function checkForm(){
	if (document.forms['contactform']){
	currentForm = document.forms['contactform'];
	
	if(!checkEmail(currentForm,"Address")){
	alert('Please enter a valid email address')
	return false;
	}
	else {
	return true;
	}
	
	}
}
function checkEmail(currentForm,input){
	var em = "";
	
	if(currentForm.elements[input].value == ""){

	return false;
	}
	else if(em = currentForm.elements[input].value ){
		em = trim(em);
		if(em.indexOf("@") == -1 || em.indexOf(".") == -1)
		{

		return false;
		}
	 
	  return true;
	}
}
function trim(st)
{
	var len = st.length;

	var begin = 0, end = len - 1;
	while (st.charAt(begin) == " " && begin < len)
	{
		begin++;
	}
	while (st.charAt(end) == " " && begin < end)
	{
		end--;
	}
	return st.substring(begin, end+1);
}