function validaTecla(obj)
{
 	var tecla;
 	if(navigator.appName.indexOf("Netscape")!= -1)
 		 tecla=event.which;
 	else
 		 tecla=event.keyCode;
 	bOk=false
 	switch (tecla)
 	{
  		case 8:
   			bOk=true
   			break;
 	}
 	return bOk
}
function limite(obj,n)
{
	return (obj.value.length<n)
}
function maximizada(endereco)
{
	window.open(endereco,'janela','width='+(window.screen.width-10)+',height='+(window.screen.height-56)+',top=0,left=0,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no');
}
function maximizadabarra(endereco,nome)
{
	window.open(endereco,nome,'width='+(window.screen.width-10)+',height='+(window.screen.height-56)+',top=0,left=0,menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=no');
}
function janela(pagina,nome,largura,altura)
{
	window.open(pagina,nome,"left="+(window.screen.width-largura)/2+",top="+(window.screen.height-altura)/2+",width="+largura+",height="+altura+",resizable=no,scrollbars=no")	
}
function janelabarra(pagina,nome,largura,altura)
{
	window.open(pagina,nome,"left="+(window.screen.width-largura)/2+",top="+(((window.screen.height-altura)/2)+17)+",width="+largura+",height="+altura+",resizable=no,scrollbars=yes")	
}
//**************************************
function isGeral(caractere,s)   
{ var strValidos = s   
	if ( strValidos.indexOf( caractere ) == -1 )   
		return false; 
	return true;   
}  
//**************************************
function validaGeral(campo, event, s, bEnter)  
{ var key;   
	var tecla;
	CheckTAB=true;   
	if(navigator.appName.indexOf("Netscape")!= -1)  
		tecla=event.which;  
	else   
		tecla=event.keyCode;   
	key = String.fromCharCode(tecla);
	if (tecla==13)  
		return bEnter;  
	if (tecla==8)   
		return true;   
	return (isGeral(key,s)); 
}        
// "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZáéíóúÁÉÍÓÚñÑâêôÂÊÔÃãõÕüÜ: /." 
function validaemail(obj)
{
	s=obj.value
	if (s!="")
	{
		antes=s.substr(0,s.indexOf("@"))
		depois=s.substr(s.indexOf("@")+1,s.length)
		depoisponto=depois.substr(depois.indexOf(".")+1,depois.length)	
		if ((depois.indexOf(".")==-1)||(depois.indexOf("@")!=-1)||(depoisponto.length==0))
		{		
			alert("Informe o e-mail corretamente")
			obj.focus()
			return false
		}
	}else{
		alert("Informe o e-mail corretamente")
		obj.focus()
		return false
	}
	return true
}
