if(!window.News){
	Processing.addIgnoredURL("/news/list.action");
	
	window.News = {

		fetchingNews: false,

		listPrevious: function(){
			if(this.fetchingNews) return;

			this.fetchingNews = true;
			var ts = ($("lastNewsLoadedTimestamp") != null ? $("lastNewsLoadedTimestamp").innerHTML : "").strip();
			new Ajax.Request(window.contextPath+"/news/list.action", {
				parameters:{ timestamp: ts },
				onComplete: function(response){
					if(!Consulte.hasError(response)){
						var html = (response.responseText||"").strip();
						if(String.isNotEmpty(html)){
							$("listPreviousContainer").remove();
							$("listContainer").insert(html);
						}else if($("listPreviousContainer") != null){
							$("listPreviousContainer").remove();
						}
					}
					this.fetchingNews = false;
				}.bind(this)
			});
		},

		detail: function(newsId){
			if($("news"+newsId).select(".newsBody").first().visible()){
				$("news"+newsId).select(".newsBody").first().hide();
			}else{
				$$(".newsBody").each(Element.hide);
				$("news"+newsId).select(".newsBody").each(Element.show);
				(function(){ $("content").select("div").first().hide().show(); }).defer();
			}
		}
	};
}

