﻿// JavaScript Document

//*****************************************************************************************//
//レシピ

function image_random_recipe(){
	
	var a = new Array('001', '002', '003', '004', '005', '006', '007', '008', '009');//ページフォルダ名
	var dir = "10haru";//季節フォルダ名
	
	
	shuffle(a);
	
	var out_left = 	'<a href="/item/sp_recipe/' + dir + '/' + a[0] + '/">' +
						'<img src="/item/sp_recipe/' + dir + '/' + a[0] + '/thum.jpg" alt="" width="70" height="70" />' +
					'</a>';
				
	var out_right = '<a href="/item/sp_recipe/' + dir + '/' + a[1] + '/">' +
						'<img src="/item/sp_recipe/' + dir + '/' + a[1] + '/thum.jpg" alt="" width="70" height="70" />' +
					'</a>';
	
	$("#top_sidebox_recipe #thum_70_left").html(out_left);
	$("#top_sidebox_recipe #thum_70_right").html(out_right);
	
	
	//alert($("#top_sidebox_recipe").html());
	
}
//*****************************************************************************************//
//観光スポット

function image_random_spot(){

	var c = new Array();
	
	
	c[0] = new Array('musashi/01musashi_no_sato','クアガーデン武蔵の里');
	c[1] = new Array('musashi/02budou_kan','宮本武蔵顕彰武蔵武道館');
	c[2] = new Array('sakutou/01valentine_park','バレンタインパーク作東');
	c[3] = new Array('sakutou/10bijutsukan','作東美術館');
	c[4] = new Array('ushiroyamakatsuta/02ai_no_mura_park','愛の村パーク');
	c[5] = new Array('ushiroyamakatsuta/05tomsawyer','トム・ソーヤ冒険村');
	c[6] = new Array('ohashi/01senmaida','上山 千枚田');
	
	
	var e = new Array();
	shuffle(c);

	var out_01 = 	'<dt><a href="./spot/' + c[0][0] + '/">' +
					'<img src="spot/' + c[0][0] + '/70_thum.jpg" alt="70" width="70" height="70" />' +
					'</a></dt>' +
					'<dd><a href="./spot/' + c[0][0] + '/">' + c[0][1] + '</a></dd>';
					
	
	var out_02 = 	'<dt><a href="./spot/' + c[1][0] + '/">' +
					'<img src="spot/' + c[1][0] + '/70_thum.jpg" alt="70" width="70" height="70" />' +
					'</a></dt>' +
					'<dd><a href="./spot/' + c[1][0] + '/">' + c[1][1] + '</a></dd>';
					
	
	var out_03 = 	'<dt><a href="./spot/' + c[2][0] + '/">' +
					'<img src="spot/' + c[2][0] + '/70_thum.jpg" alt="70" width="70" height="70" />' +
					'</a></dt>' +
					'<dd><a href="./spot/' + c[2][0] + '/">' + c[2][1] + '</a></dd>';
					
	
	$("#spot_box dl#spot_dl_01").html(out_01);
	$("#spot_box dl#spot_dl_02").html(out_02);
	$("#spot_box dl#spot_dl_03").html(out_03);
}


//配列をシャッフルする関数
function shuffle(list) {
  var i = list.length;

  while (--i) {
    var j = Math.floor(Math.random() * (i + 1));
    if (i == j) continue;
    var k = list[i];
    list[i] = list[j];
    list[j] = k;
  }

  return list;
}

