
$().ready(function() {
	// Error Modal
	$('#alertDialog').jqm({
		modal: true,
		toTop: true
	});
	
	// MIT Research Requirements
	$('#MITDialog').jqm({
		modal: true,
		closeClass: "jqmCloseAlt",
		trigger: ".jqModalAlt",
		toTop: true
	});
	
	// Privacy Policy
	$('#privacyPolicyDialog').jqm({
		modal: true,
		closeClass: "jqmClosePrivacy",
		trigger: ".jqModalPrivacy",
		toTop: true
	});
	
	// Terms Of Service
	$('#termsOfServiceDialog').jqm({
		modal: true,
		closeClass: "jqmCloseTOS",
		trigger: ".jqModalTOS",
		toTop: true
	});
	
	// Alt Password
	$('#mediumDialog').jqm({
		modal: true,
		closeClass: "jqmCloseMed",
		trigger: ".jqModalMed",
		toTop: true
	});
	
	//Disable all input fields to prevent tabbing through...
	//$("input").not($('form#simpleSearchForm input')).attr("disabled", "disabled");
	$("#zipcode").attr("disabled", "disabled");
	
	$("#year").keydown( function(e) {
		if (e.which == 9) {
			ageValidation();
		}
	});
	
	$("#country").keydown( function(e) {
		if (e.which == 9) {
			selectedCountry = this.options[this.selectedIndex].value;
			
			if ( selectedCountry == 'US' ) {
				setTimeout('document.getElementById("zipcode").focus()',500);
			} else {
				// setTimeout('document.getElementById("education").focus()',500);
			}
		}
	});
	
	//Initialize age check fields
	daysInMonth(document.getElementById('day'));
});

