var pltsPop=null;
var pltsoffsetX = 10;
var pltsoffsetY = 15;
var pltsPopbg="#ffff00";
var pltsPopfg="#111111";
var pltsTitle="";
var MaxWidth=260;//设置图片宽度界限 
var MaxHeight=260;//设置图片高度界限 
function Wa_SetImgAutoSize(img) 
{ 
//var img=document.all.img;//获取图片 
//var HeightWidth=img.offsetHeight/img.offsetWidth;//设置高宽比 
//var WidthHeight=img.offsetWidth/img.offsetHeight;//设置宽高比 
//if(img.readyState!="complete"){
//return false;//确保图片完全加载
//}
if(img.offsetWidth>img.offsetHeight){ 
if (img.offsetWidth<MaxWidth){
	img.width=img.offsetWidth
}
else
{
img.width=MaxWidth; 
}
} 
else
{ 
if (img.offsetHeight<MaxHeight){
	img.height=img.offsetHeight
}
else
{
img.height=MaxHeight; 
}
} 
}
document.write('<div id=pltsTipLayer style="display: none;position: absolute; z-index:10001"></div>');

function pltsinits()
{
    document.onmouseover = plts;
    document.onmousemove = moveToMouseLoc;
}
function plts()
{  var o=event.srcElement;
    if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
    if(o.title1!=null && o.title1!=""){o.dypop=o.title1;o.title1=""};
    pltsPop=o.dypop;
    if(pltsPop!=null&&pltsPop!=""&&typeof(pltsPop)!="undefined")
    {
	pltsTipLayer.style.left=-1000;
	pltsTipLayer.style.display='';
	var Msg=pltsPop.replace(/\n/g,"<br>");//&#13;&#10;代表<br>回车
	Msg=Msg.replace(/\0x13/g,"<br>");
	var re=/\{(.[^\{]*)\}/ig;
	if(!re.test(Msg))pltsTitle="<span style=font-size:12px; align=center>--中国艺术在线--</span>";
	else{
	  re=/\{(.[^\{]*)\}(.*)/ig;
  	  pltsTitle=Msg.replace(re,"$1")+"&nbsp;";
	  re=/\{(.[^\{]*)\}/ig;
	  Msg=Msg.replace(re,"");
	  Msg=Msg.replace("<br>","");}
	  //var attr=(document.location.toString().toLowerCase().indexOf("list.asp")>0?"nowrap":"");
	  //if(number==1)
	  //{
       	//var content =
      	//'<table style="FILTER:alpha(opacity=100) shadow(color=#bbbbbb,direction=180);" id=toolTipTalbe border=0><tr><td width="100%"><table bgcolor=#ffffff cellspacing="0" cellpadding="0" style="width:100%" style="font size:11px;">'+
      	//'<tr id=pltsPoptop><th bgcolor=#ff9900 height=20 valign=bottom class=header><p id=topleft align=left><font color=#ffffff>↖'+pltsTitle+'</font></p><p id=topright align=right style="display:none"><font color=#ffffff>'+pltsTitle+'↗</font></th></tr>'+
      	//'<tr><td "+attr+" class=f_one style="padding-left:1px;padding-right:1px;padding-top: 1px;padding-bottom:1px;line-height:135%">'+number+Msg+'</td></tr>'+
      	//'<tr id=pltsPopbot style="display:none"><th bgcolor=#ff9900  height=20 valign=bottom class=header><p id=botleft align=left><font color=#ffffff>↙'+pltsTitle+'</font></p><p id=botright align=right style="display:none"><font color=#ffffff>'+pltsTitle+'↘</font></th></tr>'+
      	//'</table></td></tr></table>';
	//	}
	   //else
	  //{
       	var content =
      	'<table style="FILTER:alpha(opacity=100) shadow(color=#bbbbbb,direction=180);" id=toolTipTalbe border=0><tr><td width="100%"><table bgcolor=#000000 cellspacing="0" cellpadding="0" style="width:100%" style="font size:11px;">'+
      	//'<tr id=pltsPoptop><th bgcolor=#ff9900 height=20 valign=bottom class=header>'+
//		<p id=topleft align=left><font color=#ffffff>↖'+pltsTitle+'</font></p><p id=topright align=right style="display:none"><font color=#ffffff>'+pltsTitle+'↗</font>
       // '</th></tr>'+
      	'<tr><td "+attr+" class=f_one style="padding-left:1px;padding-right:1px;padding-top: 1px;padding-bottom:1px;line-height:135%"><img src=http://www.jddhy.com/images/loading.gif id=img1 onload=Wa_SetImgAutoSize(this);></td></tr>'+
      	//'<tr id=pltsPopbot style="display:none"><th bgcolor=#ff9900  height=20 valign=bottom class=header>'+
		//<p id=botleft align=left><font color=#ffffff>↙'+pltsTitle+'</font></p><p id=botright align=right style="display:none"><font color=#ffffff>'+pltsTitle+'↘</font>
		//'</th></tr>'+
      	'</table></td></tr></table>';
		//}
       	pltsTipLayer.innerHTML=content;
		img1.src=Msg
       	moveToMouseLoc();
       	return true;
       }
    else
    {
    	pltsTipLayer.innerHTML='';
      	pltsTipLayer.style.display='none';
       	return true;
    }
}

function moveToMouseLoc()
{
	if(pltsTipLayer.innerHTML=='')return true;
	var MouseX=event.x;
	var MouseY=event.y;
	//window.status=event.y;
	var popHeight=pltsTipLayer.clientHeight;
	var popWidth=pltsTipLayer.clientWidth;
	if(MouseY+pltsoffsetY+popHeight>document.body.clientHeight)
	{
	  	popTopAdjust=-popHeight-pltsoffsetY*1.5;
	  	//pltsPoptop.style.display="none";
	  	//pltsPopbot.style.display="";
	}
	 else
	{
	   	popTopAdjust=0;
	  	//pltsPoptop.style.display="";
	  	//pltsPopbot.style.display="none";
	}
	if(MouseX+pltsoffsetX+popWidth>document.body.clientWidth)
	{
		popLeftAdjust=-popWidth-pltsoffsetX*2;
		//topleft.style.display="none";
		//botleft.style.display="none";
		//topright.style.display="";
		//botright.style.display="";
	}
	else
	{
		popLeftAdjust=0;
		//topleft.style.display="";
		//botleft.style.display="";
		//topright.style.display="none";
		//botright.style.display="none";
	}
	pltsTipLayer.style.left=MouseX+pltsoffsetX+document.body.scrollLeft+popLeftAdjust;
	pltsTipLayer.style.top=MouseY+pltsoffsetY+document.body.scrollTop+popTopAdjust;
  	return true;
}
pltsinits();












