/* Definition of class Folder */ 
 
function Folder(folderDescription, hreference)  
{ 
  this.desc = folderDescription 
  this.hreference = hreference 
  this.id = -1   
  this.navObj = 0  
  this.iconImg = 0  
  this.nodeImg = 0  
  this.isLastNode = 0 
 
  /* dynamic data */ 
  this.isOpen = true 
  this.iconSrc = "ftv2folderopen.gif"   
  this.children = new Array 
  this.nChildren = 0 
 
  /* methods */ 
  this.initialize = initializeFolder 
  this.setState = setStateFolder 
  this.addChild = addChild 
  this.createIndex = createEntryIndex 
  this.hide = hideFolder 
  this.display = display 
  this.renderOb = drawFolder 
  this.totalHeight = totalHeight 
  this.subEntries = folderSubEntries 
  this.outputLink = outputFolderLink 
} 
 
function setStateFolder(isOpen) 
{ 
  var subEntries 
  var totalHeight 
  var fIt = 0 
  var i=0 
 
  if (isOpen == this.isOpen) 
    return 
 
  if (browserVersion == 2)  
  { 
    totalHeight = 0 
    for (i=0; i < this.nChildren; i++) 
      totalHeight = totalHeight + this.children[i].navObj.clip.height 
      subEntries = this.subEntries() 
    if (this.isOpen) 
      totalHeight = 0 - totalHeight 
    for (fIt = this.id + subEntries + 1; fIt < nEntries; fIt++) 
      indexOfEntries[fIt].navObj.moveBy(0, totalHeight) 
  }  
  this.isOpen = isOpen 
  propagateChangesInState(this) 
} 
 
function propagateChangesInState(folder) 
{   
  var i=0 
 
  if (folder.isOpen) 
  { 
    if (folder.nodeImg) 
      if (folder.isLastNode) 
        folder.nodeImg.src = "ftv2mlastnode.gif" 
      else 
	  folder.nodeImg.src = "ftv2mnode.gif" 
    folder.iconImg.src = "ftv2folderopen.gif" 
    for (i=0; i<folder.nChildren; i++) 
      folder.children[i].display() 
  } 
  else 
  { 
    if (folder.nodeImg) 
      if (folder.isLastNode) 
        folder.nodeImg.src = "ftv2plastnode.gif" 
      else 
	  folder.nodeImg.src = "ftv2pnode.gif" 
    folder.iconImg.src = "ftv2folderclosed.gif" 
    for (i=0; i<folder.nChildren; i++) 
      folder.children[i].hide() 
  }  
} 
 
function hideFolder() 
{ 
  if (browserVersion == 1) { 
    if (this.navObj.style.display == "none") 
      return 
    this.navObj.style.display = "none" 
  } else { 
    if (this.navObj.visibility == "hiden") 
      return 
    this.navObj.visibility = "hiden" 
  } 
   
  this.setState(0) 
} 
 
function initializeFolder(level, lastNode, leftSide) 
{ 
var j=0 
var i=0 
var numberOfFolders 
var numberOfDocs 
var nc 
      
  nc = this.nChildren 
   
  this.createIndex() 
 
  var auxEv = "" 
 
  if (browserVersion > 0) 
    auxEv = "<a href='javascript:;' onMouseDown='return clickOnNode("+this.id+")'>" 
  else 
    auxEv = "<a>" 
 
  if (level>0) 
    if (lastNode) /* the last 'brother' in the children array */ 
    { 
      this.renderOb(leftSide + auxEv + "<img name='nodeIcon" + this.id + "' src='ftv2mlastnode.gif' width=16 height=22 border=0></a>") 
      leftSide = leftSide + "<img src='ftv2blank.gif' width=16 height=22>"  
      this.isLastNode = 1 
    } 
    else 
    { 
      this.renderOb(leftSide + auxEv + "<img name='nodeIcon" + this.id + "' src='ftv2mnode.gif' width=16 height=22 border=0></a>") 
      leftSide = leftSide + "<img src='ftv2vertline.gif' width=16 height=22>" 
      this.isLastNode = 0 
    } 
  else 
    this.renderOb("") 
   
  if (nc > 0) 
  { 
    level = level + 1 
    for (i=0 ; i < this.nChildren; i++)  
    { 
      if (i == this.nChildren-1) 
        this.children[i].initialize(level, 1, leftSide) 
      else 
        this.children[i].initialize(level, 0, leftSide) 
      } 
  } 
} 
 
