$(function(){
	//$('a[@rel*=lightbox]').lightBox();
	$('.lightbox').lightBox();
	
	$('.photoBlock a').lightBox();

	
	$(".rating input[type=radio]").rating({
		callback: function(value, link){
			this.form.submit();	
		}
	});
});

$(function(){
	//if($(".photos").length > 0){
		
		$(".gallery .photos a").live('click', function(){
			img = $(this).find("img");
			img.fadeTo("fast", 0.5);
			$(".photo img").bind("load", function(){
				img.fadeTo("fast", 1);
			});
			$(".photo img").attr("src", $(this).attr("href"));
			
			return false;
		});
		$(".gallery .left").live('click', function(){
			if(parseInt($(".gallery .photos .holder").css("marginLeft")) < 0){
				$(".gallery .photos .holder").animate({marginLeft: "+=160px"});
			}
			return false;
		});
		$(".gallery .right").live('click', function(){
			minLeftMargin = (-1 * (parseInt($(".gallery .photos .holder a").length) - 4) * 160);
			currentLeftMargin = parseInt($(".gallery .photos .holder").css("marginLeft"));
			
			if(currentLeftMargin > minLeftMargin){
				$(".gallery .photos .holder").animate({marginLeft: "-=160px"});
			}
			
			return false;
		});
	//}
});

	$(function(){
		$('.floors li a').click(function(){
			$('.floors li').removeClass("selected");
			$(this).parent().addClass("selected");
	        $('.floor').removeClass("selected");
			$("#floo"+$(this).attr("id")).addClass("selected");
			return false;
	    });
		$('.exhibitions .current ul li a').click(function(){
			$(".exhibitions .main").removeClass('selected');
			$("#ex"+$(this).parents("li").attr("id")).addClass('selected');
			$(".exhibitions .current ul li").removeClass("selected");
			$(this).parents("li").addClass("selected");
			return false;
		});
	});
