
// pledge frame

// make sure email is formatted, and encode it to send to phplist
function formatEmail() { 
	var email = document.getElementById("email").value;
	//alert("Email is " + emailEl.value);
	var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
     if (email.search(emailRegEx) == -1) {
          alert("That address doesn't look right - wanna try again?");
     }
     else {
          newLocation = "http://www.noshuffleday.com/SimpleSub.php?email=" + email.replace(/@/g,"%40");
          window.location = newLocation;
     }
     return false;
}

// is today no shuffle day? if so, change header text
function checkNSD() {
	var currentTime = new Date();
	if ((currentTime.getDay() == 1) && (currentTime.getDate() <= 7)) {
		document.getElementById("nsdate").innerHTML='Today is No Shuffle Day!';
	}
}

// JavaScript Document