var QTVRobjectParamStr = '\t';
var QTVRembedParamStr = '';

function addQTVR(Name, Pan, Tilt) {
	 addQTVRParameter("src",Name);
	 addQTVRParameter("controller","true");
	 addQTVRParameter("pan",Pan);
	 addQTVRParameter("tilt",Tilt);
	 addQTVRParameter("fov","60");
	 addQTVRParameter("scale","tofit");
	 addQTVRParameter("enablejavascript","true");
	 addQTVRParameter("cache","true");
	 InsertQTVR("viewer",360,200);
}

function addQTVRParameter(Name,Value) {
	QTVRobjectParamStr = QTVRobjectParamStr + '<param name="' + Name + '" value="' + Value + '">\n\t';
	QTVRembedParamStr = QTVRembedParamStr + Name + '="' + Value + '" ';
}

function InsertQTVR(Name, Width, Height) {
  outstr = '<object name="' + Name + '" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="' + Width + '" height="' + Height +'">\n';
  outstr += QTVRobjectParamStr + '\n';
  outstr += '<embed width="' + Width + '" height="' + Height + '" ' + QTVRembedParamStr + '>\n';
  outstr += '</embed>\n</object>\n';
  document.write(outstr);
  QTVRobjectParamStr = '\t';
  QTVRembedParamStr = '';
}


