﻿var xOffset = 760;
var yOffset = 225;

function initProducts()
{
    // IE 6 fix
    if($.browser.browser == "MSIE" && $.browser.version.number <= 6)
    {
        xOffset = 400;
    }
    // Make sure popup is on top
    $("#products-table").css("z-index", "100");
    $("#products-info").css("z-index", "100");
    $("#products-info > *").css("z-index", "100");
    $("#home-pod-container").css("z-index", "10");
    $("#home-pod-container > *").css("z-index", "10");    
    for (i=0;i<10;i++) // change this to the number of products listed
    {
        $("#family" + (i + 1)).mousemove(procMouseMove);
        $("#family" + (i + 1)).mouseout(procMouseOut);
    }
}

function procMouseMove(e)
{
    var index = e.target.id.replace("family", "");
    $("#products-info").css("left", (e.pageX - xOffset) + "px").css("top", (e.pageY - yOffset) + "px");
    // Hide all children
    $("#products-info > *").css("display", "none");
    //Show appropriate children
    $("#dtfamily" + index).css("display", "block");
    $("#ddfamily" + index).css("display", "block");
}

function procMouseOut(e)
{
    $("#products-info").css("left", "-9999px").css("top", "-9999px");    
}
