
if(!Curse)
{var Curse={};}
Curse.Browser={ie:navigator.appName.indexOf("Microsoft")!=-1,ie7:this.ie&&navigator.appVersion.indexOf("MSIE 7")!=-1,ie6:this.ie&&navigator.appVersion.indexOf("MSIE 6")!=-1,opera:!!window.opera,safari:navigator.userAgent.indexOf("Safari")!=-1,gecko:navigator.userAgent.indexOf("Gecko")!=-1&&navigator.userAgent.indexOf("KHTML")==-1};Curse.Client={viewportWidth:function(){return self.innerWidth||(document.documentElement.clientWidth||document.body.clientWidth);},viewportHeight:function(){return self.innerHeight||(document.documentElement.clientHeight||document.body.clientHeight);},viewportSize:function(){return{width:this.viewportWidth(),height:this.viewportHeight()};},scrollTop:function()
{if(self.pageYOffset)
{return self.pageYOffset;}
else if(document.documentElement&&!document.documentElement.scrollTop)
{return 0;}
else if(document.documentElement&&document.documentElement.scrollTop)
{return document.documentElement.scrollTop;}
else if(document.body&&document.body.scrollTop)
{return document.body.scrollTop;}}};function cg_args(a){var r=[];for(var i=0,len=a.length;i<len;++i){r.push(a[i]);}
return r;}
if(!Array.indexOf){Array.prototype.indexOf=function(obj){for(var i=0;i<this.length;i++){if(this[i]==obj){return i;}}}}
if(!Curse.Browser.ie)
{HTMLElement.prototype.contains=function(oEl){if(oEl==this)return true;if(oEl==null)return false;try{return this.contains(oEl.parentNode)}
catch(err){}};}
Function.prototype.bindAsEventListener=function(object){var __method=this;return function(event){return __method.call(object,event||window.event);}}
Function.prototype.bind=function()
{var ref=this;var args=cg_args(arguments);var object=args.shift();return function()
{return ref.apply(object,args.concat(cg_args(arguments)));};};function cg_iterateArray(arr,func,ud)
{var res;for(var i=0,len=arr.length;i<len;++i)
{res=func(arr[i],ud,arr,i);if(res!=null)
{arr[i]=res;}}}
function cg_inArray(a,r,f,s){if(a==null){return-1;}
if(f){return cg_inArrayF(a,r,f);}
for(var i=s||0,len=a.length;i<len;++i){if(a[i]==r){return i;}}
return-1;}
function cg_inArrayF(a,r,f,s){for(var i=s||0,len=a.length;i<len;++i){if(f(a[i])==r){return i;}}
return-1;}
function cg_strcmp(a,b){if(a==b){return 0;}
if(a==null){return-1;}
if(b==null){return 1;}
return a<b?-1:1;}
function cg_cOr(a,b){for(var p in b){if(typeof b[p]=="object"){if(!a[p]){a[p]={};}
cg_cOr(a[p],b[p]);}
else
{a[p]=b[p];}}}
function cg_ce(a,b){var r=document.createElement(a);if(b)
{cg_cOr(r,b);}
return r;}
function cg_ae(a,b){return a.appendChild(b);}
function cg_ge(a)
{return document.getElementById(a);}
function cg_de(a)
{if(a)
{a.parentNode.removeChild(a);}}
function cg_ia(parent,node,referenceNode){parent.insertBefore(node,referenceNode.nextSibling);}
function cg_gebt(a,b){return a.getElementsByTagName(b);}
function cg_ct(a){return document.createTextNode(a);}
function cg_rf()
{return false;}
function cg_df(){this.blur();}
function cg_ds(a){a.onmousedown=cg_rf;a.onselectstart=cg_rf;if(Curse.Browser.ie){a.onfocus=cg_df;}}
function cg_cO(a,b){for(var p in b){a[p]=b[p];}}
function cg_getShadowText(text,className)
{var shadowText=cg_ce("span");for(var i=-1;i<=1;++i)
{for(var j=-1;j<=1;++j)
{var d=cg_ce("div");d.style.position="absolute";d.style.whiteSpace="nowrap";d.style.left=i+"px";d.style.top=j+"px";if(i==0&&j==0)
{d.style.zIndex=4;}
else
{d.style.color="black";d.style.zIndex=2;}
cg_ae(d,cg_ct(text));cg_ae(shadowText,d);}}
shadowText.style.position="relative";shadowText.className="glow"+(className!=null?" "+className:"");var s=cg_ce("span");s.style.visibility="hidden";cg_ae(s,cg_ct(text));cg_ae(shadowText,s);return shadowText;}
function cg_getLookupsFromCookie(name,delim1,delim2)
{var lookupList=[];var cookieList=cg_getCookie("Login."+name);cookieList=cg_utf8Decode(cookieList);if(!delim1)
{delim1=",";}
if(!delim2)
{delim2="^";}
if(cookieList)
{cookieList=cookieList.split(delim1);for(var i=0;i<cookieList.length;i++)
{lookupList.push(cookieList[i].split(delim2));}}
return lookupList;}
function cg_getLookupSelectBox(lookupName,selectName,container,hideEmpty,onchange,fromCookie,delim1,delim2,emptyLabel)
{if(fromCookie)
{var lookupList=cg_getLookupsFromCookie(lookupName,delim1,delim2);}
else
{var lookupList=Curse.Lookup[lookupName]}
var objSelect=document.createElement("select");if(selectName)
{objSelect.name=selectName;objSelect.id="fi_"+selectName;}
if(onchange)
{objSelect.onchange=function(){eval(onchange);};}
if(!hideEmpty)
{var objOption=document.createElement("option");if(!emptyLabel)
{emptyLabel="";}
objOption.text=emptyLabel;objOption.value="";objSelect.options.add(objOption)}
if(!fromCookie)
{for(var p in lookupList)
{if(typeof p=='string'&&p!="indexOf")
{var objOption=document.createElement("option");objOption.text=lookupList[p].replace("<br>"," - ");objOption.value=p;objSelect.options.add(objOption)}}}
else
{for(var i=0;i<lookupList.length;i++)
{var objOption=document.createElement("option");objOption.text=lookupList[i][1].replace("<br>"," - ");objOption.value=lookupList[i][0];objSelect.options.add(objOption)}}
if(container)
{container.appendChild(objSelect);return objSelect}
else
{return objSelect;}}
function cg_scrollTo(element,padding)
{var pos=cg_getPosition(element)
scrollTo(0,pos.y-padding);}
function cg_scrollTop()
{if(self.pageYOffset)
{return self.pageYOffset;}
else if(document.documentElement&&!document.documentElement.scrollTop)
{return 0;}
else if(document.documentElement&&document.documentElement.scrollTop)
{return document.documentElement.scrollTop;}
else if(document.body&&document.body.scrollTop)
{return document.body.scrollTop;}}
function cg_addEventListener(eventSource,eventName,eventHandler)
{if(eventSource.addEventListener){eventSource.addEventListener(eventName,eventHandler,false);}
else if(eventSource.attachEvent){eventName="on"+eventName;eventSource.attachEvent(eventName,eventHandler);}}
function cg_removeEventListener(eventSource,eventName,eventHandler)
{if(eventSource.addEventListener){eventSource.removeEventListener(eventName,eventHandler,false);}
else if(eventSource.detachEvent)
{eventSource.detachEvent("on"+eventName);}}
function cg_hasClass(pElem,pClassName)
{if(!pElem.className)
{return;}
if(pElem.className==pClassName)
{return true;}
if(pElem.className.split(" ").indexOf(pClassName)>=0)
{return true;}
return false;}
function cg_removeClass(pElem,pClassName)
{if(!pElem.className)
{return;}
var classArray=pElem.className.split(" ");for(var i=0;i<classArray.length;i++)
{if(classArray[i]==pClassName)
{classArray.splice(i,1);break;}}
pElem.className=classArray.join(" ");}
function cg_addClass(pElem,pClassName)
{var classArray=pElem.className.split(" ");for(var i=0;i<classArray.length;i++)
{if(classArray[i]==pClassName)
{return;}}
classArray.push(pClassName);pElem.className=classArray.join(" ");}
function cg_isArray(obj){if(obj.constructor.toString().toLowerCase().indexOf("function")==-1&&obj.constructor.toString().toLowerCase().indexOf("array")==-1)
{return false;}
else
{if(!obj.length)
{return false;}
return true;}}
function cg_getPosition(pElem)
{var left=0;var top=0;while(pElem.offsetParent){left+=pElem.offsetLeft;if(pElem.clientLeft)
{left+=pElem.clientLeft;}
top+=pElem.offsetTop;if(pElem.clientTop)
{top+=pElem.clientTop;}
pElem=pElem.offsetParent;}
left+=pElem.offsetLeft;top+=pElem.offsetTop;return{x:left,y:top};}
function cg_getScroll(){var x=0,y=0;if(typeof(window.pageYOffset)=="number")
{x=window.pageXOffset;y=window.pageYOffset;}
else
{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){x=document.body.scrollLeft;y=document.body.scrollTop;}
else
{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop))
{x=document.documentElement.scrollLeft;y=document.documentElement.scrollTop;}}}
return{x:x,y:y};}
function cg_setTextNodes(n,b)
{if(a.nodeType==3)
{a.nodeValue=b;}
else
{for(var i=0;i<a.childNodes.length;++i){cg_setTextNodes(a.childNodes[i],b);}}}
function cg_deleteCookie(name,path,domain)
{if(cg_getCookie(name))
{document.cookie=name+"="+((path)?";path="+path:"")+((domain)?";domain="+domain:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT";}}
function cg_setCookie(name,value,exp_y,exp_m,exp_d,path,domain,secure)
{var cookie_string=name+"="+escape(value);var expires=new Date();if(exp_y)
{if(exp_m=null)
{exp_m=1;}
if(exp_d=null)
{exp_m=1;}
expires.setTime(expires.getTime()+(1000*60*60*24*31));}
else
{expires.setDate(expires.getDate()+365);}
cookie_string+="; expires="+expires.toGMTString();if(path)
cookie_string+="; path="+escape(path);if(domain)
cookie_string+="; domain="+escape(domain);if(secure)
cookie_string+="; secure";document.cookie=cookie_string;}
function cg_getCookie(cookie_name)
{var results=document.cookie.match(cookie_name+'=(.*?)(;|$)');if(results)
return(unescape(results[1]));else
return null;}
function cg_getElementsByClassName(sClassName,sTag,oContainer,returnFirst){var searchObj;var results=new Array();if(!oContainer){oContainer=document;}
if(sTag=="*"||!sTag){if(document.all){searchObj=oContainer.all;}
else{searchObj=oContainer.getElementsByTagName("*");}}
else
{searchObj=oContainer.getElementsByTagName(sTag);}
for(var i=0,el;((searchObj.all&&!neo.bw.isIE6up)?el=searchObj(i):el=searchObj.item(i));i++){if(el.className==sClassName){if(returnFirst)
{return el;}
results.push(el);}}
return results;}
function cg_getQueryStringParam(param){var begin,end;if(self.location.search.length>1)
{begin=self.location.search.indexOf(param)
if(begin==-1)
{return"";}
begin=begin+param.length+1;end=self.location.search.indexOf("&",begin);if(end==(-1))end=self.location.search.length;return(self.location.search.substring(begin,end));}
else if(self.location.hash.length>1)
{begin=self.location.hash.indexOf(param)+param.length+1;end=self.location.hash.indexOf("&",begin);if(end==(-1))end=self.location.hash.length;return(self.location.hash.substring(begin,end));}
else return("");}
function cg_getEvent(e){if(!Curse.Browser.ie&&!e)
{return null;}
if(!e)
{e=window.event;if(!e)
{return null;}}
e._button=e.which?e.which:e.button;e._target=e.target?e.target:e.srcElement;e._relatedTarget=e.relatedTarget?e.relatedTarget:e.toElement;return e;}
function cg_getEventTarget(e){e=cg_getEvent(e);if(!e)
{return null;}
return e._target;}
function cg_formatNumber(num)
{num=""+parseInt(num);if(num.length<=3)
{return num;}
return cg_formatNumber(num.substr(0,num.length-3))+","+num.substr(num.length-3);}
function cg_getTextValue(a)
{if(Curse.Browser.ie)
{return a.innerText;}
else
{return a.textContent;}}
function cg_toggleDisplay(a)
{if(a.style.display=="none")
{a.style.display="";return true;}
else
{a.style.display="none";return false;}}
function cg_cancelBubbling(e)
{if(Curse.Browser.ie)
{e=window.event;e.cancelBubble=true;}
else
{e=cg_getEvent(e);if(!e)
{return;}
e.stopPropagation();}}
var cg_localTime;function cg_refreshDate()
{cg_localTime=new Date().getTime();}
cg_refreshDate();function cg_mod(divisee,base)
{return Math.round(divisee-(Math.floor(divisee/base)*base));}
function cg_getLocalDateFromTime(time)
{return time;}
function cg_getShortFriendlyTime(epoch)
{localDate=new Date(epoch);function getPlural(value,ifSingular,ifPlural)
{if(value==1)
{return ifSingular;}
return ifPlural;}
var shortFriendlyTime;var timeDifferenceMinutes=parseInt((cg_localTime-localDate.getTime())/1000/60);var timeDifferenceHours=parseInt(timeDifferenceMinutes/60);if(timeDifferenceMinutes<=1)
{return Localization.time_last_minute;}
if(timeDifferenceHours<1)
{return Localization.replace("time_minute",timeDifferenceMinutes);}
if(timeDifferenceHours<24)
{var extraMins=cg_mod(timeDifferenceMinutes,60);shortFriendlyTime=parseInt(timeDifferenceHours,null)+" hr";if(extraMins>0)
{return Localization.replace("time_hour_minute",timeDifferenceHours,extraMins);}
else
{return Localization.replace("time_hour",timeDifferenceHours);}}
var timeDifferenceDays=parseInt(timeDifferenceHours/24);if(timeDifferenceDays<7)
{var extraHours=cg_mod(timeDifferenceHours,24);if(timeDifferenceDays>1)
{return Localization.replace("time_days_hour",timeDifferenceDays,extraHours);}
else
{return Localization.replace("time_day_hour",timeDifferenceDays,extraHours);}}
// time variables including minutes and seconds that I want removed
return Localization.replace("time_full",localDate.getDate(),localDate.getMonth()+1,localDate.getFullYear(),localDate.toLocaleTimeString());}
function cg_trim(a)
{return a.replace(/^\s+/,'').replace(/\s+$/,'');}
function cg_addOrReplace(a,b,c)
{if(b)
{cg_de(b);}
cg_ae(a,c);}
function cg_dbg(text)
{if(!cg_ge("debugPanel"))
{return;}
if(cg_ge("debugPanel").style.display=="none")
{return;}
cg_ge("debugPanel").appendChild(document.createElement("br"));cg_ge("debugPanel").appendChild(document.createTextNode(text));}
function cg_getRelativeLocation(ignoreEscape)
{var relativeLocation=self.location.href;var arrRelativeLocation=relativeLocation.split("index.html");relativeLocation=arrRelativeLocation[arrRelativeLocation.length-1];if(!ignoreEscape)
{relativeLocation=escape(relativeLocation);}
return relativeLocation;}
function cg_isDefined(object,variable)
{return(typeof(eval(object)[variable])!="undefined");}

if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var cg_reverseAlphaArray=["z","y","x","w","v","u","t"];function cg_navToLogin()
{var relativeLocation=cg_getRelativeLocation();if(relativeLocation.toLowerCase().indexOf("login.aspx")>=0)
{self.location="login.html";}
else
{self.location="login.aspx?referrer="+relativeLocation;}}
function cg_centerElement(oElement)
{var viewportHeight=Curse.Client.viewportHeight();var viewportWidth=Curse.Client.viewportWidth();var newTop=(viewportHeight/2)-(oElement.offsetHeight/2);var newLeft=(viewportWidth/2)-(oElement.offsetWidth/2);oElement.style.top=(newTop+cg_scrollTop())+"px";oElement.style.left=newLeft+"px";}
function cg_getFormAsString(formObject){returnString=formObject.action;formElements=formObject.elements;for(var i=formElements.length-1;i>=0;--i){if(i==formElements.length-1)
{returnString=returnString+"?";}
else
{returnString=returnString+"&";}
returnString=returnString+encodeURI(formElements[i].name)+"="+encodeURIComponent(formElements[i].value.replace(/</g,"&lt;").replace(/>/g,"&gt;"));}
return returnString;}
function cg_getViewState(index)
{var currentHashArray=self.location.hash.substring(1).split(":");if(currentHashArray.length<index+1)
{return null;}
return currentHashArray[index];}
function cg_replace()
{var args=cg_replace.arguments;var str=args[0];for(i=1;i<args.length;i++)
{str=str.replace(eval("/\\%"+i+"/g"),args[i]);}
return str;}
function cg_getStyle(elem,cssRule){var value="";if(document.defaultView&&document.defaultView.getComputedStyle){value=document.defaultView.getComputedStyle(elem,"").getPropertyValue(cssRule);}
else if(elem.currentStyle){cssRule=cssRule.replace(/\-(\w)/g,function(match,p1){return p1.toUpperCase();});value=elem.currentStyle[cssRule];}
return value;}
function cg_endsWith(str,s){var reg=new RegExp(s+"$");return reg.test(str);}
function cg_utf8Decode(utftext)
{var string="";var i=0;var c=c1=c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++;}
else if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}
else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}
return string;}
Curse.Session=function(onLogin)
{this.onLogin=onLogin;}
Curse.Session.prototype={initialize:function()
{if(cg_cookiesDisabled())
{return;}
var sessionTimeout=1000*60*10;setTimeout(this.reset,sessionTimeout);var sessionid=cg_getCookie("networkcookie");var loginInitialized=cg_getCookie("Login.Initialized");if(sessionid!=null&&loginInitialized!=null)
{this.onLogin(true);return;}
var iframe=document.createElement("IFRAME");iframe.src="http://www.toysdorado.com/NetworkService.asmx/shareSession?from=http%3a%2f%2fwww.toysdorado.com%2fajaxSession.aspx";iframe.style.display="none";document.body.appendChild(iframe);},reset:function()
{cg_deleteCookie("Login.Initialized");},handleLogin:function(status)
{this.onLogin(status);}}
Curse.Page={initialize:function(args)
{cg_cO(Curse.Page,args);}}
Curse.Screenshot={screenIndex:0,initializeForm:function()
{document.forms.screenshotForm.entity_id.value=Curse.Page.entityID;document.forms.screenshotForm.entity_type_id.value=Curse.Page.entityTypeID;document.forms.screenshotForm.viewport_height.value=Curse.Client.viewportHeight();document.forms.screenshotForm.viewport_width.value=Curse.Client.viewportWidth();},validatePost:function()
{var screenshotFile=cg_ge("inputScreenshotFile").value.toLowerCase();if(screenshotFile=="")
{Curse.Alert.show(Localization.select_valid_screenshot,Localization.submit_a_screenshot);return false;}
if(!cg_endsWith(screenshotFile,".jpg")&&!cg_endsWith(screenshotFile,".png"))
{Curse.Alert.show(Localization.unsupported_screenshot,Localization.submit_a_screenshot);return false;}
return true;},buildTable:function(startingIndex)
{Curse.Screenshot.screenIndex=startingIndex;var topTable=document.getElementById("tableScreenshotInfoTop");var bottomTable=document.getElementById("tableScreenshotInfoBottom");var row2=topTable.insertRow(topTable.rows.length);var lcell=row2.insertCell(row2.cells.length);lcell.align="left";var lAnchor=document.createElement("A");cg_ds(lAnchor);lAnchor.id="screenshotBackCell";lAnchor.className="btnPaging btnPrev";lAnchor.onclick=function(){Curse.Screenshot.screenIndex--;Curse.Screenshot.setCurrentImage()};var lAnchorLabel=document.createTextNode("Previous Screenshot");lAnchor.appendChild(lAnchorLabel);if(cg_screenshots.length>1)
{lcell.appendChild(lAnchor);}
var ccell=row2.insertCell(row2.cells.length);ccell.align="center";ccell.id="screenshotIndexCell";var rcell=row2.insertCell(row2.cells.length);rcell.align="right";var rAnchor=document.createElement("A");cg_ds(rAnchor);rAnchor.id="screenshotForwardCell";rAnchor.className="btnPaging btnNext";rAnchor.onclick=function(){Curse.Screenshot.screenIndex++;Curse.Screenshot.setCurrentImage()};var rAnchorLabel=document.createTextNode(Localization.next_screenshot);rAnchor.appendChild(rAnchorLabel);if(cg_screenshots.length>1)
{rcell.appendChild(rAnchor);}
var brow=bottomTable.insertRow(bottomTable.rows.length);var bcell=brow.insertCell(brow.cells.length);bcell.align="center";bcell.id="userCell";var brow2=bottomTable.insertRow(bottomTable.rows.length);var bcell2=brow2.insertCell(brow2.cells.length);bcell2.align="center";bcell2.id="origLinkContainer";var olink=document.createElement('a');olink.innerHTML=Localization.view_original_image;olink.id="origLink";bcell2.appendChild(olink);if((cg_getViewState(0)!="")&&(cg_getViewState(0)!=null))
Curse.Screenshot.screenIndex=Curse.Screenshot.findImageId(cg_getViewState(0));Curse.Screenshot.setCurrentImage();},findImageId:function(id)
{for(var i=0;i<cg_screenshots.length;i++)
{if(cg_screenshots[i].id==id)
return i;}
return 0;},updateViewstate:function(screenshotID)
{location.replace(""+screenshotID);},setCurrentImage:function()
{if(Curse.Screenshot.screenIndex==-1)
Curse.Screenshot.screenIndex=cg_screenshots.length-1;if(Curse.Screenshot.screenIndex==cg_screenshots.length)
Curse.Screenshot.screenIndex=0;var screen=cg_screenshots[Curse.Screenshot.screenIndex];Curse.Screenshot.updateViewstate(screen.id);cg_ge("userCell").innerHTML="<div class=\"ss-caption\">"+screen.caption+"</div><div class=\"ss-from\">"+Localization.posted_by+" <a href=\"user.aspx?id="+screen.userid+"\">"+screen.user+"</a> "+cg_getShortFriendlyTime(screen.date)+"</div>";cg_ge("screenshotIndexCell").innerHTML="<b>"+(Curse.Screenshot.screenIndex+1)+"</b> of <b>"+cg_screenshots.length+"</b>";var next=(Curse.Screenshot.screenIndex+1)+1;if(Curse.Screenshot.screenIndex==cg_screenshots.length-1)
next=1;var prev=Curse.Screenshot.screenIndex;if(Curse.Screenshot.screenIndex==0)
prev=cg_screenshots.length;if(cg_screenshots.length>1)
{cg_ge("screenshotForwardCell").innerHTML=Localization.next_screenshot+" ("+next+" of "+cg_screenshots.length+")";cg_ge("screenshotBackCell").innerHTML=Localization.previous_screen+" ("+prev+" of "+cg_screenshots.length+")";}
cg_ge("origLinkContainer").innerHTML="<button class=\"smallButton\" onclick=\"self.location='screenshots/"+screen.id+".jpg';\"><span>"+Localization.view_original_image+"</span></button>&nbsp;&nbsp;<small>"+Localization.size_colon+" "+screen.width+" X "+screen.height+"</small>";var maxwidth=800.0;var maxheight=600.0;if(screen.width>maxwidth)
{var ratio=screen.width/maxwidth;var nheight=screen.height/ratio;cg_ge("screenImage").width=maxwidth;cg_ge("screenImage").height=nheight;}
else if(screen.height>maxheight)
{var ratio=screen.height/maxheight;var nwidth=screen.width/ratio;cg_ge("screenImage").width=nwidth;cg_ge("screenImage").height=maxheight;}
cg_ge("screenImage").src="screenshots/"+screen.id+".jpg";cg_ge("screenImage").onclick=function(){self.location="screenshots/"+screen.id+".jpg";};},scrollToForm:function()
{cg_contributeTabs.show(1);}}
Curse.Alert={close:function()
{var alert=cg_ge("alert");if(alert){document.body.removeChild(alert);}
var alertOverlay=cg_ge("alert_overlay");if(alertOverlay){document.body.removeChild(alertOverlay);}
cg_removeEventListener(document,"keyup",Curse.Alert.handleKeyPress);},show:function(alertMessage,alertTitle,alertInput,alertButtons,alertOpener,alertTop,alertLeft,showAlertOverlay,alertWidth)
{cg_addEventListener(document,"keyup",Curse.Alert.handleKeyPress);var oAlert=cg_ge("alert");if(oAlert)
{document.body.removeChild(oAlert);}
var alertOverlay=cg_ge("alert_overlay");if(alertOverlay)
{document.body.removeChild(alertOverlay);}
if(showAlertOverlay)
{var alertOverlayDiv=document.createElement("DIV");alertOverlayDiv.innerHTML="&nbsp;";alertOverlayDiv.id="alert_overlay";document.body.appendChild(alertOverlayDiv);}
var alertDiv=document.createElement("DIV");alertDiv.className="content-panel alert";alertDiv.id="alert";alertDiv.style.visibility="hidden";if(alertWidth)
{alertDiv.style.width=alertWidth+"px";}
if(alertTitle==null)
{alertTitle=Localization.system_message;}
var alertContainerHTML="<div class=\"content-panel-bg\"></div><div class=\"content-panel-r\"></div><div class=\"content-panel-b\"></div><div class=\"content-panel-br\"></div><div class=\"content-panel-t\"></div><div class=\"content-panel-tr\"></div><div class=\"content-panel-wrapper\">";var alertHTML=alertContainerHTML+"<h2>"+alertTitle+"</h2><div>"+alertMessage+"</div>";var primaryButtonCallback=null;var secondaryButtonCallback=null;var alertButtonsArray=null;if(alertButtons)
{alertButtonsArray=alertButtons.split("|");primaryButtonCallback=alertButtonsArray[0].split("^")[0];secondaryButtonCallback=alertButtonsArray[1].split("^")[0];}
if(alertInput)
{alertInputArray=alertInput.split("|");alertHTML+="<div>&nbsp;</div><form onsubmit=\"return false;\">";alertHTML+="<table>";for(var i=0;i<alertInputArray.length;i++)
{alertHTML+="<tr>";var currentInput=alertInputArray[i].split("^");var defaultValue="";var lookupName="";var lookupFromCookie=true;var maxLengthHTML="";var sizeHTML="";var inputLabel=currentInput[0];var inputDescription="";var scriptActions="";var inputStyle="";if(inputLabel.indexOf(Localization.colon)==-1)
{inputLabel+=Localization.colon;}
if(currentInput.length>=3)
{defaultValue=currentInput[2];}
if(currentInput.length>=4)
{lookupName=currentInput[3];if(lookupName.indexOf("l:")==0)
{lookupName=lookupName.substring(2);lookupFromCookie=false;}}
if(currentInput.length>=5&&currentInput[4]!="")
{sizeHTML="  size='"+currentInput[4]+"'";}
if(currentInput.length>=6&&currentInput[5]!="")
{maxLengthHTML=" maxlength="+currentInput[5];}
if(currentInput.length>=7)
{inputDescription="<div class=desc>"+currentInput[6]+"</div>";}
if(currentInput.length>=8)
{scriptActions=currentInput[7];}
if(currentInput.length>=9)
{inputStyle=currentInput[8];}
alertHTML+="<td class=\"label\">"+inputLabel+"</td>";alertHTML+="<td class=\"alertInput\">";if(lookupName!="")
{var lookupSelect=cg_getLookupSelectBox(lookupName,"",null,false,null,lookupFromCookie);alertHTML+="<select id=\""+currentInput[1]+"\" name=\""+currentInput[1]+"\">"+lookupSelect.innerHTML+"</select>";}
else
{alertHTML+="<input id=\""+currentInput[1]+"\" name=\""+currentInput[1]+"\" onKeyPress=\"if((event.keyCode==10)||(event.keyCode==13)) "+primaryButtonCallback+"; if (event.keyCode==27) "+secondaryButtonCallback+";\" type=\"text\" value=\""+defaultValue+"\""+maxLengthHTML+sizeHTML+scriptActions+inputStyle+"/>"+inputDescription;}
alertHTML+="</td>";alertHTML+="</tr>";}
alertHTML+="</table>";alertHTML+="</form>";}
alertHTML+="<div class=\"buttons\">";if(alertButtonsArray)
{for(var i=0;i<alertButtonsArray.length;i++)
{var currentButton=alertButtonsArray[i].split("^");alertHTML+="&nbsp;<button class=\"smallButton\" onclick=\""+currentButton[0]+"\"><span>"+currentButton[1]+"</span></button>";}}
else{alertHTML+="<button class=\"smallButton\" onclick=\"Curse.Alert.close();\"><span>Close</span></button>";}
alertHTML+="</div>";alertHTML+="</div>";alertDiv.innerHTML=alertHTML;document.body.appendChild(alertDiv);if(!alertTop)
{cg_centerElement(alertDiv);}
else
{alertDiv.style.top=alertTop+"px";alertDiv.style.left=alertLeft+"px";}
alertDiv.style.visibility="visible";if(alertInput)
{alertDiv.getElementsByTagName("input")[0].focus();}},handleKeyPress:function(e)
{var e=cg_getEvent(e);if(e.keyCode==27)
{Curse.Alert.close();}
return;}}
if(!Curse)
{Curse={};}
Curse.Ajax={http:false,format:'text',callback:function(data){},handler:false,error:false,opt:new Object(),getHTTPObject:function(){var http=false;if(typeof ActiveXObject!='undefined'){try{http=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{http=new ActiveXObject("Microsoft.XMLHTTP");}
catch(E){http=false;}}}else if(XMLHttpRequest){try{http=new XMLHttpRequest();}
catch(e){http=false;}}
return http;},load:function(url,callback,format,method,allowCache,queueFunction,queueFunctionArgs){this.init();if(!this.http||!url)return;if(this.http.overrideMimeType)this.http.overrideMimeType('text/xml');this.callback=callback;this.queueFunction=queueFunction;this.queueFunctionArgs=queueFunctionArgs;if(!method)var method="GET";if(!format)var format="text";this.format=format.toLowerCase();method=method.toUpperCase();var ths=this;if(!allowCache)
{var now="uid="+new Date().getTime();url+=(url.indexOf("?")+1)?"&":"?";url+=now;}
var parameters=null;if(method=="POST"){var parts=url.split("\?");url=parts[0];parameters=parts[1];}
this.http.open(method,url,true);if(method=="POST"){this.http.setRequestHeader("Content-type","application/x-www-form-urlencoded");this.http.setRequestHeader("Content-length",parameters.length);if(!Curse.Browser.ie)
{this.http.setRequestHeader("Connection","close");}}
if(this.handler)
{this.http.onreadystatechange=this.handler;}
else{this.http.onreadystatechange=function()
{if(!ths)return;var http=ths.http;if(http.readyState==4){if(http.status==200){var result="";if(http.responseText)result=http.responseText;if(ths.format.charAt(0)=="j")
{result=result.replace(/[\n\r]/g,"");result=eval('('+result+')');}
else if(ths.format.charAt(0)=="x"){result=http.responseXML;}
if(ths.queueFunction)
{ths.queueFunction(result,ths.callback,ths.queueFunctionArgs);}
else if(ths.callback)
{ths.callback(result)}}
else{if(ths.opt.loadingIndicator)document.getElementsByTagName("body")[0].removeChild(ths.opt.loadingIndicator);if(ths.opt.loading)document.getElementById(ths.opt.loading).style.display="none";if(ths.error)ths.error(http.status);}}}}
this.http.send(parameters);},bind:function(user_options){var opt={'url':'','onSuccess':false,'onError':false,'format':"text",'method':"GET",'update':"",'loading':"",'loadingIndicator':""}
for(var key in opt){if(user_options[key]){opt[key]=user_options[key];}}
this.opt=opt;if(!opt.url)return;if(opt.onError)this.error=opt.onError;var div=false;if(opt.loadingIndicator){div=document.createElement("div");div.setAttribute("style","position:absolute;top:0px;left:0px;");div.setAttribute("class","loading-indicator");div.innerHTML=opt.loadingIndicator;document.getElementsByTagName("body")[0].appendChild(div);this.opt.loadingIndicator=div;}
if(opt.loading)document.getElementById(opt.loading).style.display="block";this.load(opt.url,function(data){if(opt.onSuccess)opt.onSuccess(data);if(opt.update)document.getElementById(opt.update).innerHTML=data;if(div)document.getElementsByTagName("body")[0].removeChild(div);if(opt.loading)document.getElementById(opt.loading).style.display="none";},opt.format,opt.method);},init:function(){this.http=this.getHTTPObject();}};var cg_ajaxQueue=[];var cg_ajaxProcessing=false;function cg_queueAjaxRequest(url,callbackFunction,format,method,callbackArgs,allowCache)
{if(!isNewRequest())
{return;}
var ajaxRequest={};ajaxRequest.url=url;ajaxRequest.callback=callbackFunction;ajaxRequest.callbackArgs=callbackArgs;ajaxRequest.format=format;ajaxRequest.method=method;ajaxRequest.allowCache=allowCache;cg_ajaxQueue.push(ajaxRequest);cg_processAjaxQueue();function isNewRequest()
{if(cg_ajaxQueue.length==0)
{return true;}
for(var i=0,len=cg_ajaxQueue.length;i<len;i++)
{if(cg_ajaxQueue[i].url==url)
{return false;}}
return true;}}
function cg_completeAjaxQueue(data,callback,callbackArgs)
{cg_ajaxProcessing=false;callback(data,callbackArgs);cg_processAjaxQueue();}
function cg_processAjaxQueue()
{if(cg_ajaxProcessing||cg_ajaxQueue.length==0)
{return;}
cg_ajaxProcessing=true;var ajaxRequest=cg_ajaxQueue[0];cg_ajaxQueue.splice(0,1);Curse.Ajax.load(ajaxRequest.url,ajaxRequest.callback,ajaxRequest.format,ajaxRequest.method,ajaxRequest.allowCache,cg_completeAjaxQueue,ajaxRequest.callbackArgs);}
if(!Curse)
{var Curse={};}
Curse.Mouse={x:0,y:0,initialize:function()
{cg_addEventListener(document,"mousemove",this.update);cg_addEventListener(document,"mouseout",this.update);},update:function(e)
{if(window.event)
{Curse.Mouse.x=window.event.clientX;Curse.Mouse.y=window.event.clientY;Curse.Mouse.y+=cg_scrollTop();}
else
{Curse.Mouse.x=e.pageX;Curse.Mouse.y=e.pageY;}}};Curse.Mouse.initialize();Curse.Menu={setBrowsePath:function(menuArray)
{if(!menuArray)
{return;}
var currentFilterString=cg_getQueryStringParam("filters");if(currentFilterString!="")
{currentFilterString="&filters="+currentFilterString;}
var currentBrowsePath;var span=document.createElement("SPAN");span.className="spanMenuArrow";var anchor=document.createElement("A");anchor.style.textDecoration="none";anchor.style.color="#ffffff";anchor.href="index.html";anchor.innerHTML=Localization.home;span.appendChild(anchor);var container=cg_ge("divBrowsePathLeft")
container.appendChild(span);var currentMenu;currentBrowsePath="";for(var i=0;i<menuArray.length;i++)
{currentMenu=menuArray[i];span=document.createElement("SPAN");anchor=document.createElement("A");anchor.style.cursor="default";if(i<menuArray.length-1)
{span.className="spanMenuArrow";}
if(i>0)
{currentBrowsePath+="."+currentMenu[0];}
else
{currentBrowsePath=currentMenu[0]+"";}
anchor.className="spanBrowseMenuLink";if(currentMenu[2]!=null)
{if(currentMenu[2]!="$nonav$")
{anchor.href=currentMenu[2];anchor.style.cursor="pointer";}
currentLink="";}
else
{anchor.href="search.aspx?browse="+currentFilterString;anchor.style.cursor="pointer";}
anchor.innerHTML=currentMenu[1];anchor._baseLink=currentBrowsePath;var arrayKey="mn_"+currentBrowsePath.replace(/\./g,"_").replace(/\-/g,"$");var subMenuArray=null;try
{subMenuArray=eval(arrayKey);}
catch(ex)
{}
if(subMenuArray)
{anchor._subMenuArray=subMenuArray;}
anchor.onmouseover=Curse.Menu.handleMainMenuMouseOver.bind(anchor);anchor.onmouseout=Curse.Menu.handleMainMenuMouseOut.bind(anchor);anchor.onclick=Curse.Menu.closeMainMenu.bind(anchor);anchor._isMainMenu=true;span.appendChild(anchor);container.appendChild(span);}
cg_ge("divMainPrecontents").style.display="block";Curse.Searchfilter.initialize();},addMainMenu:function(containerID,menuArray)
{var container=cg_ge(containerID);if(!container)
{return;}
var currentBrowseCategory=cg_getQueryStringParam("browse").split(".")[0];var currentFilterString=cg_getQueryStringParam("filters");if(currentFilterString!="")
{currentFilterString="&filters="+currentFilterString;}
if(!menuArray)
return;container._menuArray=[];for(var i=0;i<menuArray.length;i++)
{var currentMenu=menuArray[i];var anchor=document.createElement("A");if(i==menuArray.length-1)
{anchor.style.background="none";}
anchor.style.cursor="default";if(currentMenu[2]!=null)
{if(currentMenu[2]!="$nonav$")
{anchor.href=currentMenu[2];anchor.style.cursor="pointer";}}
else
{if(currentFilterString!=""&&currentMenu[0]==currentBrowseCategory)
{anchor.href=""}
else
{anchor.href="";}
anchor.style.cursor="pointer";anchor._baseLink=currentMenu[0];}
anchor.style.textDecoration="none";var span=document.createElement("SPAN");if(currentMenu.length>=4&&currentMenu[3]!=null)
{anchor._subMenuArray=currentMenu[3];}
if(currentMenu.length>=5)
{anchor.className=currentMenu[4];}
span.innerHTML=currentMenu[1];anchor._isMainMenu=true;anchor.onmouseover=Curse.Menu.handleMainMenuMouseOver.bind(anchor);anchor.onmouseout=Curse.Menu.handleMainMenuMouseOut.bind(anchor);anchor.onclick=Curse.Menu.closeMainMenu.bind(anchor);anchor._container=container;cg_ae(anchor,span);container._menuArray.push(anchor);cg_ae(container,anchor);}},handleMainMenuMouseOver:function()
{if(this._timeout)
{window.clearTimeout(this._timeout);}
if(this._subMenu&&this._subMenu.style.display=="block")
{return;}
var layers=cg_ge("layers");var menus=cg_getElementsByClassName("menu","div",layers);for(var i=0;i<menus.length;i++)
{menus[i].style.display="none";}
var viewportHeight=Curse.Client.viewportHeight();if(this._subMenu&&this._subMenuArray)
{if(this._viewportHeight&&this._viewportHeight!=viewportHeight)
{var menuParent=this._subMenu.parentNode;menuParent.removeChild(this._subMenu);this._subMenu=null;}}
if(!this._subMenu&&this._subMenuArray)
{var subMenu=Curse.Menu.addMenu("layers",this._subMenuArray,this,this._baseLink);this._subMenu=subMenu;this._viewportHeight=viewportHeight;}
if(this._subMenu)
{Curse.Menu.positionSubMenu(this);}},closeMainMenu:function()
{Curse.Menu.hideMainMenu.bind(this)();},hideMainMenu:function()
{this._timeout=null;if(this._subMenu)
{Curse.Menu.hideChildren(this);}},handleMainMenuMouseOut:function(e)
{e=cg_getEvent(e);var relatedTarget=e._relatedTarget;if(relatedTarget&&this.contains(relatedTarget))
{return;}
if(relatedTarget&&relatedTarget==this._subMenu)
{return;}
if(relatedTarget&&this._subMenu&&this._subMenu.contains(relatedTarget))
{return;}
this._timeout=setTimeout(Curse.Menu.hideMainMenu.bind(this),400);},addMenu:function(containerID,menuArray,objParentLink,baseID)
{var arrBrowseArray=cg_getQueryStringParam("browse").split(".");var parentCategory=arrBrowseArray[0];var filterString=cg_getQueryStringParam("filters");if(filterString!="")
{filterString="&filters="+filterString;}
var viewportHeight=Curse.Client.viewportHeight();var heightPerMenuItem;var parentMenuItemPosition=cg_getPosition(objParentLink);var newMenu=document.createElement("div");newMenu.onmouseover=Curse.Menu.expand.bind(newMenu);newMenu.onmouseout=Curse.Menu.contract.bind(newMenu);newMenu.onclick=Curse.Menu.handleSubClick.bind(newMenu);newMenu.className="menu";if(objParentLink)
{newMenu._parentLink=objParentLink;newMenu._parentMenu=objParentLink._container;}
if(objParentLink._parentMenu&&objParentLink._parentLink._subMenuArray)
{heightPerMenuItem=Math.ceil(objParentLink.offsetHeight/objParentLink._parentLink._subMenuArray.length);}
heightPerMenuItem=27;var menuContainerHeight;if(objParentLink.className=="spanBrowseMenuLink")
{var parentPosition=cg_getPosition(objParentLink);menuContainerHeight=parentPosition.y+objParentLink.offsetHeight+(heightPerMenuItem*menuArray.length);}
else
{menuContainerHeight=(heightPerMenuItem*menuArray.length);}
var itemsPerContainer;if(menuContainerHeight>viewportHeight)
{menuGroupCount=Math.ceil(menuContainerHeight/viewportHeight);itemsPerContainer=Math.ceil(menuArray.length/menuGroupCount);}
else
{newMenu.appendChild(document.createElement("em"));newMenu.appendChild(document.createElement("var"));newMenu.appendChild(document.createElement("strong"));menuGroupCount=1;itemsPerContainer=menuArray.length;}
var mainTable=document.createElement("table");newMenu.appendChild(mainTable);var tbody;if(mainTable.tBodies&&mainTable.tBodies.length>0)
{tbody=mainTable.tBodies[0];}
else
{tbody=document.createElement("tbody");mainTable.appendChild(tbody);}
var mainRow=tbody.insertRow(tbody.rows.length);for(var k=0;k<menuGroupCount;k++)
{var mainCell=mainRow.insertCell(mainRow.cells.length);var itemsStart;var mainDiv=null;if(menuGroupCount>1)
{var mainParagraph=document.createElement("p");mainCell.appendChild(mainParagraph);mainParagraph.appendChild(document.createElement("em"));mainParagraph.appendChild(document.createElement("var"));mainParagraph.appendChild(document.createElement("strong"));mainDiv=document.createElement("div");mainParagraph.appendChild(mainDiv);itemsStart=k*itemsPerContainer;}
else
{itemsStart=0;mainDiv=document.createElement("div");mainCell.appendChild(mainDiv);}
var secondDiv=document.createElement("div");mainDiv.appendChild(secondDiv);for(var i=0;i<itemsPerContainer;i++)
{var currentMenuIndex;currentMenuIndex=i;if(k>0)
{currentMenuIndex=i+(itemsPerContainer*k);}
if(currentMenuIndex>=menuArray.length)
{break;}
var currentMenu=menuArray[currentMenuIndex];if(currentMenu)
{var currentLink="";var hasChildren=false;if(cg_isArray(currentMenu))
{if(currentMenu.length==4)
{hasChildren=true;}
currentLink=currentMenu[0]+"";}
else
{currentLink=i+"";}
var anchor=document.createElement("a");if(currentMenu[2]!=null)
{if(currentMenu[2]!="$nonav$")
{anchor.href=currentMenu[2].replace(/\$userid\$/,Curse.User.id);;}
currentLink="";}
else
{if(baseID!=null)
{currentLink=currentLink;}
if(filterString!=""&&currentLink.split(".")[0]==parentCategory)
{anchor.href="search.php?xv=1&xsc=="+filterString;}
else
{anchor.href="search.php?xv=1&xsc="+currentLink;}}
anchor._parentElement=newMenu;secondDiv.appendChild(anchor);var mainSpan=document.createElement("span");if(hasChildren)
{mainSpan.className="menusub";}
if(currentMenu.length>=5)
{anchor.className=currentMenu[4];}
anchor.appendChild(mainSpan);var secondSpan=document.createElement("span");if(!cg_isArray(currentMenu))
{secondSpan.innerHTML=currentMenu;}
else
{secondSpan.innerHTML=currentMenu[1];}
if(currentLink!="")
{var arrCurrentLink;arrCurrentLink=currentLink.split(".");var blnMenuChecked=true;for(var j=0;j<arrCurrentLink.length;j++)
{if(arrCurrentLink[j]!=arrBrowseArray[j])
{blnMenuChecked=false;}}
if(blnMenuChecked)
{secondSpan.className="menucheck";}}
anchor._baseLink=currentLink;anchor._container=newMenu;mainSpan.appendChild(secondSpan);if(hasChildren)
{anchor._subMenuArray=currentMenu[3];}
else
{}
anchor.onmouseout=Curse.Menu.contractSub.bind(anchor);}}}
cg_ge(containerID).appendChild(newMenu);return newMenu;},expand:function(e)
{if(this._timeout)
{window.clearTimeout(this._timeout);}
if(this._parentLink._timeout)
{window.clearTimeout(this._parentLink._timeout);}
var a=cg_getEventTarget(e);if(a.tagName!="A"&&a.tagName!="SPAN")
{return;}
while(a.tagName!="A")
{a=a.parentNode;}
var viewportHeight=Curse.Client.viewportHeight();if(a._subMenu&&a._subMenu.style.display=="block")
{return;}
if(a._subMenu&&a._subMenuArray)
{if(a._viewportHeight&&a._viewportHeight!=viewportHeight)
{var menuParent=a._subMenu.parentNode;menuParent.removeChild(this._subMenu);this._subMenu=null;}}
if(!a._subMenu)
{if(a._subMenuArray)
{a._subMenu=Curse.Menu.addMenu("layers",a._subMenuArray,a,a._baseLink);a._viewportHeight=viewportHeight;}}
if(a._subMenu)
{Curse.Menu.positionSubMenu(a);}},positionSubMenu:function(objParentMenu)
{var objSubMenu=objParentMenu._subMenu;var parentMenuItemPosition=cg_getPosition(objParentMenu);var parentTop=parentMenuItemPosition.y-2;var parentLeft=parentMenuItemPosition.x-2;var viewportHeight=Curse.Client.viewportHeight();var viewportWidth=Curse.Client.viewportWidth();var parentMenuPadding=0;if(objParentMenu._isMainMenu)
{objSubMenu.style.visibility="hidden";objSubMenu.style.display="block";padLeft=cg_getStyle(objParentMenu,"padding-left");if(padLeft!="")
{parentMenuPadding=parseInt(padLeft.replace(/px/,""));}
if(objSubMenu.offsetHeight+parentTop>viewportHeight)
{objSubMenu.style.top=(parentTop-objSubMenu.offsetHeight-objParentMenu.offsetHeight+10)+"px";}
else
{objSubMenu.style.top=parentMenuItemPosition.y+objParentMenu.offsetHeight+"px";}
objSubMenu.style.left=parentMenuItemPosition.x+parentMenuPadding+"px";objSubMenu.style.visibility="visible";}
else if(parentMenuItemPosition.y>0)
{objSubMenu.style.visibility="hidden";objSubMenu.style.display="block";var menuPad=10;if(Curse.Browser.ie)
{menuPad=20;}
if(menuPad+objSubMenu.offsetHeight+parentTop>viewportHeight)
{objSubMenu.style.top=(viewportHeight-objSubMenu.offsetHeight-menuPad)+"px";}
else
{objSubMenu.style.top=parentTop+"px";}
if((menuPad+objSubMenu.offsetWidth+parentLeft+objParentMenu.offsetWidth+5)>viewportWidth)
{objSubMenu.style.left=(parentMenuItemPosition.x-objSubMenu.offsetWidth)+"px";}
else
{objSubMenu.style.left=parentMenuItemPosition.x+objParentMenu.offsetWidth-2+"px";}
objSubMenu.style.visibility="visible";}},hideSubMenu:function()
{this._timeout=null;this.style.display="none";if(this._parentMenu)
{Curse.Menu.hideAllParents(this);}},contractSub:function(e)
{var e=cg_getEvent(e);var toAnchor=e._relatedTarget;var fromAnchor=e._target;if(this.contains(toAnchor))
{return;}
if(this._subMenu&&!this._subMenu.contains(toAnchor))
{this._subMenu.style.display="none";return;}},contract:function(e)
{var e=cg_getEvent(e);var toAnchor=e._relatedTarget;var fromAnchor=e._target;var container=this;if(!toAnchor)
{this.style.display="none";if(this._parentMenu)
{Curse.Menu.hideAllParents(this);}
return;}
if(!fromAnchor)
{return;}
if(this.contains(toAnchor))
{return;}
if(fromAnchor.tagName=="SPAN"||fromAnchor.tagName=="A")
{while(fromAnchor.tagName!="A")
{fromAnchor=fromAnchor.parentNode;}
if(fromAnchor._subMenu&&(fromAnchor._subMenu==toAnchor||fromAnchor._subMenu.contains(toAnchor)))
{return;}}
if(this._parentLink==toAnchor)
{return;}
if(this._parentMenu&&this._parentMenu.contains(toAnchor))
{this.style.display="none";return;}
this._timeout=setTimeout(Curse.Menu.hideSubMenu.bind(this),400);return;},handleSubClick:function()
{var layers=cg_ge("layers");var menus=cg_getElementsByClassName("menu","div",layers);for(var i=0;i<menus.length;i++)
{menus[i].style.display="none";}},hideAllParents:function(child)
{child.style.display="none";if(child._parentMenu&&!child._parentLink._isMainMenu)
{Curse.Menu.hideAllParents(child._parentMenu);}},hideChildren:function(parent)
{tempMenu=parent._subMenu;while(tempMenu&&tempMenu.style.display!="none")
{tempMenu.style.display="none";tempMenu=tempMenu._subMenu;}},hideSiblings:function(obj)
{if(!obj._container)
{return;}
for(var i=0;i<obj._container._menuArray.length;i++)
{if(obj!=obj._container._menuArray[i])
{window.clearTimeout(obj._container._menuArray[i]._timeout);Curse.Menu.hideMainMenu.bind(obj._container._menuArray[i])();}}}};Curse.User={getLanguage:function()
{if(this.language!=null)
{return this.language;}
var navigatorLanguage=null;if(Curse.Browser.ie)
{navigatorLanguage=navigator.userLanguage;}
else
{navigatorLanguage=navigator.language;}
if(navigatorLanguage.indexOf("-")>=0)
{navigatorLanguage=navigatorLanguage.split("-")[0];}
navigatorLanguage=navigatorLanguage.toLowerCase();this.language=navigatorLanguage;return this.language;},getPreferredLanguage:function()
{var preferredLanguage=cg_getCookie("_language");if(preferredLanguage!=null)
{return preferredLanguage;}
return Curse.User.getLanguage();},setPreferredLanguage:function(language)
{cg_setCookie("_language",language);Curse.User.navToPreferredSite();},navToPreferredSite:function()
{var siteUrl=Curse.Lookup.site_url[Curse.User.getPreferredLanguage()];if(siteUrl==null)
{siteUrl=Curse.Lookup.site_url["en"];}
var relativeLocation=cg_getRelativeLocation(true);if(relativeLocation!="")
{relativeLocation="/"+relativeLocation;}
self.location="http://"+siteUrl+relativeLocation;},initialize:function()
{var userID=cg_getCookie("Login.UserID");if(userID!=null)
{Curse.User.id=parseInt(userID);}
var userDisplayName=cg_getCookie("Login.UserDisplayName");if(userDisplayName!=null)
{Curse.User.displayName=cg_utf8Decode(userDisplayName);}
var userAvatar=cg_getCookie("Login.UserAvatar");if(userAvatar!=null)
{Curse.User.avatar=userAvatar;}
var userIsMod=cg_getCookie("Login.UserIsMod");if(userIsMod!=null&&userIsMod=="1")
{Curse.User.isModerator=true;}}}
Curse.User.initialize();if(!Curse){var Curse={};}
Curse.Lookup={lookup:function(keyName)
{if(Curse.Lookup[keyName]!=null)
{return(Curse.Lookup[keyName]);}
else
{return"";}},add:function()
{var args=Curse.Lookup.add.arguments;for(c=0;c<args.length;c+=3)
{this[args[c]+"."+args[c+1]]=args[c+2];if(!Curse.Lookup["LookupList_"+args[c]])
{Curse.Lookup["LookupList_"+args[c]]=[];}
Curse.Lookup["LookupList_"+args[c]].push([args[c+1],args[c+2]])}},lookupList:function()
{var args=Curse.Lookup.lookupList.arguments;return Curse.Lookup[args[0]];},Localization:{replace:function()
{var args=Curse.Lookup.Localization.replace.arguments;var str=Curse.Lookup.Localization[args[0]];if(!str)
{alert("Missing: "+args[0]);}
for(i=1;i<args.length;i++)
{str=str.replace(eval("/\\%"+i+"/"),args[i]);}
return str;}}}

Localization=Curse.Lookup.Localization;
Localization._delete="Delete";
Localization._in="in";
Localization.a_spell="a Spell";
Localization.account_settings="Account Options";
Localization.activation_code_help="If you have not received a code within 24-hours, please check your spam folder.";
Localization.add="Add";
Localization.add_article="Add a Wiki Article";
Localization.add_comment="Add Comment";
Localization.add_item_tooltip_icon="Add Item Tooltip (with Icon)";
Localization.add_item_tooltip_no_icon="Add Item Tooltip (without Icon)";
Localization.add_map_location="Add Map Location";
Localization.add_spell_tooltip="Add Spell Tooltip (with Icon)";
Localization.add_spell_tooltip_no_icon="Add Spell Tooltip (without Icon)";
Localization.add_to_wishlist="Add to Wish List";
Localization.added="Added";
Localization.agility="Agility";
Localization.also_get="Also get";
Localization.amulet="Amulet";
Localization.amulets="Amulets";
Localization.an_item="an Item";
Localization.any="Any";
Localization.approve="Approve";
Localization.approve_map_locations="Approve Map Locations";
Localization.approve_talent_builds="Approve Talent Builds";
Localization.arcane="Arcane";
Localization.armor="Armor";
Localization.armor_penetration="Armor Penetration";
Localization.article_created="Item registered by %1 %2 | Source %3, view the %4article%5";
Localization.article_link="Article Link";
Localization.article_source="Article Source";
Localization.base_stats="Base Stats";
Localization.block="Block";
Localization.block_rating="Block Rating";
Localization.blocked_cookies="Your browser appears to be blocking cookies. You will not be able to login to WOWDB";
Localization.bonus_damage="Bonus Damage";
Localization.bonus_healing="Bonus Healing";
Localization.bonus_spell_damage="Bonus Spell Damage";
Localization.bookmark_search="Bookmark this Search";
Localization.bookmarks="Bookmarks";
Localization.bookmarks_appear_here="Your %1Bookmarks%2 will appear here";
Localization.browser_plugins="Browser Plugins";
Localization.bug_reporting_and_feedback="Bug Reporting & Feedback";
Localization.build_approve_error="Error Approving Build";
Localization.build_approved="Build Approved";
Localization.build_denied="Build Denied";
Localization.by="By";
Localization.by_filtering="By filtering your results, you can find exactly what you are searching for, and see up to 500 matches.";
Localization.cancel="Cancel";
Localization.category="Category";
Localization.char_enter_note="Note: You may enter up to %1 characters.";
Localization.character="Character";
Localization.characters="Characters";
Localization.check_spelling="Make sure all words are spelled correctly.";
Localization.choose="Choose";
Localization.choose_wishlist="Please choose the wish list you would like to add this to, or enter the name of a new one.";
Localization.class_colon="Class: %1";
Localization.class_name="Class";
Localization.classes="Classes";
Localization.click="Click";
Localization.click_bookmark="Click here to bookmark this search for later retrieval.";
Localization.click_here_add_wishlist="Click here to add %1 to your wish list.";
Localization.click_item_links="Click here for links to this item.";
Localization.click_map_toggle="Click the map to toggle zoom";
Localization.click_see_side_by_side="Click here to use this item for side-by-side tooltip comparisons in the %1 slot.";
Localization.click_spell_links="Click here for links to this spell.";
Localization.click_submit_build="Click here to submit this build to WOWDB";
Localization.click_to_learn="Click to learn";
Localization.click_to_tour="Click %1here%2 for an overview of our unique features, or click Close and continue browsing.";
Localization.click_to_untrain="Right or Ctrl-Click to Untrain";
Localization.click_view2="Click here to view this NPC.";
Localization.click_view4="Click here to view this quest.";
Localization.click_view5="Click here to view this object.";
Localization.cloak="Cloak";
Localization.cloaks="Cloaks";
Localization.colon=":";
Localization.confirm_delete="Are you sure you want to delete this comment?";
Localization.contains="Contains";
Localization.contract_article_contents="Contract Article Contents";
Localization.contract_by_default="Contract By Default";
Localization.cookies_blocked="Cookies Blocked";
Localization.copy_and_paste_command="Copy and paste this command to an in-game chat window.";
Localization.copy_paste_to_comment="Copy and paste this to a WOWDB comment box.";
Localization.copy_url_link_talent="Copy this URL to link directly to this talent build.";
Localization.count="Count";
Localization.create_bookmarks="Create Bookmarks";
Localization.create_filter="Create a Filter";
Localization.create_hyperlink="Create a Hyperlink";
Localization.create_tooltip="Create %1 tooltip";
Localization.crit="Crit";
Localization.crit_chance="Crit Chance";
Localization.crit_rating="Crit Rating";
Localization.daily="Daily";
Localization.dam_per_sec="damage per second";
Localization.damage="Damage";
Localization.damage_colon="Damage:";
Localization.day="day";
Localization.days="days";
Localization.decreases_enemy_hit="Descreases chance of enemy scoring a critical hit on you by";
Localization.defense="Defense";
Localization.defense_rating="Defense Rating";
Localization.defenses="Defenses";
Localization.delete_article="Delete Article";
Localization.delete_article_confirm="Are you sure you want to delete this article?";
Localization.delete_wishlist="Are you sure you want to delete this wish list?";
Localization.deny="Deny";
Localization.description_colon="Description: %1";
Localization.disable_tips="Disable Tips";
Localization.disenchant_level="Disenchant Level";
Localization.dodge="Dodge";
Localization.dodge_rating="Dodge Rating";
Localization.download_curse_client="Download the Curse Client";
Localization.dps="DPS";
Localization.dps_colon="Damage per Second:";
Localization.drop_rate="Drop Rate";
Localization.durability="Durability";
Localization.edit="Edit";
Localization.edit_article="Edit Article";
Localization.edit_map="Edit Map";
Localization.empty_wishlist="Your wish list is currently empty. To add something to it, simply browse or search the site, and click the &quot; Add to Wishlist&quot; button.";
Localization.enter_at_least_x_chars="You must enter at least %1 characters.";
Localization.enter_bookmark_name="Please enter a name for this bookmark below.";
Localization.enter_hyperlink="Please enter the hyperlink details below.";
Localization.enter_reg_code_header="Enter the registration code";
Localization.enter_the_code="Enter the registration code";
Localization.enter_to_x_chars="Enter up to %1 characters";
Localization.enter_tooltip_id="Please enter the ID of the tooltip you wish to embed below.";
Localization.enter_url="http://www.toysdorado.com/Enter%20a%20URL,%20starting%20with%20%1|Label";
Localization.existing="Existing";
Localization.expand_article_contents="Expand Article Contents";
Localization.expand_by_default="Expand By Default";
Localization.expertise="Expertise";
Localization.expertise_rating="Expertise Rating";
Localization.faction="Faction";
Localization.filtering="filtering";
Localization.fire="Fire";
Localization.first="First";
Localization.first_to_submit="Be the first to %1submit one%2!";
Localization.first_visit="This appears to be your first visit to WOWDB!";
Localization.for_verification="For verification, please enter the text you see in the box:";
Localization.frost="Frost";
Localization.gender="Gender";
Localization.get_fewer="You can get fewer by";
Localization.group="Group";
Localization.guild="Guild";
Localization.haste="Haste";
Localization.haste_rating="Haste Rating";
Localization.header="Header";
Localization.header_contribute="Post Comments and Screenshots";
Localization.here_are_suggestions="Here are some suggestions for finding what you are looking for";
Localization.hide_comment="Hide Comment";
Localization.hide_filter_form="Hide Filter Form";
Localization.hit_rating="Hit Rating";
Localization.home="Home";
Localization.hp="HP";
Localization.hr="hr";
Localization.if_equip="If you equip";
Localization.in_game_link="In-Game Link";
Localization.in_your_wishlist="In Your Wishlist";
Localization.instance_type="Instance Type";
Localization.instructions_commenting="When posting a comment, please be sure that it is helpful and does not violate the terms of service. Comments in violation of the terms of service will be deleted. Users who post abusive comments will be permanently banned.";
Localization.instructions_screenshots="When posting a screenshot, please be sure that it features the focus of the current page and does not violate the terms of service. Screenshots in violation of the terms of service will be deleted. Please refer to the %1screenshot guide%2 to learn how to capture and submit screenshots.";
Localization.intellect="Intellect";
Localization.item_id="Item ID";
Localization.item_link="Item Link";
Localization.item_no_preview="This item does not have a 3D preview.";
Localization.items_appear="Items appear after posting";
Localization.label_edit_ok="Label Edit Successful";
Localization.last="Last";
Localization.last_edited_by="Last edited by ";
Localization.latest_additions="Latest Additions";
Localization.latest_comments="Latest Comments";
Localization.latest_rss_desc="The latest Be@rbrick Items, Quests and NPCs. Visit www.toysdorado.com for a complete list!";
Localization.level="Level";
Localization.location="Location.html";
Localization.location_unknown="The location of %1 is not known.";
Localization.locations_you_add="Locations you add will be submitted for moderation. Once approved, they will be visible to all WOWDB users.";
Localization.login="Login";
Localization.login_register_to_comment="You are not logged in. Please %1Login%2 or %3Register%4 to post a comment";
Localization.login_register_to_screenshot="You are not logged in. Please %1Login%2 or %3Register%4 to post a screenshot.";
Localization.logout="Logout";
Localization.mana="Mana";
Localization.mana_per_5_sec="mana regenerated every 5 seconds while not casting";
Localization.mana_regen="Mana Regen";
Localization.melee="Melee";
Localization.melee_crit="Melee Crit Rating";
Localization.melee_damage="Melee Damage";
Localization.melee_hit="Melee Hit Rating";
Localization.melee_power="Melee Attack Power";
Localization.melee_speed="Melee Speed";
Localization.min="min";
Localization.mode="Mode";
Localization.more_article="There\'s more to this article:";
Localization.mount="Mount";
Localization.mounts="Mounts";
Localization.my_account="My Account";
Localization.n_a="n/a";
Localization.name="Name";
Localization.nature="Nature";
Localization.new_list="New List";
Localization.next="Next";
Localization.next_rank="Next rank:";
Localization.next_screenshot="Next Screenshot";
Localization.no="No";
Localization.no_comments="No comments have been submitted for %1.";
Localization.no_preview="This item does not have a 3D preview.";
Localization.no_results_matching="No results matching ";
Localization.no_search_matches="No search results were found that match %1";
Localization.no_search_results="No search results were found";
Localization.npc="NPC";
Localization.npcs="NPCs";
Localization.object="Object";
Localization.of="Of";
Localization.off_hand_frill="Off-hand Frill";
Localization.off_hand_frills="Off-hand Frills";
Localization.offhand_damage="Offhand Damage";
Localization.offhand_speed="Offhand Speed";
Localization.ok="Okay";
Localization.on="on";
Localization.or="or";
Localization.other="Other";
Localization.parry="Parry";
Localization.parry_rating="Parry Rating";
Localization.paste_the_code="Paste the code:";
Localization.patch="Format"; // EDITO
Localization.patch_2_4_2="2.4.2";
Localization.penetration="Penetration";
Localization.per_page="Per page:";
Localization.per_sec_no_cast="Per Second while not casting";
Localization.per_sec_no_combat="Per Second while not in combat";
Localization.pet_skills="Pet Skills";
Localization.pieces="Pieces";
Localization.pin_item="Pin Item";
Localization.point_of_interest="Point of Interest";
Localization.post_a_comment="Post a Comment";
Localization.post_screenshot_note="Note: Only JPEG and PNG image formats are accepted. Your screenshot will need to be approved before appearing on the site.";
Localization.posted="Posted";
Localization.posted_by="Posted by";
Localization.potential_article="Potential WoWiki Article";
Localization.power="Power";
Localization.preview="Preview";
Localization.preview_on_character="Preview on Character";
Localization.previous="Previous";
Localization.previous_screen="Previous Screenshot";
Localization.price="Price";
Localization.provide_search_criteria="Click here to provide additional criteria for your search.";
Localization.pve="PvE";
Localization.quest_link="Quest Link";
Localization.question="???";
Localization.quests="Quests";
Localization.race="Race";
Localization.ranged="Ranged";
Localization.ranged_crit="Ranged Crit Rating";
Localization.ranged_damage="Ranged Damage";
Localization.ranged_hit="Ranged Hit Rating";
Localization.ranged_power="Ranged Attack Power";
Localization.ranged_skill="Ranged Weapon Skill";
Localization.rank="Rank";
Localization.rated_by_users="(by %1 users)";
Localization.rating="Rating";
Localization.react="React";
Localization.reagent="Reagents";
Localization.reagents="Reagents";
Localization.realm="Realm Name";
Localization.recipes="Recipes";
Localization.reduces_crit_dam="Reduces damage taken from critical strikes by";
Localization.reduces_def_chance="Reduces chance to be dodged or parried by";
Localization.reduces_period_dam="Reduces damage taken from periodic damage by";
Localization.reduces_res="Reduces the target\'s resistance to your spells";
Localization.refine_by_name="Refine by name";
Localization.register="Register";
Localization.register_to_bookmark="%1Register%2 to %3Create Bookmarks%4";
Localization.remove="Remove";
Localization.remove_from_wishlist="Are you sure you want to remove this from your wish list?";
Localization.rep="Rep";
Localization.replies="Replies";
Localization.reply="Reply";
Localization.reputation="Reputation";
Localization.req="Req.";
Localization.reqd="Reqd.";
Localization.required_skill_level="Required Skill Level";
Localization.requires_account="This feature requires a WOWDB account. Click here to login or register.";
Localization.requires_points_in_talents="Requires %1 points in %2 Talents";
Localization.resilience="Resilience";
Localization.resilience_rating="Resilience Rating";
Localization.results_summary="%1 %2 were found.";
Localization.results_summary_filtering="You can get fewer by %1filtering%2 your results.";
Localization.rewards="Rewards";
Localization.ring="Ring";
Localization.rings="Rings";
Localization.save="Save";
Localization.school="School";
Localization.search="Search";
Localization.search_db="Search the database";
Localization.select_all="Select All";
Localization.select_location_type="Select the type of location, and enter a name for it using the form below.";
Localization.select_valid_screenshot="You must select a valid screenshot file.";
Localization.shad_dam_increases="Your shadow damage increases your pet\'s Attack Power by";
Localization.shadow="Shadow";
Localization.share_this_quest="Use the following links to share this quest";
Localization.shift_click_to_window="Shift click this link to put it into the default chat window";
Localization.shot_awaiting_moderation="This screenshot is awaiting moderation";
Localization.show_comment="Show Comment";
Localization.show_quest_givers_for="Show quest givers for: ";
Localization.side="Side";
Localization.site_url="index.html";
Localization.skill="Skill";
Localization.skills="Skills";
Localization.slot="Slot";
Localization.slots="Slots";
Localization.small="Small";
Localization.source="Source";
Localization.speed="Speed";
Localization.spell="Spell";
Localization.spell_crit_rating="Spell Crit Rating";
Localization.spell_hit_rating="Spell Hit Rating";
Localization.spell_id="Spell ID";
Localization.spell_link="Spell Link";
Localization.spell_penetration="Spell Penetration";
Localization.spells_appear="Spells appear after posting";
Localization.spirit="Spirit";
Localization.stamina="Stamina";
Localization.standing="Standing";
Localization.start_rotation="Start Rotation";
Localization.starts_with="Starts With";
Localization.stop_rotation="Stop Rotation";
Localization.strength="Strength";
Localization.strike="Strike";
Localization.subject="Subject";
Localization.submit="Submit";
Localization.submit_a_screenshot="Submit a Screenshot";
Localization.submit_talent_build="Submit Talent Build";
Localization.submitted_by="Submitted by";
Localization.submitting="Submitting";
Localization.syndication="Syndication";
Localization.system_message="System Message";
Localization.take_the_tour="Take the Tour";
Localization.talent="Talents";
Localization.talent_calc="Talent Calculator";
Localization.talent_header="%1 Talents";
Localization.talent_link_build="Link to this build";
Localization.talent_lower_cap="Lower Cap to 70";
Localization.talent_raise_cap="Raise Cap to 80";
Localization.talent_rating="Rating:";
Localization.talent_reset_tree="Reset Tree";
Localization.talents="Talents";
Localization.territory="Territory";
Localization.text_entered_no_match="The text you entered does not match the text in the image.";
Localization.this_can_also_be_found=" %1 can also be found in: %2";
Localization.this_can_be_found_in=" %1 can be found in ";
Localization.this_entity1="This item";
Localization.this_entity2="This npc";
Localization.this_entity3="This zone";
Localization.this_entity4="This quest";
Localization.this_entity5="This object";
Localization.this_entity6="This spell";
Localization.this_entity7="This item set";
Localization.this_entity8="This faction";
Localization.time_day_hour="%1 day %2 hr ago";
Localization.time_days_hour="%1 days %2 hr ago";
Localization.time_full="%1/%2/%3";
Localization.time_hour="%1 hr ago";
Localization.time_hour_minute="%1 hr %2 min ago";
Localization.time_last_minute="in the last minute";
Localization.time_minute="%1 min ago";
Localization.to_edit_this_map="To %1 edit this map%2, click the Edit Map button, then click the desired point on the map.";
Localization.to_perform_fulltext="To perform a full text search, you must enter at least 3 letters.";
Localization.to_retreive_search="To easily retrieve a search you frequently perform, simply click the Bookmark this %1Search%2 button after filtering results.";
Localization.to_share_spell="Use the following links to share this spell";
Localization.today="Today";
Localization.today_at="Today at";
Localization.tools="Tools";
Localization.tooltip_attack_speed="Attack Speed (seconds):";
Localization.tooltip_block="Block Rating of %1 adds %2% Block<br>Your block stops %3 damage.";
Localization.tooltip_bonus_healing="Increases your healing by up to %1";
Localization.tooltip_dodge="Dodge Rating of %1 adds %2% Dodge";
Localization.tooltip_haste_rating="Haste rating %1 (%2% haste)";
Localization.tooltip_meleehit="Increases your melee chance to hit a target of level %1 by %2%<br><br>Enemy Armor Reduced by %3.";
Localization.tooltip_meleepower="Increases damage with melee weapons by %1 damage per second.";
Localization.tooltip_parry="Parry Rating of %1 adds %2% Parry";
Localization.tooltip_pet_armor="Increases your pet\'s Armor by %1";
Localization.tooltip_pet_int="Increases your pet\'s Intellect by %1";
Localization.tooltip_pet_ranged_power="Increases your pet\'s Attack Power by %1";
Localization.tooltip_pet_spell_dmg="Increases your pet\'s Spell Damage by %1";
Localization.tooltip_pet_stamina="Increases your pet\'s Stamina by %1";
Localization.tooltip_ranged_attack_power="Increases damage with ranged weapons by %1 damage per second.";
Localization.tooltip_ranged_dmg="Increases damage with ranged weapons by %1 damage per second.";
Localization.tooltip_ranged_hit="Increases your ranged chance to hit a target of level %1 by %2%<br><br>Enemy Armor Reduced by %3.";
Localization.tooltip_spell_hit="Increases your spell chance to hit a target of level  (Reduces enemy resistances by %4)";
Localization.tooltip_statagility="Increases Critical Hit chance by %1%<br>Increases Armor by %2";
Localization.tooltip_statarmor="Reduces Physical Damage taken by %1%";
Localization.tooltip_statdefense="";
Localization.tooltip_statint="Increases Mana by %1<br>Increases Spell Critical Hit by %2%";
Localization.tooltip_statspirit="Increases Health Regeneration by %1 Per Second while not in combat";
Localization.tooltip_statspirit_mana="Increases Mana Regeneration by %1 Per 5 Seconds while not casting";
Localization.tooltip_statstamina="Increases Health by %1";
Localization.tooltip_statstrength="Increases Attack Power by %1";
Localization.trinket="Trinket";
Localization.trinkets="Trinkets";
Localization.try_different_keywords="Try different keywords.";
Localization.try_fewer_keywords="Try fewer keywords.";
Localization.try_general_keywords="Try more general keywords.";
Localization.type="Images"; // EDITO
Localization.type_to_update="Start typing the name of what you\'re searching for, and the results will update instantly.";
Localization.unpin_item="Unpin Item";
Localization.unrated="Unrated";
Localization.unsupported_screenshot="The file you selected is not a supported type.";
Localization.url="URL";
Localization.use_following_links="Use the following links to share this item";
Localization.view_item="View Item";
Localization.view_original_image="View Original Image";
Localization.view_set="View Set";
Localization.weapon_skill="Weapon Skill";
Localization.welcome="Welcome";
Localization.welcome_message="Welcome to WOWDB!";
Localization.were_found=" were found.";
Localization.wishlists="Wish Lists";
Localization.with_icon="with icon";
Localization.with_WOWDB_account="With a WOWDB account you can save searches as Bookmarks for later retrieval.";
Localization.without_icon="without icon";
Localization.WOWDB_link="WOWDB Link";
Localization.WOWDB_tooltip="WOWDB Tooltip";
Localization.xp="XP";
Localization.yes="Yes";
Localization.you_will_gain="You will gain: ";
Localization.you_will_lose="You will lose: ";
Localization.your_comment_posted="Your comment has been posted.";
Localization.your_results=" your results.";
Localization.your_shot_awaiting="Note: Your screenshot is awaiting moderation.";
Localization.zone_neutral_count="This zone has %1 neutral quest NPCs / objects.";
Localization.zone_npc_count="This zone has %1 Horde-friendly quest NPCs / objects.";
var cg_currentLanguage='en';
Curse.Lookup.initialize=function(){var _=Curse.Lookup;
_.imgstatus=[];
_.imgstatus["0"]="-";
_.imgstatus["1"]="View Image";
_.imgstatus["2"]="View Images";
_.class_id=[];
_.class_id["11"]="Druid";
_.class_id["3"]="Hunter";
_.class_id["8"]="Mage";
_.class_id["2"]="Paladin";
_.class_id["5"]="Priest";
_.class_id["4"]="Rogue";
_.class_id["7"]="Shaman";
_.class_id["9"]="Warlock";
_.class_id["1"]="Warrior";
_.client_version=[];
_.client_version["8478"]="2.4.3 (PTR)";
_.client_version["8209,8268,8278"]="2.4.2";
_.client_version["8089,8125"]="2.4";
_.client_version["7799"]="2.3.3";
_.client_version["7741"]="2.3.2";
_.client_version["7561,7741,7799"]="2.3";
_.client_version["7359"]="2.2.3";
_.client_version["7318"]="2.2.2";
_.client_version["7272,7318,7359"]="2.2";
_.client_version["6692"]="2.1";
_.client_version["6546"]="2.0";
_.disenchant_chance=[];
_.disenchant_chance["1"]="Extremely Low (1% - 2%)";
_.disenchant_chance["6"]="Guaranteed (100%)";
_.disenchant_chance["5"]="High (51% - 99%)";
_.disenchant_chance["3"]="Low (15% - 24%)";
_.disenchant_chance["4"]="Moderate (25 - 50%)";
_.disenchant_chance["2"]="Very Low (3% - 14%)";
_.drop_mode=[];
_.drop_mode["2"]="Drops in a Heroic Instance";
_.drop_mode["1"]="Drops in a Normal Instance";
_.faction_level=[];
_.faction_level["0"]="Hated";
_.faction_level["1"]="Hostile";
_.faction_level["2"]="Unfriendly";
_.faction_level["3"]="Neutral";
_.faction_level["4"]="Friendly";
_.faction_level["5"]="Honored";
_.faction_level["6"]="Revered";
_.faction_level["7"]="Exalted";
_.filter_drop_mode=[];
_.filter_drop_mode["1"]="Normal Mode Only";
_.filter_drop_mode["2"]="Heroic Mode Only";
_.filter_drop_mode["1|2"]="Normal or Heroic Mode";
_.filter_drop_mode["1^2"]="Normal and Heroic Mode";
_.filter_quest_side=[];
_.filter_quest_side["2|4|*"]="Any";
_.filter_quest_side["2"]="Alliance";
_.filter_quest_side["4"]="Horde";
_.filter_quest_side["1"]="Both";
_.filter_yes_no=[];
_.filter_yes_no["1"]="Yes";
_.filter_yes_no["0"]="No";
_.gem_color=[];
_.gem_color["1|2|4|8"]="All";
_.gem_color["8"]="Blue";
_.gem_color["1"]="Meta";
_.gem_color["2"]="Red";
_.gem_color["4"]="Yellow";
_.gender=[];
_.gender["3"]="Female";
_.gender["2"]="Male";
_.item_socket_color_id=[];
_.item_socket_color_id["8"]="Blue Socket";
_.item_socket_color_id["1"]="Meta Socket";
_.item_socket_color_id["2"]="Red Socket";
_.item_socket_color_id["4"]="Yellow Socket";
_.item_source=[];
_.item_source["4"]="Crafted";
_.item_source["11"]="Disenchanting";
_.item_source["1"]="Drop";
_.item_source["6"]="Gathered";
_.item_source["5"]="Mined";
_.item_source["10"]="Pick Pocketed";
_.item_source["7"]="Prospected";
_.item_source["3"]="Quest";
_.item_source["9"]="Skinned";
_.item_source["2"]="Vendor";
_.item_source["8"]="PvP";
_.itemset_tag=[];
_.itemset_tag["13"]="";
_.itemset_tag["14"]="";
_.itemset_tag["1"]="";
_.itemset_tag["2"]="";
_.itemset_tag["3"]="";
_.itemset_tag["4"]="";
_.itemset_tag["5"]="";
_.itemset_tag["6"]="";
_.itemset_tag["7"]="";
_.itemset_tag["9"]="";
_.itemset_tag["8"]="";
_.itemset_tag["11"]="";
_.itemset_tag["10"]="";
_.itemset_tag["15"]="";
_.itemset_tag["16"]="";
_.itemset_tag["17"]="";
_.itemset_tag["18"]="";
_.itemset_tag["19"]="";
_.itemset_tag["20"]="";
_.itemset_tag["12"]="";
_.itemset_tag["21"]="";
_.language_label=[];
_.language_label["en"]="English";
_.language_label["fr"]="Français";
_.language_label["cn"]="简体中文";
_.locale_stylesheet=[];
_.locale_stylesheet["cn"]="main_cn.css";
_.location_category_id=[];
_.location_category_id["0"]="Eastern Kingdoms";
_.location_category_id["1"]="Kalimdor";
_.location_category_id["2"]="Outland";
_.location_category_id["3"]="Dungeons";
_.location_category_id["4"]="Raids";
_.location_category_id["5"]="Battlegrounds";
_.location_category_id["6"]="Arenas";
_.location_expansion_id=[];
_.location_expansion_id["1"]="The Burning Crusade";
_.location_faction_id=[];
_.location_faction_id["1"]="Contested";
_.location_faction_id["2"]="Alliance";
_.location_faction_id["4"]="Horde";
_.location_type_id=[];
_.location_type_id["0"]="";
_.location_type_id["4"]="Arena";
_.location_type_id["7"]="City";
_.location_type_id["6"]="Transit";
_.location_type_id["3"]="Battleground";
_.location_type_id["1"]="Dungeon";
_.location_type_id["5"]="Heroic Dungeon";
_.location_type_id["2"]="Raid";
_.npc_classification_id=[];
_.npc_classification_id["3"]="Boss";
_.npc_classification_id["1"]="Elite";
_.npc_classification_id["4"]="Rare";
_.npc_classification_id["2"]="Rare Elite";
_.npc_type_id=[];
_.npc_type_id["1"]="Beast";
_.npc_type_id["8"]="Critter";
_.npc_type_id["3"]="Demon";
_.npc_type_id["2"]="Dragonkin";
_.npc_type_id["4"]="Elemental";
_.npc_type_id["13"]="Gas Cloud";
_.npc_type_id["5"]="Giant";
_.npc_type_id["7"]="Humanoid";
_.npc_type_id["9"]="Mechanical";
_.npc_type_id["12"]="Non-combat Pet";
_.npc_type_id["10"]="Not specified";
_.npc_type_id["11"]="Totem";
_.npc_type_id["6"]="Undead";
_.object_type_id=[];
_.object_type_id["9"]="Books";
_.object_type_id["3"]="Containers";
_.object_type_id["25"]="Fish Schools";
_.object_type_id["-2"]="Herbs";
_.object_type_id["-3"]="Locked Chests";
_.object_type_id["-1"]="Mineral Veins";
_.object_type_id["2"]="Quest";
_.format_label=[];
_.format_label["50%"]="50%";
_.format_label["70%"]="70%";
_.format_label["100%"]="100%";
_.format_label["400%"]="400%";
_.format_label["1000%"]="1000%";
_.format_label["Other"]="Other";
_.pp_faction_id=[];
_.pp_faction_id["0"]="Alliance";
_.pp_faction_id["1"]="Horde";
_.quality=[];
_.quality["0"]="Poor";
_.quality["1"]="Common";
_.quality["2"]="Uncommon";
_.quality["3"]="Rare";
_.quality["4"]="Epic";
_.quality["5"]="Legendary";
_.quality["6"]="Artifact";
_.quest_side_id=[];
_.quest_side_id["1"]="Both";
_.quest_side_id["2"]="Alliance";
_.quest_side_id["4"]="Horde";
_.quest_type_id=[];
_.quest_type_id["87"]="";
_.quest_type_id["83"]="Legendary";
_.quest_type_id["21"]="Life";
_.quest_type_id["82"]="World Event";
_.quest_type_id["0"]="Normal";
_.quest_type_id["1"]="Group";
_.quest_type_id["81"]="Dungeon";
_.quest_type_id["62"]="Raid";
_.quest_type_id["41"]="PvP";
_.quest_type_id["84"]="Escort";
_.quest_type_id["85"]="Heroic";
_.race_id=[];
_.race_id["10"]="Blood Elf";
_.race_id["11"]="Draenei";
_.race_id["3"]="Dwarf";
_.race_id["7"]="Gnome";
_.race_id["1"]="Human";
_.race_id["4"]="Night Elf";
_.race_id["2"]="Orc";
_.race_id["6"]="Tauren";
_.race_id["8"]="Troll";
_.race_id["5"]="Undead";
_.resistances=[];
_.resistances["6"]="Arcane";
_.resistances["2"]="Fire";
_.resistances["4"]="Frost";
_.resistances["1"]="Holy";
_.resistances["3"]="Nature";
_.resistances["0"]="Physical";
_.resistances["5"]="Shadow";
_.site_url=[];
_.site_url["cn"]="cn.WOWDB.com";
_.site_url["fr"]="fr.WOWDB.com";
_.site_url["en"]="www.toysdorado.com";
_.skill_line_category_id=[];
_.skill_line_category_id["7"]="Class Skills";
_.skill_line_category_id["-2"]="Talents";
_.skill_line_category_id["11"]="Professions";
_.skill_line_category_id["-3"]="Pet Skills";
_.skill_line_category_id["9"]="Secondary Skills";
_.skill_line_category_id["-4"]="Racial Abilities";
_.skill_line_category_id["6"]="Weapon Skills";
_.skill_line_category_id["8"]="Armor Proficiencies";
_.skill_line_category_id["10"]="Languages";
_.slot=[];
_.slot["17"]="Two-Hand";
_.slot["24"]="Ammo";
_.slot["18"]="Bag";
_.slot["4"]="Shirt";
_.slot["5"]="Chest";
_.slot["16"]="Back";
_.slot["8"]="Feet";
_.slot["11"]="Finger";
_.slot["10"]="Hands";
_.slot["1"]="Head";
_.slot["23"]="Held In Off-hand";
_.slot["7"]="Legs";
_.slot["2"]="Neck";
_.slot["15"]="Ranged";
_.slot["26"]="Ranged";
_.slot["27"]="Ranged";
_.slot["28"]="Relic";
_.slot["14"]="Off Hand";
_.slot["3"]="Shoulder";
_.slot["19"]="Tabard";
_.slot["25"]="Thrown";
_.slot["12"]="Trinket";
_.slot["6"]="Waist";
_.slot["13"]="One-Hand";
_.slot["21"]="Main Hand";
_.slot["22"]="Off Hand";
_.slot["9"]="Wrist";
_.spell_cost_type_id=[];
_.spell_cost_type_id["-2"]="Health";
_.spell_cost_type_id["3"]="Energy";
_.spell_cost_type_id["2"]="Focus";
_.spell_cost_type_id["0"]="Mana";
_.spell_cost_type_id["1"]="Rage";
_.spell_form_id=[];
_.spell_form_id["9"]="";
_.spell_form_id["10"]="";
_.spell_form_id["11"]="";
_.spell_form_id["12"]="";
_.spell_form_id["13"]="";
_.spell_form_id["22"]="";
_.spell_form_id["23"]="";
_.spell_form_id["24"]="";
_.spell_form_id["25"]="";
_.spell_form_id["26"]="";
_.spell_form_id["892"]="";
_.stat_label=[];
_.stat_label["6"]="Armor";
_.stat_label["19"]="Bonus Damage";
_.stat_label["20"]="Bonus Healing";
_.stat_label["13"]="Weapon Skill";
_.stat_label["14"]="Weapon Skill";
_.stat_label["18"]="Crit Rating";
_.stat_label["28"]="Resilience";
_.stat_label["30"]="Defense Rating";
_.stat_label["24"]="Defense Rating";
_.stat_label["12"]="Expertise";
_.stat_label["25"]="Dodge Rating";
_.stat_label["26"]="Parry Rating";
_.stat_label["27"]="Block Rating";
_.stat_label["10"]="Hit Rating";
_.stat_label["17"]="Hit Rating";
_.stat_label["21"]="Hit Rating";
_.stat_label["11"]="Crit Rating";
_.stat_label["36"]="HP";
_.stat_label["23"]="Mana Regen";
_.stat_label["37"]="Mana";
_.stat_label["9"]="Melee Attack Power";
_.stat_label["16"]="Ranged Attack Power";
_.stat_label["15"]="Speed";
_.stat_label["29"]="Haste Rating";
_.stat_label["22"]="Penetration";
_.stat_label["1"]="Strength";
_.stat_label["2"]="Agility";
_.stat_label["3"]="Stamina";
_.stat_label["4"]="Intellect";
_.stat_label["5"]="Spirit";
_.stat_label["31"]="Arcane";
_.stat_label["32"]="Fire";
_.stat_label["34"]="Frost";
_.stat_label["33"]="Nature";
_.stat_label["35"]="Shadow";
_.stat_label["40"]="Armor Penetration";
_.stat_label["7"]="Melee Damage";
_.stat_label["8"]="Melee Speed";
_.stat_label["39"]="Offhand Damage";
_.stat_label["38"]="Offhand Speed";
_.talent_build_type=[];
_.talent_build_type["4"]="Arena";
_.talent_build_type["2"]="PvE";
_.talent_build_type["1"]="PvP";
_.talent_build_type["3"]="Raid";
_.totem_category_id=[];
_.totem_category_id["3"]="Air Totem";
_.totem_category_id["14"]="Arclight Spanner";
_.totem_category_id["13"]="Blacksmith Hammer";
_.totem_category_id["2"]="Earth Totem";
_.totem_category_id["4"]="Fire Totem";
_.totem_category_id["15"]="Gyromatic Micro-Adjustor";
_.totem_category_id["21"]="Master Totem";
_.totem_category_id["11"]="Mining Pick";
_.totem_category_id["12"]="Philosopher's Stone";
_.totem_category_id["62"]="Runed Adamantite Rod";
_.totem_category_id["10"]="Runed Arcanite Rod";
_.totem_category_id["6"]="Runed Copper Rod";
_.totem_category_id["63"]="Runed Eternium Rod";
_.totem_category_id["41"]="Runed Fel Iron Rod";
_.totem_category_id["8"]="Runed Golden Rod";
_.totem_category_id["7"]="Runed Silver Rod";
_.totem_category_id["9"]="Runed Truesilver Rod";
_.totem_category_id["1"]="Skinning Knife";
_.totem_category_id["5"]="Water Totem";
_.location_name=[];
_.location_name["3428"]="Ahn'Qiraj";
_.location_name["2079"]="Alcaz Island";
_.location_name["36"]="Alterac Mountains";
_.location_name["2597"]="Alterac Valley";
_.location_name["3526"]="Ammen Vale";
_.location_name["3358"]="Arathi Basin";
_.location_name["45"]="Arathi Highlands";
_.location_name["331"]="Ashenvale";
_.location_name["3790"]="Auchenai Crypts";
_.location_name["3917"]="Auchindoun";
_.location_name["16"]="Azshara";
_.location_name["268"]="Azshara Crater";
_.location_name["3524"]="Azuremyst Isle";
_.location_name["3"]="Badlands";
_.location_name["3959"]="Black Temple";
_.location_name["719"]="Blackfathom Deeps";
_.location_name["1584"]="Blackrock Depths";
_.location_name["25"]="Blackrock Mountain";
_.location_name["1583"]="Blackrock Spire";
_.location_name["2677"]="Blackwing Lair";
_.location_name["3702"]="Blade's Edge Arena";
_.location_name["3522"]="Blade's Edge Mountains";
_.location_name["4"]="Blasted Lands";
_.location_name["3525"]="Bloodmyst Isle";
_.location_name["35"]="Booty Bay";
_.location_name["46"]="Burning Steppes";
_.location_name["221"]="Camp Narache";
_.location_name["1941"]="Caverns of Time";
_.location_name["3565"]="Cenarion Refuge";
_.location_name["2918"]="Champions' Hall";
_.location_name["3905"]="Coilfang Reservoir";
_.location_name["132"]="Coldridge Valley";
_.location_name["279"]="Dalaran";
_.location_name["148"]="Darkshore";
_.location_name["1657"]="Darnassus";
_.location_name["41"]="Deadwind Pass";
_.location_name["154"]="Deathknell";
_.location_name["2257"]="Deeprun Tram";
_.location_name["405"]="Desolace";
_.location_name["2557"]="Dire Maul";
_.location_name["269"]="Dun Algaz";
_.location_name["1"]="Dun Morogh";
_.location_name["14"]="Durotar";
_.location_name["10"]="Duskwood";
_.location_name["15"]="Dustwallow Marsh";
_.location_name["139"]="Eastern Plaguelands";
_.location_name["12"]="Elwynn Forest";
_.location_name["3430"]="Eversong Woods";
_.location_name["3820"]="Eye of the Storm";
_.location_name["1116"]="Feathermoon Stronghold";
_.location_name["361"]="Felwood";
_.location_name["357"]="Feralas";
_.location_name["3478"]="Gates of Ahn'Qiraj";
_.location_name["3433"]="Ghostlands";
_.location_name["721"]="Gnomeregan";
_.location_name["3923"]="Gruul's Lair";
_.location_name["2917"]="Hall of Legends";
_.location_name["3535"]="Hellfire Citadel";
_.location_name["3483"]="Hellfire Peninsula";
_.location_name["3562"]="Hellfire Ramparts";
_.location_name["267"]="Hillsbrad Foothills";
_.location_name["3606"]="Hyjal Summit";
_.location_name["1537"]="Ironforge";
_.location_name["4080"]="Isle of Quel'Danas";
_.location_name["3457"]="Karazhan";
_.location_name["21"]="Kul Tiras";
_.location_name["38"]="Loch Modan";
_.location_name["170"]="Lordamere Lake";
_.location_name["4095"]="Magisters' Terrace";
_.location_name["3836"]="Magtheridon's Lair";
_.location_name["3792"]="Mana-Tombs";
_.location_name["2100"]="Maraudon";
_.location_name["2717"]="Molten Core";
_.location_name["493"]="Moonglade";
_.location_name["215"]="Mulgore";
_.location_name["3518"]="Nagrand";
_.location_name["3698"]="Nagrand Arena";
_.location_name["3456"]="Naxxramas";
_.location_name["3523"]="Netherstorm";
_.location_name["24"]="Northshire Abbey";
_.location_name["9"]="Northshire Valley";
_.location_name["2367"]="Old Hillsbrad Foothills";
_.location_name["2159"]="Onyxia's Lair";
_.location_name["1637"]="Orgrimmar";
_.location_name["2037"]="Quel'thalas";
_.location_name["2437"]="Ragefire Chasm";
_.location_name["722"]="Razorfen Downs";
_.location_name["491"]="Razorfen Kraul";
_.location_name["220"]="Red Cloud Mesa";
_.location_name["44"]="Redridge Mountains";
_.location_name["3429"]="Ruins of Ahn'Qiraj";
_.location_name["3968"]="Ruins of Lordaeron";
_.location_name["702"]="Rut'theran Village";
_.location_name["796"]="Scarlet Monastery";
_.location_name["2057"]="Scholomance";
_.location_name["51"]="Searing Gorge";
_.location_name["3607"]="Serpentshrine Cavern";
_.location_name["3791"]="Sethekk Halls";
_.location_name["3789"]="Shadow Labyrinth";
_.location_name["209"]="Shadowfang Keep";
_.location_name["188"]="Shadowglen";
_.location_name["3520"]="Shadowmoon Valley";
_.location_name["3703"]="Shattrath City";
_.location_name["1377"]="Silithus";
_.location_name["3487"]="Silvermoon City";
_.location_name["130"]="Silverpine Forest";
_.location_name["3679"]="Skettis";
_.location_name["406"]="Stonetalon Mountains";
_.location_name["1519"]="Stormwind City";
_.location_name["33"]="Stranglethorn Vale";
_.location_name["2017"]="Stratholme";
_.location_name["1417"]="Sunken Temple";
_.location_name["3431"]="Sunstrider Isle";
_.location_name["4075"]="Sunwell Plateau";
_.location_name["8"]="Swamp of Sorrows";
_.location_name["440"]="Tanaris";
_.location_name["141"]="Teldrassil";
_.location_name["3842"]="Tempest Keep";
_.location_name["3845"]="Tempest Keep";
_.location_name["3519"]="Terokkar Forest";
_.location_name["330"]="Thandol Span";
_.location_name["3848"]="The Arcatraz";
_.location_name["17"]="The Barrens";
_.location_name["3696"]="The Barrier Hills";
_.location_name["2366"]="The Black Morass";
_.location_name["3840"]="The Black Temple";
_.location_name["3713"]="The Blood Furnace";
_.location_name["3847"]="The Botanica";
_.location_name["1581"]="The Deadmines";
_.location_name["3557"]="The Exodar";
_.location_name["308"]="The Forbidding Sea";
_.location_name["214"]="The Great Sea";
_.location_name["207"]="The Great Sea";
_.location_name["47"]="The Hinterlands";
_.location_name["3849"]="The Mechanar";
_.location_name["3455"]="The North Sea";
_.location_name["3714"]="The Shattered Halls";
_.location_name["3717"]="The Slave Pens";
_.location_name["3715"]="The Steamvault";
_.location_name["717"]="The Stockade";
_.location_name["1477"]="The Temple of Atal'Hakkar";
_.location_name["3716"]="The Underbog";
_.location_name["457"]="The Veiled Sea";
_.location_name["293"]="Thoradin's Wall";
_.location_name["400"]="Thousand Needles";
_.location_name["1638"]="Thunder Bluff";
_.location_name["1769"]="Timbermaw Hold";
_.location_name["85"]="Tirisfal Glades";
_.location_name["3540"]="Twisting Nether";
_.location_name["1337"]="Uldaman";
_.location_name["1497"]="Undercity";
_.location_name["490"]="Un'Goro Crater";
_.location_name["363"]="Valley of Trials";
_.location_name["718"]="Wailing Caverns";
_.location_name["3277"]="Warsong Gulch";
_.location_name["28"]="Western Plaguelands";
_.location_name["40"]="Westfall";
_.location_name["11"]="Wetlands";
_.location_name["618"]="Winterspring";
_.location_name["3521"]="Zangarmarsh";
_.location_name["3805"]="Zul'Aman";
_.location_name["1176"]="Zul'Farrak";
_.location_name["1977"]="Zul'Gurub";
_.location_has_modes=[];
_.location_has_modes["3790"]="3790";
_.location_has_modes["3562"]="3562";
_.location_has_modes["4095"]="4095";
_.location_has_modes["3792"]="3792";
_.location_has_modes["2367"]="2367";
_.location_has_modes["3791"]="3791";
_.location_has_modes["3789"]="3789";
_.location_has_modes["3848"]="3848";
_.location_has_modes["2366"]="2366";
_.location_has_modes["3713"]="3713";
_.location_has_modes["3847"]="3847";
_.location_has_modes["3849"]="3849";
_.location_has_modes["3714"]="3714";
_.location_has_modes["3717"]="3717";
_.location_has_modes["3715"]="3715";
_.location_has_modes["3716"]="3716";
_.skill_line_id=[];
_.skill_line_id["355"]="Affliction";
_.skill_line_id["171"]="Alchemy";
_.skill_line_id["237"]="Arcane";
_.skill_line_id["26"]="Arms";
_.skill_line_id["253"]="Assassination";
_.skill_line_id["44"]="Axes";
_.skill_line_id["574"]="Balance";
_.skill_line_id["653"]="Bat";
_.skill_line_id["210"]="Bear";
_.skill_line_id["50"]="Beast Mastery";
_.skill_line_id["261"]="Beast Training";
_.skill_line_id["164"]="Blacksmithing";
_.skill_line_id["756"]="Blood Elf Racial";
_.skill_line_id["211"]="Boar";
_.skill_line_id["45"]="Bows";
_.skill_line_id["213"]="Carrion Bird";
_.skill_line_id["209"]="Cat";
_.skill_line_id["415"]="Cloth";
_.skill_line_id["38"]="Combat";
_.skill_line_id["185"]="Cooking";
_.skill_line_id["214"]="Crab";
_.skill_line_id["212"]="Crocilisk";
_.skill_line_id["226"]="Crossbows";
_.skill_line_id["173"]="Daggers";
_.skill_line_id["95"]="Defense";
_.skill_line_id["354"]="Demonology";
_.skill_line_id["593"]="Destruction";
_.skill_line_id["613"]="Discipline";
_.skill_line_id["207"]="Doomguard";
_.skill_line_id["760"]="Draenei Racial";
_.skill_line_id["763"]="Dragonhawk";
_.skill_line_id["118"]="Dual Wield";
_.skill_line_id["101"]="Dwarven Racial";
_.skill_line_id["375"]="Elemental Combat";
_.skill_line_id["333"]="Enchanting";
_.skill_line_id["202"]="Engineering";
_.skill_line_id["373"]="Enhancement";
_.skill_line_id["761"]="Felguard";
_.skill_line_id["189"]="Felhunter";
_.skill_line_id["134"]="Feral Combat";
_.skill_line_id["8"]="Fire";
_.skill_line_id["129"]="First Aid";
_.skill_line_id["356"]="Fishing";
_.skill_line_id["473"]="Fist Weapons";
_.skill_line_id["6"]="Frost";
_.skill_line_id["256"]="Fury";
_.skill_line_id["270"]="Generic";
_.skill_line_id["183"]="GENERIC (DND)";
_.skill_line_id["215"]="Gorilla";
_.skill_line_id["46"]="Guns";
_.skill_line_id["182"]="Herbalism";
_.skill_line_id["56"]="Holy";
_.skill_line_id["594"]="Holy";
_.skill_line_id["654"]="Hyena";
_.skill_line_id["188"]="Imp";
_.skill_line_id["206"]="Infernal";
_.skill_line_id["755"]="Jewelcrafting";
_.skill_line_id["98"]="Language: Common";
_.skill_line_id["113"]="Language: Darnassian";
_.skill_line_id["139"]="Language: Demon Tongue";
_.skill_line_id["138"]="Language: Draconic";
_.skill_line_id["759"]="Language: Draenei";
_.skill_line_id["111"]="Language: Dwarven";
_.skill_line_id["313"]="Language: Gnomish";
_.skill_line_id["673"]="Language: Gutterspeak";
_.skill_line_id["141"]="Language: Old Tongue";
_.skill_line_id["109"]="Language: Orcish";
_.skill_line_id["115"]="Language: Taurahe";
_.skill_line_id["137"]="Language: Thalassian";
_.skill_line_id["140"]="Language: Titan";
_.skill_line_id["315"]="Language: Troll";
_.skill_line_id["414"]="Leather";
_.skill_line_id["165"]="Leatherworking";
_.skill_line_id["633"]="Lockpicking";
_.skill_line_id["54"]="Maces";
_.skill_line_id["413"]="Mail";
_.skill_line_id["163"]="Marksmanship";
_.skill_line_id["186"]="Mining";
_.skill_line_id["764"]="Nether Ray";
_.skill_line_id["126"]="Night Elf Racial";
_.skill_line_id["125"]="Orc Racial";
_.skill_line_id["655"]="Owl";
_.skill_line_id["293"]="Plate Mail";
_.skill_line_id["40"]="Poisons";
_.skill_line_id["229"]="Polearms";
_.skill_line_id["257"]="Protection";
_.skill_line_id["267"]="Protection";
_.skill_line_id["753"]="Racial - Gnome";
_.skill_line_id["754"]="Racial - Human";
_.skill_line_id["733"]="Racial - Troll";
_.skill_line_id["220"]="Racial - Undead";
_.skill_line_id["217"]="Raptor";
_.skill_line_id["767"]="Ravager";
_.skill_line_id["573"]="Restoration";
_.skill_line_id["374"]="Restoration";
_.skill_line_id["184"]="Retribution";
_.skill_line_id["762"]="Riding";
_.skill_line_id["236"]="Scorpid";
_.skill_line_id["768"]="Serpent";
_.skill_line_id["78"]="Shadow Magic";
_.skill_line_id["433"]="Shield";
_.skill_line_id["393"]="Skinning";
_.skill_line_id["203"]="Spider";
_.skill_line_id["765"]="Sporebat";
_.skill_line_id["136"]="Staves";
_.skill_line_id["39"]="Subtlety";
_.skill_line_id["205"]="Succubus";
_.skill_line_id["51"]="Survival";
_.skill_line_id["43"]="Swords";
_.skill_line_id["197"]="Tailoring";
_.skill_line_id["218"]="Tallstrider";
_.skill_line_id["124"]="Tauren Racial";
_.skill_line_id["176"]="Thrown";
_.skill_line_id["251"]="Turtle";
_.skill_line_id["172"]="Two-Handed Axes";
_.skill_line_id["160"]="Two-Handed Maces";
_.skill_line_id["55"]="Two-Handed Swords";
_.skill_line_id["162"]="Unarmed";
_.skill_line_id["204"]="Voidwalker";
_.skill_line_id["228"]="Wands";
_.skill_line_id["766"]="Warp Stalker";
_.skill_line_id["656"]="Wind Serpent";
_.skill_line_id["208"]="Wolf";
_.filter_required_skill_line_id=[];
_.filter_required_skill_line_id["171"]="Alchemy";
_.filter_required_skill_line_id["164"]="Blacksmithing";
_.filter_required_skill_line_id["185"]="Cooking";
_.filter_required_skill_line_id["333"]="Enchanting";
_.filter_required_skill_line_id["202"]="Engineering";
_.filter_required_skill_line_id["129"]="First Aid";
_.filter_required_skill_line_id["356"]="Fishing";
_.filter_required_skill_line_id["182"]="Herbalism";
_.filter_required_skill_line_id["148"]="Horse Riding";
_.filter_required_skill_line_id["755"]="Jewelcrafting";
_.filter_required_skill_line_id["165"]="Leatherworking";
_.filter_required_skill_line_id["186"]="Mining";
_.filter_required_skill_line_id["533"]="Raptor Riding";
_.filter_required_skill_line_id["762"]="Riding";
_.filter_required_skill_line_id["197"]="Tailoring";
_.filter_required_skill_line_id["150"]="Tiger Riding";
_.filter_required_skill_line_id["554"]="Undead Horsemanship";
_.filter_crafted_by=[];
_.filter_crafted_by["171"]="Alchemy";
_.filter_crafted_by["164"]="Blacksmithing";
_.filter_crafted_by["185"]="Cooking";
_.filter_crafted_by["333"]="Enchanting";
_.filter_crafted_by["202"]="Engineering";
_.filter_crafted_by["129"]="First Aid";
_.filter_crafted_by["755"]="Jewelcrafting";
_.filter_crafted_by["165"]="Leatherworking";
_.filter_crafted_by["186"]="Mining";
_.filter_crafted_by["197"]="Tailoring";
_.filter_reagent_for=[];
_.filter_reagent_for["171"]="Alchemy";
_.filter_reagent_for["164"]="Blacksmithing";
_.filter_reagent_for["185"]="Cooking";
_.filter_reagent_for["333"]="Enchanting";
_.filter_reagent_for["202"]="Engineering";
_.filter_reagent_for["129"]="First Aid";
_.filter_reagent_for["755"]="Jewelcrafting";
_.filter_reagent_for["165"]="Leatherworking";
_.filter_reagent_for["186"]="Mining";
_.filter_reagent_for["197"]="Tailoring";
_.talent_category_id=[];
_.talent_category_id["6"]="Frost";
_.talent_category_id["8"]="Fire";
_.talent_category_id["26"]="Arms";
_.talent_category_id["38"]="Combat";
_.talent_category_id["39"]="Subtlety";
_.talent_category_id["50"]="Beast Mastery";
_.talent_category_id["51"]="Survival";
_.talent_category_id["56"]="Holy";
_.talent_category_id["78"]="Shadow";
_.talent_category_id["134"]="Feral Combat";
_.talent_category_id["163"]="Marksmanship";
_.talent_category_id["184"]="Retribution";
_.talent_category_id["237"]="Arcane";
_.talent_category_id["253"]="Assassination";
_.talent_category_id["256"]="Fury";
_.talent_category_id["257"]="Protection";
_.talent_category_id["267"]="Protection";
_.talent_category_id["354"]="Demonology";
_.talent_category_id["355"]="Affliction";
_.talent_category_id["373"]="Enhancement";
_.talent_category_id["374"]="Restoration";
_.talent_category_id["375"]="Elemental";
_.talent_category_id["573"]="Restoration";
_.talent_category_id["574"]="Balance";
_.talent_category_id["593"]="Destruction";
_.talent_category_id["594"]="Holy";
_.talent_category_id["613"]="Discipline";
_.item_type=[];
_.item_type["-1.-1"]="";
_.item_type["0"]="-";
_.item_type["1"]="View Images";
_.item_type["0.2"]="Elixir";
_.item_type["0.3"]="Flask";
_.item_type["0.4"]="Scroll";
_.item_type["0.5"]="Food & Drink";
_.item_type["0.6"]="Item Enhancement";
_.item_type["0.7"]="Bandage";
_.item_type["0.8"]="Other";
_.item_type["1.0"]="Bag";
_.item_type["1.1"]="Soul Bag";
_.item_type["1.2"]="Herb Bag";
_.item_type["1.3"]="Enchanting Bag";
_.item_type["1.4"]="Engineering Bag";
_.item_type["1.5"]="Gem Bag";
_.item_type["1.6"]="Mining Bag";
_.item_type["1.7"]="Leatherworking Bag";
_.item_type["2.0"]="One-Handed Axes";
_.item_type["2.1"]="Two-Handed Axes";
_.item_type["2.2"]="Bows";
_.item_type["2.3"]="Guns";
_.item_type["2.4"]="One-Handed Maces";
_.item_type["2.5"]="Two-Handed Maces";
_.item_type["2.6"]="Polearms";
_.item_type["2.7"]="One-Handed Swords";
_.item_type["2.8"]="Two-Handed Swords";
_.item_type["2.9"]="";
_.item_type["2.10"]="Staves";
_.item_type["2.11"]="";
_.item_type["2.12"]="";
_.item_type["2.13"]="Fist Weapons";
_.item_type["2.14"]="Miscellaneous";
_.item_type["2.15"]="Daggers";
_.item_type["2.16"]="Thrown";
_.item_type["2.17"]="";
_.item_type["2.18"]="Crossbows";
_.item_type["2.19"]="Wands";
_.item_type["2.20"]="Fishing Poles";
_.item_type["3.0"]="Red";
_.item_type["3.1"]="Blue";
_.item_type["3.2"]="Yellow";
_.item_type["3.3"]="Purple";
_.item_type["3.4"]="Green";
_.item_type["3.5"]="Orange";
_.item_type["3.6"]="Meta";
_.item_type["3.7"]="Simple";
_.item_type["3.8"]="Prismatic";
_.item_type["4.-5"]="Off-hand Frills";
_.item_type["4.-4"]="Trinkets";
_.item_type["4.-3"]="Amulets";
_.item_type["4.-2"]="Rings";
_.item_type["4.-1"]="Cloaks";
_.item_type["4.0"]="Miscellaneous";
_.item_type["4.1"]="Cloth";
_.item_type["4.2"]="Leather";
_.item_type["4.3"]="Mail";
_.item_type["4.4"]="Plate";
_.item_type["4.5"]="";
_.item_type["4.6"]="Shields";
_.item_type["4.7"]="Librams";
_.item_type["4.8"]="Idols";
_.item_type["4.9"]="Totems";
_.item_type["5.0"]="Reagent";
_.item_type["6.0"]="";
_.item_type["6.1"]="";
_.item_type["6.2"]="Arrow";
_.item_type["6.3"]="Bullet";
_.item_type["6.4"]="";
_.item_type["7.0"]="Trade Goods";
_.item_type["7.1"]="Parts";
_.item_type["7.2"]="Explosives";
_.item_type["7.3"]="Devices";
_.item_type["7.4"]="Jewelcrafting";
_.item_type["7.5"]="Cloth";
_.item_type["7.6"]="Leather";
_.item_type["7.7"]="Metal & Stone";
_.item_type["7.8"]="Meat";
_.item_type["7.9"]="Herb";
_.item_type["7.10"]="Elemental";
_.item_type["7.11"]="Other";
_.item_type["7.12"]="Enchanting";
_.item_type["7.13"]="Materials";
_.item_type["8.0"]="";
_.item_type["9.0"]="Book";
_.item_type["9.1"]="Leatherworking";
_.item_type["9.2"]="Tailoring";
_.item_type["9.3"]="Engineering";
_.item_type["9.4"]="Blacksmithing";
_.item_type["9.5"]="Cooking";
_.item_type["9.6"]="Alchemy";
_.item_type["9.7"]="First Aid";
_.item_type["9.8"]="Enchanting";
_.item_type["9.9"]="Fishing";
_.item_type["9.10"]="Jewelcrafting";
_.item_type["10.0"]="";
_.item_type["11.0"]="";
_.item_type["11.1"]="";
_.item_type["11.2"]="Quiver";
_.item_type["11.3"]="Ammo Pouch";
_.item_type["12.0"]="Quest";
_.item_type["13.0"]="Key";
_.item_type["13.1"]="";
_.item_type["14.0"]="Permanent";
_.item_type["15.-1"]="Mounts";
_.item_type["15.0"]="Junk";
_.item_type["15.1"]="Reagent";
_.item_type["15.2"]="Pet";
_.item_type["15.3"]="Holiday";
_.item_type["15.4"]="Other";
_.item_type["15.5"]="";
_.faction_id=[];
_.faction_id["469"]="Alliance";
_.faction_id["891"]="Alliance Forces";
_.faction_id["529"]="Argent Dawn";
_.faction_id["1012"]="Ashtongue Deathsworn";
_.faction_id["87"]="Bloodsail Buccaneers";
_.faction_id["21"]="Booty Bay";
_.faction_id["910"]="Brood of Nozdormu";
_.faction_id["609"]="Cenarion Circle";
_.faction_id["942"]="Cenarion Expedition";
_.faction_id["909"]="Darkmoon Faire";
_.faction_id["530"]="Darkspear Trolls";
_.faction_id["69"]="Darnassus";
_.faction_id["577"]="Everlook";
_.faction_id["930"]="Exodar";
_.faction_id["729"]="Frostwolf Clan";
_.faction_id["369"]="Gadgetzan";
_.faction_id["92"]="Gelkis Clan Centaur";
_.faction_id["54"]="Gnomeregan Exiles";
_.faction_id["946"]="Honor Hold";
_.faction_id["67"]="Horde";
_.faction_id["892"]="Horde Forces";
_.faction_id["749"]="Hydraxian Waterlords";
_.faction_id["47"]="Ironforge";
_.faction_id["989"]="Keepers of Time";
_.faction_id["978"]="Kurenai";
_.faction_id["1011"]="Lower City";
_.faction_id["93"]="Magram Clan Centaur";
_.faction_id["1015"]="Netherwing";
_.faction_id["1038"]="Ogri'la";
_.faction_id["76"]="Orgrimmar";
_.faction_id["980"]="Outland";
_.faction_id["470"]="Ratchet";
_.faction_id["349"]="Ravenholdt";
_.faction_id["1031"]="Sha'tari Skyguard";
_.faction_id["1077"]="Shattered Sun Offensive";
_.faction_id["936"]="Shattrath City";
_.faction_id["809"]="Shen'dralar";
_.faction_id["911"]="Silvermoon City";
_.faction_id["890"]="Silverwing Sentinels";
_.faction_id["970"]="Sporeggar";
_.faction_id["169"]="Steamwheedle Cartel";
_.faction_id["730"]="Stormpike Guard";
_.faction_id["72"]="Stormwind";
_.faction_id["70"]="Syndicate";
_.faction_id["932"]="The Aldor";
_.faction_id["933"]="The Consortium";
_.faction_id["510"]="The Defilers";
_.faction_id["509"]="The League of Arathor";
_.faction_id["941"]="The Mag'har";
_.faction_id["990"]="The Scale of the Sands";
_.faction_id["934"]="The Scryers";
_.faction_id["935"]="The Sha'tar";
_.faction_id["967"]="The Violet Eye";
_.faction_id["59"]="Thorium Brotherhood";
_.faction_id["947"]="Thrallmar";
_.faction_id["81"]="Thunder Bluff";
_.faction_id["576"]="Timbermaw Hold";
_.faction_id["922"]="Tranquillien";
_.faction_id["68"]="Undercity";
_.faction_id["889"]="Warsong Outriders";
_.faction_id["471"]="Wildhammer Clan";
_.faction_id["589"]="Wintersaber Trainers";
_.faction_id["270"]="Zandalar Tribe";
_.entity_label=[];
_.entity_label["1"]="Item";
_.entity_label["2"]="NPC";
_.entity_label["3"]="Zone";
_.entity_label["4"]="Quest";
_.entity_label["5"]="Object";
_.entity_label["6"]="Spell";
_.entity_label["7"]="Item Set";
_.entity_label["8"]="Faction";
_.entity_label["9"]="";
_.entity_label["20"]="";
_.entity_label["100"]="";
_.entity_label["101"]="";
_.entity_label["102"]="";
_.entity_label["103"]="";
_.entity_label["104"]="";
_.entity_label["105"]="";
_.entity_label["106"]="";
_.entity_label["109"]="";
_.entity_label["110"]="";
_.entity_link=[];
_.entity_link["1"]="item.php";
_.entity_link["2"]="npc.aspx";
_.entity_link["3"]="location.aspx";
_.entity_link["4"]="quest.aspx";
_.entity_link["5"]="object.aspx";
_.entity_link["6"]="spell.aspx";
_.entity_link["7"]="itemset.aspx";
_.entity_link["8"]="faction.aspx";
_.entity_link["9"]="profile.aspx";
_.entity_link["20"]="";
_.entity_link["100"]="";
_.entity_link["101"]="";
_.entity_link["102"]="";
_.entity_link["103"]="";
_.entity_link["104"]="";
_.entity_link["105"]="talent.aspx";
_.entity_link["106"]="wishlist.aspx";
_.entity_link["109"]="";
_.entity_link["110"]="";
};

Curse.Lookup.initialize();

var mn_1_1_1=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 01"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 01"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 01"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 01"]];
var mn_1_1_2=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 02"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 02"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 02"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 02"]];
var mn_1_1_3=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 03"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 03"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 03"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 03"]];
var mn_1_1_4=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 04"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 04"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 04"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 04"]];
var mn_1_1_5=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 05"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 05"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 05"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 05"]];
var mn_1_1_6=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 06"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 06"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 06"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 06"]];
var mn_1_1_7=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 07"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 07"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 07"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 07"]];
var mn_1_1_8=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 08"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 08"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 08"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 08"]];
var mn_1_1_9=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 09"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 09"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 09"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 09"]];
var mn_1_1_10=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 10"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 10"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 10"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 10"]];

var mn_1_2_1=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 11"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 11"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 11"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 11"]];
var mn_1_2_2=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 12"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 12"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 12"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 12"]];
var mn_1_2_3=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 13"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 13"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 13"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 13"]];
var mn_1_2_4=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 14"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 14"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 14"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 14"]];
var mn_1_2_5=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 15"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 15"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 15"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 15"]];
var mn_1_2_6=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 16"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 16"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 16"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 16"]];
var mn_1_2_7=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 17"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 17"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 17"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 17"]];
var mn_1_2_8=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 18"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 18"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 18"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 18"]];
var mn_1_2_9=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 19"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 19"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 19"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 19"]];
var mn_1_2_10=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 20"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 20"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 20"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 20"]];

var mn_1_3_1=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 21"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 21"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 21"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 21"]];
var mn_1_3_2=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 22"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 22"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 22"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 22"]];
var mn_1_3_3=[[0,"Artists","search.php?xv=1&xt=13&xs=Series 23"],[1,"Basics","search.php?xv=1&xt=3&xs=Series 23"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series 23"],[3,"Standard","search.php?xv=1&xt=9&xs=Series 23"]];


var mn_1_1=[[1,"Series 01","series.php#tabs-1",mn_1_1_1],[2,"Series 02","series.php#tabs-2",mn_1_1_2],[3,"Series 03","series.php#tabs-3",mn_1_1_3],[4,"Series 04","series.php#tabs-4",mn_1_1_4],[5,"Series 05","series.php#tabs-5",mn_1_1_5],[6,"Series 06","series.php#tabs-6",mn_1_1_6],[7,"Series 07","series.php#tabs-7",mn_1_1_7],[8,"Series 08","series.php#tabs-8",mn_1_1_8],[9,"Series 09","series.php#tabs-9",mn_1_1_9],[10,"Series 10","series.php#tabs-10",mn_1_1_10,]];
var mn_1_2=[[11,"Series 11","series.php#tabs-11",mn_1_2_1],[12,"Series 12","series.php#tabs-12",mn_1_2_2],[13,"Series 13","series.php#tabs-13",mn_1_2_3],[14,"Series 14","series.php#tabs-14",mn_1_2_4],[15,"Series 15","series.php#tabs-15",mn_1_2_5],[16,"Series 16","series.php#tabs-16",mn_1_2_6],[17,"Series 17","series.php#tabs-17",mn_1_2_7],[18,"Series 18","series.php#tabs-18",mn_1_2_8],[19,"Series 19","series.php#tabs-19",mn_1_2_9],[20,"Series 20","series.php#tabs-20",mn_1_2_10]];
var mn_1_3=[[21,"Series 21","series.php#tabs-21",mn_1_3_1],[22,"Series 22","series.php#tabs-22",mn_1_3_2],[23,"Series 23","series.php#tabs-23",mn_1_3_3]];

var mn_1=[[1,"Series 01-10","series_01-10.php#tabs-1",mn_1_1],[2,"Series 11-20","series_11-20.php#tabs-11",mn_1_2],[3,"Series 21-30","series_21-30.php#tabs-21",mn_1_3]];
var mn_2=[[0,"Artists","search.php?xv=1&xt=13&xs=Series"],[1,"Basics","search.php?xv=1&xt=3&xs=Series"],[2,"Secrets","search.php?xv=1&xt=2&xs=Series"],[3,"Standard","search.php?xv=1&xt=9&xs=Series"]];
var mn_3=[[0,"Christmas","search.php?xv=1&xt=8"],[1,"Halloween","search.php?xv=1&xt=10"],[2,"New Year","search.php?xv=1&xt=12"],[3,"Valentine","search.php?xv=1&xt=4"]]; 
var mn_4=[[0,"50%","search.php?xv=1&xf=2"],[1,"70%","search.php?xv=1&xf=3"],[2,"100%","search.php?xv=1&xf=4"],[3,"200%","search.php?xv=1&xf=11"],[4,"400%","search.php?xv=1&xf=5"],[5,"1000%","search.php?xv=1&xf=6"],[6,"Other","search.php?xv=1&xf=10"]];
var mn_5=[[14,"Chogokin <font color=red>New!</font>",],[0,"Events","search.php?xv=2&xe=all"],[8,"Flocked",],[3,"Fragranced",],[2,"Glow in the Dark",],[7,"Key Chain",],[18,"Kubrick set <font color=red>New!</font>",],[0,"Not for Sale","search.php?xv=1&xt=11"],[0,"Sold in Set","search.php?xv=2&xse=all"],[6,"Thermo",],[5,"Special Display",],[4,"Wood",]];
var mn_8=[[0,"Your Collection","collection.php",],[2,"Your Gallery","gallery.php",],[3,"Settings","account.php",]];

var mn_Main=[[1,"Series","/",mn_1],[2,"Series Types","/",mn_2],[3,"Themes","/",mn_3],[4,"Formats","/",mn_4],[5,"Specials","/",mn_5],[8,"Members","/",mn_8],[10,"Collections","gallery.php",],[10,"Statistics","stats.php",]];



Curse.SelectBox=function(args)

{if(typeof args.container=="string")
{this.container=cg_ge(args.container);}
else
{this.container=args.container;}
var a=cg_ce("a");a.className="curse-select-box";a.onclick=this.toggle.bind(this);cg_ds(a);this.aSelectBox=a;if(args.selectedIndex)
{this.selectedIndex=args.selectedIndex}
else
{this.selectedIndex=0;}
cg_ae(this.container,a);var divOptionsContainer=cg_ce("div");divOptionsContainer.className="curse-select-options";divOptionsContainer.style.display="none";this.divOptionsContainer=divOptionsContainer;this.options=args.options;this.divOptions=[];for(var i=0;i<this.options.length;i++)
{var a=cg_ce("a");var value=this.options[i][0];var label=this.options[i][1];a.onclick=this.handleClick.bind(this,args.parent,i,args.onClick,args.onClickArgs);cg_ae(a,cg_ct(label));cg_ae(divOptionsContainer,a);this.divOptions.push(a);}
cg_ae(divOptionsContainer,cg_ce("div"));this.divOptions[this.selectedIndex].className="selected";this.visible=false;this.aSelectBox.innerHTML=args.options[this.selectedIndex][1];cg_ae(this.container,divOptionsContainer);}
Curse.SelectBox.prototype={show:function()
{this.visible=true;this.divOptionsContainer.style.display="block";},hide:function()
{this.visible=false;this.divOptionsContainer.style.display="none";},toggle:function()
{if(this.visible)
{this.hide();}
else
{this.show();}},handleClick:function(parent,index,onClick,onClickArgs)
{this.hide();this.divOptions[this.selectedIndex].className="";this.selectedIndex=index;this.divOptions[this.selectedIndex].className="selected";var value=this.options[index][0];this.aSelectBox.innerHTML=this.options[this.selectedIndex][1];parent[onClick](value,onClickArgs);}}
if(!Curse){var Curse={};}
Curse.Icon=function(size,id,link,relatedID,elementID,overFn,overArgs,outFn,outArgs,num,quantity,showNum,spritePath,spritePosition)
{return this.initialize(size,id,link,relatedID,elementID,overFn,overArgs,outFn,outArgs,num,quantity,showNum,spritePath,spritePosition);}
Curse.Icon.prototype={sizes:["small","medium","large"],paths:["s","m","l"],initialize:function(size,id,link,relatedID,elementID,overFn,overArgs,outFn,outArgs,num,quantity,showNum,spritePath,spritePosition)
{var icon=cg_ce("div");icon.className="icon"+this.sizes[size];var tile=cg_ce("div");tile.className="tile";if(elementID)
{icon.id=elementID;}
if(spritePath!=null)
{var sprite=cg_ce("div");sprite.className="sprite";sprite.style.backgroundImage="url("+spritePath+")";if(spritePosition)
{sprite.style.backgroundPosition=spritePosition;}
cg_ae(icon,sprite);var border=cg_ce("var");cg_ae(tile,border);icon.divSprite=sprite;icon.varBorder=border;}
else
{icon.style.backgroundImage="url(icons/"+this.paths[size]+"/"+id+".gif)";}
if(link||overFn)
{var a=cg_ce("a");if(relatedID)
{a._relatedID=relatedID;icon.aLink=a;}
if(overFn)
{a.onmouseover=overFn.bind(this,a,overArgs);}
if(outFn)
{a.onmouseout=outFn.bind(this,a,outArgs);}
if(link){a.href=link;}
else // EDITO MIGHT BE IMPORTANT TO UNDERSTAND cg_ae
{a.href="javascript:;";cg_ds(a);}
cg_ae(tile,a);}
if(showNum||(num!=null&&(num>1||num.length))){var shadowText=cg_getShadowText(num,"r1");shadowText.style.right="0";shadowText.style.bottom="0";shadowText.style.position="absolute";cg_ae(tile,shadowText);}
if(quantity!=null&&quantity>0){var shadowText=cg_getShadowText("("+quantity+")","r");shadowText.style.left="0";shadowText.style.top="0";shadowText.style.position="absolute";cg_ae(tile,shadowText);}
cg_ae(icon,tile);return icon;},over:function(){if(this.relatedTooltip!=null){Tooltip.show(this,this.relatedTooltip,0,0);}},out:function(){Tooltip.hide();}};Curse.TextFormatter={causesLineBreak:function(tagName)
{if(tagName=="[th]"||tagName=="[/th]"||tagName=="[td]"||tagName=="[/td]"||tagName=="[tr]"||tagName=="[/tr]"||tagName=="[table]"||tagName=="[/table]"||tagName=="[h4]"||tagName=="[/h4]"||tagName=="[h]"||tagName=="[/h]"||tagName=="[/li]"||tagName=="[ul]"||tagName=="[/ul]"||tagName=="[ol]"||tagName=="[/ol]"||tagName=="[/quote]"||tagName=="[/item]"||tagName=="[/spell]")
{return true;}
return false;},getFormattedText:function(rawText,previewMode,handleBreaks)
{var startTime=new Date();var newLineCount=0;var noSpacesCount=0;var newText="";var headerCount=0;var newText="";var newTextArray=[];if(handleBreaks==null)
{handleBreaks=true;}
if(handleBreaks)
{for(var i=0;i<rawText.length;i++)
{if(rawText.charAt(i)!=" "&&rawText.charAt(i)!="\n")
{noSpacesCount+=1;}
else
{noSpacesCount=0;}
if(rawText.charAt(i)=="\n")
{newLineCount+=1;if(newLineCount<=2)
{var lastTag="";var nextTag="";if(i>=1)
{if(rawText.substr(i-1,1)=="]")
{var tagStart=rawText.substr(0,i).lastIndexOf("[");if(tagStart>=0)
{var tagLength=i-1-tagStart;lastTag=rawText.substr(tagStart,tagLength+1);}}
if(rawText.substr(i+1,1)=="[")
{var tagEnd=rawText.substring(i+1).indexOf("]");if(tagEnd>=0)
{nextTag=rawText.substr(i+1,tagEnd+1);}}}
if(i+3<rawText.length&&!Curse.TextFormatter.causesLineBreak(nextTag)&&!Curse.TextFormatter.causesLineBreak(lastTag))
{newTextArray.push("<br>");}}}
else
{newLineCount=0;newTextArray.push(rawText.charAt(i));}
if(noSpacesCount>200)
{if(rawText.charAt(i+1)!=";"&&rawText.charAt(i+2)!=";"&&rawText.charAt(i+3)!=";")
{newTextArray.push(" ");noSpacesCount=0;}}}
newText=newTextArray.join("");}
else
{newText=rawText.replace(/\n\n(?!\[h)/g,"<br><br>");}
if(newText.indexOf("[")==-1){return newText;}
if(typeof(getMoneyHTML)!="undefined")
{newText=getMoneyHTML(newText);}
if(typeof(getEntityLink)!="undefined")
{newText=getEntityLink(newText,"npc");newText=getEntityLink(newText,"itemset");newText=getEntityLink(newText,"faction");newText=getEntityLink(newText,"quest");newText=getEntityLink(newText,"location");newText=getEntityLink(newText,"object");}
if(typeof(getTooltipLinks)!="undefined")
{newText=getTooltipLinks(newText,"item",getFullItemLink,previewMode);newText=getTooltipLinks(newText,"itemlink",getTextItemLink,previewMode);newText=getTooltipLinks(newText,"itemicon",getIconItemLink,previewMode);newText=getTooltipLinks(newText,"spell",getFullSpellLink,previewMode);newText=getTooltipLinks(newText,"spelllink",getTextSpellLink,previewMode);newText=getTooltipLinks(newText,"spellicon",getIconSpellLink,previewMode);}
newText=newText.replace(/\[b\]/g,"<b>").replace(/\[\/b\]/g,"</b>");newText=newText.replace(/\[table\]/g,"<table>").replace(/\[\/table\]/g,"</table>");newText=newText.replace(/\[tr\]/g,"<tr>").replace(/\[\/tr\]/g,"</tr>");newText=newText.replace(/\[td\]/g,"<td>").replace(/\[\/td\]/g,"</td>");newText=newText.replace(/\[th\]/g,"<th>").replace(/\[\/th\]/g,"</th>");newText=newText.replace(/\[i\]/g,"<i>").replace(/\[\/i\]/g,"</i>");newText=newText.replace(/\[u\]/g,"<u>").replace(/\[\/u\]/g,"</u>");newText=newText.replace(/\[s\]/g,"<s>").replace(/\[\/s\]/g,"</s>");newText=newText.replace(/\[ul\]/g,"<ul>").replace(/\[\/ul\]/g,"</ul>");newText=newText.replace(/\[ol\]/g,"<ol>").replace(/\[\/ol\]/g,"</ol>");newText=newText.replace(/\[li\]/g,"<li><div>").replace(/\[\/li\]/g,"</div></li>");newText=newText.replace(/\[small\]/g,"<small>").replace(/\[\/small\]/g,"</small>");newText=newText.replace(/\[center\]/g,"<center>").replace(/\[\/center\]/g,"</center>");newText=newText.replace(/\[quote\]/g,"<div class=\"quote\">").replace(/\[\/quote\]/g,"</div>");var headerRegex=/\[(h([0-9])?)\]/;var headerMatch=headerRegex.exec(newText);while(headerMatch!=null)
{var currentHeaderTag="h3";if(headerMatch[2]!=null)
{currentHeaderTag="h"+headerMatch[2];}
headerCount+=1;if(headerMatch.index==0&&headerCount==1)
{newText=newText.replace(headerRegex,"<"+currentHeaderTag+" class=\"first\">");}
else
{newText=newText.replace(headerRegex,"<"+currentHeaderTag+">");}
newText=newText.replace(/\[\/h(?:[0-9])?\]/,"</"+currentHeaderTag+">");headerMatch=headerRegex.exec(newText);}
newText=newText.replace(/\[\/span\]/g,"</span>");var spanRegex=/\[span(.*?)\]/;var spanMatch=spanRegex.exec(newText);while(spanMatch!=null)
{newText=newText.replace(spanRegex,"<span "+spanMatch[1]+">");spanMatch=spanRegex.exec(newText);}
var thRegex=/\[th (.*?)\]/;var thMatch=thRegex.exec(newText);while(thMatch!=null)
{newText=newText.replace(thRegex,"<th "+thMatch[1]+">");thMatch=thRegex.exec(newText);}
var tdRegex=/\[td (.*?)\]/;var tdMatch=tdRegex.exec(newText);while(tdMatch!=null)
{newText=newText.replace(tdRegex,"<td "+tdMatch[1]+">");tdMatch=tdRegex.exec(newText);}
var liRegex=/\[li (.*?)\]/;var liMatch=liRegex.exec(newText);while(liMatch!=null)
{newText=newText.replace(liRegex,"<li "+liMatch[1]+"><div>");liMatch=liRegex.exec(newText);}
var urlRegex=/\[url=(.*?)\](.*?)\[\/url\]/;var urlRegexMatch=urlRegex.exec(newText);while(urlRegexMatch!=null)
{if(urlRegexMatch[1].indexOf("http://")>0)
{newText=newText.replace(urlRegex,"<a href=\""+urlRegexMatch[1]+"\">"+urlRegexMatch[2]+"</a>");}
else
{newText=newText.replace(urlRegex,"<a target=\"_blank\" href=\""+urlRegexMatch[1]+"\">"+urlRegexMatch[2]+"</a>");}
urlRegexMatch=urlRegex.exec(newText);}
var endTime=new Date();return newText;}}
Curse.TextEditor={currentRange:null,editorNumber:1,getForm:function(formAction,formID,formHiddenFields,formBodyID,formBodyValue,formBodyFocusEvent,formBodyCols,formBodyRows,formEntryLimit,formVerification,formButtons,formAdditionalInput,formInputDisabled)
{var editorDiv=document.createElement("div");editorDiv.id="editor_"+Curse.TextEditor.editorNumber++;editorDiv.className="editor";if(formAction==null||formAction=="")
{formAction="postComment.aspx";}
if(formID==null||formID=="")
{formID="formComment";}
var lineCount=0;if(formBodyValue!=null&&formBodyValue!="")
{lineCount=formBodyValue.split("\n").length;}
if(lineCount>formBodyRows)
{formBodyRows=lineCount;}
var textEditorHTML="";if(!formInputDisabled)
{textEditorHTML+="<div class=\"editor-mode-links\">"+Localization.mode+":<a class=\"selected\" onclick=\"Curse.TextEditor.toggleMode(this,'edit');\">"+Localization.edit+"</a>|<a onclick=\"Curse.TextEditor.toggleMode(this,'preview');\">"+Localization.preview+"</a></div><div class=\"editor-preview\"></div>";}
textEditorHTML+="<div class=\"editor-formatting-buttons\">";textEditorHTML+="<button style=\"margin-left: 3px;\" onclick=\"Curse.TextEditor.applyTag(this,'b');\">B</button><button onclick=\"Curse.TextEditor.applyTag(this,'i');\"><i>I</i></button><button onclick=\"Curse.TextEditor.applyTag(this,'u');\"><u>U</u></button><button onclick=\"Curse.TextEditor.applyTag(this,'s');\"><s>"+Localization.strike+"</s></button><button onclick=\"Curse.TextEditor.applyTag(this,'small');\"><small>"+Localization.small+"</small></button><button style=\"background: url(images/button_quote.gif) no-repeat; background-position: center;width: 22px;\"  onclick=\"Curse.TextEditor.applyTag(this,'quote');\">&nbsp;</button><button onclick=\"Curse.TextEditor.applyTag(this,'h');\">"+Localization.header+"</button><button onclick=\"Curse.TextEditor.applyElement(this,'ul');\" style=\"background: url(images/button_ul.gif) no-repeat; background-position: center;width: 23px;\">&nbsp;</button><button onclick=\"Curse.TextEditor.applyElement(this,'ol');\" style=\"background: url(images/button_ol.gif) no-repeat; background-position: center;width: 23px;\">&nbsp;</button><button onclick=\"Curse.TextEditor.displayURLPrompt(event,'"+editorDiv.id+"');\" style=\"background: url(images/button_hyperlink.gif) no-repeat; background-position: center;width: 23px;\">&nbsp;</button>";textEditorHTML+="</div>";if(formInputDisabled)
{textEditorHTML=textEditorHTML.replace(/\<button/g,"<button disabled");}
if(formAction!="noform")
{textEditorHTML+="<form onsubmit=\"return false;\" method=\"post\" action=\""+formAction+"\" name=\""+formID+"\" id=\""+formID+"\">";}
formHiddenFields=formHiddenFields.split(",");for(var i=0;i<formHiddenFields.length;i++)
{var currentField=formHiddenFields[i].split("=");textEditorHTML+="<input type=\"hidden\" name=\""+currentField[0]+"\" id=\""+currentField[0]+"\" value=\""+currentField[1]+"\"/>";}
textEditorHTML+="<textarea ";if(formInputDisabled)
{textEditorHTML+="disabled ";}
if(Curse.Browser.ie)
{textEditorHTML+="onpaste=\"Curse.TextEditor.resize(this);\" onchange=\"Curse.TextEditor.resize(this);\" onkeydown=\"Curse.TextEditor.resize(this, event)\" onkeyup=\"Curse.TextEditor.resize(this)\"";}
else
{textEditorHTML+="oninput=\"Curse.TextEditor.resize(this,event)\"";}
if(formBodyFocusEvent!=null&&formBodyFocusEvent!="")
{textEditorHTML+=" onfocus=\""+formBodyFocusEvent+"\"";}
textEditorHTML+=" name=\""+formBodyID+"\" id=\""+formBodyID+"\"";if(formBodyCols!=null)
{textEditorHTML+=" cols=\""+formBodyCols+"\"";}
if(formBodyRows!=null)
{textEditorHTML+=" rows=\""+formBodyRows+"\"";}
textEditorHTML+=" style=\"overflow: visible;\">";if(formBodyValue!=null&&formBodyValue!="")
{textEditorHTML+=formBodyValue;}
textEditorHTML+="</textarea>";if(formEntryLimit!=null&&formEntryLimit!="")
{textEditorHTML+="<br/><small> "+Localization.replace("char_enter_note",formEntryLimit)+"</small>";}
if(formAdditionalInput)
{textEditorHTML+="<div class=\"editor-input\">";textEditorHTML+=formAdditionalInput;textEditorHTML+="</div>";}
if(formVerification)
{}
if(formAction!="noform")
{textEditorHTML+="</form>";}
textEditorHTML+="<div class=\"editor-buttons\">";if(!formButtons)
{textEditorHTML+="<button class=\"smallButton\" onclick=\"Curse.Comment.handleEditFormSubmit(this)\"><span>"+Localization.save+"</span></button>&nbsp;<button class=\"smallButton\" onclick=\"Curse.Comment.cancelEdit(this)\"><span>"+Localization.cancel+"</span></button>";}
else
{formButtons=formButtons.split("|");for(var i=0;i<formButtons.length;i++)
{var currentButton=formButtons[i].split("^");textEditorHTML+="<button ";if(formInputDisabled)
{textEditorHTML+="Disabled\"";}
else
{textEditorHTML+="\" onclick=\""+currentButton[0]+"\"";}
textEditorHTML+="><span>"+currentButton[1]+"</span></button>";}}
textEditorHTML+="</div>";editorDiv.innerHTML=textEditorHTML;return editorDiv;},applyElement:function(source,elementName,elementArguments)
{var form=null;if(source.className=="editor")
{form=source.getElementsByTagName("form")[0];}
else
{form=source.parentNode.parentNode.getElementsByTagName("form")[0];}
var input=form.getElementsByTagName("textarea")[0];input.focus();if(typeof document.selection!='undefined'){var range=null;if(Curse.TextEditor.currentRange)
{range=Curse.TextEditor.currentRange;}
else
{range=document.selection.createRange();}
var insText=range.text;newText=Curse.TextEditor.getEditorElement(elementName,insText,elementArguments);if(newText=="")
{return;}
range.text=newText;range.select();}
else if(typeof input.selectionStart!='undefined'){var start=input.selectionStart;var end=input.selectionEnd;var insText=input.value.substring(start,end);newText=Curse.TextEditor.getEditorElement(elementName,insText,elementArguments);if(newText=="")
{return;}
input.value=input.value.substr(0,start)+newText+input.value.substr(end);input.selectionStart=end+(newText.length-insText.length);}
Curse.TextEditor.resize(input);},applyTag:function(button,tag)
{var form=button.parentNode.parentNode.getElementsByTagName("form")[0];var input=form.getElementsByTagName("textarea")[0];var aTag='['+tag+']';var eTag='[/'+tag+']';input.focus();if(typeof document.selection!='undefined'){var range=document.selection.createRange();var insText=range.text;if(insText.substr(0,aTag.length).toLowerCase()==aTag&&insText.substr(insText.length-eTag.length).toLowerCase()==eTag)
{range.text=insText.substring(aTag.length,insText.length-eTag.length);return;}
range.text=aTag+insText+eTag;range=document.selection.createRange();if(insText.length==0){range.move('character',-eTag.length);}
else{range.moveStart('character',aTag.length+insText.length+eTag.length);}
range.select();}
else{if(typeof input.selectionStart!='undefined'){var start=input.selectionStart;var end=input.selectionEnd;var insText=input.value.substring(start,end);if(insText.toLowerCase().indexOf(aTag)>=0&&insText.toLowerCase().indexOf(eTag)>=0)
{var finished=insText.toLowerCase().indexOf(aTag)==0;var startRegExp=eval("/\\["+tag+"\\]/g");var endRegExp=eval("/\\[\\/"+tag+"\\]/g");insText=insText.replace(startRegExp,"");insText=insText.replace(endRegExp,"");if(finished)
{input.value=input.value.substr(0,start)+insText+input.value.substr(end);input.selectionStart=end-eTag.length-aTag.length;input.selectionEnd=input.selectionStart;return;}
else
{input.value=input.value.substr(0,start)+aTag+insText+eTag+input.value.substr(end);input.selectionStart=end;input.selectionEnd=end;return;}}
input.value=input.value.substr(0,start)+aTag+insText+eTag+input.value.substr(end);var pos;if(insText.length==0){pos=start+aTag.length+eTag.length;}
else{pos=start+aTag.length+insText.length+eTag.length;}
input.selectionStart=pos;input.selectionEnd=pos;}}},resize:function(obj,e)
{var myEvent=cg_getEvent(e);if(e&&cg_getEventTarget(e)!=null)
{obj=cg_getEventTarget(myEvent);}
if(myEvent&&myEvent.type=="keydown"&&myEvent.keyCode==13)
{lineCount=(obj.value+"\n").split("\n").length;}
else
{lineCount=obj.value.split("\n").length;}
if(lineCount>8)
{obj.rows=lineCount;}
else
{obj.rows=8;}
if(Curse.Browser.ie)
{obj.rows+=1;}},getSelectedText:function(input)
{if(typeof document.selection!='undefined')
{input.focus();var range=document.selection.createRange();Curse.TextEditor.currentRange=range;return range.text;}
else if(typeof input.selectionStart!='undefined')
{var start=input.selectionStart;var end=input.selectionEnd;return input.value.substring(start,end);}},toggleMode:function(toggleButton,mode)
{var buttonContainer=toggleButton.parentNode;var formContainer=buttonContainer.parentNode;var formattingButtonsContainer=cg_getElementsByClassName("editor-formatting-buttons","div",formContainer,true);var formPreviewContainer=cg_getElementsByClassName("editor-preview","div",formContainer,true);var form=formContainer.getElementsByTagName("FORM")[0];var buttons=buttonContainer.getElementsByTagName("A");for(var i=0;i<buttons.length;i++)
{if(buttons[i].className=="selected")
{buttons[i].className="";}}
toggleButton.className="selected";if(mode=="preview")
{formattingButtonsContainer.style.display="none";form.style.display="none";var formBody=form.getElementsByTagName("textarea")[0];formPreviewContainer.innerHTML=Curse.TextFormatter.getFormattedText(formBody.value,true);formPreviewContainer.style.display="block";}
else
{formattingButtonsContainer.style.display="block";formPreviewContainer.style.display="none";form.style.display="block";}},displayURLPrompt:function(e,editorID)
{var myEvent=cg_getEvent(e);var src=cg_getEventTarget(e);var srcPosition=cg_getPosition(src);var form=src.parentNode.parentNode.getElementsByTagName("form")[0];var input=form.getElementsByTagName("textarea")[0];var defaultLink=Curse.TextEditor.getSelectedText(input);Curse.Alert.show(Localization.enter_hyperlink,Localization.create_hyperlink,Localization.url+"^url^"+defaultLink+"^^^^<small>"+Localization.replace("enter_url","http://</small>")+"^label","Curse.TextEditor.processURLPrompt('"+editorID+"',event)^"+Localization.ok+"|Curse.Alert.close()^"+Localization.cancel,src,srcPosition.y,srcPosition.x+src.offsetWidth+2);},getEditorElement:function(elementName,insText,elementArguments)
{var editorElement="";if(elementName=="ul"||elementName=="ol")
{if(insText.indexOf("[ul]")>=0||insText.indexOf("[ol]")>=0)
{return"";}
editorElement="["+elementName+"]\n";insTextArray=insText.split("\n");var linesInserted=0;for(var i=0;i<insTextArray.length;i++)
{if(insTextArray[i]!="")
{linesInserted+=1;editorElement+="[li]"+insTextArray[i]+"[/li]\n";}}
if(linesInserted==0)
{editorElement+="[li][/li]\n";}
editorElement+="[/"+elementName+"]";return editorElement;}
if(elementName=="url")
{if(!elementArguments)
{return;}
if(insText.indexOf("[url]")>=0)
{return"";}
urlLink=elementArguments.url;if(elementArguments.label!="")
{urlLabel=elementArguments.label;}
else
{urlLabel=urlLink;}
editorElement="[url=";editorElement+=urlLink;editorElement+="]"+urlLabel+"[/url]";return editorElement;}
if(elementName=="item"||elementName=="itemlink"||elementName=="spell"||elementName=="spelllink")
{if(!elementArguments)
{return;}
if(insText.indexOf("[item]")>=0||insText.indexOf("[itemlink]")>=0)
{return"";}
tooltipID=elementArguments.tooltipID;editorElement="["+elementName+"]";editorElement+=tooltipID;editorElement+="[/"+elementName+"]";return editorElement;}},processURLPrompt:function(editorID,e)
{cg_cancelBubbling(e);var myAlert=cg_ge("alert");var promptForm=myAlert.getElementsByTagName("form")[0];var urlLink=promptForm.url.value;var urlLabel=promptForm.label.value;var editor=cg_ge(editorID);Curse.Alert.close();Curse.TextEditor.applyElement(editor,"url",{"url":urlLink,"label":urlLabel});}}
if(!Curse){var Curse={};}
Curse.TabGroup=function(pOptions)
{this.ignoreScroll=false;cg_cO(this,pOptions);if(this.parent)
{this.parent=cg_ge(this.parent);}
else
{return;}
this.selectedTab=-1;this.tabList=[];this.tabs=[];this.shownCount=0;if(this.hasViewstate==null)
{this.hasViewstate=true;}
this.tabWithViewstate=null;if(this.onLoad==null)
{this.onLoad=Curse.TabGroup.onLoad.bind(this);}
if(this.onShow==null)
{this.onShow=Curse.TabGroup.onShow.bind(this);}
if(this.onHide)
{this.onHide=this.onHide.bind(this);}}
Curse.TabGroup.prototype={add:function(pLabel,pOptions)
{var index=this.tabs.length;var newTab={label:pLabel,index:index,owner:this};cg_cO(newTab,pOptions);this.tabs.push(newTab);return index;},focus:function(pIndex){if(pIndex<0)
{pIndex=this.tabs.length+pIndex;}
this.forceScroll=1;var tabAnchors=cg_gebt(this.tabList,"a");tabAnchors[pTabIndex].onclick({},true);this.forceScroll=null;},show:function(pTabIndex,pTab)
{var selectedTab;if(isNaN(pTabIndex)||pTabIndex<0){pTabIndex=0;}
else if(pTabIndex>=this.tabs.length){pTabIndex=this.tabs.length-1;}
if(pTab==null&&pTabIndex==this.selectedTab){return;}
if(this.selectedTab!=-1)
{selectedTab=this.tabs[this.selectedTab];if(this.onHide&&!this.onHide(selectedTab)){return;}
if(selectedTab.onHide&&!selectedTab.onHide()){return;}}
++this.shownCount;selectedTab=cg_gebt(this.tabList,"a");if(this.selectedTab!=-1)
{selectedTab[this.selectedTab].className="";}
selectedTab[pTabIndex].className="selected";selectedTab=this.tabs[pTabIndex];if(selectedTab.onLoad)
{selectedTab.onLoad();selectedTab.onLoad=null;}
this.onShow(this.tabs[pTabIndex],this.tabs[this.selectedTab]);if(selectedTab.onShow)
{selectedTab.onShow(this.tabs[this.selectedTab]);}
this.selectedTab=pTabIndex;},render:function(pTabIndex)
{if(this.tabs.length==0)
{return;}
var loadAction;var l;var a;var d;var d2;var tabsContainer=cg_ce("div");tabsContainer.className="tabs-container";d=cg_ce("div");this.tabList=cg_ce("ul");this.tabList.className="tabs";cg_ae(d,this.tabList);cg_ae(tabsContainer,d);d=cg_ce("div");for(var i=0;i<this.tabs.length;++i)
{var tab=this.tabs[i];var l=cg_ce("li");var a=cg_ce("a");var b=cg_ce("b");if(this.hasViewstate)
{a.href="";}
else
{a.href="javascript:;";}
cg_ds(a);a.onclick=Curse.TabGroup.onClick.bind(tab,a);d=cg_ce("div");if(tab.label.indexOf("<")>=0)
{d.innerHTML=b.innerHTML=tab.label;}
else
{cg_ae(d,cg_ct(tab.label));cg_ae(b,cg_ct(tab.label));}
cg_ae(a,d);cg_ae(a,b);cg_ae(l,a);cg_ae(this.tabList,l);}
cg_ae(this.parent,tabsContainer);if(this.onLoad)
{loadAction=this.onLoad();if(loadAction!=null)
{this.tabWithViewstate=pTabIndex=loadAction;}}
this.show(pTabIndex);},setTabLabel:function(tabIndex,label)
{var tabAnchors=cg_gebt(this.tabList,"a");cg_setTextNodes(tabAnchors[tabIndex],label);},setTabViewstate:function(pTabIndex,pListViewstate)
{if(!this.hasViewstate)
{return;}
var tabAnchors=cg_gebt(this.tabList,"a");tabAnchors[pTabIndex].href=""+pListViewstate;}};Curse.TabGroup.onClick=function(a,e,_12d)
{if(_12d==null&&this.index==this.owner.selectedTab)
{return;}
this.owner.show(this.index,_12d);if(this.owner.hasViewstate)
{var label;var labelIndex=a.href.indexOf("");if(labelIndex!=-1)
label=a.href.substr(labelIndex+1);var stateArray=self.location.hash.substring(1).split(":");stateArray[0]=label;location.replace(""+stateArray.join(":"));}
return false;};Curse.TabGroup.onLoad=function()
{if(!this.hasViewstate||!location.hash.length)
{return;}
var _=location.hash.substr(1).split(":")[0];if(_)
{return cg_inArray(this.tabs,_,function(x){return x.id;});}};Curse.TabGroup.onShow=function(selTab,oldTab)
{if(oldTab)
{cg_ge("datagrid-tab-"+oldTab.id).style.display="none";}
var dataContainer=cg_ge("datagrid-tab-"+selTab.id);dataContainer.style.display="";if((!this.ignoreScroll&&this.shownCount==1&&this.tabWithViewstate!=null&&this.tabWithViewstate>=0)||this.forceScroll)
{var scrollToElement=dataContainer;var topPadding;if(this._selectedTab)
{scrollToElement=this._selectedTab;topPadding=15;}
else
{scrollToElement=dataContainer;topPadding=this.parent.offsetHeight+60;}
setTimeout(cg_scrollTo.bind(this,scrollToElement,topPadding),1);}};if(!Curse){var Curse={};}
var cg_datagrids={};Curse.DataGrid=function(settings)
{cg_cO(this,settings);var elementID="datagrid-tab-"+this.id;if(this.parent)
{var element=cg_ce("div");element.id=elementID;cg_ae(cg_ge(this.parent),element);this.container=element;}
else
{this.container=cg_ge(elementID);}
if(this.template)
{this.template=Curse.DataGrid.Templates[this.template];}
else
{return;}
if(!this.data.length&&!this.message&!this.template.noDataMessage)
{return;}
if(this.hasViewstate==null)
{if(this.template.hasViewstate!=null)
{this.hasViewstate=this.template.hasViewstate;}
else
{this.hasViewstate=true;}}
cg_datagrids[this.id]=this;if(this.listStyle==null)
{this.listStyle=this.template.listStyle;}
this.listStyle|=0;this.startingRow=0;if(!this.resultsPerPage)
{var userPerPage=parseInt(cg_getCookie("_resultsPerPage"));var templatePerPage=this.template.resultsPerPage;if(userPerPage)
{this.resultsPerPage=userPerPage;}
else
{this.resultsPerPage=(templatePerPage!=null?templatePerPage:50);}}
if(this.preProcessing==null&&this.template.preProcessing!=null)
{this.preProcessing=this.template.preProcessing;}
if(this.onBeforeCreate==null&&this.template.onBeforeCreate!=null)
{this.onBeforeCreate=this.template.onBeforeCreate;}
if(this.onAfterCreate==null&&this.template.onAfterCreate!=null)
{this.onAfterCreate=this.template.onAfterCreate;}
if(this.tabGroup)
{this.tabIndex=this.tabGroup.add(this.getTabName(),{id:this.id,onLoad:this.initialize.bind(this)});}
else
{this.initialize();}}
Curse.DataGrid.ListStyle={TableRows:0,CommentBox:2,ScreenshotBox:3};Curse.DataGrid.prototype={initialize:function()
{cg_ge("resultsContentPanel").style.display="block";while(this.container.firstChild)
{cg_de(this.container.firstChild);}
if(this.preProcessing!=null)
{for(var j=0,blen=this.data.length;j<blen;j++)
{this.preProcessing(this.data[j]);}}
this.initializeColumns();if(!this.data.length)
{this.showNoDataMessage();return;}
if(this.tabGroup)
{this.hasFocus=(this.tabGroup.tabWithViewstate==this.tabIndex);if(this.hasFocus)
{this.initializeViewstate();}}
else
{this.initializeViewstate();}
this.originalData=this.data.slice(0);if(this.sort&&this.template.sort&&this.sort!=this.template.sort)
{this.applySort();}
this.setSortIndexes();var beforeResult;if(this.onBeforeCreate!=null)
{beforeResult=this.onBeforeCreate();}
if(this.listStyle==Curse.DataGrid.ListStyle.CommentBox)
{this.mainDiv=cg_ce("div");this.mainDiv.className="datagrid-style"+this.listStyle;this.renderRows();this.appendWidgets(this.mainDiv);}
else
{this.table=cg_ce("table");this.thead=cg_ce("thead");this.tbody=cg_ce("tbody");this.tbody.className="datagrid-style"+this.listStyle;if(this.listStyle!=Curse.DataGrid.ListStyle.ScreenshotBox)
{this.appendColumnHeaders();}
cg_ae(this.table,this.thead);cg_ae(this.table,this.tbody);this.renderRows();this.appendWidgets(this.table);if(this.listStyle!=Curse.DataGrid.ListStyle.ScreenshotBox)
{this.setSortArrow();}}
if(this.onAfterCreate!=null)
{this.onAfterCreate(beforeResult);}},initializeViewstate:function()
{if(!this.hasViewstate||!location.hash.length)
{return;}
var hashString=location.hash.substr(1);if(this.tabGroup)
{var n=hashString.indexOf(":");if(n==-1)
{return;}
hashString=hashString.substr(n+1);}
var hashStartRow=parseInt(hashString);if(!isNaN(hashStartRow))
{this.startingRow=hashStartRow;this.validatePage();if(this.hasViewstate)
{var sort=[];var sortCols=hashString.match(/(\+|\-)[0-9]+/g);if(sortCols!=null)
{for(var i=sortCols.length-1;i>=0;--i)
{var currentCol=parseInt(sortCols[i])|0;var colValue=Math.abs(sortCols);if(colValue<=0||colValue>this.columns.length)
{break;}
this.addSort(sort,currentCol);}
this.setSort(sort,false,false);}}
if(this.tabGroup)
{this.tabGroup.setTabViewstate(this.tabIndex,this.getTabViewstate());}}},initializeColumns:function()
{this.columns=this.template.columns.slice(0);if(Curse.DataGrid.sharedColumns!=null&&this.displayColumns!=null)
{for(var p in Curse.DataGrid.sharedColumns)
{var col=Curse.DataGrid.sharedColumns[p];if(this.displayColumns.indexOf(col.id)>=0)
{var pos=null;if(pos==null)
{pos=this.columns.length;}
this.columns.splice(pos,0,col);}}}
this.columnsVisible=[];if(this.displayColumns!=null)
{for(var i=0,len=this.columns.length;i<len;++i)
{if(this.displayColumns.indexOf(this.columns[i].id)!=-1&&this.displayColumns.indexOf(this.columns[i].id)!=null)
{this.columnsVisible.push(i);}}}
else
{for(var i=0,len=this.columns.length;i<len;++i)
{if(!this.columns[i].hidden)
{this.columnsVisible.push(i);}}}
if(this.sort==null&&this.template.sort)
{this.sort=this.template.sort.slice(0);}
else
{if(this.sort!=null)
{var oldSort=this.sort;this.sort=[];for(var i=0,len=oldSort.length;i<len;++i){var col=parseInt(oldSort[i]);if(isNaN(col))
{var desc=0;if(oldSort[i].charAt(0)=="-"){desc=1;oldSort[i]=oldSort[i].substring(1);}
var colIndex=cg_inArray(this.columns,oldSort[i],function(x){return x.id;});if(colIndex!=-1)
{if(desc)
{this.sort.push(-(colIndex+1));}
else{this.sort.push(colIndex+1);}}}
else
{this.sort.push(col);}}}}},showNoDataMessage:function()
{var d=cg_ce("div");d.className="no-data";var message="";if(this.template.noDataMessage)
{message=this.template.noDataMessage();}
else
{message=this.message;}
d.innerHTML=message;cg_ae(this.container,d);},getTabName:function()
{var name=this.name;var n=this.data.length;if(n>0)
{name+=" ("+n+")";}
return name;},getTabViewstate:function()
{var tabViewstate="";tabViewstate+=this.startingRow;if(this.hasViewstate&&this.sort.length)
{tabViewstate+=("+"+this.sort.join("+")).replace(/\+\-/g,"-");}
return tabViewstate;},setViewstate:function()
{if(!this.hasViewstate){return;}
var tabViewstate=this.getTabViewstate();if(this.tabGroup)
{this.tabGroup.setTabViewstate(this.tabIndex,tabViewstate);location.replace(""+this.id+":"+tabViewstate);}
else
{location.replace(""+tabViewstate);}},refreshPagingUI:function()
{var resultsPerPage=this.resultsPerPage;var startingRow=this.startingRow;var rowCount=this.data.length;var showFirstPage=false;var showPreviousPage=false;var showNextPage=false;var showLastPage=false;if(resultsPerPage)
{if(startingRow>0)
{showPreviousPage=true;if(startingRow>=resultsPerPage+resultsPerPage){showFirstPage=true;}}
if(startingRow+resultsPerPage<rowCount){showNextPage=true;if(startingRow+resultsPerPage+resultsPerPage<rowCount){showLastPage=true;}}}
var pagingControls=[this.pagingTop,this.pagingBottom];for(var i=0;i<2;++i){var pagingElements=pagingControls[i].childNodes;if(showFirstPage)
{this.enableControl(pagingElements[0]);}
else
{this.disableControl(pagingElements[0]);}
if(showPreviousPage)
{this.enableControl(pagingElements[1]);}
else
{this.disableControl(pagingElements[1]);}
if(showNextPage)
{this.enableControl(pagingElements[3]);}
else
{this.disableControl(pagingElements[3]);}
if(showLastPage)
{this.enableControl(pagingElements[4]);}
else
{this.disableControl(pagingElements[4]);}
pageNumbers=pagingElements[2].childNodes;pageNumbers[0].firstChild.nodeValue=startingRow+1;pageNumbers[2].firstChild.nodeValue=resultsPerPage?Math.min(startingRow+resultsPerPage,rowCount):rowCount;pageNumbers[4].firstChild.nodeValue=rowCount;}},disableControl:function(pControl)
{cg_addClass(pControl,"disabled");},enableControl:function(pControl)
{cg_removeClass(pControl,"disabled");},getStartingRow:function(pStartingRow){var resultsPerPage=this.resultsPerPage;return(resultsPerPage>0&&pStartingRow>0?Math.floor(pStartingRow/resultsPerPage)*resultsPerPage:0);},validatePage:function()
{var resultsPerPage=this.resultsPerPage,startingRow=this.startingRow,resultsCount=this.data.length;if(startingRow<0)
{this.startingRow=0;}
else
{this.startingRow=this.getStartingRow(startingRow+resultsPerPage>resultsCount?resultsCount-1:startingRow);}},changePage:function()
{this.validatePage();this.renderRows();this.refreshPagingUI();var scrollPosition=cg_getScroll();var listPosition=cg_getPosition(this.container);if(scrollPosition.y>listPosition.y)
{scrollTo(0,listPosition.y);}
this.setViewstate();},pageNext:function()
{this.startingRow+=this.resultsPerPage;this.changePage();},pageFirst:function(){this.startingRow=0;this.changePage();},pageLast:function()
{this.startingRow=1000000;this.changePage();},pagePrevious:function()
{this.startingRow-=this.resultsPerPage;this.changePage();},getPagingUI:function()
{var div=cg_ce("div");div.className="datagrid-paging";var aFirst=cg_ce("a");aFirst.className="datagrid-paging-first";var aPrevious=cg_ce("a");aPrevious.className="datagrid-paging-previous";var aNext=cg_ce("a");aNext.className="datagrid-paging-next";var aLast=cg_ce("a");aLast.className="datagrid-paging-last";aFirst.href=aPrevious.href=aNext.href=aLast.href="javascript:;";cg_ae(aFirst,cg_ct(Localization.first));cg_ae(aPrevious,cg_ct(Localization.previous));cg_ae(aNext,cg_ct(Localization.next));cg_ae(aLast,cg_ct(Localization.last));cg_ds(aFirst);cg_ds(aPrevious);cg_ds(aNext);cg_ds(aLast);aFirst.onclick=this.pageFirst.bind(this);aPrevious.onclick=this.pagePrevious.bind(this);aNext.onclick=this.pageNext.bind(this);aLast.onclick=this.pageLast.bind(this);var span=cg_ce("span");var b1=cg_ce("b"),b2=cg_ce("b"),b3=cg_ce("b");cg_ae(b1,cg_ct("a"));cg_ae(b2,cg_ct("a"));cg_ae(b3,cg_ct("a"));cg_ae(span,b1);cg_ae(span,cg_ct(" - "));cg_ae(span,b2);cg_ae(span,cg_ct(" of "));cg_ae(span,b3);cg_ae(div,aFirst);cg_ae(div,aPrevious);cg_ae(div,span);cg_ae(div,aNext);cg_ae(div,aLast);return div;},refine:function()
{this.showResults();var refineValue=this.refineInput.value.toLowerCase();if(refineValue=="")
{if(this.data.length==this.originalData.length)
{return;}
this.data=this.originalData.slice(0);this.applySort();this.renderRows();this.refreshPagingUI();}
var refineLength=refineValue.length;var useContainsFilter=this.refineContains.checked;var dataValue="";var refineColumn=this.template.refineColumn;this.data=[];for(var i=0,len=this.originalData.length;i<len;i++)
{dataValue=this.originalData[i][refineColumn];if(useContainsFilter)
{if(dataValue.toLowerCase().indexOf(refineValue)>=0)
{this.data.push(this.originalData[i]);}}
else
{if(dataValue.substring(0,refineLength).toLowerCase()==refineValue)
{this.data.push(this.originalData[i]);}}}
if(this.data.length<this.startingRow)
{this.startingRow=0;}
this.applySort();this.renderRows();this.refreshPagingUI();},setRefineBox:function()
{var lbl=cg_ce("label");lbl.className="tip";lbl.innerHTML=Localization.refine_by_name+":"
lbl.htmlFor="datagrid-refine-"+this.tabIndex;lbl.onmouseover=Curse.Tooltip.showTip.bind(this,Localization.type_to_update);lbl.onmouseout=Curse.Tooltip.hide;var rfi=cg_ce("input");rfi.type="text";rfi.maxLength=24;rfi.onkeyup=this.refine.bind(this);rfi.id="datagrid-refine-"+this.tabIndex;this.refineInput=rfi;var rfs=cg_ce("input");rfs.type="radio";rfs.id="datagrid-refine-starts"+this.tabIndex;rfs.name="datagrid-refine-type"+this.tabIndex;rfs.checked=true;rfs.onclick=this.refine.bind(this);this.refineStarts=rfs;var lbl2=cg_ce("label");lbl2.innerHTML=Localization.starts_with;lbl2.htmlFor="datagrid-refine-starts"+this.tabIndex;var rfc=cg_ce("input");rfc.type="radio";rfc.id="datagrid-refine-contains"+this.tabIndex;rfc.name="datagrid-refine-type"+this.tabIndex;rfc.onclick=this.refine.bind(this);this.refineContains=rfc;var lbl3=cg_ce("label");lbl3.innerHTML=Localization.contains;lbl3.htmlFor="datagrid-refine-contains"+this.tabIndex;;cg_ae(this.refineBox,lbl);cg_ae(this.refineBox,this.refineInput);cg_ae(this.refineBox,this.refineStarts);cg_ae(this.refineBox,lbl2);cg_ae(this.refineBox,this.refineContains);cg_ae(this.refineBox,lbl3);},appendWidgets:function(dataContainer){var widgetTop=cg_ce("div");widgetTop.className="datagrid-widget-top";var widgetBottom=cg_ce("div");widgetBottom.className="datagrid-widget-bottom";this.refineBox=cg_ce("div");this.refineBox.className="datagrid-refine";if(this.template.showRefineBox)
{this.setRefineBox();}
else
{this.refineBox.innerHTML="&nbsp;";}
this.pagingTop=this.getPagingUI();this.pagingBottom=this.getPagingUI();var widgetSummaryTop=cg_ce("div");var widgetSummaryBottom=cg_ce("div");widgetSummaryTop.className=widgetSummaryBottom.className="datagrid-summary";if(this.count)
{var countDiv=cg_ce("div");countDiv.className="count";countDiv.innerHTML=cg_formatNumber(this.count)+" "+this.name+Localization.were_found;if(cg_ge("searchFilterForm"))
{countDiv.innerHTML+=" "+Localization.get_fewer+" <span class=\"tip\" onmouseout=\"Curse.Tooltip.hide();\" onmouseover=\"Curse.Tooltip.showTip('"+Localization.by_filtering.replace(/'/g,"\\'")+"');\">"+Localization.filtering+"</span> "+Localization.your_results+" <button onclick=\"Curse.Searchfilter.toggle(null);\"><span>"+Localization.create_filter+"</span></button>";}
cg_ae(widgetSummaryTop,countDiv);widgetSummaryTop.style.display="block";}
if(this.summary)
{widgetSummaryTop.innerHTML="<div class=\""+this.summary.cssClass+"\">"+this.summary.text+"</div>";widgetSummaryTop.style.display="block";}
cg_ae(widgetTop,widgetSummaryTop);cg_ae(widgetTop,this.pagingTop);cg_ae(widgetTop,this.getPerPageUI());cg_ae(widgetTop,this.refineBox);cg_ae(widgetBottom,this.pagingBottom);cg_ae(widgetBottom,widgetSummaryBottom);this.widgetTop=widgetTop;this.widgetBottom=widgetBottom;this.refreshPagingUI();if(this.hideWidgets)
{widgetTop.style.display=widgetBottom.style.display="none";}
cg_ae(this.container,this.widgetTop);cg_ae(this.container,dataContainer);cg_ae(this.container,this.widgetBottom);},updatePerPage:function(sel)
{var perpage=sel.options[sel.selectedIndex].value;cg_setCookie("_resultsPerPage",perpage);this.resultsPerPage=parseInt(perpage);this.validatePage();this.renderRows();this.refreshPagingUI();},getPerPageUI:function()
{var cont=cg_ce("div");cont.className="datagrid-perpage";var perpage=[15,30,50,100];var sel=cg_ce("select");for(var i=0;i<perpage.length;i++)
{var opt=cg_ce("option");sel.options.add(opt)
opt.text=perpage[i];opt.value=perpage[i];if(this.resultsPerPage==perpage[i])
{opt.selected=true;}}
sel.onchange=this.updatePerPage.bind(this,sel);cg_ae(cont,cg_ct(Localization.per_page+" "));cg_ae(cont,sel);return cont;},appendColumnHeaders:function(){var tr=cg_ce("tr");if(this.listStyle==Curse.DataGrid.ListStyle.CommentBox)
{var th=cg_ce("th");var div=cg_ce("div");var a=cg_ce("a");th.style.width="33px";if(this.poundable==2)
{a.style.cursor="default";a.style.backgroundColor="#585858";}
a.href="javascript:;";a.className="datagrid-cb";cg_ds(a);cg_ae(a,cg_ct(String.fromCharCode(160)));cg_ae(div,a);cg_ae(th,div);cg_ae(tr,th);}
for(var i=0,len=this.columnsVisible.length;i<len;++i)
{var colIndex=this.columnsVisible[i];var col=this.columns[colIndex];var th=cg_ce("th");var div=cg_ce("div");var a=cg_ce("a");var labelContainer=cg_ce("span");var label=cg_ce("span");if(col.sortable==null)
{col.sortable=true;}
if(!col.sortable)
{a.style.cursor="default";}
else
{a.href="javascript:;";a.onclick=this.sortBy.bind(this,colIndex+1);}
cg_ds(a);if(col.width!=null){th.style.width=col.width;}
if(col.halign!=null)
{th.style.textAlign=col.halign;}
else if(col.align!=null)
{th.style.textAlign=col.align;}
if(col.span!=null){th.colSpan=col.span;}
cg_ae(label,cg_ct(col.label));cg_ae(labelContainer,label);cg_ae(a,labelContainer);cg_ae(div,a);cg_ae(th,div);cg_ae(tr,th);}
cg_ae(this.thead,tr);},removeRows:function()
{var rowContainer=(this.listStyle==2?this.mainDiv:this.tbody);while(rowContainer.firstChild)
{rowContainer.removeChild(rowContainer.firstChild);}},renderRows:function()
{var totalCount=this.data.length;this.removeRows();if(totalCount>0)
{var beginIndex;var endIndex;var func;if(this.resultsPerPage>0)
{beginIndex=this.startingRow;endIndex=Math.min(totalCount,this.startingRow+this.resultsPerPage);}
else
{beginIndex=0;endIndex=totalCount;}
if(this.listStyle==Curse.DataGrid.ListStyle.CommentBox)
{for(var i=beginIndex;i<endIndex;++i)
{cg_ae(this.mainDiv,this.getDiv(i));}}
else
{if(this.listStyle==Curse.DataGrid.ListStyle.ScreenshotBox)
{var j=0;var tr=cg_ce("tr");for(var i=beginIndex;i<endIndex;++i)
{cg_ae(tr,this.getCell(i));if(++j==this.template.recordsPerRow)
{cg_ae(this.tbody,tr);if(i+1<endIndex){tr=cg_ce("tr");}
j=0;}}
if(j!=this.template.recordsPerRow)
{for(;j<this.template.recordsPerRow;++j)
{var cell=cg_ce("td");cell.className="empty-cell";cg_ae(tr,cell);}
cg_ae(this.tbody,tr);}}
else
{var docFragment=document.createDocumentFragment();for(var i=beginIndex;i<endIndex;++i)
{docFragment.appendChild(this.getRow(i));}
this.tbody.appendChild(docFragment);}}}
else
{this.hideResults();}},hideResults:function(message)
{if(message==null)
{message=Localization.no_results_matching+"<b>"+this.refineInput.value+"</b>";}
if(this.listStyle==Curse.DataGrid.ListStyle.CommentBox)
{this.mainDiv.style.display="none";return}
var tr=cg_ce("tr");var td=cg_ce("td");var colspan=0;var header=this.thead.firstChild;for(var i=0;i<header.cells.length;i++)
{if(header.cells[i].colSpan)
{colspan+=header.cells[i].colSpan;}
else
{colspan+=1;}}
td.colSpan=colspan;td.style.borderRight="none";td.innerHTML=message;cg_ae(tr,td);cg_ae(this.tbody,tr);this.pagingTop.style.display="none";this.pagingBottom.style.display="none";},showResults:function()
{this.pagingTop.style.display="block";this.pagingBottom.style.display="block";if(this.listStyle==2)
{this.mainDiv.style.display="";}
else
{this.table.style.display="";}},setSortArrow:function()
{if(!this.sort.length){return;}
var i=cg_inArray(this.columnsVisible,Math.abs(this.sort[0])-1);if(i==-1)
{return;}
if(this.listStyle==1){++i;}
var span=this.thead.firstChild.childNodes[i].firstChild.firstChild.firstChild;if(this.lsa&&this.lsa!=span)
{this.lsa.className="";}
span.className=(this.sort[0]<0?"sortdesc":"sortasc");this.lsa=span;},setSortIndexes:function(){var ldata=this.data;for(var i=0,len=ldata.length;i<len;++i)
{ldata[i].sortIndex=i;}
this.indexCreated=true;},sortBy:function(args)
{if(!this.hasViewstate||args<=0||args>this.columns.length)
{return;}
if(Math.abs(this.sort[0])==args)
{this.sort[0]=-this.sort[0];}
else
{this.addSort(this.sort,args);}
this.applySort();if(this.template.onSort)
{(this.template.onSort.bind(this))();}
this.renderRows();if(this.listStyle!=2)
{this.setSortArrow();}
this.setViewstate();},addSort:function(pSort,pArgs)
{var i=cg_inArray(pSort,pArgs,function(x){return Math.abs(x);});if(i!=-1)
{pArgs=pSort[i];pSort.splice(i,1);}
pSort.splice(0,0,pArgs);},applySort:function()
{Curse.DataGrid.sort=this.sort;Curse.DataGrid.columns=this.columns;if(this.indexCreated)
{this.data.sort(Curse.DataGrid.sortIndexedRows);}
else
{this.data.sort(Curse.DataGrid.sortRows);}
this.setSortIndexes();},setSort:function(pSort,pRenderRows,pRefreshViewstate)
{if(this.sort.toString()!=pSort.toString())
{this.sort=pSort;this.applySort();if(pRenderRows)
{this.renderRows();}
if(pRefreshViewstate)
{this.setViewstate();}}},getDiv:function(i)
{var record=this.data[i];if(record.__div==null)
{this.createDiv(record,i);}
return record.__div;},createDiv:function(record,i)
{var div=cg_ce("div");record.__div=div;(this.template.render.bind(this,record,div,i))();},getCell:function(pIndex)
{var record=this.data[pIndex];if(record.__td==null)
{this.createCell(record);}
return record.__td;},recordClick:function(record,e)
{location.href=this.template.getRecordLink(record);},createCell:function(record)
{var td=cg_ce("td");record.__td=td;(this.template.render.bind(this,record,td))();if(this.template.getRecordLink)
{td.onclick=this.recordClick.bind(this,pCell);}},getRow:function(pIndex){var row=this.data[pIndex];if(row.__tr==null){this.createRow(row);}
return row.__tr;},createRow:function(pRow){var tr=cg_ce("tr");pRow.__tr=tr;for(var i=0,len=this.columnsVisible.length;i<len;++i)
{var colIndex=this.columnsVisible[i];var col=this.columns[colIndex];var td=cg_ce("td");if(col.align!=null){td.style.textAlign=col.align;}
var renderedResult=null;if(col.render)
{renderedResult=(col.render.bind(this,pRow,td,tr))();}
else
{if(pRow[col.value]!=null)
{cg_ae(td,cg_ct(pRow[col.value]));}
else
{renderedResult=-1;}}
if(renderedResult!=-1&&renderedResult!=null)
{td.insertBefore(cg_ct(renderedResult),td.firstChild);}
cg_ae(tr,td);}
if(this.template.getRecordLink)
{tr.onclick=this.recordClick.bind(this,pRow);if(Curse.Browser.ie6)
{}}}};Curse.DataGrid.sortIndexedRows=function(a,b){var sort=Curse.DataGrid.sort;var cols=Curse.DataGrid.columns;var res;var scol=cols[Math.abs(sort[0])-1];if(scol.sortFunc)
{res=scol.sortFunc(a,b,sort[0]);}
else
{res=cg_strcmp(a[scol.value],b[scol.value]);}
if(res!=0)
{return res*sort[0];}
return a.sortIndex-b.sortIndex;};Curse.DataGrid.sortRows=function(a,b){var sort=Curse.DataGrid.sort;var cols=Curse.DataGrid.columns;for(var i=0,len=sort.length;i<len;++i){var res;var scol=cols[Math.abs(sort[i])-1];if(scol.sortFunc){res=scol.sortFunc(a,b,sort[i]);}
else{res=cg_strcmp(a[scol.value],b[scol.value]);}
if(res!=0){return res*sort[i];}}
return 0;};Curse.DataGrid.Utility={createNumericRange:function(min,max)
{min|=0;max|=0;if(min>1||max>1)
{if(min!=max&&max>0)
{return min+"-"+max;}
else
{return min+"";}}
return null;},processCounts:function(record)
{if(this.totalLootCount!=null)
{record.percent=record.lootCount/this.totalLootCount;}
else
{record.percent=record.lootCount/record.totalLootCount;}
record.percent*=100;},assocArrCmp:function(a,b,arr)
{if(a==null)
{return-1;}
else
{if(b==null)
{return 1;}}
var n=Math.max(a.length,b.length);for(var i=0;i<n;++i)
{if(a[i]==null)
{return-1;}
else
{if(b[i]==null)
{return 1;}}
var res=cg_strcmp(arr[a[i]],arr[b[i]]);if(res!=0)
{return res;}}
return 0;},appendFloatingIcons:function(container,arr,label)
{if(arr==null)
{return;}
var d=cg_ce("div"),d2=cg_ce("div");if(label)
{var d3=cg_ce("div");d3.style.position="relative";d3.style.width="1px";var d4=cg_ce("div");d4.className="r0";d4.style.position="absolute";d4.style.right="2px";d4.style.lineHeight="26px";d4.style.fontSize="11px";d4.style.whiteSpace="nowrap";cg_ae(d4,cg_ct(label));cg_ae(d3,d4);cg_ae(d,d3);}
for(var i=0,len=arr.length;i<len;++i)
{var id,num;if(typeof arr[i]=="object")
{id=arr[i][0];num=arr[i][1];}
else
{id=arr[i];}
var item=cg_items[id];var iconid;if(!item)
{var icon=new Curse.Icon(0,3677);}
else
{var icon=cg_items[id].createIcon(0,num);}
icon.style.cssFloat=icon.style.styleFloat="left";cg_ae(d,icon);}
d.style.margin="0 auto";d.style.textAlign="left";d.style.width=(26*arr.length)+"px";d2.className="clear";cg_ae(container,d);cg_ae(container,d2);return true;},appendPrice:function(container,coin,honor,arena,items)
{var s,a;if(coin>=10000)
{s=cg_ce("span");s.className="moneygold";cg_ae(s,cg_ct(Math.floor(coin/10000)));cg_ae(container,s);coin%=10000;}
if(coin>=100)
{s=cg_ce("span");s.className="moneysilver";cg_ae(s,cg_ct(" "+Math.floor(coin/100)));cg_ae(container,s);coin%=100;}
if(coin>=1)
{s=cg_ce("span");s.className="moneycopper";cg_ae(s,cg_ct(" "+coin));cg_ae(container,s);}
if(honor&&honor>0)
{s=cg_ce("span");s.className="moneyhorde";cg_ae(s,cg_ct(" "+honor));cg_ae(container,s);}
if(arena&&arena>0)
{s=cg_ce("span");s.className="moneyarena";cg_ae(s,cg_ct(" "+arena));cg_ae(container,s);}
if(items&&items.length>0)
{for(i=0;i<items.length;i++)
{var currentItemPrice=items[i];var costItem=cg_items[currentItemPrice[0]];if(!costItem)
{continue;}
// gridtime 
a=cg_ce("a");a.href="item.php?id="+costItem.id;a.className="moneyitem";a.style.backgroundImage="url(icons/t/"+costItem.icon+".gif)";a._relatedID=costItem.id;a.onmouseover=Curse.Tooltip.handleItemLinkOver.bind(this,a);a.onmouseout=Curse.Tooltip.hide.bind(this);cg_ae(a,cg_ct(" "+currentItemPrice[1]));cg_ae(container,a);}}},processDates:function(record)
{record.date=new Date(record.date).getTime();},setConditionalMessage:function(datagrid)
{alert(datagrid.message);}}
Curse.DataGrid.getDataByType=function(datagridid,entityid)
{var dg=cg_datagrids[datagridid];if(!dg)
{return null;}
for(var i=0;i<dg.datax.length;i++)
{if(dg.data[i].id==entityid)
{return dg.data[i];}}
return null;}
Curse.DataGrid.addOrReplaceData=function(id,parent,template,name,newdata)
{dg=cg_datagrids[id];if(!dg)
{dg=new Curse.DataGrid({parent:parent,template:template,id:id,name:name,tabGroup:cg_primaryTabGroup,data:newdata});cg_primaryTabGroup.render();}
else
{dg.data=newdata;dg.initialize();}}
Curse.SearchAssistant={initialized:false,processing:false,lastTerm:null,selectionIndex:-1,table:null,container:null,input:null,attach:function(id,focus)
{var input=cg_ge(id);input.setAttribute("autocomplete","off");if(focus)
{input.focus();}
var container=cg_ce("div");container.className="WOWDB-ac-container";var table=cg_ce("table");table.className="WOWDB-ac-m";cg_ae(container,table);var tbody=cg_ce("tbody");cg_ae(table,tbody);var d=document.createElement("div");d.className="WOWDB-ac-bg";cg_ae(container,d);var d=document.createElement("em");cg_ae(container,d);var d=document.createElement("var");cg_ae(container,d);var d=document.createElement("strong");cg_ae(container,d);cg_ae(document.body,container);Curse.SearchAssistant.input=input;Curse.SearchAssistant.container=container;Curse.SearchAssistant.table=table;Curse.SearchAssistant.tbody=tbody;var form=input.parentNode;while(form.tagName!="FORM")
{form=form.parentNode;}
Curse.SearchAssistant.form=form;Curse.SearchAssistant.initialized=true;input.onkeyup=Curse.SearchAssistant.handleKeyUp;input.onkeydown=Curse.SearchAssistant.handleKeyDown;input.onclick=Curse.SearchAssistant.handleInputClick.bind(this,input);document.onclick=Curse.SearchAssistant.handleDocumentClick.bind(this);},updatePosition:function()
{var pos=cg_getPosition(Curse.SearchAssistant.input);Curse.SearchAssistant.container.style.top=pos.y+Curse.SearchAssistant.input.offsetHeight+1+"px";Curse.SearchAssistant.container.style.left=pos.x+1+"px";if(Curse.SearchAssistant.table.offsetWidth<Curse.SearchAssistant.input.offsetWidth)
{Curse.SearchAssistant.table.style.width=Curse.SearchAssistant.input.offsetWidth-1+"px";}
else
{Curse.SearchAssistant.table.style.width="auto";}},show:function()
{if(!Curse.SearchAssistant.container)
{return;}
Curse.SearchAssistant.container.style.visibility="visible";},hide:function()
{if(Curse.SearchAssistant.selectionIndex>=0&&Curse.SearchAssistant.selectionIndex<Curse.SearchAssistant.table.rows.length)
{Curse.SearchAssistant.table.rows[Curse.SearchAssistant.selectionIndex].className="WOWDB-ac-a";}
Curse.SearchAssistant.selectionIndex=-1;Curse.SearchAssistant.container.style.visibility="hidden";},populate:function(matches)
{Curse.SearchAssistant.clear();if(matches=="")
{Curse.SearchAssistant.hide();return;}
var oSearchAssistantTable=cg_ge("completeTable");var searchTerm=Curse.SearchAssistant.input.value;var arrMatches=matches.split("^");for(i=0;i<arrMatches.length;i++)
{var arrCurrentMatch=arrMatches[i].split("|");var matchName=arrCurrentMatch[0];var iconID=arrCurrentMatch[1];var arrMatchCount=arrCurrentMatch[2].split(",");var row=cg_ce("tr");row.onclick=Curse.SearchAssistant.handleRowClick.bind(this,row);row.onmouseover=Curse.SearchAssistant.handleMouseOver;row.onmouseout=Curse.SearchAssistant.handleMouseOut;row.className="WOWDB-ac-a";var cell=cg_ce("td");cell.className="WOWDB-ac-icon";var iconHTML="";if(iconID!=-1)
{iconHTML="<div class=\"iconsmall\" style=\"background-image:url(icons/s/"+iconID+".gif);\">";iconHTML+="<div class=\"tile\"></div></div>";}
cell.innerHTML=iconHTML;cg_ae(row,cell);cell=cg_ce("td");cell.className="WOWDB-ac-c";cell.innerHTML=Curse.SearchAssistant.getHighlightedName(searchTerm,matchName);cg_ae(row,cell);cell=cg_ce("td");cell.className="WOWDB-ac-d";var matchCountHTML="";for(j=0;j<arrMatchCount.length;j+=2)
{var entityLabel="";if(window.cg_getEntityLabelPlural)
{entityLabel=cg_getEntityLabelPlural(arrMatchCount[j]);}
else
{entityLabel=Curse.Lookup.entity_label[arrMatchCount[j]];}
var entityCount=arrMatchCount[j+1];matchCountHTML+=", "+entityLabel+": "+entityCount;}
cell.innerHTML=matchCountHTML.substring(2);cg_ae(row,cell);cg_ae(Curse.SearchAssistant.tbody,row);}
Curse.SearchAssistant.updatePosition();Curse.SearchAssistant.show();},getHighlightedName:function(searchTerm,matchingName)
{searchTerm=searchTerm.toLowerCase();if(searchTerm.length>matchingName.length)
{return matchingName;}
if(searchTerm.toLowerCase()==matchingName)
{return"<b>"+matchingName+"</b>";}
for(var i=0;i<searchTerm.length;i++)
{if(searchTerm[i]!=matchingName[i])
{break;}}
var highlightedName=new String();return"<b>"+matchingName.substring(0,i)+"</b>"+matchingName.substring(i);},setSelectionIndex:function(newIndex)
{if(newIndex<-1)
{return;}
if(newIndex>=Curse.SearchAssistant.table.rows.length)
{newIndex=0;}
else if(newIndex==-1)
{newIndex=Curse.SearchAssistant.table.rows.length-1;}
if(Curse.SearchAssistant.selectionIndex>=0&&Curse.SearchAssistant.selectionIndex<Curse.SearchAssistant.table.rows.length)
{Curse.SearchAssistant.table.rows[Curse.SearchAssistant.selectionIndex].className="WOWDB-ac-a";}
Curse.SearchAssistant.selectionIndex=newIndex;if(Curse.SearchAssistant.selectionIndex>=0&&Curse.SearchAssistant.selectionIndex<Curse.SearchAssistant.table.rows.length)
{Curse.SearchAssistant.table.rows[Curse.SearchAssistant.selectionIndex].className="WOWDB-ac-b";Curse.SearchAssistant.input.value=cg_getTextValue(Curse.SearchAssistant.table.rows[Curse.SearchAssistant.selectionIndex].cells[1]);Curse.SearchAssistant.input.selectionStart=Curse.SearchAssistant.input.selectionEnd=Curse.SearchAssistant.input.value.length;}},process:function(target)
{var table=Curse.SearchAssistant.table;if(table.style.visbility=="hidden")
{return;}
if(Curse.SearchAssistant.selectionIndex<-1)
{return;}
if(Curse.SearchAssistant.selectionIndex>table.rows.length)
{return;}
if(target&&target!=table&&!table.contains(target))
{return;}
var searchValue;if(Curse.SearchAssistant.selectionIndex==-1)
{var searchValue=Curse.SearchAssistant.input.value;}
else
{var searchValue=cg_getTextValue(table.rows[Curse.SearchAssistant.selectionIndex].cells[1]);}
Curse.SearchAssistant.hide();Curse.SearchAssistant.input.value=searchValue;},clear:function()
{var rowContainer=Curse.SearchAssistant.tbody;if(!rowContainer)
{return;}
while(rowContainer.firstChild)
{rowContainer.removeChild(rowContainer.firstChild);}},handleRowClick:function(row,e)
{Curse.SearchAssistant.process(row);Curse.SearchAssistant.hide();Curse.SearchAssistant.form.submit();},handleInputClick:function(input,e)
{if(Curse.SearchAssistant.table.rows.length>0)
{Curse.SearchAssistant.show();}},handleDocumentClick:function(e)
{e=cg_getEvent(e);var targetObj=cg_getEventTarget(e);if(targetObj==Curse.SearchAssistant.input)
{return;}
Curse.SearchAssistant.hide();},handleMouseOver:function(e)
{e=cg_getEvent(e);var targetObj=cg_getEventTarget(e);while(targetObj.tagName!="TR")
{targetObj=targetObj.parentNode;}
targetObj.className="WOWDB-ac-b";Curse.SearchAssistant.selectionIndex=targetObj.rowIndex;},handleMouseOut:function(e)
{e=cg_getEvent(e);var targetObj=cg_getEventTarget(e);while(targetObj.tagName!="TR")
{targetObj=targetObj.parentNode;}
targetObj.className="WOWDB-ac-a";},handleKeyDown:function(e)
{e=cg_getEvent(e);if(e.keyCode==38||e.keyCode==40)
{cg_cancelBubbling(e);return false;}},handleKeyUp:function(e)
{e=cg_getEvent(e);if(e.keyCode==38)
{if(Curse.SearchAssistant.container.style.visibility=="hidden")
{Curse.SearchAssistant.consumeKeys();return;}
Curse.SearchAssistant.setSelectionIndex(Curse.SearchAssistant.selectionIndex-1);cg_cancelBubbling(e);return false;}
else if(e.keyCode==40)
{if(Curse.SearchAssistant.container.style.visibility=="hidden")
{Curse.SearchAssistant.consumeKeys();return;}
Curse.SearchAssistant.setSelectionIndex(Curse.SearchAssistant.selectionIndex+1);cg_cancelBubbling(e);return false;}
else if(e.keyCode==27)
{Curse.SearchAssistant.hide();cg_cancelBubbling(e);return false;}
else if(e.keyCode==13)
{Curse.SearchAssistant.container.style.visibility="hidden";cg_cancelBubbling(e);return false;}
if(Curse.SearchAssistant.lastTerm&&e&&(e.keyCode==38||e.keyCode==40||e.keyCode==27))
{return false;}
Curse.SearchAssistant.consumeKeys();},consumeKeys:function()
{var newTerm=Curse.SearchAssistant.input.value.toLowerCase();if(newTerm==Curse.SearchAssistant.lastTerm)
{if(Curse.SearchAssistant.tbody.rows.length>0)
{Curse.SearchAssistant.show();}
return false;}
if(newTerm.length<3)
{Curse.SearchAssistant.lastTerm=null;Curse.SearchAssistant.hide();Curse.SearchAssistant.clear();return false;}
Curse.SearchAssistant.processing=true;Curse.SearchAssistant.lastTerm=newTerm;if(Curse.SearchAssistant.input.id=="home-search-input")
{Curse.SearchAssistant.input.style.backgroundImage="url(images/spinner.gif)";}
Curse.Ajax.load("ajaxSearchAssistant.aspx?s="+newTerm,processData,"text","get",true);function processData(data)
{if(Curse.SearchAssistant.input.id=="home-search-input")
{Curse.SearchAssistant.input.style.backgroundImage="none";}
Curse.SearchAssistant.populate(data);Curse.SearchAssistant.processing=false;}}};Curse.Tooltip={initialize:function()
{if(Curse.Tooltip.container)
{return;}
Curse.Tooltip.container=cg_ce("div");Curse.Tooltip.container.className="tooltip-container";Curse.Tooltip.icons=[];Curse.Tooltip.tooltips=[];for(var i=0;i<3;i++)
{Curse.Tooltip.icons[i]=cg_ce("div");Curse.Tooltip.icons[i].className="tooltip-icon";var iconFrame=cg_ce("div");cg_ae(Curse.Tooltip.icons[i],iconFrame);cg_ae(Curse.Tooltip.container,Curse.Tooltip.icons[i]);Curse.Tooltip.tooltips[i]=cg_ce("div");Curse.Tooltip.tooltips[i].className="tooltip";var td;Curse.Tooltip.tooltips[i]._text=td=cg_ce("td");var t=cg_ce("table"),tb=cg_ce("tbody"),tr1=cg_ce("tr"),tr2=cg_ce("tr"),th1=cg_ce("th"),th2=cg_ce("th"),th3=cg_ce("th");th1.style.backgroundPosition="top right";th2.style.backgroundPosition="bottom left";th3.style.backgroundPosition="bottom right";cg_ae(tr1,td);cg_ae(tr1,th1);cg_ae(tb,tr1);cg_ae(tr2,th2);cg_ae(tr2,th3);cg_ae(tb,tr2);cg_ae(t,tb);cg_ae(Curse.Tooltip.tooltips[i],t);cg_ae(Curse.Tooltip.container,Curse.Tooltip.tooltips[i]);}
cg_ae(document.body,Curse.Tooltip.container);},showTip:function(text)
{text="<span class=\"r\">"+text+"</span>";Curse.Tooltip.show(text);Curse.Tooltip.updateSize();Curse.Tooltip.updatePosition();},hide:function(){Curse.Tooltip.currentTooltipId=null;if(Curse.Tooltip.container)
{Curse.Tooltip.hideIcons();Curse.Tooltip.container.style.display="none";Curse.Tooltip.container.style.width="auto";for(var i=0;i<Curse.Tooltip.tooltips.length;i++)
{Curse.Tooltip.tooltips[i]._text.innerHTML="";Curse.Tooltip.tooltips[i].style.display="none";}}},hideIcons:function()
{for(var i=0,len=Curse.Tooltip.icons.length;i<len;i++)
{Curse.Tooltip.icons[i].style.backgroundImage="";Curse.Tooltip.icons[i].style.display="none";}},show:function(text1,text2,text3)
{if(Curse.Tooltip.container==null)
{Curse.Tooltip.initialize();}
Curse.Tooltip.tooltips[0]._text.innerHTML=text1;Curse.Tooltip.tooltips[0].style.display="block";if(text2!=null)
{Curse.Tooltip.tooltips[1]._text.innerHTML=text2;Curse.Tooltip.tooltips[1].style.display="block";}
if(text3!=null)
{Curse.Tooltip.tooltips[2]._text.innerHTML=text3;Curse.Tooltip.tooltips[2].style.display="block";}
Curse.Tooltip.container.style.visibility="hidden";Curse.Tooltip.container.style.display="block";Curse.Tooltip.updateSize();Curse.Tooltip.updatePosition();Curse.Tooltip.container.style.visibility="visible";},updatePosition:function()
{if(!Curse.Tooltip.container)
{return;}
if(Curse.Tooltip.container.style.display!="block")
{return;}
var paddingWidth=15,paddingHeight=20,scrollPad=20,viewportHeight=Curse.Client.viewportHeight(),viewportWidth=Curse.Client.viewportWidth()-scrollPad,boundTop=Curse.Client.scrollTop(),boundBottom=viewportHeight+boundTop,tooltipHeight=Curse.Tooltip.container.offsetHeight,tooltipWidth=Curse.Tooltip.container.offsetWidth,boundLeft=0,boundRight=viewportWidth,mousePos={x:Curse.Mouse.x,y:Curse.Mouse.y},newTop=mousePos.y+paddingHeight,newLeft=mousePos.x+paddingWidth,inversePosition=false;Curse.Tooltip.orientation="bottom";if(Curse.Tooltip.inversed)
{Curse.Tooltip.orientation="top";paddingWidth=10;}
if(Curse.Tooltip.inversed||(newTop+tooltipHeight)>=boundBottom)
{Curse.Tooltip.orientation="top";newTop=mousePos.y-tooltipHeight-paddingHeight;if(newTop<0)
{newTop=(viewportHeight-tooltipHeight)/2;}}
else
{newTop=mousePos.y+paddingHeight;}
if(Curse.Tooltip.inversed||(newLeft+tooltipWidth)>=boundRight)
{newLeft=boundRight-Curse.Tooltip.container.offsetWidth;newLeft=mousePos.x-paddingWidth-Curse.Tooltip.container.offsetWidth;}
if(newTop<boundTop)
{newTop=boundTop;Curse.Tooltip.orientation="top"}
if(newLeft<boundLeft)
{newLeft=boundLeft;}
Curse.Tooltip.container.style.top=newTop+"px";Curse.Tooltip.container.style.left=newLeft+"px";Curse.Tooltip.updateOrientation();},updateOrientation:function()
{if(Curse.Tooltip.orientation=="top"&&Curse.Tooltip.container.offsetHeight>Curse.Tooltip.tooltips[0].offsetHeight)
{for(var i=0,len=Curse.Tooltip.tooltips.length;i<len;i++)
{if(Curse.Tooltip.tooltips[i].style.display=="block")
{Curse.Tooltip.tooltips[i].style.top="auto";Curse.Tooltip.tooltips[i].style.bottom=(Curse.Tooltip.tooltips[i].offsetHeight-Curse.Tooltip.container.offsetHeight)+"px";Curse.Tooltip.icons[i].style.top=(Curse.Tooltip.container.offsetHeight-Curse.Tooltip.tooltips[i].offsetHeight)+"px";}}}
else
{for(var i=0,len=Curse.Tooltip.tooltips.length;i<len;i++)
{Curse.Tooltip.tooltips[i].style.top=Curse.Tooltip.tooltips[i].style.bottom="auto";Curse.Tooltip.icons[i].style.top=Curse.Tooltip.icons[i].style.bottom="auto";}}},updateSize:function()
{var width=0;for(var i=0;i<3;i++)
{width+=Curse.Tooltip.tooltips[i].offsetWidth+Curse.Tooltip.icons[i].offsetWidth;}
Curse.Tooltip.container.style.width=width+"px";},setIcons:function(args)
{Curse.Tooltip.initialize();for(var i=0,len=args.length;i<len;i++)
{if(args[i]==null)
{continue;}
Curse.Tooltip.icons[args[i].index].style.backgroundImage="url("+args[i].image+")";Curse.Tooltip.icons[args[i].index].style.display="block";}},updateTooltip:function(index,text)
{Curse.Tooltip.tooltips[index]._cell.innerHTML=text;},setCurrentTooltip:function(id)
{Curse.Tooltip.currentTooltipId=id;},getCurrentTooltip:function()
{return Curse.Tooltip.currentTooltipId;}}
cg_addEventListener(document,"mousemove",Curse.Tooltip.updatePosition);Curse.Searchfilter={initialize:function()
{var objFilterForm=cg_ge("searchFilterForm");if(!objFilterForm)
{return;}
var filtersParam=cg_getQueryStringParam("filters");var baseFilterHTML="<button onclick=\"Curse.Tooltip.hide();saveSearch_prompt(this)\" onmouseover=\"Curse.Tooltip.showTip('"+Localization.click_bookmark+"');\" onmouseout=\"Curse.Tooltip.hide();\"><span>"+Localization.bookmark_search+"</span></button>&nbsp";if(filtersParam=="")
{cg_ge("divBrowsePathRight").innerHTML=baseFilterHTML+"<button id=\"btnToggleFilter\" onclick=\"Curse.Tooltip.hide();Curse.Searchfilter.toggle(this)\" class=\"smallButton\" onmouseover=\"Curse.Tooltip.showTip('"+Localization.provide_search_criteria+"');\" onmouseout=\"Curse.Tooltip.hide();\"><span>"+Localization.create_filter+"</span></button>";return;}
cg_ge("divBrowsePathRight").innerHTML=baseFilterHTML+"<button id=\"btnToggleFilter\" onclick=\"Curse.Searchfilter.toggle(this)\" class=\"smallButton\"><span>"+Localization.hide_filter_form+"</span></button>";Curse.Searchfilter.resetAdditionalFilters();Curse.Searchfilter.show();var filterArray=filtersParam.split(";");for(var i=0;i<filterArray.length;i++)
{var currentFilter=filterArray[i].split("=");var currentFilterName=currentFilter[0];var currentFilterValue=currentFilter[1];Curse.Searchfilter.setFilterElement(currentFilterName,currentFilterValue);}},render:function()
{if(Curse.Searchfilter.rendered)
{return;}
var f=cg_ge("searchFilterForm");var t=cg_ge("tableAdditionalFilters");var colFc=cg_getElementsByClassName("fc","DIV",f);var eventsToHandle=[];for(var i=0;i<colFc.length;i++)
{if(colFc[i].id)
{var lookupDef=colFc[i].id.split(".");var lookupOnChange=null;if(colFc[i].getAttribute("curseonchange"))
{lookupOnChange=colFc[i].getAttribute("curseonchange");}
var newSelectBox=cg_getLookupSelectBox(lookupDef[1],lookupDef[2],colFc[i],false,lookupOnChange);if(lookupOnChange)
{eventsToHandle.push(newSelectBox);}}}
for(var i=0;i<eventsToHandle.length;i++)
{}
Curse.Searchfilter.rendered=true;},show:function()
{Curse.Searchfilter.render();var searchFilterForm=cg_ge("searchFilterForm");searchFilterForm.style.display="block";},toggle:function(btn)
{var searchFilterForm=cg_ge("searchFilterForm");if(!btn)
{btn=cg_ge("btnToggleFilter");}
if(!searchFilterForm)
{return;}
if(searchFilterForm.style.display!="block"||!btn)
{Curse.Searchfilter.show();if(btn)
btn.childNodes[0].innerHTML=Localization.hide_filter_form;}
else
{searchFilterForm.style.display="none";if(btn)
btn.childNodes[0].innerHTML=Localization.create_filter;}},submitFilter:function()
{var filterString="";var objFilterForm=document.getElementById("searchFilterForm");var searchFilterCollection=objFilterForm.elements;var filtersProcessed=[];for(var i=0;i<searchFilterCollection.length;i++)
{if(searchFilterCollection[i].name=="")
{continue;}
if(filtersProcessed.indexOf(searchFilterCollection[i].name)>=0&&searchFilterCollection[i].type!="radio")
{continue;}
if(searchFilterCollection[i].multiple)
{var multiSelectValues="";for(var j=0;j<searchFilterCollection[i].options.length;j++)
{if(searchFilterCollection[i].options[j].selected&&searchFilterCollection[i].options[j].value!="")
{multiSelectValues+=","+searchFilterCollection[i].options[j].value;}}
if(multiSelectValues!="")
{multiSelectValues=multiSelectValues.substring(1);filterString+=";"+searchFilterCollection[i].name+"="+multiSelectValues;}}
else
{if((searchFilterCollection[i].type=="radio"&&searchFilterCollection[i].checked)||(searchFilterCollection[i].type=="checkbox"&&searchFilterCollection[i].checked)||(searchFilterCollection[i].type!="checkbox"&&searchFilterCollection[i].type!="radio"&&searchFilterCollection[i].value!=""))
{filterString+=";"+searchFilterCollection[i].name+"="+searchFilterCollection[i].value;}}
filtersProcessed.push(searchFilterCollection[i].name);}
filterString=filterString.substring(1);if(filterString!="")
{filterString="&filters="+filterString;}
var browseKey=cg_getQueryStringParam("browse");if(!browseKey)
{return;}
self.location="search.php?xvx=1&";},removeFilter:function()
{var browseKey=cg_getQueryStringParam("browse");if(!browseKey)
{return;}
self.location="search.php?xvxx=1&xsc=";},addSearchFilterInput:function(selectObj)
{var selectedOption=selectObj.options[selectObj.selectedIndex];var searchFilterID=selectedOption.value;var cellInputContainer=selectObj.parentNode.parentNode.cells[1];var cellLinkContainer=selectObj.parentNode.parentNode.cells[2];var numChildNodes=cellInputContainer.childNodes.length;for(var i=0;i<numChildNodes;i++)
{cellInputContainer.removeChild(cellInputContainer.childNodes[0]);}
if(selectObj.selectedIndex==0)
{cellLinkContainer.innerHTML="";return;}
if(selectedOption.className=="inputRange")
{var minRangeID=searchFilterID.split(",")[0];var maxRangeID=searchFilterID.split(",")[1];var minRangeInput=document.createElement("input");minRangeInput.type="text";minRangeInput.name=minRangeID;minRangeInput.size="4";minRangeInput.style.textAlign="center";minRangeInput.value="1";cellInputContainer.appendChild(minRangeInput);var rangeLabel=document.createElement("span");rangeLabel.innerHTML=" to ";cellInputContainer.appendChild(rangeLabel);var maxRangeInput=document.createElement("input");maxRangeInput.type="text";maxRangeInput.name=maxRangeID;maxRangeInput.size="4";maxRangeInput.style.textAlign="center";cellInputContainer.appendChild(maxRangeInput);}
else if(selectedOption.className=="inputLookup")
{cellInputContainer.appendChild(cg_getLookupSelectBox(selectedOption.id,selectedOption.value,null,true));}
else if(selectedOption.className=="inputText")
{var textInput=document.createElement("input");textInput.type="text";textInput.name=searchFilterID;textInput.size="20";cellInputContainer.appendChild(textInput);}
cellLinkContainer.innerHTML="<button class=\"smallButton\" onclick=\"return Curse.Searchfilter.removeSearchFilter(this);\"><span>"+Localization.remove+"</span></button>";},toggleModeBox:function(locationBox,modeBoxID)
{var lookupList=Curse.Lookup.location_has_modes;var currentLocationID=locationBox.options[locationBox.selectedIndex].value;var locationFound=false;for(var p in lookupList)
{if(lookupList[p].indexOf&&lookupList[p].indexOf(currentLocationID)>=0)
{locationFound=true;break;}}
if(!locationFound&&currentLocationID!="")
{cg_ge("fi_"+modeBoxID).selectedIndex=-1;cg_ge("fi_"+modeBoxID).disabled=true;}
else
{cg_ge("fi_"+modeBoxID).style.display="inline";cg_ge("fi_"+modeBoxID).disabled=false;}},addSearchFilter:function()
{var objFilterTable=document.getElementById("tableAdditionalFilters");var cloneFilterRow=objFilterTable.rows[0].cloneNode(true);objFilterTable.tBodies[0].appendChild(cloneFilterRow);cloneFilterRow.cells[1].innerHTML="";return cloneFilterRow.cells[0];},removeSearchFilter:function(removeLink)
{var objFilterTable=document.getElementById("tableAdditionalFilters");if(objFilterTable.rows.length==1)
{objFilterTable.rows[0].cells[0].childNodes[0].selectedIndex=0;Curse.Searchfilter.addSearchFilterInput(objFilterTable.rows[0].cells[0].childNodes[0]);}
else
{var parentRow=removeLink.parentNode.parentNode;objFilterTable.deleteRow(parentRow.rowIndex);}
return false;},resetAdditionalFilters:function()
{var objTbl=cg_ge("tableAdditionalFilters");if(!objTbl)
{return;}
var oSel=objTbl.getElementsByTagName("select")[0];oSel.selectedIndex=0;},setFilterElement:function(name,values)
{var objFilterForm=cg_ge("searchFilterForm");var objElements=objFilterForm.elements;var elementFound=false;for(var i=0;i<objElements.length;i++)
{if(objElements[i].name==name)
{Curse.Searchfilter.setFilterElementValue(objElements[i],values);elementFound=true;break;}}
if(elementFound)
{return;}
var objTbl=cg_ge("tableAdditionalFilters");var colSel=cg_getElementsByClassName("filters-add","select",objTbl);var oLastSel=colSel[colSel.length-1];if(oLastSel.selectedIndex>0)
{Curse.Searchfilter.addSearchFilter();colSel=cg_getElementsByClassName("filters-add","select",objTbl);oLastSel=colSel[colSel.length-1];}
var colOptions=oLastSel.options;for(var i=0;i<colOptions.length;i++)
{var filterName=colOptions[i].value;var filterNameArray=filterName.split(",");if(filterNameArray[0]==name||filterNameArray[1]==name)
{var index=0;if(filterNameArray[1]==name)
{index=1;}
oLastSel.selectedIndex=i;Curse.Searchfilter.setAdditionalFilterValue(oLastSel,values,index);break;}}},setAdditionalFilterValue:function(parentSel,values,index)
{Curse.Searchfilter.addSearchFilterInput(parentSel);var inputContainer=parentSel.parentNode.parentNode.cells[1];if(inputContainer.childNodes[0].tagName=="SELECT")
{Curse.Searchfilter.setFilterElementValue(inputContainer.childNodes[0],values);return;}
var input=inputContainer.getElementsByTagName("input")[index];input.value=values;},setFilterElementValue:function(objElement,values)
{if(objElement.tagName=="INPUT")
{if(objElement.type=="checkbox")
{if(objElement.value==values)
{objElement.checked=true;}}
else if(objElement.type=="radio")
{if(objElement.value==values)
{objElement.checked=true;}}
else
{objElement.value=unescape(values);}}
else if(objElement.tagName=="SELECT")
{if(objElement.multiple)
{var valuesArray=values.split(",");}
else
{var valuesArray=values.split(" ");}
var objOptions=objElement.options;for(var i=0;i<valuesArray.length;i++)
{for(var j=0;j<objOptions.length;j++)
{if(objOptions[j].value==valuesArray[i])
{objOptions[j].selected=true;break;}}}}}}
Curse.Comment={ratingThreshold:-4,rate:function(record,rating)
{var formString="?comment_entity_type_id="+Curse.Comment.subjectTypeID+"&comment_entity_id="+Curse.Comment.subjectID+"&comment_id="+record.id+"&comment_rating="+rating;var ratingContainer=cg_getElementsByClassName("comment-rating","DIV",record.divHeader,true);ratingContainer=ratingContainer.childNodes[ratingContainer.childNodes.length-3];var tmpRating=record.rating+rating;var ratingValueContainer=ratingContainer.lastChild.firstChild;ratingValueContainer.nodeValue=(tmpRating>0?"+":"")+tmpRating;record.spanRating.style.display="none";Curse.Ajax.load("postComment.aspx"+formString,handleCommentRatingPostback,'text','post');function handleCommentRatingPostback(data)
{var postResult=data.split("|");if(postResult[0]==0)
{record.rating=tmpRating;cg_de(record.spanRating);}
else
{ratingValueContainer.nodeValue=(record.rating>0?"+":"")+record.rating;record.spanRating.style.display="inline";Curse.Alert.show(postResult[1]);}}},toggleDisplay:function(record)
{this.firstChild.nodeValue=(cg_toggleDisplay(record.divBody)?Localization.hide_comment:Localization.show_comment);if(record.allowRating)
{record.divHeader.firstChild.lastChild.style.display="";}
cg_toggleDisplay(record.divLinks);if(record.lastEdit!=null)
{cg_toggleDisplay(record.divLastEdit);}},cancelEdit:function(cancelButton)
{Curse.Comment.removeEditForm(cancelButton.parentNode.parentNode);},removeEditForm:function(editorContainer)
{var commentContainer=editorContainer.parentNode;var commentBody=cg_getElementsByClassName("comment-body","div",commentContainer,true);var editButtonContainer=cg_getElementsByClassName("comment-links","div",commentContainer,true);commentContainer.removeChild(editorContainer);if(editorContainer&&commentBody==null)
{editorContainer.ascBodyContainer.style.display="inline";editorContainer.ascEditButtonContainer.style.display="inline";if(editorContainer.ascHiddenElements&&editorContainer.ascHiddenElements.length>0)
{for(var i=0;i<editorContainer.ascHiddenElements.length;i++)
{editorContainer.ascHiddenElements[i].style.display="block";}}}
else
{editButtonContainer.style.display="block";commentBody.style.display="block";}},edit:function(record)
// EDITO ADDING COMMENTS I BELIEVE
{record.divBody.style.display="none";record.divLinks.style.display="none";var editorDiv=Curse.TextEditor.getForm("postComment.php","formCommentEditor","ajax_action=edit_comment,comment_entity_type_id="+Curse.Page.entityTypeID+",comment_entity_id="+Curse.Page.entityID+",comment_id="+record.id,"comment_body",record.body,null,null,8,"8,000");editorDiv.className="editor";record.__div.insertBefore(editorDiv,record.divBody);},del:function(record)
{if(!window.confirm(Localization.confirm_delete))
{return;}
var formString="?comment_entity_type_id="+Curse.Page.entityTypeID;formString+="&comment_entity_id="+Curse.Page.entityID;formString+="&delete_comment_id="+record.id;Curse.Ajax.load("postComment.aspx"+formString,handleDeleteCommentPostback,'text','post');record.divContainer.style.display="none";function handleDeleteCommentPostback(data)
{var postResult=data.split("|");if(postResult[0]==0)
{Curse.Alert.show(postResult[1]);}
else
{Curse.Alert.show(postResult[1]);record.divContainer.style.display="block";}}},setLastEdited:function(record)
{var divLastEdit=cg_ce("div");divLastEdit.className="comment-lastedit";cg_ae(divLastEdit,cg_ct(Localization.last_edited_by));var a=cg_ce("a");a.href="user.aspx?id="+record.lastEdited[0];cg_ae(a,cg_ct(record.lastEdited[1]));cg_ae(divLastEdit,cg_ct(" "));cg_ae(divLastEdit,a);cg_ae(divLastEdit,cg_ct(" "));var s=cg_ce("span");var editDate=new Date(record.lastEdited[2]);var localEditTime=cg_getShortFriendlyTime(editDate);cg_ae(s,cg_ct(localEditTime));cg_ae(divLastEdit,s);cg_ae(divLastEdit,cg_ct(" "));if(record.divLastEdit!=null)
{record.divContainer.replaceChild(divLastEdit,record.divLastEdit);}
else
{cg_ae(record.divContainer,divLastEdit);}
record.divLastEdit=divLastEdit;},handleAjaxLoad:function(data,args)
{eval(data);if(!cg_comments)
{var cg_comments=[];}
Curse.DataGrid.addOrReplaceData("comments","results","comments","Comments",cg_comments);},showCaptcha:function(e)
{return;var objCommentPoster=cg_ge("divCommentPoster");if(objCommentPoster.style.display=="block")
{return;}
var objVerificationImage=cg_ge("verificationImage");objVerificationImage.src="getVerificationImage.html";objCommentPoster.style.display="block";},handleEditFormSubmit:function(saveButton)
{var editorContainer=saveButton.parentNode.parentNode;var commentForm=editorContainer.getElementsByTagName("form")[0];var commentID=commentForm.comment_id.value;Curse.Ajax.load(cg_getFormAsString(commentForm),handleEditCommentPostback,'text','post');function handleEditCommentPostback(data)
{var postResult=data.split("|");if(postResult[0]==0)
{if(commentForm.comment_body.value.indexOf("[item")>=0||commentForm.comment_body.value.indexOf("[spell")>=0)
{window.location.reload(false);}
Curse.Comment.removeEditForm(editorContainer);var comment=Curse.DataGrid.getDataByType("comments",commentID);comment.body=commentForm.comment_body.value;cg_refreshDate();var editDate=new Date();editDate=editDate.getTime();comment.lastEdited=[Curse.User.id,Curse.User.displayName,editDate];comment.divBody.innerHTML=Curse.TextFormatter.getFormattedText(comment.body);comment.divLinks.style.display="";Curse.Comment.setLastEdited(comment);}
else
{Curse.Alert.show(postResult[1]);}}},handleFormSubmit:function(e)
{var myEvent=cg_getEvent(e);var targetObj=cg_getEventTarget(myEvent);var editorContainer=targetObj;while(editorContainer.className!="editor")
{editorContainer=editorContainer.parentNode;}
var submitButton=cg_getElementsByClassName("smallButton","button",editorContainer,true);var commentForm=editorContainer.getElementsByTagName("form")[0];if(commentForm.comment_body.value.length<10)
{Curse.Alert.show(Localization.replace("enter_at_least_x_chars",10));return;}
Curse.Ajax.load(cg_getFormAsString(commentForm),handleCommentSubmitPostback,'text','post');submitButton.disabled=true;function handleCommentSubmitPostback(data)
{var postResult=data.split("|");submitButton.disabled=false;if(postResult[0]==0)
{var commentRecord=eval("("+postResult[1]+")");if(commentRecord.body.indexOf("[item")>=0||commentRecord.body.indexOf("[spell")>=0)
{window.location.reload(false);}
cg_ge("divPostConfirmation").innerHTML=Localization.your_comment_posted;cg_ge("divPostConfirmation").style.display="block";commentForm.reset();var comment={};cg_cO(comment,commentRecord);comment.userAvatar=Curse.User.avatar;if(cg_datagrids["comments"].data.length==0)
{cg_datagrids["comments"].data.push(comment);cg_datagrids["comments"].initialize();}
else
{cg_datagrids["comments"].data.push(comment);cg_datagrids["comments"].renderRows();}}
else
{Curse.Alert.show(postResult[1]);}}},handleKeyPress:function(e)
{e=cg_getEvent(e);if(e.keyCode==13)
{(e);return;}},scrollToForm:function()
{cg_contributeTabs.show(0);var objCommentInput=Curse.Comment.formContainer.getElementsByTagName("textarea")[0];Curse.Comment.formContainer.scrollIntoView();objCommentInput.focus();},formContainer:null,updateForm:function()
{Curse.Comment.subjectTypeID=Curse.Page.entityTypeID;Curse.Comment.subjectID=Curse.Page.entityID;cg_ge("comment_entity_type_id").value=Curse.Comment.subjectTypeID
cg_ge("comment_entity_id").value=Curse.Comment.subjectID;},initializeForm:function(args)
{container=Curse.Comment.formContainer=cg_ge(args.container);if(Curse.User.id==null&&container)
// EDITO CHECKS IF USER EXIST TO ALLOW COMMENT 
{var loginDiv=document.createElement("DIV");loginDiv.innerHTML="<small>"+Localization.replace("login_register_to_comment","<a href=\"javascript:cg_navToLogin();\">","</a>","<a href=\"register.php\">","</a>")+"</small>";container.insertBefore(loginDiv,container.childNodes[0]);}
var formDisabled=Curse.User.id==null;var editorDiv=Curse.TextEditor.getForm("postComment.php","formCommentEditor","ajax_action=add_comment,comment_entity_type_id="+args.subjectTypeId+",comment_entity_id="+args.subjectId,"comment_body",null,"Curse.Comment.showCaptcha(event)",null,8,"8,000",true,"(event)^"+Localization.add_comment,null,formDisabled);editorDiv.className="editor";container.appendChild(editorDiv);Curse.Comment.updateForm();}};if(!Curse.WOWDB)
{Curse.WOWDB={};}

function cg_initHeader()
{Curse.Menu.addMainMenu("spanMainMenu",mn_Main);if(cg_currentLanguage=="en"&&cg_currentLanguage!=Curse.User.getPreferredLanguage())
{}
var languageOptions=[];for(var p in Curse.Lookup.language_label)
{if(typeof(Curse.Lookup.language_label[p])!="function")
languageOptions.push([p,"<img src=\"images/clear.gif\"></img> "+Curse.Lookup.language_label[p],"javascript:Curse.User.setPreferredLanguage('"+p+"');",null,"menu-flag-"+p]);}
var languageLabel=Curse.Lookup.language_label[cg_currentLanguage];if(cg_getRelativeLocation()!=""&&cg_getRelativeLocation()!="default.aspx")
{languageLabel="&nbsp;&nbsp;&nbsp;";}
var mn_Language=[[1,"<img src=\"images/clear.gif\"></img> "+languageLabel,"javascript:;",languageOptions,"spanMenuLink menu-flag-"+cg_currentLanguage]];Curse.Menu.addMainMenu("spanLanguageMenu",mn_Language);setUser();}

function cg_setRatingPercs(itemid)
{return;var masterItem=null;var level;if(_currentCharID)
{var chara=getCharacter(_currentCharID);level=chara.level;masterItem=getCharItem(itemid,chara);}
if(!masterItem)
{masterItem=cg_items[itemid];level=_mainCharLevel;}
for(var i=1;i<35;i++)
{var regex=new RegExp("(\\<span class=r2 id='tooltipItemStat_"+i+"'>.*? rating by )(\\w+)(.*?)\\<\\/span\\>");var matches=regex.exec(masterItem.description);if(matches!=null)
{masterItem.description=masterItem.description.replace(regex,matches[1]+matches[2]+"("+roundperc(RateToVal(level,matches[2]*1.0,i))+"% at "+level+")"+matches[3]+"</span>");}}}

function cg_setStatDiffs(compareToItemID,itemPanelIndex)
{function getStatDiffs(compareToItem,masterItem)
{if(!_dispStatDiff)
{return;}
var masterStats=masterItem.stats;if(!masterStats)
{masterStats=getItemStats(masterItem.id);}
var compareToStats=compareToItem.stats;if(!compareToStats)
{compareToStats=getItemStats(compareToItem.id);}
if(masterStats==null||compareToStats==null)
{return null;}
return calculateStatDiffs(masterStats,compareToStats);}
var masterItemID=cg_itemPanels[0].itemID;var masterItem=null;if(cg_itemPanels[0].charID)
{masterItem=getCharItem(masterItemID,getCharacter(_arrItemPanels[0].charID));}
else
{masterItem=cg_items[masterItemID];}
var compareToItem=cg_items[compareToItemID];var arrStatDiffs=getStatDiffs(compareToItem,masterItem);if(arrStatDiffs==null)
{return;}
var myregexp=new RegExp("<div class=\"itemTooltipStatChangeList.*?<\/div>");var tooltipHTML=compareToItem.description;tooltipHTML=tooltipHTML.replace(myregexp,"");if(compareToItemID==masterItemID)
{compareToItem.description=tooltipHTML;setTooltipText(itemPanelIndex,tooltipHTML);return;}
tooltipHTML+="<div class=\"itemTooltipStatChangeList\">"+Localization.if_equip+" "+getItemNameWithStyle(masterItem);var statGainsHTML=[];var statLossesHTML=[];for(var j=0;j<arrStatDiffs.length;j++)
{var sdif=arrStatDiffs[j];if(sdif.val<=0)
continue;statGainsHTML.push("<span class=r"+((sdif.val>0)?('2'):('7'))+">"+((sdif.val>0)?('+'):(''))+sdif.val+" "+sdif.name+"</span>");}
for(var j=0;j<arrStatDiffs.length;j++)
{var sdif=arrStatDiffs[j];if(sdif.val>=0)
continue;statLossesHTML.push("<span class=r"+((sdif.val>0)?('2'):('7'))+">"+((sdif.val>0)?('+'):(''))+sdif.val+" "+sdif.name+"</span>");}
if(statGainsHTML.length>0)
{tooltipHTML+="<br>"+Localization.you_will_gain+statGainsHTML.join(", ");}
if(statLossesHTML.length>0)
{tooltipHTML+="<br>"+Localization.you_will_lose+statLossesHTML.join(", ");}
tooltipHTML+="</div>";compareToItem.description=tooltipHTML;setTooltipText(itemPanelIndex,tooltipHTML);}
function cg_getCSlotFromISlot(islot)
{if(islot==4)
return[6];if(islot==7)
return[11];if(islot==8)
return[12];if(islot==9)
return[8];if(islot==10)
return[9];if(islot==13)
return[17,18];if(islot==11)
return[13,14];if(islot==12)
return[15,16];if(islot==15||islot==25)
return[19];if(islot==16)
return[4];if(islot==17)
return[17];if(islot==19)
return[7];if(islot==21)
return[17];if(islot==22)
return[18];if(islot==23)
return[18];if(islot==24)
return[20];if(islot==28)
return[19];return[islot];}
function cg_getISlotFromCSlot(cslot)
{if(cslot==4)
return 16;if(cslot==6)
return 4;if(cslot==7)
return 19;if(cslot==8)
return 9;if(cslot==9)
return 10;if(cslot==10)
return 16;if(cslot==11)
return 7;if(cslot==12)
return 8;if(cslot==13)
return 11;if(cslot==14)
return 11;if(cslot==15)
return 12;if(cslot==16)
return 12;return cslot;}
function cg_setBrowseMenu(menuArray)
{if(!menuArray)
{return;}
var currentFilterString=cg_getQueryStringParam("filters");if(currentFilterString!="")
{currentFilterString="&filters="+currentFilterString;}
var currentBrowsePath;var span=document.createElement("SPAN");span.className="spanMenuArrow";var anchor=document.createElement("A");anchor.style.textDecoration="none";anchor.style.color="#ffffff";anchor.href="index.html";anchor.innerHTML=Localization.home;span.appendChild(anchor);var container=cg_ge("divBrowsePathLeft")
container.appendChild(span);var currentMenu;currentBrowsePath="";for(var i=0;i<menuArray.length;i++)
{currentMenu=menuArray[i];span=document.createElement("SPAN");anchor=document.createElement("A");anchor.style.cursor="default";if(i<menuArray.length-1)
{span.className="spanMenuArrow";}
if(i>0)
{currentBrowsePath+="."+currentMenu[0];}
else
{currentBrowsePath=currentMenu[0]+"";}
anchor.className="spanBrowseMenuLink";if(currentMenu[2]!=null)
{if(currentMenu[2]!="$nonav$")
{anchor.href=currentMenu[2];anchor.style.cursor="pointer";}
currentLink="";}
else
{anchor.href="search.aspx?browse="+currentBrowsePath+currentFilterString;anchor.style.cursor="pointer";}
anchor.innerHTML=currentMenu[1];anchor._baseLink=currentBrowsePath;var arrayKey="mn_"+currentBrowsePath.replace(/\./g,"_").replace(/\-/g,"$");var subMenuArray=null;try
{subMenuArray=eval(arrayKey);}
catch(ex)
{}
if(subMenuArray)
{anchor._subMenuArray=subMenuArray;}
anchor.onmouseover=Curse.Menu.handleMainMenuMouseOver.bind(anchor);anchor.onmouseout=Curse.Menu.handleMainMenuMouseOut.bind(anchor);anchor.onclick=Curse.Menu.closeMainMenu.bind(anchor);anchor._isMainMenu=true;span.appendChild(anchor);container.appendChild(span);}
cg_ge("divMainPrecontents").style.display="block";Curse.Searchfilter.initialize();}
function cg_getEntityLabelPlural(categoryID)
{for(var i=0;i<mn_Main.length;i++)
{if(mn_Main[i][0]==categoryID)
{return mn_Main[i][1];}}}
function cg_getEntityLabel(entityTypeID)
{return Curse.Lookup.entity_label[entityTypeID];}
function cg_setSearchText(text)
{var input=cg_ge("main-search-input");if(!input)
{return;}
input.value=text;}
if(!Curse.WOWDB)
{Curse.WOWDB={};}
Curse.Tooltip.baseURL="";Curse.Tooltip.handleSpellLinkOver=function(link,args,e)
{if(args==null)
{args={};}
args.relatedLink=link;Curse.Tooltip.showSpellTooltip(link._relatedID,args,e);}
Curse.Tooltip.showSpellTooltip=function(id,args,e)
{var spell=cg_spells[id];if(!spell||!spell.tooltip)
{Curse.Tooltip.setCurrentTooltip(id);Curse.Tooltip.loadAsync(id,args.relatedLink,Curse.Tooltip.handleAjaxSpell);return;}
if(args)
{var hideIcon=args["hideIcon"];}
if(!hideIcon)
{Curse.Tooltip.setIcons([{index:0,image:Curse.Tooltip.baseURL+"icons/m/"+spell.icon+".gif"}]);}
Curse.Tooltip.show(spell.tooltip);}
Curse.Tooltip.handleTalentLinkOver=function(link,args,e)
{Curse.Tooltip.showTalentTooltip(link._relatedID,args,e);}
Curse.Tooltip.showTalentTooltip=function(id,args,e)
{var talent=args.talents.byRank[id];if(!talent)
{return;}
Curse.Tooltip.show(talent.tooltip);}
Curse.Tooltip.loadAsync=function(id,relatedLink,handler)
{if(cg_isDefined(window,'cg_WOWDBsyndication'))
{cg_WOWDBsyndication.addExternalReference(id,relatedLink,handler,true);return;}
var url="ajaxTooltip.aspx?id="+id;if(handler==Curse.Tooltip.handleAjaxQuest)
{url+="&type=4";}
else if(handler==Curse.Tooltip.handleAjaxSpell)
{url+="&type=6";}
cg_queueAjaxRequest(url,handler,"text","get",relatedLink,true);}
Curse.Tooltip.handleItemLinkOver=function(link,args,e)
{if(!link._relatedID)
{var lpattern=new RegExp("(item|spell)\\.aspx\\?id=(\\d+)");var match=lpattern.exec(link.href);if(!match)
{return;}
link._relatedID=match[2];}
var item=cg_items[link._relatedID];if(!item||!item.tooltip)
{Curse.Tooltip.setCurrentTooltip(link._relatedID);Curse.Tooltip.loadAsync(link._relatedID,link,Curse.Tooltip.handleAjaxItem);return;}
var hideIcon,character,isEquipped;if(args)
{hideIcon=args["hideIcon"];character=args["relatedCharacter"];isEquipped=args["isEquipped"];}
var cids=Curse.Tooltip.getComparisonItems(item.id,item.slot,character,isEquipped);if(!args)
{args={};}
args.relatedLink=link;Curse.Tooltip.showItemTooltip(cids,args);}
Curse.Tooltip.showItemTooltip=function(itemids,args)
{var item,desc2,desc3;if(args==null)
{args={};}
if(args.relatedCharacter!=null)
{var item=args.relatedCharacter.itemsById[itemids[0]];}
else
{var item=cg_items[itemids[0]];if(!item||!item.tooltip)
{args.relatedLink._relatedID=itemids[0];Curse.Tooltip.setCurrentTooltip(args.relatedLink._relatedID);Curse.Tooltip.loadAsync(args.relatedLink._relatedID,args.relatedLink,Curse.Tooltip.handleAjaxItem);return;}}
if(item==null)
{return;}
var icons=[];var text=[];for(var i=0,len=itemids.length;i<len;i++)
{if(itemids[i]==null)
{continue;}
if(i==0&&args.relatedCharacter!=null)
{var item=args.relatedCharacter.itemsById[itemids[i]];}
else
{var item=cg_items[itemids[i]];}
if(item!=null&&item.tooltip)
{if(i>0||!args.hideIcon)
{icons[i]={index:i,image:Curse.Tooltip.baseURL+"icons/m/"+item.icon+".gif"}}
text[i]=item.tooltip;if(i>0)
{text[i]+=Curse.Tooltip.getStatDiffsHTML(cg_items[itemids[0]],item);}}
else
{Curse.Tooltip.loadAsync(itemids[i],args.relatedLink,Curse.Tooltip.handleAjaxItem);}}
if(icons.length>0)
{Curse.Tooltip.setIcons(icons);}
Curse.Tooltip.show(text[0],text[1],text[2]);};Curse.Tooltip.handleQuestLinkOver=function(link,e)
{Curse.Tooltip.showQuestTooltip(link._relatedID,link);}
Curse.Tooltip.showQuestTooltip=function(questid,link)
{var quest=cg_quests[questid];if(quest!=null)
{Curse.Tooltip.show(quest.tooltip);}
else
{Curse.Tooltip.setCurrentTooltip(link._relatedID);Curse.Tooltip.loadAsync(questid,link,Curse.Tooltip.handleAjaxQuest);}};Curse.Tooltip.handleAjaxItem=function(data,link)
{var newItem=eval('('+data+')');cg_items.addData(newItem);if(Curse.Tooltip.getCurrentTooltip()==link._relatedID)
{link.onmouseover();}
return;}
Curse.Tooltip.handleAjaxQuest=function(data,link)
{var newQuest=eval('('+data+')');cg_quests.addData(newQuest);if(Curse.Tooltip.getCurrentTooltip()==link._relatedID)
{link.onmouseover();}
return;}
Curse.Tooltip.handleAjaxSpell=function(data,link)
{cg_spells.addData(eval("("+data+")"));if(Curse.Tooltip.getCurrentTooltip()==link._relatedID)
{link.onmouseover();}
return;}
Curse.Tooltip.getStatDiffs=function(compareToItem,masterItem)
{function calculateStatDiffs(stat1,stat2)
{function getCStat(stat,id)
{for(var i=0;i<stat.length;i++)
{if(stat[i].id==id)
return stat[i].val;}
return 0;}
var sdifs=[];var sdone=[];for(var i=0;i<stat1.length;i++)
{var stat=stat1[i];if((stat.id==0)||(stat.id==8))
continue;if(!sdone[stat.id])
{var val=0;var sname;if(stat.id==7||stat.id==14)
{var vals1=stat.val.split('-');var nval=(((vals1[0]*1)+(vals1[1]*1))/2.0)/getCStat(stat1,stat.id+1);var damageRange2=getCStat(stat2,stat.id);if(damageRange2==0)
{continue;}
var vals2=damageRange2.split('-');var nval2=(((vals2[0]*1)+(vals2[1]*1))/2.0)/getCStat(stat2,stat.id+1);val=roundperc(nval-nval2);sname=Localization.dps;}
else
{var compVal=getCStat(stat2,stat.id);val=roundperc(stat.val-compVal);sname=statnames[stat.id];}
sdifs.push({name:sname,val:val});sdone[stat.id]=true;}}
for(var i=0;i<stat2.length;i++)
{var stat=stat2[i];if((stat.id==0)||(stat.id==8))
continue;if(sdone[stat.id]==null)
{var val=getCStat(stat1,stat.id)-stat.val;sdifs.push({name:statnames[stat.id],val:val});sdone[stat.id]=1;}}
return sdifs;}
var masterStats=masterItem.stats;if(!masterStats)
{return;}
var compareToStats=compareToItem.stats;if(!compareToStats)
{return;}
if(masterStats==null||compareToStats==null)
{return null;}
return calculateStatDiffs(masterStats,compareToStats);};Curse.Tooltip.getStatDiffsHTML=function(masterItem,compareToItem)
{if(masterItem.id==compareToItem.id)
{return"";}
var arrStatDiffs=Curse.Tooltip.getStatDiffs(compareToItem,masterItem);if(arrStatDiffs==null)
{return"";}
var tooltipHTML="<div class=\"itemTooltipStatChangeList\">"+Localization.if_equip+" "+masterItem.getNameWithStyle();var statGainsHTML=[];var statLossesHTML=[];for(var j=0;j<arrStatDiffs.length;j++)
{var sdif=arrStatDiffs[j];if(sdif.val<=0)
continue;statGainsHTML.push("<span class=r"+((sdif.val>0)?('2'):('7'))+">"+((sdif.val>0)?('+'):(''))+sdif.val+" "+sdif.name+"</span>");}
for(var j=0;j<arrStatDiffs.length;j++)
{var sdif=arrStatDiffs[j];if(sdif.val>=0)
continue;statLossesHTML.push("<span class=r"+((sdif.val>0)?('2'):('7'))+">"+((sdif.val>0)?('+'):(''))+sdif.val+" "+sdif.name+"</span>");}
if(statGainsHTML.length>0)
{tooltipHTML+="<br>"+Localization.you_will_gain+" "+statGainsHTML.join(", ");}
if(statLossesHTML.length>0)
{tooltipHTML+="<br>"+Localization.you_will_lose+" "+statLossesHTML.join(", ");}
tooltipHTML+="</div>";return tooltipHTML;}
Curse.Tooltip.getComparisonItems=function(itemID,itemSlot,character,isEquippedItem)
{var cids=new Array(3);cids[0]=itemID;if(isEquippedItem!=null||cg_isDefined(window,'cg_WOWDBsyndication'))
{return cids;}
if(character)
{var cslot=cg_getCSlotFromISlot(itemSlot);for(var i=0;i<cslot.length;i++)
{var charItem=character.getCharItemBySlot(cslot[i]);if(charItem)
{cids[i+1]=charItem.id;}}
return cids;}
else
{var citem=cg_buildTooltipIds(itemID,itemSlot)+"";cids=citem.split("|");if(cids[1]&&cids[1]=="null")
{cids[1]=null;}
if(cids[2]&&cids[2]=="null")
{cids[2]=null;}
return cids;}
if(!citem)
{cids[0]=itemID;return cids;}
else
{}
return cids;}
function cg_buildTooltipIds(id,slot)
{if((slot=="17")||(slot=="21"))
{if((cg_getCookie("Settings.PinnedItem.item_17")!=null)&&(cg_getCookie("Settings.PinnedItem.item_17")!="null"))
{return id+"|"+cg_getCookie("Settings.PinnedItem.item_17");}
else if((cg_getCookie("Settings.PinnedItem.item_21")!=null)&&(cg_getCookie("Settings.PinnedItem.item_21")!="null"))
{return id+"|"+cg_getCookie("Settings.PinnedItem.item_21");}
else if((cg_getCookie("Settings.PinnedItem.item_13")!=null)&&(cg_getCookie("Settings.PinnedItem.item_13")!="null"))
{var vals=cg_getCookie("Settings.PinnedItem.item_13").split("|");return id+"|"+vals[0];}
return id+"|"+cg_getCookie("Settings.PinnedItem.item_"+slot);}
if((slot=="5")||(slot=="20"))
{if((cg_getCookie("Settings.PinnedItem.item_5")!=null)&&(cg_getCookie("Settings.PinnedItem.item_5")!="null"))
{return id+"|"+cg_getCookie("Settings.PinnedItem.item_5");}
else if(cg_getCookie("Settings.PinnedItem.item_20")!=null&&cg_getCookie("Settings.PinnedItem.item_20")!="null")
{return id+"|"+cg_getCookie("Settings.PinnedItem.item_20");}
return id;}
else if((slot=="22")||(slot=="14")||(slot=="23"))
{if((cg_getCookie("Settings.PinnedItem.item_22")!=null)&&(cg_getCookie("Settings.PinnedItem.item_22")!="null"))
return id+"|"+cg_getCookie("Settings.PinnedItem.item_22");else if((cg_getCookie("Settings.PinnedItem.item_14")!=null)&&(cg_getCookie("Settings.PinnedItem.item_14")!="null"))
return id+"|"+cg_getCookie("Settings.PinnedItem.item_14");else if((cg_getCookie("Settings.PinnedItem.item_23")!=null)&&(cg_getCookie("Settings.PinnedItem.item_23")!="null"))
return id+"|"+cg_getCookie("Settings.PinnedItem.item_23");else if((cg_getCookie("Settings.PinnedItem.item_13")!=null)&&(cg_getCookie("Settings.PinnedItem.item_13")!="null"))
{var vals=cg_getCookie("Settings.PinnedItem.item_13").split("|");if((vals[1]!="")&&(vals[1]!=null))
return id+"|"+vals[1];}
return id+"|"+cg_getCookie("Settings.PinnedItem.item_"+slot);}
else if(slot=="13")
{var txt=id;if((cg_getCookie("Settings.PinnedItem.item_13")!="null")&&(cg_getCookie("Settings.PinnedItem.item_13")!=null))
{var vals=cg_getCookie("Settings.PinnedItem.item_13").split("|");if((vals[0]!="")&&(vals[0]!=null)&&(vals[0]!="null"))
txt+="|"+vals[0];}
if((cg_getCookie("Settings.PinnedItem.item_17")!="null")&&(cg_getCookie("Settings.PinnedItem.item_17")!=null))
txt+="|"+cg_getCookie("Settings.PinnedItem.item_17");if((cg_getCookie("Settings.PinnedItem.item_21")!="null")&&(cg_getCookie("Settings.PinnedItem.item_21")!=null))
txt+="|"+cg_getCookie("Settings.PinnedItem.item_21");if((cg_getCookie("Settings.PinnedItem.item_22")!="null")&&(cg_getCookie("Settings.PinnedItem.item_22")!=null))
txt+="|"+cg_getCookie("Settings.PinnedItem.item_22");if((cg_getCookie("Settings.PinnedItem.item_14")!="null")&&(cg_getCookie("Settings.PinnedItem.item_14")!=null))
txt+="|"+cg_getCookie("Settings.PinnedItem.item_14");if((cg_getCookie("Settings.PinnedItem.item_23")!="null")&&(cg_getCookie("Settings.PinnedItem.item_23")!=null))
txt+="|"+cg_getCookie("Settings.PinnedItem.item_23");if((cg_getCookie("Settings.PinnedItem.item_13")!="null")&&(cg_getCookie("Settings.PinnedItem.item_13")!=null))
{if((vals[1]!="")&&(vals[1]!=null)&&(vals[1]!="null"))
txt+="|"+vals[1];}
return txt;}
else
{if((cg_getCookie("Settings.PinnedItem.item_"+slot)!=null)&&(cg_getCookie("Settings.PinnedItem.item_"+slot)!="null"))
{var txt=id;vals=cg_getCookie("Settings.PinnedItem.item_"+slot).split("|");if((vals[0]!=null)&&(vals[0]!=""))
txt+="|"+vals[0];if((vals[1]!=null)&&(vals[1]!=""))
txt+="|"+vals[1];return txt;}
else
{return id;}}}
var cg_items={};cg_items.addData=function(data)
{if(data.length==null)
{dataArray=[];dataArray[0]=data;}
else
{dataArray=data;}
for(var i=0,len=dataArray.length;i<len;i++)
{cg_items[dataArray[i].id]=dataArray[i];cg_items[dataArray[i].id].getNameWithStyle=Curse.WOWDB.Item.getNameWithStyle;cg_items[dataArray[i].id].getNameWithRarity=Curse.WOWDB.Item.getNameWithRarity;cg_items[dataArray[i].id].getName=Curse.WOWDB.Item.getName;cg_items[dataArray[i].id].createIcon=Curse.WOWDB.Item.createIcon;cg_items[dataArray[i].id].isCharacterItem=Curse.WOWDB.Item.isCharacterItem;cg_items[dataArray[i].id].isEquipableItem=Curse.WOWDB.Item.isEquipableItem;}}
Curse.WOWDB.Item={};Curse.WOWDB.Item.isCharacterItem=function()
{return Curse.WOWDB.Item.armorSlots.indexOf(this.slot)>=0;}
Curse.WOWDB.Item.isEquipableItem=function(slot)
{return Curse.WOWDB.Item.heldSlots.indexOf(this.slot)>=0;}
Curse.WOWDB.Item.armorSlots=[1,2,3,4,5,6,7,8,9,10,11,12,16,20];Curse.WOWDB.Item.heldSlots=[12,13,14,15,17,21,22,23,25,26,28];Curse.WOWDB.Item.createIcon=function(size,num,showNum,baseURL)
{if(!baseURL)
{baseURL="";}
return new Curse.Icon(size,this.icon,baseURL+"item.php?id="+this.id,this.id,null,Curse.Tooltip.handleItemLinkOver,{hideIcon:true},Curse.Tooltip.hide,null,num,null,showNum,null,null,baseURL);};Curse.WOWDB.Item.getNameWithStyle=function()
{if(this.nameWithStyle)
{return this.nameWithStyle;}
var name="<span "+this.tooltip.substring(2,this.tooltip.indexOf("</b>"))+"</span>";this.nameWithStyle=name;return this.nameWithStyle;};Curse.WOWDB.Item.getName=function()
{if(this.name)
{return this.name;}
var name=this.tooltip.substring(2,this.tooltip.indexOf("</b>"))
name=name.substring(name.indexOf(">")+1);this.name=name;return this.name;};Curse.WOWDB.Item.getNameWithRarity=function()
{if(!this.name)
{name=this.getName();}
if(!this.rarity)
{this.rarity=this.tooltip.substring(10,this.tooltip.indexOf(">"));}
return{name:this.name,rarity:this.rarity};};Curse.WOWDB.Item.fixSocketText=function(item)
{var tooltip=item.tooltip;var socket=new RegExp('(\\<a href=\\"search\\.aspx\\?[\\w|\\d|\\s|=|&]+\\" class=\\"socket\\-\\d \\w\\d\\"\\>)',"g");var socketng=new RegExp('(\\<a href=\\"search\\.aspx\\?[\\w|\\d|\\s|=|&]+\\" class=\\"socket\\-\\d \\w\\d\\"\\>)');var matches=tooltip.match(socket);if(matches!=null)
{for(var i=0;i<matches.length;i++)
{item.gtot++;tooltip=tooltip.replace(socketng,matches[i].replace(/\>/," id='socketLine"+i+"'>"));}}
item.tooltip=tooltip;};var cg_quests={};cg_quests.addData=function(data)
{if(data.length==null)
{dataArray=[];dataArray[0]=data;}
else
{dataArray=data;}
for(var i=0,len=dataArray.length;i<len;i++)
{cg_quests[dataArray[i].id]=dataArray[i];}}
Curse.WOWDB.Talent={};var cg_talents={};cg_talents.trees={};cg_talents.addData=function(data)
{cg_talents.byRank={};cg_talents.byTree={};for(var i=0,len=data.length;i<len;i++)
{data[i].tooltip=cg_spells[data[i].spellid].tooltip;data[i].icon=cg_spells[data[i].spellid].icon;var key=data[i].id+"."+data[i].rank;cg_talents.byRank[key]=data[i];cg_talents.byRank[key].createIcon=Curse.WOWDB.Talent.createIcon;if(cg_talents.byTree[data[i].tree]==null)
{cg_talents.byTree[data[i].tree]=[];}
cg_talents.byTree[data[i].tree].push(cg_talents.byRank[key]);}};Curse.WOWDB.Talent.createIcon=function(spritePosition,talents)
{return new Curse.Icon(1,0,"javascript:;",this.id+"."+this.rank,null,Curse.Tooltip.handleTalentLinkOver,{"talents":talents},Curse.Tooltip.hide,null,null,null,null,"icons/talents/"+this.tree+".jpg",spritePosition);};var cg_talentBuilds={};cg_talentBuilds.addData=function(data)
{for(var i=0,len=data.length;i<len;i++)
{cg_talentBuilds[data[i].id]=data[i];}}
var cg_spells={};cg_spells.addData=function(data)
{if(data.length==null)
{var dataArray=[];dataArray[0]=data;}
else
{var dataArray=data;}
for(var i=0,len=dataArray.length;i<len;i++)
{cg_spells[dataArray[i].id]=dataArray[i];cg_spells[dataArray[i].id].createIcon=Curse.WOWDB.Spell.createIcon;cg_spells[dataArray[i].id].getName=Curse.WOWDB.Spell.getName;}}
Curse.WOWDB.Spell={};Curse.WOWDB.Spell.createIcon=function(size,baseURL)
{if(!baseURL)
{baseURL="";}
return new Curse.Icon(size,this.icon,baseURL+"spell.aspx?id="+this.id,this.id,null,Curse.Tooltip.handleSpellLinkOver,{hideIcon:true},Curse.Tooltip.hide,null,null,null,null,null,null,baseURL);};Curse.WOWDB.Spell.getName=function()
{if(this.name)
{return this.name;}
var name=this.tooltip.substring(this.tooltip.indexOf("<b>")+3,this.tooltip.indexOf("</b>"));this.name=name;return this.name;};var cg_enchants={};cg_enchants.addData=function(data)
{for(var i=0,len=data.length;i<len;i++)
{this[data[i].id]=data[i];}}
if(!Curse.WOWDB)
{Curse.WOWDB={};}
Curse.WOWDB.Enchant=function(data)
{cg_cO(this,data);}
var cg_itemsets={};cg_itemsets.addData=function(data)
{this.setsByItemId={};for(var i=0,len=data.length;i<len;i++)
{this[data[i].id]=new Curse.WOWDB.ItemSet(data[i]);}}
var timescalled=0;cg_itemsets.setsByItemId={};cg_itemsets.getByItemId=function(itemid)
{timescalled+=1;if(this.setsByItemId[itemid])
{return this.setsByItemId[itemid];}
var items=null;for(p in this)
{if(this[p].items==null)
{continue;}
items=this[p].items;for(var j=0;j<items.length;j++)
{if(items[j]==itemid)
{this.setsByItemId[itemid]=this[p];return this[p];}}}
return null;}
Curse.WOWDB.ItemSet=function(data)
{cg_cO(this,data);}
Curse.WOWDB.ItemSet.prototype={originalNames:function()
{if(this.originalNames)
{return this.originalNames;}
var tooltip=null;for(var i=0;i<this.items.length;i++)
{var item=cg_items[this.items[i]];if(item)
{tooltip=item.description;break;}}
var slotRegex=/<span id=\"tooltipItemSetSlot([0-9]+)\">.*?>(.*?)<.*?<\/span>/g;this.originalNames={};var matches=slotRegex.exec(tooltip);while(matches!=null)
{this.originalNames[matches[1]]=matches[2];matches=slotRegex.exec(tooltip)}}}
Curse.DataGrid.Templates={itemSuggestion:{sort:[1],hasViewstate:true,columns:[{id:"name",label:Localization.name,align:"left",span:2,value:"name",sortFunc:function(a,b)
{return cg_strcmp(cg_reverseAlphaArray[a.rarity]+a.name,cg_reverseAlphaArray[b.rarity]+b.name);},render:function(record,td,tr)
{var i=cg_ce("td");i.style.width="1px";i.style.padding="0";i.style.borderRight="none";var item=cg_items[record.id];if(item)
{cg_ae(i,item.createIcon(1));}
cg_ae(tr,i);td.style.borderLeft="none";var a=cg_ce("a");a.className="r"+record.rarity;a.style.fontFamily="Verdana,sans-serif";a._relatedID=record.id;a.onmouseover=Curse.Tooltip.handleItemLinkOver.bind(this,a);a.onmouseout=Curse.Tooltip.hide;cg_ae(a,cg_ct(record.name));cg_ae(td,a);}},{id:"level",label:Localization.level,width:"10%",value:"level",render:function(record,td,tr)
{return record.level;}},{id:"type",label:Localization.type,width:"18%",value:"type",render:function(record,td,tr)
{var lbl=Curse.Lookup.item_type[record.type];if(lbl=="")
{lbl="-";}
td.className="small r1";cg_ae(td,cg_ct(lbl));}}]},profiles:{sort:[1],hasViewstate:true,showRefineBox:true,refineColumn:"name",getRecordLink:function(record)
{return"profile.aspx?id="+record.id;},columns:[{id:"name",label:Localization.name,value:"name",align:"left",render:function(record,td)
{var a=cg_ce("a");a.style.fontFamily="Verdana, sans-serif";a.href=this.template.getRecordLink(record);cg_ae(a,cg_ct(record.name));cg_ae(td,a);if(record.description!=null)
{var d=cg_ce("div");d.className="small";cg_ae(d,cg_ct(record.description));cg_ae(td,d);}}},{id:"level",label:Localization.level,value:"level",width:"75px"},{id:"race",label:Localization.race,width:"100px",align:"right",halign:"center",render:function(record,td)
{var s=cg_ce("span");s.className="profile-race cr"+record.race;s.style.backgroundImage="url(images/profile_races_"+record.race+"-"+record.gender+".gif)";cg_ae(s,cg_ct(Curse.Lookup.race_id[record.race]));cg_ae(td,s);},sortFunc:function(a,b)
{return cg_strcmp(Curse.Lookup.race_id[a.race],Curse.Lookup.race_id[b.race]);}},{id:"gender",label:Localization.gender,width:"85px",align:"right",halign:"center",value:"gender",render:function(record,td)
{var s=cg_ce("span");s.className="profile-gender cg"+record.gender;cg_ae(s,cg_ct(Curse.Lookup.gender[record.gender]));cg_ae(td,s);}},{id:"class",label:Localization.class_name,width:"85px",align:"right",halign:"center",render:function(record,td)
{var s=cg_ce("span");s.className="profile-class cc"+record.cclass;cg_ae(s,cg_ct(Curse.Lookup.class_id[record.cclass]));cg_ae(td,s);},sortFunc:function(a,b)
{return cg_strcmp(Curse.Lookup.class_id[a.cclass],Curse.Lookup.class_id[b.cclass]);}},{id:"faction",label:Localization.faction,width:"80px",align:"right",halign:"center",value:"faction",render:function(record,td)
{var d=cg_ce("span");d.className="profile-faction cf"+record.faction;cg_ae(d,cg_ct(Curse.Lookup.pp_faction_id[record.faction]));cg_ae(td,d);}},{id:"guild",label:Localization.guild,width:"200px",align:"left",halign:"center",value:"guild",render:function(record,td)
{if(!record.guild)
{return"";}
var a=cg_ce("a");a.className="small r1";a.href="search.aspx?browse=9&filters=212="+record.guildid;cg_ae(a,cg_ct(record.guild));cg_ae(td,a);},sortFunc:function(a,b)
{if(a.guild==null)
{return 1;}
return cg_strcmp(a.guild==null?"zzzzzzz":a.guild.toLowerCase(),b.guild==null?"zzzzzzz":b.guild.toLowerCase());}},{id:"realm",label:Localization.realm,value:"server",width:"200px",align:"left",halign:"center",render:function(record,td)
{if(!record.server)
{return"";}
td.className="small";cg_ae(td,cg_ct(record.server));}}]},factions:{sort:[1],hasViewstate:true,showRefineBox:true,refineColumn:"name",getRecordLink:function(record)
{return"faction.aspx?id="+record.id;},columns:[{id:"name",label:Localization.name,value:"name",align:"left",render:function(record,td)
{var a=cg_ce("a");a.style.fontFamily="Verdana, sans-serif";a.href=this.template.getRecordLink(record);cg_ae(a,cg_ct(record.name));cg_ae(td,a);if(record.description!=null)
{var d=cg_ce("div");d.className="small";cg_ae(d,cg_ct(record.description));cg_ae(td,d);}}},{id:"group",label:Localization.group,value:"group",align:"center",width:"30%"}]},npcs:{sort:[1],hasViewstate:true,showRefineBox:true,refineColumn:"name",getRecordLink:function(record)
{return"npc.aspx?id="+record.id;},columns:[{id:"name",label:Localization.name,align:"left",value:"name",render:function(record,td)
{var a=cg_ce("a");a.style.fontFamily="Verdana, sans-serif";a.href=this.template.getRecordLink(record);cg_ae(a,cg_ct(record.name));cg_ae(td,a);if(record.desc!=null)
{var d=cg_ce("div");d.className="small";cg_ae(d,cg_ct("<"+record.desc+">"));cg_ae(td,d);}
if(record.disp!=null)
{var d=cg_ce("div");d.className="smallPad";var a=cg_ce("a");a.onclick=Curse.WOWDB.ModelViewer.showPreview.bind(this,this.id,record.id,'mob',null,null);cg_ae(a,cg_ct(Localization.preview));cg_ae(d,a);cg_ae(td,d);}}},{id:"level",label:Localization.level,width:"10%",render:function(record,td)
{if(record.classification)
{var d=cg_ce("div");d.className="small";cg_ae(d,cg_ct(Curse.Lookup.npc_classification_id[record.classification]));cg_ae(td,d);if(!record.minlevel)
{return Localization.question;}}
if(record.minlevel>0||record.maxlevel>0)
{if(!record.maxlevel)
{record.maxlevel=record.minlevel;}
if(record.minlevel!=record.maxlevel)
{return record.minlevel+" - "+record.maxlevel;}
else
{return record.minlevel;}}
return-1;},sortFunc:function(a,b,col)
{if(col>0)
{return cg_strcmp(a.minlevel,b.minlevel)||cg_strcmp(a.maxlevel,b.maxlevel)||cg_strcmp(a.classification,b.classification);}
else
{return cg_strcmp(a.maxlevel,b.maxlevel)||cg_strcmp(a.minlevel,b.minlevel)||cg_strcmp(a.classification,b.classification);}}},{id:"location",label:Localization.location,render:function(record,td)
{return Curse.DataGrid.Utility.appendLocation(record,td);},sortFunc:function(a,b)
{return Curse.DataGrid.Utility.assocArrCmp(a.locs,b.locs,Curse.Lookup.location_name);}},{id:"react",label:Localization.react,width:"10%",value:"react",render:function(record,td)
{if(record.react==null)
{return-1;}
var sides=["A","H"];var count=0;for(var i=0;i<sides.length;i++)
{if(record.react[i]!=null)
{if(count++>0)
{cg_ae(td,cg_ct(" "));}
var s=cg_ce("span");s.className=(record.react[i]==3?"r7":(record.react[i]==1?"r2":"r"));cg_ae(s,cg_ct(sides[i]));cg_ae(td,s);}}}},{id:"type",label:Localization.type,width:"12%",render:function(record,td)
{td.className="small r1";var a=cg_ce("a");a.href="npc.aspx?id="+record.type;cg_ae(a,cg_ct(Curse.Lookup.npc_type_id[record.type]));cg_ae(td,a);},sortFunc:function(a,b)
{return cg_strcmp(Curse.Lookup.npc_type_id[a.type],Curse.Lookup.npc_type_id[b.type]);}}]},items:{sort:[1],hasViewstate:true,showRefineBox:true,refineColumn:"name",getRecordLink:function(record)
{return"item.php?id="+record.id;},columns:[{id:"name",label:Localization.name,align:"left",span:2,sortFunc:function(a,b)
{if(!a.nameSort)
{a.nameSort=cg_reverseAlphaArray[a.rarity]+a.name;}
if(!b.nameSort)
{b.nameSort=cg_reverseAlphaArray[b.rarity]+b.name;}
return cg_strcmp(a.nameSort,b.nameSort);},render:function(record,td,tr)
{var i=cg_ce("td");i.style.width="1px";i.style.padding="0";i.style.borderRight="none";var item=cg_items[record.id];if(item)
{var num=null;if(record.stack!=null)
{num=Curse.DataGrid.Utility.createNumericRange(record.stack[0],record.stack[1]);}
cg_ae(i,item.createIcon(1,num));}
cg_ae(tr,i);td.style.borderLeft="none";var a=cg_ce("a");a.className="r"+record.rarity;a.style.fontFamily="Verdana,sans-serif";a._relatedID=record.id;a.onmouseover=Curse.Tooltip.handleItemLinkOver.bind(this,a);a.onmouseout=Curse.Tooltip.hide;a.href=this.template.getRecordLink(record);cg_ae(a,cg_ct(record.name));cg_ae(td,a);if(item&&item.disp)
{var d=cg_ce("div");d.className="smallPad";var addp=false;if(!item.isCharacterItem())
{addp=true;var a=cg_ce("a");a.onclick=Curse.WOWDB.ModelViewer.showPreview.bind(this,this.id,record.id,'item',null,null);cg_ae(a,cg_ct(Localization.preview));cg_ae(d,a);}
if(item.isEquipableItem()||item.isCharacterItem())
{if(addp)
{cg_ae(d,cg_ct(" | "));}
var a=cg_ce("a");a.onclick=Curse.WOWDB.ModelViewer.showPreview.bind(this,this.id,record.id,'item',true,null);cg_ae(a,cg_ct(Localization.preview_on_character));cg_ae(d,a);}
cg_ae(td,d);}}},{id:"level",label:Localization.level,width:"10%",value:"level",render:function(record,td,tr)
{if(record.rlevel>1){var sm=cg_ce("div");sm.className="r0 small";cg_ae(sm,cg_ct(Localization.req+" "+record.rlevel));cg_ae(td,sm);}
return record.level;}},{id:"standing",label:Localization.standing,width:"12%",value:"standing",render:function(record,td,tr)
{cg_ae(td,cg_ct(Curse.Lookup.faction_level[record.standing]));}},{id:"armor",label:Localization.armor,width:"10%",value:"armor",render:function(record,td)
{if(record.armor>0){return record.armor;}}},{id:"slot",label:Localization.slot,width:"10%",value:"slot",sortFunc:function(a,b)
{return cg_strcmp(Curse.Lookup.slot[cg_items[a.id].slot],Curse.Lookup.slot[cg_items[b.id].slot]);},render:function(record,td)
{return Curse.Lookup.slot[cg_items[record.id].slot];}},{id:"skill",label:Localization.skill,width:"10%",value:"slevel",hidden:true},{id:"slots",label:Localization.slots,width:"10%",value:"slots",hidden:true},{id:"dps",label:Localization.dps,width:"10%",value:"dps",render:function(record,td)
{return(record.dps||0).toFixed(1);}},{id:"speed",label:Localization.speed,width:"10%",value:"speed",render:function(record,td)
{return(record.speed||0).toFixed(2);}},{id:"source",label:Localization.source,width:"12%",render:function(record,td)
{td.className="small r1";if(record.source!=null)
{for(var i=0,len=record.source.length;i<len;++i)
{if(i>0)
{cg_ae(td,cg_ct(", "));}

cg_ae(td,cg_ct(Curse.Lookup.item_source[record.source[i]]));}}},sortFunc:function(a,b){return Curse.DataGrid.Utility.assocArrCmp(a.source,b.source,Curse.Lookup.item_source);}},{id:"type",label:Localization.type,width:"14%",value:"type",sortFunc:function(a,b)
{return cg_strcmp(Curse.Lookup.item_type[a.type],Curse.Lookup.item_type[b.type]);},render:function(record,td,tr)
{var lbl=Curse.Lookup.imgstatus[record.imgstatus];if(lbl=="")
{lbl="-";} // EDITO TYPE IF IMAGE EXIST
//else if(screen.height>maxheight)
//{var ratio=screen.height/maxheight;var nwidth=screen.width/ratio;cg_ge("screenImage").width=nwidth;cg_ge("screenImage").height=maxheight;}
//cg_ge("screenImage").src="screenshots/"+screen.id+".jpg";cg_ge("screenImage").onclick=function(){self.location="screenshots/"+screen.id+".jpg";};},scrollToForm:function()
//{cg_contributeTabs.show(1);}}

//{cg_ae(td,cg_ct(Curse.Lookup.faction_level[record.standing]));}},{id:"rewards",label:Localization.rewards,width:"26%",render:function(record,td)
//{var hasItems=(record.givenitems!=null||record.choiceitems!=null);if(hasItems)
//{td.style.padding="0";var choiceLabel,givenLabel;if(record.choiceitems&&record.choiceitems.length>1)
//{choiceLabel=Localization.choose+":";if(record.givenitems&&record.givenitems.length>0){givenLabel=Localization.also_get+":";}}


//td.className="small r1";var a=cg_ce("a");a.href=record.type;cg_ae(a,cg_ct(lbl));cg_ae(td,a);}}]},
//locations:{sort:[1],hasViewstate:true,showRefineBox:true,refineColumn:"name",getRecordLink:function(record)

td.className="small r1";var a=cg_ce("a");a.href=record.type;cg_ae(a,cg_ct(lbl));cg_ae(td,a);}}]},

//td.className="small r1"; cg_ge("screenImage").src="/images/button_preview_close.gif";cg_ge("screenImage").onclick=function(){self.location="/images/button_preview_close.gif";},scrollToForm:function()
//{cg_contributeTabs.show(1);}}]},
//td.className="small r1";var ratio=screen.height/maxheight;var nwidth=screen.width/ratio;cg_ge("screenImage").src="/images/button_preview_close.gif";cg_ge("screenImage").onclick=function(){self.location="images/button_preview_close.gif";};},scrollToForm:function()
locations:{sort:[1],hasViewstate:true,showRefineBox:true,refineColumn:"name",getRecordLink:function(record)

{return"location.aspx?id="+record.id;},columns:[{id:"name",label:Localization.name,align:"left",value:"name",render:function(record,td)
{var a=cg_ce("a");a.style.fontFamily="Verdana, sans-serif";a.href=this.template.getRecordLink(record);cg_ae(a,cg_ct(record.name));if(record.expansion!=null){var s=cg_ce("span");s.className="expansion_"+record.expansion;cg_ae(s,a);cg_ae(td,s);}
else
{cg_ae(td,a);}}},{id:"level",label:Localization.level,width:"10%",render:function(record,td)
{if(!record.maxlevel&&record.minlevel)
{return record.minlevel;}
if(record.maxlevel>0)
{if(record.minlevel!=record.maxlevel)
{return record.minlevel+" - "+record.maxlevel;}
else
{return record.minlevel;}}},sortFunc:function(a,b,col)
{if(col>0){return cg_strcmp(a.minlevel,b.minlevel)||cg_strcmp(a.maxlevel,b.maxlevel);}
else
{return cg_strcmp(a.maxlevel,b.maxlevel)||cg_strcmp(a.minlevel,b.minlevel);}}},{id:"territory",label:Localization.territory,width:"13%",render:function(record,td)
{var s=cg_ce("span");s.className="territory_"+record.territory;cg_ae(s,cg_ct(Curse.Lookup.location_faction_id[record.territory]));cg_ae(td,s);},sortFunc:function(a,b)
{return cg_strcmp(Curse.Lookup.location_faction_id[a.territory],Curse.Lookup.location_faction_id[b.territory]);}},{id:"instancetype",label:Localization.instance_type,width:"25%",render:function(record,td)
{if(record.type==0)
{return;}
var s=cg_ce("span");s.className="locationtype_"+record.type;var lbl=Curse.Lookup.location_type_id[record.type];if(record.limit>0)
{lbl+=" ("+record.limit+")";}
cg_ae(s,cg_ct(lbl));cg_ae(td,s);},sortFunc:function(a,b)
{return cg_strcmp(Curse.Lookup.location_type_id[a.type],Curse.Lookup.location_type_id[b.type])||cg_strcmp(a.type,b.type)||cg_strcmp(a.plimit,b.plimit);}},{id:"category",label:Localization.category,width:"15%",render:function(record,td)
{td.className="small r1";var a=cg_ce("a");a.href="search.aspx?browse=3."+record.category;cg_ae(a,cg_ct(Curse.Lookup.location_category_id[record.category]));cg_ae(td,a);},sortFunc:function(a,b)
{return cg_strcmp(Curse.Lookup.location_category_id[a.category],Curse.Lookup.location_category_id[b.category]);}}]},quests:{sort:[1,2],hasViewstate:true,showRefineBox:true,refineColumn:"name",getRecordLink:function(record)
{return"quest.aspx?id="+record.id;},columns:[{id:"name",label:Localization.name,align:"left",value:"name",render:function(record,td)
{var a=cg_ce("a");a.style.fontFamily="Verdana, sans-serif";a._relatedID=record.id;a.onmouseover=Curse.Tooltip.handleQuestLinkOver.bind(this,a);a.onmouseout=Curse.Tooltip.hide;a.href=this.template.getRecordLink(record);cg_ae(a,cg_ct(record.name));cg_ae(td,a);}},{id:"level",label:Localization.level,width:"10%",render:function(record,td)
{if(record.type||record.daily)
{var d=cg_ce("div");d.className="small";if(record.daily)
{cg_ae(d,cg_ct(Localization.daily+" "));}
if(record.type)
{cg_ae(d,cg_ct(Curse.Lookup.quest_type_id[record.type]));}
cg_ae(td,d);}
return record.level;},sortFunc:function(a,b)
{return cg_strcmp(a.level,b.level)||cg_strcmp(a.type,b.type);}},{id:"side",label:Localization.side,width:"10%",render:function(record,td)
{if(record.side)
{var s=cg_ce("span");s.className="territory_"+record.side;cg_ae(s,cg_ct(Curse.Lookup.quest_side_id[record.side]));cg_ae(td,s);}
else
{return-1;}},sortFunc:function(a,b)
{return cg_strcmp(Curse.Lookup.quest_side_id[a.side],Curse.Lookup.quest_side_id[b.side]);}},{id:"reputation",label:Localization.rep,width:"12%",hidden:true,value:"reputation"},{id:"standing",label:Localization.standing,width:"12%",value:"standing",hidden:true,render:function(record,td,tr)
{cg_ae(td,cg_ct(Curse.Lookup.faction_level[record.standing]));}},{id:"rewards",label:Localization.rewards,width:"26%",render:function(record,td)
{var hasItems=(record.givenitems!=null||record.choiceitems!=null);if(hasItems)
{td.style.padding="0";var choiceLabel,givenLabel;if(record.choiceitems&&record.choiceitems.length>1)
{choiceLabel=Localization.choose+":";if(record.givenitems&&record.givenitems.length>0){givenLabel=Localization.also_get+":";}}
Curse.DataGrid.Utility.appendFloatingIcons(td,record.choiceitems,choiceLabel);Curse.DataGrid.Utility.appendFloatingIcons(td,record.givenitems,givenLabel);}
if(record.xp>0||record.coin>0)
{var d=cg_ce("div");if(hasItems)
{d.style.padding="4px";}
if(record.xp>0){cg_ae(d,cg_ct(record.xp+" "+Localization.xp+(record.coin>0?" + ":"")));}
if(record.coin>0)
{Curse.DataGrid.Utility.appendPrice(d,record.coin);}
cg_ae(td,d);}},sortFunc:function(a,b)
{var rewardsa=(a.choiceitems!=null?a.choiceitems.length:0)+(a.givenitems!=null?a.givenitems.length:0);var rewardsb=(b.choiceitems!=null?b.choiceitems.length:0)+(b.givenitems!=null?b.givenitems.length:0);return cg_strcmp(rewardsa,rewardsb)||cg_strcmp((a.xp|0)+(a.coin|0),(b.xp|0)+(b.coin|0));}},{id:"category",label:Localization.category,width:"15%",render:function(record,td)
{if(!record.category)
{return;}
var a=cg_ce("a");a.href="search.aspx?browse=4."+record.category.join(".");cg_ae(a,cg_ct(Curse.DataGrid.Utility.getQuestCategory(record.category)));td.className="small r1";cg_ae(td,a);},sortFunc:function(a,b)
{return cg_strcmp(Curse.DataGrid.Utility.getQuestCategory(a.category),Curse.DataGrid.Utility.getQuestCategory(b.category));}}]},objects:{sort:[1],hasViewstate:true,showRefineBox:true,refineColumn:"name",getRecordLink:function(record)
{return"object.aspx?id="+record.id;},columns:[{id:"name",label:Localization.name,align:"left",value:"name",render:function(record,td)
{var a=cg_ce("a");a.style.fontFamily="Verdana, sans-serif";a.href=this.template.getRecordLink(record);cg_ae(a,cg_ct(record.name));cg_ae(td,a);}},{id:"location",label:Localization.location,render:function(record,td)
{return Curse.DataGrid.Utility.appendLocation(record,td);},sortFunc:function(a,b)
{return Curse.DataGrid.Utility.assocArrCmp(a.locs,b.locs,Curse.Lookup.location_name);}},{id:"skill",label:Localization.skill,width:"10%",value:"skill"},{id:"type",label:Localization.type,width:"12%",value:"type",render:function(record,td,tr)
{td.className="small r1";var lbl=Curse.Lookup.object_type_id[record.type];if(lbl=="")
{return"-";}
var a=cg_ce("a");a.href="search.aspx?browse=5."+record.type;cg_ae(a,cg_ct(lbl));cg_ae(td,a);}}]},spells:{sort:[1,2],hasViewstate:true,showRefineBox:true,refineColumn:"name",getRecordLink:function(record)
{return"spell.aspx?id="+record.id;},columns:[{id:"name",label:Localization.name,span:2,align:"left",value:"name",render:function(record,td,tr)
{var i=cg_ce("td");i.style.width="1px";i.style.padding="0";i.style.borderRight="none";var spell=cg_spells[record.id];var a=cg_ce("a");if(record.produces!=null)
{var item=cg_items[record.produces[0]];if(item!=null)
{a.className="r"+record.rarity;cg_ae(i,item.createIcon(1,record.produces[1]));}
else
{cg_ae(i,spell.createIcon(1));}}
else
{cg_ae(i,spell.createIcon(1));}
cg_ae(tr,i);td.style.borderLeft="none";a.style.fontFamily="Verdana,sans-serif";a._relatedID=record.id;a.onmouseover=Curse.Tooltip.handleSpellLinkOver.bind(this,a);a.onmouseout=Curse.Tooltip.hide;a.href=this.template.getRecordLink(spell);cg_ae(a,cg_ct(record.name));cg_ae(td,a);if(!this.browseDescription)
{this.browseDescription=cg_getQueryStringParam("browse");this.showTalentTag=this.browseDescription.indexOf("6.7")==0;}
var showTalentTag=record.talent!=null&&this.showTalentTag;if(record.rank!=null||showTalentTag)
{var d=cg_ce("div");d.className="smallPad";var label="";if(record.rank!=null)
{label+=record.rank;if(record.talent)
{label+=" ";}}
if(showTalentTag)
{label+="("+Localization.talent+")";}
cg_ae(d,cg_ct(label));cg_ae(td,d);}}},{id:"level",label:Localization.level,value:"level",width:"10%"},{id:"school",label:Localization.school,width:"10%",render:function(record,td)
{return Curse.Lookup.resistances[record.school];},sortFunc:function(a,b,col)
{return cg_strcmp(Curse.Lookup.resistances[a.school],Curse.Lookup.resistances[b.school]);}},{id:"reagents",label:Localization.reagents,align:"left",width:"27%",render:function(record,td)
{if(record.reagents!=null)
{td.style.padding="0";var d=cg_ce("div");d.style.width=(44*record.reagents.length)+"px";for(var i=0,len=record.reagents.length;i<len;++i)
{if(cg_items[record.reagents[i][0]])
{var icon=cg_items[record.reagents[i][0]].createIcon(1,record.reagents[i][1]);icon.style.cssFloat=icon.style.styleFloat="left";cg_ae(d,icon);}
else
{alert(record.id);}}
cg_ae(td,d);}},sortFunc:function(a,b)
{var lena=(a.reagents!=null?a.reagents.length:0);var lenb=(b.reagents!=null?b.reagents.length:0);return cg_strcmp(lena,lenb);}},{id:"skill",label:Localization.skill,width:"16%",render:function(record,td)
{if(record.skill!=null)
{var d=cg_ce("div");d.className="small";for(var i=0,len=record.skill.length;i<len;++i)
{if(i>0)
{cg_ae(d,cg_ct(", "));}
if(record.skill[i]>=0)
{if(true)
{var a=cg_ce("a");a.className="r1";var href="search.aspx?browse=6."+record.category;if(record.cclass!=null)
{href+="."+record.cclass;}
href+="."+record.skill[i];a.href=href;cg_ae(a,cg_ct(Curse.Lookup.skill_line_id[record.skill[i]]));cg_ae(d,a);}
else
{cg_ae(d,cg_ct(Curse.Lookup.skill_line_id[record.skill[i]]));}}
else
{cg_ae(d,cg_ct("..."));}}
if(record.learned>0)
{cg_ae(d,cg_ct(" ("));var s=cg_ce("span");cg_ae(s,cg_ct(record.learned));s.style.fontWeight="bold";cg_ae(d,s);cg_ae(d,cg_ct(")"));}
if(d!=null)
{cg_ae(td,d);}
if(record.skillup!=null)
{var d2=cg_ce("div");d2.className="small";d2.style.fontWeight="bold";for(var i=0;i<record.skillup.length;++i)
{if(record.skillup[i]>0)
{cg_ae(d2,cg_ct(" "));var s2=cg_ce("span");s2.className="c"+i;cg_ae(s2,cg_ct(record.skillup[i]));cg_ae(d2,s2);}}
cg_ae(td,d2);}}},sortFunc:function(a,b)
{var learnedComp=cg_strcmp(a.learned,b.learned);if(learnedComp!=0){return learnedComp;}
return Curse.DataGrid.Utility.assocArrCmp(a.skill,b.skill,Curse.Lookup.skill_line_id);}}]},itemsets:{sort:[1],hasViewstate:true,showRefineBox:true,refineColumn:"name",getRecordLink:function(record)
{return"itemset.aspx?id="+record.id;},columns:[{id:"name",label:Localization.name,align:"left",render:function(record,td,tr)
{var a=cg_ce("a");a.className="r"+record.rarity;a.style.fontFamily="Verdana,sans-serif";a.href=this.template.getRecordLink(record);cg_ae(a,cg_ct(record.name));cg_ae(td,a);var d;if(record.tag!=null)
{d=cg_ce("div");d.className="small";cg_ae(d,cg_ct(record.tag));cg_ae(td,d);}
d=cg_ce("div");d.className="smallPad";a=cg_ce("a");a.onclick=Curse.WOWDB.ModelViewer.showPreview.bind(this,this.id,record.pieces.join(","),'item',null,null);cg_ae(a,cg_ct(Localization.preview_on_character));cg_ae(d,a);cg_ae(td,d);},sortFunc:function(a,b)
{if(!a.nameSort)
{a.nameSort=cg_reverseAlphaArray[a.rarity]+a.name;}
if(!b.nameSort)
{b.nameSort=cg_reverseAlphaArray[b.rarity]+b.name;}
return cg_strcmp(a.nameSort,b.nameSort);}},{id:"level",label:Localization.level,width:"10%",render:function(record,td)
{if(record.minlevel>0||record.maxlevel>0)
{if(!record.maxlevel)
{record.maxlevel=record.minlevel;}
if(record.minlevel!=record.maxlevel)
{return record.minlevel+" - "+record.maxlevel;}
else
{return record.minlevel;}}
return-1;},sortFunc:function(a,b,col)
{if(col>0)
{return cg_strcmp(a.minlevel,b.minlevel)||cg_strcmp(a.maxlevel,b.maxlevel);}
else
{return cg_strcmp(a.maxlevel,b.maxlevel)||cg_strcmp(a.minlevel,b.minlevel);}}},{id:"pieces",label:Localization.pieces,width:"40%",render:function(record,td)
{if(record.pieces==null)
{return-1;}
td.style.padding="0";var d=cg_ce("div");d.style.width=(44*record.pieces.length)+"px";for(var i=0,len=record.pieces.length;i<len;i++)
{var icon=cg_items[record.pieces[i]].createIcon(1);icon.style.cssFloat=icon.style.styleFloat="left";cg_ae(d,icon);}
d.style.margin="0 auto";cg_ae(td,d);},sortFunc:function(a,b)
{return cg_strcmp(a.pieces.length,b.pieces.length);}},{id:"type",label:Localization.type,width:"10%",render:function(record,td,tr)
{var lbl=Curse.Lookup.item_type[record.type];td.className="small r1";cg_ae(td,cg_ct(lbl));},sortFunc:function(a,b)
{return cg_strcmp(Curse.Lookup.item_type[a.type],Curse.Lookup.item_type[b.type]);}},{id:"classes",label:Localization.classes,width:"15%",render:function(record,td,tr)
{for(var i=0,len=record.classes.length;i<len;i++)
{if(i>0)
{cg_ae(td,cg_ct(", "));}
cg_ae(td,cg_ct(Curse.Lookup.class_id[record.classes[i]]));}
td.className="small r1";},sortFunc:function(a,b)
{return Curse.DataGrid.Utility.assocArrCmp(a.classes,b.classes,Curse.Lookup.class_id);}}]},screenshots:{sort:[-1],hasViewstate:true,showRefineBox:false,recordsPerRow:4,listStyle:Curse.DataGrid.ListStyle.ScreenshotBox,noDataMessage:function()
{var message=Localization.replace("no_screenshots","<b>"+Curse.Page.entityName+"</b>");if(!Curse.User.id)
{message+="<br><br>"+Localization.replace("login_register_to_screenshot","<a href=\"javascript:cg_navToLogin();\">","</a>","<a href=\"register.aspx\">","</a>");}
else
{message+=" "+Localization.replace("first_to_submit","<a onclick=\"Curse.Screenshot.scrollToForm();\">","</a>");}
return message;},render:function(record,cell)
{cell.className="ss-cell";var a=cg_ce("a");var i=cg_ce("img");i.src="screenshots/thumbnails/"+record.id+".jpg";cg_ae(a,i);a.href="screenshot.aspx?id="+record.id;cg_ae(cell,a);var d=cg_ce("div");d.className="ss-user";cg_ae(d,cg_ct("Posted by "));a=cg_ce("a");a.href="user.aspx?id="+record.userid;cg_ae(a,cg_ct(record.user));cg_ae(d,a);cg_ae(d,cg_ct(" "+cg_getShortFriendlyTime(record.date)));cg_ae(cell,d);var d=cg_ce("div");d.className="ss-caption";cg_ae(d,cg_ct(record.caption));cg_ae(cell,d);},columns:[{id:"name",label:Localization.name,align:"left",value:"date",sortFunc:function(a,b)
{return cg_strcmp(a.date,b.date);}}]},commentsPreview:{sort:[-4],hasViewstate:true,showRefineBox:true,refineColumn:"preview",getRecordLink:function(record)
{return Curse.Lookup.entity_link[record.subjectType]+"?id="+record.subjectId+(record.id!=null?"#comments:id="+record.id:"");},columns:[{id:"subject",label:Localization.subject,align:"left",value:"subject",render:function(record,td)
{var a=cg_ce("a");a.href=this.template.getRecordLink(record);var d=cg_ce("div");d.className="small";cg_ae(d,cg_ct(Curse.Lookup.entity_label[record.subjectType]));switch(record.subjectType)
{case 1:a._relatedID=record.subjectId;a.onmouseover=Curse.Tooltip.handleItemLinkOver.bind(this,a);a.onmouseout=Curse.Tooltip.hide;break;case 4:a._relatedID=record.subjectId;a.onmouseover=Curse.Tooltip.handleQuestLinkOver.bind(this,a);a.onmouseout=Curse.Tooltip.hide;break;case 6:a._relatedID=record.subjectId;a.onmouseover=Curse.Tooltip.handleSpellLinkOver.bind(this,a);a.onmouseout=Curse.Tooltip.hide;break;}
cg_ae(a,cg_ct(record.subject));cg_ae(td,a);cg_ae(td,d);}},{id:"preview",label:Localization.preview,value:"rating",align:"left",width:"50%",render:function(record,td)
{var d=cg_ce("div");cg_ae(d,cg_ct(record.preview));cg_ae(td,d);d=cg_ce("div");d.className="smallGray";cg_ae(d,cg_ct(Localization.by+" "));var aUser=cg_ce("a");aUser.href="javascript:;";cg_ae(aUser,cg_ct(record.user));cg_ae(d,aUser);cg_ae(d,cg_ct(" - "));cg_ae(d,cg_ct(Localization.rating+": "+(record.rating>0?"+":"")+record.rating));cg_ae(td,d);}},{id:"replies",label:Localization.replies,width:"75px",value:"replies"},{id:"posted",label:Localization.posted,width:"15%",value:"date",render:function(record,td,tr)
{return cg_getShortFriendlyTime(record.date);}}]},comments:{sort:[1],hasViewstate:true,showRefineBox:false,refineColumn:"body",listStyle:Curse.DataGrid.ListStyle.CommentBox,onBeforeCreate:function()
{if(location.hash.match(/comments:id=([0-9]+)/)!=null)
{var index=cg_inArray(this.data,parseInt(RegExp.$1),function(x){return x.id;});this.startingRow=this.getStartingRow(index);return this.data[index];}},onAfterCreate:function(record)
{if(record!=null)
{var div=record.__div;this.tabGroup.__st=div;div.firstChild.style.border="1px solid #507484";}},noDataMessage:function()
{var message=Localization.replace("no_comments","<b>"+_detailsEntityName+"</b>");if(!Curse.User.id)
{message+="<br><br>"+Localization.replace("login_register_to_comment","<a href=\"javascript:navToLogin();\">","</a>","<a href=\"register.aspx\">","</a>");}
else
{message+=" "+Localization.replace("first_to_submit","<a onclick=\"scrollToCommentBox();\">","</a>");}
return message;},render:function(record,container,rownum)
{record.divContainer=container;var localTime=cg_getShortFriendlyTime(record.date);var allowEdit=Curse.User.isModerator||record.userid==Curse.User.id;var formattedBody=Curse.TextFormatter.getFormattedText(record.body);if(record.raters=="")
{record.raters=[];}
else
{record.raters=record.raters.split(",");for(var i=0;i<record.raters.length;i++)
{record.raters[i]=record.raters[i].split("&");}}
var hideComment=record.rating<Curse.Comment.ratingThreshold;record.allowRating=Curse.User.id&&record.userid!=Curse.User.id&&cg_inArray(record.raters,Curse.User.id,function(a){return a[0];})==-1;var showRating=record.rating>=0&&(Curse.User.id||record.allowRating);container.className="comment";var divHeader=cg_ce("div");var divBody=cg_ce("div");var divLinks=cg_ce("div");divHeader.className=(hideComment?"comment-header-dis":"comment-header");var divRating=cg_ce("div");divRating.className="comment-rating";if(hideComment)
{var a=cg_ce("a");a.href="javascript:;";a.onclick=Curse.Comment.toggleDisplay.bind(a,record);cg_ae(a,cg_ct(Localization.show_comment));cg_ae(divRating,a);cg_ae(divRating,cg_ct(" "+String.fromCharCode(160)+" "));divBody.style.display="none";}
var b=cg_ce("b");cg_ae(b,cg_ct(Localization.rating+": "));var s=cg_ce("span");cg_ae(s,cg_ct((record.rating>0?"+":"")+record.rating));cg_ae(b,s);cg_ae(divRating,b);cg_ae(divRating,cg_ct(" "));if(record.allowRating)
{var spanRating=cg_ce("span");var aRateUp=cg_ce("a");var aRateDown=cg_ce("a");if(Curse.User.id)
{aRateUp.href=aRateDown.href="javascript:;";aRateUp.onclick=Curse.Comment.rate.bind(aRateUp,record,1);aRateDown.onclick=Curse.Comment.rate.bind(aRateDown,record,-1);}
else
{aRateUp.href=aRateDown.href="javascript:;";aRateUp.onclick=navToLogin.bind();aRateDown.onclick=navToLogin.bind();}
cg_ae(aRateUp,cg_ct("[+]"));cg_ae(aRateDown,cg_ct("[-]"));cg_ae(spanRating,aRateDown);cg_ae(spanRating,cg_ct(" "));cg_ae(spanRating,aRateUp);cg_ae(divRating,spanRating);record.spanRating=spanRating;}
cg_ae(divHeader,divRating);cg_ae(divHeader,cg_ct(Localization.by+" "));var aUser=cg_ce("a");aUser.href="javascript:;"
cg_ae(aUser,cg_ct(record.user));cg_ae(divHeader,aUser);cg_ae(divHeader,cg_ct(" "));var aDate=cg_ce("a");aDate.className="r0";aDate.href="#comments:id="+record.id;cg_ae(aDate,cg_ct(localTime));aDate.style.cursor="pointer";cg_ae(divHeader,aDate);record.divHeader=divHeader;cg_ae(container,divHeader);divBody.className="comment-body";if(record.indent)
{divBody.className+=" comment-body-indent";}
divBody.innerHTML=Curse.TextFormatter.getFormattedText(record.body);record.divBody=divBody;cg_ae(container,divBody);if(record.lastEdited)
{Curse.Comment.setLastEdited(record);if(hideComment)
{record.divLastEdit.style.display="none";}}
divLinks.className="comment-links";if(allowEdit)
{var _42b=cg_ce("span");var _42c=cg_ce("a");cg_ae(_42c,cg_ct(Localization.edit));_42c.onclick=Curse.Comment.edit.bind(this,record);cg_ds(_42c);_42c.href="javascript:;";cg_ae(_42b,_42c);cg_ae(_42b,cg_ct(" | "));cg_ae(divLinks,_42b);var _42d=cg_ce("span");var _42e=cg_ce("a");cg_ae(_42e,cg_ct(Localization._delete));_42e.onclick=Curse.Comment.del.bind(this,record);cg_ds(_42e);_42e.href="javascript:;";cg_ae(_42d,_42e);cg_ae(_42d,cg_ct(" | "));cg_ae(divLinks,_42d);}
var aReply=cg_ce("a");cg_ae(aReply,cg_ct(Localization.reply));if(Curse.User.id)
{aReply.onclick=scrollToCommentBox.bind(this);aReply.href="javascript:;";}
else
{aReply.onclick=navToLogin.bind(this);aReply.href="javascript:;";}
cg_ae(divLinks,aReply);record.divLinks=divLinks;cg_ae(container,divLinks);if(hideComment)
{divLinks.style.display="none";}},columns:[{id:"name",label:Localization.name,align:"left",value:"body",sortFunc:function(a,b)
{return cg_strcmp(a.date,b.date);}}]}};Curse.DataGrid.Utility.appendLocation=function(record,td)
{if(record.locs==null)
{return-1;}
for(var i=0,len=record.locs.length;i<len;++i)
{if(i>0)
{cg_ae(td,cg_ct(", "));}
var cloc=record.locs[i];if(cloc==-1)
{cg_ae(td,cg_ct("..."));}
else
{var a=cg_ce("a");a.className="r1";a.href="location.aspx?id="+cloc;cg_ae(a,cg_ct(Curse.Lookup.location_name[cloc]));cg_ae(td,a);}}};Curse.DataGrid.Utility.getQuestCategory=function(subKeys)
{if(subKeys[0]>0)
{return Curse.Lookup.location_name[subKeys[1]];}
else
{var menu;for(var i=0;i<mn_4.length;i++)
{if(mn_4[i][0]==subKeys[0])
{menu=mn_4[i];break;}}
if(!menu)
{return"";}
menu=menu[3];for(var i=0;i<menu.length;i++)
{if(menu[i][0]==subKeys[1])
{return menu[i][1];}}
return"";}};Curse.DataGrid.sharedColumns={price:{id:"price",label:Localization.price,render:function(record,td)
{Curse.DataGrid.Utility.appendPrice(td,record.price[0],record.price[1],record.price[2],record.price[3]);},sortFunc:function(a,b,col)
{var lena=0,lenb=0;if(a.price[3]!=null)
{cg_iterateArray(a.price[3],function(x,_,_,i){lena+=Math.pow(10,i)+x[1];});}
if(b.price[3]!=null)
{cg_iterateArray(b.price[3],function(x,_,_,i){lenb+=Math.pow(10,i)+x[1];});}
return cg_strcmp(lena,lenb)||cg_strcmp(a.price[2],b.price[2])||cg_strcmp(a.price[1],b.price[1])||cg_strcmp(a.price[0],b.price[0]);}},dropCount:{id:"dropCount",label:Localization.count,width:"10%",value:"lootCount",render:function(record,td)
{if(record.totalLootCount)
{var d=cg_ce("div");d.className="small r0";cg_ae(d,cg_ct(" "+Localization.of+" "+record.totalLootCount));cg_ae(td,d);}
return record.lootCount;}},dropRate:{id:"dropRate",label:Localization.drop_rate,width:"10%",value:"percent",render:function(record,td)
{if(record.percent<0.01)
{return record.percent.toFixed(4)+"%";}
else if(record.percent<1.0)
{return record.percent.toFixed(2)+"%";}
else if(record.percent>=1.95)
{return record.percent.toFixed(0)+"%";}
else
{return parseFloat(record.percent.toFixed(1));}}},wishlistDate:{id:"wishlistDate",label:Localization.added,width:"15%",value:"wishlistDate",render:function(record,td,tr)
{return cg_getShortFriendlyTime(record.wishlistDate);}},wishlistEdit:{id:"wishlistEdit",label:"",width:"100px",value:"percent",sortable:false,render:function(record,td,tr)
{td.innerHTML="<button class=\"smallButton\" onclick=\"removeFromWishList(event,this,"+record.id+","+this.wishlistType+","+record.wishlistContainer+");\"><span>"+Localization.remove+"</span></button>";}},firstSeen:{id:"firstSeen",label:Localization.patch,width:"80px",value:"firstSeen",render:function(record,td,tr)
//EDITO FORMAT
{return Curse.Lookup.format_label[record.firstSeen];}},updateDate:{id:"updateDate",label:Localization.added,width:"15%",value:"date",render:function(record,td,tr)
{return cg_getShortFriendlyTime(record.date);}}}
Curse.WOWDB.ModelViewer={showPreview:function(entitySource,entityID,type,showOnCharacter,displayID,e)
{cg_cancelBubbling(e);if(!cg_ge("previewPanel"))
{Curse.WOWDB.ModelViewer.initialize();}
var flashVars="";var flashSource="wow"+type+"view.swf";if(type=="item")
{var itemIDs=entityID.toString().split(",");var myItem=cg_items[entityID];if(myItem&&!myItem.slot)
{myItem=Curse.DataGrid.getDataByType("items",entityID);}
if(showOnCharacter||itemIDs.length>1||isCharacterItem(myItem.slot))
{var itemsToLoad="";for(var i=0;i<itemIDs.length;i++)
{myItem=cg_items[itemIDs[i]];if(myItem.disp)
{itemsToLoad+=","+myItem.disp+"|"+myItem.slot;}}
flashSource="wowcharview.swf";flashVars="items="+itemsToLoad.substring(1)+"&race="+getViewerRace()+"&gender="+getViewerGender();}
else
{if(!myItem.disp)
{Curse.Alert.show(Localization.no_preview);return;}
if(myItem.disp<0)
{flashVars="id="+(-1*myItem.disp)+"&rotate=yes&zoom=5";flashSource="wowmobview.swf";}
else
{flashVars="id="+myItem.disp+"&rotate=yes&zoom=5";}}}
else if(type=="mob")
{if(!displayID)
{var npcRecord=Curse.DataGrid.getDataByType(entitySource,entityID);displayID=npcRecord.disp;}
flashVars="id="+displayID+"&rotate=no&zoom=20";}
if(cg_ge("previewPanel").style.display!="block")
{cg_ge("previewPanel").style.visibility="hidden";cg_ge("previewPanel").style.display="block";cg_centerElement(cg_ge("previewPanel"));cg_ge("previewPanel").style.visibility="visible";}
if(cg_ge("previewPanelThumbnailFlash"))
{stopThumbRotation();}
var so=new SWFObject(flashSource,"previewPanelFlash","447","391","8","#000000");so.addParam("quality","high");so.addParam("wmode","Opaque");so.addParam("FlashVars",flashVars);so.write("previewContainer");var flashObject=cg_ge("previewPanelFlash");cg_addEventListener(document,"keyup",Curse.WOWDB.ModelViewer.handleKeyPress);},handleKeyPress:function(e)
{var e=cg_getEvent(e);if(e.keyCode==27)
{Curse.WOWDB.ModelViewer.close();}
return;},initialize:function()
{var div=document.createElement("div");div.id="previewPanel";div.className="previewWindowContainer";div.innerHTML="<div class=\"moveWidget\"></div><a id=\"previewPanelClose\" onclick=\"Curse.WOWDB.ModelViewer.close();\"></a><a id=\"previewPanelClose2\" onclick=\"Curse.WOWDB.ModelViewer.close();\"></a><a id=\"previewPanelZoomOut\" onclick=\"zoomOut();\" onmouseout=\"stopZoom()\" onmouseup=\"stopZoom();\" onmousedown=\"_keepZooming=true;startZoomOut();\"></a><a id=\"previewPanelZoomIn\" onclick=\"zoomIn();\" onmouseout=\"stopZoom()\" onmouseup=\"stopZoom();\" onmousedown=\"_keepZooming=true;startZoom();\"></a><a id=\"previewPanelRotLeft\" onclick=\"rotateLeft();\" onmouseout=\"stopZoom()\" onmouseup=\"stopZoom();\" onmousedown=\"_keepZooming=true;startRotateLeft();\"></a><a id=\"previewPanelRotRight\" onclick=\"rotateRight();\" onmouseout=\"stopZoom()\" onmouseup=\"stopZoom();\" onmousedown=\"_keepZooming=true;startRotateRight();\"></a><a id=\"previewPanelRotUp\" onclick=\"rotateUp();\" onmouseout=\"stopZoom()\" onmouseup=\"stopZoom();\" onmousedown=\"_keepZooming=true;startRotateUp();\"></a><a id=\"previewPanelRotDown\" onclick=\"rotateDown();\" onmouseout=\"stopZoom()\" onmouseup=\"stopZoom();\" onmousedown=\"_keepZooming=true;startRotateDown();\"></a><div id=\"previewContainer\" style=\"position: absolute; top: 38px;left: 21px;width: 447px; height: 391px;\"></div>";document.body.appendChild(div);},close:function()
{if(!cg_ge("previewPanel"))
{return;}
cg_ge("previewPanel").style.display="none";cg_removeEventListener(document,"keyup",Curse.WOWDB.ModelViewer.handleKeyPress);}};var _arrCharacterData=[];var _searchText;var _searchDescription;var _browseDescription;var _arrItemStats=[];var _dispStatDiff=true;var _disableRefinementUI;var _userInitialized=false;var _searchBrowseString="";var dropTargets=[];var _showAllTabs=false;var _showTabs=false;var _detailsArticle=null;var _detailsEntityName=null;var _detailsEntityID=null;var _detailsPreviewIDs=null;var _detailsEntityTypeID=null;var _detailsEntityTypeLabel=null;var _detailsEntityTypeLabelThis=null;var _detailsHasPreview=null;var _detailsDisplayID=null;var _tooltipClass=null;var _selectedObj=null;var _targetObj=null;var currentItem=null;var _isDragging=false;var itemOriginalX;var itemOriginalY;var _cancelMouseOver=false;var _verificationText="";var mn_User;var mn_User_1=null;var isMapEdit=true;var _mainCharLevel=60;var _currentCharID;var statnames=["",Localization.strength,Localization.agility,Localization.stamina,Localization.intellect,Localization.spirit,Localization.armor,Localization.melee_damage,Localization.melee_speed,Localization.melee_power,Localization.melee_hit,Localization.melee_crit,Localization.expertise,Localization.ranged_skill,Localization.ranged_damage,Localization.ranged_speed,Localization.ranged_power,Localization.ranged_hit,Localization.ranged_crit,Localization.bonus_spell_damage,Localization.bonus_healing,Localization.spell_hit_rating,Localization.spell_crit_rating,Localization.spell_penetration,Localization.mana_regen,Localization.defense,Localization.dodge_rating,Localization.parry_rating,Localization.block_rating,Localization.resilience_rating,Localization.haste_rating,Localization.defense_rating,Localization.arcane,Localization.fire,Localization.nature,Localization.frost,Localization.shadow,Localization.hp,Localization.mana,Localization.offhand_speed,Localization.offhand_damage,Localization.armor_penetration];var Client={viewportWidth:function(){return self.innerWidth||(document.documentElement.clientWidth||document.body.clientWidth);},viewportHeight:function(){return self.innerHeight||(document.documentElement.clientHeight||document.body.clientHeight);},viewportSize:function(){return{width:this.viewportWidth(),height:this.viewportHeight()};}};function setUser()
{if(!cg_ge("divLoginOptions"))
{return;}
_userInitialized=true;Curse.User.initialize();if(Curse.User.displayName!=null&&Curse.User.displayName!="")
{mn_User_1=[[1,Localization.account_settings,"account.aspx"],[2,Localization.wishlists,"javascript:navToWishlist();"],[3,Localization.characters,"characters.aspx"],[4,Localization.logout,"javascript:navToLogout();"]];if(Curse.User.isModerator)
{mn_User_1.push([3,Localization.approve_map_locations,"adminApproveLocations.aspx"]);mn_User_1.push([4,Localization.approve_talent_builds,"adminApproveBuilds.aspx"]);}
mn_User=[[1,Localization.welcome+" <b>"+Curse.User.displayName+"</b>","$nonav$",null,"menuWelcomeMessage"],[2,Localization.my_account,"account.aspx",mn_User_1]];cg_ge("divLoginOptions").style.display="none";}
else
{cg_ge("divLoginOptions").style.display="block";}
setUserBookmarks();cg_ge("spanUserMenu").innerHTML="";Curse.Menu.addMainMenu("spanUserMenu",mn_User);}
function handleInitSession(status)
{setUser();}
var cg_session=new Curse.Session(handleInitSession);function showTip(tipName)
{switch(tipName)
{case"overview":Curse.Alert.show(Localization.first_visit+"<br>"+Localization.replace("click_to_tour","<a href=\"overview.aspx\">","</a>"),Localization.welcome_message,null,"navTo(event,'overview.aspx')^"+Localization.take_the_tour+"|Curse.Alert.close()^"+Localization.cancel+"|disableTips()^"+Localization.disable_tips,null,null,null,true);break;}}
function showCookieMessage()
{if(cg_cookiesDisabled())
{Curse.Alert.show(Localization.blocked_cookies,Localization.cookies_blocked);}}
function disableTips()
{Curse.Alert.close();cg_setCookie("_tipsDisabled",true,10);}
function setFirstVisit()
{if(cg_cookiesDisabled())
{return;}
if(Curse.User.id==null&&cg_getCookie("_visited")==null)
{if(self.location.href.indexOf("overview")==-1)
{}
cg_setCookie("_visited",true,10);}}
function AscArticle(id,dateCreated,createdUserID,createdUserName,dateModified,modifiedUserID,modifiedUserName,articleBody,articleLink,articleSourceID,articleSourceName,articleSourceLink)
{this.id=id;this.dateCreated=cg_getShortFriendlyTime(parseInt(dateCreated));this.createdUserName=createdUserName;if(dateModified)
{this.dateModified=cg_getShortFriendlyTime(parseInt(dateModified));}
this.modifiedUserID=modifiedUserID;this.modifiedUserName=modifiedUserName;this.body=articleBody;this.link=articleLink;this.sourceID=articleSourceID;this.sourceName=articleSourceName;this.sourceLink=articleSourceLink;}
function AscScreenshot(id,userID,userName,dateCreated,caption,isApproved)
{this.id=id;this.dateCreated=getFriendlyDate(getLocalDate(dateCreated),true);this.userID=userID;this.userName=userName;this.caption=caption;if(isApproved==1)
{this.isApproved=true;}
else
{this.isApproved=false;}}
var _mapLocations=null;var _mapCurrentIndex=0;var _mapCurrentZoom=1;function addMapLocations(data)
{_mapLocations=data;if(data&&data[0]==null)
return;if(data)
{processMap();}
else
{var mapContainer=cg_ge("mapContainer");mapContainer.innerHTML=Localization.replace("location_unknown",detailsEntityTypeLabel.toLowerCase());}}
function testAddMapLocations(data)
{if(!data)
{return;}
for(var i=0;i<data.length;i++)
{var fnd=false;for(var j=0;j<_mapLocations.length;j++)
{if(_mapLocations[j].locationID==data[i].locationID)
{fnd=true;for(var k=0;k<data[i].coords.length;k++)
{_mapLocations[j].coords.push(data[i].coords[k]);}}}
if(!fnd)
{_mapLocations.push(data[i]);}}}
function setMapLinks_Default()
{return;var mapContainer=cg_ge("mapContainer");var locationLinks=cg_cg_getElementsByClassName("map-links","div",mapContainer,true);if(!locationLinks||locationLinks.length==0)
{locationLinks=document.createElement("div");mapContainer.appendChild(locationLinks);}
else
{locationLinks.innerHTML="";}
locationLinks.className="map-links";if(_detailsEntityTypeID!=3)
{locationLinks.innerHTML+=Localization.replace("this_can_be_found_in",_detailsEntityTypeLabelThis);}
for(i=0;i<_mapLocations.length;i++)
{var locationID=_mapLocations[i].locationID;var locationName=getLookupLabel("location_name",locationID);var locationCount=_mapLocations[i].coords.length;var currentLink="";if(i>0)
{currentLink+=", ";}
currentLink+="<a ";if(locationCount>0)
{currentLink+=" onclick=\"updateMap(event,this,"+locationID+")\">";}
else
{currentLink+=" href=\"location.aspx?id="+locationID+"\">";}
currentLink+="</a>";currentLink+=locationName;if(locationCount>0)
{currentLink+=" ("+locationCount+")";}
locationLinks.innerHTML+=currentLink;}
var locationLinks=mapContainer.firstChild.getElementsByTagName("A");var firstLocationLink=locationLinks[0];var firstLocationIndex=0;for(i=0;i<locationLinks.length;i++)
{if(locationLinks[i].onclick)
{firstLocationLink=locationLinks[i];firstLocationIndex=i;break;}}
if(_mapLocations[firstLocationIndex].coords.length>0||_detailsEntityTypeID==3)
{updateMap(null,firstLocationLink,_mapLocations[firstLocationIndex].locationID);}}
function clearMapLinks()
{var mapContainer=cg_ge("mapContainer");var locationLinks=cg_getElementsByClassName("map-links","div",mapContainer,true);if(locationLinks!="")
{locationLinks.style.display="none";locationLinks.innerHTML="";}}
function getMapLinks(mapContainer)
{var locationLinks=cg_getElementsByClassName("map-links","div",mapContainer,true);if(!locationLinks||locationLinks.length==0)
{return null;}
else
{return locationLinks;}}
function setMapLinks_Herbs_Minerals(mapIndex)
{var distinctEntitySearchValues=[];var distinctEntityValues=getDistinctFilterValues(mapIndex,"entityNames");for(var i=0;i<distinctEntityValues.length;i++)
{var currentFilter=distinctEntityValues[i].split("|");distinctEntitySearchValues.push(currentFilter);}
var mapLinks=getMapFilterLinks(distinctEntityValues,distinctEntitySearchValues,mapIndex,"entityNames");var mapContainer=cg_ge("mapContainer");var locationLinks=getMapLinks(mapContainer);if(!locationLinks)
{locationLinks=document.createElement("div");locationLinks.className="map-links";mapContainer.appendChild(locationLinks);}
locationLinks.innerHTML=mapLinks;locationLinks.style.display="block";var locationLinks=cg_getElementsByClassName("map-links","div",mapContainer,true).getElementsByTagName("button");var firstLocationLink=locationLinks[0];if(firstLocationLink)
{firstLocationLink.onclick();}}
function setMapLinks_Quest(mapIndex)
{var mapContainer=cg_ge("mapContainer");var locationLinks=getMapLinks(mapContainer);if(!locationLinks)
{locationLinks=document.createElement("div");locationLinks.className="map-links";mapContainer.appendChild(locationLinks);}
else
{locationLinks.innerHTML="";}
var mapLinks;var nCount=getMapFilterCount(mapIndex,"territoryID",[1]);var aCount=getMapFilterCount(mapIndex,"territoryID",[2]);var hCount=getMapFilterCount(mapIndex,"territoryID",[4]);if(aCount>0&&hCount>0)
{mapLinks=Localization.show_quest_givers_for+getMapFilterLinks(["Alliance","Horde"],[[1,2],[1,4]],0,"territoryID");}
else if(hCount>0)
{mapLinks="";}
else if(aCount>0)
{mapLinks=Localization.replace("zone_npc_count",aCount);}
else if(nCount>0)
{mapLinks=Localization.replace("zone_neutral_count",nCount);}
locationLinks.innerHTML="<div>"+mapLinks+"</div>";locationLinks.style.display="block";var locationLinks=cg_getElementsByClassName("map-links","div",mapContainer,true).getElementsByTagName("button");var firstLocationLink=locationLinks[0];if(firstLocationLink)
{firstLocationLink.onclick();}
else
{updateMap(null,null,_mapLocations[0].locationID);}}
function setMapLinks(mapIndex)
{clearMapLinks();if(_mapLocations[mapIndex].mapType=="quest")
{setMapLinks_Quest(mapIndex);}
else if(_mapLocations[mapIndex].mapType=="mineral"||_mapLocations[mapIndex].mapType=="herb")
{setMapLinks_Herbs_Minerals(mapIndex);}}
function updateMapIndex(link,tabIndex,newIndex)
{_mapCurrentIndex=newIndex;if(_mapLocations[newIndex])
{setMapLinks(newIndex);setCurrentTab(cg_ge("tabGroupMap"),tabIndex);updateMap(null,null,_mapLocations[newIndex].locationID,_mapCurrentZoom,newIndex);}
else
{updateMap(null,null,_detailsEntityID,_mapCurrentZoom,0);}}
function processMap()
{var mapContainer=cg_ge("mapContainer");var mapTabs=document.createElement("div");mapTabs.className="map-tabs";var tabLabels=[];var tabValues=[];for(var i=0;i<_mapLocations.length;i++)
{tabLabels.push(_mapLocations[i].mapLabel+" ("+_mapLocations[i].coords.length+")");tabValues.push(i);}
if(tabLabels.length>0)
{mapTabs.id="tabGroupMap";mapContainer.appendChild(mapTabs);if(tabLabels.length<=5)
{createTabGroup(mapTabs,"tabGroupMap",tabLabels.join("|"),tabValues.join("|"),0,"updateMapIndex");}
else
{createLinkGroup(mapTabs,"tabGroupMap",tabLabels.join("|"),tabValues.join("|"),0,"updateMapIndex");}
var locationLinks=mapTabs.getElementsByTagName("A");var firstLocationIndex=0;for(i=0;i<locationLinks.length;i++)
{if(locationLinks[i].onclick)
{locationLinks[i].onclick();break;}}}
var noMapLinks=[];for(var i=0;i<_mapLocations.length;i++)
{if(_mapLocations[i].coords.length==0)
{noMapLinks.push("<a href=\"location.aspx?id="+_mapLocations[i].locationID+"\">"+_mapLocations[i].mapLabel+"</a>");}}
if(noMapLinks.length>0)
{var mapContainer=cg_ge("mapContainer");var mapLinksLower=document.createElement("div");if(_detailsEntityTypeID!=3)
{mapLinksLower.innerHTML=Localization.replace("this_can_also_be_found",_detailsEntityTypeLabelThis,noMapLinks.join(", "));}
mapContainer.appendChild(mapLinksLower);}
if(_detailsEntityTypeID==3)
{var editMapInfo=document.createElement('div');editMapInfo.id="editMapInfo";mapContainer.insertBefore(editMapInfo,cg_ge("tabGroupMap"));editMapClick();}}
function buildLocMapSelect()
{var mapContainer=cg_ge("mapContainer");var mSelect=document.createElement('select');mSelect.id="mapNameSelect";mSelect.onchange=function(){buildLocLocationSelect();};var lSelect=document.createElement('select');lSelect.id="locationNameSelect";lSelect.onchange=function(){highLightLocation();};mSelect.appendChild(document.createElement('option'));lSelect.appendChild(document.createElement('option'));var sSelect=document.createElement('select');sSelect.id="locationApprovalSelect";sSelect.appendChild(new Option('','0'));sSelect.appendChild(new Option('Approve','1'));sSelect.appendChild(new Option('Deny','2'));for(var i=0;i<_mapLocations.length;i++)
{var opt=document.createElement('option');opt.value=i;opt.innerHTML=_mapLocations[i].mapLabel;mSelect.appendChild(opt);}
mapContainer.appendChild(mSelect);mapContainer.appendChild(lSelect);mapContainer.appendChild(sSelect);var sButton=document.createElement('button');sButton.innerHTML="<span>"+Localization.submit+"</span>";sButton.onclick=submitLocationApproval;mapContainer.appendChild(sButton);buildLocLocationSelect();}
function submitLocationApproval()
{var mindex=cg_ge("mapNameSelect").value;var lids=cg_ge("locationNameSelect").value.split("^");var lid=lids[1];var lindex=lids[0];if((cg_ge("locationNameSelect").value=="")||(cg_ge("locationApprovalSelect").value==""))
return;var aval="";Curse.Ajax.load("ajaxMapEdit.aspx?locapprove="+lid+"^"+cg_ge("locationApprovalSelect").value,function(data){handleLocationSubmissionData(data,mindex,lindex);},"text","post");}
function handleLocationSubmissionData(data,mindex,lindex)
{var ids=data.split("|");if(ids[0]!=0)
{Curse.Alert.show(ids[1]);return;}
Curse.Alert.show(ids[1]);_mapLocations[mindex].coords.splice(lindex,1);updateMap(null,null,_mapLocations[mindex].locationID,_mapCurrentZoom,mindex);buildLocLocationSelect();}
function buildLocLocationSelect()
{while(cg_ge("locationNameSelect").childNodes[1]!=null)
{cg_ge("locationNameSelect").removeChild(cg_ge("locationNameSelect").childNodes[1]);}
var index=cg_ge("mapNameSelect").value;if(index=="")
{for(var i=0;i<_mapLocations.length;i++)
{for(var j=0;j<_mapLocations[i].coords.length;j++)
{var opt=document.createElement('option');opt.value=j+"^"+_mapLocations[i].coords[j][5];opt.innerHTML=_mapLocations[i].coords[j][6];cg_ge("locationNameSelect").appendChild(opt);}}}
else
{for(var j=0;j<_mapLocations[index].coords.length;j++)
{var opt=document.createElement('option');opt.value=j+"^"+_mapLocations[index].coords[j][5];opt.innerHTML=_mapLocations[index].coords[j][6];cg_ge("locationNameSelect").appendChild(opt);}
updateMapIndex(null,index,index);}}
function editMapClick()
{isMapEdit=!isMapEdit;if(isMapEdit)
{cg_ge("editMapInfo").innerHTML="<table style=\"width: 486px;\"><tr><td class=small>This map is currently being edited. Click the Cancel button to exit edit mode.</td><td align=right><button onclick=\"editMapClick();\"><span>Cancel</span></button></td></tr></table>";cg_ge("mapSpan").onclick=null;cg_addEventListener(cg_ge("mapSpan"),"click",addUserLocation);cg_ge("mapSpan").style.cursor="crosshair";}
else
{cg_ge("editMapInfo").innerHTML="<table style=\"width: 486px;\"><tr><td class=small>"+Localization.replace("to_edit_this_map","<span class=\"tip\" onmouseover=\"Curse.Tooltip.showTip('"+Localization.locations_you_add+"');\" onmouseout=\"Curse.Tooltip.hide();\">","</span>")+"</td><td><button onclick=\"editMapClick();\"><span>"+Localization.edit_map+"</span></button></td></tr></table>";cg_removeEventListener(cg_ge("mapSpan"),"click",addUserLocation);cg_ge("mapSpan").style.cursor="default";var currentLocationID=_mapLocations[_mapCurrentIndex].locationID;var newZoomLevel=_mapCurrentZoom+1;if(newZoomLevel==4)
{newZoomLevel=1;}
if(cg_ge("mapSpan").onclick==null)
{var fn=new Function("updateMap(window.event, null,'"+currentLocationID+"',"+newZoomLevel+","+_mapCurrentIndex+")");cg_ge("mapSpan").onclick=fn;}}}
function addUserLocation(e)
{var elemPos=cg_getPosition(cg_ge("mapSpan"));var y=Math.round(((Curse.Mouse.y-elemPos.y)/(cg_ge("mapSpan").offsetHeight*1.0))*10.0*100.0)/10.0;var x=Math.round(((Curse.Mouse.x-elemPos.x)/(cg_ge("mapSpan").offsetWidth*1.0))*10.0*100.0)/10.0;var pophtml=Localization.select_location_type+"<br><br><input type=\"hidden\" id=\"posX\" value=\""+x+"\"><input type=\"hidden\" id=\"posY\" value=\""+y+"\"><table><tr><td class=\"label\">"+Localization.type+":</td><td class=\"alertInput\"><select id=\"locTypeSelect\"><option value=\"-1\"></option><option value=\"0\">"+Location.point_of_interest+"</option><option value=\"2\">"+Localization.npc+"</option><option value=\"5\">"+Location.object+"</option></select><br><span align=\"top\"></td></tr><tr><td class=\"label\">"+Localization.name+":</td><td class=\"alertInput\"><input type=\"text\" id=\"locEntityName\"><div class=\"desc\">"+Localization.replace("enter_to_x_chars",50)+"</div></td></tr></table>";Curse.Alert.show(pophtml,Localization.add_map_location,"","addNewLocation()^"+Localization.ok+"|Curse.Alert.close()^"+Localization.cancel,null,null,null,true);}
function addNewLocation()
{var type=cg_ge("locTypeSelect").value;var name=cg_ge("locEntityName").value;if(type==""||name=="")
{return;}
var x=cg_ge("posX").value;var y=cg_ge("posY").value;var url="ajaxMapEdit.aspx?maploc="+type+"^"+name+"^"+x+"^"+y+"^"+_mapLocations[_mapCurrentIndex].locationID+"^"+Curse.User.id;Curse.Ajax.load(url,handleLocationSubmitPostback,'text','post');Curse.Alert.close();}
function handleLocationSubmitPostback(data)
{var postResult=data.split("|");Curse.Alert.show(postResult[1],Localization.add_map_location);}
function getMapFilterLinks(filterLabelArray,filterValueArray,mapIndex,filterName)
{var mapFilterLinks=[];mapFilterLinks.push("<button class=\"smallTab\" onclick=\"this.blur();clearMapFilters(this, "+mapIndex+");\"><span>"+Localization.any+" ("+_mapLocations[mapIndex].coords.length+")</span></button>");for(var i=0;i<filterLabelArray.length;i++)
{var currentValueArray=filterValueArray[i];var currentFilterCount=getMapFilterCount(mapIndex,filterName,currentValueArray);if(currentFilterCount<=0)
{continue;}
var currentLabel=filterLabelArray[i];for(var j=0;j<currentValueArray.length;j++)
{if(currentValueArray[j].constructor.toString().indexOf("String")>0)
{currentValueArray[j]="'"+currentValueArray[j].replace(/'/g,"\\'")+"'";}}
mapFilterLinks.push("<button class=\"smallTab\" onclick=\"this.blur();filterMapLocations(this, "+mapIndex+",'"+filterName+"',["+currentValueArray+"]);\"><span>"+currentLabel+" ("+currentFilterCount+")</span></button>");}
return mapFilterLinks.join(" ");}
function getMapFilterValue(mapRecord,filterName)
{switch(filterName)
{case"territoryID":return mapRecord[4].territoryID;break;case"entityNames":return mapRecord[4].entityNames;break;}}
function getDistinctFilterValues(mapIndex,filterName)
{var mapCoords=_mapLocations[mapIndex].coords;var distinctValues=[];for(var i=0;i<mapCoords.length;i++)
{var currentValue=getMapFilterValue(mapCoords[i],filterName);if(cg_isArray(currentValue))
{for(var j=0;j<currentValue.length;j++)
{var index=distinctValues.indexOf(currentValue[j]);if(index==null||index<0)
{distinctValues.push(currentValue[j]);}}}
else
{if(distinctValues.indexOf(currentValue)<0)
{distinctValues.push(currentValue);}}}
return distinctValues;}
function getMatchStatus(searchValueArray,pointValueArray)
{if(cg_isArray(pointValueArray))
{for(var i=0;i<pointValueArray.length;i++)
{if(searchValueArray.indexOf(pointValueArray[i])>=0)
{return true;}}
return false;}
else
{return searchValueArray.indexOf(pointValueArray)>=0;}}
function getMapFilterCount(mapIndex,filterName,filterValueArray)
{var mapCoords=_mapLocations[mapIndex].coords;var newCoords=[];var filterCount=0;for(i=0;i<mapCoords.length;i++)
{if(getMatchStatus(filterValueArray,getMapFilterValue(mapCoords[i],filterName)))
{filterCount+=1;}}
return filterCount;}
function clearMapFilters(link,mapIndex)
{var mapCoords=_mapLocations[mapIndex].coords;var newCoords=[];for(i=0;i<mapCoords.length;i++)
{mapCoords[i].IsHidden=false;}
updateMap(null,link,_mapLocations[mapIndex].locationID,null,mapIndex);}
function filterMapLocations(link,mapIndex,filterName,filterValues)
{var mapCoords=_mapLocations[mapIndex].coords;var newCoords=[];for(i=0;i<mapCoords.length;i++)
{if(getMatchStatus(filterValues,getMapFilterValue(mapCoords[i],filterName)))
{mapCoords[i].IsHidden=false;}
else
{mapCoords[i].IsHidden=true;}}
updateMap(null,link,_mapLocations[mapIndex].locationID,null,mapIndex);}
function getMapLocations(locationID,mapIndex)
{for(i=0;i<_mapLocations.length;i++)
{if(_mapLocations[i].locationID==locationID)
{return _mapLocations[i];}}}
function updateMap(e,link,locationID,zoomLevel,mapIndex)
{e=cg_getEvent(e);var targetObj=cg_getEventTarget(e);if(targetObj&&targetObj.parentNode&&targetObj.parentNode.className.indexOf("map-pin")==0)
{return;}
Curse.Tooltip.hide();if(link)
{if(link.className=="selected")
{return;}
setSelectedLink(link.parentNode,link,"button","smallTab","smallTabSelected");}
var mapContainer=cg_ge("mapContainer");var map=cg_getElementsByClassName("map","DIV",mapContainer,true);if(map=="")
{map=document.createElement("DIV");map.className="map";mapContainer.appendChild(map);}
var mapCache=cg_getElementsByClassName("map-cache","DIV",mapContainer,true);if(mapCache=="")
{mapCache=document.createElement("DIV");mapCache.className="map-cache";mapContainer.appendChild(mapCache);}
if(zoomLevel==null)
{zoomLevel=_mapCurrentZoom;}
var mapLocations=null;if(mapIndex)
{mapLocations=_mapLocations[mapIndex];}
else
{mapLocations=getMapLocations(locationID);}
var clickZoom=2;if(zoomLevel==1)
{mapWidth="480px";mapHeight="321px";if(mapLocations.iheight!=null)
{mapHeight=mapLocations.iheight+"px";}}
else if(zoomLevel==2)
{mapWidth="720px";mapHeight="480px";if(mapLocations.iheight!=null)
{mapHeight=((720.0/480.0)*mapLocations.iheight)+"px";}
clickZoom=3;}
else if(zoomLevel==3)
{mapWidth="1000px";mapHeight="663px";if(mapLocations.iheight!=null)
{mapHeight=((1000.0/480.0)*mapLocations.iheight)+"px";}
clickZoom=1;}
var mapLinks=getMapLinks(mapContainer);if(mapLinks)
{mapLinks.style.width=mapWidth;}
_mapCurrentZoom=zoomLevel;mapCache.innerHTML="<img src=\"maps/"+mapLocations.locale+"/"+locationID+"-"+clickZoom+".jpg>";map.style.width=mapWidth;map.style.height=mapHeight;var mapCoords=mapLocations.coords;var mapCoordsHTML=[];mapCoordsHTML.push("<span id=\"mapSpan\" onclick=\"updateMap(event, null,'"+locationID+"',"+clickZoom+","+mapIndex+")\" class=\"map-bg\" style=\"background: transparent url(maps/"+mapLocations.locale+"/"+locationID+"-"+zoomLevel+".jpg) repeat scroll 0%;width:"+mapWidth+";height:"+mapHeight+";\">");for(var i=0;i<mapCoords.length;i++)
{var currentCoord=mapCoords[i];var currentCoordTooltip="";var currentCoordLink="";var currentCoordClass="";if(currentCoord==null)
continue;if(currentCoord.IsHidden)
{continue;}
if(currentCoord.length>2)
{currentCoordTooltip=currentCoord[2];if(currentCoordTooltip)
{currentCoordTooltip=currentCoordTooltip.replace(/'/g,"\\'");currentCoordTooltip=currentCoordTooltip.replace(/"/g,"\\'");}
else
{currentCoordTooltip=currentCoord[0]+", "+currentCoord[1];}}
else
{currentCoordTooltip=currentCoord[0]+", "+currentCoord[1];}
if(currentCoord.length>3)
{currentCoordLink=currentCoord[3];}
if(currentCoord.length>5&&currentCoord[5]!="")
{currentCoordClass=" pin-"+currentCoord[5];}
mapCoordsHTML.push("<div class=\"map-pin"+currentCoordClass+"\" style=\"left: "+currentCoord[0]+"%; top: "+currentCoord[1]+"%;\"><a id=\"mPin-"+mapIndex+"-"+i+"\" onmouseover=\"Curse.Tooltip.show('"+currentCoordTooltip+"')\" onmouseout=\"Curse.Tooltip.hide();\"");if(currentCoordLink=="")
{mapCoordsHTML.push(" style=\"cursor: default;\"");}
else
{mapCoordsHTML.push(" href=\""+currentCoordLink+"\"");}
mapCoordsHTML.push("></a></div>");}
mapCoordsHTML.push("</span>");mapCoordsHTML.push(getGlowHTML(Localization.click_map_toggle,"glow"));map.innerHTML=mapCoordsHTML.join("");}
function addArticle(data)
{arrRawData=data.split("^");_detailsArticle=new AscArticle(arrRawData[0],arrRawData[1],arrRawData[2],arrRawData[3],arrRawData[4],arrRawData[5],arrRawData[6],arrRawData[7],arrRawData[8],arrRawData[9],arrRawData[10],arrRawData[11]);processArticle();}
function setExpandPolicy(link,expandByDefault)
{if(expandByDefault)
{expandArticle(link);cg_setCookie("_expandArticles","1",1);}
else
{contractArticle(link);cg_setCookie("_expandArticles","0",1);}}
function expandArticle(expandLink)
{var oArticleContainer=cg_ge("detailsArticleContainer");oArticleContainer.style.display="inline";oArticleContainer.style.overflow="visible";oArticleContainer.style.maxHeight="none";expandLink.parentNode.style.display="none";var articleContractor=cg_getElementsByClassName("article-contractor","DIV",oArticleContainer.parentNode,true);articleContractor.style.display="block";}
function fixIETables()
{var oArticleContainer=cg_ge("detailsArticleContainer");var articleTables=oArticleContainer.getElementsByTagName("TABLE");for(var i=0;i<articleTables.length;i++)
{articleTables[i].style.display="block";}}
var _detailsTabTop=null;function detailsTabTop()
{if(_detailsTabTop!=null)
{return _detailsTabTop;}
var viewportHeight=Client.viewportHeight();var articleContainer=cg_ge("detailsArticleContainer");var position=cg_getPosition(articleContainer);var tabContentPad=300;var tabTop=viewportHeight-position.y-tabContentPad;if(tabTop<100)
{tabTop=100;}
if(tabTop>500)
{}
_detailsTabTop=tabTop;return _detailsTabTop;}
function contractArticle(contractLink)
{cg_ge("detailsArticleContainer").style.display="block";cg_ge("detailsArticleContainer").style.overflow="hidden";cg_ge("detailsArticleContainer").style.maxHeight=detailsTabTop()+"px";if(contractLink)
{contractLink.parentNode.style.display="none";}
var articleExpander=cg_getElementsByClassName("article-expander","DIV",cg_ge("detailsArticleContainer").parentNode,true);articleExpander.style.display="block";}
function processArticle()
{if(!cg_ge("detailsArticle"))
{return;}
if(_detailsArticle)
{var tabTop=detailsTabTop();_detailsArticle.formattedBody=Curse.TextFormatter.getFormattedText(_detailsArticle.body,false,false);var articleHTML=_detailsArticle.formattedBody+"<div class=\"article-source\" style=\"background-image: url(images/article_source_"+_detailsArticle.sourceID+".png)\">"+Localization.replace("article_created","<a>"+_detailsArticle.createdUserName+"</a> "+_detailsArticle.dateCreated,"","<a href=\""+_detailsArticle.sourceLink+"\" target=\"_blank\">"+_detailsArticle.sourceName+"</a>","<a href=\""+_detailsArticle.link+"\" target=\"_blank\">","</a>")+"</div>";cg_ge("detailsArticle").innerHTML=articleHTML;if(_mapLocations)
{var spacer=document.createElement("div");spacer.className="spacerSmall";cg_ge("detailsArticleContainer").parentNode.insertBefore(spacer,cg_ge("detailsArticleContainer"));}
if(cg_ge("detailsArticleContainer").offsetHeight>tabTop&&cg_ge("detailsArticleContainer").offsetHeight-tabTop>20)
{var expandArticlePolicy=cg_getCookie("_expandArticles");var articleContractor=cg_getElementsByClassName("article-contractor","DIV",cg_ge("detailsArticle").parentNode.parentNode,true);if(!articleContractor||articleContractor.length==0)
{articleContractor=document.createElement("div");articleContractor.innerHTML="<a onclick=\"contractArticle(this)\">"+Localization.contract_article_contents+"</a> | <a onclick=\"setExpandPolicy(this, false)\">"+Localization.contract_by_default+"</a>";articleContractor.className="article-contractor";if(expandArticlePolicy!="1")
{articleContractor.style.display="none";}
cg_ge("detailsArticle").parentNode.insertBefore(articleContractor,cg_ge("detailsArticle"));}
var articleExpander=cg_getElementsByClassName("article-expander","DIV",cg_ge("detailsArticle").parentNode.parentNode,true);if(articleExpander.length==0)
{articleExpander=document.createElement("div");articleExpander.innerHTML="...<br><br>"+Localization.more_article+" <a onclick=\"expandArticle(this)\">"+Localization.expand_article_contents+"</a> | <a onclick=\"setExpandPolicy(this, true)\">"+Localization.expand_by_default+"</a>";articleExpander.className="article-expander";if(expandArticlePolicy=="1")
{articleExpander.style.display="none";}
cg_ia(cg_ge("detailsArticleContainer").parentNode,articleExpander,cg_ge("detailsArticleContainer"));}
if(expandArticlePolicy!="1"&&cg_ge("detailsArticleContainer").offsetHeight>tabTop)
{contractArticle();}}}
if(!Curse.User.isModerator)
{return;}
if(cg_ge("detailsArticle"))
{var articleLinks=cg_getElementsByClassName("article-links","DIV",cg_ge("detailsArticle").parentNode,true);if(!articleLinks||articleLinks.length==0)
{articleLinks=document.createElement("div");articleLinks.className="article-links";var mainContainer=cg_ge("detailsArticleContainer").parentNode;var editArticleContainer=cg_ge("divMainContents").getElementsByTagName("h1")[0];editArticleContainer.insertBefore(articleLinks,editArticleContainer.childNodes[0]);articleLinks.style.textAlign="left";articleLinks.style.cssFloat="right";}}
if(!_detailsArticle&&cg_ge("divMainContents").getElementsByTagName("h1")[0])
{var addArticleContainer=cg_ge("divMainContents").getElementsByTagName("h1")[0];articleLinks=document.createElement("div");articleLinks.className="article-links";articleLinks.style.textAlign="left";articleLinks.style.cssFloat="right";articleLinks.innerHTML="<span><a onclick=\"editArticle(this)\">"+Localization.add_article+"</a></span>";addArticleContainer.insertBefore(articleLinks,addArticleContainer.childNodes[0]);cg_ge("detailsArticle").innerHTML="";return;}
else if(_detailsArticle)
{articleLinks.innerHTML="<span><a onclick=\"editArticle(this,"+_detailsArticle.id+")\">"+Localization.edit_article+"</a> | </span><span><a onclick=\"deleteArticle(this,"+_detailsArticle.id+")\">"+Localization.delete_article+"</a></span>";}}
function getLookupLabel(lookupName,lookupKey)
{if(lookupKey=="")
{return"";}
return Curse.Lookup.lookup(lookupName+"."+lookupKey);}
function getCategoryLabel(categoryKey)
{var categoryArrayName=categoryKey.substring(0,categoryKey.lastIndexOf(".")).replace(/\./g,"_");var categoryValue=categoryKey.substring(categoryKey.lastIndexOf(".")+1);var categoryLabel;var categoryArray;try
{categoryArray=eval("mn_"+categoryArrayName);}
catch(ex)
{}
if(!categoryArray)
{return"";}
for(var i=0;i<categoryArray.length;i++)
{if(categoryArray[i][0]==categoryValue)
{categoryLabel=categoryArray[i][1];break;}}
return categoryLabel;}
function setStats(data)
{var stats=data.split("|");for(var i=0;i<stats.length;i++)
{var info=stats[i].split("^");var itemid=info[0];var sinfo=eval(info[1]);_arrItemStats.push({id:itemid,stats:sinfo});}}
function getItemStats(itemid)
{for(var i=0;i<_arrItemStats.length;i++)
{if(_arrItemStats[i].id==itemid)
return _arrItemStats[i].stats;}}
function roundperc(val)
{return Math.round(val*100.0)/100;}
function calculateStatDiffs(stat1,stat2)
{var sdifs=[];var sdone=[];for(var i=0;i<stat1.length;i++)
{var stat=stat1[i];if((stat.id==0)||(stat.id==8))
continue;if(!sdone[stat.id])
{var val=0;var sname;if(stat.id==7||stat.id==14)
{var vals1=stat.val.split('-');var nval=(((vals1[0]*1)+(vals1[1]*1))/2.0)/getCStat(stat1,stat.id+1);var damageRange2=getCStat(stat2,stat.id);if(damageRange2==0)
{continue;}
var vals2=damageRange2.split('-');var nval2=(((vals2[0]*1)+(vals2[1]*1))/2.0)/getCStat(stat2,stat.id+1);val=roundperc(nval-nval2);sname=Localization.dps;}
else
{var compVal=getCStat(stat2,stat.id);val=roundperc(stat.val-compVal);sname=statnames[stat.id];}
sdifs.push({name:sname,val:val});sdone[stat.id]=true;}}
for(var i=0;i<stat2.length;i++)
{var stat=stat2[i];if((stat.id==0)||(stat.id==8))
continue;if(sdone[stat.id]==null)
{var val=getCStat(stat1,stat.id)-stat.val;sdifs.push({name:statnames[stat.id],val:val});sdone[stat.id]=1;}}
return sdifs;}
function getCStat(stat,id)
{for(var i=0;i<stat.length;i++)
{if(stat[i].id==id)
return stat[i].val;}
return 0;}
function setStatDiffs(compareToItemID,itemPanelIndex)
{var masterItemID=_arrItemPanels[0].itemID;var masterItem=null;if(_arrItemPanels[0].charID)
{masterItem=getCharItem(masterItemID,getCharacter(_arrItemPanels[0].charID));}
else
{masterItem=cg_items[masterItemID];}
var compareToItem=cg_items[compareToItemID];var arrStatDiffs=getStatDiffs(compareToItem,masterItem);if(arrStatDiffs==null)
{return;}
var myregexp=new RegExp("<div class=\"itemTooltipStatChangeList.*?<\/div>");var tooltipHTML=compareToItem.description;tooltipHTML=tooltipHTML.replace(myregexp,"");if(compareToItemID==masterItemID)
{compareToItem.description=tooltipHTML;setTooltipText(itemPanelIndex,tooltipHTML);return;}
tooltipHTML+="<div class=\"itemTooltipStatChangeList\">"+Localization.if_you_equip+" "+getItemNameWithStyle(masterItem);var statGainsHTML=[];var statLossesHTML=[];for(var j=0;j<arrStatDiffs.length;j++)
{var sdif=arrStatDiffs[j];if(sdif.val<=0)
continue;statGainsHTML.push("<span class=r"+((sdif.val>0)?('2'):('7'))+">"+((sdif.val>0)?('+'):(''))+sdif.val+" "+sdif.name+"</span>");}
for(var j=0;j<arrStatDiffs.length;j++)
{var sdif=arrStatDiffs[j];if(sdif.val>=0)
continue;statLossesHTML.push("<span class=r"+((sdif.val>0)?('2'):('7'))+">"+((sdif.val>0)?('+'):(''))+sdif.val+" "+sdif.name+"</span>");}
if(statGainsHTML.length>0)
{tooltipHTML+="<br>"+Localization.you_will_gain+": "+statGainsHTML.join(", ");}
if(statLossesHTML.length>0)
{tooltipHTML+="<br>"+Localization.you_will_lose+": "+statLossesHTML.join(", ");}
tooltipHTML+="</div>";compareToItem.description=tooltipHTML;setTooltipText(itemPanelIndex,tooltipHTML);}
function getStatDiffs(compareToItem,masterItem)
{if(!_dispStatDiff)
{return;}
var masterStats=masterItem.stats;if(!masterStats)
{masterStats=getItemStats(masterItem.id);}
var compareToStats=compareToItem.stats;if(!compareToStats)
{compareToStats=getItemStats(compareToItem.id);}
if(masterStats==null||compareToStats==null)
{return null;}
return calculateStatDiffs(masterStats,compareToStats);}
function AscItemType(id,category,slots)
{this.id=id;this.category=category;this.slots=slots;}
function toggleImage(e,imageObj)
{e=cg_getEvent(e);var targetObj=cg_getEventTarget(e);if(imageObj)
{targetObj=imageObj;}
var imageSource="";imageSource=targetObj.src;if(imageSource.indexOf("clear.html")>=0)
{}
var fileExtension=imageSource.substring(imageSource.lastIndexOf(".")+1);var fileName=imageSource.substring(imageSource.lastIndexOf("index.html")+1,imageSource.lastIndexOf("."));fileName=fileName.replace("_on","").replace("_sel","");var imageState;if(e.type=="mouseover")
{imageState="_on";}
else if(e.type=="mouseout")
{imageState="";}
else if(e.type=="mousedown")
{imageState="_sel";}
else if(e.type=="mouseup")
{imageState="_on";}
targetObj.src="images/"+fileName+imageState+"."+fileExtension;}
function getEntityRecord(descriptorIndex,recordID)
{if(!cg_isArray(descriptorIndex))
{descriptorIndex=descriptorIndex.split(",");}
for(var j=0;j<descriptorIndex.length;j++)
{var dataArray=_arrResultsDataCollection[descriptorIndex[j]];for(var i=0;i<dataArray.length;i++)
{if(dataArray[i].id==recordID)
{return dataArray[i];}}}
return null;}
function getItem(itemID)
{for(var i=0;i<arrItemData.length;i++)
{if(arrItemData[i].id==itemID)
{return arrItemData[i];}}
return null;}
function getSpell(spellID)
{for(var i=0;i<arrSpellData.length;i++)
{if(arrSpellData[i].id==spellID)
{return arrSpellData[i];}}
return null;}
function setItemSets(itemSetArray)
{_arrItemSetData=itemSetArray;}
function getItemNameWithStyle(objItem)
{if(objItem.nameWithStyle)
{return objItem.nameWithStyle;}
var itemName="<span "+objItem.description.substring(2,objItem.description.indexOf("</b>"))+"</span>";objItem.nameWithStyle=itemName;return itemName;}
function getItemName(objItem)
{if(objItem.name)
{return objItem.name;}
var itemName=objItem.description.substring(2,objItem.description.indexOf("</b>"))
itemName=itemName.substring(itemName.indexOf(">")+1);objItem.name=itemName;return itemName;}
function addItems(itemData)
{var arrRawRecord=null;var arrRawData=null;var newLoad=false;arrRawData=itemData.split("|");if(arrItemData.length===0)
{newLoad=true;}
for(var i=0;i<arrRawData.length;i++)
{arrRawRecord=arrRawData[i].split("^");if(newLoad||cg_items[arrRawRecord[0]]===null)
{arrItemData.push(new AscItem(arrRawRecord[0],arrRawRecord[1],arrRawRecord[2],arrRawRecord[3],arrRawRecord[4],arrRawRecord[5],arrRawRecord[6]));}}}
function addSpells(spellData)
{var arrRawRecord=null;var arrRawData=null;var newLoad=false;arrRawData=spellData.split("|");if(arrItemData.length===0)
{newLoad=true;}
for(var i=0;i<arrRawData.length;i++)
{arrRawRecord=arrRawData[i].split("^");arrSpellData.push(new AscSpell(arrRawRecord[0],arrRawRecord[1],arrRawRecord[2]));}}
function getTargetWindow(elementObj)
{var targetWindow=elementObj;while(targetWindow.className&&targetWindow.className.indexOf("WindowContainer")<0)
{targetWindow=targetWindow.parentNode;}
if(targetWindow&&targetWindow.className&&targetWindow.className.indexOf("WindowContainer")>=0)
{return targetWindow;}
else
{return null;}}
function bringWindowToFront(targetWindow)
{return;if(targetWindow===null)
{return;}
if(targetWindow.style.zIndex=="21"){}
var windowCol=cg_getElementsByClassName("journalWindowContainer","DIV",document.body);for(var i=0;i<windowCol.length;i++)
{if(parseInt(windowCol[i].style.zIndex,null)>"20")
{windowCol[i].style.zIndex="20";}}
targetWindow.style.zIndex="21";}
var _lastMouseX;var _lastMouseY;function dbg(text)
{return;if(!cg_ge("debugPanel"))
{return;}
if(cg_ge("debugPanel").style.display=="none")
{return;}
cg_ge("debugPanel").appendChild(document.createElement("br"));cg_ge("debugPanel").appendChild(document.createTextNode(text));}
function handleGlobalMouseOver(e)
{if(_cancelMouseOver)
{_cancelMouseOver=false;return false;}
var evt=cg_getEvent(e);var tgt=evt._target;if(tgt.className=="cellItemListHeader")
{tgt.style.backgroundColor="#425166";return false;}
return;}
function handleRowMouseOut(e)
{var eventTarget=cg_getEventTarget(e);while(eventTarget.tagName!="TR")
{eventTarget=eventTarget.parentNode;}
eventTarget.style.backgroundColor="";return false;}
function handleRowMouseClick(e,sUrl)
{var eventTarget=cg_getEventTarget(e);if(eventTarget.tagName=="A")
{return;}
self.location=sUrl;}
function handleRowMouseOver(e)
{var eventTarget=cg_getEventTarget(e);while(eventTarget.tagName!="TR")
{eventTarget=eventTarget.parentNode;}
eventTarget.style.backgroundColor="#08161F";return false;}
function handleGlobalMouseOut(e)
{}
function navToNothing(e)
{cg_cancelBubbling(e);}
function navTo(e,location)
{if(e)
{cg_cancelBubbling(e);}
self.location=location;}
function navToScreenshot(id)
{self.location="screenshot.aspx?id="+_detailsEntityID+"|"+_detailsEntityTypeID+"";}
function navToWishlist()
{self.location="wishlist.aspx?id="+Curse.User.id;}
function navToLogin()
{var relativeLocation=cg_getRelativeLocation();if(relativeLocation.toLowerCase().indexOf("login.aspx")>=0)
{self.location="login.html";}
else
{self.location="login.aspx?referrer="+relativeLocation;}}
function navToLogout()
{self.location="login.aspx?action=logout&referrer="+cg_getRelativeLocation();}
function setRatingPercs(itemid)
{var masterItem=null;var level;if(_currentCharID)
{var chara=getCharacter(_currentCharID);level=chara.level;masterItem=getCharItem(itemid,chara);}
if(!masterItem)
{masterItem=getItem(itemid);level=_mainCharLevel;}
for(var i=1;i<35;i++)
{var regex=new RegExp("(\\<span class=r2 id='tooltipItemStat_"+i+"'>.*? rating by )(\\w+)(.*?)\\<\\/span\\>");var matches=regex.exec(masterItem.description);if(matches!=null)
{masterItem.description=masterItem.description.replace(regex,matches[1]+matches[2]+"("+roundperc(RateToVal(level,matches[2]*1.0,i))+"% at "+level+")"+matches[3]+"</span>");}}}
function RateToVal(level,val,stid)
{if((level>8)&&(level<60))
{var H=1.0/(1.0/(((1/52.0)*level)-(8/52.0)));}
else
{var H=-3/82.0*level+131/41;}
var F;if(stid==11)
F=14.0;else if(stid==10)
F=10.0;else if(stid==12)
F=2.5;else if(stid==25)
F=1.5;else if(stid==26)
F=12.0;else if(stid==27)
F=15.0;else if(stid==28)
F=5.0;else if(stid==30)
F=10.0;else if(stid==21)
F=8.0;else if(stid==22)
F=14.0;else if(stid==29)
F=25.0;return val/F*H;}
function setSelectedLink(linkContainer,link,tagName,regState,selState)
{if(regState==null)
{regState="";}
if(selState==null)
{selState="selected";}
if(tagName==null)
{tagName="A";}
links=linkContainer.getElementsByTagName(tagName);for(i=0;i<links.length;i++)
{links[i].className=regState;}
link.className=selState;}
var _alphaArrayRank=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];function getPlayer()
{if(Curse.Browser.ie)
{return cg_ge("previewPanelFlash");}
else
{return cg_ge("previewPanelFlash");}}
function getMobsPlayer()
{if(Curse.Browser.ie)
{return cg_ge("previewPanelMobsMobsFlash");}
else
{return cg_ge("previewPanelFlashMobsEmbed");}}
function zoomIn()
{flash=getPlayer();flash.zoomIn();}
function zoomOut()
{flash=getPlayer();flash.zoomOut();}
function rotateRight()
{flash=getPlayer();flash.rotRight();}
function rotateLeft()
{flash=getPlayer();flash.rotLeft();}
function rotateUp()
{flash=getPlayer();flash.rotUp();}
function rotateDown()
{flash=getPlayer();flash.rotDown();}
var _keepZooming=false;function startRotateDown()
{if(!_keepZooming)
{return;}
rotateDown();setTimeout(startRotateDown,50);}
function startRotateUp()
{if(!_keepZooming)
{return;}
rotateUp();setTimeout(startRotateUp,50);}
function startRotateLeft()
{if(!_keepZooming)
{return;}
rotateLeft();setTimeout(startRotateLeft,50);}
function startRotateRight()
{if(!_keepZooming)
{return;}
rotateRight();setTimeout(startRotateRight,50);}
function startZoom()
{if(!_keepZooming)
{return;}
zoomIn();setTimeout(startZoom,10);}
function startZoomOut()
{if(!_keepZooming)
{return;}
zoomOut();setTimeout(startZoomOut,10);}
function stopZoom()
{_keepZooming=false;}
var _modelToLoad=0;var _detailsItemSetIDs;function showPreview_ItemSet(btn,ids,showSet)
{loadPreviewThumbnail(ids);if(showSet)
{_detailsItemSetIDs=ids;btn.firstChild.innerHTML=Localization.view_item;var fn=new Function("showPreview_ItemSet(this,'"+_detailsEntityID+"',false);");}
else
{btn.firstChild.innerHTML=Localization.view_set;var fn=new Function("showPreview_ItemSet(this,'"+_detailsItemSetIDs+"',true);");}
var enlargeFn=new Function("Curse.WOWDB.ModelViewer.showPreview(null,'"+ids+"','item');");cg_ge("btnEnlargePreview").onclick=enlargeFn;btn.onclick=fn;}
function getViewerRace()
{var raceCookie=cg_getCookie("Settings.Character.Race");if(!raceCookie)
{raceCookie=1;}
return raceCookie;}
function getViewerGender()
{var genderCookie=cg_getCookie("Settings.Character.Gender");if(!genderCookie)
{genderCookie=0;}
return genderCookie;}
function toggleThumbRotation(button)
{if(button.childNodes[0].innerHTML.indexOf(Localization.start_rotation)>=0)
{startThumbRotation();button.childNodes[0].innerHTML=Localization.stop_rotation;}
else
{stopThumbRotation();button.childNodes[0].innerHTML=Localization.start_rotation;}}
function startThumbRotation()
{cg_ge("previewPanelThumbnailFlash").startRotating();}
function stopThumbRotation()
{cg_ge("previewPanelThumbnailFlash").stopRotating();}
var _characterArmorSlots=[1,2,3,4,5,6,7,8,9,10,11,12,16,20];var _characterHeldSlots=[12,13,14,15,17,21,22,23,25,26,28];function isCharacterItem(slot)
{if(_characterArmorSlots.indexOf(parseInt(slot,null))>=0)
{return true;}
return false;}
function isEquipableItem(slot)
{if(_characterArmorSlots.indexOf(parseInt(slot,null))>=0||_characterHeldSlots.indexOf(parseInt(slot,null))>=0)
{return true;}
return false;}
function loadPreviewThumbnail(itemIDs)
{var flashHeight="220";var flashSource="";var flashVars="";var itemsToLoad="";if(_detailsEntityTypeID=="1"||_detailsEntityTypeID=="7")
{itemIDs=itemIDs.split(",");var myItem=cg_items[itemIDs[0]];if(itemIDs.length>1||isCharacterItem(myItem.slot))
{for(var i=0;i<itemIDs.length;i++)
{myItem=cg_items[itemIDs[i]];if(!myItem)
{continue;}
if(myItem.disp)
{itemsToLoad+=","+myItem.disp+"|"+myItem.slot;}}
if(itemsToLoad=="")
{return;}
flashSource="wowcharview.swf";flashHeight="250";flashVars="items="+itemsToLoad.substring(1)+"&race="+getViewerRace()+"&gender="+getViewerGender();}
else
{if(parseInt(myItem.disp)<0)
{flashHeight="240";flashSource="wowmobview.swf";flashVars="id="+(-1*parseInt(myItem.disp))+"&rotate=no&zoom=4";}
else
{flashSource="wowitemview.swf";flashVars="id="+myItem.disp+"&rotate=no&zoom=4";}}}
else if(_detailsEntityTypeID=="2")
{flashHeight="240";flashSource="wowmobview.swf";flashVars="id="+_detailsDisplayID+"&rotate=no";}
var so=new SWFObject(flashSource,"previewPanelThumbnailFlash","100%",flashHeight,"8","#000000");so.onload=handleFlashPreviewLoad;so.addParam("quality","high");so.addParam("wmode","Opaque");so.addParam("FlashVars",flashVars);so.write("previewThumbnailContainer");handleFlashPreviewLoad();}
function handleFlashPreviewLoad()
{cg_ge("previewThumbnailContainer").style.backgroundImage="none";}
var _renderedResults;var _lastViewStateProcessed;var _processingViewState=false;var _firstLoad=true;function getViewState(index)
{var currentHashArray=self.location.hash.substring(1).split(":");if(currentHashArray.length<index+1)
{return null;}
return currentHashArray[index];}
function setViewState(stateIndex,stateValue)
{var indexArray=stateIndex.toString().split(",");var valueArray=stateValue.toString().split(",");var currentHashArray=self.location.hash.split(":");for(var i=0;i<indexArray.length;i++)
{if(indexArray[i]>(currentHashArray.length-1))
{for(var j=currentHashArray.length-1;j<indexArray[i];j++)
{currentHashArray.push("");}}
currentHashArray[indexArray[i]]=valueArray[i];}
var hashString=currentHashArray.join(":");if(_firstLoad)
{return;}
self.location.hash=hashString;lastViewStateProcessed=self.location.hash;}
function getGlowHTML(amount,className)
{var amountHTML="";if(!className)
{className="glow r1";}
amountHTML="<span class=\""+className+"\" style=\"position: absolute; right: 0pt; bottom: 0pt;\">";amountHTML+="<div style=\"position: absolute; white-space: nowrap; left: -1px; top: -1px; color: black; z-index: 2;\">"+amount+"</div>";amountHTML+="<div style=\"position: absolute; white-space: nowrap; left: -1px; top: 0px; color: black; z-index: 2;\">"+amount+"</div>";amountHTML+="<div style=\"position: absolute; white-space: nowrap; left: -1px; top: 1px; color: black; z-index: 2;\">"+amount+"</div>";amountHTML+="<div style=\"position: absolute; white-space: nowrap; left: 0px; top: -1px; color: black; z-index: 2;\">"+amount+"</div>";amountHTML+="<div style=\"position: absolute; white-space: nowrap; left: 0px; top: 0px; z-index: 4;\">"+amount+"</div>";amountHTML+="<div style=\"position: absolute; white-space: nowrap; left: 0px; top: 1px; color: black; z-index: 2;\">"+amount+"</div>";amountHTML+="<div style=\"position: absolute; white-space: nowrap; left: 1px; top: -1px; color: black; z-index: 2;\">"+amount+"</div>";amountHTML+="<div style=\"position: absolute; white-space: nowrap; left: 1px; top: 0px; color: black; z-index: 2;\">"+amount+"</div>";amountHTML+="<div style=\"position: absolute; white-space: nowrap; left: 1px; top: 1px; color: black; z-index: 2;\">"+amount+"</div>";amountHTML+="<span style=\"visibility: hidden;\">"+amount+"</span>";amountHTML+="</span>";return amountHTML;}
function getEntityLink(text,tag)
{var entityLinkRegEx=new RegExp("\\["+tag+"=([0-9]+)\](.*?)\\[\/"+tag+"]");var entityLinkMatch=entityLinkRegEx.exec(text);while(entityLinkMatch!=null)
{var entityLinkHTML="<a href=\""+tag+".aspx?id="+entityLinkMatch[1]+"\">"+entityLinkMatch[2]+"</a>";text=text.replace(entityLinkRegEx,entityLinkHTML);entityLinkMatch=entityLinkRegEx.exec(text);}
return text;}
function getMoneyHTML(text)
{var moneyRegEx=new RegExp("\\[money type=(\\\")?([a-z]+)(\\\")?( id=[0-9]+)?\\]([0-9,]+)\\[/money\\]");var moneyMatch=moneyRegEx.exec(text);while(moneyMatch!=null)
{var moneyType=moneyMatch[2].replace("honor","neutral");var moneyHTML="";if(moneyType=="item")
{var moneyItemID=moneyMatch[4].split("=")[1];var moneyItem=cg_items[moneyItemID];if(moneyItem)
{moneyHTML="<a onmouseover=\"showItemPanel("+moneyItemID+",event);\" onmouseout=\"Curse.Tooltip.hide();\" href=\"item.php?id="+moneyItemID+"\"class=\"moneyitem\" style=\"background-image: url(icons/t/"+moneyItem.iconID+".gif);\">"+moneyMatch[5]+"</a>";}}
else
{moneyHTML="<span class=\"money"+moneyType+"\">"+moneyMatch[5]+"</span>";}
text=text.replace(moneyRegEx,moneyHTML);moneyMatch=moneyRegEx.exec(text);}
return text;}
function getTooltipLinks(text,tag,formattingFunction,previewMode)
{var tooltipRegEx=new RegExp("\\["+tag+"(=[0-9]+)?( amount=)?([0-9]+)?( size=)?([a-z]+)?\\](.+?)\\[\/"+tag+"\\]");var tooltipMatch=tooltipRegEx.exec(text);while(tooltipMatch!=null)
{var tooltipAmount=null;var tooltipID=null;var tooltipLabel=null;var tooltipSize=null;if(tooltipMatch[1]&&tooltipMatch[1]!="")
{tooltipID=tooltipMatch[1].substring(1);tooltipLabel=tooltipMatch[6];}
else if(tooltipMatch[6])
{tooltipID=tooltipMatch[6];}
if(tooltipMatch[3])
{tooltipAmount=tooltipMatch[3];}
if(tooltipMatch[5])
{tooltipSize=tooltipMatch[5];}
text=text.replace(tooltipRegEx,formattingFunction(tooltipID,previewMode,tooltipLabel,tooltipAmount,tooltipSize));tooltipMatch=tooltipRegEx.exec(text);}
return text;}
function getTextItemLink(itemID,previewMode,tooltipLabel)
{if(isNaN(itemID))
{return"";}
var myItem=cg_items[itemID];if(myItem==null)
{if(previewMode)
{return"<b>["+Localization.items_appear+"]</b>";}
return"";}
if(!tooltipLabel)
{tooltipLabel=myItem.getNameWithRarity().name;}
var itemLink="<a href=\"item.php?id="+myItem.id+"\" onmouseout=\"Curse.Tooltip.hide();\" onmouseover=\"Curse.Tooltip.handleItemLinkOver(this);\" class=\"r"+myItem.rarity+"\">"+tooltipLabel+"</a>";return itemLink;}
function getIconItemLink(itemID,previewMode,tooltipLabel,tooltipAmount,tooltipSize)
{return getFullItemLink(itemID,previewMode,tooltipLabel,tooltipAmount,tooltipSize,true);}
function getFullItemLink(itemID,previewMode,tooltipLabel,tooltipAmount,tooltipSize,iconOnly)
{if(iconOnly==null)
{iconOnly=false;}
if(isNaN(itemID))
{return"";}
var item=cg_items[itemID];if(item==null)
{if(previewMode)
{return"<b>["+Localization.items_appear+"]</b>";}
return"";}
var itemLinkHTML=[];if(!tooltipLabel)
{tooltipLabel=item.getName();}
var itemRarity=item.getNameWithRarity().rarity;var itemName="<a class=r"+itemRarity+" href=\"item.php?id="+item.id+"\" onmouseout=\"Curse.Tooltip.hide();\" onmouseover=\"Curse.Tooltip.showItemTooltip(["+item.id+"]);\">"+tooltipLabel+"</a>";if(!tooltipSize)
{tooltipSize="medium";}
if(!iconOnly)
{itemLinkHTML.push("<table class=\"tableTooltipLink\"><tr><td>");}
itemLinkHTML.push("<div class=\"icon"+tooltipSize+"\" style=\"background-image:url(icons/"+tooltipSize.substring(0,1)+"/");itemLinkHTML.push(item.icon);itemLinkHTML.push(".gif);\"><div class=\"tile\">");if(tooltipAmount&&tooltipAmount>1)
{itemLinkHTML.push(getGlowHTML(tooltipAmount));}
itemLinkHTML.push("<a onmouseout=\"Curse.Tooltip.hide();\" onmouseover=\"Curse.Tooltip.showItemTooltip(["+item.id+"],{hideIcon:true});\" href=\"item.php?id="+item.id+"\"></a></div></div>");if(!iconOnly)
{itemLinkHTML.push("</td>");itemLinkHTML.push("<td style=\"padding-left: 4px;\">"+itemName+"</td></tr></table>");}
return itemLinkHTML.join("");}
function getSpellLink(objSpell,linkLabel)
{if(!linkLabel)
{linkLabel=objSpell.getName();}
linkLabel=">"+linkLabel;return"<a href=\"spell.aspx?id="+objSpell.id+"\" onmouseout=\"Curse.Tooltip.hide();\"  onmouseover=\"Curse.Tooltip.showSpellTooltip(["+objSpell.id+"],null,true);\""+linkLabel+"</a>";}
function getTextSpellLink(spellID,previewMode,tooltipLabel)
{if(isNaN(spellID))
{return"";}
var mySpell=cg_spells[spellID];if(mySpell==null)
{if(previewMode)
{return"<b>["+Localization.spells_appear+"]</b>";}
return"";}
return getSpellLink(mySpell,tooltipLabel);}
function getIconSpellLink(spellID,previewMode,tooltipLabel)
{return getFullSpellLink(spellID,previewMode,tooltipLabel,true);}
function getFullSpellLink(spellID,previewMode,tooltipLabel,iconOnly)
{if(isNaN(spellID))
{return"";}
if(iconOnly==null)
{iconOnly=false;}
var mySpell=cg_spells[spellID];if(mySpell==null)
{if(previewMode)
{return"<b>["+Localization.spells_appear+"]</b>";}
return"";}
var spellLinkHTML=[];var spellName=getSpellLink(mySpell,tooltipLabel);if(!iconOnly)
{spellLinkHTML.push("<table class=\"tableTooltipLink\"><tr><td>");}
spellLinkHTML.push("<div class=\"iconmedium\" style=\"background-image_url(icons/m/index.html");spellLinkHTML.push(mySpell.icon);spellLinkHTML.push(".gif);\"><div class=\"tile\">");spellLinkHTML.push("<a onmouseout=\"Curse.Tooltip.hide();\" onmouseover=\"Curse.Tooltip.showSpellTooltip(["+mySpell.id+"],{hideIcon:true});\" href=\"sell.aspx?id="+mySpell.id+"\"></a></div></div>");if(!iconOnly)
{spellLinkHTML.push("</td>");spellLinkHTML.push("<td style=\"padding-left: 4px;\">"+spellName+"</td></tr></table>");}
return spellLinkHTML.join("");}
function closeWindow(e,windowObj)
{var targetObj;if(windowObj)
{targetObj=windowObj;}
else
{targetObj=cg_getEventTarget(e);targetObj=getTargetWindow(targetObj);}
if(_lastProfileOpened==targetObj)
{_lastProfileOpened=null;}
var targetParent=targetObj.parentNode;targetParent.removeChild(targetObj);}
function saveSearch(browseKey,filterKey,e)
{var formString="?search_browse_key="+browseKey;formString+="&search_filter_key="+filterKey;var searchName=cg_ge("save_search_name").value;if(searchName=="")
{return;}
formString+="&search_name="+searchName;formString+="&ajax_action=save_search";Curse.Alert.close();Curse.Ajax.load("ajaxSaveSearch.aspx"+formString,handleSaveSearchPostback,'text','post');function handleSaveSearchPostback(data)
{var postResult=data.split("|");if(postResult[0]==0)
{Curse.Alert.show(postResult[1]);setUserBookmarks();}
else
{Curse.Alert.show(postResult[1]);}}}
function saveSearch_prompt(btn)
{var browseKey=cg_getQueryStringParam("browse");var filterKey=cg_getQueryStringParam("filters");Curse.Alert.show(Localization.enter_bookmark_search,Localization.bookmark_search,Localization.name+":^save_search_name^^^20^20^<small>"+Localization.replace("enter_to_x_chars",20)+"</small>","saveSearch('"+browseKey+"','"+filterKey+"',event)^"+Localization.save+"|Curse.Alert.close()^"+Localization.cancel,null,null,null,true);}
function getSharingLink_Item()
{var linkColor=getItemQualityColor(_detailsEntityID);var inGameLink="/run DEFAULT_CHAT_FRAME:AddMessage(&quot;"+Localization.shift_click_to_window+": \\124c"+linkColor+"\\124Hitem:"+_detailsEntityID+":0:0:0:0:0:0:0\\124h["+_detailsEntityName.replace(/"/g,"&quot;")+"]\\124h\\124r&quot;)";var WOWDBLinkWithIcon="[item]"+_detailsEntityID+"[/item]";var WOWDBLinkNoIcon="[itemlink]"+_detailsEntityID+"[/itemlink]";Curse.Alert.show(Localization.use_following_links+":",Localization.item_link,Localization.in_game_link+":^item_link^"+inGameLink+"^^42^2048^<small>"+Localization.copy_and_paste_command+"</small>^onfocus='select();' onclick='select();'^style='width:300px;'|"+Localization.WOWDB_tooltip+":<br><small>("+Localization.with_icon+")</small>^item_link_WOWDB_icon^"+WOWDBLinkWithIcon+"^^42^42^<small>"+Localization.copy_paste_to_comment+"</small>^onfocus='select();' onclick='select();'^style='width:300px;'|"+Localization.WOWDB_tooltip+":<br><small>("+Localization.without_icon+")</small>:^item_link_WOWDB^"+WOWDBLinkNoIcon+"^^42^42^<small>"+Localization.copy_paste_to_comment+"</small>^onfocus='select();' onclick='select();'^style='width:300px;'",null,null,null,null,true,480);function getItemQualityColor(itemID)
{var myItem=cg_items[itemID];var rarityID=myItem.getNameWithRarity().rarity;switch(parseInt(rarityID))
{case 0:return"ff9d9d9d";case 1:return"ffffffff";case 2:return"ff1eff00";case 3:return"ff0070dd";case 4:return"ffa335ee";case 5:return"ffff8000";case 6:return"ffe5cc80";case 7:return"ff0000";case 8:return"ffff98";}}}
function getSharingLink_Quest()
{var level=_detailsQuestLevel;if(!level)
{return;}
var inGameLink="/run DEFAULT_CHAT_FRAME:AddMessage(&quot;"+Localization.shift_click_to_window+": \\124Hquest:"+_detailsEntityID+":"+level+"\\124h["+_detailsEntityName.replace(/"/g,"&quot;")+"]\\124h&quot;)";var WOWDBLink="[quest]"+_detailsEntityID+"[/quest]";Curse.Alert.show(Localization.share_this_quest+":",Localization.quest_link,Localization.in_game_link+":^quest_link^"+inGameLink+"^^42^2048^<small>"+Localization.copy_and_paste_command+"</small>^onfocus='select();' onclick='select();'^style='width:300px;'|"+Localization.WOWDB_link+":^quest_link_WOWDB^"+WOWDBLink+"^^42^42^<small>"+Localization.copy_paste_to_comment+"</small>^onfocus='select();' onclick='select();'^style='width:300px;'",null,null,null,null,true,480);}
function getSharingLink_Spell()
{var WOWDBLinkWithIcon="[spell]"+_detailsEntityID+"[/spell]";var WOWDBLinkNoIcon="[spelllink]"+_detailsEntityID+"[/spelllink]";Curse.Alert.show(Localization.to_share_spell+":",Localization.spell_link,Localization.WOWDB_tooltip+":<br><small>("+Localization.with_icon+")</small>^spell_link_WOWDB_icon^"+WOWDBLinkWithIcon+"^^42^42^<small>"+Localization.copy_paste_to_comment+"</small>^onfocus='select();' onclick='select();'^style='width:300px;'|"+Localization.WOWDB_tooltip+":<br><small>("+Localization.without_icon+")</small>:^spell_link_WOWDB^"+WOWDBLinkNoIcon+"^^42^42^<small>"+Localization.copy_paste_to_comment+"</small>^onfocus='select();' onclick='select();'^style='width:300px;'",null,null,null,null,true,480);}
function setCurrentContributeTab(newTabIndex)
{setCurrentTab(cg_ge("tabGroupContribute"),newTabIndex);_currentDescriptorIndex=newTabIndex;}
function setCurrentTab(tabsContainer,newTabIndex)
{var tabsCollection=tabsContainer.getElementsByTagName("A");if(tabsCollection.length==0)
{return;}
for(var i=0;i<tabsCollection.length;i++)
{if(i==newTabIndex)
{tabsCollection[i].className="selected";if(tabsCollection[i].ascRelatedContainerID&&cg_ge(tabsCollection[i].ascRelatedContainerID))
{showElementByID(tabsCollection[i].ascRelatedContainerID);}}
else
{tabsCollection[i].className="";if(tabsCollection[i].ascRelatedContainerID&&cg_ge(tabsCollection[i].ascRelatedContainerID))
{cg_ge(tabsCollection[i].ascRelatedContainerID).style.display="none";}}}}
function showElementByID(elementID)
{showElement(cg_ge(elementID));}
function showElement(element)
{if(element.tagName=="TD")
{if(Curse.Browser.ie)
{element.style.display="inline-block";}
else
{element.style.display="table-cell";}}
else if(element.tagName=="TABLE")
{if(Curse.Browser.ie)
{element.style.display="inline-block";if(isIE6)
{element.style.width="100%";}}
else
{element.style.display="table";}}
else
{element.style.display="block";}}
function toggleTab(objTab,tabIndex)
{var tabContainer=objTab.parentNode;while(tabContainer.className!="tabs-container")
{tabContainer=tabContainer.parentNode;}
setCurrentTab(tabContainer,tabIndex);}
function createLinkGroup(objTabContainer,tabGroupName,tabLabels,tabValues,tabSelectedIndex,onClick)
{var containerDiv=document.createElement("DIV");var elClassName="selected";var resultsDescriptor;var resultsDescriptorLabel;var resultsCount;var arrTabLabels=tabLabels.split("|");var arrTabValues=tabValues.split("|");for(var i=0;i<arrTabLabels.length;i++)
{if(i==tabSelectedIndex)
{elClassName="selected";}
else
{elClassName="";}
var currentTabHTML="";if(i>0)
{currentTabHTML=" | ";}
currentTabHTML+="<a ";if(onClick)
{currentTabHTML+="onclick=\""+onClick+"(this,"+i+",'"+arrTabValues[i]+"')\"";}
currentTabHTML+=" class=\""+elClassName+"\">"+arrTabLabels[i]+"</a>";containerDiv.innerHTML+=currentTabHTML;}
objTabContainer.appendChild(containerDiv);objTabContainer.style.display="inline";}
function createTabGroup(objTabContainer,tabGroupName,tabLabels,tabValues,tabSelectedIndex,onClick)
{var containerDiv=document.createElement("DIV");var elUL=document.createElement("UL");elUL.className="tabs";var elClassName="selected";var resultsDescriptor;var resultsDescriptorLabel;var resultsCount;var arrTabLabels=tabLabels.split("|");var arrTabValues=tabValues.split("|");var selectedTabAnchor=null;for(var i=0;i<arrTabLabels.length;i++)
{if(i==tabSelectedIndex)
{elClassName="selected";}
else
{elClassName="";}
var eLI=document.createElement("LI");var currentTabHTML="";currentTabHTML="<a ";if(onClick)
{currentTabHTML+="onclick=\""+onClick+"(this,"+i+",'"+arrTabValues[i]+"')\"";}
currentTabHTML+=" class=\""+elClassName+"\"><div id=\""+tabGroupName+"_"+i+"\">"+arrTabLabels[i]+"</div><b>"+arrTabLabels[i]+"</b></a></li>";eLI.innerHTML=currentTabHTML;eLI.firstChild.ascRelatedContainerID=arrTabValues[i];elUL.appendChild(eLI);if(i==tabSelectedIndex)
{selectedTabAnchor=eLI.childNodes[0];}}
containerDiv.appendChild(elUL);objTabContainer.appendChild(containerDiv);objTabContainer.style.display="block";if(selectedTabAnchor&&selectedTabAnchor.onclick)
{selectedTabAnchor.onclick();}}
function handleGlobalMouseUp(e)
{_isDragging=false;_selectedObj=null;}
function handleGlobalMouseDown(e)
{var targetObj=cg_getEventTarget(e);if(targetObj.className.indexOf("moveWidget")==0)
{_isDragging=true;var targetWindow=getTargetWindow(targetObj);offsetx=Curse.Browser.ie?event.clientX:e.clientX;offsety=Curse.Browser.ie?event.clientY:e.clientY;nowX=parseInt(targetWindow.offsetLeft,null);nowY=parseInt(targetWindow.offsetTop,null);document.body.style.cursor=targetObj.style.cursor;bringWindowToFront(targetWindow);_selectedObj=targetObj;return true;}
targetObj=null;_selectedObj=null;return true;}
function handleGlobalClick(e)
{var characterID;var searchText;var charcterProfile;var viewportHeight;var viewportWidth;var targetObj=cg_getEventTarget(e);var myEvent=cg_getEvent(e);if(myEvent.which&&e.which!=1)
{return;}
if(myEvent.button&&myEvent.button!=0)
{return;}
if(!targetObj.className&&!targetObj.id)
{return true;}
if(targetObj.className=="imageButtonWindowClose")
{closeWindow(e);return false;}
if(targetObj.id.indexOf("characterLink_")>=0)
{characterID=targetObj.id.replace("characterLink_","");openProfile(characterID);charcterProfile=cg_ge("profile"+characterID);if(_lastProfileOpened)
{var lastPosition=cg_getPosition(_lastProfileOpened);charcterProfile.style.left=lastPosition.x+20+"px";charcterProfile.style.top=lastPosition.y+20+"px";}
else
{viewportHeight=Client.viewportHeight();viewportWidth=Client.viewportWidth();charcterProfile.style.left=((viewportWidth/2)-(charcterProfile.offsetWidth/2))+"px";charcterProfile.style.top=((viewportHeight/2)-(charcterProfile.offsetHeight/2))+"px";}
_lastProfileOpened=charcterProfile;return false;}
bringWindowToFront(getTargetWindow(targetObj));return true;}
function handleGlobalMouseMove(e)
{if(!_selectedObj)
{return;}
var mouseX=Curse.Mouse.x;var mouseY=Curse.Mouse.y;if(_selectedObj===null||_isDragging==false)
{return false;}
var targetObj=_selectedObj;var newTop=Curse.Browser.ie?nowY+event.clientY-offsety:nowY+e.clientY-offsety;var newLeft=Curse.Browser.ie?nowX+event.clientX-offsetx:nowX+e.clientX-offsetx;if(newTop<0)
{newTop=0;}
if(newLeft<0)
{newLeft=0;}
if(targetObj.className.indexOf("moveWidget")==0)
{var targetWindow=getTargetWindow(targetObj);targetWindow.style.width=targetWindow.offsetWidth+"px";targetWindow.style.height=targetWindow.offsetHeight+"px";targetWindow.style.position="absolute";targetWindow.style.left=newLeft+"px";targetWindow.style.top=newTop+"px";return false;}
else if(targetObj.className.indexOf("characterItem")==0)
{targetObj.style.left=newLeft+"px";targetObj.style.top=newTop+"px";return false;}
return false;}
function setPinItemButton()
{var pincontainer=cg_ge("divPinItemContainer");if(!pincontainer){return;}
var it=cg_items[_detailsEntityID];if(!it.slot)
{return;}
var slotName=getLookupLabel("slot",it.slot);var buttonEvents=" onclick=\"Curse.Tooltip.hide();pinItem();\" onmouseover=\"Curse.Tooltip.showTip('"+Localization.replace("click_see_side_by_side",slotName)+"')\" onmouseout=\"Curse.Tooltip.hide();\"";if(cg_getCookie("Settings.PinnedItem.item_"+it.slot)!=null)
{if(cg_getCookie("Settings.PinnedItem.item_"+it.slot).indexOf(_detailsEntityID)!=-1)
{pincontainer.innerHTML="<button class=\"smallButton\" onclick=\"unpinItem()\"><span>"+Localization.unpin_item+"</span></button>";}
else
{var txt="<button class=\"smallButton\""+buttonEvents+"><span>"+Localization.pin_item+"</span></button>";if((it.slot==11)||(it.slot==12)||(it.slot==13))
txt+="<div style=\"padding-top: 4px;\"><small>"+Localization._in+"</small>&nbsp;<select id=\"pinSideSelect\"><option value=\"0\">"+Curse.Lookup.slot[21]+"</option><option value=\"1\">"+Curse.Lookup.slot[22]+"</option></select></div>";pincontainer.innerHTML=txt;}}
else
{var txt="<button class=\"smallButton\""+buttonEvents+"><span>"+Localization.pin_item+"</span></button>";if((it.slot==11)||(it.slot==12)||(it.slot==13))
txt+="<div><small>"+Localization._in+"</small> &nbsp;<select id=\"pinSideSelect\"><option value=\"0\">"+Curse.Lookup.slot[21]+"</option><option value=\"1\">"+Curse.Lookup.slot[22]+"</option></select></div>";pincontainer.innerHTML=txt;}}
function unpinItem(itemID)
{if(!itemID)
{itemID=_detailsEntityID;}
var it=cg_items[itemID];cg_setCookie("Settings.PinnedItem.item_"+it.slot,cg_getCookie("Settings.PinnedItem.item_"+it.slot).replace(itemID,"").replace("|",""));if(_detailsEntityID)
{setPinItemButton();}}
function pinItem()
{var it=cg_items[_detailsEntityID];if((it.slot==11)||(it.slot==12)||(it.slot==13))
{var ck=cg_getCookie("Settings.PinnedItem.item_"+it.slot);if(ck==null)
cg_setCookie("Settings.PinnedItem.item_"+it.slot,_detailsEntityID);else
{var ids=ck.split("|");if((ids[1]=="")||(ids[1]==null))
ids[1]=_detailsEntityID;else if(cg_ge("pinSideSelect").value=="0")
{ids[0]=_detailsEntityID;}
else if(cg_ge("pinSideSelect").value=="1")
{ids[1]=_detailsEntityID;}
cg_setCookie("Settings.PinnedItem.item_"+it.slot,ids.join("|"));}}
else
cg_setCookie("Settings.PinnedItem.item_"+it.slot,_detailsEntityID);var slot=it.slot;if(slot=="17")
{cg_setCookie("Settings.PinnedItem.item_13",null);cg_setCookie("Settings.PinnedItem.item_14",null);cg_setCookie("Settings.PinnedItem.item_22",null);cg_setCookie("Settings.PinnedItem.item_21",null);cg_setCookie("Settings.PinnedItem.item_23",null);}
else if(slot=="21")
{cg_setCookie("Settings.PinnedItem.item_17",null);if(cg_getCookie("Settings.PinnedItem.item_13")!=null)
{var vals=cg_getCookie("Settings.PinnedItem.item_13").split("|");vals[0]="";if((vals[1]==null)||(vals[1]==""))
cg_setCookie("Settings.PinnedItem.item_13",null);else
cg_setCookie("Settings.PinnedItem.item_13",vals.join("|"));}}
else if(slot=="22")
{cg_setCookie("Settings.PinnedItem.item_23",null);cg_setCookie("Settings.PinnedItem.item_14",null);if(cg_getCookie("Settings.PinnedItem.item_13")!=null)
{var vals=cg_getCookie("Settings.PinnedItem.item_13").split("|");vals[1]="";if((vals[0]==null)||(vals[0]==""))
cg_setCookie("Settings.PinnedItem.item_13",null);else
cg_setCookie("Settings.PinnedItem.item_13",vals.join("|"));}}
else if(slot=="14")
{cg_setCookie("Settings.PinnedItem.item_23",null);cg_setCookie("Settings.PinnedItem.item_22",null);if(cg_getCookie("Settings.PinnedItem.item_13")!=null)
{var vals=cg_getCookie("Settings.PinnedItem.item_13").split("|");vals[1]="";if((vals[0]==null)||(vals[0]==""))
cg_setCookie("Settings.PinnedItem.item_13",null);else
cg_setCookie("Settings.PinnedItem.item_13",vals.join("|"));}}
else if(slot=="23")
{cg_setCookie("Settings.PinnedItem.item_22",null);cg_setCookie("Settings.PinnedItem.item_14",null);if(cg_getCookie("Settings.PinnedItem.item_13")!=null)
{var vals=cg_getCookie("Settings.PinnedItem.item_13").split("|");vals[1]="";if((vals[0]==null)||(vals[0]==""))
cg_setCookie("Settings.PinnedItem.item_13",null);else
cg_setCookie("Settings.PinnedItem.item_13",vals.join("|"));}}
else if(slot=="13")
{cg_setCookie("Settings.PinnedItem.item_17",null);if(cg_ge("pinSideSelect").value=="0")
{cg_setCookie("Settings.PinnedItem.item_21",null);}
else
{cg_setCookie("Settings.PinnedItem.item_22",null);cg_setCookie("Settings.PinnedItem.item_14",null);cg_setCookie("Settings.PinnedItem.item_23",null);}}
else if(slot=="5")
{cg_setCookie("Settings.PinnedItem.item_20",null);}
else if(slot=="20")
{cg_setCookie("Settings.PinnedItem.item_5",null);}
var pincontainer=cg_ge("divPinItemContainer");pincontainer.innerHTML="<button class=\"smallButton\" onclick=\"unpinItem()\" ><span>"+Localization.unpin_item+"</span></button>";}
function setWishlistButton()
{var buttonContainer=cg_ge("divWishlistButtonContainer");if(!buttonContainer)
{return;}
if(!Curse.User.id)
{buttonContainer.innerHTML="<button class=\"smallButton\" onmouseover=\"Curse.Tooltip.showTip('"+Localization.requires_account+"')\" onmouseout=\"Curse.Tooltip.hide();\" onclick=\"navToLogin()\" ><span>"+Localization.add_to_wishlist+"</span></button>";return;}
var currentWishlist=cg_getCookie("Login.Wishlist");if(currentWishlist)
{var arrCurrentWishlist=currentWishlist.split(",");if(arrCurrentWishlist.indexOf(_detailsEntityID+"")>=0)
{buttonContainer.innerHTML="<button class=\"smallButton\" onclick=\"navToWishlist();\"><span>"+Localization.in_your_wishlist+"</span></button>";return;}}
var entityLabel=Localization["this_entity"+_detailsEntityTypeID].toLowerCase();var tooltipHelp=" onmouseover=\"Curse.Tooltip.showTip('"+Localization.replace("click_here_add_wishlist",entityLabel)+"')\" onmouseout=\"Curse.Tooltip.hide();\"";buttonContainer.innerHTML="<button class=\"smallButton\""+tooltipHelp+"onclick=\"Curse.Tooltip.hide();addToWishlist_prompt(this,"+_detailsEntityID+")\"><span>"+Localization.add_to_wishlist+"</span></button>";}
function handleItemDetailsLoading()
{setWishlistButton();setPinItemButton();var divCommentsContainer=cg_ge("cellCommentContainer");if(Curse.User.id==null&&divCommentsContainer)
{var loginDiv=document.createElement("DIV");loginDiv.innerHTML="<small>"+Localization.replace("login_register_to_screenshot","<a href=\"javascript:navToLogin();\">","</a>","<a href=\"register.aspx\">","</a>")+"</small>";cg_ge("cellScreenshotContainer").insertBefore(loginDiv,cg_ge("cellScreenshotContainer").childNodes[0]);}
var contributeTabContainer=document.createElement("DIV");contributeTabContainer.className="tabs-container";contributeTabContainer.id="tabGroupContribute";createTabGroup(contributeTabContainer,"tabGroupContribute",Localization.post_a_comment+"|"+Localization.submit_a_screenshot,"cellCommentContainer|cellScreenshotContainer",0,"toggleTab");var oContribute=cg_ge("divContributeContainer");if(oContribute)
{var contributeContainer=oContribute.parentNode;contributeContainer.insertBefore(contributeTabContainer,cg_ge("divContributeContainer"));var formDisabled=Curse.User.id==null;Curse.Comment.initializeForm({container:'cellCommentContainer',subjectTypeId:_detailsEntityTypeID,subjectId:_detailsEntityID});}
var screenshotContainer=cg_ge("cellScreenshotContainer");if(screenshotContainer)
{if(Curse.User.id)
{if(screenshotContainer)
{document.forms.formScreenshot.viewport_height.value=Client.viewportHeight();document.forms.formScreenshot.viewport_width.value=Client.viewportWidth();document.forms.formScreenshot.entity_id.value=_detailsEntityID;document.forms.formScreenshot.entity_type_id.value=_detailsEntityTypeID;}}
else
{document.forms.formScreenshot.screenshot_file.disabled=true;}}
if(_detailsHasPreview)
{if(_detailsPreviewIDs)
{setTimeout("loadPreviewThumbnail('"+_detailsPreviewIDs+"')",200);}
else
{setTimeout("loadPreviewThumbnail('"+_detailsEntityID+"')",200);}}
if(!_detailsArticle)
{processArticle();}
document.body.focus();}
function getEditorElement(elementName,insText,elementArguments)
{var editorElement="";if(elementName=="ul"||elementName=="ol")
{if(insText.indexOf("[ul]")>=0||insText.indexOf("[ol]")>=0)
{return"";}
editorElement="["+elementName+"]\n";insTextArray=insText.split("\n");var linesInserted=0;for(var i=0;i<insTextArray.length;i++)
{if(insTextArray[i]!="")
{linesInserted+=1;editorElement+="[li]"+insTextArray[i]+"[/li]\n";}}
if(linesInserted==0)
{editorElement+="[li][/li]\n";}
editorElement+="[/"+elementName+"]";return editorElement;}
if(elementName=="url")
{if(!elementArguments)
{return;}
if(insText.indexOf("[url]")>=0)
{return"";}
urlLink=elementArguments.url;if(elementArguments.label!="")
{urlLabel=elementArguments.label;}
else
{urlLabel=urlLink;}
editorElement="[url=";editorElement+=urlLink;editorElement+="]"+urlLabel+"[/url]";return editorElement;}
if(elementName=="item"||elementName=="itemlink"||elementName=="spell"||elementName=="spelllink")
{if(!elementArguments)
{return;}
if(insText.indexOf("[item]")>=0||insText.indexOf("[itemlink]")>=0)
{return"";}
tooltipID=elementArguments.tooltipID;editorElement="["+elementName+"]";editorElement+=tooltipID;editorElement+="[/"+elementName+"]";return editorElement;}}
function processURLPrompt(editorID,e)
{_cancelBubbling(e);var myAlert=cg_ge("alert");var promptForm=myAlert.getElementsByTagName("form")[0];var urlLink=promptForm.url.value;var urlLabel=promptForm.label.value;var editor=cg_ge(editorID);Curse.Alert.close();Curse.TextEditor.applyElement(editor,"url",{"url":urlLink,"label":urlLabel});}
function processTooltipLinkPrompt(editorID,tag,e)
{_cancelBubbling(e);var myAlert=cg_ge("alert");var promptForm=myAlert.getElementsByTagName("form")[0];var tooltipID=promptForm.ID.value;var editor=cg_ge(editorID);Curse.Alert.close();Curse.TextEditor.applyElement(editor,tag,{"tooltipID":tooltipID});}
function displayTooltipLinkPrompt(e,editorID,tag,tooltipDescription,inputLabel)
{var myEvent=cg_getEvent(e);var src=cg_getEventTarget(e);var srcPosition=cg_getPosition(src);var form=src.parentNode.parentNode.getElementsByTagName("form")[0];var input=form.getElementsByTagName("textarea")[0];var defaultID=Curse.TextEditor.getSelectedText(input);Curse.Alert.show(Localization.enter_tooltip_id,Localization.replace("create_tooltip",tooltipDescription),inputLabel+"^ID^"+defaultID,"processTooltipLinkPrompt('"+editorID+"','"+tag+"',event)^"+Localization.ok+"|Curse.Alert.close()^"+Localization.cancel,src,srcPosition.y,srcPosition.x+src.offsetWidth+2);}
function removeEditCommentForm(editorContainer)
{var commentContainer=editorContainer.parentNode;var commentBody=cg_getElementsByClassName("comment-body","div",commentContainer,true);var editButtonContainer=cg_getElementsByClassName("comment-links","div",commentContainer,true);commentContainer.removeChild(editorContainer);if(editorContainer&&commentBody==null)
{editorContainer.ascBodyContainer.style.display="inline";editorContainer.ascEditButtonContainer.style.display="inline";if(editorContainer.ascHiddenElements&&editorContainer.ascHiddenElements.length>0)
{for(var i=0;i<editorContainer.ascHiddenElements.length;i++)
{editorContainer.ascHiddenElements[i].style.display="block";}}}
else
{editButtonContainer.style.display="block";commentBody.style.display="block";}}
function saveEditArticle(saveButton)
{var editorContainer=saveButton.parentNode.parentNode;var form=editorContainer.getElementsByTagName("form")[0];var articleID=form.article_id.value;Curse.Ajax.load(cg_getFormAsString(form),handleSaveEditArticlePostback,'text','post');function handleSaveEditArticlePostback(data)
{var postResult=data.split("|");if(postResult[0]==0)
{if(!_detailsArticle||form.article_body.value.indexOf("[item")>=0||form.article_body.value.indexOf("[spell")>=0)
{window.location.reload(false);}
_detailsArticle.body=form.article_body.value;_detailsArticle.dateModified=getFriendlyDate(new Date());_detailsArticle.modifiedUserId=Curse.User.id;_detailsArticle.modifiedUserName=Curse.User.displayName;_detailsArticle.link=form.article_link.value;processArticle();removeEditCommentForm(editorContainer);}
else
{Curse.Alert.show(postResult[1]);}}}
function setFormattedText(containerID,text)
{cg_ge(containerID).innerHTML=Curse.TextFormatter.getFormattedText(text,false,false);}
function editArticle(anchor,articleID)
{var articleBodyContainer=cg_ge("detailsArticle");var articleContainer=articleBodyContainer.parentNode;articleBodyContainer.style.display="none";anchor.parentNode.style.display="none";var infoBox=cg_getElementsByClassName("infobox","table",document.body,true);if(infoBox!=null&&infoBox!="")
{infoBox.style.display="none";}
var currentArticle=_detailsArticle;if(!currentArticle)
{articleID=0;articleBody="";articleLink="http://www.wowwiki.com/"+_detailsEntityName.replace(/\ /g,"_");}
else
{articleLink=currentArticle.link;articleBody=currentArticle.body;}
var articleCustomInput="<a target=\"_blank\" href=\""+articleLink+"\">"+Localization.potential_article+"</a> "+Localization.article_source+": <select name=\"article_source_id\"><option value=\"1\">WoWWiki</option></select>&nbsp;&nbsp;"+Localization.article_link+": <input name=\"article_link\" size=\"50\" value=\""+articleLink+"\" />";var editorDiv=Curse.TextEditor.getForm("postComment.aspx","formArticleEditor","ajax_action=edit_article,article_entity_type_id="+_detailsEntityTypeID+",article_entity_id="+_detailsEntityID+",article_id="+articleID,"article_body",articleBody,null,null,8,"8,000",null,"saveEditArticle(this)^"+Localization.save+"|cancelEditComment(this)^"+Localization.cancel,articleCustomInput);editorDiv.ascHiddenElements=[];editorDiv.ascHiddenElements.push(infoBox);editorDiv.ascBodyContainer=articleBodyContainer;editorDiv.ascParentContainer=articleContainer;editorDiv.ascEditButtonContainer=anchor.parentNode;editorDiv.className="article editor";articleContainer.insertBefore(editorDiv,articleBodyContainer);}
function removeFromWishList(e,anchor,entityID,entityTypeID,wishlistContainerID)
{cg_cancelBubbling(e);if(!window.confirm(Localization.remove_from_wishlist))
{return;}
anchor.style.visibility="hidden";var formString="?wishlist_entity_type_id="+entityTypeID;formString+="&wishlist_entity_id="+entityID;formString+="&wishlist_container_id="+wishlistContainerID;formString+="&ajax_action=remove_wishlist";var rowObject=anchor.parentNode;while(rowObject.tagName!="TR")
{rowObject=rowObject.parentNode;}
Curse.Ajax.load("editWishlist.aspx"+formString,handleRemoveFromWishListPostback,'text','post');function handleRemoveFromWishListPostback(data)
{var postResult=data.split("|");if(postResult[0]==0)
{Curse.Alert.show(postResult[1]);var oContainer=rowObject.parentNode;oContainer.removeChild(rowObject);}
else
{anchor.style.visibility="visible";Curse.Alert.show(postResult[1]);}}}
function deleteWishlistContainer(wishlistContainerID)
{if(!window.confirm(Localization.delete_wishlist))
{return;}
var formString="?wishlist_container_id="+wishlistContainerID;formString+="&ajax_action=delete_wishlist";Curse.Ajax.load("editWishlist.aspx"+formString,handleDeleteWishlistPostback,'text','post');function handleDeleteWishlistPostback(data)
{var postResult=data.split("|");if(postResult[0]==0)
{window.location.reload(false);}
else
{Curse.Alert.show(postResult[1]);}}}
function addToWishlist_prompt(anchor,entityID)
{Curse.Alert.show(Localization.choose_wishlist,Localization.add_to_wishlist,Localization.existing+"^wishlist_container_id^^WishlistContainers."+_detailsEntityTypeID+"|"+Localization.new_list+"^wishlist_container_name^^^^16^"+Localization.replace("enter_to_x_chars",16),"addToWishlist("+entityID+")^"+Localization.add+"|Curse.Alert.close()^"+Localization.cancel,null,null,null,true);}
function addToWishlist(entityID)
{var formString="?wishlist_entity_type_id="+_detailsEntityTypeID;formString+="&wishlist_entity_id="+_detailsEntityID;var oContainerID=cg_ge("wishlist_container_id");var wishlistContainerID=oContainerID.options[oContainerID.selectedIndex].value;var wishlistContainerName=cg_ge("wishlist_container_name").value;if(wishlistContainerID==""&&wishlistContainerName=="")
{return;}
anchor=cg_ge("divWishlistButtonContainer").childNodes[0];anchor.style.visibility="hidden";formString+="&wishlist_container_id="+wishlistContainerID;formString+="&wishlist_container_name="+wishlistContainerName;formString+="&ajax_action=add_wishlist";Curse.Alert.close();Curse.Ajax.load("editWishlist.aspx"+formString,handleAddToWishlistPostback,'text','post');function handleAddToWishlistPostback(data)
{var postResult=data.split("|");if(postResult[0]==0)
{Curse.Alert.show(postResult[1]);var oContainer=anchor.parentNode;oContainer.innerHTML="<button class=\"smallButtonDisabled\"><span>"+Localization.in_your_wishlist+"</span></button>";}
else
{anchor.style.visibility="visible";Curse.Alert.show(postResult[1]);}}}
function deleteArticle(anchor,articleID)
{if(!window.confirm(Localization.delete_article_confirm))
{return;}
var formString="?ajax_action=delete_article";formString+="&article_entity_type_id="+_detailsEntityTypeID;formString+="&article_entity_id="+_detailsEntityID;formString+="&article_id="+articleID;Curse.Ajax.load("postComment.aspx"+formString,handleDeleteArticlePostback,'text','post');function handleDeleteArticlePostback(data)
{var postResult=data.split("|");if(postResult[0]==0)
{_detailsArticle=null;processArticle();Curse.Alert.show(postResult[1]);}
else
{ratingButtonContainer.style.display="inline";Curse.Alert.show(postResult[1]);}}}
function validatePostScreenshot()
{var screenshotFile=cg_ge("inputScreenshotFile").value.toLowerCase();if(screenshotFile=="")
{Curse.Alert.show(Localization.select_valid_screenshot,Localization.submit_a_screenshot);return false;}
if(!cg_endsWith(screenshotFile,".jpg")&&!cg_endsWith(screenshotFile,".png"))
{Curse.Alert.show(Localization.unsupported_screenshot,Localization.submit_a_screenshot);return false;}
return true;}
function modScreenshot(e,approved,anchor,screenshotID)
{_cancelBubbling(e);var formString="?ajax_action=mod_screenshot&screenshot_entity_type_id="+_detailsEntityTypeID;formString+="&screenshot_entity_id="+_detailsEntityID;formString+="&screenshot_id="+screenshotID;formString+="&screenshot_approved="+approved;var modContainer=anchor.parentNode.parentNode;modContainer.style.visibility="hidden";Curse.Ajax.load("postComment.aspx"+formString,handleModScreenshotPostback,'text','post');function handleModScreenshotPostback(data)
{var postResult=data.split("|");if(postResult[0]==0)
{Curse.Alert.show(postResult[1]);}
else
{modContainer.style.visibility="visible";Curse.Alert.show(postResult[1]);}}}
function showHiddenComment(anchor)
{anchor.style.display="none";anchor.parentNode.parentNode.parentNode.childNodes[1].style.display="block";anchor.parentNode.parentNode.parentNode.childNodes[2].style.display="block";}
function getLastPageIndex()
{var pageCount=Math.ceil(_arrFilteredResultsData.length/_resultsPerPage);var startingIndex=((pageCount-1)*_resultsPerPage);return startingIndex;}
function getDescriptorIndexByName(descriptorName)
{var descriptorIndex="";for(var i=0;i<_arrResultsDataDescriptors.length;i++)
{if(_arrResultsDataDescriptors[i]==descriptorName)
{descriptorIndex+=","+i;}}
if(descriptorIndex=="")
{return null;}
descriptorIndex=descriptorIndex.substring(1);var descriptorIndexArray=descriptorIndex.split(",");if(descriptorIndexArray.count==1)
{return descriptorIndexArray[0];}
else
{return descriptorIndexArray;}}
function handleItemDetailsKeyPress(e)
{var myEvent=cg_getEvent(e);if(myEvent.keyCode==13)
{handleCommentSubmit(e);return;}}
function getItemIDFromURL()
{var itemID=self.location.href.substring(self.location.href.indexOf("?id=")+4);if(itemID.indexOf("&")>=0)
{itemID=itemID.substring(0,itemID.indexOf("&"));}
return itemID;}
function scrollToCommentBox()
{setCurrentContributeTab(0);var objCommentBox=cg_ge("tabGroupContribute");var objContributeContainer=cg_ge("divContributeContainer");var objCommentInput=objContributeContainer.getElementsByTagName("textarea")[0];objCommentBox.scrollIntoView();objCommentInput.focus();}
function scrollToScreenshotBox()
{setCurrentContributeTab(1);var objScreenshotBox=cg_ge("tabGroupContribute");objScreenshotBox.scrollIntoView();}
// ADS has been disables by XXX
function setAdsXXX()
{var adRight=cg_ge("iframeAdRight");if(adRight)
{}
var adComments=cg_ge("iframeAdComments");if(adComments)
{}}
function refreshAdsXXX()
{var adRight=cg_ge("iframeAdRight");if(adRight)
{}}
function setModMenu()
{if(!Curse.User.isModerator)
{return;}}
function handleSearchInputFocus(inputbox)
{if(inputbox.value==Localization.search_db+"...")
{inputbox.value="";}}
function handleSearchInputBlur(inputbox)
{if(inputbox.value=="")
{inputbox.value=Localization.search_db+"...";}}
function handleBookmarkChange(e)
{var savedSearchSel=cg_ge("fi_selBookmarks");var savedSearchValue=savedSearchSel.value;if(savedSearchValue=="")
{return;}
savedSearchValue=savedSearchValue.split("@@");var browseKey=savedSearchValue[0];var filterKey=savedSearchValue[1].replace(/\!\!/g,";");setTimeout("self.location = 'search.aspx?browse="+browseKey+"&filters="+filterKey+"'",1);}
function setUserBookmarks()
{if(!cg_ge("spanBookmarks"))
{return;}
if(cg_getCookie("Login.SavedSearches.1")==""||cg_getCookie("Login.SavedSearches.1")==null)
{if(!Curse.User.id)
{cg_ge("spanBookmarks").innerHTML=Localization.replace("register_to_bookmark","<a href=\"register.aspx\">","</a>","<span class=\"tip\" onmouseout=\"Curse.Tooltip.hide();\" onmouseover=\"Curse.Tooltip.showTip('"+Localization.with_WOWDB_account+"', event,'r')\">","</span>")}
else
{cg_ge("spanBookmarks").innerHTML=Localization.replace("bookmarks_appear_here","<span class=\"tip\" onmouseout=\"Curse.Tooltip.hide();\" onmouseover=\"Curse.Tooltip.showTip('"+Localization.replace("to_retreive_search","&quot;","&quot;")+"', event,'r')\">","</span>");}
return;}
var savedSearchSel=cg_getLookupSelectBox("SavedSearches.1","selBookmarks",null,false,"handleBookmarkChange()",true,"~~","||");var currentBookmark=cg_getQueryStringParam("browse")+"@@"+cg_getQueryStringParam("filters").replace(/;/g,"!!");savedSearchSel.value=currentBookmark;for(var i=0;i<savedSearchSel.options.length;i++)
{}
cg_ge("spanBookmarks").innerHTML="<small>"+Localization.bookmarks+":</small>&nbsp;";cg_ge("spanBookmarks").appendChild(savedSearchSel);}
function handleGlobalLoad(e)
{cg_addEventListener(document,"mouseover",handleGlobalMouseOver);cg_addEventListener(document,"mouseout",handleGlobalMouseOut);cg_addEventListener(document,"mousedown",handleGlobalMouseDown);cg_addEventListener(document,"mouseup",handleGlobalMouseUp);cg_addEventListener(document,"click",handleGlobalClick);cg_addEventListener(window,"scroll",handleWindowScroll);if(!_userInitialized)
{setUser();}
setAds();setFirstVisit();}
var lastScrollTop=0;function handleWindowScroll(e)
{if(cg_ge("previewPanel")&&cg_ge("previewPanel").style.display=="block")
{var scrollDelta=(cg_scrollTop()-lastScrollTop);cg_ge("previewPanel").style.top=(cg_ge("previewPanel").offsetTop+scrollDelta)+"px";}
lastScrollTop=cg_scrollTop();}
function submitSearch(srcObject)
{var val=cg_trim(srcObject.elements[0].value);if(val.length<2||val==Localization.search_db+"...")
{Curse.Alert.show(Localization.to_perform_fulltext);return false;}
return true;}
function showItemComparisonTable(classid)
{if(classid==-1)
classid=document.getElementById("compareTypeSelect").value;var compTable=document.getElementById("itemCompareTable");while(compTable.childNodes[1].childNodes[1]!=null)
compTable.childNodes[1].removeChild(compTable.childNodes[1].childNodes[1]);for(var i=0;i<compdata[classid].length;i++)
{var row=document.createElement('tr');row.onmouseout="handleRowMouseOut(event);";row.onmouseover="handleRowMouseOver(event);";for(var j=0;j<compdata[classid][i].length;j++)
{var cell=document.createElement('td');cell.align="center";var txt=document.createTextNode(compdata[classid][i][j]);cell.appendChild(txt);row.appendChild(cell);}
compTable.childNodes[1].appendChild(row);}}
function fixIE6()
{var objWrapper=cg_ge("divWrapper");if(!objWrapper)
{return;}
objWrapper.style.width=cg_ge("main-layout-center").offsetWidth-10+"px";var colContentPanels=cg_getElementsByClassName("content-panel","DIV");for(var i=0;i<colContentPanels.length;i++)
{var objContentPanel=colContentPanels[i];var objContentPanelBG=cg_getElementsByClassName("content-panel-bg","DIV",objContentPanel,true);if(objContentPanel.offsetHeight>0)
{objContentPanelBG.style.height=objContentPanel.offsetHeight-15+"px";var objContentPanelRight=cg_getElementsByClassName("content-panel-r","DIV",objContentPanel,true);objContentPanelRight.style.height=objContentPanel.offsetHeight-15+"px";}}}
if(Curse.Browser.ie6)
{cg_addEventListener(window,"load",fixIE6);cg_addEventListener(window,"resize",fixIE6);}
cg_addEventListener(window,"load",handleGlobalLoad);cg_addEventListener(document,"mousemove",handleGlobalMouseMove);
