/*
	Original Author:	Doug Cain
	
	Description:
	
	Attributes:
	
	Returns:
	
	$Header: /iPerformance/iperformance/webroot/ocf.js,v 1.2 2004/08/11 23:39:36 doug Exp $
*/

/* Used for xbuilder so it can deal with dynamically named files 
 Extract URL from the variable strURL 
*/

function _any3ParseUrl(strURL) {

	var strAfter = strURL.substring(strURL.indexOf("=")+1);
	var strParseURL = strAfter.substring(0,strAfter.indexOf(">"));

	return strParseURL
}

/* Popup window of iperformance */
function _any3PopupObject(root, objectID ,method, winName, inActive, style, refresh) {

	var sUrl = "";
	
	if (!method)
		method = "display";

	if (method=="version"){
		sUrl = root + "edit/reports/objectreport.cfm?objectid=" + objectID;
	}
	else {
		sUrl = root + "object.cfm?objectid=" + objectID + "&method="+method;
	}	
	if (refresh) {
		if (refresh == "true")
			sUrl = sUrl + "&refresh=true";
	}
	if (style) {
		sUrl = sUrl + "&style=" + style;
	}
		
	if (inActive) {
		if (inActive == "true")
			sUrl = sUrl + "&bActiveOnly=false";
	}
	
	// ENHANCEMENT February 06, 2007 14:33:45 PM richard - comment: Resizing the popup depending  on the method, because some methods need lager space then others. 
	var sWindowParam = "height=650px,width=800px,resizable=yes,scrollbars=yes";
	
	if (method == "edit") {
		sWindowParam = "height=650px,width=800px,resizable=yes,scrollbars=yes";
	}
	if (method == "qa") {
		sWindowParam = "height=400px,width=700px,resizable=yes,scrollbars=yes";
	}
	if (method == "dump") {
		sWindowParam = "height=1024px,width=1280px,resizable=yes,scrollbars=yes";
	}
	
	
	if (!winName)
		winName="OCF";

	var newWindow = window.open(sUrl, winName, sWindowParam);
	
	if (window.focus) {
		newWindow.focus();
	}
}
