// JavaScript Document

function checkCancella(){
	var OK = window.confirm("Sicuro di voler cancellare?");
	if (OK) {
		return true;
	} else {
		return false;
	}
}

$(document).ready(function() 
{
   // Notice the use of the each method to gain access to each element individually
   $('a.prevSito').each(function()
   {
      // Create image content using websnapr thumbnail service
      var content = '<img src="http://images.websnapr.com/?size=S&key=2ao4FdXq79D1&url=';
      content += $(this).attr('href');
      content += '" alt="Loading thumbnail..." height="152" width="202" />';
      
      // Setup the tooltip with the content
      $(this).qtip(
      {
         content: content,
         position: {
            corner: {
               tooltip: 'bottomMiddle',
               target: 'topMiddle'
            }
         },
         style: {
			  padding: 0,
			  background: '#ff8d0d',
			  color: 'black',
			  textAlign: 'center',
			  border: {
				 width: 3,
				 radius: 0,
				 color: '#ff8d0d'
			  },
            tip: true, // Give it a speech bubble tip with automatic corner detection
            name: 'cream'
         }
      });
   });
});



function vedi (cosa){
	$('.contFooterPercorsi').each( function(){
		if(	$(this).css('display') == 'block'	){							
			//alert($(this).attr('id'));
			//$(this).css('display','none');
			$(this).toggle('blind', 800);
		}
											
	});
	if ($(cosa).css('display') == 'none'	) {
		$(cosa).toggle('blind', 800, scrolla);
	}
}
function scrolla(e) {
		$('html, body').scrollTo( $('#tabFooterPercorsi'),800 );
		//	$('html, body').animate({scrollTop: $('#pagina').height()}, 800);
		
}

$(document).ready(function() {
	$('.contFooterPercorsi a').click(function () {
			cont=($(this).parent().parent().parent().attr('id'));
			//alert(cont);
			$.cookies.set( 'clickPercorsi', cont );
		});
	var clickPercorsi = $.cookies.get( 'clickPercorsi' );
	if( clickPercorsi != 'undefined') {
		$('#'+clickPercorsi).show('blind', 800);
	}
});

$(document).ready(function()
{
   $('a.tipTitle[title]').qtip({
      position: {
         corner: {
            target: 'topRight',
            tooltip: 'bottomLeft'
         }
      },
      style: {
         name: 'cream',
         padding: '7px 13px',
         width: {
            max: 210,
            min: 0
         },
         tip: true
      }
   });
});
