    //<![CDATA[
      if (GBrowserIsCompatible()) {
    
    var icon01 = new GIcon(); 
    icon01.image = 'graphsearch/iris_01.png';
    icon01.iconSize = new GSize(32, 32);
    icon01.iconAnchor = new GPoint(16, 16);
    icon01.infoWindowAnchor = new GPoint(16, 16);
    icon01.imageMap = [ 2,16, 8,8, 16,2, 24,8, 30,16, 24,24, 16,30, 8,24 ];

    var icon02 = new GIcon(); 
    icon02.image = 'graphsearch/iris_02.png';
    icon02.iconSize = new GSize(32, 32);
    icon02.iconAnchor = new GPoint(16, 16);
    icon02.infoWindowAnchor = new GPoint(16, 16);
    icon02.imageMap = [ 2,16, 8,8, 16,2, 24,8, 30,16, 24,24, 16,30, 8,24 ];

    var icon03 = new GIcon(); 
    icon03.image = 'graphsearch/iris_03.png';
    icon03.iconSize = new GSize(32, 32);
    icon03.iconAnchor = new GPoint(16, 16);
    icon03.infoWindowAnchor = new GPoint(16, 16);
    icon03.imageMap = [ 2,16, 8,8, 16,2, 24,8, 30,16, 24,24, 16,30, 8,24 ];

    var icon04 = new GIcon(); 
    icon04.image = 'graphsearch/iris_04.png';
    icon04.iconSize = new GSize(32, 32);
    icon04.iconAnchor = new GPoint(16, 16);
    icon04.infoWindowAnchor = new GPoint(16, 16);
    icon04.imageMap = [ 2,16, 8,8, 16,2, 24,8, 30,16, 24,24, 16,30, 8,24 ];

    var icon05 = new GIcon(); 
    icon05.image = 'graphsearch/iris_05.png';
    icon05.iconSize = new GSize(32, 32);
    icon05.iconAnchor = new GPoint(16, 16);
    icon05.infoWindowAnchor = new GPoint(16, 16);
    icon05.imageMap = [ 2,16, 8,8, 16,2, 24,8, 30,16, 24,24, 16,30, 8,24 ];

    var icon06 = new GIcon(); 
    icon06.image = 'graphsearch/iris_06.png';
    icon06.iconSize = new GSize(32, 32);
    icon06.iconAnchor = new GPoint(16, 16);
    icon06.infoWindowAnchor = new GPoint(16, 16);
    icon06.imageMap = [ 2,16, 8,8, 16,2, 24,8, 30,16, 24,24, 16,30, 8,24 ];

    var icon07 = new GIcon(); 
    icon07.image = 'graphsearch/iris_07.png';
    icon07.iconSize = new GSize(32, 32);
    icon07.iconAnchor = new GPoint(16, 16);
    icon07.infoWindowAnchor = new GPoint(16, 16);
    icon07.imageMap = [ 2,16, 8,8, 16,2, 24,8, 30,16, 24,24, 16,30, 8,24 ];

    var icon08 = new GIcon(); 
    icon08.image = 'graphsearch/iris_08.png';
    icon08.iconSize = new GSize(32, 32);
    icon08.iconAnchor = new GPoint(16, 16);
    icon08.infoWindowAnchor = new GPoint(16, 16);
    icon08.imageMap = [ 2,16, 8,8, 16,2, 24,8, 30,16, 24,24, 16,30, 8,24 ];

    var icon09 = new GIcon(); 
    icon09.image = 'graphsearch/iris_09.png';
    icon09.iconSize = new GSize(32, 32);
    icon09.iconAnchor = new GPoint(16, 16);
    icon09.infoWindowAnchor = new GPoint(16, 16);
    icon09.imageMap = [ 2,16, 8,8, 16,2, 24,8, 30,16, 24,24, 16,30, 8,24 ];

    var icon10 = new GIcon(); 
    icon10.image = 'graphsearch/iris_10.png';
    icon10.iconSize = new GSize(32, 32);
    icon10.iconAnchor = new GPoint(16, 16);
    icon10.infoWindowAnchor = new GPoint(16, 16);
    icon10.imageMap = [ 2,16, 8,8, 16,2, 24,8, 30,16, 24,24, 16,30, 8,24 ];

    var icon11 = new GIcon(); 
    icon11.image = 'graphsearch/iris_11.png';
    icon11.iconSize = new GSize(32, 32);
    icon11.iconAnchor = new GPoint(16, 16);
    icon11.infoWindowAnchor = new GPoint(16, 16);
    icon11.imageMap = [ 2,16, 8,8, 16,2, 24,8, 30,16, 24,24, 16,30, 8,24 ];

    var icon12 = new GIcon(); 
    icon12.image = 'graphsearch/iris_12.png';
    icon12.iconSize = new GSize(32, 32);
    icon12.iconAnchor = new GPoint(16, 16);
    icon12.infoWindowAnchor = new GPoint(16, 16);
    icon12.imageMap = [ 2,16, 8,8, 16,2, 24,8, 30,16, 24,24, 16,30, 8,24 ];

    var customIcons = [];
    customIcons["hotel"] = icon01;
    customIcons["gastro"] = icon02;
    customIcons["night"] = icon03;
    customIcons["fitness"] = icon04;
    customIcons["wellness"] = icon05;
    customIcons["fun"] = icon06;
    customIcons["handwerk"] = icon07;
    customIcons["schule"] = icon08;
    customIcons["recht"] = icon09;
    customIcons["medizin"] = icon10;
    customIcons["care"] = icon11;
    customIcons["rat"] = icon12;

	var iconGroups = [];
	var initart = true;
	var searchedalready = false;

  function modusSuche (area) {
  	initart = true;
  	searchedalready = false;
    var modusbar = document.getElementById("headlines");
	var moduslinks = modusbar.getElementsByTagName("a");
	for (var i = 0; i < moduslinks.length; i++) {
			moduslinks[i].className = 'weiss';
		};
	document.getElementById(area).className = 'braun'
    var entrybar = 'entrybar'+area;
    var natDetect;
    if (area != 'Nat') {
    		natDetect = 0;
    	} else {
    		natDetect = 1;
    	};
    var checkbarclass = 'checkbar'+ natDetect;
    var mapbarclass = 'mapbar'+ natDetect;
    var mapclass = 'map'+ natDetect;
    var resultsbarclass = 'resultsbar'+ natDetect;
    var sidebarclass = 'sidebar'+ natDetect;
	document.getElementById('checkbar').className = checkbarclass;
	document.getElementById('mapbar').className = mapbarclass;
	document.getElementById('sidebarcontainer').className = resultsbarclass;
	document.getElementById('sidebar').className = sidebarclass;
	document.getElementById('map').className = mapclass;
	document.getElementById('entrybarLoc').style.display = "none";
	document.getElementById('entrybarReg').style.display = "none";
	document.getElementById('entrybarNat').style.display = "none";
	document.getElementById(entrybar).style.display = "inline";
	if (area != 'Loc') {
		    searchLocations(area);
    	} else { 
    		document.getElementById('sidebar').innerHTML = '<span class="iwstartstil">Lieber Besucher,</span><p><span class="blau">ERSTMAL</span><span class="orange">KUCKEN</span> <span class="iwstartstil">ist noch recht jung, so dass Sie vorl&auml;ufig nur an wenigen Orten Eintr&auml;ge in unserer Online - Filmothek finden werden.</span></p><p class="iwstartstil">Sie k&ouml;nnen aber trotzdem einfach mal ausprobieren, wie n&uuml;tzlich Sie diese Nachbarschaftssuche finden und wie einfach sie funktioniert. Dazu m&uuml;ssen Sie nat&uuml;rlich wissen, welche Postleitzahlen schon jetzt zu einem Ergebnis f&uuml;hren. Kucken Sie doch einfach mal:<br />&bull; auf Baltrum (PLZ 26579) nach "Sport", "Schlemmen" oder "&Uuml;bernachten"<br />&bull; in Oldenburg (PLZ 26135) nach "Handwerk" oder "Fitness"<br />&bull; in Hannover (PLZ 30159, Umkreis 5km) nach "Design" oder "Wellness"<br />&bull; in Dortmund (PLZ 44135, Umkreis 5km) nach "Gesundheit", "Recht" oder "Handwerk".</p><p class="iwstartstilcenter"><b>Viel Spa&szlig; dabei!</b></p>';
    	};
  }
   
  function catClick(art) {
  	if (document.getElementById(art+"box").checked == false) {
  		document.getElementById(art+"box").checked = true;
  		show(art);
	 	document.getElementById(art+"bar").src = "graphsearch/button_act_"+art+".png";
 		} else {
  		document.getElementById(art+"box").checked = false;
  		hide(art);
 		document.getElementById(art+"bar").src = "graphsearch/button_off_"+art+".png";
 		} 	  
  	  initart = false;
	  if (searchedalready == true) {makeSidebar ();};
 	}
 	
 	function show(art) {
  		for (var i=0; i<iconGroups.length; i++) {
    	if (iconGroups[i].auswahlart == art) {
   		iconGroups[i].show();
   		}
 	  } 
 	    document.getElementById(art+"box").checked = true;
	}
	function hide(art) {
  		for (var i=0; i<iconGroups.length; i++) {
    	if (iconGroups[i].auswahlart == art) {
   		iconGroups[i].hide();
   		}
 	  } 
 	    document.getElementById(art+"box").checked = false;
 	    map.closeInfoWindow();
	}
	function checkStatus(art) {
  		for (var i = 0; i < iconGroups.length; i++) {
    	if (iconGroups[i].auswahlart == art) {
   		if (document.getElementById(art+"box").checked == false) {
   		hide(art);
  		document.getElementById(art+"bar").src = "graphsearch/button_off_"+art+".png"; 		
   		} else {
  		show(art);
  		document.getElementById(art+"bar").src = "graphsearch/button_act_"+art+".png";
   		}
 	  } 
	}
	makeSidebar();
	}
	
	function boxclick(box,art) {
    	if (box.checked) {
   		show(art);
  		} else {
  		hide(art);
   		}
   		makeSidebar();
 	}
 	
 	
 	function myclick(i) {
 		GEvent.trigger(iconGroups[i],"click");
 	}
	function makeSidebar() {
      document.getElementById("sidebar").innerHTML = "";
      var html = "";
      for (var i=0; i<iconGroups.length; i++) {
          if (!iconGroups[i].isHidden()) {
           html += '<a href="javascript:myclick(' + i + ')"><span class="iwheadstil"><b>' + iconGroups[i].auswahlfirma + '</b></span></a><br/><span class="iwdescstil" style="line-height:10px">' + iconGroups[i].auswahlbeschreibung + '</span><br/>' + iconGroups[i].auswahlstrasse + '&nbsp;&nbsp;&bull;&nbsp;&nbsp;' + iconGroups[i].auswahlplz + " " + iconGroups[i].auswahlort + '<hr/>';
    	  }
   	  }
	  var treffer = html.length;
	  if (treffer == 0) { html = 'Leider haben wir noch keine Eintr&auml;ge innerhalb Ihres Suchbereichs. Aber hoffentlich bald ...' };
	  if (document.getElementById("hotelbox").checked == false && document.getElementById("gastrobox").checked == false && document.getElementById("nightbox").checked == false && document.getElementById("fitnessbox").checked == false && document.getElementById("wellnessbox").checked == false && document.getElementById("funbox").checked == false && document.getElementById("handwerkbox").checked == false && document.getElementById("schulebox").checked == false && document.getElementById("rechtbox").checked == false && document.getElementById("medizinbox").checked == false && document.getElementById("carebox").checked == false && document.getElementById("ratbox").checked == false) { html = 'Bitte w&auml;hlen Sie mindestens einen Themenbereich aus.' };
      document.getElementById("sidebar").innerHTML = html;
    }

        var geocoder = new GClientGeocoder();
        var map = new GMap2(document.getElementById('map'));
        map.setMapType(G_SATELLITE_MAP);
        var customUI = map.getDefaultUI();
        customUI.maptypes.hybrid = false;
        map.setUI(customUI);
        map.setCenter(new GLatLng(51.5, 10), 3);
     
   function searchLocations(area) {
   		searchedalready = true;
     var bereich = 'adressInput' + area;
     var address = document.getElementById(bereich).value;
     geocoder.setBaseCountryCode("de"); 
     geocoder.getLatLng(address, function(latlng) {
       if (!latlng) {
         sidebar.innerHTML ='Dies ist leider keine g&uuml;ltige Eingabe. Bitte geben Sie eine f&uuml;nfstellige Postleitzahl aus Deutschland ein.';
       } else {
         searchLocationsNear(latlng, area);
       }
     });
   }

   function searchLocationsNear(center, area) {
     var umkreis = 'radiusSelect' + area
     var radius = document.getElementById(umkreis).value;
     var searchUrl = 'erstmalsearch_dbgenxml.php?lat=' + center.lat() + '&lng=' + center.lng() + '&radius=' + radius;
     GDownloadUrl(searchUrl, function(data) {
       var xml = GXml.parse(data);
       var markers = xml.documentElement.getElementsByTagName('kuckenwebmarkers');
       map.clearOverlays();
       iconGroups = []
       var sidebar = document.getElementById('sidebar');
       sidebar.innerHTML = '';
     if (markers.length == 0) {
       sidebar.innerHTML = 'Leider haben wir noch keine Eintr&auml;ge innerhalb Ihres Suchbereichs. Aber hoffentlich bald ...';
       map.setCenter(new GLatLng(51.5, 10), 5);
       return;
     }

     function createMarker(point, firma, beschreibung, strasse, plz, ort, art, home, client, scrid, yt) {
      var marker = new GMarker(point, customIcons[art]);
      marker.auswahlart = art;
      marker.auswahlbeschreibung = beschreibung;
      marker.auswahlhome = home;
      marker.auswahlfirma = firma;
      marker.auswahlstrasse = strasse;
      marker.auswahlplz = plz;
      marker.auswahlort = ort;
      marker.auswahlclient = client;
      marker.auswahlscrid = scrid;
      marker.auswahlyt = yt;
      var html = "<span class='iwheadstil'>" + firma + "</span><span class='iwlinestil'><hr style='width:240px'></span><span class='iwdescstil'>" + strasse + " &bull; " + plz + " " + ort +"</span><p class='pointer' align='center'><a onclick=\"jetztKucken('"+ yt +"');return false;\"><img src='ekfiles/"+ scrid +"/pic_playbutton_mini.png' width='240' height='135' alt='Video anschauen!' border='none'></a></p><span class='iwdescstil'><a class='pointer' onclick=\"xtern('"+ home +"');return false;\">&rarr; &nbsp; Homepage von "+ firma +"</a></span>";
      GEvent.addListener(marker, 'click', function() {
        marker.openInfoWindowHtml(html);
      });
      iconGroups.push(marker);
      return marker;
      
    }
	
	   var bounds = new GLatLngBounds();
       for (var i = 0; i < markers.length; i++) {
         var firma = markers[i].getAttribute('firma');
         var beschreibung = markers[i].getAttribute('beschreibung');
         var strasse = markers[i].getAttribute('strasse');
         var plz = markers[i].getAttribute('plz');
         var ort = markers[i].getAttribute('ort');
         var art = markers[i].getAttribute('art');
         var home = markers[i].getAttribute('home');
         var client = markers[i].getAttribute('client');
         var scrid = markers[i].getAttribute('scrid');
         var yt = markers[i].getAttribute('yt');
         var distance = parseFloat(markers[i].getAttribute('distance'));
         var point = new GLatLng(parseFloat(markers[i].getAttribute('lat')),
                                 parseFloat(markers[i].getAttribute('lng')));
         
         var marker = createMarker(point, firma, beschreibung, strasse, plz, ort, art, home, client, scrid, yt);
         map.addOverlay(marker);
 		 if (initart == true) {
		 		 show(art);
			};
         checkStatus(art);
		 bounds.extend(point);
       }
       map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));
     });
   }

  } 
    					
    //]]>

