// postcode defaulting to 6000.
var WA_OFFSETS = [-480, -540];


/** Returns a code for the current page; 'residential' or 'business'. */
var getPageType = function() {
    var check = /business/;
    var rtn = '';
    var url = document.location.toString();
    if (url.match(check))
        rtn = 'business';
    else
        rtn = 'residential';
    return(rtn);
};


var getWeather = function(postcode) {
   if ((weatherTabs) && (weatherTabs.getWeather))
      weatherTabs.getWeather(postcode);
};

var setHeadingText = function(e, text) {
                        $(e).text(text);
                     };

var updateLatestNews = function() {
                        //newsTabs.refresh();
                        jQuery("share_price").load("stock-quote.html");
                       };

jQuery(function() {
    // Update every 5 minutes.
    window.setInterval(function() {  updateLatestNews(); },  5 * 60 * 1000);
    var postcode = $.profile("postcode");         
    if (postcode) 
        $("#postcode").attr("value", postcode);
                                                                                
    getWeather();
    sIFR.replace(bernMedium, { selector: ".headline h4", css: ".sIFR-root { color: #ffffff; text-decoration: none; } a { color: #ffffff; text-decoration: none; } a:hover { color: #ffffff; text-decoration: none; }" });
});


