//超链接指向,str标题,href地址
function HrefTarget(str,href)
{   
  var str,href;
  var parentfrm=window.parent;
  parentfrm.run_item(str,href,-1);
	 }

//展开、收缩菜单
function showsubmenu(sid)
{
	var whichEl = document.getElementById("submenu" + sid);
	var imageId = document.getElementById("imgMenu" + sid);
	var MenuICOId = document.getElementById("MenuICO" + sid);
	var strShow=true;
	 
	if (whichEl.style.display == "none")
	{
		whichEl.style.display="";
		imageId.src="../HXIMAGES/MenuICO/Menu_close.gif";
		MenuICOId.src="../HXIMAGES/MenuICO/openfolder.gif";
		
			 for (i=0; i<document.all.length; i++)
     {
        srcelement=document.all(i);
        if(srcelement.className=="MenuPIC"){
			var targetid=srcelement.id;
			var targetelement=document.all(targetid);
			var strbuf=srcelement.src;
			if(strbuf.indexOf("Menu_close.gif"))
			  strShow=false;				
			}			
	}
	}
	else
	{
		whichEl.style.display="none";
		imageId.src="../HXIMAGES/MenuICO/Menu_open.gif";
		MenuICOId.src="../HXIMAGES/MenuICO/Menufolder.gif";
		
	 for (i=0; i<document.all.length; i++)
     {
        srcelement=document.all(i);
        if(srcelement.className=="MenuPIC"){
			var targetid=srcelement.id;
			var targetelement=document.all(targetid);
			var strbuf=srcelement.src;
			if(strbuf.indexOf("Menu_open.gif"))
			 strShow=true;
						
		}			
	}
}
	
	
	var AllShowTitle=document.getElementById("AllShowTitle");
	if(strShow==true){
	   AllShowTitle.innerHTML = "全部展开";	
		}else if(strShow==false){
	   AllShowTitle.innerHTML = "全部收缩";	
			}
	
}


//全部展开/收缩菜单
function AllShowsubmenu()
{
  var AllShowTitle=document.getElementById("AllShowTitle");
  
  for (i=0; i<document.all.length; i++)
  {
        srcelement=document.all(i);
        if(srcelement.className=="MenuPIC")
        {
			var targetid=srcelement.id;
			var targetelement=document.all(targetid);			
			var strbuf=srcelement.src;
			
			var strbufId=targetid.replace("imgMenu","");
			var whichEl = document.getElementById("submenu" + strbufId);
			var MenuICOId = document.getElementById("MenuICO" + strbufId);
			
			if(AllShowTitle.innerHTML == "全部收缩"){
					srcelement.src="../HXIMAGES/MenuICO/Menu_open.gif";
					MenuICOId.src="../HXIMAGES/MenuICO/Menufolder.gif";
					whichEl.style.display="none";
				}else{
					srcelement.src="../HXIMAGES/MenuICO/Menu_close.gif";
					MenuICOId.src="../HXIMAGES/MenuICO/openfolder.gif";				
					whichEl.style.display="";
				}
        }
   }
   
  if(AllShowTitle.innerHTML == "全部展开")
     AllShowTitle.innerHTML = "全部收缩";
  else
     AllShowTitle.innerHTML = "全部展开";
}


//显示、隐藏菜单
function switchSysBar(obj){    
	if (document.all("WSOAS_Left").style.display==""){
	 obj.src="HXIMAGES/ManageMain/goout.gif";
	 obj.title='显示菜单';
	 document.all("WSOAS_Left").style.display="none";
	 }
	else{         
	 obj.src="HXIMAGES/ManageMain/goin.gif";
	 obj.title='隐藏菜单';
	 document.all("WSOAS_Left").style.display="" ;
	}
}

//显示、隐藏菜单
function switchSysTop(obj){    
	if (document.all("WSOAS_Top").style.display==""){
	 obj.src="HXIMAGES/ManageMain/Topgoout.gif";
	 obj.title='显示';
	 document.all("WSOAS_Top").style.display="none";
	 }
	else{         
	 obj.src="HXIMAGES/ManageMain/Topgoin.gif";
	 obj.title='隐藏';
	 document.all("WSOAS_Top").style.display="" ;
	}
}

//取得日期和星期
function initArray(){
	 this.length=initArray.arguments.length
	 for(var i=0;i<this.length;i++)
	 this[i+1]=initArray.arguments[i] 
}
 
function initTime(){
	today=new Date();
    var d=new initArray("星期日","星期一","星期二","星期三","星期四","星期五","星期六"); 
    document.write(today.getYear(),"年",today.getMonth()+1,"月",today.getDate(),"日 ",d[today.getDay()+1],"&nbsp;");  	
}

//功能操作
function gotoMydesk(type){	
    if (type==7)
	{   
	    HrefTarget('在线帮助','HXWSOASHelp/Index.htm');		
		return;
	}
	
	if (type==8)
	{
		if (!confirm("确定要注销吗?")){
			return false;
		}else{
		    window.location.href="HX_Login.asp?action=loginout";
		    return true;			
			}		
	}
	if (type==9)
	{
		if (!confirm("确定要退出吗?")){
			return false;
		}else{
		    window.location.href="HX_Login.asp?action=loginout&act=closewin";
		    return true;		
		}
	}				
}		

