
function isValidCode(strCode)
{
   var i, cChar
   var strValidID = "0123456789-";
   for (i = 0; i < strCode.length; i ++ )
   {
      cChar = strCode.charAt(i);
      if(strValidID.indexOf(cChar) == - 1) return false;
   }
   return true;
}
function SkyRoom1()
{
   var info, s, ad;
   ad = "〖学校教务管理系统提示您！〗\n";
   info = ad + "您确实要修改信息吗?";
   s = document.getElementById("TxtTerm1")
   if(s.value == "")
   {
      alert(ad + "教室名称不能为空！");
      s.focus();
      return false;
   }
   s = document.getElementById("TxtShowID1")
   if(s.value == "" || ! isValidCode(s.value))
   {
      alert(ad + "教室显示顺序不能为空,并且必须是数字！");
      s.focus();
      return false;
   }
   s = document.getElementById("TxtDID1")
   if(s.value == "" || ! isValidCode(s.value))
   {
      alert(ad + "教室容量不能为空,并且必须是数字！");
      s.focus();
      return false;
   }
   s = document.getElementById("TxtNote1")
   if(s.value == "")
   {
      alert(ad + "教室备注不能为空！");
      s.focus();
      return false;
   }

   if(confirm(info))
   {
      return true;
   }
   else
   {
      return false;
   }
}
function SkyRoom2()
{
   var info, s, ad;
   ad = "〖学校教务管理系统提示您！〗\n";
   info = ad + "您确实要修改信息吗?";
   s = document.getElementById("TxtTerm2")
   if(s.value == "")
   {
      alert(ad + "教室名称不能为空！");
      s.focus();
      return false;
   }
   s = document.getElementById("TxtShowID2")
   if(s.value == "" || ! isValidCode(s.value))
   {
      alert(ad + "教室显示顺序不能为空,并且必须是数字！");
      s.focus();
      return false;
   }
   s = document.getElementById("TxtDID2")
   if(s.value == "" || ! isValidCode(s.value))
   {
      alert(ad + "教室容量不能为空,并且必须是数字！");
      s.focus();
      return false;
   }
   s = document.getElementById("TxtNote2")
   if(s.value == "")
   {
      alert(ad + "教室备注不能为空！");
      s.focus();
      return false;
   }
   if(confirm(info))
   {
      return true;
   }
   else
   {
      return false;
   }
}
