Client Authentication

JH .. updated code for client authentication .. issue .. the template JS
does not carry over to all sub pages, and only works on main page.