function yel()
{
  // Variables
  this.map    = null; 
  this.markers = new Array();
  this.markerMemory = new Array();
  this.tilesPending = false; 
  this.handler = false; 
  this.modus = 0; 
  this.suchmodus = false; 

  this.a = "<div style='width:23em;height:20em;'><div id='dialog_holder'>"; 
  this.b = "</div><div id='frame_holder'></div></div>"; 

  // Karte initialisieren
  this.load = function()
  {
    if(GBrowserIsCompatible())
	{
	  
      var map = new GMap2(document.getElementById("map"));

	  // Kontrollkn�pfe
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      map.addControl(new GOverviewMapControl());
     
	  // Doppelklick Zoom
      map.enableDoubleClickZoom(); 
      map.enableContinuousZoom(); 
      //map.enableScrollWheelZoom();

      // Karte platzieren wenn nicht mit ID kommend

      var lang = 47.000279106095;
      var lat  = 8.01287412643434;
      var zoom = 9;

      if(document.cookie){
      	var a = document.cookie;
      	a = a.substring(a.search('=')+1,a.search(';'));
      	a = a.split("||");
      	if(a[1]){
      		lang = Number(a[0].substring(1, a[0].search(', ')));
      		lat  = Number(a[0].substring(a[0].search(', ')+2, (a[0].length)-1));
      		zoom = parseInt(a[1]);
      	}else{
          yel.get_marker_infowindow(99);
        }
      }
      

      if(direct>0){
      	yel.get_marker_infowindow(direct);
      }
      
     

      map.setCenter(new GLatLng(lang, lat), zoom);


      // Satellitenbild
      map.setMapType(G_SATELLITE_MAP);


      // Kartenposition immer im Auge behalten...
      GEvent.addListener(map, "moveend", function() 
      {
      	/*
        var center = map.getCenter();
        $("center").innerHTML = center.toString();

	    var zoom = map.getZoom(); 
	    $("zoom").innerHTML = zoom.toString();
	 
	    var bounds = map.getBounds(); 
	    $("bounds").innerHTML = bounds.toString();
	    */
      	//yel.get_save('bounds', map.getBounds().toString()); 
     
	    //var maptype = map.getCurrentMapType(); 
	    yel.get_marker(); 

      });
	  yel.map = map; 

	  
	  // Nadeln anzeigen
      yel.get_marker(); 
      
      
      // Basis Nadel anlegen
      var icon = new GIcon();
      icon.image = "../images/n-1.png";
      icon.shadow = "../images/n-schatten.png";
      
      icon.iconSize = new GSize(28, 37);
      icon.shadowSize = new GSize(80, 37);
      icon.iconAnchor = new GPoint(0, 35);
      icon.infoWindowAnchor = new GPoint(20, 1);
      icon.infoShadowAnchor = new GPoint(18, 25);
      this.baseIcon=icon;

      // Checkbox weg
      //$('chk_modus').checked = false;  

      // Geocoder starten
      this.geocoder = new GClientGeocoder();
      
      if(geoLoc!=0){
      	if(geoLoc == 'Bern'){geoLoc = 'bern, ch';}
      	
      	$("search").value = geoLoc+', STRASSE? ';
		this.get_geoLoc(geoLoc);
      }
     
    } 
    else
    {
      // Errorhandling!
      alert('Alter Browser'); 
    }
  };

  // Karte deinitialisieren
  this.unload = function()
  {
  	var a = new Date();
        a = new Date(a.getTime() +1000*60*60*24*365);
    document.cookie = "yellorama="+yel.map.getCenter()+"||"+yel.map.getZoom()+"||"+yel.map.getCurrentMapType()+"; expires="+a.toGMTString()+";";
  	this.map.unload;
  }; 

   
  // Tipp - Handling
  this.get_tipp = function(nr)
  {
    var ajax = new Ajax.Updater(
	  'tipp_holder',
      '../function/get_tipp.php',
	  {
         method:'post',
		 postBody: "nr="+nr
      });
  };

  

  // Modus welchseln
  // (Eigene Nadel erfassen)
  this.change_modus = function(o)
  {
  	//alert('change Modus: '+o); 
    if(o == true)
    {
  	  yel.e = GEvent.addListener(yel.map, "click", function(marker, point) 
	  {
  		
	      // Wenn bereits im Setzmodus
	      // Und wenn Infowindow
	      if(yel.modus == 1) return; 
	      yel.get_tipp(17); 
          var icon = new GIcon(yel.baseIcon);
          icon.image = "../images/n-0.png";
		  marker = new GMarker(point,{draggable: true, icon:icon});
          
          yel.map.addOverlay(marker);
	      yel.neu_infowindow(marker) /* Event */
          
		  // Zoomlevel bestimmen
	      yel.tmp = marker.openInfoWindowHtml(yel.a+yel.b);
	      
		  // Position speichern
		  yel.get_save('point', marker.getPoint()); 
		  // Kartentyp
		  yel.get_save('maptype', yel.map.getCurrentMapType()); 
		  // Zoomlevel
		  yel.get_save('zoomlevel', yel.map.getZoom()); 
           
		  // Aktueller Marker muss gepseichert werden
		  // Um l�schen zu k�nnen. 
		  yel.marker = marker; 

		  // Auf Maximum heranzoomen!
          // yel.map.setZoom(yel.map.getCurrentMapType().getMaximumResolution()); 
          
		  // Ich brauche hier eine Verzögerung...
		  
		  window.setTimeout(function(){yel.get_dialog(2);},500);
		   
          // Modus setzen
          yel.modus = 1; 
       
		
		
      });
	  
	  yel.clear();
	  
	  // Inhalt von Nadel laden
	  //yel.neuHtml = $('progress_holder').innerHTML; 

	  // Kategorienw�hler ausblenden
	  $('suche_ro').style.display = "none"; 
	  $('neu_ro').style.display = "none"; 
	  $('filter_ro').style.display = "none"; 	 
	  $('tipp_ro').style.display = "block"; 

	  yel.get_tipp(16); 
    }
    else // Normalmodus
    {
  	
	  // Alle Nadeln l�schen
	  yel.clear(); 
      GEvent.removeListener(yel.e); 
      
      // Nadelmemory löschen
      yel.markerMemory = new Array();
	 
      // Nadeln anzeigen
      yel.get_marker(); 
      
	  // Kategorienwaehler ausfahren
      $('suche_ro').style.display = "block"; 
      Box.toggleUp('suche', {minHeight:'2em', up:1}); 
	  $('neu_ro').style.display = "block"; 
	  $('filter_ro').style.display = "block"; 
      //$('chk_modus').checked = false; 
      $('tipp_ro').style.display = "none";  
	  
	  // Status setzten
	  yel.modus = 0; 
    }
  }; 

  // Öffnet Infowindow
  // Nur beim stecken
  this.neu_infowindow = function(marker, dialognr)
  {
  	// Wenn das Infofenster geschlossen wird...
    yel.handler = GEvent.addListener(marker, "infowindowclose", function() 
    {
	  yel.change_modus(0); 
    });   
  }
  
 // Schliesst alles, Nadeln weg
 this.clear=function(){
 	yel.map.closeInfoWindow(); 
	yel.map.clearOverlays(); 
	yel.modus = 2; 
 	
 }

  // Blendet Marker ein
  // Aufruf bei "moveend"
  this.get_marker = function()
  {
    // Zoomlevel 
    var zoom = yel.map.getZoom();
    // Kartenausschnitt
    var bounds = yel.map.getBounds(); 
    var opt = 
	{
	  method: 'post', postBody: "zoom="+zoom+"&bounds="+bounds,
      onSuccess: function(t) 
	  {
	  	//alert(t.responseText); 
        var xmlDoc = t.responseXML;
        markers = new Array();
        locations = xmlDoc.documentElement.getElementsByTagName("location");
        if(locations.length)
	    {	
          for (var i=0;i<locations.length;i++) 
		  {  
		    var location_id = locations[i].getAttribute("id");
			if(yel.markerMemory[location_id] !== true)
			{
 		      // richtiges ICON w�hlen
              var icon = new GIcon(yel.baseIcon);
			  var kat  = locations[i].getAttribute("kat");
              icon.image = "../images/n-"+kat+".png";
              
              markers[i] = yel.create_marker(new GLatLng(locations[i].getAttribute("lat"), locations[i].getAttribute("lng")), i, locations[i].getAttribute("name"), icon); 
              markers[i].markerindex = i;
              markers[i].location_id = locations[i].getAttribute("id");
              yel.map.addOverlay(markers[i]);
              yel.markerMemory[location_id] = true; 
			}
	      }
		  yel.markers = markers;
		}
		Form.enable('frm_filter'); 
      },
      onFailure: function(t) {alert('Error ' + t.status + ' -- ' + t.statusText);}
    }
    new Ajax.Request('../function/get_marker.php', opt);  
  };


  // Wird bei onclick auf den Marker aufgerufen
  // Holt das Infowindow , braucht ID
  this.get_infowindow = function(a)
  {
  	// a kann Marker oder Marke ID sein...
  	if(typeof(a) == 'object'){
  		id = a.location_id; 
  		yel.marker = a; 
  	}
  	else{
  	  id = a; 
  	}
  	
    var opt = 
	{
	  method: 'post', postBody: "id="+id,
      onSuccess: function(t) 
	  {
        var html = t.responseText;
	    infoTabs = new Array(); 
	    var tab = html.split("|||"); 
        if(tab.length)
	    {
          for (var i=0;i<tab.length;i++) 
		  {  
			// Titel holen
			var c = tab[i].substr(0, tab[i].indexOf("||")); 
			var d = tab[i].substring(tab[i].indexOf("||")+2); 
            infoTabs[i] = new GInfoWindowTab(c,d); 
	      }
          a.openInfoWindowTabsHtml(infoTabs);
	    }
      },
      onFailure: function(t) {alert('Error ' + t.status + ' -- ' + t.statusText);}
    }
    new Ajax.Request('../function/get_infowindow.php', opt);  
  }; 


  // Holt Marker incl. Infowindow
  // Bei Klick auf Suchresultate aufgerufen
  this.get_marker_infowindow = function(id)
  {
    var opt = 
	{
	  method: 'post', postBody: "id="+id,
      onSuccess: function(t) 
	  {
        var html = t.responseText;
	    var tab  = html.split("|||"); 
        if(tab.length)
		{
          // Marker bauen
		  yel.clear(); 
          var icon = new GIcon(yel.baseIcon);
          icon.image = "../images/n-"+tab[3]+".png";
	      var marker = yel.create_marker(new GLatLng(tab[1], tab[2]), 1, tab[3], icon);
          marker.markerindex = 1;
		  marker.location_id = tab[0]; 
		  yel.marker = marker;
          yel.map.addOverlay(marker);
		  yel.get_infowindow(marker); 
		  
		  // Alle Nadeln einblenden
          yel.markerMemory = new Array();
		  yel.get_marker(); 
		}
      },
      onFailure: function(t) {alert('Error ' + t.status + ' -- ' + t.statusText);}
    }
    new Ajax.Request("../function/get_marker_infowindow.php", opt);  
  }; 


  // Holt die Suchresultate
  // Beim Klick auf den Suchknopf
  this.get_search = function(start)
  {
  	if($F('suchmodus') == 0){
  		
  		alert('Bitte klicke rechts vom Suchfenster, ob Nadelsuche oder Ortsuche'); 
  		return; 
  	}
  	
    var suche = $F("search"); 
    
    // Geocoding neu 
    if(this.suchmodus == 2){
    	this.get_geoLoc(suche); 
    	return; 
    }
    
    
    var bounds = yel.map.getBounds(); 
    var opt = 
	{
	  method: 'post',
	  postBody: "search="+suche+"&start="+start+"&bounds="+bounds,
      onSuccess: function(t) 
	  {
        var html = t.responseText;
	    var res  = html.split("|||"); 
        if(res.length)
	    {
          var html = "";        
		  for (var i = 0; i < res.length; i++) 
		  { 
		    html += res[i]; 
	      }
	    }
	    else
	    {
	      // Keine Suchresultate    
	      alert('Leider keine Nadel gefunden!'); 
	    }
	    
        Box.toggleUp('suche', {minHeight:'2em', up:0}); 
	    $("result_holder").innerHTML = html+'<br />';
	    $("suche_ro").style.display = "block";  
      },
      onFailure: function(t) {alert('Error ' + t.status + ' -- ' + t.statusText);}
    }
    new Ajax.Request("../function/get_search.php", opt);  
  }; 

  // Geocoding mit Google
  this.get_geoLoc = function(ort){

  	if(ort.toLowerCase() == 'bern' ){ort='Bern, ch';}
  	this.geocoder.getLatLng(ort, function(point){

  		if (!point) {
  			alert(ort + " wurde nicht gefunden!");
  		}else{
  			yel.map.setCenter(point, 15);
  		}
  	})
  };
  
  
  // Suche togglen
  this.toggle_search = function(mode)
  {
    var obj = $("suchort");
	// Auslagern in speicher
  };

  // Holt die juengsten 10 Nadeln
  this.get_youngest = function(){
  	$('suchmodus').value = 1; 
  	$("search").value='yellorama'; 
  	this.get_search(0);

  	
  };
  
  
  // Funktion f�r Geocoden
  // Aufruf wenn Formular absenden
  /*
  this.get_geoname = function(ort)
  {
    var opt = 
    {
      method: 'post',
      postBody:"q="+ort+"&maxRows=1",
      onSuccess: function(t) 
	  {
        var txt = t.responseText;
	    var geoname = txt.split("|||"); 
        if(geoname.length > 1)
	    {
		  yel.map.setCenter(new GLatLng(geoname[0], geoname[1]), 14);
		}
		else
		{
		  // Nicht gefunden
		  alert(txt);
		}
	  },
      onFailure: function(t) 
	  {
        alert('Error ' + t.status + ' -- ' + t.statusText);
      }
    }
    new Ajax.Request('../function/get_geonames.php', opt);
  };
  */
  
  // Kommentar erfassen
  this.newFeedback = function()
  {
    var ajax = new Ajax.Updater(
	  'tab_feedback',
      '../function/get_dialog.php',
	  {
         method:"post", 
		 postBody: "nr=6"
      });

    
	//var holder = $('tab_feedback');
	//var dialog = yel.get_dialog();
  };
  this.thankFeedback = function()
  {
	// Feedback speichern
	window.setTimeout(" yel.get_save('feedback', yel.marker.location_id)", 2500);
    var ajax = new Ajax.Updater(
	  'tab_feedback',
      '../function/get_dialog.php',
	  {
         method:"post", 
		 postBody: "nr=7"
      });
  };
  this.showFeedback = function(a)
  {
    yel.get_marker_infowindow(a);
  };

  // Mailing
  this.thankMailing = function()
  {
    yel.get_save('mail_go', yel.marker.location_id);
    var ajax = new Ajax.Updater(
	  'tab_function',
      '../function/get_dialog.php',
	  {
         method:"post", 
		 postBody: "nr=8"
      });
  };

  // Tab Funktionen
  // Kommentar erfassen
  this.tabFunction = function(nr)
  {
    var ajax = new Ajax.Updater(
	  'tab_function',
      '../function/get_dialog.php',
	  {
         method:"post", 
		 postBody: "nr="+nr
      });
  };
  this.thankFunction = function(saver)
  {
  	$('weiter').innerHTML = '<img src="../image/loading.gif" />'; 
  	yel.get_save(saver, yel.marker.location_id);
  	window.setTimeout("go()", 2500); 
  	go = function(){
      var ajax = new Ajax.Updater(
	  'tab_function',
      '../function/get_dialog.php',
	  {
         method:'post', 
		 postBody: 'nr=15'
      }); 
  	}; 
  };




  // *********************************
  //    Neue Nadel erfassen
  // *********************************
  
  // Holt Progress
  /*
  this.get_progress = function()
  {
    var ajax = new Ajax.Updater(
	  'progress_holder',
      '../function/get_progress.php',
	  {
         method:'post'
      });
  };
  */
  
  // Holt Kategorien
  this.get_cat = function(val)
  {
    var ajax = new Ajax.Updater(
	  'col'+val,
      '../function/get_cat.php',
	  {
         method:'post', postBody: "nr="+val
      });
	if(val=="kat1") 
	{
	  $("colkat0").style.backgroundColor="#ffffff";
	  $("colkat1").style.backgroundColor="#BAD4AF;";
	}
	if(val=="kat2")
	{
	  $("colkat1").style.backgroundColor="#ffffff";
	  $("colkat2").style.backgroundColor="#BAD4AF";
	}
  };

  // Holt Dialog
  this.get_dialog = function(nr)
  {
    var ajax = new Ajax.Updater(
	  'dialog_holder',
      '../function/get_dialog.php',
	  {
         method:"post", postBody: "nr="+nr
      });

	// Muss Neuer Tipp holen
    if(nr == 1) 
	{
	  Element.hide($("frame_holder"));
	  if($("tmp_holder")){Element.remove($("tmp_holder"));}
	  yel.get_tipp(4); 
	}

	if(nr == 2)
	{
	  $("frame_holder").show(); // Achtung, hat ihn erst, wenn onverlay offen.
      $("frame_holder").innerHTML = "<iframe src='../de/iframe.php' id='iframe_neu' name='iframe_neu' frameborder='0'></iframe>"; 
      var opt = 
      {
        method: 'post',
        postBody: "nr=61",
        onSuccess: function(t) 
	    {
          new Insertion.After($("frame_holder"), "<div id='tmp_holder'>"+t.responseText+"</div>");   
		}
      }
      new Ajax.Request('../function/get_dialog.php', opt);
	}
	else
	{
	  if($("tmp_holder")){Element.remove($("tmp_holder"));}
      Element.hide($("frame_holder"));
	  if(nr == 3)
	  {
	    yel.get_tipp(20);
	  }
	  if(nr == 4)
	  {
	  	$('weiter').innerHTML = '<img src="../image/loading.gif" />'; 
	    yel.get_tipp(21);
	  }
	}
  };

 // Holt die einzelnen Funktionen im Tab 'Funktionen'
 this.get_tabfunction = function(nr)
  {
    var ajax = new Ajax.Updater(
	  'tab_function',
      '../function/get_tabfunction.php',
	  {
         method:"post", postBody: "nr="+nr
      });

	
  };
  
  // Holt Status beim Uploaden des Bildes
  /*
  this.get_status = function()
  {
    var opt = 
    {
      method: 'post',
      postBody: "typ=img",
      onSuccess: function(t) 
	  {
	  	var txt = t.responseText; 
	  	if(txt == 'wait'){yel.get_stauts();return;}
	  	if(txt == 'error'){
	  		alert('Fehler'); 
	  	}

	    // text ändern
		$('bildWaiter').remove();
		$('agbHolder').innerHTML = t.responseText; 
		$('agbNext').show();
      },
      onFailure: function(t) 
	  {
        alert('Error ' + t.status + ' -- ' + t.statusText);
      }
    }
    new Ajax.Request('../function/get_status.php', opt);
  };
  */

  // Sendet Werte an den Server, zwecks Speicherung
  this.get_save = function(typ, val)
  {
  	// Wenn Suche
  	if(typ == 'suo'){
  		this.suchmodus = val; 
  	}
    // Wenn Iframe
	if(typ == 100)
	{
	  top.window.frames[0].document.forms[0].submit();
	  top.window.frames[0].document.getElementById('firstForm').style.display='none'; 
	  top.window.frames[0].document.getElementById('secondForm').style.display='block';
	  
      $('tmp_holder').hide();
	  return; 
	} 	
    var opt = 
    {
      method: 'post',
      postBody: "typ="+typ+"&value="+val,
      onSuccess: function(t) 
	  {
		if(typ=="kat1")yel.get_cat(typ);
		else if(typ=="kat2")yel.get_cat(typ);
		else if(typ=="kat3")$('weiter').innerHTML = t.responseText; 
		else if(typ=="agb")$('weiter').innerHTML = t.responseText; 
		else if(typ=="mailing")yel.get_dialog(5); 
		else if(typ=="feedback_titel")$('weiter').innerHTML = t.responseText; 
      },
      onFailure: function(t) 
	  {
        alert('Error ' + t.status + ' -- ' + t.statusText+"\n"+t.responseText);
      }
    }
    new Ajax.Request('../function/get_save.php', opt);
  }; 

  // Holt Vorschau in Infowindow
  // Bei Klick auf "Vorschau"
  
  this.get_vorschau = function()
  {
  	yel.get_dialog(10); 
  	return; 
  	
    var opt = 
    {
      method: 'post',
      postBody: "id=0",
      onSuccess: function(t) 
	  {
        var txt = t.responseText;
	    var tab = txt.split("|||"); 
        if(tab.length)
	    {
		  yel.clear(); 
 		  
		  // richtiges ICON w�hlen
          var icon = new GIcon(yel.baseIcon);
          icon.image = "../images/n-0.png";

	      var marker = yel.create_marker(new GLatLng(tab[0], tab[1]), 1, tab[2], icon);
          marker.markerindex = 1;
          
          yel.map.addOverlay(marker);

		  marker.openInfoWindowHtml(yel.a+tab[2]+yel.b);
		  

		  yel.marker = marker;
		  
		  // Beim schliessen muss Nadel weg
		 //yel.map.openInfoWindowHtml(new GLatLng(tab[0], tab[1]), 'hello', {onCloseFn: function() {alert('working'); }}); 
	    }
	  }
    }
    new Ajax.Request('../function/get_vorschau.php', opt);
  }; 
  
  this.create_marker = function(point, i, t, icon) 
  {
    var marker = new GMarker(point, {title:t, icon:icon});
    GEvent.addListener(marker, "click", function() 
    {
      yel.get_infowindow(this, i);
    });
    return marker;
  }; 

  return this;
}

