// Javascript from Moodle modules
function getSel() { 
    text = (document.all) ? document.selection.createRange().text : document.getSelection();
    return text;
}     
    function submitaction(action, linkid) {
        document.forms[0].action.value = action;
        document.forms[0].linkid.value = linkid;
        document.forms[0].submit();
    }        

    document.onmouseup = displayblock;
    
function displayblock(){
    text = (document.all) ? document.selection.createRange().text : window.getSelection();
    if (text != '') {
        document.multisearch.search.value=text;
        d = document.getElementById("buttons");
 
        overlib('<center>'+d.innerHTML+'</center>', FGCOLOR, '#FFFFFF', BGCOLOR, '#FF0000', STICKY);
    } else {
     nd();
    }   
}
