function load(){
	if (GBrowserIsCompatible()) {
	var physWithLabels = [ G_PHYSICAL_MAP.getTileLayers()[0], G_HYBRID_MAP.getTileLayers()[1] ];
var physWithLabelsMap = new GMapType(physWithLabels, G_PHYSICAL_MAP.getProjection(), "Hybrid Terrain");
map = new GMap2(document.getElementById("map"));
map.addMapType(G_PHYSICAL_MAP);
map.addMapType(physWithLabelsMap);
map.setCenter(new GLatLng(52.40262833871028, 13.052616119384766), 13, G_SATELLITE_MAP);
var mapControl = new GHierarchicalMapTypeControl();
mapControl.clearRelationships();
mapControl.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, "Labels", false);
mapControl.addRelationship(G_PHYSICAL_MAP, physWithLabelsMap, "Labels", false);
map.addControl(mapControl);
map.addControl(new GScaleControl());
map.addControl(new GLargeMapControl());
loadMap('./xml/potsdam.xml');
	}
}

function describeLine1(){
			var bus695 = [];
bus695.push(new GLatLng(52.39054976315683, 13.066198825836182));
bus695.push(new GLatLng(52.39056940580057, 13.064771890640259));
bus695.push(new GLatLng(52.39132236722113, 13.064020872116089));
bus695.push(new GLatLng(52.39233720794268, 13.063645362854004));
bus695.push(new GLatLng(52.39438646032828, 13.060662746429443));
bus695.push(new GLatLng(52.394818558907694, 13.059300184249878));
bus695.push(new GLatLng(52.39508698165243, 13.056789636611938));
bus695.push(new GLatLng(52.396134469429214, 13.048238754272461));
bus695.push(new GLatLng(52.39863524595465, 13.048367500305176));
bus695.push(new GLatLng(52.3991196731887, 13.047938346862793));
bus695.push(new GLatLng(52.40156791325311, 13.046844005584717));
bus695.push(new GLatLng(52.402641430223305, 13.052701950073242));
bus695.push(new GLatLng(52.40837513946985, 13.054590225219727));
bus695.push(new GLatLng(52.40811334249942, 13.050856590270996));
bus695.push(new GLatLng(52.40718395070571, 13.046844005584717));
bus695.push(new GLatLng(52.406568708746725, 13.0452561378479));
bus695.push(new GLatLng(52.40594036767667, 13.04300308227539));
bus695.push(new GLatLng(52.404631295035315, 13.04152250289917));
bus695.push(new GLatLng(52.404906203512226, 13.038496971130371));
bus695.push(new GLatLng(52.40434329384116, 13.036072254180908));
bus695.push(new GLatLng(52.40395056191009, 13.035986423492432));
bus695.push(new GLatLng(52.403767285812464, 13.031609058380127));
bus695.push(new GLatLng(52.40435638484533, 13.022940158843994));
bus695.push(new GLatLng(52.40658179909051, 13.01630973815918));
bus695.push(new GLatLng(52.40594036767667, 13.01382064819336));
bus695.push(new GLatLng(52.40419929253903, 13.013949394226074));
bus695.push(new GLatLng(52.402824710998004, 13.01081657409668));
bus695.push(new GLatLng(52.39931606109285, 13.011095523834229));
bus695.push(new GLatLng(52.398792358072726, 13.013885021209717));

			var start = 0;
			var end;
			var section=29;
			while(start<bus695.length-1){
				end=start+section+1;
				if(bus695.length<end){
					end=bus695.length;
				}
			map.addOverlay(new GPolyline(bus695.slice(start,end),'#ff0000',5,0.6));
			start+=section;
	}
}
function describeLine2(){
	var bus692 = [];
bus692.push(new GLatLng(52.40262833871028, 13.052616119384766));
bus692.push(new GLatLng(52.40357091772012, 13.057937622070312));
bus692.push(new GLatLng(52.40883328042934, 13.058538436889648));
bus692.push(new GLatLng(52.409409222313066, 13.063130378723145));
bus692.push(new GLatLng(52.41071815317216, 13.062443733215332));
bus692.push(new GLatLng(52.41495882235087, 13.066606521606445));
bus692.push(new GLatLng(52.419565506988796, 13.067936897277832));
bus692.push(new GLatLng(52.42184249722151, 13.068838119506836));
bus692.push(new GLatLng(52.421528436594365, 13.06725025177002));

			var start = 0;
			var end;
			var section= 9;
			while(start<bus692.length-1){
				end=start+section+1;
				if(bus692.length<end){
					end=bus692.length;
				}
			map.addOverlay(new GPolyline(bus692.slice(start,end),'#000080',5,0.6));
			start+=section;
	}
}
var map;
var resultText = "";
var markers = new Array();
var htmls = new Array();
var points = new Array();
var zooms = new Array();
var end;
var i=1;
function createMarker(point, title, html){
	var myIcon;
	myIcon = new GIcon();
	myIcon.image = "http://www.travelplatz.com/js/icony/icony"+ i + ".png";
	myIcon.iconSize = new GSize(20, 34);
	myIcon.shadow = "http://www.travelplatz.com/js/shadow50.png";
	myIcon.shadowSize = new GSize(37, 34);
	myIcon.iconAnchor = new GLatLng(34, 10);
	myIcon.infoWindowAnchor = new GPoint(5, 5);
	var marker = new GMarker(point,{"icon":myIcon, "clickable":true, "title":title});
	GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(html);});
		map.removeOverlay(marker);
		markers[i] = marker;
		htmls[i] = html;
		points[i] = point;
		resultText =  resultText + "<a href=javascript:change("+ i +")>"+ i + " " + title +"</a><br />";
		i++;
		if(i >end){i=1}
		return marker;
}

