

var G_icon_no = [];
var G_icon_ro = [];

var G_marker_no = [];
var G_marker_ro = null;
var G_marker_act = null;
var G_marker_counter = 0;

var G_map = null;

var G_bounds = null;
var G_southWest = null;
var G_northEast = null;
var G_lngSpan = null;
var G_latSpan = null;

var MapDiv = null;
var SatDiv = null;
var HybDiv = null;
var LocationDiv = null;
var AllLocationDiv = null;

var currentType = null;

var G_Textbox = null;

var G_ZoomId = 0;



function GLoad() {
	if (GBrowserIsCompatible()) {
		GMAP_outputobj = document.getElementById("map");
		for(var accessibility_child = 0; accessibility_child < GMAP_outputobj.childNodes.length; ++accessibility_child) {
			GMAP_outputobj.childNodes[accessibility_child].style.display = "none";
		}
		GMAP_outputobj.style.overflow = "auto";
		G_map = new GMap2(GMAP_outputobj);
//		G_map.addControl(new GLargeMapControl(),new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(1, 1)));

		
		if (G_ZoomId>0) {
			G_map.setCenter(new GLatLng(0.0000000000000000,0.0000000000000000), 7);
		} else {
			G_map.setCenter(new GLatLng(30,30), 1);
		}

		myGinit();

		myGaddMarker(-29.6719414043378120,-51.5223173323908910,'http://www.trumpler.de/en/contact/subsidiary/brazil.html','Brazil',109,100);myGaddMarker(30.7580009179029720,120.7492138547601900,'http://www.trumpler.de/en/contact/subsidiary/china.html','China',107,100);myGaddMarker(43.7651100000000000,2.0085400000000000,'http://www.trumpler.de/en/contact/subsidiary/france.html','France',106,100);myGaddMarker(49.6453700000000000,8.3708800000000000,'http://www.trumpler.de/en/contact/subsidiary/germany.html','Germany',162,100);myGaddMarker(13.9337340000000000,-90.8198550000000000,'http://www.trumpler.de/en/contact/subsidiary/guatemala.html','Guatemala',108,100);myGaddMarker(45.5120700000000000,11.3466400000000000,'http://www.trumpler.de/en/contact/subsidiary/italy-arzignano-vi.html','Italy - Arzignano (VI)',104,100);myGaddMarker(45.0834900000000000,7.4763900000000000,'http://www.trumpler.de/en/contact/subsidiary/italy-lacsa.html','Italy - LACSA',102,100);myGaddMarker(43.7170756084199680,10.7645386395442610,'http://www.trumpler.de/en/contact/subsidiary/italy-s-croce.html','Italy - S. Croce',105,100);myGaddMarker(40.8323700000000000,14.8278300000000000,'http://www.trumpler.de/en/contact/subsidiary/italy-solofra-av.html','Italy - Solofra (AV)',103,100);myGaddMarker(19.5311218221455470,-99.2113090463444250,'http://www.trumpler.de/en/contact/subsidiary/mexiko-robama.html','Mexiko - ROBAMA',114,100);myGaddMarker(21.0837859388816930,-101.6869434213369500,'http://www.trumpler.de/en/contact/subsidiary/mexiko-trumpler.html','Mexiko - TRUMPLER',115,100);myGaddMarker(41.6669400000000000,2.7494600000000000,'http://www.trumpler.de/en/contact/subsidiary/spain-robama.html','Spain - ROBAMA',112,100);myGaddMarker(41.5150600000000000,2.1272200000000000,'http://www.trumpler.de/en/contact/subsidiary/spain-trumpler.html','Spain - TRUMPLER',113,100);myGaddMarker(36.7755005958702060,3.0596977903224545,'http://www.trumpler.de/en/contact/representation/algeria.html','Algeria',124,101);myGaddMarker(23.7098012323955240,90.4071059639460370,'http://www.trumpler.de/en/contact/representation/bangladesh.html','Bangladesh',122,101);myGaddMarker(53.9166670000000000,19.4443000000000000,'http://www.trumpler.de/en/contact/representation/belarus.html','Belarus',121,101);myGaddMarker(-17.3841434793639320,-66.1667058258324800,'http://www.trumpler.de/en/contact/representation/bolivia.html','Bolivia',120,101);myGaddMarker(-33.4883687217389150,-70.6028282363106710,'http://www.trumpler.de/en/contact/representation/chile.html','Chile',119,101);myGaddMarker(6.2441355314373500,-75.5973339637802160,'http://www.trumpler.de/en/contact/representation/colombia.html','Colombia',118,101);myGaddMarker(45.8000000000000000,16.0000000000000000,'http://www.trumpler.de/en/contact/representation/croatia.html','Croatia',117,101);myGaddMarker(-0.3253760243405594,-78.4400161858357310,'http://www.trumpler.de/en/contact/representation/ecuador.html','Ecuador',116,101);myGaddMarker(30.0570994006215530,31.2271999739514360,'http://www.trumpler.de/en/contact/representation/egypt.html','Egypt',133,101);myGaddMarker(12.9155600000000000,79.1357230000000000,'http://www.trumpler.de/en/contact/representation/india.html','India',130,101);myGaddMarker(-6.1828705386207945,106.8291088582537600,'http://www.trumpler.de/en/contact/representation/indonesia.html','Indonesia',129,101);myGaddMarker(35.6833330000000000,51.4166670000000000,'http://www.trumpler.de/en/contact/representation/iran.html','Iran',128,101);myGaddMarker(35.6798793427466660,139.7575023846594000,'http://www.trumpler.de/en/contact/representation/japan.html','Japan',127,101);myGaddMarker(51.1666670000000000,71.5000000000000000,'http://www.trumpler.de/en/contact/representation/jordan.html','Jordan',126,101);myGaddMarker(37.5177605488324840,127.0166338279223300,'http://www.trumpler.de/en/contact/representation/korea.html','Korea',125,101);myGaddMarker(33.9000000000000000,35.5333330000000000,'http://www.trumpler.de/en/contact/representation/lebanon.html','Lebanon',142,101);myGaddMarker(42.0000000000000000,21.4333330000000000,'http://www.trumpler.de/en/contact/representation/macedonia.html','Macedonia',141,101);myGaddMarker(33.5888978053601830,-7.6089011363963284,'http://www.trumpler.de/en/contact/representation/morocco.html','Morocco',140,101);myGaddMarker(-39.4917357519908800,176.9162812312404500,'http://www.trumpler.de/en/contact/representation/new-zealand.html','New Zealand',139,101);myGaddMarker(-25.2666670000000000,-57.6666670000000000,'http://www.trumpler.de/en/contact/representation/paraguay.html','Paraguay',136,101);myGaddMarker(-12.5939939196368960,-69.1697947652681000,'http://www.trumpler.de/en/contact/representation/peru.html','Peru',135,101);myGaddMarker(51.7977000000000000,19.4443000000000000,'http://www.trumpler.de/en/contact/representation/poland.html','Poland',134,101);myGaddMarker(39.4577600000000000,-8.6685200000000000,'http://www.trumpler.de/en/contact/representation/portugal.html','Portugal',151,101);myGaddMarker(46.3377000000000000,15.4209000000000000,'http://www.trumpler.de/en/contact/representation/slovenia.html','Slovenia',148,101);myGaddMarker(-25.7166670000000000,28.2833330000000000,'http://www.trumpler.de/en/contact/representation/south-africa.html','South Africa',147,101);myGaddMarker(33.5000000000000000,36.3000000000000000,'http://www.trumpler.de/en/contact/representation/syria.html','Syria',145,101);myGaddMarker(24.1470126627031760,120.6742057983246100,'http://www.trumpler.de/en/contact/representation/taiwan.html','Taiwan',144,101);myGaddMarker(13.7333330000000000,100.5000000000000000,'http://www.trumpler.de/en/contact/representation/thailand.html','Thailand',143,101);myGaddMarker(36.8333330000000000,10.1500000000000000,'http://www.trumpler.de/en/contact/representation/tunisia.html','Tunisia',158,101);myGaddMarker(41.0003000000000000,28.8810000000000000,'http://www.trumpler.de/en/contact/representation/turkey.html','Turkey',157,101);myGaddMarker(-34.8221629520633940,-56.1966077858832950,'http://www.trumpler.de/en/contact/representation/uruguay.html','Uruguay',154,101);myGaddMarker(10.4960505269451070,-66.8982848100665710,'http://www.trumpler.de/en/contact/representation/venezuela.html','Venezuela',153,101);myGaddMarker(10.7591850399693950,106.6625073056609500,'http://www.trumpler.de/en/contact/representation/vietnam.html','Vietnam',152,101);

		G_map.getContainer().style.overflow="hidden"
		setTimeout('MakeCopyrightSmaller();', 500);
	}
}


