Added filtering function

Maybe not the best way to do it (I'm no pro with Javascript/jQuery), but it's a working filtering function