// -------------------------------------
// Make corrections for window-size here
// -------------------------------------

x_mac_netsc_difference = 0;
y_mac_netsc_difference = 0;    
x_mac_expl_difference = 0;  
y_mac_expl_difference = 0;
x_win_netsc_difference = 0;
y_win_netsc_difference = 0;
x_win_expl_difference = 0;
y_win_expl_difference = 0;


// -------------------------------------
// Operations: (Don't change!)
// -------------------------------------

var active = 0;
var popnumber = -1;
var MyPopup = new Array();
bName = navigator.appName;
bApp = navigator.appVersion;
bVer = parseInt(navigator.appVersion); 
if((bName.indexOf('Netsc')>=0 && bVer>=3) || (bName.indexOf('Expl')>=0 && bVer>=3) || (bName.indexOf('OmniWeb')>=0 && bVer>=3)) active=1; // only openWindow
if((bName.indexOf('Netsc')>=0 && bVer>=4) || (bName.indexOf('Expl')>=0 && bVer>=4)) active=2; // openWindow & setWindowPosition

		
function openPopupCMS(url,x,y)
{
	if(bName.indexOf('Netsc')>=0)
	{
		if(bApp.indexOf('Mac')>=0){x=x+x_mac_netsc_difference;y=y+y_mac_netsc_difference;}
		else{x=x+x_win_netsc_difference;y=y+y_win_netsc_difference;}
	}
	if(bName.indexOf('Expl')>=0)
	{
		if(bApp.indexOf('Mac')>=0){x=x+x_mac_expl_difference;y=y+y_mac_expl_difference;}
		else{ x=x+x_win_expl_difference;y=y+y_win_expl_difference;}
	}
	popnumber++;
	parameterString = "width="+x+",height="+y+",scrollbars=yes,menubar=no,location=no,border=no,toolbar=no,resizable=no,status=no";
 	if(active!=0)
	{
		MyPopup[popnumber] = open(url,"popup2",parameterString);
		
		if(active==2)
		{
			x_position = Math.round((screen.width-x)/2);
			y_position = Math.round((screen.height-y)/2);
			window.setTimeout("MyPopup[popnumber].moveTo(x_position,y_position)",200);
			MyPopup[popnumber].focus();
		}
	}
}