/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
var Awf=$merge({DropMenu:new Class({version:1.5,Implements:[Options,Events],options:{onOpen:function(el){el.set('opacity',1)},onClose:function(el){el.set('opacity',0)},onInitialize:function(el){el.set('opacity',0)},mouseoutDelay:200},initialize:function(menu,options,level){this.setOptions(options);if($type(level)=='number'){this.menu=menu;this.fireEvent('initialize',menu);this.menu.pel.addEvents({mouseover:function(){this.menu.pel.mel.store('DropDownOpen',true);this.fireEvent('open',this.menu.pel.mel);$clear(this.timer)}.bind(this),mouseout:function(){this.menu.pel.mel.store('DropDownOpen',false);this.timer=(function(){if(!this.menu.pel.mel.retrieve('DropDownOpen'))this.fireEvent('close',this.menu.pel.mel)}).delay(this.options.mouseoutDelay,this)}.bind(this)})}else{level=0;this.menu=$(menu)};this.menu.getChildren('li').each(function(item,index){var list=item.getFirst('ul');if($type(list)=='element'){item.mel=list;list.pel=item;new Awf.DropMenu(list,options,level+1)}})},toElement:function(){return this.menu}})},Awf||{});Element.implement({dropMenu:function(options){new Awf.DropMenu(this,options);return this}})
