use jQuery inArray method

use jQuery inArray method to prevent indexOf is not defined error in IE