/*

behaviours.js - JavaScript behaviour setup for clublocarno.com

Copyright 2006, Bruce Fletcher

You may use this code for any purpose in modified or unmodified form.

This code looks for certain element IDs in the current page and attaches
JavaScript behaviours to them.  Implementing JavaScript this way keeps
code out of the page content.

*/


function setupBehaviours( )
{
  var element;

  // Navigation rollovers: /js/rollover.js must be included for these.

  if ( typeof(rollover) == 'function' )
  {
    element = document.getElementById( 'sailing_icon' );

    if ( element )
      rollover( element );

    element = document.getElementById( 'windsurfing_icon' );

    if ( element )
      rollover( element );

    element = document.getElementById( 'kayaking_icon' );

    if ( element )
      rollover( element );

    element = document.getElementById( 'rowing_icon' );

    if ( element )
      rollover( element );
  }

  // <div id="wind"> contains an updating wind display.
  //  /js/wind.js must be included for this to work.

  element = document.getElementById( 'wind' );

  if ( element && typeof(updateWind) == 'function' )
  {
    updateWind();
  }

  // <span id="webcam_controls"> has controls for a webcam.
  // <img id="webcam"> has the image itself.
  // /js/webcam.js and /js/cookie.js are both needed for this.

  element = document.getElementById( 'webcam_controls' );

  if ( element && typeof(webcamSetup) == 'function' )
  {
    webcamSetup();
  }

  // Include Google Analytics.  Requires include of:
  // http://www.google-analytics.com/urchin.js

  if ( typeof(urchinTracker) == 'function' )
  {
    _uacct = "UA-172258-1";
    _udn="clublocarno.com";

    urchinTracker();
  }
}
