Maybe you missed this line?
I took your three arrays and made an uber-array where each of them is simply one element in the teams array.
var teams = [ YellowJackets, Dogs, Tigers ];
And then the code is simple:
Note that this code would work for any number of teams. Just add them to the end of the teams array and no other changes needed.
// I loop through each element in the teams array...
for ( var t == 0; t < teams.length; ++t )
// I pull out one of the elements of the teams array into the variable team
var team = teams[t];
// and then the rest of the code is really yours....just working with, if you will,
// an "alias" of one of your original arrays. That is, the variable team will first
// be that same array as YellowJackets, then the same as Dogs, then Tigers
if ( (color == team && textcolor == team)
|| (textcolor == team && color == team)
alert( team );
// and the only difference is that as soon as I get a match and display
// the message, I exit the function: