var namae = document.cookie;
if (namae == ""){
setName();
}
document.write(namae + "さん、ご訪問ありがとうございます。");
function setName(){
namae = prompt("あなたの名前を入力してください","");
if (namae == ""){
setName();
}
var now = new Date();
var yy = now.getFullYear();
yy++;
now.setFullYear(yy);
var extime = now.toGMTString();
document.cookie = namae + ";expires=" + extime;
}