
/* - liveDesc.js - */
// http://www.thuvien.net/portal_javascripts/liveDesc.js?original=1
var liveDescReq=false;var queryScr="liveDescScript?path=";var hotDescObj;var enableQuickDesc=false;var ie=document.all;var ns6=document.getElementById&&!document.all;var offsetxpoint=-60;var offsetypoint=20;
function loadContent(path){liveDescReq=new XMLHttpRequest();enableQuickDesc=true;liveDescReq.onreadystatechange=liveDescProcessReqChange;if(typeof portal_url=="undefined"){liveDescRoot=""} else{if(portal_url[portal_url.length-1]=='/'){liveDescRoot=portal_url} else{liveDescRoot=portal_url+'/'}}
liveDescReq.open("GET",liveDescRoot+queryScr+encodeURIComponent(path));liveDescReq.send(null)}
function showDesc(result){if(!hotDescObj||hotDescObj==null||hotDescObj==undefined){createHotDescDiv()}
hotDescObj.style.display="block";hotDescObj.innerHTML=result}
function createHotDescDiv(){try{hotDescObj=document.createElement('DIV');hotDescObj.id='hotDesc';hotDescObj.className='hotDescClass';hotDescObj.style.display='block';hotDescObj.style.position='absolute';document.body.appendChild(hotDescObj)}
catch(e){return}}
function liveDescProcessReqChange(){if(liveDescReq.readyState==4){try{if(liveDescReq.status>299||liveDescReq.status<200||liveDescReq.responseText.length<10)
return} catch(e){return}
showDesc(liveDescReq.responseText)}}
function liveDescHide(){if((ns6||ie)&&(hotDescObj)){enableQuickDesc=false;hotDescObj.style.visibility="hidden";hotDescObj.style.left="-1000px";hotDescObj.style.backgroundColor='';hotDescObj.style.width=''}}
function ietruebody(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}
function MyPositionDiv(e){if(enableQuickDesc){try{if(!hotDescObj||hotDescObj==null||hotDescObj==undefined){createHotDescDiv()}
var curX=(ns6)?e.pageX:event.clientX+ietruebody().scrollLeft;var curY=(ns6)?e.pageY:event.clientY+ietruebody().scrollTop;var rightedge=ie&&!window.opera?ietruebody().clientWidth-event.clientX-offsetxpoint:window.innerWidth-e.clientX-offsetxpoint-20;var bottomedge=ie&&!window.opera?ietruebody().clientHeight-event.clientY-offsetypoint:window.innerHeight-e.clientY-offsetypoint-20;var leftedge=(offsetxpoint<0)?offsetxpoint*(-1):-1000;if(rightedge<hotDescObj.offsetWidth){hotDescObj.style.left=ie?ietruebody().scrollLeft+event.clientX-hotDescObj.offsetWidth+"px":window.pageXOffset+e.clientX-hotDescObj.offsetWidth+"px"}
else if(curX<leftedge){hotDescObj.style.left="5px"}
else{hotDescObj.style.left=curX+offsetxpoint+"px"}
if(bottomedge<hotDescObj.offsetHeight){hotDescObj.style.top=ie?ietruebody().scrollTop+event.clientY-hotDescObj.offsetHeight-offsetypoint+"px":window.pageYOffset+e.clientY-hotDescObj.offsetHeight-offsetypoint+"px"}
else{hotDescObj.style.top=curY+offsetypoint+"px"}
hotDescObj.style.visibility="visible"}
catch(e){alert(e)}}}
if(window.addEventListener)
window.addEventListener("mousemove",MyPositionDiv,false);else if(window.attachEvent)
document.onmousemove=MyPositionDiv;