function drawFolder(leftSide) 
{ 
  if (browserVersion == 2) { 
    if (!doc.yPos) 
      doc.yPos=8 
    doc.write("<layer id='folder" + this.id + "' top=" + doc.yPos + " visibility=hiden>") 
  } 
   
  doc.write("<TABLE ") 
  if (browserVersion == 1) 
    doc.write(" id='folder" + this.id + "' style='position:block;' ") 
  doc.write(" BORDER=0 CELLSPACING=0 CELLPADDING=0>") 
  doc.write("<TR><TD>") 
  doc.write(leftSide) 
  this.outputLink() 
  doc.write("<img name='folderIcon" + this.id + "' ") 
  doc.write("src='" + this.iconSrc+"' border=0></a>") 
  doc.write("</TD><TD VALIGN=middle nowrap>") 
  if (USETEXTLINKS) 
  { 
    this.outputLink() 
    doc.write("<NOBR>" + this.desc + "</NOBR></a>")  
  } 
  else 
    doc.write("<NOBR>" + this.desc + "</NOBR>") 
  doc.write("</TD>")  
  doc.write("</TR></TABLE>") 
   
  if (browserVersion == 2) { 
    doc.write("</layer>") 
  } 
 
  if (browserVersion == 1) { 
    this.navObj = doc.all["folder"+this.id] 
    this.iconImg = doc.all["folderIcon"+this.id] 
    this.nodeImg = doc.all["nodeIcon"+this.id] 
  } else if (browserVersion == 2) { 
    this.navObj = doc.layers["folder"+this.id] 
    this.iconImg = this.navObj.document.images["folderIcon"+this.id] 
    this.nodeImg = this.navObj.document.images["nodeIcon"+this.id] 
    doc.yPos=doc.yPos+this.navObj.clip.height 
  } 
} 
 
function outputFolderLink() 
{ 
  if (this.hreference) 
  { 
    doc.write("<a href='" + this.hreference + "' TARGET=\"" + TFRAME + "\" ") 
    if (browserVersion > 0) 
      doc.write("onMouseDown='clickOnFolder("+this.id+")'>") 
  }else{
  	if (this.id!=0) 
	  doc.write("<a href='javascript:;' onMouseDown='clickOnFolder("+this.id+"); return false'>") /* 100600 */
  }
} 
 
function addChild(childNode) 
{ 
  this.children[this.nChildren] = childNode 
  this.nChildren++ 
  return childNode 
} 
 
function folderSubEntries() 
{ 
  var i = 0 
  var se = this.nChildren 
 
  for (i=0; i < this.nChildren; i++){ 
    if (this.children[i].children) //is a folder 
      se = se + this.children[i].subEntries() 
  } 
 
  return se 
} 
 
 
/* Definition of class Item (a document or link inside a Folder) */
 
function Item(itemDescription, itemLink)
{ 
  /* constant data */ 
  this.desc = itemDescription 
  this.link = itemLink 
  this.id = -1 //initialized in initalize() 
  this.navObj = 0 //initialized in render() 
  this.iconImg = 0 //initialized in render() 
  this.iconSrc = "ftv2doc.gif" 

  /* methods */ 
  this.initialize = initializeItem 
  this.createIndex = createEntryIndex 
  this.hide = hideItem 
  this.display = display 
  this.renderOb = drawItem 
  this.totalHeight = totalHeight 
} 
 
function hideItem() 
{ 
  if (browserVersion == 1) { 
    if (this.navObj.style.display == "none") 
      return 
    this.navObj.style.display = "none" 
  } else { 
    if (this.navObj.visibility == "hiden") 
      return 
    this.navObj.visibility = "hiden" 
  }     
} 
 
function initializeItem(level, lastNode, leftSide) 
{  
  this.createIndex() 
 
  if (level>0) 
    if (lastNode) //the last 'brother' in the children array 
    { 
      this.renderOb(leftSide + "<img src='ftv2lastnode.gif' width=16 height=22>") 
      leftSide = leftSide + "<img src='ftv2blank.gif' width=16 height=22>"  
    } 
    else 
    { 
      this.renderOb(leftSide + "<img src='ftv2node.gif' width=16 height=22>") 
      leftSide = leftSide + "<img src='ftv2vertline.gif' width=16 height=22>" 
    } 
  else 
    this.renderOb("")   
} 
 
