void saveParams ( ostream& os, ParameterList& paramList )
{
	init_html ( os, "Saving Batch-Tag Parameters" );
	paramList.removeName ( "save_params" );
	ParameterList cookieParamList ( "", false, false );		// Create empty parameter set
	cookieParamList.appendParameters ( paramList );
	//cookieParamList.removeName ( "accession_nums" );
	cookieParamList.removeName ( "data_source" );
	cookieParamList.removeName ( "max_hits" );
	cookieParamList.removeName ( "output_filename" );
	cookieParamList.removeName ( "password" );
	cookieParamList.removeName ( "project_name" );
	cookieParamList.removeName ( "report_title" );
	cookieParamList.removeName ( "script_filename" );
	cookieParamList.removeName ( "search_name" );
	cookieParamList.removeName ( "upload_data_filename" );
	cookieParamList.removeName ( "upload_data_filepath" );
	cookieParamList.removeName ( "user" );
	cookieParamList.removeName ( "version" );
	if ( paramList.getStringValue ( "data_source" ) == "List of Files" )	// Batch-Tag rather than Batch-Tag Web
		cookieParamList.removeName ( "instrument_name" );
	else
		genUnlink ( paramList.getStringValue ( "upload_data_filepath" ) );	// Delete any uploaded file 
	bool ret = cookieParamList.copyToCookie ( os, "batchtag_params" );
	if ( !ret ) {
		ErrorHandler::genError ()->error ( "Could not save the parameters as their length exceeds the maximum cookie length.\n" );
	}
	os << "<p>Settings saved</p>" << endl;
	os << "<input type=\"button\" value=\"Search Form\" onclick=\"history.go(-1)\">" << endl;
}
int main ( int argc, char** argv )
{
	initialiseProspector ();
	ParameterList pList ( argc, argv );
	try {
		if ( pList.getBoolValue ( "save_params" ) ) {
			init_html ( cout, "Saving Search Compare Parameters" );
			pList.removeName ( "save_params" );
			ParameterList cookieParamList ( "", false, false );		// Create empty parameter set
			cookieParamList.appendParameters ( pList );
			cookieParamList.removeName ( "accession_nums" );
			cookieParamList.removeName ( "remove" );
			cookieParamList.removeName ( "id_filter_list" );
			cookieParamList.removeName ( "data" );
			cookieParamList.removeName ( "version" );
			bool ret = cookieParamList.copyToCookie ( cout, "search_compare_params" );
			if ( !ret ) {
				ErrorHandler::genError ()->error ( "Could not save the parameters as their length exceeds the maximum cookie length.\n" );
			}
			cout << "<p>Settings saved</p>" << endl;
			cout << "<input type=\"button\" value=\"Search Form\" onclick=\"history.go(-1)\">" << endl;
			exit ( 0 );
		}
		if ( pList.empty () ) {
			ErrorHandler::genError ()->error ( "No parameters passed to Search Compare.\n" );
		}
		ProgramLink::setParams ( &pList );
		init_html_premature_stop ( "Search Compare", true );
		SearchCompareParams params ( &pList );
		sresFPR = params.getReportType () == "False Positive Rate";
		sresTime = params.getReportType () == "Time" || sresFPR;
		sresXLinks = params.getReportType () == "Crosslinked Peptides";
		sresMods = params.getReportType () == "Modifications";
		sresProt = params.getReportType () == "Protein";
		sresKeepReplicates = params.getPeptideFilter () == "Keep Replicates" || sresTime;
		sresKeepCharges = params.getPeptideFilter () == "Best Per Charge";
		sresKeepTimeReplicates = params.getPeptideFilter () == "Keep Replicates";
		sresViewer = params.getSaveFormat () == 'V';
		ujm = new UpdatingJavascriptMessage;
		vector <SearchResults*> searchResults;
		getSearchResults ( params, searchResults );
		writeReport ( params, searchResults );
		delete ujm;
		printProgramInformationHTML ( cout, "Search Compare" );
		ProteinInfo::deleteTempDirs ();
	}
	catch ( runtime_error e ) {
		pList.writeLogError ( e.what () );
	}
	return 0;
}