// Tabs
$(function() {
	$("ul.tabs").tabs("div.panes > div");
});

// Subtabs
$(function() {
	$("ul.sub_tabs").tabs("> .sub_pane");
});

// Toggle
$(document).ready(function(){

	//Hide (Collapse) the toggle containers on load
	$(".toggle_container").hide(); 

	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	$(".trigger").click(function(){
		$(this).toggleClass("active").next().slideToggle("slow");
		return false; //Prevent the browser jump to the link anchor
	});

});

// Expose
$(function() {

	// assign a click event to the exposed element, using normal jQuery coding
	$(".containerEpix").click(function() {

		// perform exposing for the clicked element
		$(this).expose({
			opacity: 0.9,
			color: '#000'
		});

	});
});

// Corner
$(function() {
    $('#corner img').hover(function() {
        $(this).stop().animate({ width:'175px', height:'175px' });
    }, function() {
        $(this).stop().animate({ width:'70px', height:'70px' });
    });
});

// Scroll to top
$(function(){
	$(window).scroll(function(){
		var wh = $(window).height();
		if($(window).scrollTop()!= 0)
		{
			if($("#scrollToTop").length==0)
			$("body").append('<div id="scrollToTop"><a href="javascript:void(0)" title="Retourner en haut de la page">Retourner en haut de la page</a></div>');
			$("#scrollToTop").fadeIn("fast");    
		}
		else
		{
			$("#scrollToTop").fadeOut("fast");
		}
		var a=document.body.scrollHeight-wh-100;
		if($(document).scrollTop()>=a)
		$("#scrollToTop").addClass("stopFixed");
		else
		$(".stopFixed").removeClass("stopFixed")
	});
	$("#scrollToTop a").live("click",function(a){
		a.preventDefault();
		$("html,body").animate({scrollTop:0},"slow")
	})
});
