hwmtakeoffon

Передача артов пачкой с изменениями (by xo4yxa & Demin)

当前为 2014-12-03 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name hwmtakeoffon
  3. // @author Demin
  4. // @namespace Demin
  5. // @description Передача артов пачкой с изменениями (by xo4yxa & Demin)
  6. // @homepage https://greasyfork.org/users/1602-demin
  7. // @icon http://i.imgur.com/LZJFLgt.png
  8. // @version 2.0
  9. // @encoding utf-8
  10. // @include http://*heroeswm.ru/inventory.php*
  11. // @include http://178.248.235.15/inventory.php*
  12. // @include http://209.200.152.144/inventory.php*
  13. // @include http://*lordswm.com/inventory.php*
  14. // @grant GM_deleteValue
  15. // @grant GM_getValue
  16. // @grant GM_listValues
  17. // @grant GM_setValue
  18. // @grant GM_addStyle
  19. // @grant GM_log
  20. // @grant GM_openInTab
  21. // ==/UserScript==
  22.  
  23. // (c) 2011-2014, demin ( http://www.heroeswm.ru/pl_info.php?id=15091 )
  24. // (c) 2010, xo4yxa
  25.  
  26. (function() {
  27.  
  28. var version = '2.0';
  29.  
  30.  
  31. if (!this.GM_getValue || (this.GM_getValue.toString && this.GM_getValue.toString().indexOf("not supported")>-1)) {
  32. this.GM_getValue=function (key,def) {
  33. return localStorage[key] || def;
  34. };
  35. this.GM_setValue=function (key,value) {
  36. return localStorage[key]=value;
  37. };
  38. this.GM_deleteValue=function (key) {
  39. return delete localStorage[key];
  40. };
  41. }
  42.  
  43.  
  44. var script_num = 92599;
  45. var script_name = "hwmtakeoffon: Передача артов пачкой с изменениями (by xo4yxa & Demin)";
  46. update_n(version,script_num,script_name);
  47.  
  48. var url_cur = location.href;
  49. var url = 'http://'+location.hostname+'/';
  50.  
  51.  
  52. if (!this.GM_xmlhttpRequest || (this.GM_xmlhttpRequest.toString && this.GM_xmlhttpRequest.toString().indexOf("not supported")>-1)) {
  53. this.GM_xmlhttpRequest=function (details) {
  54. var xmlhttp = new XMLHttpRequest();
  55. xmlhttp.onreadystatechange = function() {
  56. var responseState = {
  57. responseXML:(xmlhttp.readyState==4 ? xmlhttp.responseXML : ''),
  58. responseText:(xmlhttp.readyState==4 ? xmlhttp.responseText : ''),
  59. readyState:xmlhttp.readyState,
  60. responseHeaders:(xmlhttp.readyState==4 ? xmlhttp.getAllResponseHeaders() : ''),
  61. status:(xmlhttp.readyState==4 ? xmlhttp.status : 0),
  62. statusText:(xmlhttp.readyState==4 ? xmlhttp.statusText : '')
  63. }
  64. if (details["onreadystatechange"]) {
  65. details["onreadystatechange"](responseState);
  66. }
  67. if (xmlhttp.readyState==4) {
  68. if (details["onload"] && xmlhttp.status>=200 && xmlhttp.status<300) {
  69. details["onload"](responseState);
  70. }
  71. if (details["onerror"] && (xmlhttp.status<200 || xmlhttp.status>=300)) {
  72. details["onerror"](responseState);
  73. }
  74. }
  75. }
  76. try {
  77. //cannot do cross domain
  78. xmlhttp.open(details.method, details.url);
  79. } catch(e) {
  80. if( details["onerror"] ) {
  81. //simulate a real error
  82. details["onerror"]({responseXML:'',responseText:'',readyState:4,responseHeaders:'',status:403,statusText:'Forbidden'});
  83. }
  84. return;
  85. }
  86. if (details.headers) {
  87. for (var prop in details.headers) {
  88. xmlhttp.setRequestHeader(prop, details.headers[prop]);
  89. }
  90. }
  91. xmlhttp.send((typeof(details.data)!='undefined')?details.data:null);
  92. }
  93. }
  94.  
  95. dressid_regexp = /art_id=(\d+)/
  96. transed_regexp = /art_transfer.php\?id=(\d+)/
  97. returned_regexp = /inventory.php\?art_return=(\d+)/
  98. prochka_regexp = ( url.match('lordswm') ? /<li>Durability: (\d+)\/(\d+)/ : /<li>\u041f\u0440\u043e\u0447\u043d\u043ec\u0442\u044c: (\d+)\/(\d+)/ );
  99. prochka_regexp2 = ( url.match('lordswm') ? /<li>Durability: <font color="red">(\d+)<\/font>\/(\d+)/ : /<li>\u041f\u0440\u043e\u0447\u043d\u043ec\u0442\u044c: <font color="red">(\d+)<\/font>\/(\d+)/ );
  100.  
  101. var trans=[];
  102. var snart=[];
  103. for(var i=0x410;i<=0x44F;i++)
  104. {
  105. trans[i]=i-0x350;
  106. snart[i-0x350] = i;
  107. }
  108. trans[0x401]= 0xA8;
  109. trans[0x451]= 0xB8;
  110. snart[0xA8] = 0x401;
  111. snart[0xB8] = 0x451;
  112.  
  113. urlencode = function(str)
  114. {
  115. var ret=[];
  116. for(var i=0;i<str.length;i++)
  117. {
  118. var n=str.charCodeAt(i);
  119. if(typeof trans[n]!='undefined')
  120. n = trans[n];
  121. if (n <= 0xFF)
  122. ret.push(n);
  123. }
  124.  
  125. return escape(String.fromCharCode.apply(null,ret));
  126. }
  127.  
  128. urldecode = function(str)
  129. {
  130. var ret=[];
  131. str = unescape(str);
  132. for(var i=0;i<str.length;i++)
  133. {
  134. var n=str.charCodeAt(i);
  135. if(typeof snart[n]!='undefined')
  136. n = snart[n];
  137. ret.push(n);
  138. }
  139. return String.fromCharCode.apply(null,ret);
  140. }
  141.  
  142. var scripts = document.querySelectorAll("script");
  143. var sign;
  144. for ( var i=scripts.length; i--; ) {
  145. sign = /sign=([a-z0-9]+)/.exec( scripts[i].innerHTML );
  146. if ( sign ) {
  147. sign = sign[1];
  148. break;
  149. }
  150. }
  151.  
  152. var trade_a = getI( "//a[contains(@href, 'trade_cancel.php')]" ).snapshotItem(0) ;
  153. if( trade_a )
  154. {
  155. trade_tr = document.createElement( 'tr' )
  156. trade_td = document.createElement( 'td' )
  157. trade_td.setAttribute( "colspan" , 2 ) ;
  158. trade_td.setAttribute( "align" , "right" ) ;
  159. trade_td.innerHTML = '<a href="javascript:void(0);" id="trade_cancel"><b>\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0412\u0441\u0435</b>'
  160. trade_tr.appendChild( trade_td )
  161. trade_a.parentNode.parentNode.parentNode.appendChild( trade_tr )
  162. $("trade_cancel").addEventListener( "click", trade_cancel , false );
  163. }
  164.  
  165. var kukla_tbl = getI( "//table[contains(@background, 'i/kukla')]" ).snapshotItem(0) ;
  166. if( kukla_tbl )
  167. {
  168. o1 = kukla_tbl.parentNode.parentNode.parentNode ;
  169.  
  170. tr = document.createElement( 'tr' );
  171. td = document.createElement( 'td' );
  172. td.className = 'wb' ;
  173. td.setAttribute( 'colspan' , 2 ) ;
  174. td.setAttribute( 'align' , 'center' ) ;
  175.  
  176. var btsend = '' ;
  177. if( GM_getValue( "setbtsend" ) && GM_getValue( "setbtsend" ) == 1 )
  178. {
  179. btsend = '<input type="submit" id="trans_send" value="\u041f\u0435\u0440\u0435\u0434\u0430\u0442\u044c" title="\u041f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u0437\u0430 1 \u0437\u043e\u043b\u043e\u0442\u043e\u0439"> '
  180. }
  181.  
  182. td.innerHTML = '<style>#thistf A{text-decoration:none;font-size:10px;} #thistf A:hover{color:#00f;}</style><table width="100%"><form action="" method="POST" onSubmit="return false;"><tr><td>\u0418\u043c\u044f</td><td>\u0414\u043d\u0438</td><td><a href="javascript:void(0);" id="day_1_battle">\u0411\u043e\u0438</a></td><td id="tsum0">1\u0437</td><td id="tsum1">\u04261</td><td id="tsum2">\u04262</td><td id="tsum3">\u04263</td><td id="tsum4">\u0412\u041f</td><td></td></tr><tr><td><input id="trans_nick" name="trans_nick" value="" size="15"></td><td><input id="trans_time" value=0 size="1"></td><td><input id="trans_count" value=1 size="1"></td><td><input type="radio" name="sum" checked="true" value="0" id="sum0"></td><td><input type="radio" name="sum" value="1" id="sum1"></td><td><input type="radio" name="sum" value="2" id="sum2"></td><td><input type="radio" name="sum" value="3" id="sum3"></td><td><input type="radio" name="sum" value="4" id="sum4"></td></tr><tr><td colspan="8" align="right"><span id="place4return"></span>'+btsend+'<input type="submit" id="trans_rem" value="\u0420\u0435\u043c\u043e\u043d\u0442" title="\u041f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043d\u0430 \u0440\u0435\u043c\u043e\u043d\u0442 \u0437\u0430 1 \u0437\u043e\u043b\u043e\u0442\u043e\u0439"> <input type="submit" id="trans_a" value="\u0410\u0440\u0435\u043d\u0434\u0430" title="\u0421\u0434\u0430\u0442\u044c \u0432 \u0430\u0440\u0435\u043d\u0434\u0443"></td></tr></form></table>' ;
  183. tr.appendChild( td ) ;
  184. o1.insertBefore( tr , o1.firstChild.nextSibling )
  185.  
  186. if( ( type_sum = GM_getValue( "hwm_takeoffon_type_sum" ) ) )
  187. {
  188. $('sum'+type_sum).setAttribute( "checked", "on" ) ;
  189. $('tsum'+type_sum).style.fontWeight = "bold"
  190. $('tsum'+type_sum).style.color = "#ff0000"
  191. if (type_sum==2 || type_sum==4) {$('trans_count').value=0}
  192. else {$('trans_count').value=1}
  193. }
  194.  
  195. $('sum0').addEventListener( "click", set_type_sum , false );
  196. $('sum1').addEventListener( "click", set_type_sum , false );
  197. $('sum2').addEventListener( "click", set_type_sum , false );
  198. $('sum3').addEventListener( "click", set_type_sum , false );
  199. $('sum4').addEventListener( "click", set_type_sum , false );
  200.  
  201. $("trans_a").addEventListener( "click", trans_on , false );
  202. $("trans_rem").addEventListener( "click", trans_rem , false );
  203. if( btsend != '' )
  204. $("trans_send").addEventListener( "click", trans_send , false );
  205. $("day_1_battle").addEventListener( "click", daybattle_form , false );
  206.  
  207. var return_a = getI( "//a[contains(@href, 'inventory.php?art_return=')]" ).snapshotItem(0);
  208. if( return_a )
  209. {
  210. $("place4return").innerHTML='<input type="button" id="return_inp" value="\u0412\u0435\u0440\u043d\u0443\u0442\u044c"> ';
  211. $("return_inp").addEventListener( "click", return_go , false );
  212. }
  213.  
  214. tr = document.createElement( 'tr' );
  215. td = document.createElement( 'td' );
  216. td.className = 'wb' ;
  217. td.setAttribute( 'colspan' , 2 ) ;
  218. td.setAttribute( 'align' , 'center' ) ;
  219. td.innerHTML = '<b>\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0438:</b> (<a href="pl_info.php?id=15091">by Demin</a> <a href="javascript:void(0);" id="open_transfer_id">?</a>)<div style="float:right;margin:0 5px;cursor:pointer;font-weight:bold;" title="\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438" id="jsset">?</div>' ;
  220. tr.appendChild( td ) ;
  221. o1.insertBefore( tr , o1.firstChild.nextSibling )
  222.  
  223. $("jsset").addEventListener( "click", setting , false );
  224. addEvent($("open_transfer_id"), "click", open_transfer_f);
  225. }
  226.  
  227. var price_List = new Array();
  228.  
  229.  
  230. function initAll() {
  231. var anchors = getI( "//a[contains(@href, 'art_transfer.php')]" ) ;
  232. for( var i = 0; i < anchors.snapshotLength; i++ )
  233. {
  234. var el = anchors.snapshotItem(i);
  235.  
  236. params = transed_regexp.exec( el.href ) ;
  237. art_id = params[1] ;
  238.  
  239. price_a = document.createElement( 'a' );
  240. price_a.innerHTML = '\u0446\u0435\u043d\u044b' ;
  241. price_a.setAttribute( "art_id" , art_id )
  242. price_a.id = "id_price_a"+art_id;
  243. price_a.href = 'javascript:void(0);' ;
  244. price_a.addEventListener( "click", price_form , false );
  245.  
  246. need = el.parentNode.parentNode.parentNode.parentNode.firstChild.firstChild.nextSibling.firstChild.firstChild.firstChild.firstChild
  247.  
  248. title = need.querySelector("b").innerHTML;
  249. name2 = /id=([a-z0-9_-]+)/.exec( need.innerHTML )[1];
  250.  
  251. price_a.setAttribute( "art_name" , name2 )
  252. price_a.setAttribute( "art_title" , title )
  253.  
  254.  
  255. if (prochka_regexp.exec( el.parentNode.parentNode.parentNode.parentNode.firstChild.nextSibling.firstChild.innerHTML )){
  256. art_pr = prochka_regexp.exec( el.parentNode.parentNode.parentNode.parentNode.firstChild.nextSibling.firstChild.innerHTML )
  257. }
  258. else {
  259. art_pr = prochka_regexp2.exec( el.parentNode.parentNode.parentNode.parentNode.firstChild.nextSibling.firstChild.innerHTML )
  260. }
  261. price_a.setAttribute( "art_pr" , art_pr[2] )
  262.  
  263. need1 = el.parentNode.parentNode.parentNode.parentNode.firstChild.firstChild.nextSibling.firstChild.firstChild.firstChild.nextSibling.lastChild;
  264. need1.style.cssText = 'white-space: nowrap;';
  265.  
  266. sp = document.createElement( 'span' );
  267. sp.id = "span_dress_id_" + art_id ;
  268. need1.appendChild( sp ) ;
  269.  
  270. inp = document.createElement( 'input' );
  271. inp.type = "checkbox" ;
  272. inp.name = "dress_id" ;
  273. inp.value = art_id ;
  274. inp.id = "dress_id_" + art_id ;
  275. inp.setAttribute( 'art_pr' , art_pr[1] )
  276. inp.checked = false ;
  277. need1.insertBefore( inp , need1.firstChild.nextSibling ) ;
  278.  
  279.  
  280. if( ( price_art_id = GM_getValue( "hwm_takeoffon_price_"+art_id ) ) && price_art_id.indexOf( ';0;0;0;0;' ) < 0 )
  281. {
  282. price_a.style.fontWeight = "bold"
  283. price_a.style.color = "#006400"
  284. } else if( ( price_art_name = GM_getValue( "hwm_takeoffon_price_"+name2 ) ) && price_art_name.indexOf( ';0;0;0;0;' ) < 0 )
  285. {
  286. price_a.style.fontWeight = "bold"
  287. price_a.style.color = "#4169E1"
  288. } else
  289. {
  290. price_a.style.color = "#808080"
  291. }
  292.  
  293. el.parentNode.insertBefore( price_a , el.nextSibling ) ;
  294. el.parentNode.insertBefore( document.createTextNode( ' : ' ) , el.nextSibling ) ;
  295. }
  296.  
  297.  
  298. var anc_ret = getI( "//a[contains(@href, 'art_return=')]" ) ;
  299. for( var i = 0; i < anc_ret.snapshotLength; i++ )
  300. {
  301. var el = anc_ret.snapshotItem(i);
  302. params = returned_regexp.exec( el.href ) ;
  303. art_id = params[1] ;
  304. need1 = el.parentNode.parentNode.parentNode.parentNode.firstChild.firstChild.nextSibling.firstChild.firstChild.firstChild.nextSibling
  305. td = document.createElement( 'td' );
  306. td.style.textAlign="right";
  307. td.style.width="100%";
  308. td.style.paddingRight="10px";
  309. need1.insertBefore( td , need1.firstChild.nextSibling ) ;
  310.  
  311. sp = document.createElement( 'span' );
  312. sp.id = "span_dress_id_" + art_id ;
  313. td.appendChild( sp ) ;
  314.  
  315. inp = document.createElement( 'input' );
  316. inp.type = "checkbox" ;
  317. inp.name = "dress_id" ;
  318. inp.value = art_id ;
  319. inp.id = "dress_id_" + art_id ;
  320. inp.checked = false ;
  321. td.appendChild( inp ) ;
  322. }
  323. }
  324.  
  325. //+ Copyright (c) demin ( http://www.heroeswm.ru/pl_info.php?id=15091 )
  326.  
  327. var add_click_div = document.createElement('div');
  328. add_click_div.id = "click_div";
  329. add_click_div.style.display = "none";
  330. document.querySelector("body").appendChild(add_click_div);
  331.  
  332. addEvent($("click_div"), "click", initAll);
  333.  
  334. function inj_inv_372() {
  335. var inj_372 = window["show_arts_by_cat"];
  336. window["show_arts_by_cat"] = function(cat,r) {
  337. inj_372(cat,r);
  338. document.querySelector("div[id='click_div']").click();
  339. }
  340. }
  341.  
  342. var elem = document.createElement('script');
  343. elem.type = "text/javascript";
  344. elem.innerHTML = inj_inv_372.toString()+"inj_inv_372()";
  345. document.querySelector("head").appendChild(elem);
  346.  
  347. initAll();
  348.  
  349. //- Copyright (c)
  350.  
  351. //+
  352. function set_type_sum()
  353. {
  354. if( ( old = GM_getValue( "hwm_takeoffon_type_sum" ) ) )
  355. {
  356. $("tsum"+old).style.fontWeight = "normal"
  357. $('tsum'+old).style.color = "#592C08"
  358. }
  359.  
  360. GM_setValue( "hwm_takeoffon_type_sum" , this.value );
  361. $("tsum"+this.value).style.fontWeight = "bold"
  362. $('tsum'+this.value).style.color = "#ff0000"
  363.  
  364. if (this.value==2 || this.value==4) {$('trans_count').value=0}
  365. else {$('trans_count').value=1}
  366. }
  367. //-
  368.  
  369. //+
  370. returned = false ;
  371. function return_go()
  372. {
  373. var need_a = getI( "//a[contains(@href, 'inventory.php?art_return=')]" ) ;
  374. returned_regexp = /art_return=(\d+)/
  375. for( var i=0; i<need_a.snapshotLength; i++)
  376. {
  377. var this_a = need_a.snapshotItem(i);
  378. var art_id = returned_regexp.exec( this_a.href ) ;
  379.  
  380. if( $("dress_id_"+art_id[1]) && $("dress_id_"+art_id[1]).type == "checkbox" && $("dress_id_"+art_id[1]).checked )
  381. {
  382. returned = true ;
  383. $("span_dress_id_"+art_id[1]).innerHTML = loader();
  384. GM_xmlhttpRequest
  385. ({
  386. method:"GET",
  387. url: this_a.href ,
  388. onload:function(res)
  389. {
  390. $("dress_id_"+art_id[1]).type = "radio" ;
  391. $("dress_id_"+art_id[1]).selected = true ;
  392. return_go() ;
  393. }
  394. });
  395. return;
  396. }
  397. }
  398. if( returned ) window.location.href = url_cur ;
  399. }
  400. //-
  401.  
  402. //+
  403. traded = false ;
  404. function trade_cancel()
  405. {
  406. var inputs = document.getElementsByTagName('a');
  407. for( var i = 0; i < inputs.length; i++ )
  408. {
  409. var inp = inputs[i];
  410. if( inp.href.indexOf( 'trade_cancel.php' ) > -1 )
  411. {
  412. traded = true ;
  413. inp.parentNode.innerHTML = loader();
  414. GM_xmlhttpRequest
  415. ({
  416. method:"GET",
  417. url: inp.href ,
  418. onload:function(res)
  419. {
  420. trade_cancel() ;
  421. }
  422. });
  423. return;
  424. }
  425. }
  426. if( traded ) window.location.href = url_cur ;
  427. }
  428. //-
  429.  
  430. //+
  431. transed = false ;
  432. function trans_on()
  433. {
  434. var inputs = document.getElementsByTagName('input');
  435.  
  436.  
  437. if( $('sum1') && $('sum1').checked )
  438. {
  439. gold = 1 ;
  440. } else if( $('sum2') && $('sum2').checked )
  441. {
  442. gold = 2 ;
  443. } else if( $('sum3') && $('sum3').checked )
  444. {
  445. gold = 3 ;
  446. } else if( $('sum4') && $('sum4').checked )
  447. {
  448. gold = 4 ;
  449. } else
  450. {
  451. gold = 0 ;
  452. }
  453.  
  454.  
  455. var day_time = 0 ;
  456.  
  457. if( gold == 4 || gold == 2 )
  458.  
  459. {
  460. day_time = 60 ;
  461. if( $('trans_time') && $('trans_time').value != 0 )
  462. {
  463. day_time = $('trans_time').value
  464. day_time = day_time.split(',').join('.')
  465. }
  466. } else if( $('trans_time') && $('trans_time').value != 0 )
  467.  
  468. {
  469. var day_time = $('trans_time').value
  470. day_time = day_time.split(',').join('.')
  471. } else if( ( day1battle = GM_getValue( "hwm_takeoffon_day1battle" ) ) )
  472.  
  473. {
  474. var days = day1battle.split(';') ;
  475. if( days[$('trans_count').value] )
  476. {
  477. day_time = days[$('trans_count').value]
  478. day_time = day_time.split(',').join('.')
  479. }
  480. else
  481. day_time = 0
  482. }
  483. for( var i = 0; i < inputs.length; i++ )
  484. {
  485. var inp = inputs[i];
  486. if( inp.type == "checkbox" && inp.name == "dress_id" && inp.checked )
  487. {
  488. transed = true ;
  489. var art_id = inp.value ;
  490.  
  491.  
  492. if( (gold == 4 || gold == 2) && $('trans_count').value==0 )
  493.  
  494. {
  495. bcount = inp.getAttribute( 'art_pr' )
  496. } else
  497. {
  498. bcount = $('trans_count').value
  499. }
  500.  
  501.  
  502. if( gold == 0 )
  503.  
  504. {
  505. sum = 1
  506. } else
  507. {
  508. if( ( price = GM_getValue( "hwm_takeoffon_price_"+art_id ) ) && price.indexOf( ';0;0;0;0;' ) < 0 )
  509.  
  510. {
  511. price_arr = price.split(';');
  512. sum0 = price_arr[gold]
  513. } else if( $("id_price_a"+art_id) && ( art_name = $("id_price_a"+art_id).getAttribute( "art_name" ) ) && ( price = GM_getValue( "hwm_takeoffon_price_"+art_name ) ) && price.indexOf( ';0;0;0;0;' ) < 0 )
  514.  
  515. {
  516. price_arr = price.split(';');
  517. sum0 = price_arr[gold]
  518. } else
  519. {
  520. sum0 = 1
  521. }
  522. sumN = sum0 * ( bcount > 0 ? bcount : 1 )
  523.  
  524. // sum = sumN + Math.max( 1 , Math.round( sumN * 0.01 ) )
  525. if( GM_getValue( "setnalog" ) && GM_getValue( "setnalog" ) == 1 && sumN > 0 )
  526. sum = Math.max( 1 , Math.round( sumN / 0.99 ) )
  527. else
  528. sum = sumN
  529. }
  530. if (sum > 0) {
  531. $("span_dress_id_"+art_id).innerHTML = loader();
  532.  
  533. GM_xmlhttpRequest
  534. ({
  535. method:"POST",
  536. url: url+"art_transfer.php" ,
  537. headers:
  538. {
  539. 'Content-Type' : 'application/x-www-form-urlencoded' ,
  540. 'Referer' : url+'art_transfer.php?id='+art_id ,
  541. },
  542. data: 'id='+art_id+'&nick='+urlencode($('trans_nick').value)+'&gold='+sum+'&wood=0&ore=0&mercury=0&sulphur=0&crystal=0&gem=0&sendtype=2&dtime='+day_time+'&bcount='+bcount+'&art_id=&sign='+sign ,
  543. onload:function(res)
  544. {
  545. inp.type = "radio" ;
  546. inp.selected = true ;
  547. $("span_dress_id_"+art_id).innerHTML = '' ;
  548. trans_on() ;
  549. }
  550. });
  551. return;
  552. }
  553. else
  554. {
  555. alert(art_name+' \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d');
  556. inp.type = "radio" ;
  557. inp.selected = true ;
  558. }
  559. }
  560. }
  561. if( transed ) window.location.href = url_cur ;
  562. }
  563. //-
  564.  
  565. //+
  566. function trans_rem()
  567. {
  568. var inputs = document.getElementsByTagName('input');
  569. for( var i = 0; i < inputs.length; i++ )
  570. {
  571. var inp = inputs[i];
  572. if( inp.type == "checkbox" && inp.name == "dress_id" && inp.checked )
  573. {
  574. transed = true ;
  575. var art_id = inp.value ;
  576. $("span_dress_id_"+art_id).innerHTML = loader();
  577. GM_xmlhttpRequest
  578. ({
  579. method: "POST" ,
  580. url: url+"art_transfer.php" ,
  581. headers:
  582. {
  583. 'Content-Type' : 'application/x-www-form-urlencoded' ,
  584. 'Referer' : url+'art_transfer.php?id='+art_id ,
  585. },
  586.  
  587. data: 'id='+art_id+'&nick='+urlencode($('trans_nick').value)+'&gold=1&wood=0&ore=0&mercury=0&sulphur=0&crystal=0&gem=0&sendtype=2&dtime=0.004&bcount=0&rep=on&art_id=&sign='+sign ,
  588. onload:function(res)
  589. {
  590. inp.type = "radio" ;
  591. inp.selected = true ;
  592. $("span_dress_id_"+art_id).innerHTML = '' ;
  593. trans_rem() ;
  594. }
  595. });
  596. return;
  597. }
  598. }
  599. if( transed ) window.location.href = url_cur ;
  600. }
  601. //-
  602.  
  603. //+
  604. function trans_send()
  605. {
  606. var inputs = document.getElementsByTagName('input');
  607. for( var i = 0; i < inputs.length; i++ )
  608. {
  609. var inp = inputs[i];
  610. if( inp.type == "checkbox" && inp.name == "dress_id" && inp.checked )
  611. {
  612. transed = true ;
  613. var art_id = inp.value ;
  614. $("span_dress_id_"+art_id).innerHTML = loader();
  615. GM_xmlhttpRequest
  616. ({
  617. method: "POST" ,
  618. url: url+"art_transfer.php" ,
  619. headers:
  620. {
  621. 'Content-Type' : 'application/x-www-form-urlencoded' ,
  622. 'Referer' : url+'art_transfer.php?id='+art_id ,
  623. },
  624.  
  625. data: 'id='+art_id+'&nick='+urlencode($('trans_nick').value)+'&gold=1&wood=0&ore=0&mercury=0&sulphur=0&crystal=0&gem=0&sendtype=1&dtime=0&bcount=0&art_id=&sign='+sign ,
  626. onload:function(res)
  627. {
  628. inp.type = "radio" ;
  629. inp.selected = true ;
  630. $("span_dress_id_"+art_id).innerHTML = '' ;
  631. trans_send() ;
  632. }
  633. });
  634. return;
  635. }
  636. }
  637. if( transed ) window.location.href = url_cur ;
  638. }
  639. //-
  640.  
  641. //+
  642. function daybattle_form()
  643. {
  644. var bg = $('bgOverlay');
  645. var bgc = $('bgCenter');
  646. var bg_height = ScrollHeight();
  647.  
  648. if ( !bg )
  649. {
  650. bg = document.createElement('div');
  651. document.body.appendChild( bg );
  652.  
  653. bgc = document.createElement('div');
  654. document.body.appendChild( bgc );
  655. }
  656.  
  657. bg.id = 'bgOverlay';
  658. bg.style.position = 'absolute';
  659. bg.style.left = '0px';
  660. bg.style.width = '100%';
  661. bg.style.background = "#000000";
  662. bg.style.opacity = "0.5";
  663. bg.style.zIndex = "7";
  664.  
  665. bgc.id = 'bgCenter';
  666. bgc.style.position = 'absolute';
  667. bgc.style.left = ( ( ClientWidth() - 400 ) / 2 ) + 'px';
  668. bgc.style.width = '400px';
  669. bgc.style.background = "#F6F3EA";
  670. bgc.style.zIndex = "8";
  671.  
  672. addEvent(bg, "click", form_close);
  673.  
  674. var day1battle_ = GM_getValue( "hwm_takeoffon_day1battle" ) ;
  675. if( !day1battle_ )
  676. day1battle = new Array();
  677. else
  678. day1battle = day1battle_.split(';')
  679.  
  680. var form = '<div style="border:1px solid #abc;padding:5px;margin:2px;"><div style="float:right;border:1px solid #abc;width:15px;height:15px;text-align:center;cursor:pointer;" id="bt_close" title="Close">x</div><center><table><tr><td colspan="4"><b>\u0412\u0440\u0435\u043c\u044f \u043d\u0430 \u0431\u043e\u0438 \u0432 \u0434\u043d\u044f\u0445 (1 \u0447\u0430\u0441 ~ 0,042 \u0434\u043d\u044f)</b></td></tr>'
  681. for( var i=1;i<11;i++)
  682. {
  683. form += '<tr>'+
  684. '<td>'+i+'</td><td><input id="day_cnt'+i+'" size="5" value="'+( day1battle[i] ? day1battle[i] : 0 )+'"></td>'+
  685. '<td>'+(10+i)+'</td><td><input id="day_cnt'+(10+i)+'" size="5" value="'+( day1battle[10+i] ? day1battle[10+i] : 0 )+'"></td>'+
  686. '</tr>'
  687. }
  688. form += '<tr><td colspan="4" align="center"><input type="button" id="form_o" value="\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c"></td></tr></table></center></div>' ;
  689.  
  690. bgc.innerHTML = form;
  691.  
  692. $("bt_close").addEventListener( "click", form_close , false );
  693. $('form_o').addEventListener( "click", daybattle_set , false );
  694.  
  695. bg.style.top = '0px';
  696. bg.style.height = bg_height + 'px';
  697. bgc.style.top = ( window.pageYOffset + 150 ) + 'px';
  698. bg.style.display = '';
  699. bgc.style.display = '';
  700. }
  701. //-
  702.  
  703. //+
  704. function daybattle_set()
  705. {
  706. day1battle = '0;'
  707. for(var i=1;i<21;i++)
  708. {
  709. day1battle += ''+$('day_cnt'+i).value+';'
  710. }
  711. GM_setValue( "hwm_takeoffon_day1battle" , day1battle ) ;
  712. form_close() ;
  713. }
  714. //-
  715.  
  716. //+
  717. function price_form()
  718. {
  719. title = this.getAttribute( "art_title" )
  720. name2 = this.getAttribute( "art_name" )
  721. art_id = this.getAttribute( "art_id" )
  722. art_pr = this.getAttribute( "art_pr" )
  723.  
  724.  
  725. var bg = $('bgOverlay');
  726. var bgc = $('bgCenter');
  727. var bg_height = ScrollHeight();
  728.  
  729. if ( !bg )
  730. {
  731. bg = document.createElement('div');
  732. document.body.appendChild( bg );
  733.  
  734. bgc = document.createElement('div');
  735. document.body.appendChild( bgc );
  736. }
  737.  
  738. bg.id = 'bgOverlay';
  739. bg.style.position = 'absolute';
  740. bg.style.left = '0px';
  741. bg.style.width = '100%';
  742. bg.style.background = "#000000";
  743. bg.style.opacity = "0.5";
  744. bg.style.zIndex = "7";
  745.  
  746. bgc.id = 'bgCenter';
  747. bgc.style.position = 'absolute';
  748. bgc.style.left = ( ( ClientWidth() - 400 ) / 2 ) + 'px';
  749. bgc.style.width = '400px';
  750. bgc.style.background = "#F6F3EA";
  751. bgc.style.zIndex = "8";
  752.  
  753. addEvent(bg, "click", form_close);
  754.  
  755.  
  756. var price_c1 = price_c2 = price_c3 = price_c4 = 0 ;
  757. var st_i = st_n = '' ;
  758. if( ( price = GM_getValue( "hwm_takeoffon_price_"+art_id ) ) && price.indexOf( ';0;0;0;0;' ) < 0 )
  759. {
  760. st_i = ' style="color:#006400;"'
  761. price_arr = price.split(';');
  762. price_c1 = price_arr[1]
  763. price_c2 = price_arr[2]
  764. price_c3 = price_arr[3]
  765. price_c4 = price_arr[4]
  766. } else if( ( price = GM_getValue( "hwm_takeoffon_price_"+name2 ) ) && price.indexOf( ';0;0;0;0;' ) < 0 )
  767. {
  768. st_n = ' style="color:#6495ED;"'
  769. price_arr = price.split(';');
  770. price_c1 = price_arr[1]
  771. price_c2 = price_arr[2]
  772. price_c3 = price_arr[3]
  773. price_c4 = price_arr[4]
  774. }
  775.  
  776. bgc.innerHTML = '<div style="border:1px solid #abc;padding:5px;margin:2px;"><div style="float:right;border:1px solid #abc;width:15px;height:15px;text-align:center;cursor:pointer;" id="bt_close" title="Close">x</div><center><table><tr><td colspan="2"><b id="art_title"'+st_i+'>'+title+'</b> <i id="art_name"'+st_n+'>('+name2+')'+'</i></td></tr><tr><td>[\u04261] 1 \u0431\u043e\u0439</td><td><input id="art_c1" value="'+price_c1+'"></td></tr><tr><td>[\u04262] \u041e\u043f\u0442</td><td><input id="art_c2" value="'+price_c2+'"></td></tr><tr><td>[\u04263] \u041e\u0441\u043e\u0431\u0430\u044f&nbsp;</td><td><input id="art_c3" value="'+price_c3+'"></td></tr><tr><td>[\u0412\u041f] \u0412\u0441\u044f \u043f\u0440\u043e\u0447\u043a\u0430&nbsp;</td><td><input id="art_c4" value="'+price_c4+'"></td></tr><tr><td colspan="2" align="center"><input type="button" art_id="'+art_id+'" id="form_oi" value="\u0418\u043d\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043b\u044c\u043d\u043e"> <input type="button" art_name="'+name2+'" id="form_on" value="\u0412\u0441\u0435\u043c \u0442\u0430\u043a\u0438\u043c"></td></tr></table></center></div>' ;
  777.  
  778. $("bt_close").addEventListener( "click", form_close , false );
  779. $('form_oi').addEventListener( "click", price_set_id , false );
  780. $('form_on').addEventListener( "click", price_set_name , false );
  781.  
  782. bg.style.top = '0px';
  783. bg.style.height = bg_height + 'px';
  784. bgc.style.top = ( window.pageYOffset + 150 ) + 'px';
  785. bg.style.display = '';
  786. bgc.style.display = '';
  787. $('art_c1').focus();
  788. }
  789. //-
  790.  
  791. //+
  792. function form_close()
  793. {
  794. var bg = $('bgOverlay');
  795. var bgc = $('bgCenter');
  796. bg.parentNode.removeChild(bg);
  797. bgc.parentNode.removeChild(bgc);
  798. }
  799. //-
  800.  
  801. //+
  802. function price_set_id()
  803. {
  804. var art_id = this.getAttribute( "art_id" ) ;
  805. price = $('art_title').innerHTML+';'+$('art_c1').value+';'+$('art_c2').value+';'+$('art_c3').value+';'+$('art_c4').value+';'
  806. var price_old = GM_getValue( "hwm_takeoffon_price" ) ;
  807. if( !price_old || price_old.indexOf( ';' + art_id + ';' ) < 0 )
  808. {
  809. price_new = ( price_old ? price_old : '' ) + ';' + art_id + ';' ;
  810. GM_setValue( "hwm_takeoffon_price" , price_new ) ;
  811. }
  812. GM_setValue( "hwm_takeoffon_price_"+art_id , price ) ;
  813.  
  814. var price_a_obj = $("id_price_a"+art_id) ;
  815. if( price.indexOf( ';0;0;0;0;' ) < 0 )
  816. {
  817. price_a_obj.style.fontWeight = "bold"
  818. price_a_obj.style.color = "#006400"
  819. } else
  820. {
  821. if( ( this_name = price_a_obj.getAttribute( 'art_name' ) ) && ( this_price = GM_getValue( "hwm_takeoffon_price_"+this_name ) ) && this_price.indexOf( ';0;0;0;0;' ) < 0 )
  822. {
  823. price_a_obj.style.fontWeight = "bold"
  824. price_a_obj.style.color = "#6495ED"
  825.  
  826. } else
  827. {
  828. price_a_obj.style.color = "#808080" ;
  829. price_a_obj.style.fontWeight = "normal"
  830. }
  831. }
  832.  
  833. form_close() ;
  834. }
  835. //-
  836.  
  837. //+
  838. function price_set_name()
  839. {
  840. var art_name = this.getAttribute( "art_name" ) ;
  841. price = $('art_title').innerHTML+';'+$('art_c1').value+';'+$('art_c2').value+';'+$('art_c3').value+';'+$('art_c4').value+';'
  842. var price_old = GM_getValue( "hwm_takeoffon_price_name" ) ;
  843. if( !price_old || price_old.indexOf( ';' + art_name + ';' ) < 0 )
  844. {
  845. price_new = ( price_old ? price_old : '' ) + ';' + art_name + ';' ;
  846. GM_setValue( "hwm_takeoffon_price_name" , price_new ) ;
  847. }
  848. GM_setValue( "hwm_takeoffon_price_"+art_name , price ) ;
  849.  
  850. var need_a = getI( "//a[contains(@href, 'javascript:void(0);')]" ) ;
  851. if( price.indexOf( ';0;0;0;0;' ) < 0 )
  852.  
  853. {
  854. for(var i=0; i < need_a.snapshotLength; i++)
  855.  
  856. {
  857. this_a = need_a.snapshotItem(i);
  858. if( ( this_id = this_a.getAttribute( 'art_id' ) ) && ( this_price = GM_getValue( "hwm_takeoffon_price_"+this_id ) ) && this_price.indexOf( ';0;0;0;0;' ) < 0 )
  859.  
  860. {
  861. } else if( ( this_name = this_a.getAttribute( 'art_name' ) ) && this_name == art_name )
  862.  
  863. {
  864. this_a.style.fontWeight = "bold"
  865. this_a.style.color = "#6495ED"
  866. }
  867. }
  868.  
  869. } else
  870.  
  871. {
  872. for(var i=0; i < need_a.snapshotLength; i++)
  873. {
  874. this_a = need_a.snapshotItem(i);
  875. if( ( this_id = this_a.getAttribute( 'art_id' ) ) && ( this_price = GM_getValue( "hwm_takeoffon_price_"+this_id ) ) && this_price.indexOf( ';0;0;0;0;' ) < 0 )
  876.  
  877. {
  878. } else if( ( this_name = this_a.getAttribute( 'art_name' ) ) && this_name == art_name )
  879.  
  880. {
  881. this_a.style.fontWeight = "normal"
  882. this_a.style.color = "#808080"
  883. }
  884. }
  885. }
  886. form_close() ;
  887. }
  888. //-
  889.  
  890.  
  891. //+
  892. function setting()
  893. {
  894. var bg = $('bgOverlay');
  895. var bgc = $('bgCenter');
  896. var bg_height = ScrollHeight();
  897.  
  898. if ( !bg )
  899. {
  900. bg = document.createElement('div');
  901. document.body.appendChild( bg );
  902.  
  903. bgc = document.createElement('div');
  904. document.body.appendChild( bgc );
  905. }
  906.  
  907. bg.id = 'bgOverlay';
  908. bg.style.position = 'absolute';
  909. bg.style.left = '0px';
  910. bg.style.width = '100%';
  911. bg.style.background = "#000000";
  912. bg.style.opacity = "0.5";
  913. bg.style.zIndex = "7";
  914.  
  915. bgc.id = 'bgCenter';
  916. bgc.style.position = 'absolute';
  917. bgc.style.left = ( ( ClientWidth() - 650 ) / 2 ) + 'px';
  918. bgc.style.width = '650px';
  919. bgc.style.background = "#F6F3EA";
  920. bgc.style.zIndex = "8";
  921.  
  922. addEvent(bg, "click", form_close);
  923.  
  924. if ( url.match('lordswm') ) {
  925.  
  926. var st_author = 'Script author';
  927.  
  928. } else {
  929.  
  930. var st_author = '\u0410\u0432\u0442\u043E\u0440 \u0441\u043A\u0440\u0438\u043F\u0442\u0430';
  931.  
  932. }
  933.  
  934. bgc.innerHTML = '<div style="border:1px solid #abc;padding:5px;margin:2px;"><div style="float:right;border:1px solid #abc;width:15px;height:15px;text-align:center;cursor:pointer;" id="bt_close" title="Close">x</div><table>'+
  935. '<tr><td>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 передачи артов пачкой<br><br></td></tr>'+
  936. '<tr><td><label for="chsetnalog" style="cursor:pointer;"><input type="checkbox" id="chsetnalog"> \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u043b\u043e\u0433 \u0432 1% \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u0432 \u0430\u0440\u0435\u043d\u0434\u0443</label></td></tr><tr><td><label for="chsetbtsend" style="cursor:pointer;"><input type="checkbox" id="chsetbtsend"> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 "\u041f\u0435\u0440\u0435\u0434\u0430\u0442\u044c"</label></td></tr>'+
  937. '</table><table width=100%>'+
  938. '<tr><td style="text-align:right">'+st_author+': <a href="pl_info.php?id=130">xo4yxa</a> & <a href="pl_info.php?id=15091">Demin</a> <a href="javascript:void(0);" id="open_transfer_id2">?</a></td></tr>'+
  939. '</table></div>';
  940.  
  941. $("bt_close").addEventListener( "click", form_close , false );
  942. addEvent($("open_transfer_id2"), "click", open_transfer_f);
  943.  
  944. var chsetnalog = $('chsetnalog')
  945. chsetnalog.checked = ( GM_getValue( "setnalog" ) && GM_getValue( "setnalog" ) == 1 ) ? 'checked' : '' ;
  946. chsetnalog.addEventListener( "click", setChNalog , false );
  947.  
  948. var chsetbtsend = $('chsetbtsend')
  949. chsetbtsend.checked = ( GM_getValue( "setbtsend" ) && GM_getValue( "setbtsend" ) == 1 ) ? 'checked' : '' ;
  950. chsetbtsend.addEventListener( "click", setChBtsend , false );
  951.  
  952. bg.style.top = '0px';
  953. bg.style.height = bg_height + 'px';
  954. bgc.style.top = ( window.pageYOffset + 150 ) + 'px';
  955. bg.style.display = '';
  956. bgc.style.display = '';
  957. }
  958. //-
  959.  
  960.  
  961. function setChNalog()
  962. {
  963. if( GM_getValue( "setnalog" ) && GM_getValue( "setnalog" ) == 1 )
  964. GM_setValue( "setnalog" , 0 );
  965. else
  966. GM_setValue( "setnalog" , 1 );
  967. }
  968. function setChBtsend()
  969. {
  970. if( GM_getValue( "setbtsend" ) && GM_getValue( "setbtsend" ) == 1 )
  971. GM_setValue( "setbtsend" , 0 );
  972. else
  973. GM_setValue( "setbtsend" , 1 );
  974. }
  975.  
  976. function loader() {
  977. return '<img border="0" align="absmiddle" height="13" src="data:image/gif;base64,'+
  978. 'R0lGODlhEAAQAMQAAP///+7u7t3d3bu7u6qqqpmZmYiIiHd3d2ZmZlVVVURERDMzMyIiIhEREQAR'+
  979. 'AAAAAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05F'+
  980. 'VFNDQVBFMi4wAwEAAAAh+QQFBwAQACwAAAAAEAAQAAAFdyAkQgGJJOWoQgIjBM8jkKsoPEzgyMGs'+
  981. 'CjPDw7ADpkQBxRDmSCRetpRA6Rj4kFBkgLC4IlUGhbNQIwXOYYWCXDufzYPDMaoKGBoKb886OjAK'+
  982. 'dgZAAgQkfCwzAgsDBAUCgl8jAQkHEAVkAoA1AgczlyIDczUDA2UhACH5BAUHABAALAAAAAAPABAA'+
  983. 'AAVjICSO0IGIATkqIiMKDaGKC8Q49jPMYsE0hQdrlABCGgvT45FKiRKQhWA0mPKGPAgBcTjsspBC'+
  984. 'AoH4gl+FmXNEUEBVAYHToJAVZK/XWoQQDAgBZioHaX8igigFKYYQVlkCjiMhACH5BAUHABAALAAA'+
  985. 'AAAQAA8AAAVgICSOUGGQqIiIChMESyo6CdQGdRqUENESI8FAdFgAFwqDISYwPB4CVSMnEhSej+Fo'+
  986. 'gNhtHyfRQFmIol5owmEta/fcKITB6y4choMBmk7yGgSAEAJ8JAVDgQFmKUCCZnwhACH5BAUHABAA'+
  987. 'LAAAAAAQABAAAAViICSOYkGe4hFAiSImAwotB+si6Co2QxvjAYHIgBAqDoWCK2Bq6A40iA4yYMgg'+
  988. 'NZKwGFgVCAQZotFwwJIF4QnxaC9IsZNgLtAJDKbraJCGzPVSIgEDXVNXA0JdgH6ChoCKKCEAIfkE'+
  989. 'BQcAEAAsAAAAABAADgAABUkgJI7QcZComIjPw6bs2kINLB5uW9Bo0gyQx8LkKgVHiccKVdyRlqjF'+
  990. 'SAApOKOtR810StVeU9RAmLqOxi0qRG3LptikAVQEh4UAACH5BAUHABAALAAAAAAQABAAAAVxICSO'+
  991. '0DCQKBQQonGIh5AGB2sYkMHIqYAIN0EDRxoQZIaC6bAoMRSiwMAwCIwCggRkwRMJWKSAomBVCc5l'+
  992. 'UiGRUBjO6FSBwWggwijBooDCdiFfIlBRAlYBZQ0PWRANaSkED1oQYHgjDA8nM3kPfCmejiEAIfkE'+
  993. 'BQcAEAAsAAAAABAAEAAABWAgJI6QIJCoOIhFwabsSbiFAotGMEMKgZoB3cBUQIgURpFgmEI0EqjA'+
  994. 'CYXwiYJBGAGBgGIDWsVicbiNEgSsGbKCIMCwA4IBCRgXt8bDACkvYQF6U1OADg8mDlaACQtwJCEA'+
  995. 'IfkEBQcAEAAsAAABABAADwAABV4gJEKCOAwiMa4Q2qIDwq4wiriBmItCCREHUsIwCgh2q8MiyEKO'+
  996. 'DK7ZbHCoqqSjWGKI1d2kRp+RAWGyHg+DQUEmKliGx4HBKECIMwG61AgssAQPKA19EAxRKz4QCVIh'+
  997. 'ACH5BAUHABAALAAAAAAQABAAAAVjICSOUBCQqHhCgiAOKyqcLVvEZOC2geGiK5NpQBAZCilgAYFM'+
  998. 'ogo/J0lgqEpHgoO2+GIMUL6p4vFojhQNg8rxWLgYBQJCASkwEKLC17hYFJtRIwwBfRAJDk4Obwsi'+
  999. 'dEkrWkkhACH5BAUHABAALAAAAQAQAA8AAAVcICSOUGAGAqmKpjis6vmuqSrUxQyPhDEEtpUOgmgY'+
  1000. 'ETCCcrB4OBWwQsGHEhQatVFhB/mNAojFVsQgBhgKpSHRTRxEhGwhoRg0CCXYAkKHHPZCZRAKUERZ'+
  1001. 'MAYGMCEAIfkEBQcAEAAsAAABABAADwAABV0gJI4kFJToGAilwKLCST6PUcrB8A70844CXenwILRk'+
  1002. 'IoYyBRk4BQlHo3FIOQmvAEGBMpYSop/IgPBCFpCqIuEsIESHgkgoJxwQAjSzwb1DClwwgQhgAVVM'+
  1003. 'IgVyKCEAIfkECQcAEAAsAAAAABAAEAAABWQgJI5kSQ6NYK7Dw6xr8hCw+ELC85hCIAq3Am0U6JUK'+
  1004. 'jkHJNzIsFAqDqShQHRhY6bKqgvgGCZOSFDhAUiWCYQwJSxGHKqGAE/5EqIHBjOgyRQELCBB7EAQH'+
  1005. 'fySDhGYQdDWGQyUhADs=">';
  1006. }
  1007.  
  1008. function getI(xpath,elem){return document.evaluate(xpath,(!elem?document:elem),null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);}
  1009.  
  1010.  
  1011. function open_transfer_f()
  1012. {
  1013. if ( location.href.match('lordswm') )
  1014. {
  1015. window.location = "transfer.php?nick=demin&shortcomment=Transferred 10000 Gold 5 Diamonds";
  1016. } else {
  1017. window.location = "transfer.php?nick=demin&shortcomment=%CF%E5%F0%E5%E4%E0%ED%EE%2010000%20%C7%EE%EB%EE%F2%EE%205%20%C1%F0%E8%EB%EB%E8%E0%ED%F2%FB";
  1018. }
  1019. }
  1020.  
  1021. function ClientHeight() {
  1022. return document.compatMode=='CSS1Compat' && document.documentElement?document.documentElement.clientHeight:document.body.clientHeight;
  1023. }
  1024.  
  1025. function ClientWidth() {
  1026. return document.compatMode=='CSS1Compat' && document.documentElement?document.documentElement.clientWidth:document.body.clientWidth;
  1027. }
  1028.  
  1029. function ScrollHeight() {
  1030. return Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);
  1031. }
  1032.  
  1033. function $(id) { return document.querySelector("#"+id); }
  1034.  
  1035. function addEvent(elem, evType, fn) {
  1036. if (elem.addEventListener) {
  1037. elem.addEventListener(evType, fn, false);
  1038. }
  1039. else if (elem.attachEvent) {
  1040. elem.attachEvent("on" + evType, fn);
  1041. }
  1042. else {
  1043. elem["on" + evType] = fn;
  1044. }
  1045. }
  1046.  
  1047. function update_n(a,b,c,d,e){if(e){e++}else{e=1;d=(Number(GM_getValue(b+'_update_script_last2','0'))||0)}if(e>3){return}var f=new Date().getTime();var g=document.querySelector('#update_demin_script2');if(g){if((d+86400000<f)||(d>f)){g=g.innerHTML;if(/100000=1.1/.exec(g)){var h=new RegExp(b+'=(\\d+\\.\\d+)=(\\d+)').exec(g);var i=/url7=([^%]+)/.exec(g);if(a&&h&&i){if(Number(h[1])>Number(a))setTimeout(function(){if(confirm('\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u043E \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u043A\u0440\u0438\u043F\u0442\u0430: "'+c+'".\n\u0423\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u043D\u0443\u044E \u0432\u0435\u0440\u0441\u0438\u044E \u0441\u0435\u0439\u0447\u0430\u0441?\n\nThere is an update available for the script: "'+c+'".\nWould you like install the script now?')){if(typeof GM_openInTab=='function'){GM_openInTab(i[1].replace(/\s/g,'')+h[2])}else{window.open(i[1].replace(/\s/g,'')+h[2],'_blank')}}},500)}GM_setValue(b+'_update_script_last2',''+f)}else{setTimeout(function(){update_n(a,b,c,d,e)},1000)}}}else{var j=document.querySelector('body');if(j){var k=GM_getValue(b+'_update_script_array2');if(e==1&&((d+86400000<f)||(d>f)||!k)){if(k){GM_deleteValue(b+'_update_script_array2')}setTimeout(function(){update_n(a,b,c,d,e)},1000);return}var l=document.createElement('div');l.id='update_demin_script2';l.setAttribute('style','position: absolute; width: 0px; height: 0px; top: 0px; left: 0px; display: none;');l.innerHTML='';j.appendChild(l);if((d+86400000<f)||(d>f)||!k){var m=new XMLHttpRequest();m.open('GET','photo_pl_photos.php?aid=1777'+'&rand='+(Math.random()*100),true);m.onreadystatechange=function(){update(m,a,b,c,d,e)};m.send(null)}else{document.querySelector('#update_demin_script2').innerHTML=k;setTimeout(function(){update_n(a,b,c,d,e)},10)}}}}function update(a,b,c,d,e,f){if(a.readyState==4&&a.status==200){a=a.responseText;var g=/(\d+=\d+\.\d+(=\d+)*)/g;var h='';var i=/(url7=[^%]+\%)/.exec(a);if(i){h+=i[1]}while((i=g.exec(a))!=null){if(h.indexOf(i[1])==-1){h+=' '+i[1]}};GM_setValue(c+'_update_script_array2',''+h);var j=document.querySelector('#update_demin_script2');if(j){j.innerHTML=h;setTimeout(function(){update_n(b,c,d,e,f)},10)}}}
  1048.  
  1049. })();