How can I create automatic login system on javascript?

Hi,
I have less knowledge on JavaScript.
I wanted to automate my local intranet site login.
We usually enter our username and password to login.
I need to automate this process.
The page contains various frames etc… How can I map the username and password that I have with the input box in the page and enter submit button dynamically?
Please help me out…it would be great if there is a sample code or tutorial for this.

Where are you getting the username and password from? Is the user typing it in somewhere or are you getting it from somewhere else?