<!-- Begin
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
var keyCode = (isNN) ? e.which : e.keyCode; 
var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
if(input.value.length >= len && !containsElement(filter,keyCode)) {
input.value = input.value.slice(0, len);
input.form[(getIndex(input)+1) % input.form.length].focus();

}
function containsElement(arr, ele) {
var found = false, index = 0;
while(!found && index < arr.length)
if(arr[index] == ele)
found = true;
else
index++;
return found;
}
function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)index = i;
else i++;
return index;
}
return true;
}

function enterTab(inputKeyEnter, eEnter, sel) {
var keyCodeEnter = (isNN) ? eEnter.which : eEnter.keyCode; 
var selItem = sel;
if(keyCodeEnter == 13) {
inputKeyEnter.form[(getIndexEnter(inputKeyEnter)+1) % inputKeyEnter.form.length].focus();
if(selItem == true) {
inputKeyEnter.form[(getIndexEnter(inputKeyEnter)+1) % inputKeyEnter.form.length].select();
}
}

function getIndexEnter(inputKeyEnter) {
var indexEnter = -1, i = 0, found = false;
while (i < inputKeyEnter.form.length && indexEnter == -1)
if (inputKeyEnter.form[i] == inputKeyEnter)indexEnter = i;
else i++;
return indexEnter;
}
return true;
}


function check_text(ItName) {
var theWord = '';
out1 = '"'; 
out2 = "'";
//out3 = "%";
add = "";
temp = "" + ItName.value;

while (temp.indexOf(out1)>-1) {
pos= temp.indexOf(out1);
temp = "" + (temp.substring(0, pos) + add + 
temp.substring((pos + out1.length), temp.length));
theWord = 'ok';
}

while (temp.indexOf(out2)>-1) {
pos= temp.indexOf(out2);
temp = "" + (temp.substring(0, pos) + add + 
temp.substring((pos + out2.length), temp.length));
theWord = 'ok';
}

//while (temp.indexOf(out3)>-1) {
//pos= temp.indexOf(out3);
//temp = "" + (temp.substring(0, pos) + add + 
//temp.substring((pos + out3.length), temp.length));
//theWord = 'ok';
//}

//theWordsText = '[ '+out1+' ]  [ '+out2+' ]  [ '+out3+' ]'
theWordsText = '[ '+out1+' ]  [ '+out2+' ]'
ItName.value = temp;
	if (theWord != '')
	{
	alert('Este campo não aceita o seguintes caracteres: \n'+ theWordsText +' !')
	}

}




