<!--
var $ = jQuery.noConflict();

//スライドスクロール

/*
パラメータ
id				->	CSS ID名：対象のID名
now				->	数字：表示するページ数
marginAdjust	->	"auto"/px数：各エレメントのマージンを指定する。"auto"で自動で調整する（デフォルトは"auto"）
heightAdjust	->	true/false：エレメントの高さを調整する。エレメントにテキストが存在する場合は必須
loop  			->	true/false：スライドをループ表示するか（デフォルトはtrue）
null_tag		->	HTMLタグ：ダミーエレメントのタグ。エレメントを同時に複数表示させていて、尚且つループさせる場合は必ず入力
open_target_id	->	CSS ID名：エレメントの画像リンクを指定の場所に表示させるか。させる場合は対象のID名を入力
debug			->	CSS ID名：デバッグ情報を表示する場合、対象のIDを入力
*/
function FNC_slideScroll(obj){
	$(obj["id"]).each(function(){
		var id = this;
		var now = obj["now"];
		var marginAdjust = obj["marginAdjust"];
		var heightAdjust = obj["heightAdjust"];
		var loop = obj["loop"];
		var null_tag = obj["null_tag"];
		var debug = obj["debug"];
		if(loop != false){
			loop = true;
		}
			
		var open_target_id = obj["open_target_id"];
		var open_target_txt_id = obj["open_target_txt_id"];
		
		if(marginAdjust == "auto"){
			marginAdjust = $('.scroll_Show .scroll_Wrap > *',id).css("margin-right");
			marginAdjust = marginAdjust.replace("px","");
			marginAdjust *= 1;
		}else if(!isFinite(marginAdjust)){
			marginAdjust = 0;
		}
		
		$('.scroll_Show .scroll_Wrap > *',id).css('display','block');
		$('.scroll_Show .scroll_Wrap',id).css('position','absolute');
		
		heightCHK();
		function heightCHK(){
			var _height = new Array();
			var _i = 0;
			$('.scroll_Show .scroll_Wrap > *',id).each(function(){
				//alert($(this).attr('class') +'  '+ $(this).height())
				_height[_i] = $(this).outerHeight();
				_i++;
			});
			_height.sort(function(a, b) { return a - b; });
			_height.reverse();
			//alert(_height);
			$('.scroll_Show',id).css('height',_height[0]+'px');
		}
		if(heightAdjust != null){
			setInterval(heightCHK,5000);
		}
		$('.scroll_Show',id).css('overflow','hidden');
		
		//1カセット分の幅
		var w1 = $('.scroll_Show',id).width() + marginAdjust;
		
		//要素の幅
		var w2 = 0;
		//エレメント数
		var ele_num = 0;
		$('.scroll_Show .scroll_Wrap > *',id).each(function(){
			w2 += $(this).outerWidth({margin: true});
			ele_num++;
		});
		
		//要素一つの幅
		var w3 = w2/ele_num;
		
		//カセット数
		var pages = Math.ceil(w2/w1);
		
		//now値に不具合がある場合
		if(now<1){
			now = 1;
		}else if(now > pages){
			now = pages;
		}
		
		//ボタンが押せるかフラグ
		var FLG_btn = true;
		
		//一度の表示で何個の要素を表示するか
		var once_num = Math.floor(w1 / w3);
		
		//1ページで表示できる場合はループ解除
		if(ele_num <= once_num){
			loop = false;
		}

		//ダミーエレメントを追加
		if(ele_num < pages*once_num){
			var append = pages*once_num - ele_num;
			for(var i = 0; i< append; i++){
				$('.scroll_Show .scroll_Wrap > *:last',id).after(null_tag);
				ele_num++;
			}
		}
			
		
		//幅セット	
		$('.scroll_Show .scroll_Wrap',id).css("width",w1*pages+"px");
		
			
		//デバッグ
		if(debug != ""){
			$(debug).html("ID:"+id+" / w1:"+w1 +" / w2:"+ w2 +" / now:"+ now +" / pages:"+ pages +" / ele_num:"+ ele_num +" / once_num:"+ once_num);
		}
		
		
		//矢印ボタン
		$('.arrow_r img',id).click(function (){	
			if(FLG_btn){
				if(now < pages || loop == true){
					FLG_btn = false;
					now++;
					_move();
				}
			}
		});
		$('.arrow_l img',id).click(function (){
			if(FLG_btn){
				if(now > 1 || loop == true){
					FLG_btn = false;
					now--;
					_move();
				}
			}
		});
		
		//矢印ボタンを表示するか
		_btnCheck();
		function _btnCheck(){
			if(loop == false){
				if(now == 1 ){
					$('.arrow_l img',id).fadeOut("slow");
				}else{
					$('.arrow_l img',id).fadeIn("slow");
				}
				if(now == pages){
					$('.arrow_r img',id).fadeOut("slow");
				}else{
					$('.arrow_r img',id).fadeIn("slow");
				}
			}else{
				$('.arrow_l img',id).fadeIn("slow");
				$('.arrow_r img',id).fadeIn("slow");
			}
		}
		
		//移動処理
		_move('defo');
		function _move(sp){
			var ww = (now-1)*w1*-1;
			//alert(sp)
			
			if(sp == 'defo'){
				$('.scroll_Show .scroll_Wrap',id).css({"left": ww+"px"});
			}else{
				if(loop == false){
					$('.scroll_Show .scroll_Wrap',id).animate({"left": ww+"px"}, "1000",function(){FLG_btn = true;});
				}else if(now <1){
					ww = (now)*w1*-1;
					var www = (now+1)*w1*-1;
					$target = $('.scroll_Show .scroll_Wrap > *:first',id);
					$('.scroll_Show .scroll_Wrap > *:gt('+ (ele_num - once_num-1) +')',id).insertBefore($target);
					$('.scroll_Show .scroll_Wrap',id).css({"left": www+"px"});
					$('.scroll_Show .scroll_Wrap',id).animate({"left": ww+"px"}, "1000",function(){FLG_btn = true;});
					now++;
				}else if(now == pages){
					var www = (now-2)*w1*-1;			
					$('.scroll_Show .scroll_Wrap',id).animate({"left": ww+"px"}, "1000",function(){
						$target = $('.scroll_Show .scroll_Wrap > *:last',id);
						$('.scroll_Show .scroll_Wrap > *:lt('+(once_num)+')',id).insertAfter($target);
						$('.scroll_Show .scroll_Wrap',id).css({"left": www+"px"});
						FLG_btn = true;
					});
					now--;
				}else if(now > pages){
					ww = (now-2)*w1*-1;
					var www = (now-3)*w1*-1;
					$target = $('.scroll_Show .scroll_Wrap > *:last',id);
					$('.scroll_Show .scroll_Wrap > *:lt('+(once_num)+')',id).insertAfter($target);
					$('.scroll_Show .scroll_Wrap',id).css({"left": www+"px"});
					$('.scroll_Show .scroll_Wrap',id).animate({"left": ww+"px"}, "1000",function(){FLG_btn = true;});
					now--;
				}else {
					$('.scroll_Show .scroll_Wrap',id).animate({"left": ww+"px"}, "1000",function(){FLG_btn = true;});
				}
			}
	
			//デバッグ
			if(debug != ""){
				$(debug).html("ID:"+id+" / w1:"+w1 +" / w2:"+ w2 +" / now:"+ now +" / pages:"+ pages +" / ele_num:"+ ele_num +" / once_num:"+ once_num);
			}
			_btnCheck();
		}
		//クリックで画像を表示させる
		if(open_target_id != null){
			//alert(open_target_id);
			var newIMG;
			var firstIMG = true;
			var imgArray = new Array();
			var txtArray = new Array();
			$('.scroll_Show .scroll_Wrap > *. a',id).each(function(){
				imgArray.push($(this).attr("href"));
				if(open_target_txt_id != null){
					if($(this).attr("title") != ''){
						txtArray.push($(this).attr("title"));
					}else{
						txtArray.push('');
					}
				}
			});
			
			/*if(open_target_txt_id != null){
			$('.scroll_Show .scroll_Wrap > *. a[]',id).each(function(){
					txtArray.push($(this).attr("title"));
			
				});
			}*/

			$('img',open_target_id).fadeOut(0,function(){
				if($(this).attr('src') != imgArray[once_num*(now -1)]){
					$(this).attr('src',imgArray[once_num*(now -1)]).load(function(){
						$(this).fadeIn(500);
					});
				}else{
					$(this).fadeIn(500);
				}
				if(open_target_txt_id != null){
					$(open_target_txt_id).text(txtArray[once_num*(now -1)]).fadeIn(500);
				}
			});
			
			$('.scroll_Show .scroll_Wrap a',id).click(function (){
				var imgsrc = $(this).attr("href");
				var imgttl = $(this).attr("title");
				newIMG = imgsrc;
	
				$('img',open_target_id).fadeTo(0,0,function(){
					if(firstIMG && $(this).attr('src') == newIMG){
						$(this).fadeTo(500,1);
						firstIMG = false;
					}else{
						firstIMG = false;
						$(this).attr('src',imgsrc).load(function(){
							if(newIMG == imgsrc){
								$(this).stop();
								$(this).fadeTo(500,1);
							}
						});
					}
				});
				if(open_target_txt_id != null){
					$(open_target_txt_id).fadeOut(100,function(){
						$(this).text(imgttl).fadeIn(500);
					});
				}
				return false;
			});
		}
	});
}

