function Accordion(id) {
  // Speicher das Element der ?bergebenen ID als Akkordion Container
  this.accContainer = document.getElementById(id);
	
  // Alle Elemente mit der CSS-Klasse 'accordionItem' holen
  this.accItems = YAHOO.util.Dom.getElementsByClassName("accordionItem", "div", this.accContainer);
  
  // default Akkordion body H?he definieren
  this.accItemBodyHeight = 0;
  
  // ?ber alle Akkordion Elemente iterieren und jedes einzelne in einem Array speichern
  for (var i=0; i<this.accItems.length; i++) {
    // Aktuelles Akkordion Element als Eltern-Element f?r dazugeh?rigen Header und Body speichern
    this.accItems[i].parent = this;
    // Akkordion Header und Body des aktuellen Akkordion Elements holen und speichern
    this.accItems[i].header = 
      YAHOO.util.Dom.getElementsByClassName("accordionHeader", "div", this.accItems[i])[0];
    this.accItems[i].body = 
      YAHOO.util.Dom.getElementsByClassName("accordionBody", "div", this.accItems[i])[0];
    
    // Pr?fen ob das aktuelle Akkordion Element das aktive Element ist (also eine gr??ere
    // H?he f?r den accordion body gesetzt hat). Normalerweise sollte nur ein Element eine
    // H?he gr??er 0 definiert haben. Wenn die H?he gr??er 0 ist wird das aktuelle Element
    // als aktives Element gespeichert
    if (this.accItems[i].body.offsetHeight > this.accItemBodyHeight) {
      this.accItemBodyHeight = this.accItems[i].body.offsetHeight;
      this.activeItem = this.accItems[i];
      this.activeItem.body.style.height = this.accItemBodyHeight + "px";
    }
    
    // Einen Click Event Listener f?r jeden accordion header registrieren
    YAHOO.util.Event.addListener(this.accItems[i].header, "click", function(){
      // Wenn auf das aktive Element geklickt wurde - nichts machen
      if(this.parent.activeItem == this){
        return;
      }

      // F?r das aktive Element eine "Schrumpf" Animation definieren
      var shrinkLastAccAnim = new YAHOO.util.Anim(this.parent.activeItem.body, {
        height:{from:this.parent.accItemBodyHeight, to:0}}, 0.5);
	    
      // F?r das angeklickte Elment eine "Ausdehnen" Animation definieren
      var expandNewActiveAccAnim = new YAHOO.util.Anim(this.body, {
        height:{from:0, to:this.parent.accItemBodyHeight}}, 0.5);
	    	
      // Selektiertes Element als aktives Element setzen
      expandNewActiveAccAnim.onStart.subscribe(function() {
        this.parent.activeItem = this;
      }, this, true);
			zz = "bs_page.php?tpl=all&id="
			xid = this.body.id;
			zz = zz + this.body.id;
	//		document.getElementById('eintraege').style.display = "none";
			ajax_loadContent("array",zz);
			zz = "bs_page.php?tpl=ueber&id="
			zz = zz + this.body.id;
			ajax_loadContent("ueber",zz);
			zz = "bs_page.php?tpl=neue_eintraege&id="
			zz = zz + this.body.id;
			ajax_loadContent("eintraege1",zz);
      shrinkLastAccAnim.animate();
      expandNewActiveAccAnim.animate();
			// start1();

    }, this.accItems[i], true);
  }
  
  // Letzte Pr?fung, falls mehrere Elemente eine H?he angegeben haben. Es wird nur das 
  //aktive Element offen gelassen. Alle anderen Akkordion Elemente erhalten die H?he 0px.
  for(var i=0; i<this.accItems.length; i++){
    if(this.activeItem != this.accItems[i]){
      this.accItems[i].body.style.height = 0 + "px";
    }
  }

};


function geo1(xarray) {
	var mData = xarray[0].split('|');
	var latlng = new google.maps.LatLng(mData[0],mData[1]);
	map_options = {
    zoom: 14,
    center: latlng,
		scaleControl: true,
		disableDoubleClickZoom : true,
		scrollwheel : false,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  map = new google.maps.Map(document.getElementById("map"), map_options);
	bounds = new google.maps.LatLngBounds();
	google.maps.event.addListener(map, 'bounds_changed', function() { InitialZoomCheck() });
	addMarkers();
	setTimeout("ende_zoom()", 3550);
	
	function InitialZoomCheck() {
		if ( zoom_ok == 0 ) {
			google.maps.event.addListener(map, 'bounds_changed', function() { var xyz =map.getZoom() });
			if (map.getZoom() > 14) { map.setZoom (14); } 
		}
	}
  function addMarkers() {
		if (xarray.length) {
			for (n=0 ; n < xarray.length ; n++ ) {
				var mData = xarray[n].split('|');
				var point = new google.maps.LatLng(mData[0],mData[1]);
				var marker = new google.maps.Marker({
          position: point, 
          map: map, 
					icon: 'http://www.ostseeservice.de/bilder/pictogramme/pins_google/'+mData[6]+'.png'  
          //title: mData[2]
        });   
				bounds.extend(point);
				map.fitBounds(bounds);
				addMarker(marker,mData[3],mData[4]);
			}
			zoom = map.getZoom();
		}
	}

   function addMarker(marker,mm,urle) {
  	var boxText = document.createElement("div");
		boxText.style.cssText = "border: 1px solid black; margin-top: 8px; color: #34349b; background: #ffffff; padding: 5px;";
		boxText.innerHTML = mm;

		var myOptions = {
			content: boxText,
			disableAutoPan: false,
			maxWidth: 0,
			pixelOffset: new google.maps.Size(-90, 0),
			zIndex: null,
			boxStyle: { 
			  background: "url('tipbox.gif') no-repeat",
			  // opacity: 0.75,
			  width: "180px"
			},
//			closeBoxMargin: "10px 2px 2px 2px",
			infoBoxClearance: new google.maps.Size(1, 1),
			isHidden: false,
			pane: "floatPane",
			enableEventPropagation: false
		};
			// closeBoxURL: "http://www.google.com/intl/en_us/mapfiles/close.gif",
 		var ib = new InfoBox(myOptions);
//		ib.open(map, marker);
 
	google.maps.event.addListener(marker, 'mouseover', function() {
//			infowindow.setContent(mm);
//		//	infowindow.setOptions({maxWidth:200});
//			infowindow.open(map, marker);
			ib.open(map, marker);
    });
  
    google.maps.event.addListener(marker, 'mouseout', function() {
//      infowindow.close();
			ib.close();
    });
		
    google.maps.event.addListener(marker, 'click', function() {
      ib.close();
//			infowindow.close();
			if ( urle.substr(0, 1) != "/" ) { urle = "#"+urle; }
			window.location.href = urle;
    });
  }
}

