function hide(field)
{
if (document.getElementById(field))
{
	document.getElementById(field).style.visibility = 'hidden';
	document.getElementById(field).style.display = 'none';
}
}

function show(field)
{
if (document.getElementById(field))
{
	document.getElementById(field).style.visibility = 'visible';
	document.getElementById(field).style.display = '';
}
}

function calendarCallback( day, month, year )
{
var i = 0;
for(i = 0; i < document.getElementById('dat1').length; i++)
{
	if(document.getElementById('dat1').options[i].text == day)
	{
		document.getElementById('dat1').options[i].selected=true;
		break;
	}
}

for(i = 0; i < document.getElementById('dat2').length; i++)
{
	if(document.getElementById('dat2').options[i].text == month)
	{
		document.getElementById('dat2').options[i].selected=true;
		break;
	}
}

for(i = 0; i < document.getElementById('dat3').length; i++)
{
	if(document.getElementById('dat3').options[i].text == year)
	{
		document.getElementById('dat3').options[i].selected=true;
		break;
	}
}
}

function showimage(URL)
{
document.getElementById('prevImage').src = URL;
}

function showimage_cat(file_name)
{
document.getElementById('prevImage').src = "http://images1.whee.de/avatare/" + file_name;
}

function hover(row)
{
row.className = 'hover';
}

function original(row, classNameVal)
{
row.className = classNameVal;
}

