function performPage() {
    if (document.forms.search_qualified_products_form == null) {
        document.forms.searchForm.search_term.value = document.forms.brandForm.brands.options[document.forms.brandForm.brands.selectedIndex].value;
        document.forms.searchForm.selectedYear.value = document.forms.brandForm.selectedYear.value;
     }
    else {
        document.forms.searchForm.search_term.value = document.forms.search_qualified_products_form.search_term_input.value;
        document.forms.searchForm.selectedYear.value = document.forms.search_qualified_products_form.selectedYear.value;
    }
    document.getElementById('cmd').value = "pageSizeAction";
    document.forms.searchForm.cmd.value = "pageSizeAction";
    document.forms.searchForm.submit();

}
function searchBrands()
{
    var brandName = document.forms.brandForm.brands.value;
    document.forms.searchForm.search_term.value = brandName;
    var selectedYear = document.forms.brandForm.selectedYear.value;
    document.forms.searchForm.selectedYear.value = selectedYear;
    document.forms.searchForm.submit();
}

function updateCompanyList(action) {
    document.forms.brandForm.action = action;
    document.forms.brandForm.submit();
}

function submitViewListOfCompanies(action) {
    document.forms.search_qualified_products_form.action = action;
    document.forms.search_qualified_products_form.submit();
}

function delineate(str) {
    var theleft = str.indexOf("=") + 1;
    return(str.substring(theleft));
}

function giveYearToPrint() {
        var yearLink = window.location;
        document.forms.printForm.search_year.value = yearLink;
        var textboxYear = document.forms.printForm.search_year.value;
        var theYear = delineate(textboxYear);
        document.forms.printForm.search_year.value = theYear;
//    alert(theYear);
}

function sendYear() {
    var year = document.forms.brandForm.selectedYear.value;
    window.open("/bye/print?search_year=" + year, "_blank");
}