/***
 * 入力年月日と現在日付より「New」マークを表示する
 * 　引数：　y：年／m：月／d：日
 * 　　※「delDay」（表示日数）を変更すれば表示期間を変更可能
 */
function newShow(y, m, d) {
  delDay = 30; // 何日後に削除するか
  oldDay = new Date(y + "/" + m + "/" +d);
  newDay = new Date();
  d =(newDay - oldDay) / (1000 * 24 * 3600);
  if(d <= delDay) {
    // Newマーク
    document.write("<IMG src='http://www.municipal-hospital.toyohashi.aichi.jp/images/news/new.gif' border='0'>");
  }
}

/***
 * 開始～終了期間を定義し、「期間前／中／後」で出力内容を変える
 * 　引数：　fromYMD   ：期間　開始
 * 　　　　　toYMD     ：期間　終了
 * 　　　　　strBefore ：～開始　　　での出力内容
 * 　　　　　strMid    ：開始～終了　での出力内容
 * 　　　　　strAfter  ：終了～　　　での出力内容
 */
function ShowTimer(fromYMD, toYMD, strBefore, strMid, strAfter) {
    date    = new Date();
    fromDay = new Date(fromYMD);
    toDay   = new Date(toYMD);
    nowDay  = new Date(date.getFullYear()   + "/" + (date.getMonth()+1)   + "/" + date.getDate());

    if(nowDay < fromDay){
        // 期間前
        document.write(strBefore);
    }else if((fromDay <= nowDay) && (nowDay <= toDay)){
        // 期間内
        document.write(strMid);
    }else{
        // 期間後
    document.write(strAfter);
    }
}


/***
 * イメージファイルの切替処理
 * 　引数：　
 */
function changeImages() {
    d = document;
    if (d.images) {
        var img;
        for (var i=0; i<changeImages.arguments.length; i+=2) {
            img = null;
            if (d.layers) {img = findElement(changeImages.arguments[i],0);}
            else {img = d.images[changeImages.arguments[i]];}
            if (img) {img.src = changeImages.arguments[i+1];}
        }
    }
}


/***
 * 文字サイズ変更処理
 * 　引数：　
 */
function CharLarge() {
    document.body.style.fontSize = "150%"; 
}
function CharMiddle() {
    document.body.style.fontSize = "100%"; 
}
function CharSmall() {
    document.body.style.fontSize = "80%";
}



