Moved custom scripts from the base template to the template they are used in.
Modified for loop and added an if statement to insert an hr between events.