$(function() 
{
$('.more').live("click",function() {

var string = $(this).attr("id").split("_");
var order = string[0];
var ID = string[1];
var cat = $(this).attr("cat");

if(ID)
{
	$("#more"+ID).html('<img src="/images/ajax-loader.gif" />');
	
	$.ajax({
	type: "POST",
		url: "lib/more.php",
		data: "lastmsg="+ ID + "&cat="+cat+"&order="+order, 
		cache: false,
		success: function(html){
			$("#costslaw"+cat).append(html);
			$("#more"+order+"_"+ID).remove(); // removing old more button
		}
	});
} else {
	$("#costslaw"+cat+" .morebox").html('The End');// no results
}

return false;
});
});

