/*
var MyFXMenuCommercials = new Fx.Slide('liste_commercials');

//var myVerticalSlide = new Fx.Slide('vertical_slide');
var MyFXMenuMusic_Video = new Fx.Slide('liste_music_video');

var MyFXMenuPhoto_Shoot = new Fx.Slide('liste_photo_shoot');

var MyFXMenuShort_Films = new Fx.Slide('liste_short_films');

var MyFXMenuIdealger = new Fx.Slide('list_idealger');
//alert('MyFXMenuCommercials');


//var MyFXMenuGraphiste = new Fx.Slide('liste_graphiste');

MyFXMenuMusic_Video.hide();
MyFXMenuCommercials.hide();
MyFXMenuPhoto_Shoot.hide();
MyFXMenuIdealger.hide();
MyFXMenuShort_Films.hide();
//MyFXMenuGraphiste.hide();



 $('commercials').addEvent('click', function(e){
 e.stop();
  MyFXMenuPhoto_Shoot.slideOut();
 MyFXMenuMusic_Video.slideOut();
  MyFXMenuShort_Films.slideOut();
 //MyFXMenuGraphiste.slideOut();
 MyFXMenuCommercials.toggle();
 });
 
 $('music_video').addEvent('click', function(f){
 f.stop();
 MyFXMenuPhoto_Shoot.slideOut();
 MyFXMenuCommercials.slideOut();
  MyFXMenuShort_Films.slideOut();
 //MyFXMenuGraphiste.slideOut();
  MyFXMenuMusic_Video.toggle();
 });
 
 $('photo_shoot').addEvent('click', function(e){
 e.stop();
  //MyFXMenuPhoto_Shoot.slideOut();
 MyFXMenuCommercials.slideOut();
  MyFXMenuMusic_Video.slideOut();
  MyFXMenuShort_Films.slideOut();
  //MyFXMenuGraphiste.slideOut();
 MyFXMenuPhoto_Shoot.toggle();
 });
 
 $('short_films').addEvent('click', function(e){
 e.stop();
  //MyFXMenuPhoto_Shoot.slideOut();
	 MyFXMenuCommercials.slideOut();
 MyFXMenuMusic_Video.slideOut();
 MyFXMenuIdealger.slideOut();
 MyFXMenuPhoto_Shoot.slideOut();
 
  MyFXMenuShort_Films.toggle();
 
 });
 
 $('menu_idealger').addEvent('click', function(e){
 e.stop();
 
 
 MyFXMenuIdealger.toggle();
  MyFXMenuCommercials.slideOut();
 MyFXMenuMusic_Video.slideOut();
  MyFXMenuPhoto_Shoot.slideOut();
   MyFXMenuShort_Films.slideOut();
});


 */
 window.addEvent('domready', function() { 
				
		$$('div[class=rubrique_slider]').each(function(container){
			
			var containerFx = new Fx.Slide(container).hide();
		});	
		
		$$('div[id$=_slidering]').each(function(container){
			var id = container.get('liste');
			//alert(id);
			container.addEvent('click', function(e){
				e.stop();
				
				//alert("C" + container.get('liste'));
				$$('div[class=rubrique_slider]').each(function(other_container){
					
					if(other_container.get('liste') != container.get('liste')){ 
						var other_id = other_container.get('liste');
					//	alert(other_container);
						var other_containerFx = new Fx.Slide($('liste_'+other_id)).slideOut();
					}
				});
				
				var containerFx = new Fx.Slide($('liste_'+id)).toggle().chain(function(){
				    //alert("toggled !!"); //Alerts true.
				    toggleFadingOtherInformation();
				});
				    //chain(toggleFadingOtherInformation());
				//alert(container.retrieve('slide'));
				
				
				
				
				
			});
		});	
		 if($('other_information')){
			 $('other_information').addEvent('mouseover', function(e){
				 $('other_information').fade(1);
			 });
		 }
		
			
			
			
}, 'javascript'); 
 
/*
 * $('element').getPosition(); // returns {x: 100, y: 500};
 */ 
 
 /*
  * var size = myElement.getSize();
	alert('The element is ' + size.x + ' pixels wide and ' + size.y + 'pixels high.');
  */
 
 
function toggleFadingOtherInformation(){
	 if($('other_information')){
		 var y_navigation = $('navigation').getPosition().y;
		 //alert('y_nav : ' +y_navigation );
		 var height_nav = $('navigation').getSize().y;
		// alert('h_nav : ' +height_nav );
		 var y_other = $('other_information').getPosition().y;
		 //alert('h_nav : ' +height_nav + ', y_nav : ' +y_navigation  + "total : " +(y_navigation + height_nav) + ',y_other : ' +y_other);
	
		//if($('other_information').get('visible') == "false" || $('other_information').get('visible') ==""){
		 if(y_navigation + height_nav < y_other){
		
			$('other_information').fade(1);
			$('other_information').set('visible', 'true');
		}else{
			$('other_information').fade(0);
			$('other_information').set('visible', 'false');
		}
	
			
	}
	 
}	 
 
