Hello all, umm I was trying to make this program that "auto-reconnect" (so I don't hav to connect manually

the story is......because when i am online....(downloading, surfing, etc) in a certain amount of time(~10mins), my isp will disconnect me and i will have to reconnect and get a new session key to continue.
the way i was thinking to overcome this is to set a cyclic event for 10 mins. Starting by turning on IE, then have to continuesly (a loop)to check for a popup dialog box (if that popup dialog box appears, it means that I am disconnected), then i will hav to do bla bla bla...( I can work on from that point)
Well, how do I get the "If then" and etc to work?
So the steps are: turn on IE, then looping to check for a dialog box, and if it appears then.........
Appreaciate any Help, Thank You