var OLS_OPTION_SCANVULNERABILITY = 128;

var OLS_INFECTION_VIRUS     = 0;
var OLS_INFECTION_HIDDEN	= 1;
var OLS_INFECTION_SPYWARE   = 2;

var Opswat_Info_IsProductInstalled           = 0x00000001;
var Opswat_Info_IsExpired                    = 0x00000002;
var Opswat_Info_IsEnabled                    = 0x00000004;
var Opswat_Info_ProductNotInstalled          = 0x00000008; // send if no products been detected
var Opswat_Info_ScanFailed                   = 0x00000010; // could not scan with OPSWAT
var Opswat_Info_UnpdVerf_NotExecuted         = 0x00000020; // could not execute update verify
var Opswat_Info_UnpdVerf_UpdateIsLatest      = 0x00000040; // update verify found the update as latest
var Opswat_Info_UnpdVerf_UpdateIsNotLatest   = 0x00000080; // update verify found the update as NOT latest
var Opswat_Info_ProductOutdated              = 0x00000400; // Product DB is out of date (user define interval)

var OLS_OPSWAT_AV = 5;
var OLS_OPSWAT_SW = 6;
var OLS_OPSWAT_FW = 7;

function UpdateProgress(total, complete)
{
	var i, percent = 0;

	if (total != 0)
	{
		percent = (complete / total) * 10;
		if (percent > 10)
			percent = 10;
		else
		{
		    for (i = 1; i <= 10; i++) 
	            document.all('progress'+i).style.backgroundColor = '#FFFFFF';
		}
	}

	for (i = 1; i <= percent; i++)
		document.all('progress'+i).style.backgroundColor = '#31CA3E';
}

function GetActionName(action)
{
	var acttxt = "";

	switch (action & ~OLS_ACTION_SUBMIT)
	{
	case OLS_ACTION_DISINFECT:
		acttxt = top.custom.cleaning_disinfect;
		break;

	case OLS_ACTION_DELETE:
		acttxt = top.custom.cleaning_delete;
		break;

	case OLS_ACTION_RENAME:
		acttxt = top.custom.cleaning_rename;
		break;

	default:
		acttxt = top.custom.cleaning_none;
		break;
	}
	if ((action & OLS_ACTION_SUBMIT) == OLS_ACTION_SUBMIT)
	{
		if (action != OLS_ACTION_SUBMIT)
			acttxt +=  " & " + top.custom.cleaning_submit;
		else
			acttxt = top.custom.cleaning_submit;
	}
	return acttxt;
}

function OnClose()
{
	top.window.close();
}
