function CheckEmail (Ema) {
		
	email = Ema.value.toString();
	
	t = email.indexOf("@");
	
	if((email.indexOf(".") == -1) || (t == -1) || (t < 1) || (t > email.length - 5) || (email.charAt(t - 1) == '.') || (email.charAt(t + 1) == '.')) {
			
			alert("Please, Check Your E-mail");
			Ema.focus();
			
		return false;
		} 

}

// check telephone
function CheckTelephone (Tel)	 {

	var checktel="0123456789 -+()";
	
	for(i=0; i < Tel.value.length; i++) {
			if (checktel.indexOf(Tel.value.charAt(i))<0)  {
				
				alert("Please, Check Telephone. It Must be Digits or ()-+")
				Tel.focus();
				return false;
			}
	}
}


function CheckPostcode (PostC)	 {

	var checktel="0123456789";
	
	for(i=0; i < PostC.value.length; i++) {
			if (checktel.indexOf(PostC.value.charAt(i))<0)  {
				
				alert("Please, Check Postcode. It Must be Digits.")
				PostC.focus();
				return false;
			}
	}
}





function CheckContactForm (f){
	
	if (f.Name.value.length < 1 ){
		alert("Sorry, Name is Mandatory Field");
		f.Name.focus();
		return false;
	}
	
	
	
	if (f.Telephone.value.length < 1 ){
		alert("Sorry, Telephone is Mandatory Field");
		f.Telephone.focus();
		return false;
	}
	
	if (CheckTelephone (f.Telephone) === false) {
		
		return false;
		
	}
	
	if (f.Email.value.length < 1 ){
		alert("Sorry, Email is Mandatory Field");
		f.Email.focus();
		return false;
	}
	
	
	if (CheckEmail (f.Email) === false) {
		
		return false;
		
	}	
	
	if (f.Address.value.length < 1 ){
		alert("Sorry, Address is Mandatory Field");
		f.Address.focus();
		return false;
	}
	
	if (f.Address.value.length > 1000 ){
		alert("Sorry, Address is too long");
		f.Address.focus();
		return false;
	}
	
	if (f.Postcode.value.length < 1 ){
		alert("Sorry, Postcode is Mandatory Field");
		f.Postcode.focus();
		return false;
	}
	
//	if (CheckPostcode (f.Postcode) === false) {
//		
//		return false;
//		
//	}	
	
	if (f.Details.value.length < 1 ){
		alert("Sorry, Details is Mandatory Field");
		f.Details.focus();
		return false;
	}
	
	if (f.Details.value.length > 1000 ){
		alert("Sorry, Details is too long");
		f.Details.focus();
		return false;
	}

	
	
}