function check_pw(pass, output)
{
var Ergebnis;
var rang = "<p style='color: #FF0000; border: 1px dashed #000000; background-color: #FFFFFF; width: 350; padding: 4px; margin: 4px 0px;'><b>Sehr Schlechtes Passwort<br>Mehr als 6 Zeichen wäre sinnvoll.</b></p>";
var preg = /^[A-Za-z]{6,99}$/;
if (Ergebnis = preg.test(pass)) rang = "<p style='color: #D18206; border: 1px dashed #000000; background-color: #FFFFFF; width: 350; padding: 5px'><b>Schlechtes Passwort<br>Nicht nur Buchstaben verwenden!</b></p>";
var preg = /^[0-9]{6,99}$/;
if (Ergebnis = preg.test(pass)) rang = "<p style='color: #D18206; border: 1px dashed #000000; background-color: #FFFFFF; width: 350; padding: 5px'><b>Schlechtes Passwort<br>Nicht nur Zahlen verwenden!</b></p>";
var preg = /^(?=.*\d)(?=.*[a-zA-Z]).{6,99}$/;
if (Ergebnis = preg.test(pass)) rang = "<p style='color: #206A00; border: 1px dashed #000000; background-color: #FFFFFF; width: 350; padding: 5px'><b>Gutes Passwort<br>Evtl. noch '#' oder '_' oder '-' einsetzen!</b></p>";
var preg = /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[#_-]).{1,6}$/;
if (Ergebnis = preg.test(pass)) rang = "<p style='color: #206A00; border: 1px dashed #000000; background-color: #FFFFFF; width: 350; padding: 5px'><b>Gutes Passwort<br>Aber lieber mehr als 6 Zeichen benutzen!</b></p>";
var preg = /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[#_-]).{6,99}$/;
if (Ergebnis = preg.test(pass)) rang = "<p style='color: #05BF00; border: 1px dashed #000000; background-color: #FFFFFF; width: 350; padding: 5px'><b>Optimales Passwort</b></p>";
document.getElementById(output).innerHTML = rang;
}

var checkflag = false;
function check(field)
{
if (checkflag == false)
{
	for (i = 0; i < field.length; i++) field[i].checked = true;
	checkflag = true;
	return " alle Markierungen entfernen ";
}
else
	{
		for (i = 0; i < field.length; i++) field[i].checked = false;
		checkflag = false;
		return " alle markieren ";
	}
}

var wheeicon = [];

function initializeIcons()
{
	wheeicon['marker'] = new GIcon();
	wheeicon['marker'].image = "http://www.whee.de/images/icons/marker.png";
	wheeicon['marker'].shadow = "http://www.whee.de/images/icons/marker_shadow.png";
	wheeicon['marker'].iconSize = new GSize(43, 41);
	wheeicon['marker'].shadowSize = new GSize(43, 41);
	wheeicon['marker'].iconAnchor = new GPoint(28, 29);
	wheeicon['marker'].infoWindowAnchor = new GPoint(17, 3);

	wheeicon['marker_disco'] = new GIcon();
	wheeicon['marker_disco'].image = "http://www.whee.de/images/icons/marker_disco.png";
	wheeicon['marker_disco'].shadow = "http://www.whee.de/images/icons/marker_disco_shadow.png";
	wheeicon['marker_disco'].iconSize = new GSize(43, 41);
	wheeicon['marker_disco'].shadowSize = new GSize(43, 41);
	wheeicon['marker_disco'].iconAnchor = new GPoint(28, 29);
	wheeicon['marker_disco'].infoWindowAnchor = new GPoint(17, 3);

	wheeicon['marker_party'] = new GIcon();
	wheeicon['marker_party'].image = "http://www.whee.de/images/icons/marker_party.png";
	wheeicon['marker_party'].shadow = "http://www.whee.de/images/icons/marker_party_shadow.png";
	wheeicon['marker_party'].iconSize = new GSize(43, 41);
	wheeicon['marker_party'].shadowSize = new GSize(43, 41);
	wheeicon['marker_party'].iconAnchor = new GPoint(28, 29);
	wheeicon['marker_party'].infoWindowAnchor = new GPoint(17, 3);
}

function showRouteComplete(startlongitude, startLatitude, finishLongitude, finishLatitude)
{
	var start = new GLatLng(startLatitude, startlongitude);
	var ziel = new GLatLng(finishLatitude, finishLongitude);
	var wayPoints = new Array();
	wayPoints.push(start);
	wayPoints.push(ziel);
	directions.loadFromWaypoints(wayPoints);
}

var reentrant = 0;
var actLeft = 0;
var maxLeft = 0;
var stepWidth = 5;
var field = 5;
var direction = 'up';
var addLeft = false;
var images = new Array();

function goLeft()
{
	if (document.getElementById('imageList'))
	{
		var left = parseInt(document.getElementById('imageList').style.marginLeft);
		if (left < 0)
		{
			actLeft = left;
			maxLeft = left + 120;
			field = 'imageList';
			direction = 'up';
			addLeft = true;
			moveIt();
		}
	}
}

function loadImage(pos)
{
	pos = Math.abs(pos) + 2;
	var minPos = pos - 4;
	if (minPos < 1) minPos = 1;
	var maxPos = pos + 4;
	if (maxPos > images.length) maxPos = images.length;
	for (var i = minPos; i < maxPos; i++)
	{
		if (!document.getElementById('image_' + i).src) document.getElementById('image_' + i).src = images[i];
	}
}

function goRight()
{
	if (document.getElementById('imageList'))
	{
		var left = parseInt(document.getElementById('imageList').style.marginLeft);
		if (left > max)
		{
			actLeft = left;
			maxLeft = left - 120;
			field = 'imageList';
			direction = 'down';
			addLeft = true;
			moveIt();
		}
	}
}

function moveIt()
{
	if( ! reentrant )
	{
		reentrant = 1;
		var move = 0, element = document.getElementById(field);

		if (Math.abs(maxLeft - actLeft) > 110) stepWidth = 4;
		else if (Math.abs(maxLeft - actLeft) > 100) stepWidth = 4;
		else if (Math.abs(maxLeft - actLeft) > 90) stepWidth = 3.5;
		else if (Math.abs(maxLeft - actLeft) > 80) stepWidth = 3.5;
		else if (Math.abs(maxLeft - actLeft) > 70) stepWidth = 3;
		else if (Math.abs(maxLeft - actLeft) > 60) stepWidth = 3;
		else if (Math.abs(maxLeft - actLeft) > 50) stepWidth = 2.5;
		else if (Math.abs(maxLeft - actLeft) > 40) stepWidth = 2.5;
		else if (Math.abs(maxLeft - actLeft) > 30) stepWidth = 2;
		else if (Math.abs(maxLeft - actLeft) > 20) stepWidth = 1.5;
		else if (Math.abs(maxLeft - actLeft) > 10) stepWidth = 1;
		if( direction == 'up' )
		{
			if(actLeft < maxLeft )
			{
				if (addLeft == true && Math.abs(maxLeft - actLeft) > 90 && stepWidth == 3.5)
				{
					maxLeft = maxLeft + 20;
					if (maxLeft > 0) maxLeft = 0;
					stepWidth = 4;
				}
				actImage = Math.ceil(maxLeft / 120);
				maxLeft =  actImage * 120;
				actLeft += stepWidth;
				move++;
			}
		}
		else if( direction == 'down' )
		{
			if(actLeft > maxLeft )
			{
				if (addLeft == true && Math.abs(maxLeft - actLeft) > 90 && stepWidth == 3.5)
				{
					maxLeft = maxLeft - 20;
					if (maxLeft < max) maxLeft = max;
					stepWidth = 4;
				}
				actImage = Math.floor(maxLeft / 120);
				maxLeft =  actImage * 120;
				actLeft -= stepWidth;
				move++;
			}
		}
		if( move )
		{
			window.setTimeout( function(){ loadImage(actImage) }, 1 );
			element.style.marginLeft = actLeft + 'px';
			window.setTimeout( function(){ moveIt() }, 1 );
		}
		reentrant = 0;
	}
}

function stopMove()
{
	addLeft = false;
}

function showtopic()
{
	document.getElementById('topic').src = "/forum/icons/"+document.getElementById('smilie').options[document.getElementById('smilie').selectedIndex].value;
}

var http = null;
var IE = document.all?true:false
var BildX, BildY, moveable = 0, activeFriends = 0, posX = 100, posY = 100, disableSetFriends = 0, friendsVisible = 0;
var imgWidth = 0, imgHeight = 0, userID = 0, imageType = "", album = "", pic_id = "", active = 0, publisherName = '';
LinkedUsers = new Array();
tempUsers = new Array();

function createRequestObject() 
{
	var xmlhttp;
	try { xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); }
	catch(e) 
	{
		try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
		catch(f) { xmlhttp=null; }
	}
	if(!xmlhttp&&typeof XMLHttpRequest!="undefined") 
	{
		xmlhttp=new XMLHttpRequest();
	}
	return  xmlhttp;
}

function sendRequestTextGetAvatar(URL)
{
	if (http == null) http = createRequestObject();
	try{
		http.open('GET', URL);
		http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		http.onreadystatechange = handleResponseTextAvatar;
		http.send(null);
	}
	catch(e){}
	finally{}
}

function sendRequestTextGet(URL)
{
	if (http == null) http = createRequestObject();
	try{
		http.open('GET', URL);
		http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		http.onreadystatechange = handleResponseText;
		http.send(null);
	}
	catch(e){}
	finally{}
}

function sendRequestTextGetlinkedUser(URL)
{
	if (http == null) http = createRequestObject();
	try{
		http.open('GET', URL);
		http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		http.onreadystatechange = handleResponseTextlinkedUser;
		http.send(null);
	}
	catch(e){}
	finally{}
}

function handleResponseTextAvatar() 
{
	if (http == null) http = createRequestObject();
	try{
		if((http.readyState == 4)&& (http.status == 200)){
			var response = http.responseText;
			if (response != '')	document.getElementById("result").innerHTML = response;
		}
	}
	catch(e){}
	finally{}
}

function handleResponseText() 
{
	if (http == null) http = createRequestObject();
	try{
		if((http.readyState == 4)&& (http.status == 200)){
			var response = http.responseText;
			if (response != '')	document.getElementById("friends").innerHTML = response;
		}
	}
	catch(e){}
	finally{}
}

function handleResponseTextlinkedUser() 
{
	if (http == null) http = createRequestObject();
	try{
		if((http.readyState == 4)&& (http.status == 200)){
			var response = http.responseText;
			document.getElementById("linkUsers").innerHTML = response;
		}
	}
	catch(e){}
	finally{}
}

function startSetLinks()
{
	active = 1;
	showMarker();
	moveMarker();
	showAllFriends();
	document.getElementById('actionLink').href = 'javascript:stopSetLinks()';
	document.getElementById('actionLink').innerHTML = '<img border="0" src="/images/userlink-no.png" title="Verlinkung beenden" alt="Verlinkung beenden">&nbsp;Verlinkungsvorgang abschließen';
}

function stopSetLinks()
{
	active = 0;
	hideMarker();
	document.getElementById('actionLink').href = 'javascript:startSetLinks()';
	document.getElementById('actionLink').innerHTML = '<img src="/images/icons/link_add.png" alt="Verlinke deine Freunde" title="Verlinke deine Freunde">&nbsp;Personenlink hinzufügen';
}

function showMarker()
{
	moveable = 1;
	if (document.getElementById)
	{
		document.getElementById("infool").style.visibility = 'visible';
		document.getElementById("infool").style.display = 'block';
		document.getElementById("infoor").style.visibility = 'visible';
		document.getElementById("infoor").style.display = 'block';
		document.getElementById("infoul").style.visibility = 'visible';
		document.getElementById("infoul").style.display = 'block';
		document.getElementById("infour").style.visibility = 'visible';
		document.getElementById("infour").style.display = 'block';
	}
	else if (document.all)
	{
		document.all.infool.style.visibility = 'visible';
		document.all.infool.style.display = 'block';
		document.all.infoor.style.visibility = 'visible';
		document.all.infoor.style.display = 'block';
		document.all.infoul.style.visibility = 'visible';
		document.all.infoul.style.display = 'block';
		document.all.infour.style.visibility = 'visible';
		document.all.infour.style.display = 'block';
	}
}

function moveMarker()
{
	if (document.getElementById)
	{
		if (MouseX) document.getElementById("infool").style.left  = (MouseX - 20) + 'px';
		if (MouseY) document.getElementById("infool").style.top = (MouseY - 20) + 'px';
		if (MouseX) document.getElementById("infoor").style.left  = (MouseX + 10) + 'px';
		if (MouseY) document.getElementById("infoor").style.top = (MouseY - 20) + 'px';
		if (MouseX) document.getElementById("infoul").style.left  = (MouseX - 20) + 'px';
		if (MouseY) document.getElementById("infoul").style.top = (MouseY + 10) + 'px';
		if (MouseX) document.getElementById("infour").style.left  = (MouseX + 10) + 'px';
		if (MouseY) document.getElementById("infour").style.top = (MouseY + 10) + 'px';
	}
	else if (document.all)
	{
		if (MouseX) document.all.infool.style.left  = (MouseX - 20) + 'px';
		if (MouseY) document.all.infool.style.top = (MouseY - 20) + 'px';
		if (MouseX) document.all.infoor.style.left  = (MouseX + 10) + 'px';
		if (MouseY) document.all.infoor.style.top = (MouseY - 20) + 'px';
		if (MouseX) document.all.infoul.style.left  = (MouseX - 20) + 'px';
		if (MouseY) document.all.infoul.style.top = (MouseY + 10) + 'px';
		if (MouseX) document.all.infour.style.left  = (MouseX + 10) + 'px';
		if (MouseY) document.all.infour.style.top = (MouseY + 10) + 'px';
	}
}

function hideMarker() 
{
	moveable = 0;
	if (document.getElementById) {
		document.getElementById("infool").style.visibility = 'hidden';
		document.getElementById("infool").style.display = 'none';
		document.getElementById("infoor").style.visibility = 'hidden';
		document.getElementById("infoor").style.display = 'none';
		document.getElementById("infoul").style.visibility = 'hidden';
		document.getElementById("infoul").style.display = 'none';
		document.getElementById("infour").style.visibility = 'hidden';
		document.getElementById("infour").style.display = 'none';
	}
	else if (document.all)
	{
		document.all.infoul.style.visibility = 'hidden';
		document.all.infoul.style.display = 'none';
		document.all.infour.style.visibility = 'hidden';
		document.all.infour.style.display = 'none';
		document.all.infool.style.visibility = 'hidden';
		document.all.infool.style.display = 'none';
		document.all.infoor.style.visibility = 'hidden';
		document.all.infoor.style.display = 'none';
	}
}

function doAction()
{
	if (active == 1)
	{
		showFriends();
	}
	else
	{
		if (nextLink != '') window.location.href = nextLink;
	}
}

function filterFriends(search)
{
	sendRequestTextGet('linkUserOnPicsHandle.inc.php?method=list&imageType='+ imageType + "&album=" + album + "&pic_id=" + pic_id + "&search=" + search);
}

function showFriends()
{
	if (active == 1)
	{
		if (disableSetFriends == 0)
		{
			activeFriends = 1;
			sendRequestTextGet('linkUserOnPicsHandle.inc.php?method=list&imageType='+ imageType + "&album=" + album + "&pic_id=" + pic_id);
			if (document.getElementById)
			{
				document.getElementById("friendsBox").style.visibility = 'visible';
				document.getElementById("friendsBox").style.display = 'block';
				document.getElementById("friendsBox").style.left  = (MouseX + 40) + 'px';
				document.getElementById("friendsBox").style.top = MouseY + 'px';
			}
			else if (document.all)
			{
				document.all.friends.style.visibility = 'visible';
				document.all.friends.style.display = 'block';
				document.all.friends.style.left  = (MouseX + 40) + 'px';
				document.all.friends.style.top = MouseY + 'px';
			}
		}
	}
}

function hideFriends()
{
	activeFriends = 0;
	friendsVisible = 0;
	if (document.getElementById)
	{
		document.getElementById("friendsBox").style.visibility = 'hidden';
		document.getElementById("friendsBox").style.display = 'none';
		document.getElementById("friendsBox").style.left  = '1 px';
		document.getElementById("friendsBox").style.top = '1 px';
	}
	else if (document.all)
	{
		document.all.friends.style.visibility = 'hidden';
		document.all.friends.style.display = 'none';
		document.all.friends.style.left  = '1 px';
		document.all.friends.style.top = '1 px';
	}
}

function addFriend(id)
{	
	sendRequestTextGetlinkedUser('linkUserOnPicsHandle.inc.php?method=add&imageType='+ imageType + "&album=" + album + "&pic_id=" + pic_id + "&addID=" + id + "&posX=" + posX  + "&posY=" + posY);
	LinkedUsers[id] = new Array(id, posX, posY);
	//sendRequestTextGetlinkedUser('linkUserOnPicsHandle.inc.php?method=linkedUser&imageType="+ imageType + "&album=" + album + "&pic_id=" + pic_id);
	showAllFriends();
	hideFriends();
	moveMarker();
}

function deleteUser(id)
{
	Check = confirm("Willst du diesen Link wirklich entfernen?");
	if (Check == true)
	{
		sendRequestTextGetlinkedUser('linkUserOnPicsHandle.inc.php?method=delete&imageType='+ imageType + "&album=" + album + "&pic_id=" + pic_id + "&delID=" + id);
		for (var uid in LinkedUsers)
		{			
			if (uid.toString().search(/^-?[0-9]+$/) == 0)
			{				
				if (uid != id) tempUsers[uid] = LinkedUsers[uid];
			}
		}
		LinkedUsers = tempUsers;
		//sendRequestTextGetlinkedUser('linkUserOnPicsHandle.inc.php?method=linkedUser&imageType="+ imageType + "&album=" + album + "&pic_id=" + pic_id);
		showAllFriends();
		hideFriends();
	}
}

function setAllVisible()
{
	showAllFriends();
}

function setAllHidden()
{
	document.getElementById('bildkoord').innerHTML = '';
	document.getElementById('actionLinkVisibility').href = 'javascript:showAllFriends()';
	document.getElementById('actionLinkVisibility').innerHTML = '<img src="/images/icons/picture_link.png" alt="Verlinkungen anzeigen" title="Verlinkungen anzeigen">&nbsp;Verlinkungen anzeigen';
	friendsVisible = 0;
}

function showAllFriends()
{
	friendsVisible = 1;		
	var text = '<div id="infoText" class="userLinksInfobox" style="postion: absolute; visibility: hidden; display: none;"></div>';
	if (LinkedUsers.length > 0)
	{		
		for (var i in LinkedUsers)
		{				
			if (i.toString().search(/^-?[0-9]+$/) == 0)
			{				
				if (active == 0) text += "<a href='userdetail,id," + LinkedUsers[i][0] + ".html' style='position: absolute; left: " + (LinkedUsers[i][1] - 20) + "px; top: " + (LinkedUsers[i][2] - 20) + "px;z-index: 99;'><img src='images/userIconbg.gif' onmouseout='hideDetails(" + LinkedUsers[i][0] + ")' onMouseOver='showDetails(" + LinkedUsers[i][0] + ")' style='border: 0px'></a>";
				else text += "<img src='images/userIconbg.gif' onmouseout='hideDetails(" + LinkedUsers[i][0] + ")' onMouseOver='showDetails(" + LinkedUsers[i][0] + ")' style='position: absolute; left: " + (LinkedUsers[i][1] - 20) + "px; top: " + (LinkedUsers[i][2] - 20) + "px;z-index: 99;border: 0px'>";
					text += "<img src='images/userIconol.gif' id='" + LinkedUsers[i][0] + "_ol' style='position: absolute; left: " + (LinkedUsers[i][1] - 15) + "px; top: " + (LinkedUsers[i][2] - 15) + "px;'>";
					text += "<img src='images/userIconor.gif' id='" + LinkedUsers[i][0] + "_or' style='position: absolute; left: " + (LinkedUsers[i][1] + 5) + "px; top: " + (LinkedUsers[i][2] - 15) + "px;'>";
					text += "<img src='images/userIconul.gif' id='" + LinkedUsers[i][0] + "_ul' style='position: absolute; left: " + (LinkedUsers[i][1] - 15) + "px; top: " + (LinkedUsers[i][2] + 5) + "px;'>";
					text += "<img src='images/userIconur.gif' id='" + LinkedUsers[i][0] + "_ur' style='position: absolute; left: " + (LinkedUsers[i][1] + 5) + "px; top: " + (LinkedUsers[i][2] + 5) + "px;'>";
			}
		}	
	}
	document.getElementById('bildkoord').innerHTML = text;
	document.getElementById('actionLinkVisibility').href = 'javascript:setAllHidden()';
	document.getElementById('actionLinkVisibility').innerHTML = '<img src="/images/icons/picture.png" alt="Verlinkungen ausblenden" title="Verlinkungen ausblenden">&nbsp;Verlinkungen ausblenden';
}

function showDetails(id)
{
	if (friendsVisible == 0)
	{
		showAllFriends();
	}
	if (typeof LinkedUsers[id] != "undefined" && LinkedUsers[id][0] > 0)
	{
		disableSetFriends = 1;
		document.getElementById(id + "_ol").style.left = LinkedUsers[id][1] - 20 + "px";
		document.getElementById(id + "_ol").style.top = LinkedUsers[id][2] - 20 + "px";
		document.getElementById(id + "_or").style.left = LinkedUsers[id][1] + 10 + "px";
		document.getElementById(id + "_or").style.top = LinkedUsers[id][2] - 20 + "px";
		document.getElementById(id + "_ul").style.left = LinkedUsers[id][1] - 20 + "px";
		document.getElementById(id + "_ul").style.top = LinkedUsers[id][2] + 10 + "px";
		document.getElementById(id + "_ur").style.left = LinkedUsers[id][1] + 10 + "px";
		document.getElementById(id + "_ur").style.top = LinkedUsers[id][2] + 10 + "px";
		document.getElementById('infoText').style.visibility = 'visible';
		document.getElementById('infoText').style.display = 'block';
		document.getElementById('infoText').style.left = LinkedUsers[id][1] + 20 + "px";
		document.getElementById('infoText').style.top = LinkedUsers[id][2] + 20 + "px";
		document.getElementById('infoText').style.position = 'absolute';
		document.getElementById('infoText').innerHTML = document.getElementById('details_' + id).innerHTML;
	}
}

function hideDetails(id)
{
	if (typeof LinkedUsers[id] != "undefined" && LinkedUsers[id][0] > 0)
	{
		disableSetFriends = 0;
		document.getElementById(id + "_ol").style.left = LinkedUsers[id][1] - 15 + "px";
		document.getElementById(id + "_ol").style.top = LinkedUsers[id][2] - 15 + "px";
		document.getElementById(id + "_or").style.left = LinkedUsers[id][1] + 5 + "px";
		document.getElementById(id + "_or").style.top = LinkedUsers[id][2] - 15 + "px";
		document.getElementById(id + "_ul").style.left = LinkedUsers[id][1] - 15 + "px";
		document.getElementById(id + "_ul").style.top = LinkedUsers[id][2] + 5 + "px";
		document.getElementById(id + "_ur").style.left = LinkedUsers[id][1] + 5 + "px";
		document.getElementById(id + "_ur").style.top = LinkedUsers[id][2] + 5 + "px";
		document.getElementById('infoText').style.visibility = 'hidden';
		document.getElementById('infoText').style.display = 'none';
		document.getElementById('infoText').innerHTML = '';
	}
}

function getMouseX(evt) 
{
	if (evt && evt.offsetY) 
	{
		return evt.offsetX;
	} 
	else 
	{
		var obj = getEventObject( evt );
		if ( !obj.pageLeft )
		setPageTopLeft( obj );
		scrollPos = 0;
		if (typeof window.pageXOffset != 'undefined') {
		   scrollPos = window.pageXOffset;
		}
		else if (typeof document.compatMode != 'undefined' &&
		     document.compatMode != 'BackCompat') {
		   scrollPos = document.documentElement.scrollLeft;
		}
		else if (typeof document.body != 'undefined') {
		   scrollPos = document.body.scrollLeft;
		}
		return (evt.clientX - obj.pageLeft + scrollPos);
	}
}

function getMouseY(evt) 
{
	if (evt && evt.offsetY) 
	{
		return evt.offsetY;
	} 
	else 
	{
		var obj = getEventObject( evt );
		if ( !obj.pageTop )
		setPageTopLeft( obj );	
		scrollPos = 0;	
		if (typeof window.pageYOffset != 'undefined') {
		   scrollPos = window.pageYOffset;
		}
		else if (typeof document.compatMode != 'undefined' &&
		     document.compatMode != 'BackCompat') {
		   scrollPos = document.documentElement.scrollTop;
		}
		else if (typeof document.body != 'undefined') {
		   scrollPos = document.body.scrollTop;
		}
		return (evt.clientY - obj.pageTop + scrollPos);
	}
}

function setPageTopLeft( o )
{
	var top = 0,
	left = 0,
	obj = (typeof o == "string") ? document.getElementById(o) : o,
	body = document.getElementsByTagName('body')[0];

	while ( o.offsetParent && o != body)
	{
		left += o.offsetLeft ;
		top += o.offsetTop ;
		o = o.offsetParent ;
	};

	obj.pageTop = top;
	obj.pageLeft = left;
}

function getEventObject( e )
{
	return e.target || e.srcElement;
}

function mouseX(evt)
{
	if (evt.pageX) return evt.pageX;
	else if (evt.clientX)
	return evt.clientX + (document.documentElement.scrollLeft ?
	document.documentElement.scrollLeft :
	document.body.scrollLeft);
	else return null;
}

function mouseY(evt)
{	
	if (evt.pageY) return evt.pageY;
	else if (evt.clientY)	return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop :	document.body.scrollTop);
	else return null;
}

function getPosition(evt)
{
	if (!evt)
	evt = window.event;
	MouseX = mouseX(evt);
	MouseY = mouseY(evt);	
}