function LA_swapImgRestore() { //v3.0	var i,x,a=document.LA_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}function LA_findObj(n, d) { //v4.01  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=LA_findObj(n,d.layers[i].document);  if(!x && d.getElementById) x=d.getElementById(n); return x;}function LA_swapImage() { //v3.0	var i,j=0,x,a=LA_swapImage.arguments; document.LA_sr=new Array; for(i=0;i<(a.length-2);i+=3)	if ((x=LA_findObj(a[i]))!=null){document.LA_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}

function OpenFooterAsset(URL)
{
	window.open(URL,"Virtual_Visit_Information","toolbar=no,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes,scrolling=yes,resizable=yes,width=750,height=550,left=0,top=0");
}

function embedQuicktimeObject(movie, id)
{
	document.write("<object id='" + id + "' classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width='100%' height='100%' codebase='http://www.apple.com/qtactivex/qtplugin.cab'>");
		document.write("<param name='src' value='" + movie + "' />");
		document.write("<param name='controller' value='true' />");
		document.write("<param name='autoplay' value='true' />");
		document.write("<param name='enablejavascript' value='true' />");
		document.write("<param name='scale' value='aspect' />");
		document.write("<param name='kioskmode' value='true' />");
		document.write("<param name='bgcolor' value='#004236' />");
			
		document.write("<embed ");
			document.write("id='" + id + "'");
			document.write("src='" + movie + "'");
			document.write("width='100%'");
			document.write("height='100%'");
			document.write("autoplay='true'");
			document.write("scale='aspect'");
			document.write("kioskmode='true'");
			document.write("bgcolor='#004236'");
			document.write("type='video/quicktime'");
			document.write("pluginspage='http://www.apple.com/quicktime/download/'");
			document.write("enablejavascript='true'");
			document.write("controller='true'");
		document.write("></embed>");
			
	document.write("</object>");
}

function embedFlashObject(asset, id)
{
	document.write('<object id="' + id + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
	document.write('height="100%"');
	document.write('width="100%">');
	document.write('<param name="src" value="' + asset + '">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="align" value="middle">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="bgcolor" value="#FFFFFF">');
	document.write( '<embed ' );
	document.write( '  swliveconnect="true" ');
	document.write( '  id="' + id + '" ' );
	document.write( '  src="' + asset + '" ' );
	document.write( '  name="' + asset + '"' );
	document.write( '  height="100%" ' );
	document.write( '  width="100%" ' );
	document.write( '  align="middle" ' );
	document.write( '  quality="high" ' );
	document.write( '  allowScriptAccess="sameDomain" ' );
	document.write( '  scale="aspect" ' );
	document.write( '  pluginspage="http://www.macromedia.com/go/getflashplayer" ' );
	document.write( '  bgcolor="#FFFFFF" ' );
	document.write( '  type="application/x-shockwave-flash">' );
	document.write( '</embed>' );
	document.write('</object>');
}

function getFlashMovieObject(movieName)
{
	var referenceToFlash = "";
	
	if (window.document["comicMovie"]) 
	{
		 referenceToFlash = window.document[movieName];
	}
	if (navigator.appName.indexOf("Microsoft Internet")==-1)
	{
		if (document.embeds && parent.parent.document.embeds["comicMovie"])
		{
			referenceToFlash = document.embeds[movieName];
		}
	}
	else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
	{
		referenceToFlash = document.getElementById(movieName);
	}
	
	return referenceToFlash;
}

function showHideText(video)
{
	var text = "";
	var layer = parent.document.getElementById("textArea");
	var panelMovie = document.panelMovie;
		
	if (video == 6) video = "smils/license_intro.smil";
	if (video == 1) video = "smils/license_app_1.smil";
	if (video == 2) video = "smils/license_app_2.smil";
	if (video == 3) video = "smils/license_app_3.smil";
	if (video == 4) video = "smils/license_app_4.smil";
	if (video == 5) video = "smils/license_app_5.smil";
	
	if (layer.innerHTML == "")
	{
		//Stop the main movie.
		stopFlash();
		
		//Open the side panel.
		layer.innerHTML += '<iframe name="descriptionPage" src="video.html?smil=' + video + '" height="100%" width="100%" scrolling="auto" frameborder="none"></iframe>';

		//For Safari, pad some spaces so that the side panel opens properly.
		if (navigator.appVersion.indexOf("Safari") > -1)
		{
			for (var i=0; i<75; i++) 
			{
				text += '&nbsp;';
			}
		}
		
		//Display the side panel information.
		layer.innerHTML += text;
	}
	else
	{
		//Set the side panel to nothing thereby closing it.
		layer.innerHTML = "";
		
		//Make sure the panel movie stops.
		panelMovie.Stop();
		
		//Start the main movie again.
		playFlash();
	}
}

function playFlash()
{
	var flashMovie = getFlashMovieObject("comicMovie");
	flashMovie.Play();
}

function stopFlash()
{
	var flashMovie = getFlashMovieObject("comicMovie");
	flashMovie.StopPlay();
}
