home = {
	beneficiario : 0,
	perfil : 0,
	plano : 0,
	
	habilita_radio : function(beneficiario){
		if (beneficiario == 1){
			FuncoesGerais.HabilitaRadio(document.form1.perfil, false);
			FuncoesGerais.HabilitaRadio(document.form1.plano, false);
		}else if (beneficiario == 2){
			FuncoesGerais.HabilitaRadio(document.form1.perfil, false);
			FuncoesGerais.HabilitaRadio(document.form1.plano, false);
			FuncoesGerais.HabilitaRadio(document.form1.perfil, false);
		}else if (beneficiario == 3){
			FuncoesGerais.HabilitaRadio(document.form1.perfil, true);
			FuncoesGerais.HabilitaRadio(document.form1.plano, true);
			FuncoesGerais.DesmarcaRadio(document.form1.perfil);
			FuncoesGerais.DesmarcaRadio(document.form1.plano);
		}
	},
	
	envia_previdencia : function(){
		this.beneficiario = FuncoesGerais.RetornaValorRadio(document.form1.beneficiario);
		this.perfil = FuncoesGerais.RetornaValorRadio(document.form1.perfil);
		this.plano = FuncoesGerais.RetornaValorRadio(document.form1.plano);
		msg = this.valida_envio_previdencia();
		if (msg == ''){
			this.envia_resultado_previdencia();
		}else{
			alert(msg);
		}
	},
	
	valida_envio_previdencia : function(){
		msg = '';
		if (FuncoesGerais.RetornaValorRadio(document.form1.beneficiario) == ''){
			msg = 'Selecione o Plano';
		}else if (FuncoesGerais.RetornaValorRadio(document.form1.perfil) == '' && this.beneficiario < 3){
			msg = 'Selecione o Perfil';
		}else if (FuncoesGerais.RetornaValorRadio(document.form1.plano) == '' && this.beneficiario < 3){
			msg = 'Selecione a Modalidade';
		}
		return msg;
	},

	envia_resultado_previdencia : function(){
		if (this.beneficiario == 3){
		
			window.location.href = '../previdencia/default.shtml?beneficiario=3&perfil=&plano=';
			}
			
		else{
			window.location.href = '../previdencia/default.shtml?beneficiario='+this.beneficiario+'&perfil='+this.perfil+'&plano='+this.plano+'&#a1';
		}
	},

	envia_vida : function(){
		msg = this.valida_envio_vida();
		if (msg == ''){
			if(document.form1.paraVoce.disabled == false && document.form1.paraVoce.value != 0){
				this.beneficiario = document.form1.paraVoce.value;
			}
			if(document.form1.suaEmpresa.disabled == false && document.form1.suaEmpresa.value != 6){
				this.beneficiario = document.form1.suaEmpresa.value;
			}
//			this.beneficiario = FuncoesGerais.RetornaValorRadio(document.form1.tipo);
			this.envia_resultado_vida();
		}else{
			alert(msg);
		}
	},
	
	valida_envio_vida : function(){
		msg = '';
		if (FuncoesGerais.RetornaValorRadio(document.form1.tipo) == ''){
			msg = 'Selecione uma opção de seguro.';
		}else{
			if(document.form1.paraVoce.disabled == false && document.form1.paraVoce.value == 0)
			{
				msg = 'Selecione um seguro para você.';
			}
			if(document.form1.suaEmpresa.disabled == false && document.form1.suaEmpresa.value == 6)
			{
				msg = 'Selecione um seguro para sua empresa.';
			}																
		}
		return msg;
	},
	
	envia_resultado_vida : function(){
		if (this.beneficiario == 1){
			window.location.href = '../vida/premiado.shtml';
		}else if (this.beneficiario == 2){
			window.location.href = '../vida/homem.shtml';
		}else if (this.beneficiario == 3){
			window.location.href = '../vida/mulher.shtml';
		}else if (this.beneficiario == 4){
			window.location.href = '../vida/vgogh.shtml';
		}else if (this.beneficiario == 5){
			window.location.href = '../vida/a_pessoais.shtml';
		}else if (this.beneficiario == 7){
			window.location.href = '../vida/vida_empresa.shtml';
		}else if (this.beneficiario == 8){
			window.location.href = '../vida/vida_empresarial.shtml';
		}else if (this.beneficiario == 9){
			window.location.href = '../vida/vida_empresa_a_pessoais.shtml';
		}
	}
}