var p_obj = document.getElementById("p_t");
var fSize = 12;
var fTS = fSize*2;
document.write("<div id=p_t style='display:none;position:absolute;background-color:#FFFFEE; font-size:12px;border-style:solid; border-width: 1px;border-color:#000000;'></div>");
//显示
function p_sd(top,left,showtext){
	p_t.style.top=top+"px";
	p_t.style.left=left+"px";
	p_t.innerHTML = showtext;
	p_t.style.display = "block";
}
//关闭
function p_cd(){
	p_t.style.display = "none";
}
function linkoperate(id,title){
  var titlePre = title.substr(0,4);
  //var titlePre = type;
  if (titlePre=="[短讯]"){
    try{
      var pageH = document.body.scrollHeight;
      var ieheight = document.body.clientHeight;
      var iewidth = document.body.clientWidth;
      var mouseleft = window.event.clientX+document.body.scrollLeft;
      var mousetop = window.event.clientY+document.body.scrollTop;
      var n = mousetop/ieheight;
      var txtlen = title.length;	
      txtlen = txtlen*fSize;
      var left = (txtlen+mouseleft>iewidth)?(iewidth-txtlen-fTS):mouseleft;
      var top;
      top = mousetop+fSize;
      if (top>((Math.round(n)-n>=0)?Math.round(n):(Math.round(n)+1))*ieheight) top = mousetop-fSize;
      if (txtlen>0)	p_sd(top,left,title);		
    }catch(err){}
    return false;
  }else{
    var openUrl = "http://www.caixun.com/";
    if (id.indexOf("http://")>-1){openUrl = id;}
    else if (id.length==8){
      openUrl = "http://content.caixun.com/";
      var dir1 = id.substr(0,2);
      var dir2 = id.substr(2,2);
      var dir3 = id.substr(4,2);
      openUrl = openUrl + dir1 +"/" + dir2 +"/" + dir3 + "/" + id + ".shtm";
    }
    window.open(openUrl,"","height=352,width=850,top=248,left=162,toolbar=yes,menubar=yes,scrollbars=yes,Resizable=yes,location=yes");
    return false;
  }
}
/**
 * 普通文章链接跳转函数
 * id:文章ID
 * title:文章标题
 */
function jsGL(id,title){return linkoperate(id,title);}

/**
 * 文章的图片链接跳转函数
 * id:文章ID
 * title:文章标题
 */
function jsGP(id,title){return linkoperate(id,title);}

/**
 * 大标题文章链接跳转函数
 * id:文章ID
 * title:文章标题
 */
function jsGT(id,title){return linkoperate(id,title);}

/**
 * 文章摘要链接跳转函数
 * id:文章ID
 * title:文章标题
 */
function jsGZ(id,title){return linkoperate(id,title);}