function openPopup(u,n){window.open(u,n,"width=560,height=560,status=no,location=no,scrollbars=yes,resizable=yes,screenX=25,screenY=25,left=25,top=25");return false;}
function citation(d,p){w=window.open('/citethispage.php?dir='+d+'&passpage='+p+'&referer='+escape(location.href)+'&title='+escape(document.title),'_blank','width=550,height='+(screen.availHeight-200)+',screenX=10,screenY=10,status=yes,resizable=yes,scrollbars=yes,toolbar=yes');w.focus();}
function EmailForm(d){w=window.open('/emailpage.php?dir='+d+'&referer='+escape(location.href)+'&title='+escape(document.title),'_blank','width=550,height=610,status=no,resizable=yes');w.focus();}

function hotWords(){
 var hw=this;
 this.version="2";
 this.dest="http://www.infoplease.com";
 this.source=window.location.hostname;
 this.shiftKey=false;
 this.title="";
 this.str="";

 this.get=function(){
  w=window;d=document;str="";
  wspc=new RegExp('([ \\t\\v\\f\\r\\n]|%0D|%0A|%20|%u2014)+','g');
  if(w.getSelection){str=w.getSelection();}
  else if(d.getSelection){str=d.getSelection();}
  else if(d.selection){str=d.selection.createRange().text;}
  str=escape(str);
  return(str.replace(wspc,"%20"));
 };

 this.search=function(){
  str=hw.str||hw.get();
  if(str&&str.length){
   url=hw.dest+'/search?q='+str+'&fr='+hw.source+'&ver='+hw.version;
   w=window.open(url,'HotWords','toolbar=yes,menubar=yes,copyhistory=no,scrollbars=yes,resizable=yes,width=790,height=600');
   if(w){w.focus();}
   return false;}};

 this.mouseOver=function(a){hw.str=hw.get();hw.title=a.title;if(hw.str){a.title='Search Infoplease for "'+unescape(hw.str)+'"';}};

 this.mouseOut=function(a){hw.str="";a.title=hw.title;};

/* this.keyDown=function(e){
  e=e||window.event;
  k=e.keyCode||e.which;
  if(e.shiftKey){hw.shiftKey=true;}
  else if(k==16){hw.shiftKey=true;}
  if(k==13&&hw.shiftKey){hw.shiftKey=false;hw.search();}};

 this.keyUp=function(e){e=e||window.event;if(e.shiftKey){hw.shiftKey=false;}else if(e.which&&e.which==16){hw.shiftKey=false;}};

 this.keyPress=function(e){
  e=e||window.event;
  k=e.keyCode||e.which;
  if ((k==13||k==10)&&(hw.shiftKey||e.shiftKey)) {
   e.cancelBubble = true;
   e.returnValue = false;
   if (e.preventDefault) {e.preventDefault();}
   if (e.stopPropagation) {e.stopPropagation();}
   hw.shiftKey=false;
   hw.search();
   return false;
  }

};
*/
  if(document.ondblclick){document.ondblclick=function(){document.ondblclick();this.search();};}
  else{document.ondblclick=this.search;}
  /*
if(document.onkeydown){document.onkeydown=function(){document.onkeydown();this.keyDown();};}
  else{document.onkeydown=this.keyDown;}
  if(document.onkeyup){document.onkeyup=function(){document.onkeyup();this.keyUp();};}
  else{document.onkeyup=this.keyUp;}
  if(document.onkeypress){document.onkeypress=function(){document.onkeypress();this.keyPress();};}
  else{document.onkeypress=this.keyPress;}
*/
}
