! function() {
	var layout = $('#serverList'),
		l = function(selector) {
			return layout.find(selector);
		},
		list = l('.list'),
		servers = { 
		    "服务器1": "115.29.171.41:804",
		    "服务器2": "222.73.4.229:8008",
		    "服务器3": "183.129.178.76:408",
		    "服务器4": "115.29.171.41:408",
		    "服务器5": "180.153.88.60",
		    "服务器6": "115.29.171.41:480",
		    "服务器7": "183.129.178.76:804",
		    "服务器8": "112.124.53.91"
		},
		template = list.html();

	list.empty();

	if(!template){
		$('div#serverList .list').css({
			'margin-right': 20
		}).html('您安装的“瑞星杀毒软件”改变了系统设置，导致开店软件不能正常运行。<br />解决办法：卸载“瑞星杀毒软件”，重启电脑。 ');
		return;
	}

	$.ajax({
		url: 'http://112.124.53.91/serverxxx.html',
		dataType: 'json',
		timeout: 2000,
		cache: false,
		success: function(oServers){
			servers = oServers;
		},
		complete: function(){
			var debugServers = $.map(getFields({
					ip: 2,
					name: 1
				}, Fso.read('debug_v2.pur5'), /ip\:([^:]+):(\S+)/g), function(item, index) {
					servers[item.name] = item.ip;
				});

				var tempArr = [];
				$.each(servers, function(name, host) {
					tempArr.push(
					template
						.replace(/src=""/g, 'src="http://$host/images/regbg2.gif?$timer"')
						.replace(/\$hostName/g, name)
						.replace(/\$host/g, host)
						.replace(/\$timer/g, new Date().getTime()))
				});

				var timer = new Date().getTime(),flag=true,clickTimer;
				list.html(tempArr.join(''))
					.find('li')
					.click(function() {
					var Li = $(this);
					//if(Li.attr('class')){
					Dwd.host = Li.find('.host').text();
					$('.splash_version').append(' -' + Li.find('.hostName').text());
					$('#main .loginHostName').text(Li.find('.hostName').text());
					Login.layoutIn();
					window.Login && clickTimer && clearTimeout(clickTimer);
					//}
				}).
					hover(function(){
						$(this).addClass("on").siblings("").removeClass("on");
					})
				.find('img').load(function() {
					var Img = $(this),
						$li = Img.parent(),
						$speed = $li.find(".speed"),
						timerDiff = new Date().getTime() - timer;
					if (timerDiff <= 500) {
						speedClass = 'fast';
					} else if (timerDiff > 500 && timerDiff < 2000) {
						speedClass = 'normal';
					} else {
						speedClass = 'slow';
					}
					$speed.addClass(speedClass);
					if(flag){
						flag=false;
						$li.addClass("on");
						clickTimer=setTimeout(function(){
							$li.trigger("click");
						},10000);
					}
					
				})
				.bind('error', function() {
					var Img = $(this),
						$li = Img.parent(),
						$speed = $li.find(".speed");
					$speed.addClass("slow");
				});

				setTimeout(function() {
					var LoginInfo = User.getLoginInfo();
					if (!LoginInfo || !LoginInfo.autologin) return;

					var autoLoginTimer = setInterval(function() {
						if (window.Login) {
							clearInterval(autoLoginTimer);
							$('.host:contains(' + LoginInfo.host + ')').parents('li').click();
						}
					}, 10);
				}, 0);							
		}
	});	
}();