jQuery(document).ready(function(){
  if(GBrowserIsCompatible()){
    var map = new GMap2(document.getElementById('map')); 
    var geocoder = new GClientGeocoder();
    //map.setUIToDefault();
    showAddress('Bugfree Media GbR,<br />Stuttgarter Straße 102, 71032 Böblingen',geocoder,map) // Karte über Adresse laden
  }
});

function showAddress(address,geocoder,map) {
  geocoder.getLatLng(
    address,
    function(point) {
      if (!point) {
        alert(address + " nicht gefunden!");
      } else {
        map.setCenter(point, 13);
        map.addControl(new GSmallMapControl());
        /*
        var myIcon = new GIcon();
        myIcon.image = 'icons/image.png';
        myIcon.shadow = 'icons/shadow.png';
        myIcon.iconSize = new GSize(50,77);
        myIcon.shadowSize = new GSize(89,77);
        myIcon.iconAnchor = new GPoint(0,77);
        myIcon.infoWindowAnchor = new GPoint(25,0);
        myIcon.printImage = 'icons/printImage.gif';
        myIcon.mozPrintImage = 'icons/mozPrintImage.gif';
        myIcon.printShadow = 'icons/printShadow.gif';
        myIcon.transparent = 'icons/transparent.png';
        */
        var marker = new GMarker(point);
        map.addOverlay(marker);
        marker.openInfoWindowHtml(address);
      }
    }
  );
}

function toggleMap(){
  if(jQuery('#map').css('visibility') == 'hidden'){
    jQuery('#map').css('visibility','visible');
  }
  else{
    jQuery('#map').css('visibility','hidden');
  }
}

