var Ept={
	validateForm:function(){
		jQuery("#frm_order").bind("submit",function(){
			if(jQuery("input:checkbox[id='tipo_orcamento']:checked").length == 0){
				alert("Escolha o tipo de orçamento.");
				jQuery("#tipo_orcamento").focus();
				return false;	
			}
			if(jQuery("input:checkbox[id='abertura_portao']:checked").length == 0){
				alert("Escolha o tipo de abertura do portão.");
				jQuery("#abertura_portao").focus();
				return false;
			}
			if(jQuery("#medida_portao_largura").val().length == 0){
				alert("Informe a largura do portão.");
				jQuery("#medida_portao_largura").focus();
				return false;
			}
			if(jQuery("#medida_portao_altura").val().length == 0){
				alert("Informe a altura do portão.");
				jQuery("#medida_portao_altura").focus();
				return false;
			}
			if(jQuery("#nome").val().length == 0){
				alert("Informe seu nome.");
				jQuery("#nome").focus();
				return false;
			}			
			if(jQuery("#telefone").val().length == 0){
				alert("Informe seu telefone.");
				jQuery("#telefone").focus();
				return false;
			}			
			if(jQuery("#email").val().length == 0){
				alert("Informe seu email.");
				jQuery("#email").focus();
				return false;
			}	
			if(jQuery("#cidade").val().length == 0){
				alert("Informe a cidade.");
				jQuery("#medida_cidadeportao_altura").focus();
				return false;
			}
		});
		return true;
	},
	getCode:function(){
		if (jQuery.url.param("portao")) {
				jQuery("<input type='hidden' id='portao' name='portao' value='"+ jQuery.url.param("portao") +"' />").insertBefore("#enviar");
				jQuery("input[value='portao']").attr("checked","checked");
		}else if (jQuery.url.param("produto")) {
				jQuery("<input type='hidden' id='produto' name='produto' value='"+ decodeURI(jQuery.url.param("produto")) +"' />").insertBefore("#enviar");
				jQuery("input[value='"+jQuery.url.param("tipo_orcamento")+"']").attr("checked","checked");
				jQuery("input[value='"+jQuery.url.param("abertura_portao")+"']").attr("checked","checked");
		}
	}
}
