function Suche(){
	
	/* Attribute */
	this.container = document.getElementById('Suche');
	this.hidden = true;
	
	
	/* Methoden */
	this.show = show;
	this.hide = hide;
	this.showHide = showHide;
	this.loadContent = loadContent;
	this.suchen = suchen;
	this.setContainerContent = setContainerContent;
	this.firmaClick = firmaClick;
	this.hafenClick = hafenClick;
	this.poiClick = poiClick;
	this.gebietClick = gebietClick;
	this.ortClick = ortClick;
	this.plzClick = plzClick;
	this.gewaesserClick = gewaesserClick;
	this.regionClick = regionClick;
	
	
	/* Initialisierung */
	this.container.style.backgroundColor = "white";
	this.container.style.border = "1px solid #000000";
	this.container.style.position = "absolute";
	this.container.style.width = "280px";
	this.container.style.height = "250px";
	this.container.style.top = "210px";
	this.container.style.left = "525px";
	this.container.style.overflow = "auto";
	this.container.padding = "5px";
	
	
	
	function show(){
		this.loadContent();
		setTimeout("Effect.Appear('Suche', {from: 0.0, to: 0.9, duration: 0.5 })",250, 'JavaScript');
		this.hidden = false;
		
	}
	
	
	function hide(){
		Effect.DropOut('Suche');
		this.hidden = true;
	}
	
	
	function showHide(){
		if(this.hidden)
			this.show();
		else
			this.hide();
	}
	
	
	function loadContent(){
		
		var url = BASEURL+"data/karte.suche.php";
		
		var aj = new Ajax.Request(url,{
				onCreate: ajaxLoading('Suche',100),
				onComplete: Suche.setContainerContent,
				onFailure: ajaxError,
				method:'get'
			});
	}
	
	
	function setContainerContent(aResp){
		
		if(aResp.responseText){
			Suche.container.innerHTML = aResp.responseText;
		}else
			Suche.container.innerHTML = aResp;
		
	}
	
	
	
	function suchen(suchbegriff){
	
		var url = BASEURL+"data/karte.suche.php";
		var params = "SB="+suchbegriff;
		
		var aj = new Ajax.Request(url,{
				onCreate: ajaxLoading('suchergebnisse',100),
				parameters: params,
				onComplete: Suche.setContainerContent,
				onFailure: ajaxError,
				method:'post'
			});
	}
	
	
	function firmaClick(glatlng, warengruppe){
		Legende.displayGroup(warengruppe, glatlng, 13);
		Suche.hide();
	}
	
	
	function hafenClick(glatlng, warengruppe){
		Legende.displayGroup(warengruppe, glatlng, 13);
		Suche.hide();
	}
	
	
	function poiClick(glatlng, warengruppe){
		Legende.displayGroup(warengruppe, glatlng, 12);
		Suche.hide();
	}
	
	function gebietClick(glatlng){
		Legende.displayGroup("", glatlng, 11);
		Suche.hide();
	}
	
	function gewaesserClick(glatlng){
		Legende.displayGroup("", glatlng, 14);
		Suche.hide();
	}
	
	function ortClick(glatlng){
		Legende.displayGroup("", glatlng, 12);
		Suche.hide();
	}
	
	function plzClick(glatlng){
		Legende.displayGroup("", glatlng, 11);
		Suche.hide();
	}
	
	function regionClick(glatlng){
		Legende.displayGroup("", glatlng, 10);
		Suche.hide();
	}
	
}
