function setSearchType(searchType) {
	var propCategory = document.getElementById("propCategory");
	
	switch(propCategory.value) {
		case "residentialsales": {
			setSales(searchType);
			break;
		}
		case "newhomes": {
			setNewHomes(searchType);
			break;
		}
		default: {
			break;
		}
	}
	
}

function setSales(searchType) {

	var advButton = document.getElementById("advancedButton");
	advButton.style.display = "";

	if(searchType == "basic") {
		var label1 = document.getElementById("label1");
		var label2 = document.getElementById("label2");
		var label3 = document.getElementById("label3");
		var label4 = document.getElementById("label4");

		label1.innerHTML = "Min Price";
		label2.innerHTML = "Max Price";
		label3.innerHTML = "Select Office";
		//label4.innerHTML = "Town/Postcode";
		label3.style.display = "";
		label4.style.display = "none";

		var propCategory = document.getElementById("propCategory");
		propCategory.value = "residentialsales";
		
		var select1 = document.getElementById("select1");
		var select2 = document.getElementById("select2");
		var select3 = document.getElementById("select3");
		var input4 = document.getElementById("input4");
		
		select1.name = "MinPrice";
		select2.name = "MaxPrice";
		select3.name = "Town";
		input4.name = "";
		select3.style.display = "";
		input4.style.display = "none";
		
		ClearOptions(select1);
		ClearOptions(select2);
		ClearOptions(select3);

		//var hiddenFields = document.getElementById("hidden");
		//hiddenFields.innerHTML = '<input value="Results" name="WCI" type="hidden" /><input value="" name="WCU" type="hidden" /><input value="-1" name="PROPERTYTYPE" type="hidden" /><input value="276" name="EAID" type="hidden" />';
		//document.searchform.action = 'http://www.dezrez.com/DRApp/Search.ASP';
		//document.searchform.method = "get";
		//MinBeds
		//1~9
		
		AddToOptionList(select1, 0, "No Minimum");
		AddToOptionList(select1, 50000, "\u00A350,000");
		AddToOptionList(select1, 60000, "\u00A360,000");
		AddToOptionList(select1, 70000, "\u00A370,000");
		AddToOptionList(select1, 80000, "\u00A380,000");
		AddToOptionList(select1, 90000, "\u00A390,000");
		AddToOptionList(select1, 100000, "\u00A3100,000");
		AddToOptionList(select1, 120000, "\u00A3120,000");
		AddToOptionList(select1, 140000, "\u00A3140,000");
		AddToOptionList(select1, 160000, "\u00A3160,000");
		AddToOptionList(select1, 180000, "\u00A3180,000");
		AddToOptionList(select1, 200000, "\u00A3200,000");
		AddToOptionList(select1, 250000, "\u00A3250,000");
		AddToOptionList(select1, 300000, "\u00A3300,000");
		AddToOptionList(select1, 350000, "\u00A3350,000");
		AddToOptionList(select1, 400000, "\u00A3400,000");
		AddToOptionList(select1, 450000, "\u00A3450,000");
		AddToOptionList(select1, 500000, "\u00A3500,000");
		AddToOptionList(select1, 600000, "\u00A3600,000");
		AddToOptionList(select1, 700000, "\u00A3700,000");
		AddToOptionList(select1, 800000, "\u00A3800,000");
		AddToOptionList(select1, 900000, "\u00A3900,000");
		AddToOptionList(select1, 1000000, "\u00A31000,000");
		
		AddToOptionList(select2, 50000, "\u00A350,000");
		AddToOptionList(select2, 60000, "\u00A360,000");
		AddToOptionList(select2, 70000, "\u00A370,000");
		AddToOptionList(select2, 80000, "\u00A380,000");
		AddToOptionList(select2, 90000, "\u00A390,000");
		AddToOptionList(select2, 100000, "\u00A3100,000");
		AddToOptionList(select2, 120000, "\u00A3120,000");
		AddToOptionList(select2, 140000, "\u00A3140,000");
		AddToOptionList(select2, 160000, "\u00A3160,000");
		AddToOptionList(select2, 180000, "\u00A3180,000");
		AddToOptionList(select2, 200000, "\u00A3200,000");
		AddToOptionList(select2, 250000, "\u00A3250,000");
		AddToOptionList(select2, 300000, "\u00A3300,000");
		AddToOptionList(select2, 350000, "\u00A3350,000");
		AddToOptionList(select2, 400000, "\u00A3400,000");
		AddToOptionList(select2, 450000, "\u00A3450,000");
		AddToOptionList(select2, 500000, "\u00A3500,000");
		AddToOptionList(select2, 600000, "\u00A3600,000");
		AddToOptionList(select2, 700000, "\u00A3700,000");
		AddToOptionList(select2, 800000, "\u00A3800,000");
		AddToOptionList(select2, 900000, "\u00A3900,000");
		AddToOptionList(select2, 9999999, "\u00A31000,000+");

		select2.selectedIndex = select2.options.length - 1; //set the selected option to the last one in the list.
		
		AddToOptionList(select3, "", "All Offices");		
		AddToOptionList(select3, "(BS),(BST),(BSN),(BSV),(BSS),(BSE),(BSW),(ST)", "Bishop's Stortford");		
		AddToOptionList(select3, "(SW)", "Saffron Walden");		
		AddToOptionList(select3, "(GD)", "Great Dunmow");		
		AddToOptionList(select3, "(q)", "Land/Equestrian");		
		
		//Now highlight/unhighlight the buttons...
		mybutton = document.getElementById("rsSalesButton");
		mybutton.className = "active";
		mybutton = document.getElementById("rsLettingsButton");
		mybutton.className = "";
		mybutton = document.getElementById("commercialButton");
		mybutton.className = "";
		mybutton = document.getElementById("newhomesButton");
		mybutton.className = "";

	}
	else {
		var label1 = document.getElementById("label1");
		var label2 = document.getElementById("label2");
		var label3 = document.getElementById("label3");
		var label4 = document.getElementById("label4");

		label1.innerHTML = "Min Price";
		label2.innerHTML = "Max Price";
		label4.innerHTML = "Town/Postcode";
		label3.style.display = "none";
		label4.style.display = "";

		var propCategory = document.getElementById("propCategory");
		propCategory.value = "residentialsales";
		
		var select1 = document.getElementById("select1");
		var select2 = document.getElementById("select2");
		var select3 = document.getElementById("select3");
		var input4 = document.getElementById("input4");
		
		select1.name = "MinPrice";
		select2.name = "MaxPrice";
		select3.name = "";
		input4.name = "Town";
		select3.style.display = "none";
		input4.style.display = "";
		

		//Before we clear the options, just keep a note of the current selectedIndex...
		select1Index = select1.selectedIndex;
		select2Index = select2.selectedIndex;

		ClearOptions(select1);
		ClearOptions(select2);

		//var hiddenFields = document.getElementById("hidden");
		//hiddenFields.innerHTML = '<input value="Results" name="WCI" type="hidden" /><input value="" name="WCU" type="hidden" /><input value="-1" name="PROPERTYTYPE" type="hidden" /><input value="276" name="EAID" type="hidden" />';
		//document.searchform.action = 'http://www.dezrez.com/DRApp/Search.ASP';
		//document.searchform.method = "get";
		//MinBeds
		//1~9
		
		AddToOptionList(select1, 0, "No Minimum");
		AddToOptionList(select1, 50000, "\u00A350,000");
		AddToOptionList(select1, 60000, "\u00A360,000");
		AddToOptionList(select1, 70000, "\u00A370,000");
		AddToOptionList(select1, 80000, "\u00A380,000");
		AddToOptionList(select1, 90000, "\u00A390,000");
		AddToOptionList(select1, 100000, "\u00A3100,000");
		AddToOptionList(select1, 120000, "\u00A3120,000");
		AddToOptionList(select1, 140000, "\u00A3140,000");
		AddToOptionList(select1, 160000, "\u00A3160,000");
		AddToOptionList(select1, 180000, "\u00A3180,000");
		AddToOptionList(select1, 200000, "\u00A3200,000");
		AddToOptionList(select1, 250000, "\u00A3250,000");
		AddToOptionList(select1, 300000, "\u00A3300,000");
		AddToOptionList(select1, 350000, "\u00A3350,000");
		AddToOptionList(select1, 400000, "\u00A3400,000");
		AddToOptionList(select1, 450000, "\u00A3450,000");
		AddToOptionList(select1, 500000, "\u00A3500,000");
		AddToOptionList(select1, 600000, "\u00A3600,000");
		AddToOptionList(select1, 700000, "\u00A3700,000");
		AddToOptionList(select1, 800000, "\u00A3800,000");
		AddToOptionList(select1, 900000, "\u00A3900,000");
		AddToOptionList(select1, 1000000, "\u00A31000,000");
		
		AddToOptionList(select2, 50000, "\u00A350,000");
		AddToOptionList(select2, 60000, "\u00A360,000");
		AddToOptionList(select2, 70000, "\u00A370,000");
		AddToOptionList(select2, 80000, "\u00A380,000");
		AddToOptionList(select2, 90000, "\u00A390,000");
		AddToOptionList(select2, 100000, "\u00A3100,000");
		AddToOptionList(select2, 120000, "\u00A3120,000");
		AddToOptionList(select2, 140000, "\u00A3140,000");
		AddToOptionList(select2, 160000, "\u00A3160,000");
		AddToOptionList(select2, 180000, "\u00A3180,000");
		AddToOptionList(select2, 200000, "\u00A3200,000");
		AddToOptionList(select2, 250000, "\u00A3250,000");
		AddToOptionList(select2, 300000, "\u00A3300,000");
		AddToOptionList(select2, 350000, "\u00A3350,000");
		AddToOptionList(select2, 400000, "\u00A3400,000");
		AddToOptionList(select2, 450000, "\u00A3450,000");
		AddToOptionList(select2, 500000, "\u00A3500,000");
		AddToOptionList(select2, 600000, "\u00A3600,000");
		AddToOptionList(select2, 700000, "\u00A3700,000");
		AddToOptionList(select2, 800000, "\u00A3800,000");
		AddToOptionList(select2, 900000, "\u00A3900,000");
		AddToOptionList(select2, 9999999, "\u00A31000,000+");

		select1.selectedIndex = select1Index;
		select2.selectedIndex = select2Index;		
		
		//Now highlight/unhighlight the buttons...
		mybutton = document.getElementById("rsSalesButton");
		mybutton.className = "active";
		mybutton = document.getElementById("rsLettingsButton");
		mybutton.className = "";
		mybutton = document.getElementById("commercialButton");
		mybutton.className = "";
		mybutton = document.getElementById("newhomesButton");
		mybutton.className = "";
		
		
		//Type of Property
			//All
			//New Build
	}

}


