var fhTooltip=new function(){function k(a,b){var c=a.ownerDocument&&a.ownerDocument.defaultView&&a.ownerDocument.defaultView.getComputedStyle&&a.ownerDocument.defaultView.getComputedStyle(a,null),d=c&&c.getPropertyValue(b?"height":"width")||"";return d=d&&-1<d.indexOf(".")?parseFloat(d)+parseInt(c.getPropertyValue(b?"padding-top":"padding-left"))+parseInt(c.getPropertyValue(b?"padding-bottom":"padding-right"))+parseInt(c.getPropertyValue(b?"border-top-width":"border-left-width"))+parseInt(c.getPropertyValue(b?
"border-bottom-width":"border-right-width")):b?a.offsetHeight:a.offsetWidth}function v(a){for(var b=document.getElementsByTagName("body")[0],c=a.offsetLeft,d=a.offsetTop;a.offsetParent;){c+=a.offsetParent.offsetLeft;d+=a.offsetParent.offsetTop;if(a==b)break;a=a.offsetParent}return{x:c,y:d}}function w(a){var b=0,c=0;if(!a)a=window.event;if(a.pageX||a.pageY)b=a.pageX,c=a.pageY;else if(a.clientX||a.clientY)b=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,c=a.clientY+document.body.scrollTop+
document.documentElement.scrollTop+8;return{x:b,y:c}}function x(){if("complete"!=document.readyState&&"loaded"!=document.readyState)setTimeout(x,50);else{if(!document.getElementById("headjs")){var a=document.createElement("div");a.id="headjs";a.setAttribute("style","left:0;position:absolute;right:0;top:0;z-index:999999999");document.body.insertBefore(a,document.body.childNodes[0])}document.addEventListener?(document.addEventListener("mouseover",fhTooltip.mouseOver,!0),document.addEventListener("mousemove",
fhTooltip.mouseOut,!0)):(document.attachEvent("onmouseover",fhTooltip.mouseOver),document.attachEvent("onmousemove",fhTooltip.mouseOut));(!n||"object"==typeof framehead_tooltips)&&fhTooltip.preload()}}function q(a,b){if("A"!=a.nodeName||0==a.href.length&&0==a.rel.length||-1!=a.href.indexOf("#")&&-1!=a.href.indexOf(location.href.replace(/#.*/,""))||-1!=a.rel.indexOf("nott"))return!1;if(n&&!a.href.match(E)){var c=!1,d;for(d in j)d.match(/^[0-9]+$/)&&a.getAttribute("data-"+j[d])&&(c=!0);if(!c)return!1}if(0==
a.rel.indexOf("ttcustom"))"string"!=typeof b&&(m=b),-1<a.parentNode.className.search("th-icon")?(f=a.parentNode,l=1):l=f=0;else if(0==a.rel.indexOf("tt:")){d=a.rel.replace(/^tt:/,"").replace(/%27/,"'");"string"!=typeof b&&(o=d,m=b);-1<a.parentNode.className.search("th-icon")?(f=a.parentNode,l=1):l=f=0;if("list"==b)return!1;if("return"==b)return{target:a,type:"unknown",url:d};p("http://"+window.location.hostname,d)}else if(c=y(a.href)){d=c[2].replace(/%20/g," ").replace(/\+/g," ").replace(/%27/,"'");
"string"!=typeof b&&(o=d,m=b);-1<a.parentNode.className.search("th-icon")?(f=a.parentNode,l=1):l=f=0;if("list"==b||"return"==b)return{target:a,host:c[1],type:c[3],url:d};p(c[1],d)}else if(c=t(a)){d="/"+c[3]+"/"+c[4].replace(/%20/g," ").replace(/\+/g," ").replace(/%27/,"'");"string"!=typeof b&&(o=d,m=b);-1<a.parentNode.className.search("th-icon")?(f=a.parentNode,l=1):l=f=0;var i="http://www."+c[1]+".com";if("list"==b||"return"==b)return{target:a,host:i,type:c[3],url:d};p(i,d)}else return!1;if(!a.fhEvents)a.fhEvents=
1,a.onmousemove=z,a.onmouseout=function(){o=0;var a=document.getElementById("headtt");a&&a.parentNode.removeChild(a);f=0};return!0}function p(a,b){b=b.replace(/#/,"/");r[b]?u(b):A(a,b)}function u(a){var b=r[a];o==a&&"Unavailable"!=b.html.substring(0,11)&&fhTooltip.showTooltip(b.html)}function z(a){"undefined"==typeof a&&(a=m);var b=document.getElementById("headtt");if(b){if(f){var c=v(f);b.style.top=c.y-k(b,1)+"px";b.style.left=c.x+f.offsetWidth+"px";b.style.right="auto";a=B(a,b);if(a.x||a.y){if(a.y)b.style.top=
c.y+f.offsetHeight+"px";if(a.x&&(b.style.left="auto",b.style.right=C().r-c.x+"px",!a.y))b.style.top=c.y-k(b,1)+"px"}}else{var c=w(a),d=k(b,1);if(!d)b.style.display="block",d=k(b,1);b.style.top=c.y-d-6+"px";b.style.left=c.x+6+"px";b.style.right="auto";a=B(a,b);if(a.x||a.y){if(a.y)b.style.top=c.y+20+"px";if(a.x)b.style.left="auto",b.style.right=a.x+6+"px"}}b.style.display="block"}}function B(a,b){var c=0,d=0,i=C();if(f){var e=v(f);e.y-k(b,1)<i.t&&(d=1);e.x+f.offsetWidth+k(b)+1>i.r&&(c=1);return{x:c,
y:d}}e=w(a);e.y-k(b,1)-6<i.t&&(d=1);e.x+k(b)+7>i.r&&(c=i.r-e.x);return{x:c,y:d}}function A(a,b){var c=document.createElement("script");c.type="text/javascript";c.src=a+b+(b.match(/tooltips$/)?"":"/tooltip");document.head?document.head.appendChild(c):document.body.appendChild(c)}function y(a){var b=!1,c;for(c in j)if(c.match(/^[0-9]+$/)&&(b=a.match(D[j[c]].normal)))break;if(b)b[2]=b[2].replace(/#.*/,"");else{for(c in j)if(c.match(/^[0-9]+$/)&&(b=a.match(D[j[c]].hash)))break;b&&(b[2]=b[2].replace(/#/,
"/"))}return b}function t(a){for(var b in j)if(b.match(/^[0-9]+$/)&&a.getAttribute("data-"+j[b])&&(match=a.getAttribute("data-"+j[b]).match(F[j[b]])))return[match[0],j[b],match[0],match[1],match[2]];return!1}function C(){var a=document.body.scrollLeft,b=document.body.scrollTop;0==a&&(a=window.pageYOffset?window.pageXOffset:document.body.parentElement?document.body.parentElement.scrollLeft:0);0==b&&(b=window.pageYOffset?window.pageYOffset:document.body.parentElement?document.body.parentElement.scrollTop:
0);return{l:a,t:b,r:a+(window.innerWidth?window.innerWidth:document.body.clientWidth),b:b+(window.innerHeight?window.innerHeight:document.body.clientHeight)}}var E=/^https?:\/\/[^\/]*\.(torhead)\.com\//,j=["torhead"],D={torhead:{normal:/^(http:\/\/[^\/]+)(\/(item|npc|ability|schematic|class|mission)\/([^\/]+))/,hash:/^(http:\/\/[^\/]+)(\/(skill-calc)#(.+))/}},F={torhead:/^(item|npc|ability|schematic|class|mission|skill-calc)=(.*)/},n="undefined"==typeof FH?1:0,m="",r=[],o=0,f=0,l=0;this.init=function(){if(document.body){if(n){var a=
document.createElement("link");a.rel="stylesheet";a.type="text/css";a.href="http://tor.zamimg.com/tooltips.css";document.head?document.head.appendChild(a):document.body.appendChild(a)}x()}else setTimeout(fhTooltip.init,20)};this.preload=function(){var a=!n&&document.getElementById("main")?document.getElementById("main"):document.body,a=a.getElementsByTagName("a"),b={},c;for(c in a){var d=q(a[c],"list");if(d){b[d.host]||(b[d.host]={});var i=b[d.host];i[d.type]||(i[d.type]=[]);var e=i[d.type],h=d.url.replace(/%20/g,
" ").replace(/\+/g," ").replace(/%27/,"'").replace(/#/,"/");e[h]=h;i[d.type]=e;b[d.host]=i}}for(c in b)for(var g in b[c]){var a=[],f;for(f in b[c][g])"string"==typeof b[c][g][f]&&a.push(b[c][g][f].replace("/"+g+"/","").replace("/",""));A(c,"/"+g+"/"+a.join(";")+"/tooltips")}};this.modifyLinks=function(a){if("object"==typeof framehead_tooltips){var b=framehead_tooltips;if(b.colorlinks||b.iconizelinks||b.renamelinks||b.renamespecifiedlinks)for(var c=0,d=!n&&document.getElementById("main")?document.getElementById("main"):
document.body,d=d.getElementsByTagName("a"),i=0;i<d.length;i++)if(200>=c&&"object"==typeof d[i]){var e=q(d[i],"return");if(e&&"yes"!=e.target.getAttribute("data-framehead-modified")){var h=y(e.target.href);h||(h=t(e.target));if(h&&h[3]==a){e.target.setAttribute("data-framehead-modified","yes");var g=r[e.url];if(g){c++;if((b.renamelinks||b.renamespecifiedlinks&&"yes"==e.target.getAttribute("data-fhrename"))&&g.name&&e.target.innerHTML)e.target.innerHTML=g.name;b.colorlinks&&g.linkColor&&(e.target.className+=
" "+g.linkColor);if(b.iconizelinks&&g.icon){var f=document.createElement("div");f.innerHTML=g.icon;f=f.childNodes[0];g=f.getElementsByTagName("a")[0];g.href=e.target.href;(h=t(e.target))&&g.setAttribute("data-"+h[1],h[0]);e.target.parentNode.insertBefore(f,e.target)}}}}}}};this.mouseOver=function(a){for(var b=a.target?a.target:a.srcElement,c=0;null!=b&&5>c&&!q(b,a);)b=b.parentNode,++c};this.mouseOut=function(a){m=a};this.store=function(a,b,c,d,f){r[a]={html:b,linkColor:c,icon:d,name:f};u(a)};this.storeBuild=
function(a,b,c,d,f){var b="/skill-calc/"+a,e,h={trees:[]},g="",g=0,j=[0,0],l=e=0,a=a.split(".");e=a[0].substr(3);a=1<a.length?parseInt(a[1]):0;h.suffix=1!=a?"<br>Old build, may not be accurate.":"";for(var a=e.split("Z"),k=0;3>k;++k){var m=f[k];if(k>=a.length)h.trees.push([m.tree.replace(/ \(.*/,""),0]);else{var n=a[k],o=n.length,s=[0,0],q=0;a:for(var p=1;7>=p;++p)for(var t in m.skills[p]){g=n.charAt(s[0]);e=s[1]%2;g="0zMcmVokRsaqbdrfwihuGINALpTjnyxtgevElBCDFHJKOPQSUWXYZ123456789".indexOf(g);j[0]=
g%6;j[1]=(g-j[0])/6;for(g=0;g<j[e];++g)l++,q++;if(1==e&&(s[0]++,s[0]>=o))break a;s[1]++}h.trees.push([m.tree.replace(/ \(.*/,""),q])}}c=c+" ("+h.trees[0][1]+"/"+h.trees[1][1]+"/"+h.trees[2][1]+")";r[b]={html:d.replace("REPLACE_DESCRIPTION",h.trees[0][0]+" ("+h.trees[0][1]+"), "+h.trees[1][0]+" ("+h.trees[1][1]+"), "+h.trees[2][0]+" ("+h.trees[2][1]+")"),linkColor:"",icon:"",name:c};u(b)};this.showTooltip=function(a){var b=l?' class="hide-icon"':"";document.getElementById("headjs").innerHTML='<div id="headtt"'+
b+' style="display:none;position:absolute;z-index:99999999999">'+a+"</div>";z()}};fhTooltip.init();

