var _globalWin;

function popUpPic( picName, width, height) {
	if( _globalWin ) { _globalWin.close(); _globalWin = null; }
	var oWin = window.open( "/mail-server/popup.php?pic=" + picName, "", "resizable=1,top=0,left=0,height="+ height +",width="+width );
	_globalWin = oWin;	
	
	var iScreen = Browser.getVisibleSize();
	var iLeft = Math.floor((iScreen[0] - width) / 2);
	var iTop = Math.floor((iScreen[1] - height) / 2);

	oWin.moveTo(iLeft, iTop + 20);

}

function popUp( src, width, height) {
	if( _globalWin ) { _globalWin.close(); _globalWin = null; }
	var oWin = window.open( src, "", "resizable=1,top=0,left=0,height="+ height +",width="+width );
	_globalWin = oWin;	
	
	var iScreen = Browser.getVisibleSize();
	var iLeft = Math.floor((iScreen[0] - width) / 2);
	var iTop = Math.floor((iScreen[1] - height) / 2);

	oWin.moveTo(iLeft, iTop + 20);

}

function popitup(url) {
	if	(screen.width < 1280)	{
		iWidth = 768;
		iHeight = 432;
	}
	else	{
		iWidth = 960;
		iHeight = 540;
	}

	winwindow=window.open(url,'wow','height=' + iHeight + ',width=' + iWidth);
	
	var iLeft = Math.floor((screen.width - iWidth) / 2);
	var iTop = Math.floor((screen.height - iHeight) / 2);

	winwindow.moveTo(iLeft, iTop);
	
	if (window.focus) {winwindow.focus()}
	return false;
}

function autoresize()	{
	if (screen.width < 1024)	{
		self.resizeTo(774,505);

		var iLeft = Math.floor((screen.width - 768) / 2);
		var iTop = Math.floor((screen.height - 432) / 2);
	
		self.moveTo(iLeft, iTop + 20);
	}
}

function navigateOut()	{
	self.opener.location = "/mail-server/business/";
	self.close();
}