enoxtip={name:"qTip",offsetX:0,offsetY:15,tip:null,trackmouse:false,parse:true};enoxtip.init=function(){if(this.parse){myrx=new RegExp("(\\[lotro]|\\[/lotro]|\\<textarea|\\</textarea|\\<script|\\</script)","gi");contenu=document.getElementsByTagName("BODY")[0].innerHTML;var idx_start=0,contenu_split=[],ta_open=false,lfr_open=false,contenu_upd=false;while(matches=myrx.exec(contenu)){if(idx_start<matches.index)contenu_split.push(contenu.substring(idx_start,matches.index));idx_start=matches.index;contenu_parse=matches[1];switch(matches[1].toLowerCase()){case'<textarea':case'<script':ta_open=true;break;case'</textarea':case'</script':ta_open=false;break;case'[lotro]':if(!ta_open){lfr_open=true;contenu_parse='<span class="lotrofr" style="cursor:help;font-weight:bold;text-decoration:underline">';contenu_upd=true}break;case'[/lotro]':if(lfr_open){lfr_open=false;contenu_parse='</span>'}break}contenu_split.push(contenu_parse);idx_start=idx_start+matches[1].length}if(idx_start<contenu.length)contenu_split.push(contenu.substring(idx_start));if(contenu_upd)document.getElementsByTagName("BODY")[0].innerHTML=contenu_split.join('')}var tipNameSpaceURI="http://www.w3.org/1999/xhtml";if(!tipContainerID){var tipContainerID="qTip"}var tipContainer=document.getElementById(tipContainerID);if(!tipContainer){tipContainer=document.createElementNS?document.createElementNS(tipNameSpaceURI,"div"):document.createElement("div");tipContainer.setAttribute("id",tipContainerID);tipContainer.style.border="1px solid #666666";tipContainer.style.display="none";tipContainer.style.position="absolute";tipContainer.style.zindex="99999";tipContainer.style.width="302px";document.getElementsByTagName("body").item(0).appendChild(tipContainer)}if(!document.getElementById)return;this.tip=document.getElementById(this.name);if(this.tip)document.onmousemove=function(evt){enoxtip.move(evt)};var a,sTitle,sID,elements;elements=document.getElementsByTagName("span");if(elements){for(var i=0;i<elements.length;i++){a=elements[i];if(a.className!="lotrofr")continue;sID=a.getAttribute("oid");a.removeAttribute("title");a.removeAttribute("alt");sTitle="http://lotro.fr/bdd/objet_img/";if(sID){sTitle+=sID+";.png"}else{sTitle+=a.innerHTML+".png"}a.setAttribute("tip",sTitle);a.onmouseover=function(evt){enoxtip.show(evt,this.getAttribute("tip"))};a.onmouseout=function(){enoxtip.hide()};a.onclick=function(evt){enoxtip.click(evt,this.getAttribute("tip"))}}}};enoxtip.move=function(evt){if(!this.trackmouse)return false;var x=0,y=0;if(document.all){x=(document.documentElement&&document.documentElement.scrollLeft)?document.documentElement.scrollLeft:document.body.scrollLeft;y=(document.documentElement&&document.documentElement.scrollTop)?document.documentElement.scrollTop:document.body.scrollTop;x+=window.event.clientX;y+=window.event.clientY}else{x=evt.pageX;y=evt.pageY}this.tip.style.left=(x+this.offsetX)+"px";this.tip.style.top=(y+this.offsetY)+"px"};enoxtip.show=function(evt,text){if(!this.tip)return;this.trackmouse=true;this.move(evt);this.tip.innerHTML='<img src="'+text+'">';this.tip.style.display="block"};enoxtip.hide=function(){if(!this.tip||!this.trackmouse)return;this.tip.innerHTML="";this.tip.style.display="none";this.trackmouse=false};enoxtip.click=function(evt,text){if(!this.tip)return;this.tip.innerHTML='<div style="height:20px;cursor:pointer;background:#000;color:#FFF;text-align:right;border-bottom:1px solid #666" onclick="this.parentNode.style.display='+"'none'"+'">[Fermer]</div><img src="'+text+'">';this.tip.style.display="block";this.trackmouse=false};window.onload=function(){enoxtip.init()};
