Tried to do a modal Login

I tried and succeeded in implementing the visual parts of a login using a modal, instead of a stand alone page. However, I could not figure out away to login using AJAX, since I have included the Click forgery security on the whole site.. I have saved the functionality in a template page, and will be able to use it at a later point