There is a easy way to check if the browser as internet access or not. In the wireless and mobile world a check if the loaded page has internet access can be very good, a very easy check can save you alot of problem.
The only thing you need to do is
if(navigator.onLine==true){
alert("Online")
}else{
alert("Offline")
}