function getWindowsSize() {
    var myWidth = 0;
    if (typeof (window.innerWidth) == 'number') {
        //Non-IE
        myWidth = window.innerWidth;        
    } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;        
    } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;        
    }
    return myWidth;
}

function getResultsDivSize() {
    var myWidth = 0;
    if (window.document.getElementById('ResultsContent') != null) {
        myWidth = window.document.getElementById('ResultsContent').offsetWidth;
    }
    return myWidth;
}


function sendWidthToServer(WindowSize, ResultsDivSize){
    var xmlHttp = null;
    // Mozilla, Opera, Safari sowie Internet Explorer (ab v7)
    if (typeof XMLHttpRequest != 'undefined') {
        xmlHttp = new XMLHttpRequest();
    }
    if (!xmlHttp) {
        // Internet Explorer 6 und älter
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {
                xmlHttp = null;
            }
        }
    }
    if (xmlHttp) {
        xmlHttp.open('GET', 'saveWindowSize.asp?WindowSize=' + WindowSize + '&ResultsDivSize=' + ResultsDivSize, true);
        /*
        xmlHttp.onreadystatechange = function() {
            if (xmlHttp.readyState == 4) {
                alert(xmlHttp.responseText);
            }
        };*/
        xmlHttp.send(null);
    }
}

sendWidthToServer(getWindowsSize(), getResultsDivSize());
