var click_block=0
var IE=(navigator.appName=='Microsoft Internet Explorer'?1:0);

function dictionary() {
if (click_block) {
click_block=0
return
}

if (!IE) {
t = document.getSelection();
opennewdictwin(t);
}
else {
t = document.selection.createRange();
if(document.selection.type == 'Text' && t.text != '') {
document.selection.empty();
opennewdictwin(t.text);
      }
   }
}
function opennewdictwin(text) {
while (text.substr(text.length-1,1)==' ') 
	text=text.substr(0,text.length-1)
while (text.substr(0,1)==' ') 
	text=text.substr(1)
if (text > '') {
document.location='http://www.thefreedictionary.com/'+escape(text);
   }
}

function layer(id){
  var res
  if(document.getElementById) res=document.getElementById(id)
  if(document.all) res=document.all[id]
  if (res) return res.style
  return null
}

var nsx;
var nsy;
if (!document.all) {
	document.captureEvents(Event.MOUSEMOVE);	
	document.onmousemove=get_mouse;
}
function get_mouse(e) {
	nsx=e.pageX-10;
	nsy=e.pageY+5;
}
function t_i(id) {
	var hlp=layer('Tp'+id)
	if (hlp) {
	if (document.all) {
	 nsy=event.y+document.body.scrollTop
	 nsx=event.x+document.body.scrollLeft
	}
	hlp.top=nsy+20
	hlp.left=(nsx>610?nsx-470:140)		
	hlp.visibility='visible'
}}
function t_o(id) {
	var hlp=layer('Tp'+id)
	if(hlp) hlp.visibility='hidden'
}
function el(a){
window.open('http://'+a, '_blank')
return false
}
function setcolor(color) {
return;
if (Ov2)
for (i in Ov.all)
if(Ov.all[i].tagName=='A') {
Ov.all[i].style.color=color
Ov2.all[i].style.color=color
}}
function blink(i) {
return;
if (i) {
setcolor('#0000FF');
window.setTimeout('blink(0)',100);
}
else{
setcolor('#0000CF');
window.setTimeout('blink(1)',100);
}}
function eml2(path, name){
open('/_/viewer.aspx?path='+escape(path)+'&name='+name,'img','');
}
function eml(path, name){
location='/_/viewer.aspx?path='+escape(path)+'&name='+name,'view';
}
function openerlink(link) {
opener.location='http://encyclopedia.thefreedictionary.com/'+link;
self.close()
return false;
}

function m_over(url){
window.status=url;
return true;
}
function m_out(){
window.status = '';
}
function endPlay(){
sound_frame.document.location='about:blank';
}

function play(File) {
if (IE) {
  var sf=sound_frame.document;
  sf.write('<html><head><bgsound src="http://img.thefreedictionary.com/hm/prons/'+File+'.wav"><\/head><\/html>');    
  sf.close();
  window.onblur=endPlay;
} else
  location=('http://img.thefreedictionary.com/hm/prons/'+File+'.wav');
window.status='';
}

function pron_key(t) {
var pkw=open('/_/pk.htm','pk','width=630,height=675,statusbar=0,menubar=0');
return false;
}

