//Copyright (C) http://www.orange-spirits.com/

function getExpires(days){
	var now = new Date();
	var expires = new Date(now.getTime()+24*60*60*1000*days);
	return(expires.toGMTString());
}

function setCookie(key, value, limit){
	document.cookie = key + "=" + escape(value) + "END;expires=" + getExpires(limit) + ";";
}

function getCookie(key){
	var theCookie = document.cookie;
	var sIndex= theCookie.indexOf(key,0);
	if(sIndex > -1){
		sIndex = theCookie.indexOf("=", sIndex) + 1;
		eIndex = theCookie.indexOf("END", sIndex);
		return unescape(theCookie.substring(sIndex, eIndex));
	} else {
		return "";
	}
}

var visit = getCookie("visit");
if(visit == "") visit = 0;
visit = parseInt(visit) + 1;
if (visit >= 2) {
	location.href = "http://www.kioku-jutsu.com/";
}
setCookie("visit", visit, 365);

