﻿/* Author: 

*/

$(document).ready(function () {
    $('.productThumb').each(function () {
        var $urlredir = $(this).data('url');
        if ($urlredir) {
            $(this).click(function () {
                window.location.href = $urlredir;
            });
        }
    });

    $('.filter').click(function (ev) {
        $('.productThumb').hide();
        $('.filter').each(function () {
            if ($(this).attr("checked") == "checked") {
                $('.' + $(this).attr('id')).show();
            }
        });
        //$('.' + ev.target.id).toggle(this.checked);
    });

    $('#clearAll').click(function (ev) { showAllProds(ev, false) });
    $('#showAll').click(function (ev) { showAllProds(ev, true) });

});

function showAllProds(event, showAll) {
    event.preventDefault();
    $('.productThumb').toggle(showAll);
    $('.filter').attr("checked", showAll);
}




















