function err(text)
{
  window.alert(text);
  judge=false;
}

function QueryClick()
{
  document.QueryForm.action="maindn.asp";
  document.QueryForm.submit();
}

function AddClick()
{
  document.QueryForm.action="maindn.asp?Action=Add";
  document.QueryForm.submit();
}

function ExplainClick()
{
  window.location.href="help.htm";
}

function check()
  {
   var judge=true;
   var st1=st2=st3=st4=st5=st6="";
   if (document.AddForm.url_name1.value=="") st1="[公司名稱]";
   if (document.AddForm.url1.value=="") st2="[網址]";
   if (document.AddForm.url_eds1.value=="") st3="[網址說明]";
   if (document.AddForm.e_mail1.value=="") st4="[電子信箱]";
   if (document.AddForm.name1.value == "") st5="[填寫人姓名]";
   if (document.AddForm.tel1.value=="") st6="[連繫電話]";
   if (st1=="" && st2=="" && st3=="" && st4=="" && st5=="" && st6=="")
     {
      document.Form1.submit();
     }
   else
     { 
      err(st1+st2+st3+st4+st5+st6+"資料，請您確實填寫!!");
     } 
	 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();
    }
  }
}

