
var menu_eingeklappt      = true;
var menu_xPos_eingeklappt =-255;
var menu_xPos_ausgeklappt =   5;

var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;

function sidebar_showHide()
	{
	if (menu_eingeklappt)
		{
		menu_eingeklappt = false;
		document.getElementById('arrowImage').innerHTML = '<img src="teamspeak/images/sidebar_arrow_left.gif" hspace="2" border="0" />';
		}
	else
		{
		menu_eingeklappt = true;
		document.getElementById('arrowImage').innerHTML = '<img src="teamspeak/images/sidebar_arrow_right.gif" hspace="2" border="0" />';
		}

	}


function sidebar_float(id, sx, sy)
	{
	var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	var px = document.layers ? "" : "px";
	window[id + "_obj"] = el;
	if(d.layers)el.style=el;
	el.cx = el.sx = sx;
	el.cy = el.sy = sy;
	el.sP = function(x,y){this.style.left=x+px;this.style.top=y+px;};

	el.floatIt=function()
		{
		var pX, pY, offX;
		pX = (this.sx >= 0) ? 0 : ns ? innerWidth :
		document.documentElement && document.documentElement.clientWidth ?
		document.documentElement.clientWidth : document.body.clientWidth;
		pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ?
		document.documentElement.scrollTop : document.body.scrollTop;
		if(this.sy<0)
		pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ?
		document.documentElement.clientHeight : document.body.clientHeight;

		if (menu_eingeklappt == true) 
			{ this.cx = menu_xPos_eingeklappt; } 
		else 
			{ this.cx = menu_xPos_ausgeklappt; }
			
		this.cx += ((pX + this.sx) - this.cx)/4;
		this.cy += ((pY + this.sy) - this.cy)/32;
		
		this.cx = Math.round(this.cx);
		this.cy = Math.round(this.cy);
		
		this.sP(this.cx, this.cy);
		setTimeout(this.id + "_obj.floatIt()", 40);
		}
	return el;
	}

sidebar_float("floatingMenu", 5,30).floatIt();

