The reason it only works for the rifle is because it is the last member of the array. It is being set to true properly for the rest of them, but you're also immediately setting it back to false in the next loop iteration.
Try breaking out of the loop after you set it to true (and have performed all of your logic).
edit: if you still need to hide remaining images, play with
hideImgs(start, end). There's really no need to continue looping to hide the rest of the images because you know exactly how many you have
PHP Code:
// Hide remaining images
hideImgs(203 + i + 1, 203 + this.equipSlotCount);
hideImgs(223 + i + 1, 223 + this.equipSlotCount);
break; // break out of your loop
might have failed at math, but you get the idea