﻿
var temp_bar ;

$(function(){
	// 幫 #menu li 加上 hover 事件
	$('#menu_bar li').mouseover(function(){
		// 先找到 li 中的子選單
		var _this = $(this),
			_subnav = _this.children('ul');
 
 		if(temp_bar != null ){
 		temp_bar.css('backgroundColor', '').children('ul').css('display', 'none');
 		}
 
		// 變更目前母選項的背景顏色
		// 同時顯示子選單(如果有的話)
		//_this.css('backgroundColor', '#06c');
		_subnav.css('display', 'block');
		temp_bar = _this;
	} );
 
	// 取消超連結的虛線框
	$('a').focus(function(){
		this.blur();
	});
});


function showMenu(id){
	var obj = $(id);
	var total= obj.length;
	//alert(total);
	obj.show();
}

function hideMenu(id){
	var obj = $(id);
	var total= obj.length;
	//alert(total);
	obj.hide();
}


