//var p_servername = "localhost/ahano";
var p_servername = "www.ahano.de";
var jason_string = "";
var letzes_festner_id = 0;
var jason_obj;
var id_kunde_oeffnen;

function doresize () 
	{location.reload();return false;}
if(document.layers)window.captureEvents(Event.RESIZE); window.onresize=doresize;

var  js10 = (document.images)?false:true; // NN2.x
var  js11 = (document.images) && ((window.screen)?false:true); // NN3.x
var  ie = ((document.all) && (window.offscreenBuffering)) ? true : false; // IE >= 4.x
var  isNS = ((document.captureEvents) && (!document.getElementById)) ? true : false; // NN4.x
var  mz = ((document.getElementById) && (!document.all) && (document.documentElement)) ? true : false; // NN6/MZ
var  op = ((document.getElementById) && (navigator.userAgent.indexOf('Opera') != -1)) ?true : false;
var isMacIE = ( (navigator.userAgent.indexOf("IE 4") > -1) && (navigator.userAgent.indexOf("Mac")  > -1) );
var schicht;
y=0; weiter=0;

if (ie)        
{
	window.attachEvent("onload", mitglieder_aktualisieren);
}
else
{
	window.addEventListener("load", mitglieder_aktualisieren, false);
}


// schickt wird fest auf getElementById gelegt, kann aber auch über die browserweiche unten definiert werden. dann muss testen vor "wer ist online"ablaufen

schicht='document.getElementById("';stil='").style';

function testen() 
{

br=0;
	
	if (ie)        
	{
		schicht='document.getElementById("';stil='").style';
	}
	else if (isNS)        	
	{
		schicht='document.layers.scrollWindowDiv.document.layers["';stil='"]';
	}
	else if (mz)
	{
		schicht='document.getElementById("';stil='").style';
	}
	else if(op) 
	{
		schicht='document.getElementById("';stil='").style';
	}
	else 
	{
		schicht='document.getElementById("';stil='").style';
	}	
	
	/* elsewindow.location.href="controlling.html"; // nur NN und IE !!!*/
}

function moveIt(wen,wert) 
{

var hoehe = (anzahl_mitglieder_online*12.37)+75;

test=y;  // Hilfsvariable
y+=wert;
if (y < -hoehe || y > 1) 
	{
	y=test;
	eval(schicht+wen+stil+'.top="'+y+'"');
}
else 
	{
	eval(schicht+wen+stil+'.top="'+y+'"');
	}
}

function farbe() 
{

}

function scrollen_ende() 
{
	weiter=0;
}

function scrollen_start(wert) 
{
	weiter=1;
	scrollen(wert);
}

function scrollen(wert) 
{
moveIt('scrollContentDiv',wert);
a=wert;
if ((weiter)&&(y<10)) setTimeout("scrollen(a)",1);
}

function gone()
{   
if(isNS)
	{   
	document.scrollWindowDiv.document.scrollContentDiv.moveTo(20,0); 
	y=0;
	}   
if(ie)   
	{   
	scrollContentDiv.style.pixelLeft=0;   
	scrollContentDiv.style.pixelTop=0;
	y=0;
	}   
if(mz)
	{   
	document.getElementById("scrollContentDiv").style.left="0px";    
	document.getElementById("scrollContentDiv").style.top="0px";
	y=0;
	}
if(op)
	{   
	scrollContentDiv.style.pixelLeft=0;   
	scrollContentDiv.style.pixelTop=0;
	y=0;
	}
}


// stores the reference to the XMLHttpRequest object
var xmlHttp = createXmlHttpRequestObject(); 

// retrieves the XMLHttpRequest object
function createXmlHttpRequestObject() 
{	
  // will store the reference to the XMLHttpRequest object
  var xmlHttp;
  // if running Internet Explorer
  if(window.ActiveXObject)
  {
    try
    {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch (e) 
    {
      xmlHttp = false;
    }
  }
  // if running Mozilla or other browsers
  else
  {
    try 
    {
      xmlHttp = new XMLHttpRequest();
    }
    catch (e) 
    {
      xmlHttp = false;
    }
  }
  // return the created object or display an error message
  if (!xmlHttp)
    alert("Manche Funktionen auf der Seite können nicht ausgeführt werden");
  else 
    return xmlHttp;
}



function http_abbrechen()
	{
		if (xmlHttp.readyState < 4)
		{
			xmlHttp.abort();
		}
	}




// function um das tip zu schliessen
function Tip_zu()
{
	if(document.getElementById("wer_online"))
	{
		tt_HideInit();
	}	
}

function der_rote_punkt()
{
  Tip_zu();
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
    xmlHttp.open("POST","http://"+p_servername+"/inc/functionen/besucher_ajax/besucher_online_start_ajax.inc.php");  
    xmlHttp.onreadystatechange = der_rote_punkt_ausgabe;
    xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  	xmlHttp.send("senden=1&rot=1");
  }
  else
  setTimeout('der_rote_punkt()', 200);
}


