	/*
		//Als Callback Variante
		function cb_lauf( text ){
			document.getElementById("bla_id").innerHTML = text;
		}	
		Laufschrift.start("cb_lauf");
		
		//Direkt im Title
		Laufschrift.title.start("TITLELAUFSCHRIFT");
	*/
	var Laufschrift = {
		text:"Eine Laufschrift die läuft",
		letters:10,		
		nextstep:0,
	
		texttext : "",
		limit : "",
		
		cb : "",
		
		titlefunc:false,
		orginalTitle : false,
		
		sI : false,
		
		title : {			
			start : function ( text ) {				
				Laufschrift.titlefunc = true;
				if(!Laufschrift.orginalTitle) Laufschrift.orginalTitle = document.title;
				
				if(text)
					Laufschrift.text = text;
					
				Laufschrift.start();			
			},
			
			stop : function () {			
				Laufschrift.stop();
				
				document.title = Laufschrift.orginalTitle;
			}
		},
		
		stop : function () {		
			window.clearInterval(Laufschrift.sI);	
			Laufschrift.sI = false;
		},
		
		start : function( cb ) {
			
			if(cb)
				Laufschrift.cb = cb;
			
			Laufschrift.limit = Laufschrift.limit ? Laufschrift.limit : Math.ceil(Laufschrift.text.length/2);			
			Laufschrift.texttext = Laufschrift.text +"..."+ Laufschrift.text;
			
			Laufschrift.sI = window.setInterval("Laufschrift.next()", 300);			
		},
	
		next : function() {	
			Laufschrift.nextstep++;
			
			if(Laufschrift.nextstep>Math.ceil(Laufschrift.texttext.length/2))
				Laufschrift.nextstep=0;	
			
			var subtext = Laufschrift.texttext.substr(Laufschrift.nextstep , Laufschrift.limit);
			
			//Laufschrift im Title oder als CallbackFunc
			if(Laufschrift.titlefunc)
				document.title = subtext;
			else
				window[Laufschrift.cb]( subtext );
		}
	}
	
	
/* * * * * * * * * * * * *
 * Kommentar
 */
function delKom(thiss) {
	if(confirm("Eintrag wirklich löschen?")) {
	
		e = thiss.parentNode.parentNode.id;
		
		new Ajax.Request('ajax.php', {
			asynchronous:true, 
			evalScripts:true, 
			onSuccess: function(transport) {

				if(transport.responseText == 1) {
					new Effect.toggle(e,'BLIND',{duration:0.3});
				}
				else
					alert(transport.responseText);
			},
			parameters: 'rs=del&page=__lib,kommentar&rsargs[]='+ e});			
	}
}
 
 
/* * * * * * * * * * * * *
 * GästeBuch
 */
function delGb(thiss) {
	if(confirm("Eintrag wirklich löschen?")) {
	
		e = thiss.parentNode.parentNode.id;
		
		new Ajax.Request('ajax.php', {
			asynchronous:true, 
			evalScripts:true, 
			onSuccess: function(transport) {

				if(transport.responseText == 1) {
					new Effect.toggle(e,'BLIND',{duration:0.3});
				}
				else
					alert(transport.responseText);
			},
			parameters: 'rs=del&page=__lib,gbook&rsargs[]='+ e});			
	}
}
 
 
/* * * * * * * * * * * * *
 * Reply
 */
function delReply(thiss) {
	if(confirm("Eintrag wirklich löschen?")) {
	
		e = thiss.parentNode.parentNode.id;
		
		new Ajax.Request('ajax.php', {
			asynchronous:true, 
			evalScripts:true, 
			onSuccess: function(transport) {

				if(transport.responseText == 1) {
					new Effect.toggle(e,'BLIND',{duration:0.3});
				}
				else
					alert(transport.responseText);
			},
			parameters: 'rs=del&page=pool,forum&rsargs[]='+ e});			
	}
}

 /* * * * * * * * * * * * *
 * Buddys
 */
function delBuddy(thiss) {
	if(confirm("Freund wirklich löschen?")) {
			
		e = thiss.parentNode.parentNode.id;
		
		new Ajax.Request('ajax.php', {
			asynchronous:true, 
			evalScripts:true, 
			onSuccess: function(transport) {

				if(transport.responseText == 1) {
					new Effect.toggle(e,'BLIND',{duration:0.3});
				}
				else
					alert(transport.responseText);
			},
			parameters: 'rs=buddydel&page=kabine,freunde&rsargs[]='+ e});			
	}
}


/* * * * * * * * * * * * *
 * BuddyWo
 */
function delBuddyWo(thiss) {
	if(confirm("Wirklich löschen?")) {
			
		e = thiss.parentNode.parentNode.id;
		
		new Ajax.Request('ajax.php', {
			asynchronous:true, 
			evalScripts:true, 
			onSuccess: function(transport) {

				if(transport.responseText == 1) {
					new Effect.toggle(e,'BLIND',{duration:0.3});
				}
				else
					alert(transport.responseText);
			},
			parameters: 'rs=buddydelwo&page=kabine,freunde&rsargs[]='+ e});			
	}
}




/* * * * * * * * * * * * * *
	LoginSeite.js
 * * * * * * * * * * * * * */ 
 
 function HeaderSuche() {

	var form = "<form onSubmit='HeaderSucheSubmit();return false;' name=headersuche>"+
		"<div><span>SUCHE: </span></div>"+
		"<div><select style='width:120px;height:20px;' name=select id=select>"+
		"<option>Dampfies <option>Vor- und Nachname <option>Forum <option>Hilfe <option>Crews"+
		"</select></div>"+//<option>Freunde<option>Forum<option>Crews
		"<div><input type=text name=suchtext id=suchtext style='width:110px;height:16px;'></div>"+
		"<div><input type=button name='submit_suche' value='Los' class='submit schmall' onClick='HeaderSucheSubmit();return false;'></div>"+
	"</form>";
	
	var radiohilfe = "<div class=hilfe><a href='?railing,faq'>Hilfe?</a></div>";//"<div class=radio><a href='?radio'>Dampfer Radio</a></div><div class=hilfe><a href='?railing,faq'>Hilfe?</a></div>";
	document.write("<div class=suche>"+ form +"</div>" + "<div class=radiohilfe>"+ radiohilfe +"</div>");
}
 function HeaderSucheSubmit() {
	var SuchText=escape(document.getElementById('suchtext').value);
	var selected=document.getElementById('select').selectedIndex;

	if(SuchText.length==0)
		return;						
	else if(SuchText.length<=3)
		alert('Du musst mehr als 3 Buchstaben eingeben');
	else {
		SuchText = escape(SuchText);
		
		switch(selected) {
			default:
			case 0:	self.location.href='?m1=pool&m2=suche&m3='+ SuchText;			break;
			case 1:	self.location.href='?m1=pool&m2=suche&m3='+ SuchText +'&m4=real';	break;
			case 2:	self.location.href='?m1=pool&m2=forum&m3=suche&m4='+ SuchText;		break;
			case 3:	self.location.href='?m1=railing&m2=faq&m3=suche&m4='+ SuchText;		break;
			case 4:	self.location.href='?m1=crews&m2=suche&m3='+ SuchText;			break;		
		}
	}
}
 


 

 function statusmeldung() {
	a = $('statusmeldung');
	text = encodeURIComponent(a.value);

	$('status_text').innerHTML = "wird gespeichert";
	$('form_status').style.display="none";
	LoadWait_MouseLoad();
	
	new Ajax.Updater('status_text', 'ajax.php', {
		asynchronous:true, 
		evalScripts:true, 
		/*
		onComplete:function(request){
			Element.hide('indicator')
		},
		onLoading:function(request){
			Element.show('indicator')
		},
		*/
		onSuccess: function(transport) {
			new Effect.toggle($('edit_status'),'BLIND',{duration:0.3});
			$('form_status').style.display="";
			//document.getElementById("seite_details").innerHTML = transport.responseText;				
			//alert(transport.responseText);
			LoadWait_ready();
		},
		parameters: 'rs=statusmeldung&page=kabine,steckbrief_daten&rsargs[]='+ text});	
}


