PageSourceSearch

https://www.chduero.es/combo?browserId=chrome&minifierType=js&them…ets.openData%2Fjs%2Fmain.js&t=1778213338000

js chduero.es collected 2026-09-24 18:08:50 UTC 14,599 bytes, 337 lines download raw bytes

1/**
2 * 
3 */
4
5// Bocadillo de informaci?n en los mapas interactivos
6function infoMapa(tipo, elementoid, nombre, porcentaje, datomin, datomax,
7		datomedio, datopuntual, tendencia, fechahora, posicion, posflecha,url) {
8	// Se oculta inicialmente el objeto
9	var cuadro = document.getElementById("marcoinfo");
10	cuadro.style.display = "none";
11	var idpagina = 0;
12
13	flechaVisible(posflecha);
14
15	posicionCaja(posicion,posflecha,cuadro);
16
17	// Visibilidad de elementos y rellenado de INFO
18	// Visibilidad de elementos y rellenado de INFO
19	if (tipo == "o") {
20		visibilidadOficinas();
21	}
22	if (tipo == "e") {
23		visibilidadEmbalses();
24	}
25	if (tipo == "r") {
26		visibilidadRios();
27	}
28	var altomarco = 177;
29	var alto = 1;
30	var zonaTendencia = "";
31	if (tipo == "e") {
32		if (url != "")
33			document.getElementById("nombreelemento").innerHTML = nombre
34					+ "&nbsp;<a title=\"M&aacute;s informaci&oacute;n sobre el embalse\" target=\"_blank\" "
35					+ "id=\"masinfo1\" href=\"/"
36					+ url
37					+ "\"> "
38					+ "&nbsp;&nbsp;&nbsp;<span class=\"ocultar\">M&aacute;s informaci&oacute;n sobre el embalse</span></a>";
39		else
40			document.getElementById("nombreelemento").innerHTML = nombre
41					+ "<br><span class=\"embalsenochd\">Embalse no gestionado por la CHD</span>";
42
43		document.getElementById("nombreelemento").style.width = "220px";
44		document.getElementById("infooficina").innerHTML = "";
45		document.getElementById("infomapa0").innerHTML = "";
46		document.getElementById("infomapa00").innerHTML = "";
47		if (datopuntual == "")
48			document.getElementById("infomapa1").innerHTML = "<span>V. embalsado:</span> No disponible";
49		else
50			document.getElementById("infomapa1").innerHTML = "<span>V. embalsado:</span> "
51					+ datopuntual + " hm<sup>3</sup> (" + porcentaje + "%)";
52		if (datopuntual != "") {
53			if (tendencia == "a")
54				zonaTendencia = "ascendente</div><div id=\"infotendenciaa\"></div>";
55			else if (tendencia == "d")
56				zonaTendencia = "descendente</div><div id=\"infotendenciad\"></div>";
57			else if (tendencia == "e")
58				zonaTendencia = "estable</div><div id=\"infotendenciae\"></div>";
59			else
60				zonaTendencia = "No disponible</div>";
61		} else{
62			zonaTendencia = "No disponible</div>";
63		}
64		document.getElementById("infomapa2").innerHTML = "<div id='infotendencia'><span>Tendencia: </span> "
65				+ zonaTendencia;
66		document.getElementById("infomapa3").innerHTML = "<span>Capacidad:</span> "
67				+ datomedio + " hm<sup>3</sup>";
68		if (fechahora == "")
69			document.getElementById("infomapa4").innerHTML = "Informaci&oacute;n obtenida del <span>SAIH</span>:<br/>No disponible";
70		else
71			document.getElementById("infomapa4").innerHTML = "Informaci&oacute;n obtenida del <span>SAIH</span>:<br/>"
72					+ fechahora;
73		// document.getElementById("masinfo2").href =
74		// "http://www.saihduero.es/mediciones/estadisticas.php?%20rtu=" +
75		// elementoid;
76		document.getElementById("masinfo2").href = "http://www.saihduero.es/ficha-risr?r="
77				+ elementoid;
78		document.getElementById("masinfo2").title = "Mas informacion en el SAIH";
79		document.getElementById("masinfo2").style.visibility = "visible";
80		document.getElementById("infomapa4").style.visibility = "visible";
81		document.getElementById("infomapa1").style.fontWeight = "bold";
82	} else if (tipo == "r") {
83		document.getElementById("nombreelemento").innerHTML = nombre;
84		document.getElementById("nombreelemento").style.width = "248px";
85		document.getElementById("infooficina").innerHTML = "";
86		document.getElementById("infomapa0").innerHTML = "";
87		document.getElementById("infomapa00").innerHTML = "";
88		// document.getElementById("infomapa1").innerHTML = "<span>M&iacute;nimo
89		// hist&oacute;rico:</span> " + datomin + " m<sup>3</sup>/s";
90		// document.getElementById("infomapa2").innerHTML = "<span>M&aacute;ximo
91		// hist&oacute;rico:</span> " + datomax + " m<sup>3</sup>/s";
92		// document.getElementById("infomapa3").innerHTML = "<span>Media
93		// hist&oacute;rica:</span> " + datomedio + " m<sup>3</sup>/s";
94		if (datopuntual == "")
95			document.getElementById("infomapa1").innerHTML = "<span>Caudal actual:</span>
95 No disponible";
96		else
97			document.getElementById("infomapa1").innerHTML = "<span>Caudal actual:</span> "
98					+ datopuntual + " m<sup>3</sup>/s";
99		if (datopuntual != "") {
100			if (tendencia == "a")
101				zonaTendencia = "ascendente</div><div id=\"infotendenciaa\"></div>";
102			else if (tendencia == "d")
103				zonaTendencia = "descendente</div><div id=\"infotendenciad\"></div>";
104			else if (tendencia == "e")
105				zonaTendencia = "estable</div><div id=\"infotendenciae\"></div>";
106			else
107				zonaTendencia = "No disponible</div>";
108		} else{
109			zonaTendencia = "No disponible</div>";
110		}
111		document.getElementById("infomapa2").innerHTML = "<div id='infotendencia'><span>Tendencia: </span> "
112				+ zonaTendencia;
113		document.getElementById("infomapa3").innerHTML = "<span>M&aacute;ximo hist&oacute;rico:</span> "
114				+ datomax + " m<sup>3</sup>/s";
115		if (fechahora == "")
116			document.getElementById("infomapa4").innerHTML = "Informaci&oacute;n obtenida del <span>SAIH</span>:<br/>No disponible";
117		else
118			document.getElementById("infomapa4").innerHTML = "Informaci&oacute;n obtenida del <span>SAIH</span>:<br/>"
119					+ fechahora;
120		// document.getElementById("masinfo2").href =
121		// "http://www.saihduero.es/mediciones/estadisticas.php?%20rtu=" +
122		// elementoid;
123		document.getElementById("masinfo2").href = "http://www.saihduero.es/ficha-risr?r="
124				+ elementoid;
125		document.getElementById("masinfo2").title = "M\xE1s informaci\xF3n en el SAIH";
126		document.getElementById("masinfo2").style.visibility = "visible";
127		document.getElementById("infomapa4").style.visibility = "visible";
128		document.getElementById("infomapa1").style.fontWeight = "bold";
129	} else if (tipo == "o") {
130		document.getElementById("nombreelemento").innerHTML = nombre;
131		document.getElementById("nombreelemento").style.width = "248px";
132		//document.getElementById("infooficina").innerHTML = porcentaje;
133		if(datopuntual =='VALLADOLID'){
134			document.getElementById("infooficina").innerHTML = porcentaje;
135			document.getElementById("infooficina").style.top = 80+ "px";
136		}else{			
137			if (fechahora != ''){
138				document.getElementById("infooficina").innerHTML = "<div class=\'infoofi1\'><span>"+porcentaje+ "</span><br/> " + datomax+ " "+ datopuntual +"<br/>"+"Tel:"+tendencia +" - Fax: "+ fechahora + "</div>"+
139				  "<div class=\'infoofi2 infoofitreslineas\'><a target=\'_blank\' title=\'M&aacute;s informaci&oacute;n n\' " + 
140				  "class=\'masinfoofi\'  href=\'"+datomin+"\'></a></div>";
141			}else{
142				document.getElementById("infooficina").innerHTML = "<div class=\'infoofi1\'><span>"+porcentaje+ "</span><br/> " + datomax+ " "+ datopuntual +"<br/>"+"Tel:"+tendencia + "</div>"+
143				  "<div class=\'infoofi2 infoofitreslineas\'><a target=\'_blank\' title=\'M&aacute;s informaci&oacute;n n\' " + 
144				  "class=\'masinfoofi\'  href=\'"+datomin+"\'></a></div>";
145			}
146			document.getElementById("infooficina").style.top = datomedio + "px";
147			
148		}
149		
150		document.getElementById("infomapa0").innerHTML = "";
151		document.getElementById("infomapa00").innerHTML = "";
152		document.getElementById("infomapa1").innerHTML = "";
153		document.getElementById("infomapa2").innerHTML = "";
154		document.getElementById("infomapa3").innerHTML = "";
155		document.getElementById("infomapa4").style.visibility = "hidden";
156		document.getElementById("masinfo2").style.visibility = "hidden";
157	}
158
159	// Nivel de embalse o r?o y efecto onda
160	porcentaje = porcentaje.replace(",", ".");
161	if ((tipo == "e")/* ||(tipo=="r") */) {
162		var posiciononda = altomarco - (porcentaje * altomarco / 100) + 47;
163		if (porcentaje == 98)
164			posiciononda = 49;
165		if (porcentaje == 99)
166			posiciononda = 48;
167		if (porcentaje >= 100)
168			posiciononda = 47;
169		document.getElementById("ondacentro").style.top = ((posiciononda + 3) * 1)
170				+ "px";
171		document.getElementById("ondaabajo").style.top = ((posiciononda + 9) * 1)
172				+ "px";
173		if (porcentaje == 1) {
174			document.getElementById("ondacentro").style.height = "3px";
175			document.getElementById("ondacentro").style.top = ((altomarco + 49) * 1)
176					+ "px";
177			document.getElementById("ondaabajo").style.visibility = "hidden";
178		} else if (porcentaje <= 0) {
179			document.getElementById("ondacentro").style.visibility = "hidden";
180			document.getElementById("ondaabajo").style.visibility = "hidden";
181		} else {
182			document.getElementById("ondacentro").style.height = "9px";
183			alto = altomarco - posiciononda + 10 + 34;
184			if (alto < 1)
185				alto = 1;
186			document.getElementById("ondaabajo").style.height = alto + "px";
187		}
188	}
189
190	// Finalmente se muestra el elemento
191	cuadro.style.display = "block";
192	cuadro.style.filter = 'alpha(opacity=0)';
193	cuadro.style.opacity = 0;
194	muestraInfo(cuadro, 1);
195
196	return false;
197}
198
199function muestraInfo(obj, paso){
200    var retardo = 20;
201		if(paso >= retardo){         
202		obj.style.filter = 'alpha(opacity=100)';
203		obj.style.opacity = 1;
204		return;  
205	}
206	else {
207		obj.style.filter = 'alpha(opacity=' + (0 + (paso/retardo))*100 + ')';
208		obj.style.opacity = 0 + (paso/retardo);
209		setTimeout(function(){muestraInfo(obj, paso+1);}, 10);
210	}
211}
212
213
214function flechaVisible(posflecha){
215	// Flecha visible
216/*	document.getElementById("f-ul").style.visibility = document.getElementById("f-uc").style.visibility = document.getElementById("f-ur").style.visibility = "hidden";
217	document.getElementById("f-dl").style.visibility = document.getElementById("f-dc").style.visibility = document.getElementById("f-dr").style.visibility = "hidden";
218	document.getElementById("f-lu").style.visibility = document.getElementById("f-lc").style.visibility = document.getElementById("f-ld").style.visibility = "hidden";
219	document.getElementById("f-ru").style.visibility = document.getElementById("f-rc").style.visibility = document.getElementById("f-rd").style.visibility = "hidden";
220	document.getElementById("f-" + posflecha).style.visibility = "visible";*/
221}
222
223function posicionCaja(posicion,posflecha,cuadro){
224	// Posicion de la caja
225/*	var pos = posicion.split(',');
226	var left = pos[0];
227	var top = pos[1];
228	if ((posflecha == 'ul') || (posflecha == 'uc') || (posflecha == 'ur'))
229		top = top * 1 + 58;
230	if ((posflecha == 'dl') || (posflecha == 'dc') || (posflecha == 'dr'))
231		top = top - 223;
232	if ((posflecha == 'lu') || (posflecha == 'ru'))
233		top = top - 17;
234	if ((posflecha == 'lc') || (posflecha == 'rc'))
235		top = top - 80;
236	if (posflecha == 'rd')
237		top = top - 144;
238	if (posflecha == 'ld')
239		top = top - 118;
240	if ((posflecha == 'lu') || (posflecha == 'lc') || (posflecha == 'ld'))
241		left = left * 1 + 0;
242	if ((posflecha == 'ru') || (posflecha == 'rc') || (posflecha == 'rd'))
243		left = left - 350;
244	if (posflecha == 'ul')
245		left = left - 80;
246	if (posflecha == 'dl')
247		left = left - 107;
248	if ((posflecha == 'uc') || (posflecha == 'dc'))
249		left = left - 179;
250	if ((posflecha == 'ur') || (posflecha == 'dr'))
251		left = left - 259;
252
253	cuadro.style.top = top + "px";
254	cuadro.style.left = left + "px";
255	*/
256	cuadro.style.top = 0 + "px";
257	cuadro.style.left = -20 + "px";
258}
259function visibilidadOficinas(){
260	document.getElementById("ondaabajo").style.visibility = "hidden";
261	document.getElementById("ondacentro").style.visibility = "hidden";
262	document.getElementById("nivel-embalse").style.visibility = "hidden";
263	document.getElementById("nivel-rio").style.visibility = "hidden";
264	document.getElementById("fondocuadro1").style.visibility = "hidden";
265	document.getElementById("fondocuadro2").style.visibility = "hidden";
266	document.getElementById("fondocuadro3").style.visibility = "visible";
267	document.getElementById("infooficina").style.width = "260px";
268}
269
270function visibilidadEmbalses(){
271	document.getElementById("ondaabajo").style.visibility = "visible";
272	document.getElementById("ondacentro").style.visibility = "visible";
273	document.getElementById("nivel-embalse").style.visibility = "visible";
274	document.getElementById("nivel-rio").style.visibility = "hidden";
275	document.getElementById("fondocuadro1").style.visibility = "visible";
276	document.getElementById("fondocuadro2").style.visibility = "hidden";
277	document.getElementById("fondocuadro3").style.visibility = "hidden";
278	document.getElementById("infooficina").style.width = "60px"; 
279	// Para
280																	// que
281																	// el
282																	// title
283																	// del
284																	// nivel
285																	// se
286																	// vea
287	document.getElementById("infomapa1").style.marginLeft = "0px";
288	document.getElementById("infomapa2").style.marginLeft = "0px";
289	document.getElementById("infomapa3").style.marginLeft = "0px";
290}
291
292function visibilidadRios(){
293	document.getElementById("ondaabajo").style.visibility = "hidden";
294	document.getElementById("ondacentro").style.visibility = "hidden";
295	document.getElementById("nivel-embalse").style.visibility = "hidden";
296	document.getElementById("nivel-rio").style.visibility = "hidden";
297	document.getElementById("fondocuadro1").style.visibility = "hidden";
298	document.getElementById("fondocuadro2").style.visibility = "visible";
299	document.getElementById("fondocuadro3").style.visibility = "hidden";
300	document.getElementById("infooficina").style.width = "60px"; // Para
301																	// que
302																	// el
303																	// title
304																	// del
305																	// nivel
306																	// se
307																	// vea
308	document.getElementById("infomapa1").style.marginLeft = "22px";
309	document.getElementById("infomapa2").style.marginLeft = "22px";
310	document.getElementById("infomapa3").style.marginLeft = "22px";
311}
312function ocultaInfo(){
313	document.getElementById("marcoinfo").style.display = "none";
314}
315
316
317
318function cambiaMapa(id){
319	ocultaInfo();
320	 if (id == 1) {
321		 document.getElementById("mapa1").style.visibility = "visible";
322		 document.getElementById("mapa2").style.visibility = "hidden";
323		 document.getElementById("mapa3").style.visibility = "hidden";
324	 }
325	 if (id == 2){
326		 document.getElementById("mapa1").style.visibility = "hidden";
327		 document.getElementById("mapa2").style.visibility = "visible";
328		 document.getElementById("mapa3").style.visibility = "hidden";
329	 }
330	 if (id == 3){
331		 document.getElementById("mapa1").style.visibility = "hidden";
332		 document.getElementById("mapa2").style.visibility = "hidden";
333		 document.getElementById("mapa3").style.visibility = "visible";
334	 }
335}
336
337

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.