var gameidsed = '';
var carrieridsed = '';
var groupidsed = '';
var serveridsed = '';
var gtidsed = '';
var gameinfo = {};
var gameList = {};
var gameListArr = [];
var gametype='0';
var mobilegametype ='0';

function changeSelected(num) {
	var _num = Math.abs(num - 1);
	$('#mynav' + _num).removeClass('nav_on');
	$('#mynav' + _num).addClass('nav_off');
	$('#mynav' + num).removeClass('nav_off');
	$('#mynav' + num).addClass('nav_on');
	$('#qhcon' + _num).hide();
	$('#qhcon' + num).show();
}

function save_game(){
	gameidsed = $('#span_search_game').attr('gameid');
	$.each(allgames, function(i, item) {
		if (item.gameid == gameidsed) {
			gameList = item;
			return false;
		}
	});
}

function loadCarriersGroupsByGame(gameid){
	gameidsed = gameid;
	$.each(allgames, function(i, item) {
		if (item.gameid == gameid) {
			gametype = item.gametype;
			mobilegametype = item.mobilegametype;
			gameinfo = item;
			return false;
		}
	});
	
	var arr_find = false;
	if (gameListArr && gameListArr.length > 0) {
		$.each(gameListArr,function(i, item){
			if (item.gameid == gameid) {
				gameList = item;
				arr_find = true;
				return false;
			}
		})
	}
	if (!arr_find) {
		$.ajax({
			type : 'post',
			url : '/json/search.php',
			data : {
				gameid : gameid
			},
			dataType : 'json',
			success : function(json) {
				if (!json) {
					return false;
				}
				gameList = json;
				gameListArr.push(gameList);
				$('.g_name').html(gameList.gamename);
				$('.g_name').attr('gameid',gameid);
				$('.g_run').html('运营商');
				$('.g_run').attr('carrierid','');
				$('.g_area').attr('groupid','');
				$('.g_service').attr('serverid','');
				$('.g_type').attr('gtid','');
				$('.close_btn').trigger('click');
				if (gameList.carriers) {
					$('#search_main').css('width', '88px');
					$('.g_run').show();
					$('.g_run').trigger('click');
				} else {
					$('#search_main').css('width', '183px');
					$('.g_run').hide();
					$('.g_area').trigger('click');
				}
			}
		});
	} else {
		$('.g_name').html(gameList.gamename);
		$('.g_name').attr('gameid',gameid);
		$('.g_run').html('运营商');
		$('.g_run').attr('carrierid','');
		$('.g_area').attr('groupid','');
		$('.g_service').attr('serverid','');
		$('.g_type').attr('gtid','');
		$('.close_btn').trigger('click');
		if (gameList.carriers) {
			$('#search_main').css('width', '88px');
			$('.g_run').show();
			$('.g_run').trigger('click');
		} else {
			$('#search_main').css('width', '183px');
			$('.g_run').hide();
			$('.g_area').trigger('click');
		}
	}
}

function loadGroupByCarrier(gameid, carrierid){
	carrieridsed = carrierid;
	var carrier = {};
	$.each(gameList.carriers, function(i, item) {
		if (item.carrierid == carrierid) {
			carrier = item;
			return false;
		}
	});
	$('.g_run').html(carrier.carriername);
	$('.g_run').attr('carrierid',carrierid);
	$('.close_btn').trigger('click');
	$('.g_area').trigger('click');
}

function loadServersByGroup(gameid,groupid,carrierid){
	groupidsed = groupid;
	var group = {};
	var carrier = {};
	if (carrierid && carrierid != '') {
		carrieridsed = carrierid;
		$.each(gameList.carriers, function(i, item) {
			if (item.carrierid == carrierid) {
				carrier = item;
				return false;
			}
		});
		$.each(carrier.groups, function(i, item) {
			if (item.groupid == groupid) {
				group = item;
				return false;
			}
		});
	} else {
		$.each(gameList.groups, function(i, item) {
			if (item.groupid == groupid) {
				group = item;
				return false;
			}
		});
	}
	$('.g_area').html(group.groupname);
	$('.g_area').attr('groupid',groupid);
	$('#letter_server').empty();
	$.each(group.servers, function(i, item) {
		$('#letter_server').append(
				'<dt><a serverid="' + item.serverid
						+ '" onclick="loadGtidByGame(\'' + gameid + '\',\''
						+ item.serverid + '\',\'' + item.servername + '\')">'
						+ item.servername + '</a></dt>');
	});
	$('.close_btn').trigger('click');
	$('.g_service').trigger('click');
}

