<!--
// Xpeditions Hall Node Library
// updated: 2001.02.22
// 
var nextid=1;

// Xpeditions Captions
XNames=new Array('',	'Globe Projector',
						'Mental Mapper',
						'World Viewer',
						'Locator Booth',
						'Satellite Spyglass',
						'Culture Goggles',
						'Big Island Pool',
						'Eco-Cycle',
						'Migration Station',
						'Xpeditions Express',
						'Rail Traffic Controller',
						'Paris Scope',
						'Advisory Board',
						'The Garden',
						'Living Landscapes',
						'Sushi Bar',
						'The Dig',
						'Uplink Outpost');

XCaptions=new Array('',"Setup the Globe Projector and change the world.",
						"Approach and read the mind of the Mental Mapper.",
						"Paint planetary patterns with the World Viewer.",
						"Pinpoint puzzling places in the Locator Booth.",
						"Seize the Satellite Spyglass and zoom in on Earth.",
						"Gaze through the Culture Goggles for a new spin on an ancient city.",
						"Dive into the Big Island Pool and see earth, wind and fire in action.",
						"Survey a world's worth of ecosystems in the Eco-Cycle.",
						"Stop by Migration Station and watch the face of Europe change.",
						"All aboard the Xpeditions Express for a transcontinental tour of European cultures.",
						"Load 'em up, move'em out&mdash;you're the Rail Traffic Controller.",
						"Time travel through the City of Light via the Paris Scope.",
						"Travel can be treacherous. Consult the Advisory Board for words of warning.",
						"Explore the Garden to see the imprint of industry on Japan's environment.",
						"Browse the Living Landscapes gallery and glimpse the hazards of living on Earth.",
						"Sidle up to the Sushi Bar for a taste of a changing resource.",
						"Meet a long-lost cousin at the Dig.",
						"Log on and mouth off at Uplink Outpost.");

RoomNames=new Array(	'','The World in Spatial Terms',
						'Places and Regions',
						'Physical Systems',
						'Human Systems',
						'Environment and Society',
						'The Uses of Geography' );

// Xpeditions Popups Sizes						
Popups=new Array(	{x:0,y:0}, {x:493,y:415}, {x:575,y:358}, {x:612,y:390},
					{x:590,y:402}, {x:575,y:402}, {x:513,y:397},
					{x:531,y:380}, {x:589,y:403},
					{x:538,y:397}, {x:481,y:398}, {x:611,y:397}, {x:611,y:397}, {x:535,y:397},
					{x:605,y:365}, {x:600,y:400}, {x:600,y:400},
					{x:615,y:400}, {x:540,y:400});
												

// Positions for all nodes (assuming 23x23 object)
Positions=new Array( 	{x:80, y:82}, {x:80,y:46}, {x:111,y:64}, {x:111,y:100}, {x:80,y:119}, {x:48,y:100}, {x:48,y:64},
						{x:80,y:19}, {x:68,y:6}, {x:80,y:0}, {x:92,y:6},
						{x:135,y:50}, {x:138,y:35}, {x:150,y:41}, {x:150,y:54},
						{x:134,y:114}, {x:146,y:110}, {x:135,y:129},
						{x:80,y:144}, {x:70,y:151}, {x:90,y:151}, {x:92,y:166}, {x:66,y:166}, {x:104,y:148}, {x:52,y:162}, {x:52,y:148},
						{x:24,y:113}, {x:11,y:104}, {x:13,y:120}, {x:28,y:131},
						{x:24,y:49}, {x:21,y:33}, {x:9,y:48} );