// hier wird die Liste wer online ausgegeben.
function der_rote_punkt_ausgabe() 
{
  if (xmlHttp.readyState == 4) 
  {
		if (xmlHttp.status == 200) 
    {
			var xmlResponserot = xmlHttp.responseText;
			if (xmlResponserot)
			{
			var jason_online = eval("("+xmlResponserot+")");
			var bild_geschl;
			var class_admin;
			var wer_online_neu = "";
			for (var i=0; i<=jason_online.Wer_Online.Mitglieder.length; i++)
			{	
				if(jason_online.Wer_Online.Mitglieder[i])
				{

					var mitglied_neu = jason_online.Wer_Online.Mitglieder[i];

					if (mitglied_neu.GESCHLECHT == 1)
					{
						bild_geschl = "mann";
					}
					else
					{
						bild_geschl = "frau";
					}

					if (mitglied_neu.CHAT_JA == 1)
					{
						class_admin = "style='color:rgb(0,86,59);text-decoration:underline;'";
					}
					else
					{
						class_admin = "class='admin'";
					}			

					wer_online_neu = wer_online_neu+"<p class='geschl_links'><img class='geschl' src='http://www.ahano.de/images/link/"+bild_geschl+".jpg' border='0'></p><p class='geschl_rechts'>"+mitglied_neu.ALTER+" <a "+class_admin+" href='javascript:onclick=wer_online_maus_ueber_name3("+mitglied_neu.KUNDEN_ID+")'>"+mitglied_neu.MITNAME+"</a></p>";

				}
			}
		
			var string_tip = "<div id=\'wer_ist_da\'><div id=\'wer_online\'>"+wer_online_neu+"<p>"+jason_online.Wer_Online.Anzahl_Besucher+" Besucher</p></div></div>";

			var back_color = "#C40042";

			Tip(string_tip, WIDTH, 190, HEIGHT, 200, FIX, ['roter_punkt', 200, 5], CLOSEBTN, true, PADDING, 6, BGCOLOR, '#ffffff', STICKY, true, EXCLUSIVE, true, TITLE, "Wer ist online", FONTFACE, 'Arial, Helvetica, sans-serif', FONTSIZE, '12px', DELAY, 300, FADEIN, 300, FADEOUT, 300, TITLEALIGN, 'center', TITLEBGCOLOR, back_color, BORDERCOLOR, back_color,  TITLEFONTSIZE, '15px', TITLEPADDING, 8);
			}
		}
  }
}


function wer_online_maus_ueber_name3(id_kunden)
{

	id_kunde_oeffnen = id_kunden;
	if(document.getElementById("wer_online"))
	{
		Tip_zu();
		setTimeout("wer_online_maus_ueber_name4(id_kunde_oeffnen)", 1000 );		
	}
	else
	{
		wer_online_maus_ueber_name4(id_kunde_oeffnen);
	}
}

function wer_online_maus_ueber_name4(id_kunden)
{
  
  //http_abbrechen();
  
  // proceed only if the xmlHttp object isn't busy
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
		//p_s_nickname_neu = document.getElementById("s_nickname_neu").value;
    xmlHttp.open("POST","http://"+p_servername+"/inc/functionen/besucher_ajax/besucher_online_mitglied_bild.inc.php");  
    xmlHttp.onreadystatechange = wer_online_maus_ueber_name_ausgabe4;
    xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    xmlHttp.send("id_kunden="+id_kunden);
  }
}


function wer_online_maus_ueber_name_ausgabe4() 
{
  if (xmlHttp.readyState == 4) 
  {
		if (xmlHttp.status == 200) 
    {	
			var xmlResponse = xmlHttp.responseText;
			jason_obj = eval("("+xmlResponse+")");
			div_setzen3();
  	}
  }
}


function div_setzen3()
{
		var obj = jason_obj;
		var bild_link = obj.Mitglied.Bild_Link;
		jason_link_zusammen(obj);

		if(document.getElementById("wer_online"))
		{
			var string_tip = jason_string;
			document.getElementById("wer_online").innerHTML = string_tip;
		}
		else
		{
			var titel_back_color;

			if (obj.Mitglied.Geschlecht_ID == 1)
			{
				back_color = "#439390"
			}
			else
			{
				back_color = "#C40042"
			}			
			letzes_festner_id = obj.Mitglied.id_kunden;
			
			var string_tip="<div id=\'wer_online\'>"+jason_string+"</div><div id=\'wer_online_bild\'><a href=\'http://"+p_servername+"/inc/forum/profile.php?userid="+obj.Mitglied.id_kunden+"\' target=\'_blank\' border=\'0\'><img src=http://"+p_servername+"/"+bild_link+" border=\'0\'></a></div><div id=\'wer_online_schliessen\'><a href=\'javascript:onclick=tt_HideInit();\'>schliessen</a><br><br><a href=\'javascript:onclick=der_rote_punkt();\'>Liste anzeigen</a></div>";
			
			//das ist das Tip wenn man auf die Liste vom roten Punkt klickt.

			Tip(string_tip, WIDTH, 250, PADDING, 6, FIX, ['roter_punkt', 200, 5], BGCOLOR, '#ffffff', STICKY, true, EXCLUSIVE, true, TITLE, obj.Mitglied.Nick_Name, FONTFACE, 'Arial, Helvetica, sans-serif', FONTSIZE, '12px', DELAY, 300, FADEIN, 300, FADEOUT, 300, TITLEALIGN, 'center', TITLEBGCOLOR, back_color, BORDERCOLOR, back_color,  TITLEFONTSIZE, '15px', TITLEPADDING, 8);
  	
  	
  	}
}




