<!--
	var privateLogArray = new Array();

	function openPrivate(recipient)
	{
		var width = 400;
		var height = 500;
		var url="/index.php/module/Private/action/Popup/recipient/"+recipient;

		var posX = Math.round((screen.width - width) / 2);
		var posY = Math.round((screen.height - height) / 2);

		posCode = (document.all)? ",left="+posX+",top="+posY : ",screenX="+posX+",screenY="+posY;
		privateWindow = window.open(url,"private_"+recipient,"width="+width+",height="+height+"menubar=no,toolbar=no,scrollbars=no,status=no"+posCode);
		privateWindow.focus();
	}

	var recipientNickname;
	var lastId;

	function clearInputline()
	{
		inputLine = document.getElementById('message_input');
		inputLine.value='';
	}

	function setLastId(id)
	{
		lastId = id;
	}

	function setRecipientOnline()
	{
		var recipientStatusDiv = document.getElementById('recipient_status');
		recipientStatusDiv.innerHTML = '<font color=green>[ online ]</font>';
	}

	function setRecipientOffline()
	{
		var recipientStatusDiv = document.getElementById('recipient_status');
		recipientStatusDiv.innerHTML = '<font color=red>[ offline ]</font>';
	}

	function privateInitialize(nick)
	{
		recipientNickname=nick;
		updateLog();
	}

	function updateLog()
	{
		xajax_getLog(recipientNickname, lastId);
		setTimeout('updateLog();',5000);
	}

	function addToLog(id,nick,message)
	{
		var logDiv = document.getElementById('log');

		if (privateLogArray.length >= 15)
			privateLogArray.shift();

		setLastId(id);
		privateLogArray[privateLogArray.length] = new Array(nick, message);
	}

	function redrawLog(nick)
	{
		var logDiv = document.getElementById('log');

		resultHtml = '';
		for (var i = 0; i < privateLogArray.length; i++)
		{
			if (nick == privateLogArray[i][0])
				color = '#808080';
			else
				color = '#000000';
				
			resultHtml += '<font color='+color+'><b>'+privateLogArray[i][0]+'</b>: '+privateLogArray[i][1]+'</font><br>';
		}

		logDiv.innerHTML = resultHtml;
        logDiv.scrollTop = logDiv.scrollHeight;	
	}

///////////////////////////////////////
	function updateNewMessageNotificator()
	{
		xajax_checkNewMessages();
		setTimeout('updateNewMessageNotificator();',36000);
//		setTimeout('updateNewMessageNotificator();',60000);
	}

	function privateSetNewMessageNotificator(status)
	{
		var notificator = document.getElementById('notificator');
		notificator.className="notificator_"+status;
		if (status == "on")
		{
			url = '';
			url = notificator.getAttribute('notificator_url');
			if (url)
			{
				gWindow = window.open(url, 'notificator', "menubar=no; scrollbars=yes,status=no,width=640,height=480,top=100,left=100")			
				//if (gWindow)
				//	gWindow.focus();			
			}		
		}		
	}
// -->
