function check(text) {
 if (text > '') {
 if (lang==0){
    window.open('http://dictionary.cambridge.org/results.asp?searchword='+text+ '&dict=L', 'dict_win', 'width=800,height=600,resizable=yes,scrollbars=yes');
 }else{
    window.open('http://lexicon.pathfinder.gr/?lookup='+text+'&go=%CC%E5%F4%DC%F6%F1%E1%F3%E7', 'dict_win', 'width=800,height=600,resizable=yes,scrollbars=yes');
 }
   }
}

var M = (navigator.appName == "Netscape" || navigator.product == 'Gecko') ? 1 : 0;
 if (M) document.captureEvents(Event.DBLCLICK);
 document.ondblclick = dict;

var vdic;
function dict() {
if (M) {
sel = document.getSelection();
check(sel);
}
else {
sel = document.selection.createRange();
if(document.selection.type == 'Text' && sel.text != '') {
document.selection.empty();
check(sel.text);
      }
   }
}

