var Openmoomenu = new Class ({
		Implements : Options,
	 
		options : {
			delay: 1000,
			animate: {
				props: ['opacity','height'],
				options: {
					duration:500,
					fps: 100,
					transition: 'sine:out'
				}
			}
		},
	 
		initialize: function(container, options) {
			this.setOptions(options);
			this.container = document.getElement(container);
			this.titles = this.container.getChildren(); 
			this.open = '';
			this.titles.each(function(title){
					if(title.getElement('ul')){
						title.store('w',title.getElement('ul').getCoordinates(title).width);
						title.store('h', title.getElement('ul').getCoordinates(title).height);
						title.addEvent('mouseenter',function(title){
							if (this.open != ''){
								$clear(this.remove_d);
								this.open.removeClass('sfHover'); 
								this.open = '';
							}
							this.menu = title.getElement('ul');
							this.open = title;
							this.transitions = {};
							this.options.animate.props.each(function (prop) {
								this.menu.setStyle(prop,0);
								if (prop == 'opacity')
									this.transitions.opacity = 1; 
								if (prop == 'width')
									this.transitions.width = title.retrieve('w'); 
								if (prop == 'height')
									this.transitions.height = '30px';//title.retrieve('h'); 
							},this); 
							//title.addClass('sfHover');
							//this.menu.addClass('sfHover');
							this.menu.set('morph',this.options.animate.options);
							this.menu.get('morph').start(this.transitions);
					
					
					}.bind(this,title));
	 
					title.addEvent('mouseleave',function(title){
						this.remove_d = (function(){
							//title.removeClass('sfHover');
							this.open = '';
							this.menu = title.getElement('ul');
							//this.menu.set('morph',this.options.animate.options);
							//this.menu.set('morph', {duration: 'long', transition: 'bounce:out'});
							//this.menu.morph({'width':'0','opacity':'0'});
							this.menu.setStyle('opacity','0');
						}).delay(this.options.delay);
						
					}.bind(this,title)); 
					
					}
			},this);
		}
	});
