$(document).ready(function(){
	
	var speed = 400;
	
	$(".block").hover(function( ) {
		$(this).addClass("hover");
	}, function( ) {
		$(this).removeClass("hover");
	});
	
	$(".popup").center( );
	
	$(".close").hover(function( ) {
		$(this).addClass("closeHover");
	}, function( ) {
		$(this).removeClass("closeHover");
	});
	
	$(".close").click(function( ) {
		$(".popup").fadeOut(speed);
		$("#overlay").fadeOut(speed);
	});
	
	$("#overlay").click(function( ) {
		$(".popup").fadeOut(speed);
		$("#overlay").animate({
			opacity: 0
		}, speed, function ( ) {
			$("#overlay").css("display", "none");
		});
	});
	
	$(".block").click(function( ) {
		var id = $(this).find(".art").attr("id");
		$("#" + id + "Popup").fadeIn( );
		$("#overlay").css("display", "block");
		$("#overlay").animate({
			opacity: 0.5
		}, speed);
	});
	
	$(".active li").hover(function( ) {
		$(this).addClass("hover");
	}, function( ) {
		$(this).removeClass("hover");		
	});
	
	$(".active li").click(function( ) {
		var href = $(this).attr("href");
		if(href != undefined) document.location = href;
	});

	$("#submit").click(function( ) {
		$("#upgradeForm").submit( );
	});
	
});
