var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 22;
// -----------------------------

// Version check based upon the values entered above in "Globals"
var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

function detect_pano(tour_id,pano_name,degree,top_dir)
{
	// Check to see if the version meets the requirements for playback
	if (hasReqestedVersion)
	{
		// if we've detected an acceptable version
		// embed the Flash Content SWF when all tests are passed
		var player = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="620" height="465">'
				+'<param name="movie" value="../../../flash/panoview.swf?file=../../../tour_images/'+top_dir+'/'+tour_id+'/panoramic/'+pano_name+'&degree='+degree+'" />'
				+'<param name="quality" value="high" />'
				+'<param name="AllowScriptAccess" value="always" />'
				+'<embed src="../../../flash/panoview.swf?file=../../../tour_images/'+top_dir+'/'+tour_id+'/panoramic/'+pano_name+'&degree='+degree+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="620" height="465"></embed>'
				+'</object>';
		document.write(player); 
	}
	else
	{
		document.getElementById("getflash").style.display = "block";
	}
}

function view_pano(tour_id,pano_name,degree,top_dir)
{
		// embed the Flash Content SWF when all tests are passed
		var player = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="620" height="465">'
				+'<param name="movie" value="http://www.myvisuallistings.com/flash/panoview.swf?file=../../tour_images/'+top_dir+'/'+tour_id+'/panoramic/'+pano_name+'&degree='+degree+'" />'
				+'<param name="quality" value="high" />'
				+'<embed src="http://www.myvisuallistings.com/flash/panoview.swf?file=../../tour_images/'+top_dir+'/'+tour_id+'/panoramic/'+pano_name+'&degree='+degree+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="620" height="465"></embed>'
				+'</object>';
		document.write(player); 
}

function detect_pano_treb(tour_id,pano_name,degree,top_dir)
{
	// Check to see if the version meets the requirements for playback
	if (hasReqestedVersion)
	{
		// if we've detected an acceptable version
		// embed the Flash Content SWF when all tests are passed
		var player = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="620" height="465">'
				+'<param name="movie" value="http://www.myvisuallistings.com/flash/panoview-nologo.swf?file=../../../tour_images/'+top_dir+'/'+tour_id+'/panoramic/'+pano_name+'&degree='+degree+'" />'
				+'<param name="quality" value="high" />'
				+'<embed src="http://www.myvisuallistings.com/flash/panoview-nologo.swf?file=../../../tour_images/'+top_dir+'/'+tour_id+'/panoramic/'+pano_name+'&degree='+degree+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="620" height="465"></embed>'
				+'</object>';
		document.write(player); 
	}
	else
	{
		document.getElementById("getflash").style.display = "block";
	}
}


function super_pano(tour_id,pano_name,current_pano,top_dir)
{
	if (current_pano== "" || current_pano == 0)
		current_pano=1;
	var player = '<APPLET archive="../../../3dpanofiles/mvl.jar" code="PurePlayerPro" width="620" height="465">'
	+'<param name="panorama" value="../../../tour_images/'+top_dir+'/'+tour_id+'/panoramic/'+pano_name+'" />'
	+'<param name="gui" value="../../../tour_images/'+top_dir+'/'+tour_id+'/panoramic/gui'+current_pano+'.xml" />'
	+'<param name="optimizememory" value="true">'
	+'<param name="mousespeed" value="40">'
	+'<param name="quality" value="300" />'
	+'<param name="fullscreen" value="true" />'
	+'<param name="antialiasing" value="everytime" />'
	+'You need JAVA to view the panoramic scenes.<br /><br />'
	+'<strong><a href="http://www.java.com/getjava/" target="_blank" >Click here to get JAVA</a></strong><br />'
	+'<br />'
	+'After you install JAVA, please restart your browser.'
	+'</APPLET>';
	document.write(player);
}

