   
$(function(){
	var maopao = [];
	var mplist = "";
	//低分辨率处理
	if($(window).width() < 1024){
		$("body").css("background", "#fff");
		$(".ipadwarp").css("border", "none");
		$(".ipadwarp").css("margin", "0 20px");
		$(".indexwarp").css("border", "none");
		$(".indexwarp").css("margin", "0");
		$(".ltop").remove();
		$(".rtop").remove();
		$(".lbot").remove();
		$(".rbot").remove();
		$(".ipadbtn").remove();
	} else {
		$(window).scrollTop(100);
	}
	
	$.getJSON("indexdata",function(json){
		maopao = json.list;
		for(i=0; i<maopao.length; i++) {
			//mplist += "<li><a href='userIndex?uid="+maopao[i].uid+"' target='_blank'><img src='"+maopao[i].photourl+"' alt='"+maopao[i].shout+"'></a></li>\n";
			//mplist += "<li style='cursor:pointer;background:url("+maopao[i].photourl+") no-repeat center' onclick='window.location=\"userIndex?uid="+maopao[i].uid+"\"'></li>\n";
			mplist += "<li style='cursor:pointer;background:url("+maopao[i].photourl+") no-repeat center' onclick='window.location=\"getTopPopularsPage?page="+maopao[i].Id+"\"'></li>\n";
		}
		$(mplist).appendTo($("<ul/>").appendTo($(".maopao")));

		$(".maopao li").live("mouseenter", function(e){
				e.stopPropagation();
				$("ul li").find("p").remove();
				var text = "";
				if(maopao[$(this).index()].shout == ""){
					text = maopao[$(this).index()].name;
				} else {
					text = maopao[$(this).index()].name + "：" + maopao[$(this).index()].shout;
				}
				$("<p/>")
				.css("filter", "alpha(opacity=80)")
				.html(emoji_ajax(text))
				.appendTo($(this)).animate({height:60}, 200);
			}
		);
		$(".left").bind("click", function(){
			$(".maopao ul").animate({left:0}, 500);
			$(".prev").css("background", "url(img/point-index.gif) no-repeat left center");
			$(".next").css("background", "url(img/point-index.gif) no-repeat right center");
		});
		$(".right").bind("click", function(){
			$(".maopao ul").animate({left:"-840px"}, 500);
			$(".prev").css("background", "url(img/point-index.gif) no-repeat right center");
			$(".next").css("background", "url(img/point-index.gif) no-repeat left center");
		});
		$(".prev").live("click", function(){
			$(".maopao ul").animate({left:0}, 500);
			$(this).css("background", "url(img/point-index.gif) no-repeat left center");
			$(this).next().css("background", "url(img/point-index.gif) no-repeat right center");
		});
		$(".next").live("click", function(){
			$(".maopao ul").animate({left:"-840px"}, 500);
			$(this).css("background", "url(img/point-index.gif) no-repeat left center");
			$(this).prev().css("background", "url(img/point-index.gif) no-repeat right center");
		});
	});
});