function setLettings() {

	var advButton = document.getElementById("advancedButton");
	advButton.style.display = "none";

	var label1 = document.getElementById("label1");
	var label2 = document.getElementById("label2");
	var label3 = document.getElementById("label3");
	var label4 = document.getElementById("label4");

	label1.innerHTML = "Min Price";
	label2.innerHTML = "Max Price";
	label3.innerHTML = "Min Bedrooms";
	label3.style.display = "";
	label4.style.display = "none";
	
	var propCategory = document.getElementById("propCategory");
	propCategory.value = "residentiallettings";
	
	var select1 = document.getElementById("select1");
	var select2 = document.getElementById("select2");
	var select3 = document.getElementById("select3");
	var input4 = document.getElementById("input4");

	select1.name = "minPrice";
	select2.name = "maxPrice";
	select3.name = "minBedrooms";
	select3.style.display = "";
	input4.style.display = "none";
	
	//var hiddenFields = document.getElementById("hidden");
	//hiddenFields.innerHTML = '<input value="MUGR" name="group" type="hidden" /><input value="r" name="saleOrRent" type="hidden" /><input value="M" name="pricePrefix" type="hidden" />';
	//document.searchform.action = 'http://www.fastcropit.com/mugr/html/templates/mullucks_search_pages/results.cfm';
	//document.searchform.method = "post";

	ClearOptions(select1);
	ClearOptions(select2);
	ClearOptions(select3);
	
	AddToOptionList(select1, 100, "\u00A3100");
	AddToOptionList(select1, 150, "\u00A3150");
	AddToOptionList(select1, 200, "\u00A3200");
	AddToOptionList(select1, 250, "\u00A3250");
	AddToOptionList(select1, 300, "\u00A3300");
	AddToOptionList(select1, 400, "\u00A3400");
	AddToOptionList(select1, 500, "\u00A3500");
	AddToOptionList(select1, 750, "\u00A3750");
	AddToOptionList(select1, 1000, "\u00A31000");
	AddToOptionList(select1, 2000, "\u00A32000");
	
	AddToOptionList(select2, 150, "\u00A3150");
	AddToOptionList(select2, 200, "\u00A3200");
	AddToOptionList(select2, 250, "\u00A3250");
	AddToOptionList(select2, 300, "\u00A3300");
	AddToOptionList(select2, 400, "\u00A3400");
	AddToOptionList(select2, 500, "\u00A3500");
	AddToOptionList(select2, 750, "\u00A3750");
	AddToOptionList(select2, 1000, "\u00A31000");
	AddToOptionList(select2, 2000, "\u00A32000");
	AddToOptionList(select2, 999999, "\u00A35000+");

	select2.selectedIndex = select2.options.length - 1; //set the selected option to the last one in the list.	

	
	AddToOptionList(select3, 1, "1 Bedroom");
	AddToOptionList(select3, 2, "2 Bedroom");
	AddToOptionList(select3, 3, "3 Bedroom");
	AddToOptionList(select3, 4, "4 Bedroom");
	AddToOptionList(select3, 5, "5 Bedroom");
	AddToOptionList(select3, 6, "6 Bedroom");
	
	//Now highlight/unhighlight the buttons...
	mybutton = document.getElementById("rsSalesButton");
	mybutton.className = "";
	mybutton = document.getElementById("rsLettingsButton");
	mybutton.className = "active";
	mybutton = document.getElementById("commercialButton");
	mybutton.className = "";
	mybutton = document.getElementById("newhomesButton");
	mybutton.className = "";
	
}


