var agt=navigator.userAgent.toLowerCase();
this.major = parseInt(navigator.appVersion);
this.nav  = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)));
this.nav4 = (this.nav && (this.major == 4));
this.nav5 = (this.nav && (this.major == 5));
this.nav4up = this.nav && (this.major >= 5);
this.ie   = (agt.indexOf("msie") != -1);
this.ie4  = (this.ie && (this.major == 4));
this.ie5  = (this.ie && (this.major == 5));
this.ie5up  = this.ie  && (this.major >= 5);
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
//indexOf( int ch, int fromIndex ); 
//alert(substring('abcdef', 2, 3));
//alert('User Agent: ' + ua + ' pos of MSIE in ua string: ' + msie + ' pos of decimal after MSIE: ' + ua.indexOf(".",msie));
//alert(substring(msie+5, ua.indexOf( ".", msie)));
//alert(parseInt (ua.substring(msie+5, ua.indexOf( ".", msie))));

var fileID = null;
var df$ = null;
var rogersOpen = false;
var referer = "./";
var winstat = false;
var str = null;

baseURL=new Array (
"./",
"http://www.voicenet.com/~pmargush/",
"http://www.margush.com/philip/",
"http://www.margush.com/philip/",
"http://meltingpot.fortunecity.com/headfort/79/",
"http://callisto.guestworld.tripod.lycos.com/wgb/wgbsign.dbm?owner=",
"http://callisto.guestworld.tripod.lycos.com/wgb/wgbview.dbm?owner=",
"http://www.cs.uakron.edu/~margush/personal/", 
"http://www.geocities.com/pmargush/",
"http://www.margush.com/philip/",
"http://pmargush.freeservers.com/",
"http://phil_18951.tripod.com/",
"http://www.lehigh.edu/~emm2/"
);

FN=new Array (
"indexMA3.htm#WWWHO",
"statrd00 ",
"steinbg1 ",
"fourthst ",
"moving ",
"altoona ",
"510fift0 ",
"llyswen0 ",
"debauch ",
"indexMA3.htm#WWWHO"
);

function DispErr(msg,url,linnbr){
winOpen('errMsg= '+msg+'\n<br>URL= '+url+'\n<br>linNbr= '+linnbr+'\n<br>history.length= '+history.length+'\n<br>parent.length= '+parent.length+'\n<br>Desc= '+df$+'\n<br>pathName= '+location.pathname+'\n<br>name= '+ location.hash+'\n<br>host= '+ location.host+'\n<br>port= '+ location.port+'\n<br>href= '+ location.href)
alert(msg)
return true

}
window.onerror=DispErr;

function refer(i,s){
location.replace(addName(i,s));
}

function addName(pathIdx,fileName) {
var ext=".htm#DOCTOP";  
re=/ /gi;
return baseURL[pathIdx].concat(fileName.replace(re, ext));
}

var drawKnob = null;
function rogers(pathIdx,fileName,name,inWidth,inHeight,mode) {
if ((fileName == "nil ") || (fileName == "nil")){return;}

//mode: 0=minimal, 1=w/scrollbars, 2=w/all
var aw=790;
var ah=552;
var vLoc=0;
var hLoc=0;
var width=inWidth;
var height=inHeight;
str="resizable,"
if (window.screen) {
  aw = screen.availWidth - 10;
  ah = screen.availHeight - 20;    
  //alert("w"+aw+" "+inWidth+" h"+ah+" "+inHeight+"mode: "+mode);
  if ((inWidth > aw) || (inHeight > ah) || (mode > 0)) { 
    str +="scrollbars,";
    if (mode == 2) {
      str +="toolbar,location,status,menubar,";
      ah -= 140; }
    else {
      ah -= 10;}}}

//if ((inWidth > aw) || (inWidth < -1)) {alert("w"+aw); width=aw;}
if ((inWidth > aw) || (inWidth < 1)) {width=aw;}
//if ((inHeight > ah) || (inHeight < 1)) {alert("h"+ah); height=ah;} 
if ((inHeight > ah) || (inHeight < 1)) {height=ah;}

vLoc = (ah - height) / 2;
hLoc = (aw - width) / 2;
str += "left="+hLoc+",screenX="+hLoc+",top="+vLoc+",screenY="+vLoc; 
str += ",width="+width+",innerWidth="+width+",height="+height+",innerHeight="+height;  
drawKnob=window.open(addName(pathIdx,fileName), name, str);
drawKnob.focus();
}

function getScpt(Stype, fileID) {
var getScptStr='';
if (Stype == 1) {
getScptStr='<link rel=stylesheet href=\"' + fileID + '\" type=\"text/css\">';
  }
else {
getScptStr='<SCRIPT LANGUAGE=\"JavaScript1.2\" SRC=\"' + fileID + '\"></SCRIPT>'; 
};
return getScptStr;
}

