<!--
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_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_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_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];}
}

  function limpaInput(id,saiu,texto){
        
		if (saiu==true){    
		  if (id.value=="")
			id.value = texto;
		}else{
		  if (id.value==texto) 
		  id.value = "";	  
		}


  }


  function buscaAvancada(pForm,pTabela,pPagInfo,itemAjax){
     var i = 0;
	 var vLink = '';
     while (i != pForm.length-1){
	   vLink =   vLink + '&' + pForm.elements[i].name+'='+pForm.elements[i].value;

	   i++;
	 }
	 ajaxHTML('div_busca',vHost+'ajax.php?ajax=pagebusca&tabela=' + pTabela+'&pagInfo=' + pPagInfo + vLink)
  }
  
  function postForm(pForm,pTabela,pPagInfo,fileAjax,itemAjax,pDiv,pGets){
       
        if (pGets)
          pGets = "&" + pGets.replace('>', '=');

       var i = 0;
  	 var vLink = '';
       while (i != pForm.length-1){
  	   
	   
	   if (pForm.elements[i].type=='radio'){
	     
		 if (pForm.elements[i].checked)
		   vLink =   vLink + '&' + pForm.elements[i].name+'='+pForm.elements[i].value;
       }else 		 
	     vLink =   vLink + '&' + pForm.elements[i].name+'='+pForm.elements[i].value;
		 
  	   i++;
  	 }
  	 ajaxHTML(pDiv,vHost+fileAjax+'.php?ajax='+itemAjax+'&tabela=' + pTabela+'&pagInfo=' + pPagInfo + vLink + pGets)



  }

  function carrega_comp_busca(formulario,campo,carrega_campo,gets){
    
   if (document.forms[formulario].elements[campo].value){
      gets = gets+'&valor='+document.forms[formulario].elements[campo].value;
        
      ajaxHTML(carrega_campo,gets);
    }
  }

  function carrega_comp_tabela(formulario,campo,carrega_campo,gets){
    if (document.forms[formulario].elements[campo].value){
      gets = gets+'&valor='+document.forms[formulario].elements[campo].value;

      ajaxHTML(carrega_campo,gets);
    }
  }

  function carrega_pagina_codigo(formulario,campo,tabela,tip_show,clw_codigo,pagInfo,caminho){
     var codigo = document.forms[formulario].elements[campo].value;

     window.location=caminho+'01/'+clw_codigo+'/'+pagInfo+'/'+tabela+'/'+codigo;
  }

  function carrega_pagina_list(formulario,campo,tabela,tip_show,clw_codigo,pagInfo,caminho){
     var codigo = document.forms[formulario].elements[campo].value;

     window.location=caminho+'16/'+clw_codigo+'/'+pagInfo+'/'+tabela+'/'+codigo;
  } 


  function KeyTab(){
    if (event.keyCode == 13){
      event.keyCode=9
    }
  }
  

  function AbrirJanela(caminho,titulo,width,height){

    window.open(caminho,titulo, "height = "+height+", width = "+width+"");
  }

  function GetSubStr(str, sep, pos){
    var i = 0;
    var ant = 0;
    var cont = 0;
    var z = 0;
    var aux = "";

    if (str!=''){
      i = 1;
      cont = 0;
      ant = 0;
      while ((i<=str.length)&&(cont<pos+1)){
        if (str.charAt(i)==sep){
          cont = cont+1;
          if (cont<pos+1)
            ant = i+1;
        }
        if (cont<pos+1)
          i=i+1;
      }
      i=i-1;
      txt = 'ant: '+ant+', i: '+i;
      if ((cont==(pos+1)) || (pos==cont)){
        aux = '';
  	    for(z=ant;z<=i;z++){
          aux = aux+str.charAt(z);
        }
      }
    } else
      aux = "";

    return aux;
  }

  function Trim(str){
    while (str.charAt(0) == " ")
      str = str.substr(1,str.length -1);

    while (str.charAt(str.length-1) == " ")
      str = str.substr(0,str.length-1);

    return str;
  }

  function fncReplace(str,find,repla){
    while (str.indexOf(find)!=-1){
      str = str.replace(find, repla);
    }
    return str;
  }

  function SoNumero(str){
    var i = 0;
    var aux = '';
    while (i != str.length){
        switch (str.charAt(i)){
          case '0':
          case '1':
          case '2':
          case '3':
          case '4':
          case '5':
          case '6':
          case '7':
          case '8':
          case '9':
            aux = aux+str.charAt(i);
            break;
          default:
            verifica = aux;
        }
      i++;
    }
    return (aux);
  }

  function MudaPasso(nPassos,passo,pos,campos,avancar){
    var resultado;

    if (avancar==true){
  	  resultado = verificaCampoPassos(document.forms['anunciar_tabela'],campos);
      
    }else{
      resultado = true;
    }
    if (resultado){
    for(z=0;z<nPassos;z++){
      document.getElementById(passo+z).style.zIndex=0;
      document.getElementById(passo+z).style.visibility = 'hidden' ;
      document.getElementById('passo_titulo_'+z).style.background='#f0f0f0';
      document.getElementById('passo_titulo_'+z).style.color='#000000';
    }
    document.getElementById(passo+pos).style.zIndex=1;
    document.getElementById(passo+pos).style.visibility='visible';
    document.getElementById('passo_titulo_'+pos).style.background='#B00000';
    document.getElementById('passo_titulo_'+pos).style.color='#FFFFFF';
    }
    
    return resultado;
  }
  
  function AbreHelp(help,pos,nHelps,vTexto){
      
      if (document.getElementById(help+pos).className!="div_itens_home_help"){
	    document.getElementById(help+pos).className ='div_itens_home_help';
	    document.getElementById(help+pos).innerHTML=vTexto;	
	  }else{
		document.getElementById(help+pos).innerHTML="";	
		document.getElementById(help+pos).className ='div_itens_home_help_hiddem';	  
	  }
    for(z=0;z<nHelps;z++){
      if (z!=pos){
		document.getElementById(help+z).innerHTML="";	
		document.getElementById(help+z).className ='div_itens_home_help_hiddem';
	  }
	}	  
	  
  }  
  
  
  function MudaCamada(nPassos,passo,pos){


    document.getElementById(passo+'_titulo_'+pos).className=passo+'_titulo_sel';
    document.getElementById(passo+'_conteudo_'+pos).className=passo+'_conteudo_sel';

    for(z=0;z<nPassos;z++){
      if (z!=pos){
        document.getElementById(passo+'_titulo_'+z).className=passo+'_titulo';
        document.getElementById(passo+'_conteudo_'+z).className=passo+'_conteudo';
      }

    }
    /*
    document.getElementById(passo+pos).style.zIndex=25;
    document.getElementById(passo+pos).style.visibility='visible';
    document.getElementById('passo_titulo_'+pos).style.background='#B00000';
    document.getElementById('passo_titulo_'+pos).style.color='#FFFFFF';
     */
    

  }
  
  function mudaFoto(foto,caminho) {
    document.images.img_show.src = foto;
    document.getElementById("link_img_mostra").href=caminho;
  }

