// JavaScript Document
function GetBigger(url)
{
	document.getElementById("bigphoto").innerHTML = "<img src='"+url+"' />";
}


function GetContent()
{
	//var default_id = "33006737@N00"; // Define default Flickr ID here
	var max_images = 50;  // How many to show
	var have_images = 0;
	
	//if (!foreign_id) foreign_id = default_id;
	
	// Define the URL to be called
	//   Note: "jsoncallback=?" param is in URL to allow cross-domain JSON using jQuery
	var url = "http://api.flickr.com/services/feeds/photos_public.gne?id=33006737@N00&lang=en-us&format=json&jsoncallback=?&tags=web,alien";
	
	// Clear the HTML display
	document.getElementById("images").innerHTML = "";
	
	// Get the data from the web service and process
	$.getJSON(url,
		function(data){
			$.each(data.items, function(i,item){
			
			// Get first 10 chars of date_taken, which is the date: YYYY-MM-DD  -->i dont need this
			//var date_pub = item.date_taken.substring(0, 10);
			//Get larger image as well
			var largeimg = item.media.m.replace("_m.jpg", ".jpg?v=0");
			
			// Format the HTML for this photo
			var text = '<div class="photo"><a href="#" onClick="GetBigger(\''+largeimg+'\')">' + 
				'<img src="' + item.media.m + '"></a></div>';
			
			// Now append to the HTML display
			$(text).appendTo("#images");
			if ( i >= (max_images-1) ) return false; // Limit total images
			});
		
	});

}

