//var saveTime = 10*24*60*60*1000;
var saveTime = 5*60*1000;
var cookieName = "HUYjds-u";
var lotateNum = 6;
//
function getvalue(){
	document.write('<img src="/common_ja/log.gif" alt="前回の足跡はこちら" width="109" height="13" />');
	var stTemp;
	var stCount = getcookie(cookieName);
	for(i=1;i<=6;i++){
		if(i <= Number(stCount)){
			if (i % 2 != 0) {
				document.write('<img src="/common_ja/log1o.gif" width="17" height="13" alt="">');
			}else{
				document.write('<img src="/common_ja/log2o.gif" width="17" height="13" alt="">');
			}
		}else{
			if (i % 2 != 0) {
				document.write('<img src="/common_ja/log1.gif" width="17" height="13" alt="">');
			}else{
				document.write('<img src="/common_ja/log2.gif" width="17" height="13" alt="">');
			}
		}
	}
	if(stCount == 0 ){
		document.write('<span>前回の足跡はありません</span>');
	}
	if(stCount < lotateNum){
		stTemp = Number(stCount)+1;
	}else{
		stTemp = 1;
	}
	setcookie(cookieName,stTemp);
}
//
function getcookie(stNum){
	var Returns = Num = Lengths = 0;
	var stNumEx = stNum + "=";
	var stTemp = "";
	while (Num < document.cookie.length){
		Lengths = Num + stNumEx.length;
		if (document.cookie.substring(Num, Lengths) == stNumEx){
			stTemp = document.cookie.indexOf(";", Lengths);
			if (stTemp == -1){
				Returns = document.cookie.substring(Lengths, document.cookie.length);
			}else{
				Returns = document.cookie.substring(Lengths, stTemp);
			}
			break;
		}
		Num = document.cookie.indexOf(" ", Num) + 1;
		if (Num == 0){break;}
	}
	return Returns;
}
//
function setcookie(stNum, stValue){
	var dtExpire = new Date();
	dtExpire.setTime(dtExpire.getTime()+saveTime);
	document.cookie = stNum+"="+stValue+";expires="+dtExpire.toGMTString();
}