function GerarSWF(arquivo,altura,largura,id, nome){
    document.writeln('<object id="globalnav-object" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + largura + '" height="' + altura + '" id="' + id + '" name="' + id + '"_flw>');
    document.writeln('        <param name="movie" value="' + arquivo + '" />');
    document.writeln('        <param name="FlashVars" value="loc=en_US&htmlApp=false&gatewayURL=gwurl" />');
    document.writeln('        <param name="bgcolor" value="#ffffff" />');
    document.writeln('        <param name="menu" value="true" />');
    document.writeln('        <param name="quality" value="high" />');
    document.writeln('        <param name="salign" value="" />');
    document.writeln('        <param name="scale" value="showall" />');
    document.writeln('        <param name="wmode" value="transparent" />'); //window
    document.writeln('        <param name="codebase" value="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" />');
    document.writeln('        <param name="pluginspage" value="http://www.macromedia.com/go/getflashplayer" />');
    document.writeln('        <param name="align" value="middle" />');
    document.writeln('        <param name="play" value="true" />');
    document.writeln('        <param name="loop" value="true" />');
    document.writeln('        <param name="devicefont" value="false" />');
    document.writeln('        <param name="name" value="'+nome+'" />');
    document.writeln('        <param name="allowScriptAccess" value="sameDomain" />');
    document.writeln('        <embed id="globalnav-embed" src="' + arquivo + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" flashvars="loc=en_US&htmlApp=false&gatewayURL=gwurl" bgcolor="#ffffff" menu="false" quality="high" salign="tl" scale="noscale" id="' + id + '" width="' + largura + '" height="' + altura + '"></embed>');
    document.writeln('</object>');
}

function GerarVideoSWF(arquivo,altura,largura,id, nome,play){
    document.writeln('    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + largura + '" height="' + altura + '" id="' + id + '" name="' + id + '">');
    document.writeln('    <param name="movie" value="FLVPlayer_Progressive.swf" />');
    document.writeln('    <param name="bgcolor" value="#000000" />');
    document.writeln('    <param name="salign" value="lt" />');
    document.writeln('    <param name="quality" value="high" />');
    document.writeln('    <param name="scale" value="noscale" />');
    document.writeln('    <param name="FlashVars" value="&skinName=clearSkin_3&streamName=' + arquivo + '&autoPlay=true&autoRewind=false" />');
    document.writeln('    <embed src="FLVPlayer_Progressive.swf" flashvars="&skinName=clearSkin_3&streamName=' + arquivo + '&autoPlay=true&autoRewind=false" quality="high" scale="noscale" width="' + largura + '" height="' + altura + '" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.writeln('    </object>');
}

  function escondeAbertura(div_superior,div_grande){
	 document.getElementById(div_superior).style.visibility  = 'hidden'; 
	 document.getElementById(div_superior).innerHTML= ""; 	 
	 document.getElementById(div_superior).style.width = "0px"; 

	 document.getElementById(div_grande).innerHTML= ""; 
	 document.getElementById(div_grande).style.visibility  = 'hidden'; 
	 document.getElementById(div_grande).style.width = "0px"; /**/
	 
	 
	 document.body.style.overflow='auto';/* */ 
  }
  
  function AbrePainel(div,div2,url,tamanho){
	 var vHtml = "";

        switch (tamanho){
          case 'extrapequeno':
			document.getElementById(div2).style.width = "200px";
			document.getElementById(div2).style.height= "150px";
            break;
          case 'pequeno':
			document.getElementById(div2).style.width = "400px";
			document.getElementById(div2).style.height= "350px";
            break;
          case 'medio':
			document.getElementById(div2).style.width = "550px";
			document.getElementById(div2).style.height= "450px";
            break;
          case 'grande':
			document.getElementById(div2).style.width = "760px";
			document.getElementById(div2).style.height= "450px";
            break;
          case 'extragrande':
			document.getElementById(div2).style.width = "1000px";
			document.getElementById(div2).style.height= "600px";
            break;
          default:

        }

	 document.getElementById(div).style.display = 'block';
	 document.body.style.overflow='hidden';

	 document.getElementById(div2).style.display = 'block';
	 	 refreshDiv(div2);

     ajaxHTML(div2,url);
  }
  
  function FechaPainel(div,div2){
	 var vHtml = "";
	 document.getElementById(div).style.display = 'none';
	 document.body.style.overflow='auto';
	 
	 document.getElementById(div2).style.display = 'none';
	 

	 //vHtml = "<div id='painel_config'></div>"
     //document.getElementById(div).innerHTML= vHtml; 	 
  }    
  
function refreshDiv(DivName){

  var vWidth = document.getElementById(DivName).style.width;
  var vHeight = document.getElementById(DivName).style.height;
  vWidth = vWidth.substr(0,vWidth.length -2)
  vHeight = vHeight.substr(0,vHeight.length -2)
  document.getElementById(DivName).style.marginLeft = "-"+(vWidth/2)+"px";
  document.getElementById(DivName).style.marginTop = "-"+(vHeight/2)+"px";
}
  
/*Adiciona Sombra a Componentes*/

var gradientshadow={}
gradientshadow.depth=6 //Depth of shadow in pixels
gradientshadow.containers=[]

gradientshadow.create=function(){
var a = document.all ? document.all : document.getElementsByTagName('*')
for (var i = 0;i < a.length;i++) {
  	if (a[i].className == "shadow") {
		for (var x=0; x<gradientshadow.depth; x++){
			var newSd = document.createElement("DIV")
			newSd.className = "shadow_inner"
			newSd.id="shadow"+gradientshadow.containers.length+"_"+x //Each shadow DIV has an id of "shadowL_X" (L=index of target element, X=index of shadow (depth)
			if (a[i].getAttribute("rel"))
				newSd.style.background = a[i].getAttribute("rel")
			else
				newSd.style.background = "black" //default shadow color if none specified
			document.body.appendChild(newSd)
		}
	gradientshadow.containers[gradientshadow.containers.length]=a[i]
	}
}
gradientshadow.position()
window.onresize=function(){
	gradientshadow.position()
}
}

gradientshadow.position=function(){
if (gradientshadow.containers.length>0){
	for (var i=0; i<gradientshadow.containers.length; i++){
		for (var x=0; x<gradientshadow.depth; x++){
  		var shadowdiv=document.getElementById("shadow"+i+"_"+x)
			shadowdiv.style.width = gradientshadow.containers[i].offsetWidth + "px"
			shadowdiv.style.height = gradientshadow.containers[i].offsetHeight + "px"
			shadowdiv.style.left = gradientshadow.containers[i].offsetLeft + x + "px"
			shadowdiv.style.top = gradientshadow.containers[i].offsetTop + x + "px"
		}
	}
}
}

if (window.addEventListener)
window.addEventListener("load", gradientshadow.create, false)
else if (window.attachEvent)
window.attachEvent("onload", gradientshadow.create)
else if (document.getElementById)
window.onload=gradientshadow.create

/**/

