Greasy Fork is available in English.

MZScript© | por cCc vAdEr & Serbini Ini

Características y funcionalidades extras para el sitio de ManagerZone

  1. // ==UserScript==
  2. // @name MZScript© | por cCc vAdEr & Serbini Ini
  3. // @namespace https://greatest.deepsurf.us/scripts/1752-mzscript-por-ccc-vader-serbini-ini
  4. // @description Características y funcionalidades extras para el sitio de ManagerZone
  5. // @include http*://*managerzone.*
  6. // @grant none
  7. // @version 3.3.r
  8. // @copyright Copyleft(c) 2010-2018, c_c - serbocapo
  9. // @authors c_c (c_c_managerzone@yahoo.com) | serbocapo (serbocapo@managerzone.com)
  10. // @credits some icons are by Yusuke Kamiyamane [http://p.yusukekamiyamane.com/]
  11. // ==/UserScript==
  12.  
  13. function addJQuery(callback) {
  14. var script = document.createElement("script");
  15. script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js");
  16. script.addEventListener('load', function () {
  17. var script = document.createElement("script");
  18. script.textContent = "window.jQ=jQuery.noConflict(true);(" + callback.toString() + ")();";
  19. document.body.appendChild(script);
  20. }, false);
  21. document.body.appendChild(script);
  22. }
  23. addJQuery(mzscript);
  24.  
  25. function mzscript() {
  26. (function () {
  27. var dominios = ['ar', 'at', 'biz', 'bo', 'br', 'ch', 'cl', 'co', 'com', 'cr', 'cz', 'de', 'dk', 'do', 'ec', 'edu', 'es', 'eu', 'fm', 'fr', 'gb', 'gov', 'gr', 'gt', 'hn', 'hr', 'ie', 'info', 'int', 'it', 'jobs', 'lt', 'lv', 'ly', 'mx', 'mz', 'net', 'ni', 'org', 'pa', 'pe', 'pl', 'pr', 'pt', 'py', 'ro', 'ru', 'sv', 'se', 'th', 'tk', 'tn', 'to', 'tr', 'tv', 'tz', 'uk', 'us', 'uy', 've', 'vg', 'xxx', 'yu', 'zw'];
  28. var etiqOut = ['a', 'applet', 'area', 'embed', 'frame', 'frameset', 'head', 'iframe', 'img', 'map', 'meta', 'noscript', 'object', 'option', 'param', 'script', 'select', 'style', 'textarea', 'title'];
  29. var inArray = function (value, items) {
  30. for (var i = 0; items[i] && value != items[i]; i++)
  31. ;
  32. return value == items[i];
  33. }
  34. var regExp = /(^|[\s()\[\]_:~+@*"'>])((?:https?|ftp|irc):\/\/)?([-a-z\d;:&=+$,%_.!~*'()]+@)?((?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:(www|irc|ftp)\.)?(?:(?:[a-z\d]|[a-z\d][a-z\d-]*[a-z\d])\.)+([a-z]{2,6}))(:\d+)?(\/(?:[-\w.!~*'()%:@&=+$,;\/]*[\w~*%@&=+$\/])?(?:\?(?:[-\w;\/?:@&=+$,.!~*'()%\[\]|]*[\w\/@&=+$~*%])?)?(?:#(?:[-\w;\/?:@&=+$,.!~*'()%]*[\w\/@&=+$~*%])?)?|\b)/i
  35. var conteadorL = 0;
  36. var docAct = document.body;
  37. while (docAct) {
  38. if (docAct.nodeName == '#text' && (match = docAct.nodeValue.match(regExp)) && inArray(match[6], dominios)) {
  39. var url;
  40. if (match[3] && !match[2] && !match[5] && !match[8] && (match[3].indexOf(':') == -1 || match[3].indexOf('mailto:') == 0)) {
  41. url = (match[3].indexOf('mailto:') == -1 ? 'mailto:' : '') + match[3] + match[4];
  42. } else {
  43. url = (match[2] ? match[2] : (!match[5] || match[5] == 'www' ? 'http' : match[5]) + '://') + (match[3] ? match[3] : '') + match[4] + (match[7] ? match[7] : '') + (match[8] ? match[8] : '');
  44. }
  45. if (url) {
  46. var range = document.createRange();
  47. range.setStart(docAct, match.index + match[1].length);
  48. range.setEnd(docAct, match.index + match[0].length);
  49. var a = document.createElement('a');
  50. a.setAttribute('href', url);
  51. a.appendChild(range.extractContents());
  52. range.insertNode(a);
  53. range.detach();
  54. conteadorL++;
  55. }
  56. }
  57. if (docAct.tagName && !inArray(docAct.tagName.toLowerCase(), etiqOut) && docAct.firstChild) {
  58. docAct = docAct.firstChild;
  59. } else if (docAct.nextSibling) {
  60. docAct = docAct.nextSibling;
  61. } else {
  62. do {
  63. docAct = docAct.parentNode;
  64. } while (!docAct.nextSibling && docAct.parentNode);
  65. docAct = docAct.nextSibling;
  66. }
  67. }
  68. })();
  69. (function () {
  70. var css = "#body.body_mz,div.win_back,#win_bg,div.news_item,.odd{background-image:url(http://static.managerzone.com/img/windowbg.gif)!important;}.subnavhr{height:2px!important;}.even{background-color:#c0c0c0!important;}.age_restricted_game{background-color:#d6db93!important;border-top:solid 1px #000015!important;border-bottom:solid 1px #000015!important;}.age_restricted_game_secondary{background-color:#8ecf8b!important;border-top:solid 1px #000015!important;border-bottom:solid 1px #000015!important;}.mPoint{float:left;height:6px;margin-right:3px;margin-top:5px;width:6px;}.amar{background-color:#FF0}.black{background-color:#000}a.ctooltip span {display:none; padding:2px 3px; margin-left:8px; width:290px;}a.ctooltip:hover span{display:inline; position:absolute; z-index:1000; margin-top:-190px; border:1px solid #000000; background:#C4D1E4; color:#6c6c6c; border-radius:6px;}a.ctooltip2 span {/*display:none;*/ padding:2px 3px; margin-left:120px;margin-top:-33px;width:290px;}.divVisible{display:block;}.divHidden {display:none;}.cursor{cursor:pointer;}#link, #pe, #error {display: none}.forum_topic_last_post a{color:#990000!important;}.tdStyle{color:#FFF;font-weight:bold}.buttondiv{position:static}.fbtn{width:188px}.cursor{cursor:pointer}#jugador{width:20px}#jugador img{display:block;margin:auto}#jug{padding:15px}#close{padding:3px}.impTabla td {color:#FFF;font-weight:bold;padding:5px}.impTabla td input[type='radio']{float:right}.cuadros{display:none;color:#FFF;padding:8px 0;width:100%}.mzs{border:0;padding:3px;border-radius:2px;color:#FFF;font-weight:bold;cursor:pointer}.tJug{float:right}.cInput{margin-top:-2px;float:left}#notifications-wrapper > a{width:17px!important;margin: 0 3px -4px;}#header-stats-wrapper{width:370px}#stripes{margin: -8px auto 10px;padding: 5px 0}#fluid-menu-opener > div.sport-line, #top-wrapper-sport-line{background: #5d5b5f none repeat scroll 0 0}.quicklink{background-color:#4A4A4A;border-radius:4px;box-shadow:0 0 1px 0 #000;color:#FFF;display:inline-block;margin-left:4px;padding:2px 4px;text-decoration:none;}.quicklink:hover{background-color: #000000;box-shadow: 0 0 2px 0 #000000;color: #FFFFFF;text-decoration: none;}.quicklinks{padding:0 4px 8px;text-align:center}#notifications-wrapper{bottom: -2px}.atajoExtInt{padding-top:10px}#pt-wrapper{bottom:5.4em!important}.externalSc{margin-top:-10px;margin-bottom:2px}#contImpuestos{clear:both}table.playerTableC td{background-color: transparent!important;border: 0 none!important};";
  71. if (typeof GM_addStyle != "undefined") {
  72. GM_addStyle(css);
  73. } else if (typeof PRO_addStyle != "undefined") {
  74. PRO_addStyle(css);
  75. } else if (typeof addStyle != "undefined") {
  76. addStyle(css);
  77. } else {
  78. var heads = document.getElementsByTagName("head");
  79. if (heads.length > 0) {
  80. var node = document.createElement("style");
  81. node.type = "text/css";
  82. node.appendChild(document.createTextNode(css));
  83. heads[0].appendChild(node);
  84. }
  85. }
  86. })();
  87. function collapseExpand(divs) {
  88. var divObject = document.getElementById(divs);
  89. if (divObject.className == "divVisible") {
  90. divObject.className = "divHidden";
  91. } else {
  92. divObject.className = "divVisible";
  93. }
  94. }
  95. atajoForo('p=forum&sub=topics&forum_id=254&sport=soccer', 'MER', 'Ir a Mercado', 0);
  96. atajoForo('p=forum&sub=topics&forum_id=249&sport=soccer', 'AMI', 'Ir a Amistosos', 1);
  97. atajoForo('p=forum&sub=topics&forum_id=253&sport=soccer', 'MZH', 'Ir a MZ Habla', 1);
  98. atajoForo('p=forum&sub=topics&forum_id=255&sport=soccer', 'PYR', 'Ir a Preguntas y Respuestas', 1);
  99. atajoForo('p=forum&sub=topics&forum_id=250&sport=soccer', 'DA', 'Ir a Discusión Abierta', 1);
  100. atajoForo('p=forum&sub=topics&forum_id=251&sport=soccer', 'FED', 'Ir a Federaciones', 1);
  101. atajoExtInt('http://i.imgur.com/7Uttzyv.gif', '?p=transfer&sub=yourplayers', 'Ir al Monitoreo', 0);
  102. atajoExtInt('http://i.imgur.com/DRf7WGm.gif', '?p=shortlist', 'Ir a Seguimiento', 1);
  103. atajoExtInt('http://i.imgur.com/LhtVqWQ.gif', '?p=players&sub=alt', 'Ver Vista Alternativa', 1);
  104. atajoExtInt('http://i.imgur.com/gG2hhct.gif', 'http://www.mzplus.info/p', 'Ir al Skiller', 1);
  105. atajoExtInt('http://i.imgur.com/G40I9gQ.gif', 'http://imgur.com/', 'Ir a Imgur', 1);
  106. atajoExtInt('http://i.imgur.com/V1vgq9d.gif', '?p=economy', 'Ver Finanzas', 1);
  107. atajoExtInt('http://i.imgur.com/jzbCTLE.gif', '?p=transfer', 'Ver Mercado', 1);
  108. atajoExtInt('http://i.imgur.com/eqx7dq1.gif', 'http://www.mzplus.info/tax', 'Calcular Impuestos', 1);
  109. atajoExtInt('http://i.imgur.com/TzYBzYW.gif', '?p=match&sub=played', 'Ver los Partidos Jugados', 1);
  110. atajoExtInt('http://i.imgur.com/p7ZMKSw.gif', '?p=match&sub=scheduled', 'Ver los Próximos Partidos', 1);
  111. atajoExtInt('http://i.imgur.com/1hvSw7g.gif', '?p=tactics&myTactic=1', 'Ir a Tácticas', 1);
  112. atajoExtInt('http://i.imgur.com/v3RoRU6.gif', '?p=players&sub=unavailable', 'Ver Lesionados/Sancionados', 1);
  113. atajoExtInt('http://i.imgur.com/K3PXtyE.gif', '?p=training_report', 'Ver el Reporte de Entrenamiento', 1);
  114. atajoExtInt('http://i.imgur.com/1qQmgOp.gif', '?p=training', 'Ir al Entrenamiento General', 1);
  115. var url = window.location.href.split("=");
  116. var cid = url[3];
  117. if (url[1] == "private_cup&sub" || url[1] == "cup&sub" || (url[2] == "u18" || url[2] == "u21" || url[2] == "u23" || url[2] == "world" || url[2] == "u18_world")) {
  118. var cp = (url[1] == "private_cup&sub") ? 1 : 0;
  119. var extraMundial = (url[2] == "u18" || url[2] == "u21" || url[2] == "u23" || url[2] == "world" || url[2] == "u18_world") ? 1 : 0;
  120. var id = cp ? 'mostrarTabla3' : extraMundial ? 'mostrarTabla2' : 'mostrarTabla';
  121. var setterCountry;
  122. $('#ui-id-4').click(function () {
  123. setterCountry = setInterval(function () {
  124. divCountry();
  125. verProgMatch(cid, cp);
  126. addBtnMostrarTabla(id);
  127. }, 1000);
  128. });
  129. if (extraMundial) {
  130. setterCountry = setInterval(function () {
  131. addBtnMostrarTabla(id);
  132. }, 1000);
  133. }
  134. }
  135. function addBtnMostrarTabla(id) {
  136. var groupContainer = $(".nice_table thead tr.seriesHeader")[0];
  137. if (typeof groupContainer !== 'undefined') {
  138. clearInterval(setterCountry);
  139. var iconMostrarTabla = "<img src='http://i.imgur.com/B69WEGD.png' id='" + id + "' class='cursor' title='Compartir tabla' />";
  140. var thContainer = groupContainer.childNodes[1];
  141. thContainer.innerHTML = iconMostrarTabla;
  142. }
  143. }
  144. function verProgMatch(cid, cp) {
  145. var equipos = $(".nice_table tbody > tr");
  146. var filas = equipos.length;
  147. var tid = 0, fila, i, hrefN;
  148. for (i = 0; i < filas; i++) {
  149. fila = equipos[i].cells[1];
  150. tid = fila.childNodes[0].href.split("&")[1].replace("tid=", "");
  151. if (cp)
  152. hrefN = "?p=private_cup&sub=schedule&cid=" + cid.toString() + "&tid=" + tid.toString() + "&cuptype=partner";
  153. else
  154. hrefN = "?p=cup&sub=schedule&cid=" + cid.toString() + "&tid=" + tid.toString();
  155. var fixt = document.createElement("span");
  156. fixt.setAttribute('style', 'float:right');
  157. fixt.innerHTML = '<a href="' + hrefN + '" target="_blank" title="Ver Programa de Partidos"><img src="http://i.imgur.com/ECRix0U.png" /></a>';
  158. fila.appendChild(fixt);
  159. }
  160. }
  161. function divCountry() {
  162. var groupContainer = $('#group-stages');
  163. if (typeof groupContainer !== 'undefined') {
  164. clearInterval(setterCountry);
  165. var tablaHeader = $(".nice_table thead tr.seriesHeader")[0];
  166. var icon = tablaHeader.childNodes[3];
  167. var addIcon = document.createElement("img");
  168. addIcon.setAttribute('src', 'http://i.imgur.com/IwaQRmF.png');
  169. addIcon.setAttribute('style', 'float:right;cursor:pointer');
  170. addIcon.setAttribute('title', 'Ver división y país');
  171. addIcon.setAttribute('id', 'divCountry');
  172. icon.appendChild(addIcon);
  173. var flag = false;
  174. $("#divCountry").click(function () {
  175. if (!flag) {
  176. flag = true;
  177. $(".team_link").parent().width("35%");
  178. $(".nice_table").css('border-right', '1px solid #BBBBBB');
  179. $(".nice_table").css('border-bottom', '1px solid #BBBBBB');
  180. var header = tablaHeader.childNodes[4];
  181. var headerNew = document.createElement("th");
  182. headerNew.setAttribute('id', 'divCountryC');
  183. headerNew.innerHTML = "Div - País";
  184. header.parentNode.insertBefore(headerNew, header);
  185. var equipos = $(".nice_table tbody > tr");
  186. var filas = equipos.length;
  187. var equipoId = 0, fila, i;
  188. for (i = 0; i < filas; i++) {
  189. fila = equipos[i];
  190. equipoId = fila.cells[1].childNodes[0].href.split("&")[1].replace("tid=", "");
  191. xmlhttp = new XMLHttpRequest();
  192. xmlhttp.open("GET", "/xml/manager_data.php?sport_id=1&team_id=" + equipoId.toString(), false);
  193. xmlhttp.send();
  194. xmlDoc = xmlhttp.responseXML;
  195. var divNum = xmlDoc.getElementsByTagName("Team")[0].getAttribute('seriesName');
  196. var country = xmlDoc.getElementsByTagName("UserData")[0].getAttribute('countryShortname');
  197. var newCell = document.createElement("td");
  198. newCell.innerHTML = divNum + " - " + country;
  199. var place = fila.cells[2];
  200. place.parentNode.insertBefore(newCell, place);
  201. }
  202. }
  203. });
  204. }
  205. }
  206. var url = window.location.href.split('=');
  207. if (url[1] == "training_report") {
  208. var flag = 1;
  209. if (flag) {
  210. var setter = setInterval(function () {
  211. trainingBalls();
  212. }, 1000);
  213. }
  214. function trainingBalls() {
  215. var container = document.getElementById("training_report");
  216. if (container == null) {
  217. clearInterval(setter);
  218. }
  219. if (container.childElementCount > 0 && flag) {
  220. flag = 0;
  221. var tbody = container.childNodes[2].childNodes[3];
  222. var I, totalP = tbody.rows.length;
  223. for (I = 0; I < totalP; I++) {
  224. // if (container.childNodes[I].innerHTML != undefined) {
  225. var finalContainer = tbody.rows[I].cells[4].childNodes[0];
  226. var numBalls = document.createElement('span');
  227. numBalls.setAttribute("style", "float:right; font-weight: bold");
  228. numBalls.innerHTML = '(' + finalContainer.childElementCount + ')';
  229. finalContainer.appendChild(numBalls);
  230. finalContainer.style.width = '125px';
  231. // }
  232. }
  233. }
  234. }
  235. }
  236. var url = window.location.href.split('=');
  237. if (url[1] == "transfer") {
  238. var stats = document.getElementById("transfer_stats");
  239. var general = document.getElementById("general_search");
  240. var atri = document.getElementById("attributes_search");
  241. var filter = document.getElementById("filters_search");
  242. stats.style.display = "none";
  243. general.style.display = "none";
  244. atri.style.display = "none";
  245. filter.style.display = "none";
  246. }
  247. var url2 = window.location.href.split('&');
  248. if (url2[1] == "sub=players") {
  249. var stats = document.getElementById("transfer_stats");
  250. var search = document.getElementById("transfer_search");
  251. stats.style.display = "none";
  252. search.style.display = "none";
  253. }
  254. function crearFirma() {
  255. var guardando = document.getElementById("areaFirma").value;
  256. guardando = guardando.replace(/^(\s|\&nbsp;)*|(\s|\&nbsp;)*$/g, "");
  257. if (guardando == '' || guardando == null || guardando.lenght == 0) {
  258. alert("No ha ingresado firma");
  259. return false;
  260. } else {
  261. var armando = '\n\n\n\n\n\n\n' + '▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬' + '\n' + guardando;
  262. localStorage.setItem('firmaMZ', armando);
  263. alert("Su firma se ha creado exitosamente");
  264. }
  265. }
  266. function mostrarFirma() {
  267. var cFirma = localStorage.getItem('firmaMZ');
  268. if (cFirma == null || cFirma == '') {
  269. alert("No tiene ninguna firma creada");
  270. return false;
  271. }
  272. var url = window.location.href.split('=');
  273. var area = "message"
  274. obj = document.getElementsByName(area)[0];
  275. var textoActual = obj.value;
  276. obj.value = textoActual + cFirma;
  277. }
  278. function firmaSiempre() {
  279. var firmasi = document.getElementById('mostrarY').checked;
  280. localStorage.setItem('mostrar', firmasi);
  281. }
  282. function firmaCont(tabla) {
  283. var filaFirma = tabla.insertRow(5);
  284. var firmaBar = "<td></td><td><div class='mzbtn buttondiv button_account' title='Crear Firma'><span class='buttonClassMiddle'><span style='white-space: nowrap' id='boton3'>Crear Firma</span></span><span class='buttonClassRight'>&nbsp;</span></div>&nbsp;";
  285. firmaBar += "<div class='mzbtn buttondiv button_account' title='Crear Firma'><span class='buttonClassMiddle'><span style='white-space: nowrap' id='btnMostrar'>Mostrar Firma</span></span><span class='buttonClassRight'>&nbsp;</span></div>&nbsp;";
  286. firmaBar += "<b>Mostrar firma siempre?</b> <input type='checkbox' title='Mostrar Firma Siempre' alt='Mostrar Firma' id='mostrarY'><br />";
  287. firmaBar += "<div id='divFirma' class='divHidden'><img src='http://i915.photobucket.com/albums/ac355/ccc_vader/botones/imagen2_btn2.png' title='Insertar imagen' alt='Insertar img' id='btni'/>&nbsp;";
  288. firmaBar += "<img src='http://i915.photobucket.com/albums/ac355/ccc_vader/botones/negrita_btn2.png' title='Negrita' alt='Negrita' id='btnn'/>&nbsp;";
  289. firmaBar += "<img src='http://i915.photobucket.com/albums/ac355/ccc_vader/botones/cursiva_btn2.png' title='Cursiva' alt='Cursiva' id='btnc'/>&nbsp;";
  290. firmaBar += "<img src='http://i915.photobucket.com/albums/ac355/ccc_vader/botones/subra_btn2.png' title='Subrayado' alt='Subrayado' id='btns'/><br />";
  291. firmaBar += "<textarea id='areaFirma' name='areaFirma' rows='5' cols='50'></textarea><br />";
  292. firmaBar += "<img src='http://i915.photobucket.com/albums/ac355/ccc_vader/bot/btn_save.gif' title='Guardar Firma' alt='Guardar firma' id='btnFirma' class='cursor' /></div></td>";
  293. filaFirma.innerHTML = filaFirma.innerHTML + firmaBar;
  294. }
  295. function firmaFija() {
  296. var mostrarsi = localStorage.getItem('mostrar');
  297. if (mostrarsi == 'true') {
  298. var area = "forum_form_message";
  299. var posteo = document.getElementById(area);
  300. posteo.innerHTML = posteo.innerHTML + mostrarFirma();
  301. }
  302. }
  303. function upload(file) {
  304. if (!file || !file.type.match(/image.*/)) {
  305. document.getElementById("error").style.display = "block";
  306. document.getElementById("pe").style.display = "none";
  307. document.getElementById("link").style.display = "none";
  308. } else {
  309. document.getElementById("pe").style.display = "block";
  310. document.getElementById("link").style.display = "none";
  311. document.getElementById("error").style.display = "none";
  312. var fd = new FormData();
  313. fd.append("image", file);
  314. var xhr = new XMLHttpRequest();
  315. xhr.open("POST", "https://api.imgur.com/3/upload.json");
  316. if (ext != null) {
  317. var ext = document.getElementById("subidor").value;
  318. var parte = ext.split(".");
  319. } else {
  320. var ext = file.name;
  321. var parte = ext.split(".");
  322. }
  323. xhr.onload = function () {
  324. document.getElementById("error").style.display = "none";
  325. document.getElementById("pe").style.display = "none";
  326. document.getElementById("link").style.display = "block";
  327. var xts = parte[1];
  328. if (xts == 'bmp' || xts == 'tiff')
  329. xts = 'png';
  330. var parseresp = JSON.parse(xhr.responseText);
  331. var imgUrl = parseresp.data.link;
  332. document.querySelector("#link").innerHTML = "<a href='" + imgUrl + "'>" + imgUrl + "</a>";
  333. }
  334. xhr.setRequestHeader('Authorization', 'Client-ID 4306d20a28c0e7a');
  335. xhr.send(fd);
  336. }
  337. }
  338. function preventDef(event) {
  339. event.preventDefault();
  340. }
  341. function uploadImage(event) {
  342. upload(event.dataTransfer.files[0]);
  343. }
  344. function subirImagen() {
  345. var estilo = document.getElementById("contenedor").style.display;
  346. if (estilo == 'none' && window.opera) {
  347. document.getElementById("contenedor").innerHTML = "<span style='color:red;padding:3px'> Opera no soporta la posibilidad de subir imágenes directamente. <br /><span style='color:green'>&nbsp;Firefox sí, apoya una web libre! <a href='https://affiliates.mozilla.org/link/banner/12520/3/18'><img src='http://affiliates-cdn.mozilla.org/media/uploads/banners/download-small-blue-ES.png' class='cursor' /></a></span></span>";
  348. document.getElementById("contenedor").style.display = "block";
  349. } else if (estilo == 'none') {
  350. document.getElementById("contenedor").style.display = "block";
  351. } else {
  352. document.getElementById("contenedor").style.display = "none";
  353. }
  354. }
  355. function armaCodigo(tag, cubo) {
  356. obj = document.getElementsByName(cubo)[0];
  357. var scroll = obj.scrollTop;
  358. var inicio = obj.selectionStart;
  359. var fin = obj.selectionEnd;
  360. obj.value = obj.value.substr(0, inicio) + '[' + tag + ']' + obj.value.substr(inicio, fin - inicio) + '[/' + tag + ']' + obj.value.substr(fin, obj.value.length);
  361. obj.scrollTop = scroll;
  362. }
  363. function addImagen(caja) {
  364. var imagen = prompt('Ingrese URL/link de la imagen');
  365. var intentos = 0;
  366. var preUrl = '[image url=';
  367. var posUrl = ']';
  368. var rtdo = '';
  369. var obj = document.getElementsByName(caja)[0];
  370. var scroll = obj.scrollTop;
  371. var inicio = obj.selectionStart;
  372. var fin = obj.selectionEnd;
  373. if (imagen != '') {
  374. img = new Image();
  375. img.src = imagen;
  376. if ((img.height == 0) || (img.width == 0)) {
  377. while (!((img.height == 0) || (img.width == 0)) && intentos < 5) {
  378. for (pausa = 0; pausa < 100; pausa++) {
  379. }
  380. img.src = imagen;
  381. }
  382. }
  383. if ((img.height == 0) || (img.width == 0)) {
  384. alert('El link/URL: ' + imagen + ' no es una imagen, y no será convertido.');
  385. } else {
  386. rtdo += preUrl + imagen + posUrl;
  387. obj.value = obj.value.substr(0, inicio) + rtdo + obj.value.substr(fin, obj.value.length);
  388. }
  389. }
  390. obj.scrollTop = scroll;
  391. }
  392. function posteaIcono(url, area) {
  393. var obj = document.getElementsByName(area)[0];
  394. var scroll = obj.scrollTop;
  395. var inicio = obj.selectionStart;
  396. var fin = obj.selectionEnd;
  397. obj.value = obj.value.substr(0, inicio) + '[image url=' + url + ']' + obj.value.substr(fin, obj.value.length);
  398. obj.scrollTop = scroll;
  399. }
  400. function posteaTabla(area) {
  401. var dato = prompt('Ingrese el usuario para la liga oficial o el ID de la liga amistosa');
  402. var obj = document.getElementsByName(area)[0];
  403. var scroll = obj.scrollTop;
  404. var inicio = obj.selectionStart;
  405. var fin = obj.selectionEnd;
  406. if (dato == '') {
  407. alert('No ha ingresado correctamente el usuario/id. Vuelva a intentarlo, por favor.');
  408. } else if (dato == null) {
  409. return false;
  410. } else if (isNaN(dato) == true) {
  411. obj.value = obj.value.substr(0, inicio) + '[image url=http://www.mzplus.info/imgdin_liga?user=' + dato + ']' + obj.value.substr(fin, obj.value.length);
  412. } else {
  413. obj.value = obj.value.substr(0, inicio) + '[image url=http://www.mzplus.info/imgdin_liga?user=&idla=' + dato + ']' + obj.value.substr(fin, obj.value.length);
  414. }
  415. obj.scrollTop = scroll;
  416. }
  417. function mostrarTabla(which) {
  418. var tabla = document.getElementById("divTabla");
  419. if (tabla) {
  420. collapseExpand("divTabla");
  421. return false;
  422. }
  423. var tablaDeTorneo = $(".nice_table tbody > tr");
  424. var controlDiv = document.getElementById("divCountryC");
  425. var header;
  426. if (controlDiv)
  427. header = "<i>[table][th][/th][th]Equipo[/th][th]Div - País[/th][th]PJ[/th][th]PG [/th][th]PE[/th][th]PP[/th][th]GF[/th][th]GC [/th][th]=[/th][th]Pts[/th]";
  428. else
  429. header = "<i>[table][th][/th][th]Equipo[/th][th]PJ[/th][th]PG [/th][th]PE[/th][th]PP[/th][th]GF[/th][th]GC [/th][th]=[/th][th]Pts[/th]";
  430. var armarLineas = "<div style='font-weight:normal'><b>Tabla - copiar todo el texto</b> <img src='http://i.imgur.com/BzYADnz.png' id='cerrar' style='float:right' class='cursor' title='Cerrar' /><br /> <br />" + header;
  431. var tablaDeTorneoL = tablaDeTorneo.length;
  432. for (var line = 0; line < tablaDeTorneoL; line++) {
  433. var trs = tablaDeTorneo[line];
  434. if (trs.cells[0].childNodes[0].tagName != "IMG") {
  435. armarLineas += "[tr][td]" + trs.cells[0].textContent + "[/td][td]" + trs.cells[1].textContent + "[/td][td]" + trs.cells[2].textContent + "[/td][td]";
  436. armarLineas += trs.cells[3].textContent + "[/td][td]" + trs.cells[4].textContent + "[/td][td]" + trs.cells[5].textContent + "[/td][td]";
  437. armarLineas += trs.cells[6].textContent + "[/td][td]" + trs.cells[7].textContent + "[/td][td]" + trs.cells[8].textContent + "[/td][td]";
  438. armarLineas += trs.cells[9].textContent + "[/td]";
  439. if (controlDiv)
  440. armarLineas += "[td]" + trs.cells[10].textContent + "[/td]";
  441. armarLineas += "[/tr]";
  442. }
  443. }
  444. armarLineas += "[/table]</i></div>";
  445. var divContenedora = document.createElement('div');
  446. divContenedora.setAttribute('id', 'divTabla');
  447. divContenedora.setAttribute('style', 'z-index:10; position:absolute; background-color:#000; color:#FFF; width:450px; height: auto; padding:10px;');
  448. divContenedora.setAttribute('class', 'divVisible');
  449. divContenedora.innerHTML = armarLineas;
  450. if (which == 'copa') {
  451. posTabla = document.evaluate('//*[@id="mostrarTabla"]', document, null, XPathResult.ANY_TYPE, null);
  452. } else if (which == 'privada') {
  453. posTabla = document.evaluate('//*[@id="mostrarTabla3"]', document, null, XPathResult.ANY_TYPE, null);
  454. } else {
  455. posTabla = document.evaluate('//*[@id="mostrarTabla2"]', document, null, XPathResult.ANY_TYPE, null);
  456. }
  457. ins = posTabla.iterateNext();
  458. ins.parentNode.insertBefore(divContenedora, ins);
  459. }
  460. var flagR = false;
  461. function verResultados() {
  462. try {
  463. if (flagR) {
  464. alert("No hay nada para cargar. Gracias, vuelva prontos!")
  465. return;
  466. }
  467. flagR = true;
  468. $("#fixtures-results-list > dd").each(function (idx, elm) {
  469. var elem = $(elm);
  470. var elemBtns = elem.find('dl.action-panel a');
  471. console.log('elemBtns', elemBtns);
  472. var enJuego = elemBtns.length;
  473. console.log('elemBtns length', elemBtns.length);
  474. if (idx > 0 && typeof (elemBtns[0]) === "undefined")
  475. return false;
  476. if (enJuego > 2) {
  477. var idMatch = elemBtns[0].href.split('&')[3].split('=')[1];
  478. xmlhttp = new XMLHttpRequest();
  479. xmlhttp.open("GET", "/xml/match_info.php?sport_id=1&match_id=" + idMatch.toString(), false);
  480. xmlhttp.send();
  481. xmlDoc = xmlhttp.responseXML;
  482. var gol1 = xmlDoc.getElementsByTagName("Team")[0].getAttribute('goals');
  483. var gol2 = xmlDoc.getElementsByTagName("Team")[1].getAttribute('goals');
  484. var res = document.createElement('div');
  485. res.setAttribute('style', 'float:right; font-weight: bold;padding-left: 3px');
  486. res.setAttribute('id', 'visible');
  487. res.innerHTML = gol1;
  488. var res2 = document.createElement('div');
  489. res2.setAttribute('style', 'float:left; font-weight: bold;padding-right: 3px');
  490. res2.innerHTML = gol2;
  491. elem.find('dd.home-team-column > a.clippable').before(res);
  492. elem.find('dd.away-team-column img').before(res2);
  493. }
  494. });
  495. } catch (e) {
  496. console.log(e);
  497. }
  498. }
  499. var url = window.location.href.split('&');
  500. if (url[1] == "sub=scheduled") {
  501. var container = document.getElementById('matchListForm').childNodes[1];
  502. var btnRes = document.createElement('div');
  503. btnRes.setAttribute('style', 'float:right;cursor:pointer;border:2px solid #2A4CB0;width:20px;height:20px;padding:4px 0 0 4px;margin:2px 165px 0 0');
  504. btnRes.setAttribute('id', 'btnRes');
  505. btnRes.innerHTML = "<img src='http://i.imgur.com/WL38HPq.png' title='Ver resultados' />";
  506. container.appendChild(btnRes);
  507. document.getElementById("btnRes").addEventListener("click", verResultados, false);
  508. }
  509. function saveCu() {
  510. var radioButtons = document.getElementsByName("moneda");
  511. for (var i = 0; i < radioButtons.length; i++) {
  512. if (radioButtons[i].checked) {
  513. var moneda = radioButtons[i].value;
  514. if (moneda != null) {
  515. localStorage.setItem('moneda', moneda);
  516. switch (moneda) {
  517. case "4":
  518. localStorage.setItem('sigla', 'UYU');
  519. break;
  520. case "13":
  521. localStorage.setItem('sigla', 'MXN');
  522. break;
  523. case "15":
  524. localStorage.setItem('sigla', 'BOB');
  525. break;
  526. }
  527. alert("Opción Moneda guardada");
  528. collapseExpand("divTabla");
  529. return false;
  530. }
  531. }
  532. }
  533. alert("No ha seleccionado ninguna opción");
  534. }
  535. function saveTact() {
  536. var radioButtons = document.getElementsByName("tactica");
  537. for (var i = 0; i < radioButtons.length; i++) {
  538. if (radioButtons[i].checked) {
  539. var tactica = radioButtons[i].value;
  540. if (tactica != null) {
  541. localStorage.setItem('tactica', tactica);
  542. alert("Opción Táctica guardada");
  543. collapseExpand("divTabla");
  544. return false;
  545. }
  546. }
  547. }
  548. alert("No ha seleccionado ninguna opción");
  549. }
  550. function resetCu() {
  551. localStorage.removeItem("moneda");
  552. localStorage.removeItem("sigla");
  553. alert("Moneda reseteada a USD");
  554. collapseExpand("divTabla");
  555. return false;
  556. }
  557. function setearMoneda() {
  558. var tabla = document.getElementById("divTabla");
  559. if (tabla) {
  560. collapseExpand("divTabla");
  561. return false;
  562. }
  563. var divContenedora = document.createElement('div');
  564. divContenedora.setAttribute('id', 'divTabla');
  565. divContenedora.setAttribute('style', 'z-index:10;position:absolute;background-color:#000;color:#FFF;width:165px;height:auto;padding:10px;border:2px solid red');
  566. divContenedora.setAttribute('class', 'divVisible');
  567. divContenedora.innerHTML = "<img src='http://i.imgur.com/BzYADnz.png' id='cerrar' style='float:right' class='cursor' title='Cerrar' /><table align='center'><tr><td class='tdStyle' colspan='2' style='font-size:13px'>Moneda local</td></tr><tr><td class='tdStyle tJug'>MXN </td><td><input type='radio' value='13' name='moneda' class='cInput' /></td><tr><td class='tdStyle tJug'>UYU </td><td> <input type='radio' value='4' name='moneda' class='cInput' /></td></tr><tr><td class='tdStyle tJug'>BOB </td><td><input type='radio' value='15' name='moneda' class='cInput' /></td></tr><tr><td style='padding-top:10px' colspan='2'><button id='saveCu' class='mzbtn button_account mzs'>Guardar</button>&nbsp;<button id='resetCu' class='mzbtn button_account mzs'>Reset</button></td></tr></table>";
  568. divContenedora.innerHTML += "<br /> <table align='center'><tr><td colspan='2' class='tdStyle' style='font-size:13px'>Mostrar táctica</td></tr><tr><td class='tdStyle tJug'>Vertical </td><td><input type='radio' name='tactica' value='1' class='cInput' /></td></tr><tr><td class='tdStyle tJug'>Horizontal </td><td><input type='radio' name='tactica' value='0' class='cInput' /></td></tr><tr><td colspan='2' style='padding-top:10px'><button id='saveTact' class='mzbtn button_account mzs'>Guardar</button></td></tr></table><span style='font-style:italic;font-size:11px;float:right'>MZScript ©</span>";
  569. var ins = document.getElementById("contentDiv");
  570. ins.parentNode.insertBefore(divContenedora, ins);
  571. document.getElementById("saveCu").addEventListener("click", saveCu, false);
  572. document.getElementById("resetCu").addEventListener("click", resetCu, false);
  573. document.getElementById("saveTact").addEventListener("click", saveTact, false);
  574. }
  575. var url = window.location.href.split('&');
  576. if (url[1] == "sub=played" && typeof url[2] == "undefined" || url[1] == "sub=played" && url[2] == "hidescore=1") {
  577. var container = document.getElementById('matchListForm').childNodes[1];
  578. var btnMon = document.createElement('div');
  579. btnMon.setAttribute('style', 'float:right;cursor:pointer;border:2px solid #2A4CB0;width:20px;height:20px;padding:4px 0 0 4px;margin:2px 165px 0 0');
  580. btnMon.setAttribute('id', 'btnMon');
  581. btnMon.innerHTML = "<img src='http://i.imgur.com/wU57xHb.png' title='Setear moneda y táctica' />";
  582. container.appendChild(btnMon);
  583. document.getElementById("btnMon").addEventListener("click", setearMoneda, false);
  584. }
  585. function convertir(valorP, origen) {
  586. var alsek = new Array(7.4234, 9.1775, 1, 1, 0.256963, 2.62589, 13.35247, 1.23522, 1.07245, 5.86737, 5.70899, 5.66999, 1.6953, 0.68576, 2.64445, 0.939, 0.001309, 0.26313, 1.95278, 0.10433, 4.70738, 1.23733, 7.4234, 0.17079, 0.03896, 0.24946, 0.06, 0.17, 1);
  587. var valor_origen = valorP;
  588. var enseks = 1 / alsek[origen];
  589. var cMoneda = localStorage.getItem('moneda');
  590. if (cMoneda) {
  591. v = Math.round(1 / alsek[cMoneda] * valor_origen / enseks);
  592. } else {
  593. v = Math.round(1 / alsek[0] * valor_origen / enseks);
  594. }
  595. return v;
  596. }
  597. function getValues(idUno, idDos) {
  598. var cont = 0, pos, teamId, sport, index;
  599. while (cont < 2) {
  600. var titular = 1;
  601. if (cont == 0) {
  602. pos = 1;
  603. teamId = idUno;
  604. index = 0;
  605. } else {
  606. pos = 2;
  607. teamId = idDos;
  608. index = 1;
  609. }
  610. if (ajaxSport == 'soccer')
  611. sport = 1;
  612. else
  613. return;
  614. try {
  615. var xmlhttp = new XMLHttpRequest();
  616. xmlhttp.open("GET", "/xml/team_playerlist.php?sport_id=" + sport + "&team_id=" + teamId.toString(), false);
  617. xmlhttp.send();
  618. var xmlDoc = xmlhttp.responseXML;
  619. var tablaDeEquipoHeader = $("#match-statistics .hitlist_wrapper_background table thead")[index];
  620. if (tablaDeEquipoHeader == null) {
  621. cont = 2;
  622. return false;
  623. }
  624. var nombre = document.createElement('td');
  625. nombre.setAttribute('style', 'font-weight: bold;');
  626. nombre.innerHTML = "Valor MZ";
  627. var trName = tablaDeEquipoHeader.parentNode.rows[0].cells[0];
  628. trName.parentNode.insertBefore(nombre, trName);
  629. var tablaDeEquipoBody = $("#match-statistics .hitlist_wrapper_background table tbody")[index];
  630. var jugador, total = 0, tablaDeEquipoL = tablaDeEquipoBody.rows.length;
  631. for (jugador = 1; jugador < tablaDeEquipoL; jugador++) {
  632. try {
  633. var celdaControl = tablaDeEquipoBody.rows[jugador].cells[0].childNodes[0].tagName;
  634. if (celdaControl == 'IMG') {
  635. tablaDeEquipoBody.rows[jugador].cells[0].colSpan = "13";
  636. } else if (celdaControl != 'IMG' || typeof celdaControl != "undefined") {
  637. var celda = tablaDeEquipoBody.rows[jugador].cells[1];
  638. var idPlayer = celda.childNodes[1].childNodes[1].href.split('&')[1].split('=')[1];
  639. var totalXml = xmlDoc.getElementsByTagName("Player").length;
  640. for (var p = 0; p < totalXml; p++) {
  641. var idP = xmlDoc.getElementsByTagName("Player")[p].getAttribute('id');
  642. if (idPlayer == idP) {
  643. var valorP = xmlDoc.getElementsByTagName("Player")[p].getAttribute('value');
  644. var currency = xmlDoc.getElementsByTagName("TeamPlayers")[0].getAttribute('teamCurrency');
  645. var cMoneda = localStorage.getItem('moneda');
  646. var cSigla = localStorage.getItem('sigla');
  647. if ((cMoneda && currency != cSigla) || (!cMoneda && currency != "USD")) {
  648. switch (currency) {
  649. case "USD":
  650. valorP = convertir(valorP, 0);
  651. break;
  652. case "EUR":
  653. valorP = convertir(valorP, 1);
  654. break;
  655. case "SEK":
  656. valorP = convertir(valorP, 2);
  657. break;
  658. case "MM":
  659. valorP = convertir(valorP, 3);
  660. break;
  661. case "UYU":
  662. valorP = convertir(valorP, 4);
  663. break;
  664. case "R$":
  665. valorP = convertir(valorP, 5);
  666. break;
  667. case "GBP":
  668. valorP = convertir(valorP, 6);
  669. break;
  670. case "DKK":
  671. valorP = convertir(valorP, 7);
  672. break;
  673. case "NOK":
  674. valorP = convertir(valorP, 8);
  675. break;
  676. case "CHF":
  677. valorP = convertir(valorP, 9);
  678. break;
  679. case "CAD":
  680. valorP = convertir(valorP, 10);
  681. break;
  682. case "AUD":
  683. valorP = convertir(valorP, 11);
  684. break;
  685. case "ILS":
  686. valorP = convertir(valorP, 12);
  687. break;
  688. case "MXN":
  689. valorP = convertir(valorP, 13);
  690. break;
  691. case "ARS":
  692. valorP = convertir(valorP, 14);
  693. break;
  694. case "BOB":
  695. valorP = convertir(valorP, 15);
  696. break;
  697. case "PYG":
  698. valorP = convertir(valorP, 16);
  699. break;
  700. case "RUB":
  701. valorP = convertir(valorP, 17);
  702. break;
  703. case "PLN":
  704. valorP = convertir(valorP, 18);
  705. break;
  706. case "ISK":
  707. valorP = convertir(valorP, 19);
  708. break;
  709. case "BGL":
  710. case "BGN":
  711. valorP = convertir(valorP, 20);
  712. break;
  713. case "ZAR":
  714. valorP = convertir(valorP, 21);
  715. break;
  716. case "US$":
  717. valorP = convertir(valorP, 22);
  718. break;
  719. case "THB":
  720. valorP = convertir(valorP, 23);
  721. break;
  722. case "SIT":
  723. valorP = convertir(valorP, 24);
  724. break;
  725. case "SKK":
  726. valorP = convertir(valorP, 25);
  727. break;
  728. case "JPY":
  729. valorP = convertir(valorP, 26);
  730. break;
  731. case "INR":
  732. valorP = convertir(valorP, 27);
  733. break;
  734. case "MZ":
  735. valorP = convertir(valorP, 28);
  736. break;
  737. }
  738. }
  739. var valorCont = document.createElement('td');
  740. valorCont.setAttribute('style', 'width:62px;text-align:right;padding-right:15px');
  741. valorCont.innerHTML = puntosMiles(valorP);
  742. var ins = tablaDeEquipoBody.rows[jugador].cells[0];
  743. ins.parentNode.insertBefore(valorCont, ins);
  744. if (titular <= 11) {
  745. total = total + parseInt(valorP);
  746. }
  747. titular++;
  748. p = xmlDoc.getElementsByTagName("Player").length;
  749. }
  750. if (p == (totalXml - 1)) {
  751. var valorCont = document.createElement('td');
  752. valorCont.setAttribute('style', 'width:62px;text-align:right;padding-right:15px');
  753. valorCont.innerHTML = " -";
  754. var ins = tablaDeEquipoBody.rows[jugador].cells[0];
  755. ins.parentNode.insertBefore(valorCont, ins);
  756. }
  757. }
  758. }
  759. } catch (e) {
  760. console.log(e);
  761. }
  762. }
  763. if (typeof idP != "undefined") {
  764. var trFinal = tablaDeEquipoBody.parentNode.childNodes[5].rows[1].cells[0];
  765. var empty = document.createElement('div');
  766. empty.setAttribute('style', 'font-weight:bold;width:65px;text-align:right');
  767. empty.innerHTML = puntosMiles(total);
  768. ;
  769. trFinal.parentNode.insertBefore(empty, trFinal);
  770. tablaDeEquipoBody.parentNode.childNodes[5].rows[3].cells[0].colSpan = "13";
  771. }
  772. cont++;
  773. } catch (e) {
  774. console.log(e);
  775. }
  776. }
  777. }
  778. function puntosMiles(number) {
  779. number = number.toString();
  780. var result = "";
  781. while (number.length > 3) {
  782. result = "." + number.substr(number.length - 3) + result;
  783. number = number.substring(0, number.length - 3);
  784. }
  785. result = number + result;
  786. return result;
  787. }
  788. var url = window.location.href.split('&');
  789. if (url[1] == "sub=stats" || url[1] == "sub=result") {
  790. var teams = $(".team-table").find('a:first');
  791. var teamOid = teams[0].href.split('&')[1].split('=')[1];
  792. var teamTid = teams[1].href.split('&')[1].split('=')[1];
  793. getValues(teamOid, teamTid);
  794. var tactValue = localStorage.getItem('tactica');
  795. if (tactValue == 1) {
  796. var css = "#tactic-board > img {margin-bottom: 0px;margin-top: 0px;transform: none;}";
  797. var heads = document.getElementsByTagName("head");
  798. if (heads.length > 0) {
  799. var node = document.createElement("style");
  800. node.type = "text/css";
  801. node.appendChild(document.createTextNode(css));
  802. heads[0].appendChild(node);
  803. }
  804. var refPoints = "<div style='width:80px;margin-left:25px'><p style='float:left;-webkit-margin-before:10px;-webkit-margin-after:0'><span class='mPoint amar'>&nbsp;</span> Local</p> <p style='clear:both'></p> <p style='float:left;margin-top:-5px!important;-webkit-margin-before:0;-webkit-margin-after:10px'><span class='mPoint black'>&nbsp;</span> Visitante</p></div>";
  805. $(refPoints).insertBefore('img.shadow');
  806. }
  807. }
  808. function comparar_por_partido(filas) {
  809. try {
  810. var jugados = (location.href.indexOf('played') != -1) ? 1 : 0;
  811. var miEquipoSched = Boolean(!(filas[0].getElementsByTagName('a')[0]));
  812. var inicio = (!jugados && miEquipoSched) ? 1 : 0;
  813. var filasL = filas.length;
  814. for (var i = inicio; i < filasL; i++) {
  815. if (filas[i].className == 'group')
  816. continue;
  817. var ad2 = document.createElement('a');
  818. ad2.innerHTML = '<img src=\"http://i.imgur.com/FCw8KRW.png\" title=\"Mirar rival en MZPlus\" border=\"0\" width=\"22\" width=\"13\" />';
  819. var vtm = filas[i].childNodes[3].childNodes[7].childNodes[1].childNodes[1].childNodes[1].href;
  820. if (vtm.indexOf('&tid') == -1) vtm = filas[i].childNodes[3].childNodes[7].childNodes[1].childNodes[5].childNodes[2].href;
  821. vtm = vtm.substring(vtm.indexOf('&tid'));
  822. vtm = vtm.replace('&tid=', '');
  823. ad2.setAttribute('href', 'http://www.mzplus.info/i?eq=' + vtm.toString());
  824. ad2.setAttribute('target', '_blank');
  825. ad2.setAttribute('style', 'margin-left:2px');
  826. filas[i].childNodes[3].childNodes[5].appendChild(ad2);
  827. }
  828. } catch (e) {
  829. console.log(e);
  830. }
  831. }
  832. if (location.href.indexOf('scheduled') != -1 || location.href.indexOf('played') != -1) {
  833. var filas = $("#fixtures-results-list > dd");
  834. comparar_por_partido(filas);
  835. }
  836. function mzs() {
  837. try {
  838. $("#top_item_help_sub .subpage_nav").append('<li><a href="https://greatest.deepsurf.us/scripts/1752-mzscript-por-ccc-vader-serbini-ini" target="_blank">MZ Script</a></li>');
  839. } catch (e) {
  840. console.log(e);
  841. }
  842. }
  843. mzs();
  844. function insertarSelect(elementID) {
  845. var divImg = document.createElement('div')
  846. divImg.setAttribute('id', 'contenedor');
  847. divImg.setAttribute('style', 'border: 5px solid green;font-weight:bold;display:none;width:380px;padding:5px; margin: 0 auto');
  848. divImg.innerHTML = 'Arrastre su imagen a este espacio <button id="btnUpImg">O clickee acá para elegirla</button> <input style="visibility: collapse; width: 0px;" id="subidor" type="file"><p id="error" style="font-weight:bold;color:red">Error. El archivo seleccionado no es una imagen.</p><p id="pe">Cargando imagen <img src="http://managerzone.se/img/loading.gif"> &nbsp;espere por favor.</p><a id="link"></a>';
  849. var ins = document.getElementById(elementID);
  850. ins.parentNode.insertBefore(divImg, ins);
  851. document.getElementById("btnUpImg").addEventListener("click", function () {
  852. return document.getElementById('subidor').click()
  853. }, false);
  854. document.getElementById("subidor").addEventListener("change", function () {
  855. return upload(this.files[0])
  856. }, false);
  857. document.getElementById("btnUpImg").addEventListener("click", preventDef, false);
  858. document.getElementById("contenedor").addEventListener("dragover", preventDef, false);
  859. document.getElementById("contenedor").addEventListener("drop", preventDef, false);
  860. document.getElementById("contenedor").addEventListener("drop", uploadImage, false);
  861. }
  862. function generarImagen(url, idImg, elementID, height) {
  863. var bimg;
  864. if (idImg == 'btnTabla2' || idImg == 'btnTabla2c') {
  865. bimg = document.createElement('div');
  866. bimg.setAttribute('class', 'mzbtn buttondiv button_account');
  867. bimg.setAttribute('title', 'Insertar Tabla LA-liga');
  868. bimg.setAttribute('style', 'margin-bottom:5px');
  869. bimg.innerHTML = "<span class='buttonClassMiddle'><span style='white-space: nowrap' id='" + idImg + "'>Tabla LA/liga</span></span><span class='buttonClassRight'>&nbsp;</span>&nbsp;";
  870. } else if (idImg == 'upImg' || idImg == 'upImgc') {
  871. bimg = document.createElement('div');
  872. bimg.setAttribute('class', 'mzbtn buttondiv button_account');
  873. bimg.setAttribute('title', 'Subir imágenes a ImgUr');
  874. bimg.innerHTML = "<span class='buttonClassMiddle'><span style='white-space: nowrap' id='" + idImg + "'>ImgUr</span></span><span class='buttonClassRight'>&nbsp;</span>&nbsp;";
  875. } else {
  876. bimg = document.createElement('img');
  877. bimg.setAttribute('src', url);
  878. bimg.setAttribute('id', idImg);
  879. }
  880. if (height != '')
  881. bimg.setAttribute('height', height + 'px');
  882. var ins = document.getElementById(elementID);
  883. ins.parentNode.insertBefore(bimg, ins);
  884. }
  885. function insBR(elementID) {
  886. var brr = document.createElement('br');
  887. var ins = document.getElementById(elementID);
  888. ins.parentNode.insertBefore(brr, ins);
  889. }
  890. function armaPanel(elementID) {
  891. var groupContainer = $("#" + elementID);
  892. if (typeof groupContainer !== 'undefined') {
  893. clearInterval(setterBC);
  894. var height = '';
  895. generarImagen('http://i.imgur.com/juiRdYs.gif', 'btnTabla2', elementID, height);
  896. generarImagen('http://i.imgur.com/HGa7jFa.gif', 'upImg', elementID, height);
  897. generarImagen('http://i.imgur.com/WOpvhpS.gif', 'aIcono0', elementID, height);
  898. generarImagen('http://i.imgur.com/CcuKTNz.gif', 'aIcono1', elementID, height);
  899. generarImagen('http://i.imgur.com/NPyAJM5.gif', 'aIcono2', elementID, height);
  900. generarImagen('http://i.imgur.com/1ncAraF.gif', 'aIcono3', elementID, height);
  901. generarImagen('http://i.imgur.com/xp6xUJJ.gif', 'aIcono4', elementID, height);
  902. generarImagen('http://i.imgur.com/qOigaWi.png', 'aIcono5', elementID, height);
  903. generarImagen('http://i.imgur.com/rSqmTPO.gif', 'aIcono6', elementID, height);
  904. generarImagen('http://i.imgur.com/uLyJYhu.png', 'aIcono7', elementID, height);
  905. generarImagen('http://i.imgur.com/RUQN2Hy.gif', 'aIcono8', elementID, height);
  906. generarImagen('http://i.imgur.com/QuXS7fE.gif', 'aIcono9', elementID, height);
  907. generarImagen('http://i.imgur.com/Bf8NC56.png', 'aIcono10', elementID, height);
  908. generarImagen('http://i.imgur.com/2L3i1f4.png', 'aIcono11', elementID, height);
  909. generarImagen('http://i.imgur.com/OOsLDaW.gif', 'aIcono12', elementID, height);
  910. generarImagen('http://i.imgur.com/HEAlBlA.png', 'aIcono13', elementID, height);
  911. generarImagen('http://i.imgur.com/O2GDd6I.png', 'aIcono14', elementID, height);
  912. insBR(elementID);
  913. generarImagen('http://i.imgur.com/zpY2A6I.gif', 'aIcono26', elementID, height);
  914. height = 15;
  915. generarImagen('http://i.imgur.com/RzjaSKr.gif', 'aIcono17', elementID, height);
  916. generarImagen('http://i.imgur.com/XEHiXuO.gif', 'aIcono18', elementID, height);
  917. generarImagen('http://i.imgur.com/1t7YpCo.gif', 'aIcono19', elementID, height);
  918. generarImagen('http://i.imgur.com/BzPDfzF.gif', 'aIcono20', elementID, height);
  919. generarImagen('http://i.imgur.com/UR5t0o6.gif', 'aIcono21', elementID, height);
  920. generarImagen('http://i.imgur.com/aaPvRo4.gif', 'aIcono23', elementID, height);
  921. generarImagen('http://i.imgur.com/KKx3thu.gif', 'aIcono25', elementID, height);
  922. generarImagen('http://i.imgur.com/KnhAURP.gif', 'aIcono27', elementID, height);
  923. generarImagen('http://i.imgur.com/NA84WqF.gif', 'aIcono28', elementID, height);
  924. generarImagen('http://i.imgur.com/N2cdFNy.gif', 'aIcono29', elementID, height);
  925. generarImagen('http://i.imgur.com/oQYWBTO.gif', 'aIcono30', elementID, height);
  926. generarImagen('http://i.imgur.com/YWe8hno.gif', 'aIcono31', elementID, height);
  927. generarImagen('http://i.imgur.com/8t9ZJse.gif', 'aIcono22', elementID, height);
  928. generarImagen('http://i.imgur.com/av8bxvU.gif', 'aIcono32', elementID, height);
  929. generarImagen('http://i.imgur.com/Q3B4Dqz.gif', 'aIcono15', elementID, height);
  930. generarImagen('http://i.imgur.com/vWFv3Gt.gif', 'aIcono16', elementID, height);
  931. insertarSelect(elementID);
  932. }
  933. }
  934. function atajoExtInt(urlImagen, urlPagina, titleImg, created) {
  935. if (!created) {
  936. var divC = document.createElement('div');
  937. divC.setAttribute('class', 'externalSc');
  938. divC.setAttribute('id', 'externalSc');
  939. var ins = document.getElementById('contentDiv');
  940. ins.parentNode.insertBefore(divC, ins);
  941. created = 1;
  942. }
  943. var ad = document.createElement('a');
  944. ad.setAttribute('href', urlPagina);
  945. ad.setAttribute('style', 'text-decoration:none; margin-bottom:0;margin-left:4px');
  946. ad.innerHTML = '<img src=\"' + urlImagen + '\" title=\"' + titleImg + '\" border=\"0\" class="atajoExtInt">\n';
  947. $('#externalSc').append(ad);
  948. }
  949. function atajoForo(urlPagina, text, titleImg, created) {
  950. if (!created) {
  951. var divC = document.createElement('div');
  952. divC.setAttribute('class', 'fbtn');
  953. divC.setAttribute('id', 'fbtn');
  954. document.getElementById('notifications-wrapper').appendChild(divC);
  955. created = 1;
  956. }
  957. var html = '<a class="quicklink" href="?' + urlPagina + '" title="' + titleImg + '" target="_blank">' + text + '</a>';
  958. $('#fbtn').append(html);
  959. }
  960. var url = window.location.href.split('=');
  961. var setterBC;
  962. if (url[1] == "guestbook&uid" || url[1] == "guestbook" || url[1] == "friendlyseries&sub") {
  963. if (url[1] != "friendlyseries&sub") {
  964. armaPanel('writeform');
  965. } else {
  966. $("#ui-id-5").click(function () {
  967. setterBC = setInterval(function () {
  968. armaPanel('writeform');
  969. }, 1000);
  970. });
  971. }
  972. }
  973. function transformar(dato) {
  974. switch (dato) {
  975. case '0':
  976. pelota = "http://static.managerzone.com/nocache-76/img/soccer/wlevel_0.gif";
  977. break;
  978. case '1':
  979. pelota = "http://static.managerzone.com/nocache-76/img/soccer/wlevel_1.gif";
  980. break;
  981. case '2':
  982. pelota = "http://static.managerzone.com/nocache-76/img/soccer/wlevel_2.gif";
  983. break;
  984. case '3':
  985. pelota = "http://static.managerzone.com/nocache-76/img/soccer/wlevel_3.gif";
  986. break;
  987. case '4':
  988. pelota = "http://static.managerzone.com/nocache-76/img/soccer/wlevel_4.gif";
  989. break;
  990. case '5':
  991. pelota = "http://static.managerzone.com/nocache-76/img/soccer/wlevel_5.gif";
  992. break;
  993. case '6':
  994. pelota = "http://static.managerzone.com/nocache-76/img/soccer/wlevel_6.gif";
  995. break;
  996. case '7':
  997. pelota = "http://static.managerzone.com/nocache-76/img/soccer/wlevel_7.gif";
  998. break;
  999. case '8':
  1000. pelota = "http://static.managerzone.com/nocache-76/img/soccer/wlevel_8.gif";
  1001. break;
  1002. case '9':
  1003. pelota = "http://static.managerzone.com/nocache-76/img/soccer/wlevel_9.gif";
  1004. break;
  1005. case '10':
  1006. pelota = "http://static.managerzone.com/nocache-76/img/soccer/wlevel_10.gif";
  1007. break;
  1008. }
  1009. return pelota;
  1010. }
  1011. var url = window.location.href.split('&');
  1012. var control = window.location.href.split('=');
  1013. var configAlt = localStorage.getItem("configAlt");
  1014. if (url[1] == "sub=alt" && control[2] == "alt") {
  1015. try {
  1016. $(document).ready(function () {
  1017. var flag = 0;
  1018. $(".leftnav").parent().after("<div style='color:#FFF;width:158px;height: 20px;border: 1px solid white; margin-top:10px; padding: 6px 0 0 5px;font-weight:bold' class='cursor' id='configBox'><span style='line-height:16px'>Configuración</span> <img src='http://i.imgur.com/pQqMK52.png' style='vertical-align: middle;float:right;padding-right:3px' /></div>");
  1019. $("#configBox").after("<div style='color:#FFF; text-align:center; margin-top: 10px;font-weight:bold' class='divHidden' id='configBoxFull'>Mostrar skiller <br /> Sí <input type='radio' value='1' name='configOpt' /> No <input type='radio' value='0' name='configOpt' /><br /><div class='mzbtn buttondiv button_account' style='margin-top:8px;box-shadow:none!important'><span class='buttonClassMiddle'><span id='saveConfig' style='white-space: nowrap'>Guardar</span></span><span class='buttonClassRight'>&nbsp;</span></div><br /><span style='font-style:italic;font-size:11px;float:right;font-weight:normal;margin-top:5px'>MZScript ©</span></div>");
  1020. $("#configBox").bind("click", function () {
  1021. collapseExpand("configBoxFull");
  1022. if (!flag) {
  1023. $("#configBox img").attr('src', 'http://i.imgur.com/j07tHtg.png');
  1024. flag = 1;
  1025. } else {
  1026. $("#configBox img").attr('src', 'http://i.imgur.com/pQqMK52.png');
  1027. flag = 0;
  1028. }
  1029. });
  1030. $("#saveConfig").click(saveConfig);
  1031. function saveConfig() {
  1032. var option = $("input[type='radio']:checked").val();
  1033. if (typeof option != "undefined") {
  1034. localStorage.setItem('configAlt', option);
  1035. alert("La configuración ha sido guardada");
  1036. }
  1037. }
  1038. });
  1039. } catch (e) {
  1040. }
  1041. if (configAlt == 1 || configAlt == null) {
  1042. var nocm = document.getElementById("skyscraper");
  1043. var htmlCountPost, tablaDeJugadores;
  1044. if (nocm) {
  1045. htmlCountPost = document.evaluate('/html/body/div[3]/div[4]/div[5]/div[2]/div[2]/div/div[2]/div[3]/div[2]/table/tbody', document, null, XPathResult.ANY_TYPE, null);
  1046. tablaDeJugadores = htmlCountPost.iterateNext();
  1047. } else {
  1048. htmlCountPost = document.evaluate('/html/body/div[3]/div[4]/div[5]/div[2]/div[2]/div/div[2]/div[3]/div[2]/table/tbody', document, null, XPathResult.ANY_TYPE, null);
  1049. tablaDeJugadores = htmlCountPost.iterateNext();
  1050. }
  1051. var tdjP = tablaDeJugadores.rows.length;
  1052. for (jugador = 0; jugador < tdjP; jugador++) {
  1053. var celda = tablaDeJugadores.rows[jugador].cells[0].innerHTML;
  1054. var numJug = tablaDeJugadores.rows[jugador].cells[0].innerHTML;
  1055. var nombreJug = tablaDeJugadores.rows[jugador].cells[1].childNodes[0].text;
  1056. var valorJug = tablaDeJugadores.rows[jugador].cells[2].childNodes[0].innerHTML;
  1057. var sueldoJug = tablaDeJugadores.rows[jugador].cells[3].childNodes[0].innerHTML;
  1058. var edadJug = tablaDeJugadores.rows[jugador].cells[4].innerHTML;
  1059. var season = tablaDeJugadores.rows[jugador].cells[5].innerHTML;
  1060. var vel = tablaDeJugadores.rows[jugador].cells[6].innerHTML;
  1061. var res = tablaDeJugadores.rows[jugador].cells[7].innerHTML;
  1062. var intel = tablaDeJugadores.rows[jugador].cells[8].innerHTML;
  1063. var pases = tablaDeJugadores.rows[jugador].cells[9].innerHTML;
  1064. var rem = tablaDeJugadores.rows[jugador].cells[10].innerHTML;
  1065. var cab = tablaDeJugadores.rows[jugador].cells[11].innerHTML;
  1066. var atajar = tablaDeJugadores.rows[jugador].cells[12].innerHTML;
  1067. var ctrl = tablaDeJugadores.rows[jugador].cells[13].innerHTML;
  1068. var ent = tablaDeJugadores.rows[jugador].cells[14].innerHTML;
  1069. var cruces = tablaDeJugadores.rows[jugador].cells[15].innerHTML;
  1070. var bp = tablaDeJugadores.rows[jugador].cells[16].innerHTML;
  1071. var expp = tablaDeJugadores.rows[jugador].cells[17].innerHTML;
  1072. var edof = tablaDeJugadores.rows[jugador].cells[18].innerHTML;
  1073. var nuevo = "&nbsp;<a class='ctooltip'><img src='http://i.imgur.com/xrFgj2d.png' style='cursor:pointer'><span><table cellpadding='0' cellspacing='0' style='width:300px' class='playerTableC'><tr><td width='290' colspan='2' style='font-weight: bold;color:#000060'>(" + numJug + ") " + nombreJug + "</td></tr><tr><td width='120'><b>Valor: </b>" + valorJug + "</td><td width='170'><b>Sueldo: </b>" + sueldoJug + "</td></tr><tr><td><b>Edad: </b>" + edadJug + "</td><td><b>Nacido Temp.: </b>" + season + "</td></tr><tr><td align='right' colspan='2'><i style='margin-right:8px'>MZScript ©</i></td></tr><tr><td width='170'><b>Velocidad </b></td><td><img src='" + transformar(vel) + "'> (" + vel + ")</td></tr><tr><td><b>Resistencia </b></td><td><img src='" + transformar(res) + "'> (" + res + ")</td></tr><tr><td><b>Inteligencia </b></td><td><img src='" + transformar(intel) + "'> (" + intel + ")</td></tr><tr><td><b>Pases </b></td><td><img src='" + transformar(pases) + "'> (" + pases + ")</td></tr><tr><td><b>Remates </b></td><td><img src='" + transformar(rem) + "'> (" + rem + ")</td></tr><tr><td><b>Cabeza </b></td><td><img src='" + transformar(cab) + "'> (" + cab + ")</td></tr><tr><td><b>Atajar </b></td><td><img src='" + transformar(atajar) + "'> (" + atajar + ")</td></tr><tr><td><b>Control </b></td><td><img src='" + transformar(ctrl) + "'> (" + ctrl + ")</td></tr><tr><td><b>Entradas </b></td><td><img src='" + transformar(ent) + "'> (" + ent + ")</td></tr><tr><td><b>Pases largos </b></td><td><img src='" + transformar(cruces) + "'> (" + cruces + ")</td></tr><tr><td><b>Balon parado </b></td><td><img src='" + transformar(bp) + "'> (" + bp + ")</td></tr><tr><td><b>Experiencia </b></td><td><img src='" + transformar(expp) + "'> (" + expp + ")</td></tr><tr><td><b>Edo. fisico </b></td><td><img src='" + transformar(edof) + "'> (" + edof + ")</td></tr></table></span></a>";
  1074. tablaDeJugadores.rows[jugador].cells[0].innerHTML = celda + nuevo;
  1075. }
  1076. }
  1077. }
  1078. function calculando35(nrodecaso) {
  1079. if (nrodecaso == '1') {
  1080. $("#cuadro1, #cuadro2, #cuadro5, #cuadro8").css('display', 'none');
  1081. $("#cuadro3, #cuadro4, #cuadro6, #cuadro7, #cuadro10,#cuadro11").css('display', 'block');
  1082. } else if (nrodecaso == '2') {
  1083. $("#cuadro3, #cuadro5").css('display', 'none');
  1084. $("#cuadro1, #cuadro2, #cuadro6, #cuadro7,#cuadro10,#cuadro4, #cuadro8,#cuadro11").css('display', 'block');
  1085. } else if (nrodecaso == '3') {
  1086. $("#cuadro1, #cuadro2, #cuadro8").css('display', 'none');
  1087. $("#cuadro6, #cuadro7,#cuadro10,#cuadro5,#cuadro3,#cuadro4,#cuadro11").css('display', 'block');
  1088. }
  1089. }
  1090. function calculando3(obj) {
  1091. var f = document.forms[obj]
  1092. var valorVenta = f.elements["vventa"].value.replace(/[^0-9]/g, "");
  1093. var valorMz = f.elements["vMz"].value.replace(/[^0-9]/g, "");
  1094. var impuesto, porcentaje;
  1095. var ganancia = valorVenta - valorMz;
  1096. var chequeado1 = document.getElementById('cel1').checked;
  1097. var chequeado2 = document.getElementById('cel2').checked;
  1098. var chequeado3 = document.getElementById('cel3').checked;
  1099. if (!chequeado1 && !chequeado2 && !chequeado3) {
  1100. alert("Error. Elija una opción.");
  1101. return false;
  1102. }
  1103. function fechaDif(diaVenta, mesVenta, anioVenta, diaCompra, mesCompra, anioCompra) {
  1104. mesVenta = mesVenta - 1;
  1105. mesCompra = mesCompra - 1;
  1106. var msecPerDay = 86400000;
  1107. var fechaVenta = new Date(anioVenta, mesVenta, diaVenta);
  1108. var fechaCompra = new Date(anioCompra, mesCompra, diaCompra);
  1109. fechaCompra = fechaCompra.getTime() / msecPerDay;
  1110. fechaVenta = fechaVenta.getTime() / msecPerDay;
  1111. var tot = fechaVenta - fechaCompra;
  1112. if (tot < 0) {
  1113. alert("Error con las fechas");
  1114. return -1;
  1115. }
  1116. return tot;
  1117. }
  1118. var cSigla = localStorage.getItem('sigla');
  1119. if (!cSigla)
  1120. cSigla = "USD";
  1121. if (chequeado1) {
  1122. if (valorVenta == null || valorVenta == "" || valorMz == null || valorMz == "") {
  1123. alert("Error. Debe completar todos los campos.");
  1124. return false;
  1125. }
  1126. if (ganancia > 0) {
  1127. porcentaje = "15%";
  1128. impuesto = Math.round((ganancia * 15) / 100);
  1129. rganancia = Math.round(valorVenta - impuesto);
  1130. rganancia = puntosMiles(rganancia) + " " + cSigla;
  1131. } else {
  1132. porcentaje = "-";
  1133. impuesto = "-";
  1134. rganancia = "No hay ganancia con esta venta, por lo que no aplica impuestos.";
  1135. }
  1136. } else if (chequeado2) {
  1137. var fechaCompra = f.elements["fcompra"].value;
  1138. var fechaVenta = f.elements["fventa"].value;
  1139. var valorCompra = f.elements["vcompra"].value.replace(/[^0-9]/g, "");
  1140.  
  1141. var partida = fechaCompra.split('-');
  1142. var diaCompra = partida[0];
  1143. var mesCompra = partida[1];
  1144. var anioCompra = partida[2];
  1145. var partida2 = fechaVenta.split('-');
  1146. var diaVenta = partida2[0];
  1147. var mesVenta = partida2[1];
  1148. var anioVenta = partida2[2];
  1149.  
  1150. if (valorVenta == null || valorVenta == "" || valorCompra == null || valorCompra == "" || fechaCompra == null || fechaCompra == "" || fechaVenta == null || fechaVenta == "") {
  1151. alert("Error. Debe completar todos los campos.");
  1152. return false;
  1153. }
  1154. var diferencia = fechaDif(diaVenta, mesVenta, anioVenta, diaCompra, mesCompra, anioCompra);
  1155. if (diferencia < 0)
  1156. return false;
  1157. ganancia = valorVenta - valorCompra;
  1158. if (ganancia > 0 && diferencia >= 71) {
  1159. porcentaje = "15%";
  1160. impuesto = Math.round((ganancia * 15) / 100);
  1161. rganancia = Math.round(valorVenta - impuesto);
  1162. rganancia = puntosMiles(rganancia) + " " + cSigla;
  1163. } else if (ganancia > 0 && diferencia >= 28 && diferencia <= 70) {
  1164. porcentaje = "50%";
  1165. impuesto = Math.round((ganancia * 50) / 100);
  1166. rganancia = Math.round(valorVenta - impuesto);
  1167. rganancia = puntosMiles(rganancia) + " " + cSigla;
  1168. } else if (ganancia > 0 && diferencia >= 0 && diferencia <= 27) {
  1169. porcentaje = "95%";
  1170. impuesto = Math.round((ganancia * 95) / 100);
  1171. rganancia = Math.round(parseInt(valorVenta - impuesto));
  1172. rganancia = puntosMiles(rganancia) + " " + cSigla;
  1173. } else if (ganancia <= 0) {
  1174. porcentaje = "-";
  1175. impuesto = "-";
  1176. rganancia = "No hay ganancia con esta venta, por lo que no aplica impuestos.";
  1177. }
  1178. } else if (chequeado3) {
  1179. var edad = f.elements["jEdad"].value;
  1180. if (valorVenta == null || valorVenta == "" || valorMz == null || valorMz == "" || edad == null || edad == "") {
  1181. alert("Error. Debe completar todos los campos.");
  1182. return false;
  1183. }
  1184. if (ganancia > 0 && edad == 19) {
  1185. porcentaje = "25%";
  1186. impuesto = Math.round((ganancia * 25) / 100);
  1187. rganancia = Math.round(valorVenta - impuesto);
  1188. rganancia = puntosMiles(rganancia) + " " + cSigla;
  1189. } else if (ganancia > 0 && edad == 20) {
  1190. porcentaje = "20%";
  1191. impuesto = Math.round((ganancia * 20) / 100);
  1192. rganancia = Math.round(valorVenta - impuesto);
  1193. rganancia = puntosMiles(rganancia) + " " + cSigla;
  1194. } else if (ganancia > 0 && edad >= 21) {
  1195. porcentaje = "15%";
  1196. impuesto = Math.round((ganancia * 15) / 100);
  1197. rganancia = Math.round(valorVenta - impuesto);
  1198. rganancia = puntosMiles(rganancia) + " " + cSigla;
  1199. } else if (edad <= 18) {
  1200. porcentaje = "-";
  1201. impuesto = "-";
  1202. rganancia = "No se puede vender, es juvenil";
  1203. } else {
  1204. porcentaje = "-";
  1205. impuesto = "-";
  1206. rganancia = "No hay ganancia con esta venta, por lo que no aplica impuestos.";
  1207. }
  1208. }
  1209. f.elements["cimpuestos"].value = puntosMiles(impuesto) + " " + cSigla;
  1210. f.elements["cimpuestosP"].value = porcentaje;
  1211. document.getElementById("cganancia").innerHTML = rganancia;
  1212. $("#cuadro9, #cganancia").css('display', 'block');
  1213. return true;
  1214. }
  1215. function soloNumeros(valor) {
  1216. valor.value = valor.value.replace(/[^0-9]/g, "");
  1217. }
  1218. function resetImpuestos() {
  1219. document.getElementById("fimpuestos").reset();
  1220. $("#cuadro9, #cganancia").css('display', 'none');
  1221. }
  1222. function mostrando() {
  1223. var exist = document.getElementById("contImpuestos");
  1224. if (exist) {
  1225. collapseExpand("contImpuestos");
  1226. return false;
  1227. }
  1228. var div = document.createElement('div')
  1229. div.setAttribute("id", "contImpuestos");
  1230. div.setAttribute("class", "divVisible");
  1231. div.setAttribute("style", "background-color:#000");
  1232. var contenido = '<div style="color:#FFF;font-weight:bold;padding: 15px 0 10px 0;text-align: center;font-size: 13px;width:100%">Calcular Impuestos</div>';
  1233. contenido += '<form name="fimpuestos" id="fimpuestos">';
  1234. contenido += '<table class="impTabla" style="width:100%;margin: 0 0 5px -5px"><tr><td>Jugador del club</td><td> <input type="radio" name="taxes" value="1" id="cel1"></td></tr> ';
  1235. contenido += '<tr><td>Jugador comprado </td><td><input type="radio" name="taxes" value="2" id="cel2"> </td></tr> ';
  1236. contenido += '<tr><td>Ex-juvenil </td><td><input type="radio" name="taxes" value="3" id="cel3"> </td></tr></table>';
  1237. contenido += '<div id="cuadro1" class="cuadros">Valor Compra<br /> ';
  1238. contenido += '<input id="vcompra" type="text" value="" name="vcompra"></div>';
  1239. contenido += '<div id="cuadro3" class="cuadros">Valor MZ<br /> ';
  1240. contenido += '<input id="vMz" type="text" value="" name="vMz" ></div>';
  1241. contenido += '<div id="cuadro4" class="cuadros">Valor Venta<br /> ';
  1242. contenido += '<input id="vventa" type="text" value="" name="vventa"></div>';
  1243. contenido += '<div id="cuadro2" class="cuadros">Fecha Compra<br /> ';
  1244. contenido += '<input type="text" placeholder="dd-mm-aaaa" value="" name="fcompra"></div>';
  1245. contenido += '<div id="cuadro8" class="cuadros">Fecha Venta<br />';
  1246. contenido += '<input type="text" placeholder="dd-mm-aaaa" value="" name="fventa"></div>';
  1247. contenido += '<div id="cuadro5" class="cuadros">Edad<br /> ';
  1248. contenido += '<input id="jEdad" type="text" name="jEdad"></div>';
  1249. contenido += '<div id="cuadro10" class="cuadros">Impuestos <i>(%)</i><br />';
  1250. contenido += '<input name="cimpuestosP" type="text" disabled=""></div>';
  1251. contenido += '<div id="cuadro6" class="cuadros">Impuestos <i>($)</i><br /> ';
  1252. contenido += '<input name="cimpuestos" disabled=""></div>';
  1253. contenido += '<div id="cuadro9" class="cuadros" style="display:none;font-weight:bold">Ingreso final</div> ';
  1254. contenido += '<div id="cganancia" style="color: #000;background-color: #FFF;margin:8px 8px 0;width:132px;padding:5px;text-align:center;font-weight:bold;display:none"></div></div>';
  1255. contenido += "<div style='padding:0 12px'><div id='cuadro7' style='display:none;text-align:center;float:left'><div class='mzbtn buttondiv button_account' style='margin-top:8px;box-shadow:none!important'><span class='buttonClassMiddle'><span id='cBoton' style='white-space: nowrap'>Calcular</span></span><span class='buttonClassRight'>&nbsp;</span></div></div></form>";
  1256. contenido += "<div id='cuadro11' style='display:none;text-align:center'><div class='mzbtn buttondiv button_account' style='margin-top:8px;box-shadow:none!important'><span class='buttonClassMiddle'><span id='resetBtn' style='white-space: nowrap'>Reset</span></span><span class='buttonClassRight'>&nbsp;</span></div></div></div></form>";
  1257. contenido += "<span style='font-style:italic;font-size:11px;float:right;color:#FFF;clear:both;background-color:#000'>MZScript ©</span>";
  1258. div.innerHTML = contenido;
  1259. $("#leftnav-wrapper").after(div);
  1260. var aniadoId1 = document.getElementById("cel1");
  1261. aniadoId1.addEventListener("click", function () {
  1262. calculando35(1)
  1263. }, false);
  1264. var aniadoId2 = document.getElementById("cel2");
  1265. aniadoId2.addEventListener("click", function () {
  1266. calculando35(2)
  1267. }, false);
  1268. var aniadoId4 = document.getElementById("cel3");
  1269. aniadoId4.addEventListener("click", function () {
  1270. calculando35(3)
  1271. }, false);
  1272. var aniadoId3 = document.getElementById("resetBtn");
  1273. aniadoId3.addEventListener("click", function () {
  1274. resetImpuestos()
  1275. }, false);
  1276. var aniadoId8 = document.getElementById("cBoton");
  1277. aniadoId8.addEventListener("click", function () {
  1278. calculando3("fimpuestos")
  1279. }, false);
  1280. var aniadoId5 = document.getElementById("vcompra");
  1281. aniadoId5.addEventListener("keyup", function () {
  1282. soloNumeros(this)
  1283. }, false);
  1284. var aniadoId6 = document.getElementById("vventa");
  1285. aniadoId6.addEventListener("keyup", function () {
  1286. soloNumeros(this)
  1287. }, false);
  1288. var aniadoId7 = document.getElementById("vMz");
  1289. aniadoId7.addEventListener("keyup", function () {
  1290. soloNumeros(this)
  1291. }, false);
  1292. }
  1293. var url = window.location.href.split('=');
  1294. if (url[1] == "players&pid") {
  1295. var contenedor = document.getElementById("thePlayers_0").childNodes[1].childNodes[1].childNodes[1].childNodes[5];
  1296. var btnImpuestos = document.createElement('a');
  1297. btnImpuestos.setAttribute("class", "mzbtn buttondiv button_blue");
  1298. btnImpuestos.innerHTML = '<span class="buttonClassMiddle"><span style="white-space: nowrap; cursor:pointer" id="imagenRed">Impuestos</span></span><span class="buttonClassRight">&nbsp;</span>';
  1299. contenedor.appendChild(btnImpuestos);
  1300. }
  1301. function botones(filaNueva) {
  1302. //var botones = '<td>CC-Bar</td><td>';
  1303. var botones = "<div class='mzbtn buttondiv button_account' title='Insertar Tabla LA-liga'><span class='buttonClassMiddle'><span style='white-space: nowrap' id='btnTabla'>Tabla LA/liga</span></span><span class='buttonClassRight'>&nbsp;</span></div>&nbsp;";
  1304. botones += "<div class='mzbtn buttondiv button_account' title='Subir imágenes a ImgUr'><span class='buttonClassMiddle'><span style='white-space: nowrap' id='upImg'>ImgUr</span></span><span class='buttonClassRight'>&nbsp;</span></div>&nbsp;&nbsp;";
  1305. botones += "<img src='http://i.imgur.com/3YitWv3.gif' alt='>' id='icono25'/>&nbsp;";
  1306. botones += "<img src='http://i.imgur.com/Q3B4Dqz.gif' title='(y)' alt='(y)' id='icono31'/>&nbsp;";
  1307. botones += "<img src='http://i.imgur.com/vWFv3Gt.gif' title='(n)' alt='(n)' id='icono32'/>&nbsp;";
  1308. botones += "<img src='http://i.imgur.com/jaT1cb4.gif' height='20px' title='wtf' alt='wtf' id='icono51'/>&nbsp;";
  1309. botones += "<img src='http://i.imgur.com/VfbyDHO.gif' height='20px' title='fail' alt='fail' id='icono44'/>&nbsp;";
  1310. botones += "<img src='http://i.imgur.com/cheJFuk.gif' height='20px' title='repost' alt='repost' id='icono45'/>&nbsp;";
  1311. botones += "<img src='http://i.imgur.com/jDjyKTf.gif' title='cri' alt='cri' id='icono52'/>&nbsp;";
  1312. botones += "<img src='http://i.imgur.com/6PopX5q.gif' title='ha-ha' alt='ha-ha' id='icono7'/>";
  1313. botones += "<img src='http://i.imgur.com/nRp5BpE.gif' title=':)' alt=':)' id='icono1'/>&nbsp;";
  1314. botones += "<img src='http://i.imgur.com/CcuKTNz.gif' title=':D' alt=':D' id='icono2'/>&nbsp;";
  1315. botones += "<img src='http://i.imgur.com/Dfl5ZGS.gif' title='D' alt='D' id='icono53'/>&nbsp;";
  1316. botones += "<img src='http://i.imgur.com/8t9ZJse.gif' title='xD' alt='xD' id='icono4'/>&nbsp;";
  1317. botones += "<img src='http://i.imgur.com/1kJhHCs.gif' title=':/' alt=':/' id='icono46'/>&nbsp;";
  1318. botones += "<img src='http://i.imgur.com/1ncAraF.gif' title=':(' alt=':(' id='icono5'/>&nbsp;";
  1319. botones += "<img src='http://i.imgur.com/xp6xUJJ.gif' title=':*(' alt=':*(' id='icono6'/>&nbsp;";
  1320. botones += "<img src='http://i.imgur.com/qOigaWi.png' title=':S' alt=':S' id='icono8'/>&nbsp;";
  1321. botones += "<img src='http://i.imgur.com/nITjZn5.gif' title='erm' alt='erm' id='icono9'/>&nbsp;";
  1322. botones += "<img src='http://i.imgur.com/rSqmTPO.gif' title='8-)' alt='8-)' id='icono10'/>&nbsp;";
  1323. botones += "<img src='http://i.imgur.com/qP1rAQ5.png' title='¬¬' alt='¬¬' id='icono11'/>&nbsp;";
  1324. botones += "<img src='http://i.imgur.com/HdNdWN0.png' title='porfi' alt='porfi' id='icono14'/>&nbsp;";
  1325. botones += "<img src='http://i.imgur.com/QuXS7fE.gif' title='O.O' alt='O.O' id='icono13'/>&nbsp;";
  1326. botones += "<img src='http://i.imgur.com/RUQN2Hy.gif' title='_hm' alt='_hm' id='icono50'/>&nbsp;<br>";
  1327. botones += "<img src='http://i.imgur.com/QLCdFIE.gif' title='>:(' alt='>:(' id='icono15'/>&nbsp;";
  1328. botones += "<img src='http://i.imgur.com/55sAO1r.gif' title='>:)' alt='>:)' id='icono16'/>&nbsp;";
  1329. botones += "<img src='http://i.imgur.com/KbQOSgw.gif' title='flirt' alt='flirt' id='icono17'/>&nbsp;";
  1330. botones += "<img src='http://i.imgur.com/t5dALqK.gif' title=':P' alt=':P' id='icono18'/>&nbsp;";
  1331. botones += "<img src='http://i.imgur.com/zpY2A6I.gif' title='|-(' alt='|-(' id='icono19'/>&nbsp;";
  1332. botones += "<img src='http://i.imgur.com/yPtUjin.gif' title=';)' alt=';)' id='icono20'/>&nbsp;";
  1333. botones += "<img src='http://i.imgur.com/OOsLDaW.gif' title='(h)' alt='(h)' id='icono21'/>&nbsp;";
  1334. botones += "<img src='http://i.imgur.com/LdCQyai.png' title='u.u' alt='u.u' id='icono22'/>&nbsp;";
  1335. botones += "<img src='http://i.imgur.com/KnhAURP.gif' title='shh' alt='shh' id='icono26'/>&nbsp;";
  1336. botones += "<img src='http://i.imgur.com/BzPDfzF.gif' title='nana' alt='nana' id='icono28'/>";
  1337. botones += "<img src='http://i.imgur.com/XEHiXuO.gif' height='23px' title='rock' alt='rock' id='icono33'/>";
  1338. botones += "<img src='http://i.imgur.com/CsCrOnE.gif' title='grr' alt='grr' id='icono36'/>&nbsp;";
  1339. botones += "<img src='http://i.imgur.com/K2d1Mbv.gif' height='23px' title='jaja' alt='jaja' id='icono37'/>";
  1340. botones += "<img src='http://i.imgur.com/SMcjsnf.gif' title='eah' alt='eah' id='icono29'/>";
  1341. botones += "<img src='http://i.imgur.com/aaPvRo4.gif' title='clap' alt='clap' id='icono30'/>";
  1342. botones += "<img src='http://i.imgur.com/av8bxvU.gif' title='bla' alt='bla' id='icono38'/>";
  1343. botones += "<img src='http://i.imgur.com/oQYWBTO.gif' title='l' alt='l' id='icono39'/>&nbsp;";
  1344. botones += "<img src='http://i.imgur.com/z64hDgz.gif' title='grr' alt='grr' id='icono35'/>&nbsp;";
  1345. botones += "<img src='http://i.imgur.com/NA84WqF.gif' title='angel' alt='angel' id='icono40'/>&nbsp;";
  1346. botones += "<img src='http://i.imgur.com/N2cdFNy.gif' title='diablo' alt='diablo' id='icono41'/>&nbsp;";
  1347. botones += "<img src='http://i.imgur.com/YWe8hno.gif' title='baba' alt='baba' id='icono42'/>";
  1348. botones += "<img src='http://i.imgur.com/1t7YpCo.gif' height='23px' title='x)' alt='x)' id='icono43'/>&nbsp;";
  1349. botones += "<img src='http://i.imgur.com/UR5t0o6.gif' title='plz' alt='plz' id='icono3'/>&nbsp;";
  1350. botones += "<img src='http://i.imgur.com/KKx3thu.gif' title='umm' alt='umm' id='icono27'/>";
  1351. botones += "<img src='http://i.imgur.com/sC8Mgmi.gif' title='facepalm' alt='facepalm' id='icono54'/>&nbsp;";
  1352. botones += "<img src='http://i.imgur.com/gJw92DZ.gif' title='zzz' alt='zzz' id='icono48'/>";
  1353. botones += "<img src='http://i.imgur.com/RzjaSKr.gif' title='om' alt='om' id='icono34'/>";
  1354. botones += "<img src='http://i.imgur.com/7iCxtYD.gif' title='uh' alt='uh' id='icono47'/><br />";
  1355. botones += '<div id="contenedor" style="border: 5px solid green;font-weight:bold;display:none;width:430px; padding:5px;margin:auto">Arrastre su imagen a este espacio <button id="btnUpImg">O clickee acá para elegirla</button> <input style="visibility: collapse; width: 0px;" id="subidor" type="file">';
  1356. botones += '<p id="error" style="font-weight:bold;color:red">Error. El archivo seleccionado no es una imagen.</p><p id="pe">Cargando imagen <img src="http://managerzone.se/img/loading.gif"> &nbsp;espere por favor.</p><p id="link"></p></div>';
  1357. filaNueva.innerHTML = botones;
  1358. }
  1359. function addevents() {
  1360. document.getElementById("btnUpImg").addEventListener("click", preventDef, false);
  1361. document.getElementById("contenedor").addEventListener("dragover", preventDef, false);
  1362. document.getElementById("contenedor").addEventListener("drop", preventDef, false);
  1363. document.getElementById("contenedor").addEventListener("drop", uploadImage, false);
  1364. document.getElementById("btnUpImg").addEventListener("click", function () {
  1365. return document.getElementById('subidor').click()
  1366. }, false);
  1367. document.getElementById("subidor").addEventListener("change", function () {
  1368. return upload(this.files[0])
  1369. }, false);
  1370. }
  1371. var setter;
  1372. function addCCbar() {
  1373. var bbcodeContainer = $('.bbcode');
  1374. if (typeof bbcodeContainer !== 'undefined') {
  1375. clearInterval(setter);
  1376. var btnContainer = document.createElement("div");
  1377. botones(btnContainer);
  1378. $('.bbcode').before(btnContainer);
  1379. addevents();
  1380. }
  1381. return false;
  1382. }
  1383. function setCCbar() {
  1384. setter = setInterval(function () {
  1385. addCCbar();
  1386. }, 1000);
  1387. }
  1388. var url = window.location.href.split('&');
  1389. if (url[1] == "sub=topics") {
  1390. setCCbar();
  1391. var mostrarsi = localStorage.getItem('mostrar');
  1392. if (mostrarsi == 'true') {
  1393. document.getElementById('mostrarY').click();
  1394. var btnSend = document.getElementById("send_btn").childNodes[1];
  1395. btnSend.addEventListener("click", function () {
  1396. firmaFija()
  1397. }, false);
  1398. }
  1399. }
  1400. var url = window.location.href.split('&');
  1401. if (url[1] == "sub=topics") {
  1402. var link;
  1403. $("#topics-list dl.clearfix > dd").each(function (idx, elm) {
  1404. if (elm.className == 'topics-col-title') {
  1405. link = $(elm).find('a').attr('href');
  1406. }
  1407. if (elm.className == 'topics-col-counter') {
  1408. var counter = $(elm)[0];
  1409. $(counter).find("span").remove();
  1410. var cant_posts = $(counter).text();
  1411. var split = cant_posts.split('/');
  1412. var total_posts = parseInt(split[1]);
  1413. if ($.isNumeric(total_posts)) {
  1414. var cantidadDePaginas = Math.floor(parseInt(total_posts) / 50);
  1415. var nuevo = "";
  1416. if (cantidadDePaginas > 0 && total_posts != 50)
  1417. nuevo += "<a title='Ir a la página 2' href='" + link + "&offset=50'>2</a>&#160;"
  1418. if (cantidadDePaginas > 1 && total_posts != 100)
  1419. nuevo += "<a title='Ir a la página 3' href='" + link + "&offset=100'>3</a>&#160;"
  1420. if (cantidadDePaginas > 2 && total_posts != 150)
  1421. nuevo += "<a title='Ir a la página 4' href='" + link + "&offset=150'>4</a>&#160;"
  1422. if (cantidadDePaginas > 3) {
  1423. var offset;
  1424. if (total_posts % 50 == 0)
  1425. offset = total_posts - 50;
  1426. else
  1427. offset = cantidadDePaginas * 50;
  1428. nuevo += "<a title='Ir a la última página' href='" + link + "&offset=" + offset + "'>&#187;</a>"
  1429. }
  1430. if (cantidadDePaginas > 0 && total_posts != 50)
  1431. nuevo = "&#160;[" + nuevo + "]";
  1432. counter.innerHTML = counter.innerHTML + nuevo;
  1433. }
  1434. }
  1435. });
  1436. } else if (url[1] == "sub=topic") {
  1437. setCCbar();
  1438. $(".forum_content dl.hitlist_dl.forum_body").each(function (idx, elm) {
  1439. var $elm = $(elm);
  1440. var author = $elm.find('.post-author');
  1441. var $author = $(author);
  1442. var p_link_container = $author.find('a');
  1443. var id = p_link_container.attr('href').split("&")[1].replace("uid=", "");
  1444. var nombre = p_link_container.text();
  1445. var foro = url[3].replace("forum_id=", "");
  1446. var badge = $elm.find('.forum-post-badges');
  1447. var equipo = $(badge).find('img').attr('src').split("=")[1].replace("&sport", "");
  1448. var shortc = "&nbsp;<a title='GB de " + nombre + "' href='/?p=guestbook&uid=" + id + "' style='color:black;text-decoration:none;border:1px solid;'><b>&nbsp;GB&nbsp;</b></a>&nbsp;" +
  1449. "&nbsp;<a title='MSG de " + nombre + "' id='c" + idx + "' style='color:black;text-decoration:none;border:1px solid;cursor:pointer;'><b>&nbsp;MSG&nbsp;</b></a>&nbsp;" +
  1450. "&nbsp;<a title='Ver posts últimos 7 días de " + nombre + "' href='/index.php?p=forum&sub=search&search_keywords=&search_keyword_type=any&search_author=" + nombre + "&search_forum=" + foro + "&search_range=7&search_sort_by=post_date&search_sort_order=desc' style='color:black;text-decoration:none;border:1px solid;'><b>&nbsp;POST&nbsp;</b></a>&nbsp;" +
  1451. "&nbsp;<a title='Enviar amistosos a " + nombre + "' href='/?p=team&sub=challenge&tid=" + equipo + "' style='color:black;text-decoration:none;border:1px solid;'><b>&nbsp;AMI&nbsp;</b></a>";
  1452. $author.append(shortc);
  1453. $('#c' + idx).click(function () {
  1454. mz.messenger.dialog(id);
  1455. });
  1456. });
  1457. }
  1458. document.addEventListener("click", function (event) {
  1459. switch (event.target.id) {
  1460. case "mostrarTabla":
  1461. mostrarTabla('copa');
  1462. break;
  1463. case "mostrarTabla2":
  1464. mostrarTabla('nocopa');
  1465. break;
  1466. case "mostrarTabla3":
  1467. mostrarTabla('privada');
  1468. break;
  1469. case "cerrar":
  1470. collapseExpand("divTabla");
  1471. break;
  1472. case "btnTabla":
  1473. posteaTabla('message');
  1474. break;
  1475. case "btnTabla2":
  1476. posteaTabla('msg');
  1477. break;
  1478. case "icono1":
  1479. posteaIcono('http://i.imgur.com/nRp5BpE.gif', 'message');
  1480. break;
  1481. case "icono2":
  1482. posteaIcono('http://i.imgur.com/CcuKTNz.gif', 'message');
  1483. break;
  1484. case "icono3":
  1485. posteaIcono('http://i.imgur.com/UR5t0o6.gif', 'message');
  1486. break;
  1487. case "icono4":
  1488. posteaIcono('http://i.imgur.com/8t9ZJse.gif', 'message');
  1489. break;
  1490. case "icono5":
  1491. posteaIcono('http://i.imgur.com/1ncAraF.gif', 'message');
  1492. break;
  1493. case "icono6":
  1494. posteaIcono('http://i.imgur.com/xp6xUJJ.gif', 'message');
  1495. break;
  1496. case "icono7":
  1497. posteaIcono('http://i.imgur.com/6PopX5q.gif', 'message');
  1498. break;
  1499. case "icono8":
  1500. posteaIcono('http://i.imgur.com/qOigaWi.png', 'message');
  1501. break;
  1502. case "icono9":
  1503. posteaIcono('http://i.imgur.com/nITjZn5.gif', 'message');
  1504. break;
  1505. case "icono10":
  1506. posteaIcono('http://i.imgur.com/rSqmTPO.gif', 'message');
  1507. break;
  1508. case "icono11":
  1509. posteaIcono('http://i.imgur.com/qP1rAQ5.png', 'message');
  1510. break;
  1511. case "icono12":
  1512. posteaIcono('http://i.imgur.com/j79wNCf.gif', 'message');
  1513. break;
  1514. case "icono13":
  1515. posteaIcono('http://i.imgur.com/QuXS7fE.gif', 'message');
  1516. break;
  1517. case "icono14":
  1518. posteaIcono('http://i.imgur.com/HdNdWN0.png', 'message');
  1519. break;
  1520. case "icono15":
  1521. posteaIcono('http://i.imgur.com/lbQHCKk.gif', 'message');
  1522. break;
  1523. case "icono16":
  1524. posteaIcono('http://i.imgur.com/55sAO1r.gif', 'message');
  1525. break;
  1526. case "icono17":
  1527. posteaIcono('http://i.imgur.com/KbQOSgw.gif', 'message');
  1528. break;
  1529. case "icono18":
  1530. posteaIcono('http://i.imgur.com/t5dALqK.gif', 'message');
  1531. break;
  1532. case "icono19":
  1533. posteaIcono('http://i.imgur.com/zpY2A6I.gif', 'message');
  1534. break;
  1535. case "icono20":
  1536. posteaIcono('http://i.imgur.com/yPtUjin.gif', 'message');
  1537. break;
  1538. case "icono21":
  1539. posteaIcono('http://i.imgur.com/OOsLDaW.gif', 'message');
  1540. break;
  1541. case "icono22":
  1542. posteaIcono('http://i.imgur.com/LdCQyai.png', 'message');
  1543. break;
  1544. case "icono25":
  1545. posteaIcono('http://i.imgur.com/3YitWv3.gif', 'message');
  1546. break;
  1547. case "icono26":
  1548. posteaIcono('http://i.imgur.com/KnhAURP.gif', 'message');
  1549. break;
  1550. case "icono27":
  1551. posteaIcono('http://i.imgur.com/KKx3thu.gif', 'message');
  1552. break;
  1553. case "icono28":
  1554. posteaIcono('http://i.imgur.com/BzPDfzF.gif', 'message');
  1555. break;
  1556. case "icono29":
  1557. posteaIcono('http://i.imgur.com/SMcjsnf.gif', 'message');
  1558. break;
  1559. case "icono30":
  1560. posteaIcono('http://i.imgur.com/aaPvRo4.gif', 'message');
  1561. break;
  1562. case "icono31":
  1563. posteaIcono('http://i.imgur.com/Q3B4Dqz.gif', 'message');
  1564. break;
  1565. case "icono32":
  1566. posteaIcono('http://i.imgur.com/vWFv3Gt.gif', 'message');
  1567. break;
  1568. case "icono33":
  1569. posteaIcono('http://i.imgur.com/XEHiXuO.gif', 'message');
  1570. break;
  1571. case "icono34":
  1572. posteaIcono('http://i.imgur.com/RzjaSKr.gif', 'message');
  1573. break;
  1574. case "icono35":
  1575. posteaIcono('http://i.imgur.com/z64hDgz.gif', 'message');
  1576. break;
  1577. case "icono36":
  1578. posteaIcono('http://i.imgur.com/CsCrOnE.gif', 'message');
  1579. break;
  1580. case "icono37":
  1581. posteaIcono('http://i.imgur.com/K2d1Mbv.gif', 'message');
  1582. break;
  1583. case "icono38":
  1584. posteaIcono('http://i.imgur.com/av8bxvU.gif', 'message');
  1585. break;
  1586. case "icono39":
  1587. posteaIcono('http://i.imgur.com/oQYWBTO.gif', 'message');
  1588. break;
  1589. case "icono40":
  1590. posteaIcono('http://i.imgur.com/NA84WqF.gif', 'message');
  1591. break;
  1592. case "icono41":
  1593. posteaIcono('http://i.imgur.com/N2cdFNy.gif', 'message');
  1594. break;
  1595. case "icono42":
  1596. posteaIcono('http://i.imgur.com/YWe8hno.gif', 'message');
  1597. break;
  1598. case "icono43":
  1599. posteaIcono('http://i.imgur.com/1t7YpCo.gif', 'message');
  1600. break;
  1601. case "icono44":
  1602. posteaIcono('http://i.imgur.com/VfbyDHO.gif', 'message');
  1603. break;
  1604. case "icono45":
  1605. posteaIcono('http://i.imgur.com/cheJFuk.gif', 'message');
  1606. break;
  1607. case "icono46":
  1608. posteaIcono('http://i.imgur.com/1kJhHCs.gif', 'message');
  1609. break;
  1610. case "icono47":
  1611. posteaIcono('http://i.imgur.com/7iCxtYD.gif', 'message');
  1612. break;
  1613. case "icono48":
  1614. posteaIcono('http://i.imgur.com/gJw92DZ.gif', 'message');
  1615. break;
  1616. case "icono49":
  1617. posteaIcono('http://i.imgur.com/92QYUDu.gif', 'message');
  1618. break;
  1619. case "icono50":
  1620. posteaIcono('http://i.imgur.com/RUQN2Hy.gif', 'message');
  1621. break;
  1622. case "icono51":
  1623. posteaIcono('http://i.imgur.com/jaT1cb4.gif', 'message');
  1624. break;
  1625. case "icono52":
  1626. posteaIcono('http://i.imgur.com/jDjyKTf.gif', 'message');
  1627. break;
  1628. case "icono53":
  1629. posteaIcono('http://i.imgur.com/Dfl5ZGS.gif', 'message');
  1630. break;
  1631. case "icono54":
  1632. posteaIcono('http://i.imgur.com/sC8Mgmi.gif', 'message');
  1633. break;
  1634. case "aIcono0":
  1635. posteaIcono('http://i.imgur.com/nRp5BpE.gif', 'msg');
  1636. break;
  1637. case "aIcono1":
  1638. posteaIcono('http://i.imgur.com/CcuKTNz.gif', 'msg');
  1639. break;
  1640. case "aIcono2":
  1641. posteaIcono('http://i.imgur.com/NPyAJM5.gif', 'msg');
  1642. break;
  1643. case "aIcono3":
  1644. posteaIcono('http://i.imgur.com/1ncAraF.gif', 'msg');
  1645. break;
  1646. case "aIcono4":
  1647. posteaIcono('http://i.imgur.com/xp6xUJJ.gif', 'msg');
  1648. break;
  1649. case "aIcono5":
  1650. posteaIcono('http://i.imgur.com/qOigaWi.png', 'msg');
  1651. break;
  1652. case "aIcono6":
  1653. posteaIcono('http://i.imgur.com/rSqmTPO.gif', 'msg');
  1654. break;
  1655. case "aIcono7":
  1656. posteaIcono('http://i.imgur.com/qP1rAQ5.png', 'msg');
  1657. break;
  1658. case "aIcono8":
  1659. posteaIcono('http://i.imgur.com/RUQN2Hy.gif', 'msg');
  1660. break;
  1661. case "aIcono9":
  1662. posteaIcono('http://i.imgur.com/QuXS7fE.gif', 'msg');
  1663. break;
  1664. case "aIcono10":
  1665. posteaIcono('http://i.imgur.com/Bf8NC56.png', 'msg');
  1666. break;
  1667. case "aIcono11":
  1668. posteaIcono('http://i.imgur.com/CZT1Eec.gif', 'msg');
  1669. break;
  1670. case "aIcono12":
  1671. posteaIcono('http://i.imgur.com/OOsLDaW.gif', 'msg');
  1672. break;
  1673. case "aIcono13":
  1674. posteaIcono('http://i.imgur.com/yPtUjin.gif', 'msg');
  1675. break;
  1676. case "aIcono14":
  1677. posteaIcono('http://i.imgur.com/LdCQyai.png', 'msg');
  1678. break;
  1679. case "aIcono15":
  1680. posteaIcono('http://i.imgur.com/Q3B4Dqz.gif', 'msg');
  1681. break;
  1682. case "aIcono16":
  1683. posteaIcono('http://i.imgur.com/vWFv3Gt.gif', 'msg');
  1684. break;
  1685. case "aIcono17":
  1686. posteaIcono('http://i.imgur.com/RzjaSKr.gif', 'msg');
  1687. break;
  1688. case "aIcono18":
  1689. posteaIcono('http://i.imgur.com/XEHiXuO.gif', 'msg');
  1690. break;
  1691. case "aIcono19":
  1692. posteaIcono('http://i.imgur.com/1t7YpCo.gif', 'msg');
  1693. break;
  1694. case "aIcono20":
  1695. posteaIcono('http://i.imgur.com/BzPDfzF.gif', 'msg');
  1696. break;
  1697. case "aIcono21":
  1698. posteaIcono('http://i.imgur.com/UR5t0o6.gif', 'msg');
  1699. break;
  1700. case "aIcono22":
  1701. posteaIcono('http://i.imgur.com/8t9ZJse.gif', 'msg');
  1702. break;
  1703. case "aIcono23":
  1704. posteaIcono('http://i.imgur.com/aaPvRo4.gif', 'msg');
  1705. break;
  1706. case "aIcono24":
  1707. posteaIcono('http://i.imgur.com/XdfJFFs.gif', 'msg');
  1708. break;
  1709. case "aIcono25":
  1710. posteaIcono('http://i.imgur.com/KKx3thu.gif', 'msg');
  1711. break;
  1712. case "aIcono26":
  1713. posteaIcono('http://i.imgur.com/zpY2A6I.gif', 'msg');
  1714. break;
  1715. case "aIcono27":
  1716. posteaIcono('http://i.imgur.com/KnhAURP.gif', 'msg');
  1717. break;
  1718. case "aIcono28":
  1719. posteaIcono('http://i.imgur.com/NA84WqF.gif', 'msg');
  1720. break;
  1721. case "aIcono29":
  1722. posteaIcono('http://i.imgur.com/N2cdFNy.gif', 'msg');
  1723. break;
  1724. case "aIcono30":
  1725. posteaIcono('http://i.imgur.com/oQYWBTO.gif', 'msg');
  1726. break;
  1727. case "aIcono31":
  1728. posteaIcono('http://i.imgur.com/YWe8hno.gif', 'msg');
  1729. break;
  1730. case "aIcono32":
  1731. posteaIcono('http://i.imgur.com/av8bxvU.gif', 'msg');
  1732. break;
  1733. case "imagenRed":
  1734. mostrando();
  1735. break;
  1736. case "imagenCer":
  1737. collapseExpand("contImpuestos");
  1738. break;
  1739. case "boton2":
  1740. collapseExpand("divColor");
  1741. break;
  1742. case "btnFirma":
  1743. crearFirma();
  1744. break;
  1745. case "btnMostrar":
  1746. mostrarFirma();
  1747. break;
  1748. case "boton3":
  1749. collapseExpand("divFirma");
  1750. break;
  1751. case "btni":
  1752. addImagen('areaFirma');
  1753. break;
  1754. case "btnn":
  1755. armaCodigo('b', 'areaFirma');
  1756. break;
  1757. case "btnc":
  1758. armaCodigo('i', 'areaFirma');
  1759. break;
  1760. case "btns":
  1761. armaCodigo('u', 'areaFirma');
  1762. break;
  1763. case "mostrarY":
  1764. firmaSiempre();
  1765. break;
  1766. case "upImg":
  1767. subirImagen();
  1768. break;
  1769. }
  1770. }, true);
  1771. }