$(document).ready(function() {
		/*loadFlickr("48218395@N05");
		function loadFlickr(flickrid)
		{
			// Display a loading icon in our display element
			$('#feed').html('<span><img src="images/loading.gif" /></span>');
			// Request the JSON and process it
			$.ajax({
				type:'GET',
				url:"http://api.flickr.com/services/feeds/photos_public.gne",
				data:"id="+flickrid+"&lang=en-us&format=json&jsoncallback=?",
				success:function(feed) {
					// Create an empty array to store images
					var thumbs = [];
					// Loop through the items
					for(var i=0, l=feed.items.length; i < l && i < 34; ++i) 
					{
						// Manipulate the image to get thumb and medium sizes
						var img = feed.items[i].media.m.replace(
							/^(.*?)_m\.jpg$/, 
							'<a href="$1.jpg" class="example2" rel="Group"><img src="$1_s.jpg" alt="" width="103" height="70" /></a>'
						);
						// Add the new element to the array
						thumbs.push(img);
					}
					// Display the thumbnails on the page
					
					$.doTimeout( 2000, function(){
						$('#images').html(thumbs.join(''));
						// A function to add a lightbox effect
						$("a.example2").fancybox({
							'titleShow'     : false,
							'transitionIn'	: 'elastic',
							'transitionOut'	: 'elastic'
						});
					});
				},
				dataType:'jsonp'
			});
		}	*/
			


			$.getJSON('http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=bebfd77fcc454daa30aa3995d9100840&user_id=48218395@N05&per_page=35&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: 28,
				count: 100,
				query: "nldoet",
				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
	});
});

