$(function() {
	$("#home .next").live("click",function() {
		loadHomeNews(this.href);
		return false;
	})
	
	$("#home .previous").live("click",function() {
		loadHomeNews(this.href);
		return false;
	});
	
	$("#home .pager a").live("click",function() {
		loadHomeNews(this.href);
		return false;
	});
	
	
	$("#home .detail").live("click",function() {
		// Scroll To news
		$.scrollTo("#web #pages #section_news", 1000, {easing:'easeInOutExpo'});
		
		//Load New
		loadNews(this.href)
		
		return false;
	});
	
	
	$("#home .nextEvent, #home .nextEvent a").live("click",function() {
		// Scroll To news
		$(this).css({cursor:'pointer'});
		$.scrollTo("#web #pages #section_events", 1000, {easing:'easeInOutExpo'});
		
		//Load New
		//loadNews(this.href)
		
		return false;
	});
	
})


function loadHomeNews(href) {
	$("#home .newsContainer").fadeOut("normal",function() {	
		$.ajax({
			url: href,
			type: 'GET',
			dataType: 'json',
			data: {
				json : 1,
				selector : '#home .newsContainer'
			},
			success: function (res) {			
				$("#home .newsContainer").html(res.html);
				$("#home .newsContainer").fadeIn("normal");
			}
		
		})
	})
	
	
	
}

