// JavaScript Document

function abrefotos(arquivo,descricao) {
	window.open('fotos.asp?a='+arquivo+'&d='+descricao,'FotosIdentech','width=410,height=310,resizable=no,status=yes,menubar=no,scrollbars=auto');
}


function troca_fnd(id) {
	document.getElementById(id).style.background = 'url(imgsite/menu_fnd_on.gif) left top repeat-x'; 
	document.getElementById(id).style.padding='0 0 0 15px';
}

function volta_fnd(id) {
	document.getElementById(id).style.background='url(imgsite/menu_fnd_off.gif) left top repeat-x'; 
	document.getElementById(id).style.padding='0 0 0 0';
}


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 select_drop(sel_name, abbr_name){
	if(abbr_name!=''){
		if(sel_name.length > 0){
			var maxIndex = sel_name.length;
				for(var i=0; i<maxIndex; i++){
					if(abbr_name== sel_name.options[i].value){
						sel_name.selectedIndex = i;
						break;
					}
				}
			}
		}
	return true;    
}


function Chgcesta(Valor)
{
if (Valor)
{
atualiza.action = "compra_atualiza.asp?redir=cesta";
}
else
{
atualiza.action = "compra_atualiza.asp";
}
 atualiza.submit();
}