﻿/************************************** Splendid *************************************
* Created By:		Steve Doggett
* Creation Date:	23rd July 2009
* Edited ----------------------------------------------------------------------------
*      By:              On:  
* Description -----------------------------------------------------------------------
*      This file handles Who's Busy rollover functionality
*      Uses JQuery.
*
* Functions -------------------------------------------------------------------------
*       
* Event Handlers --------------------------------------------------------------------
*       whosBusy_onMouseOver()          // Shows the name and highlights the image box
*       whosBusy_onMouseOut()           // Hides the name and de-highlights the image box
*       
**************************************************************************************/

/********************************** Global Variables *********************************/
$(document).ready(function() {
    $(".whosBusy li").hover(
        function() {
            whosBusy_onMouseOver(this);
        },
        function() {
            whosBusy_onMouseOut(this);
        }
    );
});

/************************************** Functions *************************************/


/*********************************** Event Handlers ***********************************/

/****
* Handles the mouse over event on an image in the Who's Busy box
* Shows the name and highlights the image box
****/
function whosBusy_onMouseOver(which) {
    var selectedNodes = $("a", which).children();
    $(selectedNodes[1]).show();

    $("a", which).append('<span class="highlight" style="display: block;"></span>')
}

/****
* Handles the mouse out event on an image in the Who's Busy box
* Hides the name and de-highlights the image box
****/
function whosBusy_onMouseOut(which) {
    var selectedNodes = $("a", which).children();
    $(selectedNodes[1]).hide();

    $(".highlight", which).remove();
}