function MakeCopyrightSmaller() {

	for(var i = 0; i < G_map.getContainer().childNodes.length; ++i) {
		for(var j = 0; j < G_map.getContainer().childNodes[i].childNodes.length; ++i) {
			if (G_map.getContainer().childNodes[i].childNodes[j].innerHTML.indexOf(String.fromCharCode(169)) !== -1) {
				G_map.getContainer().childNodes[i].childNodes[j].style.font = "5px Arial";
				break;
			}
		}
	}
}





function myGinit() {

	          myInitGIcons('http://www.trumpler.de/fileadmin/site-templates/img/subsidiary.png',8,8,16,16,'http://www.trumpler.de/fileadmin/site-templates/img/subsidiary.png',16,16,'http://www.trumpler.de/fileadmin/site-templates/img/subsidiary.png',16,16,'http://www.trumpler.de/fileadmin/site-templates/img/subsidiary.png',16,16,100);          myInitGIcons('http://www.trumpler.de/fileadmin/site-templates/img/representation.png',8,8,8,8,'http://www.trumpler.de/fileadmin/site-templates/img/representation.png',8,8,'http://www.trumpler.de/fileadmin/site-templates/img/representation.png',8,8,'http://www.trumpler.de/fileadmin/site-templates/img/representation.png',8,8,101);

	G_bounds = G_map.getBounds();
	G_southWest = G_bounds.getSouthWest();
	G_northEast = G_bounds.getNorthEast();
	G_lngSpan = G_northEast.lng() - G_southWest.lng();
	G_latSpan = G_northEast.lat() - G_southWest.lat();

	myGmakeControl ();
	G_map.setMapType(G_HYBRID_MAP);
}



