   function isPhoneNumber(phone)
   {
     var pattern = /[0-9]{10}/;
     return pattern.test(phone);
   }
   function validEmail(email) {
     var invalidChars = " /:,;";
     if (email == "") {
       return false;
     }
     for (i=0; i<invalidChars.length;i++) {
      var  badChar = invalidChars.charAt(i);
       if (email.indexOf(badChar,0) > -1) {
         return false;
       }
     }
     var atPos = email.indexOf("@",1);
     if (atPos == -1) {
       return false;
     }
     if (email.indexOf("@",atPos+1) > -1) {
       return false;
     }
     var periodPos = email.indexOf(".",atPos);
     if (periodPos == -1) {
       return false;
     }
     if (periodPos+3 > email.length) {
       return false;
     }
     return true;
   }

   function onSubmitForm() {
      if (window.document.getElementById('name').value=='') {alert("Name can't be empty"); window.document.getElementById('name').focus(); return false;}
      //if (!window.document.getElementById('phone').value) {alert("Phone can't be empty"); window.document.getElementById('phone').focus(); return false;}
      //var phone = window.document.getElementById('phone').value;
      //if (!isPhoneNumber(phone)) {alert("Phone is not correct! Correct 1122334455");window.document.getElementById('phone').focus(); return false;}
      if (window.document.getElementById('email').value=='') {alert("Email can't be empty"); window.document.getElementById('email').focus(); return false;}
      if (!validEmail(window.document.getElementById('email').value)) {alert("Email is not correct!"); window.document.getElementById('email').focus();return false;} 
      return true;
   }

   function onSubmitForm_sel() {
      if (window.document.getElementById('name').value=='') {alert("Name can't be empty"); window.document.getElementById('name').focus(); return false;}
      if (window.document.getElementById('email').value=='') {alert("Email can't be empty"); window.document.getElementById('email').focus(); return false;}
      if (!validEmail(window.document.getElementById('email').value)) {alert("Email is not correct!"); window.document.getElementById('email').focus();return false;} 
      if (window.document.getElementById('address').value=='') {alert("Address Street can't be empty"); window.document.getElementById('address').focus(); return false;}
      if (window.document.getElementById('city').value=='') {alert("City Street can't be empty"); window.document.getElementById('city').focus(); return false;}      
      return true;
   }

