
function valid()
{

 
   if (document.getElementById('name').value=="")
  {
                alert("Please fill Your 'Full Name' .");
				document.frmRegistration.name.focus();
                //valid = false;
                return false;

 }
  if (document.getElementById('phone').value=="")
  {
                alert("Please fill Your 'Contact Number'.");
				document.frmRegistration.phone.focus();
                //valid = false;
                return false;

 }
  if (chkNumeric(document.frmRegistration.phone.value) == false) {
                alert("Invalid Phone Number!");
                document.frmRegistration.phone.focus();
                document.frmRegistration.phone.value = ""               
                return  false;
            }

 if (document.getElementById('email').value=="")
  {
                alert("Please fill Your'Email'.");
				document.frmRegistration.email.focus();
                //valid = false;
                return false;

 }
 if (echeck(document.frmRegistration.email.value) == false) {
                document.frmRegistration.email.value = ""
                document.frmRegistration.email.focus();
                return false;
            }



 if (document.getElementById('comments').value=="")
  {
                alert("Please Type your 'Commnets'.");
				document.frmRegistration.remarks.focus();
                //valid = false;
                return false;

 }
    
	if(ok==1)
	 
   return true;
  else
   return false;  
  }

//-->
function chkNumeric(strString)
        //  check for valid numeric strings	
        {
            var strValidChars = "0123456789.-";
            var strChar;
            var blnResult = true;

            if (strString.length == 0) return false;

            //  test strString consists of valid characters listed above
            for (i = 0; i < strString.length && blnResult == true; i++) {
                strChar = strString.charAt(i);
                if (strValidChars.indexOf(strChar) == -1) {
                    blnResult = false;
                }
            }
            return blnResult;
        }
function echeck(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 confirmemailvalidate() {
            var email = document.getElementById("email").value;
            var confirmemail = document.getElementById("confirmemail").value;
            if (email != confirmemail) {
			
			 alert("Email you entered is not correct,confirm email should be equal");
				document.frmRegistration.confirmemail.value="";
				document.frmRegistration.email.value="";
				document.frmRegistration.email.focus();


            }
            else {
               
            }


        }

