Solved Bug 1065376

Request to review and merge solution for Bug 1065376.
isn't all of this javascript in alerts.html (the non template version still?)