// Get the real (absolute) Y-position of an element
function getX(oElement) {
    var iReturnValue = 0;
    while (oElement != null) {
        iReturnValue += oElement.offsetLeft;
        oElement = oElement.offsetParent;
    }
    return iReturnValue;
}

// Get the real (absolute) Y-position of an element
function getY(oElement) {
    var iReturnValue = 0;
    while (oElement != null) {
        iReturnValue += oElement.offsetTop;
        oElement = oElement.offsetParent;
    }
    return iReturnValue;
}

function onItemRollOver( code ) {
    document.getElementById("popupwheel" + code).style.display = "block";
    var left;
    var top;

    switch (code) {
        case "1": //repair
            top = -50;
            left = 250;
            break;
        case "2":
            top = 70;
            left = 300; 
            break;
        case "3":
            top = 160;
            left = 300; 
            break;
        case "4":
            top= 250;
            left = 240;
            break;
        case "5":
            top = 220;
            left = -180; 
            break;
        case "6":
            top = 110;
            left = -200;
            break;
        case "7": 
            top= -20;
            left = -180; 
            break;
    }
    var wielObject = document.getElementById("wheel");
    top += getY(wielObject);
    left += getX(wielObject);
    document.getElementById("popupwheel" + code).style.left = left + "px";
    document.getElementById("popupwheel" + code).style.top = top + "px"; 
}

function onItemRollOut( code )
{
    document.getElementById("popupwheel" + code).style.display = "none";
}

function onItemClicked( code )
{
    switch (code) {
        case "0":
            window.location.href = "/lifecycle care.aspx";
            break;
        case "1": 
            window.location.href = "/lifecycle care/repair.aspx";
            break;
        case "2":
            window.location.href = "/lifecycle care/refurbish.aspx";
            break; ;
        case "3":
            window.location.href = "/lifecycle care/recycling.aspx";
            break; ;
        case "4":
            window.location.href = "/lifecycle care/reverse logistics.aspx";
            break; ;
        case "5":
            window.location.href = "/lifecycle care/customer care.aspx";
            break; ;
        case "6":
            window.location.href = "/lifecycle care/e-trac.aspx";
            break;
        case "7":
            window.location.href = "/lifecycle care/tele-made.aspx";
            break;
    }
}

function getLinkFromCode( code )
{
	switch( code )
	{
	    case "1": return "/lifecycle care/repair.aspx";
	    case "2": return "/lifecycle care/refurbish.aspx";
	    case "3": return "/lifecycle care/recycling.aspx";
	    case "4": return "/lifecycle care/reverse logistics.aspx";
	    case "5": return "/lifecycle care/customer care.aspx";
	    case "6": return "/lifecycle care/e-trac.aspx";
	    case "7": return "/lifecycle care/tele-made.aspx";
	}
}