jQuery(document).ready(function($) {


    $('.tab-carreiras').click(function() {
        $('.tab-carreiras').css({'font-weight':'bold'});
        $('.tab-pontos').css({'font-weight':'normal'});
        $('.tab-sip').css({'font-weight':'normal'});
        $('.content-carreiras').css({'display':'block'});
        $('.content-pontos').css({'display':'none'});
        $('.content-sip').css({'display':'none'});
        $('.tab-carreiras').addClass('activo');
        $('.tab-pontos').removeClass('activo');
        $('.tab-sip').removeClass('activo');
    });
    $('.tab-pontos').click(function() {
        $('.tab-carreiras').css({'font-weight':'normal'});
        $('.tab-pontos').css({'font-weight':'bold'});
        $('.tab-sip').css({'font-weight':'normal'});
        $('.content-carreiras').css({'display':'none'});
        $('.content-pontos').css({'display':'block'});
        $('.content-sip').css({'display':'none'});
        $('.tab-carreiras').removeClass('activo');
        $('.tab-pontos').addClass('activo');
        $('.tab-sip').removeClass('activo');
    });
    $('.tab-sip').click(function() {
        $('.tab-carreiras').css({'font-weight':'normal'});
        $('.tab-pontos').css({'font-weight':'normal'});
        $('.tab-sip').css({'font-weight':'bold'});
        $('.content-carreiras').css({'display':'none'});
        $('.content-pontos').css({'display':'none'});
        $('.content-sip').css({'display':'block'});
        $('.tab-carreiras').removeClass('activo');
        $('.tab-pontos').removeClass('activo');
        $('.tab-sip').addClass('activo');
    });
    
    
        $('#casos-rosa').css({'display':'block'});
        $('#casos-amarelo').css({'display':'none'});
        $('#casos-verde').css({'display':'none'});
        $('#casos-laranja').css({'display':'none'});
        $('li.rosa').click(function() {
            $('#casos-rosa').css({'display':'block'});
            $('#casos-amarelo').css({'display':'none'});
            $('#casos-verde').css({'display':'none'});
            $('#casos-laranja').css({'display':'none'});
        });
        $('li.amarelo').click(function() {
            $('#casos-rosa').css({'display':'none'});
            $('#casos-amarelo').css({'display':'block'});
            $('#casos-verde').css({'display':'none'});
            $('#casos-laranja').css({'display':'none'});
        });
        $('li.verde').click(function() {
            $('#casos-rosa').css({'display':'none'});
            $('#casos-amarelo').css({'display':'none'});
            $('#casos-verde').css({'display':'block'});
            $('#casos-laranja').css({'display':'none'});
        });
        $('li.laranja').click(function() {
            $('#casos-rosa').css({'display':'none'});
            $('#casos-amarelo').css({'display':'none'});
            $('#casos-verde').css({'display':'none'});
            $('#casos-laranja').css({'display':'block'});
        });

    $('.escondeDirectorio').click(function() {
        $('.footer-directorio').toggleClass('hide');
        $('#btn-directorio .seta').toggleClass('seta-cima');
    });
    
});


/* ------------------------PRINT PREVIEW------------------------ */ 
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent( function(){ add_print_link( 'nav' ) } );

function add_print_link( id ){
  if( !document.getElementById ||
      !document.getElementById( id ) ) return;

  // add extra functions to page tools list
  var print_page = document.getElementById( id );

  // create print link
  var print_function = document.createElement('p');
  print_function.className = 'print-link';
  print_function.onclick = function(){ print_preview(); return false; };
  print_function.appendChild( document.createTextNode( 'Print the Page' ) );

}

function print_preview() {
    //popupWin = window.open('<?=$_SERVER["REQUEST_URI"]?>', 'open_window', 'menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=640, height=480, left=0, top=0');
    // Switch the stylesheet
    setActiveStyleSheet('Print Preview');
    // Create preview message
    add_preview_message();
    // Print the page
    window.print();
}

