function ValidNumber(tocheck) {
  var isnum = true;
  if ((tocheck == null) || (tocheck == "")) {
     isnum = true;
     return isnum;
   }
  else {
    for (j = 0;j < tocheck.length; j++) {
      if ((tocheck.substring(j,j+1) != "0") &&
         (tocheck.substring(j,j+1) != "1") &&
         (tocheck.substring(j,j+1) != "2") &&
         (tocheck.substring(j,j+1) != "3") &&
         (tocheck.substring(j,j+1) != "4") &&
         (tocheck.substring(j,j+1) != "5") &&
         (tocheck.substring(j,j+1) != "6") &&
         (tocheck.substring(j,j+1) != "7") &&
         (tocheck.substring(j,j+1) != "8") &&
         (tocheck.substring(j,j+1) != "9")) {
         isnum = false;
         
       }
    }
    return isnum;  }
    
    }         

function ValidAlphaNum(tocheck) {
  var isalphanum = true;
  if ((tocheck == null) || (tocheck == "")) {
     isalphanum = true;
     return isalphanum;
   }
  else {
    for (j = 0;j < tocheck.length; j++) {
      if ((tocheck.substring(j,j+1) != "0") &&
         (tocheck.substring(j,j+1) != "1") &&
         (tocheck.substring(j,j+1) != "2") &&
         (tocheck.substring(j,j+1) != "3") &&
         (tocheck.substring(j,j+1) != "4") &&
         (tocheck.substring(j,j+1) != "5") &&
         (tocheck.substring(j,j+1) != "6") &&
         (tocheck.substring(j,j+1) != "7") &&
         (tocheck.substring(j,j+1) != "8") &&
         (tocheck.substring(j,j+1) != "9") &&
         (tocheck.substring(j,j+1) != "a") &&
         (tocheck.substring(j,j+1) != "b") &&
         (tocheck.substring(j,j+1) != "c") &&
         (tocheck.substring(j,j+1) != "d") &&
         (tocheck.substring(j,j+1) != "e") &&
         (tocheck.substring(j,j+1) != "f") &&
         (tocheck.substring(j,j+1) != "g") &&
         (tocheck.substring(j,j+1) != "h") &&
         (tocheck.substring(j,j+1) != "i") &&
         (tocheck.substring(j,j+1) != "j") &&
         (tocheck.substring(j,j+1) != "k") &&
         (tocheck.substring(j,j+1) != "l") &&
         (tocheck.substring(j,j+1) != "m") &&
         (tocheck.substring(j,j+1) != "n") &&
         (tocheck.substring(j,j+1) != "o") &&
         (tocheck.substring(j,j+1) != "p") &&
         (tocheck.substring(j,j+1) != "q") &&
         (tocheck.substring(j,j+1) != "r") &&
         (tocheck.substring(j,j+1) != "s") &&
         (tocheck.substring(j,j+1) != "t") &&
         (tocheck.substring(j,j+1) != "u") &&
         (tocheck.substring(j,j+1) != "v") &&
         (tocheck.substring(j,j+1) != "w") &&
         (tocheck.substring(j,j+1) != "x") &&
         (tocheck.substring(j,j+1) != "y") &&
         (tocheck.substring(j,j+1) != "z") &&
         (tocheck.substring(j,j+1) != "A") &&
         (tocheck.substring(j,j+1) != "B") &&
         (tocheck.substring(j,j+1) != "C") &&
         (tocheck.substring(j,j+1) != "D") &&
         (tocheck.substring(j,j+1) != "E") &&
         (tocheck.substring(j,j+1) != "F") &&
         (tocheck.substring(j,j+1) != "G") &&
         (tocheck.substring(j,j+1) != "H") &&
         (tocheck.substring(j,j+1) != "I") &&
         (tocheck.substring(j,j+1) != "J") &&
         (tocheck.substring(j,j+1) != "K") &&
         (tocheck.substring(j,j+1) != "L") &&
         (tocheck.substring(j,j+1) != "M") &&
         (tocheck.substring(j,j+1) != "N") &&
         (tocheck.substring(j,j+1) != "O") &&
         (tocheck.substring(j,j+1) != "P") &&
         (tocheck.substring(j,j+1) != "Q") &&
         (tocheck.substring(j,j+1) != "R") &&
         (tocheck.substring(j,j+1) != "S") &&
         (tocheck.substring(j,j+1) != "T") &&
         (tocheck.substring(j,j+1) != "U") &&
         (tocheck.substring(j,j+1) != "V") &&
         (tocheck.substring(j,j+1) != "W") &&
         (tocheck.substring(j,j+1) != "X") &&
         (tocheck.substring(j,j+1) != "Y") &&
         (tocheck.substring(j,j+1) != "Z") &&
         (tocheck.substring(j,j+1) != "-") &&
         (tocheck.substring(j,j+1) != "_")) {
         isalphanum = false
         
       }
    }
    return isalphanum;  }
    
    }         

