$(document).ready(function(){$("#bc__birthDate-day").autotab({target:"bc__birthDate-month",format:"numeric"});$("#bc__birthDate-month").autotab({target:"bc__birthDate-year",format:"numeric"});$("#bc__birthDate-year").autotab({format:"numeric"});$("#bc__phone1-code").autotab({target:"bc__phone1-number",format:"numeric"});$("#bc__phone1-number").autotab({target:"bc__phone2-code",format:"numeric"});$("#bc__phone2-code").autotab({target:"bc__phone2-number",format:"numeric"});$("#bc__phone2-number").autotab({target:"bc__phone3-code",format:"numeric"});$("#bc__phone3-code").autotab({target:"bc__phone3-number",format:"numeric"});$("#bc__phone3-number").autotab({format:"numeric"});$("#bc__postalCode-bloco1").click(function(){$("#bc__postalCode-bloco1").val("");$("#bc__postalCode-bloco2").val("")});$("#bc__postalCode-bloco1").autotab({target:"bc__postalCode-bloco2",format:"numeric"});$("#bc__postalCode-bloco2").autotab({format:"numeric"});if($("#cepSearchCorreios").length>0){$("#cepSearchCorreios").click(function(){window.open("http://www.correios.com.br/servicos/dnec/menuAction.do?Metodo=menuLogradouro","window")})}$("#bc__postalCode-bloco2").blur(function(){$("#bc__postalCode-bloco2").after("<div id='cepLoading'><img src='/global/images/loading.gif' align='absmiddle'>&nbsp;Verificando CEP...</div>");var a=$("#bc__postalCode-bloco1").val()+$("#bc__postalCode-bloco2").val();$.getJSON("/json/cep",{cep:a},function(b,c){if(b.address){$("#bc__address").val(b.address);$("#bc__district").val(b.district);$("#bc__city").val(b.city);$("#bc__state").val(b.state);$("#bc__country").val(b.country)}else{$("#bc__address").val("");$("#bc__district").val("");$("#bc__city").val("");$("#bc__state").val("");$("#bc__country").val("");alert("CEP não encontrado")}$("#cepLoading").fadeOut("slow")})})});$(document).ready(function(){$(".order__detail__href__templateRender").live("click",function(){var b=$(this).attr("id");var c=$.evalJSON(b).mailControl__code;var a=$.evalJSON(b).token;element_id=Math.floor(Math.random()*1600);$("body").append('<div id="'+element_id+'"></div>');$.ui.dialog.defaults.bgiframe=false;element_id_jquery="#"+element_id;$(element_id_jquery).load("/mail-control/detail",{mailControl__code:c,token:a}).dialog({width:700,height:450,modal:true,title:"Mensagem enviada:"})})});