function mitglieder_aktualisieren()
{
	if(document.getElementById("scrollWindowDiv"))
	{
		wer_online_aktualisieren();
	}
	
	if(document.getElementById("kurznachricht").value==1)
	{	
		if(!document.getElementById("wer_online"))
		{
			if(!document.getElementById("wer_online"))
			{
				setTimeout("neue_kurznachricht()", 2000 );		
			}
			if(!document.getElementById("wer_online"))
			{
				if(document.getElementById("postfach_schauen").value==1)
				{	
					setTimeout("neue_nachricht_postfach()", 5000 );	
				}
			}
		}
	}
	setTimeout("mitglieder_aktualisieren()", 60000 );
}




// hier wird nachgeschaut, ob eine neue Nachricht im Postch vorliegt
function neue_nachricht_postfach()
{
  if(!document.getElementById("wer_online"))
	{	
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
		{		
			xmlHttp.open("POST","http://"+p_servername+"/inc/functionen/besucher_ajax/postfach_neue_nachricht.inc.php");  
			xmlHttp.onreadystatechange = neue_nachricht_postfach_ausgabe;
			xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			xmlHttp.send("senden=1");
		}
  }
}


var xmlResponse_postfach_ausgabe;
function neue_nachricht_postfach_ausgabe()
{
	if (xmlHttp.readyState == 4) 
	{
		if (xmlHttp.status == 200) 
    {		
			xmlResponse_postfach_ausgabe = xmlHttp.responseText;
			if(document.getElementById("wer_online"))
			{
				setTimeout("postfach_ausgeben_setzen(xmlResponse_postfach_ausgabe)", 1000 );
			}
			else
			{
				postfach_ausgeben_setzen(xmlResponse_postfach_ausgabe);
			}
		}
	}
}


function postfach_ausgeben_setzen(xmlResponse_postfach_ausgabe)
{
	
	xmlResponse_postfach_ausgabe = xmlResponse_postfach_ausgabe.replace(/\n/g,"");
	xmlResponse_postfach_ausgabe = xmlResponse_postfach_ausgabe.replace(/\r/g,"");
	//xmlResponse_postfach_ausgabe = unescape(xmlResponse_postfach_ausgabe);
	if (xmlResponse_postfach_ausgabe)
	{
		var jason_Kurz = eval("("+xmlResponse_postfach_ausgabe+")");

		if(jason_Kurz && jason_Kurz.POSTFACH_NACHRICHT)
		{

			var nachricht_ja = jason_Kurz.POSTFACH_NACHRICHT.Nachricht_ja;


			if (nachricht_ja == 1) // wenn eine nachricht vorhanden
			{

				var bild_link = jason_Kurz.POSTFACH_NACHRICHT.Nachricht_Bild;

				var	back_color = "#C40042";

				if (jason_Kurz.POSTFACH_NACHRICHT.Nachricht_sex == 1)
				{
					back_color = "#439390"
				}
				else
				{
					back_color = "#C40042"
				}		

				var string_tip="<div id=\'wer_online\'>"+jason_Kurz.POSTFACH_NACHRICHT.Nachricht+"</div>";

				string_tip=string_tip+"<div id=\'wer_online_bild\'><img src=http://"+p_servername+"/"+bild_link+"></div><div id=\'wer_online_schliessen\'><a href=\'javascript:onclick=Tip_zu()\'>schliessen</a></div>";

				Tip(string_tip, WIDTH, 250, PADDING, 6, BGCOLOR, '#ffffff', STICKY, true, EXCLUSIVE, true, FIX, ['roter_punkt', 0, -50], TITLE, jason_Kurz.POSTFACH_NACHRICHT.Nachricht_TITEL, FOLLOWSCROLL, true, FONTFACE, 'Arial, Helvetica, sans-serif', FONTSIZE, '12px', DELAY, 300, FADEIN, 300, FADEOUT, 300, TITLEALIGN, 'center', TITLEBGCOLOR, back_color, BORDERCOLOR, back_color,  TITLEFONTSIZE, '15px', TITLEPADDING, 8);

			}
		}
	}
}



















// hier wird nachgeschaut, ob eine Kurznachricht vorliegt.
function neue_kurznachricht()
{
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
    xmlHttp.open("POST","http://"+p_servername+"/inc/functionen/besucher_ajax/neue_kurznachricht_ajax.inc.php");  
    xmlHttp.onreadystatechange = neue_kurznachricht_ausgabe;
    xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  	xmlHttp.send("senden=1");
  }
}


var xmlResponseneue_kurz_aus;