/* * * * * * * * * * * * * *
	cont_change.js
 * * * * * * * * * * * * * */ 


function contcha_pass_ol() {

}

//Content Change - PassagierListe - OnClick
function contcha_pass_oc(art_name) {

	for(var i=0;i<array_buddyonline_list_show.length;i++){
		if(array_buddyonline_list_show[i]==art_name){
			document.getElementById('tr_'+array_buddyonline_list_show[i]).style.display='';
			document.getElementById('button_'+array_buddyonline_list_show[i]).src='http://www.dampfer.net/images/dampfielist/'+ array_buddyonline_list_show[i] +'_on.gif';
		}
		else{
			document.getElementById('tr_'+array_buddyonline_list_show[i]).style.display='none';
			document.getElementById('button_'+array_buddyonline_list_show[i]).src='http://www.dampfer.net/images/dampfielist/'+ array_buddyonline_list_show[i] +'_off.gif';
		}
	}
	document.cookie = 'buddyonline_list_show='+art_name;
}



//Content Change - PassagierListe - MouseOver
function contcha_pass_mover(thiss,art_name) {
	if(document.getElementById('tr_'+art_name).style.display == 'none') {
		image = document.getElementById('button_'+art_name);
		image.src='http://www.dampfer.net/images/dampfielist/'+art_name+'_over.gif';
	}
}


//Content Change - PassagierListe - MouseOut
function contcha_pass_mout(thiss,art_name) {
	if(document.getElementById('tr_'+art_name).style.display == 'none') {
		//image = eval("img_"+art_name);
		image = document.getElementById('button_'+art_name);
		image.src='http://www.dampfer.net/images/dampfielist/'+art_name+'_off.gif';
	}
}



					
					
/* * * * * * * * * * * * * *
	optimize.js
 * * * * * * * * * * * * * */ 
 function dampfie(url) {
	popup(url,'userprof','640','550','yes');
}

//UserWrite Java Optimizer Func
function user_write(key) {
	var server = "";
	var url = server + "popup.php?write="+ key;

	popup(url,'write_new_message','540','450','');
}
//UserWrite Java Optimizer Func
function user_write_ahref(key) {
	return "<a href=\"javascript:user_write('"+ key +"')\"><img src=\"images/icons/icon_brief_neu.gif\" width=13 height=12 border=0 valign=absmiddle title=\"Briefschreiben starten\"></a>";
}

//UserChat
function user_funk(key) {
	url = "popup.php?funke="+ key;

	//fenster name = 'funke_'+key
	popup(url,'funk'+ key,'540','258','0');
}
//UserWrite Java Optimizer Func
function user_funk_ahref(key) {
	return "<a href=\"javascript:user_funk('"+ key +"')\"><img src=\"images/icons/funke.gif\" width=10 height=9 border=0 valign=absmiddle title=\"anfunken\"></a>";
}

function user_write_setall() {
	var a = $('buddylist_on').getElementsByTagName("li");
	for(var x=0;x<a.length;x++) {
		tag = a[x];
		write = user_write_ahref(tag.id);
		write+= " "+ user_funk_ahref(tag.id);
		tag.innerHTML = write +" "+ tag.innerHTML;
	}
	
	var a = $('buddylist_off').getElementsByTagName("li");
	for(var x=0;x<a.length;x++) {
		tag = a[x];
		write = user_write_ahref(tag.id);
		tag.innerHTML = write +" "+ tag.innerHTML;
	}
}

	





//Cookie Var Load
function cookie(cookie_name) {

	var cookie_split = document.cookie.split( "; " );

	for (var x = 0; x < cookie_split.length; x++) {
		var cookie_for = cookie_split[x].split ("=");

		if (cookie_for[0] == escape(cookie_name)) {
			return unescape(cookie_for[1]);
		}
	}
	return null;
}


function smilie(zeichen,gif,formfield) {

	ahref = "<a onClick=\"document.forms[0]."+ formfield +".value +='"+ zeichen + " '\" style='cursor:hand'><img src=\"http://www.dampfer.net/images/smilies/"+ gif +"\" border=0></a> ";
	document.write(ahref);
}


function malautomat(x) {
	url = "swf/malautomat/malautomat_1703.swf?malid="+ x;
	save_content=document.getElementById("play_"+ x).innerHTML;
	document.getElementById("play_"+ x).innerHTML=flash(url,"284","202");
}

function flash(url,width,height) {

	return "<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" WIDTH=\""+ width +"\" HEIGHT=\""+ height +"\" id=\"swf\" ALIGN=\"\">"+
	"<PARAM NAME=movie VALUE=\""+ url +"\">"+
	"<PARAM NAME=quality VALUE=high>"+
	"<EMBED src=\""+ url +"\" quality=high WIDTH=\""+ width +"\" HEIGHT=\""+ height +"\" NAME=\"swf\" ALIGN=\"\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED>"+
	"</OBJECT>";
}

function malautomat_after(x) {
	document.getElementById("play_"+ x).innerHTML = save_content;
}


/* * * * * * * * * * * * * *
	pop.js
 * * * * * * * * * * * * * */
 function popup(mypage, myname, w, h, scroll) {

	wh = screen.height;
	ww = screen.width;

	wleft = Math.round((ww - w) / 2);
	wtop = Math.round((wh - h) / 2) - 30;

	winprops = 'height='+h+',width='+w+',left='+wleft+',top='+wtop+',scrollbars='+scroll+',resizable=1';
	win = window.open(mypage, myname, winprops);

	if(win) {
		if(win.opener==null) {
			win.opener=self;
		}
		win.focus();
	}
}


function popup_blur(mypage, myname, w, h, scroll) {

	wh = screen.height;
	ww = screen.width;

	wleft = Math.round((ww - w) / 2);
	wtop = Math.round((wh - h) / 2) - 30;

	winprops = 'height='+h+',width='+w+',left='+wleft+',top='+wtop+',scrollbars='+scroll+',resizable=1';
	win = window.open(mypage, myname, winprops);

	win.window.blur();
	win.opener.focus();
}




