$(document).ready(function() {

	$('img.enlrg').click(function() {

	  	if($(this).height()<"400"){
			$(this).animate({'width':$(this).width()/$(this).height()*600+'px','height':'600px'},800);
		}
		else { 
			$(this).animate({'width':$(this).width()/$(this).height()*150+'px','height':'150px'},800);
		}
	});


	$('a#about-nav').click(function() {
		$('.tab').hide();
		$('#container').removeClass('visuallyhidden');
		$('#container footer').remove();
		$('#container').prepend('<footer><a href="#" id="close">close</a></footer>');
		
		$('#about').removeClass('visuallyhidden');
		$('#about').show();
		
		return false;
	});

	$('a#contact-nav').click(function() {
		$('.tab').hide();
		$('#container').removeClass('visuallyhidden');
		$('#container footer').remove();
		$('#container').prepend('<footer><a href="#" id="close">close</a></footer>');
		
		$('#contact').removeClass('visuallyhidden');
		$('#contact').show();
		
		return false;
	});

	$('a#credits-nav').click(function() {
		$('.tab').hide();
		$('#container').removeClass('visuallyhidden');
		$('#container footer').remove();

		$('#container').prepend('<footer><a href="#" id="close">close</a></footer>');
		
		$('#credits').removeClass('visuallyhidden');
		$('#credits').show();
		$('#friends').removeClass('visuallyhidden');
		$('#friends').show();
		
		return false;
	});
	
	$('a#close').live('click', function() {
		$('#container').addClass('visuallyhidden');
		
		return false;
	});
	
// this will fire when any of the like widgets are "liked" by the user
	FB.Event.subscribe('edge.create', function(href, widget) {
		$('#like>span').remove();
		$('#like').append('Thanks :)');
	});


	/*lazyload macht leider mit meinem fade in probleme, das muss ich erstmal Ÿberarbeiten
	
$("img").lazyload({         
	threshold : 200, 
	placeholder : "grey.gif",
	container: $(".imagewrap"),
	effect : "fadeIn",
	failurelimit : 50
});*/

});