function neue_kurznachricht_ausgabe()
{
	if (xmlHttp.readyState == 4 && xmlHttp.status == 200) 
  {	
		xmlResponseneue_kurz_aus = xmlHttp.responseText;
		xmlResponseneue_kurz_aus = xmlResponseneue_kurz_aus.replace(/\n/g,"<br>");
		xmlResponseneue_kurz_aus = xmlResponseneue_kurz_aus.replace(/\r/g,"<br>");	
		xmlResponseneue_kurz_aus = unescape(xmlResponseneue_kurz_aus);
		if(xmlResponseneue_kurz_aus)
		{
			var jason_kurz_aus = eval("("+xmlResponseneue_kurz_aus+")");
			if(jason_kurz_aus && jason_kurz_aus.KURZNACHRICHT)
			{
				var nachricht_ja = jason_kurz_aus.KURZNACHRICHT.Nachricht_ja;
				
				if (nachricht_ja == 1) // wenn eine nachricht vorhanden
				{			
					// jetzt wird nachgeschaut, ob kein div offen ist
					if(!document.getElementById("wer_online"))
					{
						Kurznachricht_ausgeben_setzen(jason_kurz_aus);
					}
				}
			}
		}
	}
}


function Kurznachricht_ausgeben_setzen(jason_Kurz)
{
	
	var bild_link = jason_Kurz.KURZNACHRICHT.Nachricht_bild;

	var	back_color;

	if (jason_Kurz.KURZNACHRICHT.Nachricht_sex == 1)
	{
		back_color = "#439390"
	}
	else
	{
		back_color = "#C40042"
	}		

	var jason_string = "";
	jason_string = jason_string+"<strong><a href=\'http://"+p_servername+"/inc/forum/profile.php?userid="+jason_Kurz.KURZNACHRICHT.Nachricht_id_kunde_geschrieben+"\' target=\'_blank\'>"+jason_Kurz.KURZNACHRICHT.Nachricht_von+"</a></strong> hat Dir einen Gruß am "+jason_Kurz.KURZNACHRICHT.Nachricht_time+" gesendet.<br><br>";
	jason_string = jason_string+jason_Kurz.KURZNACHRICHT.Nachricht_nachricht+"<br><br>";
	jason_string = jason_string+"<a href=\'javascript:onclick=gruss_antworten("+jason_Kurz.KURZNACHRICHT.Nachricht_id_kunde_geschrieben+","+jason_Kurz.KURZNACHRICHT.Nachricht_id+")\'>Antworten</a><br><br>";

	var string_tip="<div id=\'wer_online\'>"+jason_string+"</div><div id=\'wer_online_bild\'><img src=http://"+p_servername+"/"+bild_link+"></div><div id=\'wer_online_schliessen\'><a href=\'javascript:onclick=Kurznachricht_loeschen("+jason_Kurz.KURZNACHRICHT.Nachricht_id+")\'>schliessen</a></div>";

	Tip(string_tip, WIDTH, 250, HEIGHT, 440, PADDING, 6, BGCOLOR, '#ffffff', STICKY, true, EXCLUSIVE, true, FOLLOWSCROLL, true, CENTERWINDOW, true, TITLE, "Hallo "+jason_Kurz.KURZNACHRICHT.Nachricht_fuer, FONTFACE, 'Arial, Helvetica, sans-serif', FONTSIZE, '12px', DELAY, 300, FADEIN, 300, FADEOUT, 300, TITLEALIGN, 'center', TITLEBGCOLOR, back_color, BORDERCOLOR, back_color,  TITLEFONTSIZE, '15px', TITLEPADDING, 8);
}


var gruss_antworten_id;
div_position = 0;
function gruss_antworten(id_kunden, antwort_id)
{
	div_position = 3;
	gruss_antworten_id = id_kunden;
	Kurznachricht_loeschen(antwort_id);
	setTimeout("wer_online_maus_ueber_name(gruss_antworten_id )", 1000 );
}

function Kurznachricht_loeschen(id)
{
	
	//http_abbrechen();
	
	tt_HideInit();
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
    xmlHttp.open("POST","http://"+p_servername+"/inc/functionen/besucher_ajax/kurznachricht_loeschen_ajax.inc.php");  
    xmlHttp.onreadystatechange = Kurznachricht_loeschen_ausgabe;
    xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  	xmlHttp.send("loeschen_id="+id);
  }
}


function Kurznachricht_loeschen_ausgabe() 
{
  if (xmlHttp.readyState == 4) 
  {
		if (xmlHttp.status == 200) 
    {	
			var xmlResponse = xmlHttp.responseText;
		}
	}
}








div_position = 0;
function wer_online_maus_klick(id_kunden)
{
	div_position = 0;
	wer_online_maus_ueber_name(id_kunden);
}


function wer_online_maus_klick2(id_kunden)
{
	div_position = 2;
	wer_online_maus_ueber_name(id_kunden);
}


// hier wird die Liste wer online erstellt.
function wer_online_aktualisieren()
{
  
  //http_abbrechen();
  
  //proceed only if the xmlHttp object isn't busy
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
    xmlHttp.open("POST","http://"+p_servername+"/inc/functionen/besucher_ajax/besucher_online_start_ajax.inc.php");  
    xmlHttp.onreadystatechange = wer_online_ausgabe;
    xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  	xmlHttp.send("senden=1");
  }
}

