	var topMenu;
	
	function showMenu(menu){
		var h = parseFloat(document.getElementById(menu).scrollHeight);
		if(Element.getHeight(menu) != 30) return;
		new Effect.ResizeTo('navi_brands', {toSize:30});
		new Effect.ResizeTo('navi_categories', {toSize:30});
		new Effect.ResizeTo(menu, {toSize:h, delay:1.1});
	}
	
	function changeSex(sex){
		if(Element.hasClassName('option_content_' + sex, 'on')) return;
		if(document.getElementById("side_brands_mens")) Element.hide("side_brands_mens");
		if(document.getElementById("side_brands_womens")) Element.hide("side_brands_womens");
		if(document.getElementById("side_category_mens")) Element.hide("side_category_mens");
		if(document.getElementById("side_category_womens")) Element.hide("side_category_womens");
		var otherone = (sex=='mens') ?  'womens' : 'mens';
		Element.addClassName('option_content_' + sex, 'on');
		topMenu = (parseFloat(document.getElementById('navi_brands').style.height)>30) ? 'navi_brands' : 'navi_categories';
		new Effect.Fade(otherone+'_brands');
		new Effect.Fade(otherone+'_category', {afterFinish:swapBrandCategory});
		if(Element.hasClassName('option_content_' + otherone, 'on')) Element.removeClassName('option_content_' + otherone, 'on');
		if(parseInt(Element.getStyle('navi_sub_categories', 'left')) == 0){
			Element.setStyle('navi_brands', {height:'30px'});
			Element.setStyle('navi_categories', {height:'30px'});
			previousMenu();
		} else {
			new Effect.ResizeTo('navi_brands', {toSize:30});
			new Effect.ResizeTo('navi_categories', {toSize:30});
			 if(parseInt(Element.getStyle('sidebar', 'top'))==0) new Effect.Move('sidebar', {y:-570, duration:2});
		}
		new Effect.Appear(sex+'_brands', {delay:0.8});
		new Effect.Appear(sex+'_category', {delay:0.8});
	}
	
	function swapBrandCategory(){
		var h = parseFloat(document.getElementById(topMenu).scrollHeight);
		new Effect.ResizeTo(topMenu, {toSize:h, delay:0.2});
	}
	
	function previousMenu(){
		new Effect.Move('navi_brands', {x:167});
		new Effect.Move('navi_categories', {x:167});
		if(isIE){
			var _y = parseFloat(Element.getStyle('navi_left_menu', 'height')) - parseFloat(Element.getStyle('navi_sub_categories', 'height'));
			Element.setStyle('navi_sub_categories', {top:_y+'px'});
		} 
		new Effect.Move('navi_sub_categories', {x:167});
	}
	
	function nextMenu(){
		new Effect.Move('navi_brands', {x:-167});
		new Effect.Move('navi_categories', {x:-167});
		new Effect.Move('navi_sub_categories', {x:-167});
	}