/*ロード後実行
=========================================================================================================*/
$(document).ready(function(){
	
	//角丸処理
	$('.parts01 .box1,.parts01 .box2').append('<p class="tl"></p><p class="tr"></p><p class="bl"></p><p class="br"></p>')
	.eq(0).each(function(){
		if($.browser.name="msie" && $.browser.version ==6){
			//alert( $.browser.name +"/" +$.browser.version);
			setInterval(corner_ie6,2000);
		}
	});
	function corner_ie6(){
		//IE6は要素の高さが奇数pxと偶数pxでbottomの数値が違う
		$('.parts01 .box1,.parts01 .box2').each(function(){
			//$('h3',this).text($(this).height());
			if($(this).height()%2 == 1){
				$('.bl,.br',this).addClass('odd');
			}else{
				$('.bl,.br',this).removeClass('odd');
			}
		});
	}
	
	//カレンダーツールチップ
	calendar_tooltip('#content.fair .calender td a');
	//カレンダーの日曜を赤文字に
	/*$('#content.fair .calender tr td:first-child').addClass('sunday');
	$('#content.whatnew .calenderNew tr td:first-child').addClass('sunday');
	$('#content.blog .calenderNew tr td:first-child').addClass('sunday');*/
	$('#holidaysWrap .business-calendar thead tr th:first-child').addClass('sunday');
	

	//フォーム用アコーディオン
	form_accordion();
	
	//ボックス垂直方向に対してセンター
	box1_img_vertical_center();
	
	//フッター調整
	___resize();
	
	$("#holidays").click(function(){
		$('#holidaysWrap').slideToggle();
		return false;
	});
	
	
	
});
var delay = (function(){
  var timer = 0;
  return function(callback, ms){
    clearTimeout (timer);
    timer = setTimeout(callback, ms);
  };
})();
$(window).resize(function() {
    delay(function(){
      ___resize();
    }, 300);
});

