var cacheditemtooltips=[],cachedspelltooltips=[],cachedglyphtooltips=[];function lfs_prefetchAllItemTooltips(a){a=a.join(";");$.getJSON("http://www.lookingforstats.com/ajax.php?action=tooltip&allitems="+a+"&jsoncallback=?",function(b){if(cacheditemtooltips.length!=0)cacheditemtooltips.concat(b.all);else cacheditemtooltips=b.all})}
function lfs_prefetchAllSpellTooltips(a){a=a.join(";");$.getJSON("http://www.lookingforstats.com/ajax.php?action=tooltip&allspells="+a+"&jsoncallback=?",function(b){if(cachedspelltooltips.length!=0)cachedspelltooltips.concat(b.all);else cachedspelltooltips=b.all})}
function lfs_prefetchAllGlyphTooltips(a){a=a.join(";");$.getJSON("http://www.lookingforstats.com/ajax.php?action=tooltip&allglyphs="+a+"&jsoncallback=?",function(b){if(cachedglyphtooltips.length!=0)cachedglyphtooltips.concat(b.all);else cachedglyphtooltips=b.all})}function lfs_showTooltip(a,b){b=b.position();$("div.critp").remove();$("body").append(a);$("div.critp").css({top:b.top+20,left:b.left+0})}
function lfs_showCachedItemTooltip(a,b){cacheditemtooltips[a]&&lfs_showTooltip(cacheditemtooltips[a],b)}function lfs_showCachedSpellTooltip(a,b){cachedspelltooltips[a]&&lfs_showTooltip(cachedspelltooltips[a],b)}function lfs_showCachedGlyphTooltip(a,b){cachedglyphtooltips[a]&&lfs_showTooltip(cachedglyphtooltips[a],b)}
function lfs_showItemTooltip(a,b){if(cacheditemtooltips[a])lfs_showCachedTooltip(a,b);else{cacheditemtooltips[a]="";$.getJSON("http://www.lookingforstats.com/ajax.php?action=tooltip&itemid="+a+"&jsoncallback=?",function(c){cacheditemtooltips[a]=c.html;lfs_showCachedTooltip(a,b)})}}
function lfs_showSpellTooltip(a,b){if(cachedspelltooltips[a])lfs_showCachedSpellTooltip(a,b);else{cachedspelltooltips[a]="";$.getJSON("http://www.lookingforstats.com/ajax.php?action=tooltip&spellid="+a+"&jsoncallback=?",function(c){cachedspelltooltips[a]=c.html;lfs_showCachedSpellTooltip(a,b)})}}
function lfs_showGlyphTooltip(a,b){if(cachedglyphtooltips[a])lfs_showCachedGlyphTooltip(a,b);else{cachedglyphtooltips[a]="";$.getJSON("http://www.lookingforstats.com/ajax.php?action=tooltip&glyphid="+a+"&jsoncallback=?",function(c){cachedglyphtooltips[a]=c.html;lfs_showCachedGlyphTooltip(a,b)})}}
$(document).ready(function(){$("body").append($('<link rel="stylesheet" type="text/css" href="http://static.lookingforstats.com:12380/css/tooltip.css" />'));var a=[],b=[],c=[];$("a").each(function(){var g=$(this).attr("href");if(g){var e=0,f="";m=g.match(/^http:\/\/www.lookingforstats.com\/\?page=item&(itemid|spellid|glyphid)=([0-9]+)/);if(m!=null){f=m[1];e=m[2];if(f=="itemid"){a.push(e);$(this).hover(function(){lfs_showCachedItemTooltip(e,$(this))},function(){$("div.critp").remove()}).mousemove(function(d){$("div.critp").position();
$("div.critp").css({top:d.pageY+20,left:d.pageX+0})})}else if(f=="spellid"){b.push(e);$(this).hover(function(){lfs_showCachedSpellTooltip(e,$(this))},function(){$("div.critp").remove()}).mousemove(function(d){$("div.critp").css({top:d.pageY+20,left:d.pageX+0})})}else if(f=="glyphid"){c.push(e);$(this).hover(function(){lfs_showCachedGlyphTooltip(e,$(this))},function(){$("div.critp").remove()}).mousemove(function(d){$("div.critp").css({top:d.pageY+20,left:d.pageX+0})})}}}});a.length!=0&&lfs_prefetchAllItemTooltips(a);
b.length!=0&&lfs_prefetchAllSpellTooltips(b);c.length!=0&&lfs_prefetchAllGlyphTooltips(c)});

