/* begin toggle info bubble on pricing page
*************************************************************/

function prepareInfoImgs()
{
    var infoImages = document.getElementById("divBodyCopy").getElementsByTagName("IMG");
    
    for (var i = 0; i < infoImages.length; i++)
    {
        infoImages[i].onmouseover = function()
        {
            if(this.src.indexOf("information.gif") != -1)
            {
               showInfoBubble(this);
            }
        }
        
        infoImages[i].onmouseout = function()
        {
            if(this.src.indexOf("information.gif") != -1)
            {
               hideInfoBubble(this);
            }
        }
    }
}

function showInfoBubble(id)
{
    var divInfoBubble = id.offsetParent.getElementsByTagName("DIV");
    var divContainerTable = id.parentNode.offsetParent;
    var divContainerTD = id.parentNode;
    divInfoBubble[0].style.display = "block";
    divInfoBubble[0].style.top = ((divContainerTable.offsetTop + divContainerTD.offsetTop + id.offsetTop) - (divInfoBubble[0].offsetHeight)) + "px";
    divInfoBubble[0].style.left = (id.offsetLeft - 143) + "px"; 
}

function hideInfoBubble(id)
{
    var divInfoBubble = id.offsetParent.getElementsByTagName("DIV");
    divInfoBubble[0].style.display = "none";
}

/* end toggle info bubble on pricing page
*************************************************************/

/* begin image map/info bubble
*************************************************************/

function showBubble(areaId)
{
    var areaCoords = areaId.getAttribute('coords').split(',');
    var areaLeft = parseInt(areaCoords[0]) - 70;
    var areaTop = parseInt(areaCoords[1]) - 130;
    objDivFeatureBubble.style.display = 'block';
    objDivFeatureBubble.style.left = areaLeft + 'px';
    objDivFeatureBubble.style.top = areaTop + 'px';
    
    for (var i = 0; i < interactiveMapAreas.length; i ++)
    {
        objDivFeatureBubbleDivs[i].style.display = "none";
        
        if (areaId == interactiveMapAreas[i])
        {
            objDivFeatureBubbleDivs[i].style.display = "block";
        }
    }
}

function prepareMapAreas()
{
    for (var i = 0; i < interactiveMapAreas.length; i ++)
    {
        interactiveMapAreas[i].onmouseover = function()
        {
            return showBubble(this);
        }
        
        interactiveMapAreas[i].onmouseout = function()
        {
            objDivFeatureBubble.style.display = "none";
        }
    }
}

/* end image map/info bubble
*************************************************************/

/* begin window onload
*************************************************************/

window.onload = function() {

    // toggle info bubble on pricing page
    prepareInfoImgs();
    
    // image map/info bubble
    if(document.getElementById("divInteractiveFeatures"))
    {
        interactiveUl = document.getElementById("divInteractiveFeatures");
        interactiveMapAreas = interactiveUl.getElementsByTagName("area");
        objDivFeatureBubble = document.getElementById("divFeatureBubble");
        objDivFeatureBubbleDivs = objDivFeatureBubble.getElementsByTagName("div");
        prepareMapAreas();
    }    
}

/* end window onload
*************************************************************/