/*************** Script functions in this file **************
Filename: map_arch.js; as of Montag,
  FUNCTION:                                               LINE:
  book()                                                   49   
  chapter()                                                31   
  library()                                                13   
  page()                                                   21   
  volume()                                                 70   
  wing()                                                   95   
************ (end Script functions in this file) ***********/

function library()
 {
  this.wing = new Array();
  for (i = 0; i < arguments.length; i++) this.wing[i] = arguments[i];
 }
 
var currentPage,chosenChapter,chosenBook,chosenVolume,chosenWing;
function page()
 {
  this.name =arguments[0];
  this.url = arguments[1];
  this.target = arguments[2]
  this.text = arguments[3];
 }

function chapter()
 {
  this.name =arguments[0];
  this.url = arguments[1];
  this.target = arguments[2]
  this.text = arguments[3];
  
  this.page = new Array();
  for (i=4;i<arguments.length;i++)
   {
    x = i-3;
    this.page[x] =  arguments[i];
    this.page[x].parentChapter = this;
   }
 }
 
 
function book()
 {
  this.name =arguments[0];
  this.url = arguments[1];
  this.target = arguments[2]
  this.text = arguments[3];
  
  this.chapter = new Array();
  for (i=4;i<arguments.length;i++)
   {
    c = i-4;
    this.chapter[c] =  arguments[i];
    this.chapter[c].parentBook = this;
    for (p=0;p<this.chapter[c].page.length;p++)
     {
      this.chapter[c].page[p].parentBook = this;
     }
   }
 }
 
function volume()
 {
  this.name =arguments[0];
  this.url = arguments[1];
  this.target = arguments[2]
  this.text = arguments[3];
  
  this.book = new Array();
  for (i=4;i<arguments.length;i++)
   {
    b = i-4;
    this.book[b] =  arguments[i];
    this.book[b].parentVolume = this;
    for (c=0;c<this.book[b].chapter.length;c++)
     {
      this.book[b].chapter[c].parentVolume = this;
      for (p=0;p<this.book[b].chapter[c].page.length;p++)
       {
        this.book[b].chapter[c].page[p].parentVolume = this;
       }
     }
   }
 }
 
function wing()
 {
  this.name =arguments[0];
  this.url = arguments[1];
  this.target = arguments[2]
  this.text = arguments[3];
  
  this.volume = new Array();
  for (i=4;i<arguments.length;i++)
   {
    v = i-4;
    
    this.volume[v] =  arguments[i];
    this.volume[v].parentWing = this;
    for (b=0;b<this.volume[v].book.length;b++)
     {
      this.volume[v].book[b].parentWing = this;
      for (c=0;c<this.volume[v].book[b].chapter.length;c++)
       {
        this.volume[v].book[b].chapter[c].parentWing = this;
        for (p=0;p<this.volume[v].book[b].chapter[c].page.length;p++)
         {
          this.volume[v].book[b].chapter[c].page[p].parentWing = this;
         }
       }
     }
   }
 }
// EOF, do not remove this line!