fix: indexOf is not avaible in ie8 thus breaks script

using $.inArray instead of indexOf. indexOf is not supported in ie8. This is also about ticket #4