javascript function for acordion replacement