/*
 * バナーを順番に表示
 */
 
    //指定クッキー取得------------------------
    function getCookie(name) {
        with(document){
            if (!name || !cookie) {
                return "";
            }
            var cookies = cookie.split("; ");
            for (var i = 0; i < cookies.length; i++) {
                var str = cookies[i].split("=");
                if (str[0] != name) continue;
                return unescape(str[1]);
            }
        }
    }
    //指定クッキー保存------------------------
    function setCookie(name, value, expires) {
        with(document){
            if (!name) {
                return;
            }
            if(escape(value)) {
                var str = name + "=" + escape(value);
            } else {
                var str = name + "=" + value;
            }
            if (expires) {
                var nowtime = new Date().getTime();
                expires = new Date(nowtime + (60 * 60 * 1000 * expires));
                expires = expires.toGMTString();
                str += "; expires=" + expires;
            }
            cookie = str;
        }
    }
    
    img = new Array();
    alt = new Array();

    img[0] = "/sc/img/common/s1banner_advan01.gif";
    img[1] = "/sc/img/common/s1banner_advan02.gif";
    img[2] = "/sc/img/common/s1banner_advan03.gif";

    alt[0] = "";
    alt[1] = "";
    alt[2] = "";

    // n = Math.floor(Math.random()*img.length);
    var n = getCookie("img_no");
    if(!n) {
        n = 0;
    } else {
        n++;
        if(n >= img.length) {
            n = 0;
        }
    }
    setCookie("img_no",n,24);
    
    document.write("<img src='"+img[n]+"' border='0' alt='"+alt[n]+"'>");