function loadGtidByGame(gameid,serverid,servername){
	serveridsed = serverid;
	$('#letter_gtid').empty();
	$('.g_service').html(servername);
	$('.g_service').attr('serverid',serverid);
	$('.close_btn').trigger('click');
	$('.g_type').trigger('click');
}

function searchGtid(gtid,gtname){
	$(".g_type").html(gtname);
	$(".g_type").attr('gtid',gtid);
	$(".close_btn").trigger("click");
	var groupid = $('.g_area').attr('groupid');
	var serverid = $('.g_service').attr('serverid');
	if(gtid=='100137'){
		window.location.href='/goods-buying-'+gameidsed+'-'+gtid+'.html';
	}else if(gtid=='100106'||gtid=='100116'||gtid=='199999'){
		window.location.href='/goods-buying-'+gameidsed+'-'+(groupid==''?'0':groupid)+'-'+(serverid==''?'0':serverid)+'-'+gtid+'.html';
	}
}

function search_loadGtid(gameid, serverid, servername) {
	gameidsed = gameid;
	serverided = serverid;
	if ($('#span_search_gtid').attr('gtid') == '') {
		loadGtids();
		$('.option_wz3').hide();
		$('.option_wz4').show();
	} else {
		$('.option_wz3').hide();
	}
	$('#span_search_server').attr('serverid', serverid);
	$('#span_search_server').text(servername);
	return false;
}

$(function() {
	$(".close").click(function(e) {
		$('.option').hide();
		e.stopPropagation();
		clearGame();
		clearOther();
	});
})

function quicklySearch() {
	var txt = $('#txt_search_quickly').val();
	if (txt == '') {
		return false;
	}
	txt = txt.toLowerCase();
	var _txt = '';
	$.each(txt, function(i, item) {
		if (/[\u4e00-\u9fa5\d]/.test(item)) {
			_txt += Character.getPinyinOfChar(item);
		} else {
			_txt += item;
		}
	});
	$('.search_yxm[type="game"]').empty();
	$.each(allgames, function(i, item) {
		if (Character.testPinyinAbbrByPinyin(Character
				.getPinyin2(item.gamename).pinyin, _txt)) {
			$('.search_yxm[type="game"]').append(
					'<a class="wenzi" gameid="' + item.gameid
							+ '" onclick="search_loadGroup(\'' + item.gameid
							+ '\')">' + item.gamename + '</a>');
		}
	});
	return false;
}



function loadGameDateNew(em,gametype,mobilegametype){
	var html="";
	$.each(allgames,function(i,item){
		if(gametype=='0'){
			if(item.gametype=='0'){
				if(em=='热门游戏'){
					if (item.hot == 'hot') {
							html += '<dt><a href="javascript:void(0)" gameid='+item.gameid+' onclick="loadCarriersGroupsByGame(\''+item.gameid+'\')" >'+item.gamename+'</a></dt>';
					}
				}else if(item.px==em){
						html += '<dt><a href="javascript:void(0)" gameid='+item.gameid+' onclick="loadCarriersGroupsByGame(\''+item.gameid+'\')">'+item.gamename+'</a></dt>';
				}
			}
		}else{
			if(item.gametype=='1'){
				if(em=='热门游戏'){
					if (item.hot == 'hot' && (item.mobilegametype == mobilegametype)) {
							html += '<dt><a href="javascript:void(0)" gameid='+item.gameid+' onclick="loadCarriersGroupsByGame(\''+item.gameid+'\')" >'+item.gamename+'</a></dt>';
					}
				}else if(item.px==em){
					if (item.mobilegametype == mobilegametype) {
						html += '<dt><a href="javascript:void(0)" gameid='+item.gameid+' onclick="loadCarriersGroupsByGame(\''+item.gameid+'\')">'+item.gamename+'</a></dt>';
					}
				}
			}
			
		}
	});
	$('#letter_game').html(html);
}

