$(document).ready(function(){

    // set the cookies
    setCookie("isBrowserWinIE", $.browser.msie, "/", 1000);
    if(typeof window.navigator != 'undefined'){
	    setCookie("appVersion", window.navigator.appVersion, "/", 1000);
	    setCookie("appName", window.navigator.appName, "/", 1000);
    };

});

function getClientWidth() 
{
    return document.body && document.body.clientWidth ? document.body.clientWidth : -1;
};

function getClientHeight() 
{
    return document.body && document.body.clientHeight ? document.body.clientHeight : -1;
};

function onDocumentBodyResize()
{
    writeDocumentSizeCookies();
};

function writeDocumentSizeCookies(){
    setCookie("cw", getClientWidth(), "/", 1000);
    setCookie("ch", getClientHeight(), "/", 1000);
};

function isClientSizeAvailable(){
    var result = getCookie("cw") != 'null' && getCookie("ch") != 'null';
    return result;
};

function getUpdateClientSettingsUrl(){
    return getAjaxCommandUrl('UpdateClientSettings') + '&cw=' + getClientWidth() + '&ch=' + getClientHeight();
};





