Fix Drupal.ajax may not be loaded on some pages

Drupal.ajax is present only if ajax.js is. Switch to test for Drupal.detachBehaviors, which is not present in Drupal 6