var address = {}; var _stateCodes = ['AA', 'AE', 'AK', 'AL', 'AP', 'AR', 'AS', 'AZ', 'CA', 'CO', 'CT', 'DC', 'DE', 'FL', 'FM', 'GA', 'GU', 'HI', 'IA', 'ID', 'IL', 'IN', 'KS', 'KY', 'LA', 'MA', 'MD', 'ME', 'MH', 'MI', 'MN', 'MO', 'MP', 'MS', 'MT', 'NC', 'ND', 'NE', 'NH', 'NJ', 'NM', 'NV', 'NY', 'OH', 'OK', 'OR', 'PA', 'PR', 'PW', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VA', 'VI', 'VT', 'WA', 'WI', 'WV', 'WY']; var _returnedValuation = false; var _numRetries = 0; var _selState = ""; var _returnedRates = false; var _hasAURates = false; var _auLogo = ""; var _ssAddressStatus = ""; var _waiterRetries = 0; var _waiterId; var _geoId; var _geoRetries = 0; var _baseUrl = ""; var _auTerm = 6; // IE Compatibiliity Mode $(document).ready(function () { SetupOnChangeEvents(); }); // Modern browsers function postBackInit() { SetupOnChangeEvents(); } // page loaded set up function SetupOnChangeEvents() { if (window.addEventListener) { window.addEventListener("message", onCookieCheckFromIFrameParent, false); } else if (window.attachEvent) { window.attachEvent("onmessage", onCookieCheckFromIFrameParent, false); } if (isFramed()) { window.parent.postMessage({ "cookieCheck": "checkCookies" }, "*"); } $(".page").show(); $("#pgOwnership").hide(); $("#pgDetails").hide(); $("#pgCondition").hide(); $("#pgDiscounts").hide(); $("#pgContents").hide(); $("#pgContact").hide(); $("#pgResults").hide(); $("#pgContactMethod").hide(); $("#pgCallTiming").hide(); $("#pgCombinedChoice").hide(); $("#addressConfirmsection").hide(); $("#pgApplicant").hide(); $("#EQInsurancePan").hide(); $("#WindstormInsurancePan").hide(); $("#pgAddlLob").hide(); if ($("#hubAltair").val().toLowerCase() == "true") { $(".AgencyMessageContainer").addClass("AgencyMessageContainerAltair").removeClass("AgencyMessageContainer"); } _baseUrl = window.location.href; _baseUrl = _baseUrl.substr(0, _baseUrl.indexOf("/prop")); if (window.location.href === _baseUrl + "/property" || window.location.href === _baseUrl + "/property/" || window.location.href.indexOf("property?") > 0 || window.location.href.indexOf("property/?") > 0) { doPageView("Name and Address"); } if ($("#GreetingTxt").html() == "") { $(".description").hide(); } $(window).on('popstate', function (e) { var state = e.originalEvent.state; if (state !== null) { var prevPg = $("#prevPage").val(); if (prevPg != "") { $(".page").hide(); $("#" + prevPg).show(); var pgTitle = getPrevPgTitle(prevPg); history.pushState(prevPg, null, pgTitle); // now assign new prevPage value var res = $("#visitedPages").val().split("|"); var foundIndex = -1; for (var x = 0; x < res.length; x++) { if (res[x] == prevPg) { foundIndex = x; break; } } if (foundIndex > -1) { if (foundIndex > 0) foundIndex = foundIndex - 1; $("#prevPage").val(res[foundIndex]); } else { $("#prevPage").val(""); } } return false; } }); if (location.search.indexOf("clearsession") > 0) { $("#RefreshPgToShow").val("step1"); $("#RefreshVisitedPages").val(""); $("#RefreshPrevPage").val(""); $("#RefreshScripts").text("Itc.ConsumerRater.Utilities.clearForm();"); } if ($("#RefreshPgToShow").val() !== "") { $("#loading-div-background").hide(); $("#disclaimerAbove").hide(); $(".page").hide(); $(".page").hide(); var showPg = "#" + $("#RefreshPgToShow").val(); $("#visistedPages").val($("#RefreshVisitedPages").val()); $("#RefreshVisitedPages").val(""); $("#prevPage").val($("#RefreshPrevPage").val()); $("#RefreshPrevPage").val(""); if ($("#RefreshScripts").text() !== "") { var rs = $("#RefreshScripts").text(); eval(rs); $("#RefreshScripts").text(""); } $(showPg).show(); $("#RefreshPgToShow").val(""); scrollToTop(); } if (location.search.indexOf("abpid") > 0) { $("#loading-div-background").show(); $.ajax({ type: "GET", url: _baseUrl + "/api/GetReturnToQuotePage", contentType: "application/json; charset=utf-8", processData: false, dataType: "json", success: function (data) { if (JSON.stringify(data).length > 1) { var pageInfo = JSON.parse(data); if (pageInfo.FieldControls != null && pageInfo.FieldControls.length > 0) { var controls = pageInfo.FieldControls; $.each(controls, function (i) { if (controls[i].IsVisible === false) { $("#" + controls[i].InputContainerName).hide(); } else { if (controls[i].IsRequired) { $("#" + controls[i].ControlName).prop("required", "true"); } if (controls[i].FieldValues != null) { $("#" + controls[i].ControlName + " option").remove(); for (var x = 0; x < controls[i].FieldValues.length; x++) { $('