jQuery(document).ready(function(){

	// execute your scripts when DOM is ready. this is a good habit
	$(function() {		
		
		// initialize scrollable 
		$("div.scrollable2").scrollable({
			vertical:true, 
			size: 3
		// use circular plugin
		}).circular();	
		
		$('#desc_dtmui').siblings().hide();
		
		$('#actions  img').css('opacity', '.6');
		$('#actions img').mouseover(function () {
			$(this).fadeTo("fast", 1);
		});
		$('#actions img').mouseout(function () {
			$(this).fadeTo("fast", 0.6);
		});
	});
	$(".items div img").click(function() { 
		// calclulate large image's URL based on the thumbnail URL (flickr specific) 
		var url = $(this).attr("src").replace("t_", ""); 
		// get handle to element that wraps the image and make it semitransparent 
		var wrap = $("#image_wrap").fadeTo("medium", 0.5); 
		// the large image from flickr 
		var img = new Image(); 
		// call this function after it's loaded 
		img.onload = function() { 
			// make wrapper fully visible 
			wrap.fadeTo("fast", 1); 
			// change the image 
			wrap.find("img").attr("src", url); 
		}; 
	 
		img.src = url; 
		var tmp = url.replace(".jpg", "");
		var tmp = tmp.replace("images/portfolio/", "");
		$('#portfoliodesc > *').hide();
		$('#desc_'+tmp).show('slow');
 
	// when page loads simulate a "click" on the first image 
	}).filter(":first").click();
	
});