function add_preview_message(){
var main_content = document.getElementById('wrap');
var main_body = main_content.parentNode;

	if (document.getElementById){
		
		var preview_message = document.createElement('div');
		preview_message.id = 'preview-message';
	
		// Create Heading
		var preview_header = document.createElement('h3');
		var preview_header_text = document.createTextNode('');
		preview_header.appendChild(preview_header_text);
		
		// Create paragraph
		var preview_para = document.createElement('p');
		var preview_para_text = document.createTextNode('');
		
		var cancel_function_link = document.createElement('a');
			cancel_function_link.onclick = function(){ cancel_print_preview(); return false; };
			cancel_function_link.setAttribute('href', '#');	
		var cancel_function_link_text = document.createTextNode('Voltar ao site');
		cancel_function_link.appendChild(cancel_function_link_text);
		preview_para.appendChild(preview_para_text); //
		preview_para.appendChild(cancel_function_link);
		
		// Put it all toegether
		preview_message.appendChild(preview_header); 
		preview_message.appendChild(preview_para);
		main_body.insertBefore(preview_message, main_content);

	}
}

function cancel_print_preview() {
	// Destroy the preview message
	var print_preview = document.getElementById('preview-message');
	var main_body = print_preview.parentNode;
	main_body.removeChild(print_preview);
	
	// Switch back stylesheet
	setActiveStyleSheet('default');
}

function setActiveStyleSheet(title) {
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
     if(a.getAttribute("rel").indexOf("style") != -1
        && a.getAttribute("title")) {
       a.disabled = true;
       if(a.getAttribute("title") == title) a.disabled = false;
     }
   }
}
/* ------------------------FIM PRINT PREVIEW------------------------ */

function addFormFieldpt() {
    var id = document.getElementById("id").value;
    jQuery("#divTxt").append("<p class='linha' id='row" + id + "'><label for='txt" + id + "'>Destinatário " + id + ":<\/label> <input type='text' size='20' name='txt[]' class='destinatario' id='txt" + id + "'> <span class='edicao'><\/span><\/p>");
    jQuery('#row' + id).highlightFade({ speed:1000 });

    jQuery('#txt' + (id-1)).addClass("readonly");
    jQuery('#txt' + (id-1)).attr("readonly",true);
    jQuery('#row' + (id-1) + ' span.edicao').replaceWith("<span class='edicao'><a href='#' class='editar' onClick='toggleReadonly("+(id-1)+"); return false;'>editar<\/a> <a href='#' onClick='removeFormField(\"#row" + (id-1) + "\"); return false;'>remover<\/a><\/span>");

    id = (id - 1) + 2;
    document.getElementById("id").value = id;
}
function addFormFielden() {
    var id = document.getElementById("id").value;
    jQuery("#divTxt").append("<p class='linha' id='row" + id + "'><label for='txt" + id + "'>Receiver " + id + ":<\/label> <input type='text' size='20' name='txt[]' class='destinatario' id='txt" + id + "'> <span class='edicao'><\/span><\/p>");
    jQuery('#row' + id).highlightFade({ speed:1000 });

    jQuery('#txt' + (id-1)).addClass("readonly");
    jQuery('#txt' + (id-1)).attr("readonly",true);
    jQuery('#row' + (id-1) + ' span.edicao').replaceWith("<span class='edicao'><a href='#' class='editar' onClick='toggleReadonly("+(id-1)+"); return false;'>edit<\/a> <a href='#' onClick='removeFormField(\"#row" + (id-1) + "\"); return false;'>remove<\/a><\/span>");

    id = (id - 1) + 2;
    document.getElementById("id").value = id;
}
function removeFormField(id) { jQuery(id).remove(); }
function toggleReadonly(id) {
    if (jQuery('#txt' + id).attr("readonly") == true) {
        jQuery('#txt' + id).removeAttr("readonly"); 
        jQuery('#txt' + id).removeClass("readonly"); 
    } else {
        jQuery('#txt' + id).addClass("readonly"); 
        jQuery('#txt' + id).attr("readonly",true); 
    }
}

/* expandir conteudo */
function expandir(escondido) {
    jQuery('#'+escondido).toggleClass('expandido');
}

jQuery(document).ready(function($) {
	$('.destino #servico').selectbox({debug: true});
});

