/**
 * @author dot4all S.r.l. - david.silvestri
 */
$(document).ready(function(){
	//functio gallery portfolionew
	$(window).bind("load",function(){
	//$(".thumbs img").fadeTo("fast", 1); // This sets the opacity of the thumbs to fade down to 60% when the page loads	
		$(".thumbs img").preload().hover(function(){
			$(this).fadeTo("fast", 0.6); // This should set the opacity to 60% on hover
			var text = $(this).attr("title").split("|")
			$('#fotodesc').html(text[0])
			$('#fotodesc').append("<br /><span>"+text[1].replace('-',"<br />")+"</span>")
		},function(){
			$(this).fadeTo("fast", 1); // This should set the opacity back to 100% on mouseout
			$('#fotodesc').html('')
		});
		var dir = ["left", "right", "up", "down"]
		var numLow = 1
        var numHigh = 4        
        var adjustedHigh = (parseFloat(numHigh) - parseFloat(numLow)) + 1;        

		$(".thumbs a").each(function(){
	        var numRand = Math.floor(Math.random()*adjustedHigh) + parseFloat(numLow);
			$(this).show("slide", { direction: dir[numRand-1] }, 1500)
			$(this).children().fadeIn(1500)
		});
		
	});
});<!-- 

 -->