$(window).load(function(){subUrl=_HAN.IMPRESSION_ID;updateNextURL();core.writeTracking(core.affiliateId,_HAN.IMPRESSION_ID)});subUrl="none";fire.onLoad(function(){$("#zipcode").focus();var a;zip=$("#zipcode").val();if(version==="orange"){vUrl="&f_v=blue"}else{vUrl="&f_v=blue"}if(ads==="no"){adshown="&adsShown=false"}else{adshown="&adsShown=true"}if(alt!="true"){altUrl="&alt=false"}else{altUrl="&alt=true"}function b(){var c=$("#zipcode").val();zipError()}srcUrl="&src="+src;updateNextURL()});if(home=="true"){$("select option[value='Auto-Home']").attr("selected","selected")}function submitCompareApplyForm(){var a=$("#zipcode").val();if(a!=null&&a.isNumeric()&&a.trim().length==5){openNewForm()}else{zipError()}return false}function toggleAuto(a){if(a){$(".no-auto").fadeOut(0);$(".yes-auto").fadeIn(800)}else{$(".no-auto").fadeIn(800);$(".yes-auto").fadeOut(0)}}$("#zipcode, #ins_type").keydown(function(){updateNextURL()});$("#zipcode, #ins_type").change(function(){updateNextURL()});function updateNextURL(){var b=$("#ins_type").val();var a=$("#zipcode").val();$(".error-invalid").hide();switch(b){case"Auto":nextURL="/companies/?zipcode="+a+"&be=QUZGSUxJQVRFLTE3Njk%3D"+altUrl+adshown+srcUrl+vUrl;toggleAuto(true);break;case"Auto-Home":nextURL="/companies/?zipcode="+a+"&be=QUZGSUxJQVRFLTE3Njk%3D&insured=true"+altUrl+adshown+srcUrl+vUrl;toggleAuto(true);break;case"Home":nextURL="http://www.insureme.com/insurance-quotes.html?Refby=614368&refID=13138&Type=Home&afftrack=compareapply&zipcode="+a;toggleAuto(false);break;case"Life":nextURL="http://www.insureme.com/insurance-quotes.html?Refby=614368&refID=13138&Type=Life&afftrack=compareapply&zipcode="+a;toggleAuto(false);break;case"Health":nextURL="http://www.insureme.com/insurance-quotes.html?Refby=614368&refID=13138&Type=Health&afftrack=compareapply&zipcode="+a;toggleAuto(false);break}}function zipError(){$(".error-invalid").show()}function openNewForm(){var d=screen.width;var b=screen.height;var g=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;if(g){var d=d-40}var f=$("#ins_type").val();var c=$("#zipcode").val();var a=new Date();if(f=="Auto"){if(a.getTime()%2==0){var e="/affQuote?zipcode="+c+"&ic="+ic+"&f_id=affiliateQuoteForm-oneColumn&be=QUZGSUxJQVRFLTE3Njk%3D"+altUrl+adshown+srcUrl+vUrl+"&sub="+subUrl}else{var e="/affQuote?zipcode="+c+"&ic="+ic+"&f_id=affiliateQuoteForm-oneColumn&be=QUZGSUxJQVRFLTE3Njk%3D"+altUrl+adshown+srcUrl+vUrl+"&sub="+subUrl}window.open(e,null,"fullscreen=yes, toolbars=yes, scrollbars=yes, menubar=yes, location=yes, left=0, top=0, width="+d+",height="+b);window.location.href="/companies/?zipcode="+c+"&be=QUZGSUxJQVRFLTE3Njk%3D"+altUrl+adshown}if(f=="Auto-Home"){if(a.getTime()%2==0){var e="/affQuote?zipcode="+c+"&ic="+ic+"&f_id=affiliateQuoteForm-oneColumn&be=QUZGSUxJQVRFLTE3Njk%3D&insured=true"+altUrl+adshown+srcUrl+vUrl+"&sub="+subUrl}else{var e="/affQuote?zipcode="+c+"&ic="+ic+"&f_id=affiliateQuoteForm-oneColumn&be=QUZGSUxJQVRFLTE3Njk%3D&insured=true"+altUrl+adshown+srcUrl+vUrl+"&sub="+subUrl}window.open(e,null,"fullscreen=yes, toolbars=yes, scrollbars=yes, menubar=yes, location=yes, left=0, top=0, width="+d+",height="+b);window.location.href="/companies/?zipcode="+c+"&be=QUZGSUxJQVRFLTE3Njk%3D"+altUrl+adshown+srcUrl+vUrl}else{window.location.href=nextURL}};
