Web Scripting login

Web Scripting login

I have an info site i want to display on various units. 
But i keep running into a problem with the script not wanting to log on to the site i am logging in to. 
The log in is this pop up that comes up. 

This is how my script looks like: 

click("""Username""")
pause(1)
type("""Username""", """xxxxxx""")
pause(1)
click("""Password""")
pause(1)
type("""Password""", """xxxxxx""")
pause(1)

Can someone point me in the direction of the correct solution to actually get this working?