function myInitGIcons (icon_no,icon_anchor_w,icon_anchor_h,icon_no_w,icon_no_h,icon_no_shadow,icon_no_shadow_w,icon_no_shadow_h,icon_ro,icon_ro_w,icon_ro_h,icon_ro_shadow,icon_ro_shadow_w,icon_ro_shadow_h,pid) {
	G_icon_no[pid] = new GIcon();
	G_icon_no[pid].image = icon_no;
	G_icon_no[pid].shadow = icon_no_shadow;
	G_icon_no[pid].iconSize = new GSize(icon_no_w, icon_no_h);
	G_icon_no[pid].shadowSize = new GSize(icon_no_shadow_w, icon_no_shadow_h);
	G_icon_no[pid].iconAnchor = new GPoint(icon_anchor_w, icon_anchor_h);
	G_icon_no[pid].infoWindowAnchor = new GPoint(5, 1);

	G_icon_ro[pid] = new GIcon();
	G_icon_ro[pid].image = icon_ro;
	G_icon_ro[pid].shadow = icon_ro_shadow;
	G_icon_ro[pid].iconSize = new GSize(icon_ro_w, icon_ro_h);
	G_icon_ro[pid].shadowSize = new GSize(icon_ro_shadow_w, icon_ro_shadow_h);
	G_icon_ro[pid].iconAnchor = new GPoint(icon_anchor_w, icon_anchor_h);
	G_icon_ro[pid].infoWindowAnchor = new GPoint(5, 1);
}




function myGaddMarker (lon,lat,href,description,pageid,pid) {
	if (G_map) {
		var point = new GLatLng(lon,lat);
		var marker = new GMarker(point, G_icon_no[pid]);
		G_marker_no[G_marker_counter] = marker;
		GEvent.addListener(marker, "click", function() {
			location.href=href;
		});
		GEvent.addListener(marker, "mouseover", function() {
			try {
				G_map.removeOverlay(G_marker_ro);
				G_map.removeOverlay(G_marker_act);
				G_Textbox.remove();
			} catch (e) {}
			G_marker_ro = new GMarker(marker.getPoint(), G_icon_ro[pid]);
			myGTextboxShow(marker.getPoint(),description);
			GEvent.addListener(G_marker_ro, 'mouseout', function() {
				G_map.removeOverlay(G_marker_ro);
				G_Textbox.remove();
			});
			GEvent.addListener(G_marker_ro, 'click', function() {
				location.href=href;
			});
			G_map.addOverlay(G_marker_ro);
		});
		G_map.addOverlay(G_marker_no[G_marker_counter]);
		if (G_ZoomId==pageid) {
			try {
				G_map.removeOverlay(G_marker_ro);
				G_map.removeOverlay(G_marker_act);
				G_Textbox.remove();
			} catch (e) {}
			G_marker_act = new GMarker(marker.getPoint(), G_icon_ro[pid]);
			myGTextboxShow(marker.getPoint(),description);
			G_map.addOverlay(G_marker_act);
		}
		G_marker_counter = G_marker_counter+1;
	}
}