$('#searchBtn').click(
		function() {
		 	var gametypename = $(".main_name_select").children(".hover").html();
		 	var gtype = gametypename=='网络游戏'?0:1;
		 	var mtype = gametypename=='苹果手游'?0:1;
			var txt = $('#sselect_gamename').val();
			if (txt == '') {
				return false;
			}
			txt = txt.toLowerCase().replace(/(.)(?=[^$])/g, "$1,").split(",");
			var _txt = '';
			$.each(txt, function(i, item) {
				if (/[\u4e00-\u9fa5\d]/.test(item)) {
					_txt += Character.getPinyinOfChar(item);
				} else {
					_txt += item;
				}
			});
				$('#hotgame').click();
				$('#letter_game').empty();
				$.each(allgames, function(i, item) {
					if (Character.testPinyinAbbrByPinyin(getPy(item.gamename), _txt)) {
						var gametype = item.gametype;
						var mobiletype = item.mobilegametype;
						if((gtype==0&&gametype==0)||(gtype==1&&mobiletype==mtype)){
							$('#letter_game').append('<dt><a href="javascript:void(0)" gameid='+item.gameid+' onclick="loadCarriersGroupsByGame(\''+item.gameid+'\')" >'+item.gamename+'</a></dt>');
						}
					}
				});
			return false;
		});
$(document).click(function(event) {
	var et = $(event.target);
	if (et.closest('.option').length == 0) {
		$('.option').hide();
		clearGame();
		clearOther();
	}
});

function clearGame(){
	$.each($('.cont2:first').find('li'), function(i, item) {
		if($(item).attr('id')!=''){
			$(item).empty();
		}
	});
	$.each($('.cont2:last').find('li'), function(i, item) {
		if($(item).attr('id')!=''){
			$(item).empty();
		}
	});

}

function clearOther(){
	$('.search_yxm[type="group"]').empty();
	$('.search_yxm[type="server"]').empty();
	$('.search_yxm[type="gtid"]').empty();
}


function loadScript(url, callback){
    var script = document.createElement("script")
    script.type = "text/javascript";
    if (script.readyState){  //IE
        script.onreadystatechange = function(){
            if (script.readyState == "loaded" ||
                script.readyState == "complete"){
                script.onreadystatechange = null;
                callback();
            }
        };
    } else {  
        script.onload = function(){
            callback();
        };
    }
    script.src = url;
    $('link').append(script);
}

 
function loadCSS(url){
   var cssLink = document.createElement("link");
   cssLink.rel = "stylesheet";
   cssLink.rev = "stylesheet";
   cssLink.type = "text/css";
   cssLink.media = "screen";
   cssLink.href = url;
   $('link').append(cssLink);
}

$('#search_main').click(
		function() {
			if($('.t_search a:eq(1)').hasClass('hover')){
				simgleSearch();
			}else{
				var gameid = $('.g_name').attr('gameid');
				if (gameid == '') {
					window.location.href = '/game/';
					return false;
				}
				var carrierid = $('.g_run').attr('carrierid');
				var groupid = $('.g_area').attr('groupid');
				var serverid = $('.g_service').attr('serverid');
				var gtid = $('.g_type').attr('gtid');
				//var catid = 0;
				if(serverid != ''){
					var catid = serverid;
				}else if(groupid != ''){
					var catid = groupid;
				}else if(carrierid != ''){
					var catid = carrierid;
				}else if(gameid != ''){
					var catid = gameid;
				}
				if (carrierid == '' && groupid == '' && serverid == '' && gtid == '') {
					window.location.href = '/game/list.php?catid=' + gameid;
					return false;
				} else {
					if (gameList && carrierid != '' && gtid != '') {
						$.each(gameList.carriers, function(i, item) {
							if (item.carrierid == carrierid) {
								$.each(item.goodstype.split(','), function(j, _item){
									if (_item.split(':')[0] == gtid && _item.split(':')[1] == '0') {
										carrierid = '0';
										return false;
									}
								});
								return false;
							}
						});
					}
					window.location.href='/game/list.php?catid=' +catid+ '&gtid=' + (gtid==''?'0':gtid);
				}
				return false;
			}
		});


function simgleSearch() {
	var txt_search = $('#txt_search_simple').val();
	if (txt_search.replace(/(^\s*)|(\s*$)/g, '') == '') {
		alert('搜索内容为空');
		return false;
	}
	if ($('.xii_row').length == 1) {
		txt_search = $('.xii_row').text();
	}
	var flag = true;
	$.each(allgames, function(i, item) {
		if (item.gamename == txt_search) {
			window.location.href = '/game/list.php?catid=' + item.gameid;
			flag = false;
			return false;
		}
	});
	if (flag) {
		alert('未找到该游戏区服对应的商品');
	}
	return false;
}

