Moved javascript around