//------------------------------------------------------------------------------------------------------------
function MenuShow(ActiveName)
{//显示类菜单
   var XName;
   var ActiveTop=ActiveName.offsetTop;
   var ActiveLeft=ActiveName.offsetLeft;
   while(ActiveName=ActiveName.offsetParent)
   {	
     ActiveTop+=ActiveName.offsetTop;
     ActiveLeft+=ActiveName.offsetLeft;
   }

   if (ClassMenu.style.display=='none')
   {	 
     ClassMenu.style.top=ActiveTop+18;
     ClassMenu.style.left=ActiveLeft;
     ClassMenu.style.display='inline';
   } 
   else 
   { 
     ClassMenu.style.display='none';
   }
}
//------------------------------------------------------------------------------------------------------------
function ChildShowEx(Tags,MOs,MCs,TextPath,ClassFullPath,TagID)//
{//显示类
   if (Tags.style.display=='none')
   {
     Tags.style.display='inline';
     MCs.style.display='none';
     MOs.style.display='inline';
   }
   else
   {
     Tags.style.display='none';	 
     MOs.style.display='none';
     MCs.style.display='inline';	
   }  
   TempData.ParentID.value=TagID;	 	 
   TempData.FullPath.value=TextPath;
   TempData.ClassFullPath.value=ClassFullPath;
}
//------------------------------------------------------------------------------------------------------------
function ChildShow(Tags,MOs,MCs,TextPath,ClassFullPath,TagID)
{//显示类
   if (Tags.style.display=='none')
   {
     Tags.style.display='inline';
	 MCs.style.display='none';
	 MOs.style.display='inline';
   }
   else
   {
     Tags.style.display='none';	 
	 MOs.style.display='none';
	 MCs.style.display='inline';	 
   }  
   formData.ParentID.value=TagID;	 	 
   formData.FullPath.value=TextPath;
   formData.ClassFullPath.value=ClassFullPath;
}
//------------------------------------------------------------------------------------------------------------

function ClassUpdate()
{//类更新   
   formData.ClassFullPath.value=TempData.ClassFullPath.value;
   formData.FullPath.value="首页 >> " + TempData.FullPath.value;
   formData.ParentID.value=TempData.ParentID.value;
   ClassMenu.style.display='none';
}
//------------------------------------------------------------------------------------------------------------

function MenuRoot()
{
  TempData.ParentID.value="0";
  TempData.FullPath.value="";
  TempData.ClassFullPath.value="";
}
//------------------------------------------------------------------------------------------------------------

function SetRoot()
{//回到根
  formData.ParentID.value="0";
  formData.FullPath.value="";
  formData.ClassFullPath.value="";
}
//------------------------------------------------------------------------------------------------------------

function MenuHide()
{//隐藏菜单
   ClassMenu.style.display='none';
}
//------------------------------------------------------------------------------------------------------------

function ShowIconCheck()
{
   formData.ShowIcon.disabled=false;
   formData.ShowIcon.checked;
}
//------------------------------------------------------------------------------------------------------------

function ShowMore(TargetDiv)
{//显示更多
   if (TargetDiv.style.display=='none')
   {
     TargetDiv.style.display='inline';
   }
   else
   {
     TargetDiv.style.display='none';
   }
}
//------------------------------------------------------------------------------------------------------------

function SubmitPage(PageName,NewPage,Data)
{
   formData.action=PageName;
   if (NewPage==1)
   {
     formData.target="_blank";
   }   
   else
   {
     formData.target="_self";
   }
   if (Data==1)
   {
     formData.encoding="multipart/form-data";
   }
   else
   {
     formData.encoding="application/x-www-form-urlencoded"; 
   }
   formData.submit();
}
//------------------------------------------------------------------------------------------------------------

function ClassDelete(DelID)
{//类别管理用
   if (confirm("您真的要删除该类及它的子类吗？\n如果删除了！该类及子类下的所有资料都将会被删除！")==true)
   {
     window.location="ClassDelete.asp?ClassID=" + DelID;
   }
   else
   {}  
}
//------------------------------------------------------------------------------------------------------------

function DataDelete(DeletePage,ClassID,DelID)
{
   if (confirm("您真的打算删除吗？")==true)
      {
        window.location=DeletePage + "?ClassID=" + ClassID + "&SID=" + DelID;
      }
   else
      {}	  
}
//------------------------------------------------------------------------------------------------------------

function MyIndex()
{
   window.location="Index.asp"
}
//------------------------------------------------------------------------------------------------------------

function PopWin(url,PopWidth,PopHeight)
{
   var Screen_Height=window.screen.height;
   var Screen_width=window.screen.width;
   if (((Screen_Height-PopHeight)/2)>0)
   {
     ShowTop=(Screen_Height-PopHeight)/2;
   }
   else
   {
     ShowTop=1;   
   }
   ShowLeft=(Screen_width-PopWidth)/2;
   window.open (url, "", "width=" + PopWidth + "px, height=" + PopHeight + "px, top=" + ShowTop + ", left=" + ShowLeft + ", toolbar=no, status=no, menubar=no, resizable=no, scrollbars=yes");
}
//------------------------------------------------------------------------------------------------------------

function MsgBox(Title)
{
   window.alert(Title);
   window.history.go(-1);
}
//------------------------------------------------------------------------------------------------------------

function MyCancel()
{
   window.history.go(-1);
}
//------------------------------------------------------------------------------------------------------------

function MyClose()
{
   window.close();
}
//------------------------------------------------------------------------------------------------------------











