//-----------------------------------------------------
// KINOTROPE JavaScript Library
// Copyright(C) 2004 KINOTROPE. All Rights Reserved.
//
// flash ver 0.0.2 [last updated on 2005.02.02]
// Check the ver. of your Flash player and write source.
//-----------------------------------------------------

//flash player version
var playerVer = 9;


var getPlayerVer = 0;
var playerFlag = 0;
var plugin = 0;

var win = (navigator.appVersion.indexOf("Win") != -1)? true : false;
var ie = (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0)? true : false;

function setFlash(targetObj){
	document.open();

	//Flash Pluginのチェック
	//Mac IE 5,NN 3,Safari,Opera
	plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if(plugin){
		getPlayerVer = parseInt(plugin.description.match(/\d+\.\d+/));
		playerFlag = (getPlayerVer >= playerVer) ? 1 : 0 ;
	}
	
	//Flash Active X Controlのチェック
	//Win IE 3,Win AOL 3
	else if(navigator.userAgent && ie && win){
		var vbsSource = "";
		vbsSource+='<script language="vb'+'script"> \n'
		vbsSource+='on error resume next \n';
		vbsSource+='dim Flash \n';
		vbsSource+='dim get_Ver \n';
		vbsSource+='Flash=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash")) \n';
//		vbsSource+='get_Ver=Left(Hex(Int(CreateObject("ShockwaveFlash.ShockwaveFlash").FlashVersion)),1) \n';
		vbsSource+='get_Ver=FormatNumber(Int(CreateObject("ShockwaveFlash.ShockwaveFlash").FlashVersion), 0, 0, 0, 0) \n';
		vbsSource+='</script> \n';
		document.write(vbsSource);
		execScript("getPlayerVer=get_Ver","VBScript");
		playerFlag = (getPlayerVer >= playerVer)? 1 : 0 ;
	}
	
	//HTMLの書き出し
	if(playerFlag){
		var htmlSource = "";
		htmlSource += '<object data="' + targetObj.data +'" type="application/x-shockwave-flash" width="' + targetObj.width + '" height="' + targetObj.height + '">';
		htmlSource += '<param name="movie" value="' + targetObj.data +'">';
		htmlSource += '<param name="quality" value="high">';
		htmlSource += '<param name="bgcolor" value="' + targetObj.bgcolor +'">';
		htmlSource += '<\/object>';
		document.write(htmlSource);
	}
	else{
		document.write(targetObj.alternative);
	}
	document.close();
}





