// ©2003 ChannelVR. All rights reserved

// ----------------------------------------------
// GENERALLY USED STRUCTURES
// ----------------------------------------------

var pathToSharedFiles="../../shared-files/"
var activePortal=pathToPortal;
var activeAgent=pathToAgent;
var activePagePath=pathToPage;
var commonResourcesURL=pathToSharedFiles;

// track the active asset
var currentRoom=0;

//Set variables:
nn4=(document.layers)? true:false
ie4=(document.all)? true:false

var activeSecondaryDescription = "";

// which floorplan is being shown
var activeFloorplan=0;

var frameContents = new Array();
// frameContent Object constructor
function frameContent(frameName, displayOnEnterPage) {
   this.frameName 		= frameName
   this.displayOnEnterPage	= displayOnEnterPage
}

// setup a short reference to frames
var viewer = null;
var floorplan = null;

var agentContact;
var agentMobile;

var pageTitle;
var pageHeading1;
var pageHeading2;
var pageHeading3;
var pageDescription;

var paramArray = new Array();
paramArray["mode"] = "normal"; // default to normal mode

function parseParameters() {
// takes parameters as name/value pairs passed in with the URL and populates form fields on this page where the names match
// this will currently only work for form[0] on a page.. could be extended to handle multiple forms on a page by searching for matching elements in all forms
				sSearch = document.location.search.substring(1); // lose the '?'
				sArr = sSearch.split('&'); // split into string array  by '&' seperator
				for (i=0;i<sArr.length;i++) { // loop through all pairs
					if (sArr[i]) { // if the string is not empty
						sPair=sArr[i].split('='); // split into string array by '=' seperator
						sName=sPair[0]; // the name comes first
						sValue=sPair[1]; // then the value
						// set its value to the parameter
						paramArray[sName] = sValue;
						//alert(sName);
						//alert(paramArray[sName]);
					}
				}
}

parseParameters();

