function SetFamily_Admin(vFamilyName, vServerName, vOfficalSite, vFamilyPopular, vQQ, vMasterQQ, vVerify, vSetTop, vHits)
{
  document.form1.FamilyName.value = vFamilyName;
  document.form1.ServerName.value = vServerName;
  document.form1.OfficalSite.value = vOfficalSite;
  document.form1.FamilyPopular.value = vFamilyPopular;
  document.form1.QQ.value = vQQ;
  document.form1.MasterQQ.value = vMasterQQ;
  SetChecked(document.form1.Verify, vVerify);
  SetChecked(document.form1.SetTop, vSetTop);
  document.form1.Hits.value = vHits;
}

function setSelected(theSelect,selectValue)
{
   for (var i = 0; i<theSelect.length; i++)
   {
	   if (theSelect.options[i].value == selectValue)
	   {
		   theSelect.selectedIndex = i;
		   break;
	   }
   }
}

function SetChecked(theCheck,CheckValue)
{
   if (CheckValue == "1")
   {
	   theCheck.checked = true;
   }
   else
       theCheck.checked = false;
}


   function isNumber(vNumber)
   {
       var theNumber = /^\d+$/;
	   return theNumber.test(vNumber)

   }

   function isInval(vString)
   {
     var theString = /\'+/;
	 return theString.test(vString)
   }

   function isEmpty(s)
   {
	  if ((s == null) || (s.length == 0))
	     return true;
   }

  function checkSearch()
  {
     if (isEmpty(document.form1.Search.value))
     {
		 alert("请输入服务器名！");
		 document.form1.Search.focus();		 
     }
	   else
	    document.form1.submit();
  }

   function checkFamilyForm_Admin()
   {
     if (isEmpty(document.form1.FamilyName.value))
     {
		 alert("请输入家族名称！");
		 document.form1.FamilyName.focus();
		 return false;
     }

     if (isEmpty(document.form1.ServerName.value))
     {
		 alert("请输入服务器名！");
		 document.form1.ServerName.focus();
		 return false;
     }

if (isEmpty(document.form1.FamilyPopular.value) || !(isNumber(document.form1.FamilyPopular.value)))
     {
		 alert("请正确输入当前人数");
		 document.form1.FamilyPopular.focus();
		 return false;
     }

if (isEmpty(document.form1.QQ.value) || !(isNumber(document.form1.QQ.value)))
     {
		 alert("请正确输入QQ群号码");
		 document.form1.QQ.focus();
		 return false;
     }

if (isEmpty(document.form1.MasterQQ.value) || !(isNumber(document.form1.MasterQQ.value)))
     {
		 alert("请正确输入QQ号码");
		 document.form1.MasterQQ.focus();
		 return false;
     }

if (isEmpty(document.form1.Hits.value) || !(isNumber(document.form1.Hits.value)))
     {
		 alert("请正确输入点击数");
		 document.form1.Hits.focus();
		 return false;
     }
	 return true;
   }


 function checkFamilyForm_User()
   {

     if (isEmpty(document.form1.FamilyName.value))
     {
		 alert("请输入家族名称！");
		 document.form1.FamilyName.focus();
		 return false;
     }

     if (isEmpty(document.form1.ServerName.value))
     {
		 alert("请输入服务器名！");
		 document.form1.ServerName.focus();
		 return false;
     }

if (isEmpty(document.form1.FamilyPopular.value) || !(isNumber(document.form1.FamilyPopular.value)))
     {
		 alert("请正确输入当前人数");
		 document.form1.FamilyPopular.focus();
		 return false;
     }

if (isEmpty(document.form1.MasterQQ.value) || !(isNumber(document.form1.MasterQQ.value)))
     {
		 alert("请正确输入QQ号码");
		 document.form1.MasterQQ.focus();
		 return false;
     }

if (isEmpty(document.form1.QQ.value) || !(isNumber(document.form1.QQ.value)))
     {
		 alert("请正确输入QQ群号码");
		 document.form1.QQ.focus();
		 return false;
     }

if (isEmpty(document.form1.VerifyNumber.value) || !(isNumber(document.form1.VerifyNumber.value)))
     {
		 alert("请正确输入验证码");
		 document.form1.VerifyNumber.focus();
		 return false;
     }

	 return true;
   }
