/*
*
*	flash.js
*
*/

//Flashコンテンツの出力

/* writeFlash
 -------------------------------------------------------- */
function writeFlash(src,width,height,imgSrc,usemap){
	var flashPlayerVersion = 0,html = '';

	if(navigator.plugins && navigator.mimeTypes['application/x-shockwave-flash']){
		var plugin = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
		if(plugin){flashPlayerVersion = parseInt(plugin.description.match(/\d+\.\d+/));}
	}else{
		try{
			var flashOCX = new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").match(/([0-9]+)/);
			if(flashOCX){flashPlayerVersion = parseInt(flashOCX[0]);}
		}catch(e){}
	}
	if(flashPlayerVersion <= 6){flashPlayerVersion = 0;}


	if(flashPlayerVersion >= 7){
		html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width+'" height="'+height+'">';
		html += '<param name="allowScriptAccess" value="sameDomain">';
		html += '<param name="movie" value="'+src+'">';
		html += '<param name="quality" value="high">';
		html += '<param name="wmode" value="transparent">';
		html += '<param name="menu" value="false">';
		html += '<embed type="application/x-shockwave-flash" pluginspage="http://get.adobe.com/jp/flashplayer/" width="'+width+'" height="'+height+'" allowScriptAccess="sameDomain" src="'+src+'" quality="high" wmode="transparent" menu="false">';
		html += '</object>';
	}else if(imgSrc.length != 0){
		if(usemap.length != 0){
			html += '<img src="'+imgSrc+'" alt="" width="'+width+'" height="'+height+'" usemap="'+usemap+'" />';
		}else{
			html += '<img src="'+imgSrc+'" alt="" width="'+width+'" height="'+height+'" />';
		}
	}
	document.write(html);
}
