function searchKeyPress(event, path) {
    if(event.keyCode == 13) {
        if(!window.event) {
            event.preventDefault();
        }
        goto_search(path);
        event.cancelBubble = true;
        event.returnValue = false;
    }
}

function goto_search(path) {
    var search = document.getElementsByName("search");
    search[0].value = trim(search[0].value);
    if(search[0].value.length >= 3 || search[0].value == '@') {
        location.replace(path + "/license/search.php?search="+encodeURIComponent(search[0].value));
    }
}

function trim(val) {
    return val.replace (/^\s+/, '').replace (/\s+$/, '')
}
