wVerifiqueTAB=true;
function fMostra(quem, tammax) {
	if ( (quem.value.length == tammax) && (wVerifiqueTAB) ) {
		var i=0,j=0, indice=-1;
		for (i=0; i<document.forms.length; i++) {
			for (j=0; j<document.forms[i].elements.length; j++) {
				if (document.forms[i].elements[j].name == quem.name) {
					indice=i;
					break;
				}
			}
			if (indice != -1)
		         break;
		}
		for (i=0; i<=document.forms[indice].elements.length; i++) {
			if (document.forms[indice].elements[i].name == quem.name) {
				while ( (document.forms[indice].elements[(i+1)].type == "hidden") &&
						(i < document.forms[indice].elements.length) ) {
							i++;
				}
				document.forms[indice].elements[(i+1)].focus();
				wVerifiqueTAB=false;
				break;
			}
		}
	}
}
function fValidaPagamento() 
{
	check=false;
	
	for ( i = 0  ; i < frmConfirmacao.forma.length ; i++)
	{ 
		if (frmConfirmacao.forma[i].checked) check=true; 
	}

	if (frmConfirmacao.forma.checked)
	{
		check=true;
	}
	
	if (check == false) 
	{
		alert("Você precisa selecionar a forma de pagamento.")
		return false;
	}
	
	var val = "NADA";

	for( i = 0; i < frmConfirmacao.forma.length; i++ )
	{
		if( frmConfirmacao.forma[i].checked == true ) {
			val = frmConfirmacao.forma[i].value;
		}
	}
	
	if (val == "CARTAO DE CREDITO")
	{
			check1=false;
			
			for ( i = 0  ; i < frmConfirmacao.cartao.length ; i++)
			{ 
				if (frmConfirmacao.cartao[i].checked) check1=true; 
			}
		
			if (frmConfirmacao.cartao.checked)
			{
				check1=true;
			}
			
			if (check1 == false) 
			{
				alert("Você precisa selecionar o cartão de crédito.")
				return false;
			}
	}
}

function fDisplayParcelas( cartao )
{
	//alert( document.getElementById( cartao ).style.display );
	document.getElementById("visa").style.display = "none";
	document.getElementById("mastercard").style.display = "none";
	document.getElementById("diners").style.display = "none";
	
	var tabela = document.getElementById( cartao );
	tabela.style.display = "block";
	
}