﻿jQuery(document).ready(function () {

    jQuery("ul.static").each(function () {
        if (!jQuery(this).hasClass("root")) {
            jQuery(this).children("li:first").addClass("first-nav");
            jQuery(this).children("li:last").addClass("last-nav");
        }
    });

    jQuery(".accordion .acc-title").each(function () {
        if (!jQuery(this).hasClass("acc-default")) {
            jQuery(this).removeClass("acc-active");
            jQuery(this).next(".acc-content").hide();
        }
    });

    jQuery(".accordion .acc-title").click(function () {
        if (jQuery(this).hasClass("acc-active")) {
            jQuery(this).removeClass("acc-active");
            jQuery(this).next(".acc-content").hide();
        }
        else {
            jQuery(this).addClass("acc-active");
            jQuery(this).next(".acc-content").show();
        }
    });

    // this is our Google analytics stuff for pdf downloads.
    jQuery("a[href$='pdf']").each(function () {
        var largePath = jQuery(this).attr("href");
        jQuery(this).attr("onclick", "javascript: pageTracker._trackPageview('" + largePath + "');");
    });	
});