Array.prototype.remove = function(from, to) {
  var rest = this.slice((to || from) + 1 || this.length);
  this.length = from < 0 ? this.length + from : from;
  return this.push.apply(this, rest);
};

function updatePagination(id,resultsLength, offset, resultsPerPage, num_display_entries,callback_function) {
	$("#"+id).pagination(resultsLength, {
		current_page: offset/resultsPerPage,
		items_per_page: resultsPerPage,
		num_display_entries: num_display_entries, 
		callback:eval(callback_function)
	});	
	(resultsLength < resultsPerPage ) ?	$("#"+id).hide() : $("#"+id).show();
}

function changeLocale(lang) {
	var url = "locale.do?";		
	$.get(url,{lang: lang}, function() {
		window.location.reload( true);
	});
}
