/*!
**********************************************************************
@file systemCheck.js

Copyright 2003-2006 Adobe Systems Incorporated.                     
All Rights Reserved.                                                
                                                                    
NOTICE: All information contained herein is the property of Adobe   
Systems Incorporated.                                                                                                                    

***********************************************************************
*/

function systemCheck_wp(inController)
{
	this.SetController(inController);
	this.param = {
		k_systemCheckRunningAppsListId: 'errorCheck',
		hasPayloadError: false,
		hasWarningAppConflict: false,
		hasBlockingAppConflict: false,
		hasWarningConflictingProcess: false,
		hasBlockingConflictingProcess: false,
		hasSystemRequirementError: false,
		hasSystemRequirementHardStop: false,
		hasSystemRequirementHardStopConflicts: false,
		hasPayloadPolicyError: false,
		hasPayloadPolicyErrorHardStop: false
	};
	this._errorDOMs = null;
	this.alreadyDidExit = false;
	this._nonTransientErrorDOMs = new Object();
}

systemCheck_wp.prototype = new WizardPage("systemCheck");

/**
Creates a series of blocking and warning apps in an array (blocking[], warning[]) if they exist.
*/
systemCheck_wp.prototype.updateRunningAppsList = function(inSession)
{
	var blockingAppNames = new Array();
	var warningAppNames = new Array();
	var blockingAppNamesNoDupes = new Array();
	var warningAppNamesNoDupes = new Array();
	
	try
	{
		var allRunningApps = inSession.GetRunningApplications();
		var currentPayload = null;
		var setupCount = 0;
		
		// For each payload...
		for (var p in inSession.payloadMap)
		{
			// If it has conflicting processes listed at all...
			currentPayload = inSession.payloadMap[p];
			
			if (currentPayload.ConflictingProcesses && currentPayload.ConflictingProcesses[0])
			{
				inSession.LogInfo("The List of conflicting process for the paylaod with name - " + currentPayload.ProductName + "-are: " );
				// See if the running application matches for Blocking or Warning
				for (var regexIndex = 0; regexIndex < currentPayload.ConflictingProcesses.length; ++regexIndex) 
				{	
					inSession.LogInfo(currentPayload.ConflictingProcesses[regexIndex]["pattern"]);
					// For each running application...
					for (var appIndex=0; appIndex < allRunningApps.Applications.length; ++appIndex)
					{
						// Check to see if the application name matches the known pattern
						if (allRunningApps.Applications[appIndex].osName.match(currentPayload.ConflictingProcesses[regexIndex]["pattern"]))
						{
							// If it is blocking, not as an error
							if ("1" == currentPayload.ConflictingProcesses[regexIndex]["blocking"]) {
								blockingAppNames.push(allRunningApps.Applications[appIndex].friendlyName);
							} 
							else 
							{
								warningAppNames.push(allRunningApps.Applications[appIndex].friendlyName);
							}
						}
					}
				}
			}
		}
		if (inSession.IsOSUpdaterRunning()) {
			this.AddError("warningProcesses", "alertWarning",
				[new LocalizedString("systemPageWindowsUpdatesRunning1"),
				new LocalizedString("systemPageWindowsUpdatesRunning2"),
				new LocalizedString("systemPageWindowsUpdatesRunning3")], 3);
		}

		// Remove duplicate entries in both lists	
		var blockingAssoc = new Object;
		for (var i = 0; i < blockingAppNames.length; i++)   
			blockingAssoc[blockingAppNames[i]] = blockingAppNames[i];

		for (var k in blockingAssoc) 
		   blockingAppNamesNoDupes.push(blockingAssoc[k]);
		
		var warningAssoc = new Object;
		for (var i = 0; i < warningAppNames.length; i++)   
			warningAssoc[warningAppNames[i]] = warningAppNames[i];

		for (var k in warningAssoc) 
		   warningAppNamesNoDupes.push(warningAssoc[k]);	
	
	}
	catch(e)
	{
		inSession.LogWarning("Exception while testing application run states.");
	}
	
	return new Array(blockingAppNamesNoDupes, warningAppNamesNoDupes);
}

// used by silent...
systemCheck_wp.prototype._stringForLog = function(inStringOrObj)
{
	var result = inStringOrObj;
	if (inStringOrObj.Translate && typeof inStringOrObj.Translate == "function")
	{
		result = inStringOrObj.Translate(gSession.localization, "en_US"); //FIXME gSession
	}
	return result;
}

