function clickto(){
	if($(".toolsqq_select_text").val().length>5){
		var qqselecet = false;
		$(".ip_select_zhong").css("display","block");
		var selectzhong=setInterval(autoHide,1000);
		function autoHide() {
			if(qqselecet==true){
				clearInterval(selectzhong);	
				$(".ip_select_zhong").css("display","none");
			}
		}//每秒执行查询事件，如果成功后就去掉正在查询样式图
		$.post("https://www.daohangtx.com/tools/detail/kuaidi/js/get.php","type=1&id="+$(".toolsqq_select_text").val(), function(data) {	
			var json=eval("("+data+")");
			$(".toolskuaidi_xiala").css("display","block");
			if(json['Success']){
				$(".toolskuaidi_xiala ul").html('');
				for(var i=0;i<json['Shippers'].length;i++){
					$(".toolskuaidi_xiala ul").append('<li><span>'+json['Shippers'][i].ShipperCode+'</span><span>'+json['Shippers'][i].ShipperName+'</span>&nbsp;&nbsp;&nbsp;&nbsp;'+$(".toolsqq_select_text").val()+'</li>');	
				}
			}
			qqselecet = true;
		});
	}
}


//键盘按键 FireFly萤火虫
$(".toolsqq_select_text").keyup(function(event){
    clickto();
});

$(".toolsqq_select_text").live('click',function(e) {
    clickto();
})

$(".toolsqq_select_select").live('click',function(e) {
    clickto();
})


$(".toolskuaidi_xiala ul li").live('click',function(e) {
		var li = $(this);
		$(".toolskuaidi_xiala").css("display","none");
		var qqselecet = false;
		$(".ip_select_zhong").css("display","block");
		var selectzhong=setInterval(autoHide,1000);
		function autoHide() {
			if(qqselecet==true){
				clearInterval(selectzhong);	
				$(".ip_select_zhong").css("display","none");
			}
		}//每秒执行查询事件，如果成功后就去掉正在查询样式图
		$.post("https://www.daohangtx.com/tools/detail/kuaidi/js/get.php","type=2&id="+$(".toolsqq_select_text").val()+"&code="+$(this).children("span").eq(0).html(), function(data) {	
			
			var json=eval("("+data+")");
			if(json['Success']&&json['Traces'].length>0){
				$(".toolsqq_result_tishi").addClass("toolsqq_result_tishiadd");
				$(".toolsqq_result_tishi").css({"text-align":"center"}).html(li.html());
				$(".toolsqq_result_tishi span").addClass("toolsqq_result_tishiadd");
				$(".toolsqq_result_result").html('');
				$.each(json['Traces'],function(i,val){
					$(".toolsqq_result_result").append("<span class='AcceptTime'>"+val.AcceptTime+"</span><span class='AcceptStation'>"+val.AcceptStation+"</span><br />");
				});
			}else{
				$(".toolsqq_result_tishi").removeClass("toolsqq_result_tishiadd");
				$(".toolsqq_result_tishi span").removeClass("toolsqq_result_tishiadd");
				$(".toolsqq_result_tishi").html('查询失败，暂时没有查到该物流信息！');
				$(".toolsqq_result_result").html('');
			}
			qqselecet = true;
		});
});



