/*---------------------------------------------------------------
| Author      : Mollink.com, Margré Mollink
| Filename    : pilot-init.js
| Description : Initializes variables for pilot.js
| Created     : 2001-01-10
| History     :
| 2000-01-10 Put initialization in separate file, because the
|     opening page of all rooms run pilot.js and then would 
|     load e.g. the images from ./images, which does only exist
|     for menu.html.
\--------------------------------------------------------------*/
//----> BEGIN MAIN --------------------------------------------->
//Global variables:
var sFileExt = '.html';				//file extension
var agent=navigator.userAgent;			//browser ID
var browserVer=2;				//browser version
var iMaxRoom=5;					//nr of rooms
var sDummyPage='Home\\dummy.html';		//empty page
var sMenuPage='Home\\desc_menu.html';	//default menu page
var iCurrentRoom=0;				//start at Welcome
var sDescPrefix='desc_';			//description filename prefix

Rooms = new Array (0);
//Room: name, longname, hexcolour, directory
Rooms[0] = new Room("Welcome","Opening Page","#FFFFFF",""); //white
Rooms[1] = new Room("reception","Reception Desk","#FFCC00","reception"); //yellow
Rooms[2] = new Room("lounge","Lounge","#9966FF","lounge"); //lilac blue
Rooms[3] = new Room("hall","Hall of Fame","#CC3300","hall"); //red
Rooms[4] = new Room("library","Library","#996633","library"); //brown
Rooms[5] = new Room("studio","Recording Studio","#009900","studio"); //green
Rooms[6] = new Room("archive","---","#000000","- -");
//----> Check browser version (> Navigator 3): >---------------->
if(agent.substring(0,7)=="Mozilla")
{
  if (parseInt(agent.substring(8,9)) >= 3)
  {
	browserVer=1;
  }
}

//----> preload images: >--------------------------------------->
if (browserVer == 1)
{
  img1_off = new Image(49,47);
  img1_off.src = "images/Room1_off.gif";
  img1_on = new Image(49,47);
  img1_on.src = "images/Room1_on.gif";
  img2_off = new Image(67,47);
  img2_off.src = "images/Room2_off.gif";
  img2_on = new Image(67,47);
  img2_on.src = "images/Room2_on.gif";
  img3_off = new Image(116,14);
  img3_off.src = "images/Room3_off.gif";
  img3_on = new Image(116,14);
  img3_on.src = "images/Room3_on.gif";
  img4_off = new Image(52,44);
  img4_off.src = "images/Room4_off.gif";
  img4_on = new Image(52,44);
  img4_on.src = "images/Room4_on.gif";
  img5_off = new Image(64,44);
  img5_off.src = "images/Room5_off.gif";
  img5_on = new Image(64,44);
  img5_on.src = "images/Room5_on.gif";
}
//<---- END MAIN <---------------------------------------------//

//--->> BEGIN FUNCTIONS >>------------------------------------->>
//Variables used in functions:
//sText - text string
//sImgID - ID of the named image (room) to be replaced
//sRoomName - (part of) prefix of filename containing the description text
//iRoomNr - index in array of rooms
//imgObj - the name of the image object (= preloaded images)

//--->> Create room >>----------------------------------------->>
function Room(sName,sLongName,hxColour,sDir)
{
  this.name = sName;
  this.longname = sLongName;
  this.colour = hxColour;
  this.dir = sDir + '\\';
}//END room
//<<--- END FUNCTIONS <<---------------------------------------<<
//END SCRIPT