if(!jQuery.parseNumber)/* 
* Note:  Microsoft Corporation is not the original author of this script 
* file. Microsoft obtained the original file from 
* http://plugins.jquery.com/project/numberformatter under the license that is referred 
* to below. That license and the other notices below are provided for 
* informational purposes only and are not the license terms under which 
* Microsoft distributes the file.  Microsoft grants you the right to use the 
* file solely to interact through your browser with the Microsoft web site 
* hosting the file, subject to that web site�s terms of use. Unless 
* applicable law gives you more rights, Microsoft reserves all other rights 
* and grants no additional rights, whether by implication, estoppel or 
* otherwise. 
* 
* jquery.numberformatter - Formatting/Parsing Numbers in jQuery 
* Written by Michael Abernethy (mike@abernethysoft.com) 
* 
* Originally obtained under the MIT License. 
* 
* Date: 1/26/08 
* 
* @author Michael Abernethy 
* @version 1.1.0 
* 
* MIT License 
* 
* Permission is hereby granted, free of charge, to any person obtaining 
* a copy of this software and associated documentation files (the 
* "Software"), to deal in the Software without restriction, including 
* without limitation the rights to use, copy, modify, merge, publish, 
* distribute, sublicense, and/or sell copies of the Software, and to 
* permit persons to whom the Software is furnished to do so, subject to 
* the following conditions: 
* 
* The above copyright notice and this permission notice shall be 
* included in all copies or substantial portions of the Software. 
* 
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
**/
(function(a){function c(c,a,b){this.dec=c;this.group=a;this.neg=b}function b(a){var d=".",b=",",e="-";if(a=="us"||a=="ae"||a=="eg"||a=="il"||a=="jp"||a=="sk"||a=="th"||a=="cn"||a=="hk"||a=="tw"||a=="au"||a=="ca"||a=="gb"||a=="in"){d=".";b=","}else if(a=="de"||a=="vn"||a=="es"||a=="dk"||a=="at"||a=="gr"||a=="br"){d=",";b="."}else if(a=="cz"||a=="fr"||a=="fi"||a=="ru"||a=="se"){b=" ";d=","}else if(a=="ch"){b="'";d="."}return new c(d,b,e)}a.formatNumber=function(f,e){var e=a.extend({},a.fn.parse.defaults,e),d=b(e.locale.toLowerCase()),h=d.dec,i=d.group,g=d.neg,c=new String(f);c=c.replace(".",h).replace("-",g);return c};a.fn.parse=function(d){var d=a.extend({},a.fn.parse.defaults,d),c=b(d.locale.toLowerCase()),i=c.dec,e=c.group,h=c.neg,g="1234567890.-",f=[];this.each(function(){var b=new String(a(this).text());if(a(this).is(":input"))b=new String(a(this).val());while(b.indexOf(e)>-1)b=b.replace(e,"");b=b.replace(i,".").replace(h,"-");var j="",k=false;if(b.charAt(b.length-1)=="%")k=true;for(var d=0;d<b.length;d++)if(g.indexOf(b.charAt(d))>-1)j=j+b.charAt(d);var c=new Number(j);if(k){c=c/100;c=c.toFixed(j.length-1)}f.push(c)});return f};a.fn.format=function(c){var c=a.extend({},a.fn.format.defaults,c),e=b(c.locale.toLowerCase()),g=e.dec,d=e.group,f=e.neg,h="0#-,.";return this.each(function(){var o=new String(a(this).text());if(a(this).is(":input"))o=new String(a(this).val());for(var k="",u=false,b=0;b<c.format.length;b++)if(h.indexOf(c.format.charAt(b))==-1)k=k+c.format.charAt(b);else if(b==0&&c.format.charAt(b)=="-"){u=true;continue}else break;for(var m="",b=c.format.length-1;b>=0;b--)if(h.indexOf(c.format.charAt(b))==-1)m=c.format.charAt(b)+m;else break;c.format=c.format.substring(k.length);c.format=c.format.substring(0,c.format.length-m.length);while(o.indexOf(d)>-1)o=o.replace(d,"");var i=new Number(o.replace(g,".").replace(f,"-"));if(m=="%")i=i*100;var e="",x=i%1;if(c.format.indexOf(".")>-1){var q=g,n=c.format.substring(c.format.lastIndexOf(".")+1),j=new String(x.toFixed(n.length));j=j.substring(j.lastIndexOf(".")+1);for(var b=0;b<n.length;b++)if(n.charAt(b)=="#"&&j.charAt(b)!="0"){q+=j.charAt(b);continue}else if(n.charAt(b)=="#"&&j.charAt(b)=="0"){var w=j.substring(b);if(w.match("[1-9]")){q+=j.charAt(b);continue}else break}else if(n.charAt(b)=="0")q+=j.charAt(b);e+=q}else i=Math.round(i);var s=Math.floor(i);if(i<0)s=Math.ceil(i);var l="";if(s==0)l="0";else{var p="";if(c.format.indexOf(".")==-1)p=c.format;else p=c.format.substring(0,c.format.indexOf("."));var v=new String(Math.abs(s)),t=9999;if(p.lastIndexOf(",")!=-1)t=p.length-p.lastIndexOf(",")-1;for(var r=0,b=v.length-1;b>-1;b--){l=v.charAt(b)+l;r++;if(r==t&&b!=0){l=d+l;r=0}}}e=l+e;if(i<0&&u&&k.length>0)k=f+k;else if(i<0)e=f+e;if(!c.decimalSeparatorAlwaysShown)if(e.lastIndexOf(g)==e.length-1)e=e.substring(0,e.length-1);e=k+e+m;if(a(this).is(":input"))a(this).val(e);else a(this).text(e)})};a.fn.parse.defaults={locale:"us",decimalSeparatorAlwaysShown:false};a.fn.format.defaults={format:"#,###.00",locale:"us",decimalSeparatorAlwaysShown:false}})(jQuery);(function(n,x,a){var j,r,m,q,t,o,s,k,u,p,v,f,i,w,d,g,b,c,l=Array.prototype.slice,e=function(a,b){return function(){return a.apply(b,arguments)}},y=Object.prototype.hasOwnProperty,h=function(b,a){for(var c in a)if(y.call(a,c))b[c]=a[c];function d(){this.constructor=b}d.prototype=a.prototype;b.prototype=new d;b.__super__=a.prototype;return b};d=n.console;if(typeof d==="undefined"){g=function(){};d={log:g,warn:g,"assert":g,clear:g,dir:g,error:g,info:g,profile:g,profileEnd:g}}b={achievementsEarned:"Achievements Earned",avatar:"Avatar of ${DisplayName}",header:{},recentAchievements:"Recent Achievements",recognitionPoints:"Recognition Points",learnHow:"No Achievements Earned. <a>Learn How!</a>",learnHowLink:function(){var a;a='<a href="http://${$item.settings.brand}.microsoft.com/ff395928.aspx#How_do_I_earn_achievements" class="profile-usercard-profileLink" target="_blank">';return b.learnHow.replace("<a>",a)},leaderboardEmpty:"No leaderboard results available at this time.",viewProfile:"View Profile"};b.header["all time"]="all time";b.header.day="last day";b.header.days="last %d days";b.header.hour="last hour";b.header.hours="last %d hours";b.header.week="last week";b.header.weeks="last %d weeks";b.header["activities completed"]="activities completed";b.header["points earned"]="points earned";b.achievementsEarned="Achievements Earned";b.avatar="Avatar of ${DisplayName}";b.learnHow="No Achievements Earned. <a>Learn How!</a>";b.recentAchievements="Recent Achievements";b.recognitionPoints="Recognition Points";b.viewProfile="View Profile";b.header["all time"]="all time";b.header.day="last day";b.header.days="last %d days";b.header.hour="last hour";b.header.hours="last %d hours";b.header.week="last week";b.header.weeks="last %d weeks";b.header["activities completed"]="activities completed";b.header["points earned"]="points earned";b.leaderboardEmpty="No leaderboard results available at this time.";c={animationSpeed:100,brand:"msdn",host:n.location.host,lang:"en",largeImageDimension:110,leaderboardDataUri:"/v1/leaderboard/",scanDelay:250,search:"",statGroupDataUri:"/v1/statGroup/",userDataUri:"/v1/user/usercard/",userDataBatchSize:50,widgetImageUri:"/v1/resources/widget.png",hideDelay:250,showDelay:750};c.brand="msdn";c.lang="en-US";c.host="widgets.membership.microsoft.com:80";c.search="?brand=msdn&lang=en-US&_=1328960279600&ver=4.9.2161.17";f={resolve:function(a){return n.location.protocol+"//"+c.host+a},resolveStatic:function(a){return this.resolve(a)+c.search},createDataUri:function(){var a,b;a=arguments[0],b=2<=arguments.length?l.call(arguments,1):[];a=""+f.resolve(a)+(b!=null?b.sort().join(","):void 0);return a+("?lang="+c.lang+"&brand="+c.brand)},createQSDataUri:function(){var a,b;a=arguments[0],b=2<=arguments.length?l.call(arguments,1):[];a=""+f.resolve(a)+"?id="+(b!=null?b.sort().join(","):void 0);return a+("&lang="+c.lang+"&brand="+c.brand)},createStatGroupDataUri:function(d,b){var a;a=f.createDataUri(c.statGroupDataUri,d);return a+("&filterLocale="+b)},createUsercardDataUri:e(function(){var a;a=1<=arguments.length?l.call(arguments,0):[];return f.createQSDataUri(c.userDataUri,a)},this),createLeaderboardDataUri:e(function(){var a;a=1<=arguments.length?l.call(arguments,0):[];return f.createDataUri(c.leaderboardDataUri,a)},this),createWidgetImageUri:function(){return f.resolveStatic(c.widgetImageUri)}};m={scaleImage:function(f,e){var b,c,d;b=a(f);c={x:b.width(),y:b.height()};d=this.getXDimension(c,e);b.css("width",d);return b.css("display","inline-block")},getXDimension:function(a,b){var c,d;if(a.x<=b&&a.y<=b)return a.x;d=a.x>=a.y?a.x:a.y;c=b/d;return Math.floor(a.x*c)}};v={ellipsify:function(a,b){return a.length<=b?a:a.substr(0,b-3).concat("...")}};j=function(){function b(b,e,c,d,a){this.dataIdName=b;this.inline=e;this.selector=c;this.template=d;this.templateName=a;this.warn}b.prototype.canonicalizeId=function(a){return a.replace(/[^a-zA-Z0-9]/g,"").toLowerCase()};b.prototype.findIds=function(i){var e,b,c,f,d,h,g;b=[];g=a(this.selector,i);for(d=0,h=g.length;d<h;d++){f=g[d];e=a(f).attr(this.dataIdName);if(e){c=this.canonicalizeId(e);a(f).attr(this.dataIdName,c);a.inArray(c,b)===-1&&b.push(c)}else this.warn('Missing required attribute "'+this.dataIdName+'"')}return b};b.prototype.onDataLoaded=function(){return this.abstractWarn()};b.prototype.showAll=function(){return this.abstractWarn()};b.prototype.showWidget=function(){return this.abstractWarn()};b.prototype.abstractWarn=function(){return this.warn("You must implement this abstract class method.")};b.prototype.warn=function(a){return d.warn("Profile [BaseWidgetRegistration]: "+a)};return b}();i=function(){h(f,j);function f(c,f,d,e,b){this.dataIdName=c;this.inline=f;this.selector=d;this.template=e;this.templateName=b;this.foundIds=[];a.template(this.templateName,this.template)}f.prototype.onDataLoaded=function(c){var b;b=this;return a(""+this.selector+"[data-profile-usercard-customLink]").each(function(){var e,d;e=a(this).attr("data-profile-usercard-customLink");d=a(this).attr("data-profile-userid");return b.setCustomLink(c,d,e)})};f.prototype.setCustomLink=function(b,c,e){if(b&&b[c])try{b[c].customLink=a.parseJSON(e)}catch(f){d.warn("Profile [UsercardRegistration]: Invalid JSON in data-profile-usercard-customLink")}else d.warn("Profile [UsercardRegistration]: Failed to set custom link; user does not exist in data")};f.prototype.showAll=function(b){return a(this.selector).each(e(function(c,a){return this.showWidget(a,b)},this))};f.prototype.showWidget=function(i,h){var b,g,c,e,f;b=a(i);b.length===0&&d.warn("Profile [UsercardRegistration]: Widget not found in DOM");f=typeof b.attr("data-profile-rendered")!=="undefined";if(f)return;e=b.attr(this.dataIdName);if(e){c=h(this.dataIdName,e);if(c){c.Content=b.html();c.Rank=b.attr("data-profile-rank");c.UserId=e;this.inline&&b.html("");g=a(this.bindTemplate(c)).appendTo(b);return b.attr("data-profile-rendered","true")}else return d.warn("Profile [UsercardRegistration]: Usercard does not exist in data.")}else return d.warn('Profile [UsercardRegistration]: Expected id in attribute "'+this.dataIdName+'".')};f.prototype.bindTemplate=function(d){var b;b={settings:c,ellipsify:v.ellipsify,useDataUri:c.supportsDataUri};return a.tmpl(this.templateName,d,b)};f.prototype.warn=function(a){return d.warn("Profile [UsercardRegistration]: "+a)};f.prototype.usercardTemplate='<div class="profile-usercard">            <div class="profile-header">                <span class="profile-userimage">                    {{if $item.useDataUri }}                        <img src="data:image/jpg;base64,${AvatarData}" alt="'+b.avatar+'">                    {{else}}                        <img src="${Avatar}" alt="'+b.avatar+'">                    {{/if}}                </span>                <div>                    <p title="${DisplayName}" class="profile-display-name">${$item.ellipsify(DisplayName, 32)}</p>                {{if Company}}                    <p class="profile-company">${$item.ellipsify(Company, 27)}</p>                {{/if}}                    <p class="profile-affiliations">${Affiliations}</p>                </div>                <span class="profile-points"><span class="profile-points-img"></span>${Points}</span>            </div>            <div class="profile-achievements-header">                <span class="profile-achievements-title">'+b.recentAchievements+'</span>                <span class="profile-count profile-bronze-points"><span class="profile-bronze-img"></span><span>${Achievements.Bronze}</span></span>                <span class="profile-count profile-silver-points"><span class="profile-silver-img"></span><span>${Achievements.Silver}</span></span>                <span class="profile-count profile-gold-points"><span class="profile-gold-img"></span><span>${Achievements.Gold}</span></span>            </div>            <div class="profile-achievements-recent">                <div class="profile-achievements-centering">                    {{if Achievements.Recent && Achievements.Recent.length > 0}}                        {{each Achievements.Recent}}                    <span class="profile-achievement profile-achievement-${Medal}"><span>${Title}</span></span>                        {{/each}}                    {{else}}                        <div class="profile-achievement-none">'+b.learnHowLink()+'</div>                    {{/if}}                </div>            </div>            <div class="profile-footer">                {{if customLink}}                    <a href="${customLink.href}" title="${customLink.text}" class="profile-usercard-custom-link" target="_blank">${customLink.text}</a>                {{/if}}                <a href="${Profile}?ws=usercard-hover" class="profile-usercard-profileLink" target="_blank">'+b.viewProfile+"</a>            </div>        </div>";return f}();r=function(){h(b,i);function b(){b.__super__.constructor.call(this,"data-profile-userid",false,".profile-usercard-hover",this.usercardTemplate,"usercardTemplate");this.canHide=false;a(this.selector).live("mouseenter",e(function(a){return this.onMouseEnter(a)},this));a(this.selector).live("mouseleave",e(function(a){return this.onMouseLeave(a)},this))}b.prototype.onMouseEnter=function(g){var b,f,d;d=g.currentTarget;b=a(d);b.data("canHide","no");f=e(function(){if(b.data("canHide")==="yes")return;!b.data("data-profile-rendered")&&this.showWidget(d,this.getData);a(".profile-usercard",d).fadeIn(c.animationSpeed);return this.canHide=false},this);return setTimeout(f,c.showDelay)};b.prototype.onMouseLeave=function(b){var d;a(b.currentTarget).data("canHide","yes");this.canHide=true;d=e(function(){if(a(b.currentTarget).data("canHide")==="yes")return a(".profile-usercard",b.currentTarget).fadeOut(c.animationSpeed)},this);return setTimeout(d,c.hideDelay)};return b}();q=function(){h(d,i);function d(){d.__super__.constructor.call(this,"data-profile-userid",true,".profile-usercard-inline",this.inlineTemplate,"inlineTemplate")}d.prototype.showWidget=function(b,e){d.__super__.showWidget.call(this,b,e);return a(b).find(".profile-userimage-large > img").bind("load",function(a){return m.scaleImage(a.currentTarget,c.largeImageDimension)}).each(function(){if(this.complete)return m.scaleImage(this,c.largeImageDimension)})};d.prototype.inlineTemplate='<div class="profile-usercard profile-inline">            <div class="profile-inline-header">                <span class="profile-userimage-large">                    <img src="${LargeAvatar}" alt="'+b.avatar+'" />                </span>                <div class="profile-inline-header-details">                    <div title="${DisplayName}" class="profile-inline-display-name">${$item.ellipsify(DisplayName, 32)}</div>            {{if Company}}            <div class="profile-company profile-inline-secondary">${Company}</div>            {{/if}}                    <div class="profile-affiliations profile-inline-secondary">${Affiliations}</div>                    {{if Website}}            <div class="profile-inline-url profile-inline-secondary"><a title="${Website}" href="${Website}" target="_blank">${$item.ellipsify(Website.replace("http://", "").replace("https://", ""), 22)}</a></div>            {{/if}}                </div>            </div>            <div class="profile-statline">                <span class="profile-statline-title">'+b.recognitionPoints+'</span>                <span class="profile-points-inline"><span class="profile-statline-points-img"></span>${Points}</span>            </div>            <div class="profile-statline">                <span class="profile-statline-title">'+b.achievementsEarned+'</span>                <span class="profile-count profile-bronze-points"><span class="profile-bronze-img"></span><span>${Achievements.Bronze}</span></span>                <span class="profile-count profile-silver-points"><span class="profile-silver-img"></span><span>${Achievements.Silver}</span></span>                <span class="profile-count profile-gold-points"><span class="profile-gold-img"></span><span>${Achievements.Gold}</span></span>            </div>            {{if Biography}}            <div class="profile-biography">${Biography}</div>            {{/if}}            <div class="profile-footer">                {{if customLink}}                <a href="${customLink.href}" title="${customLink.text}" target="_blank" class="profile-usercard-custom-link">${customLink.text}</a>                {{/if}}                <a href="${Profile}?ws=usercard-inline" class="profile-usercard-profileLink" target="_blank">'+b.viewProfile+"</a>            </div>        </div>";return d}();o=function(){h(d,i);function d(){d.__super__.constructor.call(this,"data-profile-userid",false,".profile-leaderboard-item",this.leaderboardTemplate,"leaderboardTemplate")}d.prototype.showWidget=function(e,f){var b;d.__super__.showWidget.call(this,e,f);b=a(e);b.find("div").length>0&&b.show();b.find(".profile-leaderboard-value").format({format:"+#,###",locale:c.lang});return b.show()};d.prototype.leaderboardTemplate='<div class="profile-leaderboard-container">            <div class="profile-leaderboard-rank">${Rank}</div>            <div class="profile-leaderboard-userimage">            {{if $item.useDataUri }}                <img src="data:image/jpg;base64,${AvatarData}" alt="'+b.avatar+'">            {{else}}                <img src="${Avatar}" alt="'+b.avatar+'">            {{/if}}            </div>            <div class="profile-leaderboard-name profile-usercard-hover" data-profile-userid="${UserId}">                <a href="${Profile}?ws=leaderboard" target="_blank" data-profile-userid="${UserId}">${DisplayName}</a>            </div>            <div class="profile-ie7-envelope"><div class="profile-leaderboard-value">+${Content}</div></div>        </div>';return d}();s=function(){h(c,i);function c(){c.__super__.constructor.call(this,"data-profile-userid",false,".profile-usercard-mini",this.miniTemplate,"miniTemplate")}c.prototype.showWidget=function(d,f){var b,e;if(!a(".profile-mini",d).length){b=a(d);e=b.html();b.html("");c.__super__.showWidget.call(this,d,f);return b.find(".profile-mini-content").html(e)}};c.prototype.miniTemplate='<div class="profile-mini">            <div class="profile-mini-header">            <div class="profile-mini-userimage">            {{if $item.useDataUri }}                <img src="data:image/jpg;base64,${AvatarData}" alt="'+b.avatar+'">            {{else}}                <img src="${Avatar}" alt="'+b.avatar+'">            {{/if}}            </div>            <div class="profile-mini-container">                <div title="${DisplayName}" class="profile-mini-display-name"><div class="profile-usercard-hover" data-profile-userid="${UserId}"><a href="${Profile}?ws=usercard-mini" target="_blank">${DisplayName}</a></div></div>            {{if Company}}                <div class="profile-mini-company">${$item.ellipsify(Company, 27)}</div>            {{/if}}                <div class="profile-mini-affiliations">                {{if Affiliations}}                    (${Affiliations})                {{/if}}                </div>                <span class="profile-mini-points"><span class="profile-mini-points-img"></span>${Points}</span>                </div>                <div class="profile-mini-content">                </div>            </div>        </div>';return c}();t=function(){h(c,j);function c(){this.dataIdName="data-profile-leaderboard-key";this.selector=".profile-leaderboard";this.foundIds=[];this.headerName="leaderboardHeaderTemplate";this.itemName="leaderboardItemTemplate";this.emptyName="leaderboardEmptyTemplate";a.template(this.headerName,this.leaderboardHeaderTemplate);a.template(this.itemName,this.leaderboardItemTemplate);a.template(this.emptyName,this.leaderboardEmptyTemplate)}c.prototype.showAll=function(b){return a(this.selector).each(e(function(c,a){return this.showWidget(a,b)},this))};c.prototype.showWidget=function(g,o){var d,h,f,i,m,l,c,j,k,e,n;d=a(g);if(d.attr("data-profile-leaderboard-loaded")){d.profileWidgitize();return}d.attr("data-profile-leaderboard-loaded",true);l=d.attr("data-profile-leaderboard-key");if(l){f=o(this.dataIdName,l);if(f!=null){c=eval(f.Items);if((c!=null?c.length:void 0)>0){m=this.localizeHeader(f.Header);a.tmpl(this.headerName,m).appendTo(g);k=1;j=c[0].RankingColumn;for(e=0,n=c.length;e<n;e++){i=c[e];h=i.RankingColumn;if(h!==j)k=e+1;j=h;i.Rank=k}a.tmpl(this.itemName,c).appendTo(g);d.profileWidgitize();return}}return a.tmpl(this.emptyName,b.leaderboardEmpty).appendTo(g)}else return this.warn('Expected key in attribute "'+this.dataIdName+'"')};c.prototype.localizeHeader=function(a){var e,c,d,g,f;try{e=a.match(/points earned|activities completed/)[0];d=a.match(/weeks|week|days|day|hours|hour|all time/)[0];c=(f=a.match(/\d+/))!=null?f[0]:void 0;g=b.header[e]+" - "+b.header[d].replace(/%d/,c)}catch(h){leaderboard.warn("failed to load leaderboard header")}return g};c.prototype.onDataLoaded=function(){};c.prototype.leaderboardEmptyTemplate='<div class="profile-leaderboard-empty">${}</div>';c.prototype.leaderboardHeaderTemplate='<div class="profile-leaderboard-header">${}</div>';c.prototype.leaderboardItemTemplate='<div class="profile-leaderboard-item" data-profile-userid="${UserId}" data-profile-rank="${Rank}" style="display: none;">${RankingColumn}</div>';c.prototype.warn=function(a){return d.warn("Profile [Leaderboard]: "+a)};return c}();p=function(){h(b,j);function b(){this.dataIdName="data-profile-statGroupId";this.selector=".profile-statGroup";this.foundIds=[];this.statGroupTemplateName="statGroupTemplate";a.template(this.statGroupTemplateName,this.statGroupTemplate)}b.prototype.canonicalizeId=function(a){return a.replace(/[^a-zA-Z0-9_\-;]/g,"")};b.prototype.findIds=function(j){var b,c,f,d,e,k,g,i,h;c=[];h=a(this.selector,j);for(g=0,i=h.length;g<i;g++){d=h[g];e=k=void 0;e=a(d).attr("data-profile-statGroup-key");b=a(d).attr("data-profile-filterLocale");if(!(b!=null))b="";if(e!=null){f=this.canonicalizeId(e+";"+b);a(d).attr(this.dataIdName,f);a.inArray(f,c)===-1&&c.push(f)}else this.warn('Missing required attribute(s) "data-profile-statGroup-key"')}return c};b.prototype.showAll=function(b){return a(this.selector).each(e(function(c,a){return this.showWidget(a,b)},this))};b.prototype.showWidget=function(i,h){var b,e,f,g;b=a(i);b.length===0&&d.warn("Profile [StatGroupWidgetRegistration]: Widget not found in DOM");g=typeof b.attr("data-profile-rendered")!=="undefined";if(g)return;f=b.attr(this.dataIdName);if(f!=null){e=h(this.dataIdName,f);if(e){a.tmpl(this.statGroupTemplate,e).appendTo(b);b.attr("data-profile-rendered","true");return b.find(".value").format({format:"#,###",locale:c.lang})}else return d.warn("Profile [StatGroupWidgetRegistration]: Item does not exist in data.")}else return d.warn('Profile [StatGroupWidgetRegistration]: Expected id in attribute "'+this.dataIdName+'".')};b.prototype.onDataLoaded=function(){};b.prototype.statGroupTemplate='<div class="statistic-group">            <div class="statistic-header">${Header}</div>            <table class="statistic-table">                <tbody>                    {{each Statistics}}                    <tr>                        <td class="name">${$value.Name}</td>                        <td class="value"><span>${$value.Value}</span></td>                    </tr>                    {{/each}}                </tbody>            </table>        </div>';return b}();k=function(){function b(i,j,h,f){var d,b,g,c;this.registeredWidgets=i;this.createDataUri=j;this.jsonpCallbackName=h;this.batch=f!=null?f:false;this.getData=e(this.getData,this);this.loadDataError=e(this.loadDataError,this);this.loadDataSuccess=e(this.loadDataSuccess,this);this.scannedIds=[];a(x).ajaxComplete(e(function(){return this.scanWhenAble()},this));c=this.registeredWidgets;for(b=0,g=c.length;b<g;b++){d=c[b];d.getData=e(function(a,b){return this.getData(a,b)},this)}}b.prototype.scan=function(n){var b,c,d,j,h,e,f,g,m,k,l,i;b=[];i=this.registeredWidgets;for(e=0,m=i.length;e<m;e++){j=i[e];h=j.findIds(n);for(f=0,k=h.length;f<k;f++){c=h[f];a.inArray(c,b)===-1&&b.push(c)}}d=[];if(this.scannedIds)for(g=0,l=b.length;g<l;g++){c=b[g];if(a.inArray(c,this.scannedIds)===-1){d.push(c);this.scannedIds.push(c)}}else{d=b;this.scannedIds=b}return d.length?this.loadData(d):this.showItems()};b.prototype.scanWhenAble=function(){var a;if(!this.pending){a=e(function(){this.scan();return this.pending=false},this);setTimeout(a,c.scanDelay)}return this.pending=true};b.prototype.showItems=function(){var d,a,e,c,b;c=this.registeredWidgets;b=[];for(a=0,e=c.length;a<e;a++){d=c[a];b.push(d.showAll(this.getData))}return b};b.prototype.loadData=function(a){var b;if(!this.batch)return this.loadDataAjax(a);b=c.userDataBatchSize;this.currentBatch=this.currentBatch>=0?this.currentBatch+1:0;if(a.length<=b)return this.loadDataAjax(a,this.currentBatch);else{this.batch=a.slice(0,b);this.loadDataAjax(this.batch,this.currentBatch);a=a.slice(b,a.length);return this.loadData(a)}};b.prototype.loadDataAjax=function(c,b){return a.ajax({url:this.createDataUri(c),dataType:"jsonp",cache:true,jsonpCallback:this.jsonpCallbackName+(b!=null?b:""),success:this.loadDataSuccess,error:this.loadDataError})};b.prototype.loadDataSuccess=function(f){var d,b,e,c;this.data=a.extend(true,this.data,f);c=this.registeredWidgets;for(b=0,e=c.length;b<e;b++){d=c[b];d.onDataLoaded(this.data)}return this.showItems()};b.prototype.loadDataError=function(a){return this.warn("Ajax request error: #status, "+a.status+": "+a.statusText)};b.prototype.getData=function(d,c){var a,b;!this.data&&this.warn("Unable to load data");a=(b=this.data)!=null?b[c]:void 0;if(a)a[d]=c;return a};b.prototype.warn=function(a){return d.warn("Profile [Scanner]: "+a)};return b}();u=function(){h(b,k);function b(){b.__super__.constructor.apply(this,arguments)}b.prototype.loadData=function(d){var e,a,c,b;b=[];for(a=0,c=d.length;a<c;a++){e=d[a];b.push(this.loadDataAjax(e))}return b};b.prototype.loadDataAjax=function(c){var b;b=c.split(";");return a.ajax({url:this.createDataUri(b[0],b[1]),dataType:"jsonp",cache:true,jsonpCallback:this.jsonpCallbackName,success:this.loadDataSuccess,error:this.loadDataError})};return b}();w=function(){function b(){var g,b,d,c,e;this.detectFeatures();d=[new q,new o,new s,new r];this.usercardScanner=new k(d,f.createUsercardDataUri,"jsonp_loadUserData",true);b=[new t];this.leaderboardScanner=new k(b,f.createLeaderboardDataUri,"jsonp_loadLeaderboardData",false);c=[new p];this.statGroupScanner=new u(c,f.createStatGroupDataUri,"jsonp_loadStatGroupData",false);e=this.usercardScanner;a.fn.profileWidgitize=function(){e.scanWhenAble(this);return this};this.usercardScanner.scan();this.leaderboardScanner.scan();this.statGroupScanner.scan();g=new Image;g.src=f.createWidgetImageUri()}b.prototype.detectFeatures=function(){var a;a=new Image;a.onload=a.onabort=a.onerror=function(){return c.supportsDataUri=this.width===1&&this.height===1};return a.src="data:image/gif;base64,R0lGODlhAQABAIABAP8AAP///yH5BAEAAAEALAAAAAABAAEAAAICRAEAOw%3D%3D"};return b}();a(x).ready(function(){return new w})})(this,document,jQuery)