/**
 * @author - deepakb
 * @created on - 24th Dec 2009 at 7:11 PM
 * @Purpose - For handling Influential Fans functionality
 */

function getNews(baseUrl){
	$('#loader_result').show();
	$('#news').html();
	$('#paginate-top').html();
	$('#paginate-bottom').html();
	$.post(baseUrl+'/ajax/getnews',
    {
    	type:'total'
    },function(result){
    	if(result.trim() == "norec"){
    		$('#loader_result').hide();
    		$('#noSearchReasult').show();
    		$('#noSearchReasult').html('No published news available for now');
    	}else{
    		$('#loader_result').hide();
    		$('#noSearchReasult').hide();
	    	var pageArr = new Array();
	    	for(var i = 0;i < result;i++){
	    		pageArr[i] = baseUrl + '/ajax/getnews?pg=' + (i + 1);
	    	}
	    	var searchData = {
	    			pages: pageArr,
	    			selectedpage: 0
    			}
	    	var mybookinstance=new ajaxpageclass.createBook(searchData, "news", ["paginate-top", "paginate-bottom"]);
    	}
    });
	
}

function showNews(id){
	$('#full_news_'+id).show();
	$('#hide_'+id).show();
	$('#some_news_'+id).hide();
	$('#read_'+id).hide();
}

function hideNews(id){
	$('#full_news_'+id).hide();
	$('#hide_'+id).hide();
	$('#some_news_'+id).show();
	$('#read_'+id).show();
}


