jQuery(document).ready(function($) {

	if ($('#slidesContainer').length > 0) {
	$('.video-panel').appendTo($('body'));

	$('div.scrollable').scrollable({size:4});
	$('.overlay').overlay({absolute:true,expose:{color:'#333',loadSpeed:200}});
	
	$('li.item a').click(function() {
			
		// calclulate large image's URL based on the thumbnail URL (flickr specific) 
    var url = $(this).attr("href"); 
 
		var wrap = $("#single-image");
 
    // the large image from flickr 
    var img = new Image(); 
 
    // call this function after it's loaded 
    img.onload = function() { 
 
        // change the image 
        wrap.find("img").attr("src", url); 
				
				// make wrapper fully visible 
        wrap.fadeTo("fast", 1); 
 
    }; 
 
    // begin loading the image from flickr 
    img.src = url; 
		
		 // get handle to element that wraps the image and make it semitransparent 
		if (!img.complete) {
    wrap.fadeTo("fast", 0.3); 
		}
		
	
	}).filter(":first").click();
	
	}

	
});