/*=======================================================================================================*/

//カレンダー用ツールチップ
function calendar_tooltip(target){	
	var tooltip = '#calendar_tooltip';
	$(target).hover(function(e){
		var color = $(this).parent().attr('class');
		var content = $(this).parent().find('.tooltip').html();
		if(content == null){
			return false;
		}
		$("body").append('<div id="calendar_tooltip">	<div id="calendar_tooltip_body" class="'+color+'">'+content+'</div>	<span id="calendar_tooltip_bottom" class="'+color+' transpng">	</span></div>');
		var h = $(tooltip).height();
		var w = $(tooltip).width();
		$(tooltip)
			.css('top',(e.pageY -10 - h) + 'px')
			.css('left',(e.pageX - w/2) + 'px')
			.fadeIn('fast');		
	},
	function(){	
		$(tooltip).remove();
	});	
	$(target).click(function(){
		$(tooltip).remove();
	});
	$(target).mousemove(function(e){
		var h = $(tooltip).height();
		var w = $(tooltip).width();
		$(tooltip)
			.css('top',(e.pageY -10 - h) + 'px')
			.css('left',(e.pageX - w/2) + 'px')
	});			
};

//box1の画像を中央に
function box1_img_vertical_center(){
	$('.parts01 .box1').each(function(){
		var par = $(this).height();
		var chi = $('.boxR',this).height();
		$('.boxR',this).css('margin-top',Math.round(par-chi)/2+'px')
	});
}

