J1616.chaxun.index={title:"实用查询工具大全",cookieName:"J1616_chaxun_index",order:["item_sjgsd","item_tq","item_hcp","item_sfz","item_ipdz","item_zxfy"],initialize:function(){var text=$("#txt_google_source").val();if(!$.trim(text)){alert("请输入内容");$("#btnSubmit1").removeAttr("disabled").val("翻译");$("#txt_google_source").focus();return false;}
var maxLen=1402,prefix="";if(encodeURIComponent(text).length>maxLen)prefix="由于您输入的内容过多，部分翻译内容被截断，以下是翻译的正文：\n\n";(function(){try{encodeText=encodeURIComponent(text).substr(0,maxLen)
text=decodeURIComponent(encodeText);}catch(e){maxLen--;arguments.callee();}})();var sel_google_source=$("#sel_google_source").val();var sel_google_result=$("#sel_google_result").val();google.language.translate(text,sel_google_source,sel_google_result,function(result){var translated=$("#txt_google_result");if(result.translation){translated.val(prefix+result.translation);$("#btnSubmit1").removeAttr("disabled").val("翻译");}});},bindEvents:function(){var _this=this;google.load("language","1");$("#btnSubmit1").click(function(){$(this).attr("disabled",true).val("翻译中..");_this.initialize();});$(".btnChakan").click(function(){var url="http://weather.1616.net/?city=";if(isOutLine){url="http://weather."+_path+".com/?city=";}
url+=encodeURIComponent($(this).prev("select").val());window.open(url);});$("#google_huhuan").click(function(){var from=[$("#sel_google_source").text(),$("#sel_google_source").val()],to=[$("#sel_google_result").text(),$("#sel_google_result").val()];$("#sel_google_source option").removeAttr("selected");$("#sel_google_source option[value="+to[1]+"]").attr("selected","selected");$("#sel_google_result option").removeAttr("selected");$("#sel_google_result option[value="+from[1]+"]").attr("selected","selected");});$('#tmtx').submit(function(){document.charset="gb2312";});$('#tmtx_btn').click(function(){var query=$.trim($('#txtx_username').val()).length==3?3:2;var action="http://www.360hy.com/ourname/tmtx"+query+".asp";$("#tmtx").attr("action",action).submit();});$('#match').click(function(){window.open('http://www.googcc.cn/xuexingpeidui.asp?chk=xuexingpeidui&p3='+$('#match1').val()+"&p4="+$('#match2').val());});$('#btnSubmit_youbian').click(function(){$('#hide_youbian').val($('#txt_youbian').val());$('#form_youbian').submit();});$('#txt_youbian').keypress(function(e){e=e||window.event;if(e.keyCode==13){$('#btnSubmit_youbian').click();}});$("#btnSubmit_yuming").click(function(){var url="http://ipsame.com/";var v=$.trim($("#txt1_yuming").val());if(!/^(([01]?[\d]{1,2})|(2[0-4][\d])|(25[0-5]))(\.(([01]?[\d]{1,2})|(2[0-4][\d])|(25[0-5]))){3}$/.test(v)){alert("请输入合法的IP");return false;}
window.open(url+v);});$("#txt1_yuming").keyup(function(e){e=e||window.event;if(e.keyCode==13){$("#btnSubmit_yuming").click();}});$("#btnSubmit_kuozhan").click(function(){var url="http://www.kuozhanming.com/?action=search&extension=";var v=$.trim($("#txt_kuozhan").val());if(!v){alert("请输入扩展名");return false;}
window.open(url+v);});$("#txt_kuozhan").keypress(function(e){e=e||window.event;if(e.keyCode==13){$("#btnSubmit_kuozhan").click();}});$('#btnSub_baike').click(function(){var url="http://www.hudong.com/wiki/"+encodeURIComponent($('#txt_baike').val());$('#myform_baike').attr('action',url);});$("#txt_baike").keypress(function(e){e=e||window.event;if(e.keyCode==13){$('#btnSub_baike').click();}});$('#start2end_btn').click(function(){var startStation=$.trim($('#startStation').val());var endStation=$.trim($('#endStation').val());var url="http://chaxun.1616.net/lieche.htm?startStation="+startStation+'&endStation='+endStation;if(isOutLine){url="http://chaxun."+_path+".com/lieche.htm?startStation="+startStation+'&endStation='+endStation;}
$('#start2end_form').attr('action',url).submit();});$('#endStation').keypress(function(event){if(event.keyCode==13){$('#start2end_btn').click();}});$('#statorder_btn').click(function(){var stat_Order=$.trim($('#stat_Order').val());var url="http://chaxun.1616.net/lieche.htm?stat_Order="+encodeURIComponent(stat_Order);if(isOutLine){url="http://chaxun."+_path+".com/lieche.htm?stat_Order="+encodeURIComponent(stat_Order);}
$('#statorder_form').attr('action',url).submit();});$('#stat_Order').keypress(function(event){if(event.keyCode==13){$('#statorder_btn').click();}});},fillData_ip:function(j){$("#auswer_ip").html("您的IP: "+j.Ip+" 来自: "+j.Isp);},callback_ip:function(j){switch(j.QueryResult){case 1:this.fillData_ip(j);break;case 4:$("#auswer_ip").html(J1616.chaxun.errorText("发生错误，请重试"));break;}},callback_ip_:function(j){switch(j.QueryResult){case 1:this.fillData_ip(j);break;case 4:$("#auswer_ip)").html(J1616.chaxun.errorText("发生错误，请重试"));break;}},weatherInit:function(){var $citys=$(J1616_weather_citys);_fillSel($citys.filter(function(){return(this.i===0)}),$citys.filter(function(){return(this.i===1)}));function _makeProvinces($items){var provs={};$items.each(function(){var t=this.pv[0],q=this.pv[1];if(typeof provs[t]=='undefined')
provs[t]=q;});for(var key in provs){var s=provs[key];provs[key]=[$items.filter(function(){return this.pv[0]==key}),s];}
var newProvs={},i=0,tmpArr=[];for(var k in provs){tmpArr[i]=[k,provs[k]];i++;}
tmpArr.sort(function(a,b){return a[1][1].charCodeAt(0)-b[1][1].charCodeAt(0)});$(tmpArr).each(function(){newProvs[this[0]]=this[1];});return newProvs;}
function _makeContinents($items){var provs={};$items.each(function(){var t=this.ct;if(typeof provs[t]=='undefined')
provs[t]=1;});for(var key in provs){provs[key]=[$items.filter(function(){return this.ct==key}),""];}
return provs;}
function _fillSel($citys,$continents){var a="",b="",c="",d="",tmps1=_makeProvinces($citys),tmps2=_makeContinents($continents);for(var key in tmps1){a+="<option value=\""+key+"\" "+(key=="直辖市"?"selected=\"true\"":"")+">"+tmps1[key][1]+" "+key+"</option>"};$(tmps1["直辖市"][0]).each(function(){b+="<option value='"+this.n+"'>"+this.py.substr(0,1)+" "+this.n+"</option>"});for(var key in tmps2){c+="<option value=\""+key+"\" "+(key=="亚洲"?"selected=\"selected\"":"")+">"+tmps2[key][1]+" "+key+"</option>"};$(tmps2["亚洲"][0]).each(function(){d+="<option value='"+this.n+"'>"+this.py.substr(0,1)+" "+this.n+"</option>"});$('.unOverSeas_province').html(a);setTimeout(function(){$('.unOverSeas_province').find("option[value='直辖市']").attr("selected","selected");},1);$('.unOverSeas_city').html(b);$('.overSeas_continent').html(c);$('.overSeas_city').html(d);$('.unOverSeas_province').bind("change",function(){_s(tmps1,$(this))});$('.overSeas_continent').bind("change",function(){_s(tmps2,$(this))});function _s(tmps,$this){var t=tmps[$this.val()][0];var d="";for(var i=0;i<t.length;i++){d+="<option value='"+t[i].n+"'>"+t[i].py.substr(0,1)+" "+t[i].n+"</option>";}
$this.next("select").html(d);}}},init:function(){if(J1616.chaxun.getCookie(this.cookieName))
this.order=J1616.chaxun.str2obj(J1616.chaxun.getCookie(this.cookieName));$.getScript("http://chaxun.1616.net/s.php?type=ip&v=&output=json&callback=J1616.chaxun.index.callback_ip_");this.weatherInit();this.bindEvents();}};J1616.chaxun.index.init();