
/*--- フラッシュ初回のみ ---*/
function moveSwf(){
	$("#flashArea").show();
	$("body").addClass("flash");
}

function closeSwf(){
	$("#topFlash").hide();
	$("#flashArea").fadeOut(2000);
	$("body").removeClass("flash");
}

function saveCookie(n) {
  cName = "count="; // クッキー名
  cDays = 7; // データの保存日数
  setPre = new Date();
  setPre.setTime(setPre.getTime() + (cDays*1000*24*3600));
  prd = setPre.toGMTString();
  document.cookie = cName + n + ";expires=" + prd;
}

function checkContact(){
	cName = "count="; // クッキー名
	cCookie = document.cookie+";";
	str = cCookie.indexOf(cName);
	if(str != -1) {
	  //end = cCookie.indexOf(";",str);
	  //count = eval(unescape(cCookie.substring(str + cName.length, end)));
	  
	  closeSwf();
	  saveCookie(count+1);
	} else {
	  moveSwf()
	  saveCookie(2);
	}
}

window.onload = function() {
	checkContact();
	
	var bodyClass = $("body").attr("class");
	if(bodyClass=="flash"){
		timerID = setTimeout("closeSwf()", 16000);
	}
}

