
var popup_height=300;
var popup_width=500;

function setVisible(obj)
{
	var height;
	var top =10;
	var width;
	var left =10;
	
	popup_height=document.getElementById(obj).offsetHeight
	
	if (document.documentElement)
	{
		theLeft = document.documentElement.scrollLeft;
		theTop = document.documentElement.scrollTop;
		height=document.documentElement.clientHeight;
		width=document.documentElement.clientWidth;
	}
	else if (document.body)
	{
		theLeft = document.body.scrollLeft;
		theTop = document.body.scrollTop;
		height=document.body.clientHeight;
		width=document.body.clientWidth;
	}
	
	if(height>popup_height)
	{
		top=(height-popup_height)/2;
	}
	
	if(width>popup_width)
	{
		left=(width-popup_width)/2;
	}
	
	top=top+theTop;
	left=left+theLeft;

	obj = document.getElementById(obj);
	obj.style.visibility =  'visible';
	obj.style.top = top + 'px' ;
	obj.style.left = left + 'px' ;
}



function popup_startupdate(url)
{
	document.getElementById('popup_inner').innerHTML='<div align="center"><img src="/images/loading.gif"></div>'
	ajax.open("GET", url, true);
	ajax.onreadystatechange = popup_updateresponse;
	ajax.send(null);	
}

function popup_updateresponse()
{
	 if (ajax.readyState == 4)
	 {
	 	
	 	document.getElementById('popup_inner').innerHTML=ajax.responseText;	 	
	 }
}

function popup_close()
{
	obj = document.getElementById('popup');
	obj.style.visibility = 'hidden' ;
	
}
