/**
* Source.........: $HeadURL: http://webextra.startcms.nl/svn/regma2/trunk/htdocs/javascript/dropdown_menu.js $
* Project........: REGMA
* Last Modified..: $LastChangedDate: 2011-06-13 17:59:05 +0200 (ma, 13 jun 2011) $
* SVN Revision...: $LastChangedRevision: 404 $
*/

var DropDownMenu = Class.create();

DropDownMenu.prototype = {

 initialize: function(menuElement) {
	menuElement.childElements().each(function(node){
		// if there is a submenu
		var submenu = $A(node.getElementsByTagName("div")).first();
		if(submenu != null){
            // var submenu = oUL.ancestors()[0];
			// make sub-menu invisible
			Element.extend(submenu).setStyle({display: 'none'});
			// toggle the visibility of the submenu
			node.onmouseover = function(){
				// setTimeout(function(){Element.show(submenu);},1000);
				Element.show(submenu);
			}
			node.onmouseout = function(){
				// setTimeout(function(){Element.hide(submenu);},500);
				Element.hide(submenu);
			}
		}
	});
}

};
