var currentId = 12;
var map;


function setCurrentId(id) {
	
	currentId = id;
}


function loadNiederlassung(id) {

	if ((currentId > 0) && (document.getElementById('niederlassung_'+currentId)))
		document.getElementById('niederlassung_'+currentId).style.display = 'none';

	document.getElementById('niederlassung_'+id).style.display = 'block';
	currentId = id;
}


function loadGmap(lg, bg, zoomLevel) {

	if (GBrowserIsCompatible()) {
	
		var map = new GMap2(document.getElementById("gmap"));
		map.setCenter(new GLatLng(bg, lg), zoomLevel);
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		
		var icon = new GIcon();
		icon.image = "images/icons/logo_gmap.png";
		icon.iconSize = new GSize(55, 35);
		icon.iconAnchor = new GPoint(6, 20);
		icon.infoWindowAnchor = new GPoint(5, 1);
		var point = new GLatLng(bg, lg);
		map.addOverlay(new GMarker(point, icon));
	
	}
}


function loadAddress(value) {

	if (value == '-1') {
	
		document.getElementById('address_opt').style.display = 'block';
		document.getElementById('karte').style.display = 'none';
	}
	else {
	
		document.getElementById('address_opt').style.display = 'none';
		document.getElementById('karte').style.display = 'block';
		
		var lg = document.getElementById('laengengrad_' + value).value;
		var bg = document.getElementById('breitengrad_' + value).value;
		var icon = new GIcon();
		icon.image = "images/icons/logo_gmap.png";
		icon.iconSize = new GSize(55, 35);
		icon.iconAnchor = new GPoint(6, 20);
		icon.infoWindowAnchor = new GPoint(5, 1);
		
		map.setCenter(new GLatLng(bg, lg), 14);
		map.addOverlay(new GMarker(new GLatLng(bg, lg), icon));
	}
}
