 function imageSwapGif(aImage)
    {
    var imageSrc = aImage.src;
    if (imageSrc.indexOf("_f2") != -1)
        {
        aImage.src = imageSrc.replace("_f2", "");
        }
    else
        {
        aImage.src = imageSrc.replace(".gif", "_f2.gif");
        }
    }

    function showBox(type)
        {
        var showBoxId = document.getElementById('helpBox'+type);
        if (showBoxId.style.display == 'none')
            {
            showBoxId.style.display = 'block';
            }
        if ((version >= 5.5) && (version < 7) && (document.body.filters))
            {
                setImgForMessageBox();
            }
        }


function hide(aId)
    {
    var element = document.getElementById(aId);
    element.style.display = "none";
    }

function beginDrag(elementToDrag, event)
    {
    // Compute the distance between the upper-left corner of the element
    // and the mouse-click. The moveHandler function below needs these values.
    var deltaX = event.clientX - parseInt(elementToDrag.style.left);
    var deltaY = event.clientY - parseInt(elementToDrag.style.top);
    // Register the event handlers that will respond to the mousemove events
    // and the mouseup event that follow this mousedown event.
    if (document.addEventListener)
        {  // DOM Level 2 Event Model
        // Register capturing event handlers
        document.addEventListener("mousemove", moveHandler, true);
        document.addEventListener("mouseup", upHandler, true);
        }
    else if (document.attachEvent)
        {  // IE 5+ Event Model
        // In the IE event model, we capture events by calling
        // setCapture() on the element to capture them.

        elementToDrag.attachEvent("onmousemove", moveHandler);
        elementToDrag.attachEvent("onmouseup", upHandler);
        elementToDrag.setCapture();
        }
    else
        {  // IE 4 Event Model
        // In IE 4 we can't use attachEvent(  ), so assign the event handlers
        // directly after storing any previously assigned handlers, so they
        // can be restored. Note that this also relies on event bubbling.
        var oldmovehandler = document.onmousemove;
        var olduphandler = document.onmouseup;
        document.onmousemove = moveHandler;
        document.onmouseup = upHandler;
        }

    // We've handled this event. Don't let anybody else see it.
    if (event.stopPropagation) event.stopPropagation();  // DOM Level 2
    else event.cancelBubble = true;
    // IE

    // Now prevent any default action.
    if (event.preventDefault) event.preventDefault();   // DOM Level 2
    else event.returnValue = false;
    // IE

/**
 * This is the handler that captures mousemove events when an element
 * is being dragged. It is responsible for moving the element.
 **/
function moveHandler(e)
    {
    if (!e) e = window.event;  // IE Event Model
    // Move the element to the current mouse position, adjusted as
    // necessary by the offset of the initial mouse-click.

    var posX = e.clientX - deltaX;
    var posY = e.clientY - deltaY;

    if(posX < 0)
        posX = 0;

    if(posY < 0)
        posY = 0;


    if(posX + 300 > document.body.clientWidth)
        posX = document.body.clientWidth - 300;

    if(posY + 303 > document.body.clientHeight)
        posY = document.body.clientHeight - 303;

    elementToDrag.style.left = posX + "px";
    elementToDrag.style.top = posY + "px";
    // And don't let anyone else see this event.
    if (e.stopPropagation) e.stopPropagation();  // DOM Level 2
    else e.cancelBubble = true;
    // IE
    }

/**
 * This is the handler that captures the final mouseup event that
 * occurs at the end of a drag.
 **/
function upHandler(e)
    {
    if (!e) e = window.event;  // IE Event Model

    // Unregister the capturing event handlers.
    if (document.removeEventListener)
        {  // DOM Event Model
        document.removeEventListener("mouseup", upHandler, true);
        document.removeEventListener("mousemove", moveHandler, true);
        }
    else if (document.detachEvent)
        {  // IE 5+ Event Model
        elementToDrag.detachEvent("onmouseup", upHandler);
        elementToDrag.detachEvent("onmousemove", moveHandler);
        elementToDrag.releaseCapture();
        }
    else
        {  // IE 4 Event Model
        document.onmouseup = olduphandler;
        document.onmousemove = oldmovehandler;
        }

    // And don't let the event propagate any further.
    if (e.stopPropagation) e.stopPropagation();  // DOM Level 2
    else e.cancelBubble = true;
    // IE
    }
}


function setImgForMessageBox()
    {
    //set the image heights and widths for IE 6 and IE 5.5
    var elements = document.all;
    for(i=0;i<elements.length;i++)
        {
        if(elements[i].className=="helpBox-tr")
            {
            elements[i].style.height = "33";
            elements[i].style.width = "26";
            }
        else if(elements[i].className=="helpBox-tl")
            {
            elements[i].style.height = "33";
            elements[i].style.width = "20";
            }
        else if(elements[i].className=="helpBox-br")
            {
            elements[i].style.height = "20";
            elements[i].style.width = "26";
            }
        else if(elements[i].className=="helpBox-bl")
            {
            elements[i].style.height = "20";
            elements[i].style.width = "20";
            }
        else if(elements[i].className=="helpBox-closeButton")
            {
            elements[i].style.height = "20";
            elements[i].style.width = "87";
            }
        }
    }