#! /usr/bin/perl
###############################################################################
#
# Advanced search interface
#
# Written by Behan Webster <behanw@verisim.com>
# Copyright (c) 1996 by Verisim, Inc.  All rights reserved.
#
###############################################################################


require query;

###########################################################################
# Parse the command arguments
#
if ($#ARGV<0) {
	if ($ENV{'QUERY_STRING'}) {
		#
		# Read key pairs from the get
		#
		splitPairs($ENV{'QUERY_STRING'});
		$frames  = $FORM{'f'};
		$page    = $FORM{'p'};
		$display = $FORM{'d'};
		$number  = $FORM{'n'};
		$query   = $FORM{'q'};
	}
} else {
	#
	# Read the argument list from the command line
	#
	($frames, $page, $display, $number, @query) = @ARGV;
	$query    =  join(' ', @query);
}

$oldquery =  $query;
$oldquery =~ tr/ /+/;
$query    =  unarmorURL ($query);

#
# Query the index and print the results
#
resultsPage($frames, $page, $query, $oldquery, $advancedCgi, "advancedQueryForm");

