/* 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()
        {
            if(this.id != 'areaCfx7')
            {
                return showBubble(this);
            }
        }
        
        interactiveMapAreas[i].onmouseout = function()
        {
            if(this.id != 'areaCfx7')
            {
                objDivFeatureBubble.style.display = "none";
            }
        }
    }
}

/* end image map/info bubble
*************************************************************/

/* begin popups
*************************************************************/

    function QuicktourPopup()
    {
        if(document.getElementById("ulResources"))
        {
            objUlResources = document.getElementById("ulResources");
            objQuicktourHref = objUlResources.getElementsByTagName("a");
            objQuicktourHref[2].onclick = function()
            {
                window.open("/sfxPictures/quicktour/internet62Quicktour.swf", null, "width=700,height=400,status=yes,toolbar=no,menubar=no,location=no");   
                return false;
            }
        }
        
        if(document.getElementById("imgAncillaryPromo"))
        {
            objImgAncillaryPromo = document.getElementById("imgAncillaryPromo");
            objImgAncillaryPromo.onclick = function()
            {
                window.open("/sfxPictures/quicktour/internet62Quicktour.swf", null, "width=700,height=400,status=yes,toolbar=no,menubar=no,location=no");   
                return false;
            }
        }
    }

/* end popups
*************************************************************/

/* begin window onload
*************************************************************/

window.onload = function() {

    QuicktourPopup();

    // 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
*************************************************************/