today=new Date;
day=today.getDay();
month=today.getMonth();
date=today.getDate();
year=today.getYear();
dayName=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
monName=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
calendar=today.getYear()
if (calendar<1900){calendar=calendar+1900}
bannerday=dayName[day]+", "+monName[month]+" "+date;
dailyday=monName[month]+" "+date+", "+calendar;
datenoyear=monName[month]+" "+date;

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 clearfield(){if(document.search.query.value=='Enter search term'){document.search.query.value='';}}
function preload(u){if(document.images){i=new Image;i.src=u;}}
function changeImage(o,n){if(document.images){document[o].src=n;}return true;}
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();}

var IPHWver="1";
var IPHWstr="";
var IPHWdest="";
var IPHWid="ip";
var waitingForClick=false;

function IPHWntg (){
var w=window;
var str;var rng;wspc=new RegExp('([ \\t\\v\\f\\r\\n]|%0D|%0A|%20)+','g');
if(w.getSelection!=null){str=escape(w.getSelection());str=str.replace(wspc,"%20");}
else if(w.document.getSelection!=null){str=escape(w.document.getSelection());str=str.replace(wspc,"%20");}
else if(w.document.selection.type=="Text" ){rng=w.document.selection.createRange();str=rng.text;}
if(str) return (str);
return "";}

function IPHWgrab(){
IPHWstr=IPHWntg();
if (IPHWstr.length>0){window.top.status='Click to look up "'+unescape(IPHWstr)+'"'}
else{window.top.status='Infoplease Hotwords: select text to look up'}
return true;}

function IPHWout(){window.top.status="";return true;}

function IPHWgo(){
if ((IPHWstr.length>0)){searchPop(IPHWstr)}
else{alert('To use the HotWords'+String.fromCharCode(174)+' lookup button:\n\n1. Highlight a word or phrase\n2. Click the Hotwords button\n3. A new window will pop up with search results for your word or phrase')}
return false;}

function clickHandler(ev){
if(waitingForClick){waitingForClick=false;triggerPop()}
else{waitingForClick=true;setTimeout("clickHandlerTimeout()", 350)}
return true}

function clickHandlerTimeout(){waitingForClick=false;return true;}

function doubleClickHandler(ev){if(waitingForClick){waitingForClick=false;triggerPop();}return true}

function triggerPop() {
IPHWstr=IPHWntg();
if(IPHWstr!=""){searchPop(IPHWstr)}
else{setTimeout("searchPop(IPHWntg())",150)}
return true}

function searchPop(IPHWstr){
if (!IPHWstr || !IPHWstr.length) return false; 
url=IPHWdest+'/search.php3?query='+IPHWstr+'&hw='+IPHWid+IPHWver;
window.open (url,'_blank','directories=no,copyhistory=no,scrollbars=yes,resizable=yes,width=620,height=460');
return true}

if((window.captureEvents)&&(parseInt(navigator.appVersion)<5)){
window.captureEvents(Event.MOUSEUP);
window.onmouseup=clickHandler}
else{
document.onclick=clickHandler;
document.ondblclick=doubleClickHandler}