function popup_empty() {
	if(document.getElementById("popcontent").innerHTML.length == 0)this.close();

}



/* * * * * * * * * * * * * *
	klapp.js
 * * * * * * * * * * * * * */
function klapp_onload(klapp_cookie,klapp_name) {

	if(cookie(klapp_cookie) == "")
		document.getElementById(klapp_name).style.display='';
	else
		document.getElementById(klapp_name).style.display='none';

	switch(klapp_name) {
		case "buddylist_off":
			//buddylist_klapp("off");
		break;
		
		case "buddylist_geheim":
			//buddylist_klapp("geheim");
		break;

		case "buddylist_on":
			buddylist_klapp("on");
		break;
	}

}


function buddylist_klapp(art) {
	klapp('buddylist_'+art,'image_'+art,'togglecontent_buddylist_'+art,'buddylist');
}

function interview_klapp() {
	klapp('interview','interview_button','togglecontent_interview');
}




function klapp(klapp_name,klapp_button,klapp_cookie,imgart) {

	switch(imgart) {
		case "buddylist":
			var imgAr = new Array('http://www.dampfer.net/images/icons/onlist_minus.gif','http://www.dampfer.net/images/icons/onlist_plus.gif');
		break;
		
		default:
			var imgAr = new Array('http://www.dampfer.net/images/toggle_off.gif','http://www.dampfer.net/images/toggle_on.gif');
		break;
	}
	
	if(document.getElementById(klapp_name).style.display=='none') {
		document.getElementById(klapp_name).style.display='';
		document.cookie = klapp_cookie+'=1';
		document.getElementById(klapp_button).src=imgAr[0];
		document.getElementById(klapp_button).alt='ausklappen';
	}
	else {
		document.getElementById(klapp_name).style.display='none';
		document.cookie = klapp_cookie+'=';
		document.getElementById(klapp_button).src=imgAr[1];
		document.getElementById(klapp_button).alt='einklappen';
	}
}




