See zIndex for more information.
function MoveBox() { var bx = scene.getBoxById("theBox"); if (bx) { var mv = scene.getAttribute("custPlacement"); if (mv == "top") bx.moveToTop(); else bx.moveToBottom(); } }