function reach_notify()
{
var randn = Math.floor((Math.random() * 100) + 1);
$.ajax({
url: "http://www.google.com?t="+randn,
context: document.body,
error: function(jqXHR, exception) {
var d = document.getElementById("reach_notify");
d.className = "off",
d.innerHTML = "Offline"
},
success: function() {
var d = document.getElementById("reach_notify");
d.className = "on",
d.innerHTML = "Online"
}
});
}
setInterval(function(){
reach_notify()}, 5000);
document.getElementById("reach_notify").addEventListener("click", reach_notify());