$(document).ready(
	function()
	{
		// menu
		$("#menu > li").hover(function(){
			$(this).find("ul").show();
		}, function(){
			$(this).find("ul").hide();
			});

		// preview
		$("#preview-foot > li > a").click(function(){
			var linkPath = $(this).attr("href");
			var imgPath = $(this).find("img").attr("alt");
			var imgText = $(this).parent().find("span").text();
			
			$("#preview-foot > li > a").removeClass("active");
			$(this).addClass("active");			
			$("#preview-img").animate({ opacity: "hide" }, function(){
					$("#preview-img > img").attr({ src : imgPath  });
					$("#preview-img > p").html(imgText);
					$("#preview-link").attr({href : linkPath });
					});
			$("#preview-img").animate({ opacity: "show" });
			return false;
		   });

		// menu-left
		$("#menu-left > li > a").click(function(){
			var findList = $(this).parent().find("ul").length;
			if ( findList != 1 ){
				return true;
			} else {
				$(this).parent().find("ul").slideToggle("slow");
				return false;
			};
		});

});


