// JavaScript Document


//initUserEnv
function initUserEnv(){
	this.isWin		= navigator.userAgent.indexOf("Win") != -1 ? true : false;
	this.isMac		= navigator.userAgent.indexOf("Mac") != -1 ? true : false;
	this.isNs		= navigator.appName.indexOf("Netscape") != -1 ? true : false;
	this.isNs4		= (document.layers) ? true : false;
	this.isNs4_7	= navigator.userAgent.indexOf("4.7") != -1 ? true : false;
	this.isNs6		= navigator.userAgent.indexOf("Netscape6") != -1 ? true : false;
	this.isNs7		= navigator.userAgent.indexOf("Netscape/7") != -1 ? true : false;
	this.isMoz		= navigator.userAgent.indexOf("Gecko") != -1 ? true : false;
	this.isIe		= navigator.userAgent.indexOf("MSIE") != -1 ? true : false;
	this.isIe4		= navigator.userAgent.indexOf("MSIE 4") != -1 ? true : false;
	this.isIe5		= navigator.userAgent.indexOf("MSIE 5") != -1 ? true : false;
	this.isIe6		= navigator.userAgent.indexOf("MSIE 6") != -1 ? true : false;
	this.isOp		= navigator.userAgent.indexOf("Opera") != -1 ? true : false;
	this.isW3CDom	= (document.getElementById) ? true : false;
	this.isMsDom	= (document.all) ? true : false;
	this.isNsDom	= (document.layers) ? true : false;
	this.isDom		= (this.isW3CDom || this.isMsDom || this.isNsDom) ? true : false;
	return this;
}
var userEnv = new initUserEnv();


//checkBlowser
function checkBlowser(){
	return (userEnv.isW3CDom)? 1:0;
}

//getFlashPlayerVersion
function getSwfVersion(){
	var flashVersion = 0;
	if (userEnv.isIe && userEnv.isWin) {
		try{flashVersion= new ActiveXObject("ShockwaveFlash.ShockwaveFlash").FlashVersion();}catch(e){flashVersion=0};
		flashVersion = Math.floor (flashVersion / 0x10000);
	} else {
		if (userEnv.isNs && !navigator.plugins) {
			flashVersion = 0;
		} else {
			var s = "application/x-shockwave-flash";
			if (navigator.mimeTypes && navigator.mimeTypes[s] && navigator.mimeTypes[s].enabledPlugin) {
				flashVersion=navigator.plugins["Shockwave Flash"].description.match (/\d+/);
			} else {
				flashVersion = 0;
			}
		}
	}
	return flashVersion;
}


function showSwf(swf){
	if(getSwfVersion () <= 7){
		document.write('<img src="/resort/img/noflash01.jpg" alt="オフタイムに豊かさと潤いを" width="910" height="181">');
	}else{
	
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="910" height="181" align="middle">');
		document.write('<param name="allowScriptAccess" value="sameDomain" />');
		document.write('<param name="movie" value="' + swf + '" />');
		document.write('<param name="quality" value="high" />');
		document.write('<param name="bgcolor" value="#ffffff" />');
		document.write('<embed src="' + swf + '" quality="high" bgcolor="#ffffff" width="910" height="181" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
		document.write('</object>');
	}
}