﻿var timer = setInterval("autoRefresh()", 1000 * 60 * 3);
function autoRefresh() { self.location.reload(true); }

applyOrientation = function () {
    var orientation = window.orientation;
    switch (orientation) {
        case 0:
            document.body.setAttribute("class", "portrait");
            break;
        case 90:
            document.body.setAttribute("class", "landscape");
            break;
        case -90:
            document.body.setAttribute("class", "landscape");
            break;
    }
}
window.onorientationchange = function () {
    // iphone bug unresolved where change to landscape auto zooms.
    applyOrientation();
}

textSizeCookieName = "sitename-FontSize";
textSizeInt = function () {
    //var originalFontSize = $("html").css("font-size");
    if ($.cookie(textSizeCookieName)) {
        var getSize = $.cookie(textSizeCookieName);
        $("html").css({ fontSize: correctTextSize(getSize) });
    }
}
textResize = function (s) {
    $.cookie(textSizeCookieName, s);
    $("html").css("font-size", correctTextSize(s));
}
correctTextSize = function (s) {
    if (navigator.userAgent.match(/OS 4_/i)) {
        if (s.toLowerCase() == "xx-large") return "15pt";
        if (s.toLowerCase() == "x-large") return "12pt";
        if (s.toLowerCase() == "large") return "9pt";
    }
    return s;
}    