<!--

function validate()
 {

 if(document.form.comp.value=="")
    {
	alert("Enter the name of the company")
	document.form.comp.focus()
	return false
    }
   if(document.form.addr.value=="")
    {
	alert("Enter the Address")
	document.form.addr.focus()
	return false
    }	

	if(document.form.person.value=="")
    {
	alert("Enter the name of the person to be contacted")
	document.form.person.focus()
	return false
    }	
	
	email = document.form.mail.value;
           if(email.length > 0)
            {
            at= email.indexOf("@");
            dot=email.lastIndexOf(".");
            n= email.length;
               if(at < 1 || at >= dot || (dot+2) >= n)
                	{
    				alert('Invalid email!  Use a valid address');
    				document.form.mail.focus();
    				return false;
     				}      
	     }

if(document.form.phone.value=="")
    {
	alert("Enter the Telephone number")
	document.form.phone.focus()
	return false
    }

	ph=document.form.phone.value
        li="1234567890- ."
        for(i=0;i<ph.length;i++)
         {
          var cha=ph.charAt(i);
          if(li.indexOf(cha)==-1)
            {
              alert("phone Number you entered is not a valid one")
              document.form.phone.focus();
               return false;  
             }
           }  

if(document.form.other_cate.value=="Others:")
    {
	alert("Enter the Other Category you belong to")
	document.form.other_cate.focus() 
	return false
    }   
 if(document.form.deal.value=="")
    {
	alert("Enter the Details of your dealings")
	document.form.deal.focus() 
	return false
    }
 if(document.form.prorange.value=="")
    {
	alert("Enter the Product's range")
	document.form.prorange.focus()
	return false
    }
	

	var marketval = document.form.market.selectedIndex;
	if(document.form.market[marketval].value=="")
		{
			alert( "select a Market");
			document.form.market.focus();
			return false;
		}
		
	if(document.form.uname.value=="")
    {
	alert("Enter the username")
	document.form.uname.focus()
	return false
    }
	if(document.form.uname.value.length > 10)
    {
	alert("The maximum charcters allowed for username is 10 characters only.Re-Enter Username")
	document.form.uname.focus()
	return false
    }
if(document.form.pwd.value=="")
    {
	alert("Enter the Password")
	document.form.pwd.focus()
	return false
    }
	if(document.form.pwd.value.length > 10)
    {
	alert("The maximum charcters allowed for password is 10 characters only.Re-Enter Password")
	document.form.pwd.focus()
	return false
    }
	if(document.form.cpwd.value=="")
    {
	alert("Confirm your Password")
	document.form.cpwd.focus()
	return false
    }
	if(document.form.pwd.value != document.form.cpwd.value)
	{
	alert("Type mismatch in Passwords")
	document.form.cpwd.focus()
	return false
    }
	if(document.form.pwd_ques.value=="")
    {
	alert("Enter your Password retrievel question")
	document.form.pwd_ques.focus()
	return false
    }
	if(document.form.answer.value=="")
    {
	alert("provide the answer for your question")
	document.form.answer.focus()
	return false
    }
           
  
	
  
	
 }

 function chgfocus()
  {

  
    document.form.other_cate.value="Others:"
	document.form.other_cate.focus()
  
  }
 function bla()
 {
     document.form.other_cate.value=" "
 }
 
 function splallow(fieldname)
  {
 fieldval=eval("document.form."+fieldname+".value")
 chrs="',"
 for(i=0;i<fieldval.length;i++)
    {
          var cha=fieldval.charAt(i);
          if(chrs.indexOf(cha)==0 || chrs.indexOf(cha)==1 || chrs.indexOf(cha)==2)
            {
              alert("Special Characters SingleQuote(') Comma(,) are not allowed")
              focval=eval("document.form."+fieldname)
			  focval.focus()
              return false;  
             }
           } 
  }

//-->

