
function open_window(sURL, sTitle, bHasMenuFeatures)
{
	var sMenuFeatures = "";
	var sPositionFeatures = "";
	var iWidth = 600	//Less than  the standard pwc min width
	var iHeight = 600	//Less than  the standard pwc min height
	var iTop = (window.screen.availHeight - iHeight) / 2 //centered
	var iLeft = (window.screen.availWidth - iWidth) / 2 //centered
	
	if(!bHasMenuFeatures){
		sPositionFeatures = "\"status=no,top=" + iTop + ",left=" + iLeft + ",height=" + iHeight + ",width=" + iWidth + ",resizable=yes,"
		sMenuFeatures = "toolbar=no,menubar=no,location=no";
	}
	else{
		sPositionFeatures = ""
		sMenuFeatures = "";
	}
 	 
	 var sFeatures = sPositionFeatures + sMenuFeatures
 	 var oWin = window.open(sURL,'ecad_window',sFeatures)
	 
 	//We might be required to title the document...
 	if(sTitle)
 	{
		oWin.document.title = sTitle;
	}
	
}
//-----------------------------------------------------------
function dostyles(oObj, sStyles)
{
	
	//Receives the standard style notation, splitting by semi-colon to separate styles then colon for attribute name/val pairs
	vStyles = sStyles.split(";"); 
	for(var i=0; i<vStyles.length; i++)
	{
		if(vStyles[i])
		{
			sStyle = vStyles[i].toString().toLowerCase()
			vNameVal = sStyle.split(":");
			eval("oObj.style." + vNameVal[0] + "='" + vNameVal[1] + "'")
		}
	}
}
