	function updateSearchBox(type, pricefrom, priceto)
	{
		searchtype = document.forms.quicksearch_form.searchtype.options[document.forms.quicksearch_form.searchtype.selectedIndex].value;
		populatePrices(pricefrom, priceto);
	}
	
	function populatePrices(pricefrom, priceto)
	{
		searchtype = document.forms.quicksearch_form.searchtype.options[document.forms.quicksearch_form.searchtype.selectedIndex].value;
		
		currency = document.forms.quicksearch_form.currency.options[document.forms.quicksearch_form.currency.selectedIndex].value;
		prices = new Array();
		
		if(searchtype == "homeforsale" || searchtype == "commercialpropertysale" || searchtype == "project" || searchtype == "homeforsale" || searchtype == "commerciallot"  || searchtype == "lot" )
		{
			if(currency == "NAF")
			{
				for(i=0;i<2000000;i+=250000)
				{
					prices.push(i);
				}
				for(i=2000000;i<5000000;i+=500000)
				{
					prices.push(i);
				}
				for(i=5000000;i<=10000000;i+=1000000)
				{
					prices.push(i);
				}
			}
			else
			{
				for(i=0;i<1000000;i+=100000)
				{
					prices.push(i);
				}
				for(i=1000000;i<2500000;i+=250000)
				{
					prices.push(i);
				}
				for(i=2500000;i<=5000000;i+=500000)
				{
					prices.push(i);
				}
			}
		}
		else if(searchtype == "homeforrent" || searchtype == "commercialpropertyrent")
		{
			if(currency == "NAF")
			{
				for(i=0;i<5000;i+=500)
				{
					prices.push(i);
				}
				for(i=5000;i<=10000;i+=1000)
				{
					prices.push(i);
				}
			}
			else
			{
				for(i=0;i<3000;i+=250)
				{
					prices.push(i);
				}
				for(i=3000;i<10000;i+=1000)
				{
					prices.push(i);
				}
				for(i=10000;i<=15000;i+=2500)
				{
					prices.push(i);
				}
			}
		}
		
		document.forms.quicksearch_form.pricefrom.options.length = prices.length;
		document.forms.quicksearch_form.priceto.options.length = prices.length;
		for(i=0;i<prices.length;i++)
		{
			document.forms.quicksearch_form.pricefrom.options[i+2] 	= new Option(getNumber(prices[i], currency) , prices[i]);
			if(pricefrom === prices[i])
				document.forms.quicksearch_form.pricefrom.options[i+2].selected = true;
			document.forms.quicksearch_form.priceto.options[i+2] 	= new Option(getNumber(prices[i], currency), prices[i]);
			if(priceto === prices[i])
				document.forms.quicksearch_form.priceto.options[i+2].selected = true;
			
		}
		
	}
	
	function getNumber(num, currency)
	{
		sign = "";
		thou = ".";
		dec = "";
		if(currency == "USD")
		{
			sign = "$";
			thou = ",";
			dec = "";			
		}
		else if(currency == "EUR")
			sign = "€";
		else if(currency == "NAF")
			sign = "ƒ";
		return formatNumber(num, 0, thou, dec, sign + ' ', '', '','');
	}
	
	function formatNumber(num,dec,thou,pnt,curr1,curr2,n1,n2) {var x = Math.round(num * Math.pow(10,dec));if (x >= 0) n1=n2='';var y = (''+Math.abs(x)).split('');var z = y.length - dec; if (z<0) z--; for(var i = z; i < 0; i++) y.unshift('0'); if (z<0) z = 1; y.splice(z, 0, pnt); if(y[0] == pnt) y.unshift('0'); while (z > 3) {z-=3; y.splice(z,0,thou);}var r = curr1+n1+y.join('')+n2+curr2;return r;}