/**
 * swfobject.execute.js
 * @version	1.0.0.0 - 0:02 2009/01/31
 * @see		SWFObject JavaScript API documentation
 * 			http://code.google.com/p/swfobject/wiki/api
 * @usage	swfobject.embedSWF(
				swfURL:String,
				replaceElementId:String,
				width:String,
				height:String,
				playerVersion:String,
				expressInstallSwfUrl:String,
				flashvars:Object,
				params:Object,
				attributes:Object
			);
 */
var movies = [
	[ './swf/other/datumou.swf', 'movie01'],
	[ './swf/facial/facial.swf', 'movie02'],
	[ './swf/soushin/sousin.swf', 'movie03'],
	[ './swf/bust/bustcare.swf', 'movie04'],
	[ '../swf/facial/facial.swf', 'movie05'],
	[ '../swf/facial/premium.swf', 'movie06'],
	[ '../swf/soushin/sousin.swf', 'movie07'],
	[ '../swf/soushin/india.swf', 'movie08'],
	[ '../swf/bust/bustcare.swf', 'movie09'],
	[ './swf/other/datumou.swf', 'movie10']
];

addEvent(window, 'load', function() {
	for (var i = 0, l = movies.length; i < l; i++) {
		setSWF(movies[i][0], movies[i][1]);
	}
});

function setSWF(path, id) {
	
	if (!document.getElementById(id)) return;
	
	var swfurl        = path;
	var elementId     = id;
	var swfwidth      = '480';
	var swfheight     = '360';
	var playerversion = '9.0.0';
	
	// Express Install を使わずに代替コンテンツを表示する場合は null
	// var expressInstall = null;
	var expressInstall = './lib/swfobject2.2/expressInstall.swf';

	var flashvars = {};

	var params = {
		allowScriptAccess: 'always',
		allowFullScreen: 'true',
		base: '.'
	};
	// params.wmode = 'transparent';

	var attributes = {};
	// attributes.id   = elementId;
	// attributes.name = elementId;
	
	/**
	 * Flashが再生可能な場合の処理
	 * if (swfobject.hasFlashPlayerVersion(playerversion)) Kaas.load.css('css/fullscreen.css');
	 */
	swfobject.embedSWF(swfurl, elementId, swfwidth, swfheight, playerversion, expressInstall, flashvars, params, attributes);
	
}


function addEvent(elm, listener, fn) {
	try {
		elm.addEventListener(listener, fn, false);
	} catch(e) {
		elm.attachEvent('on' + listener, fn);
	}
}