

/**
 * handles clicks on the result navigation tabs by generating a url for
 * displaying the result set for the tab.
 *
 * @param clickedTab - The tab clicked
 * @param selectedTab - The tab that is currently being viewed
 * @param selectectedTabOffset - The page the user was viewing if the user
 *                                  was viewing on the clicked tab
 * @param filters - filters used on the most previous request.
 */
function handleTabClick(clickedTab, selectedTab, search, city, state, threshold, filters) {
    if (clickedTab==selectedTab) {
        return 0;
    }
    var url = toAbsoluteUrl("search.do" +
                "?whichTab=" + clickedTab +
                "&action=searchFromLink" +
                "&search=" + search +
                "&city=" + city +
                "&state=" + state +
                "&threshold=" + threshold);

    if ( filters ) {
        url += "&toFilter=t" +
               "&filters=" + filters;
    }
    window.location.href = url;
}