 
// What is $(document).ready ? See: http://flowplayer.org/tools/using.html#document_ready

// Gotcha - when looking for code samples, replace refs to '$' with 'jQuery'. When using 
// Prototype and jQuery, one of them has to relinquish the $ namespace to avoid conflicts. 
jQuery(document).ready(function() {
	image_overlay = jQuery('a.thumbnail').overlay({
		target: '#overlay',
		expose: { 
	        color: '#000000',  
	        loadSpeed: 300, 
	        opacity: 0.5
	    }
	});
	
	jQuery('a.simple_popup').click(function () { jQuery(this).populateOverlayScreen(jQuery(this)); });
	
	jQuery('a#close').click(function () {
	   jQuery('a.thumbnail').each(function() { 
		   jQuery(this).overlay().close(); 
	    }); 
	});
});

jQuery.fn.populateOverlayScreen = function(element) {
	jQuery(".overlayPadder").replaceWith("<div class=\"overlayPadder\" id=\"overlayPadder\"><h2>"+element[0].title+"</h2><img src=\""+element[0].href+"\" /></div>");
};
 

 
		
 