// JavaScript Document
$(document).ready(function() {
    $("#men_top .sub").click(function() { 
        var curList = $("#men_top a.current").attr("rel");
        var $newList = $(this);
        var curListHeight = $("#submentop").height();
        $("#submentop").height(curListHeight);
        $("#men_top a").removeClass("current");
        var listID = $newList.attr("rel");
     
        if (listID != curList ) {
            $newList.addClass("current");
            $("#"+curList).fadeOut(300, function() {
                $("#"+listID).fadeIn();
                var newHeight = $("#"+listID).height();
                $("#submentop").animate({
                    height: newHeight
                });    
            });
        }  else{ 
		 $("#men_top  #ini").addClass("current");
		   $("#"+curList).fadeOut(300, function() {
                var newHeight = $("#"+listID).height();
                $("#submentop").animate({
                    height: 0
                });
            });
		}      
        return false;
    });
    $("#nav .sub2").click(function() { 
        var curList = $("#nav a.current").attr("rel");
        var $newList = $(this);
        var curListHeight = $("#submen").height();
        $("#submen").height(curListHeight);
        $("#nav a").removeClass("current");
        var listID = $newList.attr("rel");
     
        if (listID != curList ) {
            $newList.addClass("current");
            $("#"+curList).fadeOut(300, function() {
                $("#"+listID).fadeIn();
                var newHeight = $("#"+listID).height();
                $("#submen").animate({
                    height: newHeight
                });    
            });
            
        }  else{ 
		 $("#nav  #ini_n").addClass("current");
		   $("#"+curList).fadeOut(300, function() {
                var newHeight = $("#"+listID).height();
                $("#submen").animate({
                    height: 0
                });
            });
		}      
        return false;
    });
});

