//----------------------------------------------------------------------------
// nagashima_top_swf.js
//
// Requires: jQuery 1.1.3+
//----------------------------------------------------------------------------
// Written by BrainPowers
//
// ReleasedDate: 2011-03-16 (iu)
// ChangedDate: ----------
//----------------------------------------------------------------------------

// Flashファイルのパス+ファイル名
var swf_file = '/data/swf/hanamizuki_top.swf';
	
// Flash非対応時の画像のパス
var img_path = '/data/image/anime/top_hanamizuki/';
	
//----------------------------------------------------------------------------

var Flash = function () {
	var o = {installed:0, version:[]}, description, oActiveX, nMajor, nMinor;
	if(navigator.plugins && typeof navigator.plugins["Shockwave Flash"] == "object"){
		o.pluginType = "npapi";
		description = navigator.plugins["Shockwave Flash"].description;
		if(typeof description != "undefined"){
			description = description.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
			nMajor = parseInt(description.replace(/^(.*)\..*$/, "$1"), 10);
			nMinor = /r/.test(description) ? parseInt(description.replace(/^.*r(.*)$/, "$1"), 10) : 0;
			o.version = [nMajor, nMinor];
			o.installed = 1;
		}
	}
	else if(window.ActiveXObject){
		o.pluginType = "ax";
		try{
			oActiveX = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}catch(e){
			try{
				oActiveX = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				o.version = [6, 0];
				o.installed = 1;
				oActiveX.AllowScriptAccess = "always";
			}catch(e){
				if(o.version[0] == 6) {o.installed=1; return; }
			}
		
			try{
				oActiveX = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			}catch(e){
			}
		}
		
		if(typeof oActiveX == "object"){
			description = oActiveX.GetVariable("$version");
			if(typeof description != "undefined"){
				description = description.replace(/^\S+\s+(.*)$/, "$1").split(",");
				o.version = [parseInt(description[0], 10), parseInt(description[2], 10)];
				o.installed = 1;
			}
		}
	}

	return o;
}();


if(Flash.installed)
{
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="570" HEIGHT="309" id="nico" ALIGN="">');
	document.write('<PARAM NAME=movie VALUE="'+swf_file+'"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="'+swf_file+'" quality=high bgcolor=#FFFFFF  WIDTH="570" HEIGHT="309" NAME="nico" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://get.adobe.com/jp/flashplayer/"></EMBED>');
	document.write('</OBJECT>');

}
else
{
	document.write('	<div style="width:570px;height:309px;">');
	document.write('		<img src="'+img_path+'00.jpg" />');
	document.write('	</div>');
}

