function IncludeJavaScript(jsFile) {
    document.write('<script type="text/javascript" src="' + jsFile + '"></script>');
}

document.write('<link rel="shortcut icon" href="../images/favicon.ico" type="image/x-icon" />');
document.write('<link rel="icon" href="../images/favicon.ico" type="image/x-icon" />');

IncludeJavaScript('com/Scripts/jquery-1.6.4.min.js');
IncludeJavaScript('com/Scripts/common.js');



String.prototype.Trim = function() {
    return this.replace(/(^\s*)|(\s*$)/g, "");
}
if (document.all) {//for IE
    window.attachEvent("onload", InitPageSearch);
} else {//for firefox
    window.addEventListener('load', InitPageSearch, false);
}

function changemenu() {
    var ev = document.all ? window.event : e;
    if (ev.keyCode == 13) {
        InitPageSearch();
    }

}

function InitPageSearch() {
    var k = document.getElementById('Keyword');
    var k1 = document.getElementById('textfield4');

    var b = document.getElementById('btnSearch');
    var b1 = document.getElementById('btnSearch1');


    if (k) { //全站搜索
        k.onfocus = function() {
//            if (this.value.Trim() == "\u4ECE\u4F60\u611F\u5174\u8DA3\u7684\u5F00\u59CB\u2026\u2026") { this.value = ""; }
//            this.style.color = '#000';
        };
        k.onblur = function() {
            if (this.value == "") {
//                this.value = "\u4ECE\u4F60\u611F\u5174\u8DA3\u7684\u5F00\u59CB\u2026\u2026";
//                this.style.color = '#666';
            }
        };

//        k.onblur();

        if (b) { SearchUrl.Init(k, b); }

        if (b1) { SearchUrl.Init(k1, b1); }



        document.onkeydown = function(e) {
            var ev = document.all ? window.event : e;
            if (ev.keyCode == 13) {
                return false;
                //                var actId = document.activeElement.id;
                //                //                $("#Keyword").focus(function() {
                //                //                    if (k.value.Trim() != "\u4ECE\u4F60\u611F\u5174\u8DA3\u7684\u5F00\u59CB\u2026\u2026") {
                //                //                        SearchUrl.Init(k, b);
                //                //                    }
                //                //                    if (k1.value.Trim() != "\u4ECE\u4F60\u611F\u5174\u8DA3\u7684\u5F00\u59CB\u2026\u2026") {
                //                //                        SearchUrl.Init(k1, b1);
                //                //                    }
                //                //                });
                //                var qian = "ctl00_ctl00_ContentPlaceHolder2_ContentPlaceHolder1_";
                //                //上搜索
                //                if (actId == "Keyword") {
                //                    if (k.value.Trim() != "\u4ECE\u4F60\u611F\u5174\u8DA3\u7684\u5F00\u59CB\u2026\u2026") {
                //                        SearchUrl.Init(k, b);
                //                    }
                //                }
                //                //下搜索
                //                if (actId == "textfield4") {
                //                    if (k1.value.Trim() != "\u4ECE\u4F60\u611F\u5174\u8DA3\u7684\u5F00\u59CB\u2026\u2026") {
                //                        SearchUrl.Init(k1, b1);
                //                    }
                //                }
                //                if (actId == qian + "txtlogin_zh") {
                //                    if ($("#" + basestr + "txtlogin_zh").val() == "") {
                //                        alert("请输入账号");
                //                        return false;
                //                    }
                //                }
                //                if (actId == qian + "txtlogin_mm") {
                //                    alert("dneglu2");
                //                }
            }
        }


    }
}
var SearchUrl = {
    Init: function(k, b) {
        var pram = SearchUrl.FilterKey(SearchUrl.DecodeKey(SearchUrl.GetParamValue(window.location.href, 'key'))).Trim();
        if (pram != '' && pram != "\u4ECE\u4F60\u611F\u5174\u8DA3\u7684\u5F00\u59CB\u2026\u2026") {
            k.value = pram;
            k.style.color = '#000';
        }
        b.onclick = function() {

            if (k.value.Trim() != '' && k.value.Trim() != "\u4ECE\u4F60\u611F\u5174\u8DA3\u7684\u5F00\u59CB\u2026\u2026") {
                window.location.href = 'Search.aspx?keyword=' + SearchUrl.EncodeKey(SearchUrl.FilterKey(k.value.Trim()));
            } else {
                //                window.location.href = window.location.pathname;
            }
        }



        if (k.value.Trim() != '' && k.value.Trim() != "\u4ECE\u4F60\u611F\u5174\u8DA3\u7684\u5F00\u59CB\u2026\u2026") {
            window.location.href = 'Search.aspx?keyword=' + SearchUrl.EncodeKey(SearchUrl.FilterKey(k.value.Trim()));
        }

    },
    GetParamValue: function(url, name) {
        var re = new RegExp("[&?]" + name + "=([^&?]*)", "ig");
        return ((url.match(re)) ? (url.match(re)[0].substr(name.length + 2)) : '');
    },
    DecodeKey: function(v) { if (v && v != '') { return unescape(decodeURI(v)); } return v; },
    EncodeKey: function(v) { if (v && v != '') { return encodeURI(escape(v)); } return v; },
    FilterKey: function(v) { return v.replace(/([^\u0391-\uFFE5a-zA-Z0-9])/ig, ''); }
}


//下面是收听记录实现效果js
 
<!--
var timeout         = 500;
var closetimer		= 0;
var ddmenuitem      = 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 
// -->
