$(document).ready(function(){
	
	// setting tooltip
	$('.tTip').betterTooltip({speed: 150, delay: 0});
	
	// setting fancybox
	$("a.screenshot").fancybox({ 
 		'zoomSpeedIn': 300, 
 		'zoomSpeedOut': 300,
 		'zoomOpacity': true,
 		'overlayOpacity': 0.5, 
 		'overlayShow': true 
 	}); 
 	
 	// pulsante back to top
 	$('.backtotop').click(function(){
		$('html, body').animate({scrollTop:0}, 'slow');
	});

	// link servizi homepage	
      $('.servizi li').biggerlink(); 

}); 

//animazione bookmark
$(function(){
	$('.bookmark a')
		.css( {backgroundPosition: "0 -35px"} )
		.mouseover(function(){
			$(this).stop().animate(
				{backgroundPosition:"(0 0px)"}, 
				{duration:150})
			})
		.mouseout(function(){
			$(this).stop().animate(
				{backgroundPosition:"(0 -35px)"}, 
				{duration:150})
			})
});	

// Hover blocco servizi home
$(function () {
    if ($.browser.msie && $.browser.version < 7) return;
    
    $('#home .servizi')
        .find('li')
        .append('<span class="fade" />').each(function () {
                var $span = $('> span.fade', this).css('opacity', 0);
                $(this).hover(function () {
                    $span.stop().fadeTo(300, 1);
                }, function () {
                    $span.stop().fadeTo(300, 0);
                });
            });
            
});

// visualizza icona hover portfolio
$(function () {
    if ($.browser.msie && $.browser.version < 7) return;    
    $('.progetto a.screenshot')
        .append('<span />').each(function () {
                var $span = $('> span', this).css('opacity', 0);
                $(this).hover(function () {
                    $span.stop().fadeTo(300, 1);
                }, function () {
                    $span.stop().fadeTo(300, 0);
                });
            });
 });  