function hinweistab(id) {	GDownloadUrl('http://www.rivermap.ch/data/gethinweise2.php?id=' + id, function(data, responseCode) {    if(responseCode == 200) {		  		var xml = GXml.parse(data);			var hits = xml.documentElement.getElementsByTagName("hinweis");			var result = "<div style=width:250px>Eintr&auml;ge: " + hits[0].getAttribute("active") + " (" + hits[0].getAttribute("total") + ") | <a href='http://www.rivermap.ch/hinweise.php?id=" + id + "' class='infoWindowLink' target=_blank title='in separatem Fenster'>Liste extern</a> | <a href='http://www.rivermap.ch/erfassen.php?id=" + id + "' class='infoWindowLink' target=_blank title='in separatem Fenster'>Erfassen</a><br>";			if (hits[0].getAttribute("total") > 0) {				result += "Neueste, aktive Meldungen (max. 5): <br>";									result += "<hr style='border: none 0; border-top: 1px solid #999; height: 1px; background-color: #fff; ' />";									result += "<div style=width:250px;height:150px><div style=overflow:auto;width:250px;height:150px>";				for (var i = 0; i < hits.length; i++) {										result += "<b>" + hits[i].getAttribute("kategorie") + "</b><font color='#666666'>";					if (hits[i].getAttribute("abfluss")) result += " | " + hits[i].getAttribute("abfluss") + "  m&sup3;/s";					if (hits[i].getAttribute("datum")) result += " | " + hits[i].getAttribute("datum");					result += "</font><br>";										result += hits[i].firstChild.nodeValue + "<br /><br />"; 										for (var j = 1; j <= hits[i].getAttribute("bilder"); j++) {						result += '<div class="highslide-gallery">';						result += "<a href='http://www.rivermap.ch/bilder/"+ hits[i].getAttribute("id") + "-" + j + ".jpg' class='highslide' onclick='return hs.expand(this)'>";							result += "<img src='http://www.rivermap.ch/bilder/thumbs/"+ hits[i].getAttribute("id") + "-" + j + ".jpg' alt='Highslide JS' title='"+hits[i].getAttribute("text"+j)+"' /></a>";						result += "<div class='highslide-caption' style='font: 11px Verdana, Arial, sans-serif;'>"+hits[i].getAttribute("text"+j)+" ("+hits[i].getAttribute("kategorie");						if (hits[i].getAttribute("abfluss")) result += ", "+hits[i].getAttribute("abfluss")+" m&sup3;/s";						if (hits[i].getAttribute("datum")) result += ", "+hits[i].getAttribute("datum");						result += ")</div></div><br>";																}					result += "<font color='#666666'>" + hits[i].getAttribute("erfasst") + "</font><br>";					result += "<hr style='border: none 0; border-top: 1px dotted #999; height: 1px; background-color: #fff; ' />";				}				result += "</div></div>";			}			result += "</div>";						var planung = xml.documentElement.getElementsByTagName("planung");								map.openInfoWindowTabsHtml(new GLatLng(hits[0].getAttribute("lat"), hits[0].getAttribute("lng")), [new GInfoWindowTab("Abschnitt",lasthtml), new GInfoWindowTab("Hinweise",result), new GInfoWindowTab("Planung", planung[0].firstChild.nodeValue)]);				} else if(responseCode == -1) {	    alert("Data request timed out. Please try later.");	  } else { 	    alert("Request resulted in error. Check XML file is retrievable.");	  }	}); }function setPolyLineOptions(line, id, strecke, fluss, ww, luft, hilfsstation, nw, mw, hw, refwert, dz, stationsname, wertung, map) {	var einheit = "m&sup3;/s";	if (stationsname == 'CAMPERTOGNO(VC)') einheit = "cm";	var html = "";	html += "<table border='0' width=250>";	html += "<tr align='left'><th colspan='2' class='infoWindowTitle'>" + strecke + "</th><td width=12><a href='http://www.rivermap.ch/befahrbarkeit.php' class='infoWindowLink' target=_blank title='Beschrieb Befahrbarkeit'>?<a/></td></tr>";	html += "<tr class='infoWindow'><td width=40>Fluss:</td><td>" + fluss + "</td></tr>";	html += "<tr class='infoWindow'><td width=40><a href='http://de.wikipedia.org/wiki/Wildwasserschwierigkeitsskala' class='infoWindowLink' target=_blank title='Schwierigkeitsskala'>WW</a>:</td><td>" + ww + "</td></tr>";	html += "<tr class='infoWindow'><td width=40>Luftlinie:</td><td>" + luft + "</td></tr>";	if (nw != 0.0) html += "<tr class='infoWindow'><td width=40>N-M-H:</td><td>" + nw.replace(".0", "") + " - " + mw.replace(".0", "") + " - " + hw.replace(".0", "")  + " " + einheit + "</td></tr>";	if (refwert != '') html += "<tr class='infoWindow'><td width=40 valign=top>Abfluss:</td><td><b>" + refwert + " " + einheit + "</b> (prov. Daten!)<br>" + dz + "<br>" + stationsname + "</td></tr>";	if (hilfsstation == "1") html += "<tr class='infoWindow'><td width=40>Achtung:</td><td><b>Wert von Hilfsstation!</b></td></tr>";	 		html += "<tr class='infoWindow'><th colspan='2' class='infoWindowWarning' align=left><b>Warnung:</b> Alle Angaben ohne Gew&auml;hr.<br>Jede Haftung wird abgelehnt!&nbsp;<a href='http://www.rivermap.ch/haftungsausschluss.php' class='infoWindowLink' target=_blank title='Haftungsausschluss'>mehr...</a></th></tr>";	html += "</table>";	if (ginfo == id) lasthtml = html;			var offx = 14;	var options = {  		'padding': '1px 1px',		'fontSize': '100%',		'offsetX': offx,		'backgroundColor': '#fff',    'border': '1px solid #000'   	};	GEvent.addListener(line, 'mouseover', function() { 		map.getDragObject().setDraggableCursor("pointer"); 		this.setStrokeStyle({color: "#804000"});		this.setStrokeStyle({weight:6});		lastsec = id;		lasthtml = html;				var ovltxt = '<div style="white-space:pre">' + fluss + '<br /><strong>' + strecke + '</strong><br />' + ww;		if (wertung != '#FFFFFF' && wertung != '#999999') ovltxt += '<br />' + refwert + ' ' + einheit + ' (' + nw.replace('.0', '') + '-' + mw.replace('.0', '') + '-' + hw.replace('.0', '')  + ')';		ovltxt += '</div>';		this.overlay = new MapTooltip(this, ovltxt , options ); 	    map.addOverlay(this.overlay);    	});		GEvent.addListener(line, 'mouseout', function() { 		map.getDragObject().setDraggableCursor("url(http://maps.google.com/intl/en_us/mapfiles/openhand.cur),default"); 		this.setStrokeStyle({color: wertung}); 		this.setStrokeStyle({weight:5}); 		lastsec = 0;    map.removeOverlay(this.overlay);    	});		return line;}function createMarker(point, html, tooltip, type, corner) {	w = 18;	h = 25;	iconPath = "http://www.rivermap.ch/icon/";		var icon = new GIcon();	icon.image = iconPath + type.replace("#", "") + corner.replace("#", "") + ".png";  icon.iconSize = new GSize(w, h);  icon.shadow = iconPath + "shadow50.png";   icon.shadowSize = new GSize(w*1.8, h);   icon.iconAnchor = new GPoint(w/2, h);  icon.infoWindowAnchor = new GPoint(w/2, 0);  icon.infoShadowAnchor = new GPoint((w/2)*0.9, h*0.8); 	var marker = new PdMarker(point, {icon: icon});	marker.setTooltip(tooltip);  	marker.setOpacity(100);							GEvent.addListener(marker, 'click', function() {		lastsec = 0;		marker.openInfoWindowHtml(html);	});		return marker;}									function createInfoHtml(id, name, lat, lng, datum, zeit, wert, delta24, type, temp, hoehe, einzug, deltaproz, alter, i, kat, vhstxt, wetter) {		var pathBafu = "http://www.hydrodaten.admin.ch";	var pathSG = "http://www.umwelt.sg.ch";	var pathZH = "http://www.hochwasser.zh.ch/internet/bd/awel/wb/hw/de/messwerte/aktuelle_liste.html";	var pathBE = "http://www.wea.bve.be.ch/messwerte/rahmenstruktur/wasser/index.asp?active=3&spr=";	var ll = WGS84toCH1903(lat, lng);	var ln07 = '';	var html = "";		html += "<table border='0'>";	html += "<tr align='left'><th colspan='3' class='infoWindowTitle'>" + name + "</th><td width=12><a href='http://www.rivermap.ch/abfluss.php' class='infoWindowLink' target=_blank title='Beschrieb Abfluss'>?</></td></tr>";	html += "<tr class='infoWindow'><td>Messung:&nbsp;</td><td>" + datum + "</td><td>" + zeit + "</td><td> </td></tr>";	html += "<tr class='infoWindow'><td>Abfluss:</td><td><b>" + wert + " m&sup3;/s&nbsp;&nbsp;&nbsp;</b></td><td>";	if (temp) html+= temp + " &deg;C";	html += "</td><td> </td></tr>";	html += "<tr><td class='infoWindow'>Werte:</td><th class='infoWindow' colspan='3' align='left'>provisorische Rohdaten!</th></tr>";	if (delta24) html += "<tr class='infoWindow'><td>&plusmn;24h:</td><td>" + delta24 + " m&sup3;/s&nbsp;&nbsp;&nbsp;</td><td>" + deltaproz + " %</td><td> </td></tr>";	if (hoehe) html += "<tr class='infoWindow'><td>H&ouml;he:</td><td>" + hoehe + " m.&uuml;.M</td><td> </td><td> </td></tr>";	if (einzug) html += "<tr class='infoWindow'><td>Einzug:</td><td>" + einzug + " km&sup2;</td><td> </td><td> </td></tr>";		switch (kat) {		case ("bafu"):			lnad = pathBafu + '/d/index.htm';			lnst = pathBafu + '/d/' + id + '.htm';			lnbi = pathBafu + '/lhg/pic/P' + id + '.jpg';			ln07 = pathBafu + '/lhg/' + id + '_7.PDF'; 			ln40 = pathBafu + '/lhg/' + id + '_40.PDF';			lntx = 'Bundesamt f&uuml;r Umwelt';			break;					case ("sg"):			lnad = pathSG + '/home/daten___fakten/bereiche/wasser/hydrometrie.filter__all.paging__no.html';			lnst = pathSG + '/tools/hydrometrie/stationen/og/' + id + '.html';			lnbi = '';			ln07 = '';			ln40 = 'http://ftp.sg.oca.ch/Hydro/' + id + '_40Tage_OG_Q_k.pdf';			lntx = 'umwelt.sg.ch';			break;					case ("zh"):			lnad = pathZH;			lnst = '';			lnbi = '';			switch (id) {				case '519':					lnz7 = '5183';					break;				case '581':					lnz7 = '5149';					break;				case '523':					lnz7 = '5196';					break;				case '582':					lnz7 = '548';					break;				case '547':					lnz7 = '5124';					break;				case '572':					lnz7 = '588';					break;			}																											ln07 = 'http://www.hw.zh.ch/hochwasser/mac/aaw/0' + lnz7 + '.PDF';			ln40 = '';			lntx = 'hochwasser.zh.ch';			break;					case ("be"):			lnad = pathBE;			lnst = '';			lnbi = '';			lnz7 = id;			if (id == '70') lnz7 = '68';																													ln40 = '';			lntx = 'bve.be.ch';			break;				}				html += "<tr><td>Details:</td><th colspan='3' class='infoWindow' align='left'>";	if (lnst) html += "<a href='" + lnst + "' class='infoWindowLink' target=_blank title='Details Station'>Station</a> ";	if (lnbi) html += "<a href='" + lnbi + "' class='infoWindowLink' target=_blank title='Bild Station'>Bild</a> ";	if (ln07) html += "<a href='" + ln07 + "' class='infoWindowLink' target=_blank title='Link PDF'>7-Tage</a> ";	if (ln40) html += "<a href='" + ln40 + "' class='infoWindowLink' target=_blank title='Link PDF'>40-Tage</a>";	html += "</th></tr>";		html += "<tr><td class='infoWindow'>Quelle:</td><th colspan='3' class='infoWindow' align='left'><a href='" + lnad + "' class='infoWindowLink' target=_blank title='Liste Stationen'> " + lntx + "</a></th></tr>";				if (vhstxt) html += "<tr><td class='infoWindow'>Spitze:</td><th colspan='3' class='infoWindow' align='left'><a href='http://www.bafu.admin.ch/hydrologie/01833/02021/02023/index.html?lang=de' class='infoWindowLink' target=_blank title='Detailinfo und PDF'>" + vhstxt + " m&sup3;/s</a></th></tr>";																					 	html += "<tr class='infoWindow'><td>Zoom:</td><th colspan='3' class='infoWindow'> - ";	for (ii = 8; ii < 19; ii+=2) {					html += "<a href='javascript:map.setCenter(gmarkers[" + i + "].getPoint()," + ii + ");map.closeInfoWindow()' class='infoWindowLink'>" + ii + "</a> ";	}	html += "+</th></tr></table>";			return html;}
