var total=1;
var db = new Array();

// -- Enter Values Here --
// Format: dbAdd(parent[true|false] , description, URL [blank for nohref], level , TARGET [blank for "content"], new? [1=yes])
dbAdd( true, "Product Families" , "" , 0 , "" , 0)
	dbAdd( true, "Palm" , "http://www.trajectorylabs.com/palmos.html" , 1 , "" , 0)
		dbAdd( false, "Productivity" , "http://www.trajectorylabs.com/palm_productivity.html" , 2 , "" , 0)
		dbAdd( false, "Calendar" , "http://www.trajectorylabs.com/palm_calendar.html" , 2 , "" , 0)
		dbAdd( false, "Humor" , "http://www.trajectorylabs.com/palm_humor.html" , 2 , "" , 0)
		dbAdd( false, "Drawing" , "http://www.trajectorylabs.com/palm_drawing.html" , 2 , "" , 0)
		dbAdd( false, "Nature" , "http://www.trajectorylabs.com/palm_nature.html" , 2 , "" , 0)
		dbAdd( false, "Games" , "http://www.trajectorylabs.com/palm_games.html" , 2 , "" , 0)
		dbAdd( false, "Sports" , "http://www.trajectorylabs.com/palm_sports.html" , 2 , "" , 0)
		dbAdd( false, "Lore" , "http://www.trajectorylabs.com/palm_lore.html" , 2 , "" , 0)
		dbAdd( false, "Misc" , "http://www.trajectorylabs.com/palm_misc.html" , 2 , "" , 0)
		dbAdd( false, "Bundles" , "http://www.trajectorylabs.com/palm_bundles.html" , 2 , "" , 0)
		
		
		
		
		
		
	dbAdd( false, "Pocket PC" , "http://www.trajectorylabs.com/pocketpc.html" , 1 , "" , 0)
    dbAdd( false, "Smartphone" , "http://www.trajectorylabs.com/smartphone_software.html" , 1 , "" , 0)
	dbAdd( false, "Windows PC " , "http://www.trajectorylabs.com/windowspc.html" , 1 , "" , 0)
	
dbAdd( true , "Support" , "" , 0 , "" , 0)
	dbAdd( false, "FAQ" , "http://www.trajectorylabs.com/faq.html" , 1 , "" , 0)
	dbAdd( false, "Customer Service" , "http://www.trajectorylabs.com/cs.html" , 1 , "" , 0)
	dbAdd( true, "Installing Apps" , "http://www.trajectorylabs.com/installing.html" , 1 , "" , 0)
	dbAdd( false, "Palm" , "http://www.trajectorylabs.com/installing_palm.html" , 2 , "" , 0)
	dbAdd( false, "Pocket PC" , "http://www.trajectorylabs.com/installing_pocket_pc.html" , 2 , "" , 0)
dbAdd( true , "Utilities" , "" , 0 , "" , 0)
        dbAdd( false, "PDB Files" , "http://www.trajectorylabs.com/PDB_files.html" , 1 , "" , 0)
	dbAdd( false, "Print Reports" , "http://www.trajectorylabs.com/converter.html" , 1 , "" , 0)
	dbAdd( false, "SketchPad Bmp" , "http://www.trajectorylabs.com/convertersketchpad.html" , 1 , "" , 0)
dbAdd( true , "Links" , "" , 0 , "" , 0)
	dbAdd( false, "Site News" , "http://www.trajectorylabs.com/news.html" , 1 , "" , 0)
	dbAdd( false, "Partnerships" , "http://www.trajectorylabs.com/links.html" , 1 , "" , 0)
	dbAdd( false, "Behind The Scenes" , "http://www.trajectorylabs.com/BehindTheScenes/index.html" , 1 , "" , 0)
	dbAdd( true, "Developer Links" , "http://www.trajectorylabs.com/development.html" , 1 , "" , 0)
	dbAdd( false, "Dev Links" , "http://www.trajectorylabs.com/dev.html" , 2 , "" , 0)
	dbAdd( false, "Dev Tutorials" , "http://www.trajectorylabs.com/tutorials.html" , 2 , "" , 0)
dbAdd( true , "Contact/Info" , "" , 0 , "" , 0)
	dbAdd( false, "Contact" , "http://www.trajectorylabs.com/contact.html" , 1 , "" , 0)
	dbAdd( false, "About Us" , "http://www.trajectorylabs.com/about.html" , 1 , "" , 0)

	
// dbAdd( false , "" , "" , 0 , "" , 0)

// -- End modifications --

// Get current cookie setting
var current=getCurrState()
function getCurrState() {
  var label = "currState="
  var labelLen = label.length
  var cLen = document.cookie.length
  var i = 0
  while (i < cLen) {
    var j = i + labelLen
    if (document.cookie.substring(i,j) == label) {
      var cEnd = document.cookie.indexOf(";",j)
      if (cEnd == -1) { cEnd = document.cookie.length }
      return unescape(document.cookie.substring(j,cEnd))
    }
    i++
  }
  return ""
}

// Add an entry to the database
function dbAdd(mother,display,URL,indent,top,newitem) {
  db[total] = new Object;
  db[total].mother = mother
  db[total].display = display
  db[total].URL = URL
  db[total].indent = indent
  db[total].top = top
  db[total].newitem = newitem
  total++
  }

// Record current settings in cookie
function setCurrState(setting) {
  var expire = new Date();
  expire.setTime(expire.getTime() + ( 7*24*60*60*1000 ) ); // expire in 1 week
  document.cookie = "currState=" + escape(setting) + "; expires=" + expire.toGMTString();
  }

// toggles an outline mother entry, storing new value in the cookie
function toggle(n) {
  if (n != 0) {
    var newString = ""
    var expanded = current.substring(n-1,n) // of clicked item
    newString += current.substring(0,n-1)
    newString += expanded ^ 1 // Bitwise XOR clicked item
    newString += current.substring(n,current.length)
    setCurrState(newString) // write new state back to cookie
  }
}

// returns padded spaces (in mulTIPles of 2) for indenting
function pad(n) {
  var result = ""
  for (var i = 1; i <= n; i++) { result += "&nbsp;&nbsp;&nbsp;&nbsp;" }
  return result
}

// Expand everything
function explode() {
  current = "";
  initState="";
  for (var i = 1; i < db.length; i++) { 
    initState += "1"
    current += "1"
    }
  setCurrState(initState);
  history.go(0);
  }

// Collapse everything
function contract() {
  current = "";
  initState="";
  for (var i = 1; i < db.length; i++) { 
    initState += "0"
    current += "0"
    }
  setCurrState(initState);
  history.go(0);
  }

function tree_close() {
  window.parent.location = window.parent.content.location;
  }
  
function openUbb(url) {
window.open(url, 'ubb_window', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=800,height=700');
}

function openEdag(url) {
window.open(url, 'crap_window', 'toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=800,height=700');
}