// filename: openWin.js
// revisions:
// 7/24/2003 - created function openWin

function openWin(url, winWidth, winHeight, winFeatures, winName)
{
	var popupWin;
	var args = "resizable=yes,scrollbars=yes";	// default window features
	
	if (winWidth && winHeight)
		args += ",width=" + winWidth + ",height=" + winHeight;
	else if (winWidth)
		args += ",width=" + winWidth + ",height=480";
	else if (winHeight)
		args += ",width=600,height=" + winHeight;
	else
		args += ",width=600,height=480";

	if (winFeatures && ((typeof winFeatures) == "string"))
	{
		args += (winFeatures.indexOf("location") == -1) ? ",location=no" : ",location=yes";
		args += (winFeatures.indexOf("status") == -1) ? ",status=no" : ",status=yes";
		args += (winFeatures.indexOf("menubar") == -1) ? ",menubar=no" : ",menubar=yes";
		args += (winFeatures.indexOf("toolbar") == -1) ? ",toolbar=no" : ",toolbar=yes";
	}

	if (winName)
		popupWin = window.open(url, winName, args);
	else
		popupWin = window.open(url, 'popup', args);
}
