var ih=0,iw=0;//图片的高、宽
var l,t;//层的left top
var mx,my;//鼠标的位置
var st;//滚动条的位置
var img=null;
var retime;
document.write('<div id=mytips style="position:absolute;z-index:1;border:1px solid #999999;padding:2px; gray solid;font-size:12px;background-color:#ffffff;color:#666666;display:none;filter: progid:DXImageTransform.Microsoft.Shadow(color=#999999,direction=135,strength=3);"></div>');
var my_tips=document.all.mytips;

function tip(str){
	my=event.clientY;
	mx=event.clientX;
	st=document.body.scrollTop;
	my_tips.style.left=mx;
	my_tips.style.top=st+my;
	my_tips.innerHTML="";
	my_tips.innerHTML="<img id='ims' src='"+str+"' align=left>";
	my_tips.style.display="";
	iw=ims.offsetWidth;
	ih=ims.offsetHeight;
	if(iw==0 || ih==0){
		clearTimeout(retime)
		retime=setTimeout("tip('"+str+"')",100);
	}else{
		show();
	}
}
function show(){
	maxHeight=document.body.clientHeight;
	maxWidth=document.body.clientWidth;
	if(mx+iw+20>maxWidth){l=mx-iw;}else{l=mx+10;}
	my_tips.style.left=l;
	if(my+ih+20>maxHeight){t=my+st-ih;}else{t=my+10+st;}
	my_tips.style.top=t;

}
function hide_tip(){
	var my_tips=document.all.mytips;
	my_tips.innerHTML="";
	my_tips.style.display="none";
}
