var limit = 14;//Cookieの有効期限(14日間)
var imgNo = 0;
//以下、画像のリスト
var imgList = new Array;
imgList[0] = "<a href=\"http://www.johomarket.com/go/0286565580/\"><img src=\"http://www.johomarket.com/image/banner/07.jpg\" alt=\"ステーキいづつや\"  border=\"0\" width=\"270px\"/></a>";
imgList[1] = "<a href=\"http://www.iidasangyo.co.jp/shop/shop/?oc=007\"><img src=\"http://www.johomarket.com/image/banner/top08.png\" alt=\"飯田産業\"  border=\"0\" width=\"270px\"/></a>";
imgList[2] = "<a href=\"http://www.indesign.co.jp/bell/weddingbell.html\"><img src=\"http://www.johomarket.com/files/images/bell2.jpg\" alt=\"ウェディングベル\"  border=\"0\" width=\"270px\"/></a>";

//if(document.cookie.length > 0) imgNo = parseInt(document.cookie.substring(6,99));
function getCookie(key) {
tmp = document.cookie + ";";
tmp1 = tmp.indexOf(key, 0);
if (tmp1 == -1) {
return "";
}
tmp = tmp.substring(tmp1, tmp.length);
start = tmp.indexOf("=", 0) + 1;
end = tmp.indexOf(";", start);
return (unescape(tmp.substring(start, end)));
}
var cook1 = getCookie("imgNo");
if (cook1 == "") {
imgNo = 0;
} else {
imgNo = parseInt(cook1);
}
document.write(imgList[imgNo]);
if (++imgNo >= imgList.length) {
imgNo = 0;
}
var d = new Date();
d.setTime(d.getTime() + 24 * limit * 60 * 60 * 1000);
document.cookie = "imgNo=" + imgNo + " ; expires=" + d.toGMTString();

