<!-- 
function validaEmail(strEmail) 
{
	if (strEmail.indexOf("@")==-1){
		alert("O e-mail '" + strEmail + "' está incorreto.");
		return false;
		}
	if (strEmail.indexOf("@.")!=-1){
		alert("O e-mail '" + strEmail + "' está incorreto.");
		return false;
		}
	if (strEmail.indexOf(".@")!=-1){
		alert("O e-mail '" + strEmail + "' está incorreto.");
		return false;
		}
	if (strEmail.indexOf(".")==-1){
		alert("O e-mail '" + strEmail + "' está incorreto.");
		return false;
		}
	if (strEmail.indexOf("..")!=-1){
		alert("O e-mail '" + strEmail + "' está incorreto.");
		return false;
		}
	if (strEmail.charAt(strEmail.length - 1) == "."){
		alert("O e-mail '" + strEmail + "' está incorreto.");
		return false;
		}
	if (strEmail.charAt(0) == "."){
		alert("O e-mail '" + strEmail + "' está incorreto.");
		return false;
		}

	var Erro = 0
	for (i=0 ; i < strEmail.length ; i++)
	{
		if (strEmail.charCodeAt(i) != 95 && ((strEmail.charCodeAt(i) < 45) || (strEmail.charCodeAt(i) == 47) || ((strEmail.charCodeAt(i) > 57) && (strEmail.charCodeAt(i) < 64)) || ((strEmail.charCodeAt(i) > 90) && (strEmail.charCodeAt(i) < 97)) || (strEmail.charCodeAt(i) > 122)))
		{
			Erro = 1
			i = strEmail.length
		}
	}
	if (Erro == 1)
	{
		alert('Caracteres inválidos no e-mail "' + strEmail + '".')
		return false
	}
	return true
}		

// Tira aspas
function Aspas(pInteiro, oCampo)
{
 if (event.keyCode == 34) 
  {
	event.returnValue = false;
	 	
  }
}

// Evita espaço (campo vazio)
function vazio(texto) {
	if(document.activeElement.tagName == 'INPUT') {
		for(i=0; i < texto.length; i++)
			if(texto.charAt(i) != ' ')
				return false;
		return true;
	}
	else
		return false;		
}

/*
Permite somente digitar números. Se passar o parâmetro
pInteiro true permite inclusão de 1 ponto também.
*/
function OnlyNumber(pInteiro, oCampo)
{	 
  if ((event.keyCode < 48) || (event.keyCode > 57)) 
  {
	if  (pInteiro == false)
	{
 		if ((event.keyCode != 46) && (event.keyCode != 45))  // ponto 
 	  		event.returnValue = false;
 		else
 		{
	 		if (event.keyCode == 45) 
	 		{
				//if (oCampo.value.indexOf("-") >= 0)
 	 			event.returnValue = false;
 	 		}
 	 		if (event.keyCode == 46) 
 	 		{
	 			//if (oCampo.value.indexOf(".") >= 0)
 	 			event.returnValue = false;
 	 		}
 	 	}
 	 }
 	 else{
 		if (event.keyCode != 46)
 			event.returnValue = false;
 		if (event.keyCode == 46) 
 	 		{
 	 			if (oCampo.value.indexOf(".") >= 0)
 	 			event.returnValue = false;
 	 		}
	 	 	
 	 }
  }
}


/*
Permite somente digitar números. Se passar o parâmetro
pInteiro true permite inclusão de 1 ponto também.
*/
function OnlyNumber2(pInteiro, oCampo)
{	 

  if ((event.keyCode < 48) || (event.keyCode > 57)) 
  {
	if  (pInteiro == false)
	{
	
 		if ((event.keyCode != 46) && (event.keyCode != 45) && (event.keyCode != 44))  // ponto 
 	  		event.returnValue = false;
 		else
 		{
	 		if (event.keyCode == 45) 
	 		{
				//if (oCampo.value.indexOf("-") >= 0)
 	 			event.returnValue = false;
 	 		}
 	 		if (event.keyCode == 46) 
 	 		{
	 			//if (oCampo.value.indexOf(".") >= 0)
 	 			event.returnValue = false;
 	 		}
 	 		if (event.keyCode == 44) 
 	 		{
	 			//if (oCampo.value.indexOf(".") >= 0)
 	 			event.returnValue = false;
 	 		}
 	 	}
 	 }
 	 else{
 	
 		if ((event.keyCode != 46) && (event.keyCode != 44))
 			event.returnValue = false;
 		if (event.keyCode == 44) 
 	 		{
 	 			if (oCampo.value.indexOf(",") >= 0)
 	 			event.returnValue = false;
 	 		}
	 	 	
 	 }
  }
}

