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.description.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() 
{
//web validation	
if (document.webcheck.web.value =="")
{
alert("Please Enter Your Web Address....");
document.webcheck.web.focus();
return (false);
}	
if (document.webcheck.web.value.length<=4){
alert("Please enter your Web Address properly...")
return (false);
}

//contact person name validation
if (document.webcheck.name.value =="")
{
alert("Please Enter Your Name Please....");
document.webcheck.name.focus();
return (false);
}
if (document.webcheck.designation.value =="")
{
alert("Please Enter Your Name Designation / Role i.e. are you the Owner / Manager at Company etc.....");
document.webcheck.designation.focus();
return (false);
}


if (document.webcheck.phone.value =="")
{
alert("Please Provide Us Your Phone Number....");
document.webcheck.phone.focus();
return (false);
}
if (document.webcheck.phone.value =="")
{
alert("Please Provide Us Your Phone Number....");
document.webcheck.phone.focus();
return (false);
}
if(document.webcheck.email.value.indexOf(" ") >= 0)
{
	alert("Please enter your email-id without any white space character.");
	document.webcheck.email.focus();
	return (false);
}
if ( (document.webcheck.email.value.indexOf("@") == -1) || (document.webcheck.email.value.indexOf(".") == -1) )
{
	alert("Please enter a valid email-id"); 
	document.webcheck.email.focus();
	return (false);
}
BeforeAtRate = document.webcheck.email.value.substring(0,document.webcheck.email.value.indexOf("@"));
AfterAtRate = document.webcheck.email.value.substring(document.webcheck.email.value.indexOf("@")+1,document.webcheck.email.value.length);
if (AfterAtRate.indexOf(".") == -1)
{
	alert("Please enter a valid email-id"); 
	document.webcheck.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.webcheck.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.webcheck.email.focus();
	return (false);
}
var Phone=document.webcheck.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.webcheck.description.value =="")
{
alert("Please Give us some information about your business activity....");
document.webcheck.description.focus();
return (false);
}
var maxlength=3000
if (document.webcheck.description.value.length>maxlength){
alert("Please restrain your business activity description to 3000 or less characters!")
return (false);
}
document.webcheck.submit ();
return(true);
return(false);
}
