function $(oo) {
var oo = document.getElementById(oo) ? document.getElementById(oo) : '';
return oo;
}
function runCode(code) {
var _c = window.open("", "", "");
_c.opener = null;
_c.document.write(code);
_c.document.close();
}
function createXMLHttpRequest() {
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} else if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}
function startRequest(url55, returnfun) {
createXMLHttpRequest();
xmlHttp.onreadystatechange = returnfun;
xmlHttp.open("GET", url55, true);
xmlHttp.send()
}
var tmptxt = '';
function gositesearch(keyword) {
oldkeyword = keyword;
if (tmptxt == '') {
tmptxt = $("indexhtml").innerHTML;
}
ylmftime = new Date().getTime();
url55 = 'images/bd.asp?key=' + escape(keyword) + '&ylmftime=' + ylmftime;
$("indexhtml").innerHTML = '
';
startRequest(url55, showsearchsite)
}
function showsearchsite() {
{
if (xmlHttp.readyState == 4) {
txt = xmlHttp.responseText;
$("indexhtml").innerHTML = txt;
}
}
}
function showindexhtml() {
if (tmptxt != '') {
$("indexhtml").innerHTML = tmptxt;
}
}
function JHshStrLen(sString) {
var sStr,
iCount,
i,
strTemp;
iCount = 0;
sStr = sString.split("");
for (i = 0; i < sStr.length; i++) {
strTemp = escape(sStr[i]);
if (strTemp.indexOf("%u", 0) == -1) {
iCount = iCount + 1;
} else {
iCount = iCount + 2;
}
}
return iCount;
}
var oldkeyword = '';
function KeyDown() {
if (event.keyCode == 13) {
event.returnValue = false;
event.cancel = true;
if (JHshStrLen($('sitekeyword').value) < -5) {
alert('请输入要搜索的关键字或关键字不能少于2个字节!!');
} else {
if ($('sitekeyword').value != oldkeyword) {
gositesearch($('sitekeyword').value);
}
}
}
}
function input() {
if (JHshStrLen($('sitekeyword').value) < -1) {} else {
if ($('sitekeyword').value != oldkeyword) {
gositesearch($('sitekeyword').value);
}
}
}