/* 新着・更新情報の窓の開閉スクリプト */
//クッキーの情報を保管しておく変数
var sin1 = null;
$(document).ready(function(){
    Read();
    if( sin1 == 1 ) {
        $("#sintyaku1").slideDown();
    }
    /* 画像をクリックした時の動き */
    $("div#shintyaku").click(function(){
        $("#sintyaku1").slideToggle("fast",function(){ save(); });
        save();
    });
});
//クッキーに書き込み
function save() {
    v1 = $("#sintyaku1").css("display");
    if( v1 == "block" ) { sin1 = 1; } else { sin1 = 0; }
    if(!navigator.cookieEnabled){ return; }
    sday = new Date();
    sday.setTime( sday.getTime() + ( 30 * 1000 * 60 * 60 * 24 ) );
    s2day = sday.toGMTString();
    document.cookie = "sin1=" + sin1 + ";expires=" + s2day;
}
//クッキーの読み込み
function Read() {
    kword = "sin1=";
    scookie = document.cookie + ";";　　　　// クッキー情報を読み込む
    start = scookie.indexOf(kword);   　// キーワードを検索
    if (start != -1){    // キーワードと一致するものあり
        end = scookie.indexOf(";", start);    // 情報の末尾位置を検索
        sin1 = unescape(scookie.substring(start + kword.length, end));  // データ取り出し
    }
}

