﻿////////////////////////////////////////////////////////////////////////////////////////////
//Highlight javascript functions
//These functions can be used to add a mouseover effect to elements on webpages
//Created by David Kluver 7/30/2007
//
//To use this function this js file must be included on the page
//
//To change the color that is used in the effect change the HIGHLIGHT_COLOR variable below
//
//To use the functions, add the following the apropriate element on the page
//onmouseover="mouseOn(this);"
//onmouseout="mouseOff(this);"
//
//to override the default color on a given page pass a second paramater to mouseOn containing the override color
//onmouseover="mouseOn(this,'red');"
////////////////////////////////////////////////////////////////////////////////////////////

//  Style definition
var HIGHLIGHT_COLOR = '#F8F8FF';


//  Utility variables used by the functions
var hlt_origionalColor = '#000000'; //default value just in case.


//Functions

function mouseOn(element,overrideColor)
{
    if(overrideColor)
    {
       HIGHLIGHT_COLOR =  overrideColor;
    }
    hlt_origionalColor = element.style.backgroundColor;
    element.style.backgroundColor = HIGHLIGHT_COLOR;
}

function mouseOff(element)
{
    element.style.backgroundColor = hlt_origionalColor;
}
