﻿var myWidth = 0, myHeight = 0,maxHeight=380,scroll=0, marginHeightTop=0, marginWidthLeft=0;
var SiteHeight = 643;
var SiteWidth = 1004;
var IsSetMaxHeight = true;

  
function Resize() 
{
    //alert("do resize");
    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;
    }
    //alert('myWidth  ' + myWidth);
    if (myWidth > SiteWidth)
    {
        var marginWidth = myWidth - SiteWidth;
        marginWidthLeft = marginWidth /2;
    }
    
    if (myHeight > SiteHeight)
    {
        var marginHeight = myHeight - SiteHeight;
        marginHeightTop =   marginHeight /2;
        if ($('div_page'))
        {
            $('div_page').style.marginTop = marginHeightTop+"px";
        }
    }
    if($('DarkBackground'))
    {
        $('DarkBackground').style.width = myWidth+'px';
        $('DarkBackground').style.height = myHeight+'px';
    }
    if($('div_copyright'))
    {
       $('div_copyright').style.width = myWidth+'px';
       //$('div_copyright').style.height = myHeight+'px';
       $('div_copyright_intern').style.left = 232 + marginWidthLeft + 'px';
       $('div_copyright_intern').style.top = 50 + marginHeightTop + 'px';

    }
    if($('div_terms'))
    {
       $('div_terms').style.width = myWidth+'px';
       //$('div_terms').style.height = myHeight+'px';
       document.getElementById('div_terms_intern').style.left = 232 + marginWidthLeft + 'px';
       document.getElementById('div_terms_intern').style.top = 50 + marginHeightTop + 'px';

    }
    if(document.getElementById('div_disclaimer'))
    {
       document.getElementById('div_disclaimer').style.width = myWidth+'px';
       //document.getElementById('div_disclaimer').style.height = '200px';
       document.getElementById('div_disclaimer_intern').style.left = 232 + marginWidthLeft + 'px';
       document.getElementById('div_disclaimer_intern').style.top = 50 + marginHeightTop + 'px';
    }
    if(document.getElementById('div_map'))
    {
       document.getElementById('div_map').style.width = myWidth+'px';
       //document.getElementById('div_map').style.height = '200px';
       document.getElementById('div_map_intern').style.left = 132 + marginWidthLeft + 'px';
       document.getElementById('div_map_intern').style.top = 50 + marginHeightTop + 'px';
    }
    if(document.getElementById('div_uitlegIPsecurity'))
    {
       document.getElementById('div_uitlegIPsecurity').style.width = myWidth+'px';
       //document.getElementById('div_map').style.height = '200px';
       document.getElementById('div_uitlegIPsecurity_intern').style.left = 232 + marginWidthLeft + 'px';
       document.getElementById('div_uitlegIPsecurity_intern').style.top = 50 + marginHeightTop + 'px';
    }
    if(document.getElementById('div_security'))
    {
       document.getElementById('div_security').style.width = myWidth+'px';
       //document.getElementById('div_map').style.height = '200px';
       document.getElementById('div_security_intern').style.left = 232 + marginWidthLeft + 'px';
       document.getElementById('div_security_intern').style.top = 50 + marginHeightTop + 'px';
    }
}
    
 window.onload = Resize;
 window.onresize = Resize;
  