Auto Website Visit + Form-Fill Scripting

Hello I’m very green at using AppleScript - but i just put together a simple script
that activates iTunes and Adium when my Bluetooth Phone comes near my iMac.

I’m thrilled that I got it working, but I have a problem.
Before I have access to internet I have to visit a website and enter a login / pass.
(go.i4s.be)
This way, Adium can’t really start and go online when my Bluetooth Phone comes near my iMac.

I would like to know how I can have my iMac automatically start up Safari, go to this website,
enter the login / pass and press the "Login’ button. I don’t even know if that is possible using
AppleScript.

Thanks in advance

Ok. So far I have this.
It actually works (if you have the login / pass already filled in by default)

BUT
it only works one out of two times.
Sometimes it just opens the window but the keystroke tab doesn’t work.

tell application "Safari"
	activate
	do JavaScript "window.open('http://go.i4s.be/?res=notyet&uamip=192.168.182.1&uamport=3990&challenge=3688250867aa1ac332a3909ed7211d50&userurl=&nasid=STVERPOS008&preregister=true&mac=00-1C-B3-BC-AD-57')" in document 1
end tell


tell application "System Events"
	set frontApp to a reference to item 1 of (every process whose frontmost is true)
	
	tell frontApp
		
		keystroke tab
		keystroke tab
		keystroke return
		
		delay 6
		
		keystroke "w" using command down
		keystroke "w" using command down
	end tell
end tell

oh. a little delay was enough to do the trick.
if all this can be done in an easier way, please tell me.