// hallNode(position,orientation,imgname,qtvr,fwd,rev,left,right,imgmap)
Nodes=new Array();
// Nodes in the center of the hall						
Nodes[0]=new hallNode(0,0,'qnode1.jpg','hall.mov',6,3,5,1,'');
Nodes[1]=new hallNode(0,1,'qnode2.jpg','hall.mov',8,4,0,2,'');
Nodes[2]=new hallNode(0,2,'qnode3.jpg','hall.mov',10,5,1,3,'');
Nodes[3]=new hallNode(0,3,'qnode4.jpg','hall.mov',12,0,2,4,'');
Nodes[4]=new hallNode(0,4,'qnode5.jpg','hall.mov',14,1,3,5,'');
Nodes[5]=new hallNode(0,5,'qnode6.jpg','hall.mov',16,2,4,0,'');
// Nodes in front of each room
Nodes[6]=new hallNode(1,0,'node1-f.jpg','',18,7,-1,-1,'');
Nodes[7]=new hallNode(1,3,'node1-r.jpg','',3,6,-1,-1,'');
Nodes[8]=new hallNode(2,1,'node2-f.jpg','',23,9,-1,-1,'');
Nodes[9]=new hallNode(2,4,'node2-r.jpg','',4,8,-1,-1,'');
Nodes[10]=new hallNode(3,2,'node3-f.jpg','',28,11,-1,-1,'');
Nodes[11]=new hallNode(3,5,'node3-r.jpg','',5,10,-1,-1,'');
Nodes[12]=new hallNode(4,3,'node4-f.jpg','',32,13,-1,-1,'');
Nodes[13]=new hallNode(4,0,'node4-r.jpg','',0,12,-1,-1,'');
Nodes[14]=new hallNode(5,4,'node5-f.jpg','',41,15,-1,-1,'');
Nodes[15]=new hallNode(5,1,'node5-r.jpg','',1,14,-1,-1,'');
Nodes[16]=new hallNode(6,5,'node6-f.jpg','',46,17,-1,-1,'');
Nodes[17]=new hallNode(6,2,'node6-r.jpg','',2,16,-1,-1,'');
// Room I
Nodes[18]=new hallNode(7,0,'room1-f.jpg','room1.mov',21,19,20,22,'');
Nodes[19]=new hallNode(7,3,'room1-r.jpg','room1.mov',7,18,22,20,'');
Nodes[20]=new hallNode(8,5,'x1.jpg','',-1,-1,19,21,'',1,'1/x1/xpedition1.html');
Nodes[21]=new hallNode(9,0,'x2.jpg','',-1,-1,20,22,'',2,'1/x2/xpedition2.html');
Nodes[22]=new hallNode(10,1,'x3.jpg','',-1,-1,21,19,'',3,'1/x3/xpedition3.html');
// Room II
Nodes[23]=new hallNode(11,1,'room2-f.jpg','room2.mov',26,24,25,27,'');
Nodes[24]=new hallNode(11,4,'room2-r.jpg','room2.mov',9,23,27,25,'');
Nodes[25]=new hallNode(12,0,'x4.jpg','',-1,-1,24,26,'',4,'2/x4/xpedition4.html');
Nodes[26]=new hallNode(13,1,'x5.jpg','',-1,-1,25,27,'',5,'2/x5/xpedition5.html');
Nodes[27]=new hallNode(14,2,'x6.jpg','',-1,-1,26,24,'',6,'2/x6/xpedition6.html');
// Room III
Nodes[28]=new hallNode(15,2,'room3-f.jpg','room3.mov',-1,29,30,31,'');
Nodes[29]=new hallNode(15,5,'room3-r.jpg','room3.mov',11,28,31,30,'');
Nodes[30]=new hallNode(16,1,'x7.jpg','',-1,-1,29,31,'',7,'3/x7/xpedition7.html');
Nodes[31]=new hallNode(17,3,'x8.jpg','',-1,-1,30,29,'',8,'3/x8/xpedition8.html');
// Room IV
Nodes[32]=new hallNode(18,3,'room4-f.jpg','room4.mov',-1,33,34,35,'');
Nodes[33]=new hallNode(18,0,'room4-r.jpg','room4.mov',13,32,40,36,'');
Nodes[34]=new hallNode(20,2,'room4-left.jpg','',37,-1,35,36,'');
Nodes[35]=new hallNode(19,4,'room4-right.jpg','',39,33,38,40,'');
Nodes[36]=new hallNode(23,2,'x9.jpg','',-1,-1,33,37,'',9,'4/x9/xpedition9.html');
Nodes[37]=new hallNode(21,3,'x10.jpg','',-1,-1,36,38,'',10,'4/x10/xpedition10.html');
Nodes[38]=new hallNode(22,3,'x11.jpg','',-1,-1,37,39,'',11,'4/x11/xpedition11.html');
Nodes[39]=new hallNode(24,4,'x12.jpg','',-1,-1,38,40,'',12,'4/x12/xpedition12.html');
Nodes[40]=new hallNode(25,5,'x13.jpg','',-1,-1,39,33,'',13,'4/x13/xpedition13.html');
// Room V
Nodes[41]=new hallNode(26,4,'room5-f.jpg','room5.mov',44,42,43,45,'');
Nodes[42]=new hallNode(26,1,'room5-r.jpg','room5.mov',15,41,45,43,'');
Nodes[43]=new hallNode(29,3,'x14.jpg','',-1,-1,42,44,'',14,'5/x14/xpedition14.html');
Nodes[44]=new hallNode(28,4,'x15.jpg','',-1,-1,43,45,'',15,'5/x15/xpedition15.html');
Nodes[45]=new hallNode(27,5,'x16.jpg','',-1,-1,44,42,'',16,'5/x16/xpedition16.html');
// Room V
Nodes[46]=new hallNode(30,5,'room6-f.jpg','room6.mov',-1,47,48,49,'');
Nodes[47]=new hallNode(30,2,'room6-r.jpg','room6.mov',17,46,49,48,'');
Nodes[48]=new hallNode(32,4,'x17.jpg','',-1,-1,47,49,'',17,'6/x17/xpedition17.html');
Nodes[49]=new hallNode(31,0,'x18.jpg','',-1,-1,48,47,'',18,'6/x18/xpedition18.html');

function popUp(xnumb,xurl) {
	string="width="+top.Popups[xnumb].x;
	string+=",height="+top.Popups[xnumb].y;
	win=window.open(xurl,'win',string);
}

