var win = (navigator.userAgent.indexOf("Windows") != -1) || false;
var mac = (navigator.userAgent.indexOf("PPC Mac") != -1 || navigator.userAgent.indexOf("PowerPC") != -1 ) || false;
var intelMac = (navigator.userAgent.indexOf("Intel Mac") != -1) || false;
var ie = (document.all && win) || false;
var ie7 =(navigator.userAgent.indexOf("MSIE 7") != -1) || false;
var macIE = (navigator.userAgent.indexOf("MSIE") != -1 && mac) || false;
var firefox = (navigator.userAgent.indexOf("Firefox") != -1) || false;
var opera9 = (navigator.userAgent.indexOf("Opera/9") != -1) || false;
var opera = (navigator.userAgent.indexOf("Opera") != -1 && !opera9) || false;
var safari = (navigator.userAgent.indexOf("Safari") != -1) || false;
var camino = (navigator.userAgent.indexOf("Camino") != -1) || false;
var omniweb = (navigator.userAgent.indexOf("OmniWeb") != -1) || false;

//##############################//
//## now on air Flashタグ挿入 ##//
//##############################//

function drawOnAir() {
if (document.getElementById){
	document.write('<div id="on-air">' + "\n");
	if(ie) {
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="100" height="100">' + "\n");
		document.write('<param name="allowScriptAccess" value="sameDomain" />' + "\n");
		document.write('<param name="movie" value="./flash/on_air.swf" />' + "\n");
		document.write('<param name="quality" value="high" />' + "\n");
		document.write('<param name="wmode" value="transparent">' + "\n");
		document.write('</object>' + "\n");
	} else {
		document.write('<embed id="flash" src="./flash/on_air.swf" quality="high" wmode="transparent" width="100" height="100" name="release" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' + "\n");
	}
	document.write('</div>' + "\n");
	document.write('<hr />' + "\n");
}
}

//################################//
//## ダイジェスト Flashタグ挿入 ##//
//################################//

function drawFlash(file) {
if (document.getElementById){
	if(ie) {
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="750" height="250">' + "\n");
		document.write('<param name="allowScriptAccess" value="sameDomain" />' + "\n");
		document.write('<param name="movie" value="' + file + '.swf" />' + "\n");
		document.write('<param name="quality" value="high" />' + "\n");
		document.write('<param name="wmode" value="opaque">' + "\n");
		document.write('</object>' + "\n");
	} else {
		document.write('<embed id="flash" src="' + file + '.swf" quality="high" wmode="opaque" width="750" height="250" name="release" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' + "\n");
	}
}
}

//#########################################//
//## Flash Player 簡易バージョンチェック ##//
//#########################################//

function chkFlashVersion(ver) {
if (document.getElementById){
	var flashVersion = 0;
	var targetVersion = ver;
	var text = '<div id="caution"><p>エラー：バージョン' + ver + '以上の <a href="http://www.macromedia.com/go/getflashplayer">Flash Player</a> をお使いください</p>\n</div>' + "\n"
	
	if((win && (safari || firefox || opera)) || ((intelMac || mac) && ((safari && !omniweb) || firefox || camino))) {
		flashVersion = navigator.plugins["Shockwave Flash"].description.charAt(16);
			
		if(flashVersion >= targetVersion) {
			return;
		} else {
			document.write(text);
		}
	} else if(ie) {
        var temp = new ActiveXObject("ShockwaveFlash.ShockwaveFlash").FlashVersion();
        flashVersion=Math.floor(temp / 0x10000);
        
		if(flashVersion >= targetVersion) {
			return;
		} else {
			document.write(text);
		} 
	}
}
}
