// Fonctions de mise en page avec lib Mootools

window.addEvent('domready', function() {

	//infobulle
	var Tips2 = new Tips($$('.Tips2'), {
		initialize:function(){
			this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 200, wait: false}).set(0);
		},
		onShow: function(toolTip) {
			this.fx.start(1);
		},
		onHide: function(toolTip) {
			this.fx.start(0);
		}
	});
	
	
	
	if (document.getElementById('schema_produit'))
	{	
		
		var headings = $$('#schema_produit div.texte_bulle_categorie');
		var list = $$('#schema_produit div.liste_produits');
		var spans = new Array();	
		var collapsibles = new Array();	
		
		// Workaround for Safari 2.0
		if (window.webkit419) {
		  end = 0.9999;
		} else {
		  end = 1;
		}	
		
		headings.each( function(heading, i) {
			var collapsible = new Fx.Styles(list[i],  {duration:250,  transition: Fx.Transitions.linear});
			collapsibles[i] = collapsible;
			heading.onmouseover = function(){
				
				for(var j = 0; j < collapsibles.length; j++){
					if(j!=i) {
						collapsibles[j].set({'opacity':0});
					}
					else
					{
						collapsibles[j].set({'opacity':1});
					}
				}
				return false;
			}
			heading.onmouseout = function(){
			}
			collapsible.set({'opacity':0});
			
		});	
	
	}



});
