$(document).ready(function() {
  // Creating custom :external selector

  $.expr[':'].external = function(obj){

	if(obj.hostname == "www.netit.financial-net.com")
		return;

      return !obj.href.match(/^mailto\:/) && (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;">These links to other websites are provided to assist you in locating information.  Once you click on a link, you will leave the credit union website and link to an alternate site that is not operated by the credit union.  The Credit Union is not responsible for the content of the alternate website and does not endorse the linked websites.  Privacy and security policies of other websites may differ from those practiced by the Credit Union.</div>').dialog({
      title: "External Link",
	  width: 400,
      modal : true,
	  dialogClass: "",
      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;
  });
});