function jason_string_pruefen(jason_uebergabe)
{
	if (jason_uebergabe.substr(jason_uebergabe.length-2, jason_uebergabe.length) == "}}")
	{
		return true;
	}
	else
	{
		return false	
	}
}



// hier wird die Liste wer online ausgegeben.
function wer_online_ausgabe() 
{
  if (xmlHttp.readyState == 4 && xmlHttp.status == 200) 
  {	
		var xmlResponse = xmlHttp.responseText;
		if (xmlResponse)
		{
			if (jason_string_pruefen(xmlResponse))
			{
				var jason_online = eval("("+xmlResponse+")");

				var bild_geschl;
				var class_admin;
				var wer_online_neu = "";

				var anzahl_mitglieder_online = jason_online.Wer_Online.Anzahl_Mitglieder;

				if(anzahl_mitglieder_online > 0)
				{
					for (var i=0; i<=jason_online.Wer_Online.Mitglieder.length; i++)
					{	
						if(jason_online.Wer_Online.Mitglieder[i])
						{

							var mitglied_neu = jason_online.Wer_Online.Mitglieder[i];

							if (mitglied_neu.GESCHLECHT == 1)
							{
								bild_geschl = "mann";
							}
							else
							{
								bild_geschl = "frau";
							}

							if (mitglied_neu.CHAT_JA == 1)
							{
								class_admin = "admin_gruen";
							}
							else
							{
								class_admin = "admin";
							}			

							wer_online_neu = wer_online_neu+"<div class='geschl'><p class='geschl_links'><img class='geschl' src='http://www.ahano.de/images/link/"+bild_geschl+".jpg' border='0'></p><p class='geschl_rechts'>"+mitglied_neu.ALTER+" <a class='"+class_admin+"' href='javascript:onclick=wer_online_maus_klick("+mitglied_neu.KUNDEN_ID+")' alt='zuletzt aktiv "+mitglied_neu.ZULETZT_AKTIV+"' title='zuletzt aktiv "+mitglied_neu.ZULETZT_AKTIV+"'>"+mitglied_neu.MITNAME+"</a></p></div>";
						}
					}
				}
			}

			wer_online_neu = wer_online_neu+"<p>"+jason_online.Wer_Online.Anzahl_Besucher+" Gäste</p>";

			document.getElementById("scrollContentDiv_unter").innerHTML = wer_online_neu;
		}
	}
}



function jason_link_zusammen(obj)
{

	jason_string = "";
	jason_string = "Geschlecht: "+obj.Mitglied.Geschlecht+"<br>";
	jason_string = jason_string+"Alter: "+obj.Mitglied.Alter+"<br>";
	jason_string = jason_string+"PLZ: "+obj.Mitglied.PLZ+"<br>";	
	jason_string = jason_string+"Zuletzt online: "+obj.Mitglied.Zuletztonline+"<br>";
	
	if(obj.Mitglied.Eigenes_Profil == 1)
	{
		jason_string = jason_string+"Dein Profil: <a href=\'http://"+p_servername+"/inc/forum/profile.php?userid="+obj.Mitglied.id_kunden+"\' target=\'_blank\'>"+obj.Mitglied.Nick_Name+"</a><br>";
	}
	else
	{
		jason_string = jason_string+"Profil anschauen von <a href=\'http://"+p_servername+"/inc/forum/profile.php?userid="+obj.Mitglied.id_kunden+"\' target=\'_blank\'>"+obj.Mitglied.Nick_Name+"</a><br>";
	}
	
	if(obj.Mitglied.favoliste == 1)
	{
		if(obj.Mitglied.favoliste_aktuell == 1)
		{
			jason_string = jason_string+"<span id=\'id_kurz_favo\'>Aus meiner Favoritenliste <a href=\'javascript:favoliste_kurz_update("+obj.Mitglied.id_kunden+",1)\'>löschen</a></span><br>";
		}
		else
		{
			jason_string = jason_string+"<span id=\'id_kurz_favo\'>In meine Favoritenliste <a href=\'javascript:favoliste_kurz_update("+obj.Mitglied.id_kunden+",0)\'>aufnehmen</a></span><br>";
		}
	}
	else
	{
		jason_string = jason_string+"In meine Favoritenliste <a href=\'http://"+p_servername+"/?kom=2&u_kom=7&u_u_kom=1\'>aufnehmen</a><br>";
	}	
	
	jason_string = jason_string+"<a href=\'javascript:wer_online_kurznachricht("+obj.Mitglied.id_kunden+")\'><img src=http://"+p_servername+"/inc/functionen/besucher_ajax/images/brief_kurzn.gif border=\'0\'></a> "+obj.Mitglied.Nick_Name+" einen Gruß <a href=\'javascript:wer_online_kurznachricht("+obj.Mitglied.id_kunden+")\'>schicken</a><br>";
	
	if(obj.Mitglied.Anzahl_Eintraege != 0)
	{
		if(obj.Mitglied.Eigenes_Profil == 1)
		{
			jason_string = jason_string+"Hier bist Du aktiv:<br>";
		}
		else
		{
			jason_string = jason_string+"Erfahre mehr über mich:<br>";
		}
		
		if (obj.Mitglied.partner != "")
		{
			jason_string = jason_string+"<a href=\'http://"+p_servername+"/?kom=6&u_kom=21&u_u_kom="+obj.Mitglied.partner+"\'>Partnersuche</a><br>";
		}	
		if (obj.Mitglied.freizeitsuche != "")
		{
			jason_string = jason_string+"<a href=\'http://"+p_servername+"/?kom=9&u_kom=75&u_u_kom="+obj.Mitglied.freizeitsuche+"\'>Freizeitpartnersuche</a><br>";
		}		
		if (obj.Mitglied.reisepartner != "")
		{
			jason_string = jason_string+"<a href=\'http://"+p_servername+"/?kom=4&u_kom=16&u_u_kom="+obj.Mitglied.reisepartner+"\'>Reisepartnersuche</a><br>";
		}	
		if (obj.Mitglied.reiseberichte != "")
		{
			jason_string = jason_string+"<a href=\'http://"+p_servername+obj.Mitglied.reiseberichte+"\'>Reiseberichte</a><br>";
		}
		if (obj.Mitglied.rezepte != "")
		{
			jason_string = jason_string+"<a href=\'http://"+p_servername+"/?kom=5&u_kom=18&u_u_kom="+obj.Mitglied.rezepte+"\'>Rezepte</a><br>";
		}
		if (obj.Mitglied.leihoma != "")
		{
			jason_string = jason_string+"<a href=\'http://"+p_servername+"/?kom=12&u_kom=39&u_u_kom="+obj.Mitglied.leihoma+"\'>Leihomasuche</a><br>";
		}
		if (obj.Mitglied.pflege != "")
		{
			jason_string = jason_string+"<a href=\'http://"+p_servername+"/?kom=7&u_kom=23&u_u_kom="+obj.Mitglied.pflege+"\'>Pflegebörse</a><br>";
		}
		if (obj.Mitglied.wohngemeinschaft != "")
		{
			jason_string = jason_string+"<a href=\'http://"+p_servername+"/?kom=7&u_kom=76&u_u_kom="+obj.Mitglied.wohngemeinschaft+"\'>WG-Suche</a><br>";
		}
		if (obj.Mitglied.flohmarkt != "")
		{
			jason_string = jason_string+"<a href=\'http://"+p_servername+"/?kom=19&u_kom=106&u_u_kom="+obj.Mitglied.flohmarkt+"\'>Flohmarkt</a><br>";
		}
	}
}


