(function(){var b=null;$.fn.titleTooltip=function(a){return $(this).each(function(){var d=$(this).attr("title");d&&$(this).removeAttr("title").tooltip(d,a)})};$.fn.imageTooltip=function(a,d){return $(this).tooltip('<img src="'+a+'" alt="'+a+'" />',d)};$.fn.tooltip=function(a,d){function c(a){if(d.snap)var a=$(this),e=a.offset(),a={left:e.left,top:e.top,right:e.left+a.outerWidth(),bottom:e.top+a.outerHeight()};else a={left:a.pageX,top:a.pageY,right:a.pageX,bottom:a.pageY};a.left-=d.offset.left;a.top-=
d.offset.top;a.right+=d.offset.right;a.bottom+=d.offset.bottom;a=$.fn.tooltip.position(d.align,a,b.outerWidth(),b.outerHeight());b.offset({left:a.x,top:a.y})}b===null&&(b=$("<div/>").css("position","absolute").hide().appendTo("body"));d=$.extend({},$.fn.tooltip.defaults,d);return $(this).hover(function(f){var g=$.isFunction(a)?a(this):a;b.removeClass().addClass(d.className).html(g).stop(!0,!1).delay(d.showDelay).css("display","block").animate({opacity:1},d.showDuration);d.follow&&!d.snap&&$(this).bind("mousemove",
c);c.call(this,f);if(d.show)f.tooltip=b,d.show(f)},function(a){b.stop(!0,!1).delay(d.hideDelay).animate({opacity:0},d.hideDuration,function(){$(this).css("display","none")});d.follow&&!d.snap&&$(this).unbind("mousemove",c);if(d.hide)a.tooltip=b,d.hide(a)})};$.fn.tooltip.defaults={show:function(){},showDelay:0,showDuration:"fast",hide:function(){},hideDelay:0,hideDuration:0,offset:{left:1,top:1,right:10,bottom:20},align:"bottom right",follow:!0,snap:!1,className:"tooltip"};var c=$(window);$.fn.tooltip.view=
{width:function(){return c.width()-18},height:function(){return c.height()-18},scrollLeft:function(){return c.scrollLeft()},scrollTop:function(){return c.scrollTop()}};$.fn.tooltip.fit=function(a,d,b,c,g){function h(a){if(k)return(d+b-c)/2;return(a==i?b:d)-(a?c:0)}var k=/center/i.test(a),j=/left|top/i.test(a),i=/in/i.test(a),a=h(j);!k&&(a<0||a+c>g)&&(a=h(!j));(a<0||a+c>g)&&(a=k&&a<0||j||c>g?0:g-c);return a};$.fn.tooltip.position=function(a,d,c,b){var g=$.fn.tooltip.view,h=g.width(),k=g.height(),j=
g.scrollLeft(),g=g.scrollTop(),i=(a+"  ").split(/ /g,2),l=/left|right/i.test(i[0]),a=l?i[1]:i[0],m=$.fn.tooltip.fit,c=m(l?i[0]:i[1],d.left-j,d.right-j,c,h),d=m(a,d.top-g,d.bottom-g,b,k);return{x:c+j,y:d+g}}})();
(function(){$.fn.stopFadeOut=function(b){$(this).stop(!0,!1).animate({opacity:0},b||1E3,"linear",function(){$(this).css("display","none")})};$.fn.stopFadeIn=function(b){$(this).css("display","block").stop(!0,!1).animate({opacity:1},b||1E3)};$.interval=function(b,c){function a(){clearInterval(e);clearTimeout(f)}function d(){a();e=setInterval(c,b)}var e=null,f=null;d();return{start:d,stop:a,delay:function(c){a();f=setTimeout(d,c)}}}})();var Acx={Tests:{}};
function escapeHTML(b){var c={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;"};return b.replace(/[<>&"]/g,function(a){return c[a]})}Date.parseJSON=function(b){return new Date(parseInt(b.replace(/\D/g,"")))};if(!Math.clamp)Math.clamp=function(b,c,a){return b>a?b:c<a?c:a};if(!Math.lerp)Math.lerp=function(b,c,a){return b*(1-a)+c*a};if(!Math.randomInt)Math.randomInt=function(b,c){return b+Math.floor(Math.random()*(c-b))};
if(!String.prototype.trim)String.prototype.trim=function(){return this.replace(/(^\s+|\s+$)/g,"")};if(!String.prototype.toUpperCaseFirst)String.prototype.toUpperCaseFirst=function(){return this.replace(/^([a-z])/,function(b){return b.toUpperCase()})};
(function(b){b.enqueue=b.push;b.dequeue=b.shift;b.prepend=b.unshift;b.select=b.map;b.where=b.filter;b.all=b.every;b.any=b.some;b.foreach=function(c){for(var a in this)if(this.hasOwnProperty(a)&&c.call(this[a],this[a],a)===!1)break};b.add=function(c){this[this.length]=c};b.removeAt=function(c){c!=-1&&this.splice(c,1)};b.remove=function(c){this.removeAt(this.indexOf(c))};b.insert=function(c,a){this.splice(c,0,a)};b.first=function(){if(this.length==0)throw Error("Collection does not contain any elements.");
return this[0]};b.last=function(){if(this.length==0)throw Error("Collection does not contain any elements.");return this[this.length-1]};b.contains=function(c){return this.indexOf(c)!=-1};b.sum=function(c,a){c=c||function(a){return a};return this.reduce(function(a,b,f){return a+c(b,f)},a||0)};b.min=function(c){if(this.length==0)throw Error("Collection does not contain any elements.");return Math.min.apply(null,c?this.select(c):this)};b.max=function(c){if(this.length==0)throw Error("Collection does not contain any elements.");
return Math.max.apply(null,c?this.select(c):this)};b.selectMany=function(c){return[].concat.apply([],c?this.select(c):this)};b.single=function(c){c=c?this.where(c):this;if(c.length===0)throw Error("Collection does not contain any elements.");if(c.length>1)throw Error("Collection contains more than one element.");return c.first()};b.singleOrDefault=function(c,a){a===void 0&&(a=null);var b=c?this.where(c):this;if(b.length===0)return a;if(b.length>1)throw Error("Collection contains more than one element.");
return b.first()};b.toDictionary=function(c,a){var a=a?a:function(a){return a},b=[];this.forEach(function(e,f){b[c(e,f)]=a(e,f)});return b};b.skip=function(b){return this.slice(b)};b.take=function(b){return this.slice(0,b)};b.distinct=function(b){var a=[],b=b?b:function(a,b){return a==b};this.forEach(function(d){a.any(function(a){return b(a,d)})||a.add(d)});return a};Array.range=function(b,a){for(var d=[],e=0;e<a;++e)d[e]=e+b;return d};Array.repeat=function(b,a){for(var d=[],e=0;e<a;++e)d[e]=b;return d}})(Array.prototype);
var Tbc={Services:{},Talents:{},Tests:{},RacesPL:["Krwawe Elfy","Draenei","Krasnoludy","Gnomy","Ludzie","Nocne Elfy","Orkowie","Taureni","Trolle","Nieumarli","Worgeni","Gobliny"],ClassesPL:["Rycerz \u015amierci","Druid","\u0141owca","Mag","Kap\u0142an","\u0141otrzyk","Szaman","Warlock","Wojownik","Paladyn"],Map:function(b){var c=$("#map-regions > div, #map-regions > img");c.show().css("opacity",0);$("#map-map area").each(function(a){var d=c.eq(a);$(this).hover(function(){d.stop(!0,!1).delay(100).animate({opacity:1},
300)},function(){d.stop(!0,!1).animate({opacity:0},200)}).tooltip(b.Regions[a])});$("#map .zoomout").tooltip(b.Return);$("#map-items a").each(function(a){$(this).tooltip(b.Items[a])});$("#map-levels a").click(function(){$("#map-image").attr("src",$(this).data("image"));$("#map-levels a").removeClass("active");$(this).addClass("active");return!1});$("#map-levels a:first").addClass("active")}},Item={item:0,items:[],reqs:[],itemsToInit:[],Show:function(b,c){c?Tooltip.Show(Item.items[b]+c):Tooltip.Show(Item.items[b])},
Hide:function(){Tooltip.Hide()}},MyProfile={ShowTab:function(b){function c(a){var b=document.getElementById("my-"+a);b.style.display="none";b=document.getElementById("my-"+a+"-button");b.src=b.src.replace("-s.png",".png");b.src=b.src.replace("-s.jpg",".jpg");b.src=b.src.replace("-s.gif",".gif")}c("data");c("info");c("avatar");c("chars");var a=document.getElementById("my-"+b);a.style.display="block";a=document.getElementById("my-"+b+"-button");a.src=a.src.replace(".png","-s.png");a.src=a.src.replace(".jpg",
"-s.jpg");a.src=a.src.replace(".gif","-s.gif")},UpdateServers:function(){var b=document.getElementById("server").value;document.getElementById("server_en").style.display="none";document.getElementById("server_ge").style.display="none";document.getElementById("server_fr").style.display="none";document.getElementById("server_sp").style.display="none";document.getElementById("server_ru").style.display="none";document.getElementById("server_"+b).style.display="inline"}};
Tbc.InitializeVideoPlayer=function(b){var c=$("#player");c.attr("width");c.attr("height");var a=!0;$("#catlinks > a").click(function(){var a=$(this).index();$("#catlinks .selected").removeClass("selected");$("#cats > div").hide().eq(a).show();$(this).addClass("selected")});$(".video-box > a").click(function(){var b=$(this).parent().data();$("#description").text(b.desc);$("#title").text(b.title);$("#formTargetId").val(b.id);$("#cats .selected").removeClass("selected");$(this).parent(".video-box").addClass("selected");
$("#news-comments").html("");$.ajax({url:"/Wideoteka/Comments",data:{id:b.id},dataType:"text",success:function(a){a=a.replace(/class="info /g,'class="vid ');$("#news-comments").html(a)}});c.attr("src","http://www.youtube.com/embed/"+b.link+"?hd=1&autoplay="+(!a?"1":"0"));a=!1});var d=location.hash.replace(/^#/,""),e=$("#cats .video-box").filter(function(){return $(this).data("id")==d});e.length||(e=$("#cats .video-box").filter(function(){return $(this).data("id")==b}));if(e.length){var f=e.parents(".catdiv").index();
$("#catlinks > a").eq(f).click();e.find(".video-link").click()}else $($("#catlinks > a")[0]).click(),$("#cats > :first .video-link:first").click(),location.hash="";$("#turnoncaptions").imageTooltip("/Images/Video/turnoncaptions.jpg",{snap:!0,align:"bottom right",offset:{left:1,top:1,right:5,bottom:5}})};
$(function(){"placeholder"in document.createElement("input")||$("[placeholder]").focus(function(){$(this).val()===$(this).attr("placeholder")&&$(this).val("")}).blur(function(){$(this).val()===""&&$(this).val($(this).attr("placeholder"))}).blur()});$(function(){"autofocus"in document.createElement("input")||$("[autofocus]").focus()});
$(function(){$.fn.tooltip.defaults.className="newtip";$('a[href^="http://"]:not(.donotopenwindow),area[href^="http://"]').live("click",function(){if($(this).parents(".donotopenwindow").length==0)return window.open(this.href),!1});$(".facebook").live("click",function(){window.open(this.href,"sharer","toolbar=0,status=0,width=626,height=436").focus();return!1});$(".deletecommentlink > a").live("click",function(){if(confirm("Napewno chcesz usun\u0105\u0107 ten komentarz ?")){var a=$(this);$.get(this.href,{ajax:!0},function(){a.parents(".comment").remove()})}return!1});
$("#news-commenting form").submit(function(){var a=$('input[name="Target"]').val(),b=$('input[name="TargetId"]').val(),c=$('textarea[name="Text"]').val();/^\s*$/.test(c)||($.ajax({url:"/Comment/Create",data:{Target:a,TargetId:b,Text:c},dataType:"html",type:"POST",success:function(a){var b=/id="comment-(\d+)"/.exec(a)[1];$("#comment-"+b).length>0?$("#comment-"+b).replaceWith(a):$(a).appendTo("#news-comments").hide().slideDown()}}),$('textarea[name="Text"]').val(""),window.scroll(0,1E5));return!1});
$("#tracker-nav > a").mouseover(function () { $(this).text() == "Classes" ? $("#sub-nav1").show() : $("#sub-nav1").hide() }); $(".google-search").focus(function () { $(this).css("background-image", "none") }).blur(function () { $(this).val() == "" && $(this).css("background-image", "url(/Images/google.png)") }).blur(); $('#menu a[href*="Sklep"], .breadcrumbs a[href*="keye.pl"]').css("color", "#00CCDD"); $(".w3c a").each(function ()
{
	var a = $(this).find("img").attr("alt"), b = $(this).attr("title"), c = /^Valid/.test(a) ? "green" :
/^Blizz/.test(a)?"blue":"orange";$(this).removeAttr("title");$(this).tooltip('<span class="big '+c+'">'+a+"</span><br />"+b)});$(".rank-icon, .news-img, .faction-icon, .tip, abbr").titleTooltip();$(".char-info a:has(span)").each(function(){var a=$($(this).find("span")[0]).remove().html();$(this).tooltip(a)});$(".card").each(function(){var a=this.title;$(this).removeAttr("title");$(this).tooltip('<img src="'+("http://www.wowtcgdb.com/Images/medium/"+a+".jpg")+'" alt="" style="width: 220px; height: 308px;" />')});
$(".tip > img:first-child").each(function(){var a=this.alt.replace(/^(.+?:)/,'<span class="yellow">$1</span>');$(this).parent().tooltip(a);$(this).removeAttr("title")});$(".spoiler, .media").hide();$(".spoiler-header > a, .media-header > a").click(function(){var a=$(this);a.parent().parent().find("> .spoiler, > .media").slideToggle();a.parent().find("a").toggle();return!1});$(".dungeon-versions > a").click(function(){$("#wersje > div").hide();$($(this).attr("href")).show();$(".dungeon-versions > a").css("text-decoration",
"none");$(this).css("text-decoration","underline");return!1});$(".thumb").attr("rel","gallery").fancybox({titlePosition:"over",overlayColor:"#000"});$(".news").each(function(){$(this).find(".thumb").attr("rel","gallery"+parseInt(Math.random()*1E3))});$("#user-register").hover(function(){$("#user-register-img").css("background-position","0 -100%")},function(){$("#user-register-img").css("background-position","0 0")});$("#user-autologin-button").click(function(){var a=$("#user-autologin");a.val(a.val()==
"true"?"false":"true");$(this).css("background-position",a.val()=="true"?"0 -100%":"0 0")}).css("background-position",$("#user-autologin").val()=="true"?"0 -100%":"0 0");var b=$("#user-panel").data("currenttime"),c=$("#user-panel").data("lastvisit"),b='<div style="width:260px"><span class="big">Aktualny czas :</span><span class="rt">'+b+"</span>";c&&(b+='<br /><span class="big">Ostatnia wizyta :</span><span class="rt">'+c+"</span>");b+="</div>";$("#user-panel time").tooltip(b);$("#login-form").submit(function(){var a=
$("#user-login").val();if($("#user-password").val()==""||a=="")return!1});$(".vendor-rewards").change(function(){var a=this.parentNode.parentNode.getElementsByTagName("div").item(1).getElementsByTagName("div"),b=[],c;for(c=0;c<a.length;++c)a.item(c).className=="rewards"&&(b[b.length]=a.item(c));for(c in b)if(b.hasOwnProperty(c))b[c].style.display=c==this.value?"block":"none"});$(".vendor-table").click(function(){var a=$(this).index();this.parentNode.style.backgroundImage="url(/Images/Tables/top-"+
(a?"horde":"alliance")+".jpg)";var b=this.parentNode.getElementsByTagName("a"),c;for(c=0;c<b.length;c++)a==c?b.item(c).style.backgroundImage=b.item(c).style.backgroundImage.replace("e.jpg","e-hilit.jpg"):b.item(c).style.backgroundImage=b.item(c).style.backgroundImage.replace("-hilit","");var b=this.parentNode.getElementsByTagName("select").item(0),f=b.getElementsByTagName("option");for(c=0;c<f.length;c++)f.item(c).value=c+f.length*a;b.value=b.value%f.length+f.length*a;$(b).change();return!1});$("#patch-control > a").click(function(){$("#patch-content > div").hide();
$($("#patch-content > div")[$(this).index()]).show()});$("#patch-content > div").hide();$("#patch-content > div:first").show()});
$(function(){window.GraphicsDevice&&$(".webgl").each(function(){var b=$(this),c=b.data("scene");setTimeout(function(){Content.getBinary("/Models/"+c+".scene",function(a){try{var c=$("<canvas/>");c.attr({width:b.width()||100,height:b.height()||100,"class":b.attr("class"),style:b.attr("style")});var e=new GraphicsDevice(c[0]),f=new Content(e),g=new BinaryReader(a),h=new Scene(f,g);if(h.size)c.attr({width:h.size[0],height:h.size[1]}),h.camera.aspect=e.getAspect(),h.camera.apply();b.replaceWith(c);setInterval(function(){e.clear();
h.update(0.03);h.draw()},30);c.click(function(a){var b=c.offset();h.click(a.pageX-b.left,a.pageY-b.top)})}catch(k){}})},1);return b})});
