jQuery.noConflict();

/*
//jQuery(document).ready(initPage);
Event.observe(window, 'load', initPage, false);Event.observe(window, 'load', initPage, false);

function initPage(){
/*
resizeWindow();

}
*/


/************************************************************************************
*									Gestion de la taille de la fenêtre
************************************************************************************/
/*
function resizeWindow(){ 	
	if ( $("background_container").getHeight() > ($("global_container").getHeight()) ) {
		Element.setStyle("footer_container",{top: ($("background_container").getHeight()-$("global_container").getHeight()-$("footer").getHeight())+"px"});	

	}

}

onresize = resizeWindow;
*/

/************************************************************************************
*									Accordion
************************************************************************************/


function initAccordionMenu(selected_id, id){
	jQuery(function() {
		if(jQuery("#"+id)) {
			jQuery("#"+id).accordion({
				event: "click", 
				collapsible: false,
				autoHeight: false,
				active: selected_id,
				navigation: true
			});
		}
	});
}

/************************************************************************************
*									Easy Slider
************************************************************************************/



(function($) {
	$(document).ready(function() {
		var overflowShadowBox = function() {
			$.each($('.div_reg'), function(index, value) {
				$(value).css('overflow', 'hidden');
			});

			window.setTimeout(overflowShadowBox, 200);
		}

		overflowShadowBox();
	

		$.each($('img'), function(index, value) {
			(function(value) {
				if($(value).hasClass('span-5') || $(value).hasClass('span-7')) {
					$(value).bind('error', function() {
						$(value).attr('src', '/images/rien.gif');
						$(value).css('height', 60);	
					});
				}
			})(value);
		});

		var position_footer = function() {
			var pfooter = $('#background_black_footer').position().top;
			var pchecker = $('#helper-footer').position().top;
			
			if(pchecker > pfooter + $('#background_black_footer').height()) {
				$('#background_black_footer').css({
					'position': 'fixed',
					'bottom': 0,
					'width': '100%'
				});
			}	
			else {
				$('#background_black_footer').css({
					'position': 'normal'
				});
			}
		}

		var position_footer2 = function() {
			$('#slide_container').css({
				//'position': 'absolute',
				//'top': $('#background_black_footer').position().top + 50,
				//'left': $('#slide_container').position().left
			});

			$('#slide_container #slide').css({
				/*'position': 'absolute',
				'top': $('#slide_container ').position().top,
				'left': 235*/
			});
			
			window.setTimeout(position_footer2, 1);
		}
		
		position_footer();
		position_footer2();

		jQuery("#slider").easySlider({
			auto: true, 
			continuous: true
		});
	});
})(jQuery);

