Waiting for internet connection to be established

I have a number of applications which require an internet connection. I have an airport network which broadcasts the adsl signal from my router. So as soon as airport connection is establised, so is the internet connection. The problem is that these applications are set to start automtically when the machine starts up. I always get these messages saying that the internet connection could not be established as the apps start before the airport signal is recognised. This often makes apps like MSN Messenger give up and not keep trying to connect. So how can I delay the login items with AppleScript until the airport signal is established?

You could use a script which includes a delay to launch the apps.

do shell script "sleep 30" -- delay 30 seconds
tell application "Safari" to activate
tell application "MSN Messenger" to activate

– Rob