function clearMarker(){
	map.clearOverlays();
}

function change(i) {
   markers[i].openInfoWindowHtml(htmls[i]);
}
function loadMap(url){
	var request = GXmlHttp.create();
	request.open("GET", url, true);
	request.onreadystatechange = function(){
		if(request.readyState==4){
			var xml = request.responseXML;
			var place = xml.documentElement.getElementsByTagName("items");
			end = place.length;
			resultText="";
			for(var i=0; i<place.length; i++){
				var lat = parseFloat(place[i].getElementsByTagName("lat")[0].firstChild.nodeValue);
				var lng = parseFloat(place[i].getElementsByTagName("lon")[0].firstChild.nodeValue);
				var point = new GLatLng(lat, lng);
				var html = "<div style='width:200px'>";
				if(place[i].getElementsByTagName("name").length != 0){
					var name = place[i].getElementsByTagName("name")[0].firstChild.nodeValue;
					html += "<b style='color: navy; font-size: small; font-weight: 400; font-style: normal;'>";
				}
				if(place[i].getElementsByTagName("url").length != 0){
					var link = place[i].getElementsByTagName("url")[0].firstChild.nodeValue;
					html += "<a href='" + link + "' target='_blank'>" + name + "</a></b><br />";
				}else{
					html += name;
					html += "</b><br />";
				}
				if(place[i].getElementsByTagName("info").length != 0){
					html += "<font size='-1'>";
					html += place[i].getElementsByTagName("info")[0].firstChild.nodeValue;
					html += "<br/><a href=javascript:map.zoomIn()>zoomIn</a> | <a href=javascript:map.zoomOut()>zoomOut</a></font></div>";
				}else{
					html += "";
					html += "</div>";
				}
				var title = place[i].getElementsByTagName("name")[0].firstChild.nodeValue;
				var marker = createMarker(point, title, html);
				map.addOverlay(marker);
				}
				document.getElementById("map_right").innerHTML = resultText;
		}
	}
request.send('');
}
onload = load;
onunload = GUnload;
