function GetScreenSize() {  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 [ parseInt(myWidth), parseInt(myHeight) ];}function TopLayer(){    $('#TopLayerContent').each(function(){        var tlWidth = parseInt($(this).width());        var tlHeight = parseInt($(this).height());        var screenSize = GetScreenSize();        var pozycjaX = ((screenSize[0] - tlWidth) / 2) - 9;        var pozycjaY = (screenSize[1] - tlHeight) / 2;        //var pozycjaY = 163;        if (pozycjaX < 0) pozycjaX = 0;        if (pozycjaY < 0) pozycjaY = 0;        $(this).parent().css('width', screenSize[0] + 'px');        $(this).parent().css('height', screenSize[1] + 'px');        $(this).parent().css('left', '0px');        $(this).parent().css('top', '0px');        $(this).css('left', pozycjaX + 'px');        $(this).css('top', pozycjaY + 'px');        $('BODY').css('overflow-y', 'hidden');        $('#AvatarOpenHome').css('visibility', 'hidden');        $('#HomeBoxes').css('position', 'static');    });}function createCookie(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=/";}function TopLayerClose(){    var chb = $('#TopLayer').find('INPUT:eq(0)').attr('checked');    if (chb)    {        var nazwa = $('#TopLayer').find('INPUT:eq(0)').attr('name');        //createCookie(nazwa, 1, 365);    }    $('#TopLayer').css('left', '-3000px');    $('#TopLayer').css('top', '-3000px');    $('#TopLayer').css('visibility', 'hidden');    $('BODY').css('overflow-y', 'auto');    $('#HomeBoxes').css('position', 'relative');    $('#AvatarOpenHome').css('visibility', 'visible');    if (parseInt($('INPUT[name="avatarstart"]').val()) == 3)    {        $('#AvatarOpenHome').click();    }    $('#TopLayer').remove();}
