/*-- Powered by Pires e Jacó - interatividade
www.piresejaco.com.br
Goiânia/Goiás/Brazil
*/
function logoff(){
location.href="login/logout.php";
}
var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")

window.defaultStatus='Centroleite +55 62 3281-4999';
function emBranco(str) {
	tamanho = str.length;
	contador = 0;
	for (x=0; x<tamanho; x++) {
		if (str.substring(x,x+1) == " ") { ++contador;}
		}
	return ((contador == tamanho) || (str == ""));
}
//
function validaMail(obj){
var email = obj.value;
var BadChars = "*|,\":<>[]{}`\'';()&$#% ";
var GoodChars = "@."; 
var posarroba = email.indexOf ('@',0);
if (email.length < 6) // o email é menor que 6 caracteres
{
   alert("\"E-mail\" inválido!"); 
   obj.focus();
   return false;
}
for (var i = 0; i < email.length; i++) 
{
   if (BadChars.indexOf(email.charAt(i)) != -1) // Contém caracteres inválidos, badchars
	{
	alert("Seu \"E-mail\" contém caracteres inválidos!");
	obj.email.value = '';
	obj.focus();
	return false;
	}
}
for (var i = 0; i < GoodChars.length; i++) 
{
	if (email.indexOf(GoodChars.charAt(i)) == -1) // não tem goodchars
	{
	alert("\"E-mail\" inválido!");
	obj.focus();
	return false;
	}
	if (email.indexOf(GoodChars.charAt(i),0) == 0) // começou com goodchars (. ou @)
	{
		alert("\"E-mail\" inválido!");
		obj.focus();
		return false;
	}
	if (email.lastIndexOf(GoodChars.charAt(i)) > email.length-3) //existe menos de 2 caracteres depois do ultimo goodchar
		{
		alert("\"E-mail\" inválido! Seu e-mail não deve terminar com @.");
		obj.focus();
		return false;
		}
}
if (email.lastIndexOf('@') > email.lastIndexOf('.')) //Não tem ponto depois do arroba
	{
	alert("\"E-mail\" inválido!");
	obj.focus();
	return false;
	}
if (email.indexOf ('@.',0) != -1 || email.indexOf ('.@',0) != -1) // . e @ colados
	{
	alert("\"E-mail\" inválido!");
	obj.focus();
	return false;
	}
if (email.indexOf ('@',posarroba+1) != -1) // Contém mais de um " @ " 
	{
	alert("\"E-mail\" inválido! Contém mais de um @");
	obj.focus();
	return false;
	}
return true;
}

var navegador = navigator.appName;
function inicio_pagina(){
	if((navegador=="Microsoft Internet Explorer") || (navegador=="Netscape")){
		if(screen.width>800){
			cols=(screen.width/2)-((775/2)*1.05);
			document.write('<div style="position:relative; top:-15px; left:'+cols+'px;">');
		}
	}
}
function fim_pagina(){
	if((navegador=="Microsoft Internet Explorer") || (navegador=="Netscape")){
		if(screen.width>800){
			document.write('</div>');
		}
	}
}

