var lists = new Array();

// First set of text and values
lists['LETTINGSMIN']    = new Array();
lists['LETTINGSMIN'][0] = new Array(
	'No min',
	'£300',
	'£400',
	'£500',
	'£600',
	'£700',
	'£800',
	'£900',
	'£1000'	
);
lists['LETTINGSMIN'][1] = new Array(
	'0',
	'300',
	'400',
	'500',
	'600',
	'700',
	'800',
	'900',
	'1000'	
);

// Second set of text and values
lists['SALESMIN']    = new Array();
lists['SALESMIN'][0] = new Array(
	'No min',
	'£50,000',
	'£60,000',
	'£70,000',
	'£80,000',
	'£90,000',
	'£100,000',
	'£120,000',
	'£140,000',
	'£160,000',
	'£180,000',
	'£200,000',
	'£225,000',
	'£250,000'
);
lists['SALESMIN'][1] = new Array(
	'0',
	'50000',
	'60000',
	'70000',
	'80000',
	'90000',
	'100000',
	'120000',
	'140000',
	'160000',
	'180000',
	'200000',
	'225000',
	'250000'
);


// First set of text and values
lists['LETTINGSMAX']    = new Array();
lists['LETTINGSMAX'][0] = new Array(
	'No max',
	'£300',
	'£400',
	'£500',
	'£600',
	'£700',
	'£800',
	'£900',
	'£1000',
	'£1200',
	'£1500',	
	'£1700',		
	'£2000'			
);
lists['LETTINGSMAX'][1] = new Array(
	'1000000',
	'300',
	'400',
	'500',
	'600',
	'700',
	'800',
	'900',
	'1000',
	'1200',
	'1500',	
	'1700',		
	'2000'
);

// Second set of text and values
lists['SALESMAX']    = new Array();
lists['SALESMAX'][0] = new Array(
	'No max',
	'£50,000',
	'£60,000',
	'£70,000',
	'£80,000',
	'£90,000',
	'£100,000',
	'£120,000',
	'£140,000',
	'£160,000',
	'£180,000',
	'£200,000',
	'£225,000',
	'£250,000',
	'£275,000',
	'£300,000',
	'£325,000',
	'£350,000',
	'£375,000',
	'£400,000'
);
lists['SALESMAX'][1] = new Array(
	'1000000',
	'50000',
	'60000',
	'70000',
	'80000',
	'90000',
	'100000',
	'120000',
	'140000',
	'160000',
	'180000',
	'200000',
	'225000',
	'250000',
	'275000',
	'300000',
	'325000',
	'350000',
	'375000',
	'400000'
);








// This function goes through the options for the given
// drop down box and removes them in preparation for
// a new set of values

function emptyList( box ) {
	// Set each option to null thus removing it
	while ( box.options.length ) box.options[0] = null;
}

// This function assigns new drop down options to the given
// drop down box from the list of lists specified

function fillList( box, arr ) {
	// arr[0] holds the display text
	// arr[1] are the values

	for ( i = 0; i < arr[0].length; i++ ) {

		// Create a new drop down option with the
		// display text and value from arr

		option = new Option( arr[0][i], arr[1][i] );

		// Add to the end of the existing options

		box.options[box.length] = option;
	}

	// Preselect option 0

	box.selectedIndex=0;
}

// This function performs a drop down list option change by first
// emptying the existing option list and then assigning a new set

function changeList( box ) {
	// Isolate the appropriate list by using the value
	// of the currently selected option

	list = lists[box.options[box.selectedIndex].value + "MIN"];
//	alert (box.options[box.selectedIndex].value);

	// Next empty the slave list

	emptyList( box.form.selPriceMin );

	// Then assign the new list values

	fillList( box.form.selPriceMin, list );


	list = lists[box.options[box.selectedIndex].value + "MAX"];
//	alert (box.options[box.selectedIndex].value + "123");

	// Next empty the slave list

	emptyList( box.form.selPriceMax );

	// Then assign the new list values

	fillList( box.form.selPriceMax, list );

	
}
