﻿/* Set mouse-over state picture */
function tabBarMouseOver(tabObj){
    var isSel = tabObj.getAttribute("selected");
    if (true == isSel || "true" == isSel)
       return;
    tabObj.childNodes[0].childNodes[1].style.display = "block";
    tabObj.childNodes[0].childNodes[0].style.display = "none";
    tabObj.childNodes[0].childNodes[2].style.display = "none";
}

/* Set normal state picture */
function tabBarMouseOut(tabObj){
    var isSel = tabObj.getAttribute("selected");
    if (true == isSel || "true" == isSel)
       return;
    tabObj.childNodes[0].childNodes[0].style.display = "block";
    tabObj.childNodes[0].childNodes[1].style.display = "none";
    tabObj.childNodes[0].childNodes[2].style.display = "none";
}

/* Set clicked state picture */
function tabBarMouseClicked(tabObj){
    tabObj.childNodes[0].childNodes[2].style.display = "block";
    tabObj.childNodes[0].childNodes[1].style.display = "none";
    tabObj.childNodes[0].childNodes[0].style.display = "none";
}

function btnBarMouseOver(btnObj){
    var pictName = btnObj.getAttribute("pictName");
    btnObj.src = "images/Top/"+pictName+"-o.gif";
}

function btnBarMouseOut(btnObj){
    var pictName = btnObj.getAttribute("pictName");
    btnObj.src = "images/Top/"+pictName+".gif";
}

function btnTabBarMouseOver(btnObj) {
    var pictName = btnObj.getAttribute("pictName");
    btnObj.style.backgroundImage = "url(images/Tab/" + pictName + "-o.gif)";
}

function btnTabBarMouseOut(btnObj) {
    var pictName = btnObj.getAttribute("pictName");
    btnObj.style.backgroundImage = "url(images/Tab/" + pictName + ".gif)";
}

function btnTabBarBcashMouseOver(btnObj) {
    var pictName = btnObj.getAttribute("pictName");
    btnObj.style.backgroundImage = "url(images/Tab-bcash/" + pictName + "-o.gif)";
}

function btnTabBarBcashMouseOut(btnObj) {
    var pictName = btnObj.getAttribute("pictName");
    btnObj.style.backgroundImage = "url(images/Tab-bcash/" + pictName + ".gif)";
}

/*
** Handles clicks of the top logo bar tab
*/
function btnBarMouseClick(btnObj){
    var pictName = btnObj.getAttribute("pictName");
    switch(pictName){
        case "btn-compte": // compte client
        case "btn-compte-bcash":
            document.location = '/ClientEspace.aspx';
            break;
        case "btn-commandes": // commande
        case "btn-commandes-bcash":
            document.location = '/Commande.aspx';
            break;
        case "tab-promotions": // promotions
        case "tab-promotions-bcash": // promotions
            document.location = '/Promotions.aspx';
            break;
        default:
            alert("Erreur: opération non disponible.");
            break;
    }
}

