$(document).ready(function(){
	updateNewsPaginationLinks();
	updateEventsPaginationLinks();
});

function getNewsContents(path) {
	$.ajax({
		type: "GET",
		url: path,
		success: function(msg){
			$("#more_news_inner").html(msg);
			updateNewsPaginationLinks();
	  }
	});
	
	return false;
}

function getEventsContents(path) {
	$.ajax({
		type: "GET",
		url: path,
		success: function(msg){
			$("#more_events_inner").html(msg);
			updateEventsPaginationLinks();
	  }
	});
	
	return false;
}

function updateNewsPaginationLinks() {
	$("a.news_pagination").click(function(){ return getNewsContents(this.href); } );
}

function updateEventsPaginationLinks() {
	$("a.events_pagination").click(function(){ return getEventsContents(this.href); } );
}
