/********************************************************************************
 *                              SCRIPT INFORMATION
 ********************************************************************************
 * File and Version Information -
 *------------------------------------------------------------------------------*
 * File Name     | dgImageManager.js
 * Creation Date | 09 DEC 2002
 * Version       | 1.0.0.0
 * Purpose       | None.
 * Notes         | None.
 * Warnings      | None.
 *------------------------------------------------------------------------------*
 *
 *------------------------------------------------------------------------------*
 * Authors -
 *------------------------------------------------------------------------------*
 * Initials | Name
 *------------------------------------------------------------------------------*
 *    RAG   | Ron Goral
 *------------------------------------------------------------------------------*
 *
 *------------------------------------------------------------------------------*
 * Revision History -
 *------------------------------------------------------------------------------*
 * Author        | RAG
 * Date          | 09 DEC 2002
 * Modifications | None.
 * Purpose       | Initial Creation.
 * Notes         | None.
 *******************************************************************************/

 /*******************************************************************************
 * Global Variable Declarations -
 *******************************************************************************/
/*-- STRING VARIABLES (use the format: var str_variableName) ------------------*/
/*-- FLAG VARIABLES (use the format: var b_variableName) ----------------------*/
/* Designate whether diagnostics are set-up */
 var dgimgs_bDebug = false;
/*-- ARRAY VARIABLES (use the format: var a_variableName) ---------------------*/
var aryImages = new Array();
/*-- OBJECT VARIABLES (use the format: var obj_variableName) ------------------*/
/*******************************************************************************/

/********************************************************************************
 * Start the script processing
 *******************************************************************************/
/********************************************************************************
 * Name           | LoadImages
 * Purpose        | Takes two arrays of image addresses and stuffs them into an
 *                |     array of image objects called ImageArrays.
 * Implementation | LoadImages (A_IMGARRAYON, A_IMGARRAYOFF)
 *                |-------------------------------------------------------------
 *                | A_IMGARRAYON
 *                |-------------------------------------------------------------
 *                | An array of image addresses for when the "on" portion of a
 *                |     rollover event.
 *                |-------------------------------------------------------------
 *                | A_IMGARRAYOFF
 *                |-------------------------------------------------------------
 *                | An array of image addresses for when the "off" portion of a
 *                |     rollover event.
 *                |-------------------------------------------------------------
 * Return Value   | false if there is an error.
 * Notes          | Both arrays for this func must be of the same size.  If they
 *                |     are not, the func will return an error alert.
 * Warnings       | None.
 *------------------------------------------------------------------------------*
 * Revision History -
 *------------------------------------------------------------------------------*
 * Author         | RAG
 * Date           | 09 DEC 2002
 * Modifications  | None.
 * Purpose        | Initial Creation.
 * Notes          | None.
 *******************************************************************************/
function LoadImages(aryImagesOn,aryImagesOff)
    {
    /* Diagnostics ------------------------------------------------------------*/
    if(dgimgs_bDebug){alert("dgImageManager.js::LoadImages -\nEnter LoadImages.");}
    /*-------------------------------------------------------------------------*/
    if (aryImagesOn.length != aryImagesOff.length)
        {
        alert("dgImageManager.js::LoadImages -\nThe array lengths are not consistent");
        return false;
        }

    for(var i = 0; i < aryImagesOn.length;i++)
        {aryImages[i] = new ImageArray(aryImagesOn[i],aryImagesOff[i]);}

    /* Diagnostics ------------------------------------------------------------*/
    if(dgimgs_bDebug){alert("dgImageManager.js::LoadImages -\nExit LoadImages.");}
    /*-------------------------------------------------------------------------*/
    } /* end LoadImages */

/********************************************************************************
 * Name           | ImageArray
 * Purpose        | Provides an OO type interface to place multiple elements into
 *                |     an array and call them each by index and name.
 * Implementation | a_array[i] = new ImageArray(STR_IMGON,STR_IMGOFF)
 *                |-------------------------------------------------------------
 *                | STR_IMGON
 *                |-------------------------------------------------------------
 *                | The absolute address of the "on" image.
 *                |-------------------------------------------------------------
 *                | STR_IMGOFF
 *                |-------------------------------------------------------------
 *                | The absolute address of the "off" image.
 *                |-------------------------------------------------------------
 * Return Value   | None.
 * Notes          | None.
 * Warnings       | None.
 *------------------------------------------------------------------------------*
 * Revision History -
 *------------------------------------------------------------------------------*
 * Author         | RAG
 * Date           | 09 DEC 2002
 * Modifications  | None.
 * Purpose        | Initial Creation.
 * Notes          | None.
 *******************************************************************************/
function ImageArray(strImgOn,strImgOff)
    {
    /* Diagnostics ------------------------------------------------------------*/
    if(dgimgs_bDebug){alert("dgImageManager.js::ImageArray -\nEnter ImageArray.");}
    /*-------------------------------------------------------------------------*/

    this.on = strImgOn;
    this.off = strImgOff;

    /* Diagnostics ------------------------------------------------------------*/
    if(dgimgs_bDebug){alert("dgImageManager.js::ImageArray -\nExit ImageArray.");}
    /*-------------------------------------------------------------------------*/
    }   /* end ImageArray */

/********************************************************************************
 * Name           | RollImage
 * Purpose        | Provides an OO type interface to place multiple elements into
 *                |     an array and call them each by index and name.
 * Implementation | a_array[i] = new ImageArray(STR_IMGNAME,DIG_IMGINDEX,ON_OFF)
 *                |-------------------------------------------------------------
 *                | STR_IMGNAME
 *                |-------------------------------------------------------------
 *                | The name of the image area to be replaced.
 *                |-------------------------------------------------------------
 *                | DIG_IMGINDEX
 *                |-------------------------------------------------------------
 *                | The index of the image in the array of ImageArray objects.
 *                |-------------------------------------------------------------
 *                | ON_OFF
 *                |-------------------------------------------------------------
 *                | Whether the image is turned on or off
 *                |-------------------------------------------------------------
 * Return Value   | None.
 * Notes          | None.
 * Warnings       | None.
 *------------------------------------------------------------------------------*
 * Revision History -
 *------------------------------------------------------------------------------*
 * Author         | RAG
 * Date           | 09 DEC 2002
 * Modifications  | None.
 * Purpose        | Initial Creation.
 * Notes          | None.
 *******************************************************************************/
function RollImage(strImgName,intImgIndex,OnOff)
    {
    if(document.images)
        {document[strImgName].src=ImageArray[dg_imgIndex] + "." + OnOff;}
    }   /* end RollImage */

function changeColor(oElem,strBordWidth,strBordStyle,strBordColor,BackColor)
    {
    oElem.style.borderWidth = strBordWidth;
    oElem.style.borderStyle = strBordStyle;
    oElem.style.borderColor = strBordColor;
    oElem.style.backgroundColor = BackColor;
    }

function toggleImage(img)
    {
    var image = (document.layers)?document.layers[img]:
			    (document.all && !document.getElementById)?document.all(img):
			    (document.getElementById && document.body.style)?document.getElementById(img):
				null;
	if(image != null){image.src = (image.src == aryImages[1])?aryImages[0]:aryImages[1];}
    }