document.observe("dom:loaded",function(e){$$('nav a').each(function(element){var menu=$($A(element.classNames()).first()+"_menu");if(menu){menu.hide();element.observe('mouseover',function(e){link_item=$A(Event.element(e).classNames());show_drop(menu,link_item.first());});}});});function show_drop(drop_div,button_class){$$('nav a.'+button_class).each(function(e){button=e.identify();button_width=$(button).getWidth();button_height=$(button).getHeight()-1;});$$('div.drop').each(function(e){e.hide();e.setStyle({position:'absolute'});e.clonePosition(button,{setLeft:true,setTop:true,setWidth:false,setHeight:false,offsetLeft:0,offsetTop:button_height+1});});$$('a.active').each(function(e){e.removeClassName('active');});$(drop_div).show();$(drop_div).observe('mouseout',function(){clearTimeout(document.timer);document.timer=setTimeout(function(){$(drop_div).hide();$(button).removeClassName('active');},500);});$(drop_div).observe('mouseover',function(){$(drop_div).show();$(button).addClassName('active');clearTimeout(document.timer);});$(button).observe('mouseout',function(){clearTimeout(document.timer);document.timer=setTimeout(function(){$(drop_div).hide();$(button).removeClassName('active');},500);});$(button).observe('mouseover',function(){$(drop_div).show();$(button).addClassName('active');clearTimeout(document.timer);});}
