// JavaScript Document

function changepano() 
{
	var soundon=false;
	var elementid = document.getElementById("choice");
	var temp = elementid[elementid.selectedIndex].value;
	var temp2 = temp.split("#");
	if (temp2[0] == "pano")
	{
		stopflashvideo();
		startsoundplayer();
		document.getElementById("stilldiv").style.visibility = "hidden";
		document.getElementById("viddiv").style.visibility = "hidden";
		document.getElementById("slideshow").style.visibility = "hidden";
		document.getElementById("panodiv").style.visibility = "visible";
		document.ptviewer.newPanoFromList(parseInt(temp2[1]));
		document.getElementById("textdiv").innerHTML = temp2[2];
		document.getElementById("textTitle").innerHTML = temp2[3];

	}
	if (temp2[0] == "still")
	{
		stoppano();
		stopflashvideo();
		startsoundplayer();
		document.getElementById("panodiv").style.visibility = "hidden";
		document.getElementById("viddiv").style.visibility = "hidden";
		document.getElementById("slideshow").style.visibility = "hidden";
		document.getElementById("stilldiv").style.visibility = "visible";
		document.getElementById("textdiv").innerHTML = temp2[2];
		document.getElementById("textTitle").innerHTML = temp2[3];
	}
	if (temp2[0] == "video")
	{
		stoppano();		
		stopsoundplayer();
		document.getElementById("panodiv").style.visibility = "hidden";
		document.getElementById("stilldiv").style.visibility = "hidden";
		document.getElementById("slideshow").style.visibility = "hidden";
		document.getElementById("viddiv").style.visibility = "visible";
		document.getElementById("textdiv").innerHTML = temp2[2];
		document.getElementById("textTitle").innerHTML = temp2[3];
		startflashvideo();
	}
	if(temp2[0] == "slideshow")
	{
		stoppano();
		stopflashvideo();
		startsoundplayer();
		document.getElementById("panodiv").style.visibility = "hidden";
		document.getElementById("viddiv").style.visibility = "hidden";
		document.getElementById("stilldiv").style.visibility = "hidden";
		document.getElementById("slideshow").style.visibility = "visible";
		document.getElementById("textdiv").innerHTML = temp2[2];
		document.getElementById("textTitle").innerHTML = temp2[3];
	}
	
}

function stoppano() 
{
	document.ptviewer.stopAutoPan();
}

function startpano() 
{
	document.ptviewer.startAutoPan( 0.2, 0.0, 1.0 );
}

function still_visible() 
{
	document.getElementById("stilldiv").style.visibility = "visible";
	document.getElementById("panodiv").style.visibility = "hidden";
}

function pano_visible() 
{
	
	document.getElementById("stilldiv").style.visibility = "hidden";
	document.getElementById("panodiv").style.visibility = "visible";
	document.getElementById("viddiv").style.visibility = "hidden";
	
}
function video_visible()
{
stopsoundplayer()
	document.getElementById("stilldiv").style.visibility = "hidden";
	document.getElementById("panodiv").style.visibility = "hidden";
	document.getElementById("viddiv").style.visibility = "visible";
	startflashvideo();
}

function stopvideo()
{
	document.mediaPlayer.stop();
}

function startvideo()
{
	document.mediaPlayer.play();
}
function stopflashvideo()
{  
	if (navigator.userAgent.indexOf("Opera")==-1)
	{
		var movie = document.video;
		movie.GotoFrame(2);
	}
}
function startflashvideo()
{
	if (navigator.userAgent.indexOf("Opera")==-1)
	{
		var movie = document.video;
		movie.Rewind();
	}

}
function stopsoundplayer()
{
	soundon=false;
	if (navigator.userAgent.indexOf("Opera")==-1)
	{

		var sound=document.sound;
		sound.GotoFrame(2);
	}
}
function startsoundplayer()
{	
	if(!soundon)
	{
		soundon=true;
		if (navigator.userAgent.indexOf("Opera")==-1)
		{
			var sound=document.sound;
			sound.Rewind();
		}
	}
}