//初始化智能输入词库
$.ajax({
	type : 'post',
	url : '/json/queryGameNameArray.php',
	dataType : 'text',
	success : function(data) {
		if (!data) {
			return false;
		}
		var game_store = data.split(',');
		$('#txt_search_simple').xqkinput({
			words : game_store,
			width : 356,
			height : 170
		});
	}
});
		
$(document).ready(function(){

		//简单搜索/精准搜索
	    $(".t_search a").click(function(){
	        $(this).addClass("hover").siblings().removeClass("hover");
	        $(".s_blue_box ul").eq($(".t_search a").index(this)).show().siblings().hide();
	     });
		//游戏名/区服/类型
		 $(".selectbox li").click(function(){
	        $(".top_search .arrow").stop().animate({'left':'50px'});
			$(".b_blue_box div").eq($(".selectbox li").index(this)).show().siblings().hide();
		 });
		 
		 $('.g_run').click(function(event){
			 var gameid=$('.g_name').attr('gameid');
			 if(gameid!=''){
				$('#letter_carrier').empty();
				$.each(gameList.carriers, function(i, item) {
					$('#letter_carrier').append(
							'<dt><a href="javascript:void(0)" carrierid="'+item.carrierid+'"  onclick="loadGroupByCarrier(\'' + gameid
							+ '\',\'' + item.carrierid + '\')">'+item.carriername+'</a></dt>'
							);
				});
			 }
			$('.top_search .arrow,.b_blue_box,.close_btn').show();
	        $('.top_search .arrow').stop().animate({'left':'140px'});
	        event.stopPropagation();
	     });
		 
		 $('.g_area').click(function(){
			 var gameid=$('.g_name').attr('gameid');
			 if(gameid!=''){
				$('#letter_group').empty();
				var carrierid = $('.g_run').attr('carrierid');
				if (carrierid != '') {
				 	var carrier = {};
					$.each(gameList.carriers, function(i, item) {
						if (item.carrierid == carrierid) {
							carrier = item;
							return false;
						}
					});
					$.each(carrier.groups, function(i, item) {
						$('#letter_group').append(
								'<dt><a href="javascript:void(0)" groupid="'+item.groupid+'"  onclick="loadServersByGroup(\'' + gameList.gameid
								+ '\',\'' + item.groupid + '\',\''+carrierid+'\')">'+item.groupname+'</a></dt>'
								);
					});
				} else {
					$.each(gameList.groups, function(i, item) {
						$('#letter_group').append(
								'<dt><a href="javascript:void(0)" groupid="'+item.gameid+'"  onclick="loadServersByGroup(\'' + gameList.gameid
								+ '\',\'' + item.groupid + '\',\'\')">'+item.groupname+'</a></dt>'
								);
					});
				}
			 }
			 if ($('.g_run').is(':visible')) {
			 	$('.top_search .arrow').stop().animate({'left':'250px'});
			 } else {
			 	$('.top_search .arrow').stop().animate({'left':'155px'});
			 }
	     });
	     
		 $('.g_service').click(function(){
			 var gameid = $('.g_name').attr('gameid');
			 var carrierid = $('.g_run').attr('carrierid');
			 var groupid = $('.g_area').attr('groupid');
			 if (gameid != '') {
				var group = {};
				var carrier = {};
			 	if (carrierid != '') {
					$.each(gameList.carriers, function(i, item) {
						if (item.carrierid == carrierid) {
							carrier = item;
							return false;
						}
					});
					$.each(carrier.groups, function(i, item) {
						if (item.groupid == groupid) {
							group = item;
							return false;
						}
					});
			 	} else {
					$.each(gameList.groups, function(i, item) {
						if (item.groupid == groupid) {
							group = item;
							return false;
						}
					});
			 	}
				$('#letter_server').empty();
				$.each(group.servers, function(i, item) {
					$('#letter_server').append(
							'<dt><a serverid="' + item.serverid
									+ '" onclick="loadGtidByGame(\'' + gameid + '\',\''
									+ item.serverid + '\',\'' + item.servername + '\')">'
									+ item.servername + '</a></dt>');
				});
			 }
			 if ($('.g_run').is(':visible')) {
			 	$('.top_search .arrow').stop().animate({'left':'370px'});
			 } else {
			 	$('.top_search .arrow').stop().animate({'left':'275px'});
			 }
	     });
		 $('.g_type').click(function(){
			 var gameid=$('.g_name').attr('gameid');
			 if(gameid!=''){
				$('#letter_gtid').empty();
				$.each(gameinfo.splxids.split(','), function(i, item) {
					var lxid = item.split(':')[0];
					var lxname = item.split(':')[1];
					$('#letter_gtid').append(
							'<dt><a gtid="' + lxid
									+ '" onclick="searchGtid(\'' + lxid + '\',\''
									+ lxname + '\')">' + lxname + '</a></dt>');
				});
			 };
			 if ($('.g_run').is(':visible')) {
			 	$('.top_search .arrow').stop().animate({'left':'480px'});
			 } else {
			 	$('.top_search .arrow').stop().animate({'left':'385px'});
			 }
	        $('dl#letter_gtid dt a').click(function(event){
				$('.top_search .arrow,.b_blue_box,.close_btn').hide();
				event.stopPropagation();
			 });
	     });
		 $(".box_title a").click(function(event){
			 $(".top_search .arrow,.b_blue_box,.close_btn").hide();
				event.stopPropagation();
		 });
		 $(".close_btn").click(function(){
	        $(".top_search .arrow,.b_blue_box,.close_btn").hide();
	     });
		$(document).click(function(e){
			if(e.which == 1);
		    	$(".top_search .arrow,.b_blue_box,.close_btn").hide();
		    });
		$(".g_area,.g_service,.g_type,.b_blue_box").bind("click",function(event){
		   $(".top_search .arrow,.b_blue_box,.close_btn").show();
		   event.stopPropagation();
		});
		
		var crrCheckText = '1';
		
		$('.g_name').bind('click',function(event){
			   $('.top_search .arrow,.b_blue_box,.close_btn').show();
			   var gameid=$('.g_name').attr('gameid');
			   if(gameid!=''){
			   		loadGameDateNew('热门游戏', gametype, mobilegametype);
			   		if (gametype == 0) {
			   			$('.main_name_select a:eq(0)').trigger('click');
			   		} else if (mobilegametype == 0) {
			   			$('.main_name_select a:eq(1)').trigger('click');
			   		} else if (mobilegametype == 1) {
			   			$('.main_name_select a:eq(2)').trigger('click');
			   		}
			   } else if(gametype == 0 && crrCheckText=='1'){
			   		loadGameDateNew('热门游戏','0');
			   		crrCheckText='2';
			   }
			   event.stopPropagation();
			}); 
		//网络游戏/手机游戏
	    $(".main_name_select a").click(function(){
	    	if($(this).html()=='苹果手游'){
	    	$(".main_letter_select").show();
	    		gametype='1';
	    		mobilegametype = '0';
	    		loadGameDateNew('热门游戏',gametype, mobilegametype);
	    		$('#hotgame').trigger('click');
	    	}else if($(this).html()=='安卓手游'){
	    	$(".main_letter_select").show();
	    		gametype='1';
	    		mobilegametype = '1';
	    		loadGameDateNew('热门游戏',gametype, mobilegametype);
	    		$('#hotgame').trigger('click');
	    	}
	    	else if($(this).html()=='苹果阅读'){
	    	$(".main_letter_select").hide();
	    	$("#letter_game").empty();
	    	var yuedu = '<dt><a href="/goods-buying-A1531-0-0-100140.html">QQ阅读</a></dt><dt><a href="/goods-buying-A1533-0-0-100140.html">掌阅iReader</a></dt><dt><a href="/goods-buying-A1534-0-0-100140.html">书香云集</a></dt><dt><a href="/goods-buying-A1532-0-0-100140.html">百度阅读</a></dt>';
	    		$("#letter_game").append(yuedu);
	    		//gametype='1';
	    		//mobilegametype = '1';
	    		///loadGameDateNew('热门游戏',gametype, mobilegametype);
	    		//$('#hotgame').trigger('click');
	    	}
	    	else{
	    	$(".main_letter_select").show();
	    	
	    		gametype='0';
	    		loadGameDateNew('热门游戏',gametype);
	    		$('#hotgame').trigger('click');
	    	}
	        $(this).addClass("hover").siblings().removeClass("hover");
	        //$(".main_con dl").eq($(".main_name_select a").index(this)).show().siblings().hide();
			//$(".main_con ul").show()
	     });
		 $(".main_letter_select a").click(function(){
	        $(this).addClass("current").siblings().removeClass("current");
	        loadGameDateNew($(this).html(),gametype,mobilegametype);
	     });
		 
		 if ($('.g_name').attr('gameid')) {
			gameidsed = $('.g_name').attr('gameid');
			$.each(allgames, function(i, item) {
				if (item.gameid == gameidsed) {
					gametype = item.gametype;
					mobilegametype = item.mobilegametype;
					gameinfo = item;
					return false;
				}
			});
			$.ajax({
				type : 'post',
				url : 'http://www.7881.com/getGameQuFuInfo.action',
				data : {
					gameid : $('.g_name').attr('gameid')
				},
				dataType : 'json',
				success : function(json) {
					if (!json) {
						return false;
					}
					gameList = json;
					gameListArr.push(gameList);
				}
			});
		 }
});

