// JavaScript Document
 $(document).ready(function(){
       
		//SWAPPING BOTTONI MACRO
		
		$("a[id^='"+thisP+"']").addClass("linkSwapped");

		
		
			//PRETTYPHOTO
			$("a[rel^='prettyPhoto']").prettyPhoto({
				animationSpeed: 'normal', /* fast/slow/normal */
			opacity: 0.80, /* Value between 0 and 1 */
			showTitle: true, /* true/false */
			allowresize: true, /* true/false */
			default_width: 500,
			default_height: 344,
			counter_separator_label: ' - ', /* The separator for the gallery counter 1 "of" 2 */
			theme: 'light_rounded', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
			hideflash: true, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
			wmode: 'opaque', /* Set the flash wmode attribute */
			autoplay: true, /* Automatically start videos: True/False */
			modal: false, /* If set to true, only the close button will close the window */
			changepicturecallback: function(){}, /* Called everytime an item is shown/changed */
			callback: function(){} /* Called when prettyPhoto is closed */

			});
			
			
			
			
			//Ancore interne
			
			//ANCORE sia su mappe immagine che su tag a

			$('area[href*=#]').click(function(event) {
								   
				event.preventDefault();
 				if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
   					var $target = $(this.hash);
   					$target = $target.length && $target   || $('[name=' + this.hash.slice(1) +']');
   					if ($target.length) {
  						var targetOffset = $target.offset().top;
  						$('html,body').animate({scrollTop: targetOffset}, 800);
    					return false;
   					}
 				}
  			});
			
			$('a[href*=#]').click(function(event) {
								   
				event.preventDefault();
 				if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
   					var $target = $(this.hash);
   					$target = $target.length && $target   || $('[name=' + this.hash.slice(1) +']');
   					if ($target.length) {
  						var targetOffset = $target.offset().top;
  						$('html,body').animate({scrollTop: targetOffset}, 800);
    					return false;
   					}
 				}
  			});
			
			
		
	
	});
 
 
 
 