function setCommercial() {

	var advButton = document.getElementById("advancedButton");
	advButton.style.display = "none";

	var label1 = document.getElementById("label1");
	var label2 = document.getElementById("label2");
	var label3 = document.getElementById("label3");
	var label4 = document.getElementById("label4");

	label1.innerHTML = "Min Area";
	label2.innerHTML = "Max Area";
	label3.innerHTML = "Property Type";
	label3.style.display = "";
	label4.style.display = "none";

	var propCategory = document.getElementById("propCategory");
	propCategory.value = "commercial";
	
	var select1 = document.getElementById("select1");
	var select2 = document.getElementById("select2");
	var select3 = document.getElementById("select3");
	var input4 = document.getElementById("input4");

	//var hiddenFields = document.getElementById("hidden");
	//hiddenFields.innerHTML = '<input type="hidden" name="counter" value="0" /><input type="hidden" name="dim" value="1" />';
  	//document.searchform.action = 'http://www.propertypilot.co.uk/cgi-bin/db2www.exe/168results.d2w/report';
	//document.searchform.method = "post";

	select1.name = "minsize";
	select2.name = "maxsize";
	select3.name = "unittype";
	select3.style.display = "";
	input4.style.display = "none";
	
	ClearOptions(select1);
	ClearOptions(select2);
	ClearOptions(select3);

	AddToOptionList(select3, 5, "Industrial");
	AddToOptionList(select3, 1, "Office");
	AddToOptionList(select3, 2, "Shop");
	AddToOptionList(select3, 10, "Misc");
	AddToOptionList(select3, 13, "Investment");
	AddToOptionList(select3, 15, "Restaurant");
	AddToOptionList(select3, 17, "Development");
	
	AddToOptionList(select1, 0, "0 sq.ft.");
	AddToOptionList(select1, 100, "100 sq.ft.");
	AddToOptionList(select1, 250, "250 sq.ft.");
	AddToOptionList(select1, 500, "500 sq.ft.");
	AddToOptionList(select1, 1000, "1000 sq.ft.");
	AddToOptionList(select1, 2000, "2000 sq.ft.");
	AddToOptionList(select1, 3000, "3000 sq.ft.");
	AddToOptionList(select1, 5000, "5000 sq.ft.");
	AddToOptionList(select1, 10000, "10000 sq.ft.");
	
	AddToOptionList(select2, 250, "250 sq.ft.");
	AddToOptionList(select2, 500, "500 sq.ft.");
	AddToOptionList(select2, 1000, "1000 sq.ft.");
	AddToOptionList(select2, 2000, "2000 sq.ft.");
	AddToOptionList(select2, 3000, "3000 sq.ft.");
	AddToOptionList(select2, 5000, "5000 sq.ft.");
	AddToOptionList(select2, 10000, "10000 sq.ft.");
	AddToOptionList(select2, 999999, "10000+ sq.ft.");

	select2.selectedIndex = select2.options.length - 1; //set the selected option to the last one in the list.	
	
	//Now highlight/unhighlight the buttons...
	mybutton = document.getElementById("rsSalesButton");
	mybutton.className = "";
	mybutton = document.getElementById("rsLettingsButton");
	mybutton.className = "";
	mybutton = document.getElementById("commercialButton");
	mybutton.className = "active";
	mybutton = document.getElementById("newhomesButton");
	mybutton.className = "";
	
	
}

