
//****************************************************************
// Positionnement du pied de page 
//****************************************************************
function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
function setHeight() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentHeight = document.getElementById('global').offsetHeight;
			var footerElement = document.getElementById('foot');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight) >= 0) {
				footerElement.style.position = 'absolute';
				//footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
			}
			else {
				footerElement.style.position = 'static';
			}
		}
	}
}
window.onload = function() {
	setHeight();
}
window.onresize = function() {
	setHeight();
}



//****************************************************************
// Affichage des libellés de la boîte à outils 
//****************************************************************

/* sfHover = function() {
        if (document.getElementById('tools'))
                {
                var sfEls = document.getElementById('tools').getElementsByTagName("LI");
                for (var i=0; i<sfEls.length; i++) {
                        sfEls[i].onmouseover=function() {
                                this.className+=" sfhover";
                        }
                        sfEls[i].onmouseout=function() {
                        this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
                        }
                }
                }
}
if (window.attachEvent) window.attachEvent("onload", sfHover); */




//****************************************************************
// Affichage Carousel
//****************************************************************

// execute your scripts when the DOM is ready. this is a good habit 
//$(document).ready(function() {

 
    // initialize scrollable 
//    $("div.scrollable").scrollable({size: 3}).mousewheel().autoscroll({
//				steps: 1,
//				autoplay: true,  	
//			interval: 6000	
//			});	
 
//}); 

// wait until document is fully scriptable
/* $(function() { */

	// select #flowplanes and make it scrollable. use circular and navigator plugins
/*     $("div.scrollable").scrollable({size: 3}).autoscroll({
			steps: 1,
			autoplay: true,  	
			interval: 6000	

	});
}); */




$(document).ready(function() {

// initialize scrollable together with the autoscroll plugin
var root = $("#scroller").scrollable({size: 3, circular: true, mousewheel: true})
		.autoscroll({ 
			steps: 1, 
			autoplay: true,   	
			interval: 8000	
		})
		//.move(1);

// provide scrollable API for the action buttons
//window.api = root.data("scrollable");

	
});

//****************************************************************
// Affichage Overlay
//****************************************************************
$(function() {
	$("a[rel]").overlay({
		mask: '#FFFFFF',
		effect: 'apple',

		onBeforeLoad: function() {
			var wrap = this.getOverlay().find(".contentWrap");
			wrap.load(this.getTrigger().attr("href"));
		}

	});
});


