.indexOf() replaced with jQuery inArray to avoid issues with IE8 and older

JavaScript method .indexOf() was replaced with jQuery.inArray() because .indexOf() is not supported by old versions of Internet Explorer (IE8 and older). Please update the min version and the JS files at the demo if you accept the fix.