function err(text)
{
  window.alert(text);
  judge=false;
}

function QueryClick()
{
  document.QueryForm.action = "main.asp";
  document.QueryForm.submit();
}

function AddClick()
{
  document.QueryForm.action = "main.asp?Action=Add";
  document.QueryForm.submit();
}

function ExplainClick()
{
  window.location.href = "help.htm";
}

function check()
  {
   var judge=true;
   var st1=st2=st3=st4=st5="";
   if (document.AddForm.url_name1.value=="") st1="[單位名稱]";
   if (document.AddForm.addr1.value=="") st2="[地址]";
   if (document.AddForm.tel11.value=="") st3="[地址]";
   if (document.AddForm.name1.value == "") st4="[填寫人姓名]";
   if (document.AddForm.tel1.value=="") st5="[連繫電話]";
   if (st1=="" && st2=="" && st3=="" && st4=="" && st5=="")
     {
      document.AddForm.submit();
     }
   else
     { 
      err(st1+st2+st3+st4+st5+"資料，請您確實填寫!!");
     } 
	 return judge;    
  }

function CheckTelNumber(ctrl,telnum)
  {
  var ian="";
  if (telnum!="")
    {
     ian=isNaN(telnum);
  if(ian)
    {
     window.alert("電話號碼輸入錯誤!!,請重新輸入");
     ctrl.focus();
     ctrl.value="";
    }
    }
  }

function CheckMail(ctrl,telnum)
{
  var ian="";
  if (telnum!="")
  {
    if((telnum.indexOf("@")==-1) || (telnum.indexOf(".")==-1) )          
    {
      window.alert("電子信箱格式輸入錯誤!!請檢查一下");
      ctrl.focus();
    }
  }
}

