$(document).ready(function(){

	//   Slide the login box up and down
	$("a#slidein").click(function(){ $("div#loginWrap").find("div#loginBox:hidden").slideDown("slow"); $("div#loginExpand").hide(); $("div#loginContract").show(); });
	$("a#slideout").click(function(){ $("div#loginWrap").find("div#loginBox:visible").slideUp("slow"); $("div#loginContract").hide(); $("div#loginExpand").show(); });
	$("div#loginContract").hide();
	$("div#loginBox").hide();
	
	//   Left-hand accordion menu
	if ($('#themenu').size() != 0)
	{
        $('#themenu').Accordion({
            active: 'span.selected',
            header: 'span.menuarrow',
            pagetitle: 'span.menuhead',
            alwaysOpen: false,
            animated: true,
            showSpeed: 400,
            hideSpeed: 800
        });
        $("div#themenu li ul").show();
    }
	/* fixes for if there is no js to hide unneeded things in the left col with css */
	$("div#loginExpand").show();
	 
	if ($('#leftNav').size() != 0) {
		$("ul.leftNavSectionOpened li a").mouseover(function(){ 
	    	$(this).parent("li").addClass("active"); 
		}); 
		 
		$("ul.leftNavSectionOpened li a").mouseout(function(){ 
		    $(this).parent("li").removeClass("active"); 
		}); 
	}
	
});