$(document).ready(function(){
	
$('#header, #works, #navigation, #gr').supersleight();	
	
// $("#wrapper").hide();


function GetSiblingNumber(oElement) {
    return $(oElement).parent().children(oElement.nodeName).index(oElement);
}


$('#slideshow').serialScroll({
	items:'li.slide',
	prev:'#slideshowcontainer a.prev',
	next:'#slideshowcontainer a.next',
	duration:500
});

	$("a#linkcontatti").click( function (event) {
		event.preventDefault();
		$("#info-container").scrollTo( $("#contatti-box"),800,{axis:'x'});
		$("a#linkcontatti").addClass("active");
		$("a#linkworks").removeClass("active");
		
	})
	$("a#linkworks").click( function (event) {
		event.preventDefault();
		$("#info-container").scrollTo( $("#web-box"),800,{axis:'x'});
		$("a#linkcontatti").removeClass("active");
		$("a#linkworks").addClass("active");
	})



	
	
$("li.work-item").hover(function (event){
	
	pshown=	$("ul#generic-description").css("display");
//	alert (pshown);
	/*
	if (pshown="block") {
	$("p#generic-description").hide("fast");
  	} */
$("p.work-item-description").hide("slow");
	event.preventDefault();
	
var pos= GetSiblingNumber(this);
var currentDescription = $("p.work-item-description").eq(pos);
currentDescription.show("slow");
	
	
})


$("#info-works").mouseenter(function (event){
	$("div#generic-description").hide("fast");
	
}).mouseleave(function (event){
	$("p.work-item-description").hide("slow");
	$("div#generic-description").show("slow");
})



/*
	//Full Caption Sliding 
	$('.slideli').hover(function(){
		$(".moreinfo", this).stop().animate({top:'-120px', left:'-20'},{queue:false,duration:160});
	}, function() {
		$(".moreinfo", this).stop().animate({top:'-120', left:'-300'},{queue:false,duration:160});
	});
	  
	  $('.moreinfo').css({'opacity':'0.85'});
*/
	 

});