	var textx;
if(typeof $WowheadPower=="undefined"){
	var $WowheadPower=new function(){
		function l(AE,AD){
			var AC=document.createElement(AE);
			if(AD){x(AC,AD)}
			return AC
		}
		
		function M(AC,AD){return AC.appendChild(AD)}
		function k(AD,AE,AC){
			if(window.attachEvent){
				AD.attachEvent("on"+AE,AC)
			}else{
				AD.addEventListener(AE,AC,false)
			}
		}
		function x(AE,AC){
			for(var AD in AC){
				if(typeof AC[AD]=="object"){
					if(!AE[AD]){
						AE[AD]={}
					}
					x(AE[AD],AC[AD])
				} else{
					AE[AD]=AC[AD]
				}
			}
		}
		function h(AC){
			if(!AC){AC=event}
			if(!AC._button){
				AC._button=AC.which?AC.which:AC.button;
				AC._target=AC.target?AC.target:AC.srcElement
			}
			return AC
		}
		
		function s(){
			var AD=0,AC=0;
			if(typeof window.innerWidth=="number"){
				AD=window.innerWidth;
				AC=window.innerHeight
			}else{
				if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){
					AD=document.documentElement.clientWidth;
					AC=document.documentElement.clientHeight
				}else{
					if(document.body&&(document.body.clientWidth||document.body.clientHeight)){
						AD=document.body.clientWidth;
						AC=document.body.clientHeight
					}
				}
			}
			return{w:AD,h:AC}
		}
		
		function Y(){
			var AC=0,AD=0;
			if(typeof (window.pageYOffset)=="number"){
				AC=window.pageXOffset;
				AD=window.pageYOffset
			}else{
				if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){
					AC=document.body.scrollLeft;
					AD=document.body.scrollTop
				}else{
					if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){
						AC=document.documentElement.scrollLeft;
						AD=document.documentElement.scrollTop
					}
				}
			}
			
			return{x:AC,y:AD}
		}
		
		function w(AE){
			var AD,AF;
			if(window.innerHeight){
				AD=AE.pageX;AF=AE.pageY
			}else{
				var AC=Y();
				AD=AE.clientX+AC.x;
				AF=AE.clientY+AC.y
			}return{x:AD,y:AF}
		}
		
		var X={applyto:3},H,q,o,m,P=document.getElementsByTagName("head")[0],a=[],W=[],I=[],p,U,C,b,F=1,r=!!(window.attachEvent&&!window.opera),R=navigator.userAgent.indexOf("MSIE 7.0")!=-1,T=navigator.userAgent.indexOf("MSIE 6.0")!=-1&&!R,d={loading:"Loading...",noresponse:"No response from server :("},t=0,L=1,J=2,j=3,u=4,e=3,i=5,V=6,O=15,g=15,Q={3:[a,"item","Item"],5:[W,"quest","Quest"],6:[I,"spell","Spell"]};
		
		function z(){
			M(P,l("link",{type:"text/css",href:"http://www.wowhead.com/widgets/power/power.css?3",rel:"stylesheet"}));
			if(r){M(P,l("link",{type:"text/css",href:"http://www.wowhead.com/widgets/power/power_ie.css?3",rel:"stylesheet"}));
				if(T){M(P,l("link",{type:"text/css",href:"http://www.wowhead.com/widgets/power/power_ie6.css?3",rel:"stylesheet"}))}
			}
			
			k(document,"mouseover",c)
		}
		
		function N(AC){
			var AD=w(AC);
			o=AD.x;
			m=AD.y
		}
		
		function AA(AD,AG){
			if(AD.nodeName!="A"){return -2323}
			if(!AD.href.length){return }
			var AF,AE,AC;
			if(X.applyto&1){
				AF=2;
				AE=3;
				//AC=AD.href.match(/http:\/\/(www\.)?wowxhead\.com\/\?(item|quest|spell)=([0-9]+)/)
				AC=AD.href.match(/http:\/\/(www\.)?pallytank\.com\/\?(item|quest|spell)=([0-9]+)/)
					
			}
	
			if(AC==null&&(X.applyto&2)&&AD.rel){
				AF=1;
				AE=2;
				AC=AD.rel.match(/(item|quest|spell).?([0-9]+)/)
			}
			
			if(AC){
				if(!AD.onmousemove){
					AD.onmousemove=B;
					AD.onmouseout=D
				}
				N(AG);
				if(AC[AF]=="item"){
					f(e,AC[AE])
				}else{
					if(AC[AF]=="quest"){
						f(i,AC[AE])
					}else{
						f(V,AC[AE])
					}
				}
			}
		}
		
		function c(AE){
			AE=h(AE);
			var AD=AE._target;
			var AC=0;
			while(AD!=null&&AC<3&&AA(AD,AE)==-2323){
				AD=AD.parentNode;++AC
			}
		}
		
		function B(AC){
			AC=h(AC);N(AC);Z()
		}
		
		function D(){
			H=null;S()
		}
		
		function G(){
			if(!p){
				var AH=l("div"),AL=l("table"),AE=l("tbody"),AG=l("tr"),AD=l("tr"),AC=l("td"),AK=l("th"),AJ=l("th"),AI=l("th");
				AH.className="wowhead-tooltip";
				AK.style.backgroundPosition="top right";
				AJ.style.backgroundPosition="bottom left";
				AI.style.backgroundPosition="bottom right";
				M(AG,AC);
				M(AG,AK);
				M(AE,AG);
				M(AD,AJ);
				M(AD,AI);
				M(AE,AD);
				M(AL,AE);
				b=l("p");
				b.style.display="none";
				M(b,l("div"));
				M(AH,b);
				M(AH,AL);
				M(document.body,AH);
				p=AH;
				U=AL;
				C=AC;
				if(X.showlogo){
					var AF=l("div");
					AF.className="wowhead-tooltip-powered";
					M(AH,AF)
				}
				S()
			}
		}
		
		function AB(AC,AD){
			
			if(!p){G()}
			if(!AC){
				AC=Q[H][2]+" not found :(";
				AD="Temp"
			}
			
			if(F&&AD){
				textx="url(http://static.wowhead.com/images/icons/medium/"+AD.toLowerCase()+".jpg)";
				b.style.backgroundImage=textx;
				b.style.display=""
			}else{
				b.style.backgroundImage="none";
				b.style.display="none"
			}
			
			p.style.display="";
			p.style.width="320px";
			C.innerHTML=AC;
			y();
			Z();
			
			p.style.visibility="visible"
		}
		
		function S(){
			if(!p){return }
			p.style.display="none";
			p.style.visibility="hidden"
		}
		
		function y(){
			var AD=C.childNodes;
			if(AD.length>=2&&AD[0].nodeName=="TABLE"&&AD[1].nodeName=="TABLE"){
				var AC;
				if(AD[1].offsetWidth>300){
					AC=Math.max(300,AD[0].offsetWidth)+20
				}else{
					AC=Math.max(AD[0].offsetWidth,AD[1].offsetWidth)+20
				}
				
				if(AC>20){
					p.style.width=AC+"px";
					AD[0].style.width=AD[1].style.width="100%"
				}
			} else{
				p.style.width=U.offsetWidth+"px"
			}
		}
		
		function Z(){
			if(!p){return }
			if(o==null){return }
			var AL=s(),AM=Y(),AI=AL.w,AF=AL.h,AH=AM.x,AE=AM.y,AG=U.offsetWidth,AC=U.offsetHeight,AD=o+O,AK=m-AC-g;
			if(AD+O+AG+4>=AH+AI){
				var AJ=o-AG-O;
				if(AJ>=0){AD=AJ}
				else{AD=AH+AI-AG-O-4}
			}
			
			if(AK<AE){
				AK=m+g;
				if(AK+AC>AE+AF){
					AK=AE+AF-AC;
					if(F){
						if(o>=AD-48&&o<=AD&&m>=AK-4&&m<=AK+48){
							AK-=48-(m-AK)
						}
					}
				}
			}
			
			p.style.left=AD+"px";
			p.style.top=AK+"px"
		}
		
		function v(AD,AE){
			var AC=Q[AD][0];
			if(AC[AE]==null){
				AC[AE]={}
			}
			
			if(AC[AE].status==null){
				AC[AE].status=t}
			}
		
		function f(AD,AE){
			H=AD;q=AE;v(AD,AE);
			var AC=Q[AD][0];
			if(AC[AE].status==u||AC[AE].status==j){
				AB(AC[AE].tooltip_enus,AC[AE].icon)
			}else{
				if(AC[AE].status==L){
					AB(d.loading)
				}else{E(AD,AE)}}
			}
			
			function E(AE,AF,AD){
				var AC=Q[AE][0];
				if(AC[AF].status!=t&&AC[AF].status!=J){return }
				AC[AF].status=L;
				if(!AD){
					AC[AF].timer=setTimeout(function(){K.apply(this,[AE,AF])},333)
				}
				
				A("http://www.wowhead.com/?"+Q[AE][1]+"="+AF+"&power&lol")
			}
			
			function A(AC){
				M(P,l("script",{type:"text/javascript",src:AC}))
			}
			
			function K(AD,AE){
				if(H==AD&&q==AE){
					AB(d.loading);
					var AC=Q[AD][0];
					AC[AE].timer=setTimeout(function(){n.apply(this,[AD,AE])},3850)
				}
			}
			
			function n(AD,AE){
				var AC=Q[AD][0];
				AC[AE].status=J;
				if(H==AD&&q==AE){
					AB(d.noresponse)
				}
			}
			
			this.register=function(AF,AG,AD,AE){
				var AC=Q[AF][0];
				clearTimeout(AC[AG].timer);
				x(AC[AG],AE);
				if(AC[AG].tooltip_enus){
					AC[AG].status=u
				}else{
					AC[AG].status=j
				}
				if(H==AF&&AG==q){
					AB(AC[AG].tooltip_enus,AC[AG].icon)
				}
			};
			
			this.registerItem=function(AE,AC,AD){
				this.register(e,AE,AC,AD)
			};
			
			this.registerQuest=function(AE,AC,AD){
				this.register(i,AE,AC,AD)
			};
			
			this.registerSpell=function(AE,AC,AD){
				this.register(V,AE,AC,AD)
			};
			
			this.set=function(AC){x(X,AC)};
			this.showTooltip=function(AE,AD,AC){N(AE);AB(AD,AC)};
			this.hideTooltip=function(){S()};
			this.moveTooltip=function(AC){B(AC)};
			z()
		}
	};