// Make HTML code from a node
function makeHTML(how) {
	code='<table width="380" cellspacing="0" cellpadding="1" border="0">';
	code+='<tr valign="top"><td colspan="3" bgcolor="#FF9900">';
	// Image/QTVR
	if (how!=1) {
		code+='<img src="images/'+ this.imgname + '" width="380" height="200" border="0" usemap="#hallmap">';
		code+='<map name="hallmap">';
		code+=this.imgmap;
		if (this.left >=0) {
			code+='<area coords="0,0,60,200" HREF="javascript:top.loadNode('+this.left+')" TARGET="_top" onMouseOver="rollOn(\'left\')" onMouseOut="rollOut(\'left\')">';
		}
		if (this.right >=0) {
			code+='<area coords="320,0,380,200" HREF="javascript:top.loadNode('+this.right+')" TARGET="_top" onMouseOver="rollOn(\'right\')" onMouseOut="rollOut(\'right\')">';
		}
		if (this.xped) {
			code+='<area coords="100,0,280,200" HREF="javascript:top.popUp('+this.xped+',\''+this.xurl+'\')">';
		} else if (this.fwd>=0) {
			code+='<area coords="100,0,280,200" HREF="javascript:top.loadNode('+this.fwd+')" onMouseOver="rollOn(\'forward\')" onMouseOut="rollOut(\'forward\')">';
		}
		code+='</map>';
	} else {
		code+='<embed src="images/'+this.qtvr+'" width=380 height=200>';
	}	
	code+='</td>';
	code+='</tr>';
	// Navigation
	code+='<tr valign="top"><td align="left">';
	if (how!=1) {
		if (this.left >=0) code+='<A HREF="javascript:top.loadNode('+this.left+')" onMouseOver="rollOn(\'left\')" onMouseOut="rollOut(\'left\')"><img src="images/left-off.gif" width="13" height="15" vspace=5 alt="Turn Left" border="0" name="left">';
		code+='</td><td align=center>';
		if (this.fwd >=0) code+='<A HREF="javascript:top.loadNode('+this.fwd+')" onMouseOver="rollOn(\'forward\')" onMouseOut="rollOut(\'forward\')"><img src="images/forward-off.gif" width="15" height="13" vspace=5 alt="Move Forward" border="0" hspace=5 name="forward">';
		if (this.reverse >=0) code+='<A HREF="javascript:top.loadNode('+this.reverse+')" onMouseOver="rollOn(\'reverse\')" onMouseOut="rollOut(\'reverse\')"><img src="images/reverse-off.gif" width="18" height="14" vspace=5 alt="Turn Around" hspace=5 border="0" name="reverse">';
		if (this.qtvr != '') code+='<A HREF="view.html?qtvr='+this.qtvr+'"  onMouseOver="rollOn(\'qtvr\')" onMouseOut="rollOut(\'qtvr\')"><img src="images/qtvr-off.gif" width="31" height="10" hspace=5 vspace=5 alt="QTVR" border="0" name="qtvr">';
		code+='</td><td align=right>';
		if (this.right >=0) code+='<A HREF="javascript:top.loadNode('+this.right+')" onMouseOver="rollOn(\'right\')" onMouseOut="rollOut(\'right\')"><img src="images/right-off.gif" width="13" height="15" vspace=5 alt="Turn Right" border="0" name="right">';
		if (this.xped) {
			code+='</td></tr><tr><td colspan="3" align="center" class="caption">';	
			code+=XCaptions[this.xped];
		}
	} else {
		code+='</td><td align=center>';
		if (this.reverse >=0) code+='<A HREF="javascript:top.loadNode('+top.master+')" onMouseOver="rollOn(\'reverse\')" onMouseOut="rollOut(\'reverse\')"><img src="images/reverse-off.gif" width="18" height="14" vspace=5 alt="Turn Around" hspace=5 border="0" name="reverse">';
		code+='</td><td align=right>';
	}
	
	code+='</td></tr></table>';	
	return(code);
}
// Hall Node Constructor
function hallNode(position,orientation,imgname,qtvr,fwd,reverse,left,right,imgmap,xped,xurl) {
	this.ID=nextid++;
	this.position=position;
	this.orientation=orientation;
	this.imgname=imgname;
	this.qtvr=qtvr;
	this.imgmap=imgmap;
	this.fwd=fwd;
	this.reverse=reverse;
	this.left=left;
	this.right=right;
	if (xped) this.xped=xped; else this.xped=false;
	if (xurl) this.xurl=xurl; else this.xurl=false;
	this.makeHTML=makeHTML;
}

function rollOn(imgname) {
	eval( 'document.images.'+imgname+'.src="images/'+imgname+'-on.gif"' );
}

function rollOut(imgname) {
	eval( 'document.images.'+imgname+'.src="images/'+imgname+'-off.gif"' );
}

function getQueryParam(paramname) {
	querystring=self.location.search;
	pp=paramname+'=';
	if (querystring.indexOf(pp)!= -1) {
		value=querystring.substring(querystring.indexOf(pp)+pp.length);
		if ( value.indexOf('&') != -1 ) value=value.substring(0,value.indexOf('&'));
		return(value);
	}
	return false;
}
//-->