var wx;

function popup(url, win, args, center, fs) {
	var moreargs = '';

	var scrwidth = screen.width;
	var scrheight = screen.height;

	if (fs)	{
		moreargs = 'width='+scrwidth+',height='+scrheight+',left=0,top=0' + (args ? ','+args : args);
	}

	if (center) {
		var winwidth = (args.match(/width=(\d+)/i))[1];
		var winheight = (args.match(/height=(\d+)/i))[1];
		moreargs = ',left='+Math.round((scrwidth-winwidth)/2)+',top='+Math.round((scrheight-winheight)/2);
	}

	wx = window.open(url, win, args + moreargs);
	setTimeout('checkpopup()', 2000);
}

function checkpopup() {
	if ( (wx == null) || (!wx) || (wx.closed) ){
		alert("A popup blocker is not allowing " + location.host + " to work properly!\n\nPlease disable your popup blocker (or allow popups from " + location.host + ") for this site to work properly.");
	}

	wx = null;
}