/**
 * NavSearchModule
 * @author Jae Cho
 *
 */
function NavSearchModule() {

    this._cont = null;

    this._name = NavSearchModule.NAME;

    this.initialize = function() {
        this._cont = $("#navSearchMod");
        this._cont.find("#nsmSubmitLink").bind("click", this, this._submitSearch);
        this._cont.find("#nsmInput").bind("keypress", this, function(e){
            var module = e.data;
            if (e.which == 13){
               module._submitSearch(e); 
            }
        })
    }

    this._submitSearch = function(e){
            var module = e.data;
            var text = escape(module._cont.find("#nsmInput").val());
            var selected = module._cont.find("#nsmSelect").val();
            window.location = "/profile/searchPage.php?" +
                          "pageAction=search&type="+selected+"&" +
                          "text=" + text;
    }
}

NavSearchModule.NAME = "NavSearchModule";

NavSearchModule.prototype = new Module();