<!--
/****************************************************
     Author: Eric King
     Url: http://redrival.com/eak/index.shtml
     This script is free to use as long as this info is left in
     Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function pops(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->

/* timer */
jQuery.fn.extend({everyTime:function(interval,label,fn,times,belay){return this.each(function(){jQuery.timer.add(this,interval,label,fn,times,belay);});},oneTime:function(interval,label,fn){return this.each(function(){jQuery.timer.add(this,interval,label,fn,1);});},stopTime:function(label,fn){return this.each(function(){jQuery.timer.remove(this,label,fn);});}});jQuery.event.special;jQuery.extend({timer:{global:[],guid:1,dataKey:"jQuery.timer",regex:/^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,powers:{ms:1,cs:10,ds:100,s:1000,das:10000,hs:100000,ks:1000000},timeParse:function(value){if(value==undefined||value==null){return null;}var result=this.regex.exec(jQuery.trim(value.toString()));if(result[2]){var num=parseFloat(result[1]);var mult=this.powers[result[2]]||1;return num*mult;}else{return value;}},add:function(element,interval,label,fn,times,belay){var counter=0;if(jQuery.isFunction(label)){if(!times){times=fn;}fn=label;label=interval;}interval=jQuery.timer.timeParse(interval);if(typeof interval!="number"||isNaN(interval)||interval<=0){return;}if(times&&times.constructor!=Number){belay=!!times;times=0;}times=times||0;belay=belay||false;var timers=jQuery.data(element,this.dataKey)||jQuery.data(element,this.dataKey,{});if(!timers[label]){timers[label]={};}fn.timerID=fn.timerID||this.guid++;var handler=function(){if(belay&&this.inProgress){return;}this.inProgress=true;if((++counter>times&&times!==0)||fn.call(element,counter)===false){jQuery.timer.remove(element,label,fn);}this.inProgress=false;};handler.timerID=fn.timerID;if(!timers[label][fn.timerID]){timers[label][fn.timerID]=window.setInterval(handler,interval);}this.global.push(element);},remove:function(element,label,fn){var timers=jQuery.data(element,this.dataKey),ret;if(timers){if(!label){for(label in timers){this.remove(element,label,fn);}}else{if(timers[label]){if(fn){if(fn.timerID){window.clearInterval(timers[label][fn.timerID]);delete timers[label][fn.timerID];}}else{for(var fn in timers[label]){window.clearInterval(timers[label][fn]);delete timers[label][fn];}}for(ret in timers[label]){break;}if(!ret){ret=null;delete timers[label];}}}for(ret in timers){break;}if(!ret){jQuery.removeData(element,this.dataKey);}}}}});jQuery(window).bind("unload",function(){jQuery.each(jQuery.timer.global,function(index,item){jQuery.timer.remove(item);});});

/* jquery.selectbox-0.5.js */
jQuery.fn.extend({selectbox:function(options){return this.each(function(){new jQuery.SelectBox(this,options);});}});if(!window.console){var console={log:function(msg){}};}jQuery.SelectBox=function(selectobj,options){var opt=options||{};opt.inputClass=opt.inputClass||"selectbox";opt.containerClass=opt.containerClass||"selectbox-wrapper";opt.hoverClass=opt.hoverClass||"current";opt.currentClass=opt.selectedClass||"selected";opt.debug=opt.debug||false;var elm_id=selectobj.id;var active=-1;var inFocus=false;var hasfocus=0;var $select=jQuery(selectobj);var $container=setupContainer(opt);var $input=setupInput(opt);$select.hide().before($input).before($container);init();$input.click(function(){if(!inFocus){$container.toggle();}}).focus(function(){if($container.not(":visible")){inFocus=true;$container.show();}}).keydown(function(event){switch(event.keyCode){case 38:event.preventDefault();moveSelect(-1);break;case 40:event.preventDefault();moveSelect(1);break;case 13:event.preventDefault();jQuery("li."+opt.hoverClass).trigger("click");break;case 27:hideMe();break;}}).blur(function(){if($container.is(":visible")&&hasfocus>0){if(opt.debug){console.log("container visible and has focus");}}else{if($.browser.msie){if(document.activeElement.getAttribute("id").indexOf("_container")==-1){hideMe();}else{$input.focus();}}else{hideMe();}}});function hideMe(){hasfocus=0;$container.hide();}function init(){$container.append(getSelectOptions($input.attr("id"))).hide();var width=$input.css("width");$container.width(width);}function setupContainer(options){var container=document.createElement("div");$container=jQuery(container);$container.attr("id",elm_id+"_container");$container.addClass(options.containerClass);return $container;}function setupInput(options){var input=document.createElement("input");var $input=jQuery(input);$input.attr("id",elm_id+"_input");$input.attr("type","text");$input.addClass(options.inputClass);$input.attr("autocomplete","off");$input.attr("readonly","readonly");$input.attr("tabIndex",$select.attr("tabindex"));return $input;}function moveSelect(step){var lis=jQuery("li",$container);if(!lis){return;}active+=step;if(active<0){active=0;}else{if(active>=lis.size()){active=lis.size()-1;}}lis.removeClass(opt.hoverClass);jQuery(lis[active]).addClass(opt.hoverClass);}function setCurrent(){var li=jQuery("li."+opt.currentClass,$container).get(0);var ar=(""+li.id).split("_");var el=ar[ar.length-1];$select.val(el).attr("selectedIndex",$container.find("li").index(li));$input.val(jQuery(li).html());return true;}function getCurrentSelected(){return $select.val();}function getCurrentValue(){return $input.val();}function getSelectOptions(parentid){var select_options=new Array();var ul=document.createElement("ul");$select.children("option").each(function(){var li=document.createElement("li");li.setAttribute("id",parentid+"_"+jQuery(this).val());li.innerHTML=jQuery(this).html();if(jQuery(this).is(":selected")){$input.val(jQuery(this).html());jQuery(li).addClass(opt.currentClass);}ul.appendChild(li);jQuery(li).mouseover(function(event){hasfocus=1;if(opt.debug){console.log("over on : "+this.id);}jQuery(event.target,$container).addClass(opt.hoverClass);}).mouseout(function(event){hasfocus=-1;if(opt.debug){console.log("out on : "+this.id);}jQuery(event.target,$container).removeClass(opt.hoverClass);}).click(function(event){var fl=jQuery("li."+opt.hoverClass,$container).get(0);if(opt.debug){console.log("click on :"+this.id);}jQuery("li."+opt.currentClass).removeClass(opt.currentClass);jQuery(this).addClass(opt.currentClass);setCurrent();hideMe();$select.change();});});return ul;}};

