//-----------------------------------------------------------------------
// KINOTROPE JavaScript Library
// Copyright(C) 2004 KINOTROPE. All Rights Reserved.
//
// flash ver 0.0.2
// Check the ver. of your Flash player and write source.
// Last updated on 2004.11.17
// Written by SAKASHITA Mai
//-----------------------------------------------------------------------


//バージョン指定
var playerVer = 6;

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){
	//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.substring(plugin.description.indexOf(".")-1));
		playerFlag = getPlayerVer >= playerVer;
	}
	
	//Flash Active X Controlのチェック
	//Win IE 3,Win AOL 3
	
	else if(navigator.userAgent && ie && win){
		var vbsSource = "";
		vbsSource += '<script type="text/vbscript">';
		vbsSource += 'on error resume next \n';
		vbsSource += 'playerFlag = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & playerVer)))\n';
		vbsSource += '<\/script>';
		document.write(vbsSource);
	}
	
	//HTMLの書き出し
	
	if(playerFlag && win && ie){
		var htmlSource = "";
		htmlSource += '<object 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 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);
	}
}




