var BCModules = {
	HiddenID : String,
	NumModules : Number,
	Modules : null,
	Init : function(hidden) {
		this.HiddenID = hidden;
		this.NumModules = 0;	
		this.Modules = new Array();
	},
	RegisterModule : function(m) {
		this.Modules[this.NumModules] = m;
		this.NumModules++;
	},
	CheckActiveX : function() {
		if (typeof(PluginDetect) != "undefined" && PluginDetect.isIE && !PluginDetect.ActiveXEnabled)
		{
			//document.getElementById("checking").style.display="none";
			//document.getElementById("warnactivex").style.display="";
			//AutoSizeThisPopup(false);
			location=location+"&warnactivex=1";
			return false;
		}
		return true;
	},
	CheckBrowser : function() {
		var allowBrowser = TestBrowser();
		if (!allowBrowser)
		{
			//document.getElementById("checking").style.display="none";	
			//document.getElementById("warnbrowserunsupported").style.display="";
			//AutoSizeThisPopup(false);
			location=location+"&warnbrowser=1";
			return false;
		}
		return true;
	},
	CheckFinished : function() {
		// executes after all modules have been checked
		var params = '';
		for (var i=0;i<this.NumModules;i++)
		{
			if (!this.Modules[i].IsInstalled)
				params+= ",-" + this.Modules[i].Index;		
		}

		for (var i=0;i<this.NumModules;i++)
		{
			if (this.Modules[i].IsInstalled)
				params+= "," + this.Modules[i].Index;				
		}
		
		if (params.length > 0)
		{
			var el = document.getElementById(this.HiddenID);
			if (el)
				el.value = params.substring(1);

			__doPostBack('Page', '');
		}

	}
}


