function fecha(){ 
document.getElementById('flash').style.display='none'; }

function indique(theURL,winName,features) { //v2.0
  window.open('indique.asp','','width=400,height=400');
}
var URLSite = window.location.href;
var TituloSite = document.title;
function addfav()
{
	str_titulo = TituloSite;
	str_url = URLSite;
	//FireFox
	if (window.sidebar)
		{
    		window.sidebar.addPanel(str_titulo, str_url,"");
		}
	//IE
	else if( window.external )
		{
  	  		window.external.AddFavorite( str_url, str_titulo);
		}
	//Opera
	else if(window.opera && window.print)
		{
    		return true;
		}
}

function val_newsletter(){
d=document.form_newsletter
//validar nome
if(d.f_nome.value ==""||d.f_nome.value=='nome'){
alert("Por favor, informe seu nome")
d.f_nome.focus();
return false;
}
//validar email (verificação de endereço eletrônico)
parte1 = d.p_mail.value.indexOf("@");
parte2 = d.p_mail.value.indexOf(".");
parte3 = d.p_mail.value.length;
if(!(parte1 >= 3&& parte2 >= 6 && parte3 >= 9)){
alert("O campo e-mail deve conter um endereço de e-mail válido")
d.p_mail.focus();
return false;
}
return true;
}

function val_busca(){
d=document.busca_ac
//validar busca
if(d.f_busca.value ==""||d.f_busca.value=='busca no site'){
alert("insira um ou mais termos para a busca")
d.f_busca.focus();
return false;
}
return true;
}
/*limpa campos selecionados (onfocus)*/
function clearDefault(el) {
if (el.defaultValue==el.value) el.value = ""
}

startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("primary-nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace
	(" over", "");
   }
   }
  }
 }
}
window.onload=startList;
/*Valida campos área de acesso exclusivo*/
function val_admin(){
d=document.form_admin

//validar USUÁRIO
if(d.f_login.value ==""){
alert("Por favor, informe o LOGIN!")
d.f_login.focus();
return false;
}
//validar SENHA
if(d.f_senha.value ==""){
alert("Por favor, informe a SENHA!")
d.f_senha.focus();
return false;
}
return true;
}

function inclui_usuario(){
d=document.form_inc
if(d.f_login.value ==""){
alert("Favor preencher o campo LOGIN (nome ou apelido para acesso ao site)")
d.f_login.focus();
return false;
}
if(d.f_senha.value ==""){
alert("Favor preencher o campo SENHA")
d.f_senha.focus();
return false;
}
if(d.f_senha2.value ==""){
alert("Favor confirmar a senha inserida repetindo-a")
d.f_senha2.focus();
return false;
}
/*if(d.f_senha2.value !==d.f_senha.value){
alert("as senhas não são iguais, por favor tente novamente")
d.f_senha2.focus();
return false;
}*/
if(d.f_nome.value ==""){
alert("Favor preencher o campo NOME")
d.f_nome.focus();
return false;
}
//validar email (verificação de endereço eletrônico)
parte1 = d.p_mail.value.indexOf("@");
parte2 = d.p_mail.value.indexOf(".");
parte3 = d.p_mail.value.length;
if(!(parte1 >= 3&& parte2 >= 6 && parte3 >= 9)){
alert("O campo e-mail deve conter um endereço de e-mail válido")
d.p_mail.focus();
return false;
}
return true;
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);

}
function inclui_cat(){
d=document.form_inc
if(d.f_titulo.value ==""){
alert("Favor preencher o campo TITULO")
d.f_titulo.focus();
return false;
}
return true;
}

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; }
}