function fastSearchKeyUp(){
	
	var gametypename = $(".main_name_select").children(".hover").html();
 	var gtype = gametypename=='网络游戏'?0:1;
 	var mtype = gametypename=='苹果手游'?0:1;
	var txt = $('#sselect_gamename').val();
	if (txt == '') {
		return false;
	}
	txt = txt.toLowerCase().replace(/(.)(?=[^$])/g, "$1,").split(",");
	var _txt = '';
	$.each(txt, function(i, item) {
		if (/[\u4e00-\u9fa5\d]/.test(item)) {
			_txt += Character.getPinyinOfChar(item);
		} else {
			_txt += item;
		}
	});
		$('#hotgame').click();
		$('#letter_game').empty();
		$.each(allgames, function(i, item) {
			if (Character.testPinyinAbbrByPinyin(getPy(item.gamename), _txt)) {
				var gametype = item.gametype;
				var mobiletype = item.mobilegametype;
				if((gtype==0&&gametype==0)||(gtype==1&&mobiletype==mtype)){
					$('#letter_game').append('<dt><a href="javascript:void(0)" gameid='+item.gameid+' onclick="loadCarriersGroupsByGame(\''+item.gameid+'\')" >'+item.gamename+'</a></dt>');
				}
			}
		});
	return false;
}

