﻿//--IE6
function getScrollXY() {
    var scrOfX = 0, scrOfY = 0;
    if (typeof (window.pageYOffset) == 'number') {
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
    } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
    } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
    }
    return [scrOfX, scrOfY];
}
function getSizes() {
    var myWidth = 0, myHeight = 0;
    if (typeof (window.innerWidth) == 'number') {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }
    return [myWidth, myHeight]
}
function resizeWindowPopupOnScrollOrResize() {
    var size = getSizes()
    var scroll = getScrollXY()

    curH = $('#divBodyFade:visible').height();
    curW = $('#divBodyFade:visible').width();
    if (curH != null || curW != null) {
        $('#divBodyFade:visible').height(size[1] + scroll[1]);
        $('#divBodyFade:visible').width(size[0] + scroll[0]);

        $('.inlineWindow').css({ 'top': scroll[1] + parseInt(size[1] / 2) - parseInt($('.inlineWindow').height() / 2)
                , 'left': scroll[0] + parseInt(size[0] / 2) - parseInt($('.inlineWindow').width() / 2)
        });
    }
}
function PopWindowFixIE6() {
    if (isIE6 == true) {
        $('#divBodyFade:visible').height($('#Main').height());
        alert("ok");
        resizeWindowPopupOnScrollOrResize();
    }
}
$(document).ready(function() {
    if (isIE6 == true) {
        window.onscroll = function() {
            resizeWindowPopupOnScrollOrResize()
        }
        window.onresize = function() {
            resizeWindowPopupOnScrollOrResize()
        }
    }
    
    if (jQuery.browser.msie6 = jQuery.browser.msie && parseInt(jQuery.browser.version) == 6) {
        $(".sidenav .side").css("position", "relative");
        
        $(".sidenav .side .divBubbleSmall").css({ position: "absolute"  });
        $(".sidenav .side .divBubbleMedium").css({ position: "absolute"  });
        $(".sidenav .side .divBubbleLarge").css({ position: "absolute"  });
    }

    
});
    
