/*
window.addEvent('domready', function() {
	//-vertical

	var myVerticalSlide = new Fx.Slide('ssRub', {transition: Fx.Transitions.Sine.easeIn , link: 'cancel' });

	$('ssRub').setStyle('margin', '0 auto');

	var actif = $('products').className; //alert (actif);
	if (actif != 'activeRub') { //gestion de la réouverture, on masque ceux qui ne sont pas actifs
		myVerticalSlide.hide(); 
		$('ssRub').setStyle('opacity', '0');
	} 


	$('products').addEvent('mouseover', function(e){
		e.stop();
		myVerticalSlide.slideIn();
		$('ssRub').morph({ 'opacity': '1' });
	});

	$$('.productOff').each(function(el) {
		el.addEvent('mouseover', function(e){
			e.stop();
			myVerticalSlide.slideOut();
			$('ssRub').morph({ 'opacity': '0' });
		});
	});
});
*/



 
window.addEvent('domready', function() {
    //Some Startvars
    //Left Position of your open "tv"-Div
    var OpenPos = '128px';
   
    //Left Position of your close "tv"-Div the Arrows are visible
    var ClosePos = '61px';
   
    //Open-Close-Status
    var Open = false;
 
   //Use the FX.Tween for the Movement not SlideIn/Out
   var myFx = new Fx.Morph($('ssRub'), {duration: 'normal', wait: false});
 
   //Begin with the open "tv"-DIV
   $('ssRub').setStyles({
     //height: 0,
     opacity: 0
     //top: ClosePos
   });
 
    //Text-Buttons (Rein/Raus) Delete this if you delete the Text
    //Close the "tv"-Div if it is open
	$('products').addEvent('mouseover', function(e){
        e.stop();
        if(!Open)
		{
		  myFx.start({
			'opacity':[0,1]
			//'height':["0","100%"]
			//'top': [ClosePos, OpenPos]
			//'position': ["absolute", "relative"],
			//'margin': ['0 auto','0']
		  });
		  Open = true;
		}
    });
 
  //Open the "tv"-Div if it is closed
	$$('.productOff').each(function(el) {
		el.addEvent('mouseover', function(e){
			e.stop();
			if(Open)
			{
		  myFx.start({
			'opacity':[1,0]
			//'height':["100%","0"]
			//'top': [OpenPos, ClosePos]
			//'position': ["relative", "absolute"],
	 		//'margin': ['0','0 auto']
		  });
			  Open = false;
			}
		});
    });
   
   
});
 