/* plugins galeria scroll */
function loopDestaques(tempo){jQuery(".multi-destaques").everyTime(tempo,function(){jQuery(".right").trigger("click");teste="."+(jQuery("li.chosen").attr("class")).substring(0,5);jQuery(".multi-destaques .imagem-destaques img.destaque").css({display:"none"});jQuery(".multi-destaques .texto-destaques .destaque").css({display:"none"});jQuery(".multi-destaques .imagem-destaques img.img_g").css({display:"none"});jQuery(".multi-destaques .texto-destaques .info").css({display:"none"});jQuery(teste).fadeIn("1000");jQuery(teste).css({display:"block"});jQuery(".hide").css({display:"none"});});}function stopLoopDestaques(){jQuery(".multi-destaques").stopTime();}jQuery(document).ready(function($){loopDestaques("10s");});clickMenu=function(gallery){var getImg=document.getElementById(gallery).getElementsByTagName("A");var getLi=document.getElementById(gallery).getElementsByTagName("LI");for(var i=0;i<getImg.length;i++){getImg[i].onclick=function(){var fim=getLi.length-1;if((this.className.indexOf("right"))!=-1){for(var x=0;x<getLi.length;x++){if((getLi[x].className.indexOf("chosen"))!=-1){getLi[x].className=getLi[x].className.replace("chosen","");x++;if(x<(getLi.length-1)){getLi[x].className+=" chosen";if(x<=5){getLi[x].className=getLi[x].className.replace("hide","");}if(x>5&&x<getLi.length){getLi[x].className=getLi[x].className.replace("hide","");if((getLi[x-6].className.indexOf("hide"))==-1){getLi[x-6].className+=" hide";}}}if(x==(getLi.length-1)){x=0;getLi[x].className+=" chosen";getLi[x].className=getLi[x].className.replace("hide","");getLi[1].className=getLi[1].className.replace("hide","");jQuery(getLi[1]).css({display:"block"});}}}}if((this.className.indexOf("left"))!=-1){for(var x=getLi.length-1;x>0;x--){if((getLi[x].className.indexOf("chosen"))!=-1){getLi[x].className=getLi[x].className.replace("chosen","");x--;if(x>-1){getLi[x].className+=" chosen";if(x>-1&&x<getLi.length-6){getLi[x].className=getLi[x].className.replace("hide","");if((getLi[x+6].className.indexOf("hide"))==-1){getLi[x+6].className+=" hide";}}if(x>=getLi.length-6){getLi[x].className=getLi[x].className.replace("hide","");}}}if((getLi[0].className.indexOf("chosen")==5)){if(x==fim){getLi[0].className=getLi[0].className.replace("chosen","");getLi[fim-1].className+=" chosen";var limite=fim-6;for(var y=0;y<limite;y++){getLi[y].className+=" hide";getLi[fim-y].className=getLi[fim-y].className.replace("hide","");jQuery(getLi[fim-y]).css({display:"block"});}x--;}}}}};}for(var i=0;i<getLi.length;i++){getLi[i].onclick=function(){for(var x=0;x<getLi.length;x++){if((getLi[x].className.indexOf("chosen"))!=-1){getLi[x].className=getLi[x].className.replace("chosen","");}}this.className+=" chosen";};}jQuery(document).ready(function($){$(".left").click(function(){stopLoopDestaques();loopDestaques("10s");teste="."+($("li.chosen").attr("class")).substring(0,5);$(".multi-destaques .imagem-destaques img.destaque").css({display:"none"});$(".multi-destaques .texto-destaques .destaque").css({display:"none"});$(teste).fadeIn("1000");$(".multi-destaques .imagem-destaques img.img_g").css({display:"none"});$(".multi-destaques .texto-destaques .info").css({display:"none"});$(teste).css({display:"block"});$(".hide").css({display:"none"});});$(".right").click(function(){stopLoopDestaques();loopDestaques("10s");teste="."+($("li.chosen").attr("class")).substring(0,5);$(".multi-destaques .imagem-destaques img.destaque").css({display:"none"});$(".multi-destaques .texto-destaques .destaque").css({display:"none"});$(".multi-destaques .imagem-destaques img.img_g").css({display:"none"});$(".multi-destaques .texto-destaques .info").css({display:"none"});$(teste).fadeIn("1000");$(teste).css({display:"block"});$(".hide").css({display:"none"});});});};

