if(typeof k=="undefined")var k=function(){this.C.apply(this,arguments)},l,m,n,o,p,q,s;function t(){var c=new k;return c.i.apply(c,arguments)}
(function(){l||(l={});var c=k.prototype={};c.C=function(a){this.f=a||{I:true,J:{},q:null,r:false,K:null,L:null,M:false,N:{},O:[""],P:false,Q:null,R:{},S:[],T:[],U:null,V:false,s:null,W:null,X:{},Y:[]}};c.i=function(a,b,d){var e=this.f.q||new m;e.f=this.f;e.h=this.f.s||new n;e.h.u=this.f;e.j=new o;e.j.f=this.f;e.v=new p;e.v.f=this.f;var f;function g(h){try{f=e.i(a,h)}catch(j){if(!String(j).match(/Jemplate\.STOP\n/))throw j;f=j.toString().replace(/Jemplate\.STOP\n/,"")}if(typeof d=="undefined")return f;
if(typeof d=="function"){d(f);return null}if(typeof d=="string"||d instanceof String){if(d.match(/^#[\w\-]+$/)){h=d.replace(/^#/,"");var r=document.getElementById(h);if(typeof r=="undefined")throw'No element found with id="'+h+'"';r.innerHTML=f;return null}}else{d.innerHTML=f;return null}throw"Invalid arguments in call to Jemplate.process";}if(typeof b=="function")b=b();else if(typeof b=="string"){q.H(b,function(h){g(h)});return null}return g(b)};if(typeof m=="undefined")m=function(){};c=m.prototype;
c.ia=function(a,b){return this.i(a,b,true)};c.i=function(a,b,d){d?this.h.w(b):this.h.update(b);b=l[a];if(typeof b=="undefined")throw'No Jemplate template named "'+a+'" available';a=b(this);d&&this.h.A();return a};c.p=function(a,b){this.Z=[a,b];return a};c.pa=function(a,b){if(typeof a=="undefined")throw"Unknown plugin name ':"+a+"'";return new window[a](this,b)};c.filter=function(a,b,d){if(b=="null")b="null_filter";if(typeof this.j.a[b]=="function")return this.j.a[b](a,d,this);else throw"Unknown filter name ':"+
b+"'";};if(typeof p=="undefined")p=function(){};c=p.prototype;c.plugins={};if(typeof o=="undefined")o=function(){};c=o.prototype;c.a={};c.a.oa=function(){return""};c.a.va=function(a){return a.toUpperCase()};c.a.ma=function(a){return a.toLowerCase()};c.a.ta=function(a){var b=a.charAt(0);a=a.substr(1);return b.toUpperCase()+a};c.a.la=function(a){var b=a.charAt(0);a=a.substr(1);return b.toLowerCase()+a};c.a.ra=function(a){return a.replace(/^\s+/g,"").replace(/\s+$/g,"")};c.a.collapse=function(a){return a.replace(/^\s+/g,
"").replace(/\s+$/g,"").replace(/\s+/," ")};c.a.ea=function(a){a=a.replace(/&/g,"&amp;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");return a=a.replace(/"/g,"&quot;")};c.a.ha=function(a){return"<p>\n"+a.split(/(?:\r?\n){2,}/).join("\n</p>\n\n<p>\n")+"</p>\n"};c.a.fa=function(a){return a.replace(/(\r?\n){2,}/g,"$1<br />$1<br />$1")};c.a.ga=function(a){return a.replace(/(\r?\n)/g,"$1<br />$1")};c.a.uri=function(a){return encodeURIComponent(a)};c.a.url=function(a){return encodeURI(a)};c.a.ja=function(a,
b){b=b[0];if(!a)return null;if(typeof b=="undefined")b=4;var d="";if(typeof b=="number"||String(b).match(/^\d$/))for(var e=0;e<b;e++)d+=" ";else d=b;return a.replace(/^/gm,d)};c.a.sa=function(a,b){b=b[0];if(!a)return null;b||(b=32);if(a.length<b)return a;return a.substr(0,b-3)+"..."};c.a.repeat=function(a,b){if(!a)return null;if(!b||b==0)b=1;if(b==1)return a;for(var d=a,e=1;e<b;e++)d+=a;return d};c.a.replace=function(a,b){if(!a)return null;var d=b[0];b=b[1];d||(d="");b||(b="");return a.replace(new RegExp(d,
"g"),b)};if(typeof n=="undefined")n=function(){this.data={}};c=n.prototype;c.w=function(a){var b=this.data;this.data={};this.update(b);this.update(a);this.data.t=b};c.A=function(){this.data=this.data.t||this.data};c.update=function(a){if(typeof a!="undefined")for(var b in a)this.k(b,a[b])};c.e=function(a){var b=this.data;if(a instanceof Array)for(var d=0;d<a.length;d+=2){var e=a.slice(d,d+2);e.unshift(b);value=this.l.apply(this,e);if(typeof value=="undefined")break;b=value}else value=this.l(b,a);
if(typeof value=="undefined"){if(this.u.r)throw"undefined value found while using DEGUG_UNDEF";value=""}return value};c.k=function(a,b,d){if(a instanceof Array){var e=this.e(a[0])||{};a=a[2]}else e=this.data;d&&typeof e[a]!="undefined"||(e[a]=b)};c.l=function(a,b,d){if(!(typeof b=="undefined"||typeof b=="string"&&b.match(/^[\._]/))){if(!d&&typeof a=="object"&&(!(a instanceof Array)||typeof b=="number")&&typeof a[b]!="undefined"){b=a[b];if(typeof b=="function")b=b.apply(a);return b}if(typeof a=="string"&&
this.d[b])return this.d[b](a,d);if(a instanceof Array&&this.b[b])return this.b[b](a,d);if(typeof a=="object"&&this.c[b])return this.c[b](a,d);if(typeof a[b]=="function")return a[b].apply(a,d)}};c.d={};c.d.$=function(a,b){b=b[0];var d=[];b||(b=1);if(b<0){b=0-b;for(i=a.length-b;i>=0;i-=b)d.unshift(a.substr(i,b));a.length%b&&d.unshift(a.substr(0,a.length%b))}else for(i=0;i<a.length;i+=b)d.push(a.substr(i,b));return d};c.d.aa=function(){return 1};c.d.hash=function(a){return{value:a}};c.d.length=function(a){return a.length};
c.d.D=function(a){return[a]};c.d.match=function(a,b){return a.match(new RegExp(b[0],"gm"))};c.d.repeat=function(a,b){b=b[0]||1;for(var d="",e=0;e<b;e++)d+=a;return d};c.d.replace=function(a,b){var d=new RegExp(b[0],"gm");(b=b[1])||(b="");return a.replace(d,b)};c.d.search=function(a,b){return a.search(new RegExp(b[0]))>=0?1:0};c.d.size=function(){return 1};c.d.split=function(a,b){return a.split(new RegExp(b[0]))};c.b={};c.b.join=function(a,b){return a.join(b[0])};c.b.sort=function(a,b){if(typeof b!=
"undefined"&&b!="")return a.sort(function(d,e){return d[b]==e[b]?0:d[b]>e[b]?1:-1});return a.sort()};c.b.F=function(a){return a.sort(function(b,d){return b-d})};c.b.da=function(a,b){b=new RegExp(b[0]);for(var d=[],e=0;e<a.length;e++)a[e].match(b)&&d.push(a[e]);return d};c.b.ua=function(a){for(var b=[],d={},e=0;e<a.length;e++){var f=a[e];d[f]||b.push(f);d[f]=true}return b};c.b.reverse=function(a){for(var b=[],d=a.length-1;d>=0;d--)b.push(a[d]);return b};c.b.na=function(a,b){var d=[];function e(f){if(f instanceof
Array)for(var g=0;g<f.length;g++)d.push(f[g]);else d.push(f)}e(a);for(a=0;a<b.length;a++)e(b[a]);return d};c.b.slice=function(a,b){return a.slice(b[0],b[1])};c.b.splice=function(a,b){if(b.length==1)return a.splice(b[0]);if(b.length==2)return a.splice(b[0],b[1]);if(b.length==3)return a.splice(b[0],b[1],b[2]);return null};c.b.push=function(a,b){a.push(b[0]);return a};c.b.pop=function(a){return a.pop()};c.b.unshift=function(a,b){a.unshift(b[0]);return a};c.b.shift=function(a){return a.shift()};c.b.m=
function(a){return a[0]};c.b.size=function(a){return a.length};c.b.max=function(a){return a.length-1};c.b.o=function(a){return a.slice(-1)};c.c={};c.c.ba=function(a){var b=[];for(var d in a)b.push(d,a[d]);return b};c.c.ca=function(a,b){return typeof a[b[0]]=="undefined"?0:1};c.c.ka=function(a){var b=[];for(var d in a)b.push(d);return b};c.c.D=function(a,b){var d="";if(b)d=b[0];b=[];var e;if(d=="keys")for(e in a)b.push(e);else if(d=="values")for(e in a)b.push(a[e]);else if(d=="each")for(e in a)b.push(e,
a[e]);else for(e in a)b.push({key:e,value:a[e]});return b};c.c.F=function(a){var b=[];for(var d in a)b.push(d);return b.sort(function(e,f){return e-f})};c.c.size=function(a){var b=0;for(var d in a)b++;return b};c.c.sort=function(a){var b=[];for(var d in a)b.push(d);return b.sort()};c.c.wa=function(a){var b=[];for(var d in a)b.push(a[d]);return b};c.c.remove=function(a,b){return delete a[b[0]]};c.c["delete"]=c.c.remove;if(typeof s=="undefined")s=function(a){if(a instanceof Array){this.object=a;this.size=
a.length;this.max=this.size-1}else if(a instanceof Object){this.object=a;var b=[];for(var d in a)b[b.length]=d;this.g=b.sort();this.size=b.length;this.max=this.size-1}};c=s.prototype;c.B=function(){this.index=0;this.m=1;this.o=0;this.z=1;return this.n(1)};c.n=function(a){var b=this.object;if(typeof a!="undefined"&&a)a=this.index;else{a=++this.index;this.m=0;this.z=this.index+1;if(this.index==this.size-1)this.o=1}if(typeof b=="undefined")throw"No object to iterate";if(this.g){if(a<this.g.length){this.G=
a>0?this.g[a-1]:"";this.next=a<this.max?this.g[a+1]:"";return[this.g[a],false]}}else if(a<b.length){this.G=a>0?b[a-1]:"";this.next=a<this.max?b[a+1]:"";return[b[a],false]}return[null,true]};q={e:function(){throw"This is a Jemplate.Ajax.get stub that doesn't do anything. Try including the jQuery, YUI, or XHR option when building the runtime";},H:function(){throw"This is a Jemplate.Ajax.processGet stub that doesn't do anything. Try including the jQuery, YUI, or XHR option when building the runtime";
},qa:function(){throw"This is a Jemplate.Ajax.post stub that doesn't do anything. Try including the jQuery, YUI, or XHR option when building the runtime";}}})();if(typeof k=="undefined")throw"Jemplate.js must be loaded before any Jemplate template files";
l["ebay-sales.html"]=function(c){if(!c)throw"Jemplate function called without context\n";var a=c.h,b="";try{if(a.e("sales")&&a.e(["sales",0,"size",0])){b+='<table class="striped wide">\n    <thead>\n        <tr>\n            <th>Sale Date</th>\n            <th>Amount</th>\n            <th>Item ID</th>\n        </tr>\n    </thead>\n    <tbody>';(function(){var e=a.e("sales");e=new s(e);var f=e.B(),g=f[0],h=f[1],j;j=a.e("loop");a.k("loop",e);try{for(;!h;){a.data.sale=g;b+="<tr";b+=a.e(["loop",0,"index",
0])%2?' class="odd"':"";b+='>\n            <td class="date">';b+=a.e(["sale",0,"date",0]);b+='</td>\n            <td class="numeric">$';b+=a.e(["sale",0,"amount",0]);b+='</td>\n            <td class="item_id">\n                <a href="http://rover.ebay.com/rover/1/711-53200-19255-0/1?type=3&campid=5336510469&toolid=10001&customid=closedauctions&mpre=http%3A%2F%2Fshop.ebay.com%2F';b+=a.e(["sale",0,"item_id",0]);b+='" onClick="javascript:urchinTracker(\'/ads/ebay/completed-auctions\');">';b+=a.e(["sale",
0,"item_id",0]);b+="</a>\n            </td>\n        </tr>";f=e.n();g=f[0];h=f[1]}}catch(r){throw c.p(r,b);}a.k("loop",j)})();b+="</tbody>\n</table>"}else b+="<p>No eBay sales data in the last 90 days.</p>"}catch(d){throw c.p(d,b);}return b};if(typeof u=="undefined")var u={};$(function(){if(window.location.pathname.match("^/game/")){$("#eBay_sales").dialog({autoOpen:false,resizable:false,draggable:true,closeOnEscape:true});$("#eBay_sales_link").click(function(){var c=$("#eBay_sales");c.dialog("open");if(c.attr("loaded"))return false;var a=$("#product_id").text();$.getJSON("/game/sales-sample/"+a+".json",function(b){t("ebay-sales.html",b,"#eBay_sales")});c.attr("loaded","true");urchinTracker("/link/game/completed-auctions");return false})}});