/**
Fabricate the DOM for a system check error/warning
*/
systemCheck_wp.prototype._createErrorListElement = function(inClass, inText)
{
	var session = this.wizardControl.session;

	var isArray = function(inObj)
	{
		return typeof inObj == "object" && inObj.length && inObj.concat && inObj.join;
	};

	var isLocalizedString = function(inObj)
	{
		return typeof inObj == "object" && inObj.Translate && typeof inObj.Translate == "function";
	};

	var resolveString = function(inObj, forLog)
	{
		if (isLocalizedString(inObj))
		{
			if (forLog)
				return inObj.Translate(session.localization, 'en_US');
			else
				return inObj.Translate(session.localization);
		}
		return inObj;
	};

	var contentList = inText;
	if (!isArray(inText))
		contentList = new Array(inText);
		
	var errorDiv = document.createElement("div");
	if (inClass)
		errorDiv.className = inClass;

	for (var i in contentList)
	{
		var item = contentList[i];
		if (isArray(item))
		{
			if (item.length > 0)
			{
				var listElement = document.createElement("ul");
				listElement.style.listStyleType = "none";
				listElement.style.fontWeight = "bold";
				for (var si in item)
				{
					var li = document.createElement("li");
					li.appendChild(document.createTextNode(resolveString(item[si])));
					listElement.appendChild(li);
					if (inClass == "alertCritical")
						session.LogError(" - " + resolveString(item[si], true));
					else
						session.LogWarning(" - " + resolveString(item[si], true));
				}
				errorDiv.appendChild(listElement);
			}
		}
		else
		{
			var p = document.createElement("p");
			//p.appendChild(document.createTextNode(resolveString(item)));
			// TODO: Maybe we can put condition to create createTextNode or insert directly.
			var _myabcde = resolveString(item);
			var myregexp_gq = new RegExp("_GLOBAL_NEWLINE_XML", "g");
			_myabcde = _myabcde.replace(myregexp_gq,"<br />");
			p.innerHTML = _myabcde;
			errorDiv.appendChild(p);
			if (inClass == "alertCritical")
				session.LogError(resolveString(item, true));
			else
				session.LogWarning(resolveString(item, true));
		}
	}

	return errorDiv;
}




/**
Create and displayd an ErrorListElement.  Arguments are the same as for createErrorListElement().
Errors are identified by a string ID that can be used to remove the error.  If you add an error
that already exists, the existing one will be replaced with the new content.

inLabel, inOptErrorEnd and the members of inOptErrorList may be either strings or LocalizedString objects.
LocalizedString objects are recommended to ensure that the UI gets the proper localization and the
log file gets en_US without having to think about it when you generate the string.

inCategory should be one of
1 or 2 or 3 or 4
1)Min Sys Requirements & ManifestErrors[Hard stop, minimum requirements not met: You cannot continue] Picture:X, Buttonz:Quit
2)Conflicting Payloads Installed [Hard stop, conflict: You cannot continue] Picture:X, Buttonz:Quit
3)Multiple Soft Stops [Soft Stop: Warning that something about your machine configuration is not fully supported, but
you are permitted to continue at your own risk.] Picture:!, Buttonz:Quit, Continue
4)Closeme&Retry Conflicting Processes [Conflicting process...fix this then retry.] Picture:X, Buttonz:Quit, Retry
*/
systemCheck_wp.prototype.AddError = function(inId, inClass, inText, inCategory)
{
	if (!this._errorDOMs)
	{
		this._errorDOMs = new Object();
	}
	if (!(this._errorDOMs[inCategory]))
	{
		this._errorDOMs[inCategory] = new Array();
	}
	var newDom = this._createErrorListElement(inClass, inText);
	this._errorDOMs[inCategory].push(newDom.innerHTML);
	
	// Cache the non-transient errors
	if(inId != "blockingProcesses" && inId != "warningProcesses")
	{
		if(!this._nonTransientErrorDOMs[inCategory])
			this._nonTransientErrorDOMs[inCategory] = new Array();
		
		this._nonTransientErrorDOMs[inCategory].push(newDom.innerHTML);
	}
}

