<!--
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_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 validaLogin() {
                CNPJ = document.getElementById('login').value;
                erro = new String;
				
				if (CNPJ.length == 0) return true;		
                 if (CNPJ.length < 14) erro = "CNPJ invalido! \n\n";
                 if ((CNPJ.charAt(2) == ".") || (CNPJ.charAt(6) == ".") || (CNPJ.charAt(10) == "/") || (CNPJ.charAt(15) == "-")){
                 if (erro.length == 0) erro = "CNPJ invalido! \n\n";
                }
                 
               var nonNumbers = /\D/;
               if (nonNumbers.test(CNPJ)) erro += "A verificação de CNPJ suporta apenas números! \n\n";
               var a = [];
               var b = new Number;
               var c = [6,5,4,3,2,9,8,7,6,5,4,3,2];
              for (i=0; i<12; i++){
                       a[i] = CNPJ.charAt(i);
                       b += a[i] * c[i+1];
 }
               if ((x = b % 11) < 2) { a[12] = 0 } else { a[12] = 11-x }
               b = 0;
               for (y=0; y<13; y++) {
                       b += (a[y] * c[y]);
               }
               if ((x = b % 11) < 2) { a[13] = 0; } else { a[13] = 11-x; }
               if ((CNPJ.charAt(12) != a[12]) || (CNPJ.charAt(13) != a[13])){
                       erro ="CNPJ invalido!!";
               }
               if (erro.length > 0){
                       alert(erro);
					   document.getElementById('login').value='';
					   document.getElementById('login').focus();
                       return false;
               } else {
                       seila=2;
					  
               }
           return true;
   }


function validaCNPJ() {
                CNPJ = document.getElementById('cnpj').value;
                erro = new String;
				
				if (CNPJ.length == 0) return true;		
                 if (CNPJ.length < 14) erro = "CNPJ invalido! \n\n";
                 if ((CNPJ.charAt(2) == ".") || (CNPJ.charAt(6) == ".") || (CNPJ.charAt(10) == "/") || (CNPJ.charAt(15) == "-")){
                 if (erro.length == 0) erro = "CNPJ invalido! \n\n";
                }
                 
               var nonNumbers = /\D/;
               if (nonNumbers.test(CNPJ)) erro += "A verificação de CNPJ suporta apenas números! \n\n";
               var a = [];
               var b = new Number;
               var c = [6,5,4,3,2,9,8,7,6,5,4,3,2];
              for (i=0; i<12; i++){
                       a[i] = CNPJ.charAt(i);
                       b += a[i] * c[i+1];
 }
               if ((x = b % 11) < 2) { a[12] = 0 } else { a[12] = 11-x }
               b = 0;
               for (y=0; y<13; y++) {
                       b += (a[y] * c[y]);
               }
               if ((x = b % 11) < 2) { a[13] = 0; } else { a[13] = 11-x; }
               if ((CNPJ.charAt(12) != a[12]) || (CNPJ.charAt(13) != a[13])){
                       erro ="CNPJ invalido!!";
               }
               if (erro.length > 0){
                       alert(erro);
					   document.getElementById('cnpj').value='';
                       return false;
               } else {
                       seila=2;
					  
               }
           return true;
   }



function CarregaJingle(valor){
		
		ajaxHTMLtxt('carregasom','campanhas/jingle'+valor+'.htm');
	}      

function EnviaComentarioEnquete(){
	
	if(document.getElementById('comentario').value == ''){
		alert('Voce deve preencher o campo comentário.');
	}else{
		document.getElementById('fcomentario').submit();
		alert('Comentário enviado.');
		
		}
	}

function ExcluirProduto(id){
	var id,nome;
	nome='at_qt['+id+']';
	
	document.getElementById(nome).value = '0';
	formatualiza.submit()
	
	}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function NovaSenha(){
	var login,email;
	login=document.getElementById('login').value;
	email=document.getElementById('email').value;
	ajaxHTML('divsenha','index_ajax.php?secao=novasenha&login='+login+'&email='+email);
	document.getElementById('login').value = '';
	document.getElementById('email').value = '';
	
	}
	
function MostraAjuda(id){
	var id;
	
	ajaxHTML('divajuda','index_ajax.php?secao=ajudaretorno&id='+id);
	
	
	}
	
function DetPedido(id){
	var id;
	
	ajaxHTML('divpedido','index_ajax.php?secao=detpedido&id='+id);
	
	
	}

function EnviaCurriculo(id_vaga){
	var id_vaga;
	
		MM_openBrWindow('index_ajax.php?secao=curriculo&id_vaga='+id_vaga,'','status=yes,width=400,height=160');
	
	}

function Zoom(imagem){
	
	ajaxHTMLoff('Zoom'+imagem,'index_ajax.php?secao=zoom&imagem='+imagem);
	
	
	}
function FechaZoom(imagem){
	
	
	ajaxHTMLoff('Zoom'+imagem,'clean.htm');
	
	}
	
function Preco(imagem){
	
	ajaxHTMLoff('Zoom'+imagem,'index_ajax.php?secao=loginpop&imagem='+imagem);
	
	
	}

function Aviseme(imagem){
	
	ajaxHTMLoff('Zoom'+imagem,'index_ajax.php?secao=aviseme&imagem='+imagem);
	
	
	}

function Busca(evtKeyPress){

	 var i, nTecla;
	if(document.all) { // Internet Explorer
        nTecla = evtKeyPress.keyCode;
		 }
      else if(document.layers) { // Nestcape
        nTecla = evtKeyPress.which;
      }
	  
	  if (nTecla == 13){
	  	formbusca.submit();
	  }


}

function AdicionaProduto(cod){
	var cod,quantidade;
	
		quantidade = document.getElementById('qt_'+cod).value;
		meuInteger = parseInt(quantidade);
		
		if(isNaN(meuInteger) || meuInteger == 0 || meuInteger < 0){
			alert('Quantidade Invalida');
			//
		}else{
			ajaxHTMLoff('off','index_ajax.php?secao=carrinho&produto='+cod+'&quantidade='+meuInteger);
			alert('Produto incluido no carrinho de compras');
			document.getElementById('qt_'+cod).value='01';
			}
	
	}

//ENQUETE

function Resultado(){
		MM_openBrWindow('index_ajax.php?secao=resultado','','status=yes,width=400,height=160');
	
	}

function Votar(){
	var id;
	id = document.getElementById('meuvoto').value;
	ajaxHTML('Zoommenu','index_ajax.php?secao=enquete&voto='+id);
	Resultado();
	
	}
function SetaVoto(id){
	var id;
	document.getElementById('meuvoto').value = id;
	
	}