
function centerObjs()
{
 ///alert("Your resolution is "+screen.width+"x"+screen.height);
 centerBackground();
 centerBanner();
 centerContent();
 centerFooter();
}

function centerBackground()
{
 var body = document.body;
 var bg_width=1824;
 var bg_height=1368;
 var scr_height=getClientHeight();
 var scr_width=body.clientWidth;
 var xpos=((scr_width-bg_width)/2)+"px";
 var ypos=((scr_height-bg_height)/2)+"px";
 body.style.backgroundPosition=xpos+" "+ypos;
}

function centerBanner()
{
 var banner=document.getElementById("banner");
 var body = document.body;

 //var height=banner.offsetHeight;
 var width=banner.offsetWidth;
 //var scr_height=body.clientHeight;
 var scr_width=body.clientWidth;
 var ml=(scr_width-width)/2;
 banner.style.marginLeft=ml+"px";

}

function centerContent()
{
 var content=document.getElementById("content");
 var body = document.body;
 var scr_height=getClientHeight();
 var ch=scr_height-288;

 //var height=content.offsetHeight;
 var width=content.offsetWidth;
 //var scr_height=body.clientHeight;
 var scr_width=body.clientWidth;
 var ml=(scr_width-width)/2;
 content.style.marginLeft=ml+"px";
 content.style.height=ch+"px";

}


function centerFooter()
{
 var footer=document.getElementById("footer");
 var body = document.body;

 //var height=footer.clientHeight;
 var width=footer.clientWidth;
 //var scr_height=body.clientHeight;
 var scr_width=body.clientWidth;
 var ml=(scr_width-width)/2;
 footer.style.marginLeft=ml.toString()+"px";
}


function getClientHeight()
{
 var retVal=0;

 if(window.innerHeight)
 {
  if(window.innerHeight > 0) retVal=window.innerHeight;
 }

 if(document.body.clientHeight)
 {
  if(document.body.clientHeight > 0) retVal=document.body.clientHeight;
 }

 if(document.documentElement.clientHeight)
 {
  if(document.documentElement.clientHeight > 0) retVal=document.documentElement.clientHeight;
 }

 return retVal;
}
