//----------------------------------------------------------------------------
// nagashima_top_swf.js
//
// Requires: jQuery 1.1.3+
//----------------------------------------------------------------------------
// Written by BrainPowers
//
// ReleasedDate: 2011-03-16 (iu)
// ChangedDate: 2011-09-13 (iu) filename( map6swf_20110920.js )
// ChangedDate: 2011-09-20 (iu) filename( map6swf.js )
//----------------------------------------------------------------------------

// Flashファイルのパス+ファイル名
var swf_file = '/data/swf/map6.swf';
	
// JavaScriptの画像のパス
var img_path = '/data/image/anime/top_attraction/';	

//----------------------------------------------------------------------------

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="550" height="400" 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="550" height="400" id="nico" align="" type="application/x-shockwave-flash" pluginspage="http://get.adobe.com/jp/flashplayer/"></embed>');
	document.write('</object>');
}
else
{
	document.write('	<div id="SL_top_anime_js" style="width:550px;height:400px;overflow:hidden;position:relative;">');
	document.write('		<img src="'+img_path+'05.jpg" usemap="#map_5" />');
	document.write('		<img src="'+img_path+'04.jpg" usemap="#map_4" />');
	document.write('		<img src="'+img_path+'03.jpg" usemap="#map_3" />');
	document.write('		<img src="'+img_path+'02_20110920.jpg" usemap="#map_2" />');
	document.write('		<img src="'+img_path+'01_20110920.jpg" usemap="#map_1" />');

	document.write('	<map name="map_1">');
	document.write('　		<area shape="rect" coords="399,317,550,337" href="javascript:imgNext(3);" alt="" title="">');
	document.write('　		<area shape="rect" coords="399,337,550,357" href="javascript:imgNext(2);" alt="" title="">');
	document.write('　		<area shape="rect" coords="399,357,550,377" href="javascript:imgNext(1);" alt="" title="">');
	document.write('　		<area shape="rect" coords="399,377,550,397" href="javascript:imgNext(0);" alt="" title="">');
	document.write('	</map>');

	document.write('	<map name="map_2">');
	document.write('　		<area shape="rect" coords="399,297,550,317" href="javascript:imgNext(4);" alt="" title="">');
	document.write('　		<area shape="rect" coords="399,337,550,357" href="javascript:imgNext(2);" alt="" title="">');
	document.write('　		<area shape="rect" coords="399,357,550,377" href="javascript:imgNext(1);" alt="" title="">');
	document.write('　		<area shape="rect" coords="399,377,550,397" href="javascript:imgNext(0);" alt="" title="">');
	document.write('	</map>');

	document.write('	<map name="map_3">');
	document.write('　		<area shape="rect" coords="399,297,550,317" href="javascript:imgNext(4);" alt="" title="">');
	document.write('　		<area shape="rect" coords="399,317,550,337" href="javascript:imgNext(3);" alt="" title="">');
	document.write('　		<area shape="rect" coords="399,357,550,377" href="javascript:imgNext(1);" alt="" title="">');
	document.write('　		<area shape="rect" coords="399,377,550,397" href="javascript:imgNext(0);" alt="" title="">');
	document.write('	</map>');

	document.write('	<map name="map_4">');
	document.write('　		<area shape="rect" coords="399,297,550,317" href="javascript:imgNext(4);" alt="" title="">');
	document.write('　		<area shape="rect" coords="399,317,550,337" href="javascript:imgNext(3);" alt="" title="">');
	document.write('　		<area shape="rect" coords="399,337,550,357" href="javascript:imgNext(2);" alt="" title="">');
	document.write('　		<area shape="rect" coords="399,377,550,397" href="javascript:imgNext(0);" alt="" title="">');
	document.write('	</map>');

	document.write('	<map name="map_5">');
	document.write('　		<area shape="rect" coords="399,297,550,317" href="javascript:imgNext(4);" alt="" title="">');
	document.write('　		<area shape="rect" coords="399,317,550,337" href="javascript:imgNext(3);" alt="" title="">');
	document.write('　		<area shape="rect" coords="399,337,550,357" href="javascript:imgNext(2);" alt="" title="">');
	document.write('　		<area shape="rect" coords="399,357,550,377" href="javascript:imgNext(1);" alt="" title="">');
	document.write('	</map>');
	
	document.write('	</div>');

	$("#SL_top_anime_js img").css('border', 'none');
	$("#SL_top_anime_js img").css('position', 'absolute').hide();
	$("#SL_top_anime_js img:eq(4)").show();
	var map_now = 4;
}

function imgNext(map_show){
	$("#SL_top_anime_js img:eq("+map_now+")").fadeOut(500, function(){$("#SL_top_anime_js img:eq("+map_show+")").fadeIn(500)});
	map_now = map_show;
}



