var http = create();
var reportId;

function create() {
	var xmlHttp = false;
	try {
   		xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
	} catch(e) {
   		try {
	        xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
   		} catch(e) {
	        xmlHttp  = false;
   		}
	}
	if (!xmlHttp  && typeof XMLHttpRequest != 'undefined') {
   		xmlHttp = new XMLHttpRequest();
	}
	return xmlHttp;
}

function submit(id) {
	// set the global report id
	reportId = id;
	// make a request
	http.open('get', 'generateimagetags.php');
	// prevent caching
	http.setRequestHeader("Pragma", "no-cache");
	http.setRequestHeader("Cache-Control", "must-revalidate");
	http.setRequestHeader("If-Modified-Since", document.lastModified);
    http.send(null);
    // tell which method will catch the response
	http.onreadystatechange = responseCatcher;
}

function responseCatcher() {
	if(http.readyState == 4){
        var response = http.responseText;
        // set the inner html to the content of the response
        document.getElementById('testdiv').innerHTML = response;
    }
}
 
