var popupCount = 0;

function openPopupWindow (url, width, height, options, winName)
{
	if (width == null) width = 400;
	if (height == null) height = 500;
	
	var windowName = winName ? winName : "popup" + (popupCount ++);
	var o = "width=" + width + ",height=" + height + (options ? ("," + options) : "");
	var p = window.open(url, windowName, o);
}