
    var searchText;

    function GetSearchBox()
    {
        var txt = document.getElementById("searchBox");

        if (txt == null)
            txt = document.getElementById("ctrBasicSearch_search");

        return txt;
    }

    function InitialiseSearch(text)
    {
        searchText = text;

        var txt = GetSearchBox();
        if (txt == null) return;
        txt.value = text;
        txt.onkeypress = GoSearch;

        txt.onblur = FocusOut;
        txt.onfocus = FocusIn;
     
        var summary = $get("searchSummaryContainer");
        summary.style.display = "none";
    }

    function GoSearch(e)
    {
        var characterCode;

        if (typeof(event) != "undefined")
        {
            e = event;
            characterCode = e.keyCode;
        }
        else
        {
            characterCode = e.which;
        }

        if(characterCode == 13)
        {
            var btn = $get("ctrBasicSearch_searchButton");
            btn.focus();
            return false;
        }
        else
        {
            return true; 
        }
    }

    function FocusIn()
    {
        var txt = GetSearchBox();
        if (txt.value == searchText)
        {
            txt.value = "";
        }
    }

    function FocusOut()
    {
        var txt = GetSearchBox();
        if (txt.value.length == 0)
        {
            txt.value = searchText;
        }
    }

