$(function () {
    $("#tabs").tabs().addClass('ui-tabs-vertical ui-helper-clearfix');
    $("#tabs li").removeClass('ui-corner-top');
    
    //slide has some particular things to it like chaning the input boxes as the slider slides
    //and triggering clear and submit when it stops
    $("#yearpublishedslidervolume").slider({
        range: true,
        min: parseInt($("#yearpublishedstartvolume").val()),
        max: parseInt($("#yearpublishedendvolume").val()),
        values:[parseInt($("#yearpublishedstartvolume").val()), parseInt($("#yearpublishedendvolume").val())],
        slide: function (event, ui) {
            $("#yearpublishedstartvolume").val(ui.values[0]);
            $("#yearpublishedendvolume").val(ui.values[1]);
        },
        change: function (event, ui) {
            $("#yearpublishedslidervolume").closest("form").find("input[name='page']").val(1);
            $("#yearpublishedslidervolume").closest("form").submit();
        }
    });
    
    //slide has some particular things to it like chaning the input boxes as the slider slides
    //and triggering clear and submit when it stops
    $("#yearcoveredslidervolume").slider({
        range: true,
        min: parseInt($("#yearcoveredstartvolume").val()),
        max: parseInt($("#yearcoveredendvolume").val()),
        values:[parseInt($("#yearcoveredstartvolume").val()), parseInt($("#yearcoveredendvolume").val())],
        slide: function (event, ui) {
            $("#yearcoveredstartvolume").val(ui.values[0]);
            $("#yearcoveredendvolume").val(ui.values[1]);
        },
        change: function (event, ui) {
            $("#yearcoveredslidervolume").closest("form").find("input[name='page']").val(1);
            $("#yearcoveredslidervolume").closest("form").submit();
        }
    });
    
    //slide has some particular things to it like chaning the input boxes as the slider slides
    //and triggering clear and submit when it stops
    $("#yearpublishedsliderpeople").slider({
        range: true,
        min: parseInt($("#yearpublishedstartpeople").val()),
        max: parseInt($("#yearpublishedendpeople").val()),
        values:[parseInt($("#yearpublishedstartpeople").val()), parseInt($("#yearpublishedendpeople").val())],
        slide: function (event, ui) {
            $("#yearpublishedstartpeople").val(ui.values[0]);
            $("#yearpublishedendpeople").val(ui.values[1]);
        },
        change: function (event, ui) {
            $("#yearpublishedsliderpeople").closest("form").find("input[name='page']").val(1);
            $("#yearpublishedsliderpeople").closest("form").submit();
        }
    });
    
});