function check_text_pur(ItName) {
var theWord = '';
temp = "" + ItName.value;

var out1 = new Array('à','á','ã','â','ä','å')
add1 = "a";

var out2 = new Array('À','Á','Ã','Â','Ä','Ǻ')
add2 = "A";

var out3 = new Array('è','é','ê','ë')
add3 = "e";

var out4 = new Array('È','É','Ê','Ë')
add4 = "E";

var out5 = new Array('ì','í','î','ï')
add5 = "i";

var out6 = new Array('Ì','Í','Î','Ï')
add6 = "I";

var out7 = new Array('ò','ó','ô','õ','ö')
add7 = "o";

var out8 = new Array('Ò','Ó','Ô','Õ','Ö')
add8 = "O";

var out9 = new Array('ù','ú','û','ü')
add9 = "u";

var out10 = new Array('Ù','Ú','Û','Ü')
add10 = "U";

var out11 = new Array('ç')
add11 = "c";

var out12 = new Array('Ç')
add12 = "C";

var out13 = new Array('ñ')
add13 = "n";

var out14 = new Array('Ñ')
add14 = "N";

for (x in out1) {
while (temp.indexOf(out1[x])>-1) {
pos= temp.indexOf(out1[x]);
temp = "" + (temp.substring(0, pos) + add1 + 
temp.substring((pos + out1[x].length), temp.length));
theWord = 'ok';
}}

for (x in out2) {
while (temp.indexOf(out2[x])>-1) {
pos= temp.indexOf(out2[x]);
temp = "" + (temp.substring(0, pos) + add2 + 
temp.substring((pos + out2[x].length), temp.length));
theWord = 'ok';
}}


for (x in out3) {
while (temp.indexOf(out3[x])>-1) {
pos= temp.indexOf(out3[x]);
temp = "" + (temp.substring(0, pos) + add3 + 
temp.substring((pos + out3[x].length), temp.length));
theWord = 'ok';
}}

for (x in out4) {
while (temp.indexOf(out4[x])>-1) {
pos= temp.indexOf(out4[x]);
temp = "" + (temp.substring(0, pos) + add4 + 
temp.substring((pos + out4[x].length), temp.length));
theWord = 'ok';
}}

for (x in out5) {
while (temp.indexOf(out5[x])>-1) {
pos= temp.indexOf(out5[x]);
temp = "" + (temp.substring(0, pos) + add5 + 
temp.substring((pos + out5[x].length), temp.length));
theWord = 'ok';
}}

for (x in out6) {
while (temp.indexOf(out6[x])>-1) {
pos= temp.indexOf(out6[x]);
temp = "" + (temp.substring(0, pos) + add6 + 
temp.substring((pos + out6[x].length), temp.length));
theWord = 'ok';
}}

for (x in out7) {
while (temp.indexOf(out7[x])>-1) {
pos= temp.indexOf(out7[x]);
temp = "" + (temp.substring(0, pos) + add7 + 
temp.substring((pos + out7[x].length), temp.length));
theWord = 'ok';
}}

for (x in out8) {
while (temp.indexOf(out8[x])>-1) {
pos= temp.indexOf(out8[x]);
temp = "" + (temp.substring(0, pos) + add8 + 
temp.substring((pos + out8[x].length), temp.length));
theWord = 'ok';
}}

for (x in out9) {
while (temp.indexOf(out9[x])>-1) {
pos= temp.indexOf(out9[x]);
temp = "" + (temp.substring(0, pos) + add9 + 
temp.substring((pos + out9[x].length), temp.length));
theWord = 'ok';
}}

for (x in out10) {
while (temp.indexOf(out10[x])>-1) {
pos= temp.indexOf(out10[x]);
temp = "" + (temp.substring(0, pos) + add10 + 
temp.substring((pos + out10[x].length), temp.length));
theWord = 'ok';
}}

for (x in out11) {
while (temp.indexOf(out11[x])>-1) {
pos= temp.indexOf(out11[x]);
temp = "" + (temp.substring(0, pos) + add11 + 
temp.substring((pos + out11[x].length), temp.length));
theWord = 'ok';
}}

for (x in out12) {
while (temp.indexOf(out12[x])>-1) {
pos= temp.indexOf(out12[x]);
temp = "" + (temp.substring(0, pos) + add12 + 
temp.substring((pos + out12[x].length), temp.length));
theWord = 'ok';
}}

for (x in out13) {
while (temp.indexOf(out13[x])>-1) {
pos= temp.indexOf(out13[x]);
temp = "" + (temp.substring(0, pos) + add13 + 
temp.substring((pos + out13[x].length), temp.length));
theWord = 'ok';
}}

for (x in out14) {
while (temp.indexOf(out14[x])>-1) {
pos= temp.indexOf(out14[x]);
temp = "" + (temp.substring(0, pos) + add14 + 
temp.substring((pos + out14[x].length), temp.length));
theWord = 'ok';
}}

ItName.value = temp;
	if (theWord != '')
	{
	alert('Este campo não aceita acentuações !')
	}

}


//	var theWord = '';
//temp = "" + ItName.value;
//var whichCode = (window.Event) ? e.which : e.keyCode;
//var strCheck = '65';	

//if (strCheck.indexOf(whichCode) != -1) {
//alert("xxxxxx");
//ItName.value = "";
//ItName.focus();
//ItName.select();
//return false;
//}

//}



function check_number(ItName)
{

out = "."; 
out1 = "-";
out2 = " ";
add = "";
temp = "" + ItName.value;

while (temp.indexOf(out)>-1) {
pos= temp.indexOf(out);
temp = "" + (temp.substring(0, pos) + add + 
temp.substring((pos + out.length), temp.length));
}

while (temp.indexOf(out1)>-1) {
pos= temp.indexOf(out1);
temp = "" + (temp.substring(0, pos) + add + 
temp.substring((pos + out1.length), temp.length));
}

while (temp.indexOf(out2)>-1) {
pos= temp.indexOf(out2);
temp = "" + (temp.substring(0, pos) + add + 
temp.substring((pos + out2.length), temp.length));
}

ItName.value = temp;

	if (isNaN(ItName.value) == true)
	{
	alert('Este campo aceita apenas numero!');	
	ItName.value = '';
	ItName.focus();
	ItName.select();
	}
}

