(function(A){A.fn.extend({mousewheel:function(B){if(!B.guid){B.guid=A.event.guid++}if(!A.event._mwCache){A.event._mwCache=[]}return this.each(function(){if(this._mwHandlers){return this._mwHandlers.push(B)}else{this._mwHandlers=[]}this._mwHandlers.push(B);var C=this;this._mwHandler=function(F){F=A.event.fix(F||window.event);A.extend(F,this._mwCursorPos||{});var G=0,E=true;if(F.wheelDelta){G=F.wheelDelta/120}if(F.detail){G=-F.detail/3}if(window.opera){G=-F.wheelDelta}for(var D=0;D<C._mwHandlers.length;D++){if(C._mwHandlers[D]){if(C._mwHandlers[D].call(C,F,G)===false){E=false;F.preventDefault();F.stopPropagation()}}}return E};if(A.browser.mozilla&&!this._mwFixCursorPos){this._mwFixCursorPos=function(D){this._mwCursorPos={pageX:D.pageX,pageY:D.pageY,clientX:D.clientX,clientY:D.clientY}};A(this).bind("mousemove",this._mwFixCursorPos)}if(this.addEventListener){if(A.browser.mozilla){this.addEventListener("DOMMouseScroll",this._mwHandler,false)}else{this.addEventListener("mousewheel",this._mwHandler,false)}}else{this.onmousewheel=this._mwHandler}A.event._mwCache.push(A(this))})},unmousewheel:function(B){return this.each(function(){if(B&&this._mwHandlers){for(var C=0;C<this._mwHandlers.length;C++){if(this._mwHandlers[C]&&this._mwHandlers[C].guid==B.guid){delete this._mwHandlers[C]}}}else{if(A.browser.mozilla&&!this._mwFixCursorPos){A(this).unbind("mousemove",this._mwFixCursorPos)}if(this.addEventListener){if(A.browser.mozilla){this.removeEventListener("DOMMouseScroll",this._mwHandler,false)}else{this.removeEventListener("mousewheel",this._mwHandler,false)}}else{this.onmousewheel=null}this._mwHandlers=this._mwHandler=this._mwFixCursorPos=this._mwCursorPos=null}})}});A(window).one("unload",function(){var C=A.event._mwCache||[];for(var B=0;B<C.length;B++){C[B].unmousewheel()}})})(jQuery);(function(B){B.dimensions={version:"1.2"};B.each(["Height","Width"],function(D,C){B.fn["inner"+C]=function(){if(!this[0]){return }var F=C=="Height"?"Top":"Left",E=C=="Height"?"Bottom":"Right";return this.is(":visible")?this[0]["client"+C]:A(this,C.toLowerCase())+A(this,"padding"+F)+A(this,"padding"+E)};B.fn["outer"+C]=function(F){if(!this[0]){return }var H=C=="Height"?"Top":"Left",E=C=="Height"?"Bottom":"Right";F=B.extend({margin:false},F||{});var G=this.is(":visible")?this[0]["offset"+C]:A(this,C.toLowerCase())+A(this,"border"+H+"Width")+A(this,"border"+E+"Width")+A(this,"padding"+H)+A(this,"padding"+E);return G+(F.margin?(A(this,"margin"+H)+A(this,"margin"+E)):0)}});B.each(["Left","Top"],function(D,C){B.fn["scroll"+C]=function(E){if(!this[0]){return }return E!=undefined?this.each(function(){this==window||this==document?window.scrollTo(C=="Left"?E:B(window)["scrollLeft"](),C=="Top"?E:B(window)["scrollTop"]()):this["scroll"+C]=E}):this[0]==window||this[0]==document?self[(C=="Left"?"pageXOffset":"pageYOffset")]||B.boxModel&&document.documentElement["scroll"+C]||document.body["scroll"+C]:this[0]["scroll"+C]}});B.fn.extend({position:function(){var H=0,G=0,F=this[0],I,C,E,D;if(F){E=this.offsetParent();I=this.offset();C=E.offset();I.top-=A(F,"marginTop");I.left-=A(F,"marginLeft");C.top+=A(E,"borderTopWidth");C.left+=A(E,"borderLeftWidth");D={top:I.top-C.top,left:I.left-C.left}}return D},offsetParent:function(){var C=this[0].offsetParent;while(C&&(!/^body|html$/i.test(C.tagName)&&B.css(C,"position")=="static")){C=C.offsetParent}return B(C)}});function A(C,D){return parseInt(B.curCSS(C.jquery?C[0]:C,D,true))||0}})(jQuery);jQuery.fn.extend({getUrlParam:function(F){F=escape(unescape(F));var E=new Array();var B=null;if($(this).attr("nodeName")=="#document"){if(window.location.search.search(F)>-1){B=window.location.search.substr(1,window.location.search.length).split("&")}}else{if($(this).attr("src")!="undefined"){var D=$(this).attr("src");if(D.indexOf("?")>-1){var A=D.substr(D.indexOf("?")+1);B=A.split("&")}}else{if($(this).attr("href")!="undefined"){var D=$(this).attr("href");if(D.indexOf("?")>-1){var A=D.substr(D.indexOf("?")+1);B=A.split("&")}}else{return null}}}if(B==null){return null}for(var C=0;C<B.length;C++){if(escape(unescape(B[C].split("=")[0]))==F){E.push(B[C].split("=")[1])}}if(E.length==0){return null}else{if(E.length==1){return E[0]}else{return E}}}});(function(A){A.fn.bgIframe=A.fn.bgiframe=function(C){if(A.browser.msie&&/6.0/.test(navigator.userAgent)){C=A.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},C||{});var D=function(E){return E&&E.constructor==Number?E+"px":E},B='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+C.src+'"style="display:block;position:absolute;z-index:-1;'+(C.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(C.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":D(C.top))+";left:"+(C.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":D(C.left))+";width:"+(C.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":D(C.width))+";height:"+(C.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":D(C.height))+';"/>';return this.each(function(){if(A("> iframe.bgiframe",this).length==0){this.insertBefore(document.createElement(B),this.firstChild)}})}return this}})(jQuery);(function(A){A.superfish={};A.superfish.o=[];A.superfish.op={};A.superfish.defaults={hoverClass:"sfHover",pathClass:"overideThisToUse",delay:800,animation:{opacity:"show"},speed:"normal",oldJquery:false,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};A.fn.superfish=function(H){var E="sfbreadcrumb",F=function(){var I=A(this),J=C(I);G(J,true);clearTimeout(J.sfTimer);I.showSuperfishUl().siblings().hideSuperfishUl()},D=function(){var I=A(this),K=C(I);var J=G(K,true);clearTimeout(K.sfTimer);if(!I.is("."+E)){K.sfTimer=setTimeout(function(){I.hideSuperfishUl();if(J.$path.length){F.call(J.$path)}},J.delay)}},C=function(I){return I.parents("ul.superfish:first")[0]},G=function(I,J){I=J?I:C(I);return A.superfish.op=A.superfish.o[I.serial]},B=function(){return A.superfish.op.oldJquery?"li[ul]":"li:has(ul)"};return this.each(function(){var I=this.serial=A.superfish.o.length;var K=A.extend({},A.superfish.defaults,H);K.$path=A("li."+K.pathClass,this).each(function(){A(this).addClass(K.hoverClass+" "+E).filter(B()).removeClass(K.pathClass)});A.superfish.o[I]=A.superfish.op=K;A(B(),this)[(A.fn.hoverIntent&&!K.disableHI)?"hoverIntent":"hover"](F,D).not("."+E).hideSuperfishUl();var J=A("a",this);J.each(function(L){var M=J.eq(L).parents("li");J.eq(L).focus(function(){F.call(M)}).blur(function(){D.call(M)})});K.onInit.call(this)}).addClass("superfish")};A.fn.extend({hideSuperfishUl:function(){var C=A.superfish.op,B=A("li."+C.hoverClass,this).add(this).removeClass(C.hoverClass).find(">ul").hide().css("visibility","hidden");C.onHide.call(B);return this},showSuperfishUl:function(){var C=A.superfish.op,B=this.addClass(C.hoverClass).find(">ul:hidden").css("visibility","visible");C.onBeforeShow.call(B);B.animate(C.animation,C.speed,function(){C.onShow.call(this)});return this}});A(window).unload(function(){A("ul.superfish").each(function(){A("li",this).unbind("mouseover","mouseout","mouseenter","mouseleave")})})})(jQuery);(function(A){A.fn.hoverIntent=function(I,H){var J={sensitivity:7,interval:100,timeout:0};J=A.extend(J,H?{over:I,out:H}:I);var L,K,F,D;var E=function(M){L=M.pageX;K=M.pageY};var C=function(N,M){M.hoverIntent_t=clearTimeout(M.hoverIntent_t);if((Math.abs(F-L)+Math.abs(D-K))<J.sensitivity){A(M).unbind("mousemove",E);M.hoverIntent_s=1;return J.over.apply(M,[N])}else{F=L;D=K;M.hoverIntent_t=setTimeout(function(){C(N,M)},J.interval)}};var G=function(N,M){M.hoverIntent_t=clearTimeout(M.hoverIntent_t);M.hoverIntent_s=0;return J.out.apply(M,[N])};var B=function(P){var O=(P.type=="mouseover"?P.fromElement:P.toElement)||P.relatedTarget;while(O&&O!=this){try{O=O.parentNode}catch(P){O=this}}if(O==this){return false}var N=jQuery.extend({},P);var M=this;if(M.hoverIntent_t){M.hoverIntent_t=clearTimeout(M.hoverIntent_t)}if(P.type=="mouseover"){F=N.pageX;D=N.pageY;A(M).bind("mousemove",E);if(M.hoverIntent_s!=1){M.hoverIntent_t=setTimeout(function(){C(N,M)},J.interval)}}else{A(M).unbind("mousemove",E);if(M.hoverIntent_s==1){M.hoverIntent_t=setTimeout(function(){G(N,M)},J.timeout)}}};return this.mouseover(B).mouseout(B)}})(jQuery);jQuery.jScrollPane={active:[]};jQuery.fn.jScrollPane=function(A){A=jQuery.extend({scrollbarWidth:10,scrollbarMargin:5,wheelSpeed:18,showArrows:false,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:true,scrollbarOnLeft:false},A);return this.each(function(){var K=jQuery(this);if(jQuery(this).parent().is(".jScrollPaneContainer")){var x=A.maintainPosition?K.offset({relativeTo:jQuery(this).parent()[0]}).top:0;var I=jQuery(this).parent();var Y=I.innerWidth();var y=I.outerHeight();var J=y;if(I.unmousewheel){I.unmousewheel()}jQuery(">.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown",I).remove();K.css({top:0})}else{var x=0;this.originalPadding=K.css("paddingTop")+" "+K.css("paddingRight")+" "+K.css("paddingBottom")+" "+K.css("paddingLeft");this.originalSidePaddingTotal=(parseInt(K.css("paddingLeft"))||0)+(parseInt(K.css("paddingRight"))||0);var Y=K.innerWidth();var y=K.innerHeight();var J=y;K.wrap(jQuery("<div></div>").attr({className:"jScrollPaneContainer"}).css({height:y+"px",width:Y+"px"}));jQuery(document).bind("emchange",function(z,AA,p){K.jScrollPane(A)})}var j=this.originalSidePaddingTotal;var g={height:"auto",width:Y-A.scrollbarWidth-A.scrollbarMargin-j+"px"};if(A.scrollbarOnLeft){g.paddingLeft=A.scrollbarMargin+A.scrollbarWidth+"px"}else{g.paddingRight=A.scrollbarMargin+"px"}K.css(g);var h=K.outerHeight();var d=y/h;if(d<0.99){var E=K.parent();E.append(jQuery("<div></div>").attr({className:"jScrollPaneTrack"}).css({width:A.scrollbarWidth+"px"}).append(jQuery("<div></div>").attr({className:"jScrollPaneDrag"}).css({width:A.scrollbarWidth+"px"}).append(jQuery("<div></div>").attr({className:"jScrollPaneDragTop"}).css({width:A.scrollbarWidth+"px"}),jQuery("<div></div>").attr({className:"jScrollPaneDragBottom"}).css({width:A.scrollbarWidth+"px"}))));var u=jQuery(">.jScrollPaneTrack",E);var L=jQuery(">.jScrollPaneTrack .jScrollPaneDrag",E);if(A.showArrows){var b;var w;var O;var l;var e=function(){if(l>4||l%4==0){t(o+w*W)}l++};var H=function(p){jQuery("html").unbind("mouseup",H);b.removeClass("jScrollActiveArrowButton");clearInterval(O)};var U=function(){jQuery("html").bind("mouseup",H);b.addClass("jScrollActiveArrowButton");l=0;e();O=setInterval(e,100)};E.append(jQuery("<a></a>").attr({href:"javascript:;",className:"jScrollArrowUp"}).css({width:A.scrollbarWidth+"px"}).html("Scroll up").bind("mousedown",function(){b=jQuery(this);w=-1;U();this.blur();return false}),jQuery("<a></a>").attr({href:"javascript:;",className:"jScrollArrowDown"}).css({width:A.scrollbarWidth+"px"}).html("Scroll down").bind("mousedown",function(){b=jQuery(this);w=1;U();this.blur();return false}));var M=jQuery(">.jScrollArrowUp",E);var G=jQuery(">.jScrollArrowDown",E);if(A.arrowSize){J=y-A.arrowSize-A.arrowSize;u.css({height:J+"px",top:A.arrowSize+"px"})}else{var m=M.height();A.arrowSize=m;J=y-m-G.height();u.css({height:J+"px",top:m+"px"})}}var r=jQuery(this).css({position:"absolute",overflow:"visible"});var B;var T;var W;var o=0;var R=d*y/2;var V=function(z,AB){var AA=AB=="X"?"Left":"Top";return z["page"+AB]||(z["client"+AB]+(document.documentElement["scroll"+AA]||document.body["scroll"+AA]))||0};var a=function(){return false};var q=function(){i();B=L.offset(false);B.top-=o;T=J-L[0].offsetHeight;W=2*A.wheelSpeed*T/h};var C=function(p){q();R=V(p,"Y")-o-B.top;jQuery("html").bind("mouseup",P).bind("mousemove",c);if(jQuery.browser.msie){jQuery("html").bind("dragstart",a).bind("selectstart",a)}return false};var P=function(){jQuery("html").unbind("mouseup",P).unbind("mousemove",c);R=d*y/2;if(jQuery.browser.msie){jQuery("html").unbind("dragstart",a).unbind("selectstart",a)}};var t=function(z){z=z<0?0:(z>T?T:z);o=z;L.css({top:z+"px"});var AA=z/T;r.css({top:((y-h)*AA)+"px"});K.trigger("scroll");if(A.showArrows){M[z==0?"addClass":"removeClass"]("disabled");G[z==T?"addClass":"removeClass"]("disabled")}};var c=function(p){t(V(p,"Y")-B.top-R)};var k=Math.max(Math.min(d*(y-A.arrowSize*2),A.dragMaxHeight),A.dragMinHeight);L.css({height:k+"px"}).bind("mousedown",C);var f;var N;var F;var n=function(){if(N>8||N%4==0){t((o-((o-F)/2)))}N++};var v=function(){clearInterval(f);jQuery("html").unbind("mouseup",v).unbind("mousemove",Z)};var Z=function(p){F=V(p,"Y")-B.top-R};var Q=function(p){q();Z(p);N=0;jQuery("html").bind("mouseup",v).bind("mousemove",Z);f=setInterval(n,100);n()};u.bind("mousedown",Q);if(E.mousewheel){E.mousewheel(function(z,AB){q();i();var AA=o;t(o-AB*W);var p=AA!=o;return !p},false)}var D;var S;function X(){var p=(D-o)/A.animateStep;if(p>1||p<-1){t(o+p)}else{t(D);i()}}var i=function(){if(S){clearInterval(S);delete D}};var s=function(AA,p){if(typeof AA=="string"){$e=jQuery(AA,this);if(!$e.length){return }AA=$e.offset().top-K.offset().top}i();var z=-AA/(y-h)*T;if(!p||A.animateTo){D=z;S=setInterval(X,A.animateInterval)}else{t(z)}};K[0].scrollTo=s;K[0].scrollBy=function(z){var p=-parseInt(r.css("top"))||0;s(p+z)};q();s(-x,true);jQuery.jScrollPane.active.push(K[0])}else{K.css({height:y+"px",width:Y-this.originalSidePaddingTotal+"px",padding:this.originalPadding})}})};jQuery(window).bind("unload",function(){var B=jQuery.jScrollPane.active;for(var A=0;A<B.length;A++){B[A].scrollTo=B[A].scrollBy=null}});

/*
	Masked Input plugin for jQuery
	Copyright (c) 2007-2009 Josh Bush (digitalbush.com)
	Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license) 
	Version: 1.2.2 (03/09/2009 22:39:06)
*/
(function(a){var c=(a.browser.msie?"paste":"input")+".mask";var b=(window.orientation!=undefined);a.mask={definitions:{"9":"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"}};a.fn.extend({caret:function(e,f){if(this.length==0){return}if(typeof e=="number"){f=(typeof f=="number")?f:e;return this.each(function(){if(this.setSelectionRange){this.focus();this.setSelectionRange(e,f)}else{if(this.createTextRange){var g=this.createTextRange();g.collapse(true);g.moveEnd("character",f);g.moveStart("character",e);g.select()}}})}else{if(this[0].setSelectionRange){e=this[0].selectionStart;f=this[0].selectionEnd}else{if(document.selection&&document.selection.createRange){var d=document.selection.createRange();e=0-d.duplicate().moveStart("character",-100000);f=e+d.text.length}}return{begin:e,end:f}}},unmask:function(){return this.trigger("unmask")},mask:function(j,d){if(!j&&this.length>0){var f=a(this[0]);var g=f.data("tests");return a.map(f.data("buffer"),function(l,m){return g[m]?l:null}).join("")}d=a.extend({placeholder:"_",completed:null},d);var k=a.mask.definitions;var g=[];var e=j.length;var i=null;var h=j.length;a.each(j.split(""),function(m,l){if(l=="?"){h--;e=m}else{if(k[l]){g.push(new RegExp(k[l]));if(i==null){i=g.length-1}}else{g.push(null)}}});return this.each(function(){var r=a(this);var m=a.map(j.split(""),function(x,y){if(x!="?"){return k[x]?d.placeholder:x}});var n=false;var q=r.val();r.data("buffer",m).data("tests",g);function v(x){while(++x<=h&&!g[x]){}return x}function t(x){while(!g[x]&&--x>=0){}for(var y=x;y<h;y++){if(g[y]){m[y]=d.placeholder;var z=v(y);if(z<h&&g[y].test(m[z])){m[y]=m[z]}else{break}}}s();r.caret(Math.max(i,x))}function u(y){for(var A=y,z=d.placeholder;A<h;A++){if(g[A]){var B=v(A);var x=m[A];m[A]=z;if(B<h&&g[B].test(x)){z=x}else{break}}}}function l(y){var x=a(this).caret();var z=y.keyCode;n=(z<16||(z>16&&z<32)||(z>32&&z<41));if((x.begin-x.end)!=0&&(!n||z==8||z==46)){w(x.begin,x.end)}if(z==8||z==46||(b&&z==127)){t(x.begin+(z==46?0:-1));return false}else{if(z==27){r.val(q);r.caret(0,p());return false}}}function o(B){if(n){n=false;return(B.keyCode==8)?false:null}B=B||window.event;var C=B.charCode||B.keyCode||B.which;var z=a(this).caret();if(B.ctrlKey||B.altKey||B.metaKey){return true}else{if((C>=32&&C<=125)||C>186){var x=v(z.begin-1);if(x<h){var A=String.fromCharCode(C);if(g[x].test(A)){u(x);m[x]=A;s();var y=v(x);a(this).caret(y);if(d.completed&&y==h){d.completed.call(r)}}}}}return false}function w(x,y){for(var z=x;z<y&&z<h;z++){if(g[z]){m[z]=d.placeholder}}}function s(){return r.val(m.join("")).val()}function p(y){var z=r.val();var C=-1;for(var B=0,x=0;B<h;B++){if(g[B]){m[B]=d.placeholder;while(x++<z.length){var A=z.charAt(x-1);if(g[B].test(A)){m[B]=A;C=B;break}}if(x>z.length){break}}else{if(m[B]==z[x]&&B!=e){x++;C=B}}}if(!y&&C+1<e){r.val("");w(0,h)}else{if(y||C+1>=e){s();if(!y){r.val(r.val().substring(0,C+1))}}}return(e?B:i)}if(!r.attr("readonly")){r.one("unmask",function(){r.unbind(".mask").removeData("buffer").removeData("tests")}).bind("focus.mask",function(){q=r.val();var x=p();s();setTimeout(function(){if(x==j.length){r.caret(0,x)}else{r.caret(x)}},0)}).bind("blur.mask",function(){p();if(r.val()!=q){r.change()}}).bind("keydown.mask",l).bind("keypress.mask",o).bind(c,function(){setTimeout(function(){r.caret(p(true))},0)})}p()})}})})(jQuery);

jQuery(document).ready(function(){
    if ( jQuery('#dnn_ctr1487_DynamicForms_tblQuestions').length > 0 ) {
        // when we are on the eNews signup page, mask the birthday field
        jQuery(jQuery('input.DynamicForms_TextBox')[8]).mask("99/99/9999");
    }

    // image pulsating, used on thanksgiving page 20091110
    var ldm_fademe = jQuery('#ldmimgrotator li:last');
    var ldm_blank = jQuery('#ldmimgrotator li:eq(1)');
    var ldm_fademe_counter = 0;
    setInterval(function() {
        if (ldm_fademe_counter == 0 ) {
            jQuery(ldm_fademe).stop().fadeOut('slow');
            setTimeout(function() {
                jQuery(ldm_blank).stop().fadeOut('slow');
            }, 900);
            ldm_fademe_counter = 1;
        } else if (ldm_fademe_counter == 1) {
            jQuery(ldm_blank).stop().fadeIn('slow');
            setTimeout(function() {
                jQuery(ldm_fademe).stop().fadeIn('slow');
            }, 900);
            ldm_fademe_counter = 0;
        }
    }, 5000);

    // orig value 3000, request for faster
        
});
