// $Id: fbconnect.js,v 1.4 2009/02/27 17:46:09 lanets Exp $
/*
 * Our <fb:login-button> specifies this function in its onlogin attribute,
 * which is triggered after the user authenticates the app in the Connect
 * dialog and the Facebook session has been set in the cookies.
 */
function facebook_onlogin_ready() {
 $('#fbconnect-autoconnect-form').submit();
}

/*
 * Show the feed form. This would be typically called in response to the
 * onclick handler of a "Publish" button, or in the onload event after
 * the user submits a form with info that should be published.
 *
 */
function facebook_publish_feed_story(form_bundle_id, template_data) {
  // Load the feed form
  FB.ensureInit(function() {
          FB.Connect.showFeedDialog(form_bundle_id, template_data);
  });
}
;// $Id: googleanalytics.js,v 1.3.2.6 2008/11/25 22:43:30 hass Exp $

Drupal.behaviors.gaTrackerAttach = function(context) {

  // Attach onclick event to all links.
  $('a', context).click( function() {
    var ga = Drupal.settings.googleanalytics;
    // Expression to check for absolute internal links.
    var isInternal = new RegExp("^(https?):\/\/" + window.location.host, "i");
    // Expression to check for special links like gotwo.module /go/* links.
    var isInternalSpecial = new RegExp("(\/go\/.*)$", "i");
    // Expression to check for download links.
    var isDownload = new RegExp("\\.(" + ga.trackDownloadExtensions + ")$", "i");

    // Is the clicked URL internal?
    if (isInternal.test(this.href)) {
      // Is download tracking activated and the file extension configured for download tracking?
      if (ga.trackDownload && isDownload.test(this.href)) {
        // Download link clicked.
        var extension = isDownload.exec(this.href);
        pageTracker._trackEvent("Downloads", extension[1].toUpperCase(), this.href.replace(isInternal, ''));
      }
      else if (isInternalSpecial.test(this.href)) {
        // Keep the internal URL for Google Analytics website overlay intact.
        pageTracker._trackPageview(this.href.replace(isInternal, ''));
      }
    }
    else {
      if (ga.trackMailto && $(this).is("a[href^=mailto:]")) {
        // Mailto link clicked.
        pageTracker._trackEvent("Mails", "Click", this.href.substring(7));
      }
      else if (ga.trackOutgoing) {
        // External link clicked.
        pageTracker._trackEvent("Outgoing links", "Click", this.href);
      }
    }
  });
}
;