function InstallManager() {
	var autoUpdate = null;
	var autoUpdateErr = "";
			
	this.validate = function () {
		if (! params.isInstalled() && autoUpdate!=null && (autoUpdate.InProgressProducts())=="" || autoUpdate.ArePendingUpdates("Amadeus Cruise")) {
				autoUpdate.ForceUpdate(true, "Automatic Update");
		}
	}	

	this.initialize = function () {
		try {		
			//var errCode = InstallAutomaticUpdate();
			//if (errCode != 0) {
			//	autoUpdateErr = szAUInstallErrorMsg; // TODO: log these errors somewhere
			//	return;
			//}
			autoUpdate = new ActiveXObject("AutoUpdate.AutoUpdateSrv");
			autoUpdate.SetWebServer(window.top.location.hostname);
			params.cruiseInstalled = (autoUpdate.GetProductList().toUpperCase().indexOf("CRUISE") != -1);	
			if (params.cruiseInstalled) {
				params.cruisePath = autoUpdate.GetProductPath("CRUISE");
				params.clientRelease  = autoUpdate.GetProductVersion("CRUISE");
				params.clientRelease.search(/(.+)[B|b|P|p](\d+)/)
				params.clientVersion = RegExp.$1;
				params.clientBuild = RegExp.$2;
			}
			params.auRelease  = autoUpdate.GetProductVersion("");
			params.auRelease.search(/(.+)[B|b|P|p](\d+)/)
			params.auVersion = RegExp.$1;
			params.auBuild = RegExp.$2;
			params.sgCompatible = ((params.clientVersion >= StartupParameters.CLIENT_MIN_SG_VERSION) && (autoUpdate.SGIsHWID_available(true, false) == 0));
		}
		catch (e) {}
	}	

	
	this.updateWebConfStatistics = function() {
		var url = "http://"+top.location.hostname+"/webconfv1/wcfgSetLastProductAccess.asp?CertificateId="+params.cid+"&ProductName=Cruise";
		try {
			var tmpDOM = this.createDOMDocument(true);
			tmpDOM.load(url);
		}
		catch(e) {}
	}
	
	
	this.createDOMDocument = function (a_async) {
		var result = null;
		var versions = ["Msxml2.DOMDocument.4.0", "Msxml2.DOMDocument.3.0"];
		for (var i=0; i<versions.length; i++) {
			try {
				result = new ActiveXObject(versions[i]);
				break;
			}
			catch (e) {}
		}
		if (result != null)
			result.async = (typeof(a_async)!="undefined" && a_async);
	}
	
}
