added implementation for missing array.indexOf to fix ie8
better to use jquery.inArray