/* fontsize */
var min=10;var max=20;function aumentarTamanho(){if(document.getElementById("conteudos")==null){var c=document.getElementById("listagens");}else{var c=document.getElementById("conteudos");}if(c.style.fontSize){var s=parseInt(c.style.fontSize.replace("px",""));}else{var s=13;}if(s<max){s+=4;}else{if(s>=max){s=min;s+=4;}}c.style.fontSize=s+"px";if(document.getElementById("introamarelo")!=null){var d=document.getElementById("introamarelo");}else{var d="";}if(d==null){}else{if(d.style.fontSize){var t=parseInt(d.style.fontSize.replace("px",""));}else{var t=13;}if(t<max){t+=4;}else{if(t>=max){t=min;t+=4;}}d.style.fontSize=t+"px";}}

/* highlight */
jQuery.fn.highlightFade=function(settings){var o=(settings&&settings.constructor==String)?{start:settings}:settings||{};var d=jQuery.highlightFade.defaults;var i=o.interval||d.interval;var a=o.attr||d.attr;var ts={linear:function(s,e,t,c){return parseInt(s+(c/t)*(e-s));},sinusoidal:function(s,e,t,c){return parseInt(s+Math.sin(((c/t)*90)*(Math.PI/180))*(e-s));},exponential:function(s,e,t,c){return parseInt(s+(Math.pow(c/t,2))*(e-s));}};var t=(o.iterator&&o.iterator.constructor==Function)?o.iterator:ts[o.iterator]||ts[d.iterator]||ts.linear;if(d.iterator&&d.iterator.constructor==Function){t=d.iterator;}return this.each(function(){if(!this.highlighting){this.highlighting={};}var e=(this.highlighting[a])?this.highlighting[a].end:jQuery.highlightFade.getBaseValue(this,a)||[255,255,255];var c=jQuery.highlightFade.getRGB(o.start||o.colour||o.color||d.start||[255,255,128]);var s=jQuery.speed(o.speed||d.speed);var r=o["final"]||(this.highlighting[a]&&this.highlighting[a].orig)?this.highlighting[a].orig:jQuery.curCSS(this,a);if(o.end||d.end){r=jQuery.highlightFade.asRGBString(e=jQuery.highlightFade.getRGB(o.end||d.end));}if(typeof o["final"]!="undefined"){r=o["final"];}if(this.highlighting[a]&&this.highlighting[a].timer){window.clearInterval(this.highlighting[a].timer);}this.highlighting[a]={steps:((s.duration)/i),interval:i,currentStep:0,start:c,end:e,orig:r,attr:a};jQuery.highlightFade(this,a,o.complete,t);});};jQuery.highlightFade=function(e,a,o,t){e.highlighting[a].timer=window.setInterval(function(){var newR=t(e.highlighting[a].start[0],e.highlighting[a].end[0],e.highlighting[a].steps,e.highlighting[a].currentStep);var newG=t(e.highlighting[a].start[1],e.highlighting[a].end[1],e.highlighting[a].steps,e.highlighting[a].currentStep);var newB=t(e.highlighting[a].start[2],e.highlighting[a].end[2],e.highlighting[a].steps,e.highlighting[a].currentStep);jQuery(e).css(a,jQuery.highlightFade.asRGBString([newR,newG,newB]));if(e.highlighting[a].currentStep++>=e.highlighting[a].steps){jQuery(e).css(a,e.highlighting[a].orig||"");window.clearInterval(e.highlighting[a].timer);e.highlighting[a]=null;if(o&&o.constructor==Function){o.call(e);}}},e.highlighting[a].interval);};jQuery.highlightFade.defaults={start:[255,255,128],interval:50,speed:400,attr:"backgroundColor"};jQuery.highlightFade.getRGB=function(c,d){var result;if(c&&c.constructor==Array&&c.length==3){return c;}if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c)){return[parseInt(result[1]),parseInt(result[2]),parseInt(result[3])];}else{if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c)){return[parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55];}else{if(result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c)){return[parseInt("0x"+result[1]),parseInt("0x"+result[2]),parseInt("0x"+result[3])];}else{if(result=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c)){return[parseInt("0x"+result[1]+result[1]),parseInt("0x"+result[2]+result[2]),parseInt("0x"+result[3]+result[3])];}else{return jQuery.highlightFade.checkColorName(c)||d||null;}}}}};jQuery.highlightFade.asRGBString=function(a){return"rgb("+a.join(",")+")";};jQuery.highlightFade.getBaseValue=function(e,a,b){var s,t;b=b||false;t=a=a||jQuery.highlightFade.defaults.attr;do{s=jQuery(e).css(t||"backgroundColor");if((s!=""&&s!="transparent")||(e.tagName.toLowerCase()=="body")||(!b&&e.highlighting&&e.highlighting[a]&&e.highlighting[a].end)){break;}t=false;}while(e=e.parentNode);if(!b&&e.highlighting&&e.highlighting[a]&&e.highlighting[a].end){s=e.highlighting[a].end;}if(s==undefined||s==""||s=="transparent"){s=[255,255,255];}return jQuery.highlightFade.getRGB(s);};jQuery.highlightFade.checkColorName=function(c){if(!c){return null;}switch(c.replace(/^\s*|\s*$/g,"").toLowerCase()){case"aqua":return[0,255,255];case"black":return[0,0,0];case"blue":return[0,0,255];case"fuchsia":return[255,0,255];case"gray":return[128,128,128];case"green":return[0,128,0];case"lime":return[0,255,0];case"maroon":return[128,0,0];case"navy":return[0,0,128];case"olive":return[128,128,0];case"purple":return[128,0,128];case"red":return[255,0,0];case"silver":return[192,192,192];case"teal":return[0,128,128];case"white":return[255,255,255];case"yellow":return[255,255,0];}};

