/**
*	Author: Jarrett M. Barnett
*	E-mail: jarrett@mc2design.com
*	Company: MC2 Design Group, Inc.
*	Copyright (c) 2009
*	Last Modified: 2009-07-20
*/

/**
*	Notes:
*		Built using jQuery library.
*			Confirmed to work with jQuery v1.3.2.
*/

/**
*	rel="external" will make links open in new window
*	rel="noclick" will make href="#" and onclick="aFunction();return false;" so it still acts like a link mouseover
*/

// Run on pageload
$(document).ready(function() {

    // Creating custom :external selector
    $.expr[':'].external = function(obj){
        return !obj.href.match(/^mailto\:/)
                && (obj.hostname != location.hostname);
    };
    // Add 'external' CSS class to all external links
    $('a:external').attr('rel', 'external');


  // Open External Links In New Window
  $('a[rel="external"]').click(function(){
    $(this).attr('target','_blank');
  });

  // Convert Links To Non-Links
  $('a[rel="noclick"]').hover(function() {
    $(this).attr('onclick',"aFunction();return false;");
	$(this).attr('href','#');
  });



});
