/* Global Variables */
	 var currentDate = new Date();//make a new date object set at the current date 
	 var currentYear = currentDate.getFullYear() + "";//get the four position year and make it a string 
	 var currentMonth = (currentDate.getMonth() + 1) + "";//get the zero-indexed month and add 1
																				//for the real month and make it a string	
			 if (currentMonth.length == 1) { //add a zero at the beginning if only one digit month
			   currentMonth = "0" + currentMonth;
			 }
	 var currentDayOfMonth = currentDate.getDate() + ""; //get the current day of the month and make it a string
			 if (currentDayOfMonth.length == 1) { //add a zero if necessary
			   currentDayOfMonth = "0" + currentDayOfMonth;
			 }
	currentDateStr = currentYear + currentMonth + currentDayOfMonth;//"20080519"
	currentDateNum = Number(currentDateStr);
	/* Created currentDate, currentDateStr, currentDateNum as separate variables just in case
		we need to use them in other functions. */

function initDateForm(){
	//form contains 
	dObj = document.Form1.zday;
	mObj = document.Form1.zmonth;
	yObj = document.Form1.zyear;
	for(i=0; i<dObj.length;i++){
		if(Number(currentDayOfMonth) == dObj.options[i].value){
			dObj.options[i].selected = true;
		}
	}
	for(j=0;j<mObj.length;j++){
		if(Number(currentMonth) == mObj.options[j].value){
			mObj.options[j].selected = true;
		}
	}
	for(k=0;k<yObj.length;k++){
		if(Number(currentYear) == yObj.options[k].value){
			yObj.options[k].selected = true;
		}
	}
}





function  checkDate(){
	var day = document.Form1.zday.value; 
			if (day.length == 1) {//add a zero if necessary
			   day = "0" + day;
			}		
	var mon = document.Form1.zmonth.value; 
			if (mon.length == 1) {//add a zero if necessary
				mon = "0" + mon;
			}				
	var yr = document.Form1.zyear.value;
  	var formDate = yr + mon + day;		
	formDate = Number(formDate);	
		
	if (currentDateNum > formDate) {
  		alert("The date you selected is in the past, please choose a date in the future.");		
		return false;
    }

}