function wer_online_maus_ueber_name(id_kunden)
{
  
  //http_abbrechen();
  
  // proceed only if the xmlHttp object isn't busy
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
		//p_s_nickname_neu = document.getElementById("s_nickname_neu").value;
    xmlHttp.open("POST","http://"+p_servername+"/inc/functionen/besucher_ajax/besucher_online_mitglied_bild.inc.php");  
    xmlHttp.onreadystatechange = wer_online_maus_ueber_name_ausgabe;
    xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    xmlHttp.send("id_kunden="+id_kunden);
  }
}

function wer_online_maus_ueber_name_ausgabe() 
{
  if (xmlHttp.readyState == 4) 
  {
		if (xmlHttp.status == 200) 
    {	
			var xmlResponse = xmlHttp.responseText;
			jason_obj = eval("("+xmlResponse+")");
			if(document.getElementById("wer_online"))
			{
				tt_HideInit();
				setTimeout("div_setzen()", 1000 );	
			}
			else
			{
				div_setzen();
			}
		}
  }
}


function div_setzen()
{
		var obj = jason_obj;
		var bild_link = obj.Mitglied.Bild_Link;
		jason_link_zusammen(obj);
		
		if(document.getElementById("wer_online"))
		{
			var string_tip = jason_string;
			document.getElementById("wer_online").innerHTML = string_tip;
		}
		else
		{
			var titel_back_color;

			if (obj.Mitglied.Geschlecht_ID == 1)
			{
				back_color = "#439390"
			}
			else
			{
				back_color = "#C40042"
			}			
			
			letzes_festner_id = obj.Mitglied.id_kunden;
			var string_tip="<div id=\'wer_online\'>"+jason_string+"</div><div id=\'wer_online_bild\'><a href=\'http://"+p_servername+"/inc/forum/profile.php?userid="+obj.Mitglied.id_kunden+"\' target=\'_blank\' border=\'0\'><img src=http://"+p_servername+"/"+bild_link+" border=\'0\'></a></div><div id=\'wer_online_schliessen\'><a href=\'javascript:onclick=tt_HideInit();\'>schliessen</a></div>";
			
			if(div_position == 2) // aus Liste in Teaser
			{
				Tip(string_tip, WIDTH, 250, PADDING, 6, BGCOLOR, '#ffffff', STICKY, true, EXCLUSIVE, true, TITLE, obj.Mitglied.Nick_Name, FONTFACE, 'Arial, Helvetica, sans-serif', FONTSIZE, '12px', DELAY, 700, FADEIN, 700, FADEOUT, 700, TITLEALIGN, 'center', TITLEBGCOLOR, back_color, BORDERCOLOR, back_color,  TITLEFONTSIZE, '15px', TITLEPADDING, 8);  		
  		}			
			else if(div_position == 3) // antworten genau in der mitte
			{
				Tip(string_tip, WIDTH, 250, PADDING, 6, FOLLOWSCROLL, true, CENTERWINDOW, true, BGCOLOR, '#ffffff', STICKY, true, EXCLUSIVE, true, TITLE, obj.Mitglied.Nick_Name, FONTFACE, 'Arial, Helvetica, sans-serif', FONTSIZE, '12px', DELAY, 300, FADEIN, 300, FADEOUT, 300, TITLEALIGN, 'center', TITLEBGCOLOR, back_color, BORDERCOLOR, back_color,  TITLEFONTSIZE, '15px', TITLEPADDING, 8);  		
  		}				
			else /// aus sonstigen links - neben dem link
			{
				Tip(string_tip, WIDTH, 250, PADDING, 6, FIX, ['kurzprofil_aus', -300, -350], BGCOLOR, '#ffffff', STICKY, true, EXCLUSIVE, true, TITLE, obj.Mitglied.Nick_Name, FONTFACE, 'Arial, Helvetica, sans-serif', FONTSIZE, '12px', DELAY, 300, FADEIN, 300, FADEOUT, 300, TITLEALIGN, 'center', TITLEBGCOLOR, back_color, BORDERCOLOR, back_color,  TITLEFONTSIZE, '15px', TITLEPADDING, 8);
  		}
  	}
}

