
function StoreLocator(zipBoxId, cityBoxId, ddlStateId, rangeOptionId, searchBtnId, ddlCountryId) {
    this.ZipBoxId = zipBoxId;
    this.CityBoxId = cityBoxId;
    this.DdlStateId = ddlStateId;
    this.RangeOptionId = rangeOptionId;
    this.SearchBtnId = searchBtnId;
    this.DdlCountryId = ddlCountryId;

    this.ValUSA = function(source, arguments) {
        /* This is attached to the State ddl but is just a general validation function */
        var country = $('#' + this.DdlCountryId).val();
        var zip = $('#' + this.ZipBoxId).val();
        var city = $('#' + this.CityBoxId).val();
        var state = $('#' + this.DdlStateId).val();
        if (country == 'US' && zip.length > 0 || (city.length > 0 && state != '00')) {
            arguments.IsValid = true;
        }
        else {
            arguments.IsValid = false;
        }
    }

    this.SearchFromCityMatchList = function(zip) {
        //Enter the zip in its text box
        //click the submit button
        //clear this so that the regular zip-based mode is used.
        $('#' + this.CityBoxId).val("");
        $('#' + this.ZipBoxId).val(zip);
        $('#' + this.RangeOptionId).val(50);
        $('#' + this.SearchBtnId).click();
    }
}


