window.addEvent( 'domready', function() {
  $$('.outbound').addEvent('click', function(){
    var clicky_custom = {};
    clicky_custom.id = "259";
    clicky_custom.revenue = "";
    try {
      var c = clicky.goal(clicky_custom.id, clicky_custom.revenue); // Visited an External Portfolio
    } catch(e) {
    }
  });

  // jquery: $('a.outbound').click(function() {
  $$('.outbound').addEvent('click', function(){
    // Get Clicky
    var clicky_custom = {};
    var _href = this.get('href'); //jquery: this.attr('href');
    var _title = this.get('title');  //jquery: attr('title');
    var _alt = this.get('alt');  //jquery: attr('alt');
    clicky_custom.href = _href;
    clicky_custom.title = (_title ? _title : (_alt ? _alt : _href));
    clicky_custom.type = 'outbound'; // outbound, download, click, pageview
    clicky.log( clicky_custom.href, clicky_custom.title, clicky_custom.type );
  });

  // jquery: $('a.goal').click(function() {
  // Doesn't work on links that already have a onclick event
  $$('.goal').addEvent('click', function(){
    // Get Clicky
    var id = $(this).get('goalid'); //jquery: $(this).attr('goalid');
    var revenue = $(this).get('goalrevenue') ? $(this).get('goalrevenue') : '0.00';  //jquery: $(this).attr('goalrevenue') ? $(this).attr('goalrevenue') : '0.00';
    clicky.goal( id, revenue );
  });
});