  $(document).ready(function() {
 
  // Creating custom :external selector
	$.expr[':'].external = function(obj){
	return !obj.href.match(/^mailto\:/)
	&& !obj.href.match(/^javascript\:/)
	&& !obj.href.match(/threerivers/)
	&& (obj.hostname != location.hostname);
	};
 
  // Add 'external' CSS class to all external links
  $('a:external').addClass('external');
 
  $('.external').click(function() {
    var link = $(this).attr('href');
 
    $('<div style="font-size: 11px; text-align: left;"><b>You are leaving www.threeriverscreditunion.com</b><p>Three Rivers Community Credit Union does not provide, and is not responsible for, the product, service, or overall website content available at a third-party site. Three Rivers Community Credit Union neither endorses the information, content, presentation, or accuracy nor makes any warranty, express or implied, regarding any external site.<br /><br />Three Rivers Community Credit Union privacy policies do not apply to linked websites. You should consult the privacy disclosures on any linked site for further information.<br /><br />Thank you for visiting the Three Rivers Community Credit Union website.</p></div>').dialog({
      title: "External Link",
      modal : true,
      overlay: {
        backgroundColor: '#000',
        opacity: 0.5
      },
      buttons: {
        'Okay': function() {
          $(this).dialog('close').remove();
          window.open(link);
        },
        'Cancel': function() {
          $(this).dialog('close').remove();
          return false;
        }
      }
    });
 
    return false;
  });
});
