// ©2003 ChannelVR. All rights reserved

// ----------------------------------------------
// GENERALLY USED STRUCTURES
// **** DO NOT EDIT THIS FILE ****
// ----------------------------------------------
var plans	 	= new Array();
var specificGuidedTour 	= new Array();
var rooms 		= new Array();
var stills 		= new Array();
var videos 		= new Array();
var Objects3D 		= new Array();
var index		= 0;
var guidedtour		= false; // determines if guided tour button is displayed

// Room Object constructor
function room(panoImageURL, panoThumbURL, panoTitle, panoDescription, panoFloorplanHotspot) {
   this.index 			= rooms.length
   this.name 			= "room"
   this.panoImageURL 		= panoImageURL
   this.panoThumbURL 		= panoThumbURL
   this.panoTitle 		= panoTitle
   this.panoDescription 	= panoDescription
   this.hotspots		= new Array()
}
// 3D Hotspot Object constructor
function hotspot(pitch, yaw, zoom, points, type, action, desc) {
   this.name 		= "hotspot"
   this.pitch 		= pitch
   this.yaw 		= yaw
   this.zoom 		= zoom
   this.points 		= points
   this.action		= action
   this.type		= type
   this.desc		= desc
}

// 2D Still Image Object constructor
function still(stillImageURL, stillThumbURL, stillTitle, stillDescription) {
   this.index 			= stills.length
   this.name 			= "still"
   this.stillImageURL 		= stillImageURL
   this.stillThumbURL 		= stillThumbURL
   this.stillTitle 		= stillTitle
   this.stillDescription 	= stillDescription
}

// Video Object constructor
function video(videoURL, videoThumbURL, videoTitle, videoDescription) {
   this.index 			= videos.length
   this.name 			= "video"
   this.videoURL 		= videoURL
   this.videoThumbURL 		= videoThumbURL
   this.videoTitle 		= videoTitle
   this.videoDescription 	= videoDescription
}

// 3D Object constructor
function Object3D(object3DURL, object3DThumbURL, object3DTitle, object3DDescription) {
   this.index 			= Objects3D.length
   this.name 			= "Object3D"
   this.object3DURL 		= object3DURL
   this.object3DThumbURL 		= object3DThumbURL
   this.object3DTitle 		= object3DTitle
   this.object3DDescription 	= object3DDescription
}

// Plan Object constructor
function plan(planImageURL, planThumbURL, planTitle, planDescription) {
   this.index 			= plans.length
   this.name 			= "plan"
   this.planImageURL 		= planImageURL
   this.planThumbURL 		= planThumbURL
   this.planTitle 		= planTitle
   this.planDescription 	= planDescription
   this.hotspots		= new Array()
}

function escape(s)
{
	s = "" + s; // Convert s to a string.
   var OKString = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890@*-_+./";

   var newStr = "";

   for (var i=0;i<s.length;i++)
   {
     var ch = s.charAt(i);
     if (OKString.indexOf(ch)==-1)
     {

   	var n = new Number(s.charCodeAt(i));
   	var str = n.toString(16);
   	if (str.length==1) str = "0"+str;
   	newStr = newStr+"%"+str;
     }
     else
        newStr = newStr + ch;
   }


   return newStr;
}
