
function HighlightMenuItem(id,offset){
	var El = document.getElementById(id);
	El.style.backgroundPosition = '-'+offset+'px';
}

function SetupRoot(){
	
	var DIV=document.getElementById('root');
	DIV.style.visibility='visible';	

	PositionDIV();
	
	if (window.attachEvent){
		window.attachEvent('onresize',PositionDIV);
	}
	else{
		window.addEventListener('resize', PositionDIV, false);
	}
}	
			
function PositionDIV(){
	
	if (self.innerWidth)
	{
		Width = self.innerWidth-18;
		Height = self.innerHeight;
	}	
	else if (document.documentElement && document.documentElement.clientWidth)
	{
		Width = document.documentElement.clientWidth;
		Height = document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		Width = document.body.clientWidth;
		Height = document.body.clientHeight;
	}

	Top=Math.floor((Height-668)/2);
	if (Top<0) Top=0;
	DIV=document.getElementById('root');
	DIV.style.marginTop=Top+'px';	
}

function OpenWindow(url,target,width,height){

	var x=screen.width;
	x=Math.floor(x-width)/2;
	var y=screen.height;
	y=Math.floor(y-height)/2;
	
	var cmd="window.open('"+url+"','"+target+"','width="+width+",height="+height+",left="+x+",top="+y+"');";
	eval(cmd);
}
