// JavaScript Document <script language="javascript" type="text/javascript">

var now = new Date();

function startup() {
	document.getElementById('selmonthdes').selectedIndex = now.getMonth();
	resetDaysDes(now.getMonth(),"T");
	document.getElementById('selmonthalt').selectedIndex = now.getMonth();
	resetDaysAlt(now.getMonth(),"T");
}
function resetDaysDes(month,curday) {
	var days = 0;
	switch(month) {
		case 1:
			days = 28;
			break;
		case 2:	case 6:	case 8:	case 9:
			days = 30;
			break;
		case 0:	case 3:	case 4:	case 5:	case 7:	case 10: case 11:
			days = 31;
			break;
		default:
	}
	var obj = document.getElementById('seldaydes');
	obj.options.length = 0;
	for (var i=0; i<days; i++) {
		obj.options[obj.options.length] = new Option(i+1,i+1);
	}
	if (curday == "T") {
		obj.selectedIndex = now.getDate()-1;
	}
}

function resetDaysAlt(month,curday) {
	var days = 0;
	switch(month) {
		case 1:
			days = 28;
			break;
		case 2:	case 6:	case 8:	case 9:
			days = 30;
			break;
		case 0:	case 3:	case 4:	case 5:	case 7:	case 10: case 11:
			days = 31;
			break;
		default:
	}
	var obj = document.getElementById('seldayalt');
	obj.options.length = 0;
	for (var i=0; i<days; i++) {
		obj.options[obj.options.length] = new Option(i+1,i+1);
	}
	if (curday == "T") {
		obj.selectedIndex = now.getDate()-1;
	}
}


function validForm(form) {
	var email = form.emailaddy.value;
	
	if (email == "") 
	{ 
		alert("Please enter your email address");
		form.emailaddy.focus();
		return false;
	}
	else if (isValidEmail(email) == false) 
	{
		alert("Your email address is invalid!");
		form.emailaddy.focus();
		return false;
	} 
	else
	{
		return true;
	}
}


function isValidEmail(email) {
	var locA = email.indexOf("@");
	var locD = email.indexOf(".");
	var len = email.length;
	if (locA == -1 || locA == 0 || locA == len || locD == -1 || locD == 0 || locD == len || email.indexOf("@",(locA+1)) != -1 || email.substring(locA - 1, locA) == locD || email.substring(locA + 1, locA + 2) == locD || email.indexOf(".",(locA + 2)) == -1 || email.indexOf(" ") > -1) 
	{
		return false;
	}
	else
	{
		return true;
	}
}
	
		
		