// ÓÃÓÚcheck±íµ¥
//chkform.js

function chkstring(checkStr, checkOK) {
  var allValid = true;
  if (checkStr.length == 0){
		return false;  
  }
  if (typeof(checkStr) != "string" || typeof(checkOK) != "string") 
      return(false);
  for (i = 0; i < checkStr.length; i++) {
    ch = checkStr.charAt(i);
    if (checkOK.indexOf(ch) == -1) {
      allValid = false;
      break;
    }
  }
  return(allValid);
}

function chkphone(checkStr) {
  var checkOK = "0123456789-()# ";
  return(chkstring(checkStr, checkOK));
}

function chkaccount(checkStr) {
  var checkOK = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";
  return(chkstring(checkStr, checkOK));
}

function chkemail(checkStr) {
  var checkOK = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@._-";
  if(checkStr.indexOf("@") != -1)
     return(chkstring(checkStr, checkOK));
  else
     return(false);
}

function chknumber(checkStr) {
  var checkOK = "0123456789";
  return(chkstring(checkStr, checkOK));
}