function check_numberMoeda(ItName)
{

temp = "" + ItName.value;
num = temp.toString().replace(/\,|\,/g,'');

	if (isNaN(num) == true)
	{
	alert('Este campo aceita apenas numero!');	
	ItName.value = '';
	ItName.focus();
	ItName.select();
	}


}

function check_numberSimples(ItName)
{

temp = "" + ItName.value;
num = temp.toString().replace(/\,|\,/g,'');

	if (isNaN(num) == true)
	{
	alert('Este campo aceita apenas numero!');	
	ItName.value = '';
	ItName.focus();
	ItName.select();
	temp = '';
	}
num = temp.toString().replace(/\.|\./g,',');
	ItName.value = num;
}



function check_email(ItName)
{
	if (ItName.value != '')
	{

		if ((ItName.value.search("@") == -1 || ItName.value.search("[.*]") == -1))
		{
		alert('Este é um e-mail inválido');	
		ItName.value = '';
		ItName.focus();
		ItName.select();
		}
	}
}
function check_url(ItName)
{
	if (ItName.value != '')
	{
		if ((ItName.value.search("www") == -1 || ItName.value.search("[.*]") == -1))
		{
		alert('Este é um endereço inválido');	
		ItName.value = '';
		ItName.focus();
		ItName.select();
		}
	}
}
function check_url_dom(ItName)
{
	if (ItName.value != '')
	{
		if ((ItName.value.search("www") == 0 || ItName.value.search("[.*]") == -1))
		{
		alert('Este é um endereço inválido\nNão utilize www');	
		ItName.value = '';
		ItName.focus();
		ItName.select();
		}
	}
}
function check_url_sub(ItName)
{
	if (ItName.value != '')
	{
		if ((ItName.value.search("www") == -1 || ItName.value.search("[.*]") == -1))
		{
		alert('Este é um endereço inválido\nUtilize www');	
		ItName.value = '';
		ItName.focus();
		ItName.select();
		}
	}
}


function check_cnpj(ItName)
{
  string = ItName.value || '';
  string = string + "";
  string = string.toUpperCase();
  chars = '0123456789.-/';
  out   = '';

  for (i=0; i<string.length; i++) {
    schar = string.charAt(i);
    if (chars.indexOf(schar) != -1) { out += schar; }
  }
    
  ItName.value = out;

	if (ItName.value != '')
	{

		if ((ItName.value.search("/") == -1 || ItName.value.search("[.*]") == -1 || ItName.value.search("-") == -1))
		{
		alert('Este é um CNPJ inválido');	
		ItName.value = '';
		ItName.focus();
		ItName.select();
		}

	}
}

function check_cpf(ItName)
{

  string = ItName.value || '';
  string = string + "";
  string = string.toUpperCase();
  chars = '0123456789.-';
  out   = '';

  for (i=0; i<string.length; i++) {
    schar = string.charAt(i);
    if (chars.indexOf(schar) != -1) { out += schar; }
  }
    
  ItName.value = out;

	if (ItName.value != '')
	{
		if (ItName.value.search("[.*]") == -1)
		{
		alert('Este é um CPF inválido');	
		ItName.value = '';
		ItName.focus();
		ItName.select();
		}
	}
}


function check_ie(ItName)
{
  string = ItName.value || '';
  string = string + "";
  string = string.toUpperCase();
  chars = '0123456789.';
  out   = '';

  for (i=0; i<string.length; i++) {
    schar = string.charAt(i);
    if (chars.indexOf(schar) != -1) { out += schar; }
  }
    
  ItName.value = out;

	if (ItName.value != '')
	{

		if (ItName.value.search("[.*]") == -1)
		{
		alert('Este é um I.E. inválido');	
		ItName.value = '';
		ItName.focus();
		ItName.select();
		}

	}
}

function check_rg(ItName)
{
  string = ItName.value || '';
  string = string + "";
  string = string.toUpperCase();
  chars = '0123456789.-';
  out   = '';

  for (i=0; i<string.length; i++) {
    schar = string.charAt(i);
    if (chars.indexOf(schar) != -1) { out += schar; }
  }
    
  ItName.value = out;

	if (ItName.value != '')
	{
		if (ItName.value.search("[.*]") == -1)
		{
		alert('Este é um RG inválido');	
		ItName.value = '';
		ItName.focus();
		ItName.select();
		}
	}
}
-->