function getPy(word){
	var _pinyin;
	$.each(srcSearchWord, function(i, item) {
			if(item.text == word){
				_pinyin = item.pinyin;
				return false;
			}					
		});
	return _pinyin;
}

function fastSearchKeyUp2(){
	var gametypename = $(".main_name_select").children(".hover").html();
 	var gtype = gametypename=='网络游戏'?0:1;
 	var mtype = gametypename=='苹果手游'?0:1;
	var txt = $('#sselect_servername').val();
	if (txt == '') {
		return false;
	}
	txt = txt.toLowerCase().replace(/(.)(?=[^$])/g, "$1,").split(",");
	var _txt = '';
	$.each(txt, function(i, item) {
		if (/[\u4e00-\u9fa5\d]/.test(item)) {
			_txt += Character.getPinyinOfChar(item);
		} else {
			_txt += item;
		}
	});
		//$('#hotgame').click();
		//loadGtidByGame(gameid,serverid,servername);
		var group = {};
		var carrier = {};
		var gameid = $('.g_name').attr('gameid');
		var carrierid = $('.g_run').attr('carrierid');
		var groupid = $('.g_area').attr('groupid');

		if (carrierid != '') {
			$.each(gameList.carriers, function(i, item) {
				if (item.carrierid == carrierid) {
					carrier = item;
					return false;
				}
			});
			$.each(carrier.groups, function(i, item) {
				if (item.groupid == groupid) {
					group = item;
					return false;
				}
			});
		} else {
			$.each(gameList.groups, function(i, item) {
				if (item.groupid == groupid) {
					group = item;
					return false;
				}
			});
		}

		$('#letter_server').empty();
		$.each(group.servers,function(i, item) {
			
			if (Character.testPinyinAbbrByPinyin(Character.getPinyin2(item.servername).pinyin, _txt)) {
				$('#letter_server').append(
						'<dt><a serverid="' + item.serverid
								+ '" onclick="loadGtidByGame(\'' + gameid + '\',\''
								+ item.serverid + '\',\'' + item.servername + '\')">'
								+ item.servername + '</a></dt>');
			}
		});
		
	return false;
}