		function ClearOptions(OptionList) 
		{
			// Always clear an option list from the last entry to the first
			for (x = OptionList.length; x >= 0; x--)
			{
				OptionList[x] = null;
   			}
		}
		function AddToOptionList(OptionList, OptionValue, OptionText)
		{
			// Add option to the bottom of the list
   			OptionList[OptionList.length] = new Option(OptionText, OptionValue);
		}
		function populate_price()
		{
			var s = document.getElementById('search_type_drop').selectedIndex;
			var id = document.getElementById('search_type_drop')[s].value;
			if(id)
			{
				var list = document.getElementById("min_price_drop");
				var list2 = document.getElementById("max_price_drop");
				ClearOptions(list);
				ClearOptions(list2);
				AddToOptionList(list, '0', "Min");
				AddToOptionList(list2, '0', "Max");
				if(id == 2)
				{
					var i = 0;
					while(i <= 6000000)
					{
						AddToOptionList(list, i, "USD "+i);
						i = i + 100000;
					}
					var i = 6000000;
					while(i > 0)
					{
						AddToOptionList(list2, i, "USD "+i);
						i = i - 100000;
					}
				}
				
				if(id == 3)
				{
					var i = 0;
					while(i <= 5000)
					{
						AddToOptionList(list, i, "USD "+i);
						i = i + 250;
					}
					var i = 5000;
					while(i > 0)
					{
						AddToOptionList(list2, i, "USD "+i);
						i = i - 250;
					}
				}
				
				if(id == 4)
				{
					var i = 0;
					while(i <= 20000)
					{
						AddToOptionList(list, i, "USD "+i);
						i = i + 500;
					}
					var i = 20000;
					while(i > 0)
					{
						AddToOptionList(list2, i, "USD "+i);
						i = i - 500;
					}
				}
				
   			}
   			else
   			{
   				var list = document.getElementById("min_price");
				ClearOptions(list);
   				AddToOptionList(list, '', "Please Select Search Type");
   				var list = document.getElementById("max_price");
				ClearOptions(list);
   				AddToOptionList(list, '', "Please Select Search Type");
   			}
		}