var contentWidth;



function initPage()
{
   resizeRLborder();
   contentWidth = getWidth(document.getElementById('pageFrame'));
   centerContent();
}


function resizeRLborder()
{
   var contentHeight = getHeight(document.getElementById('content'));
   
   document.getElementById('frameLeft').style.height = contentHeight + 'px';
   document.getElementById('frameRight').style.height = contentHeight + 'px';
}


function centerContent()
{
   //return
   
   var windowWidth = getWinWidth(),
       leftMargin = Math.round((windowWidth - contentWidth) / 2);
       
   if(leftMargin < 0){
      leftMargin = 0;
   }
   document.getElementById('pageFrame').style.marginLeft = leftMargin + 'px';
   var menuL2x = (windowWidth - leftMargin - 110) + 'px';
   // alert(menuL2x);
   document.getElementById('TransMenu0').style.left = menuL2x;
//   document.getElementById('TransMenu1').style.left = menuL2x;
}


function getPos(obj) 
{
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function getHeight(obj)
{
   return obj.offsetHeight;
}

function getWidth(obj)
{
   return obj.offsetWidth;
}

function getWinWidth()
{
   if (window.innerWidth) {
      return window.innerWidth;
   } else if (document.body.clientWidth) {
      return document.body.clientWidth;
   }
   return 0;
}
