function serverNext(gameid,count){
	var serverlist = $('#serverlist'+gameid+' dl');
	var size = serverlist.size();
	var prev = $('#serverlist'+gameid).parent().find('div[class="left"]');
	var nest = $('#serverlist'+gameid).parent().find('div[class="right"]');
	if(size < count){
		$.each(serverlist,function(i){ 
			if($(this).css('display') == 'block'){
				var k = i+1;
				var t = i+2;
				serverlist.hide();
				if($('#serverlist'+gameid).find('dl[class="list'+t+'"]').length>0){
					$('#serverlist'+gameid).find('dl[class="list'+t+'"]').show();
				}else{
					$('#serverlist'+gameid).append('<dl class="list'+t+'"></dl>');
					$.ajax({
						url: '/site/getServerList.html?id='+gameid+'&page='+t,
						success:function(html){
							$('#serverlist'+gameid).find('dl[class="list'+t+'"]').html(html);
						}
					});
				}
				prev.show();
				if(t == count){
					nest.hide();
				}
				return false;
			}
		});		
	}else{
		$.each(serverlist,function(i){
			if($(this).css('display') == 'block'){
				var k = i+2; 
				serverlist.hide();
				$('#serverlist'+gameid).find('dl[class="list'+k+'"]').show();
				prev.show();
				if(k == count){
					nest.hide();
				}
				return false;
			}
		});
	}
}

function serverPrev(gameid,count){
	var serverlist = $('#serverlist'+gameid+' dl');
	var size = serverlist.size();
	var prev = $('#serverlist'+gameid).parent().find('div[class="left"]');
	var nest = $('#serverlist'+gameid).parent().find('div[class="right"]');
	$.each(serverlist,function(i){
		if($(this).css('display') == 'block'){
			serverlist.hide();
			$(this).prev().show();
			nest.show();
			if(i == 1){
				prev.hide();
			}
			return false;
		}
	});
}
