Fix IE7/8 support in graphs.js

Array.indexOf is not supported in IE8 and less. We now use
jQuery.inArray instead.