// JavaScript Document
function showerroremail() { 
	alert("E-mail was entered wrong."); 
}

function check() 
 { 

	 var empty = new RegExp(/^\s{1,}$/);

	 txtlastname = document.contactform.lastname.value;
	 if (txtlastname == '') { 
	 alert("Please insert Your First name"); 
	 return(false) 
	 }
	 	 		
	 txtname=document.getElementById('name').value;
	 if (txtname=="") { 
		 alert("Please insert Your Last name"); 
	 return(false) 
	 } 

	 txtemail=document.contactform.email.value; 
	 
	 if (txtemail == "") { 
	 alert("Please insert Your E-mail"); 
	 return(false) 
	 } 
	 
	 if (txtemail.indexOf(".") == -1) { 
	 alert("Missing symbol . in email"); 
	 return(false) 
	 } 
	 
	 dog = txtemail.indexOf("@"); 
	 if (dog == -1) { 
	 alert("Missing symbol \"@\" in email."); 
	 return(false) 
	 } 
	 
	 if ((dog < 1) || (dog > txtemail.length - 5)) { 
	 showerroremail(); 
	 return(false) 
	 } 
	 
	 if ((txtemail.charAt(dog - 1) == '.') || (txtemail.charAt(dog + 1) == '.')) { 
	 showerroremail(); 
	 return(false) 
	 } 
	 
 	 txtmobil=document.contactform.mobil.value; 
	 	 
	 if (txtmobil == "") { 
	 alert("Please insert Your mobile number."); 
	 return(false) 
	 }
	 
 	 var re_phone = /^([0-9,+() s-]{5,23})$/; 
	 if(!txtmobil.match(re_phone)) {
	 	alert("Error in mobile number"); return false;
	}
	
}
