// JavaScript Document
function slideSwitch(timer) {
					var $active = $('#slideshow IMG.active');
					
					if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
					
					var $next =  $active.next().length ? $active.next()
					: $('#slideshow IMG:first');
					
					$active.addClass('last-active');
					
					$next.css({opacity: 0.0})
					.addClass('active')
					.animate({opacity: 1.0}, timer, function() {
					$active.removeClass('active last-active');
					});
					}
					
					$(function() {
					setInterval( "slideSwitch(1000)", 5000 );
					});

function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}

$(window).load(function() {
	
var p = $("#Footer_Fine");
var position = p.position();
if( getDocHeight() > position.top) {
	$("#Footer_Fine").height(getDocHeight() - position.top);
}


//alert( "Altezza pagina: " + getDocHeight() + ", Posizione: " + position.top + ",Differenza:" + (getDocHeight() - position.top));
});

$(function(){
$(window).resize(function(){
	$("#Footer_Fine").height(5);
	var p = $("#Footer_Fine");
	var position = p.position();
	
	if( getDocHeight() > position.top) {
		$("#Footer_Fine").height(getDocHeight() - position.top);
	}
});
});
