function clearText(thefield){
    if (thefield.defaultValue==thefield.value) thefield.value = "";
} 
        
function restoreText(thefield,thetext) {
    if (thefield.value == '') thefield.value = thetext; 
}

function validateSubscribe(theform) {
	if(!validateEmail(theform.email.value))
	{
		alert('You have entered an invalid email.');
		theform.email.value = "";
		theform.email.focus();
		return false;	
	}
	return true;
}

function validateEmail(email) 
{ 
 var re = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/;
 return email.match(re) 
}

