//	<!-- START GENERIC FUNCTIONS -->
//	<!-- <script type="text/javascript">  -->
		//--------------------------------------------------------------------------------------------------------------------------
		//CONVERT A TIMESTAMP TO A JAVASCRIPT DATE OBJECT 
		//There are java.sql.Timestamp values that need conversion to Javascript compatible Date values.  This function does this
		//conversion.
		//NOTE: This is a String to Object conversion.  The return value is a Javascript Date() object, not just a string.
		//--------------------------------------------------------------------------------------------------------------------------
		function TimeStampToJSDate(sqlTS) {
			var returnDateObj = new Date();
			try {
				//2006-01-28 20:48:25.0  must first become January 28, 2006 20:48:25 to initially become a JS Date object
				if (sqlTS === null || sqlTS==="") { throw -1; }
				if (sqlTS.indexOf(" ")<1) { throw -2; }
				var DateTimeSpaceSplit = sqlTS.split(" ");

				var DateSide = DateTimeSpaceSplit[0];
				var TimeSide = DateTimeSpaceSplit[1];

				var DateSideArray = DateSide.split("-"); //idx-0==YYYY, idx-1==MM, idx-2==DD
				var TimeSideArray = TimeSide.split("."); //This is setup to drop the millis from sqlTS
				var MMVal = DateSideArray[1];
				var MMName = "";
				switch(MMVal) {
					case "01": MMName = "January"; break;
					case "02": MMName = "February"; break;
					case "03": MMName = "March"; break;
					case "04": MMName = "April"; break;
					case "05": MMName = "May"; break;
					case "06": MMName = "June"; break;
					case "07": MMName = "July"; break;
					case "08": MMName = "August"; break;
					case "09": MMName = "September"; break;
					case "10": MMName = "October"; break;
					case "11": MMName = "November"; break;
					case "12": MMName = "December"; break;
					default: throw -3;
				}

				var ConvertibleDateString = MMName + ", " + DateSideArray[2] + " " + DateSideArray[0] + " " + TimeSideArray[0];
				//alert("ConvertibleDateString: " + ConvertibleDateString);
				var DateMillis = Date.parse(ConvertibleDateString);
				returnDateObj.setTime(DateMillis);
				
			} catch(errNbr) {
				switch(errNbr) {
					 case -1: alert("(-1): TimeStampToJSDate(): sqlTS arg null or empty."); break;
					 case -2: alert("(-2): TimeStampToJSDate(): Invalid sqlTS arg. No space to split on: " + sqlTS); break;
					 case -3: alert("(-3): TimeStampToJSDate(): Invalid MMVal has no switch case match: " + MMVal); break;
					 default: alert("(DfltErr): TimeStampToJSDate(): \n" + errNbr); break;
				}
			}
			
			return returnDateObj;
		}


		//--------------------------------------------------------------------------------------------------------------------------------
		// CONVERT A JAVASCRIPT DATE OBJECT.toString() STRING RESULT TO A MySQL TimeStamp
		//    MySQL timestamp string formatted as YYYY-MM-DD HH:mm:SS.n
		//    JSDate toString() formatted as ==>  Sun Apr 2 13:56:24 CDT 2006
		//--------------------------------------------------------------------------------------------------------------------------------
		function JSDateStringToTimeStamp(JSDateString) {
			var tsBuild = "";
			try {
				if (JSDateString===null || JSDateString==="") { throw -1; }
				var itemArray = JSDateString.split(" ");
				var dayAbbrv = itemArray[0];
				var monAbbrv = itemArray[1];
				var dayPart  = itemArray[2];
				var timePart = itemArray[3];
				var zoneAcr =  itemArray[4];
				var yearPart = itemArray[5];

				var tsMM = "";
				var tsDD = "";

				switch(monAbbrv) {
					case "Jan": tsMM = "01"; break;
					case "Feb": tsMM = "02"; break;
					case "Mar": tsMM = "03"; break;
					case "Apr": tsMM = "04"; break;
					case "May": tsMM = "05"; break;
					case "Jun": tsMM = "06"; break;
					case "Jul": tsMM = "07"; break;
					case "Aug": tsMM = "08"; break;
					case "Sep": tsMM = "09"; break;
					case "Oct": tsMM = "10"; break;
					case "Nov": tsMM = "11"; break;
					case "Dec": tsMM = "12"; break;
					default: throw -2;
				}

				if (dayPart < 10) { 
					tsDD = "0" + dayPart; 
				} else {
					tsDD = dayPart;
				}
				
				tsBuild = yearPart + "-" + tsMM + "-" + tsDD + " " + timePart + ".0";
				
			} catch(errNbr) {
				switch(errNbr) {
					 case -1: alert("(-1): JSDateStringToTimeStamp(): JSDateString arg null or empty."); break;
					 case -2: alert("(-2): JSDateStringToTimeStamp(): Invalid monAbbrv has no switch case match: " + monAbbrv); break;
					 default: alert("(DfltErr): JSDateStringToTimeStamp(): \n" + errNbr); break;
				}
			}
			
			return tsBuild;
		}


		//-----------------------------------------------------------------------------------------------------------------------------------------
		//  SET A SEQUENCE OF DATE DDL TO A SINGLE DATE IN CCYY-MM-DD FORMAT
		//	The ZeekEngine stores dates in CCYY-MM-DD format.  It is customary in ZeekEngine Admin UI to split the date components into three
		//	DDL lists: CCYY, MM, DD.  This function is a convenience whereby simply giving the individual names of these DDL widgets plus a 
		//  standard String date format of CCYY-MM-DD (with intervening dashes) will set the whole set of three DDLs to the single date.
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function setDateDDLToDate(CCYYName,MMName,DDName,inDate) {
			try {
				var CCYYNameRef = document.getElementById(CCYYName);
				var MMNameRef = document.getElementById(MMName);
				var DDNameRef = document.getElementById(DDName);
				if (isDNE(CCYYNameRef)) { throw -1; }
				if (isDNE(MMNameRef)) { throw -2; }
				if (isDNE(DDNameRef)) { throw -3; }
				if (isDNE(inDate)) { throw -4; }
				if (inDate.indexOf("-")==-1) { throw -5; }
				
				var itemArray = inDate.split("-");
				var CCYYItem = itemArray[0];
				var MMItem = itemArray[1];
				var DDItem  = itemArray[2];
				
				//alert("CCYY:" + CCYYItem + " MMItem:" + MMItem + " DDItem:" + DDItem);
				setDDLToLineByValue(CCYYNameRef,CCYYItem);
				setDDLToLineByValue(MMNameRef,MMItem);
				setDDLToLineByValue(DDNameRef,DDItem);
				
			} catch(errNbr) {
				switch(errNbr) {
					 case -1: alert("(-1): setDateDDLToDate(): CCYYName ref DNE in DOM."); break;
					 case -2: alert("(-2): setDateDDLToDate(): MMName ref DNE in DOM."); break;
					 case -3: alert("(-3): setDateDDLToDate(): DDName ref DNE in DOM."); break;
					 case -4: alert("(-4): setDateDDLToDate(): The inDate arg is null or blank."); break;
					 case -5: alert("(-5): setDateDDLToDate(): Invalid format inDate arg.  Must be CCYY-MM-DD.  The arg passed was: " + inDate); break;
					 default: alert("(DfltErr): setDateDDLToDate(): \n" + errNbr); break;
				}
			}
		}
		
		
		//-----------------------------------------------------------------------------------------------------------------------------------------
		//  SET A SEQUENCE OF TIME DDL TO A SINGLE TIME IN HH:MM:SS.n -OR- HH:MM:SS FORMATS
		//	The ZeekEngine stores times in HH:MM:SS.n format.  It is customary in ZeekEngine Admin UI to split the time components into three
		//	DDL lists: Hrs, Min, Sec.  This function is a convenience whereby simply giving the individual names of these DDL widgets plus a 
		//  standard String time format (with intervening colons) will set the whole set of three DDLs to the single time.
		//  NOTE that if there is a milliseconds component that it is ignored.
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function setTimeDDLToTime(HrsName,MinName,SecName,inTime) {
			try {
				var HrsNameRef = document.getElementById(HrsName);
				var MinNameRef = document.getElementById(MinName);
				var SecNameRef = document.getElementById(SecName);
				if (isDNE(HrsNameRef)) { throw -1; }
				if (isDNE(MinNameRef)) { throw -2; }
				if (isDNE(SecNameRef)) { throw -3; }
				if (isDNE(inTime)) { throw -4; }
				if (inTime.indexOf(":")==-1) { throw -5; }
				
				if (inTime.indexOf(".")>-1) {
					inTime = inTime.substring(0,inTime.indexOf("."));
				}
				
				var itemArray = inTime.split(":");
				var HrsItem = itemArray[0];
				var MinItem = itemArray[1];
				var SecItem  = itemArray[2];
				
				//alert("Hours:" + HrsItem + " Minutes:" + MinItem + " Seconds:" + SecItem);
				setDDLToLineByValue(HrsNameRef,HrsItem);
				setDDLToLineByValue(MinNameRef,MinItem);
				setDDLToLineByValue(SecNameRef,SecItem);
				
			} catch(errNbr) {
				switch(errNbr) {
					 case -1: alert("(-1): setTimeDDLToTime(): HrsName ref DNE in DOM."); break;
					 case -2: alert("(-2): setTimeDDLToTime(): MinName ref DNE in DOM."); break;
					 case -3: alert("(-3): setTimeDDLToTime(): SecName ref DNE in DOM."); break;
					 case -4: alert("(-4): setTimeDDLToTime(): The inTime arg is null or blank."); break;
					 case -5: alert("(-5): setTimeDDLToTime(): Invalid format inTime arg.  Must be HH:MM:SS.n or HH:MM:SS  The arg passed was: " + inTime); break;
					 default: alert("(DfltErr): setTimeDDLToTime(): \n" + errNbr); break;
				}
			}
		}
		
		
		//-----------------------------------------------------------------------------------------------------------------------------------------
		//  SET A SEQUENCE OF TIME DDL TO A SINGLE TIME IN HH:MM:SS.n -OR- HH:MM:SS FORMATS
		//	The ZeekEngine stores times in HH:MM:SS.n format.  It is customary in ZeekEngine Admin UI to split the time components into three
		//	DDL lists: Hrs, Min, Sec.  This function is a convenience whereby simply giving the individual names of these DDL widgets plus a 
		//  standard String time format (with intervening colons) will set the whole set of three DDLs to the single time.
		//  NOTE that if there is a milliseconds component that it is ignored.
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function setDateTimeDDLToDateTime(CCYYName,MMName,DDName,HrsName,MinName,SecName,inDateTime) {
			try {
				
				if (isDNE(inDateTime)) { throw -1; }
				if (inDateTime.indexOf(":")==-1 || inDateTime.indexOf(" ")==-1 || inDateTime.indexOf("-")==-1) { throw -2; }
				var inDate = inDateTime.substring(0,inDateTime.indexOf(" "));
				var inTime = inDateTime.substring(inDateTime.indexOf(" ")+1);
				
				setDateDDLToDate(CCYYName,MMName,DDName,inDate);
				setTimeDDLToTime(HrsName,MinName,SecName,inTime);
				
			} catch(errNbr) {
				switch(errNbr) {
					 case -1: alert("(-1): setDateTimeDDLToDateTime(): The inDateTime arg is null or blank."); break;
					 case -2: alert("(-2): setDateTimeDDLToDateTime(): \nInvalid format inDateTime arg.\nMust be CCYY-MM-DD HH:MM:SS.n or CCYY-MM-DD HH:MM:SS \nThe arg passed was: " + inDateTime); break;
					 default: alert("(DfltErr): setTimeDDLToTime(): \n" + errNbr); break;
				}
			}
		}
		
		
		
		
		
		//-----------------------------------------------------------------------------------------------------------------------------------------
		//  SET A SEQUENCE OF DATE DDL TO A SINGLE DATE IN CCYY-MM-DD FORMAT
		//  This routine sets a set of CCYY-MM-DD DDLs to the Now() time.  It takes an optional argument that gives an offset.
		//	Usage:
		//		1. If no offset arg is given, the CCYY-MM-DD setting is todays date.
		//  		2. If an offset is given, it is calculated as a duration from todays date.  Therefore, +365d gives a year from today's date.
		//		
		//	Examples of the OFFSET argument.
		//		1.	+45d		==> 45 days in the future from today 
		//		2.	+2y		==>	2 years in the future from today
		//		3.	+6m		==>	6 months in the future from today
		//
		//	Current limitations:
		//
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function setDateDDLToNowPlusOffset(CCYYName,MMName,DDName,OFFSET) {
			try {
				var CCYYNameRef = document.getElementById(CCYYName);
				var MMNameRef = document.getElementById(MMName);
				var DDNameRef = document.getElementById(DDName);
				if (isDNE(CCYYNameRef)) { throw -1; }
				if (isDNE(MMNameRef)) { throw -2; }
				if (isDNE(DDNameRef)) { throw -3; }
				
				var todayDateObj = new Date();
				var todayInMS = todayDateObj.getTime();
				var setCCYYVal = null;
				var setMMVal = null;
				var setDDVal = null;
					
				if (isDNE(OFFSET)) {
					setCCYYVal = todayDateObj.getFullYear();
					setMMVal = todayDateObj.getMonth();
					setMMVal += 1;
					setDDVal = todayDateObj.getDate();	
				} else {
					var incArray = OFFSET.split("+");
					if (isDNE(incArray) || incArray.length<1 ) { throw -4; }
					var curOffsetType = null;
					var curOffsetMultiplier = null;
					var curOffset = null;
					for (var n=0;n<incArray.length;n++) {
						curOffset = incArray[n];
						if (curOffset.length<1) { continue; }
						curOffsetType = curOffset.charAt(curOffset.length-1);
						curOffsetMultiplier = curOffset.substring(0,(curOffset.length-1));
						if (isDNE(curOffsetMultiplier) || curOffsetMultiplier<1) { throw -5; }
						switch (curOffsetType) {
							case "d":
								todayDateObj.setDate(todayDateObj.getDate()+curOffsetMultiplier);	
								break;
							case "m":
								todayDateObj.setMonth(todayDateObj.getMonth()+curOffsetMultiplier);	
								break;
							case "y":	
								todayDateObj.setFullYear(todayDateObj.getFullYear()+curOffsetMultiplier);	
								break;
							default:
								throw -6; break;	
						}
					}
					setCCYYVal = todayDateObj.getFullYear();
					setMMVal = todayDateObj.getMonth();
					setMMVal += 1;
					setDDVal = todayDateObj.getDate();
				}
						
				//alert("CCYY:" + CCYYItem + " MMItem:" + MMItem + " DDItem:" + DDItem);
				setDDLToLineByValue(CCYYNameRef,setCCYYVal);
				setDDLToLineByValue(MMNameRef,setMMVal);
				setDDLToLineByValue(DDNameRef,setDDVal);
				
			} catch(errNbr) {
				switch(errNbr) {
					 case -1: alert("(-1): setDateDDLToNowPlusOffset(): CCYYName ref DNE in DOM."); break;
					 case -2: alert("(-2): setDateDDLToNowPlusOffset(): MMName ref DNE in DOM."); break;
					 case -3: alert("(-3): setDateDDLToNowPlusOffset(): DDName ref DNE in DOM."); break;
					 case -4: alert("(-4): setDateDDLToNowPlusOffset(): OFFSET arg invalid.  No plus-sign offset delimiters."); break;
					 case -5: alert("(-5): setDateDDLToNowPlusOffset(): OFFSET arg Invalid.  Current curOffsetMultiplier<1."); break;
					 case -6: alert("(-6): setDateDDLToNowPlusOffset(): OFFSET arg Invalid.  Current curOffsetType not in d,m,y."); break;
					 default: alert("(DfltErr): setDateDDLToNowPlusOffset(): \n" + errNbr); break;
				}
			}
		}
		
		

		//-----------------------------------------------------------------------------------------------------------------------------------------
		// GET JAVASCRIPT DATE OBJECT FOR SET OF DATE DDL LISTS
		// Dates are typically represented as a set of three DDL lists with a naming scheme composed of the date part and the date field generic
		// name as follows:
		//      YYYYDateFieldName, MMDateFieldName, DDDateFieldName.
		//
		//   ARGUMENTS:
		//      yyRef  <== The NAME (not object reference) of the date field DDL containing the 4-digit YYYY value.
		//      mmRef  <== The NAME (not object reference) of the date field DDL containing the 2-digit MM value.
		//      ddRef  <== The NAME (not object reference) of the date field DDL containing the 2-digit DD value.
		//
		//   NOTES:
		//      1. Since the YYYY,MM,DD DDLs do not have any time info, the current time is used to set the output time for the JS Date object.
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function getDateDDLAsJSDateObj(yyRef,mmRef,ddRef) {
			var buildDateObj = new Date();
			try {
				if (yyRef===null || yyRef==="") { throw -1; }
				if (mmRef===null || mmRef==="") { throw -2; }
				if (ddRef===null || ddRef==="") { throw -3; }
				var YYYYObjRef = document.getElementById(yyRef);
				var MMObjRef = document.getElementById(mmRef);
				var DDObjRef = document.getElementById(ddRef);
				var YYYYVal = YYYYObjRef.value;
				var MMVal = MMObjRef.value;
				var DDVal = DDObjRef.value;
				//alert("YYYYVal:" + YYYYVal + " | MMVal:" + MMVal + " | DDVal:" + DDVal);
				
				buildDateObj.setYear(YYYYVal);
				buildDateObj.setMonth(MMVal);
				buildDateObj.setDate(DDVal);
				
			} catch(errNbr) {
				switch(errNbr) {
					 case -1: alert("(-1): getDateDDLAsJSDateObj(): yyRef arg null or empty."); break;
					 case -2: alert("(-2): getDateDDLAsJSDateObj(): mmRef arg null or empty."); break;
					 case -3: alert("(-3): getDateDDLAsJSDateObj(): ddRef arg null or empty."); break;
					 default: alert("(DfltErr): getDateDDLAsJSDateObj(): \n" + errNbr); break;
				}
			}
			return buildDateObj;
		}


		//-----------------------------------------------------------------------------------------------------------------------------------------
		// GET MySQL java.sql.Types.DATE STRING FOR A SET OF DATE DDL LISTS
		//
		// The java.sql.Types.DATE is formatted as CCYY-MM-DD and the dashes are significant.
		// ZeekEngine Dates are represented as a set of three DDLs with a naming scheme composed of the date part and the date field generic
		// name as follows:
		//      YYYYDateFieldName, MMDateFieldName, DDDateFieldName.
		//
		//   ARGUMENTS:
		//      yyRef  <== The NAME (not object reference) of the date field DDL containing the 4-digit YYYY value.
		//      mmRef  <== The NAME (not object reference) of the date field DDL containing the 2-digit MM value.
		//      ddRef  <== The NAME (not object reference) of the date field DDL containing the 2-digit DD value.
		//
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function getDateDDLAsMySQLDateString(yyRef,mmRef,ddRef) {
			var MySQLDateString = null;
			try {
				if (yyRef===null || yyRef==="") { throw -1; }
				if (mmRef===null || mmRef==="") { throw -2; }
				if (ddRef===null || ddRef==="") { throw -3; }
				var YYYYObjRef = document.getElementById(yyRef);
				var MMObjRef = document.getElementById(mmRef);
				var DDObjRef = document.getElementById(ddRef);
				var YYYYVal = YYYYObjRef.value;
				var MMVal = MMObjRef.value;
				var DDVal = DDObjRef.value;
				
				MySQLDateString = YYYYVal + "-" + MMVal + "-" + DDVal;
			} catch(errNbr) {
				switch(errNbr) {
					 case -1: alert("(-1): getDateDDLAsMySQLDateString(): yyRef arg null or empty."); break;
					 case -2: alert("(-2): getDateDDLAsMySQLDateString(): mmRef arg null or empty."); break;
					 case -3: alert("(-3): getDateDDLAsMySQLDateString(): ddRef arg null or empty."); break;
					 default: alert("(DfltErr): getDateDDLAsMySQLDateString(): \n" + errNbr); break;
				}
			}
			return MySQLDateString;
		}
		
		
		
		//-----------------------------------------------------------------------------------------------------------------------------------------
		// GET TIME STRING FOR A SET OF TIME DDL LISTS (HH:MM:SS)
		//
		//   ARGUMENTS:
		//      HrsRef  <== The NAME (not object reference) of the time field DDL containing the 2-digit HOURS value.
		//      MinRef  <== The NAME (not object reference) of the time field DDL containing the 2-digit MINUTES value.
		//      SecRef  <== The NAME (not object reference) of the time field DDL containing the 2-digit SECONDS value.
		//
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function getTimeDDLAsTimeString(HrsRef,MinRef,SecRef) {
			var MySQLDateString = null;
			try {
				if (HrsRef===null || HrsRef==="") { throw -1; }
				if (MinRef===null || MinRef==="") { throw -2; }
				if (SecRef===null || SecRef==="") { throw -3; }
				var HrsObjRef = document.getElementById(HrsRef);
				var MinObjRef = document.getElementById(MinRef);
				var SecObjRef = document.getElementById(SecRef);
				var HrsVal = HrsObjRef.value;
				var MinVal = MinObjRef.value;
				var SecVal = SecObjRef.value;
				
				TimeString = HrsVal + ":" + MinVal + ":" + SecVal;
			} catch(errNbr) {
				switch(errNbr) {
					 case -1: alert("(-1): getTimeDDLAsTimeString(): HrsRef arg null or empty."); break;
					 case -2: alert("(-2): getTimeDDLAsTimeString(): MinRef arg null or empty."); break;
					 case -3: alert("(-3): getTimeDDLAsTimeString(): SecRef arg null or empty."); break;
					 default: alert("(DfltErr): getTimeDDLAsTimeString(): \n" + errNbr); break;
				}
			}
			return TimeString;
		}
		
		
		//-----------------------------------------------------------------------------------------------------------------------------------------
		// GET DATE-TIME STRING FOR A SET OF DATE AND TIME DDL LISTS (CCYY-MM-DD HH:MM:SS)
		//
		//   ARGUMENTS:
		//      See respective calls for both called subroutines.
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function getDateTimeDDLAsDateTimeString(yyRef,mmRef,ddRef,HrsRef,MinRef,SecRef) {
			var MySQLDateTimeString = null;
			try {
				var DatePart = getDateDDLAsMySQLDateString(yyRef,mmRef,ddRef);
				var TimePart = getTimeDDLAsTimeString(HrsRef,MinRef,SecRef);
				
				MySQLDateTimeString = DatePart + " " + TimePart;
			} catch(errNbr) {
				switch(errNbr) {
					default: alert("(DfltErr): getDateTimeDDLAsDateTimeString(): \n" + errNbr); break;
				}
			}
			return MySQLDateTimeString;
		}
		
		
		
		
		
		//-----------------------------------------------------------------------------------------------------------------------------------------
		// GET DDL VALUE FOR A NAMED DDL SELECTOR IF IT HAS A SELECTION MADE
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function getSelectedDDLValue(DDLName) {
			var DDLValue = null;
			try {
				if (DDLName===null || DDLName==="") { throw -1; }
				var DDLNameObjRef = document.getElementById(DDLName);
				if (DDLNameObjRef===null) { throw -2; }
				DDLValue = DDLNameObjRef.value;
			} catch(errNbr) {
				switch(errNbr) {
					 case -1: alert("(-1): getSelectedDDLValue(): DDLName arg null or empty."); break;
					 case -2: alert("(-2): getSelectedDDLValue(): DOM object DNE for DDL name arg: " + DDLName); break;
					 default: alert("(DfltErr): getSelectedDDLValue(): \n" + errNbr); break;
				}
			}
			return DDLValue;
		}
		
		
		//-----------------------------------------------------------------------------------------------------------------------------------------
		// LOAD INITIAL DATE DDL SEGMENTS TO BASIC LIST VALUES
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function loadDateDDLs(yyRef,mmRef,ddRef) {
			var YearList = document.getElementById(yyRef);
			var yearVar = 2007;
			for (var y=0;y<14;y++) {
				YearList.options[y] = new Option(yearVar,yearVar);
				yearVar++;
			}

			var MonthList = document.getElementById(mmRef);
			var monthVar = 1;
			var entryValMM = "";
			for (var m=0;m<12;m++) {
				entryValMM = stringResize(monthVar,2,"PRE","0");
				MonthList.options[m] = new Option(entryValMM,entryValMM);
				monthVar++;
			}

			var DayList = document.getElementById(ddRef);
			var dayVar = 1;
			var entryValDD = "";
			for (var d=0;d<31;d++) {
				entryValDD = stringResize(dayVar,2,"PRE","0");
				DayList.options[d] = new Option(entryValDD,entryValDD);
				dayVar++;
			}
		}


		//-----------------------------------------------------------------------------------------------------------------------------------------
		// LOAD INITIAL TIME DDL SEGMENTS TO BASIC LIST VALUES
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function loadTimeDDLs(HrsRef,MinRef,SecRef) {
			var HoursDDL = document.getElementById(HrsRef);
			var Hours = 0;
			for (var h=0;h<24;h++) {
				Hours = stringResize(Hours,2,"PRE","0");
				HoursDDL.options[h] = new Option(Hours,Hours);
				Hours++;
			}

			var MinsDDL = document.getElementById(MinRef);
			var Minutes = 0;
			for (var m=0;m<60;m++) {
				Minutes = stringResize(Minutes,2,"PRE","0");
				MinsDDL.options[m] = new Option(Minutes,Minutes);
				Minutes++;
			}

			var SecDDL = document.getElementById(SecRef);
			var Seconds = 0;
			for (var s=0;s<60;s++) {
				Seconds = stringResize(Seconds,2,"PRE","0");
				SecDDL.options[s] = new Option(Seconds,Seconds);
				Seconds++;
			}
		}


		//-----------------------------------------------------------------------------------------------------------------------------------------
		// Load US States into a select DDL.  This is a convenience wrapper on the version that uses explicit object refs.  This allows assignment
		// by just the id name, provided it is unique in the DOM.  Else, if any ambiguity use the reference-explicit version below.
		// NOTE: The option.value and option.text are set to the same.
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function loadStateDDL(StateSelectorName) {
			try {
				if (isDNE(StateSelectorName)) { throw -1; }
				var stateDDLObjRef = document.getElementById(StateSelectorName);
				if (isDNE(stateDDLObjRef)) { throw -2; }
				 loadStateDDLByRef(stateDDLObjRef);
			} catch(errNbr) {
				 switch(errNbr) {
				 	 case -1: alert("(-1): loadStateDDL(): Input arg StateSelectorName empty or null."); break;
					 case -2: alert("(-2): loadStateDDL(): State DDL control DNE for input arg StateSelectorName: " + StateSelectorName); break;
					 default: alert("(DfltErr): loadStateDDL(): \n" + errNbr); break;
				 }
			}
		}
		
		
		//-----------------------------------------------------------------------------------------------------------------------------------------
		// Load US States into a select DDL DOM reference.
		// This is the principal function that loads a DDL given by DOM reference.  This is useful in cases where multiple forms may have a State
		// DDL that has the same name in each form.  We don't want to rely on pure Id names, so passing the explicit ref is done.
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function loadStateDDLByRef(stateDDLObjRef) {
			try {
				if (isDNE(stateDDLObjRef)) { throw -1; }
				var USStateCodes = new Array("AL","AK","AS","AZ","AR","CA","CO","CT","DE","DC","FM","FL","GA","GU","HI","ID","IL","IN","IA","KS","KY","LA","ME","MH","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","MP","OH","OK","OR","PW","PA","PR","RI","SC","SD","TN","TX","UT","VT","VI","VA","WA","WV","WI","WY","AE","AA","AE","AE","AP","ZZ");
				var stateLen = USStateCodes.length;
				stateDDLObjRef.options.length = 0; //blitz existing entries

				for (var i=0;i<stateLen;i++) { 
					stateDDLObjRef.options[i] = new Option(USStateCodes[i],USStateCodes[i]);	
				}
			} catch(errNbr) {
				 switch(errNbr) {
					 case -1: alert("(-1): loadStateDDLByRef(): State DDL stateDDLObjRef arg DNE in DOM."); break;
					 default: alert("(DfltErr): loadStateDDLByRef(): \n" + errNbr); break;
				 }
			}
		}



		//-----------------------------------------------------------------------------------------------------------------------------------------
		// Load Country abbreviations into the specified (by name in DOM) DDL list selector.
		// NOTES: 
		//	1.	The option.value and option.text are set to the same.
		//	2.	At this point, only between 20 to 30 countries are listed.  These are the few countries that have normalized trade relationships
		//		with the US that might understand the need for Zeek Systems to advance the welfare of their state.
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function loadCountryDDL(CountrySelectorName) {
			try {
				var cntryDDLRef = document.getElementById(CountrySelectorName);
				if(isDNE(cntryDDLRef)) { throw -1; }

				var CountryCodes = new Array("US","CA","GB","NZ","IE","HK","IN","DE","PR","VI","MX","IT","CL","DK","FR","GL","IL","JP","KW","ES","SE","CH","TW","UM");
				var CntryCodeLen = CountryCodes.length;
				cntryDDLRef.options.length = 0; //blitz existing entries

				for (var i=0;i<CntryCodeLen;i++) { 
					cntryDDLRef.options[i] = new Option(CountryCodes[i],CountryCodes[i]);	
				}
			} catch(errNbr) {
				 switch(errNbr) {
				 	 case -1: alert("(-1): loadCountryDDL(): Input arg cntryDDLName refers to DNE obj in DOM with name: " + cntryDDLName); break;
					 default: alert("(DfltErr): compare(): \n" + errNbr); break;
				 }
			}
		}
		
		
		

		//-----------------------------------------------------------------------------------------------------------------------------------------
		//  Sets a Drop Down Listbox control to the desired value of an Entity Object passed in.  The field name within that Entity Object is given.
		//
		//  USAGE:
		//      A DDL control in a form must be reset to the value of the currently selected Entity Object when that entity is set into its Form.
		//      There are typically any number of DDL controls, usually pertaining to _type, or _prop settings in the entity object.
		//
		//  ARGS:
		//		1. entityObj <== actual entity object reference, likely from prior extraction from a document.table__Array.
		//		2. DDLObjId  <== The HTML id of the DDL control, NOT the reference to the object.  The getElementById is done in this function for it.
		//      3. selectorField <== The selector field name within the entity object that will be used to set the current option with the DDL
		//                           select control.  This is typically a _type_id field name.
		//
		//  NOTES:
		//      1. The lookup against the DDL control is done based on its option.value and NOT against its option.text
		//      2. Note that this is the preferred function for associating Entity Objects to DDL controls, as opposed to the setDDLtoLineByValue()
		//         which is for making similar DDL option selections independently of an Entity Object.
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function setDDLToLineByEntityObject(entityObj,DDLObjId,selectorField) {
			try {
				if (entityObj===null || entityObj==="") { throw -1; }
				if (DDLObjId===null || DDLObjId==="") { throw -2; }
				if (selectorField===null || selectorField==="") { throw -3; }

				var DDLObjRef = document.getElementById(DDLObjId);
				if (DDLObjRef===null) { throw -4; }
				var selectorFieldValue = entityObj[selectorField];

				if (selectorFieldValue===null || selectorFieldValue==="") {
					DDLObjRef.options.selectedIndex = -1;
				}

				setDDLToLineByValue(DDLObjRef,selectorFieldValue);
			} catch(errNbr) {
				 switch(errNbr) {
					 case -1: alert("(-1): setDDLToEntityObject(): entityObj arg is null."); break;
					 case -2: alert("(-2): setDDLToEntityObject(): DDLObjId arg is null."); break;
					 case -3: alert("(-3): setDDLToEntityObject(): selectorField arg is null"); break;
					 case -4: alert("(-4): setDDLToEntityObject(): DDLObjRef DNE in document for DDLObjId arg of: " + DDLObjId); break;
					 default: alert("(DfltErr): setDDLToEntityObject(): \n" + errNbr); break;
				 }
			}
		}


		//-----------------------------------------------------------------------------------------------------------------------------------------
		//  SET A DDL SELECT OPTION LINE GIVEN THE DESIRED VALUE AND DDL document object reference
		//
		//  USAGE:
		//     This function is very similar to the  "setDDLToLineByEntityObject(entityObj,DDLObjId,selectorField)" which is also defined in this
		//     generic functions script.  The partial deprecation relates to how the other function should be used specifically when there is an
		//     Entity Object that has an internal field that will set the current option of a select DDL.  This function should only be used when
		//     there is NOT an Entity Object, but instead the value is being set independently.  An example of such an independent DDL setting is
		//     to auto-set a "State" DDL to 'TX' for Texas as matter of an address form initialization.
		//
		//  NOTES:
		//		1. This function is actually called by setDDLToLineByEntityObject() once that other function has reduced its arguments to make the
		//         actual lookup-and-set.  This function does the actual lookup-and-set.
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function setDDLToLineByValue(selectControlRef,curVal) {
			var optCnt = selectControlRef.options.length;
			var curOptVal = null;
			for (var i=0;i<optCnt;i++) {
				curOptVal = selectControlRef.options[i].value;
				if (curOptVal == curVal) {
					selectControlRef.options.selectedIndex = i;
					break;
				}
			}
		}


		//-----------------------------------------------------------------------------------------------------------------------------------------
		//  SET A DDL SELECT OPTION LINE TO THE FIRST LIST ITEM [IDX==0]
		//
		//  USAGE:
		//     	There is an advantage to making the desired default value of a DDL the first list item.  There are times also when the first list
		//		item is seemingly "empty" but there may still be an underlying value.  It is specifically these cases where a call to deselectDDL
		//		can give an unintended result where the FORM is left in an invalid state.  Use this call when the DDL should be reset to the first
		//		item in its list.
		//
		//	NOTES:
		//		1. Note the use of the name arg instead of a reference.  This is a convenience, however if the name can not be resolved then this
		//		   function fails silently.
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function setDDLToFirstItem(selectControlID) {
			if (isDNE(selectControlID)) { return; }
			var selectDDLRef = document.getElementById(selectControlID);
			if (isDNE(selectDDLRef)) { return; }
			
			if (!selectDDLRef.options || selectDDLRef.options===null) { return; }
			var optCnt = selectDDLRef.options.length;
			if (optCnt<1) { return; }
			
			selectDDLRef.options.selectedIndex = 0;
		}
		
		

		//-----------------------------------------------------------------------------------------------------------------------------------------
		//  SET A DDL SELECT OPTION CONTROL TO AN EMPTY DEFAULT OR ELSE A SINGLE PROVIDED VALUE
		//
		//  USAGE:
		//      Use this function to initialize select option controls.  If not init value is provided then an empty default value will be created.
		//		The select control will have a single <option/> value after executing this.  Note that the single select option will have a 
		//      value equal to the initValue default or the one provided.
		//
		//  ARGS:
		//		selectControlRef	<==	The DOM reference to the select control --OR-- optionally, just the selectors' NAME.  Note the getElementById...
		//      initValue			<== The optional initializing text to assign to the single option set into the select control.
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function setDDLToInit(selectControlRef,initValue) {
			if (isDNE(selectControlRef)) { return; }
			if (typeof(selectControlRef)=="string" && selectControlRef.lastIndexOf("Selector")>-1) {
				selectControlRef = document.getElementById(selectControlRef);
				if (isDNE(selectControlRef)) { return; }
			} 
			selectControlRef.options.length = 0; //blitz existing entries
			if (initValue===null || ""===initValue) { initValue = "No Options Listed"; }
			selectControlRef.options[0] = new Option(initValue,initValue);
		}


		//-----------------------------------------------------------------------------------------------------------------------------------------
		//  SET A DDL SELECT OPTION CONTROL TO HAVE NO CURRENTLY SELECTED OPTIONS
		//
		//  USAGE:
		//      Use this function to initialize select option controls to a NON-selected state without deleting all the options.   
		//      What makes this a bit more convenient is that only the Name of the selector control (the id, actually) is needed.
		//      The operation of simply setting the selectedIndex =-1 is trivial, so having this method go through the DOM ref lookup
		//		and perform basic existence checking is the benefit.
		//
		//  ARGS:
		//		selectorName		<==	The id value of the select control to lookup in the DOM and deselect all its lines.
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function deselectDDL(selectorName) {
			try {
				if (selectorName===null || selectorName==="") { return; }
				var NamedSelectorRef=document.getElementById(selectorName);
				if (!NamedSelectorRef) { throw -1; }
				NamedSelectorRef.options.selectedIndex = -1;
			} catch(errNbr) {
				switch (errNbr) {
					case -1: alert("(-1): deselectDDL(): The selectorName: [" + selectorName + "] has no matching ref in DOM."); break;
					default: alert("(DfltErr): deselectDDL(): \n" + errNbr); break;
			 	}
			}
		}




		//-----------------------------------------------------------------------------------------------------------------------------------------
		//  MAKE AN INPUT STRING CAMEL CASED.  
		//
		//  NOTES:
		//		1.  This function returns full-camel case, not half-camel case.  The first character will be capitalized.
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function camelCase(inString) {
			var outString = "";
			inString = trim(inString);
			outString = inString.replace(/( |_)([a-zA-Z])/g, function(t,a,b) { return b.toUpperCase(); } );
			return outString;
		}




		//-----------------------------------------------------------------------------------------------------------------------------------------
		//  RESIZES A STRING BY EITHER PADDING OR TRUNCATING
		//
		//  USAGE:
		//      Pass in a string.  Define a padding character (padChar) and whether it should prepend or append to the input string if the input
		//      string is less than the desired new length (newLen).  If the input string is longer than the desired new length, then the input
		//      string is truncated to that length.
		//
		//  ARGS:
		//		1. inString	  <== The input string that will either be padded or truncated
		//		2. newLen	  <== The desired new length int value that the result should be, whether by padding or truncating
		//      3. PrePost    <== Possible values [PRE|POST] that determine if padding with the padChar is prepend or append
		//      4. padChar    <== If padding needed for inString, this is the pad character to be used.
		//-----------------------------------------------------------------------------------------------------------------------------------------
		function stringResize(inString,newLen,PrePost,padChar) {
			var spacesPool = "                                                                               ";
			inString = inString + "";
			var curSize = inString.length;
			var outString = "";

			try {
				if (PrePost==="") { PrePost="POST"; }
				var padAmt = newLen - curSize;
				
				if (padAmt < 0) {
					outString = inString.substring(0,newLen);
				} else {
					if (PrePost=="POST") {
						if (padChar==="") {
							outString = inString + spacesPool.substring(0,padAmt);
						} else {
							outString = inString;
							for (var n=0;n<padAmt;n++) { outString += padChar; }
						}
					} else {
						if (padChar==="") {
							outString = spacesPool.substring(0,padAmt) + inString;
						} else {
							for (var z=0;z<padAmt;z++) { outString += padChar; }
							outString += inString;
						}
					}
				}
			} catch(errNbr) {
				 switch(errNbr) {
					 default: alert("(DfltErr): stringResize(): \n" + errNbr); break;
				 }
			}
			return outString;
		}



		//------------------------------------------------------------------------------------------------------------------------------------------
		// Make character data safe for putting into XML
		// NOTES:
		//	1. 
		//------------------------------------------------------------------------------------------------------------------------------------------
		function makeXMLSafe(inString) {
			if (inString===null || inString==="") { return ""; }
			inString = inString.replace(new RegExp( "<", "g" ),"");
			inString = inString.replace(new RegExp( ">", "g" ),"");
			inString = inString.replace(new RegExp( "\\\\", "g" ),"");
			inString = inString.replace(new RegExp( "&", "g" ),"");
			inString = inString.replace(new RegExp( "'", "g" ),"");
			inString = inString.replace(new RegExp( "\\n", "g" )," ");
			
			return inString;	
		}



		//------------------------------------------------------------------------------------------------------------------------------------------
		// Trims the end of a string to the specified zapChar, and including deletion of the last zapChar.
		// NOTES:
		//	1. 	The "zapChar" arg is not limited to single characters.  It can be an entire string fragment.  This is particularly useful in getting
		//		a parent directory of an input directory path.  For example: Say you want the parent directory of /usr/local/foo/bar/ which is just
		//		/usr/local/foo/
		//		Therefore, passing in the args ("/usr/local/foo/bar/","bar/") will rip off the final "bar/".
		//		Keep in mind the ZeekEngine convention that all paths are internally represented with a trailing forward slash.
		//
		//------------------------------------------------------------------------------------------------------------------------------------------
		function zapEndChar(inString,zapChar) {
			if (inString===null || inString==="") { return ""; }
			if (inString.indexOf(zapChar)<0) { return inString; }
			
			var idxOfZapChar = inString.lastIndexOf(zapChar);
			var returnString = inString.substring(0,idxOfZapChar);
			return returnString;	
		}


		//------------------------------------------------------------------------------------------------------------------------------------------
		//  Set the update button red for a form that has a UI change that has not been persisted.
		//  This is called by processes that stage updates to form that do not actually invoke the submit.
		//  NOTES:
		//      1. The reset button must disable the non-persisted change and reset the update button color to normal
		//
		//------------------------------------------------------------------------------------------------------------------------------------------
		function setUpdateButtonHot(formID) {
			try {
				if (formID===null || formID==="") { throw -1; }
				var FormRef = document.getElementById(formID);
				if (FormRef===null) { throw -2; }
				var UpdateButtonRef = FormRef.elements["update"];
				if (UpdateButtonRef===null) { throw -3; }
				//alert("UpdateButtonRef name: " + UpdateButtonRef.name);
				UpdateButtonRef.style.color = "#f00";
				UpdateButtonRef.style.borderColor = "#f00";
			} catch(errNbr) {
				 switch(errNbr) {
					 case -1: alert("(-1): setUpdateButtonHot(): formID input arg is null."); break;
					 case -2: alert("(-2): setUpdateButtonHot(): FormRef object ref null for formID:" + formID); break;
					 case -3: alert("(-3): setUpdateButtonHot(): Update button object ref null for formID:" + formID); break;
					 default: alert("(DfltErr): setUpdateButtonHot(): \n" + errNbr); break;
				 }
			}
		}
		
		
		
		//------------------------------------------------------------------------------------------------------------------------------------------
		//  Check if the input object or item Does Not Exist: "DNE".
		//  This is a "negative" check since it is most often used for checking for errors.  That is, if the object DOES NOT EXIST, then return TRUE.
		//  If the obj argument DOES exist, return false.
		//------------------------------------------------------------------------------------------------------------------------------------------
		function isDNE(obj) {
			if (!obj || obj===null || obj==="" || obj=="null") { return true; }
			return false;
		}
		
		
		//------------------------------------------------------------------------------------------------------------------------------------------
		//  Verify that the input keyUUID arg is valid as a UUID at least in pure formatting.
		//  An example UUID is basically:   a1b2c3d4-aaaa-bbbb-cccc-0123456789ab
		//  RegExp Pattern to validate is:  /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/
		//------------------------------------------------------------------------------------------------------------------------------------------
		function isUUID(keyUUID) {
			if (keyUUID===null || ""===keyUUID || keyUUID.length!=36) { return false; }
			var uuidRegExp = new RegExp(/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/);
			if (uuidRegExp.test(keyUUID)) {
				return true;
			} else {
				return false;
			}
		}
		
		
		//------------------------------------------------------------------------------------------------------------------------------------------
		//  Convert to boolean is a helper function because Javascript has problems accurately discerning what should be a boolean in all cases.
		//  The specific problem Javascript has is that new Boolean("false") evaluates to true.  This function fixes that and makes the use of 
		//  Strings to Booleans like Java.
		//------------------------------------------------------------------------------------------------------------------------------------------
		function getBool(inVal) {
			var returnBool = false;
			if (inVal===null) { return false; }
			if (inVal==="") { return false; }
			if (inVal==" ") { return false; }
			if (inVal=="false") { return false; }
			if (inVal===0) { return false; }
			if (inVal=="0") { return false; }
			if (inVal=="NA") { return false; }
			
			if (inVal=="true") { return true; }
			if (inVal==1) { return true; }
			if (inVal=="1") { return true; }
			return returnBool;
		}
		
		

		//------------------------------------------------------------------------------------------------------------------------------------------
		//  The ZeekHeader1.jsp shows the common ZeekEngine header area.  It is styled with the ZeekSysDress.css
		//  Together, they provide a DIV for showing a system-common status message display window in the upper right of the header area.
		//  This function obtains the handle to that DIV and formats messages for it.
		//------------------------------------------------------------------------------------------------------------------------------------------
		function setStatus(statusMessage) {
			try {
				var statusWindowTARef = document.getElementById("statusWindowTA");
				if (!statusWindowTARef || statusWindowTARef===null) { throw -1; }
				if (statusMessage===null || statusMessage==="") {
					statusWindowTARef.value = "";
				} else {
					statusWindowTARef.value = statusMessage;
				}
			} catch(errNbr) {
				 switch(errNbr) {
					 case -1: alert("(-1): setStatus(): statusWindowTARef ref DNE in DOM.  Check usage of ZeekHeader1.jsp for statusWindow DIV."); break;
					 default: alert("(DfltErr): setStatus(): \n" + errNbr); break;
				 }
			}
		}
		
		//------------------------------------------------------------------------------------------------------------------------------------------
		//  This is a variant of addStatus() above.  This function appends the new statusMessage arg to the existing statusMessage text area
		//  without deleting the former contents.  It uses a dashed line to delimit the subsequent appended message.
		//------------------------------------------------------------------------------------------------------------------------------------------
		function appendStatus(statusMessage) {
			try {
				var statusWindowTARef = document.getElementById("statusWindowTA");
				if (!statusWindowTARef || statusWindowTARef===null) { throw -1; }
				if (statusMessage===null || statusMessage==="") { return; }
				
				var currentStatus = statusWindowTARef.value;
				currentStatus += "\n --------------------------------------------\n";
				currentStatus += statusMessage;
				statusWindowTARef.value = currentStatus;
				
			} catch(errNbr) {
				 switch(errNbr) {
					 case -1: alert("(-1): appendStatus(): statusWindowTARef ref DNE in DOM.  Check usage of ZeekHeader1.jsp for statusWindow DIV."); break;
					 default: alert("(DfltErr): appendStatus(): \n" + errNbr); break;
				 }
			}
		}
		
		
		
		//------------------------------------------------------------------------------------------------------------------------------------------
		//  Launch remote URL
		//------------------------------------------------------------------------------------------------------------------------------------------
		function launch(newURL, newName, newFeatures, orgName) {
  			var remote = open(newURL, newName, newFeatures);
  			if (remote.opener === null) {	remote.opener = window; }
  			remote.opener.name = orgName;
  			return remote;
		}

		//------------------------------------------------------------------------------------------------------------------------------------------
		//  Launch a pop-up window
		//------------------------------------------------------------------------------------------------------------------------------------------
		function launchPopUp() {
		
			this.popupHandle = null;
			
			this.urlTarget = "";
			
			this.baseHTML = "<html><head><title>__TITLE__</title>__HEAD__</head><body>__BODY__</body></html>";
			
			this.baseHEAD = "<script type=\"text/javascript\"><!--\n";
			this.baseHEAD += "	function closeWin() {  window.close(); }\n";
			this.baseHEAD += "	if (window.Event) { document.captureEvents(Event.ONCLICK); }\n";
			this.baseHEAD += "	document.onclick = closeWin;\n";
			this.baseHEAD += "	// -->\n";
			this.baseHEAD += "</script>\n";
		
		
			this.winOpts = new Object();
			this.winOpts["height"] = 350;
			this.winOpts["width"] = 350;
			this.winOpts["alwaysLowered"] = 0;
			this.winOpts["alwaysRaised"] = 1;
			this.winOpts["channelmode"] = 0;
			this.winOpts["dependent"] = 1;
			this.winOpts["directories"] = 0;
			this.winOpts["fullscreen"] = 0;
			this.winOpts["hotkeys"] = 1;
			this.winOpts["location"] = 0;
			this.winOpts["menubar"] = 0;
			this.winOpts["resizable"] = 0;
			this.winOpts["scrollbars"] = 0;
			this.winOpts["status"] = 0;
			this.winOpts["titlebar"] = 1;
			this.winOpts["toolbar"] = 0;
			this.winOpts["z-lock"] = 0;
			
			
			
			//This method will overwrite the default settings above if a duplicate winOptName is given
   			this.setWinOpt = function(winOptName,winOptValue) { 
   				if (this.winOpts === null) { this.winOpts = new Object(); }
   				this.winOpts[winOptName] = winOptValue; 
   			}
   					
   			this.getWinOpt = function(winOptName) {
   				if (this.winOpts === null) { return ""; } 
   				return this.winOpts[winOptName]; 
   			}
			
			this.getPopupHandle = function() { return this.popupHandle; }
			
			this.setURLTarget = function(urlTarget) { this.urlTarget = urlTarget; }
			this.getURLTarget = function() { return this.urlTarget; }
			
			
			//This sets the caller-provided body content into the output construction.  This must be called externally.
			this.setBodyContent = function(bodyContent) { 
				if (bodyContent===null || ""===bodyContent) {	bodyContent = "No Body Content";	} 
				this.baseHTML = this.baseHTML.replace(/__BODY__/g,bodyContent);
			}
			
			//This sets the caller-provided Title content into the output construction.  This must be called externally.
			this.setTitleContent = function(titleContent) { 
				if (titleContent===null || ""===titleContent) { titleContent = "No Title Provided";	} 
				this.baseHTML = this.baseHTML.replace(/__TITLE__/g,titleContent);
			}
			
			//This is an internal method called during assembly of complete output.  Provides the JS to close the window.
			this.setBaseHeadContent = function() { this.baseHTML = this.baseHTML.replace(/__HEAD__/g,this.baseHEAD); }
			
			//This method launches the popup
			this.launch = function() { 
				this.setBaseHeadContent();
				try {
					var winOptString = this.getWinOptString();
					this.popupHandle = launch(this.urlTarget,"myRemote",winOptString,"myWindow");
					if (this.popupHandle===null) { throw -1; }
					if (!this.popupHandle.document) { throw -2; }
					if (this.urlTarget===null || this.urlTarget==="") {	//When urlTarget provided, we do not manually inject HTML content
						this.popupHandle.document.write(this.baseHTML);
					}	
					return this.popupHandle;
				} catch(errNbr) {
					var newErrorObj;
			 		switch(errNbr) {
			 			case -1: newErrorObj = new Error("(-1): launchPopUp.launch():\n this.popupHandle null after call to window.open"); break;
			 			case -2: newErrorObj = new Error("(-2): launchPopUp.launch():\n this.popupHandle.document object DNE on this.popupHandle after call to window.open"); break;
						default: newErrorObj = new Error("(DfltErr): launchPopUp.launch(): \n" + errNbr); break;
			 		}
			 	 	return newErrorObj;
		    		}	
			}
			
			
			//--- converts the Object property hash on the this.winOpts Objects into a comma-delim string.
			this.getWinOptString = function() {
   				var winOptString = "";
   				var wkLine = null;
   				for (var property in this.winOpts) {
   					wkLine = property + "=" + this.winOpts[property] + ","; 
   					winOptString += wkLine;
   				}
   				winOptString = zapEndChar(winOptString,",");
   				return winOptString;
   			}
			
		}



 		//------------------------------------------------------------------------------------------------------------------------------------------
		//  Copy to Clipboard functionality supporting both IE and Netscape/Mozilla browsers.
		//  Someday when you know how to sign scripts...
		//------------------------------------------------------------------------------------------------------------------------------------------
//		function copy2clip(clipText) {
//			if (window.clipboardData) {
//				// IE supports the very easy one, albeit very insecure.
//				window.clipboardData.setData("Text", clipText);
//			} else if (window.netscape) { 
//				netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
//			   	var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
//				if (!clip) { return; }
//			    var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
//			    if (!trans) { return; }
//			    trans.addDataFlavor('text/unicode');
//			   
//			    var str = new Object();
//			    var len = new Object();
//			   
//			    var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
//			    var copytext=clipText;
//			    str.data=copytext;
//			    trans.setTransferData("text/unicode",str,copytext.length*2);
//			    var clipid=Components.interfaces.nsIClipboard;
//			    if (!clipid) { return false; }
//			    clip.setData(trans,null,clipid.kGlobalClipboard);
//			 }
//			 alert("Following info was copied to your clipboard:\n\n" + clipText);
//			 return false;
//		}
           
      
		
		
//	<!-- </script>  -->
//	<!-- END OF TOTALLY GENERIC FUNCTIONS SECTION  -->
//	<!-- =================================================================================================================================  -->


