// JavaScript WebPing
// Author: david.kierznowski_at_gmail.com
// http://michaeldaw.org

// Get data from form and set variables

function scan_with_form(form) {
  _url = form.target.value;
  _glbport = form.port.value;
  _timeout = form.timeout.value;
  JSExternalScan(_url, _glbport, _timeout);
}

// set GET request and make it so
var i=0;
function JSExternalScan(_url, _glbport, _timeout) {
  
  if (i == 0) {

  var localurl = _url;
  localurl = localurl + ':' + _glbport + '/';

  e=document.getElementById("ifrm");
  e.src = localurl;

  t=setTimeout("JSExternalScan(_url, _glbport, _timeout)", _timeout);
  }

  else {
  if (_url != 'done') {
  document.getElementById("data").innerHTML+=_url + " down.\n";
  }
  return;
  } 

  i=i+1;

}

function Check() {
 
 document.getElementById("data").innerHTML+=_url + " ALIVE\n";
 _url = "done";
 return _url; 

}


