// $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);
      }
    }
  });
}
;
var divId='LiveActor';
var vWidth=200; // set to the width of .flv video
var vHeight=225; // set to the height of .flv video
var videoPath = Drupal.settings.live_actor['flvurl'];
var so = new SWFObject(Drupal.settings.live_actor['playerurl'], 'mymovie', vWidth, vHeight, '8');
so.addParam('allowScriptAccess','always');
so.addParam('swliveconnect','true');
so.addParam('wmode','transparent');
so.addVariable('videoPath', videoPath);
so.addVariable('videoW', vWidth);
so.addVariable('videoH', vHeight);
//
// CLIENT CONTROLLED FEATURES //
so.addVariable('autoplay', Drupal.settings.live_actor['autoplay']);//If set to true, the video will begin playing as soon as it loads.
so.addVariable('autorewind', Drupal.settings.live_actor['autorewind']); //resets the video to the first frame when finished playing.
so.addVariable('hoursDelayInterval', Drupal.settings.live_actor['hoursDelayInterval']); //Use a cookie to set number of hours before video plays again.
so.addVariable('daysDelayInterval', Drupal.settings.live_actor['daysDelayInterval']); //Use a cookie to set number of days before video plays again.
so.addVariable('weeksDelayInterval', Drupal.settings.live_actor['weeksDelayInterval']); //Use a cookie to set number of days before video plays again.
so.addVariable('delayVideoId', Drupal.settings.live_actor['delayVideoId']); //If set to true, the player will remove itself from the page when done playing.
so.addVariable('closewhendone', Drupal.settings.live_actor['closewhendone']); //If set to true, the player will remove itself from the page when done playing.
//END CLIENT CONTROLLED FEATURES//
//
window.onload=function(){so.write(divId);};

