﻿function ToolBarLoad()
{
    var frame = document.getElementById("toolbarmenu");

    if (IS.ie)
    {
        frame.attachEvent("onmouseover", OnToolBarHover);
        frame.attachEvent("onmouseout", OnToolBarOut);
    }
    else
    {
        frame.addEventListener("mouseover", OnToolBarHover, false);
        frame.addEventListener("mouseout", OnToolBarOut, false);
    }
}

function OnToolBarHover()
{
    var el = event.srcElement;
    var param = GetElementType(el);

    var type = param[1];
    if (type != null)
    {
        var child = param[0];
        if (document.getElementById("activeMenu") != null)
            var menu = document.getElementById("activeMenu").value;
        if (type != menu)
            child.children[0].children[0].className = type == "BuyNow" ? "buyhover" : "hover";
    }
}

function OnToolBarOut()
{
    var el = event.srcElement;
    var param = GetElementType(el);

    var type = param[1];
    if (type != null)
    {
        var child = param[0];
        if (document.getElementById("activeMenu") != null)
            var menu = document.getElementById("activeMenu").value;
        if (type != menu)
            child.children[0].children[0].className = type == "BuyNow" ? "buynormal" : "";
    }
}
