Rewritten with mor logic structure and added openOne setting wich closes all open boxes on open click