function get_client_width()
{
	win_width = window.innerWidth; // netscape
	if (document.body) // ie
	{
		win_width = document.body.clientWidth;
	}
	if (win_width == 0 && document.documentElement && document.documentElement.clientWidth)
	{
		win_width = document.documentElement.clientWidth;
	}
	return win_width;
}

function get_client_height()
{
	win_height = window.innerHeight; // netscape
	if (document.body) // ie
	{
		win_height = document.body.clientHeight;
	}
	if (win_height == 0 && document.documentElement && document.documentElement.clientWidth)
	{
		win_height = document.documentElement.clientHeight;
	}
	return win_height;
}

var popUpWin=0;
function popup_window(URLStr, w, h, scrollbars, resizable, menubar, toolbar, location, directories, status, copyhistory)
{
	if (scrollbars == ''){ scrollbars = 'no'; }
	if (resizable == ''){ resizable = 'no'; }
	if (menubar == ''){ menubar = 'no'; }
	if (toolbar == ''){ toolbar = 'no'; }
	if (location == ''){ location = 'no'; }
	if (directories == ''){ directories = 'no'; }
	if (status == ''){ status = 'no'; }
	if (copyhistory == ''){ copyhistory = 'no'; }
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	var xsize = w;
	var ysize = h;
	var DocumentWidth = parseInt(get_client_width());
	var DocumentHeight = parseInt(get_client_height());
	var xpos = (DocumentWidth/2)-(xsize/2);
	var ypos = (DocumentHeight/2)-(ysize/2);
	
	popUpWin = open(URLStr, 'popUpWin', 'toolbar='+toolbar+',location='+location+',directories='+directories+',status='+status+',menubar='+menubar+',scrollbars='+scrollbars+',resizable='+resizable+',copyhistory='+copyhistory+', width='+xsize+',height='+ysize+',left='+xpos+',top='+ypos);
	if (popUpWin.opener == null)
		popUpWin.opener = self;
	popUpWin.focus();
	return false;
}