// add to your web page: <body ondblclick="beolingus('_service_')">
// replace _service_ by:
// deen for German/English, de-en German to English, en-de English to German
// dees for German/Spanish, de-es German to Spanish, es-de Spanish to German
// dept for German/Portuguese, de-pt German to Portuguese, es-pt Portuguese to German
function beolingus(service) {
    var t = '';
    if (navigator.appName != 'Microsoft Internet Explorer') {
        t = document.getSelection();
    } else {
        var tt = document.selection.createRange();
        if (document.selection.type == 'Text' && tt.text > '') {
            document.selection.empty();
            t = tt.text;
        }
    }
    if (! t) return false;
    t = t.replace(/[.!?:,;"]/, '');
    while (t.substr(t.length - 1, 1) == ' ') 
        t = t.substr(0, t.length - 1);
    while (t.substr(0, 1) == ' ') 
        t = t.substr(1);
    if (t) {
        s = service.search(/^[a-z-]$/) != -1 ? ';service=' + service : '';
        var w = window.open('http://dict.tu-chemnitz.de/?query=' +
        encodeURIComponent(t) + s + ';mini=1', 'dict', 'width=280,height=400,resizable=1,scrollbars=1,status=1,titlebar=1,location=1');
        w.focus();
    }
}   
// status = 'double-click any word to get a translation';
// document.ondblclick = beolingus(''); // for IE only


