﻿// JScript File
//Pour gérer les menu
 function jsViewMenue(id)
{
    var obj1 = document.getElementById(id);
    
   
    
    for(j=1; j < 8; j++)
    { 
        var obj2 = document.getElementById("trSMenu"+j);
        
        if(obj2)
        {
            obj2.style.display = "none";
        }
    }
    
    if(obj1.style.display == "")
    {
        obj1.style.display = "none";
    }
    else
    {
        obj1.style.display = "";
    }
}

function jsGoToStep(idStep, nbrStep)
{
    for(j=1; j <= nbrStep ; j++)
    {
        var objStep = document.getElementById("tableStep"+j);
        if(objStep)
        {
            objStep.style.display = "none";
        }
        
        document.getElementById(idStep).style.display = "";
    }
}

 function jsAddElement(idSource,idDest)
{
    var objSource = document.getElementById(idSource);
    var objDest = document.getElementById(idDest);
    
    if(objSource && objDest)
    {
        nouvel_element = new Option(objSource.options[objSource.selectedIndex].text,objSource.options[objSource.selectedIndex].value,false,true);
        objDest.options[objDest.length] = nouvel_element;
        objSource.options[objSource.selectedIndex] = null;
    }
    
    
}
        
function jsDelElement(idSource,idDest)
{
    var objSource = document.getElementById(idSource);
    var objDest = document.getElementById(idDest);
    
    if(objSource && objDest)
    {
        nouvel_element = new Option(objDest.options[objDest.selectedIndex].text,objDest.options[objDest.selectedIndex].value,false,true);
        objSource.options[objSource.length] = nouvel_element;
        objDest.options[objDest.selectedIndex] = null;
    }
    
}