var ua = navigator.userAgent.toLowerCase(); var isIE = ua.indexOf("msie") > -1; var isFF = ua.indexOf("firefox") > -1; function regE(c, b, a) { if (window.attachEvent) { c.attachEvent(b, a) } else { c.addEventListener(b.replace(/^on/, ""), a, true) } } function os(obj) { return document.getElementById(obj).style } function __firefox() { HTMLElement.prototype.__defineGetter__("runtimeStyle", __element_style); window.constructor.prototype.__defineGetter__("event", __window_event); Event.prototype.__defineGetter__("srcElement", __event_srcElement) } function __element_style() { return this.style } function __window_event() { return __window_event_constructor() } function __event_srcElement() { return this.target } function __window_event_constructor() { if (document.all) { return window.event } var e = __window_event_constructor.caller; while (e != null) { var d = e.arguments[0]; if (d) { var a = d.constructor; if (a.toString().indexOf("Event") != -1) { return d } } e = e.caller } return null } if (window.addEventListener) { __firefox() } var state = false; if (isIE) { if (document.readyState == "complete") { state = true } } else { window.onload = function() { state = true } } document.onclick = function() { os("suggest").display = "none" }; function googleHint(a) { if (isIE) { if (document.readyState == "complete") { state = true } } else { window.onload = function() { state = true } } if (state) { var d = document.body.appendChild(document.createElement("script")); d.language = "javascript"; d.id = "gsuggest"; d.charset = "utf-8"; d.src = "http://suggest.taobao.com/sug?code=utf-8&callback=TB.Suggest.callback&q=" + encodeURIComponent(a) + "&t=" + Math.random() } } function bdhint() { myhint(event, document.getElementById("key")) } regE(document.getElementById('key'), "onkeyup", bdhint); var sg_tb = document.getElementById("suggest"); function sg_trover(a, d) { var e = sg_tb; if (e._oldhi != "") { e.firstChild.rows[e._oldhi].className = "trout" } a.className = "trover"; sg_tb._i = d; e._oldhi = d } function searchKey(d) { document.getElementById("key").focus(); document.getElementById("key").value = d } function myhint(event, obj) { var keyword = obj; var h = document.getElementById("suggest"); h._oldhi = ""; if (!keyword.value || !keyword.value.length || event.keyCode == 27 || event.keyCode == 13) { h.style.display = "none"; return } if (event.keyCode == 38 || event.keyCode == 40) { h._maxi = h.firstChild.rows.length - 1; if (h.style.display == "none") { return } if (event.keyCode == 38) { if (h._i == -1) { h._i = h._maxi } else { h._i-- } } else { h._i++ } if (h._oldhi != "") { h.firstChild.rows[h._oldhi].className = "trout" } h._oldhi = h._i; if (h._i == -1 || h._i > h._maxi) { h._oldhi = "" } for (var i = 0; i < h.firstChild.rows.length; i++) { h.firstChild.rows[i].className = "trout" } if (h._i >= 0 && h._i < h.firstChild.rows.length) { with (h.firstChild.rows[h._i]) { className = "trover"; tmp = cells[0].innerHTML.split("blank>"); keyword.value = tmp[1].replace("</A>", "") } } else { keyword.value = h._kw; h._i = -1 } } else { h._i = -1; h._kw = keyword.value; googleHint(keyword.value) } } window.Taokk = {}; window.Taokk.sug = function(a) { var f = ""; if (state) { var h = 0; for (var e = 0; e < c.length; e += 1) { var g = c[e]; f += '<tr onmouseover="sg_trover(this,' + h + ');" onmouseout="this.className=\'trout\';">'; f += "<td onclick=\"search('" + g + "');\" oncontextmenu=\"search('" + g + "');return false;\">"; f += "<a  target=\"_blank\" onclick=\"$('suggest').style.display='none';\">" + g + "</a>"; f += "</td></tr>"; h++ } document.getElementById("suggest").innerHTML = '<table width="100%" id="baidumes" class="suggestTable">' + f + "</table>"; document.getElementById("suggest").style.display = "block" } }; TB = {}; TB.Suggest = {}; TB.Suggest.callback = function(a) { c = a.result; if (!c) { return } var f = ""; if (state) { var h = 0; for (var e = 0; e < c.length; e += 1) { var g = c[e][0]; var hh = c[e][1]; url = "/keys-" + encodeURI(g) + '-0-0/'; f += '<tr onmouseover="sg_trover(this,' + h + ');" onmouseout="this.className=\'trout\';">'; f += "<td onclick=\"searchKey('" + g + "');\" oncontextmenu=\"searchKey('" + g + "');return false;\">"; f += '<em>Ô¼&nbsp;' + hh + '&nbsp;¼þÉÌÆ·</em><a href="' + url + '" target="_blank" onclick="document.getElementById(\'suggest\').style.display=\'none\';">' + g + "</a>"; f += "</td></tr>"; h++ } document.getElementById("suggest").innerHTML = '<table class="suggestTable">' + f + "</table>"; document.getElementById("suggest").style.display = "block" } };