systemCheck_wp.prototype.renderError = function(newDom, inCategory)
{
	try
	{
		var errorTitle = this.wizardControl.session.localization.GetString("locProductName","Adobe Product")
						+" "
						+this.wizardControl.session.localization.GetString("locInstaller", "Installer")
						+" - "
						+this.wizardControl.session.localization.GetString("locErrorWindowTitle", "Alerts");

		if(inCategory==1 || inCategory==2)
		{
			var button1 = {label:this.wizardControl.session.localization.GetString("locBtnQuit", "Quit"), left:"256px", top:"306px", returnCode:"1", hotkey:"Q", defaultOption:"7"};
			var buttonsArray = new Array(button1);

			var _WE = new WizardError1(this.wizardControl.session, errorTitle, newDom, buttonsArray, "error",
					this.wizardControl.session.localization.GetString("locSystemCheck", "System Check")
					);
			this._errorDOMs = null;
		    this.alreadyDidExit = true;
			this.wizardControl.NavQuit();//for quit, quit
			
		}
		else if(inCategory==3)
		{
			var button1 = {label:this.wizardControl.session.localization.GetString("locBtnQuit", "Quit"), left:"187px", top:"306px", returnCode:"1", hotkey:"Q", defaultOption:"7"};
			var button2 = {label:this.wizardControl.session.localization.GetString("locBtnContinue", "Continue"), left:"325px", top:"306px", returnCode:"2", hotkey:"C", defaultOption:"0"};

			var buttonsArray = new Array(button1,button2);

			var _WE = new WizardError1(this.wizardControl.session, errorTitle, newDom, buttonsArray, "warning",
					this.wizardControl.session.localization.GetString("locWarning", "Warning")
					);
			if(_WE.returnValue=="1" || _WE.returnValue=="")
			{
				this._errorDOMs = null;
	            this.alreadyDidExit = true;
				this.wizardControl.NavQuit();//for quit, quit
			}
			else
			{
				//for continue, do nothing, let _WE close and we proceed
			}
		}
		else if(inCategory==4)
		{
			var button1 = {label:this.wizardControl.session.localization.GetString("locBtnQuit", "Quit"), left:"187px", top:"306px", returnCode:"1", hotkey:"Q", defaultOption:"4"};
			var button2 = {label:this.wizardControl.session.localization.GetString("locBtnRetry", "Retry"), left:"325px", top:"306px", returnCode:"2", hotkey:"R", defaultOption:"3"};

			var buttonsArray = new Array(button1,button2);

			var _WE = new WizardError1(this.wizardControl.session, errorTitle, newDom, buttonsArray, "error",
					this.wizardControl.session.localization.GetString("locApplicationsrunning", "Applications running")
					);
			if(_WE.returnValue=="1" || _WE.returnValue=="")
			{
				this._errorDOMs = null;
				this.alreadyDidExit = true;
				this.wizardControl.NavQuit();//for quit, quit
			}
			else
			{
				this.OnSubsequentShow();//for retry
			}
		}
		else
		{
			alert("unknown error category :: "+inCategory+" it should be one amongst 1,2,3,4 only!");
		}
	}
	catch (ex)//exceptional implies resolve the error like earlier, now your screen will become crappy
	{
		if (this.contentBox && newDom)
		{
			this.contentBox.innerHTML=newDom;
		}
	}
}

/**
Check for system requirements
*/
systemCheck_wp.prototype.runSystemRequirementsCheck = function(inSession, inOptPayloadList)
{
    // Early return if we are in maintenance mode
	if (inSession.IsMaintenanceMode())
	{
		return new Array();	
	}
	return RunSystemRequirementsCheck(inSession, inOptPayloadList);
}


/**
Check for manifest errors and warnings
*/
systemCheck_wp.prototype.checkManifestErrors = function(inSession)
{
	var payloadWithErrors = null;
	var ecount = 0;
	
	for (var p in inSession.payloadMap)
	{
		payloadWithErrors  = inSession.payloadMap[p];
		if (1 == payloadWithErrors.hasManifestErrors)
			ecount++;
	}
	
	return ecount;
}


