﻿//
//  Copyright 2009 Syracuse Camera Club. All rights reserved.
//

var lastTopic = null;

    function showTopic(topicID)
    {
        var topicElement = null;
        var lastElement = null;
        
        topicElement = document.getElementById(topicID);
        if (topicElement == undefined)
            return false;
        
        if (topicID == lastTopic) {
            // Toggle topic display attribute
            if (topicElement.style.display == 'block')
                topicElement.style.display = 'none';
            else
                topicElement.style.display = 'block';
        }
        else {
            // Show topic
            topicElement.style.display = 'block';
            // Hide last topic
            lastElement = document.getElementById(lastTopic);
            if (lastElement != undefined)
                lastElement.style.display = 'none';
        }

        lastTopic = topicID;

        return true;
    }
