//IMAGENS RODANDO NA HOME
hoje = new Date();
 numero_b = 3; // numero de banners a rodar...
 segundos = hoje.getSeconds();
 numero = segundos % numero_b;
 if (numero == 0)
 {
 banner    = "home_chamadab.jpg";
 }
 if (numero == 1){
 banner    = "home_chamada02b.jpg";
 }
  if (numero == 2){
 banner    = "home_chamada03b.jpg";
 }
 function imagemdestaque()
 {
 document.write('<a href="galeriadefotos1.php"><img src="imagens/' + banner + '" alt="Clique aqui e confira as melhores imagens da Equipe Petrobras Lubrax" border="0"></a>');
 }


//FUNÇÃO PARA VALIDAR OS FORMULÁRIOS NO SITE
function validaForm(){
		//validar nome
		d = document.cadastro;
		if (d.nome.value == ""){
			alert("O campo " + d.nome.name + " deve ser preenchido!");
			d.nome.focus();
			return false;
		}
		
		//validar email
		if (d.email.value == ""){
			alert("O campo " + d.email.name + " deve ser preenchido!");
			d.email.focus();
			return false;
		}
		//validar email(verificao de endereco eletronico)
		parte1 = d.email.value.indexOf("@");
		parte2 = d.email.value.indexOf(".");
		parte3 = d.email.value.length;
		if (!(parte1 >= 2 && parte2 >= 2 && parte3 >= 9)) {
			alert("O campo " + d.email.name + " deve ser conter um endereco eletronico!");
			d.email.focus();
			return false;
		}
		//validar telefone
		if (d.telefone.value == ""){
			alert("O campo " + d.telefone.name + " deve ser preenchido!");
			d.telefone.focus();
			return false;
		}
		//validar telefone(verificacao se contem apenas numeros)
		if (isNaN(d.telefone.value)){
			alert("O campo " + d.telefone.name + " deve conter apenas numeros!");
			d.telefone.focus();
			return false;
		}
		
		return true;
	}
	

//FUNÇÃO PARA ABRIR A FOTO GRANDE DA GALERIA DE FOTOS EM BAIXA RESOLUÇÃO
function horizontal(src,fotografo,comentario,download)
                 {
                text = ("<html><head><title>Site Oficial Equipe Petrobras Lubrax</title></head><link href='brasildakar.css' type='text/css' rel='stylesheet'><body><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td width='100%' align='center'>");
                text = (text + "<center><table border='0' cellpadding='10' cellspacing='0' width='85%' bgcolor='#ffffff' height=80%><tr><td align='center'><div class='h0'>( <a href='../img/" + download + "' target='_blank'>clique aqui e faça download desta imagem em <strong>alta resolução</strong></a> )</div><img src='../img/" + src + "' border='5' style='border-color:#FFFFFF;'><br><div class='h0'><strong>");
                text = (text + comentario + "</strong><br />Crédito: " + fotografo + "<br /><a href='javascript:self.close();'>(fechar)</a></div></td></tr></table></body></html>");
                msgWindow=window.open("","displayWindow2","toolbar=no,directories=no,status=yes,width=650,height=450,location=no,scrollbars=yes,resize=no,menubar=no")
                msgWindow.document.write(text)
                msgWindow.document.close()
                }

//FUNÇÃO PARA O PULLDOWN DE GALERIA ABRIR AUTOMATICAMENTE UMA PÁGINA		
function goURL(){
if (document.formURL.selectURL.options[document.formURL.selectURL.selectedIndex].value != "escolha") {
parent.document.location = document.formURL.selectURL.options[document.formURL.selectURL.selectedIndex].value
		}
else { 
        return false; }
	}
	
function goURL2(){
if (document.formURL2.selectURL2.options[document.formURL2.selectURL2.selectedIndex].value != "escolha") {
parent.document.location = document.formURL2.selectURL2.options[document.formURL2.selectURL2.selectedIndex].value
		}
else { 
        return false; }
	}	
	
function goURL3(){
if (document.formURL3.selectURL3.options[document.formURL3.selectURL3.selectedIndex].value != "escolha") {
parent.document.location = document.formURL3.selectURL3.options[document.formURL3.selectURL3.selectedIndex].value
		}
else { 
        return false; }
	}		
	
	
//FUNÇÃO PARA ABRIR O PAPEL DE PAREDE
function pdeparede(src,fotografo,comentario)
                 {
                text = ("<html><head><title>Site Oficial Equipe Petrobras Lubrax</title></head><link href='brasildakar.css' type='text/css' rel='stylesheet'><body><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td width='100%' align='center'>");
                text = (text + "<center><table border='0' cellpadding='10' cellspacing='0' width='85%' height=80%><tr><td align='center'><div class='h0'><a href='javascript:self.close();'><font color='#FFFFFF'>(fechar)</font></a><br><br><img src='imagens/" + src + "' border='5' style='border-color:#FFFFFF;'><br>");
                text = (text + comentario + "</b><br>"  + fotografo + "<br><a href='javascript:self.close();'><font color='#FFFFFF'>(fechar)</font></a></div></td></tr></table></body></html>");
                msgWindow=window.open("","displayWindow2","toolbar=no,directories=no,status=yes,fullscreen,location=no,scrollbars=yes,resize=no,menubar=no")
                msgWindow.document.write(text)
                msgWindow.document.close()
                }
				
				
//FUNÇÃO PARA ABRIR O POP-UP DE PATROCINADORES
	function openWin( windowURL, windowName, windowFeatures ) { 
		return window.open( windowURL, windowName, windowFeatures ) ; 
	} 
