var ProductPassiveBgColor = "#445566";
var ProductActiveBgColor = "#66ccff";

function SetProductBackground(product, activeBg) {
    divItem = document.getElementById(product);
    divItem.style.backgroundColor = activeBg ? ProductActiveBgColor : ProductPassiveBgColor;
}

function SetProductEventHandlers() {
    msie = (navigator.userAgent.indexOf("MSIE") >= 0) ? true : false;

    pic = document.getElementById("KryptelPic");
    pic.onmouseover = function(e) { SetProductBackground('Kryptel', true); if (msie) showTooltip(event, 'Click to learn more about Kryptel'); else showTooltip(e, 'Click to learn more about Kryptel'); };
    pic.onmouseout = function(e) { SetProductBackground('Kryptel', false); hideTooltip(); };

    pic = document.getElementById("SilverKeyPic");
    pic.onmouseover = function(e) { SetProductBackground('SilverKey', true); if (msie) showTooltip(event, 'Click to learn more about Silver Key'); else showTooltip(e, 'Click to learn more about Silver Key'); };
    pic.onmouseout = function(e) { SetProductBackground('SilverKey', false); hideTooltip(); };

    pic = document.getElementById("FreeSoftPic");
    pic.onmouseover = function(e) { SetProductBackground('FreeSoft', true); if (msie) showTooltip(event, 'Click to view our free software page'); else showTooltip(e, 'Click to view our free software page'); };
    pic.onmouseout = function(e) { SetProductBackground('FreeSoft', false); hideTooltip(); };
}

function InitProductsPage() {
    SetProductBackground('Kryptel', false);
    SetProductBackground('SilverKey', false);
    SetProductBackground('FreeSoft', false);

    SetProductEventHandlers();
}