/**
Check payload policy for co-existence violations.
*/
systemCheck_wp.prototype.checkPayloadPolicy = function()
{
	var result = true;

	if (!this.wizardControl.session.IsMaintenanceMode())
	{
		this.wizardControl.session.PayloadPolicyInit();
		var driver = this.wizardControl.session.GetDriverPayload();
		if (driver)
		{
			driver = this.wizardControl.session.sessionPayloads[driver.AdobeCode];
			if (driver)
			{
				var ppo = driver.policyNode;
				if (ppo)
				{
					// Generic driver constraint handle.  The driver normally has an Intrinsic.Driver constraint.
					// If it doesn't, that means a dependency has some other intrinsic constraint that override's
					// the driver's normal constraint.
					if (!(ppo.GetConstraintClass() == kPolicyClass.Intrinsic && ppo.GetConstraintCode() == kIntrinsicPolicyCode.Driver))
					{
						this.param.hasPayloadPolicyError = true;
						this.param.hasPayloadPolicyErrorHardStop = (ppo.GetAction() == kPolicyActionNo);

						// Enumerate the details if available, but skip over Intrinsic.Sysreq as we
						// present an aggregate of those elsewhere.
						var detailCount = 0;
						for (var error in ppo._message.detail)
						{
							var detail = ppo._message.detail[error];
							if (!(detail.dependentConstraintClass == kPolicyClass.Intrinsic && detail.dependentConstraintCode == kIntrinsicPolicyCode.Sysreq) && detail.text)
							{
								this.AddError("policyDriver." + error, detail.className, detail.text,2);
								detailCount++;
							}
						}

						// If no details, at least try for a note
						var blockingListErrors = new Array();
						if (detailCount == 0 && ppo._message.note && !(detail.dependentConstraintClass == kPolicyClass.Intrinsic && detail.dependentConstraintCode == kIntrinsicPolicyCode.Sysreq))
						{
							blockingListErrors.push(ppo._message.note);
							this.AddError("policyDriver", this.param.hasPayloadPolicyErrorHardStop ? "alertCritical" : "alertWarning",
							 	[new LocalizedString("locDriverCannotInstall", "[productName] cannot be installed because:"),
							 	[ppo._message.note]], this.param.hasPayloadPolicyErrorHardStop ? 2:3);
						}

						result = false;
					}

					// But not all business rules are encoded as constraints, so handle those here.
					else
					{
					}
				}
			}
		}
	}
	return result;
}


/**
Rebuild the conflicting processes list information
*/
systemCheck_wp.prototype.updateConflictingProcesses = function()
{
	var runningAppWarningsAndErrors = this.updateRunningAppsList(this.wizardControl.session);
	this.param.hasBlockingConflictingProcess  = false;
	this.param.hasWarningConflictingProcess = false;
	
	if (runningAppWarningsAndErrors[0] || runningAppWarningsAndErrors[1]) 
	{
		this.param.hasBlockingConflictingProcess  = runningAppWarningsAndErrors[0].length > 0;
		this.param.hasWarningConflictingProcess = runningAppWarningsAndErrors[1].length > 0;
		
		// Show contents of running apps list
		this._refreshConflictingProcessesAlert(runningAppWarningsAndErrors);
	}
}


/**
Recreate the conflicting processes error alert
*/
systemCheck_wp.prototype._refreshConflictingProcessesAlert = function(inArrBlockingAndWarningsArray)
{
	if (inArrBlockingAndWarningsArray[0].length > 0)
	{
		this.AddError("blockingProcesses", "alertCritical",
			[new LocalizedString("systemPageAppCloseError"),
			inArrBlockingAndWarningsArray[0],
			new LocalizedString("systemPageAppCloseError2")],4);
	}

	if (inArrBlockingAndWarningsArray[1].length > 0)
	{
		this.AddError("warningProcesses", "alertWarning",
			[new LocalizedString("systemPageAppCloseWarning"),
			inArrBlockingAndWarningsArray[1],
			new LocalizedString("systemPageAppCloseWarningEnd")],3);
	}
}


