Need more information if you want help. What kind of iMac is it?
When you say disconnected, are you losing the airport signal, or just getting "you are not connected to the internet" pages?
Intel iMacs have some issues with signal. Run a software update.
For any iMac, try changing the channel on your router. Cordless phones and microwaves can interfere with your signal.