
// FlashMajorVersion
var requiredMajorVersion = 8;

// FlashMinorVersion
var requiredMinorVersion = 0;

// FlashRevision
var requiredRevision = 0;

// JavaScriptVersion
var jsVersion = 1.0;

var MMredirectURL;
var MMdoctitle;


function flashVerCheck( movieName ) {
	var hasProductInstall = DetectFlashVer( 6, 0, 65 );
	var hasReqestedVersion = DetectFlashVer( requiredMajorVersion, requiredMinorVersion, requiredRevision );
	MMredirectURL = window.location;

	if( hasProductInstall && !hasReqestedVersion ) {  // Version 6.0.05 OK
		document.title = document.title.slice(0, 47) + " - Flash Player Installation";
		MMdoctitle = document.title;
		openExpressInstall();
	} else if ( hasReqestedVersion ) {  // Version OK
		writeSWF( movieName );
	} else {  // Version NO
		writeInstallGuide();
	}
}


// SWFWrite
function writeSWF( movieName )
{
	var swfhtml = "";
	swfhtml += '<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab\" width=\"100%\" height=\"1490\" id=\"keystyle\" align=\"middle\">';
	swfhtml += '<param name=\"movie\" value=\"' + movieName + '.swf\" />';
	swfhtml += '<param name=\"quality\" value=\"high\" />';
	swfhtml += '<param name=\"menu\" value=\"false\" />';
	swfhtml += '<param name=\"wmode\" value=\"transparent\" />';
	swfhtml += '<param name=\"bgcolor" value=\"#ffffff\" />';
	swfhtml += '<embed src=\"' + movieName + '.swf\" quality=\"high\" wmode=\"transparent\" width=\"100%\" height=\"1490\" name=\"keystyle\" align=\"middle\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" menu==\"false\" bgcolor=\"#ffffff\" />';
	swfhtml += '</object>';

	//Output
	document.write( swfhtml );
}


// ExpressInstallSWFOpen
function openExpressInstall()
{
	var swfhtml = "";
	swfhtml += '<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab\" width=\"100%\" height=\"1490\" id=\"expressSWF\" align=\"middle\">';
	swfhtml += '<param name=\"movie\" value=\"expressinstall.swf?MMredirectURL='+MMredirectURL+'&MMplayerType=ActiveX&MMdoctitle='+MMdoctitle+'\" />';
	swfhtml += '<param name=\"quality\" value=\"high\" />';
	swfhtml += '<param name=\"menu\" value=\"false\" />';
	swfhtml += '<param name=\"wmode\" value=\"transparent\" />';
	swfhtml += '<param name=\"bgcolor" value=\"#ffffff\" />';
	swfhtml += '<embed src=\"expressinstall.swf?MMredirectURL='+MMredirectURL+'&MMplayerType=PlugIn\" quality=\"high\" wmode=\"transparent\"  width=\"100%\" height=\"1490\" name=\"expressSWF\" align=\"middle\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" menu==\"false\" bgcolor=\"#ffffff\" />';
	swfhtml += '</object>';

	//Output
	document.write( swfhtml );
}

// ExpressInstallSWFClose
function closeExpressInstall()
{
	var swfhtml = "";

	//Output
	document.write( swfhtml );
}


// InstallGuideHtmlWrite
function writeInstallGuide()
{
	var guidehtml = "";
	guidehtml += '<div id="logo">';
	guidehtml += '<img src="img/" alt="" width="449" height="39">';
	guidehtml += '</div>';
	guidehtml += '<p class="guidetxt">';
	guidehtml += 'こちらのコンテンツをご覧になるには、最新の';
	guidehtml += '<a href=\"http://www.adobe.com/shockwave/download/index.cgi?Lang=Japanese&P5_Language=Japanese&P1_Prod_Version=ShockwaveFlash&Lang=Japanese\" target=\"_blank\">';
	guidehtml += 'Flash Player';
	guidehtml += '</a>';
	guidehtml += 'が必要がです。';
	guidehtml += '</p>';
	guidehtml += '<p class="guidetxt">';
	guidehtml += 'ダウンロードは、';
	guidehtml += '<a href=\"http://www.adobe.com/shockwave/download/index.cgi?Lang=Japanese&P5_Language=Japanese&P1_Prod_Version=ShockwaveFlash&Lang=Japanese\" target=\"_blank\">';
	guidehtml += 'Macromedia Flash Player ダウンロードセンター';
	guidehtml += '</a>';
	guidehtml += 'から。';
	guidehtml += '</p>';

	//Output
	document.write( guidehtml );
}

