var buildList= function( element, update ) {
	 
	if( !update.style.position || update.style.position=='absolute' ) {
		
		update.style.position = 'absolute';
		Position.clone(
			element,
			update,
			{
				setHeight: false, 
				offsetTop: element.offsetHeight
			}
		);
		
	 /*
	  * Individuelle Anpassung der Breite mit automatischer Ausrichtung an rechter Kante.  
	  */
		
		var newWidth= 300;
		var oldWidth= parseInt( $J( update ).css( "width" ) );
		var oldLeft= parseInt( $J( update ).css( "left" ) );
		var newLeft= oldLeft - newWidth + oldWidth;
		$J( update ).css( "width", newWidth + "px" );
		$J( update ).css( "left", newLeft + "px" );
	}
	
	Effect.Appear(update,{duration:0.15});
	
};

function autocompleteSuche() {
	new Ajax.Autocompleter( "suchfeld", "suchtipps", "/suche_list.php", { onShow : buildList } );
}
