////////// Simple Popup Window /////////////
var popWin = null;
function openPop(sURL, nWidth, nHeight, nLeft, nTop) {
	var sFeatures= "";
	closePop();
	if (openPop.arguments.length < 2)
		nWidth = 100;
	if (openPop.arguments.length < 3)
		nHeight = 100;

	sFeatures = "width="+nWidth+",height="+nHeight

	if (openPop.arguments.length < 4 || nLeft == "center")
		sFeatures = sFeatures + centerPop(nWidth,nHeight);
	else
		sFeatures = sFeatures + ",screenX="+nLeft+",left="+nLeft+",screenY="+nTop+",top="+nTop;

	sFeatures = sFeatures + ",menubar=no"
	popWin = window.open(sURL, "popWin", sFeatures);
}
function closePop() {
	if (navigator.appName != "Microsoft Internet Explorer" || parseInt(navigator.appVersion) >= 4)
		if(popWin != null) 
			if(!popWin.closed) popWin.close() 
}
function centerPop(nWidth, nHeight) {
	var nLeft, nTop;
	
	nLeft = (screen.width - nWidth) / 2;
	nTop = (screen.height - nHeight) / 2 - 20;

	return ",screenX=" + nLeft + ",left=" + nLeft + ",screenY=" + nTop + ",top=" + nTop;
}

