﻿document.onkeydown = function (e) {

    if (!e) e = window.event; //火狐中是 window.event
    if ((e.keyCode || e.which) == 13) {
        var url = window.location.href;
        if (url == 'http://www.yaoba18.tv/' || url == 'http://www.yaoba18.tv/default.html')
        { s(); }
    }
}

function showhidesmdiv(display) {
    if (display == "0") {
        document.getElementById("selectmerchant").style.display = "";
        //document.getElementsByTagName("select").BranchId.style.visibility = "hidden";
    }
    if (display == "1") {
        document.getElementById("selectmerchant").style.display = "none";
        //document.getElementsByTagName("select").BranchId.style.visibility = "";
    }
}
var timeInterval = 100;
mainLoop = function () {
    var val = queryField.value;
    if (lastVal != val && val != "") {
        timeInterval = 500;
        //        var response = Yb.WEB.aspx.proscenium.Control.top.GetSearchItems(val, 7, 4);
        //        var response = getArray(val);
        showQueryDiv(val);
        lastVal = val;
    }
    if (val == "") { timeInterval = 100; showDiv(false); }
    setTimeout('mainLoop()', timeInterval);
    return true;
}

searthKey = function (id) {
    var key = document.getElementById(id).value;
    if (key != "" && key != "支持中文、拼音搜索") {
        window.location = 'http://www.yaoba18.tv/sousuo/default1.html?key=' + escape(key);
    } else window.location = 'http://www.yaoba18.tv/sousuo/default1.html';
}
