// JavaScript Document

// gallery var
var sliderHeight = "189px";
var defHeight = "408px"; 

$(document).ready(function(){
	// gallery						   
$(".gallery").css("height", sliderHeight);
$("#carousel ul").animate({top: "-100px"}, {duration: "slow" });
$(".slider_menu").html('<div class="open"><a href="#">View gallery</a></div>');
$(".slider_menu a").click(function() { openSlider() })	
	// inizio menu
	$(".services").removeClass("sub"); 
	$('.full_hide').hide();
	$('.button_head').click(function(){
		$('.button_head').slideUp('fast');
		if ( $('.full_hide').is(":hidden"))
			$('.full_hide').slideDown("slow");
		else{
			$('.full_hide').slideUp('slow');}
		})
	$('.close').click(function(){$('.full_hide').slideUp('fast'); $('.button_head').slideDown("slow") })
	// fine menu
	

		
		// inizio gallery
		$('#carousel').infiniteCarousel();
		// fine gallery
		

// overlay
$("a[rel^='prettyPhoto']").prettyPhoto({theme:'light_rounded'});

// scroll offerte
$("#scrolloffers").scrollable({size: 1, clickable: false}).navigator(".navig");
		
});

// funzioni slider gallery
function openSlider()
 
{
    $(".gallery").animate({"height": defHeight}, {duration: "slow" });
	$("#carousel ul").animate({top: "0"}, {duration: "slow" });
    $(".slider_menu").html('<div class="close"><a href="#">Reduce</a></div>');
    $(".slider_menu a").click(function() { closeSlider() })
}
 
function closeSlider()
 
{
    $(".gallery").animate({"height": sliderHeight}, {duration: "slow" });
    $(".slider_menu").html('<div class="open"><a href="#">View gallery</a></div>');
    $(".slider_menu a").click(function() { openSlider() })
	$("#carousel ul").animate({top: "-100px"}, {duration: "slow" });
}




