jQuery.fn.attrAppend=function(f,g){var d;return this.each(function(){d=$(this);d.attr(f)!==undefined&&d.attr(f)!=""&&d.attr(f,g+d.attr(f))})}; function SteamProfile(){function f(a){return o+"xmlproxy.php?id="+escape(a)+"&lang="+escape(t)}function g(a){return k.find('vars > var[name="'+a+'"]').text()}function d(a){if(a>=i.length)l=false;else{var b=$(i[a++]),h=b.data("profileID");if(p[h]==null)jQuery.ajax({type:"GET",url:f(h),dataType:"xml",complete:function(A){p[h]=u($(A.responseXML));b.empty().append(p[h]);d(a)}});else{var v=p[h].clone();w(v);b.empty().append(v);d(a)}}}function u(a){if(a.find("profile").length!==0){var b;if(a.find("profile > steamID").text()== "")return q(e[c].no_profile);else{b=j.clone();var h=a.find("profile > onlineState").text();b.find(".sp-badge").addClass("sp-"+h);b.find(".sp-avatar img").attr("src",a.find("profile > avatarIcon").text());b.find(".sp-info a").append(a.find("profile > steamID").text());a.find("profile > visibilityState").text()=="1"?b.find(".sp-info").append(e[c].private_profile):b.find(".sp-info").append(a.find("profile > stateMessage").text());if(x&&a.find("profile > inGameInfo > gameLogoSmall").length!==0)b.css("background-image", "url("+a.find("profile > inGameInfo > gameLogoSmall").text()+")");else{b.removeClass("sp-bg-game");b.find(".sp-bg-fade").removeClass("sp-bg-fade")}if(y){a.find("profile > inGameInfo > gameJoinLink").length!==0?b.find(".sp-joingame").attr("href",a.find("profile > inGameInfo > gameJoinLink").text()):b.find(".sp-joingame").remove();z?b.find(".sp-viewitems").attr("href","http://tf2items.com/profiles/"+a.find("profile > steamID64").text()):b.find(".sp-viewitems").remove();b.find(".sp-addfriend").attr("href", "steam://friends/add/"+a.find("profile > steamID64").text());b.find(".sp-avatar a, .sp-info a.sp-name").attr("href","http://steamcommunity.com/profiles/"+a.find("profile > steamID64").text());w(b)}else b.find(".sp-extra").remove()}return b}else return a.find("response").length!==0?q(a.find("response > error").text()):q(e[c].invalid_data)}function w(a){a.find(".sp-handle").click(function(){a.find(".sp-content").toggle(200)})}function q(a){var b=r.clone();b.append(a);return b}var o,m,x,y,z,i=[],p={}, l=false,s=false,k,j,n,r,t="english",c="english",e={english:{loading:"Loading\u00e2\u20ac\u00a6",no_profile:"This user has not yet set up their Steam Community profile.",private_profile:"This profile is private.",invalid_data:"Invalid profile data.",join_game:"Join Game",add_friend:"Add to Friends",view_tf2items:"View TF2 Backpack"},german:{loading:"Lade\u00e2\u20ac\u00a6",no_profile:"Dieser Benutzer hat bisher kein Steam Community Profil angelegt.",private_profile:"Dieses Profil is privat.",invalid_data:"Ung\u00c3\u00bcltige Profildaten.", join_game:"Spiel beitreten",add_friend:"Als Freund hinzuf\u00c3\u00bcgen",view_tf2items:"TF2 Rucksack ansehen"},portuguese:{loading:"Carregando\u00e2\u20ac\u00a6",no_profile:"This user has not yet set up their Steam Community profile.",private_profile:"This profile is private.",invalid_data:"Invalid profile data.",join_game:"Entrar",add_friend:"Adicionar \u00c3\u00a0 sua lista de amigos",view_tf2items:"Ver Itens do TF2"}};this.init=function(){var a=$("script[src$='steamprofile.js']");if(a.length!== 0){o=a.attr("src").replace("steamprofile.js","");jQuery.ajax({type:"GET",url:o+"steamprofile.xml",dataType:"html",complete:function(b){k=$(b.responseXML);y=g("slidermenu").toLowerCase()=="true";x=g("gamebanner").toLowerCase()=="true";z=g("tf2items").toLowerCase()=="true";c=t=g("language");if(e[c]==null)c="english";m=o+"themes/"+g("theme")+"/";$("head").append('<link rel="stylesheet" type="text/css" href="'+m+'style.css">');j=$(k.find("templates > profile").text());n=$(k.find("templates > loading").text()); r=$(k.find("templates > error").text());j.find("img").attrAppend("src",m);n.find("img").attrAppend("src",m);r.find("img").attrAppend("src",m);j.find(".sp-joingame").attr("title",e[c].join_game);j.find(".sp-addfriend").attr("title",e[c].add_friend);j.find(".sp-viewitems").attr("title",e[c].view_tf2items);n.append(e[c].loading);s=true;SteamProfile.refresh()}})}};this.refresh=function(){if(!(!s||l)){l=true;i=$(".steamprofile[title]");if(i.length!==0){i.each(function(){var a=$(this);a.data("profileID", $.trim(a.attr("title")));a.removeAttr("title")});i.empty().append(n);d(0)}}};this.load=function(a){if(!(!s||l)){profile=$('<div class="steamprofile"></div>');profile.append(n);jQuery.ajax({type:"GET",url:f(a),dataType:"xml",complete:function(b){profile.empty().append(u($(b.responseXML)))}});return profile}};this.isLocked=function(){return l}}$(document).ready(function(){SteamProfile=new SteamProfile;SteamProfile.init()});
