var SECONDS = 0.30;
var EFFECT = 'appear'; // 'appear', 'blind', 'slide' -- the latter two are a little buggy

function toggle(event, showId, hideIds) {
    for (i = 0; i < hideIds.length; i++) {
        if ($(hideIds[i]).style.display != 'none') 
            Effect.toggle(hideIds[i],EFFECT,{duration:SECONDS});
    }
    Effect.toggle(showId,EFFECT,{duration:SECONDS}); 
}
function hideAll(event, navIds, menuIds) {
    for (i = 0; i < navIds.length; i++) {
        if ( Position.within($(navIds[i]), Event.pointerX(event), Event.pointerY(event)) ) {
            return;
        }
    }
    for (j = 0; j < menuIds.length; j++) { 
        if ($(menuIds[j]).style.display != 'none') {
            Effect.toggle(menuIds[j],EFFECT,{duration:SECONDS});
            }
        }
}