function drawItem(leftSide) 
{ 
  if (browserVersion == 2) 
    doc.write("<layer id='item" + this.id + "' top=" + doc.yPos + " visibility=hiden>") 
     
  doc.write("<TABLE ") 
  if (browserVersion == 1) 
    doc.write(" id='item" + this.id + "' style='position:block;' ") 
  doc.write(" BORDER=0 CELLSPACING=0 CELLPADDING=0>") 
  doc.write("<TR><TD>") 
  doc.write(leftSide) 
  if (this.link) 
      doc.write("<a href=" + this.link + ">") 
  doc.write("<img id='itemIcon"+this.id+"' ") 
   doc.write("src='"+this.iconSrc+"' border=0>")

  doc.write("</a>") 
  doc.write("</TD><TD VALIGN=middle nowrap>") 
  if (USETEXTLINKS && this.link) 
    doc.write("<NOBR><a href=" + this.link + ">" + this.desc + "</NOBR></a>") 
  else 
    doc.write("<NOBR>" + this.desc + "</NOBR>") 
  doc.write("</TD></TR></TABLE>") 
   
  if (browserVersion == 2) 
    doc.write("</layer>") 
 
  if (browserVersion == 1) { 
    this.navObj = doc.all["item"+this.id] 
    this.iconImg = doc.all["itemIcon"+this.id] 
  } else if (browserVersion == 2) { 
    this.navObj = doc.layers["item"+this.id] 
    this.iconImg = this.navObj.document.images["itemIcon"+this.id] 
    doc.yPos=doc.yPos+this.navObj.clip.height 
  } 
} 
 
 
/* Methods common to both objects (pseudo-inheritance) */ 
 
function display() 
{ 
  if (browserVersion == 1) 
    this.navObj.style.display = "block" 
  else 
    this.navObj.visibility = "show" 
} 
 
function createEntryIndex() 
{ 
  this.id = nEntries 
  indexOfEntries[nEntries] = this 
  nEntries++ 
} 
 
/* total height of subEntries open */ 
function totalHeight() //used with browserVersion == 2 
{ 
  var h = this.navObj.clip.height 
  var i = 0 
   
  if (this.isOpen) //is a folder and _is_ open 
    for (i=0 ; i < this.nChildren; i++)  
      h = h + this.children[i].totalHeight() 
 
  return h 
} 
  
function clickOnFolder(folderId) 
{ 
  var clicked = indexOfEntries[folderId] 
 
  if (!clicked.isOpen) 
    clickOnNode(folderId) 
 
  return 
 
  if (clicked.isSelected) 
    return 
} 
 
function clickOnNode(folderId) 
{ 
  var clickedFolder = 0 
  var state = 0 
 
  clickedFolder = indexOfEntries[folderId] 
  state = clickedFolder.isOpen 
 
  clickedFolder.setState(!state)

  return false;  
} 
 
 
/* Auxiliary Functions for Folder-Tree backward compatibility */ 
 
function gFld(description, ref) 
{ 
  if (DWIN && ref) ref = "javascript:go(\""+ref+"\")"
  
  folder = new Folder(description, ref) 
  return folder 
} 
 
function gLnk(target, description, ref) 
{ 
  fullLink = "" 

  if (DWIN && ref) ref = "javascript:go(\""+ref+"\")"

  if (ref) 
   if (target==0) 
     fullLink = "'"+ref+"' target=\"" + TFRAME + "\"" 
   else 
     fullLink = "'"+ref+"' target=_blank" 
   
  linkItem = new Item(description, fullLink)   
  return linkItem 
} 
 
function insFld(parentFolder, childFolder) 
{ 
  return parentFolder.addChild(childFolder) 
} 
 
function insDoc(parentFolder, document) 
{ 
  parentFolder.addChild(document) 
} 
 

