window.showMap=showMap;window.initindexmap=initindexmap;window.hideMap=hideMap;window.showMap=showMap;window.tglSearchMap=tglSearchMap;var cookiename="osc_showmap";var mapisdrawn=false;function tglSearchMap(id){var indexmap=$("#"+id);if(indexmap.css("display")=="none"){showMap(id)}else{hideMap(id)}}function showMap(id){setCookie(cookiename,"1",1);$("#"+id).fadeIn(500,function(){$("#hrefindexmap").text("Karte ausblenden")});initindexmap(getMapPoints(),id)}function hideMap(id){setCookie(cookiename,"0",1);$("#"+id).fadeOut(500,function(){$("#hrefindexmap").text("Adressen dieser Seite auf Karte anzeigen")})}function classExists(c){return typeof(c)=="function"&&typeof(c.prototype)=="object"?true:false}function initindexmap(points,id){if((typeof(GMap2)=="undefined")||!classExists(GMap2)){hideMap(id);alert("Ihr Browser unterstützt die Darstellung der Karte nicht.");return false}map=new GMap2(document.getElementById(id));map.addControl(new GLargeMapControl());var mySpace=new GLatLngBounds(),showmap=$("#showmap"),oscIcon=getIcon(),markerOptions={icon:oscIcon};if(points.length<=1&&points[0]==""){hideMap(id);alert("Es wurden keine darstellbaren Adressen gefunden.");return}$(points).each(function(){var marker=new GMarker(new GLatLng(this[0],this[1]),markerOptions);marker.bindInfoWindowHtml(this[2]);map.addOverlay(marker);mySpace.extend(new GLatLng(this[0],this[1]))});map.setCenter(mySpace.getCenter(),map.getBoundsZoomLevel(mySpace))};
