function fs_string(n) {
	cont='';
	cont += '<li class="pano_qt"><a onclick="cft=0;openhires('+n+'); return ClickReturn(1);" target="fullscreen" href="'+path+'/fullscreen.html?id='+n+'" title="QuickTime Hi-Res" class="panolink"><span class="label">QT Hi-Res</span></a></li>';
	document.write (cont);
}

function openhires(n){
	if(haveqt){
		if (ns4){
			//
		} else { 
			iviewer.document.location=path+"/splash.html";
		}
		loadPanoWin(n);
	} else alert('No Quicktime is detected.');
}	

function runcheck() {
	if (!haveqt && !havejava){
		if (confirm ('Neither Quicktime nor the Java Virtual Machine is apparently installed on your system. One or the other is required to view this tour. With Quicktime you will have a better viewing experience and is a smaller download. It is recommended that you click [Ok] to download it now, or click [Cancel] to exit and attempt to view the VR anyway.'))document.location.href="http://www.apple.com/quicktime";
	}
}

function go_to(obid) {
	++obid;
	obsid=eval(opie?'sel'+obid:'');
	sel_click(obsid,obid);
}

function opt_click(n) {
	if (ns4) {
		++n;
		sel_click(n,n);
	} 
}

function sel_click(obj, obid){
	obsid='sel'+obid; --obid; 
	bgimg=path+"/images/map/point";
	if (obsid != curdiv.nm){
		if(ie || opera){
			if (curdiv.nm){
				eval(curdiv.nm).className='select_'+curdiv.pl;
				was=opera?'0':'2';
				document.all['point'+curdiv.id].style.backgroundImage = "url('"+bgimg+curdiv.id+"_"+was+".gif"+"')";
			}
			obj.className='select_'+align[obid]+'over';
			document.all['point'+obid].style.backgroundImage = "url('"+bgimg+obid+"_1.gif"+"')";
		} else if (!ns4) {
			obj2=document.getElementById(''+obsid); obj2.className='select_'+align[obid]+'over';
			if (curdiv.nm){	
				obj2=document.getElementById(''+curdiv.nm);	
				obj2.className='select_'+curdiv.pl;
				document.getElementById('point'+curdiv.id).style.backgroundImage = "url('"+bgimg+curdiv.id+"_2.gif"+"')";
			}
			document.getElementById('point'+obid).style.backgroundImage = "url('"+bgimg+obid+"_1.gif"+"')";
		}
		curdiv.nm = obsid; curdiv.pl = align[obid]; curdiv.id = obid;
	}
	if(cft) loadmovie(obid); cft=1;
}

function loadmovie(n) {
	if(mode==cmode) {
		if (mode == 'qt')loadmovie_qt(n)
		else loadmovie_java(n);
	} else {
		mode=cmode;
		newvr=n;
		if (mode == 'qt' && haveqt){
			if (ns4)window.location = "?mode=1&id="+newvr;
//			else loadframe()
			else iviewer.document.location = path+"/loadframe.html?mode=1&id="+newvr;
		} else if (mode == 'java' && havejava){         
			if (ns4)window.location = "?mode=2&id="+newvr;
//			else loadframe()
			else iviewer.document.location = path+"/loadframe.html?mode=1&id="+newvr;
		} else alert('No '+(mode == 'qt'?'Quicktime ':'Java Virtual Machine ')+ 'is detected.');
	}
}
function setnodes(newvr) {
	document.viewer.SetControllerVisible(qtcontroller); // why it not works???
	for (n=0; n<numhotspots; n++) {
		if (x[newvr][n]) {
			destn=dest[newvr][n];
			document.viewer.SetHotspotUrl((n+1),"javascript:go_to("+destn+")");
		}
	}
}
function loadmovie_qt(n) {
	if (mode == 'qt') {
		newvr=n;
		if (ns4) {
			gopath=path+"/qtvr/"+scene[newvr]+"_low.mov";
			document.viewer.SetURL(gopath);
			TimerID3=setTimeout('setnodes(newvr)',200);
		} else {
			iviewer.document.location=path+"/loadframe.html";
		}
		currentn=n;
	} else {
		alert('No QuickTime detected!')
	}
}

function loadmovie_java(n){
	if (havejava){
		newvr=n;
		if (ns4) {
			document.viewer.newPanoFromList(newvr);
		} else if (dom) {
			iviewer.document.getElementById('viewer').newPanoFromList(newvr);
		} else {
			iviewer.document.viewer.newPanoFromList(newvr);
		}
		currentn=n;
	} else {
		alert('No Java detected!')
	}
}

// Buttons for PTViewer
function DoAutorotationStart() {
	if ((mac) || (ns4)) {document.viewer.startAutoPan( 0.5, 0.0, 1.0 );}
	else {iviewer.document.viewer.startAutoPan( 0.5, 0.0, 1.0 );}
}

function DoAutorotationStop() {
	if ((mac) || (ns4)) {document.viewer.stopAutoPan();}
	else {iviewer.document.viewer.stopAutoPan();}
}
function DoZoomIn() {
	if ((mac) || (ns4)) {var pv=document.viewer;}
	else {	var pv=iviewer.document.viewer;}
	pv.moveTo(pv.pan(),pv.tilt(),60,10);
}
function DoZoomOut() {
	if ((mac) || (ns4)) {var pv=document.viewer;}
	else {	var pv=iviewer.document.viewer;}
	pv.moveTo(pv.pan(),pv.tilt(),120,10);
}
function DoShowHideHotspots() {
	if ((mac) || (ns4)) {document.viewer.toggleHS();}
	else {iviewer.document.viewer.toggleHS();}
}
function DoReset() {
	if ((mac) || (ns4)) {document.viewer.gotoView(0,0,80);}
	else {iviewer.document.viewer.gotoView(0,0,80);}
}

