var tmpRepeatDlgWin;function isEmpty(s)	{ 	return ((s == null) || (s.length == 0))	}function isDigit (c)	{	 return ((c >= "0") && (c <= "9"))	}function isInteger (s)	{ 	var i;	if (isEmpty(s)) return false;		for (i = 0; i < s.length; i++)		{ 			var c = s.charAt(i);			if (!isDigit(c)) return false;		}	return true;	}function isNonnegativeInteger (s)	{ 	// The next line is a bit byzantine. What it means is:	// a) s must be a signed integer, AND	// b) one of the following must be true:	// i) s is empty and we are supposed to return true for	// empty strings	// ii) this is a number >= 0	return (isSignedInteger(s) && (isEmpty(s) || (parseInt (s) >= 0) ) );	}function isSignedInteger (s)	{ 	if (isEmpty(s)) return false;	else {		var startPos = 0;			// skip leading + or -			if ( (s.charAt(0) == "-") || (s.charAt(0) == "+") )				startPos = 1; 			return (isInteger(s.substring(startPos, s.length)))		}	}function makeArray(n) 	{	for (var i = 1; i <= n; i++) {		this[i] = 0		} 	return this	}var daysInMonth = makeArray(12);daysInMonth[1] = 31;daysInMonth[2] = 29; // must programmatically check thisdaysInMonth[3] = 31;daysInMonth[4] = 30;daysInMonth[5] = 31;daysInMonth[6] = 30;daysInMonth[7] = 31;daysInMonth[8] = 31;daysInMonth[9] = 30;daysInMonth[10] = 31;daysInMonth[11] = 30;daysInMonth[12] = 31;function isIntegerInRange (s, a, b)	{ 	if (isEmpty(s)) return false;	if (!isInteger(s)) return false;	var num = parseInt (s);	return ((num >= a) && (num <= b));	}function isMonth (s)	{ 	if (isEmpty(s)) return false;		// now strip out leading 0 because parseInt() will not!		s = stripLeadingCharsInBag (s, "0")		return isIntegerInRange (s, 1, 12);	}function isDay (s)	{ 	if (isEmpty(s)) return false;		// now strip out leading 0 because parseInt() will not!		s = stripLeadingCharsInBag (s, "0")	return isIntegerInRange (s, 1, 31);	}function stripLeadingCharsInBag (s, bag)	{ 	var i;	var returnString = "";	for (i = 0; i < s.length; i++)		{ 		var c = s.charAt(i);		if (bag.indexOf(c) == -1) {			returnString = s.substring( i, s.length);			break;			}		}	return returnString;	}	function daysInFebruary (year)	{	return ( ((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0) ) ) ? 29 : 28 );	}function isYear (s)	{ 	if (isEmpty(s)) return false;	if (!isNonnegativeInteger(s)) return false;	return ((s.length == 2) || (s.length == 4));	}	// isDate (STRING year, STRING month, STRING day)function isDate (year, month, day)	{ 	if (! (isYear(year) && isMonth(month) && isDay(day))) return false;	var intYear = parseInt(year);	var intMonth = parseInt(month);	var intDay = parseInt(day);	// catch invalid days, except for February	if (intDay > daysInMonth[intMonth]) return false; 	if ((intMonth == 2) && (intDay > daysInFebruary(intYear))) return false;	return true;}function isWhitespace (s)	{ 	var i;		var whitespace = " \t\n\r";	if (isEmpty(s)) return true;	for (i = 0; i < s.length; i++)		{ 		var c = s.charAt(i);		if (whitespace.indexOf(c) == -1) return false;		}	return true;	}function stripCharsInBag (s, bag)	{ 	var i;	var returnString = "";	for (i = 0; i < s.length; i++)		{ 		// Check that current character isn't whitespace.		var c = s.charAt(i);		if (bag.indexOf(c) == -1) returnString += c;		}	return returnString;	}function stripWhitespace (s)	{ 	var whitespace = " \t\n\r";	return stripCharsInBag (s, whitespace)	}	function extractNumber (strValue)	{	var space = -1;	var strTest = strValue;	do {		if ((space = strValue.indexOf(" ")) == -1) strTest = strValue;		else strTest = strValue.slice(0, space);		if (isFinite(strTest) == true) return strTest;		if (space == -1) return "NaN";		strValue = strValue.slice(space + 1, strValue.length);		} while (true)	}function setDateFormat()	{	thisform = window.document.forms[0];	var str1=thisform.webStaticDateTime.value.substring(0, 2);	var str2= thisform.webStaticDateTime.value.substring(3, 5);	var str3=thisform.webStaticDateTime.value.substring(6, 8);			if (("30"== str1) & ("06"==str2) & ("97"==str3)) {			thisform.tmpStrDateFormatClient.value="0"		}				if (("97"== str1) & ("06"==str2) & ("30"==str3)) {			thisform.tmpStrDateFormatClient.value="1"		}				if (("06"== str1) & ("30"==str2) & ("97"==str3)) {			thisform.tmpStrDateFormatClient.value="2"		}	}function translateDate( datevalue )	{	thisform = window.document.forms[0];	//strDateFormat = thisform.tmpDateTimeFormat.value.substring(0,thisform.tmpDateTimeFormat.value.indexOf(";"));	strDateFormat=thisform.tmpStrDateFormatClient.value;	//strDateSep = thisform.tmpDateTimeSep.value.substring(0, thisform.tmpDateTimeSep.value.indexOf(";"));	strDateSep = thisform.webStaticDateTime.value.substring(2, 3);			if (strDateFormat == "0") 		//DMY			{			iIndex = datevalue.indexOf(strDateSep)			day = datevalue.substring(0, iIndex)			datevalue = datevalue.substring(iIndex+1, datevalue.length)			iIndex = datevalue.indexOf(strDateSep)			month = datevalue.substring(0, iIndex)			year = datevalue.substring(iIndex+1, datevalue.length)			}		else if (strDateFormat == "1") 	// YMD			{			iIndex = datevalue.indexOf(strDateSep)			year = datevalue.substring(0, iIndex)			datevalue = datevalue.substring(iIndex+1, datevalue.length)			iIndex = datevalue.indexOf(strDateSep)			month = datevalue.substring(0, iIndex)			day = datevalue.substring(iIndex+1, datevalue.length)			}		else // MDY			{			iIndex = datevalue.indexOf(strDateSep)			month = datevalue.substring(0, iIndex)			datevalue = datevalue.substring(iIndex+1, datevalue.length)			iIndex = datevalue.indexOf(strDateSep)			day = datevalue.substring(0, iIndex)			year = datevalue.substring(iIndex+1, datevalue.length)			}					year = extractNumber(year);		month = extractNumber(month);		day = extractNumber(day);			     if (year.length == 2 && year.substring(0,1) < 5) year = '20' + year;		if (isDate(year, month, day)) {			return month + "/" + day + "/" + year;		} else {			return "NaN";		}}