var yel = new yel;

/*
G_SATELLITE_MAP.getErrorMessage = function()
{   
  var z = yel.map.getZoom();
  if (z > 0 && !yel.tilesPending)
  {  yel.map.setZoom(z - 1);
  }
  return ""; 
}
G_NORMAL_MAP.getErrorMessage = function()
{   
  var z = yel.map.getZoom();
  if (z > 0 && !yel.tilesPending)
  {  yel.map.setZoom(z - 1);
  }
  return ""; 
}
G_HYBRID_MAP.getErrorMessage = function()
{   
  var z = yel.map.getZoom();
  if (z > 0 && !yel.tilesPending)
  {  yel.map.setZoom(z - 1);
  }
  return ""; 
}
*/


// ******************************************
// Klasse f�r Tree
// ******************************************
function show_kat(obj)
{
  var ul     = obj.parentNode.nextSibling;
  var ebene  = Element.classNames(obj.parentNode);
  var dis    = (Element.getStyle(ul, "display") == "list-item")? 0:1; 
  ebene = (ebene=="k1")?1:(ebene=="k2")?2:3; 

  while(ul != null && ul.nodeName.toLowerCase()=="li")
  {
	if(Element.classNames(ul) != "k"+ebene)
	{
	   if(dis==0)
	   {
         Element.setStyle(ul, {display:'none'}); 
         obj.src = "../images/ordnerkreuz.gif"; 
	   }
	   else
	   {
		 var k = ebene + 1; 
		 if(Element.classNames(ul) == "k"+k)
         Element.setStyle(ul, {display:"list-item"}); 
         obj.src = "../images/ordnerminus.gif"; 
	   }
	   ul = ul.nextSibling; 
	}
	else
	{
	  break;
	}
  }
}
function get_save_kat(typ, obj)
{
  Form.disable('frm_filter'); 
  yel.markerMemory = new Array();
  var val = obj.value; 
  var ul = obj.parentNode;
  var ebene = Element.classNames(ul); // IE macht hier Fehler
  ebene = (ebene=="k1")?1:(ebene=="k2")?2:3; 
  ul = ul.nextSibling; 
  // Wenn Haken weg, Kinder Haken auch weg
  if(obj.checked==false)
  {
      yel.get_save(typ+"_minus", val); 
	  while(ul != null && ul.nodeName.toLowerCase()=="li")
      {
		if(Number(String(Element.classNames(ul)).substr(1,1)) > ebene) 
	    {
		  for(var i=0;ul.childNodes.length>i;i++)
		  {
		    if(ul.childNodes[i].nodeName.toLowerCase()=="input")
			{
			  ul.childNodes[i].checked=false; 
			  break;
			}
		  }
		}
		else
		{
		  break;
		}
	    ul = ul.nextSibling; 
	  }
  }
  else
  {
    yel.get_save(typ+"_plus", val); 
	// Wenn ein Haken gesetzt wird, 
	// die Nadeln einblenden
	/*
	  while(ul != null && ul.nodeName.toLowerCase()=="li")
      {
		if(Number(String(ul.classNames(ul)).substr(1,1)) > ebene) 
	    {
		  for(var i=0;ul.childNodes.length>i;i++)
		  {
		    if(ul.childNodes[i].nodeName.toLowerCase()=="input")
			{
			  ul.childNodes[i].checked=true; 
			  break;
			}
		  }
		}
		else
		{
		  break;
		}
	    ul = ul.nextSibling; 
	  }
	  */
  }
  	yel.clear();
    yel.get_marker();

}



