// JavaScript Document
	function checkchar(txt)
{
var rt = true;
var iChars = "!@#$%^&*()+=-[]\\\';/{}|\":<>?";

for (var i = 0; i < document.getElementById(txt).value.length; i++)
{
if (iChars.indexOf(document.getElementById(txt).value.charAt(i)) != -1)
{
rt = false;
}
}
return rt;
}
	
//function for Email Validation using ValidRegular Expression
function isValidEmail(strEmail){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
  strEmail = document.getElementById('email').value;

   // search email text for regular exp matches
    if (strEmail.search(validRegExp) == -1) 
   {
      <!--alert('A valid e-mail address is required.\nPlease amend and retry');-->
      return false;
    } 
    return true; 
}
	
function validation()
	
	{
		var fname=document.getElementById('fname').value;
		
		if(fname.indexOf(" ")== 0)
		{
			alert("Please Enter valid  Name");
	    return false;
		}
	else if(document.getElementById('fname').value=="")
		{
			alert("Please Enter Your Name")
			document.getElementById('fname').focus();
			return false;
		}
		else if (!checkchar('fname'))
		{
			alert("Invalid Name Please re-enter.")
			document.getElementById('fname').focus();
			return (false)
		}
		if(document.getElementById('email').value=="")
		{
			alert("Please Enter Your Email Address")
			document.getElementById('email').focus();
			return false;
		}
		else if(!isValidEmail("email"))
		{
			alert("Invalid Email Please re-enter.")
			document.getElementById('email').focus();
			return (false)
		}
		if (document.getElementById('comment').value=="")
		{
			alert("Please Enter Your Comments")
			document.getElementById('comment').focus();
			return false;
		}
		else if (!checkchar('comment'))
		{
			alert("Invalid Comments Please re-enter.")
			document.getElementById('comment').focus();
			return false;
		}
		return true;
		}



//function validation()
//{
//	//Validation for First Name	
//	if(document.contactus.fname.value=="")
//	{
//		alert("Please Enter Your Name!");
//		document.contactus.fname.focus()
//		return false;
//	}
//	else if(!checktext(document.contactus.fname.value))
//	{
//		alert("Please Enter only alphabets !")
//		document.contactus.fname.select()
//		return false;
//	}
//	//if (document.contactus.add1.value=="")
////	{
////		alert("Plz Enter Your Address")
////		document.contactus.add1.focus();
////		return false;
////	}
////	if (document.contactus.add2.value=="")
////	{
////		alert("Plz Enter Another Address")
////		document.contactus.add2.focus();
////		return false;
////	}
//	//Validation for City
//	//if(document.contactus.city.value=="")
////	{
////		alert("Please Enter Your City!");
////		document.contactus.city.focus()
////		return false;
////	}
////	else if(!checktext(document.contactus.city.value))
////	{
////		alert("Please Enter only alphabets !")
////		document.contactus.city.select()
////		return false;
////	}
//	   
//  //Validation for postcode
//  //if (document.contactus.postcode.value== "")   
////  {
////      alert("Please Enter Your Post Code !");
////      document.contactus.postcode.focus() 
////      return false;
////   }
//// test = document.contactus.postcode.value; size = test.length
//// test = test.toUpperCase(); //Change to uppercase
//// while (test.slice(0,1) == " ") //Strip leading spaces
////  {test = test.substr(1,size-1);size = test.length
////  }
//// while(test.slice(size-1,size)== " ") //Strip trailing spaces
////  {test = test.substr(0,size-1);size = test.length
////  }
//// document.contactus.postcode.value = test; //write back to form field
//// if (size < 6 || size >8){ //Code length rule
////  alert(test + " is not a valid postcode - wrong length");
////  document.contactus.postcode.focus();
////  return false;
////  }
//// if (!(isNaN(test.charAt(0)))){ //leftmost character must be alpha character rule
////   alert(test + " is not a valid postcode - cannot start with a number");
////   document.contactus.postcode.focus();
////   return false;
////  }
//// if (isNaN(test.charAt(size-3))){ //first character of inward code must be numeric rule
////   alert(test + " is not a valid postcode - alpha character in wrong position");
////   document.contactus.postcode.focus();
////   return false;
////  }
//// if (!(isNaN(test.charAt(size-2)))){ //second character of inward code must be alpha rule
////   alert(test + " is not a valid postcode - number in wrong position");
////   document.contactus.postcode.focus();
////   return false;
////  }
//// if (!(isNaN(test.charAt(size-1)))){ //third character of inward code must be alpha rule
////   alert(test + " is not a valid postcode - number in wrong position");
////   document.contactus.postcode.focus();
////   return false;
////  }
//// if (!(test.charAt(size-4) == " ")){//space in position length-3 rule
////   alert(test + " is not a valid postcode - no space or space in wrong position");
////   document.contactus.postcode.focus();
////   return false;
////   }
//// count1 = test.indexOf(" ");count2 = test.lastIndexOf(" ");
//// if (count1 != count2){//only one space rule
////   alert(test + " is not a valid postcode - only one space allowed");
////   document.contactus.postcode.focus();
////   return false;
////  }
//  //////////Validation for email
//  if(document.contactus.email.value=="")
//			{
//		alert("Please  enter your email");
//		document.contactus.email.focus();
//		return false;
//			}
//else if(!isValidEmail(document.contactus.email.value))
//	    {
//	    alert("Please enter valid Email");
//		document.contactus.email.select()
//		return false;
//	    }     
//	
//	//Validation for Telephone Number
//	
//	//var myTelNo = document.getElementById('tel').value;
////	if (!checkUKTelephone (myTelNo)) 
////	{
////		alert (telNumberErrors[telNumberErrorNo]);
////		document.contactus.tel.select();
////		return false;
////    }
//	if (document.contactus.comment.value=="")
//	{
//		alert("Plz Enter Some Comments")
//		document.contactus.comment.focus();
//		return false;
//	}
//	return true;
//
//}