function appInit() { 	if (getURLParam("lat")) {		latitude = parseFloat(getURLParam("lat"));	} 		if (getURLParam("lng")) {		longitude = parseFloat(getURLParam("lng"));	} 		if (getURLParam("zoom")) {		zoomlevel = parseInt(getURLParam("zoom"));	}}function appConfig(map) {		this.map = map;	 	this.map.enableDoubleClickZoom();	this.map.enableContinuousZoom();	this.map.enableScrollWheelZoom();		this.map.setMapType(G_PHYSICAL_MAP);  		switch (getURLParam("map")) {		case 'k': this.map.setMapType(G_NORMAL_MAP); break; 		case 's': this.map.setMapType(G_SATELLITE_MAP); break;		case 'h': this.map.setMapType(G_HYBRID_MAP); break;		case 'g': this.map.setMapType(G_PHYSICAL_MAP); break;	}		largeMapControl = new GLargeMapControl();	mapTypeControl = new GMapTypeControl();	overviewMapControl = new GOverviewMapControl();		if (getURLParam("ctrl") == "0") {		gcontrol = 0;	}		if (gcontrol) {	 		this.map.addControl(largeMapControl);		this.map.addControl(mapTypeControl);		this.map.addControl(overviewMapControl);	} 		if (getURLParam("lbl") == "1") {		glabel = 1;	}		if (getURLParam("menu") == "0") {		gmenu = 0;	}	}function appOverlays(map) {	this.map = map; 	 	var html='<div class="menuSwitch" id="menuSwitch">&nbsp;Menu</div>'; 	loadingMessage=new HtmlControl(html);	map.addControl(loadingMessage, new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(70, 6)));  	var html='<div class="menuPanel" id="menuPanel" style="display:none">';	 	html += '<div class="menuButton" id="helpLink">&nbsp;RiverMap Home</div>';	html += '<div class="menuButton" id="hinweisLink">&nbsp;Flusshinweise</div>';	html += '<div class="menuButton" id="wwLink" style="border-bottom-color:#000">&nbsp;Karte WW-Grade</div>';	html += '<div class="menuButton" id="hydroBullLink" style="border-bottom-color:#CCC">&nbsp;Hydro. Bulletin</div>';	html += '<div class="menuButton" id="meteoschweizLink">&nbsp;MeteoSchweiz</div>';	html += '<div class="menuButton" id="meteocentraleLink">&nbsp;meteocentrale</div>';	html += '<div class="menuButton" id="schneehoehe" style="border-bottom-color:#CCC">&nbsp;Schneeh&ouml;hen</div>'; 	html += '<div class="menuButton" id="verkehrsinfoLink" style="border-bottom-color:#000">&nbsp;Verkehrsinfo</div>';	html += '<div class="menuButton" id="generateLink" style="border-bottom-color:#CCC">&nbsp;Link erstellen</div>';	html += '<div class="menuButton" id="toggleControls">';	html += '&nbsp;Steuerung <span>';	html += (gcontrol)?'aus':'ein';	html += '</span></div>';	html += '<div class="menuButton" id="toggleLabels">';	html += '&nbsp;Abflusslabel <span>';	html += (glabel)?'aus':'ein';	html += '</span></div>';	html += '<div class="menuButton" id="legende">&nbsp;Legende ein</div>';	html += '</div>';	loadingMessage=new HtmlControl(html);	map.addControl(loadingMessage, new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(0, 0))); 							 			if (dbgMode) {		var html='<div class="debugWindow" id="debugWindow">debug</div>';		loadingMessage=new HtmlControl(html, { selectable:true });		this.map.addControl(loadingMessage, new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(2, 38)));	}		if (newsBar) {		var html='<div class="newsBar" id="newsBar" style="display:none">' + newsText + '</div>';		loadingMessage=new HtmlControl(html, { selectable:true });		this.map.addControl(loadingMessage, new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(80, 5)));	}}function refreshLink(map) {	this.map = map;	z = this.map.getCenter();	x = (Math.round(z.lat()*1000000)/1000000);	y = (Math.round(z.lng()*1000000)/1000000);		var para = '?lat=' + x;	para += '&lng=' + y;	para += '&zoom=' + this.map.getZoom();	para += '&map=';		if (this.map.getCurrentMapType() == G_NORMAL_MAP) { 		para += 'k';	}	if (this.map.getCurrentMapType() == G_SATELLITE_MAP) { 		para += 's';	}	if (this.map.getCurrentMapType() == G_HYBRID_MAP) { 		para += 'h';	}	if (this.map.getCurrentMapType() == G_PHYSICAL_MAP) { 		para += 'g';	}		return getURLBase() + para + '&ctrl=' + gcontrol + '&lbl=' + glabel; }function refreshDebug(map) {	this.map = map;	button = document.getElementById('debugWindow');	var html = dbgMsg + dbgVar;	button.innerHTML = html;}function UnCryptMailto( s ){    var n = 0;    var r = "";    for( var i = 0; i < s.length; i++)    {        n = s.charCodeAt( i );        if( n >= 8364 )        {            n = 128;        }        r += String.fromCharCode( n - 1 );    }    return r;}function linkTo_UnCryptMailto( s ){    location.href=UnCryptMailto( s );}