/***************/
/*** TEXTBOX ***/
/***************/

var G_internal_width=0;
var G_internal_run=0;

function myGTextbox (bounds, point) {
	this.bounds_ = bounds;
	this.point_ = point;
}

function myGTextboxShow (point,description) {

	description = description.replace(/ /g,"\u00a0");

	myGTextbox.prototype = new GOverlay();

	myGTextbox.prototype.initialize = function(G_map) {
		var div = document.createElement("div");
		div.style.position = "absolute";
		if (parseInt(G_internal_run)==0) {
			div.innerHTML = "<div id=\"theTextbox\" style=\"width:auto;visibility:hidden;color:#FFFFFF;background:#FFFFFF;\">"+description+"</div>";
		} else {
			this.width_ = parseInt(G_internal_width)+4;
			div.style.padding="1px";
			div.style.border = "1px solid #294288";
			div.style.backgroundColor = "#FFFFFF";
			div.style.color = "#294288";
			div.style.width = G_internal_width+"px";
			div.style.whitespace = "nowrap";
			div.style.visibility = "hidden";
			div.appendChild(document.createTextNode(description));

		}

		// these mouseover markers shall appear on the very top pane
		G_map.getPane(G_MAP_FLOAT_PANE).appendChild(div);

		this.map_ = G_map;
		this.div_ = div;
		
	}

	// Remove the main DIV from the map pane
	myGTextbox.prototype.remove = function() {
		this.div_.parentNode.removeChild(this.div_);
	}

	// Copy our data to a new Rectangle
	myGTextbox.prototype.copy = function() {
		return new myGTextbox(this.bounds_, this.weight_, this.color_, this.backgroundColor_, this.opacity_);
	}

	// Redraw the rectangle based on the current projection and zoom level
	myGTextbox.prototype.redraw = function(force) {
		// We only need to redraw if the coordinate system has changed
		if (!force) {
			return;
		}
/*
		this.div_.style.width = Math.abs(c2.x - c1.x) + "px";
		this.div_.style.height = Math.abs(c2.y - c1.y) + "px";
		this.div_.style.left = (Math.min(c2.x, c1.x) - this.weight_) + "px";
		this.div_.style.top = (Math.min(c2.y, c1.y) - this.weight_) + "px";
*/
		var pixelcoord = this.map_.fromLatLngToDivPixel(this.point_);
		var c2 = this.map_.fromLatLngToDivPixel(this.map_.getBounds().getNorthEast());
		var c1 = this.map_.fromLatLngToDivPixel(this.map_.getBounds().getSouthWest());
		if (	parseInt(c2.x) - 5 >= parseInt(pixelcoord.x) + Math.floor(parseInt(G_internal_width)/2) &&
			parseInt(c1.x) + 35 <= parseInt(pixelcoord.x) - Math.floor(parseInt(G_internal_width)/2)) {
			this.div_.style.left = (parseInt(pixelcoord.x) - Math.floor(parseInt(G_internal_width)/2)) + "px";
			this.div_.style.top = (pixelcoord.y + 3) + "px";
		} else {
			if(parseInt(c1.x) + 35 > parseInt(pixelcoord.x) - Math.floor(parseInt(G_internal_width)/2)) {
//				this.div_.style.left = (parseInt(c1.x) + 35) + "px";
				this.div_.style.left = (pixelcoord.x + 12) + "px";
				this.div_.style.top = (pixelcoord.y - 16) + "px";
			} else {
//				this.div_.style.left = (parseInt(c2.x) - parseInt(G_internal_width) - 5) + "px";
				this.div_.style.left = (pixelcoord.x - 12 - G_internal_width) + "px";
				this.div_.style.top = (pixelcoord.y - 16) + "px";
			}
		}
		this.div_.style.visibility = "visible";
	}

	// Display a rectangle in the center of the map at about a quarter of
	// the size of the main map
	var n_bounds = G_map.getBounds();
	var n_southWest = n_bounds.getSouthWest();
	var n_northEast = n_bounds.getNorthEast();
	var n_lngDelta = (n_northEast.lng() - n_southWest.lng()) / 4;
	var n_latDelta = (n_northEast.lat() - n_southWest.lat()) / 4;
	var rectBounds = new GLatLngBounds(
		new GLatLng(n_southWest.lat() + n_latDelta, n_southWest.lng() + n_lngDelta),
		new GLatLng(n_northEast.lat() - n_latDelta, n_northEast.lng() - n_lngDelta)
	);

	// first run: render the Textbox to dynamically determine its width
	G_internal_width=0;
	G_internal_run=0;
	G_Textbox = new myGTextbox(rectBounds,point);
	G_map.addOverlay(G_Textbox);
	G_internal_width=document.getElementById('theTextbox').offsetWidth;

	// second run: remove the object created during first run,
	// create object with the now known width.
	G_Textbox.remove();
	G_internal_run=1;
	G_Textbox = new myGTextbox(rectBounds,point);
	G_map.addOverlay(G_Textbox);
}



