<!--

	var lease_price = new Array(
	"100",
	"200",
	"300",
	"400",
	"500",
	"600",
	"700",
	"800",
	"900",
	"1000",
	"1250",
	"1500",
	"1750",
	"2000",
	"2250",
	"2500",
	"2750",
	"3000",
	"4000",
	"5000",
	"6000",
	"7000",
	"8000",
	"9000",
	"10000"
	);

	var normal_price = new Array(
	"100000",
	"125000",
	"150000",
	"175000",
	"200000",
	"225000",
	"250000",
	"275000",
	"300000",
	"325000",
	"350000",
	"375000",
	"400000",
	"425000",
	"450000",
	"475000",
	"500000",
	"600000",
	"700000",
	"800000",
	"900000",
	"1000000",
	"1250000",
	"1500000",
	"1750000",
	"2000000",
	"2250000",
	"2500000",
	"2750000",
	"3000000",
	"3250000",
	"3500000",
	"3750000",
	"4000000",
	"4500000",
	"5000000",
	"5500000",
	"6000000",
	"6500000",
	"7000000",
	"7500000",
	"8000000",
	"8500000",
	"9000000",
	"9500000",
	"10000000"
	);
	
	function addCommas(nStr)
	{
		nStr += '';
		x = nStr.split('.');
		x1 = x[0];
		x2 = x.length > 1 ? '.' + x[1] : '';
		var rgx = /(\d+)(\d{3})/;
		while (rgx.test(x1)) {
			x1 = x1.replace(rgx, '$1' + ',' + '$2');
		}
		return x1 + x2;
	}

	function update_price(idx) {
		if(idx == "lease") {
			var arr = lease_price;
		} else {
			var arr = normal_price;
		}
		document.getElementById("minimum_price").options.length=1
		document.getElementById("maximum_price").options.length=1
		for(var i=0, len=arr.length; i<len; i++) {
				var num = arr[i];
				num_comma = addCommas(num);
				document.getElementById("minimum_price").options[i+1]=new Option("$"+num_comma, num);				
				document.getElementById("minimum_price").value="";					
				document.getElementById("maximum_price").options[i+1]=new Option("$"+num_comma, num);	
				document.getElementById("maximum_price").value="";	
		}
	}
	
	function map_price()
	{
		var val = document.getElementById("search_type").value;
		update_price(val);
	}
	
//-->