function renderPano(vid,movieurl) {
	document.writeln('<div id="container_'+vid+'" style="display:block;width:480px;padding:0px;padding:6px;">');
	document.writeln('<div id="loader_'+vid+'" style="display:block;font-family:Arial;font-size:12px;padding:0px;margin-bottom:6px;border-style:none;width:480px;text-align:left;">Loading - Please Wait...</div>');
	document.writeln('<div style="margin:30px 0px 0px 0px;display:block;padding:0px;"><object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="480" height="240" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" id="qtvr_'+vid+'" style="display:block;">');
	document.writeln('  <param name="src" value="'+movieurl+'" />');
	document.writeln('  <param name="autoplay" value="true" />');
	document.writeln('  <param name="controller" value="true" />');
	document.writeln('  <param name="qtsrcdontusebrowser" value="true" />');
	document.writeln('  <param name="kioskmode" value="true" />');
	document.writeln('  <param name="enablejavascript" value="true" />');
	document.writeln('  <embed src="'+movieurl+'" width="480" height="240" pluginspage="http://www.apple.com/quicktime/download/" name="qtvr_'+vid+'" autoplay="true" controller="true" qtsrcdontusebrowser="true" kioskmode="true" enablejavascript="true" style="display:block;margin-top:0px;"> </embed>');
	document.writeln('</object></div>');
	document.writeln('</div>');
	document.writeln('<script type="text/javascript">');
	document.writeln('<!--');
	document.writeln('function checkcallback_'+vid+'() {');
	document.writeln('	if (document.qtvr_'+vid+'.GetPluginStatus()==\'Complete\') {');
	document.writeln('		document.getElementById(\'loader_'+vid+'\').innerHTML=\'Drag Mouse to Pan, Shift Zoom in, Ctrl Zoom out\';');
    document.writeln('      document.qtvr_'+vid+'.height=256;');
	document.writeln('	} else {');
	document.writeln('		setTimeout(\'checkcallback_'+vid+'()\',1000);');
	document.writeln('	}');
	document.writeln('}');
	document.writeln('setTimeout(\'checkcallback_'+vid+'();\',1000);');
	document.writeln('//-->');
	document.writeln('</script>');
}

function setPano(vid,movieurl,title,desc) {
    // URL encode the last 3 args
    setTimeout('isetPano(document.qtvr_'+vid+',\''+movieurl+'\','+vid+',\'' + title + '\',\''+ desc +'\');',1);
}
function isetPano(tobj,movieurl,vid,title,desc) {
    if (tobj.GetPluginStatus()=='Complete') {
        tobj.height=240;
        document.getElementById('loader_'+vid).innerHTML='Loading - Please Wait...';
        document.getElementById('vttitle_'+vid).innerHTML=unescape(title);
        document.getElementById('vtdesc_'+vid).innerHTML=unescape(desc);
        tobj.SetURL(unescape(movieurl));
        tobj.SetControllerVisible(true);
        tobj.SetKioskMode(true);
        setTimeout('checkcallback_'+vid+'();',1000);
    }
}