function formValidator(){
	var name = document.getElementById('name');
	var email = document.getElementById('email');
	
	

	if(isAlphabet(name, "Please enter a valid name (characters only)")){
	if(emailValidator(email, "Please enter a valid email address (joe@hotmail.com)")){
							return true;
	}
}	
	
	return false;
	
}

function isEmpty(elem, helperMsg){
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus(); 
		return true;
	}
	return false;
}

function isAlphabet(elem, helperMsg){
	var alphaExp = /^[a-z A-Z]+$/;
	if(elem.value.match(alphaExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}
function emailValidator(elem, helperMsg){
	var emailExp = /^[\w\-\.\+]+\@[a-z A-Z 0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if(elem.value.match(emailExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function delayer(){
    window.location = "contact.php"
}

function error(){
    window.location = "javascript: history.go(-1)"
}
function redirect(){
    window.location = "index.php"
}
function error404(){
    window.location = "http://www.lilaccancer.org/"
}

function popUp(url){
	window.open(url,"pop","width=550,height=400,toolbars=0,scrollbars=1")
}

function formValidator(){
	var email = document.getElementById('email');

			if(emailValidator(email, "Please enter a valid email address (Lisa@Mail.com)")){
							return true;
				        		}	return false;
	
}

function isEmpty(elem, helperMsg){
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus(); 
		return true;
	}
	return false;
}

function emailValidator(elem, helperMsg){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if(elem.value.match(emailExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