/**
Check for errors and warnings once on page load.
*/
systemCheck_wp.prototype.GUISystemCheck = function()
{
    var fatalErrorList = new Array();
    
	// Check and report manifest errors ================================================
	var manifestErrorCount = this.checkManifestErrors(this.wizardControl.session);
	
	if (manifestErrorCount > 0)
	{
		this.param.hasPayloadError = true;
	}
	
	if (this.param.hasPayloadError == true)
	{			
		if (confirm("Manifest errors were found. Click OK to exit and view report, cancel to continue"))
		{
			gSession.UIShowManifestErrors();		
		this.wizardControl.NavQuit();//for quit, quit
		}
	} 
	else 
	{
		this.UpdateProgress("10%");
	}

	// Check for and report fatal pre-installation errors ================================================
	if (this.wizardControl.session.sessionErrorMessages && this.wizardControl.session.sessionErrorMessages[0])
	{
		this.param.hasSystemRequirementHardStopConflicts = true;
		this.param.hasBlockingAppConflict = true;
		
		for (var i = 0; i < this.wizardControl.session.sessionErrorMessages.length; i++)
		{
			// TODO: have sessionErrorMessages be LocalizedString objects to begin with.
			fatalErrorList.push(new LocalizedString(this.wizardControl.session.sessionErrorMessages[i][0], this.wizardControl.session.sessionErrorMessages[i][1]));
		}

		this.AddError("sessionErrors", "alertCritical",
			[new LocalizedString("systemPageSessionErrorStart", "Critical errors were found in setup:"),
			fatalErrorList,
			new LocalizedString("systemPageSessionErrorEnd", "Please see the log file for details.")],1);
		return;
	}
	else
	{
		this.UpdateProgress("20%");
	}
	
	// Check and report on system requirements ================================================

	// Assemble a list of driver & dependencies
	var hiddenPayloads = new Array();
	var driver = this.wizardControl.session.GetDriverPayload();
	if (driver)
	{
		driver = this.wizardControl.session.sessionPayloads[driver.AdobeCode];
		if (driver)
		{
			var required = driver.GetDependentsArray();
			for (var p in required)
			{
				hiddenPayloads.push(required[p]);
			}
			hiddenPayloads.push(driver);
		}
	}
	
	// If we have some, do a requriements check on just that set.
	if (hiddenPayloads.length > 0)
	{
		var systemRequirementResults = this.runSystemRequirementsCheck(this.wizardControl.session, hiddenPayloads);

		if (systemRequirementResults[0] || systemRequirementResults[1] || systemRequirementResults[2])
		{
			this.param.hasSystemRequirementError = ((systemRequirementResults[0].length > 0)
			 										|| (systemRequirementResults[1].length > 0)
													|| (systemRequirementResults[2].length > 0)) ? true : false;
		
			var hasHardStop = false;
		
			// Errors showing requirements
			if (systemRequirementResults[0])
			{
				if (systemRequirementResults[0].length > 0)
				{
					hasHardStop = true;
					this.AddError("sysreqError", "alertCritical",
					 	[new LocalizedString("systemPageSysReqErrorStart"),
					 	systemRequirementResults[0],
					 	new LocalizedString("systemPageSysReqErrorEnd")],1);
				}
				else
				{
					this.UpdateProgress("40%");
				}
			}
		
			// Errors showing problems with the system
			if (systemRequirementResults[2])
			{
				if (systemRequirementResults[2].length > 0)
				{
					hasHardStop = true;
					this.AddError("sysreqExclude", "alertCritical",
						[new LocalizedString("systemPageSysReqExcludedErrorStart"),
						systemRequirementResults[2],
						new LocalizedString("systemPageSysReqExcludedErrorEnd")],1);
				}
				else
				{
					this.UpdateProgress("50%");
				}
			}
		
			// Warnings showing requirements
			if (systemRequirementResults[1])
			{
				if (systemRequirementResults[1].length > 0)
				{
					this.AddError("sysreqWarning", "alertWarning",
					 	[new LocalizedString("systemPageSysReqWarningStart"),
					 	systemRequirementResults[1],
					 	new LocalizedString("systemPageSysReqWarningEnd")],3);
				}
				else
				{
					this.UpdateProgress("70%");
				}
			}
		
			// Set hasSystemRequirementHardStop to match whether or not there were any hard stops
			this.param.hasSystemRequirementHardStop = hasHardStop;
		}
	}

	// Check for and report fatal payload policy errors ================================================
	if (!this.checkPayloadPolicy())
	{
		// And short circuit
		return;
	}
	else
	{
		this.UpdateProgress("90%");
	}

	// Check and report running applications ================================================
	this.updateConflictingProcesses();
	this.UpdateProgress("100%");
}

systemCheck_wp.prototype.CopyTransientErrorsToErrorDOM = function()
{
	this._errorDOMs = new Object();
	for(var i = 1; i < 5; i++)
	{
		if(this._nonTransientErrorDOMs[i])
		{
			this._errorDOMs[i] = new Array();
			for(var j = 0; j < this._nonTransientErrorDOMs[i].length; j++)
			{
				this._errorDOMs[i].push(this._nonTransientErrorDOMs[i][j]);
			}
		}
	}
}

