<!-- 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_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_calc(ItName,Form,i)
{

it1 = eval("Form.relQua"+i+".value")
it2 = eval("Form.relValUnit"+i+".value")
Form1 = new Object(Form["relValTotal"+i]);
 if((it1 != '') && (it2 != ''))
{
it1 = it1.toString().replace(/\,|\,/g,'.');

it2 = it2.toString().replace(/\.|\./g,'');
it2 = it2.toString().replace(/\,|\,/g,'.');

valT = it2 * it1;


num = valT;


num = num.toString().replace(/\$|\,/g,'');

if(isNaN(num)) num = "0";

cents = Math.floor((num * 100 + 0.5) % 100);
num = Math.floor((num * 100 + 0.5) / 100).toString();
if(cents < 10) cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++)
num = num.substring(0,num.length - (4 * i + 3))+','+num.substring(num.length-(4 * i + 3));
num = num.toString().replace(/\$|\,/g,'.');
valT = ("R$" + num + "," + cents);

Form1.value = valT;
}
 if((it1 == '') || (it2 == ''))
{
valT = it2 * it1
Form1.value = '';
}

}


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();
		}
	}
}
-->