function buildOptions(){
	var options = [];
	if(sectionID != ''){
		options.push({field : SECTION_ID_FIELD, value : sectionID});
	}
	if(fundID != ''){
		options.push({field : FUND_ID_FIELD, value : fundID});
	}
	if(keyword != ''){
		options.push({field : KEYWORD_FIELD, value : keyword});
	}
	if(sortOrder != ''){
		options.push({field : SORT_ORDER_FIELD, value : sortOrder});
	}
	if(sortOrderDirection != ''){
		options.push({field : SORT_ORDER_DIRECTION_FIELD, value : sortOrderDirection});
	}
	if(grantInAidOnly != ''){
		options.push({field : GRANT_IN_AID_ONLY_FIELD, value : grantInAidOnly});
	}
	return options;
}

function submitSearch() {
	var sectionSelector = Ext.get('sectionSelector').dom;
	sectionID = sectionSelector.value;
	
	var fundSelector = Ext.get('fundSelector').dom;
	fundID = fundSelector.value;
	
	var keywordInput = Ext.get('keywordInput').dom;
	keyword = keywordInput.value;
	
	go();
}

function showGrantInAidOnly() {
	grantInAidOnly = "true";
	go();
}

function cancelSearch() {
	start = 0;
	step = 40;
	page = 1;
	pages = 0;
	sectionID = "-1";
	fundID = "-1";
	keyword = "";
	sortOrder = "";
	sortOrderDirection = "";
	grantInAidOnly = "false";
	
	go();
}

function changeStep(){
	var changer = Ext.get('stepChanger').dom;
	step = 0 + changer.options[changer.selectedIndex].value;
	go();
}

function hideAll(){
	if(Ext.get('submitbtn')){
		Ext.get('submitbtn').dom.style.display = 'none';
	}
}
