// JavaScript Document
function TitleMsg(frm,msg)
{
  showhide(false);	
  if(!msg || msg.length<2)return;
  ///提示格式是:1;文字|
  var tlist=msg.split("|");
  var str=[];
  if(tlist.length<4)return;
  for(var i=0;i<tlist.length;i++)
  {
	 var tmsg=tlist[i].split(";");
	 if(tmsg.length<2) continue;
	 str.push("<a href='/product/product_List.asp?classid="+tmsg[0]+"'>"+tmsg[1]+"</a><br>");
  }
  $("titlecontent").innerHTML=str.join("");
  var t=getPosition(frm);
  var t2=getWindowHW();
  $("titlemsg").style.top=t.top+'px';
  $("titlemsg").style.left=(t.left+t.width-30)+'px';
  showhide(true);	
 // $("titlecontent").style.top=t2.hs+t.top+t.heigtt+'px';
}

function showhide(b)
{
  $("titlemsg").style.display=b?"inline":"none";	
}



function getPosition(obj)
{
	    var top=0;
	    var left=0;
	    var width=obj.offsetWidth;
	    var height=obj.offsetHeight;
		while (obj.offsetParent) {
			    top += obj.offsetTop;
			    left += obj.offsetLeft;
			    obj = obj.offsetParent;
		    }
	    return {"top":top,"left":left,"width":width,"height":height};
}


function getWindowHW()
   {
	   var scrollPos,scrollLeft,clientHeight,clientWidth,wh,ww;
	   if (typeof(document.compatMode) != 'undefined' &&   document.compatMode != 'BackCompat')
	   { 
		   scrollPos = document.documentElement.scrollTop;
		   scrollLeft= document.documentElement.scrollLeft;
		   clientHeight= document.documentElement.clientHeight;
		   clientWidth= document.documentElement.clientWidth;
		   wh=document.documentElement.scrollHeight;
		   ww=document.documentElement.scrollWidth;
       }
		else
		{
		   scrollPos = document.body.scrollTop;
		   scrollLeft= document.body.scrollLeft;
		   clientHeight= document.body.clientHeight;
		   clientWidth= document.body.clientWidth;
		   wh=document.body.scrollHeight;
		   ww=document.body.scrollWidth;
		}
		return {"ws":scrollLeft,"w":clientWidth,"wh":wh,"hs":scrollPos,"h":clientHeight,"ww":ww}
   }