// ====================================================
//	Filename:	openWin.js
//	Author:		Taher Scherzay
//	Created: 	11/10/2004
//
//	Description: 	Open a new window
//
// 	Inbius Technology Partners
//	www.inbius.com
//
// ====================================================

// ====================================================
function	openWin(inURL, inName, inFeatures, inWidth, inHeight)
{
	var strURL = "";
	var strFeatures = "";
	var intWidth = 0;
	var intHeight = 0;
	var intLeft = 0;
	var intTop = 0;
	var strName = "";
	
	if (inURL == null)
		return;
	
	strURL = "" + inURL;
	if (inName != null)
		strName = "" + inName;
	
	if (inFeatures != null)
		strFeatures = "" + inFeatures;
	
	if (inWidth != null)
		if (!isNaN(parseInt(inWidth, 10)))
			intWidth = parseInt(inWidth, 10);
	
	if (inHeight != null)
		if (!isNaN(parseInt(inHeight, 10)))
			intHeight = parseInt(inHeight, 10);
	
	if (intWidth == 0)
		intWidth = 500;		// Default
		
	if (intHeight == 0)
		intHeight = 400;	// Default
	
	strFeatures = strFeatures.toLowerCase();
	
	if (strFeatures.indexOf("scrollbars") == -1)
	{
		if (strFeatures.length > 0)
			strFeatures = strFeatures + ",";
		strFeatures = strFeatures + "scrollbars=1";
	}
	
	if (strFeatures.indexOf("resizable") == -1)
	{
		if (strFeatures.length > 0)
			strFeatures = strFeatures + ",";
		strFeatures = strFeatures + "resizable=1";
	}
	
	if (window.screen != null)
	{
		intLeft = (window.screen.width / 2) - (intWidth / 2);
		intTop = (window.screen.height / 2) - (intHeight / 2);
	
	}
	
	strFeatures = "width=" + intWidth + ",height=" + intHeight + "," + strFeatures;
	strFeatures = strFeatures + ",left=" + intLeft + ",top=" + intTop;
	
	window.open(strURL, strName, strFeatures);
}
