$(document).ready(function() {

    //Hide menus to support those without Javascript on
    $("#rightColumn p").css("display", "none");
    $("#rightColumn h2").css("margin-bottom",0);

    $("#rightColumn h2").click(function () {
    	$("#rightColumn h2.active").removeClass("active");
    	$(this).addClass("active");
        //Get Button "name" attribute value
        var title = $(this).attr("title");
        
        //Test if user clicked the same button
        //Hide menu if its clicked while open
        if($("#rightColumn p[title="+title+"]").hasClass("on")){
            $("#rightColumn p.on").slideUp("normal").removeClass("on")
            $("div.banner").slideDown("normal");
            $("div#rightList").fadeIn();
            $("h2.blank").fadeIn();
            $("#rightColumn h2.active").removeClass("active");

        }else{
            //Find previously opened div
            $("#rightColumn p.on").hide().removeClass("on");
            
            $("#rightColumn ul").addClass("up");
            $("div.banner").slideUp("normal");
            $("div#rightList").fadeOut();
            $("h2.blank").fadeOut();
            $("#leftList").removeClass("border");

            //Find div by variable "title" and show div and add "class"="no"
            $("#rightColumn p[title="+title+"]").slideDown("normal").addClass("on");
        }
        
    });

});
