// Conditional alert.
function cAlert (message) {
   if (!this.silent)
      alert(message);
}

// Conditional confirm.
function cConfirm (message) {
   if (this.silent)
      return true;
   else
      return confirm(message);
}

// Variable indicating whether or not installation should proceed.
bInstall = true;

// Make sure Java is enabled before doing anything else.
if ( !navigator.javaEnabled() ) {
   bInstall = false;
   cAlert ("Java must be enabled to install.");
}

// If all conditions look good, proceed with the installation.
if (bInstall) {
	bAbort = false;

	vi = new netscape.softupdate.VersionInfo(1, 0, 0, 2);
	su = new netscape.softupdate.SoftwareUpdate(this, "FV20 Plugin");

	PIFolder = su.GetFolder("Plugins");

	err = su.StartInstall("plugins/Mindmaker/NPFV20/", vi, netscape.softupdate.SoftwareUpdate.FULL_INSTALL);
	if (err == 0)
	{			
		//registry(1.param) relative to the StartInstall registry

		err = su.AddSubcomponent("NPFV20Plugin", vi, "NPFV.dll", PIFolder, "", this.force);
        	bAbort = bAbort || (err !=0);
		err = su.AddSubcomponent("NPFV20PluginCLASS", vi, "NPFV.class", PIFolder, "", this.force);
		bAbort = bAbort || (err !=0);
	}
	if (bAbort) {
		cAlert ("Installation error: NPFV.DLL-CLASS. Aborting");
		su.AbortInstall();
	}
	else
	{
		err = su.FinalizeInstall();
		if (err == 0)
			navigator.plugins.refresh(true);
		else if (err == 999)
			cAlert("You must reboot to finish this installation");
	}
}


