var pltsPop=null;
var pltsoffsetX = 3;   // 弹出窗口位于鼠标左侧或者右侧的距离；3-12 合适
var pltsoffsetY = 5; // 弹出窗口位于鼠标下方的距离；3-12 合适
var pltsPopbg="#F6FDDC"; //背景色
var pltsPopfg="#DEDBDE"; //前景色
var pltsTitle="#000000";
var webname="伊缘网络";
var thelink;
document.write('<div id=pltsTipLayer style="display: none;position: absolute; z-index:10001"></div>');
var ax_ts=document.getElementById("pltsTipLayer");
function pltsinits()
{
    document.onmouseover   = plts;
    document.onmousemove = moveToMouseLoc;
}
function plts(e)
{
if(e){o=e.target;MouseX=e.pageX;MouseY=e.pageY} else{o=event.srcElement;MouseX=event.x;MouseY=event.y}

    if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
    if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
    
    if(o.href!=null && o.href!=""){o.hlink=o.href;}else{o.hlink="#"};
    thelink = o.hlink;
    
    pltsPop=o.dypop;
    if(pltsPop!=null&&pltsPop!=""&&typeof(pltsPop)!="undefined")
    {
    ax_ts.style.left=-1000;
    ax_ts.style.display='';
    var Msg=pltsPop.replace(/\n/g,"<br>");
    Msg=Msg.replace(/\0x13/g,"<br>");
    var re=/\{(.[^\{]*)\}/ig;
    if(!re.test(Msg)){//pltsTitle="red";
    /*********************************************************************************/
    		    if ((thelink.indexOf('art.asp') > -1) || (thelink.indexOf('art_list.asp') > -1) ){
				    pltsTitle="文章教程 - " + webname;
			    }else if (thelink.indexOf('news.asp') > -1) {
				    pltsTitle="新闻动态 - " + webname;
				}else if(thelink.indexOf('down.asp') > -1){
				    pltsTitle="资源下载 - " + webname;
				}else if(thelink.indexOf('jc.asp') > -1){
				    pltsTitle="视频教程 - " + webname;
				}else if(thelink.indexOf('js.asp') > -1){
				    pltsTitle="JavaScript特效 - " + webname;
				}else if(thelink.indexOf('web.asp') > -1){
				    pltsTitle="酷站欣赏 - " + webname;
				}else if((thelink.indexOf('wx.asp') > -1) || (thelink.indexOf('wx_list.asp') > -1) ){
				    pltsTitle="精彩网文 - " + webname;
				}else if (thelink.indexOf('flash.asp') > -1){
				    pltsTitle="动漫欣赏 - " + webname;
				}else if ((thelink.indexOf('shop') > -1) && (thelink.indexOf('.asp') > -1)){
				    pltsTitle="伊缘商城 - " + webname;
				}else if (thelink.indexOf('gj.asp') > -1){
				    pltsTitle="在线工具 - " + webname;
				}else if (thelink.indexOf('book.asp') > -1){
				    pltsTitle="网站留言 - " + webname;
				}else if (thelink.indexOf('help.asp') > -1){
				    pltsTitle="用户帮助 - " + webname;
				}else if ((thelink.indexOf('rss') > -1)){
				    pltsTitle="RSS订阅 - " + webname;
				}else if (thelink.indexOf('.asp?keyword') > -1){
				    pltsTitle="搜索标签 TAGS - " + webname;
				}else if (thelink.indexOf('#') > -1){
				    pltsTitle=webname + " - www.2ey.cn";
				}else{
			        pltsTitle=webname + " - www.2ey.cn";//////////
			}
	}
    /****************************************************************************************/
    else{
    re=/\{(.[^\{]*)\}(.*)/ig;
    pltsTitle=Msg.replace(re,"$1")+"&nbsp;";
    re=/\{(.[^\{]*)\}/ig;
    Msg=Msg.replace(re,"");
    Msg=Msg.replace("<br>","");}
           var content =
      	'<table style="FILTER:alpha(opacity=85) shadow(color=#808080,direction=145);opacity:0.85" id=toolTipTalbe border=0 >'+
      	'<tr><td width="100%">'+
      	'<table class=table Border="1" cellspacing="1" cellpadding="0" style="width:100%">'+

      	'<tr id=pltsPoptop  bgcolor="#525151" height="18px">'+
      	'<td height="18px;" valign=bottom><font size="2" color=white>'+
      	'<b><p id=topleft align=left>↖'+pltsTitle+'</p><p id=topright align=right style="display:none">'+pltsTitle+'↗</font></b></font>'+
      	'</td></tr>'+

      	'<tr bgcolor="#E0E0E0"><td "+attr+" class=tablebody1 style="padding-left:14px;padding-right:14px;padding-top: 6px;padding-bottom:6px;line-height:135%;"><a href="#">'+Msg+'</a></td></tr>'+

      	'<tr id=pltsPopbot style="display:none" bgcolor="#525151" height="18"><th height=18 valign=bottom><font color=white size="2"><b><p id=botleft align=left>↙'+pltsTitle+'</p><p id=botright align=right style="display:none">'+pltsTitle+'↘</font></b></font></th></tr>'+

      	'</table>'+
      	
      	'</td></tr></table>';
           ax_ts.innerHTML=content;
           document.getElementById("toolTipTalbe").style.width=Math.min(ax_ts.clientWidth,document.body.clientWidth/2.2);
           moveToMouseLoc(e);
           return true;
       }
    else
    {
        ax_ts.innerHTML='';
          ax_ts.style.display='none';
           return true;
    }
}

function moveToMouseLoc(e)
{
if(e){MouseX=e.pageX;MouseY=e.pageY;}else{MouseX=event.clientX;MouseY=event.clientY;}
if(ax_ts.innerHTML=='')return true;
    var popHeight=ax_ts.clientHeight;
    var popWidth=ax_ts.clientWidth;
    if(MouseY+pltsoffsetY+popHeight>document.body.clientHeight)
    {
        popTopAdjust=-popHeight-pltsoffsetY*1.5;
        document.getElementById("pltsPoptop").style.display="none";
        document.getElementById("pltsPopbot").style.display="";
    }
    else
    {
           popTopAdjust=0;
        document.getElementById("pltsPoptop").style.display="";
        document.getElementById("pltsPopbot").style.display="none";
    }
    if(MouseX+pltsoffsetX+popWidth>document.body.clientWidth)
    {
        popLeftAdjust=-popWidth-pltsoffsetX*2;
        document.getElementById("topleft").style.display="none";
        document.getElementById("botleft").style.display="none";
        document.getElementById("topright").style.display="";
        document.getElementById("botright").style.display="";
    }
    else
    {
        popLeftAdjust=0;
        document.getElementById("topleft").style.display="";
        document.getElementById("botleft").style.display="";
        document.getElementById("topright").style.display="none";
        document.getElementById("botright").style.display="none";
    }
    //ax_ts.style.left=MouseX+pltsoffsetX+document.body.scrollLeft+popLeftAdjust;
     
	 ax_ts.style.left=MouseX+pltsoffsetX+document.body.scrollLeft+popLeftAdjust;
	 ax_ts.style.top=MouseY+pltsoffsetY+document.body.scrollTop+popTopAdjust;
  	return true;
}
pltsinits();
