function successHandler(o) {
    var root = o.responseXML;
    var oCondition = root.getElementsByTagName("condition")[0];
    if (oCondition == null) {
        oCondition = root.getElementsByTagName('yweather:condition').item(0);
    }
    var d = new Date();
    var dayNight;
    var curr_hour = d.getHours();
    dayNight = (curr_hour >= 17) ? "n" : "d";

    var oImage = '/images/weather/lg/' + oCondition.getAttribute('code') + dayNight + '.png';
    var oLink = root.getElementsByTagName('link')[0].firstChild.nodeValue;
    // var locTable1 = document.getElementById("locTable");
    var locTable1 = document.getElementById("pageitem");
    locTable1.style.backgroundImage = "url('" + oImage + "')";
    locTable1.style.backgroundRepeat = "no-repeat";
    locTable1.style.backgroundPosition = "center bottom";
    div.innerHTML = '<div>' + oCondition.getAttribute('text') + ' ' + oCondition.getAttribute('temp') + '&deg; F</div><div>' + '<a href="' + oLink +'"" style="font-size:10px;">Yahoo! Weather Forecast</a></div>';
}

function failureHandler(o) {
    div.innerHTML = o.status + " " + o.statusText;
}
function getModule(iZip) {
    var entryPoint = '/weather.aspx';
    var queryString = encodeURI('?p=' + iZip);
    var sUrl = entryPoint + queryString;
    var request = YAHOO.util.Connect.asyncRequest('GET', sUrl, { success: successHandler, failure: failureHandler });
}
var roundCorners = function() {
    Nifty("div.employee,#foc1,div.contact", "big transparent");
    Nifty("#virtualTour", "transparent");
};
function init() {
    div = document.getElementById('weatherModule');
    if (div) {
        div.style.marginTop = "10px";
        getModule(zipCode);
    }
}

function writeEmail(A) { addy2 = "oist.com"; addy1 = "ben"; addy = (A + "@" + addy1 + addy2); document.write('<a href="mailto:' + addy + '">' +  "E-mail Me!" + "</a>") }

YAHOO.util.Event.addListener(window, "load", init);
