/**** /community/_scripts/citypicker.js ****/

function calculateHW() {
    var viewWidth, viewHeight, bodyWidth, bodyHeight; bodyHeight = $(document).height(); bodyWidth = $(document).width(); if (self.innerHeight)
    { viewWidth = self.innerWidth; viewHeight = self.innerHeight; }
    else if (document.documentElement && document.documentElement.clientHeight) { viewWidth = document.documentElement.clientWidth; viewHeight = document.documentElement.clientHeight; }
    else if (document.body) { viewWidth = document.body.clientWidth; viewHeight = document.body.clientHeight; }
    if (viewWidth < 982) { bodyWidth = 982; }
    if (bodyHeight < viewHeight) { bodyHeight = viewHeight; }
    $('#dim_bg').css('height', bodyHeight); $('#dim_bg iframe').css('height', bodyHeight); $('#popupcitypicker').css('height', bodyHeight); $('#dim_bg').css('width', bodyWidth); $('#dim_bg iframe').css('width', bodyWidth); $('#popupcitypicker').css('width', bodyWidth); if (etagHelper) { etagHelper.addEtag({ "etag": "<%=this.CurrentPageContext.Etag %>" }); } 
}
function popupCityPicker() { if ($('#popupcitypicker').val() != undefined) { $('#dim_bg').show(); $('#dim_bg').css('opacity', 0.7).fadeTo('slow', 0.7); $('#popupcitypicker').show(); $('#popupcitypicker').css('opacity', 1).fadeTo('slow', 1); } }
function closeCityPicker() { $('#dim_bg').hide(); $('#popupcitypicker').hide(); }
function getCities(strValue) {
    var idx = cityPickerJson.length; while (idx) {
        idx--; if (cityPickerJson[idx].v == strValue)
            return cityPickerJson[idx].c;
    }
    return "";
}
function makeOptionsFragment(jsonCities) {
    var oFrag = document.createDocumentFragment(); var oTextNode = null, oElement = null, oAttribute = null; var idx = jsonCities.length; while (idx) { idx--; oText = document.createTextNode(jsonCities[idx].t); oElement = document.createElement("option"); oElement.appendChild(oText); oElement.setAttribute("value", jsonCities[idx].v); oFrag.appendChild(oElement); }
    return oFrag;
}
function pickState(oElem) { var oTarget = document.getElementById("ddlCity"); oTarget.options.length = 1; var cities = getCities(oElem.value); var oFrag = makeOptionsFragment(cities); oTarget.appendChild(oFrag); }
function pickCity(oElem) { window.location = "?citycode=" + oElem.value; }

/**** USB-CMMTY2 09/06/2010 06:09:51 ****/
