PageSourceSearch

https://www.sanidad.gob.es/diseno/js/utilidadesCompleta.js

js sanidad.gob.es collected 2026-10-01 08:48:43 UTC 44,167 bytes, 967 lines download raw bytes

1function cogerValorCookie(indice) {
2  //indice indica el comienzo del valor
3  var galleta = document.cookie;
4  //busca el final del valor, dado por ;, a partir de indice
5  var finDeCadena = galleta.indexOf(";", indice);
6  //si no existe el ;, el final del valor lo marca la longitud total de la cookie
7  if (finDeCadena == -1) finDeCadena = galleta.length;
8
9  return unescape(galleta.substring(indice, finDeCadena));
10}
11
12function guardarCookie(nombre, valor, caducidad) {
13  if (!caducidad) caducidad = caduca(0);
14
15  document.cookie =
16    nombre + "=" + escape(valor) + "; expires=" + caducidad + "; path=/";
17}
18
19function cogerCookie(nombre) {
20  var galleta = document.cookie;
21  //construye la cadena con el nombre del valor
22  var arg = nombre + "=";
23  var alen = arg.length; //longitud del nombre del valor
24  var glen = galleta.length; //longitud de la cookie
25
26  var i = 0;
27  while (i < glen) {
28    var j = i + alen; //posiciona j al final del nombre del valor
29    if (galleta.substring(i, j) == arg)
30      //si en la cookie estamo ya en nombre del valor
31      return cogerValorCookie(j); //devuleve el valor, que esta a partir de j
32
33    i = galleta.indexOf(" ", i) + 1; //pasa al siguiente
34    if (i == 0) break; //fin de la cookie
35  }
36  return ""; //no se encuentra el nombre del valor
37}
38
39var vMovil = cogerCookie("vMovil");
40
41var mobile = /iphone|ipod|android|blackberry|mini|windows\sce|palm/i.test(
42  navigator.userAgent.toLowerCase()
43);
44var iPad = /ipad/i.test(navigator.userAgent.toLowerCase());
45var isSecure = /https/i.test(window.location);
46
47var cargaMovil = false;
48
49if (
50  (mobile == true && (vMovil == "true" || vMovil == "")) ||
51  (iPad == true && vMovil == "true")
52) {
53  cargaMovil = true;
54}
55
56var ruta = "";
57var arrayPath = document.location.pathname.split('/')
58
59if (arrayPath[1] == "ca" ||
60arrayPath[1] == "gl" ||
61arrayPath[1] == "en" ||
62arrayPath[1] == "fr" ||
63arrayPath[1] == "va" ||
64arrayPath[1] == "eu") {
65  var nivel = arrayPath.length - 2
66} else {
67  var nivel = arrayPath.length - 1
68}
69
70for (i = 1; i < nivel; i++) {
71  ruta = "../" + ruta;
72}
73
74/***mostrar/ocultar información**/
75function mostrarTexto(texto) {
76  document.getElementById(texto).style.display = "inline";
77}
78/********************************************************************
79 Cambiar el idioma de la página y no perder la localización actual
80 *********************************************************************/
81function Urlidioma(idioma) {
82  //Url completa
83  urlCompleta = new String(document.location);
84  //Solo el path
85  cadena = document.location.pathname;
86  //Posicion donde empieza el path
87  posicion = urlCompleta.indexOf(cadena);
88  //Dominio
89  dominio = urlCompleta.substr(0, posicion);
90  //idioma actual
91  idioma_actual = cadena.substring(0, 4);
92  if (
93    idioma_actual == "/ca/" ||
94    idioma_actual == "/gl/" ||
95    idioma_actual == "/en/" ||
96    idioma_actual == "/fr/" ||
97    idioma_actual == "/va/" ||
98    idioma_actual == "/eu/"
99  ) {
100    cadena = cadena.substring(3);
101  }
102  //Comprobamos si tiene parametros
103  params = "";
104  posParams = urlCompleta.indexOf("?");
105  if (posParams != -1) {
106    params = urlCompleta.substring(posParams);
107  }
108  cadenaFinal = dominio + "/" + idioma + cadena.substring(1) + params;
109  location.href = cadenaFinal;
110} //fin Urlidioma
111
112function createCookie(name, value, days) {
113  if (days) {
114    var date = new Date();
115    date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
116    var expires = "; expires=" + date.toGMTString();
117  } else expires = "";
118  document.cookie = name + "=" + value + expires + "; path=/";
119}
120function readCookie(name) {
121  var nameEQ = name + "=";
122  var ca = document.cookie.split(";");
123  for (var i = 0; i < ca.length; i++) {
124    var c = ca[i];
125    while (c.charAt(0) == " ") c = c.substring(1, c.length);
126    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
127  }
128  return null;
129}
130
131var loca = window.location;
132
133switch(idioma_actual) {
134  case '/ca/':
135    function traducir() {
136      if ($("#avisogoogle").length == 0) {
137        $("#enlaceTraducir").after(
138          "<span id='avisogoogle' style='display:none;'>" +
139            "<p>Per generar una traducció no oficial es pot usar el sistema automàtic de traducció PLaTa. Aquesta eina dóna un servei de traducció aproximat que ofereix, de manera instantània, una traducció automàtica a diferents idiomes.</p>" +
140            "<p>Més informació a <a href='http://administracionelectronica.gob.es/pae_Home/p
140ae_Informacion/pae_PLATA.html#.V8gHjjUsrX8' target='_blank' title='S'obrirà en una finestra nova'>Plataforma de traducció automàtica <img src=\"/diseno/img/ico_ext.gif\" alt=\"S'obrirà en una finestra nova\"></a></p>" +
141            "<p><select id='traducciones' name='traduccion'>" +
142            "<option value='ca'>Català</option><option value='eu'>Basc</option><option value='gl'>Gallec</option><option value='ca_valencia'>Valencià</va><option value='en'>Anglès</option><option value='fr'>Francès</option>" +
143            "</select>" +
144            "<a href='javascript:gcancelar()' class='bGoogle'>Cancel·lar</a><a href='javascript:gtraducir()' class='bGoogle'>Acceptar</a></p></span>"
145        );
146      }
147      $("#avisogoogle").slideToggle("slow", function () {});
148    }
149
150    var cookieTxt = "<p>Informació important sobre galetes: El lloc web del Ministeri de Sanitat fa servir galetes pròpies per millorar la navegació. Les galetes utilitzades no contenen cap tipus d'informació de caràcter personal. Si continueu navegant, entenem que n'accepteu l'ús. Disposeu de més informació sobre les galetes i com impedir-ne l'ús a la nostra <a href='/ca/avisoLegal/home.htm#politicaCookie'>Política de galetes</a>. <a id='aceptarCookie' class='btn btn-primary'>Acceptar <i class='fa fa-caret-right' aria-hidden='true'></i></a></p>";
151
152    var servicioNoDisponible = "El servei no es troba disponible";
153
154    var ocultarBarra = "Ocultar barra d'utilitats";
155    var mostrarBarra = "Mostrar barra d'utilitats";
156
157    var nuevaVentana = "S\'obrirà en una finestra nova";
158    var archivoPDF = "Arxiu pdf";
159    break;
160  case '/gl/':
161    function traducir() {
162      if ($("#avisogoogle").length == 0) {
163        $("#enlaceTraducir").after(
164          "<span id='avisogoogle' style='display:none;'>" +
165            "<p>Para xerar unha tradución non oficial, pódese facer uso do sistema automático de tradución PLaTa. Esta ferramenta dá un servizo aproximado de tradución, que ofrece de forma instantánea traducións automáticas a distintos idiomas.</p>" +
166            "<p>Máis información en <a href='http://administracionelectronica.gob.es/pae_Home/pae_Informacion/pae_PLATA.html#.V8gHjjUsrX8' target='_blank' title='Abrirase nunha fiestra nova'>Plataforma de tradución automática <img src=\"/diseno/img/ico_ext.gif\" alt=\"Abrirase nunha fiestra nova\"></a></p>" +
167            "<p><select id='traducciones' name='traduccion'>" +
168            "<option value='ca'>Catalán</option><option value='eu'>Euskera</option><option value='gl'>Galego</option><option value='ca_valencia'>Valenciano</va><option value='en'>Inglés</option><option value='fr'>Francés</option>" +
169            "</select>" +
170            "<a href='javascript:gcancelar()' class='bGoogle'>Cancelar</a><a href='javascript:gtraducir()' class='bGoogle'>Aceptar</a></p></span>"
171        );
172      }
173      $("#avisogoogle").slideToggle("slow", function () {});
174    }
175
176    var cookieTxt = "<p>Información importante sobre cookies: O Sitio Web do Ministerio de Sanidade utiliza cookies propias para mellorar a navegación. As cookies utilizadas non conteñen ningún tipo de información de carácter persoal. Se continúa a navegar entendemos que acepta o seu uso. Dispón de máis información sobre as cookies e como impedir o seu uso na nosa <a href='/gl/avisoLegal/home.htm#politicaCookie'>Política de cookies</a>. <a id='aceptarCookie' class='btn btn-primary'>Aceptar <i class='fa fa-caret-right' aria-hidden='true'></i></a></p>";
177
178    var servicioNoDisponible = "O servizo non se encontra dispoñible";
179
180    var ocultarBarra = "Ocultar barra de utilidades";
181    var mostrarBarra = "Amosar barra de utilidades";
182
183    var nuevaVentana = "Abrirase nunha fiestra nova";
184    var archivoPDF = "Arquivo pdf";
185    break;
186  case '/en/':
187    function traducir() {
188      if ($("#avisogoogle").length == 0) {
189        $("#enlaceTraducir").after(
190          "<span id='avisogoogle' style='display:none;'>" +
191            "<p>The automatic translation system PLaTa can be used to produce an unofficial translation. This translation tool provides approximate translations automatically in various languages.</p>" +
192            "<p>Further information can be found at the <a href='http://administracionelectronica.gob.es/pae_Home/p
192ae_Informacion/pae_PLATA.html#.V8gHjjUsrX8' target='_blank' title='Will open in a new window'>Automatic translation platform <img src=\"/diseno/img/ico_ext.gif\" alt=\"Will open in a new window\"></a></p>" +
193            "<p><select id='traducciones' name='traduccion'>" +
194            "<option value='ca'>Catalan</option><option value='eu'>Basque</option><option value='gl'>Galician</option><option value='ca_valencia'>Valencia</va><option value='en'>English</option><option value='fr'>French</option>" +
195            "</select>" +
196            "<a href='javascript:gcancelar()' class='bGoogle'>Cancel</a><a href='javascript:gtraducir()' class='bGoogle'>OK</a></p></span>"
197        );
198      }
199      $("#avisogoogle").slideToggle("slow", function () {});
200    }
201
202    var cookieTxt = "<p>Important information about cookies: The website of the Ministry of Health uses its own cookies to improve the browsing experience. The cookies used do not contain any personal information. If you continue browsing the site we will understand that you have accepted their use. Find more information on cookies and how to block them in our <a href='/en/avisoLegal/home.htm#politicaCookie'>Cookies Policy</a>. <a id='aceptarCookie' class='btn btn-primary'>Ok <i class='fa fa-caret-right' aria-hidden='true'></i></a></p>";
203
204    var servicioNoDisponible = "The service is not available";
205
206    var ocultarBarra = "Hide tool bar";
207    var mostrarBarra = "Show tool bar";
208
209    var nuevaVentana = "Will open in a new window";
210    var archivoPDF = "File pdf";
211    break;
212  case '/fr/':
213    function traducir() {
214      if ($("#avisogoogle").length == 0) {
215        $("#enlaceTraducir").after(
216          "<span id='avisogoogle' style='display:none;'>" +
217            "<p>Pour obtenir une traduction non officielle, vous pouvez utiliser le système automatique de traduction PLaTa. Cet outil propose un service de traduction approximative qui offre de manière instantanée des traductions automatiques dans différentes langues.</p>" +
218            "<p>Plus d'informations sur <a href='http://administracionelectronica.gob.es/pae_Home/pae_Informacion/pae_PLATA.html#.V8gHjjUsrX8' target='_blank' title='S'ouvrira dans une fenêtre nouvelle'>Plateforme de traduction automatique <img src=\"/diseno/img/ico_ext.gif\" alt=\"S'ouvrira dans une fenêtre nouvelle\"></a></p>" +
219            "<p><select id='traducciones' name='traduccion'>" +
220            "<option value='ca'>Catalan</option><option value='eu'>Basque</option><option value='gl'>Galicien</option><option value='ca_valencia'>Valence</va><option value='en'>Anglais</option><option value='fr'>Français</option>" +
221            "</select>" +
222            "<a href='javascript:gcancelar()' class='bGoogle'>Annuler</a><a href='javascript:gtraducir()' class='bGoogle'>Accepter</a></p></span>"
223        );
224      }
225      $("#avisogoogle").slideToggle("slow", function () {});
226    }
227
228    var cookieTxt = "<p>Informations importantes sur les cookies: Le site web du ministère de la Santé utilise ses propres cookies dans le but d'améliorer votre navigation. Les cookies utilisés ne contiennent aucun type d'informations à caractère personnel. Si vous poursuivez votre navigation, nous considérerons que vous acceptez leur utilisation. Vous pouvez trouver plus de renseignements sur les cookies et comment désactiver leur utilisation dans notre <a href='/fr/avisoLegal/home.htm#politicaCookie'>Politique des cookies</a>. <a id='aceptarCookie' class='btn btn-primary'>Accepter <i class='fa fa-caret-right' aria-hidden='true'></i></a></p>";
229
230    var servicioNoDisponible = "Le service n'est pas disponible";
231
232    var ocultarBarra = "Masquer la barre d'outils";
233    var mostrarBarra = "Afficher la barre d'outils";
234
235    var nuevaVentana = "S\'ouvrira dans une fenêtre nouvelle";
236    var archivoPDF = "Archives pdf";
237    break;
238  case '/va/':
239    function traducir() {
240      if ($("#avisogoogle").length == 0) {
241        $("#enlaceTraducir").after(
242          "<span id='avisogoogle' style='display:none;'>" +
243            "<p>Per a generar una traducció no oficial es pot usar el sistema automàtic de traducció PLaTa. Esta ferramenta dóna un servici de traducció aproximat que oferix, de manera instantània, una traducció automàtica a diferents idiomes.</p>" +
244            "<p>Més informació a <a href='http://administracionelectronica.gob.es/pae_Home/p
244ae_Informacion/pae_PLATA.html#.V8gHjjUsrX8' target='_blank' title='S'obrirà en una finestra nova'>Plataforma de traducció automàtica <img src=\"/diseno/img/ico_ext.gif\" alt=\"S'obrirà en una finestra nova\"></a></p>" +
245            "<p><select id='traducciones' name='traduccion'>" +
246            "<option value='ca'>Català</option><option value='eu'>Basq</option><option value='gl'>Galec</option><option value='ca_valencia'>Valencià</va><option value='en'>Anglès</option><option value='fr'>Francès</option>" +
247            "</select>" +
248            "<a href='javascript:gcancelar()' class='bGoogle'>Cancel·lar</a><a href='javascript:gtraducir()' class='bGoogle'>Acceptar</a></p></span>"
249        );
250      }
251      $("#avisogoogle").slideToggle("slow", function () {});
252    }
253
254    var cookieTxt = "<p>Informació important sobre galetes: El lloc web del Ministeri de Sanitat fa servir galetes pròpies per a millorar la navegació. Les galetes utilitzades no contenen cap tipus d'informació de caràcter personal. Si continua navegant, entenem que n'accepta l'ús. Disposa de més informació sobre les galetes i com impedir-ne l'ús a la nostra <a href='/va/avisoLegal/home.htm#politicaCookie'>Política de galetes</a>. <a id='aceptarCookie' class='btn btn-primary'>Acceptar <i class='fa fa-caret-right' aria-hidden='true'></i></a></p>";
255
256    var servicioNoDisponible = "El servici no es troba disponible";
257
258    var ocultarBarra = "Ocultar barra d'utilitats";
259    var mostrarBarra = "Mostrar barra d'utilitats";
260
261    var nuevaVentana = "S\'obrirà en una finestra nova";
262    var archivoPDF = "Arxiu pdf";
263    break;
264  case '/eu/':
265    function traducir() {
266      if ($("#avisogoogle").length == 0) {
267        $("#enlaceTraducir").after(
268          "<span id='avisogoogle' style='display:none;'>" +
269            "<p>Itzulpen ez-ofizial bat egiteko, PLaTa izeneko Itzultzaile automatikoa erabil daiteke. Tresna horrek nolabaiteko itzulpen-zerbitzua eskaintzen du, eta berehala ematen ditu itzulpen automatikoak hainbat hizkuntzatan.</p>" +
270            "<p>Informazio gehiago <a href='http://administracionelectronica.gob.es/pae_Home/pae_Informacion/pae_PLATA.html#.V8gHjjUsrX8' target='_blank' title='Leiho berri batean irekiko da'>Itzulpen automatikoen plataforman <img src=\"/diseno/img/ico_ext.gif\" alt=\"Leiho berri batean irekiko da\"></a></p>" +
271            "<p><select id='traducciones' name='traduccion'>" +
272            "<option value='ca'>KatalaneanSarbidea</option><option value='eu'>EuskaranSarbidea</option><option value='gl'>GalegoanSarbidea</option><option value='ca_valencia'>ValentziarreanSarbidea</va><option value='en'>IngeleseanSarbidea</option><option value='fr'>FrantseseanSarbidea</option>" +
273            "</select>" +
274            "<a href='javascript:gcancelar()' class='bGoogle'>Utzi</a><a href='javascript:gtraducir()' class='bGoogle'>Ornatzea</a></p></span>"
275        );
276      }
277      $("#avisogoogle").slideToggle("slow", function () {});
278    }
279
280    var cookieTxt = "<p>Cookie-ei buruzko informazio garrantzitsua: Osasun Ministerioaren web orriak bere cookie-ak erabiltzen ditu nabigazioa hobetzeko. Erabilitako cookie-ek ez dute inolako informazio pertsonalik. Nabigatzen jarraitzen baduzu, cookie-ak erabiltzea onartzen duzula esan nahi du. Cooki-ei buruzko eta horien erabilera eragozteko moduari buruzko informazio gehiago daukazu gure <a href='/eu/avisoLegal/home.htm#politicaCookie'>Cookie politika</a> atalean. <a id='aceptarCookie' class='btn btn-primary'>Onartzea <i class='fa fa-caret-right' aria-hidden='true'></i></a></p>";
281
282    var servicioNoDisponible = "Zerbitzua ez dago erabilgarri";
283
284    var ocultarBarra = "Ezkutatu tresna-barra";
285    var mostrarBarra = "Bistaratu tresna-barra";
286
287    var nuevaVentana = "Leiho berri batean irekiko da";
288    var archivoPDF = "Artxibo pdf";
289    break;
290  default:
291    function traducir() {
292      if ($("#avisogoogle").length == 0) {
293        $("#enlaceTraducir").after(
294          "<span id='avisogoogle' style='display:none;'>" +
295          "<p>Para acceder a una traducción oficial de esta página, por favor, seleccione el idioma en la parte superior derecha de la página. En caso de que no exista traducción oficial, puede generar una traducción no oficial mediante este sistema automático de traducción PLaTa. Esta herramienta da un servicio aproximado de traducción, que ofrece de forma instantánea traducciones automáticas a distintos idiomas.</p>" +
296          "<p>Más información en <a href='http://administracionelectronica.gob.es/pae_Home/p
296ae_Informacion/pae_PLATA.html#.V8gHjjUsrX8' target='_blank' title='Se abrirá en una ventana nueva'>Plataforma de traducción automática <img src=\"/diseno/img/ico_ext.gif\" alt=\"Se abrirá en una nueva ventana\"></a></p>" +
297          "<p><select id='traducciones' name='traduccion'>" +
298          "<option value='ca'>Catalán</option><option value='eu'>Euskera</option><option value='gl'>Gallego</option><option value='ca_valencia'>Valenciano</va><option value='en'>Inglés</option><option value='fr'>Francés</option>" +
299          "</select>" +
300          "<a href='javascript:gcancelar()' class='bGoogle'>Cancelar</a><a href='javascript:gtraducir()' class='bGoogle'>Aceptar</a></p></span>"
301        );
302      }
303      $("#avisogoogle").slideToggle("slow", function () { });
304    }
305
306    var cookieTxt = "<p>Información importante sobre cookies: El Sitio Web del Ministerio de Sanidad utiliza cookies propias para mejorar la navegación. Las cookies utilizadas no contienen ningún tipo de información de carácter personal. Si continua navegando entendemos acepta su uso. Dispone de más información acerca de las cookies y cómo impedir su uso en nuestra <a href='/avisoLegal/home.htm#politicaCookie'>Política de cookies</a>. <a id='aceptarCookie' class='btn btn-primary'>Aceptar <i class='fa fa-caret-right' aria-hidden='true'></i></a></p>";
307
308    var servicioNoDisponible = "El servicio no se encuentra disponible";
309
310    var ocultarBarra = "Ocultar barra de utilidades";
311    var mostrarBarra = "Mostrar barra de utilidades";
312
313    var nuevaVentana = "Se abrirá en una ventana nueva";
314    var archivoPDF = "Archivo pdf";
315}
316
317
318function gcancelar() {
319  $("#avisogoogle").slideToggle("slow", function () {});
320  $("#errorTraduccion").remove();
321}
322
323function scancelar() {
324  $("#serviciosPerso").slideToggle("slow", function () {});
325}
326
327function rsscancelar() {
328  $("#avisorss").slideToggle("slow", function () {});
329}
330
331//Mensaje de Política de Cookies
332$(function () {
333  var politicaCookie = readCookie("politicaCookie");
334  if (politicaCookie == null) {
335    $(".cabecera").before("<div id='avisoCookies' style='display:none'></div>");
336    $("#avisoCookies").append(cookieTxt);
337    $("#avisoCookies").slideToggle("slow", function () {});
338  }
339  $("#aceptarCookie").click(function () {
340    $("#avisoCookies").slideToggle(
341      {
342        direction: "up",
343      },
344      function () {
345        $(".cabecera").remove("#avisoCookies");
346      }
347    );
348    createCookie("politicaCookie", "creada", 7);
349  });
350});
351
352function volverTraduccion() {
353  location.reload();
354}
355
356function gtraducir() {
357  var destino = document.getElementById("traducciones").value;
358  var protocol = window.location.protocol;
359  var host = window.location.host;
360  var urldestino = window.location.protocol + "//" + host + "/traduccion.do";
361  var urlorigen = window.location.href;
362  //var contenido = document.documentElement.innerHTML;
363  //var contenido = $("html").html();
364  var contenido = $("section").html();
365  //contenido = '<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"
366  //xml:lang="es" lang="es">' + contenido + '</html>';
367
368  $("body").append("<div class='modal'></div>");
369  $("body").addClass("loading");
370
371  jQuery.ajax({
372    type: "POST",
373    url: urldestino,
374    data: {
375      idioma: destino,
376      contenido: contenido,
377    },
378    success: function (response) {
379      //var pagina = window.open(document.location,"_blank");
380      //setTimeout(function(){ pagina.document.write(response);},
381      //100);
382      //pagina.document.write(response);
383      //$("body").html(response);
384      $("#enlaceTraducir").remove();
385      $("section").html(response);
386      $("body").removeClass("loading");
387      $("section").prepend(
388        "<p class='tautomatica danger'>Traducción automática generada por PLaTa <a href='javascript:volverTraduccion()'>Volver a versión original<a></p>"
389      );
390      $("#avisogoogle").slideToggle("slow", function () {});
391      $("#errorTraduccion").remove();
392    },
393    error: function (error) {
394      $("body").addClass("loading");
395      $("#errorTraduccion").remove();
396      $("#avisogoogle").append(
397        '<p id="errorTraduccion">' + servicioNoDisponible + '</p>'
398      );
399      $("body").removeClass("loading");
400    },
401  });
402}
403var addthis_config = {
404  services_expanded:
405    "facebook,twitter,whatsapp,google_plusone_share,meneame,delicious,tuenti,7live7,digg,reddit,stumbleupon,buzzzy,fresqui",
406  services_compact: "facebook,twitter,whatsapp,more",
407};
408
409function iniciaMenu() {}
410
411$(function () {
412  $("#ocultarBarra a").append(ocultarBarra);
413  $("#barraMostrar a").append(mostrarBarra);
414});
415
416//Mensaje PLATA
417cadena = document.location.pathname;
418idioma = cadena.substring(0, 4);
419if (
420  idioma == "/ca/" ||
421  idioma == "/gl/" ||
422  idioma == "/en/" ||
423  idioma == "/fr/" ||
424  idioma == "/va/" ||
425  idioma == "/eu/"
426) {
427  document.write(
428    '<script type="text/javascript" src="' +
429      idioma +
430      'diseno/js/avisoTraduccion.js"></script>'
431  );
432}
433
434function crearEnlaces(literal, enlace, nivel) {
435  var listaEnlaces = "";
436  for (i = 0; i < literal.length; i++) {
437    //Para nivel de profundidad 3
438    if (nivel[i] == "3") {
439      //Literal y enlace
440      var literalMenu = literal[i];
441      var enlaceMenu = enlace[i];
442      //Obtenemos el Path, lo dividimo en un array, por '/' y cogemos todo menos el último que es el nombre del fichero
443      var aPath = enlaceMenu.split("/");
444      var sPath = "";
445      for (j = 0; j < aPath.length - 1; j++) {
446        sPath += aPath[j] + "/";
447      }
448      //Enlace externo
449      if (
450        enlaceMenu.indexOf("http://") != -1 || enlaceMenu.indexOf("https://") != -1 ||
451        enlaceMenu.indexOf(".pdf") != -1
452      ) {
453        listaEnlaces =
454          listaEnlaces +
455          '<li><a href="' +
456          enlaceMenu +
457          '" target="_blank" title="' + nuevaVentana + '">' +
458          literalMenu;
459        if (enlaceMenu.indexOf("http://") != -1 || enlaceMenu.indexOf("https://") != -1) {
460          listaEnlaces =
461            listaEnlaces +
462            '<img src="/diseno/img/ico_ext.gif" alt="' + nuevaVentana + '"/>';
463        } else {
464          listaEnlaces =
465            listaEnlaces +
466            '<img src="/diseno/img/ico_pdf.gif" alt="' + archivoPDF + '. ' + nuevaVentana + '"/>';
467        }
468        listaEnlaces = listaEnlaces + "</a></li>";
469      } else {
470        //Enlace interno
471        listaEnlaces =
472          listaEnlaces +
473          '<li><a href="' +
474          enlaceMenu +
475          '">' +
476          literalMenu +
477          "</a></li>";
478      } //fin else
479    } //fin if
480  } //fin for
481  return listaEnlaces;
482}
483
484function crearEnlacesNivel4(literal, enlace, nivel) {
485  var listaEnlaces = "";
486  for (i = 0; i < literal.length; i++) {
487    //Para nivel de profundidad 3
488    if (nivel[i] == "4") {
489      //Literal y enlace
490      var literalMenu = literal[i];
491      var enlaceMenu = enlace[i];
492      //Obtenemos el Path, lo dividimo en un array, por '/' y cogemos todo menos el último que es el nombre del fichero
493      var aPath = enlaceMenu.split("/");
494      var sPath = "";
495      for (j = 0; j < aPath.length - 1; j++) {
496        sPath += aPath[j] + "/";
497      }
498      //Enlace externo
499      if (
500        enlaceMenu.indexOf("http://") != -1 || enlaceMenu.indexOf("https://") != -1 ||
501        enlaceMenu.indexOf(".pdf") != -1
502      ) {
503        listaEnlaces =
504          listaEnlaces +
505          '<li><a href="' +
506          enlaceMenu +
507          '" target="_blank" title="' + nuevaVentana + '">' +
508          literalMenu;
509        if (enlaceMenu.indexOf("http://") != -1 || enlaceMenu.indexOf("https://") != -1) {
510          listaEnlaces =
511            listaEnlaces +
512            '<img src="/diseno/img/ico_ext.gif" alt="' + nuevaVentana + '"/>';
513        } else {
514          listaEnlaces =
515            listaEnlaces +
516            '<img src="/diseno/img/ico_pdf.gif" alt="' + archivoPDF + '. ' + nuevaVentana + '"/>';
517        }
518        listaEnlaces = listaEnlaces + "</a></li>";
519      } else {
520        //Enlace interno
521        listaEnlaces =
522          listaEnlaces +
523          '<li><a href="' +
524          enlaceMenu +
525          '">' +
526          literalMenu +
527          "</a></li>";
528      } //fin else
529    } //fin if
530  } //fin for
531  return listaEnlaces;
532}
533
534function crearEnlaces2(literal, enlace, nivel) {
535  var listaEnlaces = "";
536  for (i = 0; i < literal.length; i++) {
537    if (nivel[i] == "3" || nivel[i] == "4") {
538      //Literal y enlace
539      var literalMenu = literal[i];
540      var enlaceMenu = enlace[i];
541      //Obtenemos el Path, lo dividimo en un array, por '/' y cogemos todo menos el último que es el nombre del fichero
542      var aPath = enlaceMenu.split("/");
543      var sPath = "";
544      for (j = 0; j < aPath.length - 1; j++) {
545        sPath += aPath[j] + "/";
546      }
547
548      //Para nivel de profundidad 3
549      if (nivel[i] == "3") {
550        //Si el nivel anterior es mayor que 3
551        if (nivel[i - 1] > "3") {
552          listaEnlaces = listaEnlaces + "</ul></li>";
553        }
554      }
555
556      //Enlace externo
557      if (
558        enlaceMenu.indexOf("http://") != -1 || enlaceMenu.indexOf("https://") != -1 ||
559        enlaceMenu.indexOf(".pdf") != -1
560      ) {
561        listaEnlaces =
562          listaEnlaces +
563          '<li><a href="' +
564          enlaceMenu +
565          '" target="_blank" title="' + nuevaVentana + '">' +
566          literalMenu;
567        if (enlaceMenu.indexOf("http://") != -1 || enlaceMenu.indexOf("https://") != -1) {
568          listaEnlaces =
569            listaEnlaces +
570            '<img src="/diseno/img/ico_ext.gif" alt="' + nuevaVentana + '"/>';
571        } else {
572          listaEnlaces =
573            listaEnlaces +
574            '<img src="/diseno/img/ico_pdf.gif" alt="' + archivoPDF + '. ' + nuevaVentana + '"/>';
575        }
576        listaEnlaces = listaEnlaces + "</a>";
577      } else {
578        //Enlace interno
579        listaEnlaces =
580          listaEnlaces +
581          '<li><a href="' +
582          enlaceMenu +
583          '">' +
584          literalMenu +
585          "</a>";
586      } //fin else
587
588      //Para nivel de profundidad 3
589      if (nivel[i] == "3") {
590        //Si es el último
591        if (i == literal.length - 1) {
592          listaEnlaces = listaEnlaces + "</li>";
593        }
594        //Si el siguiente nivel es 4
595        else if (nivel[i + 1] == "4") {
596          listaEnlaces = listaEnlaces + "<ul>";
597        }
598        //Si el siguiente nivel no es 4
599        else {
600          listaEnlaces = listaEnlaces + "</li>";
601        }
602        //Para nivel de profundidad 4
603      } else {
604        //Si es el último
605        if (i == literal.length - 1) {
606          listaEnlaces = listaEnlaces + "</li></ul></li>";
607        }
608        //Si el siguiente nivel es 4 o superior
609        else {
610          listaEnlaces = listaEnlaces + "</li>";
611        }
612      }
613    } //fin if
614  } //fin for
615  return listaEnlaces;
616}
617
618$(document).ready(function () {
619  //Participación pública en proyectos normativos
620  // $("#categorias ul li").each(function (e, i) {
621  //   -1 !=
622  //     $(i).find("a").attr("href").indexOf("/normativa/proyectos/home.htm") &&
623  //     ($(i).find("a:first").attr("class", "dropdown-toggle proyectos"),
624  //     $(i)
625  //       .find("a:first")
626  //       .html(
627  //         '<span><strong>Participación Pública</strong><span class="comic">en Proyectos Normativos</span></span>'
628  //       ));
629  // });
630
631  //Añadir el atributo data-toggle para el correcto funcionamiento de las pestañas en el CCAES
632  $(".contenidoCCAES .menuTabs .nav-tabs a").attr("data-toggle", "tab");
633
634  //Inhabilitar BIFIMED de forma temporal
635  //$('#frmMedicamentos').next().text('Esta información no se encuentra disponible en estos momentos. Lamentamos las molestias.');
636  //$('#frmMedicamentos').remove();
637
638  // Eliminar el mapa de predicciones hasta que se solucione el problema
639  //$('#mapaPredicciones').remove();
640  //$( "p:has(a[href$='suscripcion.do'])" ).remove();
641
642  //Cambiar href y literal del Portal Estadistico SNS por Sanidad en datos
643  // var enlaces_es = document.querySelectorAll(
644  //   "li a[href='/estadEstudios/portada/home.htm']"
645  // );
646  // for (var i = 0, l = enlaces_es.length; i < l; i++) {
647  //   var enlace_es = enlaces_es[i];
648  //   enlace_es.setAttribute("href", "/estadEstudios/sanidadDatos/home.htm");
649  //   enlace_es.innerHTML = "Sanidad en datos";
650  // }
651 //banner flotante Sanidad en datos
652  // if (window.location.href.indexOf("sanidadDatos") != -1) {
653  //   $("#leftmenu").after(
654  //     "<div class='sns_logo'>	<img src='/estadEstudios/sanidadDatos/images/ICONO_SISTEMA_DE_INFORMACION_SNS.png' class='header__photo'> <div class='header__info'> <a class='info__title' href='/estadEstudios/portada/home.htm'>Sistema de Información Sanitaria</a>
654 	<div class='pull-right' style='font-size:0.65em;'><a href='/estadEstudios/portada/home.htm' class='btn btn-primary'>Más información  <i class='fa fa-caret-right' aria-hidden='true'>&nbsp;</i>	</a></div>	</div>			</div>"
655  //   );
656  // }
657  
658  if ((/rss\/cargar.do/.test(window.location.href)) ) {
659
660	$("#rss_ms").remove();
661	$("#mis_rss").remove();
662
663	$("#zona_rss").append("<div><ul><li>Gabinete de prensa<ul><li><a href='/gabinete/notap_rss.do' target='_blank' title='Enlace a https://www.sanidad.gob.es/gabinete/notap_rss.do'><img src='../diseno/img/ico_rss_peq.gif' alt=''>Notas de prensa</a></li></ul></li></ul></div>");
664
665	}
666  
667  
668});
669
670//Literal para la sección Áreas
671switch(idioma){
672  case '/ca/':
673      var literalAreas = 'Àrees';
674      break;
675  case '/gl/':
676      var literalAreas = 'Áreas';
677      break;
678  case '/fr/':
679      var literalAreas = 'Domaines';
680      break;
681  case '/en/':
682      var literalAreas = 'Areas';
683      break;
684  case '/eu/':
685      var literalAreas = 'Alorrak';
686      break;
687  case '/va/':
688      var literalAreas = 'Àrees';
689      break;
690  default:
691      var literalAreas = 'Áreas';
692
693}
694//Formulario info util
695"use strict";
696 switch(idioma){
697  case '/ca/':
698      var apariencia= 'basic';
699      var tituloH1= 'Ha estat útil aquesta pàgina?';
700      var textoP='La teva resposta ens ajudarà a millorar el lloc web';
701      var botonSi='Sí';
702      var botonNo='No';
703      var botonProblema="Informa d'un problema amb la pàgina";
704      var descripcionProblema='Descripció del problema.';
705      var maxCaracteres='Tens un màxim de 400 caràcters per enviar el missatge.';
706      var botonEnviar='Envia';
707      var textoGracias='Gràcies per la teva aportació';
708      break;
709  case '/gl/':
710      var apariencia= 'alternativeSecond';
711      var tituloH1= 'Foiche útil esta páxina?';
712      var textoP='A túa resposta axudaranos a mellorar a web';
713      var botonSi='Si';
714      var botonNo='Non';
715      var botonProblema='Informar dun problema coa páxina';
716      var descripcionProblema='Descrición do problema.';
717      var maxCaracteres='Dispón dun máximo de 400 caracteres para enviar a súa mensaxe.';
718      var botonEnviar='Enviar';
719      var textoGracias='Moitas grazas pola túa achega';
720      break;
721  case '/fr/':
722      var apariencia= 'alternative';
723      var tituloH1= 'Cette page vous a-t-elle été utile?';
724      var textoP='Votre réponse nous aidera à améliorer le site';
725      var botonSi='Oui';
726      var botonNo='Non';
727      var botonProblema='Signaler un problème avec la page';
728      var descripcionProblema='Description du problème.';
729      var maxCaracteres="Vous disposez d'un maximum de 400 caractères pour envoyer votre message.";
730      var botonEnviar='Envoyer';
731      var textoGracias='Merci beaucoup pour votre contribution';
732      break;
733  case '/en/':
734      var apariencia= 'alternative';
735      var tituloH1= 'Was this page helpful?';
736      var textoP='Your answer will help us improve the website';
737      var botonSi='Yes';
738      var botonNo='No';
739      var botonProblema="Report a problem with the page";
740      var descripcionProblema='Description of the problem.';
741      var maxCaracteres='You have a maximum of 400 characters to send your message.';
742      var botonEnviar='Send';
743      var textoGracias='Thank you for your input';
744      break;
745  case '/eu/':
746      var apariencia= 'alternative';
747      var tituloH1= 'Orri hau baliagarria izan zaizu?';
748      var textoP='Zure erantzunak webgunea hobetzen lagunduko digu';
749      var botonSi='Bai';
750      var botonNo='Ez';
751      var botonProblema="Eman orriarekin izandako arazo baten berri";
752      var descripcionProblema='Arazoaren deskribapena.';
753      var maxCaracteres='Gehienez 400 karaktere dituzu zure mezua idazteko.';
754      var botonEnviar='Bidali';
755      var textoGracias='Eskerrik asko zure ekarpenarengatik';
756      break;
757  case '/va/':
758      var apariencia= 'basic';
759      var tituloH1= 'Ha estat útil aquesta pàgina?';
760      var textoP='La teva resposta ens ajudarà a millorar el lloc web';
761      var botonSi='Sí';
762      var botonNo='No';
763      var botonProblema="Informa d'un problema amb la pàgina";
764      var descripcionProblema='Descripció del problema.';
765      var maxCaracteres='Tens un màxim de 400 caràcters per enviar el missatge.';
766      var botonEnviar='Envia';
767      var textoGracias='Gràcies per la teva aportació';
768      break;
769  default:
770      var apariencia= 'basic';
771      var tituloH1= '&iquest;Te ha resultado &uacute;til esta p&aacute;gina?';
772      var textoP='Tu respuesta nos ayudar&aacute; a mejorar la web';
773      var botonSi='S&iacute;';
774      var botonNo='No';
775      var botonProblema='Reportar un problema con la p&aacutegina';
776      var descripcionProblema='Descripci&oacute;n del problema.';
777      var maxCaracteres='Dispone de una m&aacuteximo de 400 caracteres para enviar su mensaje.';
778      var botonEnviar='Enviar';
779      var textoGracias='Muchas gracias por tu aportaci&oacute;n';
780}
781var callback = () => {	
782  var htmlContent = `
783       <div class="forminfo col-md-12">
784                           	<form id="frmInfoUtil" action="#" method="POST">
785                              	<fieldset>
786              							<legend role="heading" aria-level="2">${tituloH1}</legend>
787              								<p>${textoP}</p>
788              								<div class="formContainer ${apariencia}">
789              									<div class="formContainerBtn">
790              										<div class="bloque">
791              											<input type="radio" name="infoUtil" id="infoUtilY" value="Si">
792              											<label for="infoUtilY" class="botones-azul">${botonSi}</label>
793              										</div>
794              										<div class="bloque">
795              											<input type="radio" name="infoUtil" id="infoUtilN" value="No">
796              											<label for="infoUtilN" class="botones-azul">${botonNo}</label>
797              										</div>
798              										<p class="answer hidden">${textoGracias}</p>
799              									</div>
800              									<div class="formContainerTxt">
801              										<div class="bloque">
802              											<input type="radio" name="problemaPag" id="problema" value="${botonProblema}">      
803              											<label for="problema" class="botones-azul">${botonProblema}</label>
804              										</div>
805              										<div class="bloqueTxt hidden">
806              											<label for="problemaD">${descripcionProblema} </label>
807              										<textarea maxlength="400" id="problemaD" name="problemaD"></textarea>
808              											<p>${maxCaracteres}</p>
809                                    <p class="texto_izquierda">         											
810                                     <input type="button" class="boton botones-azul" id="bt
810nEnviar" disabled name="enviar" value="${botonEnviar}">
811                                    </p>
812              										</div>
813              										<p class="answer hidden">${textoGracias}</p>
814              									</div>
815              								</div>
816              						</fieldset>
817              					</form>
818              				</div>
819    `;
820    let contenidoGeneral = document.querySelector('.informacion');
821    if(contenidoGeneral){
822        contenidoGeneral.insertAdjacentHTML('beforeend', htmlContent); 
823    }			
824	}
825const enviarFormularioManual = (p1, p2, p3, p4, p5) => {
826  // Validación básica de parámetros
827  const params = [p1, p2, p3, p4, p5].map(p => encodeURIComponent(p ?? ""));
828
829  const bodyData = [
830    "callCount=1",
831    "page=" + encodeURIComponent(window.location.href),
832    "httpSessionId=",
833    "scriptSessionId=1234567890",
834    "c0-scriptName=InformacionUtilFormulario",
835    "c0-methodName=enviarFormulario",
836    "c0-id=0",
837    `c0-param0=string:${params[0]}`,
838    `c0-param1=string:${params[1]}`,
839    `c0-param2=string:${params[2]}`,
840    `c0-param3=string:${params[3]}`,
841    `c0-param4=string:${params[4]}`,
842    "batchId=1"
843  ].join("\n");
844
845  fetch("/dwr/call/plaincall/InformacionUtilFormulario.enviarFormulario.dwr", {
846    method: "POST",
847    headers: {
848      "Content-Type": "text/plain",
849      "X-Requested-With": "XMLHttpRequest"
850    },
851    body: bodyData
852  })
853    .then(response => {
854      if (!response.ok) {
855        throw new Error(`Error HTTP: ${response.status}`);
856      }
857      return response.text(); // DWR suele responder en texto
858    })
859    .then(data => {
860      console.log("Respuesta del servidor:", data);
861    })
862    .catch(error => {
863      console.error("Error en la llamada DWR:", error);
864    });
865};
866
867window.onload = () => {
868callback();
869  //var
870  const respuestaBtn = document.querySelector(".formContainerBtn .answer");
871  const respuestaTxt = document.querySelector(".formContainerTxt .bloqueTxt");
872  const respuestaTxt2 = document.querySelector(".formContainerTxt .answer");
873  const contendorBtn = document.querySelector(".formContainerBtn");
874  const buttonY = document.getElementById('infoUtilY');
875  const buttonN = document.getElementById('infoUtilN');
876  const buttonP = document.getElementById('problema');
877  const buttonD = document.querySelector(".formContainerTxt .bloque");
878  const divD = document.querySelector(".formContainerTxt");
879  const buttonS = document.querySelector(".formContainerTxt .bloqueTxt input[type=button]");
880  const textarea = document.getElementById('problemaD');
881  const btnEnviar = document.getElementById('btnEnviar');
882  var formulario = document.getElementById('frmInfoUtil');
883  let buttons = document.querySelectorAll(".formContainerBtn .bloque");
884 
885//comportamiento
886var handleClickY = () => {
887  respuestaBtn.classList.remove('hidden');
888  buttons.forEach(item => item.classList.add('hidden'));
889  contendorBtn.classList.add('w-30');
890  if(window.location.href.startsWith('https://vsf')){
891var nuevaUrl=window.location.href.split('.es')[0].replace('https://vsf-iwsold-pro-portal.sanidad.gob','https://www.sanidad.gob.es')+window.location.href.split('.es')[1];
892enviarFormularioManual("1", "0", "", nuevaUrl, "0");
893
894}else if(window.location.href.startsWith('https://www.msps')){
895	var nuevaUrl=window.location.href.split('.es')[0].replace('https://www.msps','https://www.sanidad.gob.es')+window.location.href.split('.es')[1];
896 enviarFormularioManual("1", "0", "", nuevaUrl, "0");
897  }else{
898 enviarFormularioManual("1", "0", "", window.location.href, "0");
899}
900 
901}
902var handleClickN = () => {
903  respuestaBtn.classList.remove('hidden');
904  buttons.forEach(item => item.classList.add('hidden'));
905  contendorBtn.classList.add('w-30');
906  if(window.location.href.startsWith('https://vsf')){
907
908
909var nuevaUrl=window.location.href.split('.es')[0].replace('https://vsf-iwsold-pro-portal.sanidad.gob','https://www.sanidad.gob.es')+window.location.href.split('.es')[1];
910enviarFormularioManual("0", "1", "", nuevaUrl, "0");
911}else if(window.location.href.startsWith('https://www.msps')){
912	var nuevaUrl=window.location.href.split('.es')[0].replace('https://www.msps','https://www.sanidad.gob.es')+window.location.href.split('.es')[1];
913 enviarFormularioManual("0", "1", "", nuevaUrl, "0");
914  }else{
915  enviarFormularioManual("0", "1", "", window.location.href, "0");
916}
917}
918var handleClickD = () => {
919  respuestaTxt.classList.remove('hidden');
920  buttonD.classList.add('hidden');
921  divD.classList.add('outline');
922	
923}
924var handleClickS = (event) => {
925  respuestaTxt2.classList.remove('hidden');
926  respuestaTxt.classList.add('hidden');
927  event.preventDefault();
928 if(window.location.href.startsWith('https://vsf'))
929{
930var nuevaUrl=window.location.href.split('.es')[0].replace('https://vsf-iwsold-pro-portal.sanidad.gob','https://www.sanidad.gob.es')+window.location.href.split('.es')[1];
931enviarFormularioManual("0", "0", $("#problemaD").val(), nuevaUrl, "1");
932}else if(window.location.href.startsWith('https://www.msps'))
933{
934	var nuevaUrl=window.location.href.split('.es')[0].replace('https://www.msps','https://www.sanidad.gob.es')+window.location.href.split('.es')[1];
935	enviarFormularioManual("0", "0", $("#problemaD").val(), nuevaUrl, "1");
936  }else{
937  enviarFormularioManual("0", "0", $("#problemaD").val(), window.location.href, "1");
938}
939}
940var checkText =() => {
941  if (textarea.value.trim() !== '') {
942	 btnEnviar.removeAttribute("disabled");
943    btnEnviar.classList.remove('hidden');
944  }else{
945	btnEnviar.setAttribute("disabled","");
946	
947  } 
948}
949
950if(formulario){
951  buttonY.addEventListener('click', handleClickY);
952  buttonN.addEventListener('click', handleClickN);
953  buttonP.addEventListener('click', handleClickD);
954  buttonS.addEventListener('click', handleClickS);
955  textarea.addEventListener('input', checkText);
956}else{
957  setTimeout(() => {
958    if(formulario){
959    buttonY.addEventListener('click', handleClickY);
960    buttonN.addEventListener('click', handleClickN);
961    buttonP.addEventListener('click', handleClickD);
962    buttonS.addEventListener('click', handleClickS);
963    textarea.addEventListener('input', checkText);
964    }
965  }, 2000);
966  }
967};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.