function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
 } 
function FormValidator(theForm)
{
    if (theForm.email.value == "")
   {
    alert("Please enter a value for the \"email\" field."); 
    theForm.email.focus(); 
    return (false);
   }
    if (!isEmailAddr(theForm.email.value))
   {
    alert("Please enter a complete email address in the form:emailid@domain.com"); 
    theForm.email.focus(); 
    return (false);
   }

    if (theForm.add1.value == "" && theForm.add2.value == "")
   {	
      alert("Please give postal address");
      theForm.add1.focus();
      return false
   }	 
    if (theForm.ccode.value == "" || theForm.acode.value == "" || theForm.pnumber.value == "" )
   {
       alert ("Please enter proper Phone Number");
       theForm.ccode.focus();
       return false
   }
cc = theForm.ccode.value
ac = theForm.acode.value
phno = theForm.pnumber.value
fcc = theForm.fccode.value
fac = theForm.facode.value
fno = theForm.fnumber.value

var i;
for (i = 0; i < cc.length; i++)
{   
        var c = cc.charAt(i);
        if (((c < "0") || (c > "9"))) 
	{
	alert ("Please enter Proper Number");
	document.acme.ccode.value = ""
	document.acme.ccode.focus();
	return false
	}
 }	

cc = theForm.ccode.value
ac = theForm.acode.value
phno = theForm.pnumber.value
fcc = theForm.fccode.value
fac = theForm.facode.value
fno = theForm.fnumber.value

var i;
for (i = 0; i < cc.length; i++)
{   
        var c = cc.charAt(i);
        if (((c < "0") || (c > "9"))) 
	{
	alert ("Please enter Proper Number");
	document.acme.ccode.value = ""
	document.acme.ccode.focus();
	return false
	}
 }	

var i;
for (i = 0; i < fcc.length; i++)
{   
        var c = fcc.charAt(i);
        if (((c < "0") || (c > "9"))) 
	{
	alert ("Please enter Proper Number");
	document.acme.fccode.value = ""
	document.acme.fccode.focus();
	return false
	}
 }	

var i;
for (i = 0; i < fac.length; i++)
{   
        var c = fac.charAt(i);
        if (((c < "0") || (c > "9"))) 
	{
	alert ("Please enter Proper Number");
	document.acme.facode.value = ""
	document.acme.facode.focus();
	return false
	}
 }	

var i;
for (i = 0; i < fno.length; i++)
{   
        var c = fno.charAt(i);
        if (((c < "0") || (c > "9"))) 
	{
	alert ("Please enter Proper Number");
	document.acme.fnumber.value = ""
	document.acme.fnumber.focus();
	return false
	}
 }

if (theForm.company.value == "")
   {
    alert("Please enter Your Company Name"); 
    theForm.company.focus(); 
    return (false);
   }
}


function aaa()
{
dx = new Date();	
op = setTimeout("aaa()",100);
xx = document.acme.hquestion.value
document.acme.counter.value = xx.length 
}

function bb()
{
	clearTimeout(op);
	if(xx.length > 1000)
  {
 	alert("More than 1000 words will be ignored, so please shorten the question");

  }
}			