//FIX, ['scrollContentDiv', 200, 5],



function wer_online_kurznachricht(id_kunden)
{
  
  //http_abbrechen();
  
  // proceed only if the xmlHttp object isn't busy
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
    xmlHttp.open("POST","http://"+p_servername+"/inc/functionen/besucher_ajax/besucher_online_kurznachricht.inc.php");  
    xmlHttp.onreadystatechange = wer_online_kurznachricht_ausgabe;
    xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    xmlHttp.send("id_kunden="+id_kunden);
  }
}

function wer_online_kurznachricht_ausgabe(id_kunden)
{
	if (xmlHttp.readyState == 4) 
	{
		if (xmlHttp.status == 200) 
    {	
			document.getElementById("wer_online").innerHTML = xmlHttp.responseText;
		}
	}
}





function wer_online_abbrechen(id_kunden)
{
  
  //http_abbrechen();
  
  // proceed only if the xmlHttp object isn't busy
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
    xmlHttp.open("POST","http://"+p_servername+"/inc/functionen/besucher_ajax/besucher_online_mitglied_bild.inc.php");  
    xmlHttp.onreadystatechange = wer_online_abbrechen_ausgabe;
    xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    xmlHttp.send("id_kunden="+id_kunden);
  }
}


// executed automatically when a message is received from the server
function wer_online_abbrechen_ausgabe() 
{
  // move forward only if the transaction has completed
  if (xmlHttp.readyState == 4) 
  {
		if (xmlHttp.status == 200) 
    {	
			var xmlResponse = xmlHttp.responseText;
			jason_obj = eval("("+xmlResponse+")");
			var obj = jason_obj;
			var bild_link = obj.Mitglied.Bild_Link;
			jason_link_zusammen(obj);
			var string_tip = jason_string;
			document.getElementById("wer_online").innerHTML = string_tip;
  	}
  }
}


function wer_online_senden(id_kunden)
{
  
  //http_abbrechen();
  
  // proceed only if the xmlHttp object isn't busy
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
    
		var kurznachricht;
    kurznachricht = document.getElementById('besucher_nachricht').value;

    for (var j=1;j<=14;j++)
    {
			if(document.getElementById("kurz_art"+j).checked == true)
			{
				kurz_art=j;
			}
    }

		kurznachricht = escape(kurznachricht);

    xmlHttp.open("POST","http://"+p_servername+"/inc/functionen/besucher_ajax/besucher_online_kurznachricht_speichern.inc.php");  
    xmlHttp.onreadystatechange = wer_online_senden_ausgabe;
    xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    xmlHttp.send("id_kunden="+id_kunden+"&kurznachricht="+kurznachricht+"&art="+kurz_art);
  }

}

// executed automatically when a message is received from the server
function wer_online_senden_ausgabe() 
{
  if (xmlHttp.readyState == 4) 
  {
		if (xmlHttp.status == 200) 
    {
			var xmlResponse = xmlHttp.responseText;
			jason_kurz = eval("("+xmlResponse+")");
			if (jason_kurz.Nachricht.Gesendet == 1)
			{
				document.getElementById("wer_online").innerHTML = jason_kurz.Nachricht.Text;
			}
			else if(jason_kurz.Nachricht.Gesendet == 2)
			{
				document.getElementById("nachricht_fehler").innerHTML = jason_kurz.Nachricht.Text;
			}
		}
  }
}






var mit_up;
var mit_up_wert;

function favoliste_kurz_update(id,id2)
{
  
  //http_abbrechen();
  
  mit_up = id;
	mit_up_wert = id2;
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
    xmlHttp.open("POST","http://"+p_servername+"/inc/mitgliederliste_frei/mitgliederliste_ajax_2.inc.php");  
    xmlHttp.onreadystatechange = favoliste_kurz_update_ausgabe;
    xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    xmlHttp.send("mit_nr="+mit_up+"&mit_up_wert="+mit_up_wert);  
  }
  else
  setTimeout('favoliste_kurz_update(id,id2)', 1000);
}

