$(document).ready(function(){
	// visualizza la descrizione
	$(".viewdesc").toggle(function(){
		$(".projectText").fadeIn("slow");
	}, function() {
		$(".projectText").hide("slow");
	});
	
	// innerfade foto
	//$('.projectImg').innerfade({ speed: 'slow', timeout: 4000, type: 'sequence', containerheight: '300px' });
	//$('.projectImg2').innerfade({ speed: 'fast', timeout: 4000, type: 'sequence', containerheight: '300px' }); 
	slideSwitch();
	setInterval( "slideSwitch()", 5000 );
	
	//effetto opacity roll over thumbs
	$("a.thumbslink").fadeTo("slow", 0.60);
	
	// visualizzazione di titolo e sottotitolo
	$(".thumbslink").hover(
	  function () {
		$(this).fadeTo("slow", 1);
		var name = $(this).attr("title");
		var pieces = name.split("-");
		var title = pieces[0];
		var subtitle = pieces[1];
		$("#worktitle").html(title);
		$("#worksubtitle").html(subtitle);
		Cufon.replace('#worktitle');
		Cufon.replace('#worksubtitle');
	  }, 
	  function () {
		$(this).fadeTo("slow", 0.60);
		$("#worktitle").empty();
		$("#worksubtitle").empty();
	  }
	);
	
	
	/*
	$( "#birds" ).autocomplete({
		source: "inc/list.php",
		minLength: 3,
		select: function( event, ui ) {
			//alert(ui.item.rif+"-"+ui.item.id);
			document.location.href = "http://www.rumblefish.it/progetto.php?id="+ui.item.id+"&db="+ui.item.rif;
		}
	});*/
	
});
