	function sendResponse(pars, _id)
	{
	/*	if (Ajax.activeRequestCount > 0) {
			return;
		}	*/

		var url = '/ajax/';
		
		if (_id) {
			var curPos = Position.cumulativeOffset($(_id));
			if ($('systemWorking'))
			{
				$('systemWorking').style.top = curPos[1] - 5; 
				$('systemWorking').style.left = curPos[0] + 20;
				Element.show('systemWorking');
			}
		}
		
		var myAjax = new Ajax.Request(
			url, 
			{
				method: 'post', 
				parameters: pars, 
				onComplete: showResponse,
				evalScripts: true
			});
	}
	
	function showResponse(originalRequest)
	{
		try {
			eval(originalRequest.responseText)
		}
		catch(e) {
			alert (e);
		};
		if ($('systemWorking'))
			Element.hide('systemWorking');
	}
	

	function changeStatus(contact_type, value, user_id)
	{
//		alert (contact_type+' - '+value+'_'+user_id);
		var no_cache = Math.random();	

		var pars = 'action=contact_type'+'&contact_type='+contact_type+'&value='+value+'&user_id='+user_id+'&no_cache='+no_cache;
		if (pars) sendResponse(pars, user_id+'_'+contact_type+'_'+value);
	}
	
	function changeMessageActivity(value, message_id)
	{
		var no_cache = Math.random();	

		var pars = 'action=activate_message'+'&value='+value+'&message_id='+message_id+'&no_cache='+no_cache;
		if (pars) sendResponse(pars, message_id+'_active_'+value);
	}
	
	function checkIPM()
	{
		var no_cache = Math.random();	
//alert (no_cache);
		var pars = 'action=checkIPM&no_cache='+no_cache;
		if (pars) sendResponse(pars, 0);
	}
	
	function checkChat(room_id)
	{
		var no_cache = Math.random();	

		var pars = 'action=checkChat&room_id='+room_id+'&no_cache='+no_cache;
		if (pars) sendResponse(pars, 0);
	}
	
	function checkSendChat(room_id, message, param)
	{
		var no_cache = Math.random();	

		var pars = 'action=checkSendChat&room_id='+room_id+'&message='+message+'&no_cache='+no_cache+param;
		
		//alert (pars);
		if (pars) sendResponse(pars, 0);
	}
	
	function checkChatRoomUsers()
	{
		var no_cache = Math.random();	

		var pars = 'action=checkChatRoomUsers&room_id='+room_id+'&no_cache='+no_cache;
		if (pars) sendResponse(pars, 0);
	}
	
	
	function checkChatClose(room_id)
	{
		var no_cache = Math.random();	

		var pars = 'action=checkChatClose&room_id='+room_id+'&no_cache='+no_cache;
		if (pars) sendResponse(pars, 0);
	}
	
	