function infoBarDialog(was)
	{
	if (was == "show")
		{
		document.getElementById("infoBarSettingsButton").href = "javascript:infoBarDialog('hide');";
		$("infoBarSettings").appear({ duration: 0.5, from: 0.0, to: 1.0 });
		$("infoBarSettingsImage").fade({ duration: 0.5, from: 1.0, to: 0.5 });
		//infoBarDialogDelayStart();
		}
		else
			{
			document.getElementById("infoBarSettingsButton").href = "javascript:infoBarDialog('show');";
			$("infoBarSettings").fade({ duration: 0.2, from: 1.0, to: 0.0 });
			$("infoBarSettingsImage").fade({ duration: 0.2, from: 0.5, to: 1.0 });
			}
	}
	
function infoBar_updater()
	{	
	get_infobar_update();
	var ib = window.setInterval("get_infobar_update()", 15000);
	}
	
function get_infobar_update()
	{	
	var state = document.getElementById("infobar-opener").innerHTML;
	if (state == "0")
		{
		document.getElementById("ib-con-noclick").style.display = "block";
		document.getElementById("ib-con-opener").style.display = "none";
		document.getElementById("ib-con-closer").style.display = "none";
		var jetzt = new Date();
		var jetzt = jetzt.getTime();
		new Ajax.Request('http://www.bizzpoint.net/info-bar/update/'+jetzt+"/",
										{
										method: 'get',
										onComplete: function(transport) {
											var response = transport.responseText;
											response = response.split("%%%FINDER CONTENT NOW STARTING%%%");
											$("infoBar").update(response[0]);
											var fupdate = "";
											for(var i = 1; i < response.length; i++)
												{
												fupdate = fupdate + response[i];
												}
											$("finder").update(fupdate);
											}
										}
								);
		}
		else
			{
			var jetzt = new Date();
			var jetzt = jetzt.getTime();
			new Ajax.Request('http://www.bizzpoint.net/info-bar/update-online-state/'+jetzt+"/",
											{
											method: 'get'
											}
									);
			}
	}

function ib_con_list(state, load_text)
	{
	if (state == "open")
		{
		document.getElementById('ib-bubble').style.display = "none";
		document.getElementById("infobar-opener").innerHTML = "1";
		document.getElementById("infobar-contacts").style.display = "block";
		document.getElementById("ib-con-opener").style.display = "none";
		document.getElementById("ib-con-closer").style.display = "block";
		get_contact_list('offline', load_text);
		}
		else
			{
			document.getElementById("infobar-opener").innerHTML = "0";
			document.getElementById("infobar-contacts").style.display = "none";
			document.getElementById("ib-con-closer").style.display = "none";
			get_infobar_update();
			tog('show', 'ib-bubble');
			}
	}
	
function get_contact_list(state, load_text)
	{
	$("waiting-for-contacts").appear({ duration: 0.2, from: 0.0, to: 1.0 });
	var so = new SWFObject("http://www.bizzpoint.net/media/swf/loading.swf", "mymovie", "668", "58", "9", "#000000");
	so.addParam("wmode", "transparent");
	so.addVariable("load_text", load_text);
	so.write("waiting-for-contacts");
	document.getElementById("contacts-ajax").style.display = "none";
	var jetzt = new Date();
	var jetzt = jetzt.getTime();
	new Ajax.Updater('contacts-ajax', 'http://www.bizzpoint.net/info-bar/contact_list/state/'+state+'/'+jetzt+"/",
									{
									method: 'get',
									onComplete: function () {
															document.getElementById("waiting-for-contacts").style.display = "none";
															$("contacts-ajax").appear({ duration: 0.5, from: 0.0, to: 1.0 });
															init_con_hover();
															}
									}
							);
	}

function init_con_hover()
	{
	var obj = document.getElementById("all_cons").innerHTML;
	if (obj != "empty")
		{
		list = obj.split(",");
		for (var i = 0; i < list.length; i++)
			{
			if (list[i] != "")
				{
				$("img_"+list[i]).appear({ duration: 0.2, from: 1.0, to: 0.5 });
				}
			}
		}
	}

