function nl2br (str)
{
	return (str + '').replace(/(\\)/g, "").replace(/(\r\n|\n\r|\r|\n)/g, "<br />");
}

function doAjax(liveDataFunction,successCallback,str)
{
	if (liveDataFunction)
	{
		$.ajax(
			{
				type:		"POST",
				url:		"/index.php/liveData/"+liveDataFunction,
				data:		str,
				dataType:	"json",
				success:	function(Response)
							{
								if(successCallback != null)
								{
									if (Response.error_code < 0)
									{
										alert("log out");
										location.href = "/index.php/auth/logout";
									}
									else
									{
										successCallback(Response);
									}
								}
								else
								{
									alert(Response);
								}
							},
				error:		function(Response)
							{
								alert("SERVER ERROR - " + Response);
							}
				});
	}
}