/* jmp3 */
jQuery.fn.jmp3=function(passedOptions){var playerpath="/plugins/musica/";var options={filepath:"/plugins/musica/",backcolor:"",forecolor:"ffffff",width:"25",repeat:"no",volume:"50",autoplay:"false",showdownload:"false",showfilename:"false"};if(passedOptions){jQuery.extend(options,passedOptions);}return this.each(function(){var filename=options.filepath+jQuery(this).html();var validfilename=filename.indexOf(".mp3");if(validfilename==-1){return false;}var mp3html='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';mp3html+='width="'+options.width+'" height="20" ';mp3html+='codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">';mp3html+='<param name="movie" value="'+playerpath+"singlemp3player.swf?";mp3html+="showDownload="+options.showdownload+"&file="+filename+"&autoStart="+options.autoplay;mp3html+="&backColor="+options.backcolor+"&frontColor="+options.forecolor;mp3html+="&repeatPlay="+options.repeat+"&songVolume="+options.volume+'" />';mp3html+='<param name="wmode" value="transparent" />';mp3html+='<embed wmode="transparent" width="'+options.width+'" height="20" ';mp3html+='src="'+playerpath+"singlemp3player.swf?";mp3html+="showDownload="+options.showdownload+"&file="+filename+"&autoStart="+options.autoplay;mp3html+="&backColor="+options.backcolor+"&frontColor="+options.forecolor;mp3html+="&repeatPlay="+options.repeat+"&songVolume="+options.volume+'" ';mp3html+='type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';mp3html+="</object>";if(options.showfilename=="false"){jQuery(this).html("");}jQuery(this).prepend(mp3html+"&nbsp;");if(jQuery.browser.msie){this.outerHTML=this.outerHTML;}});};

jQuery(document).ready(function($){ $(".mp3").jmp3(); });