function super_pano_treb(tour_id,pano_name,total_panos,current_pano,top_dir)
{
	if (current_pano == "" || current_pano == 0) current_pano=1;
	var player = '<APPLET archive="../../../3dpanofiles/treb.jar" code="PurePlayerPro" width="620" height="465">'
	+'<param name="panorama" value="../../../tour_images/'+top_dir+'/'+tour_id+'/panoramic/'+pano_name+'" />'
    //'<param name="gui" value="../../../gui/gui.xml" />'
	+'<param name="gui" value="../../../tour_images/'+top_dir+'/'+tour_id+'/panoramic/gui'+current_pano+'.xml" />'
	+'<param name="optimizememory" value="true">'
	+'<param name="mousespeed" value="40">'
	+'<param name="quality" value="300" />'
	+'<param name="fullscreen" value="true" />'
	+'<param name="antialiasing" value="everytime" />'
	+'</APPLET>';
	document.write(player); 
	//+'<param name="panorama" value="http://www.myvisuallistings.com/tour_images/'+tour_id+'/panoramic/'+pano_name+'" />'
}

function detect_sound(soundfile,action)
{
	// Check to see if the version meets the requirements for playback
	if (hasReqestedVersion)
	{
	var sound = '<param name="movie" value="http://www.myvisuallistings.com/flash/sound.swf?sound='+soundfile+'&amp;action='+action+'" />'
	+'<param name="allowScriptAccess" value="sameDomain" />'
	+'<param name="quality" value="high" />'
	+'<param name="bgcolor" value="#4e4e4e" />'
 	+'<embed src="http://www.myvisuallistings.com/flash/sound.swf?sound='+soundfile+'&amp;action='+action+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="25" height="10"></embed>';
	document.write(sound); 
	}
	else
	{
		document.getElementById("getflash").style.display = "block";
	}
}

function detect_vt_sound(soundfile,action,url)
{
	// Check to see if the version meets the requirements for playback
	if (hasReqestedVersion)
	{
	var sound = '<param name="movie" value="http://www.myvisuallistings.com/flash/vt-sound.swf?sound='+soundfile+'&amp;action='+action+'&amp;myurl='+url+'" />'
	+'<param name="allowScriptAccess" value="sameDomain" />'
	+'<param name="quality" value="high" />'
	+'<param name="bgcolor" value="#4e4e4e" />'
 	+'<embed src="http://www.myvisuallistings.com/flash/vt-sound.swf?sound='+soundfile+'&amp;action='+action+'&amp;myurl='+url+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="50" height="18"></embed>';
	document.write(sound); 
	}
	else
	{
		document.getElementById("getflash").style.display = "block";
	}
}


function detect_vt_sound_new(soundfile,action,url)
{
	// Check to see if the version meets the requirements for playback
	if (hasReqestedVersion)
	{
	var sound = '<param id="myMusicObject" value="http://www.myvisuallistings.com/resources-deluxe-html/images/soundv2.swf?sound='+soundfile+'&amp;startSlide=1&amp;action='+action+'&amp;myurl='+url+'" />'
	+'<param name="allowScriptAccess" value="sameDomain" />'
	+'<param name="quality" value="high" />'
	+'<param value="transparent" name="wmode">'
 	+'<embed src="http://www.myvisuallistings.com/resources-deluxe-html/images/soundv2.swf?sound='+soundfile+'&amp;startSlide=1&amp;action='+action+'&amp;myurl='+url+'" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="22" height="19"></embed>';
	document.write(sound); 
	}
	else
	{
		document.getElementById("getflash").style.display = "block";
	}
}


function checkNSJava() {
	
  if (!document.all){  
	  jump=false;
	  found = false;
	  version = "";
	  pluginFound = false;
	  s = "";
	  for (i = 0; (i < navigator.mimeTypes.length) && (!pluginFound); i++) {
		p = navigator.mimeTypes[i].enabledPlugin;
		if (p != null) {
		  if (p.description.toLowerCase().substring(0, 4) == "java") {
			version = p.description;
			pluginFound = true;
		  }
		}
	  }
	  if (pluginFound) {
		ver=version.substring(version.indexOf("Java Plug-in")+13,version.indexOf("Java Plug-in")+16);    
		document.getElementById("getjava").style.display = "none";
	
		if(ver*1.0>1.2) jump=true; 
	  }
	  else {
		document.getElementById("getjava").style.display = "";
	  }
  }
}
