
// little page loading function
function preselect_jobtype(category_id) {
	f = document.searchform;
	for(i=0;i<f.category_id2.options.length;i++) {
		if(f.category_id2.options[i].value == category_id) {
			f.category_id2.options[i].selected = true;
			break;
		}
	}
}

// chucks the above info into the right select dropdown whatsit
function populate_jobtypes() {
	f = document.searchform;
	
	// clear it first
	select_clear(f.category_id2);
	
	// throw in the "all" option
	f.category_id2.options[0] = new Option("All", "0", false, false);
	
	// see which one is selected
	n = f.category_id1.selectedIndex;
	
	// populate the secondary dropdown
	for(i=0;i<jobtypes[n].length;i++) {
		f.category_id2.options[i + 1] = jobtypes[n][i];
	}
}

// clears all options that a given select form field has
function select_clear(f) {
	for(i=f.length-1;i>=0;i--) {
		f.options[i] = null;
	}
}

