// ver 1.0 DPJS 04 Spet 2003
	function VirtualTour(codebase, showcontrolbar, showcompass, height, width, agentlogo) {
		this.codebase = codebase;
		this.agentlogo = (agentlogo) ? agentlogo:'http://ivt2.webdadi.biz/public/viewers/ivt2/default.jpg';
		this.height = (height) ? height:270;
		this.width = (width) ? width:550;
		this.showcontrolbar = (showcontrolbar && showcontrolbar == true) ? true:false;
		this.showcompass = (showcompass && showcompass == true) ? true:false;
		this.panoList = new Array(new Array(), new Array(), new Array());
		this.HTML = '';
		this.preload, this.optionlist='';
		this.add = function (img, name) {
			if (!img || !name)
				alert('Invalid Parameters in [object].add');
			else {
				img = img.replace('{','%7b');
				img = img.replace('}','%7d');
				this.panoList[0][this.panoList[0].length] = img;
				this.panoList[1][this.panoList[1].length] = name;	
				this.panoList[2][this.panoList[2].length] = img.substring(img.length-3, img.length);		
			}
		}
		this.create = function () {
			if (this.panoList[0].length > 0) {
				this.HTML = '<table cellpadding="0" cellspacing="0" border="0" ><tr><td>' +
					'<applet codebase="' + this.codebase + '" archive="ptviewer.jar" width="' + this.width + '" height="' + this.height + '"code="ptviewer.class" name="ptviewer" id="ptviewer">' +
					'<param name="file" value="ptviewer:0"><param name="quality" value="3"><param name="wait" value="' + this.agentlogo + '" />';
				for (var i = 0; i < this.panoList[0].length; i++) {
					this.HTML += '<param name="pano' + i + '" value="{file=' + this.panoList[0][i] + '}{fov=100}{fovmin=50}{fovmax=100}{auto=0.25}';
					if (this.panoList[2][i] == '3dl')
						this.HTML += '{tiltmin=-35}{tiltmax=35}'
					this.HTML += '">';
					if (this.preload != '')
						this.preload += ',';
					this.preload += unescape(this.panoList[0][i]);
					this.optionlist += '<option>' + this.panoList[1][i] + '</option>';
				}
				this.HTML += '<param name="preload" value="' + this.preload + '">';
				if (showcompass)
					this.HTML += '<param name="bar_y" value="' + (height-40) + '"><param name="applet0" value="{code=ptcompass.class}{compass_map=' + this.codebase + '/compass.gif}{compass_x=2}{compass_y=253}{compass_pan=1}">';
				this.HTML += '<param name="inits" value="ptviewer:startApplet(0)"></applet></td></tr>';
				if (this.showcontrolbar) {
					this.HTML += '<tr><td style="background-color:#C0C0C0;"><table width="100%"><tr>' +
						'<td width="15"><img src="' + this.codebase + '/ctrl_zoom_out.gif" height="17" width="17" border="0" alt="Zoom In" onClick="document.getElementById(\'ptviewer\').ZoomIn()"></td>' +
						'<td width="15"><img src="' + this.codebase + '/ctrl_zoom_in.gif" height="17" width="17" border="0" alt="Zoom Out" onClick="document.getElementById(\'ptviewer\').ZoomOut()"></td>' +
						'<td width="15"><img src="' + this.codebase + '/ctrl_play.gif" height="17" width="17" border="0" alt="Play" onClick="document.getElementById(\'ptviewer\').startAutoPan(0.25, 0, 1);"></td>' +
						'<td>&nbsp;</td><td width="90" style="font-family:tahoma;font-size:11px;">Currently viewing:</td><td width="10"><select style="font-family:tahoma;font-size:11px;" onChange="document.getElementById(\'ptviewer\').newPanoFromList(this.selectedIndex);ptviewer.startApplet(0)">' +
						this.optionlist + '</select></td><td width="15"><img src="' + this.codebase + '/ctrl_help.gif" alt="Help" width="17" height="17" border="0" onclick="showHelp()"></td></tr></table></td></tr></table>';						
				}
				document.write(this.HTML);
			} else
				alert('No Images specified for [object].create');
		}
	}

	function showHelp() {
		var oPop = window.createPopup();
		oBody = oPop.document.body;
		oBody.style.backgroundColor='#ffffff';
		oBody.style.border='1px solid #000000';
		oBody.innerHTML = '<table><tr><td style="font-family:tahoma;font-size:16px;font-weight:bold;color:#ff8c00">Inside View<sup>2</sup> Help</td></tr><tr><td style="font-size:11px;font-family:tahoma;">This applet requires a Java enabled browser to ' +
			'display correctly. If you cannot see the viewer correctly, get the latest version of the Java Virtual Machine ' +
			'from <a href="#" onclick="parent.window.open(\'http://www.java.com\')">http://www.java.com</a></td></table>';
		oPop.show(window.event.clientX-340,window.event.clientY-120,340,120, oBody);
	}