﻿$(document).ready(function() {

    //For mouse over effect on tooltip 
    $("#banner-hover li a ").hover(function() {

        $(this).find('span').fadeIn(700);
    },
        function() {
            $(this).find('span').hide();
        });


    //hide all divs with class of answer					   
    $("div.member").hide();

    /*
    get all div's that are links with the class of questionAnchor and run the function on each of them (.each is jquery specific) 
    using an array to add +1 each time it runs so matches up the q and A. Index increments each time the loop is run
    */
    $('a.link').each(function(index) {

        //$(this) equals the current anchor								  
        $(this).click(function() {


            //removes the default text when page first opens
            $('div.member-intro').hide();

            //hide all open divs with class of member
            $("div.member").hide();


            //get the corrsponding div and show it
            vMemberID = $(this).attr("href");
            $(vMemberID).fadeIn('def');

            return false;

        });
    });

    //This is to view all members
    $('a.bm-link').toggle(

    function() {

        $('div.member').fadeIn();
        $('div.member-intro').hide();
        $('a.bm-link').text("Hide all Board members");
        
    },

    function() {
        $('div.member-intro').show();
        $('div.member').fadeOut('fast');
        $('a.bm-link').text("Show all board members");
    }

    );


});


