/*

  Script copyrighted Cambridge university press 2000
  Do *not* modify without written permission to do so..

   Usage of script :

   * Place dictionary.js in the directory on your website
   * Add following to your html file(s)
     <script language="javascript1.2" src="dictionary.js" ></script>

  When a people doubleclick on a word that word will be looked up in our
  online dictionary.

*/

var NS = (navigator.appName == "Netscape") ? 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) {
 if (text > '') {
 location.href="/results.asp?searchword="+text;
   }
}
