/*
 * rj.js
 * (c) Ryan Funduk
 */

jQuery.fn.disableSelection = function() {
  return $(this).each( function( index, el ) {
    if( typeof el.style.MozUserSelect != 'undefined' ) {
      el.style.MozUserSelect = 'none';
    }
    else {
      el.onmousedown = function() { return false; }
    }
    el.style.cursor = 'pointer';
  } );
}

$(document).ready( function () {
  $('a[rel=external]').attr( 'target', '_blank' );

  $('table#contact tr td.eval').each( function () {
    $(this).html( eval( $(this).text() ) );
  } );

  $('#email_address').each( function () {
    var email = eval( $(this).text() );
    $(this).html( "<a href='mailto:" + email + "'>" + email + "</a>" );
  } );

  var thumbs = $('img.hover_thumb');
  $('a.hover_thumb').hover( function() {
    var link = $(this);
    var target = link.attr('rel').replace(/external/,'') || 'me';
    thumbs.hide();
    thumbs.filter('[rel=' + target + ']').show();
  } );

  if( $.fn.archiver ) { $('#archives').archiver( { trigger: 'click' } ); }
} );

try { Typekit.load(); }
catch( e ) {}