//フォーム用アコーディオン
function form_accordion(){
	$('.accordionTtl .btn a').click(function(){
		var btn = $(this);
		
		$('#accordionBdy').slideToggle('first',function(){
			if(btn.text() == "このフォームを非表示にする"){
				btn.text('このフォームを表示する');
			}else{
				btn.text('このフォームを非表示にする');
			}
		});
		return false;
	});
}

//カレンダーから日付選択
function date_picker(target,todayset){
	
	var today = new Date();
	var Y = $('.Y',target);
	var M = $('.M',target);
	var D = $('.D',target);

	// initialise the "Select date" link
	$('.date-pick',target)
		.datePicker(
			// associate the link with a date picker
			{
				createButton:false,
				startDate:'01/01/'+today.getFullYear(),
				endDate:'31/12/'+(today.getFullYear()+2)
			}
		).bind(
			// when the link is clicked display the date picker
			'click',
			function()
			{
				updateSelects($(this).dpGetSelected()[0]);
				$(this).dpDisplay();
				return false;
			}
		).bind(
			// when a date is selected update the SELECTs
			'dateSelected',
			function(e, selectedDate, $td, state)
			{
				updateSelects(selectedDate);
			}
		).bind(
			'dpClosed',
			function(e, selected)
			{
				updateSelects(selected[0]);
			}
		);
	var updateSelects = function (selectedDate)
	{
		//alert(selectedDate)
		var selectedDate = new Date(selectedDate);
		//alert(selectedDate.getFullYear())
		$('option[value=' + selectedDate.getDate() + ']',D).attr('selected', 'selected').trigger('change');
		$('option[value=' + (selectedDate.getMonth()+1) + ']',M).attr('selected', 'selected').trigger('change');
		$('option[value=' + (selectedDate.getFullYear()) + ']',Y).attr('selected', 'selected').trigger('change');
	}
	// listen for when the selects are changed and update the picker
	$(Y,M,D)
		.bind(
			'change',
			function()
			{
				var d = new Date(
							$(Y).val(),
							$(M).val()-1,
							$(D).val()
							);
							//alert("かわった")
				$(target).dpSetSelected(d.asString());			
			}
		);
	
	// default the position of the selects to today
	if(todayset){
		if($(M).val() == '' && $(D).val() == '') updateSelects(today.getTime());
	}
	// and update the datePicker to reflect it...
	$(D).trigger('change');
	
}

function day_ShowHide(id){
	_showhide($('.M',id).val());
	$('.M',id).parent().find('ul a').click(function(){
		_showhide($(this).text());
	});
	$('.M',id).change(function(){
		_showhide($(this).val());
	});
	function _showhide(val){
		if(val != '' && val != '　'){
			if(val*1 > 0){
				
			}else{
				$('.dayWrapper',id).fadeOut('500');
				return false;
			}
		}
			$('.dayWrapper',id).fadeIn('500');
		
	}
	
}
function date_setting(id){	
	_set();
	$('select',id).change(function(){
		_set();
	});
	$('ul a',id).click(function(){
		_set();
	});
	function _set(){
		var txt = '';
		var yy = $('.Y',id).val();
		var mm = $('.M',id).val();
		var dd = $('.D',id).val();
		if(yy != '' && yy != '　'){
			txt += yy + '年';
		}
		if(mm != '' && yy != '　'){
			txt += mm + '月';
		}
		if(dd != '' && yy != '　'){
			txt += dd + '日';
		}
		//$('.Y',id).val() +'年'+ $('.M',id).val()  +'月'+ $('.D',id).val()+'日';
		var val = $('.M',id).val();
		if(val != '' && val != '　'){
			if(val*1 > 0){
			}else{
				txt = '';
				if(yy != '' && yy != '　'){
					txt = yy + '年';
				}
				txt += mm;
			}
		}
		$('.hidefield',id).val(txt);
	}
}

