function enquiry_form() {
 
  var error=false;
  var msg='';
  var name = document.getElementById('cus_name').value;
  var organization_name = document.getElementById('cus_organization_name').value;
  var country = document.getElementById('cus_country').value;
  var phone = document.getElementById('cus_phone').value;
  var email = document.getElementById('cus_email').value;
  var comments = document.getElementById('cus_comments').value;
 
 
	  if(trim(name) == '') {
		  msg=msg+'* Please enter Your Name\n';
		  error=true;
	  }
	  
	  if(trim(organization_name) == '') {
		  msg=msg+'* Please enter Organisation Name\n';
		  error=true;
	  }
	  
	  if(trim(country) == '') {
		  msg=msg+'* Please enter Country\n';
		  error=true;
	  }

	   if(trim(email) == '') {
		  msg=msg+'* Please enter Your Email Address\n';
		  error=true;
	  }
	  else if(!validate_email(email)) {
		  msg=msg+'* Please enter Valid EMail ID\n';
		  error=true;
	   }
	   if(trim(comments) == '') {
		  msg=msg+'* Please enter Your Comments\n';
		  error=true;
	  }
	  
	  if(error) 
	   {
			alert(msg);
			return false;
	   }
	   
 }

function validate_email(email) {
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   if(reg.test(email) == false) {
       return false;
   }
   else
   {
   		return true;
   }
}




function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}
 
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

function isInteger (s)
{
      var i;

      for (i = 0; i < s.length; i++)
      {
         var c = s.charAt(i);

         if (!isDigit(c)) return true;
      }

      return false;
}

function isDigit (c)
{
      return ((c >= "0") && (c <= "9"))
}
