// eschmidt, 5/2003
// standard js functions used across the site.

function ImageSwap(imageplace, imagename){
	document.images[imageplace].src=imagename.src;	
}

// launch a help window, passing an itemID or a dimensionID
function launchhelp(dimensionID,serviceID) {
	var helpwin = window.open("/index.cfm?action=help.topic&dimensionID="+dimensionID+"&serviceID="+serviceID,"helppop","top=50,left=100,width=403,height=285,copyhistory=no,scrollbars=yes,resizable=no")
	helpwin.focus();
}

function showPrintWindow(winURL) {
	self.name = "main"; // names current window as "main"
	OpenWindow = window.open(winURL, "remote", "toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=500,height=500,top=100,left=110");
	OpenWindow.focus();
}

function showPopupWindow(winURL) {
	self.name = "main"; // names current window as "main"
	OpenWindow = window.open(winURL, "remote", "toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=500,height=500,top=100,left=110");
	OpenWindow.focus();
}

// function used when select boxes got to a new location on select
function loadSelect(objSelect,loadURL) {
	var selindex = objSelect.selectedIndex;
	var selID = objSelect.options[selindex].value;
	if (selID) top.location.href=loadURL+selID;
}

// function for created comma-separated lists from multiple select boxes
function listFromMultSelect(selObj) {
	var retList = '';
	for (var count=0;count < selObj.length; count++) {
		if (selObj.options[count].selected == true)
			retList += selObj.options[count].value + ',';
	}
	return retList.substring(0,retList.length-1);
}

function strtrim() {
	return this.replace(/^\s+/,'').replace(/\s+$/,'');
}
// function prototype
String.prototype.trim = strtrim;

