	
		function MakeArray(n) {
			this.length = n
			return this
		}
		
		
		monthNames = new MakeArray(12)
		monthNames[1] = "January"
		monthNames[2] = "February"
		monthNames[3] = "March"
		monthNames[4] = "April"
		monthNames[5] = "May"
		monthNames[6] = "June"
		monthNames[7] = "July"
		monthNames[8] = "August"
		monthNames[9] = "September"
		monthNames[10] = "October"
		monthNames[11] = "November"
		monthNames[12] = "December"

		dayNames = new MakeArray(7)
		dayNames[1] = "Sun"
		dayNames[2] = "Mon"
		dayNames[3] = "Tue"
		dayNames[4] = "Wed"
		dayNames[5] = "Thu"
		dayNames[6] = "Fri"
		dayNames[7] = "Sat"


		
	
		function check_size(objtextarea,ilimit) {
			var stext;
			if ((objtextarea.value.length) > ilimit)
				{
				stext=objtextarea.value;
				objtextarea.value=stext.substring(0,ilimit);
				}
		}
		
		
		function isNumeric(x) {
			var numbers=".0123456789";
			// is x a String or a character?
			if(x.length>1) {
				// remove negative sign
				x=Math.abs(x)+"";
				for(j=0;j<x.length;j++) {
					// call isNumeric recursively for each character
					number=isNumeric(x.substring(j,j+1));
					if(!number) return number;
				}
				return number;
			}
			else {
				// if x is number return true
				if(numbers.indexOf(x)>=0) return true;
				return false;
			}
		}
		
		
		
	//this function is incomplete
	function DateAdd(Interval, Number,MyDate) {
		var oneMinute=60*1000;
		var oneHour=oneMinute*60;
		var oneDay=oneHour*24;
		var oneWeek=oneDay*7;
		var currentdateinms=MyDate.getTime()
		var newdate
		
		switch (Interval)	{
			case "s":
				currentdateinms=currentdateinms+1000;
			break;
			case "n":
				currentdateinms=currentdateinms+(oneMinute*Number);
			break;
			case "h":
				currentdateinms=currentdateinms+(oneHour*Number);
			break;
			case "d":
				currentdateinms=currentdateinms+(oneDay*Number);
			break;
			case "w":
				currentdateinms=currentdateinms+(oneWeek*Number);
			break;								
		}
			
		newdate=new Date(currentdateinms);

		return newdate;

	}
	
	
	
	
	function ud(cboDay, cboMonth, cboYear) {
		if(cboMonth.options[cboMonth.selectedIndex].value == "February") {
			cboDay.options[29] = null;
			cboDay.options[30] = null;
			cboDay.options[31] = null;
			var year = eval(cboYear.options[cboYear.selectedIndex].value);
			if ( ((year%400)==0) || (((year%100)!=0) && ((year%4)==0)) ) {
				if (cboDay.options[29] == null) {
					cboDay.options[29] = new Option("29");
					cboDay.options[29].value = "29";
				}
			} 
			else {
				cboDay.options[29] = null;
			}
		}

		  if(cboMonth.options[cboMonth.selectedIndex].value == "January" ||
		     cboMonth.options[cboMonth.selectedIndex].value == "March" ||
		     cboMonth.options[cboMonth.selectedIndex].value == "May" ||
		     cboMonth.options[cboMonth.selectedIndex].value == "July" ||
		     cboMonth.options[cboMonth.selectedIndex].value == "August" ||
		     cboMonth.options[cboMonth.selectedIndex].value == "October" ||
		     cboMonth.options[cboMonth.selectedIndex].value == "December")
		  {
		    if (cboDay.options[29] == null) {
		      cboDay.options[29] = new Option("29");
		      cboDay.options[29].value = "29";
		    }
		    if (cboDay.options[30] == null) {
		      cboDay.options[30] = new Option("30");
		      cboDay.options[30].value = "30";
		    }
		    if (cboDay.options[31] == null) {
		      cboDay.options[31] = new Option("31");
		      cboDay.options[31].value = "31";
		    }
		  }

		  if(cboMonth.options[cboMonth.selectedIndex].value == "April" ||
		     cboMonth.options[cboMonth.selectedIndex].value == "June" ||
		     cboMonth.options[cboMonth.selectedIndex].value == "September" ||
		     cboMonth.options[cboMonth.selectedIndex].value == "November")
		  {
		    if (cboDay.options[29] == null || cboDay.options[29].value=="") {
		      cboDay.options[29] = new Option("29");
		      cboDay.options[29].value = "29";
		    }
		    
		    if (cboDay.options[30] == null  || cboDay.options[30].value=="") {
		      cboDay.options[30] = new Option("30");
		      cboDay.options[30].value = "30";
		    }
		    cboDay.options[31] = null;
		  }

		  if (cboDay.selectedIndex == -1)
		    cboDay.selectedIndex = 0;

		}
		
		
	function left(sString,length)	{
		return sString.substring(0,length);
	}
	
	function isPositiveInteger(inputVal) {
		inputStr = inputVal.toString();
		for (var i = 0; i < inputStr.length; i++) {
			var oneChar = inputStr.charAt(i)
			if (oneChar < "0" || oneChar > "9") {
				return false
			}
		}
		return true
	}
	
	function isDate(inputVal) {
		var sInput = inputVal.toString();
		var iSlashPos1 = sInput.indexOf("/");
		var iSlashPos2 = sInput.lastIndexOf("/");
		
		if ((iSlashPos1 == 1 || iSlashPos1 == 2) && ((iSlashPos1 + 2 == iSlashPos2) || (iSlashPos1 + 3 == iSlashPos2))) {
			var iDay = parseInt(sInput.substring(0, iSlashPos1), 10);
			var iMonth = parseInt(sInput.substring(iSlashPos1 + 1, iSlashPos2), 10);
			var iYear = parseInt(sInput.substring(iSlashPos2 + 1, sInput.length), 10);
			if (!isNaN(iDay) && !isNaN(iMonth) && !isNaN(iYear)) {
				if (iYear >= 1900 && iYear <= 2078) {
					if ((iDay >= 1 && iDay <= 31) && (iMonth == 1 || iMonth == 3 || iMonth == 5 || iMonth == 7 || iMonth == 8 || iMonth == 10 || iMonth == 12)) {
						return true;
					}
					else if ((iDay >= 1 && iDay <= 30) && (iMonth == 4 || iMonth == 6 || iMonth == 9 || iMonth == 11)) {
						return true;
					}
					else if ((iDay >= 1 && iDay <= 29) && (iMonth == 2)) {
						if (iDay == 29 && ((iYear % 400 !=0) && (iYear % 100 == 0 || iYear % 4 != 0))) {
							return false;
						}
						else {
							return true;
						}
					}
					else {
						return false;
					}
				}
				else {
					return false;
				}
			}
			else {
				return false;
			}
		}
		else {
			return false;
		}
	}
	function validateDateRange(dtFrom, dtTo) {
		if (isDate(dtFrom)) {
			if (isDate(dtTo)) {
				sInput = dtFrom.toString();
				var iSlashPos1 = sInput.indexOf("/");
				var iSlashPos2 = sInput.lastIndexOf("/");
				
				var iDay1 = parseInt(sInput.substring(0, iSlashPos1), 10);
				var iMonth1 = parseInt(sInput.substring(iSlashPos1 + 1, iSlashPos2), 10);
				var iYear1 = parseInt(sInput.substring(iSlashPos2 + 1, sInput.length), 10);
				
				sInput = dtTo.toString();
				var iSlashPos1 = sInput.indexOf("/");
				var iSlashPos2 = sInput.lastIndexOf("/");
				
				var iDay2 = parseInt(sInput.substring(0, iSlashPos1), 10);
				var iMonth2 = parseInt(sInput.substring(iSlashPos1 + 1, iSlashPos2), 10);
				var iYear2 = parseInt(sInput.substring(iSlashPos2 + 1, sInput.length), 10);
				
				if ((iYear2 < iYear1) || ((iYear1 == iYear2) && (iMonth2 < iMonth1)) || ((iYear1 == iYear2) && (iMonth1 == iMonth2) && (iDay2 < iDay1))) {
					return 3;
				}
				else {
					return 0;
				}
			}
			else {
				return 2;
			}
		}
		else {
			return 1;
		}
	}
	
	function bCheckTextSize(txtCheck, lSize, sName) {
		if (txtCheck.value.length > lSize) {
			if (confirm(sName + " is over the maximum length of " + lSize.toString() + " characters.\nDo you wish to Continue?\n(Continuing will truncate the text)")) {
				txtCheck.value = txtCheck.value.substring(0, lSize);
				return true;
			}
			else {
				txtCheck.focus();
				return false;
			}
		}
		else
			return true;
	}
	