I guess it'd be worth to mention that you never will be able to create a login system in JavaScript where the website visitor will be able to read the password from the source code. Esentially, no site with the need for a login system for security issues has so low security that a JavaScript login will do
I'd recommend you to go for a serverside language like PHP or ASP