
var timerObj=null;
function getIE(e,par){
var t=e.offsetTop;
var l=e.offsetLeft;
while(e=e.offsetParent){
t+=e.offsetTop;
l+=e.offsetLeft;
}
if(par=="t")
return t;
if(par=="l")
return l;
}

function showdiv(id,showobj)//显示DIV,id相对位置的ID，showobj要显示对象的ID
{
clearTimeout(timerObj);

	var obj=G(id);
	//G("list").innerHTML=str[id];
	showobj=G(showobj);
	showobj.style.left=getIE(obj,"l")-showobj.offsetWidth+obj.offsetWidth;
	//alert(showobj.offsetWidth);
	showobj.style.top=getIE(obj,"t")+obj.offsetHeight;
	showobj.style.visibility="visible";
}
function starthid(showobj)//开始执行隐藏
{
timerObj=setTimeout("hiddiv('"+showobj+"')",500);
}
function clearTimer()//中断隐藏
{
		if(timerObj!=null)
	{
	clearTimeout(timerObj);
	timerObj=null;
	}
}
function hiddiv(showobj)//隐藏DIV
{

	clearTimeout(timerObj);
	timerObj=null;
	//G(showobj).innerHTML="";
	G(showobj).style.visibility="hidden";
}

//document.write('<div id="list" onmouseover="clearTimer()" onmouseout="starthid()"></div>');


//以下是使用方法
//<a href="#"  onMouseOver="showdiv(1)" onMouseOut="starthid()" id="a1">教学内容</a>