/*--- accordion function ---*/
function initAccordion(_hold){
	$(_hold).each(function(){
		var _list = $(this).children();
		var _a = _list.index(_list.filter('.active:eq(0)'));
		_list.removeClass('active');
		if(_a != -1) _list.eq(_a).addClass('active');
		_list.each(function(_i){
			var _el = $(this);
			this._btn = _el.children('a');
			this._box = _el.children('div');
			if(this._btn.length && this._box.length){
				this._h = this._box.height();
				if(_i == _a) this._box.show();
				else this._box.hide();
				/*this._btn.click(function(){
					if(_a != -1){
						_list.get(_a)._box.stop().animate({height: 0}, 400, function(){
							$(this).css({display: 'none', height: 'auto'}).parent().removeClass('active');
						});
					}
					if(_a != _i){
						_list.eq(_i).addClass('active');
						if(_list.get(_i)._box.is(':hidden')){
							_list.get(_i)._box.show();
							_list.get(_i)._h = _list.get(_i)._box.height();
							_list.get(_i)._box.height(0);
						}
						_list.get(_i)._box.stop().animate({ height: _list.get(_i)._h}, 400, function(){
							$(this).height('auto');
						});
						_a = _i;
					}
					else{
						_a = -1;
					}
					if(_a <0) {
						return false;
					}
				});*/
			}
		});
	});
}
$(document).ready(function(){
	//$('#menu li.active:last').parents('li').addClass('active');
	//initAccordion('#menu, #menu ul');
});
