﻿// 画像をランダムで表示
//
img = new Array();
//
//
// 画像のファイル名を記入
//
img[0] = "photo_01.jpg";
img[1] = "photo_02.jpg";
img[2] = "photo_03.jpg";
img[3] = "photo_04.jpg";
//
//
//  img src="…には絶対パス、またはルートを基点として/で始まるパスを指定
n = Math.floor(Math.random()*img.length);
//
//
//日付を取得
today = new Date();
today_month = today.getMonth()+1;
today_date = today.getDate();
//
//
//季節の設定
//
// ■春 - 3月から、4月、5月15日まで
if ((today_month == 3) || (today_month == 4) || ((today_month == 5) && (today_date <= 15))) {
  document.write("<img src='../../photo/season1/"+img[n]+"' width='900' height='120' alt='' /></p>");
} else 
// ■夏 - 5月16日から、6月、7月、8月まで
if (((today_month == 5) && (today_date >= 16)) || (today_month == 6) || (today_month == 7) || (today_month == 8)) {
  document.write("<img src='../../photo/season2/"+img[n]+"' width='900' height='120' alt='' /></p>");
} else 
// ■秋 - 9月から、10月、11月まで
if ((today_month == 9) || (today_month == 10) || (today_month == 11)) {
  document.write("<img src='../../photo/season3/"+img[n]+"' width='900' height='120' alt='' /></p>");
} else 
// ■冬- 12月から、1月、2月まで
if ((today_month == 12) || (today_month == 1) ||(today_month == 2)) {
  document.write("<img src='../../photo/season4/"+img[n]+"' width='900' height='120' alt='' /></p>");
}