function initializeDocument() 
{ 
  if (doc.all) 
    browserVersion = 1 /* IE */
  else 
    if (doc.layers) 
    {
	browserVersion = 2 /* NS */ 
	self.onresize = self.doResize	
    } 
    else 
      browserVersion = 0 /* other */

  foldersTree.initialize(0, 1, "") 
  foldersTree.display()
  
  if (browserVersion > 0) 
  { 
    doc.write("<layer top="+indexOfEntries[nEntries-1].navObj.top+">&nbsp;</layer>") 
 
    /* close the whole tree */ 
    clickOnNode(0) 
    /* open the root folder */ 
    clickOnNode(0)
    clickOnNode(1)
    clickOnNode(6)
    clickOnNode(26)

  } 
} 

function go(s)
{
	onerror=goNewW; /* IE */
	sErrREF = s; /* IE */
	
	if (!opener.closed)
		opener.document.location=s;
	else
		window.open(s,"newW"); /* NS */
}

function goNewW() /* IE */ 
{
	window.open(sErrREF,"newW");
}

function doResize() /* NS */
{
	document.location.reload();
}

function hideLayer(layerName){
  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
}

indexOfEntries = new Array 
nEntries = 0 
doc = document 
browserVersion = 0 
selectedFolder=0 
sErrREF = ""; /* IE */
layerRef="document.all";
styleSwitch=".style";
  if (navigator.appName == "Netscape") {
    layerRef="document.layers";
	styleSwitch="";
  }
USETEXTLINKS = 1 
TFRAME="right" 
DWIN=0 

