<!--
function mudaFormaPagamento(){
	var valor = 0.00;
	var pag1 		  = gE('pag1');
	var pag2 		  = gE('pag2');
	var valorSemFrete = gE('valorSemFrete');
	
	with(document.form1){
		if(condicao[0].checked && assinante[0].checked){
			valor = "R$ 85,00 (desc. 5.5%)";
			valor_semfrete.value = 85,00;
			pag1.style.display = "block";
			pag2.style.display = "block";
		}
		
		if(condicao[1].checked && assinante[0].checked){
			valor = "R$ 90,00";
			valor_semfrete.value = 90,00;
			pag1.style.display = "block";
			pag2.style.display = "none";
		}
		
		if(condicao[0].checked && assinante[1].checked){
			valor = "R$ 94,00  (desc. 5%)";
			valor_semfrete.value = 94,00;
			pag1.style.display = "block";
			pag2.style.display = "block";
		}
		
		if(condicao[1].checked && assinante[1].checked){
			valor = "R$ 99,00";
			valor_semfrete.value = 99,00;
			pag1.style.display = "block";
			pag2.style.display = "none";
		}
	}
	valorSemFrete.innerHTML = valor;
}

function calcFrete(estado){
	var valorTotal = document.form1.valor_total;
	var valorCalculado = document.form1.valorCalculado;
	var total = gE('total');
	var a;
	
	if(!estado){
		estado = document.form1.estado.value;
	}
	
	a = parseFloat(document.form1.valor_semfrete.value);
	
	
	switch(estado){
		case "AC": valorTotal.value = a + 17.55; break;
		case "AL": valorTotal.value = a + 13.91; break;
		case "AM": valorTotal.value = a + 17.55; break;
		case "AP": valorTotal.value = a + 17.55; break;
		case "BA": valorTotal.value = a + 13.91; break;
		case "CE": valorTotal.value = a + 17.55; break;
		case "DF": valorTotal.value = a + 10.55; break;
		case "ES": valorTotal.value = a + 10.55; break;
		case "GO": valorTotal.value = a + 10.55; break;
		case "MA": valorTotal.value = a + 17.55; break;
		case "MG": valorTotal.value = a + 8.68; break;
		case "MS": valorTotal.value = a + 10.55; break;
		case "MT": valorTotal.value = a + 13.91; break;
		case "PA": valorTotal.value = a + 17.55; break;
		case "PB": valorTotal.value = a + 13.91; break;
		case "PE": valorTotal.value = a + 13.91; break;
		case "PI": valorTotal.value = a + 17.55; break;
		case "PR": valorTotal.value = a + 8.68; break;
		case "RJ": valorTotal.value = a + 8.68; break;
		case "RN": valorTotal.value = a + 17.55; break;
		case "RO": valorTotal.value = a + 17.55; break;
		case "RR": valorTotal.value = a + 17.55; break;
		case "RS": valorTotal.value = a + 10.55; break;
		case "SC": valorTotal.value = a + 8.68; break;
		case "SE": valorTotal.value = a + 13.91; break;
		case "SP": valorTotal.value = a + 6.74; break;
		case "TO": valorTotal.value = a + 13.91; break; 
	}
	valorCalculado.value = valorTotal.value;
	

}

function valida(){
	with(document.form1){
		var erro = 0;
		var a=0,b=0,c=0;
		
		for (i=0;i<assinante.length;i++){ 
    	   if (assinante[i].checked == true){
			   a = 1;
		   }  
  	  	}
		
		for (i=0;i<condicao.length;i++){ 
    	   if (condicao[i].checked == true){
			   b = 1;
		   }  
  	  	}
		
		for (i=0;i<forma_pag.length;i++){ 
    	   if (forma_pag[i].checked == true){
			   c = 1;
		   }  
  	  	}
		
		var forms = new Array();
		forms[0]   = nome.value;
		forms[1]   = endereco.value;
		forms[2]   = numero.value;
		forms[3]   = cep.value;
		forms[4]   = cidade.value;
		forms[5]   = estado.value;
		forms[6]   = ddd.value;
		forms[7]   = telefone.value;
		forms[8]   = email.value;
					
		var i;
		for(i=0; i<forms.length; i++){
			if(!forms[i]){
				erro = 1;
			}
		}
		
		if(erro || a == 0 || b == 0 || c == 0){
			alert("Todos os campos são de preenchimento obrigatório.");
			return false;
		}
	}
}
-->
