var monthly_prices = [350, 450, 500, 550, 600, 650, 700, 800, 1000, 1500, 2000];
var weekly_prices = [50, 60, 70, 80, 90]

var selectDepartment = function() {
	if (!$("department"))
		return;
	var department = $F("department");
	$("bedrooms").enable();
	$("minprice").enable();
	$("maxprice").enable();
	if (department == "Student") {
		var prices = weekly_prices;
		var format = "&pound;{!$price} pppw";
		$("rental_period").value == "weekly";
	} else if (department == "Garage") {
		$("minprice").selectedIndex = 0;
		$("maxprice").selectedIndex = $("maxprice").options.length-1;
		$("bedrooms").disable();
		$("minprice").disable();
		$("maxprice").disable();
		return;
	} else {
		var prices = monthly_prices;
		var format = "&pound;{!$price} pcm";
		$("rental_period").value == "monthly";
	}

	populatePrices($("minprice"), prices, "min", format);
	populatePrices($("maxprice"), prices, "max", format);
};
selectDepartment.onLoad();

