<!--

var gED = new easyDate();



function isDateValid(day, monthyear, nlcheckID) {
	var bReturn;
	bReturn=true;

	with (gED) {
		if ((getDay(day) == 0) && (getMonth(monthyear) == 0)) {
			// date not selected but left untouched... so exit with a smile...
			bReturn= true;
		} else if ((getDay(day) == 0) || (getMonth(monthyear) == 0)) {
			// the date must be complete, only will be done for returning...
			alert(errorMSG['IncompleteDate']);
			bReturn= false;
		}else{
			
			// js will make 31st Feb 2004 the 2nd March 2004...
			// so check that the date we have, has the same month as the date passed!...
			var objDate = constructDate(monthyear, day, true);
			if ((getMonth(monthyear)) < objDate.getMonth()+1) {
				alert(errorMSG['InvalidDate']);
				if (nlcheckID == 1) { // out
					day.selectedIndex = (getDay(day)-objDate.getDate()-1);
				} else {
					day.selectedIndex = (getDay(day)-objDate.getDate());
				}
				bReturn= false;
			}
		}
	}
	return bReturn;
}



function populateDays(oHTML, bOrig, bToday) {

	var sDay='';
	var nlPos=0;
	var dDay = new Date(serveryear,servermonth-1,serverday).getDate();
	var nlNow=0;
	for (var nlCount = 1; nlCount <= 31; nlCount++) {
		sDay = nlCount.toString();
		if (nlCount<10) {
			sDay = ('0'+ sDay)
		}
		if (bOrig) {
			nlPos = nlCount-1
		} else {
			nlPos = nlCount
		}
		if (bToday && (dDay == nlPos)) {
			nlNow = (nlPos-1);
		}
		oHTML.options[nlPos] = new Option(sDay, nlCount);
	}

	oHTML.selectedIndex = nlNow;

}
 // 




function easyDate() {

	easyDate.prototype.formatDate = function(dteDateToFormat) {
		//This will return a date in dd MMM yyyy format
		var strDay = dteDateToFormat.getDate();
		var strMonth = monthArray[dteDateToFormat.getMonth() + 1];
		var strYear = dteDateToFormat.getFullYear();
		var strFormattedDate = strDay + "/" + strMonth + "/" + strYear;
		return strFormattedDate;
	}

	easyDate.prototype.constructDate = function(monthyear, day, bMinus1) {
		
		var objYear = this.getYear(monthyear);
		var objMonth = this.getMonth(monthyear);
		var objDay = this.getDay(day);
		var objDate;
		
		if (bMinus1) {
			objDate = new Date(objYear, (objMonth-1), objDay);
		} else {
			objDate = new Date(objYear, objMonth, objDay);
		}
		return objDate;
	}

	easyDate.prototype.getYear = function(monthyear) {
		return monthyear.options[monthyear.selectedIndex].value.substring(2,6);
	}

	easyDate.prototype.getMonth = function(monthyear){
		return monthyear.options[monthyear.selectedIndex].value.substring(0,2)
	}

	easyDate.prototype.getDay = function(day) {		
		return day.options[day.selectedIndex].value;
	}
}



function selectOption(pCtrl,strVal){
	var nlCount;
	if(pCtrl==null) return;
	if(pCtrl.options){
		for (nlCount=0; (nlCount < pCtrl.options.length); nlCount++) {
			if(pCtrl.options[nlCount].value==strVal){
				pCtrl.selectedIndex = nlCount;
				break;
			}
		}
	}
}



var sClose='Close';
						
-->