$(function(){
	$('.list-item').click(function(){
		var data = $(this).attr('data');
		waiting();
		var id,url;
		if(typeof(data) == 'object'){
			id = data.id;
			url = data.url;
		}else{
			var json = eval('('+data+')');
			id = json.id;
			url = json.url;
		}
		if(url==''){
			window.location.href=ctx+"/cmsg/getmsg/"+id;
		}else{
			window.location.href=url;
		}
	});
	$('#pre').click(function(){
		var getPage = page-1;
		if(getPage<1){
			getPage=1;
		}
		if(getPage!=page){
			window.location.href=ctx+"/cmsg/getmsglist?openid="+openid+"&communityId="+communityId+"&buildId="+buildId+"&cellId="+cellId+"&page="+getPage;
		}
	});
	$('#next').click(function(){
		var getPage = page+1;
		if(getPage>total){
			getPage=total;
		}
		if(getPage!=page){
			window.location.href=ctx+"/cmsg/getmsglist?openid="+openid+"&communityId="+communityId+"&buildId="+buildId+"&cellId="+cellId+"&page="+getPage;
		}
	});
});