function getHelp(withThis){
	var NN = (document.all ? false : true);

	// center the new window
   var wHeight = 450;
   var wWidth = 600;

   var wLeft = ((NN ? innerWidth : screen.availWidth) / 3) - (wWidth/3);
   var wTop = ((NN ? innerHeight : screen.availHeight) / 3) - (wHeight/3);
   // keep new windows controls to a minimum for both browsers
   if (NN) {
     var Options = 'scrollbars=no, titlebar=no, left=' + wLeft + ',top=' + wTop + ',width=' + wWidth + ',height=' + wHeight + ',alwaysRaised=yes';
   } else { 
     var Options = 'scrollbars=no, toolbar=no, left=' + wLeft + ',top=' + wTop + ',status=no,location=no,directories=no,width=' + wWidth + ',height=' + wHeight;
   }; 			

	var oURL = 'functions/dsp_Help.cfm?withThis=' + withThis;
	window.open(oURL,'helpWindow',Options);
}

function openPopUp(wH,wW,tar,oURL,scroll){
	var NN = (document.all ? false : true);
	// center the new window
   var wHeight = wH;
   var wWidth = wW;
   var wLeft = ((NN ? innerWidth : screen.availWidth) / 2) - (wWidth/2);
   var wTop = ((NN ? innerHeight : screen.availHeight) / 2) - (wHeight/2);
   // keep new windows controls to a minimum for both browsers
   if (NN) {
     var Options = 'scrollbars=' + scroll +', titlebar=no, left=' + wLeft + ',top=' + wTop + ',width=' + wWidth + ',height=' + wHeight + ',alwaysRaised=yes';
   } else { 
     var Options = 'scrollbars=' + scroll +', toolbar=no, left=' + wLeft + ',top=' + wTop + ',status=no,location=no,directories=no,width=' + wWidth + ',height=' + wHeight;
   }; 			
	window.open(oURL,tar,Options);		
}
function openPopUp2(oURL,target,wW,wH,scroll,resize){
	var NN = (document.all ? false : true);
	// center the new window
   var wHeight = wH;
   var wWidth = wW;
   var wLeft = ((NN ? innerWidth : screen.availWidth) / 2) - (wWidth/2);
   var wTop = ((NN ? innerHeight : screen.availHeight) / 2) - (wHeight/2);
   // keep new windows controls to a minimum for both browsers
   if (NN) {
     var Options = 'resizable=' + resize + ', scrollbars=' + scroll +', titlebar=no, left=' + wLeft + ',top=' + wTop + ',width=' + wWidth + ',height=' + wHeight + ',alwaysRaised=yes';
   } else { 
     var Options = 'resizable=' + resize + ', scrollbars=' + scroll +', toolbar=no, left=' + wLeft + ',top=' + wTop + ',status=no,location=no,directories=no,width=' + wWidth + ',height=' + wHeight;
   }; 			
	window.open(oURL,target,Options);		
}
//place popupform in universals.cfm or application.cfm or on page that calls this.
function formPopUp(oURL,wW,wH){
	document.popupform.wW.value = wW;
	document.popupform.wH.value = wH;
	document.popupform.action = oURL;
	document.popupform.submit();
	document.popupform.field1.name = "field1";
	document.popupform.field2.name = "field2";
}
//place popupform in universals.cfm or application.cfm or on page that calls this.
function formPopUp2(oURL,wW,wH,resize,thisTarget){
	var NN = (document.all ? false : true);
	// center the new window
   	var wLeft = ((NN ? innerWidth : screen.availWidth) / 2) - (wW/2);
   	var wTop = ((NN ? innerHeight : screen.availHeight) / 2) - (wH/2);
	document.popupform.wW.value = wW;
	document.popupform.wH.value = wH;
	//round because can't work with fractions of pixels
	document.popupform.wLeft.value = Math.round(wLeft);
	document.popupform.wTop.value = Math.round(wTop);
	//resize before submitting to avoid extra window resizing.
	if(resize == "y"){
		window.resizeTo(wW,wH);
		window.moveTo(wLeft,wTop);
	}
	document.popupform.action = oURL;
	document.popupform.target = thisTarget;
	document.popupform.submit();
	document.popupform.field1.name = "field1";
	document.popupform.field2.name = "field2";
}
//trimAll was created by ASPDEV.com
//Steve Pera changed  == ' ' to .match(thisPattern) != null 9/14/09
// otherwise it's only catching spaces.
function trimAll(sString){
	var thisPattern = /\s/
	while (sString.substring(0,1).match(thisPattern) != null){
	sString = sString.substring(1, sString.length);
	}
	while (sString.substring(sString.length-1, sString.length).match(thisPattern) != null){
	sString = sString.substring(0,sString.length-1);
	}
	return sString
}
function checkAll(truefalse,formName){
	var numElements = document(formName).elements.length;
	for(var i=0; i < numElements; i++){
		if(document[formName].elements[i].type == "checkbox"){
			document[formName].elements[i].checked = truefalse;
		}
	}
}
function autoTab(numChars,formName,thisField,nextField){
	if(document[formName][thisField].value.length >= numChars){
		document[formName][nextField].focus();
	}
}
function toggleColors(id,bgc,txtc){//added 7/21/09
	document.getElementById(id).style.backgroundColor = bgc;
	document.getElementById(id).style.color = txtc;
}
function getCheckedIndex(fieldName,formName){
	var numElements = document[formName][fieldName].length;
	var checkedElement = -1;
	for(var i=0; i < numElements; i++){
		if(document[formName][fieldName][i].checked == true){
			checkedElement = i;
			return checkedElement;
		}
	}
	return checkedElement;
}
function getCheckedValue(fieldName,formName){
	var numElements = document[formName][fieldName].length;
	var checkedValue = "";
	for(var i=0; i < numElements; i++){
		if(document[formName][fieldName][i].checked == true){
			checkedValue = document[formName][fieldName][i].value;
			return checkedValue;
		}
	}
	return checkedValue;
}