// JavaScript Document

function openQTVRWindow(MovFile){
	var Width = '800';
	var Height = '600';
	var MoviePath = '/quicktime/'+MovFile+'.mov';
	var MovieTitle = MovFile.replaceAll('-',' ');
	
	window.open('/virtual-tour.php?file='+escape(MoviePath)+'&width='+Width+'&height='+Height+'&title='+escape(MovieTitle),'qtvrViewer','status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,scrollbars=0,width='+Width+',height='+(parseInt(Height)+100));
}
	
var gArgCountErr="The \"%%\" function requires an even number of arguments."+"\nArguments should be in the form \"atttributeName\", \"attributeValue\", ...";
var gTagAttrs=null;
var gQTGeneratorVersion=1;

function AC_QuickTimeVersion(){
	return gQTGeneratorVersion;
}

function _QTComplain(_1,_2){
	_2 = _2.replace("%%",_1);
	alert(_2);
}

function _QTAddAttribute(_3,_4,_5){
	var _6;
	_6 = gTagAttrs[_3+_4];
	if(null==_6){ _6 = gTagAttrs[_4]; }
	if(null!=_6){
		if(0==_4.indexOf(_3)&&(null==_5)){
			_5 = _4.substring(_3.length);
		}
		if(null==_5){ _5 = _4; }
		return ""+_5+"=\""+_6+"\"";
	} else {
		return "";
	}
}

function _QTAddObjectAttr(_7,_8){
	if(0==_7.indexOf("emb#")){ return ""; }
	if(0==_7.indexOf("obj#")&&(null==_8)){
		_8 = _7.substring(4);
	}
	return _QTAddAttribute("obj#",_7,_8);
}

function _QTAddEmbedAttr(_9,_a){
	if(0==_9.indexOf("obj#")){ return ""; }
	if(0==_9.indexOf("emb#")&&(null==_a)){ 
		_a = _9.substring(4);
	}
	return _QTAddAttribute("emb#",_9,_a);
}

function _QTAddObjectParam(_b,_c){
	var _d;
	var _e="";
	var _f=(_c)?" />":">";
	if(-1==_b.indexOf("emb#")){
		_d = gTagAttrs["obj#"+_b];
		if(null==_d){ _d = gTagAttrs[_b]; }
		if(0==_b.indexOf("obj#")){ _b = _b.substring(4); }
		if(null!=_d){ 
			_e = "<param name=\""+_b+"\" value=\""+_d+"\""+_f;
		}
	}
	return _e;
}

function _QTDeleteTagAttrs(){
	for(var ndx=0;ndx<arguments.length;ndx++){
		var _11 = arguments[ndx];
		delete gTagAttrs[_11];
		delete gTagAttrs["emb#"+_11];
		delete gTagAttrs["obj#"+_11];
	}
}

function _QTGenerate(_12,_13,_14){
	if(_14.length<4||(0!=(_14.length%2))){
		_QTComplain(_12,gArgCountErr);
		return "";
	}
	gTagAttrs = new Object();
	gTagAttrs["src"] = _14[0];
	gTagAttrs["width"] = _14[1];
	gTagAttrs["height"] = _14[2];
	gTagAttrs["classid"] = "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B";
	gTagAttrs["pluginspage"] = "http://www.apple.com/quicktime/download/";
	var _15=_14[3];
	if((null==_15)||(""==_15)){ _15 = "6,0,2,0"; }
	gTagAttrs["codebase"] = "http://www.apple.com/qtactivex/qtplugin.cab#version="+_15;
	var _16,attrValue;
	for(var ndx=4;ndx<_14.length;ndx+=2){
		_16 = _14[ndx].toLowerCase();
		attrValue = _14[ndx+1];
		if("name"==_16||"id"==_16){
			gTagAttrs["name"] = attrValue;
		} else {
			gTagAttrs[_16] = attrValue;
		}
	}
	var _18 = "<object "+_QTAddObjectAttr("classid")+_QTAddObjectAttr("width")+_QTAddObjectAttr("height")+_QTAddObjectAttr("codebase")+_QTAddObjectAttr("name","id")+_QTAddObjectAttr("tabindex")+_QTAddObjectAttr("hspace")+_QTAddObjectAttr("vspace")+_QTAddObjectAttr("border")+_QTAddObjectAttr("align")+_QTAddObjectAttr("class")+_QTAddObjectAttr("title")+_QTAddObjectAttr("accesskey")+_QTAddObjectAttr("noexternaldata")+">"+_QTAddObjectParam("src",_13);
	var _19 = "<embed "+_QTAddEmbedAttr("src")+_QTAddEmbedAttr("width")+_QTAddEmbedAttr("height")+_QTAddEmbedAttr("pluginspage")+_QTAddEmbedAttr("name")+_QTAddEmbedAttr("align")+_QTAddEmbedAttr("tabindex");
	_QTDeleteTagAttrs("src","width","height","pluginspage","classid","codebase","name","tabindex","hspace","vspace","border","align","noexternaldata","class","title","accesskey");
	for(var _1a in gTagAttrs){
		attrValue = gTagAttrs[_1a];
		if(null!=attrValue){
			_19 += _QTAddEmbedAttr(_1a);
			_18 += _QTAddObjectParam(_1a,_13);
		}
	}
	return _18+_19+"></em"+"bed></ob"+"ject"+">";
}

function QT_GenerateOBJECTText(){
	return _QTGenerate("QT_GenerateOBJECTText",false,arguments);
}

function QT_GenerateOBJECTText_XHTML(){
	return _QTGenerate("QT_GenerateOBJECTText_XHTML",true,arguments);
}

function QT_WriteOBJECT(){
	document.writeln(_QTGenerate("QT_WriteOBJECT",false,arguments));
}

function QT_WriteOBJECT_XHTML(){
	document.writeln(_QTGenerate("QT_WriteOBJECT_XHTML",true,arguments));
}

// Replaces all instances of the given substring.
String.prototype.replaceAll = function( strTarget, strSubString ){
	var strText = this;
	var intIndexOfMatch = strText.indexOf( strTarget );
 
	while (intIndexOfMatch != -1){
		strText = strText.replace( strTarget, strSubString )
		intIndexOfMatch = strText.indexOf( strTarget );
	}
 
	return( strText );
}