$(document).ready(function(){ 
	window.setInterval(function () {
                GetData()}, 30000); 
 
});
function GetData(){//取值方法,参数i表示页数
	$.ajax(
			{
				type: "GET",
				url: "enjoyajax.php?type=3&d="+new Date(), dataType:"xmlDocument" ,
				success: function(msg){
					document.getElementById('px').innerHTML=msg;	
				} 
			}
		);
}
function chPage(type,page)
	{	
		$.ajax(
			{
				type: "GET",
				url: "enjoy_sort.php?page="+page+"&sort="+type+'&d='+new Date(), dataType:"xmlDocument" ,
				success: function(msg){
					//alert(msg);
					document.getElementById('listsort').innerHTML=msg;	
						
				} 
			}
		);
	}
function changpx(num){
	if(num==1){//按上传排序
		$("#one").addClass('on');
		$("#two").removeClass();
		$.ajax(
			{
				type: "GET",
				url: "enjoy_sort.php?sort=1&stype=1&d="+new Date(), dataType:"xmlDocument" ,
				success: function(msg){
					//alert(msg);
					document.getElementById('listsort').innerHTML=msg;	
				} 
			}
		);
		
	}else{//按关注排序
		$("#two").addClass('on');
		$("#one").removeClass();
		$.ajax(
			{
				type: "GET",
				url: "enjoy_sort.php?sort=2&stype=2&d="+new Date(), dataType:"xmlDocument" ,
				success: function(msg){
					//alert(msg);
					document.getElementById('listsort').innerHTML=msg;	
				} 
			}
		);
	}
}