﻿// JScript File

function PlaceDivs()
{
    var myHeight = 0;
    var myWidth = 0;
    var strPx = document.childNodes ? 'px' : 0;
    var k = 768;
    
    //Get window height and width
    if( typeof( window.innerHeight ) == 'number' )
    {
        //Non-IE
        myHeight = window.innerHeight;
        myWidth = window.innerWidth;
    }
    else if( document.documentElement
        && document.documentElement.clientHeight )
    {
        //IE 6+ in 'standards compliant mode'
        myHeight = document.documentElement.clientHeight;
        myWidth = document.documentElement.clientWidth;
    }
    else if( document.body && document.body.clientHeight )
    {
        //IE 4 compatible
        myHeight = document.body.clientHeight;
        myWidth = document.body.clientWidth;
    }
    
    //position div#floating and div#links
    var c = myWidth + (myWidth % 2);
    var offset = (c - k) / 2 + 140;
    if( offset < 140 ) offset = 140;
    document.getElementById('links').style.left = offset + strPx;
    offset = offset + 81;
    document.getElementById('floating').style.left = offset + strPx;
    
    //set div#links visibility
    if( (myHeight < 595) || (myWidth < 814) )
    {
        document.getElementById('links').style.visibility = 'hidden';
        document.getElementById('links').style.display = 'none';
    }
    else
    {
        document.getElementById('links').style.visibility = 'visible';
        document.getElementById('links').style.display = 'block';
    }
    
    //set div#outside height
    document.getElementById('outside').style.height = myHeight + strPx;
}