function addCityAutoComplete(a, b, d, c) { a = null == a || "" == a ? "#city" : a; b = getAutoCompleteOptions("/Components/ZipCodeCityLookup.asp", b, d, 3, c); addAutocompleteToField(a, b) } function addZipAutoComplete(a, b, d, c) { a = null == a || "" == a ? "#zip1" : a; b = getAutoCompleteOptions("/Components/ZipCodeCityLookup.asp", b, d, 3, c); addAutocompleteToField(a, b) }
function showStateFieldForAutoComplete(a, b, d, c, e, g, h) {
    var a = null == a || "" == a ? "#cn" : a, b = null == b || "" == b ? "#StateFieldCnt" : b, c = null == c ? "" : c, d = null == d || "" == d ? "#NewStateCode" : d, h = null == h ? !1 : h, f = "", i = d.substr(1, d.length), a = getCountryIDSelectedValue(a); "function" == typeof g && g(); h && (f = "&fltr=y"); "function" != typeof e && (e = function() { var a = "<label for='" + i + "'>State/Province</label>", c = jQuery(b).html(); jQuery(b).html(a + c) }); c = jQueryGetAjaxOptions(b, "/Components/GetStateListBoxForCountry.asp", "CountryID=" + a + "&StateValue=" +
c + "&Name=" + i + f, null, e); jQuery.ajax(c)
} function showMultiSelectStateFieldForAutoComplete(a, b, d, c, e, g) { b = null == b || "" == b ? "#StateFieldCnt" : b; c = null == c ? "" : c; a = jQuery("#cn option:selected").val(); "function" == typeof g && g(); b = jQueryGetAjaxOptions(b, "/Components/GetStateMultiSelectListBoxForCountry.asp", "CountryID=" + a + "&Sel=" + c, null, e); jQuery.ajax(b) }
function initZipCodeAutoComplete(a, b, d, c) {
    var a = null == a || "" == a ? "#cn" : a, b = null == b || "" == b ? "#zip1" : b, d = null == d || "" == d ? "#city" : d, c = null == c || "" == c ? "#NewStateCode" : c, e = function() { return getLastTermValue(b) }; addZipAutoComplete(b, { ZipCode: e }, getDefaultListItemsForZipCode, function(g, h) {
        var f = h.split(","), i = f[0], j = f[1], f = 3 == f.length ? f[2] : e(); jQuery(b).val(f); jQuery(d).val(i); jQuery("select" + c).attr("multiple") ? jQuery("select" + c + " option:selected").each(function() { jQuery(this).attr("selected", "") }) : jQuery("select" +
c + " option:first").attr("selected", "selected"); jQuery("select" + c + " [value='" + j + "']").attr("selected", "selected"); removeZipCodeOnBlurEvent(a, b, d, c)
    })
}
function initCityAutoComplete(a, b, d) {
    a = null == a || "" == a ? "#city" : a; b = null == b || "" == b ? "#NewStateCode" : b; blnUseZipAutocomplete = null != d; addCityAutoComplete(a, { City: function() { return getLastTermValue(a) } }, getDefaultListItemsForZipCode, function(c, e) {
        var g = e.split(","), h = g[0], f = g[1]; if (blnUseZipAutocomplete) var i = g[2]; jQuery(a).val(h); jQuery("select" + b).attr("multiple") ? jQuery("select" + b + " option:selected").each(function() { jQuery(this).attr("selected", "") }) : jQuery("select" + b + " option:first").attr("selected",
"selected"); blnUseZipAutocomplete && jQuery(d).val(i); jQuery("select" + b + " [value='" + f + "']").attr("selected", "selected")
    })
}
function setupAutoCompleteForCountry(a, b, d, c) { var a = null == a || "" == a ? "#cn" : a, b = null == b || "" == b ? "#zip1" : b, d = null == d || "" == d ? "#city" : d, c = null == c || "" == c ? "#NewStateCode" : c, e = getCountryIDSelectedValue(a); allowAutoCompleteForCountry(e) ? (initZipCodeAutoComplete(a, b, d, c), initCityAutoComplete(d, c), addZipCodeOnBlurEvent(b, d, c)) : (removeAutocompleteFromField(b + "," + d), removeZipCodeOnBlurEvent(a, b, d, c)) } function initZipCodeBlurEvent() { } function addZipCodeOnBlurEvent() { } function removeZipCodeOnBlurEvent() { }
function getAutoCompleteOptions(a, b, d, c, e, g) {
    return { minLength: c, source: function(c, e) { jQuery.getJSON(a, b, function(a) { null == a || jsonResponseHasError(a) ? jQuery(":input:not(:hidden,:button).ui-autocomplete-input").each(function() { jQuery(this).hasClass("ui-autocomplete-loading") && jQuery(this).removeClass("ui-autocomplete-loading") }) : e(jQuery.map(a.Response.Records, d)) }) }, search: function() { "function" != typeof g && (g = function(a) { return "" != a }); return g(this.value) }, focus: function() { return !1 }, select: function(a,
b) { "function" == typeof e ? e(this.value, b.item.value) : this.value = b.item.value; return !1 } }
    } function allowAutoCompleteForCountry(a) { a = parseInt(a); return 1 == a || 2 == a ? !0 : !1 } function getCountryIDSelectedValue(a) { a = jQuery("select" + (null == a || "" == a ? "#cn" : a) + " option:selected").val(); a = parseInt(a); if (isNaN(a) || 0 > a) a = 1; return a } function getLastTermValue(a) { return jQuery(a).val() }
    function getDefaultListItemsForZipCode(a) { var b = toProperCase(a.City), d = a.State, a = a.ZipCode; return { label: b + ", " + d + ", " + a, value: b + "," + d + "," + a} } function getDefaultListItemsForCity(a) { var b = toProperCase(a.City), d = a.State, a = a.ZipCode; return { label: b + ", " + d + ", " + a, value: b + "," + d + "," + a} } function getCityRegExForAutocomplete() { return /^(?:[a-z]|\.|\s)+?$/gi } function getDefaultPostalCodeRegExForAutocomplete() { return /^[0-9]+?$/g }
    function getCanadianPostalCodeRegExForAutocomplete() { return /^([a-z][0-9]\w?)+?$/gi }
    function initJobLocationAutoComplete(a, b) {
        jQuery(a).keyup(function() {
            var d = getLastTermValue(a); if (!(2 > d.length)) {
                var c = function() { null != b && jQuery(b).attr("autocomplete", "off") }, e = function(b) { jQuery(a).bind("blur", function() { initLocationBlurEvent(a, b); setTimeout(function() { closeAutocompleteForField(a) }, 500) }) }, g = getCityRegExForAutocomplete(), h = getDefaultPostalCodeRegExForAutocomplete(), f = getCanadianPostalCodeRegExForAutocomplete(); g.test(d) ? (initLocationCityAutoComplete(a), c(), e("city")) : f.test(d) ||
h.test(d) ? (initLocationZipCodeAutoComplete(a), c(), e("zip")) : removeAutocompleteFromField(a)
            } 
        })
    } function initLocationCityAutoComplete(a) { a = null == a || "" == a ? "#city" : a; addCityAutoComplete(a, { City: function() { return getLastTermValue(a) } }, getDefaultListItemsForCity, function(b, d) { var c = d.split(","), e = c[0], c = c[1]; jQuery(a).val(e + ", " + c); removeLocationBlurEvent(a) }) }
    function initLocationZipCodeAutoComplete(a) { a = null == a || "" == a ? "#zip1" : a; addZipAutoComplete(a, { ZipCode: function() { return getLastTermValue(a) } }, getDefaultListItemsForZipCode, function(b, d) { var c = d.split(",")[2]; jQuery(a).val(c); removeLocationBlurEvent(a) }) } function initLocationBlurEvent() { } function removeLocationBlurEvent() { }
    function initAutoCompleteForZipCodeOnly(a) { a = null == a || "" == a ? "#zip1" : a; addZipAutoComplete(a, { ZipCode: function() { return getLastTermValue(a) } }, getDefaultListItemsForZipCode, function(b, d) { var c = d.split(",")[2]; jQuery(a).val(c); removeOnBlurEventForZipCodeOnly(a) }) } function addOnBlurEventForZipCodeOnly() { } function initOnBlurEventForZipCodeOnly() { } function removeOnBlurEventForZipCodeOnly() { }
    function initAutocompleteForLocationFields(a, b) {
        null == a && (a = ""); var d = !1, c = "#PostalCode" + a, e = "#City" + a, g = "#CountryID" + a, h = "#StateFieldCnt" + a, f = "#StateCode" + a, i = "#OrigStateCode" + a, j = function(a) { showStateFieldForAutoComplete(g, h, f, a, function() { }, k, b) }, k = function() {
            var a = getCountryIDSelectedValue(g); allowAutoCompleteForCountry(a) ? d ? (initZipCodeAutoComplete(g, c, e, f), addZipCodeOnBlurEvent(c, e, f), initCityAutoComplete(e, f, c)) : initCityAutoComplete(e, f) : (d && (removeAutocompleteFromField(c), removeZipCodeOnBlurEvent(g,
c, e, f)), removeAutocompleteFromField(e))
        }; jQuery("#locationFields" + a).ready(function() { (d = "1" == jQuery("#showPostalCode" + a).val()) ? (initZipCodeAutoComplete(g, c, e, f), addZipCodeOnBlurEvent(c, e, f), initCityAutoComplete(e, f, c)) : initCityAutoComplete(e, f); jQuery(g).change(function() { j() }); j(jQuery(i).val()) })
    } function addAutocompleteToField(a, b) { try { jQuery(a).autocomplete(b) } catch (d) { } } function removeAutocompleteFromField(a) { try { jQuery(a).autocomplete("destroy") } catch (b) { } }
    function closeAutocompleteForField(a) { try { jQuery(a).autocomplete("close") } catch (b) { } };
