function buscar (obj) {
	var divs = $('formBuscaLateral').getElementsByTagName('div');
	for (indice = 0; indice < divs.length; indice ++) {
		divs[indice].style.display = "none";
	}
	$(obj).style.display = "block";
}

function changePage(newLoc)	 {
   nextPage = newLoc.options[newLoc.selectedIndex].value;		
   if (nextPage != "") {
	  document.location.href = nextPage
   }
}

function abasDescricao (obj, agrupa, exclusao) {
	var divs = $(agrupa).getElementsByTagName('div');

	for (indice = 0; indice < divs.length; indice ++) {
		if(divs[indice].dir == exclusao) {
			var links = "l_"+divs[indice].id;		
			divs[indice].style.display = "none";
			if($(links)) {
				$(links).className = "";
			}			
		}
	}
	
	$(obj).style.display = "block";
	$("l_"+obj).className = "selecionado";
}

function mostraFotoCor(parametro,div) {
	if(parametro == 'img') {
		$(div).style.display = "";
	} else {
		$(div).style.display = "none";
	}
}
function abasAreaVip (obj, agrupa, exclusao) {
	var divs = $(agrupa).getElementsByTagName('dd');
	for (indice = 0; indice < divs.length; indice ++) {
		if(divs[indice].dir == exclusao) {
			var links = "l_"+divs[indice].id;		
			divs[indice].style.display = "none";
			$(links).className = "fonteRoxa";
		}
	}
	$(obj).style.display = "block";
	$("l_"+obj).className = "fonteRoxa fonteNegrito";
}
function marca_isento(id, obj) {
	if (obj.checked) {
		$(id).value = '0';
		$(id).hide();
		$(id).readOnly = true;
		
	} else {
		$(id).value = '';
		$(id).show();
		$(id).readOnly = false;	
	}
}
function IsNumeric(sText) {    
	var ValidChars = "0123456789.";
	var IsNumber=true;
	var Char;

	for (i = 0; i < sText.length && IsNumber == true; i++) { 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) {
			IsNumber = false;
		}
	}
	return IsNumber;
}


function validaIE(valor, campo) {
	if (!IsNumeric(valor)) { campo.value = ''; campo.focus(); alert("Favor digitar apenas numeros"); }
}

