function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function showOrHide(elemento,f){
	if(f){
		visi="visible";
	} else { 
		visi="hidden";
	}
		
	if(document.layers){
		document.elemento.visibility = visi;
	}
	
	if(document.all){
		document.getElementById(elemento).style.visibility = visi;
	}
	
	if(document.getElementById){
		document.getElementById(elemento).style.visibility = visi;
	}
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/**********************************/
/* controle da foto rotativa */
var iDelaySlide = 10000 ; // ms
var iDelayOpacity = 80 ; // ms
var rotate_index = 0 ; // int
var rotate_interval = null ;
var timer = null ;

function rreload(){
	if( !document.getElementById ){
		return ;
	}

	rotate_index += 1 ;
	if( rotate_index < 0 ) rotate_index = aJJBA.length - 1;
	if( rotate_index > aJJBA.length - 1) rotate_index =  0;

	if ( rotate_interval ){
		rpause() ;
	}
}

function rnav( iPos ){

	if( !document.getElementById ){
		return ;
	}	
	rotate_index += iPos ;
	if (rotate_index == 0) { document.getElementById("retornar").style.visibility="hidden"; document.getElementById("avancar").style.visibility="visible";}
	if (rotate_index == 1) { document.getElementById("retornar").style.visibility="visible"; document.getElementById("avancar").style.visibility="visible";}
	if (rotate_index == 2) { document.getElementById("retornar").style.visibility="visible"; document.getElementById("avancar").style.visibility="visible";}
	if (rotate_index == 3) { document.getElementById("retornar").style.visibility="visible"; document.getElementById("avancar").style.visibility="hidden";}	
	
	if( rotate_index < 0 ) rotate_index = aJJBA.length - 1;
	if( rotate_index > aJJBA.length - 1) rotate_index =  0;

	if ( rotate_interval ){
		rpause() ;
	}

	if ( timer ){
		jjba_opcty(100);
	}

	with( document ) {
		var el_img  = getElementById( "ju_img" );
		var el_ftr  = getElementById( "ju_ftr" );
		var el_lnk1 =  getElementById( "ju_link1" );
		var el_lnk2 =  getElementById( "ju_link2" );
	}

	if ( aJJBA && aJJBA.length > rotate_index ){
		el_img.src = aJJBA[rotate_index][1];
		el_lnk1.href = aJJBA[rotate_index][2];
		el_lnk2.href = aJJBA[rotate_index][2];
		el_ftr.innerHTML = aJJBA[rotate_index][3];
		el_img.alt = aJJBA[rotate_index][3];
		
		if ( aJJBA[rotate_index][4] && aJJBA.length > rotate_index && aJJBA[rotate_index][4] == 'PUBLICIDADE' ){
			el_lnk1.target = '_blank';
			el_lnk2.target = '_blank';
		}
	}
	jjba_opcty(10);
}

function jjba_opcty( iOpacity ){
	var curLayer = document.getElementById('ju_img');
	iOpacity == null ? iOpacity = 0 : iOpacity += 10;
	curLayer.style.opacity = iOpacity / 100 ;
	curLayer.style.filter = 'alpha(opacity=' + iOpacity + ')';
	if( iOpacity < 100 ) {
		timer = setTimeout('jjba_opcty(' + iOpacity + ')', iDelayOpacity);
	} else {
		clearTimeout(timer);
		timer = null ;
		jjba_reset();
	}
}

function jjba_reset(){
	var iOpacity = 99;
	var curLayer = document.getElementById('ju_img');
	curLayer.style.opacity = (iOpacity / 100);
	curLayer.style.filter = 'alpha(opacity=' + iOpacity + ')';
}

function jjba_preload(a){
	var d = document;
	if(d.images) {
		if(!d.mm) d.mm = new Array();
		var i, j = d.mm.length ;
		for( i = 0; i < a.length; i++ ){
			if ( a[i][1].indexOf("#") != 0 ){
				d.mm[j] = new Image;
				d.mm[j++].src   = a[i][1];
			}
		}
	}
}

function Ativar(elemento,classe){
	//if ( $(elemento).className == '' ) {
	//$(elemento).removeClassName('institucional');
		$(elemento).addClassName(classe);
	//}	
}

function AtivarInstitucional(elemento,classe){
	if ( $(elemento).className == 'institucional' ) {
		$(elemento).removeClassName('institucional');
		$(elemento).addClassName(classe);
	}	
}

function DesativarInstitucional(elemento,classe){
	if ( $(elemento).className == 'institucional-ativo' ) { 
		 $(elemento).removeClassName('institucional-ativo');
		 $(elemento).addClassName(classe);
	}
}


function AtivarContato(elemento,classe){
	if ( $(elemento).className == 'contato' ) {
		$(elemento).removeClassName('contato');
		$(elemento).addClassName(classe);
	}	
}
function DesativarContato(elemento,classe){
	if ( $(elemento).className == 'contato-ativo' ) { 
		 $(elemento).removeClassName('contato-ativo');
		 $(elemento).addClassName(classe);
	}
}

function TextArea(elemento,classe){
	if ( document.getElementById(elemento) == "" ) {
		document.getElementById(elemento).removeClassName(classe);
	} else {
	//if ( document.getElementById(elemento)  == "" ) { 
		document.getElementById(elemento).addClassName(classe);
	}
}
jQuery(document).ready(function(){
    var text = jQuery(".produtos p span").html();
    /*
	jQuery(".produtos p").attr({
        class: "",
        style: ""
    })
    jQuery(".produtos p span").attr({
        class: "",
        style: "font-size:12px;"
    })
	*/
	if($(".produtos p")!=null){
		$(".produtos p").attr('class','');
		$(".produtos p").attr('style','');	
	    $(".produtos p span").attr('style',"font-size:12px;");
		$(".produtos p span").attr('class','');	
	}
    //jQuery(".produtos p span").parent().html(text);
})