function setNewHomes(searchType) {

	var advButton = document.getElementById("advancedButton");
	advButton.style.display = "";

	if(searchType == "basic") {

		var label1 = document.getElementById("label1");
		var label2 = document.getElementById("label2");
		var label3 = document.getElementById("label3");
		var label4 = document.getElementById("label4");

		label1.innerHTML = "Min Price";
		label2.innerHTML = "Max Price";
		label3.innerHTML = "Select Office";
		//label4.innerHTML = "Town/Postcode";
		label3.style.display = "";
		label4.style.display = "none";

		var propCategory = document.getElementById("propCategory");
		propCategory.value = "newhomes";
		
		var select1 = document.getElementById("select1");
		var select2 = document.getElementById("select2");
		var select3 = document.getElementById("select3");
		var input4 = document.getElementById("input4");
		
		select1.name = "MinPrice";
		select2.name = "MaxPrice";
		select3.name = "Town";
		input4.name = "";
		select3.style.display = "";
		input4.style.display = "none";
		
		ClearOptions(select1);
		ClearOptions(select2);
		ClearOptions(select3);

		AddToOptionList(select1, 0, "No Minimum");
		AddToOptionList(select1, 50000, "\u00A350,000");
		AddToOptionList(select1, 60000, "\u00A360,000");
		AddToOptionList(select1, 70000, "\u00A370,000");
		AddToOptionList(select1, 80000, "\u00A380,000");
		AddToOptionList(select1, 90000, "\u00A390,000");
		AddToOptionList(select1, 100000, "\u00A3100,000");
		AddToOptionList(select1, 120000, "\u00A3120,000");
		AddToOptionList(select1, 140000, "\u00A3140,000");
		AddToOptionList(select1, 160000, "\u00A3160,000");
		AddToOptionList(select1, 180000, "\u00A3180,000");
		AddToOptionList(select1, 200000, "\u00A3200,000");
		AddToOptionList(select1, 250000, "\u00A3250,000");
		AddToOptionList(select1, 300000, "\u00A3300,000");
		AddToOptionList(select1, 350000, "\u00A3350,000");
		AddToOptionList(select1, 400000, "\u00A3400,000");
		AddToOptionList(select1, 450000, "\u00A3450,000");
		AddToOptionList(select1, 500000, "\u00A3500,000");
		AddToOptionList(select1, 600000, "\u00A3600,000");
		AddToOptionList(select1, 700000, "\u00A3700,000");
		AddToOptionList(select1, 800000, "\u00A3800,000");
		AddToOptionList(select1, 900000, "\u00A3900,000");
		AddToOptionList(select1, 1000000, "\u00A31000,000");
		
		AddToOptionList(select2, 50000, "\u00A350,000");
		AddToOptionList(select2, 60000, "\u00A360,000");
		AddToOptionList(select2, 70000, "\u00A370,000");
		AddToOptionList(select2, 80000, "\u00A380,000");
		AddToOptionList(select2, 90000, "\u00A390,000");
		AddToOptionList(select2, 100000, "\u00A3100,000");
		AddToOptionList(select2, 120000, "\u00A3120,000");
		AddToOptionList(select2, 140000, "\u00A3140,000");
		AddToOptionList(select2, 160000, "\u00A3160,000");
		AddToOptionList(select2, 180000, "\u00A3180,000");
		AddToOptionList(select2, 200000, "\u00A3200,000");
		AddToOptionList(select2, 250000, "\u00A3250,000");
		AddToOptionList(select2, 300000, "\u00A3300,000");
		AddToOptionList(select2, 350000, "\u00A3350,000");
		AddToOptionList(select2, 400000, "\u00A3400,000");
		AddToOptionList(select2, 450000, "\u00A3450,000");
		AddToOptionList(select2, 500000, "\u00A3500,000");
		AddToOptionList(select2, 600000, "\u00A3600,000");
		AddToOptionList(select2, 700000, "\u00A3700,000");
		AddToOptionList(select2, 800000, "\u00A3800,000");
		AddToOptionList(select2, 900000, "\u00A3900,000");
		AddToOptionList(select2, 9999999, "\u00A31000,000+");

		select2.selectedIndex = select2.options.length - 1; //set the selected option to the last one in the list.
		
		
		AddToOptionList(select3, "", "All Offices");		
		AddToOptionList(select3, "(BS),(BST),(BSN),(BSV),(BSS),(BSE),(BSW),(ST)", "Bishop's Stortford");		
		AddToOptionList(select3, "(SW)", "Saffron Walden");		
		AddToOptionList(select3, "(GD)", "Great Dunmow");		
		AddToOptionList(select3, "(q)", "Land/Equestrian");		
		
		//Type of Property
			//All
			//New Build
		
		//Now highlight/unhighlight the buttons...
		mybutton = document.getElementById("rsSalesButton");
		mybutton.className = "";
		mybutton = document.getElementById("rsLettingsButton");
		mybutton.className = "";
		mybutton = document.getElementById("commercialButton");
		mybutton.className = "";
		mybutton = document.getElementById("newhomesButton");
		mybutton.className = "active";
	
	
	}
	else {


		var label1 = document.getElementById("label1");
		var label2 = document.getElementById("label2");
		var label3 = document.getElementById("label3");
		var label4 = document.getElementById("label4");

		label1.innerHTML = "Min Price";
		label2.innerHTML = "Max Price";
		label4.innerHTML = "Town/Postcode";
		label3.style.display = "none";
		label4.style.display = "";

		var propCategory = document.getElementById("propCategory");
		propCategory.value = "newhomes";
		
		var select1 = document.getElementById("select1");
		var select2 = document.getElementById("select2");
		var select3 = document.getElementById("select3");
		var input4 = document.getElementById("input4");
		
		select1.name = "MinPrice";
		select2.name = "MaxPrice";
		select3.name = "";
		input4.name = "Town";
		select3.style.display = "none";
		input4.style.display = "";

		//Before we clear the options, just keep a note of the current selectedIndex...
		select1Index = select1.selectedIndex;
		select2Index = select2.selectedIndex;
		
		ClearOptions(select1);
		ClearOptions(select2);

		//var hiddenFields = document.getElementById("hidden");
		//hiddenFields.innerHTML = '<input value="Results" name="WCI" type="hidden" /><input value="" name="WCU" type="hidden" /><input value="-1" name="PROPERTYTYPE" type="hidden" /><input value="276" name="EAID" type="hidden" />';
		//document.searchform.action = 'http://www.dezrez.com/DRApp/Search.ASP';
		//document.searchform.method = "get";
		//MinBeds
			//1~9
		
		AddToOptionList(select1, 0, "No Minimum");
		AddToOptionList(select1, 50000, "\u00A350,000");
		AddToOptionList(select1, 60000, "\u00A360,000");
		AddToOptionList(select1, 70000, "\u00A370,000");
		AddToOptionList(select1, 80000, "\u00A380,000");
		AddToOptionList(select1, 90000, "\u00A390,000");
		AddToOptionList(select1, 100000, "\u00A3100,000");
		AddToOptionList(select1, 120000, "\u00A3120,000");
		AddToOptionList(select1, 140000, "\u00A3140,000");
		AddToOptionList(select1, 160000, "\u00A3160,000");
		AddToOptionList(select1, 180000, "\u00A3180,000");
		AddToOptionList(select1, 200000, "\u00A3200,000");
		AddToOptionList(select1, 250000, "\u00A3250,000");
		AddToOptionList(select1, 300000, "\u00A3300,000");
		AddToOptionList(select1, 350000, "\u00A3350,000");
		AddToOptionList(select1, 400000, "\u00A3400,000");
		AddToOptionList(select1, 450000, "\u00A3450,000");
		AddToOptionList(select1, 500000, "\u00A3500,000");
		AddToOptionList(select1, 600000, "\u00A3600,000");
		AddToOptionList(select1, 700000, "\u00A3700,000");
		AddToOptionList(select1, 800000, "\u00A3800,000");
		AddToOptionList(select1, 900000, "\u00A3900,000");
		AddToOptionList(select1, 1000000, "\u00A31000,000");
		
		AddToOptionList(select2, 50000, "\u00A350,000");
		AddToOptionList(select2, 60000, "\u00A360,000");
		AddToOptionList(select2, 70000, "\u00A370,000");
		AddToOptionList(select2, 80000, "\u00A380,000");
		AddToOptionList(select2, 90000, "\u00A390,000");
		AddToOptionList(select2, 100000, "\u00A3100,000");
		AddToOptionList(select2, 120000, "\u00A3120,000");
		AddToOptionList(select2, 140000, "\u00A3140,000");
		AddToOptionList(select2, 160000, "\u00A3160,000");
		AddToOptionList(select2, 180000, "\u00A3180,000");
		AddToOptionList(select2, 200000, "\u00A3200,000");
		AddToOptionList(select2, 250000, "\u00A3250,000");
		AddToOptionList(select2, 300000, "\u00A3300,000");
		AddToOptionList(select2, 350000, "\u00A3350,000");
		AddToOptionList(select2, 400000, "\u00A3400,000");
		AddToOptionList(select2, 450000, "\u00A3450,000");
		AddToOptionList(select2, 500000, "\u00A3500,000");
		AddToOptionList(select2, 600000, "\u00A3600,000");
		AddToOptionList(select2, 700000, "\u00A3700,000");
		AddToOptionList(select2, 800000, "\u00A3800,000");
		AddToOptionList(select2, 900000, "\u00A3900,000");
		AddToOptionList(select2, 9999999, "\u00A31000,000+");
		

		select1.selectedIndex = select1Index;
		select2.selectedIndex = select2Index;	

		//Type of Property
			//All
			//New Build
		
		//Now highlight/unhighlight the buttons...
		mybutton = document.getElementById("rsSalesButton");
		mybutton.className = "";
		mybutton = document.getElementById("rsLettingsButton");
		mybutton.className = "";
		mybutton = document.getElementById("commercialButton");
		mybutton.className = "";
		mybutton = document.getElementById("newhomesButton");
		mybutton.className = "active";
	}
}