/***************/
/*** MAPTYPE ***/
/*** ZOOM and CENTER ***/
/***************/

function myGTypeControlAct() {
	switch (G_currentType) {
		case G_NORMAL_MAP:
			MapDiv.style.backgroundColor = "#FF8143";
			SatDiv.style.backgroundColor = "#294288";
			HybDiv.style.backgroundColor = "#294288";
			MapDiv.style.color = "#294288";
			SatDiv.style.color = "#FF8143";
			HybDiv.style.color = "#FF8143";
			MapDiv.style.border = "1px solid #9DB9DA";
			SatDiv.style.border = "1px solid #FF8143";
			HybDiv.style.border = "1px solid #FF8143";
		break;
		case G_SATELLITE_MAP:
			MapDiv.style.backgroundColor = "#294288";
			SatDiv.style.backgroundColor = "#FF8143";
			HybDiv.style.backgroundColor = "#294288";
			MapDiv.style.color = "#FF8143";
			SatDiv.style.color = "#294288";
			HybDiv.style.color = "#FF8143";
			MapDiv.style.border = "1px solid #FF8143";
			SatDiv.style.border = "1px solid #9DB9DA";
			HybDiv.style.border = "1px solid #FF8143";
		break;
		default:
			MapDiv.style.backgroundColor = "#294288";
			SatDiv.style.backgroundColor = "#294288";
			HybDiv.style.backgroundColor = "#FF8143";
			MapDiv.style.color = "#FF8143";
			SatDiv.style.color = "#FF8143";
			HybDiv.style.color = "#294288";
			MapDiv.style.border = "1px solid #FF8143";
			SatDiv.style.border = "1px solid #FF8143";
			HybDiv.style.border = "1px solid #9DB9DA";
		break;
	}
}

function myGTypeControl () {
}
function myGCenterControl () {
}

