//获取公告信息列表
function getNoticeList(page) {
    var pageSize = 8, notictHTML = "";
    page = page || 1;
    $("#noticeList, #noticePage").empty();
    ajax("ajax_notice_list.do", {"status":2, "pageNo" : page,"pageSize" : pageSize}, function(res){
        if (res.code==1 && res.list.length > 0){
            $.each(res.list, function(index, item){
                notictHTML += '<li><a href="to_notice_detail.do?id='+item.id+'" target="_blank">'+item.title+'</a></li>';
            });
            $("#noticeList").html(notictHTML);
            var newpage = new createPage(res.count, page, pageSize, 3, 'noticeGO');
            $("#noticePage").html(newpage.pageHtml);
        }
    });
}
noticeGO = getNoticeList;

//获取媒体排行信息列表
function getMediaRankList() {
	var mediaType = $("#recomTabs>.button.active").index(), cityType = $("input[name='cityType']:checked").val(), html = "";
    ajax("ajaxSearchNewAdRankInfoList.do", {"mediaType":mediaType, "cityType":cityType}, function(res){
        if (res.code == 1 && res.list.length > 0){
            $.each(res.list, function(index, item){
                if(mediaType > 2){
                	html += '<tr>\n\
                        <td>'+item.name.toNull()+'</td>\n\
                        <td>'+item.netPlatform.toNull()+'</td>\n\
                        <td>'+item.dailyInsactivity+'</td>\n\
                        <td>'+item.rank+'</td>\n\
                        </tr>';
                }else{
                	html += '<tr>\n\
                        <td>'+item.rank+'</td>';
                        if(mediaType > 0) html+='<td>'+item.name.toNull()+'</td>';
                        html+='<td>'+item.channel.toNull()+'</td>\n\
                        <td>'+item.audienceRate+'</td>\n\
                        <td>'+item.audienceShare+'</td>\n\
                        </tr>';
                }
                $(".table").hoverTable(true,true);
            });
            if(mediaType > 2){
            	$("#mediaList2").html(html);
            }else{
            	$("#mediaList").html(html);
            	if(mediaType == parseInt(0)){
                	$("#mediaTable th:eq(1)").addClass("contentTxt");
    			}else{
    				$("#mediaTable th:eq(1)").removeClass("contentTxt");
    			}
            }
        }else{
        	$(mediaType > 2 ? "#mediaList2":"#mediaList").info("暂无信息。");
        }
    });
}