<!--

	var lease_price = new Array(
	"1000",
	"1250",
	"1500",
	"1750",
	"2000",
	"2250",
	"2500",
	"2750",
	"3000",
	"4000",
	"5000",
	"6000",
	"7000",
	"8000",
	"9000",
	"10000"
	);

	var normal_price = new Array(
	"75000",
	"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, min, max) {
		//alert('TEST');
		if(idx == "lease") {
			var arr = lease_price;
		} else {
			var arr = normal_price;
		}
		
		$('select[name="minimum_price"]').each(function(idx, item) {
			item.options.length=1;
		});
		
		$('select[name="maximum_price"]').each(function(idx, item) {
			item.options.length=1;
		});

		//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);
				if(num == min) {
    				//document.getElementById("minimum_price").options[i+1]=new Option("$"+num_comma, num, true, true);
    				
					$('select[name="minimum_price"]').each(function(idx, item) {
						item.options[i+1]=new Option("$"+num_comma, num, true, true);
					});    				
				} else {
    				//document.getElementById("minimum_price").options[i+1]=new Option("$"+num_comma, num);
    				
					$('select[name="minimum_price"]').each(function(idx, item) {
						item.options[i+1]=new Option("$"+num_comma, num);
					});    				
				}
				//document.getElementById("minimum_price").value="";
				
				$('select[name="minimum_price"]').each(function(idx, item) {
					item.value = "";
				});
				
				if(num == max) {
    				//document.getElementById("maximum_price").options[i+1]=new Option("$"+num_comma, num, true, true);
    				
					$('select[name="maximum_price"]').each(function(idx, item) {
						item.options[i+1]=new Option("$"+num_comma, num, true, true);
					});
				} else {
				    //document.getElementById("maximum_price").options[i+1]=new Option("$"+num_comma, num);
				    
					$('select[name="maximum_price"]').each(function(idx, item) {
						item.options[i+1]=new Option("$"+num_comma, num);
					});				    
				}
				//document.getElementById("maximum_price").value="";
				
				$('select[name="maximum_price"]').each(function(idx, item) {
					item.value="";
				});
		}
	}

	function map_price()
	{
		var val = document.getElementById("search_type").value;
		update_price(val);
	}

	function quick_price()
	{
		var val = document.getElementById("idx").value;
		update_price(val);
	}
//-->