function limitChars(n,t,i){var r=$("#"+n).val(),u=r.length;return u>t?($("#"+i).html("Not more than "+t+" characters!"),$("#"+n).val(r.substr(0,t)),!1):($("#"+i).html(t-u+" characters left."),!0)}function isValidEmailAddress(n){var t=new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);return t.test(n)}function fbs_click(){return u=location.href,t=document.title,window.open("https://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t)," sharer","toolbar=0, status=0, width=626, height=436"),!1}function centerModal(){var t=$(this).find(".adpopup-newsletter"),i=150,r=80,n;(t==undefined||t==null||t==""||t.height()==undefined||t.height()==null||t.height()<=0)&&(t=$(this).find(".adpopup"),i=0);n=($(window).height()-t.height())/2;n=n-30;n=n-70;n=n-i;n<r&&(n=r);t.css("margin",n+"px auto auto auto")}(function(n){"use strict";n("#menu .nav li").hover(function(){n(this).find(".dropnav-container, .subnav-container").slideDown(300)},function(){n(this).find(".dropnav-container, .subnav-container").hide()});n("#menu .subnav-menu li").hover(function(){n(this).parent().find("li").removeClass("current");n(this).addClass("current")});n("#nav-expander").sidr({side:"right"});n("#nav-expander-left").sidr({name:"sidr-left",side:"left"});n("#sidr li a.more").click(function(t){t.preventDefault();n(this).parent().find("ul").toggle()});n("#weekly-gallery").photobox("a",{time:0});n(".article-gallery").photobox("a",{time:0});n("#archive-date-picker").datepicker({format:"mm/dd/yyyy"});n(".scrollToTop").click(function(){return n("html, body").animate({scrollTop:0},800),!1});n("a[href^='http']").attr("target","_blank");n(".email").each(function(){var t=n(this),i=t.text().replace(/\s*\[at\]\s*/,"@").replace(/\s*\[dot\]\s*/g,".");t.html('<a href="mailto:'+i+'">'+i+"<\/a>")})})(jQuery);$(".modal").on("show.bs.modal",centerModal);$(window).on("resize",function(){$(".modal:visible").each(centerModal)})