//Start of code only for XML HTTP to BandManager
//Required to overide IE inability to use getElementById correctly
var strDIV; //Global variable for passed div
var http = getHTTPObject(); // We create the HTTP Object

var isBusy = false;
function getHTTPObject() {
  var xmlhttp;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         xmlhttp = new XMLHttpRequest();
         if (xmlhttp.overrideMimeType) {
            xmlhttp.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!xmlhttp) {
         xmlhttp=null;
      }
      return xmlhttp;
      
}
function updatepage(str){
    //this fails if the script is fired before the div is printed
    // on ie 6+ (only when refreshing due to browser caching)
    var myElement = document.getElementById(strDIV);
    if(myElement)
    {
    myElement.innerHTML = str;
    } else {
    //Element not created yet
    }
}
  
function handleHttpResponse() {
  if (http.readyState == 4) {
    results = http.responseText;
    //Update Div with results
    updatepage(results);
  }
}

function CaptureContent(strURL,divName)
{
    //http =  getHTTPObject();

    strDIV = divName;
//  if (isBusy)
//{
//    //Necessary to clear for mozilla
//	http.onreadystatechange = function () {}
//	http.abort();
//}
//Try using EVAL(variable name + variant) for the variable name using the div
// This could allow multiple calls as a unique xml object is created
  http.open("GET", strURL, true);
  http.onreadystatechange = handleHttpResponse;
  http.send(null);
}
// END of code for xmlhttp only to bandmanager

/*
function sendRequest(url,callback,postData) {
	var req = createXMLHTTPObject();
	if (!req) return;
	var method = (postData) ? "POST" : "GET";
	req.open(method,url,true);
	req.setRequestHeader('User-Agent','XMLHTTP/1.0');
	if (postData)
		req.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	req.onreadystatechange = function () {
		if (req.readyState != 4) return;
		if (req.status != 200 && req.status != 304) {
//			alert('HTTP error ' + req.status);
			return;
		}
		callback(req);
	}
	if (req.readyState == 4) return;
	req.send(postData);
}

function XMLHttpFactories() {
	return [
		function () {return new XMLHttpRequest()},
		function () {return new ActiveXObject("Msxml2.XMLHTTP")},
		function () {return new ActiveXObject("Msxml3.XMLHTTP")},
		function () {return new ActiveXObject("Microsoft.XMLHTTP")}
	];
}

function createXMLHTTPObject() {
	var xmlhttp = false;
	var factories = XMLHttpFactories();
	for (var i=0;i<factories.length;i++) {
		try {
			xmlhttp = factories[i]();
		}
		catch (e) {
			continue;
		}
		break;
	}
	return xmlhttp;
}
*/