﻿// JScript File
// KCGIS Center 10/28/2008
  dojo.require("esri.utils");
  var serviceURL="";
  
  function getServiceStatus(url) {
    serviceURL = url;  //set this to use if we get an error
    esri.request({
      url: url,
      content: { f:"json" },
      callbackParamName: "callback",
      load: serviceOK,
      error: serviceDown,
      timeout: 10000
    });
  }
  
  function serviceOK(response, io) {
    // do something? or do nothing.
  }
  
   function serviceDown(response, io) {
    // do something
    // could set up a switch on serviceURL to react differently depending on which service is down.
    document.location = "error.aspx?badURL="+serviceURL;
  } 
  
 
  