
function windowDelete(){
 // alert("Hello, JavaScript. This is AS3.0");
 divnam = "opning";
 vflg = document.getElementById(divnam).style.visibility;
 document.getElementById(divnam).style.visibility = 'hidden'; 
}

function GetCookie (name)
{
	var arg  = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen)
		{
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
		}
	return null;
}

function getCookieVal (offset)
{
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset,endstr));
}


function SetCookie (name,value)
{
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path    = (argc > 3) ? argv[3] : null;
var domain  = (argc > 4) ? argv[4] : null;
var secure  = (argc > 5) ? argv[5] : false;

document.cookie = name + "="  + escape (value) +
 ((expires == null) ? ""		: ("; expires=" + expires.toGMTString())) +
 ((path == null)    ? ""		: ("; path=" + path)) +
 ((domain == null)  ? "" 	: ("; domain=" + domain)) +
 ((secure == true)  ? "; secure" : "");
}

// 消去日の設定は、この関数の中に指定します
function set_data(name,put_data)
{
var expdate = new Date ();
expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000 * 31 * 1));
SetCookie (name,put_data,expdate);
}

// ########## Cookie設定
// VANTAN を key にしてクッキー読み込み
times = GetCookie("VANTAN");

var opningFlg=false;

//alert("times="+times);
if (times == null){
	//alert("check");
	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 (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();
	}
	function result()
	{
		if (mac && ie && macChecked==0) return;
		// alert("flashVersion:"+parseInt(flashVersion));
		if( parseInt(flashVersion) >= 9 || parseInt(flashVersion) == 1){
			
				if (navigator.platform.charAt(0) == "W"){
					if (navigator.appName.charAt(0)=="M"){
						
						document.write('<div id="opning" style="z-index:9999;visibility:visible;";>');
						document.write('<div align="center" style="width:100%;position:absolute;top:0px;left:0px;right:0px;">');
						document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="100%" height="1600" align="top">');
						
						document.write('<param name=movie value="swf/op.swf">');
						document.write('<param name=quality value=high>');
						document.write('<param name=wmode value="transparent">');
						document.write('</object></div>');
						document.write('</div>');
					}else{
					    document.write('<div id="opning" style="z-index:9999;width:100%;position:absolute;top:0px;left:0px;right:0px;visibility:visible;">');
						document.write('<object type="application/x-shockwave-flash" data="swf/op.swf" width="100%" height="1600">');
						document.write('<param name="movie" value="swf/op.swf" />');
						document.write('<param name="wmode" value="transparent" />');
						document.write('</object>');
						document.write('</div>');
					}
				}
		}
		opningFlg = true;
	}
	result();

}else{
	
	times = 2;
	opningFlg = false;
}
// alert("opningFlg:"+opningFlg);
// クッキーの更新
set_data("VANTAN",times);

