I think you could use regular expressions:
this tests for shoes case insensitive. (match also "shoesprostore")
if (/shoes/i.test(ele.Department)) { } this tests for the word shoes case insensitive. (match only "shoes""Big Shoes" and "Small Shoes") (edit 4)
if (/\bshoes\b/i.test(ele.Department)) { } edit:
this tests for the words shoe and shoes case insensitive.
if (/\bshoes?\b/i.test(ele.Department)) { } \b : start and finish of a word
? : the previous character may or may not be present
i (after the sencond /) : case insensitive
look here for more http://www.w3schools.com/jsref/jsref_obj_regexp.asp
:)
edit 2:
corrected grammar inconsistencies thanks to my friend SandMan
edit 3:
maybe you could save the regex in global scope (before the $(document).ready(...) statement) using
var shoeTest = /shoes/i; then
if (shoeTest.test(...))