systemCheck_wp.prototype.onNext = function()
{
	if(this.wizardControl.session.IsRecordMode() == false)
	{
		var workflowMode = this.wizardControl.session.getWorkflowMode();

		var mode ="install";
		if ( workflowMode == kWorkflowModeInstall )
		{
			mode ="install";
		}
		else if(workflowMode == kWorkflowModeMaintenance)
		{
			mode = "repair";
		}
		else if(workflowMode == kWorkflowModeUninstall)
		{
			mode = "remove";
		}
		
		for(var adobecode in this.wizardControl.session.sessionPayloads)
		{
		    var payload = this.wizardControl.session.sessionPayloads[adobecode];
		    this.wizardControl.session.LogInfo("Calling pre-system check custom code for payload " + adobecode );
		    var caRet = this.wizardControl.session.CallCustomActionCode(adobecode, mode, payload.GetPayloadOverrideProperties(this.wizardControl.session.properties), "sys", 0);
		    this.wizardControl.session.LogDebug("Pre-system check custom code for payload " + adobecode + " returned " + caRet);
		    
		}
	}	
	this.wizardControl.session.UIShowWindow(1);
	return (true);
}

systemCheck_wp.prototype.OnSubsequentShow = function()
{
	if(this.wizardControl.session.IsRecordMode() == false)
	{
		this.CopyTransientErrorsToErrorDOM();
		this.alreadyDidExit = false;

		this.updateConflictingProcesses();
		this.DisplayErrors();
	}
}

systemCheck_wp.prototype.OnFirstShow = function()
{
	if(this.wizardControl.session.IsRecordMode() == false)
	{
		// Start the operations and ui bar of progress updating
		this.GUISystemCheck();

		this.DisplayErrors();
	}
	else
	{
	   this.UpdateProgress("100%");
	}
}

systemCheck_wp.prototype.DisplayErrors = function()
{
	//ALL ADDERRORZ HAVE BEEN CALLED BY NOW POPULATING this._errorDOMs[category] for category in (1,2,3,4)
	//UX SPEC mentions that we check in the following order (1,2, 4&3 together if they exist,4 only, 3 only, no errorz)
	var arrayRef=null;
	var content="";
	
	/**************************all 1***************************/
	arrayRef=null;
	if(this._errorDOMs && this._errorDOMs[1])
		arrayRef = this._errorDOMs[1];
	if(arrayRef && arrayRef.length>0)
	{
		content = "";
		for (var domindex in arrayRef)
		{
			content+=arrayRef[domindex];
		}
		this.renderError(content,1);
	}
	/***************************all 2**************************/
	arrayRef=null;
	if(this._errorDOMs && this._errorDOMs[2])
		arrayRef = this._errorDOMs[2];
	if(arrayRef && arrayRef.length>0)
	{
		content = "";
		for (var domindex in arrayRef)
		{
			content+=arrayRef[domindex];
		}
		this.renderError(content,2);
	}
	/***************************4&3 together**************************/
	var arrayRef4=null;
	var arrayRef3=null;
	if(this._errorDOMs && this._errorDOMs[4])
		arrayRef4 = this._errorDOMs[4];
	if(this._errorDOMs && this._errorDOMs[3])
		arrayRef3 = this._errorDOMs[3];
	if(arrayRef4 && arrayRef3 && arrayRef4.length>0 && arrayRef3.length>0)
	{
		content = "";
		for (var domindex in arrayRef4)
		{
			content+=arrayRef4[domindex];
		}
		for (var domindex in arrayRef3)
		{
			content+=arrayRef3[domindex];
		}
		this.renderError(content,4);
	}
	else
	{
		/***************************only 4**************************/
		if(arrayRef4 && arrayRef4.length>0)
		{
			content = "";
			for (var domindex in arrayRef4)
			{
				content+=arrayRef4[domindex];
			}
			this.renderError(content,4);
		}
		/****************************only 3*************************/
		if(arrayRef3 && arrayRef3.length>0)
		{
			content = "";
			for (var domindex in arrayRef3)
			{
				content+=arrayRef3[domindex];
			}
			this.renderError(content,3);
		}
	}
	/************************no errorz*****************************/
	// nothing to render for no errorz!
	/*****************************************************/
}

systemCheck_wp.prototype.UpdateProgress = function(progressPercentage)
{
	this.wizardControl.session.SetProgressToBootstrapper(progressPercentage);
	
	return (true);
}

systemCheck_wp.prototype.onCancel = function()
{	
	this.wizardControl.session.UIExitDialog();
}

// Return the name of the class.
"systemCheck_wp";
