Extracted javascript out of html