/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function $(id){return document.getElementById(id);}

var myWidth = 0;
var myHeight = 0;
var scrOfX = 0;
var scrOfY = 0;

window.onresize = function(){
  bgResize();

  

}

function bgResize()
{

  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;
  }




  if(myWidth/myHeight > 1.5 )
  {
      $('mainbackground').style.width=myWidth+'px';
      $('mainbackground').style.height='auto';
      offset = (myWidth/1.5-myHeight)/2;
      $('mainbackground').style.top='-'+offset+'px';
      $('mainbackground').style.left='0';


  }
  else
    {
        $('mainbackground').style.width='auto';
        $('mainbackground').style.height=myHeight+'px';
        offset = (1.5*myHeight-myWidth)/2;
        $('mainbackground').style.left='-'+offset+'px';
        $('mainbackground').style.top='0';
    }
    msWidth = myWidth-197;
    $('mainsection').style.width=msWidth+'px';
    if(  $('mainsection').offsetHeight  < myHeight )
    $('mainsection').style.height=myHeight+'px';
}
/*
window.onscroll = function(){
    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;
      }

    $("backgroundwrapper").style.top=scrOfY+'px';
}
*/