/* * * * * * * * * * * * * *
	onlinelist_mitalter.js
 * * * * * * * * * * * * * */ 

	OnlineListAr = new Array();
	var OnlineListCountDampfies = 0;
	var OnlineListCountGuests = 0;
	var OnlineListStart = 0;
	var OnlineListeTimeStart = new Date();
	var firstCall = 0;			//wird +1, wenn daten manuell nachgeladen werden (no loading, wenn am anfang keine daten da sind)
	var erwOnlist="";
	var filterOption = new Array();
	var filterSet = false;
	var ownAge = 0;
	
	function userlink(ar) {
		md5 = ar[0];
		username = unescape(unescape(ar[1]));
		style = ar[2];
		gfx = ar[3];
		title = ar[6];
		geschlecht = ar[7];
		alter = ar[8];
		
		phpfile = 'popup.php';
		//server = 'http://localhost/dampfer04/';
		//server = 'http://web2.dampfer.net/';
		onClick = 'onClick=\"userprof(this.href); return false;\"';
		css_style = 'id='+ style;
		
		if(title.length > 0)
			title = "title=\""+ title +"\"";
		else
			title = "title=\"Alter: "+ alter +"\"";

		

		return '<a href=\"'+ phpfile +'?user='+ md5 +'\" '+ onClick  +' '+ css_style +' '+ title +'>'+gfx+' '+ username +'</a>';
	}
	
	
	
	var view_art_last = "buddys";
	function buddyliste_onoff(view_art) {	
		
	
		if(document.getElementById('buddylist_div').style.display == 'none' ) {
			document.getElementById('buddylist_div').style.display = '';
			
			document.getElementById('listcontent_'+ view_art).style.display = '';
			document.getElementById('listcontent_'+ (view_art=="buddy"?"crew":"buddy") ).style.display = 'none';
			
			onoff = 1;
		}
		else if(!view_art || view_art_last == view_art) {
			document.getElementById('buddylist_div').style.display = 'none';
			onoff = 0;
		}
		else {
			document.getElementById('listcontent_'+ view_art).style.display = '';
			document.getElementById('listcontent_'+ (view_art=="buddy"?"crew":"buddy") ).style.display = 'none';
			onoff = 1;
		}
		
		document.getElementById('buddylist_h2').setAttribute("class" , "h2_"+ view_art);

		view_art_last = view_art;
		document.cookie = "BuddylistOn=" + onoff;
		document.cookie = "BuddylistLast=" + view_art_last;
	}	

	function buddylist_cookieload() {
		if(cookie("BuddylistOn")==1) {
			document.getElementById('buddylist_div').style.top = cookie("BuddylistTop");
			document.getElementById('buddylist_div').style.left = cookie("BuddylistLeft");
			buddyliste_onoff(cookie("BuddylistLast"));
		}
	}
					
	function onlinelist_userlink(ar) {	
		if(!ar) return;
		uc = ar[0];
		status_online = ar[4];
		status_funke = ar[5];
		alter = ar[8];

		
		//if(status_online)
		//	symbol_online = '<img src=\"http://www.dampfer.net/images/buddylist_listicon_on.gif\">';
		//else
		//	symbol_online = '<img src=\"http://www.dampfer.net/images/buddylist_listicon_away.gif\">';
		symbol_online = '';
		
		symbol_write = '<a href=\"javascript:user_write(\''+ uc +'\')\"><img src=\"http://www.dampfer.net/images/icons/icon_brief_neu.gif\" width=13 height=12 border=0 title=\"Briefschreiben starten\"></a>';
				
		if(status_funke)
			symbol_funke = '<a href=\"javascript:user_funk(\''+ uc +'\')\"><img src=\"http://www.dampfer.net/images/icons/funke.gif\" width=10 height=9 border=0 title=\"Funkkasten starten\"></a>';
		else
			symbol_funke = '';

		//return symbol_online +' '+ symbol_write +' '+ symbol_funke +' '+ userlink(ar);
		return '<div class="div_out_onlinelist"><div class="div_inner_onlinelist">' + alter + ' ' + symbol_write+' '+symbol_funke+' '+userlink(ar)+'</div></div>';
	}
	
	function onlinelist_v3(start,limit,vorschau) {
	
		if(!start) start = 0;
		if(!limit) limit = 80;
		if(!vorschau) vorschau = 0;
		
		++firstCall;	//hochzählen (ab 2 wird gedrückt, 1 ist anfang, kein daten nachladen notwendig)
		
		onlinelistHTML = onlinelist_limited(start,limit,vorschau);
		
		if(onlinelistHTML)
			document.getElementById('div_onlinelist').innerHTML = onlinelistHTML;
		
	}
	
	function onlinelist_navi(start,limit) {
		
		var seiten = Math.ceil(OnlineListCountDampfies / limit);
		var akt = Math.floor(start / limit) + 1;
		
		var next = (start + limit);
		var pre = (start - limit);
		
		if(next > OnlineListCountDampfies) next = start;
		if(pre < 0) pre = 0;		
		
		var onClick_plus = "onClick=\"onlinelist_v3("+ (next) +","+ limit +")\" style='cursor:pointer' ";
		var onClick_minus = "onClick=\"onlinelist_v3("+ (pre)   +","+ limit +")\" style='cursor:pointer' ";
		
		if(akt == seiten) onClick_plus = "";
		if(akt == 1)  onClick_minus = "";
		
		var img_plus = "<img src='http://www.dampfer.net/images/icons/onlist_vor.gif' "+ onClick_plus  +" title='nächste Seite' align=absmiddle>";
		var img_minus = "<img src='http://www.dampfer.net/images/icons/onlist_back.gif' "+ onClick_minus  +" title='Seite zurück' align=absmiddle>";


		
		if(akt<=9) akt = "0"+ akt;
		if(seiten<=9) seiten = "0"+ seiten;
		
		var pageAnzeige = "<span style='font-family:tahoma;font-size:9px'>["+ akt +"/"+ seiten +"]</span>";
		
		
		var ButtonReload = "<img src='http://www.dampfer.net/images/icons/onlist_reload.gif' align=absmiddle onClick=\"onlinelist_reload()\" style='cursor:pointer;padding-right:14px'  title='Onlineliste neuladen'>";
		var ButtonAll = "<img src='http://www.dampfer.net/images/icons/onlist_ausklapp.gif' align=absmiddle onClick=\"onlinelist_v3(0,"+ OnlineListCountDampfies +")\" style='cursor:pointer;padding-left:14px'  title='komplette Liste'>";
			
		if(limit == OnlineListCountDampfies)
			ButtonAll = "<img src='http://www.dampfer.net/images/icons/onlist_einklapp.gif' align=absmiddle onClick=\"onlinelist_v3(0,50)\" style='cursor:pointer;padding-left:14px'  title='Liste mit Seitenansicht'>";
		
		var statusDampfies = onlinelist_status();
		var Navi = "<div id='div_onlinelist_navi' style='height:17px;margin:2px 4px 0 0;text-align:center;font-size:9px;'>"+ 
			ButtonReload +" "+ img_minus +" "+ pageAnzeige +" "+ img_plus +" "+ ButtonAll+
		"</div>";
		//var Navi = '<div id="div_onlinelist_navi"></div>';
		
		return Navi + statusDampfies;
	}
	
	function onlinelist_status() {

		//niemand da
		if(OnlineListCountDampfies == 0 && OnlineListCountGuests == 0)
			return "Kein User online<br>";

		//Gäste da
       if(OnlineListCountGuests > 0) {
			wort = OnlineListCountGuests == 1 ? "Gast" : "Gäste";
			gaeste = "<b>"+ OnlineListCountGuests +" "+ wort +"</b> und<br>";
		}
		else {
			gaeste = "";
		}

		
		if(erwOnlist)
			filter = onlinelist_filterContent() +"<br>";
		else
			filter = "";
			
		profil_durchsuchen = "<div style='margin-bottom: 2px;'><span id=link_list><img src='http://www.dampfer.net/images/mini_pfeil_1.gif'  align=absmiddle />&nbsp;<a href='index.php?pool,suche,online'><span id=text_klein>Komplette Passagiersliste</span></a></span></div>";

		
		//Text User Anzahl
		dampfies = OnlineListCountDampfies == 1 ? "Dampfie" : "Dampfies";
		return  "<div style='margin-bottom: 2px;'>" + filter + profil_durchsuchen + gaeste +"<b>"+ OnlineListCountDampfies + " "+ dampfies +"</b></div>";
	}


	function onlinelist_limited(start,limit,vorschau) {
		ar = onlinelist_ar(start,limit);
		
		if(!ar) return false;	
		list_array = new Array();
		
		if(filterSet) {
			ar = onlinelist_filterAr(ar);
		}


		var alle = ar.length;	
		list_return = '';
		i=0;

		for(x=start;x<=alle;x++) {
			if(!ar[x]) break;						
			if(i++ >= limit) break;
			//if(!onlinelist_filterCheck(ar[x])) continue;		

			alter = ar[x][8];	

			//u16Filter
			if(ownAge>=17 || ownAge==0) {
				if(alter < 16)
					continue;
			}
			
			
			if (vorschau==1) list_return += onlinelist_userlink(ar[x]);		
			else {
			if (!list_array[alter]) list_array[alter] = "";
			list_array[alter] += onlinelist_userlink(ar[x]);
			}
		}
		
		if (vorschau!=1) {
			for (x=10;x<110;x++) {
				if(list_array[x]) list_return += list_array[x];
			}
		}
		
		if(!list_return.length)
			list_return = "<i>Keine Daten verfügbar</i>";
			
		return onlinelist_navi(start,limit) + list_return;//
		
	}
	
	function onlinelist_ar(start,limit) {
		OnlineListStart = start;
		OnlineListLimit = limit;
		
		if(firstCall > 1) {
			if(!OnlineListAr) { onlinelist_getData(); return false; }
			if(!OnlineListAr[start]) { onlinelist_getData(); return false; }
			if(OnlineListCountDampfies >= limit) {
				if(!OnlineListAr[(limit - 1)]) { onlinelist_getData(); return false; }
			}			
		}
		
		return OnlineListAr;			
	}
	
	function onlinelist_reload() {
		OnlineListStart = 0;
		OnlineListLimit = 70;
		
		var OnlineListeTimeReload = new Date();	
		var TimeVergangen = Math.round((OnlineListeTimeReload.getTime() - OnlineListeTimeStart.getTime()) / 1000);
		
		//erst nach einer Minute reloaden
		if(TimeVergangen >= 40)		{		
			OnlineListeTimeStart = new Date();
			
			onlinelist_getData();
		}
		else {
			document.getElementById('div_onlinelist_navi').innerHTML = "[erst in "+ (40-TimeVergangen) +" Sek]";
			
			window.setTimeout("onlinelist_v3()", 400);
		}
	}
	function onlinelist_getData() {
		// mHhh... geht irgendwie nicht?!
		//return;
		
		//Loading
		document.getElementsByTagName('body')[0].style.cursor='wait';
		if(document.getElementById('div_onlinelist_navi'))
			document.getElementById('div_onlinelist_navi').innerHTML = "[Loading]";
		
			x_onlinelist_data(do_onlinelist_date_cb);
	}

	
		
	/*
		FILTERs
		filterOption[0] = Name
		filterOption[1] = FilterEinstellungen

	*/
	function onlinelist_filterOption(thiss) {	
		varSelect = thiss.selectedIndex;
		switch(varSelect) {
			default:
				filterOption[0] = "";	//name
				filterOption[1] = 0;	//einstellung
				filterSet = false;
			break;
			
			case 2://girls
				filterOption[0] = "geschlecht";	//name
				filterOption[1] = 2;
				filterSet = true;
			break;		
			
			case 3://boys
				filterOption[0] = "geschlecht";	//name
				filterOption[1] = 1;
				filterSet = true;				
			break;	

			case 4://"altergleich":		
				filterOption[0] = "alter";	//name
				
				filterOption[1] = new Array();
				filterOption[1][0] = ownAge;
				
				filterSet = true;				
			break;			

			case 5://"alteretwa":
				filterOption[0] = "alter";	//name
				
				filterOption[1] = new Array();
				filterOption[1][0] = ownAge;				
				
				filterOption[1][1] = ownAge - 1;
				filterOption[1][2] = ownAge + 1;
				
				if(ownAge >= 16) {
					filterOption[1][3] = ownAge - 2;
					filterOption[1][4] = ownAge + 2;
				}								
				if(ownAge >= 18) {
					filterOption[1][5] = ownAge - 3;
					filterOption[1][6] = ownAge + 3;
				}
				if(ownAge >= 22) {
					filterOption[1][7] = ownAge - 4;
					filterOption[1][8] = ownAge + 4;
				}
				
				filterSet = true;				
			break;	

			case 6://v3
				filterOption[0] = "v3";	//name
				filterOption[1] = 1;
				filterSet = true;	
			break;
		}
		
		onlinelist_v3(0,OnlineListCountDampfies);	
	}

	
	/*
		return true - NO FILTERING
		return false - RAUSGEFILTERT
	*/
	function onlinelist_filterCheck(meta) {
		if(!erwOnlist) return true;
	
		geschlecht = meta[7];
		alter = meta[8];
		v3 = meta[9];
		
		if(filterSet) {
			if(filterOption[0] == "geschlecht") {
				if(filterOption[1] != geschlecht)
					return true;
			}			
		
			if(filterOption[0] == "alter") {
				if(!in_array(alter,filterOption[1]))
					return true;
			}	
			
			if(filterOption[0] == "v3") {
				if(filterOption[1] != v3)
					return true;
			}	
		}
		
		return false;
	}


				
	function onlinelist_filterAr(ar) {
		var ar_return = new Array();
		var i = 0;
		for(x=0;x<ar.length;x++) {
			if(onlinelist_filterCheck(ar[x])) continue;			
			
			ar_return[i++] = ar[x];		
		}
		return ar_return;
	}
	
	
	function onlinelist_filterContent() {	
		return "<select onChange='onlinelist_filterOption(this);' style='width:130px;font-size:9px;margin-left:4px;background-color:#cdbc9a;border-color:#4e3d13;'>"+
					"<option name=''></option>"+
					"<option name='all'>Alle Dampfies</option>"+
					"<option name='girls'>Nur Dampfergirls</option>"+
					"<option name='boys'>Nur Dampferboys</option>"+
					"<option name='altergleich'>Alle Gleichaltrigen</option>"+
					"<option name='alteretwa'>Alle etwa in meinem Alter</option>"+
				//	"<option name='geburtstag'>Die Geburtstagskinder</option>"+
				//	"<option name='v3'>Dampfer v3 Tester</option>"+
				"</select>";	
	}
	

	
	
	/*  *  *  *  *  *  *  *  *  *  *
	 *	AJAX Spass
	 */	
	function x_onlinelist_data() { sajax_do_call("onlinelist_data", "__lib,onlinelist" , x_onlinelist_data.arguments , "" );}

	function do_onlinelist_date_cb(objekt) {
		
		OnlineListAr = new Array();		
		for (var key in objekt) {			
			data = objekt[key];
			
			OnlineListAr[key] = new Array();
			for (var sub_key in data) {			
				sub_data = data[sub_key];
				
				OnlineListAr[key][sub_key] = sub_data;
			}			
		}
		
		OnlineListCountDampfies = OnlineListAr.length;
		
		document.getElementsByTagName('body')[0].style.cursor='auto';

		onlinelist_v3(OnlineListStart,OnlineListLimit);
	}
	
	
	/*  *  *  *  *  *  *  *  *  *  *
	 *	Sonstiges
	 */
	
	
	function in_array(Wert,Array) {		
		for(var key in Array) {
			if(Wert == Array[key])
				return true;		
		}
		return false;
	}
	

	var p1="0";
	var p2="01";
	var p3="012";
	
	
	function submenu_write() {
	
	if(p) {
		p1=p.substr(0,1);
		p2=p.substr(0,2);
		p3=p.substr(0,3);
	}

	
	var out = "";
	
	ar_menu = mainmenu_ar();
	ar_submenu = submenu_ar();
	for(x=1;x<ar_submenu.length;x++) {
		
		if(!ar_submenu.length) continue;
		ar_get2 = ar_submenu[x];		

		out += "<div id='dropmenu"+ x +"' class='dropmenudiv'>";
		
		for(y=0;y<ar_get2.length;y++) {
			
			get1 = ar_menu[x];
			get2 = ar_get2[y][0];
			name = ar_get2[y][1];
			
					
			//no
			if(ar_get2[y][2]) {
				if(ar_get2[y][2].match("."+ p2 +".")) {
					//jo
					if(ar_get2[y][3]) {	
						if(ar_get2[y][3].match("."+ p3 +".") == null) {  
							continue;
						}
					}
				}
			}
			else if(ar_get2[y][3]) {
				if(ar_get2[y][3].match("."+ p2 +".") == null)
					continue;
			}
			
			
			href = "?"+ get1 +","+ get2;			
			
			out += "<a href='"+ href +"' class=get2>"+ name +"</a>";
		}		
		out += "</div>";
	}	

	document.write(out);
}



