// Checa a versão do Browser
var isNav4 = false, isNav5 = false, isIE4 = false
var strSeperator = "/"; 

var vDateType = 3; // Valor global para valores em formato de data
// 1 = mm/dd/aaaa
// 2 = aaaa/dd/mm (Unable to do date check at this time)
// 3 = dd/mm/aaaa
var vYearType = 4; //Deixe 2 ou 4 par o número de digitos para o Netscape
var vYearLength = 2; // Configure em 4 se você quiser forçar o usuario a utilizar 4 digitos
var err = 0; // Código do erro
if(navigator.appName == "Netscape") {
if (navigator.appVersion < "5") {
isNav4 = true;
isNav5 = false;
}
else
if (navigator.appVersion > "4") {
isNav4 = false;
isNav5 = true;
}
}
else {
isIE4 = true;
}

function DateFormat(vDateName, vDateValue, e, dateCheck, dateType) {
vDateType = dateType;
if (vDateValue == "~") {
alert("AppVersion = "+navigator.appVersion+" \nNav. 4 Versao = "+isNav4+" \nNav. 5 Versao = "+isNav5+" \nIE Versao = "+isIE4+" \nTipo do Ano = "+vYearType+" \nTipo da Data = "+vDateType+" \nSeparador = "+strSeperator);
vDateName.value = "";
vDateName.focus();
return true;
}
var whichCode = (window.Event) ? e.which : e.keyCode;
// Verifica se o separador está presente

if (vDateValue.length > 8 && isNav4) {
if ((vDateValue.indexOf("-") >= 1) || (vDateValue.indexOf("/") >= 1))
return true;
}
//Elimina todos os códigos ASPCII que são inválidos
var alphaCheck = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/-";
if (alphaCheck.indexOf(vDateValue) >= 1) {
	if (isNav4) {
	vDateName.value = "";
	vDateName.focus();
	vDateName.select();
	return false;
	}
	else {
	vDateName.value = vDateName.value.substr(0, (vDateValue.length-1));
	return false;
	}
}
if (whichCode == 8) //Ignora o valor do backspace para o Netscape. IE nao possui este valor
	return false;
else {
//Cria string numérica para 0123456789/
//Inclui os valores do teclado e do keypad
var strCheck = '47,48,49,50,51,52,53,54,55,56,57,58,59,95,96,97,98,99,100,101,102,103,104,105';
if (strCheck.indexOf(whichCode) != -1) {
if (isNav4) {
if (((vDateValue.length < 6 && dateCheck) || (vDateValue.length == 7 && dateCheck)) && (vDateValue.length >=1)) {
	alert("Data Inválida");
	vDateName.value = "";
	vDateName.focus();
	vDateName.select();
	return false;
}
if (vDateValue.length == 6 && dateCheck) {
var mDay = vDateName.value.substr(2,2);
var mMonth = vDateName.value.substr(0,2);
var mYear = vDateName.value.substr(4,4)

//Transforma um ano de dois dígitos em quatro dígitos
if (mYear.length == 2 && vYearType == 4) {
var mToday = new Date();
//Se o ano for maior do 30, utiliza-se o século como 19. Senão 20.
var checkYear = mToday.getFullYear() + 30; 
var mCheckYear = '20' + mYear;
if (mCheckYear >= checkYear)
mYear = '19' + mYear;
else
mYear = '20' + mYear;
}
var vDateValueCheck = mMonth+strSeperator+mDay+strSeperator+mYear;
if (!dateValid(vDateValueCheck)) {
alert("Data inválida");
vDateName.value = "";
vDateName.focus();
vDateName.select();
return false;
}
return true;
}
else {
// Reformata a data para validação e configura o tipo de data para 1
if (vDateValue.length >= 8 && dateCheck) {
if (vDateType == 1) // mmddaaaa
{
var mDay = vDateName.value.substr(2,2);
var mMonth = vDateName.value.substr(0,2);
var mYear = vDateName.value.substr(4,4)
vDateName.value = mMonth+strSeperator+mDay+strSeperator+mYear;
}
if (vDateType == 2) // aaaammdd
{
var mYear = vDateName.value.substr(0,4)
var mMonth = vDateName.value.substr(4,2);
var mDay = vDateName.value.substr(6,2);
vDateName.value = mYear+strSeperator+mMonth+strSeperator+mDay;
}
if (vDateType == 3) // ddmmaaaa
{
var mMonth = vDateName.value.substr(2,2);
var mDay = vDateName.value.substr(0,2);
var mYear = vDateName.value.substr(4,4)
vDateName.value = mDay+strSeperator+mMonth+strSeperator+mYear;
}
//Cria uma variavel temporaria para receber o tipo de data e trocar
//o tipo de data para 1 para a validação
var vDateTypeTemp = vDateType;
vDateType = 1;
var vDateValueCheck = mMonth+strSeperator+mDay+strSeperator+mYear;
if (!dateValid(vDateValueCheck)) {
alert("Data inválida");
vDateType = vDateTypeTemp;
vDateName.value = "";
vDateName.focus();
vDateName.select();
return false;
}
vDateType = vDateTypeTemp;
return true;
}
else {
if (((vDateValue.length < 8 && dateCheck) || (vDateValue.length == 9 && dateCheck)) && (vDateValue.length >=1)) {
alert("Data inválida");
vDateName.value = "";
vDateName.focus();
vDateName.select();
return false;
}
}
}
}
else {
// Verificação Non isNav
if (((vDateValue.length < 8 && dateCheck) || (vDateValue.length == 9 && dateCheck)) && (vDateValue.length >=1)) {
alert("Data inválida");
vDateName.value = "";
vDateName.focus();
return true;
}
// Reformat a data para um formato que pode ser validado. mm/dd/aaaa
if (vDateValue.length >= 8 && dateCheck) {
// Formatos adicionais de datas podem ser inseridos aqui para o parse
// que serão reconhecidas como uma nova rotina
if (vDateType == 1) // mm/dd/aaaa
{
var mMonth = vDateName.value.substr(0,2);
var mDay = vDateName.value.substr(3,2);
var mYear = vDateName.value.substr(6,4)
}
if (vDateType == 2) // aaaa/mm/dd
{
var mYear = vDateName.value.substr(0,4)
var mMonth = vDateName.value.substr(5,2);
var mDay = vDateName.value.substr(8,2);
}
if (vDateType == 3) // dd/mm/aaaa
{
var mDay = vDateName.value.substr(0,2);
var mMonth = vDateName.value.substr(3,2);
var mYear = vDateName.value.substr(6,4)
}
if (vYearLength == 4) {
if (mYear.length < 4) {
alert("Data inválida");
vDateName.value = "";
vDateName.focus();
return true;
}
}
// Cria uma variável temporária para receber o valor de vDateType
var vDateTypeTemp = vDateType;
//tipo de validação de data
vDateType = 1;
// Armazena a data 
var vDateValueCheck = mMonth+strSeperator+mDay+strSeperator+mYear;
if (mYear.length == 2 && vYearType == 4 && dateCheck) {
//Transforma um ano de dois dígitos em um de quatro
var mToday = new Date();
//Se o ano for maior do 30, utiliza-se o século como 19. Senão 20.
var checkYear = mToday.getFullYear() + 30; 
var mCheckYear = '20' + mYear;
if (mCheckYear >= checkYear)
mYear = '19' + mYear;
else
mYear = '20' + mYear;
vDateValueCheck = mMonth+strSeperator+mDay+strSeperator+mYear;
// Armazena o novo valor novamente ao campo. Esta função não funcionará
// not work com o tipo de data 2 se que o ano seja inserido antes
if (vDateTypeTemp == 1) // mm/dd/aaaa
vDateName.value = mMonth+strSeperator+mDay+strSeperator+mYear;
if (vDateTypeTemp == 3) // dd/mm/aaaa
vDateName.value = mDay+strSeperator+mMonth+strSeperator+mYear;
} 
if (!dateValid(vDateValueCheck)) {
alert("Data inválida");
vDateType = vDateTypeTemp;
vDateName.value = "";
vDateName.focus();
return true;
}
vDateType = vDateTypeTemp;
return true;
}
else {
if (vDateType == 1) {
if (vDateValue.length == 2) {
vDateName.value = vDateValue+strSeperator;
}
if (vDateValue.length == 5) {
vDateName.value = vDateValue+strSeperator;
}
}
if (vDateType == 2) {
if (vDateValue.length == 4) {
vDateName.value = vDateValue+strSeperator;
}
if (vDateValue.length == 7) {
vDateName.value = vDateValue+strSeperator;
}
} 
if (vDateType == 3) {
if (vDateValue.length == 2) {
vDateName.value = vDateValue+strSeperator;
}
if (vDateValue.length == 5) {
vDateName.value = vDateValue+strSeperator;
}
}
return true;
}
}
if (vDateValue.length == 10&& dateCheck) {
if (!dateValid(vDateName)) {
// Retire o comentário da linha abaixo para ver mensagens de erro
//alert(err); 
alert("Data inválida");
vDateName.focus();
vDateName.select();
}
}
return false;
}
else {
// Se p valor não estiver na string, então é retornada a string menos
//o último caractere
if (isNav4) {
vDateName.value = "";
vDateName.focus();
vDateName.select();
return false;
}
else
{
//vDateName.value = vDateName.value.substr(0, (vDateValue.length-1));
return false;
}
}
}
}
function dateValid(objName) {
var strDate;
var strDateArray;
var strDay;
var strMonth;
var strYear;
var intday;
var intMonth;
var intYear;
var booFound = false;
var datefield = objName;
var strSeparatorArray = new Array("-"," ","/",".");
var intElementNr;
// var err = 0;
var strMonthArray = new Array(12);
strMonthArray[0] = "Jan";
strMonthArray[1] = "Fev";
strMonthArray[2] = "Mar";
strMonthArray[3] = "Abr";
strMonthArray[4] = "Mai";
strMonthArray[5] = "Jun";
strMonthArray[6] = "Jul";
strMonthArray[7] = "Ago";
strMonthArray[8] = "Set";
strMonthArray[9] = "Out";
strMonthArray[10] = "Nov";
strMonthArray[11] = "Dez";

strDate = objName;
if (strDate.length < 1) {
return true;
}
for (intElementNr = 0; intElementNr < strSeparatorArray.length; intElementNr++) {
if (strDate.indexOf(strSeparatorArray[intElementNr]) != -1) {
strDateArray = strDate.split(strSeparatorArray[intElementNr]);
if (strDateArray.length != 3) {
err = 1;
return false;
}
else {
strDay = strDateArray[0];
strMonth = strDateArray[1];
strYear = strDateArray[2];
}
booFound = true;
}
}
if (booFound == false) {
if (strDate.length>5) {
strDay = strDate.substr(0, 2);
strMonth = strDate.substr(2, 2);
strYear = strDate.substr(4);
}
}
//Ajusta para os anos de dois dígitos inseridos
if (strYear.length == 2) {
strYear = '20' + strYear;
}
strTemp = strDay;
strDay = strMonth;
strMonth = strTemp;
intday = parseInt(strDay, 10);
if (isNaN(intday)) {
err = 2;
return false;
}
intMonth = parseInt(strMonth, 10);
if (isNaN(intMonth)) {
for (i = 0;i<12;i++) {
if (strMonth.toUpperCase() == strMonthArray[i].toUpperCase()) {
intMonth = i+1;
strMonth = strMonthArray[i];
i = 12;
}
}
if (isNaN(intMonth)) {
err = 3;
return false;
}
}
intYear = parseInt(strYear, 10);
if (isNaN(intYear)) {
err = 4;
return false;
}
if (intMonth>12 || intMonth<1) {
err = 5;
return false;
}
if ((intMonth == 1 || intMonth == 3 || intMonth == 5 || intMonth == 7 || intMonth == 8 || intMonth == 10 || intMonth == 12) && (intday > 31 || intday < 1)) {
err = 6;
return false;
}
if ((intMonth == 4 || intMonth == 6 || intMonth == 9 || intMonth == 11) && (intday > 30 || intday < 1)) {
err = 7;
return false;
}
if (intMonth == 2) {
if (intday < 1) {
err = 8;
return false;
}
if (LeapYear(intYear) == true) {
if (intday > 29) {
err = 9;
return false;
}
}
else {
if (intday > 28) {
err = 10;
return false;
}
}
}
return true;
}
function LeapYear(intYear) {
if (intYear % 100 == 0) {
if (intYear % 400 == 0) { return true; }
}
else {
if ((intYear % 4) == 0) { return true; }
}
return false;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init== true) with (navigator) {if((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.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; }
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=leftWidth; document.MM_pgH=leftHeight; onresize=MM_reloadPage; }}
  else if (leftWidth!=document.MM_pgW || leftHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function Numerico(e) { // Abre funcao

if (navigator.appName == 'Netscape') {return true;}

if(document.all) {// Internet Explorer
var teclax = event.keyCode;
}

if(document.layers) { // Nestcape
var teclax = e.which;
}


if(teclax == 44) // Virgula
return true;
else
{
if(teclax == 48) // 0
return true;
else
{
if(teclax == 49) // 1
return true;
else
{
if(teclax == 50) // 2
return true;
else
{
if(teclax == 51) // 3
return true;
else
{
if(teclax == 52) // 4
return true;
else
{
if(teclax == 53) // 5
return true;
else
{
if(teclax == 54) // 6
return true;
else
{
if(teclax == 55) // 7
return true;
else
{
if(teclax == 56) // 8
return true;
else
{
if(teclax == 57) // 9
return true;
else
{
return false;
} // ,
} // 0
} // 1
} // 2
} // 3
} // 4
} // 5
} // 6
} // 7
} // 8
} // 9

} // fecha funcao

// ================================================================================================
// Função para imprimir boletos Itaú
// Implementado por Claudinei Miranda em 10/4/2002
// ================================================================================================
function imprime_boleto_itau(valor,parcela,dia,pedi_codigo,usua_codigo)
{
vjanela=window.open('imprime_boleto.asp?valor=' + valor + '&parcela=' + parcela + '&dia=' + dia + '&pedi_codigo=' + pedi_codigo + '&usua_codigo=' + usua_codigo,'vpos','toolbar=yes,menubar=yes,resizable=yes,status=no,scrollbars=yes,width=700,height=480');
eval(vjanela);
}

// ================================================================================================
// Função para abertura de janelas explicativas na tela de pedido
// Implementado por Claudinei Miranda em 12/4/2002
// ================================================================================================
function mens_help(numero)
{
	if (numero=='1')	// pedido
	{
	var titulo = 'Verifique os dados do pedido e altere-os se necessário';
	var texto  = '';
	texto = 'Confira os dados principais do seu pedido (produtos, quantidade e embalagem para presente). <BR><BR>Se precisar realizar alguma modificação,<BR> clique em ALTERAR PEDIDO.';
	window.open('mensagem.asp?titulo=' + titulo + '&mensagem=' + texto , 'tt','top=0,left=0,width=450,height=300');
	}
	if (numero=='2')	// endereço
	{
	var titulo = 'Verifique os endereços e altere-os se necessário';
	var texto  = '';
	texto = 'Confira no box da direita todas as informações do endereço de entrega para este pedido. <BR><BR>Caso seja necessário realizar alguma modificação,<BR> clique em ALTERAR ENDEREÇO.';
	window.open('mensagem.asp?titulo=' + titulo + '&mensagem=' + texto , 'tt','top=0,left=0,width=450,height=300');
	}
	if (numero=='3')	// forma de pagamento
	{
	var titulo = 'Escolha a forma de pagamento';
	var texto  = '';
	texto = 'Selecione sua forma de pagamento, leia atentamente o texto explicativo sobre procedimentos e condições para a forma de pagamento escolhida.<BR><BR>Se a forma de pagamento permitir parcelamento, selecione a condição deseja. Quando solicitado, digite os dados do seu cartão. Fique tranquilo, seus dados trafegam de forma totalmente segura.<BR><BR> <B>IMPORTANTE:</B> Para pagamentos realizados com boletos bancários, depósitos ou transferências eletrônicas, o prazo de entrega expresso no pedido será contado a partir da confirmação do respectivo pagamento.';
	window.open('mensagem.asp?titulo=' + titulo + '&mensagem=' + texto , 'tt','top=0,left=0,width=450,height=400');
	}
	if (numero=='4')	// pedido concluido
	{
	var titulo = 'Pedido Concluido';
	var texto  = '';
	texto = 'Seu pedido está concluído. <BR><BR>Antes de fechar a janela do pedido, atente para os seguintes procedimentos:<BR><BR>';
	texto = texto + '1)&nbsp;Anote o número de seu pedido. Você também receberá por e-mail uma cópia de seu pedido. Guarde-a até que o pedido seja entregue. <BR>';
	texto = texto + '2)&nbsp;Caso queira imprimir seu pedido, clique no ícone de impressora.<BR>';
	texto = texto + '3)&nbsp;O box “Forma de Pagamento” traz o link de acesso direto para realizar o pagamento, quando a forma de pagamento escolhida for banco on-line (transferência eletrônica) ou boleto bancário.<BR>';
	texto = texto + '4)&nbsp;Siga os procedimentos da caixa “Instruções” quando tiver optado por pagamento com boleto eletrônico, banco on-line (transferência eletrônica) ou depósito bancário.<BR>';
	texto = texto + '5)&nbsp;A qualquer momento, você poderá acompanhar o andamento de seu pedido pelo módulo “Meus Pedidos” <BR>';
	window.open('mensagem.asp?titulo=' + titulo + '&mensagem=' + texto , 'tt','top=0,left=0,width=450,height=500');
	}
	if (numero=='5')	// dúvidas no cadastro
	{
	var titulo = 'Dúvidas sobre Preenchimento';
	var texto  = '5';
	window.open('mensagem.asp?titulo=' + titulo + '&mensagem=' + texto , 'tt','top=0,left=0,width=500,height=500,scrollbars=1');
	}

	
}


function valida_valor(e) { // Abre funcao
	if(document.all) // Internet Explorer
		var tecla = event.keyCode;
	else if(document.layers) // Nestcape
	var tecla = e.which;

	if(tecla > 47 && tecla < 58) // numeros de 0 a 9
		return true;
	else
		return false;
	if (tecla == 8) // backspace e traço (se quiser pode colocar o traço ! é o && tecla !=45) 
		return false;
	else
		return true;
		if(tecla == 61) // Igual
		return false;
		else
		{
		if(tecla == 59) // ponto e virgula
		return false;
		else
		{
		if(tecla == 34) // aspas duplas
		return false;
		else
		{
		if(tecla == 39) // aspas
		return false;
		else
		{

		} // if(tecla == 39) // aspas
		} // if(tecla == 34) // aspas duplas
		} // if(tecla == 59) // ponto e virgula
		} // if(tecla == 61) // Igual
} // fecha funcao


// Validação de valor permitindo
// Barra, Traços e pontos

function valida_valor2(e) { // Abre funcao
	if(document.all) // Internet Explorer
		var tecla = event.keyCode;
	else if(document.layers) // Nestcape
	var tecla = e.which;

	if(tecla > 47 && tecla < 58) // numeros de 0 a 9
		return true;
	else
	if(tecla == 45 || tecla == 46 || tecla == 47 || tecla == 92)  // traço , ponto e barras
		return true;
	else
		return false;
	if (tecla == 8) // backspace e traço (se quiser pode colocar o traço ! é o && tecla !=45) 
		return false;
	else
		return true;
		if(tecla == 61) // Igual
		return false;
		else
		{
		if(tecla == 59) // ponto e virgula
		return false;
		else
		{
		if(tecla == 34) // aspas duplas
		return false;
		else
		{
		if(tecla == 39) // aspas
		return false;
		else
		{

		} // if(tecla == 39) // aspas
		} // if(tecla == 34) // aspas duplas
		} // if(tecla == 59) // ponto e virgula
		} // if(tecla == 61) // Igual
} // fecha funcao


// ================================================================================================
// Verifica E-mail
// Implementado por Claudinei Miranda em 05/4/2002
// ================================================================================================

function valida_email(campo) {
	var go=1;
	vemail = campo;   
  
if (vemail.value.length < 5 || vemail.value.indexOf('@') == -1 || 	vemail.value.indexOf('.') == 	-1 || vemail.value.indexOf(' ') != -1){
			 go=0;
			 alert("E-mail incorreto.\nPor favor, verifique o e-mail digitado.");
			 vemail.focus();
}
}	// Fecha Função
// ================================================================================================




function valida_texto_asc(e) { // Abre funcao
	if(document.all) // Internet Explorer
		var teclax = event.keyCode;
	else if(document.layers) // Nestcape
	var teclax = e.which;
		//alert(teclax);
		if(teclax < 33 && teclax > 122) // Virgula
			// alert('nao suportado');
			return false;
		else
		{
		if(teclax == 44) // Virgula
			return false;
		else
		{
		if(teclax == 38) // & (Comercial)
		return false;
		else
		{
		if(teclax == 35) // # (Canal)
		return false;
		else
		{
		if(teclax == 58) // Dois pontos
			return false;
		else
		{
		if(teclax == 93) // Colchetes
			return false;
		else
		{
		if(teclax == 91) // Colchetes
			return false;
		else
		{
		if(teclax == 123) // Chaves
			return false;
		else
		{
		if(teclax == 125) // Chaves
			return false;
		else
		{
		if(teclax == 40) // Parenteses
			return false;
		else
		{
		if(teclax == 41) // Parenteses
			return false;
		else
		{
		if(teclax == 63) // Interrogação
			return false;
		else
		{
		if(teclax == 61) // Igual
			return false;
		else
		{
		if(teclax == 59) // ponto e virgula
			return false;
		else
		{
		if(teclax == 39) // Aspas Simples
			return false;
		else
		{
		if (teclax == 34) // Aspas Duplas
			return false;
		else
			return true;
		} // fecha else do if Aspas Simples
		} // if(tecla == 59) // ponto e virgula
		} // if(teclax == 61) // Igual
		} // if(teclax == 63) // Interrogação
		} // if(teclax == 41) // Parenteses
		} // if(teclax == 40) // Parenteses
		} // if(teclax == 125) // Chaves
		} // if(teclax == 123) // Chaves
		} // if(teclax == 91) // Colchetes
		} // if(teclax == 93) // Colchetes
		} // if(teclax == 58) // Dois pontos
		} // # (Canal)
		} // & (Comercial)
		} // if(teclax == 44) // Virgula
		}
} // fecha funcao



// ================================================================================================
// Valida TEXTAREA - Impede caracteres especiais
// Implementado por Claudinei em 8/4/2002
// ================================================================================================

function valida_area(e) { // Abre funcao
	if(document.all) // Internet Explorer
		var teclax = event.keyCode;
	else if(document.layers) // Nestcape
	var teclax = e.which;
		if(teclax == 93) // Colchetes
			return false;
		else
		{
		if(teclax == 91) // Colchetes
			return false;
		else
		{
		if(teclax == 123) // Chaves
			return false;
		else
		{
		if(teclax == 125) // Chaves
			return false;
		else
		{
		if(teclax == 38) // & (Comercial)
		return false;
		else
		{
		if(teclax == 35) // # (Canal)
		return false;
		else
		{
		if(teclax == 39) // Aspas Simples
			return false;
		else
			return true;
		} // & (Comercial) 
		} // # (Canal)
		} // if(teclax == 125) // Chaves
		} // if(teclax == 123) // Chaves
		} // if(teclax == 91) // Colchetes
		} // if(teclax == 93) // Colchetes
} // fecha funcao

// ================================================================================================


// Contador para objeto TextArea.
function limita(campo,tam,e){
	var tamanho = campo.value.length;
	var tex=campo.value;
	// Chama a função de validação da textarea
	valida_area(e);
		// Caso a função de validação retorne false
		if (valida_area(e)==false)
		{
		return false
		}
	if (tamanho>=tam) 
	{
		campo.value=tex.substring(0,tam); 
	}
	return true;
}

function contacampo(campo, tamtxt) {
document.form[tamtxt].value =  1200-document.form[campo].value.length;
}
// --



// ================================================================================================
// Valida Campos - Impede caracteres especiais
// Implementado por Claudinei em 4/4/2002
// ================================================================================================



  
