IE8/old firefox fixes (remove console.log, changed array.indexOf to $.inArray())