foldersTree = gFld("The Waste of Time Website - Home", "../index.htm")
a1 = insFld(foldersTree, gFld("HTML Files", ""))
a2 = insFld(a1, gFld("Essays", ""))
insDoc(a2, gLnk(0, "Violence in Video Games is Good (English)", "../vivg/vivg.htm"))
insDoc(a2, gLnk(0, "Electromagnetic Pulse (Science)", "../emp.htm"))
insDoc(a2, gLnk(0, "Smart Bombs (IPT) (coming soon)", "../smart/smartbmb.htm"))
a6 = insFld(a1, gFld("Actually Interesting Pages", ""))
insDoc(a6, gLnk(0, "How to Make Easy Money Online", "../money.htm"))
insDoc(a6, gLnk(0, "It\'s Hilarious", "../funny.htm"))
insDoc(a6, gLnk(0, "Jokes, Confusion & More", "../jokes.htm"))
insDoc(a6, gLnk(0, "Downloads - Handy Apps, Pranks, Jokes and More!", "../download.htm"))
insDoc(a6, gLnk(0, "Why Microsoft is Hated", "../mshate/msenter.htm"))
insDoc(a6, gLnk(0, "Funny Videos, Sounds & Music", "../vid-sfx/vsenter.htm"))
insDoc(a6, gLnk(0, "Free E-mail", "../freemail.htm"))
insDoc(a6, gLnk(0, "My Tweak Guide (for systems with 32MBish RAM)", "../tweak.htm"))
insDoc(a6, gLnk(0, "My Favourite Links (they might be yours too!)", "../favlinks.txt"))
insDoc(a6, gLnk(0, "For Sale: Cheap Software, Games & Hardware", "../forsale.htm"))
insDoc(a6, gLnk(0, "Don\'t click this!", "../funny.htm"))
a18 = insFld(a1, gFld("More about this site", ""))
insDoc(a18, gLnk(0, "Index", "../index.htm"))
insDoc(a18, gLnk(0, "Latest News", "../news.htm"))
insDoc(a18, gLnk(0, "Vote For This Site!", "http://pub14.bravenet.com/vote/vote.php?usernum=1165685431&cpv=1"))
insDoc(a18, gLnk(0, "About Me & This Site\"s Future", "../mefuture.htm"))
insDoc(a18, gLnk(0, "Sponsors", "../sponsors/sponsors.htm"))
insDoc(a18, gLnk(1, "Re-open Entire Site", "http://members.fortunecity.com/wasteoftime"))
insDoc(a18, gLnk(0, "E-mail the Webmaster", "mailto:webmaster@wasteoftime.allhere.com"))
a26 = insFld(foldersTree, gFld("More Files", ""))
a27 = insFld(a26, gFld("VB - Cool Programs", ""))
insDoc(a27, gLnk(0, "Fake LoveBug (6.31KB) (Extremely Funny!) ", "../zips/LB.zip"))
insDoc(a27, gLnk(0, "DLL needed for thes programs (vbrun300.dll) (224KB)", "../zips/vbrun300.zip"))
insDoc(a27, gLnk(0, "Comet! (35.9KB)", "../zips/comet.zip"))
insDoc(a27, gLnk(0, "Cat Tent (7.72KB)", "../zips/cattent.zip"))
insDoc(a27, gLnk(0, "Cat & Dog (31.5KB)", "../programs/CatDog.zip"))
insDoc(a27, gLnk(0, "Shut Down Options (2.6KB)", "../programs/ShutDown.zip"))
insDoc(a27, gLnk(0, "Goto Great Program Downloads", "../download.htm"))
a35 = insFld(a26, gFld("Downloads", ""))
a36 = insFld(a35, gFld("Rise of the Triad Levels", ""))
insDoc(a36, gLnk(0, "Skill War Level Pack (15KB)", "../zips/skillwar.zip"))
insDoc(a36, gLnk(0, "Leak Level (2.12KB)", "../zips/leak.zip"))
insDoc(a36, gLnk(0, "Skill War - About", "../moreinfo/skillwar.htm"))
insDoc(a36, gLnk(0, "Leak - About", "../moreinfo/leak.htm"))
insDoc(a36, gLnk(0, "Goto Downloads", "../download.htm"))
a42 = insFld(a35, gFld("Java", ""))
insDoc(a42, gLnk(0, "Whatever made this sitemap (272KB)", "../zips/vtree101.zip"))
insDoc(a42, gLnk(0, "Vrover - Menu Java (on left) (19KB)", "../zips/vrover.zip"))
insDoc(a42, gLnk(0, "Goto Downloads", "../download.htm"))
insDoc(a35, gLnk(0, "ASCII Making Program  (131KB)", "..\\zips\\ascii.zip"))
insDoc(a35, gLnk(0, "File Divider (1.11KB)", "..\\zips\\filediv.zip"))
insDoc(a35, gLnk(0, "Goto Downloads", "..\\download.htm"))
a49 = insFld(a26, gFld("Funny Sounds & Music", ""))
insDoc(a49, gLnk(0, "Beans Sound (155KB)", "../vid-sfx/beans.zip"))
insDoc(a49, gLnk(0, "Gilligan\"s Island Sound - Internet Parody (414KB)", "../vid-sfx/gilligan.zip"))
insDoc(a49, gLnk(0, "Goto Videos & Sounds", "../vid-sfx/vid-sfx.htm"))
a53 = insFld(a26, gFld("Videos", ""))
insDoc(a53, gLnk(1, "Chimpanzee (getting knocked out)", "../vid-sfx/chimp.mpeg"))
insDoc(a53, gLnk(1, "Freaky Eyes (protruding eyeballs)", "../vid-sfx/Freaky.Eyes.avi"))
insDoc(a53, gLnk(1, "Dog (Taco Bell)", "../vid-sfx/tacodog.avi"))
insDoc(a53, gLnk(1, "Win95 Out of Box Experience", "../mshate/win95.oobe3.avi"))
insDoc(a53, gLnk(1, "Win98 Test Run (with Blue Screen)", "../mshate/gates98.mov"))
insDoc(a53, gLnk(0, "Goto Microsoft Hate", "../mshate/microsux.htm"))
insDoc(a53, gLnk(0, "Goto Videos & Sounds", "../vid-sfx/vid-sfx.htm"))
a61 = insFld(a26, gFld("Pics", ""))
a62 = insFld(a61, gFld("Animated", ""))
insDoc(a62, gLnk(1, "Cartoon Bird (Flying)", "../cartoonbird.gif"))
insDoc(a62, gLnk(1, "Email Logo (Spinning @)", "../start/email.gif"))
insDoc(a62, gLnk(1, "Browsers (Spinning 3D Cube)", "../mshate/ienetetc.gif"))
insDoc(a62, gLnk(1, "Line (Pulsating)", "../line.gif"))
insDoc(a62, gLnk(1, "New", "../new.gif"))
insDoc(a62, gLnk(1, "Netscape vs. Internet Explorer", "../mshate/warwar.gif"))
insDoc(a62, gLnk(1, "Welcome (light up sign)", "../start/welcome.gif"))
insDoc(a62, gLnk(0, "Goto Mircosoft Hate", "../mshate/microsux.htm"))
a71 = insFld(a61, gFld("Violence in Video Games is Good", ""))
insDoc(a71, gLnk(1, "Gaming Violence (Bloody)", "../vivg/gv.jpg"))
insDoc(a71, gLnk(1, "VIVG Graph", "../vivg/graph.jpg"))
insDoc(a71, gLnk(1, "Arcade Game (gun & screen)", "../vivg/gun.jpg"))
insDoc(a71, gLnk(1, "Video Game (gun)", "../vivg/shoot.jpg"))
insDoc(a71, gLnk(1, "Arcade Overview", "../vivg/video.jpg"))
insDoc(a71, gLnk(1, "Violence in Video Games (Text)", "../vivg/vivg.jpg"))
insDoc(a71, gLnk(0, "Goto the essay", "../vivg/vivg.htm"))
a79 = insFld(a61, gFld("More", ""))
insDoc(a79, gLnk(1, "Black Dot Background", "../bgbkgrd.gif"))
insDoc(a79, gLnk(1, "Microsoft Cross", "../mshate/miecross.gif"))
insDoc(a79, gLnk(1, "Flight Sim 98 Barf Bag", "../mshate/FS98barf.jpg"))
insDoc(a79, gLnk(0, "Goto Microsoft Hate", "../mshate/microsux.htm"))
insDoc(a61, gLnk(0, "Ask permission before using on a site (Max. size 76KB)", "mailto:imagepermission@wot.xs3.com"))
insDoc(a26, gLnk(0, "Goto Great Programs & More Downloads", "../download.htm"))
insDoc(a26, gLnk(0, "Goto Videos & Sound Effects", "../vid-sfx/vid-sfx.htm"))
a87 = insFld(foldersTree, gFld("Sponsors", ""))
a88 = insFld(a87, gFld("Free Stuff", ""))
insDoc(a88, gLnk(1, "Free $25 last time I checked", "http://click.linksynergy.com/fs-bin/stat?id=4Z1QWrkBs80&offerid=15268&subid=0"))
insDoc(a88, gLnk(0, "Tell Someone about this Site & Get FREE Jokes, Trivia & Freebies ( $110 Shopping!)", "http://go.mailbits.com/Tell.asp?73095.1"))
insDoc(a88, gLnk(0, "Secrets Revealed Ezine", "http://go.mailbits.com/trivia.asp?73095.1"))
insDoc(a88, gLnk(1, "About.com - Great Freeware & Shareware", "http://service.bfast.com/bfast/click?bfmid=7279965&siteid=28413193&bfpage=shareware2"))
insDoc(a88, gLnk(0, "Goto Jokes", "../jokes.htm"))
insDoc(a88, gLnk(0, "Goto Great Program Downloads", "../download.htm"))
a95 = insFld(a87, gFld("Easy Money !!!", ""))
insDoc(a95, gLnk(1, "Get paid $2-$25 per person you find/know is in need of a service or product", "http://www.gorefer.com/promo/StartJoin/standard?u=AAAArFAAFAAAAU5AAZ&w=3"))
insDoc(a95, gLnk(1, "Get $20! per Visa Card sold via NextCard", "http://banners.nextcard.com/affiliates/affiliates.shtml?ref=0038797"))
insDoc(a95, gLnk(0, "Get Paid 20-50c per banner used! don\"t sell anything", "http://aff.webowner.com/info/earn.asp?73095"))
insDoc(a95, gLnk(0, "Get (Goto) Money!", "../money.htm"))
a100 = insFld(a87, gFld("Purchase", ""))
insDoc(a100, gLnk(1, "Toowoomba Mall Online", "http://tmbamall.future.easyspace.com/index.html"))
insDoc(a100, gLnk(1, "Nextcard Visa Card (2.9%! variable rate, 9.9% fixed)", "http://www.nextcard.com/index6.html?ref=aff0038797"))
insDoc(a100, gLnk(0, "Goto  \"For Sale\"", "../forsale.htm"))
insDoc(a87, gLnk(0, "Goto Sponsors Page", "../sponsors/sponsors.htm"))
