//don't forget to add <body ondblclick="dictionary()">
function dictionary() {
if (navigator.appName!='Microsoft Internet Explorer') {
	var t = document.getSelection();
	od(t);
	}
else {
	var t = document.selection.createRange();
	if(document.selection.type == 'Text' && t.text>'') {
		document.selection.empty();
		od(t.text);}
   }
function od(t) {
text = text.replace(/[́!.:?,;"]/g, '').replace(/[\n\t ]/g, ' ').replace(/^\s+|\s+$/, '');
if (t) window.open('http://pt.thefreedictionary.com/'+encodeURIComponent(t), 'dict', 'width=700,height=500,resizable=1,menubar=1,scrollbars=1,status=1,titlebar=1,toolbar=1,location=1,personalbar=1');
}   
};
status='double-click any word - get its instant definition in the dictionary.';
document.ondblclick=dictionary; //works for IE only. For other browsers add <body ondblclick="dictionary()">
