var t=0;

var subs = $$("#NavigationBar ul");

var fx = new Fx.Elements(subs,{duration:300,transition:Fx.Transitions.quadOut});

var hideobj = {};



subs.each(function(sub,i) { { hideobj[i] = { "height": 0 }; } });



$$("#NavigationBar").getElements("a")[0].addEvent("mouseover",function(e) {

	$clear(t);

	if (this.getParent().getParent().id=="NavigationBar") {

	  var obj = {};

	  var sub = this.getParent().getElement("ul");

		subs.each(function(other,i){

		  if (other==sub) { obj[i] = { "height": sub.getSize().scrollSize.y }; }

			else { obj[i]={"height":0}; }

		});

		fx.start(obj);

	}

});



$$("#NavigationBar").getElements("a")[0].addEvent("mouseout",function(e) {

	t = function() { fx.start(hideobj);}.delay(500);

});