// ******************************************
// Funktionen

// Wrapper
function next(a){
	yel.get_marker_infowindow(a);
	
}

function img_big(obj) 
{
  var src = obj.src.replace(/middle/, "big"); 
  var img = document.createElement("img"); 
  var holder = document.getElementById("image_big"); 
  var top = get_scroll_top(); 
  top = top+10; 
  img.src = src; 
  img.style.position = "absolute"; 
  img.style.top = top+"px";
  if(img.width<=800){
  img.style.left = "50%";
  img.style.marginLeft = "-400px"; 
  img.style.width = "800px";
  }
  img.style.cursor = "pointer"; 
  img.style.zIndex = "12000"; 
  img.alt="Klicken Sie auf das Bild, um es wieder klein zu machen!";
  img.onclick= function(){this.style.visibility='hidden';}; 
  holder.appendChild(img); 
}

function get_scroll_top() 
{
  //if (window.pageYOffset) /* �nderung Firefox:   
  if (window.pageYOffset &! document.body)
  {
	return window.scrollTop; 
  }
  else if(document.documentElement && document.documentElement.scrollTop)
  {
	return document.documentElement.scrollTop; 
  }
  else if(document.body)
  {
	return document.body.scrollTop; 
  }
  else {alert('Sorry, we do not support your browser.'); }
}