//Drop Down Tabs Menu- Author: Dynamic Drive (http://www.dynamicdrive.com)
//Created: May 16th, 07'

var tabdropdown={
	disappeardelay: 200, //set delay in miliseconds before menu disappears onmouseout
	disablemenuclick: false, //when user clicks on a menu item with a drop down menu, disable menu item's link?
	enableiframeshim: 1, //1 or 0, for true or false

	//No need to edit beyond here////////////////////////
	dropmenuobj: null, ie: document.all, firefox: document.getElementById&&!document.all, previousmenuitem:null,
	currentpageurl: window.location.href.replace("http://"+window.location.hostname, "").replace(/^\//, ""), //get current page url (minus hostname, ie: http://www.dynamicdrive.com/)

	getposOffset:function(what, offsettype){
		var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
		var parentEl=what.offsetParent;
			while (parentEl!=null){
				totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
				parentEl=parentEl.offsetParent;
			}
		return totaloffset;
	},

	showhide:function(obj, e, obj2){ //obj refers to drop down menu, obj2 refers to tab menu item mouse is currently over
		if (this.ie || this.firefox)
			this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px";
		if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover"){
			if (obj2.parentNode.className.indexOf("default")==-1) //if tab isn't a default selected one
				obj2.parentNode.className="selected";
			obj.visibility="visible";
			}
		else if (e.type=="click")
			obj.visibility="hidden";
	},

	iecompattest:function(){
		return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
	},

	clearbrowseredge:function(obj, whichedge){
		var edgeoffset=0;
		if (whichedge=="rightedge"){
			var windowedge=this.ie && !window.opera? this.standardbody.scrollLeft+this.standardbody.clientWidth-15 : window.pageXOffset+window.innerWidth-15;
			this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth;
			if (windowedge-this.dropmenuobj.x < this.dropmenuobj.contentmeasure){  //move menu to the left?
				edgeoffset=this.dropmenuobj.contentmeasure-obj.offsetWidth;
			}
		}
		else{
			var topedge=this.ie && !window.opera? this.standardbody.scrollTop : window.pageYOffset;
			var windowedge=this.ie && !window.opera? this.standardbody.scrollTop+this.standardbody.clientHeight-15 : window.pageYOffset+window.innerHeight-18;
			this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight;
			if (windowedge-this.dropmenuobj.y < this.dropmenuobj.contentmeasure){ //move up?
				edgeoffset=this.dropmenuobj.contentmeasure+obj.offsetHeight;
				if ((this.dropmenuobj.y-topedge)<this.dropmenuobj.contentmeasure) //up no good either?
					edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge;
			}
			this.dropmenuobj.firstlink.style.borderTopWidth=(edgeoffset==0)? 0 : "1px"; //Add 1px top border to menu if dropping up
		}
		return edgeoffset;
	},

	dropit:function(obj, e, dropmenuID){
		if (this.dropmenuobj!=null){ //hide previous menu
			this.dropmenuobj.style.visibility="hidden"; //hide menu
			if (this.previousmenuitem!=null && this.previousmenuitem!=obj){
				if (this.previousmenuitem.parentNode.className.indexOf("default")==-1) //If the tab isn't a default selected one
					this.previousmenuitem.parentNode.className="";
			}
		}
		this.clearhidemenu();
		if (this.ie||this.firefox){
			obj.onmouseout=function(){tabdropdown.delayhidemenu(obj);};
			obj.onclick=function(){return !tabdropdown.disablemenuclick;}; //disable main menu item link onclick?
			
			this.dropmenuobj=document.getElementById(dropmenuID);
			this.dropmenuobj.onmouseover=function(){tabdropdown.clearhidemenu()};
			this.dropmenuobj.onmouseout=function(e){tabdropdown.dynamichide(e, obj)};
			this.dropmenuobj.onclick=function(){tabdropdown.delayhidemenu(obj)};
			this.showhide(this.dropmenuobj.style, e, obj);
			this.dropmenuobj.x=this.getposOffset(obj, "left");
			this.dropmenuobj.y=this.getposOffset(obj, "top");
			this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px";
			this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1+"px";
			this.previousmenuitem=obj; //remember main menu item mouse moved out from (and into current menu item)
			this.positionshim(); //call iframe shim function
		}
	},

	contains_firefox:function(a, b) {
		while (b.parentNode)
		if ((b = b.parentNode) == a)
			return true;
		return false;
	},

	dynamichide:function(e, obj2){ //obj2 refers to tab menu item mouse is currently over
		var evtobj=window.event? window.event : e;
		if (this.ie&&!this.dropmenuobj.contains(evtobj.toElement))
			this.delayhidemenu(obj2);
		else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefox(evtobj.currentTarget, evtobj.relatedTarget))
			this.delayhidemenu(obj2);
	},

	delayhidemenu:function(obj2){
		this.delayhide=setTimeout(function(){tabdropdown.dropmenuobj.style.visibility='hidden'; if (obj2.parentNode.className.indexOf('default')==-1) obj2.parentNode.className=''},this.disappeardelay); //hide menu
	},

	clearhidemenu:function(){
		if (this.delayhide!="undefined")
			clearTimeout(this.delayhide);
	},

	positionshim:function(){ //display iframe shim function
		if (this.enableiframeshim && typeof this.shimobject!="undefined"){
			if (this.dropmenuobj.style.visibility=="visible"){
				this.shimobject.style.width=this.dropmenuobj.offsetWidth+"px";
				this.shimobject.style.height=this.dropmenuobj.offsetHeight+"px";
				this.shimobject.style.left=this.dropmenuobj.style.left;
				this.shimobject.style.top=this.dropmenuobj.style.top;
			}
		this.shimobject.style.display=(this.dropmenuobj.style.visibility=="visible")? "block" : "none";
		}
	},

	hideshim:function(){
		if (this.enableiframeshim && typeof this.shimobject!="undefined")
			this.shimobject.style.display='none';
	},

