var access = GetCookie("ACCESS");

var d_year   = GetCookie("year");
var d_month   = GetCookie("month");
var d_day   = GetCookie("day");
var d_hour   = GetCookie("hour");

if(access == ""){access = 0;}

var ndate = new Date();
var year  = ndate.getYear();
var month = ndate.getMonth() + 1;
var day   = ndate.getDate();
var hour  = ndate.getHours();
var min   = ndate.getMinutes();
var sec   = ndate.getSeconds();
if(year < 1900){year += 1900;}

//if(month < 10){month = "0" + month;}
//if(day < 10){day = "0" + day;}
//if(hour < 10){hour = "0" + hour;}
//if(min < 10){min = "0" + min;}
//if(sec < 10){sec = "0" + sec;}



function GetCookie(key){
	var tmp = document.cookie + ";";
	var index1 = tmp.indexOf(key, 0);
	if(index1 != -1){
		tmp = tmp.substring(index1,tmp.length);
		var index2 = tmp.indexOf("=",0) + 1;
		var index3 = tmp.indexOf(";",index2);
		return(unescape(tmp.substring(index2,index3)));
	}
	return("");
}

function SetCookie(key, val){
	//document.cookie = key + "=" + escape(val) + ";expires=Fri, 31-Dec-2030 23:59:59;path=/;";
	document.cookie = key + "=" + escape(val) + ";path=/;";
}
