// Abre Pop Up
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// Vai para a URL
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

// Áreas restritas
function mostrarAreaRestrita(quem){
	document.getElementById(quem).style.display = "";
}

function esconderAreaRestrita(quem){
	document.getElementById(quem).style.display = "none";
}

function ativarAreaRestrita(quem){
	document.getElementById(quem).style.backgroundColor = "F4751B";
	document.getElementById(quem).style.color = "FFFFFF";
}

function desativarAreaRestrita(quem){
	document.getElementById(quem).style.backgroundColor = "";
	document.getElementById(quem).style.color = "D36719";
}

// Conteúdo
function mostrarConteudo(quem){
	if (document.getElementById(quem).style.display == "")
		document.getElementById(quem).style.display = "none";
	else
		document.getElementById(quem).style.display = "";		
}

// Abre Pop Up
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// Valida E-mail
function validaEmail(str) {
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	
	if (str.indexOf(at)==-1){
	   alert("E-mail inválido!")
	   return false
	}
	
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert("E-mail inválido!")
	   return false
	}
	
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		alert("E-mail inválido!")
		return false
	}
	
	 if (str.indexOf(at,(lat+1))!=-1){
		alert("E-mail inválido!")
		return false
	 }
	
	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		alert("E-mail inválido!")
		return false
	 }
	
	 if (str.indexOf(dot,(lat+2))==-1){
		alert("E-mail inválido!")
		return false
	 }
	
	 if (str.indexOf(" ")!=-1){
		alert("E-mail inválido!")
		return false
	 }
	
	 return true					
}