function initialise() {
	setSales('basic');
	showClock();
}

function setLink(myform) {
	
	var select1 = document.getElementById("select1");
	var select2 = document.getElementById("select2");
	var select3 = document.getElementById("select3");
	var input4 = document.getElementById("input4");
	
	var str = input4.value;
	str = str.toLowerCase();
	input4.value = str.replace("bishops", "bishop's");
	
	var qs = "";
	var propCat = document.getElementById("propCategory").value;
	switch(propCat) {
		case "residentialsales": {
			qs += "&host=http://www.dezrez.com/DRApp/Search.ASP";
			qs += "&method=get";
			qs += "&WCI=Results&WCU=&PROPERTYTYPE=-1&EAID=276";
			break;
		}
		case "residentiallettings": {
			qs += "&host=http://www.fastcropit.com/mugr/html/templates/mullucks_search_pages/results.cfm";
			qs += "&method=post";
			qs += "&group=MUGR&saleOrRent=r&pricePrefix=M";
			break;
		}
		case "commercial": {
			qs += "&host=http://www.propertypilot.co.uk/cgi-bin/db2www.exe/168results.d2w/report";
			qs += "&method=post";
			qs += "&counter=0&dim=1";
			break;
		}
		case "newhomes": {
			qs += "&host=http://www.dezrez.com/DRApp/Search.ASP";
			qs += "&method=get";
			qs += "&WCI=Results&WCU=&PROPERTYTYPE=-1&EAID=276&Glazing_type=2";
			break;
		}
		default: {
			alert("default case");
			break;
		}
	}
	
	qs += "&" + select1.name + "=" + select1.value;
	qs += "&" + select2.name + "=" + select2.value;
	qs += "&" + select3.name + "=" + select3.value;
	qs += "&" + input4.name + "=" + input4.value;
	
	var addr = "http://www.mullucks.co.uk/index.php?option=com_wrapper&view=wrapper&Itemid=51" + qs;
	window.location = addr;
	return false;
}