isSelected:function(menuurl){
	var menuurl=menuurl.replace("http://"+menuurl.hostname, "").replace(/^\//, "");
	return (tabdropdown.currentpageurl==menuurl);
},

	init:function(menuid, dselected){
		this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body; //create reference to common "body" across doctypes
		var menuitems=document.getElementById(menuid).getElementsByTagName("a");
		for (var i=0; i<menuitems.length; i++){
			if (menuitems[i].getAttribute("rel")){
				var relvalue=menuitems[i].getAttribute("rel");
				document.getElementById(relvalue).firstlink=document.getElementById(relvalue).getElementsByTagName("a")[0];
				menuitems[i].onmouseover=function(e){
					var event=typeof e!="undefined"? e : window.event;
					tabdropdown.dropit(this, event, this.getAttribute("rel"));
				}
			}
			if (dselected=="auto" && typeof setalready=="undefined" && this.isSelected(menuitems[i].href)){
				menuitems[i].parentNode.className+=" home";
				var setalready=true;
			}
			else if (parseInt(dselected)==i)
				menuitems[i].parentNode.className+=" home";
		}
	}

};


	var InternTabCounter = 0;
	var AktivTabPosition = -1;
	var zindex = 0;
	var left = 0;
	var div_tabline = "";
	var tab_ar_org = 0;
	var content_last = 0;
	var counterKlicks = 0;
	var tabtext = "normal";
	

	function tabbrowsing(tab_ar,checked) {		
		if(tab_ar_org==0) tab_ar_org = tab_ar;
		if(tab_ar==0 && tab_ar_org!=0) tab_ar = tab_ar_org;
	
		LoadWait_ready();
		tabB_Reset();	
		for(x=0;x<tab_ar.length;x++) {		
			tab_name = tab_ar[x];		

			div_tabline += (checked == x) ? tabB_get_akt(tab_name,x) : tabB_get_nor(tab_name,x);	
		}
		
		document.getElementById("tabbrowsing").innerHTML = "<div class='div_tab'>"+ div_tabline + "</div>";	
		
		if(++counterKlicks != 1)
			LoadOnClickCheck(checked);
		
		tabB_content_show(checked);
		tabB_emptyCheck();
	}

	function tabB_emptyCheck() {		
		for(x=0;x<tab_ar.length;x++) {	
			if(!document.getElementById("tabcontent_"+ x).firstChild)
				document.getElementById("tabbutton_"+ x).style.display = "none";			
			else
				document.getElementById("tabbutton_"+ x).style.display = "";
		}
	}

	function tabB_content_show(content_akt) {	

		document.getElementById("tabcontent_"+ content_last).style.display = "none";
		document.getElementById("tabcontent_"+ content_akt).style.display = "";			
		
		if(document.getElementById("tabcontent_extra_"+ content_last))
			document.getElementById("tabcontent_extra_"+ content_last).style.display = "none";
			
		if(document.getElementById("tabcontent_extra_"+ content_akt))
			document.getElementById("tabcontent_extra_"+ content_akt).style.display = "";		

		content_last = content_akt;
	}

	function tabB_get_nor(tab_name,x) {	

		style ="z-index:"+ ++InternTabCounter +";";	
		if(InternTabCounter > AktivTabPosition && AktivTabPosition>0) style = "left:-1px;";		
		if(tab_name.length >= 13) style += "font-size:10px;";
		
		if(tabtext == "normal") {
			tab_text = escape(tab_name);
			url = "image.php?art=tab&text="+ tab_text ;
			url = "images/contwin/dyn_header/tab_"+ tab_text +".jpg"

			//tab_text = "<img src='"+ url +"' alt='"+ tab_text +"' style='display:none'>";		
			tab_text = "<div style='background-image:url("+ url +");background-repeat:no-repeat;background-position:center -22px;height:22px;'></div>";
		}
		else if(tabtext == "span") {
			tab_text = "<span>"+ tab_name +"</span>";
		}
		else {
			tab_text = tab_name;
		}
		
		return ""+
		"<div "+ tabB_onClick(InternTabCounter-1) +" "+ tabB_rollOverFX() +" id='tabbutton_"+ x +"' style='"+ style +"' class='tab_normal'>"+
			"<div class='tab_text'>"+ tab_text +"</div>"+
		"</div>";	
	}

	function tabB_get_akt(tab_name,x) {	
		AktivTabPosition = ++InternTabCounter;
		
		style = "left:0;";	
		if(tab_name.length >= 13) style += "font-size:10px;";
			
		
		if(tabtext == "normal") {
			tab_text = escape(tab_name);
			url = "image.php?art=tab&text="+ tab_text ;
			url = "images/contwin/dyn_header/tab_"+ tab_text +".jpg"
			
			//tab_text = "<img src='"+ url +"' alt='"+ tab_text +"' style='display:none'>";		
			tab_text = "<div style='background-image:url("+ url +");background-repeat:no-repeat;background-position:center top;height:22px;'></div>";
		}
		else if(tabtext == "span") {
			tab_text = "<span>"+ tab_name +"</span>";
		}
		else {
			tab_text = tab_name;
		}
		
		return "<div id='tabbutton_"+ x +"' style='"+ style +"' class='tab_aktiv'><div class='tab_text'>"+ tab_text +"</div></div>";	
	}

	function tabB_onClick(ii) {
		return "onClick='tabbrowsing(0,"+ ii +")'";
	}

	function tabB_rollOverFX() {
		//mOver = "onmouseover=\"this.style.backgroundPosition='0px -86px'; this.firstChild.style.color='#fff'; \"";
		//mOut  = "onmouseout=\"this.style.backgroundPosition='0px -43px'; this.firstChild.style.color='#d2c9b7';\"";
		
		mOver = "onmouseover=\"this.style.backgroundPosition='0px -86px'; this.firstChild.firstChild.style.backgroundPosition='center top'; \"";
		mOut  = "onmouseout=\"this.style.backgroundPosition='0px -43px'; this.firstChild.firstChild.style.backgroundPosition='center -22px'\"";
		
		return mOver +" "+ mOut;
	}

	function tabB_Reset() {
		InternTabCounter = 0;
		AktivTabPosition = -1;
		zindex = 0;
		left = 0;
		div_tabline = "";
	}


	function LoadOnClickCheck(tabX) {	
			
		switch(tabX) {
			case 0: if(isFuncLoadOnClick0) LoadOnClick0();	break;
			case 1: if(isFuncLoadOnClick1) LoadOnClick1();	break;
			case 2: if(isFuncLoadOnClick2) LoadOnClick2();	break;
			case 3: if(isFuncLoadOnClick3) LoadOnClick3();	break;
		}
	}


	function LoadOnClickContent(tabX,cache) {
		if(document.getElementById("tabcontent_"+ tabX).innerHTML == "..." || !cache) {	
			LoadWait_Screen('tabcontent_'+ tabX);
			switch(tabX) {
				case 0: x_LOC0(do_LOC0_cb);		break;
				case 1: x_LOC1(do_LOC1_cb);		break;
				case 2: x_LOC2(do_LOC2_cb);		break;
				case 3: x_LOC3(do_LOC3_cb);		break;
			}		
		}
	}
	
	
	
	

 

