function jsonFlickrApi(data) {
	var s = "";
	for(var i=0; i<15; i++){
		 photo = data.photos.photo[i];
     t_url = 'http://farm'+ photo.farm +'.static.flickr.com/'+ photo.server +'/'+ 
     photo.id +'_'+ photo.secret +'.jpg';
     //Right now the above t_url ends with just ".jpg" but to change the size of the image being pulled you can change it to "_[size].jpg". For example "_s.jpg" would give you a small image.

     p_url = 'http://www.flickr.com/photos/' + 
     photo.owner +'/'+ photo.id;
     s +=  '<a href="'+ p_url +'" rel="external"><img width="390" alt="'+ photo.title +'" src="'+ t_url +'" /></a>';
    }
		$("#fade").html(s);
		$("#fade").cycle({
			fx: 'fade',
			speed: 'normal'
		});
}

$(window).load(function(){
  var preload = [ new Image(), new Image(), new Image, new Image ];
  preload[0].src = "/images/structure/img-banner2.jpg";
  preload[1].src = "/images/structure/img-banner2.jpg";
  preload[2].src = "/images/structure/img-banner2.jpg";
  preload[3].src = "/images/structure/img-banner2.jpg";
});

$(document).ready(function(){
	
	//Flickr API Call
	$.getJSON("http://api.flickr.com/services/rest/?format=json&method=flickr.photos.search&user_id=39177584@N08&sort=date-taken-dsc&api_key=4e13bdce134178ebc6d5e1c81defd08e&callback=?");
	
	//External links		
  $('a[rel="external"]').click(function(){
    $(this).attr('target','_blank');
  });


	$("#tabs a").click(function(){
	 if ($(this).hasClass("tab-current") == false)
	 {
	  var thisTarget = $(this).attr("href");
	  $(this).parents("#tabs").find('a.tab-current').removeClass('tab-current');
	  $(this).addClass('tab-current');
	  $(this).parents("#tabs").nextAll("#tab-content").children(":visible").hide(1, function() { 
			jQuery(thisTarget).show(1);
	 	});
	}
	return false;
	});
	

});