function ShowBar(flg,target)
{
    if( flg ) {
        target.style.display = '';
    }
    else {
        target.style.display = 'none';
    }
}
function DaysOfRest(yy,mm,dd)
{
    var cDate = new Date();
    var lDate = new Date(yy,mm-1,dd);
    return( Math.floor((lDate.getTime() - cDate.getTime())/1000/60/60/24));
}
function DispRest(yy,mm,dd,target)
{
    var rDay = DaysOfRest(yy,mm,dd);
    if( rDay > 0 ) {
        rDay = rDay + 1;
        target.innerHTML = target.innerHTML + "　あと" + toWide(rDay) + "日　";
        if( rDay < 7 ) {
            target.style.fontSize = (10 + (7 - rDay) * 2);
            target.style.color = "#FF0080";
        }
    }
    else if( rDay == 0 ) {
        target.style.fontSize = 24;
        target.style.color = "#FF0080";
        target.innerHTML = target.innerHTML + "いよいよ明日です";
    }
    else if( rDay == -1 ) {
        target.style.fontSize = 28;
        target.style.color = "#FF0080";
        target.innerHTML = target.innerHTML + "今日ですよー　＼(^o^)／";
    }
    else {
        target.innerHTML = target.innerHTML + "ご参加の皆さんありがとうございました";
    }
    target.style.fontWeight = "bold";
}
function toWide(n)
{
    var ns = "０１２３４５６７８９";
    var wd = ""
    while( n ) {
        amari = n % 10;
        wd = ns.substring(amari,amari+1) + wd;
        n = Math.floor(n / 10);
    }
    return wd;
}
// 背景変更
function chgBG() {
    var cDate = new Date();
    if( cDate.getMonth() == 0 ) {
        //　１月
        if( cDate.getDate() <= 7 ) {
            document.body.background = "image/bg_hamaya2.gif";    //１月７日まではお正月
        }
        else {
          document.body.background = "image/TEXTUR29.BMP";        //それ以降は雪の結晶
        }
    }
    else if( cDate.getMonth() == 1 ) {
        //　２月
        if( cDate.getDate() == 14 ) {
            document.body.background = "image/bg_heart_pb.gif";   //２月１４日はバレンタインデー
        }
        else {
            document.body.background = "image/TEXTUR26.BMP";      //それ以外は雪だるま
        }
    }
    else if( cDate.getMonth() == 2 )
        document.body.background ="image/TEXTUR20.BMP";           //３月は小梅
    else if( cDate.getMonth() == 3 )
        document.body.background ="image/TEXTUR21.BMP";           //４月は桜
    else if( cDate.getMonth() == 4 )
        document.body.background ="image/TEXTUR22.BMP";           //５月は青空
    else if( cDate.getMonth() == 5 )
        document.body.background ="image/bg_katatumuri1.gif";     //６月はアジサイにかたつむり
    else if( cDate.getMonth() == 6 )
        document.body.background ="image/bg_sakana4.gif";           //７月はヨット
    else if( cDate.getMonth() == 7 )
        document.body.background ="image/bg_himawari3.gif";       //８月はひまわり
    else if( cDate.getMonth() == 8 )
        document.body.background ="image/bg_akatonbo_t02.gif";    //９月は赤とんぼ
    else if( cDate.getMonth() == 9 )
        if( cDate.getDate() > 20 )
            document.body.background ="image/bg_halloween_t03.gif"; //１０月２１日以降はハロウェーン
        else
            document.body.background ="image/bg_susuki_t01.gif";    //それ以外は月とすすき
    else if( cDate.getMonth() == 10 ) {
        if( cDate.getDate() % 2 )
            document.body.background ="image/bg_ichou_t11.gif";     //１１月の奇数日は銀杏
        else
            document.body.background ="image/TEXTUR25.BMP";         //１１月の偶数日は紅葉
    }
    else if( cDate.getMonth() == 11 ) {
        if( cDate.getDate() == 24 )
            document.body.background ="image/bg_pastel_xmas21.gif";     //クリスマス・イブ
        else if( cDate.getDate() == 25 )
            document.body.background ="image/bg_pastel_xmas20.gif";     //クリスマス
        else
            document.body.background ="image/TEXTUR28.BMP";             //１２月はクリスマス風
    }
}


