hiddenImg = new Image();
hiddenImg.src = "/chat/img/loading19.gif";

function getShort()
{
	$.post('/chat/getMessage.php', {method:'show'}, function(data){
															  $('#shortMess').hide().html(data.text).fadeIn(500);
															  }, 'json');
}

function getShortAdd()
{
	$('#loading2').html('<img src="/chat/img/loading19.gif" class="im2">');	
	$.post('/chat/getMessage.php', {method:'add', text:$('#stext').val()}, function(data){
																					
		$('#loading2').html('<img src="/chat/img/say.gif" class="i2" title="Крикнуть" onClick="getShortAdd();" style="cursor:pointer">');	
		if(data.error == null)
		{
			$('#stext').val('');
			getShort();
		}
		else alert(data.error);
	}, 'json');
}

function insSmile(id)
{
	$('#stext').val($('#stext').val()+'[smile=' + id + ']');
}

function refreshShort()
{
	$('#refr').html('<img src="/chat/img/loading19.gif" class="im2">');
	$.post('/chat/getMessage.php', {method:'show'}, function(data){
				 $('#refr').html('<img src="/chat/img/ref.png" class="im2" title="Обновить чат" onClick="refreshShort();" style="cursor:pointer">');
				  $('#shortMess').hide().html(data.text).fadeIn(500);
				  }, 'json');
}
