jQuery.noConflict();

jQuery(document).ready(function() {
	// make the menu work
	jQuery(".dropdown_menu").hide();
	jQuery("#btn_About").mouseover(function(){showLayer('menu_about',this)}).mouseout(btnTimer).css('position','relative');
	jQuery("#btn_Events").mouseover(function(){showLayer('menu_events',this)}).mouseout(btnTimer).css('position','relative');
	jQuery("#btn_Kitchen").mouseover(function(){showLayer('menu_kitchen',this)}).mouseout(btnTimer).css('position','relative');
});

var menuActive = 0;
var menuOn = 0;
var onLayer;
var timeOn = null;
var current = null;

function showLayer(layerName,parent){
	if (timeOn != null) {
		clearTimeout(timeOn);
		hideLayer(onLayer);
	} onLayer = layerName;
	var opts = {margin:true,border:true,padding:true,scroll:true,lite:false}
	var aligner = jQuery(parent);
	current = aligner;
	aligner.css({backgroundColor:'#CC6633',color:'#FFFFFF'});
	var offset = aligner.offset({padding:true,margin:true,borders:true});
	offset.top += aligner.parent().height()-1;
	//offset.width = aligner.parent().width();
	jQuery("#"+layerName).css(offset).show();
}
function hideLayer(layerName) {
	if (menuActive == 0) {
		jQuery("#"+layerName).hide();
	}	if(current) {
		current.css({backgroundColor:'transparent',color:'#000000'});
		current = null;
	}
}
function btnTimer() {timeOn = setTimeout("btnOut()",600);}
function btnOut(layerName){if (menuActive == 0) {hideLayer(onLayer);}}
function menuOver() {clearTimeout(timeOn); menuActive = 1;}
function menuOut() {menuActive = 0; timeOn = setTimeout("hideLayer(onLayer)", 100);}
