buyingprices = new Array;
buyingprices[0] = "0";
buyingprices[1] = "25,000";
buyingprices[2] = "50,000";
buyingprices[3] = "75,000";
buyingprices[4] = "100,000";
buyingprices[5] = "125,000";
buyingprices[6] = "150,000";
buyingprices[7] = "175,000";
buyingprices[8] = "200,000";
buyingprices[9] = "300,000";
buyingprices[10] = "400,000";
buyingprices[11] = "500,000";
buyingprices[12] = "600,000";
buyingprices[13] = "700,000";
buyingprices[14] = "800,000";
buyingprices[15] = "900,000";
buyingprices[16] = "1,000,000";
buyingprices[17] = "3,000,000";
buyingprices[18] = "5,000,000";
buyingprices[19] = "6,000,000+";

rentingprices = new Array;
rentingprices[0] = "0";
rentingprices[1] = "50";
rentingprices[2] = "100";
rentingprices[3] = "150";
rentingprices[4] = "200";
rentingprices[5] = "250";
rentingprices[6] = "300";
rentingprices[7] = "350";
rentingprices[8] = "400";
rentingprices[9] = "450";
rentingprices[10] = "500";
rentingprices[11] = "700";
rentingprices[12] = "900";
rentingprices[13] = "1,000";
rentingprices[14] = "2,000";
rentingprices[15] = "2,500+";

function switchsearch() {

	d1 = document.getElementById('type1');
	d2 = document.getElementById('type2');

	l = document.getElementById('minprice').options.length;
	for(i=0;i<l;i++) {
		document.getElementById('minprice').options[0] = null;
	}

	l = document.getElementById('maxprice').options.length;
	for(i=0;i<l;i++) {
		document.getElementById('maxprice').options[0] = null;
	}

	if (d1.checked == true) {
		for(i=0;i<buyingprices.length;i++) {
			document.getElementById('minprice').options[i] = new Option("£"+buyingprices[i].replace('+',''),buyingprices[i].replace(',','').replace('+',''));
			document.getElementById('maxprice').options[i] = new Option("£"+buyingprices[i],buyingprices[i].replace(',',''));
		}
	} else {
		for(i=0;i<rentingprices.length;i++) {
			document.getElementById('minprice').options[i] = new Option("£"+rentingprices[i].replace('+',''),rentingprices[i].replace(',','').replace('+',''));
			document.getElementById('maxprice').options[i] = new Option("£"+rentingprices[i],rentingprices[i].replace(',',''));
		}
	}

	document.getElementById('maxprice').selectedIndex = (document.getElementById('maxprice').options.length-1);
}

 