function ValidDate(tocheck) {
  var isdate = true;
  if ((tocheck == null) || (tocheck == "")) {
     isdate = true;
     return isdate;
   }
  else {
    for (j = 0;j < tocheck.length; j++) {
      if ((tocheck.substring(j,j+1) != "0") &&
         (tocheck.substring(j,j+1) != "1") &&
         (tocheck.substring(j,j+1) != "2") &&
         (tocheck.substring(j,j+1) != "3") &&
         (tocheck.substring(j,j+1) != "4") &&
         (tocheck.substring(j,j+1) != "5") &&
         (tocheck.substring(j,j+1) != "6") &&
         (tocheck.substring(j,j+1) != "7") &&
         (tocheck.substring(j,j+1) != "8") &&
         (tocheck.substring(j,j+1) != "9") &&
		 (tocheck.substring(j,j+1) != "/")) {
         isdate = false;
         
       }
    }
    return isdate;  }
    
    }    
	
function ValidTime(tocheck) {
  var istime = true;
  if ((tocheck == null) || (tocheck == "")) {
     istime = true;
     return istime;
   }
  else {
    for (j = 0;j < tocheck.length; j++) {
      if ((tocheck.substring(j,j+1) != "0") &&
         (tocheck.substring(j,j+1) != "1") &&
         (tocheck.substring(j,j+1) != "2") &&
         (tocheck.substring(j,j+1) != "3") &&
         (tocheck.substring(j,j+1) != "4") &&
         (tocheck.substring(j,j+1) != "5") &&
         (tocheck.substring(j,j+1) != "6") &&
         (tocheck.substring(j,j+1) != "7") &&
         (tocheck.substring(j,j+1) != "8") &&
         (tocheck.substring(j,j+1) != "9") &&
		 (tocheck.substring(j,j+1) != ":") &&
		 (tocheck.substring(j,j+1) != "a") &&
		 (tocheck.substring(j,j+1) != "A") &&
		 (tocheck.substring(j,j+1) != "p") &&
		 (tocheck.substring(j,j+1) != "P") &&
		 (tocheck.substring(j,j+1) != "m") &&
		 (tocheck.substring(j,j+1) != "M") &&
		 (tocheck.substring(j,j+1) != " ")) {
         istime = false;
         
       }
    }
    return istime;  }
    
    }         

function ValidPhone(tocheck) {
  var isphone = true;
  if ((tocheck == null) || (tocheck == "")) {
     isphone = true;
     return isphone;
   }
  else {
    for (j = 0;j < tocheck.length; j++) {
      if ((tocheck.substring(j,j+1) != "0") &&
         (tocheck.substring(j,j+1) != "1") &&
         (tocheck.substring(j,j+1) != "2") &&
         (tocheck.substring(j,j+1) != "3") &&
         (tocheck.substring(j,j+1) != "4") &&
         (tocheck.substring(j,j+1) != "5") &&
         (tocheck.substring(j,j+1) != "6") &&
         (tocheck.substring(j,j+1) != "7") &&
         (tocheck.substring(j,j+1) != "8") &&
         (tocheck.substring(j,j+1) != "-") &&
         (tocheck.substring(j,j+1) != "9")) {
         isphone = false;
         
       }
    }
    return isphone;  }
      
    }  
    
function ValidEmail(eadd){
	var isemail = true;
	if (eadd.length < 6 ){
         isemail = false;
         return isemail;
        }
          
    if (eadd.indexOf("@") == -1 ){
          isemail = false;
          return isemail;
          }
          
    if (eadd.indexOf(".") == -1 ){
          isemail = false;
          return isemail;
          }
    return isemail;
    }   
