// Change the sorting on the page
function orderResults(sortVal) {
	switch(sortVal) {
		case 'StartDate':
			document.forms['form1'].SortBy.value = 'StartDate';
			document.forms['form1'].SortOrder.value = 'Descending';
			break;
		case 'CurrentBidD':
			document.forms['form1'].SortBy.value = 'CurrentBid';
			document.forms['form1'].SortOrder.value = 'Descending';
			break;
		case 'CurrentBidA':
			document.forms['form1'].SortBy.value = 'CurrentBid';
			document.forms['form1'].SortOrder.value = 'Ascending';
			break;
		default:
			document.forms['form1'].SortBy.value = 'EndTime';
			document.forms['form1'].SortOrder.value = 'Ascending';
			break;
	}
    document.forms['form1'].PageNum.value = '1';
	document.forms['form1'].submit();
}
// Change the page number in the search results
function changePage(pageNum) {
        document.forms['form1'].PageNum.value = pageNum;
        document.forms['form1'].submit();
}
// check to see if the value passed is not an empty string
function checkIsEmpty(myVal, name) {
        retVal=false;

        if( myVal == '' ) {
             alert(name + ' is a required field');
             retVal = false;
        }
        else {
             retVal = true;
        }
        return retVal;
}
// change to a sub-category on the page using form2
function changeCat(catNumber, query, title) {
    document.forms['form2'].Category.value = catNumber;
    document.forms['form2'].Query.value = query;
    document.forms['form2'].Title.value = title;
    document.forms['form2'].submit();
}
//displays the privacy statment in new window
function showPrivacy() {
         popup=window.open('http://www.beekeeping-supplies.com/privacy.html', 'privacy',
'dialog,modal,scrollbars=yes,resizable=yes,width=400,height=400,left=0,top=0');
}