document.addEventListener("click", function() {
switch (event.target) {

/* OPEN-CLOSE THE MENU */
case ui.crop.ref:             ui.crop.click()              ; break;
case ui.menu_open.ref:        ui.menu_open.click()              ; break;

/* */
case ui.tab1.ref:             ui.tab1.click()              ; break;
case ui.tab2.ref:             ui.tab2.click()              ; break;
case ui.tab3.ref:             ui.tab3.click()              ; break;
case ui.tab4.ref:             ui.tab4.click()              ; break;
case ui.tab5.ref:             ui.tab5.click()              ; break;
case ui.tab6.ref:             ui.tab6.click()              ; break;

/* */
case ui.folder11button.ref:      ui.folder11button.click()       ; break;
case ui.folder12button.ref:      ui.folder12button.click()       ; break;
case ui.folder21button.ref:      ui.folder21button.click()       ; break;
case ui.folder22button.ref:      ui.folder22button.click()       ; break;
case ui.folder31button.ref:      ui.folder31button.click()       ; break;
case ui.folder32button.ref:      ui.folder32button.click()       ; break;
case ui.folder41button.ref:      ui.folder41button.click()       ; break;
case ui.folder42button.ref:      ui.folder42button.click()       ; break;
case ui.folder51button.ref:      ui.folder51button.click()       ; break;
case ui.folder52button.ref:      ui.folder52button.click()       ; break;
case ui.folder61button.ref:      ui.folder61button.click()       ; break;
case ui.folder62button.ref:      ui.folder62button.click()       ; break;

/* tab 1 folder 1 */
case ui.xrayGrey.ref:            ui.xrayGrey.click()             ; break;
case ui.xrayMagenta.ref:         ui.xrayMagenta.click()          ; break;
case ui.xrayCyan.ref:            ui.xrayCyan.click()             ; break;
case ui.cursorAuto.ref:          ui.cursorAuto.click()           ; break;
case ui.cursorXS.ref:            ui.cursorXS.click()             ; break;
case ui.cursorS.ref:             ui.cursorS.click()              ; break;
case ui.cursorM.ref:             ui.cursorM.click()              ; break;
case ui.cursorL.ref:             ui.cursorL.click()              ; break;
case ui.cursorXL.ref:            ui.cursorXL.click()             ; break;
case ui.cursorNum.ref:           ui.cursorNum.click()            ; break;
case ui.partPrev.ref:            ui.partPrev.click()             ; break;
case ui.partNext.ref:            ui.partNext.click()             ; break;

/* tab 1 folder 2 */
case ui.coin77155.ref:           ui.coin77155.click()            ; break;
case ui.coin59760.ref:           ui.coin59760.click()            ; break;
case ui.coin64291.ref:           ui.coin64291.click()            ; break;
case ui.coin70038.ref:           ui.coin70038.click()            ; break;
case ui.coin49592.ref:           ui.coin49592.click()            ; break;
case ui.coin54398.ref:           ui.coin54398.click()            ; break;

case ui.setLayer1.ref:           ui.setLayer1.click()            ; break;
case ui.setLayer2.ref:           ui.setLayer2.click()            ; break;
case ui.setLayer3.ref:           ui.setLayer3.click()            ; break;
case ui.setLayer4.ref:           ui.setLayer4.click()            ; break;
case ui.setLayer5.ref:           ui.setLayer5.click()            ; break;
case ui.setLayer6.ref:           ui.setLayer6.click()            ; break;
case ui.setLayer7.ref:           ui.setLayer7.click()            ; break;
case ui.setLayer8.ref:           ui.setLayer8.click()            ; break;
case ui.setLayer9.ref:           ui.setLayer9.click()            ; break;
case ui.setLayer10.ref:          ui.setLayer10.click()           ; break;
case ui.setLayer11.ref:          ui.setLayer11.click()           ; break;
case ui.setLayer12.ref:          ui.setLayer12.click()           ; break;
case ui.setLayer13.ref:          ui.setLayer13.click()           ; break;
case ui.setLayer14.ref:          ui.setLayer14.click()           ; break;
case ui.setLayer15.ref:          ui.setLayer15.click()           ; break;
case ui.setLayer16.ref:          ui.setLayer16.click()           ; break;
case ui.setLayer17.ref:          ui.setLayer17.click()           ; break;
case ui.setLayer18.ref:          ui.setLayer18.click()           ; break;
case ui.setLayer19.ref:          ui.setLayer19.click()           ; break;
case ui.setLayer20.ref:          ui.setLayer20.click()           ; break;
case ui.setLayer21.ref:          ui.setLayer21.click()           ; break;
case ui.setLayer22.ref:          ui.setLayer22.click()           ; break;
case ui.setLayer23.ref:          ui.setLayer23.click()           ; break;
case ui.setLayer24.ref:          ui.setLayer24.click()           ; break;
case ui.setLayer25.ref:          ui.setLayer25.click()           ; break;

/* tab 2 folder 1 */
case ui.modeZ.ref:               ui.modeZ.click()                ; break;
case ui.modeEeM1.ref:            ui.modeEeM1.click()             ; break;
case ui.modeD.ref:               ui.modeD.click()                ; break;
case ui.modeG.ref:               ui.modeG.click()                ; break;
case ui.modeEeM0.ref:            ui.modeEeM0.click()             ; break;
case ui.modeT.ref:               ui.modeT.click()                ; break;

case ui.hdub_menuScale8.ref:     ui.hdub_menuScale8.click()      ; break;
case ui.hdub_menuScale4.ref:     ui.hdub_menuScale4.click()      ; break;
case ui.hdub_menuScale2.ref:     ui.hdub_menuScale2.click()      ; break;
case ui.hdub_menuScale1.ref:     ui.hdub_menuScale1.click()      ; break;
case ui.hdub_menuScaleHalf.ref:  ui.hdub_menuScaleHalf.click()   ; break;
case ui.hdub_menuScaleQuarter.ref: ui.hdub_menuScaleQuarter.click() ; break;
case ui.hdub_menuScaleEighth.ref: ui.hdub_menuScaleEighth.click() ; break;

case ui.setDragThresholdFromGrid.ref: ui.setDragThresholdFromGrid.click() ; break;





/* tab 2 folder 2 */
case ui.coin21493.ref:           ui.coin21493.click()            ; break;
case ui.coin31352.ref:           ui.coin31352.click()            ; break;
case ui.coin44789.ref:           ui.coin44789.click()            ; break;
case ui.coin33352.ref:           ui.coin33352.click()            ; break;
case ui.coin35216.ref:           ui.coin35216.click()            ; break;
case ui.coin36899.ref:           ui.coin36899.click()            ; break;
case ui.coin38511.ref:           ui.coin38511.click()            ; break;
case ui.coin40870.ref:           ui.coin40870.click()            ; break;
case ui.coin46684.ref:           ui.coin46684.click()            ; break;
case ui.coin48242.ref:           ui.coin48242.click()            ; break;
case ui.coin50503.ref:           ui.coin50503.click()            ; break;
case ui.coin53180.ref:           ui.coin53180.click()            ; break;
case ui.coin55658.ref:           ui.coin55658.click()            ; break;
case ui.coin57816.ref:           ui.coin57816.click()            ; break;
case ui.coin60297.ref:           ui.coin60297.click()            ; break;
case ui.coin64112.ref:           ui.coin64112.click()            ; break;
case ui.coin66935.ref:           ui.coin66935.click()            ; break;
case ui.coin70148.ref:           ui.coin70148.click()            ; break;
case ui.coin05786.ref:           ui.coin05786.click()            ; break;
case ui.coin08962.ref:           ui.coin08962.click()            ; break;
case ui.coin10912.ref:           ui.coin10912.click()            ; break;
case ui.coin15097.ref:           ui.coin15097.click()            ; break;
case ui.coin18271.ref:           ui.coin18271.click()            ; break;
case ui.coin21056.ref:           ui.coin21056.click()            ; break;
case ui.coin22927.ref:           ui.coin22927.click()            ; break;
case ui.coin26110.ref:           ui.coin26110.click()            ; break;
case ui.coin44062.ref:           ui.coin44062.click()            ; break;
case ui.coin46633.ref:           ui.coin46633.click()            ; break;
case ui.coin48525.ref:           ui.coin48525.click()            ; break;
case ui.coin51107.ref:           ui.coin51107.click()            ; break;
case ui.coin56470.ref:           ui.coin56470.click()            ; break;
case ui.coin58382.ref:           ui.coin58382.click()            ; break;
case ui.coin59792.ref:           ui.coin59792.click()            ; break;
case ui.coin61443.ref:           ui.coin61443.click()            ; break;
case ui.coin63058.ref:           ui.coin63058.click()            ; break;
case ui.coin65326.ref:           ui.coin65326.click()            ; break;
case ui.coin67576.ref:           ui.coin67576.click()            ; break;
case ui.coin69548.ref:           ui.coin69548.click()            ; break;
case ui.coin71699.ref:           ui.coin71699.click()            ; break;
case ui.coin72936.ref:           ui.coin72936.click()            ; break;
case ui.coin74420.ref:           ui.coin74420.click()            ; break;
case ui.coin63249.ref:           ui.coin63249.click()            ; break;

case ui.coin38634.ref:           ui.coin38634.click()            ; break;
case ui.coin41046.ref:           ui.coin41046.click()            ; break;
case ui.coin07023.ref:           ui.coin07023.click()            ; break;

case ui.setMetric.ref:           ui.setMetric.click()            ; break;
case ui.setComp2.ref:            ui.setComp2.click()             ; break;
case ui.setComp3.ref:            ui.setComp3.click()             ; break;
case ui.setComp2and3.ref:        ui.setComp2and3.click()         ; break;

case ui.cursorShutoff.ref:           ui.cursorShutoff.click()            ; break;









case ui.saveTheme_a0.ref:        ui.saveTheme_a0.click()         ; break;
case ui.saveTheme_b1.ref:        ui.saveTheme_b1.click()         ; break;
case ui.saveTheme_c2.ref:        ui.saveTheme_c2.click()         ; break;
case ui.saveTheme_d3.ref:        ui.saveTheme_d3.click()         ; break;
case ui.saveTheme_e4.ref:        ui.saveTheme_e4.click()         ; break;
case ui.saveTheme_f5.ref:        ui.saveTheme_f5.click()         ; break;
case ui.saveTheme_g6.ref:        ui.saveTheme_g6.click()         ; break;
case ui.saveTheme_h7.ref:        ui.saveTheme_h7.click()         ; break;
case ui.saveTheme_i8.ref:        ui.saveTheme_i8.click()         ; break;
case ui.saveTheme_j9.ref:        ui.saveTheme_j9.click()         ; break;

case ui.loadTheme_a0.ref:        ui.loadTheme_a0.click()         ; break;
case ui.loadTheme_b1.ref:        ui.loadTheme_b1.click()         ; break;
case ui.loadTheme_c2.ref:        ui.loadTheme_c2.click()         ; break;
case ui.loadTheme_d3.ref:        ui.loadTheme_d3.click()         ; break;
case ui.loadTheme_e4.ref:        ui.loadTheme_e4.click()         ; break;
case ui.loadTheme_f5.ref:        ui.loadTheme_f5.click()         ; break;
case ui.loadTheme_g6.ref:        ui.loadTheme_g6.click()         ; break;
case ui.loadTheme_h7.ref:        ui.loadTheme_h7.click()         ; break;
case ui.loadTheme_i8.ref:        ui.loadTheme_i8.click()         ; break;
case ui.loadTheme_j9.ref:        ui.loadTheme_j9.click()         ; break;













/* tab 6 folder 1 */
case ui.coin17304.ref:           ui.coin17304.click()            ; break;
case ui.coin26746.ref:           ui.coin26746.click()            ; break;
case ui.coin32891.ref:           ui.coin32891.click()            ; break;
case ui.coin40855.ref:           ui.coin40855.click()            ; break;
case ui.coin46032.ref:           ui.coin46032.click()            ; break;

/* */

}
});
