google 常用js
2009-02-19 16:58 贪婪的小猪 阅读(260) 评论(0) 编辑 收藏 举报Code
(function(){
var e = navigator.userAgent.toLowerCase();
google.isOpera = e.indexOf("opera") != -1;
google.isIE = document.all && e.indexOf("msie") != -1 && !google.isOpera;
google.isSafari = e.indexOf("safari") != -1;
google.time = function(){
return (new Date).getTime()
};
google.log = function(a, d){
(new Image).src = "/gen_204?atyp=i&ct=" + a + "&cad=" + d + "&zx=" + google.time()
};
google.xhr = function(){
var a = null;
if (window.XMLHttpRequest)
try {
a = new XMLHttpRequest
}
catch (d) {
}
else
if (window.ActiveXObject)
for (var b = 0, c; c = ["MSXML2.XMLHTTP.6.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"][b++];)
try {
a = new ActiveXObject(c);
break
}
catch (d) {
}
return a
};
function h(a, d){
var b = document.defaultView && document.defaultView.getComputedStyle(a, ""), c = b && b.getPropertyValue(d);
return document.defaultView && b && typeof c == "string" && parseInt(c, 10)
}
google.getHeight = function(a){
return h(a, "height") || a.offsetHeight
};
google.getWidth = function(a){
return h(a, "width") || a.offsetWidth
};
google.rhs = function(){
};
window.google.bind = function(a, d, b){
var c = "on" + d;
if (a.addEventListener)
a.addEventListener(d, b, false);
else
if (a.attachEvent)
a.attachEvent(c, b);
else {
var i = a[c];
a[c] = function(){
var f = i.apply(this, arguments), g = b.apply(this, arguments);
return f == undefined ? g : (g == undefined ? f : g && f)
}
}
};
})();
(function(){
var c, e, h, j = "", l = null, o = null, p = null, q = -1, s, t, u, v, w, x, z, A = 0, B = 0, C = null, D = 0;
var E = 0;
var F;
var I = null, J = 0;
var L = 0, aa = new RegExp("^[\\s\\u1100-\\u11FF\\u3040-\\u30FF\\u3130-\\u318F\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\u9FFF\\uAC00-\\uD7A3\\uF900-\\uFAFF\\uFF65-\\uFFDC]+$");
function ba(a, b, d, f, g){
s = a;
t = b;
z = ["/complete/search", "?hl=", google.kHL, "&gl=cn", (d ? "&ds=" + d : ""), (f ? "&pq=" + encodeURIComponent(f) : "")].join("");
google.bind(s, "submit", M);
t.setAttribute("autocomplete", "off");
google.bind(t, "blur", function(){
if (!L)
N();
L = 0
});
google.bind(t, "beforedeactivate", function(){
if (E) {
window.event.cancelBubble = true;
window.event.returnValue = false
}
E = 0
});
google.bind(t, "keydown", O);
google.bind(t, "keyup", P);
e = (h = (c = t.value));
F = Q(t);
u = document.createElement("table");
u.cellSpacing = (u.cellPadding = "0");
v = u.style;
u.className = "gac_m";
s.appendChild(u);
N();
R();
google.bind(window, "resize", R);
window.setInterval(function(){
var m = t.value;
if (m != c)
S(0);
c = m
}, 10);
w = T("aq", "f");
x = T("oq", e);
var k = document.createElement("style");
document.getElementsByTagName("head")[0].appendChild(k);
var i = null;
i = k.styleSheet;
var n = function(m, Y){
i.addRule(m, Y);
};
n(".gac_m", "font-size:13px;cursor:default;line-height:17px;border:1px solid black;z-index:99;background:white;position:absolute;margin:0;");
n(".gac_b", "background:#36c;color:white;");
var y = "white-space:nowrap;overflow:hidden;text-align:left;padding-left:3px;" + "padding-bottom:1px;";
n(".gac_c", y);
n(".gac_d", "white-space:nowrap;overflow:hidden;text-align:right;font-size:10px;color:green;padding:0 3px");
n(".gac_b td", "color:white");
n(".gac_e td", "padding:0 3px 2px;text-align:right;font-size:10px;line-height:15px");
n(".gac_e span", "color:#00c;text-decoration:underline;cursor:pointer");
U();
}
function R(){
if (u) {
v.left = V(t, "offsetLeft") + "px";
v.top = V(t, "offsetTop") + t.offsetHeight - 1 + "px";
v.width = t.offsetWidth + "px";
}
}
function T(a, b){
var d = document.createElement("input");
d.type = "hidden";
d.name = a;
d.value = b;
return s.appendChild(d)
}
function O(a){
var b = a.keyCode;
if (b == 27 && ca()) {
N();
W(e);
a.cancelBubble = true;
return a.returnValue = false
}
if (b == 38 || b == 40) {
B++;
if (B % 3 == 1)
S(b);
return false
}
}
function P(a){
var b = a.keyCode;
if (B == 0 && !(b == 38 || b == 40))
S(b);
B = 0;
}
function S(a){
if (a == 38 || a == 40) {
L = 1;
t.blur();
window.setTimeout(function(){
t.focus()
}, 10)
}
if (t.value != c) {
e = t.value;
F = Q(t);
x.value = e
}
a == 40 && da(q + 1);
a == 38 && da(q - 1);
R();
if (j != e && !C)
C = window.setTimeout(N, 500);
c = t.value;
if (c == "" && !l)
U()
}
function ea(){
if (D)
return;
if (p)
p.className = "gac_a";
this.className = "gac_b";
p = this;
for (var a = 0, b; b = o[a]; a++)
b ==
p &&
(q = a)
}
function da(a){
if (!j && e) {
h = "";
U();
return
}
if (e != j || !l)
return;
if (!o || o.length <= 0)
return;
if (!ca()) {
X();
return
}
var b = o.length - 1;
if (p)
p.className = "gac_a";
if (a == b || a == -1) {
q = -1;
W(e);
t.focus();
w.value = "f";
return
}
else
if (a > b)
a = 0;
else
if (a < -1)
a = b - 1;
q = a;
p = o.item(a);
p.className = "gac_b";
W(p.completeString);
w.value = p.completeId
}
function N(){
if (C) {
window.clearTimeout(C);
C = null
}
v.visibility = "hidden";
}
function X(){
v.visibility = "visible";
R();
D = 1
}
function ca(){
return v.visibility == "visible"
}
function fa(a){
A > 0 && A--;
if (a[0] != e)
return;
if (C) {
window.clearTimeout(C);
C = null
}
j = a[0];
while (u.rows.length)
u.deleteRow(-1);
var d = 0;
for (var f = 0, g; f < a[1].length; f++)
if (g = a[1][f]) {
d++;
var k = u.insertRow(-1);
k.onclick = function(){
W(this.completeString);
M();
s.submit();
};
k.onmousedown = ga;
k.onmouseover = ea;
k.onmousemove = function(){
if (D) {
D = 0;
ea.call(this)
}
};
k.completeString = g[0];
k.completeId = g[2];
k.className = "gac_a";
var i = document.createElement("td");
$(i, g[0]);
i.className = "gac_c";
aa.test(g[0]) && (i.style.paddingTop = "2px");
k.appendChild(i);
var r = document.createElement("td");
$(r, g[1]);
r.className = "gac_d";
k.appendChild(r);
}
if (d > 0) {
var n = u.insertRow(-1);
n.onmousedown = ga;
var y = document.createElement("td");
y.colSpan = 2;
n.className = "gac_e";
var m = document.createElement("span");
n.appendChild(y);
y.appendChild(m);
$(m, "关闭");
m.onclick = function(){
N();
j = "";
window.clearTimeout(l);
l = null;
w.value = "x"
}
}
q = -1;
o = u.rows;
(o.length > 0 ? X : N)()
}
function M(){
N();
if (x.value != t.value)
w.value = o.item(q).completeId;
else {
x.value = "";
if (A >= 10 || J >= 3)
w.value = "o"
}
}
function U(){
if (J >= 3)
return;
if (h !=
e &&
e) {
A++;
ha(encodeURIComponent(e));
t.focus()
}
h = e;
var f = 100;
for (var g = 1; g <=
(A - 2) /
2; ++g)
f *= 2;
f += 50;
l = window.setTimeout(U, f)
}
function W(a){
t.value = a;
c = a
}
function V(a, b){
var d = 0;
while (a) {
d += a[b];
a = a.offsetParent
}
return d
}
function $(a, b){
a.appendChild(document.createTextNode(b))
}
function ga(a){
E = 1;
return false
}
function ia(){
var a = null;
try {
a = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (b) {
try {
a = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (d) {
}
}
return a
}
function ha(a){
if (I && I.readyState != 0 && I.readyState != 4)
I.abort();
if (I)
I.onreadystatechange = function(){
};
I = ia();
if (I) {
I.open("GET", z + "&xhr=t&q=" + a + "&cp=" + F, true);
I.onreadystatechange = function(){
if (I.readyState == 4)
switch (I.status) {
case 403:
J = 1000;
break;
case 302:
case 500:
case 502:
case 503:
J++;
break;
case 200:
fa(eval(I.responseText));
default:
J = 0
}
};
I.send(null)
}
}
function Q(a){
var b = 0, d = 0;
var f = a.createTextRange(), g = document.selection.createRange();
if (f.inRange(g)) {
f.setEndPoint("EndToStart", g);
b = f.text.length;
f.setEndPoint("EndToEnd", g);
d = f.text.length
}
return b && d && b == d ? b : 0
}
window.google.ac = {
i: ba,
h: fa
};
})();
(function(){
var k = "/intl/zh-CN/images/toolbar_animation_20090112.png", l = 52, m = 37, n = 75, o = 100;
function p(b, d, c, a, e){
return {
url: b,
name: d,
tooltip: c,
color: a,
yAdjust: e
}
}
var q = [p("http://video.google.cn/", "<font size=-1>\u89c6\u9891</font>", "\u641c\u7d22\u70ed\u95e8\u7f51\u7edc\u89c6\u9891", "#54a70d", [2, 5]), p("http://images.google.cn/", "<font size=-1>\u56fe\u7247</font>", "\u641c\u7d22\u5168\u7403\u7684\u56fe\u7247", "#3b79e7", [2, 5]), p("http://shenghuo.google.cn/", "<font size=-1>\u751f\u6d3b</font>", "\u641c\u7d22\u60a8\u8eab\u8fb9\u7684\u5206\u7c7b\u751f\u6d3b\u4fe1\u606f", "#96cfec", [3, 7]), p("http://ditu.google.cn/", "<font size=-1>\u5730\u56fe</font>", "\u67e5\u8be2\u5730\u5740\u3001\u635c\u7d22\u5468\u8fb9\u548c\u89c4\u5212\u8def\u7ebf", "#e8d40f", [4, 9]), p("http://finance.google.cn/", "<font size=-1>\u8d22\u7ecf</font>", "\u5546\u4e1a\u4fe1\u606f\u3001\u8d22\u7ecf\u65b0\u95fb\u3001\u5b9e\u65f6\u80a1\u4ef7\u548c\u52a8\u6001\u56fe\u8868", "#ea504c", [3, 7]), p("http://translate.google.cn/", "<font size=-1>\u7ffb\u8bd1</font>", "\u5728\u7ebf\u7ffb\u8bd1\u5916\u6587\u6bb5\u843d\u3001\u7f51\u9875\u3001\u641c\u7d22\u7ed3\u679c", "#54a70d", [2, 5]), p("http://www.265.com/", "<font size=-1>265\u5bfc\u822a</font>", "\u5b9e\u7528\u7f51\u5740\u5927\u5168\uff0c\u4fbf\u6377\u76f4\u8fbe\u5e38\u7528\u7f51\u7ad9", "#d93c08", [2, 5])], r = [];
function s(b, d){
while (d && b != d)
d = d.parentNode;
return d == b
}
function u(b, d){
return function(c){
c = c || window.event;
var a = r[d], e = b == "mouseover", g = c.target || c.srcElement, f = c.relatedTarget || (e ? c.fromElement : c.toElement), h = !f || s(a.element, f), i = s(a.element, g);
if (e && !h || !e && (!f || i && !h)) {
var j = a.icon;
j.mouseTimeout = window.clearTimeout(j.mouseTimeout);
var t = e ? 1 : -1;
if (j.b != t)
j.mouseTimeout = window.setTimeout(j.e(t, undefined), e ? o / 3 : o)
}
}
}
function v(b, d, c){
google.bind(b, d, u(d, c))
}
function w(b, d, c){
this.c = b;
var a = document.createElement("div"), e = b.color, g = "background-color:" + e, f = "width:1px;height:1px;" + g + ";float:", h = '<div style="height:1px;overflow:hidden"><div style="' + f + 'left"></div><div style="' + f + 'right"></div></div>', i = "margin:0 1px;height:1px;overflow:hidden;" + g;
a.innerHTML = '<div style="display:none;position:absolute;top:0;left:0;z-index:2;background:#fff;cursor:pointer;cursor:hand"><a href="' +
d +
'" style="color:#444;text-decoration:none" target=_blank><div style="' +
i +
'"></div><div style="text-align:center;border-left:1px solid;border-right:1px solid;border-color:' +
e +
'">' +
h +
'<div style="margin:0 auto;white-space:nowrap;padding:.2em 0 0"><font size=-1><span>' +
c +
"</span></font></div>" +
h +
'</div><div style="' +
i +
'"></div><div style="height:4px" align="center"><div style="position:relative;top:-1px;z-index:3;width:8px;overflow:hidden;margin:0 auto;height:4px;background:no-repeat -260px ' +
-b.spriteCoordinateList[0].y +
'px"></div></div></a></div>';
this.h = a.getElementsByTagName("span")[0];
document.body.appendChild(a);
a.firstChild.firstChild.lastChild.firstChild.style.backgroundImage = "url(" + k + ")";
this.element = a.firstChild;
var j = r.length;
r.push({
icon: b,
element: this.element
});
v(this.element, "mouseover", j);
v(this.element, "mouseout", j)
}
w.prototype.play = function(b){
var d = this.c.element.firstChild, c = {
left: -d.offsetLeft,
top: 0
};
while (d) {
c.left += d.offsetLeft;
c.top += d.offsetTop;
d = d.offsetParent
}
var a = this.element.style;
if (a.display ==
"none") {
a.visibility = "hidden";
a.display = "block"
}
var e = this.element.offsetHeight, g = this.h.offsetWidth + 14;
if (a.visibility == "hidden") {
a.display = "none";
a.visibility = "visible"
}
a.width = g + "px";
c.left -= (g - this.c.element.parentNode.offsetWidth) / 2;
c.top -= e - 3;
c.top += 20 * Math.pow(1 - b / this.c.frames, 3);
a.left = c.left + "px";
a.top = c.top + "px";
if (b == 0 || this.c.b < 0)
a.display = "none";
else {
a.display = "";
var f = b / this.c.frames;
if ("opacity" in a)
a.opacity = f;
else
if ("MozOpacity" in a)
a.MozOpacity = f;
else
if ("KhtmlOpacity" in a)
a.KhtmlOpacity = f;
else
if ("filter" in a)
a.filter = "alpha(opacity=" + f * 100 + ")"
}
};
function x(b, d, c, a, e){
this.element = b;
this.mouseTimeout = null;
this.frames = d.length - 1;
this.spriteCoordinateList = d;
this.color = c;
this.d = null;
this.g = b.getElementsByTagName("div")[1];
this.i = new w(this, a, e);
this.b = -1;
this.a = 1;
var g = r.length;
r.push({
icon: this,
element: b
});
v(b, "mouseover", g);
v(b, "mouseout", g)
}
x.prototype.e = function(b, d){
var c = this;
return function(){
c.f(b, d)
}
};
x.prototype.f = function(b, d){
if (b) {
this.b = b;
this.mouseTimeout = window.clearTimeout(this.mouseTimeout);
this.d = window.clearTimeout(this.d)
}
typeof d != "undefined" && (this.a = d);
var c = this.spriteCoordinateList[this.a];
this.g.style.backgroundPosition = -c.x + "px " + -c.y + "px";
this.i.play(this.a);
var a = this.element.getElementsByTagName("font")[0].style;
if (this.b < 0) {
a.color = "#444";
a.textDecoration = "none"
}
else {
a.color = this.color;
a.textDecoration = "underline"
}
this.a += this.b;
if (this.a > this.frames)
this.a = this.frames - 1;
else
if (this.a < 0)
this.a = 1;
else
this.d = window.setTimeout(this.e(undefined, undefined), n)
};
google.y.first.push(function(){
var b = document.getElementById("tb");
if (b) {
try {
document.execCommand("BackgroundImageCache", false, true)
}
catch (d) {
}
var c = '<table style="margin:2em auto;border-collapse:collapse;line-height:1.4em" cellpadding="3" cellspacing="2" border="0"><tr>';
for (var a = 0; a < q.length; ++a) {
var e = q[a];
e.url = "/url?ct=pro&cd=" + a + "&source=cwh&q=" + encodeURIComponent(e.url);
var g = [], f = m * a;
for (var h = 0; h < 7; ++h)
if (h > 4)
g.push({
x: l * 4,
y: f - e.yAdjust[h - 5]
});
else
g.push({
x: l * h,
y: f
});
e.coordinates = g;
c += '<td valign=bottom style="text-align:center;padding:0 .35em 0 .4em;margin:0;cursor:pointer;cursor:hand"><a style="color:#444;text-decoration:none;vertical-align:bottom" href="' +
e.url +
'" target=_blank><div><div style="width:52px;height:37px;margin:.5em auto;cursor:pointer;cursor:hand;background:no-repeat 0 ' +
-f +
'px"></div><span style="white-space:nowrap">' +
e.name +
"</span></div></a></td>"
}
c += "</tr></table>";
b.innerHTML = c;
var i = b.getElementsByTagName("a");
for (var a = 0; a < i.length; ++a) {
i[a].firstChild.firstChild.style.backgroundImage = "url(" + k + ")";
new x(i[a], q[a].coordinates, q[a].color, q[a].url, q[a].tooltip)
}
}
});
})();
if (google.y.first) {
for (var a = 0, b; b = google.y.first[a]; ++a)
b();
delete google.y.first
}
for (a in google.y)
google.y[a][1] ? google.y[a][1].apply(google.y[a][0]) : google.y[a][0].go();
google.x = function(d, c){
c && c.apply(d);
return false
};
(function(){
var e = navigator.userAgent.toLowerCase();
google.isOpera = e.indexOf("opera") != -1;
google.isIE = document.all && e.indexOf("msie") != -1 && !google.isOpera;
google.isSafari = e.indexOf("safari") != -1;
google.time = function(){
return (new Date).getTime()
};
google.log = function(a, d){
(new Image).src = "/gen_204?atyp=i&ct=" + a + "&cad=" + d + "&zx=" + google.time()
};
google.xhr = function(){
var a = null;
if (window.XMLHttpRequest)
try {
a = new XMLHttpRequest
}
catch (d) {
}
else
if (window.ActiveXObject)
for (var b = 0, c; c = ["MSXML2.XMLHTTP.6.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"][b++];)
try {
a = new ActiveXObject(c);
break
}
catch (d) {
}
return a
};
function h(a, d){
var b = document.defaultView && document.defaultView.getComputedStyle(a, ""), c = b && b.getPropertyValue(d);
return document.defaultView && b && typeof c == "string" && parseInt(c, 10)
}
google.getHeight = function(a){
return h(a, "height") || a.offsetHeight
};
google.getWidth = function(a){
return h(a, "width") || a.offsetWidth
};
google.rhs = function(){
};
window.google.bind = function(a, d, b){
var c = "on" + d;
if (a.addEventListener)
a.addEventListener(d, b, false);
else
if (a.attachEvent)
a.attachEvent(c, b);
else {
var i = a[c];
a[c] = function(){
var f = i.apply(this, arguments), g = b.apply(this, arguments);
return f == undefined ? g : (g == undefined ? f : g && f)
}
}
};
})();
(function(){
var c, e, h, j = "", l = null, o = null, p = null, q = -1, s, t, u, v, w, x, z, A = 0, B = 0, C = null, D = 0;
var E = 0;
var F;
var I = null, J = 0;
var L = 0, aa = new RegExp("^[\\s\\u1100-\\u11FF\\u3040-\\u30FF\\u3130-\\u318F\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\u9FFF\\uAC00-\\uD7A3\\uF900-\\uFAFF\\uFF65-\\uFFDC]+$");
function ba(a, b, d, f, g){
s = a;
t = b;
z = ["/complete/search", "?hl=", google.kHL, "&gl=cn", (d ? "&ds=" + d : ""), (f ? "&pq=" + encodeURIComponent(f) : "")].join("");
google.bind(s, "submit", M);
t.setAttribute("autocomplete", "off");
google.bind(t, "blur", function(){
if (!L)
N();
L = 0
});
google.bind(t, "beforedeactivate", function(){
if (E) {
window.event.cancelBubble = true;
window.event.returnValue = false
}
E = 0
});
google.bind(t, "keydown", O);
google.bind(t, "keyup", P);
e = (h = (c = t.value));
F = Q(t);
u = document.createElement("table");
u.cellSpacing = (u.cellPadding = "0");
v = u.style;
u.className = "gac_m";
s.appendChild(u);
N();
R();
google.bind(window, "resize", R);
window.setInterval(function(){
var m = t.value;
if (m != c)
S(0);
c = m
}, 10);
w = T("aq", "f");
x = T("oq", e);
var k = document.createElement("style");
document.getElementsByTagName("head")[0].appendChild(k);
var i = null;
i = k.styleSheet;
var n = function(m, Y){
i.addRule(m, Y);
};
n(".gac_m", "font-size:13px;cursor:default;line-height:17px;border:1px solid black;z-index:99;background:white;position:absolute;margin:0;");
n(".gac_b", "background:#36c;color:white;");
var y = "white-space:nowrap;overflow:hidden;text-align:left;padding-left:3px;" + "padding-bottom:1px;";
n(".gac_c", y);
n(".gac_d", "white-space:nowrap;overflow:hidden;text-align:right;font-size:10px;color:green;padding:0 3px");
n(".gac_b td", "color:white");
n(".gac_e td", "padding:0 3px 2px;text-align:right;font-size:10px;line-height:15px");
n(".gac_e span", "color:#00c;text-decoration:underline;cursor:pointer");
U();
}
function R(){
if (u) {
v.left = V(t, "offsetLeft") + "px";
v.top = V(t, "offsetTop") + t.offsetHeight - 1 + "px";
v.width = t.offsetWidth + "px";
}
}
function T(a, b){
var d = document.createElement("input");
d.type = "hidden";
d.name = a;
d.value = b;
return s.appendChild(d)
}
function O(a){
var b = a.keyCode;
if (b == 27 && ca()) {
N();
W(e);
a.cancelBubble = true;
return a.returnValue = false
}
if (b == 38 || b == 40) {
B++;
if (B % 3 == 1)
S(b);
return false
}
}
function P(a){
var b = a.keyCode;
if (B == 0 && !(b == 38 || b == 40))
S(b);
B = 0;
}
function S(a){
if (a == 38 || a == 40) {
L = 1;
t.blur();
window.setTimeout(function(){
t.focus()
}, 10)
}
if (t.value != c) {
e = t.value;
F = Q(t);
x.value = e
}
a == 40 && da(q + 1);
a == 38 && da(q - 1);
R();
if (j != e && !C)
C = window.setTimeout(N, 500);
c = t.value;
if (c == "" && !l)
U()
}
function ea(){
if (D)
return;
if (p)
p.className = "gac_a";
this.className = "gac_b";
p = this;
for (var a = 0, b; b = o[a]; a++)
b ==
p &&
(q = a)
}
function da(a){
if (!j && e) {
h = "";
U();
return
}
if (e != j || !l)
return;
if (!o || o.length <= 0)
return;
if (!ca()) {
X();
return
}
var b = o.length - 1;
if (p)
p.className = "gac_a";
if (a == b || a == -1) {
q = -1;
W(e);
t.focus();
w.value = "f";
return
}
else
if (a > b)
a = 0;
else
if (a < -1)
a = b - 1;
q = a;
p = o.item(a);
p.className = "gac_b";
W(p.completeString);
w.value = p.completeId
}
function N(){
if (C) {
window.clearTimeout(C);
C = null
}
v.visibility = "hidden";
}
function X(){
v.visibility = "visible";
R();
D = 1
}
function ca(){
return v.visibility == "visible"
}
function fa(a){
A > 0 && A--;
if (a[0] != e)
return;
if (C) {
window.clearTimeout(C);
C = null
}
j = a[0];
while (u.rows.length)
u.deleteRow(-1);
var d = 0;
for (var f = 0, g; f < a[1].length; f++)
if (g = a[1][f]) {
d++;
var k = u.insertRow(-1);
k.onclick = function(){
W(this.completeString);
M();
s.submit();
};
k.onmousedown = ga;
k.onmouseover = ea;
k.onmousemove = function(){
if (D) {
D = 0;
ea.call(this)
}
};
k.completeString = g[0];
k.completeId = g[2];
k.className = "gac_a";
var i = document.createElement("td");
$(i, g[0]);
i.className = "gac_c";
aa.test(g[0]) && (i.style.paddingTop = "2px");
k.appendChild(i);
var r = document.createElement("td");
$(r, g[1]);
r.className = "gac_d";
k.appendChild(r);
}
if (d > 0) {
var n = u.insertRow(-1);
n.onmousedown = ga;
var y = document.createElement("td");
y.colSpan = 2;
n.className = "gac_e";
var m = document.createElement("span");
n.appendChild(y);
y.appendChild(m);
$(m, "关闭");
m.onclick = function(){
N();
j = "";
window.clearTimeout(l);
l = null;
w.value = "x"
}
}
q = -1;
o = u.rows;
(o.length > 0 ? X : N)()
}
function M(){
N();
if (x.value != t.value)
w.value = o.item(q).completeId;
else {
x.value = "";
if (A >= 10 || J >= 3)
w.value = "o"
}
}
function U(){
if (J >= 3)
return;
if (h !=
e &&
e) {
A++;
ha(encodeURIComponent(e));
t.focus()
}
h = e;
var f = 100;
for (var g = 1; g <=
(A - 2) /
2; ++g)
f *= 2;
f += 50;
l = window.setTimeout(U, f)
}
function W(a){
t.value = a;
c = a
}
function V(a, b){
var d = 0;
while (a) {
d += a[b];
a = a.offsetParent
}
return d
}
function $(a, b){
a.appendChild(document.createTextNode(b))
}
function ga(a){
E = 1;
return false
}
function ia(){
var a = null;
try {
a = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (b) {
try {
a = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (d) {
}
}
return a
}
function ha(a){
if (I && I.readyState != 0 && I.readyState != 4)
I.abort();
if (I)
I.onreadystatechange = function(){
};
I = ia();
if (I) {
I.open("GET", z + "&xhr=t&q=" + a + "&cp=" + F, true);
I.onreadystatechange = function(){
if (I.readyState == 4)
switch (I.status) {
case 403:
J = 1000;
break;
case 302:
case 500:
case 502:
case 503:
J++;
break;
case 200:
fa(eval(I.responseText));
default:
J = 0
}
};
I.send(null)
}
}
function Q(a){
var b = 0, d = 0;
var f = a.createTextRange(), g = document.selection.createRange();
if (f.inRange(g)) {
f.setEndPoint("EndToStart", g);
b = f.text.length;
f.setEndPoint("EndToEnd", g);
d = f.text.length
}
return b && d && b == d ? b : 0
}
window.google.ac = {
i: ba,
h: fa
};
})();
(function(){
var k = "/intl/zh-CN/images/toolbar_animation_20090112.png", l = 52, m = 37, n = 75, o = 100;
function p(b, d, c, a, e){
return {
url: b,
name: d,
tooltip: c,
color: a,
yAdjust: e
}
}
var q = [p("http://video.google.cn/", "<font size=-1>\u89c6\u9891</font>", "\u641c\u7d22\u70ed\u95e8\u7f51\u7edc\u89c6\u9891", "#54a70d", [2, 5]), p("http://images.google.cn/", "<font size=-1>\u56fe\u7247</font>", "\u641c\u7d22\u5168\u7403\u7684\u56fe\u7247", "#3b79e7", [2, 5]), p("http://shenghuo.google.cn/", "<font size=-1>\u751f\u6d3b</font>", "\u641c\u7d22\u60a8\u8eab\u8fb9\u7684\u5206\u7c7b\u751f\u6d3b\u4fe1\u606f", "#96cfec", [3, 7]), p("http://ditu.google.cn/", "<font size=-1>\u5730\u56fe</font>", "\u67e5\u8be2\u5730\u5740\u3001\u635c\u7d22\u5468\u8fb9\u548c\u89c4\u5212\u8def\u7ebf", "#e8d40f", [4, 9]), p("http://finance.google.cn/", "<font size=-1>\u8d22\u7ecf</font>", "\u5546\u4e1a\u4fe1\u606f\u3001\u8d22\u7ecf\u65b0\u95fb\u3001\u5b9e\u65f6\u80a1\u4ef7\u548c\u52a8\u6001\u56fe\u8868", "#ea504c", [3, 7]), p("http://translate.google.cn/", "<font size=-1>\u7ffb\u8bd1</font>", "\u5728\u7ebf\u7ffb\u8bd1\u5916\u6587\u6bb5\u843d\u3001\u7f51\u9875\u3001\u641c\u7d22\u7ed3\u679c", "#54a70d", [2, 5]), p("http://www.265.com/", "<font size=-1>265\u5bfc\u822a</font>", "\u5b9e\u7528\u7f51\u5740\u5927\u5168\uff0c\u4fbf\u6377\u76f4\u8fbe\u5e38\u7528\u7f51\u7ad9", "#d93c08", [2, 5])], r = [];
function s(b, d){
while (d && b != d)
d = d.parentNode;
return d == b
}
function u(b, d){
return function(c){
c = c || window.event;
var a = r[d], e = b == "mouseover", g = c.target || c.srcElement, f = c.relatedTarget || (e ? c.fromElement : c.toElement), h = !f || s(a.element, f), i = s(a.element, g);
if (e && !h || !e && (!f || i && !h)) {
var j = a.icon;
j.mouseTimeout = window.clearTimeout(j.mouseTimeout);
var t = e ? 1 : -1;
if (j.b != t)
j.mouseTimeout = window.setTimeout(j.e(t, undefined), e ? o / 3 : o)
}
}
}
function v(b, d, c){
google.bind(b, d, u(d, c))
}
function w(b, d, c){
this.c = b;
var a = document.createElement("div"), e = b.color, g = "background-color:" + e, f = "width:1px;height:1px;" + g + ";float:", h = '<div style="height:1px;overflow:hidden"><div style="' + f + 'left"></div><div style="' + f + 'right"></div></div>', i = "margin:0 1px;height:1px;overflow:hidden;" + g;
a.innerHTML = '<div style="display:none;position:absolute;top:0;left:0;z-index:2;background:#fff;cursor:pointer;cursor:hand"><a href="' +
d +
'" style="color:#444;text-decoration:none" target=_blank><div style="' +
i +
'"></div><div style="text-align:center;border-left:1px solid;border-right:1px solid;border-color:' +
e +
'">' +
h +
'<div style="margin:0 auto;white-space:nowrap;padding:.2em 0 0"><font size=-1><span>' +
c +
"</span></font></div>" +
h +
'</div><div style="' +
i +
'"></div><div style="height:4px" align="center"><div style="position:relative;top:-1px;z-index:3;width:8px;overflow:hidden;margin:0 auto;height:4px;background:no-repeat -260px ' +
-b.spriteCoordinateList[0].y +
'px"></div></div></a></div>';
this.h = a.getElementsByTagName("span")[0];
document.body.appendChild(a);
a.firstChild.firstChild.lastChild.firstChild.style.backgroundImage = "url(" + k + ")";
this.element = a.firstChild;
var j = r.length;
r.push({
icon: b,
element: this.element
});
v(this.element, "mouseover", j);
v(this.element, "mouseout", j)
}
w.prototype.play = function(b){
var d = this.c.element.firstChild, c = {
left: -d.offsetLeft,
top: 0
};
while (d) {
c.left += d.offsetLeft;
c.top += d.offsetTop;
d = d.offsetParent
}
var a = this.element.style;
if (a.display ==
"none") {
a.visibility = "hidden";
a.display = "block"
}
var e = this.element.offsetHeight, g = this.h.offsetWidth + 14;
if (a.visibility == "hidden") {
a.display = "none";
a.visibility = "visible"
}
a.width = g + "px";
c.left -= (g - this.c.element.parentNode.offsetWidth) / 2;
c.top -= e - 3;
c.top += 20 * Math.pow(1 - b / this.c.frames, 3);
a.left = c.left + "px";
a.top = c.top + "px";
if (b == 0 || this.c.b < 0)
a.display = "none";
else {
a.display = "";
var f = b / this.c.frames;
if ("opacity" in a)
a.opacity = f;
else
if ("MozOpacity" in a)
a.MozOpacity = f;
else
if ("KhtmlOpacity" in a)
a.KhtmlOpacity = f;
else
if ("filter" in a)
a.filter = "alpha(opacity=" + f * 100 + ")"
}
};
function x(b, d, c, a, e){
this.element = b;
this.mouseTimeout = null;
this.frames = d.length - 1;
this.spriteCoordinateList = d;
this.color = c;
this.d = null;
this.g = b.getElementsByTagName("div")[1];
this.i = new w(this, a, e);
this.b = -1;
this.a = 1;
var g = r.length;
r.push({
icon: this,
element: b
});
v(b, "mouseover", g);
v(b, "mouseout", g)
}
x.prototype.e = function(b, d){
var c = this;
return function(){
c.f(b, d)
}
};
x.prototype.f = function(b, d){
if (b) {
this.b = b;
this.mouseTimeout = window.clearTimeout(this.mouseTimeout);
this.d = window.clearTimeout(this.d)
}
typeof d != "undefined" && (this.a = d);
var c = this.spriteCoordinateList[this.a];
this.g.style.backgroundPosition = -c.x + "px " + -c.y + "px";
this.i.play(this.a);
var a = this.element.getElementsByTagName("font")[0].style;
if (this.b < 0) {
a.color = "#444";
a.textDecoration = "none"
}
else {
a.color = this.color;
a.textDecoration = "underline"
}
this.a += this.b;
if (this.a > this.frames)
this.a = this.frames - 1;
else
if (this.a < 0)
this.a = 1;
else
this.d = window.setTimeout(this.e(undefined, undefined), n)
};
google.y.first.push(function(){
var b = document.getElementById("tb");
if (b) {
try {
document.execCommand("BackgroundImageCache", false, true)
}
catch (d) {
}
var c = '<table style="margin:2em auto;border-collapse:collapse;line-height:1.4em" cellpadding="3" cellspacing="2" border="0"><tr>';
for (var a = 0; a < q.length; ++a) {
var e = q[a];
e.url = "/url?ct=pro&cd=" + a + "&source=cwh&q=" + encodeURIComponent(e.url);
var g = [], f = m * a;
for (var h = 0; h < 7; ++h)
if (h > 4)
g.push({
x: l * 4,
y: f - e.yAdjust[h - 5]
});
else
g.push({
x: l * h,
y: f
});
e.coordinates = g;
c += '<td valign=bottom style="text-align:center;padding:0 .35em 0 .4em;margin:0;cursor:pointer;cursor:hand"><a style="color:#444;text-decoration:none;vertical-align:bottom" href="' +
e.url +
'" target=_blank><div><div style="width:52px;height:37px;margin:.5em auto;cursor:pointer;cursor:hand;background:no-repeat 0 ' +
-f +
'px"></div><span style="white-space:nowrap">' +
e.name +
"</span></div></a></td>"
}
c += "</tr></table>";
b.innerHTML = c;
var i = b.getElementsByTagName("a");
for (var a = 0; a < i.length; ++a) {
i[a].firstChild.firstChild.style.backgroundImage = "url(" + k + ")";
new x(i[a], q[a].coordinates, q[a].color, q[a].url, q[a].tooltip)
}
}
});
})();
if (google.y.first) {
for (var a = 0, b; b = google.y.first[a]; ++a)
b();
delete google.y.first
}
for (a in google.y)
google.y[a][1] ? google.y[a][1].apply(google.y[a][0]) : google.y[a][0].go();
google.x = function(d, c){
c && c.apply(d);
return false
};