﻿
//*************************************************//
//** Author: Ian Howden                          **//
//** Copyright: 2000-2011 Pelorus Methods, Inc.  **//
//*************************************************//

jQuery(document).ready(function() {
    InitializeTopics();
    RequestedTopic();
});

function InitializeTopics() {
    jQuery(".Topics a").each(function(index) {
        jQuery(this).click(function() {
            var ID;

            jQuery(".Topics a").each(function(index) {
                jQuery(this).removeClass("Active");

                ID = ("." + jQuery(this).attr("id"));
                jQuery(ID).css('display', 'none');
            });

            jQuery(this).addClass("Active");

            ID = ("." + jQuery(this).attr("id"));
            jQuery(ID).css('display', 'block');
        });
    });
}

function RequestedTopic() {
    var topic = UrlParameter("Topic");

    if (topic != null && topic != undefined) 
    {
        topic = topic.replace("#", "");
        
        jQuery(".Topics a").each(function(index) {
            var ID = jQuery(this).attr("id");
            if (ID.toUpperCase() == topic) jQuery(("#" + ID)).click();
        });
    }    
}