function con_hover(id, state)
	{
	if (state == "over")
		{
		$("img_"+id).setStyle({ backgroundPosition: "bottom" });
		}
		else
			{
			$("img_"+id).setStyle({ backgroundPosition: "top" });
			}
	}

function con_goto(state, id, total)
	{
	id = Number(id); 
	if (state == "up")
		{
		if (id > 0)
			{
			var new_id = id - 1;
			var old_id = id + 1;
			document.getElementById("con-slider-"+state).href = "javascript:con_goto('"+state+"', '"+new_id+"', '"+total+"');";
			document.getElementById("con-slider-down").href = "javascript:con_goto('down', '"+old_id+"', '"+total+"');";
			Effect.SlideDown("con_row_"+id, { duration: 0.5, afterFinish: function() {
																$("con_row_"+old_id).setStyle({display: "none"}); }});
			}
		}
		else
			{
			if (id <= total)
				{
				var new_b_id = id + 1;
				var old_b_id = id - 1;
				document.getElementById("con-slider-"+state).href = "javascript:con_goto('"+state+"', '"+new_b_id+"', '"+total+"');";
				document.getElementById("con-slider-up").href = "javascript:con_goto('up', '"+old_b_id+"', '"+total+"');";
				Effect.SlideUp("con_row_"+old_b_id, {duration: 0.5});
				$("con_row_"+id).setStyle({display: "block"});
				}
			}
	}
	
function con_get_profile(profile, load_text)
	{
	document.getElementById("con-waiting-for-profile-infos").style.display = "block";
	document.getElementById("con-profile-infos-ajax").style.display = "none";
	var so = new SWFObject("http://www.bizzpoint.net/media/swf/loading-m.swf", "load_con_profile", "566", "58", "9", "#000000");
	so.addParam("wmode", "transparent");
	so.addVariable("load_text", load_text);
	so.write("con-waiting-for-profile-infos");
	var jetzt = new Date();
	var jetzt = jetzt.getTime();
	new Ajax.Updater('con-profile-infos-ajax', 'http://www.bizzpoint.net/info-bar/con_get_profile/profile/'+profile+'/'+jetzt+"/",
									{
									method: 'post',
									onComplete: function() 
													{
													document.getElementById("con-waiting-for-profile-infos").style.display = "none";
													$("con-profile-infos-ajax").appear({ duration: 0.5, from: 0.0, to: 1.0 });
													}
									}
								);
	}
	
function con_select(acc, row, totalRows, load_text)
	{
	con_get_profile(acc, load_text);
	row = Number(row);
	con_goto("up", "1", totalRows);
	if (row > 1)
		{
		setTimeout("con_goto('down', "+row+", "+totalRows+")", 1000);
		}
	}

function finder_show_profile(profile)
	{
	var jetzt = new Date();
	var jetzt = jetzt.getTime();
	new Ajax.Updater('finder-profile', 'http://www.bizzpoint.net/info-bar/get_profile/profile/'+profile+'/'+jetzt+"/",
									{
									method: 'post'
									}
								);
	}

function finder_matches(state)
	{
	if (state == "open")
		{
		$("finder-matches-link-o").fade({ duration: 0.0, from: 1.0, to: 0.0 });
		$("finder-matches-link-c").appear({ duration: 0.0, from: 0.0, to: 1.0 });
		$("finder-matches").appear({ duration: 0.5, from: 0.0, to: 1.0 });
		document.getElementById("infobar-opener").innerHTML = "1";
		}
		else
			{
			$("finder-matches-link-c").fade({ duration: 0.0, from: 1.0, to: 0.0 });
			$("finder-matches-link-o").appear({ duration: 0.0, from: 0.0, to: 1.0 });
			$("finder-matches").fade({ duration: 0.2, from: 1.0, to: 0.0 });
			document.getElementById("infobar-opener").innerHTML = "0";
			}
	}