function validateAge(obj,evnt) {
	if (document.theForm.chkAgeVerification.checked == false) 
	{
		evnt.IsValid = false;
	}
}

function validateAgree(obj,evnt) {
	
	if (document.theForm.chkAgree.checked == false)
	{
		evnt.IsValid = false;
	}
}

function ageCheck(obj,evnt) {
	if (isDate()) {
		var myDate
		var today = new Date();
		
		myDate = new Date(document.theForm.ddlMonth.options[document.theForm.ddlMonth.selectedIndex].value + "/" + document.theForm.ddlDay.options[document.theForm.ddlDay.selectedIndex].value + "/" + document.theForm.ddlYear.options[document.theForm.ddlYear.selectedIndex].value);
		var sYear = today.getFullYear()-18;
		var sMonth = today.getMonth() + 1;
		var sDay = today.getDate();
		var today = new Date(sMonth + "/" + sDay + "/" + sYear);
		
		if (today < myDate) {
		evnt.IsValid = false;
		}
	}
}

function validateBirthDate(obj,evnt) {
	if (isDate()) {
		//alert("valid");
		}
	else {
		evnt.IsValid = false;
	}
}
function validateExpiryDate(obj,evnt) {
	if (isDate()) {
		//alert("valid");
		}
	else {
		evnt.IsValid = false;
	}
}
function isDate() {
	var myDate 
	myDate = document.theForm.ddlMonth.options[document.theForm.ddlMonth.selectedIndex].value + "/" + document.theForm.ddlDay.options[document.theForm.ddlDay.selectedIndex].value + "/" + document.theForm.ddlYear.options[document.theForm.ddlYear.selectedIndex].value;
	
	var delimiterFirstInstance;
	var delimiterSecondInstance;
	var delimiterType;
	var monthPart;
	var dayPart;
	var yearPart;

	//accepts delimiting characters of either "/" or "-"

	//indexOf is similar to the Vb InStr() function
	delimiterFirstInstance = myDate.indexOf("/");
	if (delimiterFirstInstance == -1) {
		//check for the other allowed delimiter
		delimiterFirstInstance = myDate.indexOf("-");
		//if it is still not found, return false
	if (delimiterFirstInstance == -1) {
		return false;
	} 
		delimiterType = "-";
	} 
	else { 
		delimiterType = "/";
	}
	//indexOf is similar to the Vb InStr() function
	delimiterSecondInstance = myDate.indexOf(delimiterType,
	(delimiterFirstInstance + 1));
	if (delimiterSecondInstance == -1) {
		return false;
	}
	monthPart = myDate.substring(0, delimiterFirstInstance);
	if(validateMonth(monthPart) == false) {
		return false;
	}
	yearPart = myDate.substring((delimiterSecondInstance + 1),
	(myDate.length));

	if(validateYear(yearPart) == false) {
		return false;
	}

	dayPart = myDate.substring((delimiterFirstInstance + 1),
	(delimiterSecondInstance));
	if(validateDay(monthPart, dayPart, yearPart) == false) {
		return false;
	} else { 
		return true;
	}
}
function validateDay(m, d, y) {
	if((isNaN(d)) || d == "") {
		return false;
	}
	var mo = parseInt(m, 10);
	var da = parseInt(d, 10);
	var ye = parseInt(y, 10);

		if (da < 1) {
			return false;
		}

		if ((mo == 4) || (mo == 6) || (mo == 9) || (mo == 11)) {
		//it is a 30 day month
		if (da > 30) {
			return false;
		}
	} else if(mo == 2) {
	// it is february (either 28 or 29 depending on leap year)
		if (isLeapYear(ye) == true) {
			if (da > 29) {
			//leap years have 29 days in february
			return false;
			}
		} 
		else {
			if (da > 28) {
			//non leap years have 28 days in february
			return false;
		}
		}
	} 
	else {
	// it is a 31 day month
		if (da > 31) {
			return false;
		}
	}
	//if we made it through all of the above without falling out,
	//it must be a valid day for the given month and year
	return true;
}

function validateMonth(mnth) {
	if((isNaN(mnth)) || mnth == "") {
	return false;
	}
	var intMonth = parseInt(mnth, 10);
	if((intMonth < 1) || (intMonth > 12)) {
		return false; //month must be between 1 and 12 (inclusive)
	} 
	else { 
		return true;
	}
}

function validateYear(yr) {
	if((isNaN(yr)) || yr == "") {
		return false;
	}
	//var intYear = parseInt(yr, 10);
	//if((intYear < 1970) || (intYear > 9999)) {
	//return false; //year must be between 1970 and 9999 (inclusive)
	//} else { return true;
	//} 
}

function isLeapYear(yr) {
/* classic leap year calculation:
	if the year is:
	evenly divisible by 4 and not evenly divisible by 100
	or
	evenly divisible by 400
	then it is a leap year,
	Otherwise it is not a leap year
*/

	if (((yr % 4 == 0) && (yr % 100 != 0)) || (yr % 400 == 0)) {
		return true;
	} 
	else { 
		return false;
	} 
}
function validatePassword(obj,evnt) {
	var sPassword = document.theForm.txtPassword.value;
	if ((sPassword.length < 6) || (sPassword.length > 20)) {
		evnt.IsValid = false;
	}
}
-->