
function clientSideInclude(id, url) {
  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
  
  
 var element = document.getElementById(id);
 
 /*
 if ( element == null ) return;
 if (!element) {
  alert("Bad id " + id + 
   "passed to clientSideInclude." +
   "You need a div or span element " +
   "with this id in your page.");
  return;
 }
 */
  if (req) {
    // Synchronous request, wait till we have it all
    var randomnumber = Math.floor(Math.random()*1000001);
    req.open('GET', url + '?' + randomnumber, false);
    req.send(null);
    if ( req.responseText.indexOf('Error 404') == -1 ) {
		if ( element == null ) {
			return req.responseText;
		}
		element.innerHTML = req.responseText;
	} else {
		if ( element == null ) {
			return 'There were no games scheduled or played this month.';
		}
		element.innerHTML = 'There were no games scheduled or played this month.';
	}
        
  } else {
    element.innerHTML =
   "Sorry, your browser does not support " +
      "XMLHTTPRequest objects. This page requires " +
      "Internet Explorer 5 or better for Windows, " +
      "or Firefox for any system, or Safari. Other " +
      "compatible browsers may also exist.";
  }
}


function getCurrentSeason( sport ) {	
	var a = clientSideInclude( null, "/sports-scores/data/"+sport+"ScoresAndMatchup/CurrentSeason.html");

	if ( a.indexOf("The page cannot be found") == -1 ) {
		return a;
	} else {
		alert("season not found");
		return "2005-2006";
	}
}