/* * * * * * * * * * *
 *    Sajax
 * * * * * * * * * * * */ 
	
	
	
		// remote scripting library
		// (c) copyright 2005 modernmethod, inc
		var sajax_debug_mode = true;//$tpl[debug_mode];
		var sajax_debug_mode_phperror = true;//$tpl[debug_mode_phperror];
		var sajax_request_type = "POST";//"$tpl[sajax_request_type]";
		var sajax_target_id = "";//""";
		var sajax_failure_redirect = "";//"$tpl[sajax_failure_redirect]";
		var dampferAjaxFile = "ajax.php";
		
		function sajax_debug(text,phperror) {
			///*
			if(sajax_debug_mode,phperror)
				alert(text);
			else if(phperror && sajax_debug_mode_phperror)
				alert(text);
			//*/
		}
		
 		function sajax_init_object() {
 			sajax_debug("sajax_init_object() called..");
 			
 			var A;
 			
 			var msxmlhttp = new Array(
				'Msxml2.XMLHTTP.5.0',
				'Msxml2.XMLHTTP.4.0',
				'Msxml2.XMLHTTP.3.0',
				'Msxml2.XMLHTTP',
				'Microsoft.XMLHTTP');
			for (var i = 0; i < msxmlhttp.length; i++) {
				try {
					A = new ActiveXObject(msxmlhttp[i]);
				} catch (e) {
					A = null;
				}
			}
 			
			if(!A && typeof XMLHttpRequest != "undefined")
				A = new XMLHttpRequest();
			if (!A)
				sajax_debug("Could not create connection object.");
			return A;
		}
		
		var sajax_requests = new Array();
		
		function sajax_cancel() {
			for (var i = 0; i < sajax_requests.length; i++) 
				sajax_requests[i].abort();
		}
		
		function sajax_do_call(func_name, dampferdata, args , ajaxFile) {
			var i, x, n;
			var uri;
			var post_data;
			var target_id;
			
			sajax_debug("in sajax_do_call().." + sajax_request_type + "/" + sajax_target_id);
			target_id = sajax_target_id;
			if (typeof(sajax_request_type) == "undefined" || sajax_request_type == "") 
				sajax_request_type = "GET";
			
			//uri = "$tpl[sajax_remote_uri]";
			
			if(!ajaxFile)
				uri = "ajax.php";
			else
				uri = ajaxFile;
				
			
			if (sajax_request_type == "GET") {
			
				if (uri.indexOf("?") == -1) 
					uri += "?rs=" + escape(func_name);
				else
					uri += "&rs=" + escape(func_name);
				uri += "&rst=" + escape(sajax_target_id);
				uri += "&rsrnd=" + new Date().getTime();
				
				for (i = 0; i < args.length-1; i++) 
					uri += "&rsargs[]=" + escape(args[i]);

				post_data = null;
			} 
			else if (sajax_request_type == "POST") {
				post_data = "rs=" + escape(func_name);
				post_data += "&rst=" + escape(sajax_target_id);
				post_data += "&rsrnd=" + new Date().getTime();
				
				/* DampferData */
				//dampferdata = "$tpl[sajax_dampferdata]";
				post_data += "&dampferdata="+ dampferdata;
				
				for (i = 0; i < args.length-1; i++) 
					post_data = post_data + "&rsargs[]=" + escape(args[i]);
			}
			else {
				//alert("Illegal request type: " + sajax_request_type);
			}
			
			x = sajax_init_object();
			if (x == null) {
				if (sajax_failure_redirect != "") {
					location.href = sajax_failure_redirect;
					return false;
				} else {
					sajax_debug("NULL sajax object for user agent: " + navigator.userAgent);
					return false;
				}
			} else {
				x.open(sajax_request_type, uri, true);
				/* window.open(uri); */
				
				sajax_requests[sajax_requests.length] = x;
				
				if (sajax_request_type == "POST") {
					x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1");
					x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				}
			
				x.onreadystatechange = function() {
					if (x.readyState != 4) 
						return;

					sajax_debug("received " + x.responseText);
				
					var status;
					var data;
					var txt = x.responseText.replace(/^\s*|\s*$/g,"");
					status = txt.charAt(0);
					data = txt.substring(2);

					if (status == "") {
						/* let's just assume this is a pre-response bailout and let it slide for now */
					} else if (status == "-") {
						//alert("Error: " + data);
					}
					else {
						if (target_id != "") 
							document.getElementById(target_id).innerHTML = eval(data);
						else {
							try {
								var callback;
								var extra_data = false;
								if (typeof args[args.length-1] == "object") {
									callback = args[args.length-1].callback;
									extra_data = args[args.length-1].extra_data;
								} else {
									callback = args[args.length-1];
								}
								callback(eval(data), extra_data);
							} catch (e) {
								sajax_debug("Caught error " + e + ": Could not eval " + data,true);
							}
						}
					}
				}
			}
			
			sajax_debug(func_name + " uri = " + uri + "/post = " + post_data);
			x.send(post_data);
			sajax_debug(func_name + " waiting..");
			delete x;
			return true;
		}
		
		
	
	
	
	

