fixed two usage errors with jQuery.inArray(); fixed permissions problem in template