﻿function sh(o, h) {
    o.style.height = parseInt(h) + "px";
}
function r(sender) {
    var height = window.innerHeight;
    if (document.body) {
        if (document.body.clientHeight) {
            height = document.body.clientHeight;
        }
    }

    if (sender == null) sender = document.getElementById('s1');
    if (sender == null) sender = document.getElementById('s2');

    if (sender != null) {
        if (document.body.className == 'h') {
            height = (height - sender.offsetTop - 8) / 2;
        }
        else {
            height = height - sender.offsetTop - 8;
        }

        sh(document.getElementById('s1'), height);
        sh(document.getElementById('s2'), height);
    }
}
function f() {
    document.getElementById('s0').focus();
}
function s(sl) {
    document.body.className = sl;
    cc('s', sl, 30);
    r(); 
    return false;
}

function cc(name, value, days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
        var expires = "; expires=" + date.toGMTString();
    }
    else var expires = "";
    document.cookie = name + "=" + value + expires + "; path=/";
}

window.onresize = function() { r(null); };
window.onload = f;

