window.onload = function() {
	document.getElementById("header").onclick = function(){window.location.href = "http://www.mimitheangel.ca/";};
	var currentDate  = new Date();
	var currentMonth = "";
	switch(currentDate.getMonth()) {
		case 0:
			currentMonth = "January";
			break;
		case 1:
			currentMonth = "February";
			break;
		case 2:
			currentMonth = "March";
			break;
		case 3:
			currentMonth = "April";
			break;
		case 4:
			currentMonth = "May";
			break;
		case 5:
			currentMonth = "June";
			break;
		case 6:
			currentMonth = "July";
			break;
		case 7:
			currentMonth = "August";
			break;
		case 8:
			currentMonth = "September";
			break;
		case 9:
			currentMonth = "October";
			break;
		case 10:
			currentMonth = "November";
			break;
		case 11:
			currentMonth = "December";
	}
	if(document.getElementById("date")) {
		document.getElementById("date").innerHTML = currentMonth + " " +
													currentDate.getDate() + ", " +
													currentDate.getFullYear();
	}
	if(document.getElementById("radiointerview_01")) {
		document.getElementById("radiointerview_01").onclick = function(){return Popup(this);};
	}
}
function Popup(e) {
	var popup = window.open(e.getAttribute("href"), "Popup", "height=250,width=400,location=no,menubar=no,directories=no,toolbar=no,status=no,resizable=yes,scrollbars=yes");
	return false;
}
// Validate against empty (non-checked) checkboxes
function Validate_Subscribe() {
    var form_Firstname 	  = document.getElementById("firstname");
    var form_Lastname  	  = document.getElementById("lastname");
    var form_Email	   	  = document.getElementById("email");
    var form_EmailConfirm = document.getElementById("email_confirm");
    var boolStatus   = false;
    
	// Check for any empty fields
	if(form_Firstname.value.length < 1) {
		alert("Please provide your first name");
		form_Firstname.focus();
	} else if(form_Lastname.value.length <1 ) {
		alert("Please provide your last name");
		form_Lastname.focus();
	} else if(form_Email.value.length < 1) {
		alert("Please provide your e-mail address");
		form_Email.focus();
	} else if(form_EmailConfirm.value.length < 1) {
		alert("Please provide the same e-mail address used above for confirmation");
		form_EmailConfirm.focus();
	} else {
		boolStatus = true;
	}
	
	// Check for valid e-mail addresses
	if(boolStatus) {
		if(!form_Email.value.match(/\b[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}\b/i)) {
			alert("You have provided an invalid e-mail address");
			form_Email.focus();
			boolStatus = false;
		} else if(!form_EmailConfirm.value.match(/\b[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}\b/i)) {
			alert("You have provided an invalid confirmation e-mail address");
			form_EmailConfirm.focus();
			boolStatus = false;
		}
	}
	
	// No empty fields - check for correct e-mail address
	if(boolStatus) {
		if(form_Email.value != form_EmailConfirm.value) {
			alert("Please confirm that the two e-mail addresses you entered are the same");
			form_EmailConfirm.focus();
			boolStatus = false;
		}
	}
		
    return boolStatus;
}
