jQuery( document ).ready( function () {

/*
  jQuery( '.tweet' ).tweet( {
    username:               'keepjobsincan'
    join_text:              '...',
    avatar_size:            16,
    count:                  3,
    auto_join_text_default: 'we said,',
    auto_join_text_ed:      'we',
    auto_join_text_ing:     'we were',
    auto_join_text_reply:   'we replied to',
    auto_join_text_url:     'we were checking out',
    loading_text:           '' //'loading tweets...'
  } );
*/

} );

function displayVideo( oData ) {

  var aEntry = oData.feed.entry || [];

  if (aEntry.length) {
    var oVideo = aEntry.shift();
    swfobject.embedSWF( oVideo.media$group.media$content[0].url + '&rel=1&border=0&fs=1&autoplay=0', 'objYouTubePlayer', '198', '140', '9.0.0', false, false, { allowfullscreen : 'true' } );
  }
}

function jsonFlickrFeed( oFeed ) {

  for (var i in oFeed.items) {
    if (i < 9) {
      document.write( '<a href="' + oFeed.items[i].link + '" class="external"><img src="' + oFeed.items[i].media.m + '" alt="' + oFeed.items[i].title + '" /></a>' );
    }
  }
}

function twitterFeed( aTweet ) {

  var aHTML = [];

  for (var i in aTweet){

    var sStatus = aTweet[i].text.replace( /((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function( sURL ) {
      return '<a href="' + sURL + '" class="external">' + sURL + '</a>';
    } ).replace( /\B@([_a-z0-9]+)/ig, function( sReply ) {
      return  sReply.charAt( 0 )+'<a href="http://www.twitter.com/' + sReply.substring( 1 ) + '" class="external">' + sReply.substring( 1 ) + '</a>';
    } );

    aHTML.push( '<dt><img src="images/menu/menu_leaf.gif" alt="" /><span>' + sStatus + '</span></dt>' );
  }

  document.getElementById( 'dlTwitter' ).innerHTML = aHTML.join( '' );
}