function myGmakeControl () {

	myGTypeControl.prototype = new GControl();
	myGCenterControl.prototype = new GControl();

	myGTypeControl.prototype.initialize = function(G_map) {
		var container = document.createElement("div");

		MapDiv = document.createElement("div");
		this.setButtonStyle_(MapDiv);
		container.appendChild(MapDiv);
		MapDiv.appendChild(document.createTextNode("Map"));
		GEvent.addDomListener(MapDiv, "click", function() {
			G_map.setMapType(G_NORMAL_MAP);
		});
		GEvent.addDomListener(MapDiv, "mouseover", function() {
			myGTypeControlAct();
			MapDiv.style.backgroundColor = "#FF8143";
			MapDiv.style.color = "#294288";
			MapDiv.style.border = "1px solid #9DB9DA";
		});
		GEvent.addDomListener(MapDiv, "mouseout", function() {
			myGTypeControlAct();
		});

		SatDiv = document.createElement("div");
		this.setButtonStyle_(SatDiv);
		container.appendChild(SatDiv);
		SatDiv.appendChild(document.createTextNode("Satellite"));
		GEvent.addDomListener(SatDiv, "click", function() {
			G_map.setMapType(G_SATELLITE_MAP);
		});
		GEvent.addDomListener(SatDiv, "mouseover", function() {
			myGTypeControlAct();
			SatDiv.style.backgroundColor = "#FF8143";
			SatDiv.style.color = "#294288";
			SatDiv.style.border = "1px solid #9DB9DA";
		});
		GEvent.addDomListener(SatDiv, "mouseout", function() {
			myGTypeControlAct();
		});

		HybDiv = document.createElement("div");
		this.setButtonStyle_(HybDiv);
		container.appendChild(HybDiv);
		HybDiv.appendChild(document.createTextNode("Hybrid"));
		GEvent.addDomListener(HybDiv, "click", function() {
			G_map.setMapType(G_HYBRID_MAP);
		});
		GEvent.addDomListener(HybDiv, "mouseover", function() {
			myGTypeControlAct();
			HybDiv.style.backgroundColor = "#FF8143";
			HybDiv.style.color = "#294288";
			HybDiv.style.border = "1px solid #9DB9DA";
		});
		GEvent.addDomListener(HybDiv, "mouseout", function() {
			myGTypeControlAct();
		});

		G_map.getContainer().appendChild(container);

		return container;
	}

	myGCenterControl.prototype.initialize = function(G_map) {
		var container = document.createElement("div");

		if (G_ZoomId>0) {

			LocationDiv = document.createElement("div");
			this.setButtonStyle_(LocationDiv);
			container.appendChild(LocationDiv);
			LocationDiv.appendChild(document.createTextNode("Contact"));
			GEvent.addDomListener(LocationDiv, "click", function() {
				G_marker_counter = 0;
				myGaddMarker(-29.6719414043378120,-51.5223173323908910,'http://www.trumpler.de/en/contact/subsidiary/brazil.html','Brazil',109,100);myGaddMarker(30.7580009179029720,120.7492138547601900,'http://www.trumpler.de/en/contact/subsidiary/china.html','China',107,100);myGaddMarker(43.7651100000000000,2.0085400000000000,'http://www.trumpler.de/en/contact/subsidiary/france.html','France',106,100);myGaddMarker(49.6453700000000000,8.3708800000000000,'http://www.trumpler.de/en/contact/subsidiary/germany.html','Germany',162,100);myGaddMarker(13.9337340000000000,-90.8198550000000000,'http://www.trumpler.de/en/contact/subsidiary/guatemala.html','Guatemala',108,100);myGaddMarker(45.5120700000000000,11.3466400000000000,'http://www.trumpler.de/en/contact/subsidiary/italy-arzignano-vi.html','Italy - Arzignano (VI)',104,100);myGaddMarker(45.0834900000000000,7.4763900000000000,'http://www.trumpler.de/en/contact/subsidiary/italy-lacsa.html','Italy - LACSA',102,100);myGaddMarker(43.7170756084199680,10.7645386395442610,'http://www.trumpler.de/en/contact/subsidiary/italy-s-croce.html','Italy - S. Croce',105,100);myGaddMarker(40.8323700000000000,14.8278300000000000,'http://www.trumpler.de/en/contact/subsidiary/italy-solofra-av.html','Italy - Solofra (AV)',103,100);myGaddMarker(19.5311218221455470,-99.2113090463444250,'http://www.trumpler.de/en/contact/subsidiary/mexiko-robama.html','Mexiko - ROBAMA',114,100);myGaddMarker(21.0837859388816930,-101.6869434213369500,'http://www.trumpler.de/en/contact/subsidiary/mexiko-trumpler.html','Mexiko - TRUMPLER',115,100);myGaddMarker(41.6669400000000000,2.7494600000000000,'http://www.trumpler.de/en/contact/subsidiary/spain-robama.html','Spain - ROBAMA',112,100);myGaddMarker(41.5150600000000000,2.1272200000000000,'http://www.trumpler.de/en/contact/subsidiary/spain-trumpler.html','Spain - TRUMPLER',113,100);myGaddMarker(36.7755005958702060,3.0596977903224545,'http://www.trumpler.de/en/contact/representation/algeria.html','Algeria',124,101);myGaddMarker(23.7098012323955240,90.4071059639460370,'http://www.trumpler.de/en/contact/representation/bangladesh.html','Bangladesh',122,101);myGaddMarker(53.9166670000000000,19.4443000000000000,'http://www.trumpler.de/en/contact/representation/belarus.html','Belarus',121,101);myGaddMarker(-17.3841434793639320,-66.1667058258324800,'http://www.trumpler.de/en/contact/representation/bolivia.html','Bolivia',120,101);myGaddMarker(-33.4883687217389150,-70.6028282363106710,'http://www.trumpler.de/en/contact/representation/chile.html','Chile',119,101);myGaddMarker(6.2441355314373500,-75.5973339637802160,'http://www.trumpler.de/en/contact/representation/colombia.html','Colombia',118,101);myGaddMarker(45.8000000000000000,16.0000000000000000,'http://www.trumpler.de/en/contact/representation/croatia.html','Croatia',117,101);myGaddMarker(-0.3253760243405594,-78.4400161858357310,'http://www.trumpler.de/en/contact/representation/ecuador.html','Ecuador',116,101);myGaddMarker(30.0570994006215530,31.2271999739514360,'http://www.trumpler.de/en/contact/representation/egypt.html','Egypt',133,101);myGaddMarker(12.9155600000000000,79.1357230000000000,'http://www.trumpler.de/en/contact/representation/india.html','India',130,101);myGaddMarker(-6.1828705386207945,106.8291088582537600,'http://www.trumpler.de/en/contact/representation/indonesia.html','Indonesia',129,101);myGaddMarker(35.6833330000000000,51.4166670000000000,'http://www.trumpler.de/en/contact/representation/iran.html','Iran',128,101);myGaddMarker(35.6798793427466660,139.7575023846594000,'http://www.trumpler.de/en/contact/representation/japan.html','Japan',127,101);myGaddMarker(51.1666670000000000,71.5000000000000000,'http://www.trumpler.de/en/contact/representation/jordan.html','Jordan',126,101);myGaddMarker(37.5177605488324840,127.0166338279223300,'http://www.trumpler.de/en/contact/representation/korea.html','Korea',125,101);myGaddMarker(33.9000000000000000,35.5333330000000000,'http://www.trumpler.de/en/contact/representation/lebanon.html','Lebanon',142,101);myGaddMarker(42.0000000000000000,21.4333330000000000,'http://www.trumpler.de/en/contact/representation/macedonia.html','Macedonia',141,101);myGaddMarker(33.5888978053601830,-7.6089011363963284,'http://www.trumpler.de/en/contact/representation/morocco.html','Morocco',140,101);myGaddMarker(-39.4917357519908800,176.9162812312404500,'http://www.trumpler.de/en/contact/representation/new-zealand.html','New Zealand',139,101);myGaddMarker(-25.2666670000000000,-57.6666670000000000,'http://www.trumpler.de/en/contact/representation/paraguay.html','Paraguay',136,101);myGaddMarker(-12.5939939196368960,-69.1697947652681000,'http://www.trumpler.de/en/contact/representation/peru.html','Peru',135,101);myGaddMarker(51.7977000000000000,19.4443000000000000,'http://www.trumpler.de/en/contact/representation/poland.html','Poland',134,101);myGaddMarker(39.4577600000000000,-8.6685200000000000,'http://www.trumpler.de/en/contact/representation/portugal.html','Portugal',151,101);myGaddMarker(46.3377000000000000,15.4209000000000000,'http://www.trumpler.de/en/contact/representation/slovenia.html','Slovenia',148,101);myGaddMarker(-25.7166670000000000,28.2833330000000000,'http://www.trumpler.de/en/contact/representation/south-africa.html','South Africa',147,101);myGaddMarker(33.5000000000000000,36.3000000000000000,'http://www.trumpler.de/en/contact/representation/syria.html','Syria',145,101);myGaddMarker(24.1470126627031760,120.6742057983246100,'http://www.trumpler.de/en/contact/representation/taiwan.html','Taiwan',144,101);myGaddMarker(13.7333330000000000,100.5000000000000000,'http://www.trumpler.de/en/contact/representation/thailand.html','Thailand',143,101);myGaddMarker(36.8333330000000000,10.1500000000000000,'http://www.trumpler.de/en/contact/representation/tunisia.html','Tunisia',158,101);myGaddMarker(41.0003000000000000,28.8810000000000000,'http://www.trumpler.de/en/contact/representation/turkey.html','Turkey',157,101);myGaddMarker(-34.8221629520633940,-56.1966077858832950,'http://www.trumpler.de/en/contact/representation/uruguay.html','Uruguay',154,101);myGaddMarker(10.4960505269451070,-66.8982848100665710,'http://www.trumpler.de/en/contact/representation/venezuela.html','Venezuela',153,101);myGaddMarker(10.7591850399693950,106.6625073056609500,'http://www.trumpler.de/en/contact/representation/vietnam.html','Vietnam',152,101);
				G_map.setCenter(new GLatLng(0.0000000000000000,0.0000000000000000), 7);
			});
			GEvent.addDomListener(LocationDiv, "mouseover", function() {
				LocationDiv.style.backgroundColor = "#FF8143";
				LocationDiv.style.color = "#294288";
				LocationDiv.style.border = "1px solid #9DB9DA";
			});
			GEvent.addDomListener(LocationDiv, "mouseout", function() {
				LocationDiv.style.backgroundColor = "#294288";
				LocationDiv.style.color = "#FF8143";
				LocationDiv.style.border = "1px solid #FF8143";
			});
		}



		AllLocationDiv = document.createElement("div");
		this.setButtonStyle_(AllLocationDiv);
		container.appendChild(AllLocationDiv);
		AllLocationDiv.appendChild(document.createTextNode("global view"));
		GEvent.addDomListener(AllLocationDiv, "click", function() {
			G_map.setCenter(new GLatLng(30,30), 1);
		});
		GEvent.addDomListener(AllLocationDiv, "mouseover", function() {
			AllLocationDiv.style.backgroundColor = "#FF8143";
			AllLocationDiv.style.color = "#294288";
			AllLocationDiv.style.border = "1px solid #9DB9DA";
		});
		GEvent.addDomListener(AllLocationDiv, "mouseout", function() {
			AllLocationDiv.style.backgroundColor = "#294288";
			AllLocationDiv.style.color = "#FF8143";
			AllLocationDiv.style.border = "1px solid #FF8143";
		});

		EULocationDiv = document.createElement("div");
		this.setButtonStyle_(EULocationDiv);
		container.appendChild(EULocationDiv);
		EULocationDiv.appendChild(document.createTextNode("Europe"));
		GEvent.addDomListener(EULocationDiv, "click", function() {
			G_map.setCenter(new GLatLng(49,21), 3);
		});
		GEvent.addDomListener(EULocationDiv, "mouseover", function() {
			EULocationDiv.style.backgroundColor = "#FF8143";
			EULocationDiv.style.color = "#294288";
			EULocationDiv.style.border = "1px solid #9DB9DA";
		});
		GEvent.addDomListener(EULocationDiv, "mouseout", function() {
			EULocationDiv.style.backgroundColor = "#294288";
			EULocationDiv.style.color = "#FF8143";
			EULocationDiv.style.border = "1px solid #FF8143";
		});

		G_map.getContainer().appendChild(container);
		return container;
	}


	// By default, the control will appear in the top right corner of the
	// map with 1 pixel of padding.
	myGTypeControl.prototype.getDefaultPosition = function() {
		return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(1, 1));
	}
	myGCenterControl.prototype.getDefaultPosition = function() {
		return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(60, 1));
	}

	// Sets the proper CSS for the given button element.
	myGTypeControl.prototype.setButtonStyle_ = function(button) {
		button.style.textDecoration = "none";
		button.style.color = "#FF8143";
		button.style.backgroundColor = "#294288";
		button.style.font = "10px Arial";
		button.style.border = "1px solid #FF8143";
		button.style.padding = "1px";
		button.style.marginBottom = "2px";
		button.style.textAlign = "center";
		button.style.width = "40px";
		button.style.cursor = "pointer";
	}

	myGCenterControl.prototype.setButtonStyle_ = function(button) {
		button.style.textDecoration = "none";
		button.style.color = "#FF8143";
		button.style.backgroundColor = "#294288";
		button.style.font = "10px Arial";
		button.style.border = "1px solid #FF8143";
		button.style.padding = "1px";
		button.style.marginBottom = "2px";
		button.style.textAlign = "center";
		button.style.width = "130px";
		button.style.cursor = "pointer";
	}


	G_map.addControl(new myGTypeControl());
	G_map.addControl(new myGCenterControl());

	GEvent.addListener(G_map, "maptypechanged", function() {
		G_currentType = G_map.getCurrentMapType();
		myGTypeControlAct();
	});

}












function decode_utf8(utftext) {

	var plaintext = ""; var i=0; var c=c1=c2=0;

	// while-Schleife, weil einige Zeichen uebersprungen werden
	while(i<utftext.length) {
		c = utftext.charCodeAt(i);
		if (c<128) {
			plaintext += String.fromCharCode(c);
			i++;
		} else {
			if((c>191) && (c<224)) {
				c2 = utftext.charCodeAt(i+1);
				plaintext += String.fromCharCode(((c&31)<<6) | (c2&63));
				i+=2;
			} else {
				c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2);
				plaintext += String.fromCharCode(((c&15)<<12) | ((c2&63)<<6) | (c3&63));
				i+=3;
			}
		}
	}
	return plaintext;
}


