function countit(what){
//Character count script- by javascriptkit.com
//Visit JavaScript Kit (http://javascriptkit.com) for script
//Credit must stay intact for use
formcontent=what.form.question.value
what.form.displaycount.value=formcontent.length
}
//-->
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 6;
function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}
function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}
function checkInternationalPhone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}
function check_fields()
{
if (document.contactform.name.value =="")
{
alert("Please Enter Your Name Please....");
document.contactform.name.focus();
return (false);
}
var maxlength=2000
if (document.contactform.question.value.length>maxlength){
alert("Please restrain your question to 2000 or less characters!")
return (false);
}
if (document.contactform.phone.value =="")
{
alert("Please Provide Us Your Phone Number....");
document.contactform.phone.focus();
return (false);
}
if (document.contactform.phone.value =="")
{
alert("Please Provide Us Your Phone Number....");
document.contactform.phone.focus();
return (false);
}
if(document.contactform.email.value.indexOf(" ") >= 0)
{
	alert("Please enter your email-id without any white space character.");
	document.contactform.email.focus();
	return (false);
}
if ( (document.contactform.email.value.indexOf("@") == -1) || (document.contactform.email.value.indexOf(".") == -1) )
{
	alert("Please enter a valid email-id"); 
	document.contactform.email.focus();
	return (false);
}
BeforeAtRate = document.contactform.email.value.substring(0,document.contactform.email.value.indexOf("@"));
AfterAtRate = document.contactform.email.value.substring(document.contactform.email.value.indexOf("@")+1,document.contactform.email.value.length);
if (AfterAtRate.indexOf(".") == -1)
{
	alert("Please enter a valid email-id"); 
	document.contactform.email.focus();
	return (false);
}
middle = AfterAtRate.substring(0, AfterAtRate.indexOf("."));
last = AfterAtRate.substring(AfterAtRate.indexOf(".") + 1,AfterAtRate.length);
if (BeforeAtRate.length == 0 || middle.length == 0 || last.length == 0)
{
	alert("Please enter a valid email-id"); 
	document.contactform.email.focus();
	return (false);
}
if (middle.indexOf(",") != -1 || last.indexOf(",") != -1 || middle.indexOf(",") != -1 || BeforeAtRate.indexOf(",") != -1){
	alert("Please enter a valid email-id"); 
	document.contactform.email.focus();
	return (false);
}
var Phone=document.contactform.phone
	if ((Phone.value==null)||(Phone.value=="")){
		alert("Please Enter your Phone Number")
		Phone.focus()
return (false);
}
	if (checkInternationalPhone(Phone.value)==false){
		alert("Please Enter a Valid Phone Number")
		Phone.value=""
		Phone.focus()
		return (false);
	}
if (document.contactform.question.value =="")
{
{
alert("Please Enter Your Query....");
document.contactform.question.focus();
return (false);
}
document.contactform.submit ();
return(true);
return(false);
}
}