function DisplayImage(iObjID,iWidth,iHeight,type,path,fileaddr,fileport)
{
	
	var encBars     = 'directories=no,location=no,menubar=no,status=no,titlebar=no,toolbar=no';
	var encOptions  = 'scrollbars=no,width='+iWidth+',height='+iHeight+'';    
	var encFeatures = encBars + ',' + encOptions;
	
	var newWin = open('', 'newEncWin'+'iObjID', encFeatures);
		
	newWin.document.writeln(
	"<html>"
	+"<body marginwidth=0 marginheight=0 topmargin=0 leftmargin=0>"
	+"<img src=\"/cgi-bin/Pdisplay.cgi?type="
	+type
	+"&path="
	+path
	+"&fileaddr="
	+fileaddr
	+"&fileport="
	+fileport
	+"\">"
	+"</body>"
	+"</html>"
	);
	
	newWin.document.close();
	newWin.focus();
}

function DisplayURL(iObjID,type,path,fileaddr,fileport,displaycgiloc,tempfilename)
{

	var encBars     = 'directories=yes,location=yes,menubar=yes,status=yes,titlebar=yes,toolbar=yes';
	var encOptions  = 'scrollbars=yes';    
	var encFeatures = encBars + ',' + encOptions;
	
	var BuiltURL    = displaycgiloc;

// Hack to get IE to work with all mimetypes
// Also has the sideeffect of naming the file you save ;)

            BuiltURL   += '/';
            BuiltURL   += tempfilename;


	    BuiltURL   += '?type=';
	    BuiltURL   += type;
	    BuiltURL   += '&path=';
	    BuiltURL   += path;
	    BuiltURL   += '&fileaddr=';
	    BuiltURL   += fileaddr;
	    BuiltURL   += '&fileport=';
	    BuiltURL   += fileport;
	var newWin = open(BuiltURL, 'newURLWin', encFeatures);
}

function BuildHierButton(ObjID,RepoCode,lockcode)
{

var URL = "";

URL += '<img src="/images/view_relat.gif" border="0" alt="View Relationships" ';
URL += 'onclick="document.location=';
URL += "'/logicrouter/servlet/LogicRouter?OUTPUTXSL=hier.xsl&";

URL += "pm_RC=" + RepoCode + "&"
URL += "pm_COI=" + ObjID + "&"
URL += "pm_OTF=Y" + "&"
//URL += 'pm_LCI=' + lockcode + '&'
URL += "api_1=COLL_GET_PARENTS&"

URL += "pm_RC=" + RepoCode + "&"
URL += "pm_POI=" + ObjID + "&"
URL += "pm_OTF=Y" + "&"
URL += 'pm_LCI=' + lockcode + '&'
URL += "api_2=COLL_GET_CHILDREN&"


//URL += "pm_RC=" + RepoCode + "&"
//URL += "pm_OI=" + ObjID + "&"
//URL += "api_3=GET_DESCDOC&"

//URL += "LCI=" + lockcode + ""
URL += "'";
URL += '">';
        
document.write(URL);

}

function BuildSRButton(hierid)
{

var URL = "";

URL += '<img src="/images/addtosaved.gif" border="0" alt="Add to Saved Records" ';
URL += 'onclick="document.location=';
URL += "'/logicrouter/servlet/LogicRouter?OUTPUTXSL=object.xsl&";

URL += "num_result=" + hierid + "&"
URL += "sr_api=ADD_SAVED_RECORD" + "&"
URL += "DIRECTIVE=getFullRec" + "&"
URL += "UPDOBJ=N"

URL += "'";
URL += '">';

if(typeof hierid != 'undefined')
{      
	document.write(URL);
}

}
