﻿$(document).ready(function() {
    $(".distributor-listing").tablesorter({
        // sort on the first column and third column, order asc 
        widgets: ['zebra']
        //sortList: [[0, 0]]
    });

    function clearFilter(e) {
        window.location = "product-locator-distributor.aspx"

    }

    function chooseCategory(e) {

        var category = extractID($(this).attr("id"));

        if (category == "unitedStates") {

            window.location = "product-locator-distributor-us.aspx"

        } else {

            window.location = "product-locator-distributor-int.aspx"

        }
    }

    /* return only the NUM portion of an ID */
    function extractID(theID) {
        return (theID.split("-")[1]);
    }

    $(".clear-search").bind("click", clearFilter);
    $(".internal-nav li").bind("click", chooseCategory);
    $(".internal-nav li").bind("click", chooseCategory);
}
);

