﻿$(function() {
	var directShop = function() {
		var val = location.search.split('=');
		if(val[1]) {
			var a = "#"+val[1];	//get shopdetail
			var b = a+"Title";	//get shopntitle
			var info = $(a).html();	
			$("div#shopInfo").html(info);
			$("div#shopList>dl>dt").removeClass("current");
			$(b).addClass("current");
		}
	}
	var showInfo = function() {
		var info = $(this).next("dd").html();		
		$("div#shopInfo").html(info);
		$("div#shopList>dl>dt").removeClass("current");
		$(this).addClass("current");	
	}
	var hideInfo = function() {
		$("div#shopList>dl>dd").hide();
	}
	var onMouse = function() {$("div#shopList>dl>dt").hover(function() {
			$(this).css('color', '#66f');
		}, function() {
			$(this).css('color', '#333');
		});
	}

	$("div#map>span#mapToggle").toggle(function() {
		$(this).html("表示");
		$(this).next("img").slideUp("fast");
	}, function() {
		$(this).html("隠す");
		$(this).next("img").slideDown("fast");
	});

	directShop();
	hideInfo();
	$("div#shopList>dl>dt").click(showInfo);
	onMouse();
});