//フェア予約フォームの時間プルダウン
function FNC_reserve_change(obj){
	$(obj["id"]).each(function(){
		var id = this;
		var st_rh = obj["st_rh"];
		var st_rm = obj["st_rm"]/10 -1;
		var en_rh = obj["en_rh"];
		var en_rm = obj["en_rm"]/10 + 1;
		//alert(st_rh+":"+st_rm+"〜"+en_rh+":"+en_rm);
		
		_set();
		$('#reserve_h select',id).change(function(){
			_set();
		});
		$('.jqTransformSelectWrapper:eq(0) ul a',id).click(function(){
			_set();
		});
		function _set(){
			$('ul:eq(1) a',id).parent('li').show();
			if($('#reserve_h',id).val() == en_rh){
				for(var i = en_rm; i<=6; i++){
					$('ul:eq(1) a',id).parent('li:eq('+i+')').hide();
				}
				if($('.jqTransformSelectWrapper:eq(1) ul li a.selected',id).attr('index') >= en_rm){
					var txt = (en_rm-1)*10;
					if(txt == 0){
						txt = "00";
					}
					$('.jqTransformSelectWrapper:eq(1) div span').text(txt);
					$('#reserve_m option[value='+(en_rm-1)*10+']',id).attr('selected', 'selected');
					$('.jqTransformSelectWrapper:eq(1) ul li a.selected',id).removeClass('selected');
					$('.jqTransformSelectWrapper:eq(1) ul li:eq('+(en_rm-1)+') a',id).addClass('selected');
				}
			}else if($('#reserve_h',id).val() == st_rh){
				for(var i = st_rm; i>=0; i--){
					$('ul:eq(1) a',id).parent('li:eq('+i+')').hide();
				}
				if($('.jqTransformSelectWrapper:eq(1) ul li a.selected',id).attr('index') <= st_rm){
					var txt = (st_rm+1)*10;
					if(txt == 0){
						txt = "00";
					}
					$('.jqTransformSelectWrapper:eq(1) div span').text(txt);
					$('#reserve_m option[value='+(st_rm+1)*10+']',id).attr('selected', 'selected');
					$('.jqTransformSelectWrapper:eq(1) ul li a.selected',id).removeClass('selected');
					$('.jqTransformSelectWrapper:eq(1) ul li:eq('+(st_rm+1)+') a',id).addClass('selected');
				}
				
			}
		}
	});
}

//携帯電話番号統合
function FNC_cellular(target){
	_set();
	$('input',target).change(function(){
		_set();
	});
	function _set(){
		var val = '';
		$('input:not(.hidefield)',target).each(function(){
			if($(this).val() != ""){
				val += $(this).val()+"-";
			}
		});
		val = val.slice(0, -1);
		//alert(val)
		$('.hidefield',target).val(val);
	}
}
//フォームの確認画面において、余計なものを削除
function FNC_form_null_hide(){
	$('td span.wrap').each(function(){
		var target = $('span.null',this);
		if(target.text() == ''){
			$(this).hide();
		}
	});
}


function FNC_click_to_bigimg(id,target,bigimg,txt){
	if(txt != ''){
		$(".hide",txt).hide();
	}
	$(target,id).click(function(){
		var linkimg = $(this).attr('href');
		if($(bigimg+' img',id).attr('src') != linkimg){
			if(linkimg.search(/\.swf/i) == -1){
				$("#swf").remove();
				$(bigimg+' img',id).fadeOut(250,function(){
					$(this).attr('src',linkimg).load(function(){
						$(this).fadeIn(500);
						
					});
				});
			}else{
				//swfを表示する場合
				$(bigimg+' img',id).fadeOut(250,function(){
					$(bigimg+' img',id).parent().parent().append('<div id="swf"></div>');
					swf_show();
				});
			}
			if(txt != ''){
				var no = $(this).attr('rel');
				$('div',txt).hide();
				$("div:eq("+no+")",txt).show();
			}
		}
		return false;
	});
}

//vista 7 macのFirefoxでinputがずれるのを修正
function FNC_input_adjust(){
	var os, ua = navigator.userAgent;
	if (ua.match(/Win(dows )?NT 6\.1/) || ua.match(/Win(dows )?NT 6\.0/) || ua.match(/Mac|PPC/)) {
		if($.browser.name == 'firefox'){
			$("form input[type='text']").css('padding-top','0');
		}
	}
}

function ___resize() {
	$("#content .main").css("height","auto");
	var bh = $("body").height();
	var hh = $("html").height();
	var mh = $("#content .main").height();
	var h = mh + hh - bh;
	if(mh<h){
		$("#content .main").css("height",h+"px");
	}
}
function ___getWidth() {
	var windowWidth;
	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth; 
		} else {
			windowWidth = self.innerWidth;
		}
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
	}
	var w = windowWidth;
	return w;
};





//-->
