function clickto(){
	var zhanzhang=false;
	var aizhan=false;
	$(".ip_select_zhong").css("display","block");//开启查询样式图，提醒用户正在查询
	var selectzhong=setInterval(autoHide,1000);
	function autoHide() {
		if(zhanzhang==true&&aizhan==true){
			clearInterval(selectzhong);	
			$(".ip_select_select").removeAttr("disabled");
			$(".ip_select_zhong").css("display","none");
		}
	}//每秒执行查询事件，如果成功后就去掉正在查询样式图
	$(".ip_select_select").attr("disabled","disabled");//查询期间禁止再次点击，避免重复获取数据
	qingchu();
	//站长工具信息获取
    $.post("https://www.daohangtx.com/tools/detail/pr/js/get.php","type=1&url="+$(".ip_select_text").val(), function(data) {
		var json=eval("("+data+")");
		$(".pr_chinaz .title").html(json['title']!=null?json['title']:"------------");
		$(".pr_chinaz .baidupr").html(json['baidupr']!=null?json['baidupr']:"------------");
		if(json['360pr']!=null){
			$(".pr_chinaz .360pr").html('<img src="360rank'+json['360pr']+'.gif"/*tpa=https://www.daohangtx.com/Skins/mb/images/360rank'+json['360pr']+'.gif*/ />');	
		}else{
			$(".pr_chinaz .360pr").html('------------');
		}
		$(".pr_chinaz .googlepr").html(json['googlepr']!=null?json['googlepr']:"------------");
		$(".pr_chinaz .baidulaiyuan").html(json['baidulaiyuan']!=null?json['baidulaiyuan']:"------------");
		$(".pr_chinaz .baiduciku").html(json['baiduciku']!=null?json['baiduciku']:"------------");
		$("https://www.daohangtx.com/tools/detail/pr/js/.pr_chinaz .old").html(json['old']!=null?json['old']:"------------");
		$("https://www.daohangtx.com/tools/detail/pr/js/.pr_chinaz .icp").html(json['icp']!=null?json['icp']:"------------");
		$("https://www.daohangtx.com/tools/detail/pr/js/.pr_chinaz .ip").html(json['ip']!=null?json['ip']:"------------");
		$(".pr_chinaz .alexa").html(json['alexa']!=null?json['alexa']:"------------");
		zhanzhang = true;
	});
	//爱站信息获取
	$.post("https://www.daohangtx.com/tools/detail/pr/js/get.php","type=2&url="+$(".ip_select_text").val(), function(data) {
		var json=eval("("+data+")");
		$(".pr_aizhan .title").html(json['title']!=null?json['title']:"------------");
		$(".pr_aizhan .baidupr").html(json['baidupr']!=null?json['baidupr']:"------------");
		$(".pr_aizhan .googlepr").html(json['googlepr']!=null?json['googlepr']:"------------");
		$(".pr_aizhan .sogou").html(json['sogou']!=null?json['sogou']:"------------");
		$(".pr_aizhan .baidulaiyuan").html(json['baidulaiyuan']!=null?json['baidulaiyuan']:"------------");
		$("https://www.daohangtx.com/tools/detail/pr/js/.pr_aizhan .old").html(json['old']!=null?json['old']:"------------");
		$("https://www.daohangtx.com/tools/detail/pr/js/.pr_aizhan .icp").html(json['icp']!=null?json['icp']:"------------");
		$("https://www.daohangtx.com/tools/detail/pr/js/.pr_aizhan .ip").html(json['ip']!=null?json['ip']:"------------");
		$(".pr_aizhan .alexa").html(json['alexa']!=null?json['alexa']:"------------");
		aizhan = true;
	});	
}

//键盘按键 FireFly萤火虫
$(document).keyup(function(event){
  if(event.keyCode ==13){
    	clickto();
  }
});

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

$("tr td a").live('click',function(event) {
	if(!($(this).parents().hasClass("pr_logo_tr"))){
		event.preventDefault();	
	}
});

function qingchu(){
	$(".pr_chinaz tr").each(function(index, element) {
       $(element).find("td").eq(1).html('------------');
    });
	$(".pr_aizhan tr").each(function(index, element) {
       $(element).find("td").eq(1).html('------------');
    });
}
