$(function() {
	$("#contact_wrapper").hide();
	$("#contact_header").click(function() {
		$("#contact_wrapper").slideToggle('1000', "easeOutBounce", function () {});
	});
});

jQuery(function($){
	$.supersized({
		fit_always		:	0,
		fit_portrait    :   1,
		fit_landscape	:   0,
		slides  		:  	[ {image : 'display/bg_me.jpg', title : ''} ]
	});
});

$(function() {
    $("#tabbed").organicTabs({
        "speed": 200
    });
});

$(document).ready(function () {		
	// API Ref: http://api.dribbble/players/:id/shots
	$.jribbble.getShotsByPlayerId('markuspfeifer', function (playerShots) {
		var html = [];
		$.each(playerShots.shots, function (i, shot) {
			html.push('<li><h3>' + shot.title + '</h3>');
			html.push('<p>by ' + shot.player.name + '</p><a href="' + shot.url + '">');
			html.push('<img src="' + shot.image_teaser_url + '" ');
			html.push('alt="' + shot.title + '"></a></li>');
		});
			
		$('#shotsByPlayerId').html(html.join(''));
	}, {page: 1, per_page: 6});
	
	$.fn.scrollToTop=function(){
		$(this).hide().removeAttr("href");
		if($(window).scrollTop()!="0"){
			$(this).fadeIn("slow")
		}
		var scrollDiv=$(this);	
		$(window).scroll(function(){
			if($(window).scrollTop()=="0"){
				$(scrollDiv).fadeOut("slow")
			}else{
				$(scrollDiv).fadeIn("slow")
			}
		});			
		$(this).click(function(){
			$("html, body").animate({scrollTop:0},"slow");
		});
	}
	
	$('div#lastfm').lastFM({
			username: 'markuspfeifer',
			apikey: '3775fab496932bbeb479a399e6939378',
			number: 8,
			artSize: 'small',
			noart: 'display/noartwork.gif',
			onComplete: function(){
				//Done
			}
	});
	
});

$(function() {
	$("#scrollbutton").scrollToTop();
});

