/***************************************/
/*** 实现功能：三级菜单树—触发链接模块
/*** 设计日期：2004-12-1
/*** 更新日期：2006-8-1
/*** 版权所有：CopyRight By 湖南青果软件有限公司
/***************************************/
var RGB_NONE='#cccccc';
var RGB_LINK='black';
var RGB_OVER='red';
var RGB_CHECK='#008080';

function MouseOver(arg)
{
if(arg.style.color==RGB_NONE){arg.style.cursor='';return false;}
if(arg.style.color==RGB_LINK){arg.style.cursor='hand';arg.style.color=RGB_OVER;}
}

function MouseOut(arg){try
{
if(arg.style.color==RGB_OVER) arg.style.color=RGB_LINK;
}catch(e){}
}

function showLay(divId){
	var objDiv=eval("divGrp"+divId);
	var objImg=eval("imgGrp"+divId);
	var whichEl=KingoMemuBar.lastLayerID;
	var vTREE_Multi=false;

	if(vTREE_Multi!=true){
		if(whichEl!='')
		if(whichEl!=divId){
		eval("divGrp"+whichEl+".style.display='none'")
		eval("imgGrp"+whichEl+".src='../themes/default/tree/+1.gif'");}
	}

	//alert(objDiv.style.display);
	if(eval("divGrp"+divId+".style.display=='none'")){
		objImg.src='../themes/default/tree/-1.gif';
		objDiv.style.display='';
	}else{  
		objImg.src='../themes/default/tree/+1.gif';
		objDiv.style.display='none';
	}
	KingoMemuBar.lastLayerID=divId;
}

//链接过程(含参数)
function ToLink(theObj)
{		
	var whichEl,vTitle;
	var url=theObj.getAttribute("value");
	if((theObj.style.color!=RGB_OVER)&&(theObj.style.color!=RGB_CHECK)) return false;
	
	whichEl = KingoMemuBar.lastLinkObj;
	if(whichEl!=''){
	if(whichEl.style.color==RGB_CHECK) whichEl.style.color = RGB_LINK;
	}

    theObj.style.color =RGB_CHECK;
	KingoMemuBar.lastLinkObj=theObj;
	if(theObj.value!=''){
	vTitle = TheMenu_Owner+' ['+KingoMemuBar.barArray[KingoMemuBar.curBarIndex].text;
	vTitle+='--'+theObj.innerText+']';

	//window.frames.frmMain.document.location.replace(url);
	window.document.getElementById("frmMain").src=url;
	//window.frmMain.location=url;
	vTitle=vTitle.replace('&nbsp;&nbsp;','').replace('&nbsp;','').replace('&nbsp;','').replace('<br>','');
	
	window.top.document.title=vTitle;
	frmTool.goDesktop('tree');	

	}else{alert('不能点击空链接!');}
}

//链接过程(含参数)
function setHeight(theObj)
{
	var whichEl,vTitle;
	var hgt=theObj.getAttribute("height");
	window.document.getElementById("myTD").height=hgt;
		
	vTitle = TheMenu_Owner+' ['+KingoMemuBar.barArray[KingoMemuBar.curBarIndex].text;
	vTitle+='--'+theObj.innerText+']';	
	
	vTitle=vTitle.replace('&nbsp;&nbsp;','').replace('&nbsp;','').replace('&nbsp;','').replace('<br>','');	
	window.top.document.title=vTitle;
}
