//Everything here handcoded by the ghost in the machine.
function LoadContent(source){ window.location=source; }

function ValidateEmail(elem){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	return elem.value.match(emailExp);	//will be true if it matched; false otherwise.
}

function SubmitEmail(elem){
	if(ValidateEmail(elem)){
		LoadContent("thanks.php?email=" + elem.value); 
		return true;
	}
	else{
		alert('Please enter a valid email address.');
		elem.focus();
		return false;
	}	
}

function ShowAnswer(clicked){
	var imagespan=clicked.childNodes[0];
	var answer = clicked.childNodes[2];
	if(answer.style.display!="block"){ 
		answer.style.display="block";	
		imagespan.innerHTML="<img src='/images/minus.gif'>";
	} 
	else {
		answer.style.display="none";
		imagespan.innerHTML="<img src='/images/plus.gif'>";
	}
}

function HighlightLink(link){ 
	var imagelink = "<img src='images/drop.png'/>";
	link.innerHTML= imagelink + link.innerHTML; 
	link.style.color = "#d80025";
}
function UnHighlightLink(link, string){ 
	link.innerHTML = string;
	link.style.color = "#123BB3";
}
