    $(document).ready(function() {
        
		dropdown('#menu_principale ul');
		dropdown('#colonna_sx ul');
		
		if ( $('#slider-home, #slider-home_interna ').length )
		{
			$('#photos').cycle({
				allowPagerClickBubble: true,
				fx: 'fade',
				speed: 500,
				timeout: 7000,
				pager: '#menu_slide ul',
				pagerEvent: 'mouseover',
				pause: 1,
				pauseOnPagerHover: 1, 
				pagerAnchorBuilder: function(idx, slide) {
					return $('#menu_slide ul li:eq('+idx+')');
				} 
			});
		}

	/*	
		if ( $('#photos-sr').length )
			{
				$('#photos-sr').cycle({
					allowPagerClickBubble: true,
					cleartypeNoBg:  true, //ie7,8
					fx: 'fade',
					speed: 500,
					timeout: 5000,
					pager: '#paginazione-sr ul',
					//pagerEvent: 'mouseover',
					pause: 1,
					pauseOnPagerHover: 1, 
					pagerAnchorBuilder: function(idx, slide) {
						return $('#paginazione-sr ul li:eq('+idx+')');
					} 
			})
			}
			
		*/
		
        if ( $('#map').length > 0 ) {
		
			showmaps();
			
		}
		
		$("a[rel='showgallery']").click(function() {							 
		var imago = $(this).find('.imagegall').attr("src");
		var alto = $(this).find('.imagegall').attr("title");
		imago = imago.replace('w=110', 'w=634');
		imago = imago.replace('h=85', 'h=424');
		$('#mainPic').stop().animate({opacity:'0.2'},function(){
		$(this).attr('src',imago+'?'+Math.floor(Math.random()*(10*100)));
		$(this).attr('title',alto);
		$(this).attr('alt',alto);
		
		}).load(function(){
		$(this).stop().animate({opacity:'1'});
		});
		$("#didascalia").html(alto);
		return false;
		});	
		
		$("#photogallery ul").carouFredSel({
			auto: true,							   
			items: 4,
			prev: "#prev",
			next: "#next",
			scroll: {duration:800, items:4}
		});
		
		$(".open-box").each(function(i){
		
			$(this).click(function() {
				$('.select_lingua').slideToggle('fast');
			
				/*if( $('.select_lingua').hasClass('opened') ) {
			   
				   	$('.select_lingua').fadeOut('slow');
			   
				} else {
				
					$('.select_lingua').fadeIn('slow');
					$("#bn-close-l").click();					   
				}*/
				return false;
				
			});
				  
		});
		
		
    });
	
	
