//jQuery(document).ready(function(){ 
////	jQuery("#slidingTopContent").hide();
////	
////	jQuery("#slidingTopTrigger").live("click", function(event) {
////        jQuery("#slidingTopContent").slideToggle("slow", function(){
////			    if (jQuery("#slidingTopContent").is(":visible")) {
////				    jQuery("#slidingTopTrigger").removeClass("down");
////				    jQuery("#slidingTopTrigger").addClass("up");
////			    } else {
////			      jQuery("#slidingTopTrigger").addClass("down");
////				    jQuery("#slidingTopTrigger").removeClass("up");
////			    }
////        });
////    });

//jQuery(".collection").live("mouseover", function(event) {
//    element = jQuery(this).attr("id");
//    if(element != selectedCollection) {
//        jQuery("#ul" + selectedCollection.substring(1, selectedCollection.length) + "_Sub").removeClass("shown");
//        jQuery("#ul" + element.substring(1, element.length) + "_Sub").addClass("shown");
//      jQuery("#" + selectedCollection).removeClass("selected");
//      jQuery("#" + element).addClass("selected");
//      selectedCollection = element;
//    }
//  });
//});

$(document).ready(function() {
    //$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled - Adds empty span tag after ul.subnav
    $("ul.topnav li a").hover(function() { //When trigger is clicked...
        //Following events are applied to the subnav itself (moving subnav up and down)
        if (jQuery(this).attr("id") != "") {
            $("li.topnavliselect").removeClass("topnavliselect");
            $(this).parent().addClass("topnavliselect");
        }
        $(this).parent().find("ul.subnav").css("zIndex", "99995");
        $(this).parent().find("ul.subnav li").css("zIndex", "99996");
        $(this).parent().find("ul.subnav li a").css("zIndex", "99997");
        $(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click
        $(this).parent().hover(function() {
        }, function() {
            $(this).parent().find("ul.subnav").slideUp('fast'); //When the mouse hovers out of the subnav, move it back up
        });
        //Following events are applied to the trigger (Hover events for the trigger)
    }).hover(function() {
        $(this).addClass("subhover"); //On hover over, add class "subhover"
    }, function() {	//On Hover Out
        $(this).removeClass("subhover"); //On hover out, remove class "subhover"
    });
});

