<!--
// --- vvv --- Which your Browser --- vvv ---
var myBrowser;
if(navigator.platform){
	myBrowser=new myBrowser((document.getElementById != null),(navigator.platform.indexOf('Win32') != -1),(navigator.appName.indexOf('Microsoft') != -1));
}
function myBrowser(version,platform,type){
	this.version=version;	//trueかfalse,DOM使用可能ブラウザ(IE4以上,NN6以上)ならtrue
	this.platform=platform;	//trueかfalse,Win32ならtrue
	this.type=type;		//trueかfalse,IEならtrue
}
// --- ^^^ --- Which your Browser --- ^^^ ---


// --- vvv --- Dose it have Flash Plugin --- vvv --- 
var MM_contentVersion = 6;//Setting to Version 6
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
	var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	for (var i = 0; i < words.length; ++i){
		if (isNaN(parseInt(words[i]))) continue;
		var MM_PluginVersion = words[i]; 
	}
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}
// --- ^^^ --- Dose it have Flash Plugin --- ^^^ ---



// --- vvv --- Open main window --- vvv ---
function openContentsWindow(url){
	if(MM_FlashCanPlay){//Flash Player Ver.6を持っていればウィンドウを開く
		var theWidth=screen.availWidth-10;
		var theHeight=screen.availHeight-35;
		if(!myBrowser.version) theHeight-=30;
		if(!myBrowser.platform){theWidth+=7;theHeight+=7;}
		var isScroll=0;
		/*var theWidth=970;
		var theHeight=670;*/
		
		var isFullscreen=0;
		if(theKey != null && theKey == 17) isFullscreen=1;
		
		var toShort=35;
		if(myBrowser.platform && !myBrowser.version) toShort=65;
		
		if(screen.width < 1024 || screen.height < 768) isScroll=1;
		if(screen.availWidth-10 < theWidth) theWidth=screen.availWidth-10;
		if(screen.availHeight-toShort < theHeight) theHeight=screen.availHeight-toShort;
		if(!url) url='main.html';
		var mainWin=window.open(url,'mainWin','toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=1,titlebar=1,scrollbars='+isScroll+',fullscreen='+isFullscreen+',width='+theWidth+',height='+theHeight+',left=0,top=0,screenX=0,screenY=0');
	}
	else{//Flash Player Ver.6を持っていなければアラートを表示
		if(confirm('本サイトをお楽しみいただくためには最新のFlash Playerが必要です\nあなたのブラウザでは最新のFlash Playerを利用できません\n\n最新のFlash Playerをダウンロードしますか')){
			window.location='http://www.macromedia.com/jp/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash&Lang=Japanese';
		}
	}
}
// --- ^^^ --- Open main window --- ^^^ ---


function writeFlashTags(showContents){
	var widthNum='100%';
	var heightNum='100%';
	if(screen.width < 1024 || screen.height < 768){
		widthNum=1024;
		heightNum=768;
	}
	document.write('<table border="0" cellspacing="0" cellpadding="0" width="'+widthNum+'" height="'+heightNum+'" id="basearea"><tr>');
	document.write('<td width="'+widthNum+'" valign="middle" align="center"> ');
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"');
	document.write(' WIDTH="'+widthNum+'" HEIGHT="'+heightNum+'" id="main" ALIGN="">');
	document.write(' <PARAM NAME=movie VALUE="sahara_top.swf');
	if(showContents != null) document.write('?showContents='+showContents);
	document.write('"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=scale VALUE=noscale> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="sahara_top.swf');
	if(showContents != null) document.write('?showContents='+showContents);
	document.write('" menu=false quality=high scale=noscale bgcolor=#FFFFFF  WIDTH="'+widthNum+'" HEIGHT="'+heightNum+'" NAME="main" ALIGN=""');
	document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	document.write('</OBJECT>');
	document.write('</td><td width="1"><img src="images/spacer.gif" width="1" height="1" name="nn6bar"></td>');
	if(myBrowser.version && !myBrowser.type){
		document.nn6bar.height=screen.availheight-35;
	}
	if(window.opener.theKey == 17){
		document.body.scroll="no";
		window.opener.theKey=null;
	}
	document.write('</tr></table>');
}





function openDownloadLink(url){
	wx = 490;
	wy = 310;
	x = (screen.width  - wx) / 2 + 60;
	y = (screen.height - wy) / 2 + 35;
	newWin = window.open(url,"newwindow","left="+x+",top="+y+",width="+wx+",height="+wy);
	newWin.focus();
}

// --- vvv --- Open other window --- vvv ---
function showOtherWindow(url,name,option){
	var otherWin=window.open(url,name,option);
}
// --- ^^^ --- Open other window --- ^^^ ---

// --- vvv --- Open Sonic stage window --- vvv ---
function showSonicWindow(){
	var sonicStageWin=window.open('directory/file.html','sonicStageWin','scrollbars=0,resizable=no,location=no,menubar=yes,status=no,left=0,top=0,width=760,height=700');
}
// --- ^^^ --- Open Sonic stage window --- ^^^ ---

// --- vvv --- Open Camp window --- vvv ---
function showCampWindow(url,name,option,bool){
	if(bool){
		var optionArr=option.split(',');
		var option='';
		for(var i=0;i<optionArr.length;i++){
			if(optionArr[i].indexOf('height') != -1) optionArr[i]='height='+(screen.availHeight-40);
		}
	}
	var option=optionArr.join(',');
	var otherWin=window.open(url,name,option);
}
// --- ^^^ --- Open Camp window --- ^^^ ---
	
	
// --- vvv --- Open Camp window --- vvv ---
function showWKMWindow(){
	var winWidth=980;
	var winHeight=424;
	var leftPosition=(screen.availWidth-winWidth)/2;
	var topPosition=(screen.availHeight-winHeight)/2;
	var otherWin=window.open('directory/file.html','file_name','scrollbars=1,width='+winWidth+',height='+winHeight+',left='+leftPosition+',top='+topPosition);
}
// --- ^^^ --- Open Camp window --- ^^^ ---
//-->

