// 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;
   					}
 				}
  			});
			
			
			
			//$("#firstpane div.menu_head")
			
			/////////////////////////ROLLOVERS PAGINE SOLUZIONI
			//if ($("#nameSearch")) {

			
			if(thisP=="soluzioni"){
			
				if($("div[id^='"+subSoluzioni+"']")){
					
					//alert($("div[id^='"+subSoluzioni+"']"))
					//$(this).next().css({display:"block"})
					
					//$("div[id^='"+subSoluzioni+"'] div").css({display:"block"})
					
					
					$("div[id^='"+subSoluzioni+"']").remove();
					
					$("div[id^='c_"+subSoluzioni+"']").append('<img src=\"../modules/images/soluzioni/'+L+'/nav/b_'+subSoluzioni+'_f1.jpg" alt="" />');
					
					
				}//else{
					
				// find the div.fade elements and hook the hover event
				 $('div.fade').hover(function() {
					// on hovering over, find the element we want to fade *up*
					//
					//alert('ddd');
					//
				var fade = $('> div', this);
					
					// if the element is currently being animated (to a fadeOut)...
				if (fade.is(':animated')) {
					  // ...take it's current opacity back up to 1
					fade.stop().fadeTo(20, 1);
					
					
				} else {
					  // fade in quickly
					 fade.fadeIn(25);
				}
				}, function () {
					// on hovering out, fade the element out
					var fade = $('> div', this);
					if (fade.is(':animated')) {
					  fade.stop().fadeTo(300, 0);
					} else {
					  // fade away slowly
					  fade.fadeOut(300);
					}
				});
				  
			
			
		}
				
			//}
			
		
			
			
			
			
		
	
	});
 
 
 
 


