$(document).ready(function() {
	
	$('#img .close').click(function(){
		$('#img').hide();
		return false;
	});

	$('#video_link').click(function(){
		$('#img').hide();
		$('#video').show();
		return false;
	});

	$('#video .close').click(function(){
		$('#video').hide();
		$('#img').show();
		return false;
	});

	$('.close img').fadeTo(0, 0.25);
	
	$('.close a').hover(
		function(){
			$(this).children('img').fadeTo('fast', 1);
		},
		function(){
			$(this).children('img').fadeTo('fast', 0.25);
		}
	);
	
	$('#about .close').click(function(){
		$('#content').hide();
		$("body").css({"background-image": "url(/wordpress/wp-content/themes/1.1/img/shop_bg.jpg)"});
		return false;
	});
	
	$('#events .close').click(function(){
		$('#content').hide();
		$("body").css({"background-image": "url(/wordpress/wp-content/themes/1.1/img/shop_bg.jpg)"});
		return false;
	});
	
	$('#press .close').click(function(){
		$('#content').hide();
		$("body").css({"background-image": "url(/wordpress/wp-content/themes/1.1/img/shop_bg.jpg)"});
		return false;
	});
	
	$('#contact .close').click(function(){
		$('#content').hide();
		$("body").css({"background-image": "url(/wordpress/wp-content/themes/1.1/img/shop_bg.jpg)"});
		return false;
	});
	
	$('.row img').fadeTo(0, 0.6);

	$('.row a').hover(
		function(){
			$(this).children('img').fadeTo('fast', 1);
		},
		function(){
			$(this).children('img').fadeTo('fast', 0.6);
		}
	);

	$('#thumbs a').first().addClass('current');
	$('.thumb a').each(function() {
		if($(this).hasClass('current')) {
		}else{
			$(this).children('img').fadeTo(0, 0.6);
		}
	});

	var bgimg = $('#thumbs a').first().attr('href');
	$('#img .full-image').attr('src', bgimg);
	$('#img .full-image').attr('width', '587');
	$('#img .full-image').attr('height', 'auto');

	$('.thumb a').hover(
		function(){
			$(this).children('img').fadeTo('fast', 1);
		},
		function(){
			$('.thumb a').each(function() {
			if($(this).hasClass('current')) {
				$(this).children('img').css({opacity:1});
			}else{
				$(this).children('img').fadeTo('fast', 0.6);
			}
		});
	});

	$('#thumbs a').click(function(){
		$('#thumbs a').removeClass('current');
		$(this).addClass('current');
		$('.thumb a').each(function() {
			if($(this).hasClass('current')) {
			}else{
				$(this).children('img').fadeTo(0, 0.6);
			}
		});
		var bgimg = $(this).attr('href');
		$('#img .full-image').attr('src', bgimg);
		$('#img .full-image').attr('width', '587');
		$('#img .full-image').attr('height', 'auto');
		return false;
	});

});

