Greasy Fork 还支持 简体中文。

Stats Xente Script

Example of description of statsxente

目前為 2024-05-02 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Stats Xente Script
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.68
  5. // @description Example of description of statsxente
  6. // @author xente
  7. // @match https://www.managerzone.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=managerzone.com
  9. // @grant GM_xmlhttpRequest
  10. // @grant GM_addStyle
  11. // @require https://code.jquery.com/jquery-3.7.1.js
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17.  
  18. GM_addStyle(`
  19. /* The Modal (background) test 2*/
  20. .modal {
  21. display: none;
  22. /* Hidden by default */
  23. position: fixed;
  24. /* Stay in place */
  25. z-index: 1;
  26. /* Sit on top */
  27. padding-top: 25px;
  28. /* Location of the box */
  29. left: 0;
  30. top: 0;
  31. width: 100%;
  32. /* Full width */
  33. height: 100%;
  34. /* Full height */
  35. overflow: auto;
  36. /* Enable scroll if needed */
  37. background-color: rgb(0, 0, 0);
  38. /* Fallback color */
  39. background-color: rgba(0, 0, 0, 0.75);
  40. /* Black w/ opacity */
  41. }
  42.  
  43. /* Modal Content */
  44. .modal-content {
  45. background-color: #fefefe00;
  46. margin: auto;
  47. padding: 20px;
  48. width: 95%;
  49. }
  50.  
  51. /* The Close Button */
  52. .close {
  53. color: #aaaaaa;
  54. float: right;
  55. font-size: 28px;
  56. font-weight: bold;
  57. }
  58.  
  59. .close:hover,
  60. .close:focus {
  61. color: #000;
  62. text-decoration: none;
  63. cursor: pointer;
  64. }
  65.  
  66.  
  67. /* The Modal (background) */
  68. .modal_1 {
  69. display: none;
  70. /* Hidden by default */
  71. position: fixed;
  72. /* Stay in place */
  73. z-index: 1;
  74. /* Sit on top */
  75. padding-top: 25px;
  76. /* Location of the box */
  77. left: 0;
  78. top: 0;
  79. width: 100%;
  80. /* Full width */
  81. height: 100%;
  82. /* Full height */
  83. overflow: auto;
  84. /* Enable scroll if needed */
  85. background-color: rgb(0, 0, 0);
  86. /* Fallback color */
  87. background-color: rgba(0, 0, 0, 0.75);
  88. /* Black w/ opacity */
  89. }
  90.  
  91. /* Modal Content */
  92. .modal-content_1 {
  93. background-color: #fefefe00;
  94. margin: auto;
  95. padding: 20px;
  96. width: 45%;
  97. }
  98.  
  99. /* The Close Button */
  100. .close_1 {
  101. color: #aaaaaa;
  102. float: right;
  103. font-size: 28px;
  104. font-weight: bold;
  105. }
  106.  
  107. .close_1:hover,
  108. .close_1:focus {
  109. color: #000;
  110. text-decoration: none;
  111. cursor: pointer;
  112. }
  113.  
  114. .modal_cargando {
  115. display: none;
  116. /* Hidden by default */
  117. position: fixed;
  118. /* Stay in place */
  119. z-index: 1;
  120. /* Sit on top */
  121. padding-top: 25px;
  122. /* Location of the box */
  123. left: 0;
  124. top: 0;
  125. width: 100%;
  126. /* Full width */
  127. height: 100%;
  128. /* Full height */
  129. overflow: auto;
  130. /* Enable scroll if needed */
  131. background-color: rgb(0, 0, 0);
  132. /* Fallback color */
  133. background-color: rgba(0, 0, 0, 0.75);
  134. /* Black w/ opacity */
  135. }
  136.  
  137. /* Modal Content */
  138. .modal-content_cargando {
  139. background-color: #fefefe00;
  140. padding-top: 15%;
  141. width: 95%;
  142. display: flex;
  143. justify-content: center;
  144. align-items: center;
  145. }
  146.  
  147. /* The Close Button */
  148. .close_cargando {
  149. color: #aaaaaa;
  150. float: right;
  151. font-size: 28px;
  152. font-weight: bold;
  153. }
  154.  
  155. .close_cargando:hover,
  156. .close_cargando:focus {
  157. color: #000;
  158. text-decoration: none;
  159. cursor: pointer;
  160. }
  161.  
  162. `);
  163.  
  164.  
  165.  
  166. var cats = {};
  167. cats["senior"] = "senior";
  168. cats["world"] = "seniorw";
  169. cats["u23"] = "SUB23";
  170. cats["u21"] = "SUB21";
  171. cats["u18"] = "SUB18";
  172. cats["u23_world"] = "SUB23w";
  173. cats["u21_world"] = "SUB21w";
  174. cats["u18_world"] = "SUB18w";
  175. window.cats=cats;
  176.  
  177.  
  178. var langs = new Map();
  179. langs.set('es', 'SPANISH');
  180. langs.set('ar', 'SPANISH')
  181. langs.set('en', 'ENGLISH');
  182. langs.set('br', 'PORTUGUES');
  183. langs.set('pt', 'PORTUGUES');
  184. langs.set('pl', 'POLISH');
  185. langs.set('ro', 'ROMANIAN');
  186. langs.set('tr', 'TURKISH');
  187.  
  188. var lanCookie = getCookie("MZLANG");
  189. if(langs.has(lanCookie)){
  190. window.lang=langs.get(lanCookie);
  191. }else{
  192. window.lang="ENGLISH";
  193. }
  194.  
  195. console.log(window.lang)
  196.  
  197.  
  198. // Ejemplo de uso
  199. var sportCookie = getCookie("MZSPORT");
  200. console.log(sportCookie);
  201. var lsport="F"
  202. if(sportCookie=="hockey"){
  203. lsport="H";
  204. }
  205. window.sport=sportCookie;
  206. window.lsport=lsport;
  207.  
  208.  
  209. document.addEventListener("DOMContentLoaded", function() {
  210. var urlParams = new URLSearchParams(window.location.search);
  211. if((urlParams.has('p')) && (urlParams.get('p') === 'league')){
  212.  
  213.  
  214. leagues();
  215.  
  216. }
  217.  
  218. if((urlParams.has('p')) && (urlParams.get('p') === 'federations')&& (urlParams.get('sub') === 'clash')){
  219.  
  220.  
  221. clash();
  222.  
  223. }
  224.  
  225.  
  226. });
  227.  
  228.  
  229. function clash(){
  230.  
  231. var badges = document.getElementsByClassName("fed_badge");
  232. var regex = /fid=(\d+)/;
  233. var srcLocal = badges[0].getAttribute('src');
  234. var local_id = srcLocal.match(regex);
  235. var src_away = badges[1].getAttribute('src');
  236. var away_id = src_away.match(regex);
  237.  
  238. var names = document.getElementsByClassName("name-score name-score--desktop text-ellipsis")
  239.  
  240.  
  241.  
  242.  
  243. var elems = document.getElementsByClassName("mainContent top-pane top-pane--desktop");
  244. var tabla = elems[0]
  245.  
  246. var contenidoNuevo="</br><center><table><tr><td class='subheader clearfix'>Clash Compare</td></tr><tr><td><center><img id=clashCompare src='https://i.imgur.com/G76Jm71.png' style='width:45px; height:45px;'/></center></td></tr></table></center>";
  247. tabla.insertAdjacentHTML('beforeend', contenidoNuevo)
  248.  
  249. document.getElementById("clashCompare").addEventListener('click', function () {
  250. var link = "https://statsxente.com/MZ1/Functions/loadClashFederationData.php?tamper=yes&fid="+local_id[1]+"&fid1="+away_id[1]+"&fede="+encodeURIComponent(names[0].innerText)+"&fede1="+encodeURIComponent(names[1].innerText)+"&idioma=SPANISH&divisa=EUR&sport=soccer";
  251. openWindow(link,0.95,1.25);
  252. });
  253.  
  254. }
  255.  
  256.  
  257. var teams_data="";
  258.  
  259. function leagues(){
  260. var initialValues = {};
  261. initialValues["senior"] = "valor";
  262. initialValues["world"] = "valor";
  263. initialValues["u23"] = "valor23";
  264. initialValues["u21"] = "valor21";
  265. initialValues["u18"] = "valor18";
  266. initialValues["u23_world"] = "valor23";
  267. initialValues["u21_world"] = "valor21";
  268. initialValues["u18_world"] = "valor18";
  269.  
  270. var nameInitialValues = {};
  271. nameInitialValues["senior"] = "Value";
  272. nameInitialValues["world"] = "Value";
  273. nameInitialValues["u23"] = "Value U23";
  274. nameInitialValues["u21"] = "Value U21";
  275. nameInitialValues["u18"] = "Value U18";
  276. nameInitialValues["u23_world"] = "Value U23";
  277. nameInitialValues["u21_world"] = "Value U21";
  278. nameInitialValues["u18_world"] = "Value U18";
  279.  
  280. var linkIds=""
  281. var urlParams = new URLSearchParams(window.location.search);
  282. setTimeout(function() {
  283.  
  284. var elems = document.getElementsByClassName("nice_table");
  285. var tabla = elems[0]
  286. var thSegundo = tabla.querySelector("thead th:nth-child(2)");
  287. thSegundo.style.width = "250px";
  288.  
  289.  
  290. var values = new Map();
  291.  
  292. // Agregar elementos al mapa
  293. values.set('valor23', 'Value U23');
  294. values.set('valor21', 'Value U21');
  295. values.set('valor18', 'Value U18');
  296. values.set('valorUPSenior', 'Value LM');
  297. values.set('valorUPSUB23', 'Value LM U23');
  298. values.set('valorUPSUB21', 'Value LM U21');
  299. values.set('valorUPSUB18', 'Value LM U18');
  300. values.set('valor11', 'TOP 11');
  301. values.set('valor11_23', 'TOP 11 U23');
  302. values.set('valor11_21', 'TOP 11 U21');
  303. values.set('valor11_18', 'TOP 11 U18');
  304. values.set('elo', 'ELO Score');
  305. values.set('elo23', 'ELO Score U23');
  306. values.set('elo21', 'ELO Score U21');
  307. values.set('elo18', 'ELO Score U18');
  308.  
  309. var contenidoNuevo = '<div id=testClick><center><table><tr><td><label><input class="statsxente" type="checkbox" id="valor" value="Value">Value</label></td>';
  310. values.forEach(function(valor, clave) {
  311. /*if(clave=="valorUPSenior"){
  312. contenidoNuevo+="</tr><tr>";
  313. }*/
  314. if(clave=="valor11"){
  315. contenidoNuevo+="</tr><tr>";
  316. }
  317. /* if(clave=="elo"){
  318. contenidoNuevo+="</tr><tr>";
  319. }*/
  320. contenidoNuevo+='<td><label><input class="statsxente" type="checkbox" value="'+valor+'" id="'+clave+'">'+valor+'</label></td>';
  321.  
  322. });
  323.  
  324.  
  325.  
  326. contenidoNuevo+="</tr></table></center></div>";
  327.  
  328.  
  329. values.set('valor', 'Value');
  330.  
  331. elems = document.getElementsByClassName("nice_table");
  332. tabla = elems[0]
  333.  
  334.  
  335. tabla.insertAdjacentHTML('beforebegin', contenidoNuevo);
  336.  
  337.  
  338.  
  339. values.forEach(function(valor, clave) {
  340.  
  341. var elemento = document.getElementById(clave);
  342. elemento.addEventListener('click', handleClick);
  343.  
  344. });
  345.  
  346.  
  347.  
  348. // Añadir una nueva celda en la fila de encabezados
  349. var nuevaCeldaEncabezado = document.createElement("th");
  350. nuevaCeldaEncabezado.textContent = "Stats Xente";
  351. nuevaCeldaEncabezado.style.backgroundColor="#246355"
  352. nuevaCeldaEncabezado.style.color="white"
  353. var ser = document.getElementsByClassName("seriesHeader")
  354. document.getElementsByClassName("seriesHeader")[0].appendChild(nuevaCeldaEncabezado);
  355.  
  356.  
  357. nuevaCeldaEncabezado = document.createElement("th");
  358. nuevaCeldaEncabezado.textContent = nameInitialValues[urlParams.get('type')];
  359. nuevaCeldaEncabezado.style.backgroundColor="#246355"
  360. nuevaCeldaEncabezado.style.color="white"
  361. ser = document.getElementsByClassName("seriesHeader")
  362. document.getElementsByClassName("seriesHeader")[0].appendChild(nuevaCeldaEncabezado);
  363.  
  364. // Añadir una nueva columna al final de cada fila de datos
  365. var contIds=0
  366. var filasDatos = tabla.getElementsByTagName("tbody")[0].getElementsByTagName("tr");
  367. for (var i = 0; i < filasDatos.length; i++) {
  368. var celda = tabla.rows[i+1].cells[1];
  369.  
  370. var equipo=celda.textContent.trim()
  371. var iniIndex = celda.innerHTML.indexOf("tid=");
  372. var lastIndex = celda.innerHTML.indexOf("\">", iniIndex+4);
  373. var data=String(celda.innerHTML)
  374. var id=data.substring(iniIndex+4,lastIndex)
  375. linkIds+="&idEquipo"+contIds+"="+id
  376. contIds++
  377. celda.innerHTML+="<input type='hidden' id='team_"+id+"' value='"+equipo+"'/>"
  378.  
  379.  
  380.  
  381.  
  382. var nuevaColumna = document.createElement("td");
  383. // var iner = "<img src='https://statsxente.com/MZ1/View/Images/detail.png' width='20px' height='20px' onclick=\"openModalStatsEquiposHistoricoFiltro1("+id+",'team_"+id+"','z_hola',77,77,'soccer')\"/>";
  384. var iner = "<img src='https://statsxente.com/MZ1/View/Images/detail.png' width='20px' height='20px' id='but"+id+"' style='cursor:pointer;'/>";
  385. iner += "<img src='https://statsxente.com/MZ1/View/Images/graph.png' width='20px' height='20px' id='but1"+id+"' style='cursor:pointer;'/>";
  386. iner += "<img src='https://statsxente.com/MZ1/View/Images/report.png' width='20px' height='20px' onclick=\"openModalStatsEquiposHistoricoFiltro1("+id+",'team_"+id+"','z_hola',77,77,'soccer')\"/>";
  387. var cat = cats[urlParams.get('type')]
  388. nuevaColumna.innerHTML=iner
  389. filasDatos[i].appendChild(nuevaColumna);
  390.  
  391. nuevaColumna = document.createElement("td");
  392.  
  393.  
  394. //var link="https://statsxente.com/MZ1/Graficos/graficoProgresoEquipo.php?idEquipo=276402&modal=yes&idioma=SPANISH&divisa=EUR&deporte=F"
  395.  
  396.  
  397.  
  398. (function (currentId,currentLSport,lang) {
  399. document.getElementById("but1" + currentId).addEventListener('click', function () {
  400. var link = "https://statsxente.com/MZ1/Graficos/graficoProgresoEquipo.php?idEquipo="+currentId+"&idioma="+lang+"&divisa=EUR&deporte="+currentLSport;
  401. openWindow(link,0.95,1.25);
  402. });
  403. })(id,window.lsport,window.lang);
  404.  
  405. (function (currentId, currentEquipo,currentCat,currentSport,lang) {
  406. document.getElementById("but" + currentId).addEventListener('click', function () {
  407. var link = "https://statsxente.com/MZ1/View/filtroStatsEquiposHistorico.php?tamper=yes&idEquipo=" + currentId + "&idioma="+lang+"&modal=yes&deporte="+currentSport+"&season=77&season_actual=77&categoria="+currentCat+"&equipo=" + currentEquipo + "&cerrar=no";
  408. openWindow(link,0.95,1.25);
  409. });
  410. })(id, equipo,cat,window.sport,window.lang);
  411.  
  412.  
  413.  
  414.  
  415. }
  416.  
  417. console.log(linkIds)
  418. GM_xmlhttpRequest({
  419. method: "GET",
  420. url: "https://statsxente.com/MZ1/Functions/tamper_teams.php?sport="+sport+linkIds,
  421. headers: {
  422. "Content-Type": "application/json"
  423. },
  424. onload: function(response) {
  425. var jsonResponse = JSON.parse(response.responseText);
  426.  
  427. teams_data=jsonResponse;
  428. var filasDatos = tabla.getElementsByTagName("tbody")[0].getElementsByTagName("tr");
  429. for (var i = 0; i < filasDatos.length; i++) {
  430. var celda = tabla.rows[i+1].cells[1];
  431.  
  432. var equipo=celda.textContent.trim()
  433. var iniIndex = celda.innerHTML.indexOf("tid=");
  434. var lastIndex = celda.innerHTML.indexOf("\">", iniIndex+4);
  435. var data=String(celda.innerHTML)
  436. var id=data.substring(iniIndex+4,lastIndex)
  437.  
  438.  
  439.  
  440. var nuevaColumna = document.createElement("td");
  441.  
  442.  
  443. if (jsonResponse[id] && jsonResponse[id][initialValues[urlParams.get('type')]] !== undefined) {
  444. var valor = new Intl.NumberFormat("es-ES").format(Math.round(jsonResponse[id][initialValues[urlParams.get('type')]]))
  445. }else{
  446. var valor=0;
  447. }
  448. nuevaColumna.innerHTML=valor
  449. filasDatos[i].appendChild(nuevaColumna);
  450.  
  451.  
  452.  
  453.  
  454. }
  455.  
  456.  
  457.  
  458.  
  459. var thead=document.getElementsByClassName("seriesHeader")[0]
  460.  
  461. console.log(thead)
  462. var ths = thead.querySelectorAll("th");
  463.  
  464. // Agregar event listener a cada th
  465. ths.forEach(function(th, index) {
  466. th.addEventListener("click", function() {
  467. ordenarTabla(index);
  468. });
  469. });
  470.  
  471.  
  472.  
  473. }
  474. });
  475.  
  476.  
  477.  
  478.  
  479.  
  480. }, 3000);
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487. }
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494. function openWindow(link,porAncho,porAlto){
  495. var ventanaAncho=(window.innerWidth)*porAncho
  496. var ventanaAlto= (window.innerHeight)*porAlto
  497. console.log(ventanaAlto)
  498. // Calcular las coordenadas para centrar la ventana
  499. var ventanaIzquierda = (window.innerWidth - ventanaAncho) / 2;
  500. var ventanaArriba = (window.innerHeight - ventanaAlto) / 2;
  501.  
  502. // Opciones de la ventana (puedes ajustar según tus necesidades)
  503. var opcionesVentana = "width=" + ventanaAncho +
  504. ",height=" + ventanaAlto +
  505. ",left=" + ventanaIzquierda +
  506. ",top=" + ventanaArriba;
  507. // Abrir la nueva ventana en el centro
  508. window.open(link, "_blank", opcionesVentana);
  509. }
  510.  
  511.  
  512.  
  513.  
  514. function handleClick(event) {
  515.  
  516.  
  517.  
  518. var elems = document.getElementsByClassName("nice_table");
  519. var tabla = elems[0]
  520. var filas = tabla.getElementsByTagName("tbody")[0].getElementsByTagName("tr");
  521.  
  522. // Obtener el segundo th del thead
  523. var thSegundo = tabla.querySelector("thead th:nth-child(2)");
  524.  
  525. // Cambiar el ancho del segundo th
  526. thSegundo.style.width = "250px";
  527.  
  528. // Iterar sobre cada fila
  529. for (var i = 0; i < filas.length; i++) {
  530. // Obtener todas las celdas de la fila
  531.  
  532.  
  533.  
  534. var celda = tabla.rows[i+1].cells[1];
  535.  
  536. var equipo=celda.textContent.trim()
  537. var iniIndex = celda.innerHTML.indexOf("tid=");
  538. var lastIndex = celda.innerHTML.indexOf("\">", iniIndex+4);
  539. var data=String(celda.innerHTML)
  540. var id=data.substring(iniIndex+4,lastIndex)
  541.  
  542.  
  543. var celdas = filas[i].getElementsByTagName("td");
  544.  
  545. // Obtener la última celda de la fila
  546. var ultimaCelda = celdas[celdas.length - 1];
  547.  
  548.  
  549.  
  550. console.log(teams_data[id])
  551.  
  552. var valor= new Intl.NumberFormat("es-ES").format(Math.round(teams_data[id][event.target.id]))
  553. ultimaCelda.innerHTML = valor;
  554. }
  555. var checkboxes = document.querySelectorAll('.statsxente');
  556.  
  557.  
  558.  
  559. var ultimaFilaEncabezado = tabla.querySelector("thead tr:last-child");
  560.  
  561. // Obtener la última celda de encabezado (<th>) dentro de la última fila de encabezado
  562. var ultimaCeldaEncabezado = ultimaFilaEncabezado.querySelector("th:last-child");
  563.  
  564. // Cambiar el texto de la última celda de encabezado
  565. ultimaCeldaEncabezado.textContent = event.target.value;
  566.  
  567.  
  568. // Iterar sobre los elementos
  569. checkboxes.forEach(function(checkbox) {
  570. console.log(checkbox.id )
  571. // Verificar si el checkbox no tiene el ID "hola"
  572. if (checkbox.id !== event.target.id) {
  573. // Deseleccionar el checkbox
  574. checkbox.checked = false;
  575. }
  576. });
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584. var columna=12
  585.  
  586.  
  587.  
  588. }
  589.  
  590.  
  591. function ordenarTabla(columna){
  592.  
  593.  
  594. var elems = document.getElementsByClassName("nice_table");
  595. var tabla = elems[0]
  596.  
  597. var filas, switching, i, x, y, debeCambiar, direccion, cambioRealizado;
  598.  
  599. switching = true;
  600. // Establecer la dirección de orden inicial a ascendente
  601. direccion = "descendente";
  602. // Continuar ordenando hasta que no haya más cambios realizados
  603. while (switching) {
  604. switching = false;
  605. filas = tabla.rows;
  606. // Recorrer todas las filas excepto la primera (encabezados)
  607. for (i = 1; i < (filas.length - 1); i++) {
  608. debeCambiar = false;
  609. // Obtener los elementos a comparar, uno de la columna actual y otro de la siguiente
  610. x = filas[i].getElementsByTagName("td")[columna];
  611. y = filas[i + 1].getElementsByTagName("td")[columna];
  612. // Eliminar los separadores de miles y convertir a números
  613. var xValue = parseFloat(x.innerHTML.replace(/[^0-9.-]+/g,""));
  614. var yValue = parseFloat(y.innerHTML.replace(/[^0-9.-]+/g,""));
  615. // Comparar los elementos según la dirección de orden
  616. if (direccion == "ascendente") {
  617. if (isNaN(xValue)) {
  618. if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) {
  619. debeCambiar = true;
  620. break;
  621. }
  622. } else {
  623. if (xValue > yValue) {
  624. debeCambiar = true;
  625. break;
  626. }
  627. }
  628. } else if (direccion == "descendente") {
  629. if (isNaN(xValue)) {
  630. if (x.innerHTML.toLowerCase() < y.innerHTML.toLowerCase()) {
  631. debeCambiar = true;
  632. break;
  633. }
  634. } else {
  635. if (xValue < yValue) {
  636. debeCambiar = true;
  637. break;
  638. }
  639. }
  640. }
  641. }
  642. if (debeCambiar) {
  643. // Si debe cambiar, marcarlo y cambiar el orden de las filas
  644. filas[i].parentNode.insertBefore(filas[i + 1], filas[i]);
  645. switching = true;
  646. // Marcar que se realizó un cambio
  647. cambioRealizado = true;
  648. } else {
  649. // Si no se realizó ningún cambio y se estaba ordenando de forma ascendente,
  650. // cambiar a orden descendente y volver a empezar
  651. if (!cambioRealizado && direccion == "descendente") {
  652. direccion = "ascendente";
  653. switching = true;
  654. }
  655. }
  656. }
  657.  
  658.  
  659.  
  660. filas = tabla.getElementsByTagName("tbody")[0].getElementsByTagName("tr");
  661.  
  662. // Recorrer todas las filas
  663. for ( i = 0; i < filas.length; i++) {
  664. // Obtener el primer td de la fila
  665. var primerTd = filas[i].querySelector("td");
  666.  
  667. // Establecer el contenido del primer td
  668. primerTd.innerHTML = (i+1);
  669. }
  670. }
  671.  
  672.  
  673.  
  674.  
  675. function getCookie(nombre) {
  676. var regex = new RegExp("(?:(?:^|.*;\\s*)" + nombre + "\\s*\\=\\s*([^;]*).*$)|^.*$");
  677. var valorCookie = document.cookie.replace(regex, "$1");
  678. return decodeURIComponent(valorCookie);
  679. }
  680.  
  681.  
  682. // Your code here...
  683. })();
  684.