function pula_campo(campo,campo2,tamanho)
{
	var campo = eval("document.form1."+campo);
	var proximo;
	proximo = eval("document.form1."+campo2);
	if (campo.value.length == tamanho)
	{
		proximo.focus();
		return false;
	}
	return false;
}

function pula_campo2(form,campo,campo2,tamanho)
{
	var proximo;
	proximo = eval("document."+form+"."+campo2);
	if (campo.value.length == tamanho)
	{
		proximo.focus();
		return false;
	}
	return false;
}


function centerWindow()
{
 var screenWidth   = screen.width;
 var screenHeight  = screen.height;

 var windowWidth   = document.body.clientWidth;
 var windowHeight  = document.body.clientHeight;

 window.top.moveTo((screenWidth - windowWidth) / 2, (screenHeight - windowHeight - 30) / 2);
}

function resizeWindow(x, y)
{
 window.top.resizeTo(x, y);
}


function Mascara (formato, keypress, objeto){ 
	campo = eval (objeto); 
	// CEP 
	if (formato=='CEP'){ 
	separador = '-'; 
	conjunto1 = 5; 
	if (campo.value.length == conjunto1){ 
	campo.value = campo.value + separador; 
	} 
	} 

	// DATA 
	if (formato=='DATA'){ 
	separador = '/'; 
	conjunto1 = 2; 
	conjunto2 = 5; 
	if (campo.value.length == conjunto1){ 
	campo.value = campo.value + separador; 
	} 
	if (campo.value.length == conjunto2){ 
	campo.value = campo.value + separador; 
	} 
	} 

	// TELEFONE 
	if (formato=='TELEFONE'){ 
	separador = '-'; 
	conjunto1 = 4; 
	if (campo.value.length == conjunto1){ 
	campo.value = campo.value + separador; 
	} 
	} 


} 


function Coloca_decimal(texto)
{
	// Esta	função Coloca_decimal
	var	vc = new String(texto.value);
	if((vc.length) > 0)
	{
		var	flag = -1;
		if(vc.charAt(vc.length-1)==',')
		{
			vc = vc	+ '00';			
			}			
			for(i=0;i<(vc.length-1);i++)
			{
				if(vc.charAt(i)==',')
				{
					flag = i;					
					break;				
				}								
			}							
			if(flag	== -1)
			{					
				vc = vc	+ ',00';
			}
			else
			{
				var	ponto =	vc.substring(flag+1, vc.length)	+ "00";			
				if(ponto.charAt(0)==',')
				{
					vc = vc.substring(0, flag+1) + "00";
				}
				else						
					vc = vc.substring(0, flag+1) + ponto.substring(0, 2);			
			}		
		}		
		texto.value=vc;
		return true;
}



var timerID = null;
var timerRunning = false;
function stopclock()
{
if(timerRunning)
clearTimeout(timerID)
timerRunning = false;
}

function startclock()
{
stopclock();
showtime();
}

function showtime()
{
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
var timeValue = "" + ((hours > 12) ? hours  : hours);
timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
//timeValue += (hours >= 12) ? " P.M." : " A.M.";
document.clock.face.value = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}

function ver(id)
{
	//window.open('ampliarfotos.asp?id='+id+'&tabela='+tabela+'&campo='+campo, 'fotos' ,'width=400,height=500,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=120,top=10');
	window.open('ampliarfotos.asp?id='+id, 'fotos' ,'width=400,height=500,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=120,top=10');
}

function pula_campo3(campo,campo2,tamanho)
{
	var campo = eval("document.form1."+campo);
	var proximo;
	proximo = eval("document.form1."+campo2);
	if (campo.value.length == tamanho)
	{
		proximo.focus();
		return false;
	}
	return false;
}

function ChamaPopIndique()
{
	window.open('indique_pop.asp', 'indiquepop' ,'width=400,height=500,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=120,top=10');
}

function verImg(foto)
{
	window.open('ampliarfotos2.asp?foto='+foto, 'fotos' ,'width=200,height=200,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=120,top=10');
}

//--> 