/* * LeaveNotice - plug in to notify users of leaving your site * Examples and documentation at: http://rewdy.com/tools/leavenotice-jquery-plugin * Version: 1.1.3 (07/08/2013) * Copyright (c) 2012 Andrew Meyer * Licensed under the MIT License: http://en.wikipedia.org/wiki/MIT_License * Requires: jQuery v1.4+ */ (function($){$.fn.leaveNotice=function(opt){var defaults={siteName:"EDA",exitMessage:"
We hope your visit was informative and enjoyable.
When attempting to access external websites, you may wish to review each privacy notice since their information collection practices may differ from ours. In addition, our linking to these sites does not constitute an endorsement of any products or services.
",preLinkMessage:"You will now be directed to:
{URL}
Cancel or press the ESC key.
'}else{msgContent+='Click the link above to continue or Cancel
'}$("#"+options.messageBoxId).append(msgContent);if(options.timeOut>0){leaveIn=setTimeout(function(){$("#ln-cancelMessage").html("Loading...");window.location.href=url},options.timeOut)}else{leaveIn=false}if(options.newWindow){$("a#"+options.linkId).attr("target","_blank").click(function(){closeDialog(options,leaveIn)})}$("#ln-cancelLink").click(function(){closeDialog(options,leaveIn);return false});$(document).bind("keyup",function(e){if(e.which==27){closeDialog(options,leaveIn)}});$(window).unload(function(){closeDialog(options,leaveIn)});return false})})};function closeDialog(options,timer){if(options.timeOut>0){clearTimeout(timer)}$("#"+options.overlayId+", #"+options.messageHolderId).fadeOut("fast",function(){$("#"+options.overlayId+", #"+options.messageHolderId).remove()});$(document).unbind("keyup")}})(jQuery);