function favoliste_kurz_update_ausgabe() 
{
  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      var xmlResponse = xmlHttp.responseText;
			if (xmlResponse ==1)
			{
				if(mit_up_wert==0) // löschen
				{
					document.getElementById('id_kurz_favo').innerHTML = "Aus meiner Favoritenliste <a href=\'javascript:favoliste_kurz_update("+mit_up+",1)\'>löschen</a>";
				}
				else if(mit_up_wert==1) // anfügen
				{
					document.getElementById('id_kurz_favo').innerHTML = "In meine Favoritenliste <a href=\'javascript:favoliste_kurz_update("+mit_up+",0)\'>aufnehmen</a>";
				}				
			}
    } 
  }
}







var kurzuebersicht_id_kunden;
var jason_kurzuebersicht;

function kurzuebersicht(id_kunden_kurz)
{
  kurzuebersicht_id_kunden = id_kunden_kurz;
  if(!document.getElementById("wer_online"))
	{	
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
		{		
			//p_s_nickname_neu = document.getElementById("s_nickname_neu").value;
			xmlHttp.open("POST","http://"+p_servername+"/inc/functionen/besucher_ajax/kurzuebersicht.inc.php");  
			xmlHttp.onreadystatechange = kurzuebersicht_ausgabe;
			xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			xmlHttp.send("id_kunden="+kurzuebersicht_id_kunden);
		}
		else
		{
			setTimeout("kurzuebersicht(kurzuebersicht_id_kunden)", 500 );
		}
	}
	else
	{
		tt_HideInit();
		setTimeout("kurzuebersicht(kurzuebersicht_id_kunden)", 500 );
	}
}


function kurzuebersicht_ausgabe() 
{
	if (xmlHttp.readyState == 4 && xmlHttp.status == 200) 
  {
		var xmlResponse = xmlHttp.responseText;
		if(xmlResponse)
		{
			jason_kurzuebersicht = eval("("+xmlResponse+")");
			if(jason_kurzuebersicht)
			{
				kurzuebersicht_ausgabe_div();
			}
		}
	}
}


function kurzuebersicht_ausgabe_div()
{
	var obj = jason_kurzuebersicht;
	jason_link_zusammen_kurzuebersicht(obj);
	var titel_back_color;
	if (obj.Mitglied.Geschlecht_ID == 1)
	{
		back_color = "#439390"
	}
	else
	{
		back_color = "#C40042"
	}			
	letzes_festner_id = obj.Mitglied.id_kunden;
	var string_tip=jason_string;
	Tip(string_tip, CLOSEBTN, true, FIX, ['roter_punkt', 200, 0], WIDTH, 600, HEIGHT, 450, PADDING, 6, BGCOLOR, '#ffffff', STICKY, true, EXCLUSIVE, true, TITLE, "Hallo "+obj.Mitglied.Nick_Name+": Deine ahano-Übersicht", JUMPVERT, false, FONTFACE, 'Arial, Helvetica, sans-serif', FONTSIZE, '12px', DELAY, 300, FADEIN, 300, FADEOUT, 300, TITLEALIGN, 'center', TITLEBGCOLOR, back_color, BORDERCOLOR, back_color,  TITLEFONTSIZE, '15px', TITLEPADDING, 8);
}


function jason_link_zusammen_kurzuebersicht(obj)
{
	jason_string = obj.Mitglied.Mitglied_kurz_1;
}

// ab hier alles für sozial bookmark

function schnipp() { 
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function schnupp(n, d) { 
  var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=schnupp(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
  }
function schnapp() { 
  var i,j=0,x,a=schnapp.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=schnupp(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
  }
  
function bookmarken()
{
  
  Tip_zu();
  
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
    xmlHttp.open("POST","http://"+p_servername+"/inc/functionen/besucher_ajax/ausgabe_bookmark.inc.php");  
    xmlHttp.onreadystatechange = bookmarken_ausgabe;
    xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    xmlHttp.send("senden=1");
  }

}

// executed automatically when a message is received from the server
function bookmarken_ausgabe() 
{
  if (xmlHttp.readyState == 4 && xmlHttp.status == 200) 
   {
		var xmlResponse = xmlHttp.responseText;
		var back_color = "#C40042";
		Tip(xmlResponse, CLOSEBTN, true, FIX, ['bookmark-div', 200, 0], WIDTH, 172, HEIGHT, 180, PADDING, 6, BGCOLOR, '#ffffff', STICKY, true, EXCLUSIVE, true, TITLE, "ahano merken bei:", JUMPVERT, false, FONTFACE, 'Arial, Helvetica, sans-serif', FONTSIZE, '12px', DELAY, 300, FADEIN, 300, FADEOUT, 300, TITLEALIGN, 'center', TITLEBGCOLOR, back_color, BORDERCOLOR, back_color,  TITLEFONTSIZE, '15px', TITLEPADDING, 8);
  }
}  
  