 
var NS = (navigator.appName == "Netscape" || navigator.product == 'Gecko') ? 1 : 0;
if (NS) document.captureEvents(Event.DBLCLICK); 
document.ondblclick = dict;
var dictvar;
function dict()
 { 
 	if (NS) 
	 	{ 
		 	t = document.getSelection();
			pass_to_dictionary(t);
		 } 
	else
		 { 
		 	t = document.selection.createRange();
			if(document.selection.type == 'Text' && t.text != '')
			 	{ 
				 	document.selection.empty();
					pass_to_dictionary(t.text);
				 }
		  }
 } 
function pass_to_dictionary(text) 
	{ 
		//alert(text);	
		if (text > '')
		 { 
		 	window.open('http://dictionary.cambridge.org/learnenglish/results.asp?searchword='+text+ '&dict=L', 'dict_win', 'width=650,height=400,resizable=yes,scrollbars=yes');
		  }
	 }
 
