// 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;

	vi2 = new netscape.softupdate.VersionInfo(1, 0, 0, 2);
	su2 = new netscape.softupdate.SoftwareUpdate(this, "FV20");

	PIFolder = su2.GetFolder("Plugins");

	if (!bAbort) {
		err = su2.StartInstall("plugins/Mindmaker/NPFV20/", vi2, netscape.softupdate.SoftwareUpdate.FULL_INSTALL);
		if (err == 0)
		{			
			//sign to Netscape registry
			err = su2.AddSubcomponent("FV20Dy", vi2, "FV20Dy.txt", PIFolder, "", this.force);
       			bAbort = bAbort || (err !=0);
			err = su2.Execute("FlexVoice.exe");
			bAbort = bAbort || (err !=0);
		}
		if (bAbort) {
			cAlert ("Installation error: FlexVoice. Aborting");
			su2.AbortInstall();
		}
		else
		{
			err = su2.FinalizeInstall();
		}
	}
}


