// Copyright (c) 2005-2010, FlyTech Inc. All rights reserved.
// Author: Fly <flyphp@gmail.com>　

$.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m=$.extend({},m);m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};var fly={s:function(a){return this._s[this.lang][a]},tj:function(){$(window).load(function(){$('a[title^="51.la"]').remove()})},$_GET:function(b){var c=unescape(window.location.href),a=c.match(b+".html#([^&]*)");if(a!=null){return a[1]}return""},reg:function(d,c){return new RegExp(d,c)},_c:function(c){var b,a=c.length,d=[];for(b=0;b<10;b++){d.push(c.substr(Math.floor(a*b/10),1))}return d},c:function(a,b){return a+b.length},fnow:function(){return(new Date()).getTime()},_cc:function(a){return a.match(this.reg(".{1}","g"))},cc:function(b){var g=this,i=b.d,d=g.tongji,e,a,h=16;e=g.c("",i);i=escape(b.d),e=g.c(e,i);i=i.replace(g.reg("[^\\d]*","gi"),"");e=g.c(e,i)+g.fnow();e+=e;e=e.substr(0,h);e=g._cc(e);i=(b.d+d).replace(g.reg("[^a-z]*","gi"),"");d=g._c(i);a=""+d.length+"a";for(i=a.length;i<h;i++){a+=d[e[i]]}a=g._cc(a);d="";for(i=0;i<h;i++){d+=e[i]+a[i]}$.cookie("mds",d.toLowerCase(),{expires:7,path:"/"})},empty:function(a){var d=true,b,c=typeof(a);if(c=="undefined"){}else{if(c=="number"){d=a==0}else{if(c=="string"){d=a==""}else{if(c=="object"||c=="array"){for(b in a){d=!d;break}}else{if(c=="boolean"){d=a}else{if(c=="function"){d=!d}}}}}}return d},post:function(){var b=this,h=b.data,g,a,i=$.cookie,e;h={d:function(){var d=[],c;for(c in h.d){d.push(c+"+"+h.d[c])}return d.join("|")}()};b.cc(h);$.post("/gg.php",h);h.d={}},search:{init:function(){$("#menu").after('<div id="search"><form method="get" onsubmit="fly.search.act();return false;"><fieldset><input type="text" name="s" id="search-text" size="15" onfocus="this.value=\'\'" /><input type="submit" id="search-submit" value="GO" /></fieldset></form></div>')},act:function(){var c=$("#search-text"),b=$.trim(c.val());c.val(b);if(b.match(fly.reg("^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$","i"))){window.location.href="/zh.ip."+b+".html"}else{alert("请输入正确的IP地址！")}}},init:function(){var e=this,c=$("body").attr("g").split("_"),a=window,b=a.location.href,h=new Date();h.setTime(h.getTime()-7*24*60*60*1000);$("#logo").prepend('<div style="float:right;padding-top:10px;line-height:25px;text-align:right">我们不是最优秀，但一直努力做更优秀，因为我们一直在用心去做！<br />IP数据库最后更新 <font color=red>'+h.getFullYear()+"-"+(h.getMonth()+1)+"-"+h.getDate()+"</font></div>");$("#maincontent").after('<div id="sidebar"><ul><li><h2>什么是IP？</h2><p>IP是英文Internet Protocol（网络之间互连的协议）的缩写，就是给每个连接在Internet上的主机分配的一个地址。</p></li><li><h2>收藏CCker</h2><div><img src="'+flyImage.favorite+'" /></div><ul><li><a href="/#a1">CCker查询是免费的</a></li><li><a href="/#a2">使用CCker查询速度非常快</a></li><li><a href="/#a3">CCker接口十分丰富</a></li><li><a href="/#a4">非常实用，很多人在用</a></li><li><a href="/#a5">CCker有强大的数据库支持</a></li><li><a href="/#a6">CCker使用非常简单</a></li></ul></li></ul></div><div style="clear: both;"></div>');if(c[0]=="ip"){e.search.init();$("#search-text").val(c[1]);$(".addr").append('<p>您所在的地址的IP: <a href="/zh.ip.'+c[2]+'.html">'+c[2]+"</a>");e.map.show($("#map_canvas"),c[1])}else{if(c[0]=="addr"){e.search.init();$("#search-text").val(c[1]);$(".addr").append('<p>您所在的地址的IP: <a href="/zh.ip.'+c[1]+'.html">'+c[1]+"</a>")}else{if(c[0]=="index"){e.search.init();$("#search-text").val(c[1])}}}$.getScript("/js.php");e.tj()},map:{bc:function(h,l){var g=fly,b=_n=h.length,e,k,m,c="",j=g.data.d;function a(d){c.geocode({address:d[2]+" "+d[3]},function(n,f){m=d[0]+"_"+d[1];if(f==google.maps.GeocoderStatus.OK){var i=n[0].geometry.location;j[m]=i.Ja+","+i.Ka}else{j[m]=","}if(b--==1){l(j[m])}})}for(e=0;e<_n;e++){k=h[e].split("_");m=k[0]+"_"+k[1];if(c==""){c=new google.maps.Geocoder()}if(c){a(k)}}},show:function(b,e){var a=b.attr("d"),d=b.attr("bc");function c(i){if(i==","){b.css("background","url("+flyImage.mapbg+") no-repeat")}else{var i=i.split(","),l=a.split("_"),k=new google.maps.LatLng(i[0],i[1]),f={zoom:8,center:k,mapTypeId:google.maps.MapTypeId.ROADMAP},h=new google.maps.Map(b[0],f),j='<div id="content" style="font-size:15px;width:200px;"><b>'+e+"</b><br />"+l[2]+" "+l[3]+"</div>",g=new google.maps.InfoWindow({position:k,content:j});g.open(h)}}if(d==""){this.bc([a],c)}else{c(d)}},js:function(a){this.bc(a.split("-"),function(){fly.post()})}},data:{d:{}},ver:"$Id: q.js 330 2010-06-20 14:24:31Z h058 $"};$.extend(fly,_fly);fly.init();
