$(document).ready(function(){
    $ = $ || jQuery;
    // loop over each item and set it up 
    // for our spiffy menu.
    $(".pagenav > ul > li > a").each(function(item, el){
        var $el = $(el),
            hasChildren = $el.next().length > 0;
            txt = !hasChildren ? "&nbsp;&nbsp;" : "+ ",
            origTxt = $el.html().slice(),
            spHtml = $("<span/>").addClass("fixed").html(txt);
        // set the text and put the class on the parent
        $el
            .prepend( spHtml )
            .parent().addClass("clickNavBlock");
        // if we're creating a drop down menu, then we'll need
        // to populate it with the present link.  This is bc 
        // there's a top level page for each of these categories.
        if (hasChildren){
            var list = $el.next(),
                tmpl = $(list.children()[0]).clone(),
                kid = $("<a/>");
            
            kid.attr('href', $el.attr('href'));
            kid.html(origTxt+ " Main Page");
            list.prepend( tmpl.html(kid) );
            $el.addClass("clickNavOpen");
        }
            
        
    });
    
    $(".clickNavOpen").click(function(ev){
        ev.preventDefault();   
        $(this).next().slideToggle("fast");
    });
    
    
});