/* * * * * * * * * * *
 *    LoadingScreen
 * * * * * * * * * * * */ 
		
//kopiert OrginalInhalt (idElement) in ein extra DIV (idElementLoading), 
//blendet idElement aus 
//und haut über idElementLoadig ein LoadingScreen			
//loadwait_2()
function LoadWait(idElement,idElementLoading,width,height) { 
	if(!idElementLoading) idElementLoading = "tabcontent_loading";
	
	var divLoading = document.getElementById(idElementLoading);
	var divContent = document.getElementById(idElement);
	
	divLoading.innerHTML = divContent.innerHTML;
	
	
	divLoading.style.display = "";	
	
	//Formulare unbrauchbar machen (nur das erste was er findet)		
	if(document.getElementsByTagName("form")) {		
		var formular = divLoading.getElementsByTagName("form")[0];	
		if(formular)
			formular.removeAttribute("name");
	}

	LoadWait_Screen(idElementLoading,width,height); 
}
		
//Haut in idElement ein DIV mit LoadingScreen 
//(nicht rückgängig - Inhalt aus IdElement muss neu geladen werden)
//loadwait()
function LoadWait_Screen(idElement,width,height) {
	if(!width) width = 739;			
	if(!height) height = 350;
	

	
	var divLoadingScreen = document.getElementById(idElement);

	LoadWait_MouseLoad();	
	
	
	divLoadingScreen.innerHTML = "<div style='width:"+ width +"px;height:"+ height +"px;overflow:hidden;'>"+
		//"<div style='position:relative;width:"+ width +"px;height:"+ height +"px;background-image:url(http://www.dampfer.net/images/2x2streifen_ocker.gif);z-index:10;'>"+
		"<div style='position:relative;width:"+ width +"px;height:"+ height +"px;background-color:#f2ede4;z-index:10;' id='loadingBG'>"+
			"<div style='position:relative;top:50px;text-align:center;font-size:30px;font-weight:bold;color:#444'>"+
				"wird geladen<br><img src='http://www.dampfer.net/images/gutscheine/ajax-loader.gif'>"+
			"</div>"+
		"</div>	"+
		"<div style='position:relative;top:-"+ height +"px;height:0px;z-index:1;'>"+ document.getElementById(idElement).innerHTML +"</div>"+
	"</div>";


	//Loading Screen fadeIn
	if(!tabdropdown.ie) {
		e = document.getElementById("loadingBG");
		e.setStyle({opacity: '0.1'});
		new Effect.Opacity(e,{ duration: 0.8, from: 0.1, to: 0.8 });
	}
	else {
		document.getElementById("loadingBG").style.dispay='';
	}
}


function LoadWait_ready(idElement,idElementLoading) {
	if(!idElementLoading) idElementLoading = "tabcontent_loading";

	LoadWait_MouseNormal();
	if(document.getElementById(idElementLoading)) {
		document.getElementById(idElementLoading).style.display = 'none';
	}
}


//Sanduhr Mauszeiger
function LoadWait_MouseLoad() {
	document.getElementsByTagName('body')[0].style.cursor='wait';
}
//normaler Mauszeiger
function LoadWait_MouseNormal() {
	document.getElementsByTagName('body')[0].style.cursor='auto';
}

		
		
/* * * * * * * * * * *
 *    Formular
 * * * * * * * * * * * */ 
function FormInfobox(thiss,text) {
	f = $('forminfobox');
	
	p = Position.positionedOffset(thiss); 
	f.style.top = (p[1] + 22) +"px";
	f.style.left = (p[0] + 40) +"px";
	f.style.display = "";
	f.innerHTML = text;

	return;	
}
function FormInfobox_clear() {
	f = $('forminfobox');	
	f.style.display = "none";
}

 
 
 
function FormMeldung(txt) {

	html = "<div id=text_meldung class=line_trennline_o style='padding:3px'>"+
			"<b>Meldung:</b><br>"+ txt +"</div>";

	document.getElementById("AjaxFormMeldungDiv").innerHTML = html;
}

function FormMeldung_Clear() {
	document.getElementById("AjaxFormMeldungDiv").innerHTML = "";
}

 
function footerjahr() {
	e=document.getElementById('footerjahr');
	j=e.innerHTML;
	d=new Date();
	y=d.getFullYear();
	if(j!=y)e.innerHTML=y;
}
function footermenu() {
	a="";
	var b=mainmenu_ar();
	for(i=1;i<b.length;i++){
		c=b[i];
		d = (i < b.length-1) ? "&middot;" : "";			
	   a += " <a href='?"+c+"' style='color:white;font-weight:normal;text-transform:capitalize'>"+ c +"</a> " + d;
	}
	document.write(a);
}
