hwmtakeoffon

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

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