Premettendo che sono assolutamente ignorante di JavaScript chiedo, avendo questa funzione:
function popUp(menuName,e){
if (!areCreated) return;
hideAll();
currentMenu = eval(menuName);
xPos = 220;
yPos = 180;
currentMenu.moveTo(xPos,yPos);
currentMenu.keepInWindow()
currentMenu.isOn = true;
currentMenu.showIt(true);
}
Come si scrive correttamente la condizione:
if currentMenu = "menu1" then ypos=180;
if currentMenu = "menu2" then ypos=220;
In modo che in base al nome del menu la posizione verticale è diversa