<!--
	function currencyFormat(fld, milSep, decSep, e) {
	var sep = 0;
	var key = '';
	var i = j = 0;
	var len = len2 = 0;
	var strCheck = '0123456789';
	var aux = aux2 = '';
	var whichCode = (window.Event) ? e.which : e.keyCode;
	if (whichCode == 13) return true;  // Enter
	key = String.fromCharCode(whichCode);  // Get key value from key code
	if (strCheck.indexOf(key) == -1) return false;  // Not a valid key
	len = fld.value.length;
	for(i = 0; i < len; i++)
	if ((fld.value.charAt(i) != '0') && (fld.value.charAt(i) != decSep)) break;
	aux = '';
	for(; i < len; i++)
	if (strCheck.indexOf(fld.value.charAt(i))!=-1) aux += fld.value.charAt(i);
	aux += key;
	len = aux.length;
	if (len == 0) fld.value = '';
	if (len == 1) fld.value = '0'+ decSep + '0' + aux;
	if (len == 2) fld.value = '0'+ decSep + aux;
	if (len > 2) {
	aux2 = '';
	for (j = 0, i = len - 3; i >= 0; i--) {
	if (j == 3) {
		aux2 += milSep;
	j = 0;
	}
	aux2 += aux.charAt(i);
	j++;
	}
	fld.value = '';
	len2 = aux2.length;
	for (i = len2 - 1; i >= 0; i--)
	fld.value += aux2.charAt(i);
	fld.value += decSep + aux.substr(len - 2, len);
	}
	return false;
	}

	function fncFormatNumeric(e) {
		var whichCode = (window.Event) ? e.which : e.keyCode;
		if (whichCode > 47 && whichCode < 58)
		{
			return true;
		}
		else
		{
			return false;
		}
	}


	var isNN = (navigator.appName.indexOf("Netscape")!=-1);
	function autoTab(input,len, e) {
	var keyCode = (isNN) ? e.which : e.keyCode; 
	var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
	if(input.value.length >= len && !containsElement(filter,keyCode)) {
	input.value = input.value.slice(0, len);
	input.form[(getIndex(input)+1) % input.form.length].focus();
	}
	function containsElement(arr, ele) {
	var found = false, index = 0;
	while(!found && index < arr.length)
	if(arr[index] == ele)
	found = true;
	else
	index++;
	return found;
	}
	function getIndex(input) {
	var index = -1, i = 0, found = false;
	while (i < input.form.length && index == -1)
	if (input.form[i] == input)index = i;
	else i++;
	return index;
	}
	return true;
	}

	function changeCase(frmObj) {
	var index;
	var tmpStr;
	var tmpChar;
	var preString;
	var postString;
	var strlen;
	tmpStr = frmObj.value;
	strLen = tmpStr.length;
	if (strLen > 0)  {
		for (index = 0; index < strLen; index++)  {
	if (index == 0)  {
	tmpChar = tmpStr.substring(0,1).toUpperCase();
	postString = tmpStr.substring(1,strLen);
	tmpStr = tmpChar + postString;
	}
	   }
	}
	frmObj.value = tmpStr;
	}

	var tokPat=new RegExp("^month_strict|month|Month|MONTH|yyyy|YYYY|mins|MINS|mon_strict|ampm|AMPM|mon|Mon|MON|min|MIN|dd|DD|mm|MM|yy|YY|hh|HH|ss|SS|m|M|d|D|y|Y|h|H|s|S");
	var lowerMonArr={jan:1, feb:2, mar:3, apr:4, may:5, jun:6, jul:7, aug:8, sep:9, oct:10, nov:11, dec:12}
	var monPatArr=new Array();
	monPatArr['mon_strict']=new RegExp(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/);
	monPatArr['Mon']=new RegExp(/Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec/);
	monPatArr['MON']=new RegExp(/JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC/);
	monPatArr['mon']=new RegExp("jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec",'i');
	var monthPatArr=new Array();
	monthPatArr['month']=new RegExp(/^january|february|march|april|may|june|july|august|september|october|november|december/i);
	monthPatArr['Month']=new RegExp(/^January|February|March|April|May|June|July|August|September|October|November|December/);
	monthPatArr['MONTH']=new RegExp(/^JANUARY|FEBRUARY|MARCH|APRIL|MAY|JUNE|JULY|AUGUST|SEPTEMBER|OCTOBER|NOVEMBER|DECEMBER/);
	monthPatArr['month_strict']=new RegExp(/^january|february|march|april|may|june|july|august|september|october|november|december/);
	var cutoffYear=50;
	function FormatToken (token, type) {
	this.token=token;
	this.type=type;
	}

	function parseFormatString (formatStr) {
	var tokArr=new Array;
	var tokInd=0;
	var strInd=0;
	var foundTok=0;
	    
	while (strInd < formatStr.length) {
	if (formatStr.charAt(strInd)=="%" &&
	(matchArray=formatStr.substr(strInd+1).match(tokPat)) != null) {
	strInd+=matchArray[0].length+1;
	tokArr[tokInd++]=new FormatToken(matchArray[0],"symbolic");
	} else {
	if (tokInd>0 && tokArr[tokInd-1].type=="literal") {
	tokArr[tokInd-1].token+=formatStr.charAt(strInd++);
	}
	else {
	tokArr[tokInd++]=new FormatToken(formatStr.charAt(strInd++), "literal");
	      }
	   }
	}
	return tokArr;
	}

	function buildDate(dateStr,formatStr) {
	// parse the format string first.
	var tokArr=parseFormatString(formatStr);
	var strInd=0;
	var tokInd=0;
	var intMonth;
	var intDay;
	var intYear;
	var intHour;
	var intMin;
	var intSec;
	var ampm="";
	var strOffset;

	var curdate=new Date();
	intMonth=curdate.getMonth()+1;
	intDay=curdate.getDate();
	intYear=curdate.getFullYear();

	intHour=0;
	intMin=0;
	intSec=0;

	while (strInd < dateStr.length && tokInd < tokArr.length) {

	if (tokArr[tokInd].type=="literal") {
	if (dateStr.indexOf(tokArr[tokInd].token,strInd)==strInd) {

	strInd+=tokArr[tokInd++].token.length;
	continue;
	}
	else {

	return "\"" + dateStr + "\" does not conform to the expected format: " + formatStr;
	   }
	}

	switch (tokArr[tokInd].token) {
	case 'm':
	case 'M':
	case 'd':
	case 'D':
	case 'h':
	case 'H':
	case 'min':
	case 'MIN':
	case 's':
	case 'S':

	curChar=dateStr.charAt(strInd);
	nextChar=dateStr.charAt(strInd+1);
	matchArr=dateStr.substr(strInd).match(/^\d{1,2}/);
	if (matchArr==null) {

	switch (tokArr[tokInd].token.toLowerCase()) {
	case 'd': var unit="day"; break;
	case 'm': var unit="month"; break;
	case 'h': var unit="hour"; break;
	case 'min': var unit="minute"; break;
	case 's': var unit="second"; break;
	}
	return "Bad " + unit + " \"" + curChar + "\" or \"" + curChar +
	nextChar + "\".";
	}
	strOffset=matchArr[0].length;
	switch (tokArr[tokInd].token.toLowerCase()) {
	case 'd': intDay=parseInt(matchArr[0],10); break;
	case 'm': intMonth=parseInt(matchArr[0],10); break;
	case 'h': intHour=parseInt(matchArr[0],10); break;
	case 'min': intMin=parseInt(matchArr[0],10); break;
	case 's': intSec=parseInt(matchArr[0],10); break;
	}
	break;
	case 'mm':
	case 'MM':
	case 'dd':
	case 'DD':
	case 'hh':
	case 'HH':
	case 'mins':
	case 'MINS':
	case 'ss':
	case 'SS':

	strOffset=2;
	matchArr=dateStr.substr(strInd).match(/^\d{2}/);
	if (matchArr==null) {

	switch (tokArr[tokInd].token.toLowerCase()) {
	case 'dd': var unit="day"; break;
	case 'mm': var unit="month"; break;
	case 'hh': var unit="hour"; break;
	case 'mins': var unit="minute"; break;
	case 'ss': var unit="second"; break;
	}
	return "Bad " + unit + " \"" + dateStr.substr(strInd,2) + 
	"\".";
	}
	switch (tokArr[tokInd].token.toLowerCase()) {
	case 'dd': intDay=parseInt(matchArr[0],10); break;
	case 'mm': intMonth=parseInt(matchArr[0],10); break;
	case 'hh': intHour=parseInt(matchArr[0],10); break;
	case 'mins': intMin=parseInt(matchArr[0],10); break;
	case 'ss': intSec=parseInt(matchArr[0],10); break;
	}
	break;
	case 'y':
	case 'Y':

	if (dateStr.substr(strInd,4).search(/\d{4}/) != -1) {

	intYear=parseInt(dateStr.substr(strInd,4),10);
	strOffset=4;
	}
	else {
	if (dateStr.substr(strInd,2).search(/\d{2}/) != -1) {

	intYear=parseInt(dateStr.substr(strInd,2),10);
	if (intYear>=cutoffYear) {
	intYear+=1900;
	}
	else {
	intYear+=2000;
	}
	strOffset=2;
	}
	else {

	return "Bad year \"" + dateStr.substr(strInd,2) + 
	"\". Must be two or four digits.";
	   }
	}
	break;
	case 'yy':
	case 'YY':

	if (dateStr.substr(strInd,2).search(/\d{2}/) != -1) {

	intYear=parseInt(dateStr.substr(strInd,2),10);
	if (intYear>=cutoffYear) {
	intYear+=1900;
	}
	else {
	intYear+=2000;
	}
	strOffset=2;
	} else {

	return "Bad year \"" + dateStr.substr(strInd,2) + 
	"\". Must be two digits.";
	}
	break;
	case 'yyyy':
	case 'YYYY':

	if (dateStr.substr(strInd,4).search(/\d{4}/) != -1) {

	intYear=parseInt(dateStr.substr(strInd,4),10);
	strOffset=4;
	}
	else {

	return "Bad year \"" + dateStr.substr(strInd,4) + 
	"\". Must be four digits.";
	}
	break;
	case 'mon':
	case 'Mon':
	case 'MON':
	case 'mon_strict':

	monPat=monPatArr[tokArr[tokInd].token];
	if (dateStr.substr(strInd,3).search(monPat) != -1) {
	intMonth=lowerMonArr[dateStr.substr(strInd,3).toLowerCase()];
	}
	else {

	switch (tokArr[tokInd].token) {
	case 'mon_strict': caseStat="lower-case"; break;
	case 'Mon': caseStat="mixed-case"; break;
	case 'MON': caseStat="upper-case"; break;
	case 'mon': caseStat="between Jan and Dec"; break;
	}
	return "Bad month \"" + dateStr.substr(strInd,3) + 
	"\". Must be " + caseStat + ".";
	}
	strOffset=3;
	break;
	case 'month':
	case 'Month':
	case 'MONTH':
	case 'month_strict':

	monPat=monthPatArr[tokArr[tokInd].token];
	matchArray=dateStr.substr(strInd).match(monPat);
	if (matchArray==null) {

	return "Can't find a month beginning at \"" +
	dateStr.substr(strInd) + "\".";
	}

	intMonth=lowerMonArr[matchArray[0].substr(0,3).toLowerCase()];
	strOffset=matchArray[0].length;
	break;
	case 'ampm':
	case 'AMPM':
	matchArr=dateStr.substr(strInd).match(/^(am|pm|AM|PM|a\.m\.|p\.m\.|A\.M\.|P\.M\.)/);
	if (matchArr==null) {

	return "Missing am/pm designation.";
	}

	if (matchArr[0].substr(0,1).toLowerCase() == "a") {

	ampm = "am";
	}
	else {
	ampm = "pm";
	}
	strOffset = matchArr[0].length;
	break;
	}
	strInd += strOffset;
	tokInd++;
	}
	if (tokInd != tokArr.length || strInd != dateStr.length) {

	return "Date is either missing desired information or has more information than the expected format: " + formatStr;
	}

	if (intMonth < 1 || intMonth > 12) {
	return "Month must be between 1 and 12.";
	}
	if (intDay < 1 || intDay > 31) {
	return "Day must be between 1 and 31.";
	}

	if ((intMonth == 4 || intMonth == 6 || intMonth == 9 || intMonth == 11) && intDay == 31) {
	return "Month "+intMonth+" doesn't have 31 days!";
	}

	if (intMonth == 2) {

	var isleap=(intYear%4==0 && (intYear%100!=0 || intYear%400==0));
	if (intDay > 29 || (intDay == 29 && !isleap)) {
	return "February " + intYear + " doesn't have " + intDay + 
	" days!";
	   }
	}

	if (ampm == "") {
	if (intHour < 0 || intHour > 23) {
	return "Hour must be between 0 and 23 for military time.";
	   }
	}
	else {

	if (intHour < 1|| intHour > 12) {
	return "Hour must be between 1 and 12 for standard time.";
	   }
	}

	if (ampm=="am" && intHour==12) {
	intHour=0;
	}
	if (ampm=="pm" && intHour < 12) {
	intHour += 12;
	}
	if (intMin < 0 || intMin > 59) {
	return "Minute must be between 0 and 59.";
	}
	if (intSec < 0 || intSec > 59) {
	return "Second must be between 0 and 59.";
	}
	return new Date(intYear,intMonth-1,intDay,intHour,intMin,intSec);
	}
	function dateCheck(dateStr,formatStr) {
	var myObj = buildDate(dateStr,formatStr);
	if (typeof myObj == "object") {

	return true;
	}
	else {

	alert(myObj);
	return false;
	   }
	}

	function currencyFormat(fld, milSep, decSep, e) {
	var sep = 0;
	var key = '';
	var i = j = 0;
	var len = len2 = 0;
	var strCheck = '0123456789';
	var aux = aux2 = '';
	var whichCode = (window.Event) ? e.which : e.keyCode;
	if (whichCode == 13) return true;  // Enter
	key = String.fromCharCode(whichCode);  // Get key value from key code
	if (strCheck.indexOf(key) == -1) return false;  // Not a valid key
	len = fld.value.length;
	for(i = 0; i < len; i++)
	if ((fld.value.charAt(i) != '0') && (fld.value.charAt(i) != decSep)) break;
	aux = '';
	for(; i < len; i++)
	if (strCheck.indexOf(fld.value.charAt(i))!=-1) aux += fld.value.charAt(i);
	aux += key;
	len = aux.length;
	if (len == 0) fld.value = '';
	if (len == 1) fld.value = '0'+ decSep + '0' + aux;
	if (len == 2) fld.value = '0'+ decSep + aux;
	if (len > 2) {
	aux2 = '';
	for (j = 0, i = len - 3; i >= 0; i--) {
	if (j == 3) {
	aux2 += milSep;
	j = 0;
	}
	aux2 += aux.charAt(i);
	j++;
	}
	fld.value = '';
	len2 = aux2.length;
	for (i = len2 - 1; i >= 0; i--)
	fld.value += aux2.charAt(i);
	fld.value += decSep + aux.substr(len - 2, len);
	}
	return false;
	}

//-->