// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function swapImage(element)
{
  NewSRC = document.getElementById(element).src;
  OldSRC = document.getElementById('Large').src;
  document.getElementById('Large').src = NewSRC.replace(/icon\//,'large/');
  document.getElementById(element).src = OldSRC.replace(/large\//,'icon/');
}

/*               
Google Analytics 
(requires <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script> in the head)
*/               
function loadGA()
{                
        // Check to make sure it's loaded before trying to call it
        if (typeof urchinTracker == "function") {
                _uacct = "UA-952902-7";
                urchinTracker();
        }        
}

/*           
Unobtrusive onload event function
Author: Simon Wilson - http://simonwillison.net/2004/May/26/addLoadEvent/
*/
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(loadGA);
