// JavaScript Document
function isNumberKey(evt)
    {
        var charCode = (evt.which) ? evt.which : event.keyCode
        if (charCode > 31 && (charCode < 48 || charCode > 57)) return false;
        return true;
    }

    function isNumberKey1(evt) {

        var charCode = (evt.which) ? evt.which : event.keyCode

        if (charCode > 31 && ((charCode >= 48 && charCode <= 64) || charCode == 46 || charCode == 126 || (charCode >= 33 && charCode <= 47)))

            return false;

    }


		function echeckquick(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}
	
	
    function validate()
    {
	
    if ((document.counsellor.Requirement.value==""))
    {
    alert ("Please choose Requirement")
	document.counsellor.Requirement.focus()
    return false
    }
	if ((document.counsellor.budget.value==""))
    {
    alert ("Please choose Budget")
	document.counsellor.budget.focus()
    return false
    }
	
	if ((document.counsellor.name.value==""))
    {
    alert ("Please fill name")
	document.counsellor.name.focus()
    return false
    }
	
	
	if ((document.counsellor.phone.value==""))
    {
    alert ("Please fill   Phone No:")
	document.counsellor.phone.focus()
    return false
    }
	if ((document.counsellor.mail.value==""))
    {
    alert ("Please fill Email address")
	document.counsellor.mail.focus()
    return false
    }
	var emailID=document.counsellor.mail
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeckquick(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	
	 if ((document.counsellor.city.value==""))
    {
    alert ("Please choose City")
	document.counsellor.city.focus()
    return false
    }
	if ((document.counsellor.location.value==""))
    {
    alert ("Please fill Location")
	document.counsellor.location.focus()
    return false
    }
	
	 if ((document.counsellor.knowsource.value==""))
    {
    alert ("Please choose Knowing Source")
	document.counsellor.knowsource.focus()
    return false
    }
	
	/*if (document.counsellor.code.value=='')
	  {
	  alert ("Please Enter Capcha code.")
             document.counsellor.code.focus()
           return false
      }
	if (document.counsellor.code.value!=document.counsellor.capcha.value)
	  {
	  alert ("Please Enter Exact Capcha code.")
	         document.counsellor.code.value=''
             document.counsellor.code.focus()
           return false
      }
	*/
	
	
	
	
	
	
		
	 else
    return true
    }
    
