$(document).ready(function() {
	$("p.color-dates a").hover(
		function() {
			c = $(this).attr("class");
			this.$thumbs = $("div.thumbnail img." + c);
			this.$thumbs.css("border-bottom", "1px solid black");
		},
		function() {
			this.$thumbs.css("border-bottom", "1px solid white");
		}
	);
});

$(document).ready(function() {
	$("div.thumbnail img").hover(
		function() {
			c = $(this).attr("class");
			this.$dateLinks = $("p.color-dates a." + c);
			this.$dateLinks.addClass("over-date");
		},
		function() {
			this.$dateLinks.removeClass("over-date");
		}
	);
});


$(document).ready(function() {
	link = $("div.side-block h3");
	link.click(
		function() {
			is_centers = (typeof(centers) == "undefined") ? false : true;
			list = $(this).siblings("div");
			if (list.attr("class") == "invisible") {
				if (is_centers) {
					country_id = $(this).children("span.country-name").attr("id");
					center = centers[country_id];
					map.setCenter(new GLatLng(center[0], center[1]), center[2]);
				}
				list.show("fast");
				list.removeClass("invisible");
				$(this).children("span.arr").html("&darr;");
			}
			else {
				if (is_centers) {
					map.setCenter(new GLatLng(43.5803909, -37.96875), 2);
				}
				list.hide("slow");
				list.addClass("invisible");
				$(this).children("span.arr").html("&rarr;");
			}

		}
	);
});
