Edited Javascript

Made javascript a little smarter when hiding divs.