if(typeof Jemplate=="undefined")var Jemplate=function(){this.init.apply(this,arguments)};Jemplate.VERSION="0.22";Jemplate.process=function(){var c=new Jemplate;return c.process.apply(c,arguments)};
(function(){if(!Jemplate.templateMap)Jemplate.templateMap={};var c=Jemplate.prototype={};c.init=function(a){this.config=a||{AUTO_RESET:true,BLOCKS:{},CONTEXT:null,DEBUG_UNDEF:false,DEFAULT:null,ERROR:null,EVAL_JAVASCRIPT:false,FILTERS:{},INCLUDE_PATH:[""],INTERPOLATE:false,OUTPUT:null,PLUGINS:{},POST_PROCESS:[],PRE_PROCESS:[],PROCESS:null,RECURSION:false,STASH:null,TOLERANT:null,VARIABLES:{},WRAPPER:[]}};c.process=function(a,b,d){var e=this.config.CONTEXT||new Jemplate.Context;e.config=this.config;
e.stash=this.config.STASH||new Jemplate.Stash;e.stash.__config__=this.config;e.__filter__=new Jemplate.Filter;e.__filter__.config=this.config;e.__plugin__=new Jemplate.Plugin;e.__plugin__.config=this.config;var f,g=function(j){try{f=e.process(a,j)}catch(B){if(!String(B).match(/Jemplate\.STOP\n/))throw B;f=B.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\-]+$/)){j=d.replace(/^#/,
"");var C=document.getElementById(j);if(typeof C=="undefined")throw'No element found with id="'+j+'"';C.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"){Jemplate.Ajax.processGet(b,function(j){g(j)});return null}return g(b)};if(typeof Jemplate.Context=="undefined")Jemplate.Context=function(){};c=Jemplate.Context.prototype;c.include=function(a,b){return this.process(a,b,true)};c.process=
function(a,b,d){d?this.stash.clone(b):this.stash.update(b);b=Jemplate.templateMap[a];if(typeof b=="undefined")throw'No Jemplate template named "'+a+'" available';a=b(this);d&&this.stash.declone();return a};c.set_error=function(a,b){this._error=[a,b];return a};c.plugin=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.__filter__.filters[b]=="function")return this.__filter__.filters[b](a,
d,this);else throw"Unknown filter name ':"+b+"'";};if(typeof Jemplate.Plugin=="undefined")Jemplate.Plugin=function(){};c=Jemplate.Plugin.prototype;c.plugins={};if(typeof Jemplate.Filter=="undefined")Jemplate.Filter=function(){};c=Jemplate.Filter.prototype;c.filters={};c.filters.null_filter=function(){return""};c.filters.upper=function(a){return a.toUpperCase()};c.filters.lower=function(a){return a.toLowerCase()};c.filters.ucfirst=function(a){var b=a.charAt(0);a=a.substr(1);return b.toUpperCase()+
a};c.filters.lcfirst=function(a){var b=a.charAt(0);a=a.substr(1);return b.toLowerCase()+a};c.filters.trim=function(a){return a.replace(/^\s+/g,"").replace(/\s+$/g,"")};c.filters.collapse=function(a){return a.replace(/^\s+/g,"").replace(/\s+$/g,"").replace(/\s+/," ")};c.filters.html=function(a){a=a.replace(/&/g,"&amp;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");return a.replace(/"/g,"&quot;")};c.filters.html_para=function(a){return"<p>\n"+a.split(/(?:\r?\n){2,}/).join("\n</p>\n\n<p>\n")+"</p>\n"};
c.filters.html_break=function(a){return a.replace(/(\r?\n){2,}/g,"$1<br />$1<br />$1")};c.filters.html_line_break=function(a){return a.replace(/(\r?\n)/g,"$1<br />$1")};c.filters.uri=function(a){return encodeURIComponent(a)};c.filters.url=function(a){return encodeURI(a)};c.filters.indent=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.filters.truncate=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.filters.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.filters.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 Jemplate.Stash=="undefined")Jemplate.Stash=function(){this.data={}};c=Jemplate.Stash.prototype;c.clone=function(a){var b=this.data;this.data={};this.update(b);
this.update(a);this.data._PARENT=b};c.declone=function(){this.data=this.data._PARENT||this.data};c.update=function(a){if(typeof a!="undefined")for(var b in a)this.set(b,a[b])};c.get=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._dotop.apply(this,e);if(typeof value=="undefined")break;b=value}else value=this._dotop(b,a);if(typeof value=="undefined"){if(this.__config__.DEBUG_UNDEF)throw"undefined value found while using DEGUG_UNDEF";
value=""}return value};c.set=function(a,b,d){if(a instanceof Array){var e=this.get(a[0])||{};a=a[2]}else e=this.data;d&&typeof e[a]!="undefined"||(e[a]=b)};c._dotop=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.string_functions[b])return this.string_functions[b](a,d);if(a instanceof Array&&
this.list_functions[b])return this.list_functions[b](a,d);if(typeof a=="object"&&this.hash_functions[b])return this.hash_functions[b](a,d);if(typeof a[b]=="function")return a[b].apply(a,d)}};c.string_functions={};c.string_functions.chunk=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.string_functions.defined=function(){return 1};c.string_functions.hash=
function(a){return{value:a}};c.string_functions.length=function(a){return a.length};c.string_functions.list=function(a){return[a]};c.string_functions.match=function(a,b){return a.match(new RegExp(b[0],"gm"))};c.string_functions.repeat=function(a,b){b=b[0]||1;for(var d="",e=0;e<b;e++)d+=a;return d};c.string_functions.replace=function(a,b){var d=new RegExp(b[0],"gm");(b=b[1])||(b="");return a.replace(d,b)};c.string_functions.search=function(a,b){return a.search(new RegExp(b[0]))>=0?1:0};c.string_functions.size=
function(){return 1};c.string_functions.split=function(a,b){return a.split(new RegExp(b[0]))};c.list_functions={};c.list_functions.join=function(a,b){return a.join(b[0])};c.list_functions.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.list_functions.nsort=function(a){return a.sort(function(b,d){return b-d})};c.list_functions.grep=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.list_functions.unique=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.list_functions.reverse=function(a){for(var b=[],d=a.length-1;d>=0;d--)b.push(a[d]);return b};c.list_functions.merge=function(a,b){var d=[],e=function(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.list_functions.slice=function(a,b){return a.slice(b[0],b[1])};c.list_functions.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.list_functions.push=function(a,b){a.push(b[0]);return a};c.list_functions.pop=function(a){return a.pop()};c.list_functions.unshift=function(a,b){a.unshift(b[0]);return a};c.list_functions.shift=function(a){return a.shift()};c.list_functions.first=function(a){return a[0]};c.list_functions.size=function(a){return a.length};c.list_functions.max=function(a){return a.length-
1};c.list_functions.last=function(a){return a.slice(-1)};c.hash_functions={};c.hash_functions.each=function(a){var b=[];for(var d in a)b.push(d,a[d]);return b};c.hash_functions.exists=function(a,b){return typeof a[b[0]]=="undefined"?0:1};c.hash_functions.keys=function(a){var b=[];for(var d in a)b.push(d);return b};c.hash_functions.list=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.hash_functions.nsort=function(a){var b=[];for(var d in a)b.push(d);return b.sort(function(e,f){return e-f})};c.hash_functions.size=function(a){var b=0;for(var d in a)b++;return b};c.hash_functions.sort=function(a){var b=[];for(var d in a)b.push(d);return b.sort()};c.hash_functions.values=function(a){var b=[];for(var d in a)b.push(a[d]);return b};c.hash_functions.remove=function(a,b){return delete a[b[0]]};c.hash_functions["delete"]=c.hash_functions.remove;
if(typeof Jemplate.Iterator=="undefined")Jemplate.Iterator=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.object_keys=b.sort();this.size=b.length;this.max=this.size-1}};c=Jemplate.Iterator.prototype;c.get_first=function(){this.index=0;this.first=1;this.last=0;this.count=1;return this.get_next(1)};c.get_next=function(a){var b=this.object;if(typeof a!="undefined"&&a)a=this.index;
else{a=++this.index;this.first=0;this.count=this.index+1;if(this.index==this.size-1)this.last=1}if(typeof b=="undefined")throw"No object to iterate";if(this.object_keys){if(a<this.object_keys.length){this.prev=a>0?this.object_keys[a-1]:"";this.next=a<this.max?this.object_keys[a+1]:"";return[this.object_keys[a],false]}}else if(a<b.length){this.prev=a>0?b[a-1]:"";this.next=a<this.max?b[a+1]:"";return[b[a],false]}return[null,true]};Jemplate.Ajax={get: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";
},processGet: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";},post: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";}};Jemplate.JSON={parse:function(){throw"This is a Jemplate.JSON.parse stub that doesn't do anything. Try including the jQuery, YUI, or XHR option when building the runtime";},stringify:function(){throw"This is a Jemplate.JSON.stringify stub that doesn't do anything. Try including the jQuery, YUI, or XHR option when building the runtime";
}}})();if(typeof Jemplate=="undefined")throw"Jemplate.js must be loaded before any Jemplate template files";
Jemplate.templateMap["ebay-sales.html"]=function(c){if(!c)throw"Jemplate function called without context\n";var a=c.stash,b="";try{if(a.get("sales")&&a.get(["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            <th></th>\n        </tr>\n    </thead>\n    <tbody>';(function(){var e=a.get("sales");e=new Jemplate.Iterator(e);var f=e.get_first(),g=f[0],j=f[1],B;B=a.get("loop");
a.set("loop",e);try{for(;!j;){a.data.sale=g;b+="<tr";b+=a.get(["loop",0,"index",0])%2?' class="odd"':"";b+='>\n            <td class="date">';b+=a.get(["sale",0,"date",0]);b+='</td>\n            <td class="numeric">$';b+=a.get(["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.get(["sale",0,"item_id",0]);
b+="\" onClick=\"_gaq.push(['_trackEvent','Ads','Ebay','Product_Completed_Auctions',51]);\">";b+=a.get(["sale",0,"item_id",0]);b+='</a>\n            </td>\n            <td class="thumb-down">\n                <a title="Report this auction as incorrect" href="#">\n                    <img src="/static/images/icon-thumb-down.png"/>\n                </a>\n            </td>\n        </tr>';f=e.get_next();g=f[0];j=f[1]}}catch(C){throw c.set_error(C,b);}a.set("loop",B)})();b+="</tbody>\n</table>\n<img style='text-decoration:none; border: 0; padding: 0; margin: 0;' src='http://rover.ebay.com/ar/1/711-53200-19255-0/1?mpt=[CacheBuster]&adtype=1&size=1x1&type=3&campid=5336510469&toolid=10001&customid=game-closed-auctions&ext=&satitle='>"}else b+=
"<p>No eBay sales data in the last 90 days.</p>"}catch(d){throw c.set_error(d,b);}return b};
Jemplate.templateMap["live-listings.html"]=function(c){if(!c)throw"Jemplate function called without context\n";var a=c.stash,b="";try{b+="<h3>\n    ";b+=function(){var e="";e+=a.get(["product",0,"name",0]);return c.filter(e,"html",[])}();b+=' Price Comparison\n    <span class="store_count">';b+=a.get("store_count");b+=' Stores</span>\n</h3>\n<table id="live_listings">\n';if(a.get("listings")&&a.get(["listings",0,"size",0])){b+="\n";(function(){var e=["Brand New","Like New","Very Good","Good","Acceptable"];
e=new Jemplate.Iterator(e);var f=e.get_first(),g=f[0],j=f[1],B;B=a.get("loop");a.set("loop",e);try{for(;!j;){a.data.condition=g;b+="\n    ";a.set("items",a.get(["listings",0,a.get("condition"),0]));b+="\n    ";if(a.get("items")){b+='\n    <thead>\n        <tr>\n            <th colspan="3" class="condition">';b+=a.get("condition");b+='</th>\n        </tr>\n    </thead>\n    <tbody>\n\t<tr class="headings">\n\t    <td class="price">Price</td>\n\t    <td class="subject">Description</td>\n\t    <td>Site</td>\n\t</tr>\n        ';
(function(){var D=a.get("items");D=new Jemplate.Iterator(D);var E=D.get_first(),G=E[0],H=E[1],I;I=a.get("loop");a.set("loop",D);try{for(;!H;){a.data.listing=G;b+='\n        <tr class="hoverable">\n            <td class="price">$';b+=function(){var F="";F+=a.get(["listing",0,"price",0]);return c.filter(F,"html",[])}();b+="</td>\n            <td class=\"subject\"><a onclick=\"_gaq.push(['_trackEvent','Ads','";b+=c.include("affiliate_name");b+="','Product_Live_Listings',";b+=c.include("ad_value");b+=
']);" href="';b+=a.get(["listing",0,"link",0]);b+='">';b+=function(){var F="";F+=a.get(["listing",0,"title",0]);return c.filter(F,"html",[])}();b+='</a></td>\n            <td><div class="affiliate-';b+=a.get(["listing",0,"affiliate",0]);b+='"/></td>\n        </tr>\n        ';E=D.get_next();G=E[0];H=E[1]}}catch(J){throw c.set_error(J,b);}a.set("loop",I)})();b+="\n\t<tr>\n\t    <td>&nbsp;</td>\n\t</tr>\n    </tbody>\n    "}b+="\n";f=e.get_next();g=f[0];j=f[1]}}catch(C){throw c.set_error(C,b);}a.set("loop",
B)})();b+="\n"}else b+="\n<tbody>\n    <tr>Sorry, there are no current listings on any site we know of.</tr>\n</tbody>\n";b+="\n</table>\n\n"}catch(d){throw c.set_error(d,b);}return b};Jemplate.templateMap.ad_value=function(c){if(!c)throw"Jemplate function called without context\n";var a=c.stash,b="";try{switch(a.get(["listing",0,"affiliate",0])){case "ebay":b+="95";break;case "half":b+="32";break;case "amazon":b+="53";break}}catch(d){throw c.set_error(d,b);}return b};
Jemplate.templateMap.affiliate_name=function(c){if(!c)throw"Jemplate function called without context\n";var a=c.stash,b="";try{switch(a.get(["listing",0,"affiliate",0])){case "ebay":b+="Ebay";break;case "half":b+="Half";break;case "amazon":b+="Amazon";break}}catch(d){throw c.set_error(d,b);}return b};if(typeof h=="undefined")var h={};function i(){return $("#asin").text()}function k(){return $("#eBay_product_id").text()}
function l(){function c(e,f){var g;if(e=="ebay")g=m;else if(e=="half")g=n;else if(e=="amazon")g=o;else throw"Unknown affiliate "+e;f=g(f);$("#"+e+"_throbber img").attr("src","/static/images/yes_checkmark.gif");d=d.concat(f);f.length>0&&b++;if(!(--a>0)){e=d;f={};for(g=0;g<e.length;g++){var j=f[e[g].condition];if(j)j.push(e[g]);else f[e[g].condition]=[e[g]]}e=f;e=p(e,q);e=p(e,r);e={product:{name:$("#product_name").text()},store_count:b,listings:e};Jemplate.process("live-listings.html",e,"#price_comparison");
$("#live_listings_dialog").dialog("close")}}$("#live_listings_dialog").dialog({autoOpen:false,resizable:false,width:"430px",draggable:true,closeOnEscape:true});var a=3,b=0,d=[];$("#live_listings_link").click(function(){var e=$("#live_listings_dialog");if(e.attr("loaded"))return false;e.dialog("open");s("amazon",c);s("ebay",c);s("half",c);e.attr("loaded","true");_gaq.push(["_trackPageview","/link/game/live-listings"]);return false})}
function s(c,a){var b;if(c=="ebay")b=k;else if(c=="half")b=k;else if(c=="amazon")b=i;else throw"Unknown affiliate "+c;var d=b();if(d==""||d=="none")a(c,[]);else{if(c=="ebay")b="callbackname";else if(c=="half")b="callbackname";else if(c=="amazon")b="callback";else throw"Unknown affiliate "+c;var e;if(c=="ebay")e=t;else if(c=="half")e=u;else if(c=="amazon")e=v;else throw"Unknown affiliate "+c;d=e(d);$.ajax({dataType:"jsonp",timeout:5E3,success:function(f){a(c,f)},error:function(){a(c,[])},jsonp:b,url:d});
if(c=="amazon")$("body").append('<img src="https://www.assoc-amazon.com/e/ir?t=vidgampricha-20&l=ur2&o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />');else if(c=="ebay")$("body").append('<img style="text-decoration:none;border:0;padding:0;margin:0;" src="http://rover.ebay.com/roverimp/1/711-53200-19255-0/1?ff3=2&pub=5574631883&toolid=10001&campid=5336611015&customid=&item=170344799330&mpt=[CACHEBUSTER]">');else c=="half"&&$("body").append('<img style="text-decoration:none;border:0;padding:0;margin:0;" src="http://rover.ebay.com/roverimp/1/8971-56017-19255-0/1?ff3=8&pub=5574631883&toolid=10001&campid=5336611015&customid=&mpt=[CACHEBUSTER]">')}}
function o(c){for(var a=0;a<c.length;a++){var b=c[a];b.link="http://www.amazon.com/gp/redirect.html?ie=UTF8&location="+escape(b.link)+"&tag=live-listings-game-page-20&linkCode=ur2&camp=1789&creative=390957";b.is_auction=false}return c}
function n(c){var a=[];if(!c.Products)return a;if(!c.Products.Product)return a;c=c.Products.Product[0].ItemArray.Item;for(var b=0;b<c.length;b++){var d=c[b];a.push({affiliate:"half",time_left:0,is_auction:false,condition:w(d.HalfItemCondition),price:d.CurrentPrice.Value,title:d.SellerComments,link:"http://rover.ebay.com/rover/1/8971-56017-19255-0/1?ff3=8&pub=5574631883&toolid=10001&campid=5336611015&customid=&mpre="+escape(d.ViewItemURLForNaturalSearch),feedback_rate:d.Seller.PositiveFeedbackPercent})}return a}
function w(c){var a={BrandNew:"Brand New",LikeNew:"Like New",VeryGood:"Very Good"}[c];if(a)return a;return c}
function m(c){var a=[];if(!c.ItemArray)return a;c=c.ItemArray.Item;for(var b=0;b<c.length;b++){var d=c[b],e=d.ConvertedCurrentPrice.Value;if(d.ConvertedBuyItNowPrice)e=d.ConvertedBuyItNowPrice.Value;a.push({affiliate:"ebay",time_left:x(d),is_auction:!y(d),condition:z(d),price:e,link:"http://rover.ebay.com/rover/1/711-53200-19255-0/1?icep_ff3=2&pub=5574631883&toolid=10001&campid=5336611015&customid=&icep_item="+d.ItemID+"&ipn=psmain&icep_vectorid=229466&kwid=902099&mtid=824&kw=lg",title:d.Title})}return a}
function y(c){if(c.BuyItNowAvailable)return true;if(c.ListingType=="StoresFixedPrice")return true;if(c.ListingType=="FixedPriceItem")return true;return false}function x(c){var a=c.TimeLeft;if(!a)return 0;if(y(c))return 0;(c=a.match(/([0-9]+)D/))||(c=[0,0]);(a=a.match(/([0-9]+)H/))||(a=[0,0]);return 24*c[1]+a[1]}function z(c){c=c.ItemSpecifics;if(!c)return"";c=c.NameValueList;for(var a=0;a<c.length;a++)if(c[a].Name=="Condition")return c[a].Value[0];return""}
function t(c){return"http://open.api.ebay.com/shopping?siteid=0&version=637&appid=JJGAMESLLCE6I42I17B11113BF577I&callname=FindProducts&responseencoding=JSON&AvailableItemsOnly=true&HideDuplicateItems=true&IncludeSelector=Items,ItemSpecifics&ProductID.Value="+c+"&ProductID.type=Reference"}
function u(c){return"http://open.api.ebay.com/shopping?siteid=0&version=637&appid=JJGAMESLLCE6I42I17B11113BF577I&callname=FindHalfProducts&responseencoding=JSON&AvailableItemsOnly=true&IncludeSelector=Items&ProductID.Value="+c+"&ProductID.type=Reference"}function v(c){return"http://proxy.videogamepricecharts.com/amazon/listings?asin="+c}function p(c,a){for(var b=["Brand New","Like New","Very Good","Good","Acceptable"],d=0;d<b.length;d++){var e=b[d],f=c[e];if(f)c[e]=a(f)}return c}
function q(c){c.sort(function(a,b){var d=a.time_left;if(d<12)d=0;var e=b.time_left;if(e<12)e=0;return d-e||a.price-b.price});if(c.length>5)c=c.splice(0,5);return c}function r(c){for(var a=0;a<c.length;a++){var b=c[a],d=(b.price+"").match(/\.([0-9]+)$/);if(d){if(d[1].length==1)b.price+="0"}else b.price+=".00";if(d=b.title){if(d.length>100)b.title=d.substr(0,78)+"\u2026"}else b.title="None"}return c}$(function(){if(window.location.pathname.match("^/game/")){A();l()}});
function A(){$("#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){Jemplate.process("ebay-sales.html",b,"#eBay_sales");$(".thumb-down a").click(function(d){d=$(d.target).parents("tr").first();var e=d.find(".numeric").text(),f=d.find(".item_id a").text();if(confirm("Report auction #"+
f+" (for "+e+") as being for the wrong product?")){d.fadeOut();$.get("/game/bad-sale/"+f)}return false})});c.attr("loaded","true");_gaq.push(["_trackPageview","/link/game/completed-auctions"]);return false})};
