var flashVersion=false;
var nn=(navigator.appName.charAt(0)=="N");
var n6=(document.getElementById && nn) || false;
var ie=(document.all && !nn) || false;
var mac=(navigator.userAgent.indexOf("Mac")!=-1) || false;
var ver=""+navigator.appVersion;
var fno=ver.indexOf(" ");
var macChecked=0;
ver=eval(ver.substring(0,fno));

if (window.opera || mac) {
	for (i = 0; i < navigator.plugins.length; i++) {
		pName = navigator.plugins[i].description;
		if (pName.indexOf("Flash", 0) != -1) {
			flashVersion = pName.substr(pName.indexOf("Flash", 0)+6, 1);
		}
	}
} else {
	if (ie && !mac) {
		var flashVersion=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").FlashVersion();
		flashVersion=Math.floor(flashVersion / 0x10000);
	}
}

if (!flashVersion) {
	if (nn && !document.plugins) flashVersion=false;
	else if ((nn || n6) && navigator.plugins) flashVersion=navigator.plugins["Shockwave Flash"].description.charAt(16);
	else flashVersion=false;
}
/*
if (ie && mac) window.onload=chkMac;
	
function chkMac() {
	if (window["sample"]) flashVersion=((window["sample"].FlashVersion() & 0xffff0000) >> 16);
	macChecked=1;
	result();
}
*/


//********************************************************
// Flash Version Check
//********************************************************
function chkflash() {
//	if (mac && ie && macChecked==0) return "NG";

	if (!flashVersion) {
		return "NG";
	}

	if (flashVersion >= 8) {
		return "OK";
	} else {
		if (flashVersion == 1) {
			return "OK";
		} else {
			return "NG";
		}
	}
}



/**
* Display button
*/
function showButton(id) {
	if (chkflash() == 'OK' && window_w >= 980) {
		switch (id) {
			case 1:
				document.write('<div class="enter"><a href="http://nikon-tour.com/e/business/index.htm" target="tour"><img src="img/enter.jpg" alt="ENTER" name="chap01" width="245" height="28" border="0" class="rollover"></a></div>');
				break;
			case 3:
				document.write('<div class="enter"><a href="http://nikon-tour.com/e/reading/index.htm" target="tour"><img src="img/enter.jpg" alt="ENTER" name="chap03" width="245" height="28" border="0" class="rollover"></a></div>');
				break;
			case 4:
				document.write('<div class="enter"><a href="http://nikon-tour.com/e/micromacro/index.htm" target="tour"><img src="img/enter.jpg" alt="ENTER" name="chap04" width="245" height="28" border="0" class="rollover"></a></div>');
				break;
		}
	}
	else {
		document.write('<img class="enter" src="img/entern.jpg" alt="ENTER" name="chap01" width="245" height="28" border="0">');
	}
}