function navOver(iNom,dir,over) {
  if (!document.images) {return};
    whichIm = document.images[iNom];
  if (over) { whichIm.src = "image/b_" + dir + "_over.gif" }
    else { whichIm.src = "image/b_" + dir + ".gif" }
  }
function navPress(iNom,dir,press) {
  whichIm = document.images[iNom];
  if (press) { whichIm.src = "image/b_" + dir + "_down.gif" }
  else { whichIm.src = "image/b_" + dir + ".gif" }
}

function fetchURL(pathIdx, fileIdx) {
window.location.href=addName(pathIdx,FN[fileIdx]);
}

function getURL(pathIdx, fileName) {
if (pathIdx==-1){pathIdx=0};
if(parent.frames.length!=0) {
window.top.location.href=addName(pathIdx,fileName);
}
else {
window.top.location.href=addName(pathIdx,fileName);
}
}

function doURL(pathIdx, fileName) {
if (pathIdx==-1){pathIdx=0};
rogers(pathIdx,fileName,'doURL',-1,-1,2);
}

function winOpen(msg) {
   msgWin=window.open("","winOpen","top=20,left=200,width=400,height=200,status=no,toolbar=no,menubar=no",'_top');
   msgWin.document.open()
   msgWin.document.write("<HEAD><TITLE>Message Window</TITLE></HEAD>");
   msgWin.document.write("<font size=2>" + msg + " </font>");
return true;
}

function winClose() { 
close();
}

function popupwindow(fileName) {
rogers(0,fileName,'popupwin',640,480,1)
}

function popwin(pathIdx,fileName,inWidth,inHeight) {
rogers(pathIdx,fileName,'popwin',inWidth,inHeight,1)
}

var marimba = null;
function allen(pathIdx,fileName,name) {
rogers(pathIdx,fileName,name,540,460,1)
}

function hammond(pathIdx,fileName,name) {
str +=",toolbar=yes,location=yes,status=yes,menubar=yes,resizable=yes";
drawBar=window.open(addName(pathIdx,fileName), name,str);
drawBar.focus();
}

function lastwork() {
//document.watch.peg.value = "Last Modified: " + document.lastModified;
var lastmod = document.lastModified;    
var lastmoddate = Date.parse(lastmod);  
if(lastmoddate && nav){
df$ = "<br>Steve Jobs, v.: " + major + "<em id=empr> Good! </em><li>But sorry , Netscape may make some pages display funkie! In otherwords: <font id=pt8> The codes presented here are sometimes specific to Internet Explorer running on the Microsoft Windows® platform. These pages may not work properly on other platforms.</font>";
}
else if (lastmoddate && ie) { 
df$= "<br>&#160;&#183;Bill Gates: " + ua + "<em id=empr> Yikes!</em> <li>The world began with <b>Coleco Adam</b> -- A man-boy with inquiring eyes fixed upon the blinking cursor of <i><b>ADAM BASIC</b></i>. Like President Nixon, <i>I didn't know it would come to this</i>.";
}
else {
df$=  "<i>anachronismos</i>";
lastmod = "Unknown";
}
document.write(" " + lastmod + "<li>Browser Opinion Class: " + df$); 
}

function whenLast() {
var lastMod = document.lastModified;    
return lastMod;
}


function twothou() {
var oneday = 1000 * 60 * 60 * 24;
var cd = 0;
var td = new Date();
var yr = td.getYear();
while (td.getMonth() > 0) {
td.setTime(td - oneday);
cd = cd +1;
}
while (td.getDate() != 1) {
td.setTime(td - oneday);
cd = cd +1
}
cy = 99 - yr 
cd = (365 - cd) + cy*365 
document.write(cd);
}

function dismiss(nomin) {
if (nomin == null) {nomin=''};
if ((opener == null) && (history.length == 0)) {
  df$=baseURL[0]+'index.htm#DOCTOP'; 
  location.replace(df$); } 
else if (opener != null) {
     window.close(); } 
   else {
     history.back();  
   }
}

function doAbout() {
if (abtBox==null) return;
if (abtBox.style.visibility == "hidden") {abtBox.style.visibility = "visible"}else{abtBox.style.visibility = "hidden"}
}

function togVis(inName) {
if (inName==null) return;
if (inName.style.visibility == "hidden") {inName.style.visibility = "visible"}else{inName.style.visibility = "hidden"}
}

function togDsp(inName) {
if (inName==null) return;
if (inName.style.display == "none") {inName.style.display = "inline"}else{inName.style.display = "none"}
}