$(document).ready(function() {

			$.getJSON('http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=bebfd77fcc454daa30aa3995d9100840&user_id=54110563@N03&per_page=20&format=json&jsoncallback=?', function(data) {
				$(data.photos.photo).each(function(){
					var farmid = this.farm;
					var server = this.server;
					var imgid	= this.id;
					var imgsecret	= this.secret;
					var imgtitle = this.title;
					var img = 'http://farm'+farmid+'.static.flickr.com/'+server+'/'+imgid+'_'+imgsecret+'.jpg';
					var img_s = 'http://farm'+farmid+'.static.flickr.com/'+server+'/'+imgid+'_'+imgsecret+'_s.jpg';
					
					$.doTimeout( 2000, function(){
						$('#images .loading').remove();
						$('<a class="example2" rel="Group" href="'+img+'" title="'+imgtitle+'"><img width="104" height="70" src="'+img_s+'" /></a>').appendTo('#images');
						$("a.example2").fancybox({
							'titleShow'     : true,
							'transitionIn'	: 'elastic',
							'transitionOut'	: 'elastic'
						});
					});
				});
			});

		  					   		
			$("#twitterbox").tweet({
				avatar_size: 48,
				count: 5,
				query: "burendag",
				loading_text: "zoeken in twitter...",
				refresh_after: 120
			  }).bind("empty", function() { $(this).append("Geen tweets gevonden"); });
	
	$('a#twitter_up').click(function(){
		$('#twitterbox').stop().scrollTo('-=300px', 800);
		return false;
	});
	$('a#twitter_down').click(function(){
		$('#twitterbox').stop().scrollTo('+=300px', 800);
		return false;
	});
	$("#tooltipFoto").tooltip({
		track: true,
		delay: 0,
		showURL: false
	});

    // Sliding about div

    $('#aboutBD').hide();

    $('a.trigger').click(function(){
        $('#aboutBD').slideToggle('fast');
    });

    $('a.close').click(function(){
        $('#aboutBD').slideToggle('fast');
    })

});

