function ZipGenerator() {

  this.XMLHTTP = null;

  this.strSession = null;

  if (window.XMLHttpRequest) {
  	this.XMLHTTP = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
  	try {
  		this.XMLHTTP =	new ActiveXObject('Msxml2.XMLHTTP');
  	} catch(ex) {
  		try {
  		this.XMLHTTP = new ActiveXObject('Microsoft.XMLHTTP');
  		} catch(ex) {
  		}
  	}
  }

  ZipGenerator.prototype.initZipGeneration = function(fileName, objZipGenerator, aHandler, articles) {
  	this.XMLHTTP.open('POST', fileName);
  	this.XMLHTTP.onreadystatechange = new Function(objZipGenerator + '.' + aHandler + '()');
  	this.XMLHTTP.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  	post  = 'zip=' + encodeURIComponent(this.strSession) + '&articles=' + articles;
  	this.XMLHTTP.send(post);
  }

  ZipGenerator.prototype.zip = function(keyword) {
    if (this.XMLHTTP.readyState == 4) {
      document.getElementById('wait').style.display = 'none';
    }
  }

}

var zg = null;
function initZipGenerator(sessionId) {
  zg = new ZipGenerator();
  zg.strSession = sessionId;
}
