PageSourceSearch

https://www.mukcbs.org/sites/default/files/js/js_J43MOerar7EATJHHImRrdozhwsQIkVU9kJFzDB3uwFM.js

js mukcbs.org collected 2026-10-02 10:19:10 UTC 177,093 bytes, 3,180 lines download raw bytes

vendor: 11,960 bytes, lines 1-6
1/*!
2	Colorbox 1.6.4
3	license: MIT
4	http://www.jacklmoore.com/colorbox
5*/
6(function(t,e,i){function n(i,n,o){var r=e.createElement(i);return n&&(r.id=Z+n),o&&(r.style.cssText=o),t(r)}function o(){return i.innerHeight?i.innerHeight:t(i).height()}function r(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var n;return void 0===this.cache[e]&&(n=t(this.el).attr("data-cbox-"+e),void 0!==n?this.cache[e]=n:void 0!==i[e]?this.cache[e]=i[e]:void 0!==X[e]&&(this.cache[e]=X[e])),this.cache[e]},this.get=function(e){var i=this.value(e);return t.isFunction(i)?i.call(this.el,this):i}}function h(t){var e=W.length,i=(A+t)%e;return 0>i?e+i:i}function a(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():o())/100:1)*parseInt(t,10))}function s(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function l(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function d(t){"contains"in x[0]&&!x[0].contains(t.target)&&t.target!==v[0]&&(t.stopPropagation(),x.focus())}function c(t){c.str!==t&&(x.add(v).removeClass(c.str).addClass(t),c.str=t)}function g(e){A=0,e&&e!==!1&&"nofollow"!==e?(W=t("."+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get("rel")===e}),A=W.index(_.el),-1===A&&(W=W.add(_.el),A=W.length-1)):W=t(_.el)}function u(i){t(e).trigger(i),ae.triggerHandler(i)}function f(i){var o;if(!G){if(o=t(i).data(Y),_=new r(i,o),g(_.get("rel")),!U){U=$=!0,c(_.get("className")),x.css({visibility:"hidden",display:"block",opacity:""}),I=n(se,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(I),j=T.height()+k.height()+b.outerHeight(!0)-b.height(),D=C.width()+H.width()+b.outerWidth(!0)-b.width(),N=I.outerHeight(!0),z=I.outerWidth(!0);var h=a(_.get("initialWidth"),"x"),s=a(_.get("initialHeight"),"y"),l=_.get("maxWidth"),f=_.get("maxHeight");_.w=Math.max((l!==!1?Math.min(h,a(l,"x")):h)-z-D,0),_.h=Math.max((f!==!1?Math.min(s,a(f,"y")):s)-N-j,0),I.css({width:"",height:_.h}),J.position(),u(ee),_.get("onOpen"),O.add(F).hide(),x.focus(),_.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",d,!0),ae.one(re,function(){e.removeEventListener("focus",d,!0)})),_.get("returnFocus")&&ae.one(re,function(){t(_.el).focus()})}var p=parseFloat(_.get("opacity"));v.css({opacity:p===p?p:"",cursor:_.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),_.get("closeButton")?B.html(_.get("close")).appendTo(b):B.appendTo("<div/>"),w()}}function p(){x||(V=!1,E=t(i),x=n(se).attr({id:Y,"class":t.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),v=n(se,"Overlay").hide(),L=t([n(se,"LoadingOverlay")[0],n(se,"LoadingGraphic")[0]]),y=n(se,"Wrapper"),b=n(se,"Content").append(F=n(se,"Title"),R=n(se,"Current"),P=t('<button type="button"/>').attr({id:Z+"Previous"}),K=t('<button type="button"/>').attr({id:Z+"Next"}),S=t('<button type="button"/>').attr({id:Z+"Slideshow"}),L),B=t('<button type="button"/>').attr({id:Z+"Close"}),y.append(n(se).append(n(se,"TopLeft"),T=n(se,"TopCenter"),n(se,"TopRight")),n(se,!1,"clear:left").append(C=n(se,"MiddleLeft"),b,H=n(se,"MiddleRight")),n(se,!1,"clear:left").append(n(se,"BottomLeft"),k=n(se,"BottomCenter"),n(se,"BottomRight"))).find("div div").css({"float":"left"}),M=n(se,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),O=K.add(P).add(R).add(S)),e.body&&!x.parent().length&&t(e.body).append(v,x.append(y,M))}function m(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),f(this))}return x?(V||(V=!0,K.click(function(){J.next()}),P.click(function(){J.prev()}),B.click(function(){J.close()}),v.click(function(){_.get("overlayClose")&&J.close()}),t(e).bind("keydown."+Z,function(t){var e=t.keyCode;U&&_.get("escKey")&&27===e&&(t.preventDefault(),J.close()),U&&_.get("arrowKey")&&W[1]&&!t.altKey&&(37===e?(t.preventDefault(),P.click()):39===e&&(t.preventDefault(),K.click()))}),t.isFunction(t.fn.on)?t(e).on("click."+Z,"."+te,i):t("."+te).live("click."+Z,i)),!0):!1}function w(){var e,o,r,h=J.prep,d=++le;if($=!0,q=!1,u(he),u(ie),_.get("onLoad"),_.h=_.get("height")?a(_.get("height"),"y")-N-j:_.get("innerHeight")&&a(_.get("innerHeight"),"y"),_.w=_.get("width")?a(_.get("width"),"x")-z-D:_.get("innerWidth")&&a(_.get("innerWidth"),"x"),_.mw=_.w,_.mh=_.h,_.get("maxWidth")&&(_.mw=a(_.get("maxWidth"),"x")-z-D,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.get("maxHeight")&&(_.mh=a(_.get("maxHeight"),"y")-N-j,_.mh=_.h&&_.h<_.mh?_.h:_.mh),e=_.get("href"),Q=setTimeout(function(){L.show()},100),_.get("inline")){var c=t(e).eq(0);r=t("<div>").hide().insertBefore(c),ae.one(he,function(){r.replaceWith(c)}),h(c)}else _.get("iframe")?h(" "):_.get("html")?h(_.get("html")):s(_,e)?(e=l(_,e),q=_.get("createImg"),t(q).addClass(Z+"Photo").bind("error."+Z,function(){h(n(se,"Error").html(_.get("imgError")))}).one("load",function(){d===le&&setTimeout(function(){var e;_.get("retinaImage")&&i.devicePixelRatio>1&&(q.height=q.height/i.devicePixelRatio,q.width=q.width/i.devicePixelRatio),_.get("scalePhotos")&&(o=function(){q.height-=q.height*e,q.width-=q.width*e},_.mw&&q.width>_.mw&&(e=(q.width-_.mw)/q.width,o()),_.mh&&q.height>_.mh&&(e=(q.height-_.mh)/q.height,o())),_.h&&(q.style.marginTop=Math.max(_.mh-q.height,0)/2+"px"),W[1]&&(_.get("loop")||W[A+1])&&(q.style.cursor="pointer",t(q).bind("click."+Z,function(){J.next()})),q.style.width=q.width+"px",q.style.height=q.height+"px",h(q)},1)}),q.src=e):e&&M.load(e,_.get("data"),function(e,i){d===le&&h("error"===i?n(se,"Error").html(_.get("xhrError")):t(this).contents())})}var v,x,y,b,T,C,H,k,W,E,I,M,L,F,R,S,K,P,B,O,_,j,D,N,z,A,q,U,$,G,Q,J,V,X={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),n=t(this).data("cbox-iframe-attrs");return"object"==typeof n&&t.each(n,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},Y="colorbox",Z="cbox",te=Z+"Element",ee=Z+"_open",ie=Z+"_load",ne=Z+"_complete",oe=Z+"_cleanup",re=Z+"_closed",he=Z+"_purge",ae=t("<a/>"),se="div",le=0,de={},ce=function(){function t(){clearTimeout(h)}function e(){(_.get("loop")||W[A+1])&&(t(),h=setTimeout(J.next,_.get("slideshowSpeed")))}function i(){S.html(_.get("slideshowStop")).unbind(s).one(s,n),ae.bind(ne,e).bind(ie,t),x.removeClass(a+"off").addClass(a+"on")}function n(){t(),ae.unbind(ne,e).unbind(ie,t),S.html(_.get("slideshowStart")).unbind(s).one(s,function(){J.next(),i()}),x.removeClass(a+"on").addClass(a+"off")}function o(){r=!1,S.hide(),t(),ae.unbind(ne,e).unbind(ie,t),x.removeClass(a+"off "+a+"on")}var r,h,a=Z+"Slideshow_",s="click."+Z;return function(){r?_.get("slideshow")||(ae.unbind(oe,o),o()):_.get("slideshow")&&W[1]&&(r=!0,ae.one(oe,o),_.get("slideshowAuto")?i():n(),S.show())}}();t[Y]||(t(p),J=t.fn[Y]=t[Y]=function(e,i){var n,o=this;return e=e||{},t.isFunction(o)&&(o=t("<a/>"),e.open=!0),o[0]?(p(),m()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,Y)||{};t.data(this,Y,t.extend(i,e))}).addClass(te),n=new r(o[0],e),n.get("open")&&f(o[0])),o):o},J.position=function(e,i){function n(){T[0].style.width=k[0].style.width=b[0].style.width=parseInt(x[0].style.width,10)-D+"px",b[0].style.height=C[0].style.height=H[0].style.height=parseInt(x[0].style.height,10)-j+"px"}var r,h,s,l=0,d=0,c=x.offset();if(E.unbind("resize."+Z),x.css({top:-9e4,left:-9e4}),h=E.scrollTop(),s=E.scrollLeft(),_.get("fixed")?(c.top-=h,c.left-=s,x.css({position:"fixed"})):(l=h,d=s,x.css({position:"absolute"})),d+=_.get("right")!==!1?Math.max(E.width()-_.w-z-D-a(_.get("right"),"x"),0):_.get("left")!==!1?a(_.get("left"),"x"):Math.round(Math.max(E.width()-_.w-z-D,0)/2),l+=_.get("bottom")!==!1?Math.max(o()-_.h-N-j-a(_.get("bottom"),"y"),0):_.get("top")!==!1?a(_.get("top"),"y"):Math.round(Math.max(o()-_.h-N-j,0)/2),x.css({top:c.top,left:c.left,visibility:"visible"}),y[0].style.width=y[0].style.height="9999px",r={width:_.w+z+D,height:_.h+N+j,top:l,left:d},e){var g=0;t.each(r,function(t){return r[t]!==de[t]?(g=e,void 0):void 0}),e=g}de=r,e||x.css(r),x.dequeue().animate(r,{duration:e||0,complete:function(){n(),$=!1,y[0].style.width=_.w+z+D+"px",y[0].style.height=_.h+N+j+"px",_.get("reposition")&&setTimeout(function(){E.bind("resize."+Z,J.position)},1),t.isFunction(i)&&i()},step:n})},J.resize=function(t){var e;U&&(t=t||{},t.width&&(_.w=a(t.width,"x")-z-D),t.innerWidth&&(_.w=a(t.innerWidth,"x")),I.css({width:_.w}),t.height&&(_.h=a(t.height,"y")-N-j),t.innerHeight&&(_.h=a(t.innerHeight,"y")),t.innerHeight||t.height||(e=I.scrollTop(),I.css({height:"auto"}),_.h=I.height()),I.css({height:_.h}),e&&I.scrollTop(e),J.position("none"===_.get("transition")?0:_.get("speed")))},J.prep=function(i){function o(){return _.w=_.w||I.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function a(){return _.h=_.h||I.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if(U){var d,g="none"===_.get("transition")?0:_.get("speed");I.remove(),I=n(se,"LoadedContent").append(i),I.hide().appendTo(M.show()).css({width:o(),overflow:_.get("scrolling")?"auto":"hidden"}).css({height:a()}).prependTo(b),M.hide(),t(q).css({"float":"none"}),c(_.get("className")),d=function(){function i(){t.support.opacity===!1&&x[0].style.removeAttribute("filter")}var n,o,a=W.length;U&&(o=function(){clearTimeout(Q),L.hide(),u(ne),_.get("onComplete")},F.html(_.get("title")).show(),I.show(),a>1?("string"==typeof _.get("current")&&R.html(_.get("current").replace("{current}",A+1).replace("{total}",a)).show(),K[_.get("loop")||a-1>A?"show":"hide"]().html(_.get("next")),P[_.get("loop")||A?"show":"hide"]().html(_.get("previous")),ce(),_.get("preloading")&&t.each([h(-1),h(1)],function(){var i,n=W[this],o=new r(n,t.data(n,Y)),h=o.get("href");h&&s(o,h)&&(h=l(o,h),i=e.createElement("img"),i.src=h)})):O.hide(),_.get("iframe")?(n=_.get("createIframe"),_.get("scrolling")||(n.scrolling="no"),t(n).attr({src:_.get("href"),"class":Z+"Iframe"}).one("load",o).appendTo(I),ae.one(he,function(){n.src="//about:blank"}),_.get("fastIframe")&&t(n).trigger("load")):o(),"fade"===_.get("transition")?x.fadeTo(g,1,i):i())},"fade"===_.get("transition")?x.fadeTo(g,0,function(){J.position(0,d)}):J.position(g,d)}},J.next=function(){!$&&W[1]&&(_.get("loop")||W[A+1])&&(A=h(1),f(W[A]))},J.prev=function(){!$&&W[1]&&(_.get("loop")||A)&&(A=h(-1),f(W[A]))},J.close=function(){U&&!G&&(G=!0,U=!1,u(oe),_.get("onCleanup"),E.unbind("."+Z),v.fadeTo(_.get("fadeOut")||0,0),x.stop().fadeTo(_.get("fadeOut")||0,0,function(){x.hide(),v.hide(),u(he),I.remove(),setTimeout(function(){G=!1,u(re),_.get("onClosed")},1)}))},J.remove=function(){x&&(x.stop(),t[Y].close(),x.stop(!1,!0).remove(),v.remove(),G=!1,x=null,t("."+te).removeData(Y).removeClass(te),t(e).unbind("click."+Z).unbind("keydown."+Z))},J.element=function(){return t(_.el)},J.settings=X)})(jQuery,document,window);
vendor: 5,061 bytes, lines 6-8
6;
7/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */
8!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,(function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const u=N(Array.prototype.forEach),m=N(Array.prototype.pop),f=N(Array.prototype.push),p=N(String.prototype.toLowerCase),d=N(String.prototype.toString),h=N(String.prototype.match),g=N(String.prototype.replace),T=N(String.prototype.indexOf),y=N(String.prototype.trim),E=N(RegExp.prototype.test),A=(_=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(_,t)});var _;function N(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return c(e,t,o)}}function b(e,o){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p;t&&t(e,null);let i=o.length;for(;i--;){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}function S(t){const n=l(null);for(const[o,i]of e(t))void 0!==r(t,o)&&(n[o]=i);return n}function R(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return N(n.get);if("function"==typeof n.value)return N(n.value)}e=o(e)}return function(e){return console.warn("fallback value for",e),null}}const w=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),D=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),L=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),v=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),x=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),k=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),C=i(["#text"]),O=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
8spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),I=i(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),M=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),U=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),P=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),F=a(/<%[\w\W]*|[\w\W]*%>/gm),H=a(/\${[\w\W]*}/gm),z=a(/^data-[\-\w.\u00B7-\uFFFF]/),B=a(/^aria-[\-\w]+$/),W=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),G=a(/^(?:\w+script|data):/i),Y=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),j=a(/^html$/i);var q=Object.freeze({__proto__:null,MUSTACHE_EXPR:P,ERB_EXPR:F,TMPLIT_EXPR:H,DATA_ATTR:z,ARIA_ATTR:B,IS_ALLOWED_URI:W,IS_SCRIPT_OR_DATA:G,ATTR_WHITESPACE:Y,DOCTYPE_NAME:j});const X=function(){return"undefined"==typeof window?null:window},K=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};var V=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:X();const o=e=>t(e);if(o.version="3.0.6",o.removed=[],!n||!n.document||9!==n.document.nodeType)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:_,Node:N,Element:P,NodeFilter:F,NamedNodeMap:H=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:z,DOMParser:B,trustedTypes:G}=n,Y=P.prototype,V=R(Y,"cloneNode"),$=R(Y,"nextSibling"),Z=R(Y,"childNodes"),J=R(Y,"parentNode");if("function"==typeof _){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let Q,ee="";const{implementation:te,createNodeIterator:ne,createDocumentFragment:oe,getElementsByTagName:re}=r,{importNode:ie}=a;let ae={};o.isSupported="function"==typeof e&&"function"==typeof J&&te&&void 0!==te.createHTMLDocument;const{MUSTACHE_EXPR:le,ERB_EXPR:ce,TMPLIT_EXPR:se,DATA_ATTR:ue,ARIA_ATTR:me,IS_SCRIPT_OR_DATA:fe,ATTR_WHITESPACE:pe}=q;let{IS_ALLOWED_URI:de}=q,he=null;const ge=b({},[...w,...D,...L,...x,...C]);let Te=null;const ye=b({},[...O,...I,...M,...U]);let Ee=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ae=null,_e=null,Ne=!0,be=!0,Se=!1,Re=!0,we=!1,De=!1,Le=!1,ve=!1,xe=!1,ke=!1,Ce=!1,Oe=!0,Ie=!1;const Me="user-content-";let Ue=!0,Pe=!1,Fe={},He=null;const ze=b({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Be=null;const We=b({},["audio","video","img","source","image","track"]);let Ge=null;const Ye=b({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),je="http://www.w3.org/1998/Math/MathML",qe="http://www.w3.org/2000/svg",Xe="http://www.w3.org/1999/xhtml";let Ke=Xe,Ve=!1,$e=null;const Ze=b({},[je,qe,Xe],d);let Je=null;const Qe=["application/xhtml+xml","text/html"],et="text/html";let tt=null,nt=null;const ot=r.createElement("form"),rt=function(e){return e instanceof RegExp||e instanceof Function},it=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!nt||nt!==e){if(e&&"object"==typeof e||(e={}
vendor: 5,478 bytes, line 8
8),e=S(e),Je=Je=-1===Qe.indexOf(e.PARSER_MEDIA_TYPE)?et:e.PARSER_MEDIA_TYPE,tt="application/xhtml+xml"===Je?d:p,he="ALLOWED_TAGS"in e?b({},e.ALLOWED_TAGS,tt):ge,Te="ALLOWED_ATTR"in e?b({},e.ALLOWED_ATTR,tt):ye,$e="ALLOWED_NAMESPACES"in e?b({},e.ALLOWED_NAMESPACES,d):Ze,Ge="ADD_URI_SAFE_ATTR"in e?b(S(Ye),e.ADD_URI_SAFE_ATTR,tt):Ye,Be="ADD_DATA_URI_TAGS"in e?b(S(We),e.ADD_DATA_URI_TAGS,tt):We,He="FORBID_CONTENTS"in e?b({},e.FORBID_CONTENTS,tt):ze,Ae="FORBID_TAGS"in e?b({},e.FORBID_TAGS,tt):{},_e="FORBID_ATTR"in e?b({},e.FORBID_ATTR,tt):{},Fe="USE_PROFILES"in e&&e.USE_PROFILES,Ne=!1!==e.ALLOW_ARIA_ATTR,be=!1!==e.ALLOW_DATA_ATTR,Se=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Re=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,we=e.SAFE_FOR_TEMPLATES||!1,De=e.WHOLE_DOCUMENT||!1,xe=e.RETURN_DOM||!1,ke=e.RETURN_DOM_FRAGMENT||!1,Ce=e.RETURN_TRUSTED_TYPE||!1,ve=e.FORCE_BODY||!1,Oe=!1!==e.SANITIZE_DOM,Ie=e.SANITIZE_NAMED_PROPS||!1,Ue=!1!==e.KEEP_CONTENT,Pe=e.IN_PLACE||!1,de=e.ALLOWED_URI_REGEXP||W,Ke=e.NAMESPACE||Xe,Ee=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&rt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ee.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&rt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ee.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ee.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),we&&(be=!1),ke&&(xe=!0),Fe&&(he=b({},[...C]),Te=[],!0===Fe.html&&(b(he,w),b(Te,O)),!0===Fe.svg&&(b(he,D),b(Te,I),b(Te,U)),!0===Fe.svgFilters&&(b(he,L),b(Te,I),b(Te,U)),!0===Fe.mathMl&&(b(he,x),b(Te,M),b(Te,U))),e.ADD_TAGS&&(he===ge&&(he=S(he)),b(he,e.ADD_TAGS,tt)),e.ADD_ATTR&&(Te===ye&&(Te=S(Te)),b(Te,e.ADD_ATTR,tt)),e.ADD_URI_SAFE_ATTR&&b(Ge,e.ADD_URI_SAFE_ATTR,tt),e.FORBID_CONTENTS&&(He===ze&&(He=S(He)),b(He,e.FORBID_CONTENTS,tt)),Ue&&(he["#text"]=!0),De&&b(he,["html","head","body"]),he.table&&(b(he,["tbody"]),delete Ae.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Q=e.TRUSTED_TYPES_POLICY,ee=Q.createHTML("")}else void 0===Q&&(Q=K(G,c)),null!==Q&&"string"==typeof ee&&(ee=Q.createHTML(""));i&&i(e),nt=e}},at=b({},["mi","mo","mn","ms","mtext"]),lt=b({},["foreignobject","desc","title","annotation-xml"]),ct=b({},["title","style","font","a","script"]),st=b({},D);b(st,L),b(st,v);const ut=b({},x);b(ut,k);const mt=function(e){let t=J(e);t&&t.tagName||(t={namespaceURI:Ke,tagName:"template"});const n=p(e.tagName),o=p(t.tagName);return!!$e[e.namespaceURI]&&(e.namespaceURI===qe?t.namespaceURI===Xe?"svg"===n:t.namespaceURI===je?"svg"===n&&("annotation-xml"===o||at[o]):Boolean(st[n]):e.namespaceURI===je?t.namespaceURI===Xe?"math"===n:t.namespaceURI===qe?"math"===n&&lt[o]:Boolean(ut[n]):e.namespaceURI===Xe?!(t.namespaceURI===qe&&!lt[o])&&(!(t.namespaceURI===je&&!at[o])&&(!ut[n]&&(ct[n]||!st[n]))):!("application/xhtml+xml"!==Je||!$e[e.namespaceURI]))},ft=function(e){f(o.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},pt=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Te[e])if(xe||ke)try{ft(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},dt=function(e){let t=null,n=null;if(ve)e="<remove></remove>"+e;else{const t=h(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Je&&Ke===Xe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=Q?Q.createHTML(e):e;if(Ke===Xe)try{t=(new B).parseFromString(o,Je)}catch(e){}if(!t||!t.documentElement){t=te.createDocument(Ke,"template",null);try{t.documentElement.innerHTML=Ve?ee:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),Ke===Xe?re.call(t,De?"html":"body")[0]:De?t.documentElement:i},ht=function(e){return ne.call(e.ownerDocument||e,e,F.SHOW_ELEMENT|F.SHOW_COMMENT|F.SHOW_TEXT,null)},gt=function(e){return e instanceof z&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof H)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Tt=function(e){return"function"==typeof N&&e instanceof N},yt=function(e,t,n){ae[e]&&u(ae[e],(e=>{e.call(o,t,n,nt)}))},Et=function(e){let t=null;if(yt("beforeSanitizeElements",e,null),gt(e))return ft(e),!0;const n=tt(e.nodeName);if(yt("uponSanitizeElement",e,{tagName:n,allowedTags:he}),e.hasChildNodes()&&!Tt(e.firstElementChild)&&E(/<[/\w]/g,e.innerHTML)&&E(/<[/\w]/g,e.textContent))return ft(e),!0;if(!he[n]||Ae[n]){if(!Ae[n]&&_t(n)){if(Ee.tagNameCheck instanceof RegExp&&E(Ee.tagNameCheck,n))return!1;if(Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(n))return!1}if(Ue&&!He[n]){const t=J(e)||e.parentNode,n=Z(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o)t.insertBefore(V(n[o],!0),$(e))}}return ft(e),!0}return e instanceof P&&!mt(e)?(ft(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!E(/<\/no(script|embed|frames)/i,e.innerHTML)?(we&&3===e.n
8odeType&&(t=e.textContent,u([le,ce,se],(e=>{t=g(t,e," ")})),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),yt("afterSanitizeElements",e,null),!1):(ft(e),!0)},At=function(e,t,n){if(Oe&&("id"===t||"name"===t)&&(n in r||n in ot))return!1;if(be&&!_e[t]&&E(ue,t));else if(Ne&&E(me,t));else if(!Te[t]||_e[t]){if(!(_t(e)&&(Ee.tagNameCheck instanceof RegExp&&E(Ee.tagNameCheck,e)||Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(e))&&(Ee.attributeNameCheck instanceof RegExp&&E(Ee.attributeNameCheck,t)||Ee.attributeNameCheck instanceof Function&&Ee.attributeNameCheck(t))||"is"===t&&Ee.allowCustomizedBuiltInElements&&(Ee.tagNameCheck instanceof RegExp&&E(Ee.tagNameCheck,n)||Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(n))))return!1}else if(Ge[t]);else if(E(de,g(n,pe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==T(n,"data:")||!Be[e]){if(Se&&!E(fe,g(n,pe,"")));else if(n)return!1}else;return!0},_t=function(e){return e.indexOf("-")>0},Nt=function(e){yt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Te};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=tt(a);let f="value"===a?c:y(c);if(n.attrName=s,n.attrValue=f,n.keepAttr=!0,n.forceKeepAttr=void 0,yt("uponSanitizeAttribute",e,n),f=n.attrValue,n.forceKeepAttr)continue;if(pt(a,e),!n.keepAttr)continue;if(!Re&&E(/\/>/i,f)){pt(a,e);continue}we&&u([le,ce,se],(e=>{f=g(f,e," ")}));const p=tt(e.nodeName);if(At(p,s,f)){if(!Ie||"id"!==s&&"name"!==s||(pt(a,e),f=Me+f),Q&&"object"==typeof G&&"function"==typeof G.getAttributeType)if(l);else switch(G.getAttributeType(p,s)){case"TrustedHTML":f=Q.createHTML(f);break;case"TrustedScriptURL":f=Q.createScriptURL(f)}try{l?e.setAttributeNS(l,a,f):e.setAttribute(a,f),m(o.removed)}catch(e){}}}yt("afterSanitizeAttributes",e,null)},bt=function e(t){let n=null;const o=ht(t);for(yt("beforeSanitizeShadowDOM",t,null);n=o.nextNode();)yt("uponSanitizeShadowNode",n,null),Et(n)||(n.content instanceof s&&e(n.content),Nt(n));yt("afterSanitizeShadowDOM",t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,i=null,l=null;if(Ve=!e,Ve&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Tt(e)){if("function"!=typeof e.toString)throw A("toString is not a function");if("string"!=typeof(e=e.toString()))throw A("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Le||it(t),o.removed=[],"string"==typeof e&&(Pe=!1),Pe){if(e.nodeName){const t=tt(e.nodeName);if(!he[t]||Ae[t])throw A("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof N)n=dt("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),1===r.nodeType&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!xe&&!we&&!De&&-1===e.indexOf("<"))return Q&&Ce?Q.createHTML(e):e;if(n=dt(e),!n)return xe?null:Ce?ee:""}n&&ve&&ft(n.firstChild);const c=ht(Pe?e:n);for(;i=c.nextNode();)Et(i)||(i.content instanceof s&&bt(i.content),Nt(i));if(Pe)return e;if(xe){if(ke)for(l=oe.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(Te.shadowroot||Te.shadowrootmode)&&(l=ie.call(a,l,!0)),l}let m=De?n.outerHTML:n.innerHTML;return De&&he["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&E(j,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),we&&u([le,ce,se],(e=>{m=g(m,e," ")})),Q&&Ce?Q.createHTML(m):m},o.setConfig=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};it(e),Le=!0},o.clearConfig=function(){nt=null,Le=!1},o.isValidAttribute=function(e,t,n){nt||it({});const o=tt(e),r=tt(t);return At(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&(ae[e]=ae[e]||[],f(ae[e],t))},o.removeHook=function(e){if(ae[e])return m(ae[e])},o.removeHooks=function(e){ae[e]&&(ae[e]=[])},o.removeAllHooks=function(){ae={}},o}();return V}));
9
10;
11/**
12 * @file
13 * Colorbox module init js.
14 */
15
16(function ($) {
17
18Drupal.behaviors.initColorbox = {
19  attach: function (context, settings) {
20    if (!$.isFunction($('a, area, input', context).colorbox) || typeof settings.colorbox === 'undefined') {
21      return;
22    }
23
24    if (settings.colorbox.mobiledetect && window.matchMedia) {
25      // Disable Colorbox for small screens.
26      var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")");
27      if (mq.matches) {
28        return;
29      }
30    }
31
32    // Use "data-colorbox-gallery" if set otherwise use "rel".
33    settings.colorbox.rel = function () {
34      if ($(this).data('colorbox-gallery')) {
35        return $(this).data('colorbox-gallery');
36      }
37      else {
38        return $(this).attr('rel');
39      }
40    };
41
42    $('.colorbox', context)
43      .once('init-colorbox').each(function(){
44        // Only images are supported for the "colorbox" class.
45        // The "photo" setting forces the href attribute to be treated as an image.
46        var extendParams = {
47          photo: true
48        };
49        // If a title attribute is supplied, sanitize it.
50        var title = $(this).attr('title');
51        if (title) {
52          extendParams.title = Drupal.colorbox.sanitizeMarkup(title);
53        }
54        $(this).colorbox($.extend({}, settings.colorbox, extendParams));
55      });
56
57    $(context).bind('cbox_complete', function () {
58      Drupal.attachBehaviors($('#cboxLoadedContent'));
59    });
60  }
61};
62
63// Create colorbox namespace if it doesn't exist.
64if (!Drupal.hasOwnProperty('colorbox')) {
65  Drupal.colorbox = {};
66}
67
68/**
69 * Global function to allow sanitizing captions and control strings.
70 *
71 * @param markup
72 *   String containing potential markup.
73 * @return @string
74 *  Sanitized string with potentially dangerous markup removed.
75 */
76Drupal.colorbox.sanitizeMarkup = function(markup) {
77  // If DOMPurify installed, allow some HTML. Otherwise, treat as plain text.
78  if (typeof DOMPurify !== 'undefined') {
79    var purifyConfig = {
80      ALLOWED_TAGS: [
81        'a',
82        'b',
83        'strong',
84        'i',
85        'em',
86        'u',
87        'cite',
88        'code',
89        'br'
90      ],
91      ALLOWED_ATTR: [
92        'href',
93        'hreflang',
94        'title',
95        'target'
96      ]
97    }
98    if (Drupal.settings.hasOwnProperty('dompurify_custom_config')) {
99      purifyConfig = Drupal.settings.dompurify_custom_config;
100    }
101    return DOMPurify.sanitize(markup, purifyConfig);
102  }
103  else {
104    return Drupal.checkPlain(markup);
105  }
106}
107
108})(jQuery);
109;
110/**
111 * @file
112 * Colorbox module style js.
113 */
114
115(function ($) {
116
117Drupal.behaviors.initColorboxDefaultStyle = {
118  attach: function (context, settings) {
119    $(context).bind('cbox_complete', function () {
120      // Only run if there is a title.
121      if ($('#cboxTitle:empty', context).length == false) {
122        $('#cboxLoadedContent img', context).bind('mouseover', function () {
123          $('#cboxTitle', context).slideDown();
124        });
125        $('#cboxOverlay', context).bind('mouseover', function () {
126          $('#cboxTitle', context).slideUp();
127        });
128      }
129      else {
130        $('#cboxTitle', context).hide();
131      }
132    });
133  }
134};
135
136})(jQuery);
137;
138/**
139 * @file
140 * Colorbox module load js.
141 */
142(function ($) {
143
144Drupal.behaviors.initColorboxLoad = {
145  attach: function (context, settings) {
146    if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') {
147      return;
148    }
149
150    if (settings.colorbox.mobiledetect && window.matchMedia) {
151      // Disable Colorbox for small screens.
152      var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")");
153      if (mq.matches) {
154        return;
155      }
156    }
157
158    $.urlParams = function (url) {
159      var p = {},
160          e,
161          a = /\+/g,  // Regex for replacing addition symbol with a space.
162          r = /([^&=]+)=?([^&]*)/g,
163          d = function (s) { return decodeURIComponent(s.replace(a, ' ')); },
164          q = url.split('?');
165      while (e = r.exec(q[1])) {
166        e[1] = d(e[1]);
167        e[2] = d(e[2]);
168        switch (e[2].toLowerCase()) {
169          case 'true':
170          case 'yes':
171            e[2] = true;
172            break;
173          case 'false':
174          case 'no':
175            e[2] = false;
176            break;
177        }
178        if (e[1] == 'width') { e[1] = 'innerWidth'; }
179        if (e[1] == 'height') { e[1] = 'innerHeight'; }
180        if (e[2]) {
181          e[2] = Drupal.checkPlain(e[2]);
182        }
183        p[e[1]] = e[2];
184      }
185      return p;
186    };
187
188    $('.colorbox-load', context)
189      .once('init-colorbox-load', function () {
190        var href = $(this).attr('href');
191
192        var params = $.urlParams(href);
193
194        // Always load in an iframe.
195        params.iframe = true;
196
197        // Set inner width and height if not already specified.
198        if (!params.hasOwnProperty('innerWidth')) {
199          params.innerWidth = $(window).width() * .8;
200        }
201        if (!params.hasOwnProperty('innerHeight')) {
202          params.innerHeight = $(window).height() * .8;
203        }
204
205        if (!params.hasOwnProperty('title')) {
206          // If a title attribute is supplied, sanitize it.
207          var title = $(this).attr('title');
208          if (title) {
209            params.title = Drupal.colorbox.sanitizeMarkup(title);
210          }
211        }
212        $(this).colorbox($.extend({}, settings.colorbox, params));
213      });
214  }
215};
216
217})(jQuery);
218;
219/**
220 * @file
221 * Colorbox module inline js.
222 */
223
224(function ($) {
225
226Drupal.behaviors.initColorboxInline = {
227  attach: function (context, settings) {
228    if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') {
229      return;
230    }
231
232    if (settings.colorbox.mobiledetect && window.matchMedia) {
233      // Disable Colorbox for small screens.
234      var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")");
235      if (mq.matches) {
236        return;
237      }
238    }
239
240    $.urlParam = function(name, url){
241      if (name == 'fragment') {
242        var results = new RegExp('(#[^&#]*)').exec(url);
243      }
244      else {
245        var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(url);
246      }
247      if (!results) { return ''; }
248      return results[1] || '';
249    };
250    $('.colorbox-inline', context).once('init-colorbox-inline').colorbox({
251      transition:settings.colorbox.transition,
252      speed:settings.colorbox.speed,
253      opacity:settings.colorbox.opacity,
254      slideshow:settings.colorbox.slideshow,
255      slideshowAuto:settings.colorbox.slideshowAuto,
256      slideshowSpeed:settings.colorbox.slideshowSpeed,
257      slideshowStart:settings.colorbox.slideshowStart,
258      slideshowStop:settings.colorbox.slideshowStop,
259      current:settings.colorbox.current,
260      previous:settings.colorbox.previous,
261      next:settings.colorbox.next,
262      close:settings.colorbox.close,
263      overlayClose:settings.colorbox.overlayClose,
264      maxWidth:settings.colorbox.maxWidth,
265      maxHeight:settings.colorbox.maxHeight,
266      innerWidth:function(){
267        return $.urlParam('width', $(this).attr('href'));
268      },
269      innerHeight:function(){
270        return $.urlParam('height', $(this).attr('href'));
271      },
272      title:function(){
273        return Drupal.colorbox.sanitizeMarkup(
274          decodeURIComponent($.urlParam('title', $(this).attr('href'))));
275      },
276      iframe:function(){
277        return $.urlParam('iframe', $(this).attr('href'));
278      },
279      inline:function(){
280        return $.urlParam('inline', $(this).attr('href'));
281      },
282      href:function(){
283        return $.urlParam('fragment', $(this).attr('href'));
284      }
285    });
286  }
287};
288
289})(jQuery);
290;
291(function ($) {
292
293/**
294 * A progressbar object. Initialized with the given id. Must be inserted into
295 * the DOM afterwards through progressBar.element.
296 *
297 * method is the function which will perform the HTTP request to get the
298 * progress bar state. Either "GET" or "POST".
299 *
300 * e.g. pb = new progressBar('myProgressBar');
301 *      some_element.appendChild(pb.element);
302 */
303Drupal.progressBar = function (id, updateCallback, method, errorCallback) {
304  var pb = this;
305  this.id = id;
306  this.method = method || 'GET';
307  this.updateCallback = updateCallback;
308  this.errorCallback = errorCallback;
309
310  // The WAI-ARIA setting aria-live="polite" will announce changes after users
311  // have completed their current activity and not interrupt the screen reader.
312  this.element = $('<div class="progress" aria-live="polite"></div>').attr('id', id);
313  this.element.html('<div class="bar"><div class="filled"></div></div>' +
314                    '<div class="percentage"></div>' +
315                    '<div class="message">&nbsp;</div>');
316};
317
318/**
319 * Set the percentage and status message for the progressbar.
320 */
321Drupal.progressBar.prototype.setProgress = function (percentage, message) {
322  if (percentage >= 0 && percentage <= 100) {
323    $('div.filled', this.element).css('width', percentage + '%');
324    $('div.percentage', this.element).html(percentage + '%');
325  }
326  $('div.message', this.element).html(message);
327  if (this.updateCallback) {
328    this.updateCallback(percentage, message, this);
329  }
330};
331
332/**
333 * Start monitoring progress via Ajax.
334 */
335Drupal.progressBar.prototype.startMonitoring = function (uri, delay) {
336  this.delay = delay;
337  this.uri = uri;
338  this.sendPing();
339};
340
341/**
342 * Stop monitoring progress via Ajax.
343 */
344Drupal.progressBar.prototype.stopMonitoring = function () {
345  clearTimeout(this.timer);
346  // This allows monitoring to be stopped from within the callback.
347  this.uri = null;
348};
349
350/**
351 * Request progress data from server.
352 */
353Drupal.progressBar.prototype.sendPing = function () {
354  if (this.timer) {
355    clearTimeout(this.timer);
356  }
357  if (this.uri) {
358    var pb = this;
359    // When doing a post request, you need non-null data. Otherwise a
360    // HTTP 411 or HTTP 406 (with Apache mod_security) error may result.
361    $.ajax({
362      type: this.method,
363      url: this.uri,
364      data: '',
365      dataType: 'json',
366      success: function (progress) {
367        // Display errors.
368        if (progress.status == 0) {
369          pb.displayError(progress.data);
370          return;
371        }
372        // Update display.
373        pb.setProgress(progress.percentage, progress.message);
374        // Schedule next timer.
375        pb.timer = setTimeout(function () { pb.sendPing(); }, pb.delay);
376      },
377      error: function (xmlhttp) {
378        pb.displayError(Drupal.ajaxError(xmlhttp, pb.uri));
379      }
380    });
381  }
382};
383
384/**
385 * Display errors on the page.
386 */
387Drupal.progressBar.prototype.displayError = function (string) {
388  var error = $('<div class="messages error"></div>').html(string);
389  $(this.element).before(error).hide();
390
391  if (this.errorCallback) {
392    this.errorCallback(this);
393  }
394};
395
396})(jQuery);
397;
398/**
399 * @file
400 *
401 * Implement a modal form.
402 *
403 * @see modal.inc for documentation.
404 *
405 * This javascript relies on the CTools ajax responder.
406 */
407
408(function ($) {
409  // Make sure our objects are defined.
410  Drupal.CTools = Drupal.CTools || {};
411  Drupal.CTools.Modal = Drupal.CTools.Modal || {};
412
413  /**
414   * Display the modal
415   *
416   * @todo -- document the settings.
417   */
418  Drupal.CTools.Modal.show = function(choice) {
419    var opts = {};
420
421    if (choice && typeof choice == 'string' && Drupal.settings[choice]) {
422      // This notation guarantees we are actually copying it.
423      $.extend(true, opts, Drupal.settings[choice]);
424    }
425    else if (choice) {
426      $.extend(true, opts, choice);
427    }
428
429    var defaults = {
430      modalTheme: 'CToolsModalDialog',
431      throbberTheme: 'CToolsModalThrobber',
432      animation: 'show',
433      animationSpeed: 'fast',
434      modalSize: {
435        type: 'scale',
436        width: .8,
437        height: .8,
438        addWidth: 0,
439        addHeight: 0,
440        // How much to remove from the inner content to make space for the
441        // theming.
442        contentRight: 25,
443        contentBottom: 45
444      },
445      modalOptions: {
446        opacity: .55,
447        background: '#fff'
448      },
449      modalClass: 'default'
450    };
451
452    var settings = {};
453    $.extend(true, settings, defaults, Drupal.settings.CToolsModal, opts);
454
455    if (Drupal.CTools.Modal.currentSettings && Drupal.CTools.Modal.currentSettings != settings) {
456      Drupal.CTools.Modal.modal.remove();
457      Drupal.CTools.Modal.modal = null;
458    }
459
460    Drupal.CTools.Modal.currentSettings = settings;
461
462    var resize = function(e) {
463      // When creating the modal, it actually exists only in a theoretical
464      // place that is not in the DOM. But once the modal exists, it is in the
465      // DOM so the context must be set appropriately.
466      var context = e ? document : Drupal.CTools.Modal.modal;
467
468      if (Drupal.CTools.Modal.currentSettings.modalSize.type == 'scale') {
469        var width = $(window).width() * Drupal.CTools.Modal.currentSettings.modalSize.width;
470        var height = $(window).height() * Drupal.CTools.Modal.currentSettings.modalSize.height;
471      }
472      else {
473        var width = Drupal.CTools.Modal.currentSettings.modalSize.width;
474        var height = Drupal.CTools.Modal.currentSettings.modalSize.height;
475      }
476
477      // Use the additionol pixels for creating the width and height.
478      $('div.ctools-modal-content', context).css({
479        'width': width + Drupal.CTools.Modal.currentSettings.modalSize.addWidth + 'px',
480        'height': height + Drupal.CTools.Modal.currentSettings.modalSize.addHeight + 'px'
481      });
482      $('div.ctools-modal-content .modal-content', context).css({
483        'width': (width - Drupal.CTools.Modal.currentSettings.modalSize.contentRight) + 'px',
484        'height': (height - Drupal.CTools.Modal.currentSettings.modalSize.contentBottom) + 'px'
485      });
486    };
487
488    if (!Drupal.CTools.Modal.modal) {
489      Drupal.CTools.Modal.modal = $(Drupal.theme(settings.modalTheme));
490      if (settings.modalSize.type == 'scale') {
491        $(window).bind('resize', resize);
492      }
493    }
494
495    resize();
496
497    $('span.modal-title', Drupal.CTools.Modal.modal).html(Drupal.CTools.Modal.currentSettings.loadingText);
498    Drupal.CTools.Modal.modalContent(Drupal.CTools.Modal.modal, settings.modalOptions, settings.animation, settings.animationSpeed, settings.modalClass);
499    $('#modalContent .modal-content').html(Drupal.theme(settings.throbberTheme)).addClass('ctools-modal-loading');
500
501    // Position autocomplete results based on the scroll position of the modal.
502    $('#modalContent .modal-content').delegate('input.form-autocomplete', 'keyup', function() {
503      $('#autocomplete').css('top', $(this).position().top + $(this).outerHeight() + $(this).offsetParent().filter('#modal-content').scrollTop());
504    });
505  };
506
507  /**
508   * Hide the modal
509   */
510  Drupal.CTools.Modal.dismiss = function() {
511    if (Drupal.CTools.Modal.modal) {
512      Drupal.CTools.Modal.unmodalContent(Drupal.CTools.Modal.modal);
513    }
514  };
515
516  /**
517   * Provide the HTML to create the modal dialog.
518   */
519  Drupal.theme.prototype.CToolsModalDialog = function () {
520    var html = '';
521    html += '<div id="ctools-modal">';
522    html += '  <div class="ctools-modal-content">'; // panels-modal-content
523    html += '    <div class="modal-header">';
524    html += '      <a class="close" href="#">';
525    html +=          Drupal.CTools.Modal.currentSettings.closeText + Drupal.CTools.Modal.currentSettings.closeImage;
526    html += '      </a>';
527    html += '      <span id="modal-title" class="modal-title">&nbsp;</span>';
528    html += '    </div>';
529    html += '    <div id="modal-content" class="modal-content">';
530    html += '    </div>';
531    html += '  </div>';
532    html += '</div>';
533
534    return html;
535  };
536
537  /**
538   * Provide the HTML to create the throbber.
539   */
540  Drupal.theme.prototype.CToolsModalThrobber = function () {
541    var html = '';
542    html += '<div id="modal-throbber">';
543    html += '  <div class="modal-throbber-wrapper">';
544    html +=      Drupal.CTools.Modal.currentSettings.throbber;
545    html += '  </div>';
546    html += '</div>';
547
548    return html;
549  };
550
551  /**
552   * Figure out what settings string to use to display a modal.
553   */
554  Drupal.CTools.Modal.getSettings = function (object) {
555    var match = $(object).attr('class').match(/ctools-modal-(\S+)/);
556    if (match) {
557      return match[1];
558    }
559  };
560
561  /**
562   * Click function for modals that can be cached.
563   */
564  Drupal.CTools.Modal.clickAjaxCacheLink = function () {
565    Drupal.CTools.Modal.show(Drupal.CTools.Modal.getSettings(this));
566    return Drupal.CTools.AJAX.clickAJAXCacheLink.apply(this);
567  };
568
569  /**
570   * Handler to prepare the modal for the response
571   */
572  Drupal.CTools.Modal.clickAjaxLink = function () {
573    Drupal.CTools.Modal.show(Drupal.CTools.Modal.getSettings(this));
574    return false;
575  };
576
577  /**
578   * Submit responder to do an AJAX submit on all modal forms.
579   */
580  Drupal.CTools.Modal.submitAjaxForm = function(e) {
581    var $form = $(this);
582    var url = $form.attr('action');
583
584    setTimeout(function() { Drupal.CTools.AJAX.ajaxSubmit($form, url); }, 1);
585    return false;
586  };
587
588  /**
589   * Bind links that will open modals to the appropriate function.
590   */
591  Drupal.behaviors.ZZCToolsModal = {
592    attach: function(context) {
593      // Bind links
594      // Note that doing so in this order means that the two classes can be
595      // used together safely.
596      /*
597       * @todo remimplement the warm caching feature
598       $('a.ctools-use-modal-cache', context).once('ctools-use-modal', function() {
599         $(this).click(Drupal.CTools.Modal.clickAjaxCacheLink);
600         Drupal.CTools.AJAX.warmCache.apply(this);
601       });
602        */
603
604      $('area.ctools-use-modal, a.ctools-use-modal', context).once('ctools-use-modal', function() {
605        var $this = $(this);
606        $this.click(Drupal.CTools.Modal.clickAjaxLink);
607        // Create a drupal ajax object
608        var element_settings = {};
609        if ($this.attr('href')) {
610          element_settings.url = $this.attr('href');
611          element_settings.event = 'click';
612          element_settings.progress = { type: 'throbber' };
613        }
614        var base = $this.attr('href');
615        Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings);
616      });
617
618      // Bind buttons
619      $('input.ctools-use-modal, button.ctools-use-modal', context).once('ctools-use-modal', function() {
620        var $this = $(this);
621        $this.click(Drupal.CTools.Modal.clickAjaxLink);
622        var button = this;
623        var element_settings = {};
624
625        // AJAX submits specified in this manner automatically submit to the
626        // normal form action.
627        element_settings.url = Drupal.CTools.Modal.findURL(this);
628        if (element_settings.url == '') {
629          element_settings.url = $(this).closest('form').attr('action');
630        }
631        element_settings.event = 'click';
632        element_settings.setClick = true;
633
634        var base = $this.attr('id');
635        Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings);
636
637        // Make sure changes to settings are reflected in the URL.
638        $('.' + $(button).attr('id') + '-url').change(function() {
639          Drupal.ajax[base].options.url = Drupal.CTools.Modal.findURL(button);
640        });
641      });
642
643      // Bind our custom event to the form submit
644      $('#modal-content form', context).once('ctools-use-modal', function() {
645        var $this = $(this);
646        var element_settings = {};
647
648        element_settings.url = $this.attr('action');
649        element_settings.event = 'submit';
650        element_settings.progress = { 'type': 'throbber' };
651        var base = $this.attr('id');
652
653        Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings);
654        Drupal.ajax[base].form = $this;
655
656        $('input[type=submit], button', this).click(function(event) {
657          Drupal.ajax[base].element = this;
658          this.form.clk = this;
659          // Stop autocomplete from submitting.
660          if (Drupal.autocompleteSubmit && !Drupal.autocompleteSubmit()) {
661            return false;
662          }
663          // An empty event means we were triggered via .click() and
664          // in jquery 1.4 this won't trigger a submit.
665          // We also have to check jQuery version to prevent
666          // IE8 + jQuery 1.4.4 to break on other events
667          // bound to the submit button.
668          if (jQuery.fn.jquery.substr(0, 3) === '1.4' && typeof event.bubbles === "undefined") {
669            $(this.form).trigger('submit');
670            return false;
671          }
672        });
673      });
674
675      // Bind a click handler to allow elements with the 'ctools-close-modal'
676      // class to close the modal.
677      $('.ctools-close-modal', context).once('ctools-close-modal')
678        .click(function() {
679          Drupal.CTools.Modal.dismiss();
680          return false;
681        });
682    }
683  };
684
685  // The following are implementations of AJAX responder commands.
686
687  /**
688   * AJAX responder command to place HTML within the modal.
689   */
690  Drupal.CTools.Modal.modal_display = function(ajax, response, status) {
691    var settings = response.settings || ajax.settings || Drupal.settings;
692    // If the modal does not exist yet, create it.
693    if ($('#modalContent').length == 0) {
694      Drupal.CTools.Modal.show(Drupal.CTools.Modal.getSettings(ajax.element));
695    }
696    // If the modal exists run detachBehaviors before removing existing content.
697    else {
698      Drupal.detachBehaviors($('#modalContent'), settings, 'unload');
699    }
700    $('#modal-title').html(response.title);
701    // Simulate an actual page load by scrolling to the top after adding the
702    // content. This is helpful for allowing users to see error messages at the
703    // top of a form, etc.
704    $('#modal-content').html(response.output).scrollTop(0);
705    $(document).trigger('CToolsAttachBehaviors', $('#modalContent'));
706
707    // Attach behaviors within a modal dialog.
708    Drupal.attachBehaviors($('#modalContent'), settings);
709
710    if ($('#modal-content').hasClass('ctools-modal-loading')) {
711      $('#modal-content').removeClass('ctools-modal-loading');
712    }
713    else {
714      // If the modal was already shown, and we are simply replacing its
715      // content, then focus on the first focusable element in the modal.
716      // (When first showing the modal, focus will be placed on the close
717      // button by the show() function called above.)
718      $('#modal-content :focusable:first').focus();
719    }
720  };
721
722  /**
723   * AJAX responder command to dismiss the modal.
724   */
725  Drupal.CTools.Modal.modal_dismiss = function(command) {
726    Drupal.CTools.Modal.dismiss();
727    $('link.ctools-temporary-css').remove();
728  };
729
730  /**
731   * Display loading
732   */
733  //Drupal.CTools.AJAX.commands.modal_loading = function(command) {
734  Drupal.CTools.Modal.modal_loading = function(command) {
735    Drupal.CTools.Modal.modal_display({
736      output: Drupal.theme(Drupal.CTools.Modal.currentSettings.throbberTheme),
737      title: Drupal.CTools.Modal.currentSettings.loadingText
738    });
739  };
740
741  /**
742   * Find a URL for an AJAX button.
743   *
744   * The URL for this gadget will be composed of the values of items by
745   * taking the ID of this item and adding -url and looking for that
746   * class. They need to be in the form in order since we will
747   * concat them all together using '/'.
748   */
749  Drupal.CTools.Modal.findURL = function(item) {
750    var url = '';
751    var url_class = '.' + $(item).attr('id') + '-url';
752    $(url_class).each(
753      function() {
754        var $this = $(this);
755        if (url && $this.val()) {
756          url += '/';
757        }
758        url += $this.val();
759      });
760    return url;
761  };
762
763
764  /**
765   * modalContent
766   * @param content string to display in the content box
767   * @param css obj of css attributes
768   * @param animation (fadeIn, slideDown, show)
769   * @param speed (valid animation speeds slow, medium, fast or # in ms)
770   * @param modalClass class added to div#modalContent
771   */
772  Drupal.CTools.Modal.modalContent = function(content, css, animation, speed, modalClass) {
773    // If our animation isn't set, make it just show/pop
774    if (!animation) {
775      animation = 'show';
776    }
777    else {
778      // If our animation isn't "fadeIn" or "slideDown" then it always is show
779      if (animation != 'fadeIn' && animation != 'slideDown') {
780        animation = 'show';
781      }
782    }
783
784    if (!speed && 0 !== speed) {
785      speed = 'fast';
786    }
787
788    // Build our base attributes and allow them to be overriden
789    css = jQuery.extend({
790      position: 'absolute',
791      left: '0px',
792      margin: '0px',
793      background: '#000',
794      opacity: '.55'
795    }, css);
796
797    // Add opacity handling for IE.
798    css.filter = 'alpha(opacity=' + (100 * css.opacity) + ')';
799    content.hide();
800
801    // If we already have modalContent, remove it.
802    if ($('#modalBackdrop').length) $('#modalBackdrop').remove();
803    if ($('#modalContent').length) $('#modalContent').remove();
804
805    // position code lifted from http://www.quirksmode.org/viewport/compatibility.html
806    if (self.pageYOffset) { // all except Explorer
807    var wt = self.pageYOffset;
808    } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
809      var wt = document.documentElement.scrollTop;
810    } else if (document.body) { // all other Explorers
811      var wt = document.body.scrollTop;
812    }
813
814    // Get our dimensions
815
816    // Get the docHeight and (ugly hack) add 50 pixels to make sure we dont have a *visible* border below our div
817    var docHeight = $(document).height() + 50;
818    var docWidth = $(document).width();
819    var winHeight = $(window).height();
820    var winWidth = $(window).width();
821    if( docHeight < winHeight ) docHeight = winHeight;
822
823    // Create our divs
824    $('body').append('<div id="modalBackdrop" class="backdrop-' + modalClass + '" style="z-index: 1000; display: none;"></div><div id="modalContent" class="modal-' + modalClass + '" style="z-index: 1001; position: absolute;">' + $(content).html() + '</div>');
825
826    // Get a list of the tabbable elements in the modal content.
827    var getTabbableElements = function () {
828      var tabbableElements = $('#modalContent :tabbable'),
829          radioButtons = tabbableElements.filter('input[type="radio"]');
830
831      // The list of tabbable elements from jQuery is *almost* right. The
832      // exception is with groups of radio buttons. The list from jQuery will
833      // include all radio buttons, when in fact, only the selected radio button
834      // is tabbable, and if no radio buttons in a group are selected, then only
835      // the first is tabbable.
836      if (radioButtons.length > 0) {
837        // First, build up an index of which groups have an item selected or not.
838        var anySelected = {};
839        radioButtons.each(function () {
840          var name = this.name;
841
842          if (typeof anySelected[name] === 'undefined') {
843            anySelected[name] = radioButtons.filter('input[name="' + name + '"]:checked').length !== 0;
844          }
845        });
846
847        // Next filter out the radio buttons that aren't really tabbable.
848        var found = {};
849        tabbableElements = tabbableElements.filter(function () {
850          var keep = true;
851
852          if (this.type == 'radio') {
853            if (anySelected[this.name]) {
854              // Only keep the selected one.
855              keep = this.checked;
856            }
857            else {
858              // Only keep the first one.
859              if (found[this.name]) {
860                keep = false;
861              }
862              found[this.name] = true;
863            }
864          }
865
866          return keep;
867        });
868      }
869
870      return tabbableElements.get();
871    };
872
873    // Keyboard and focus event handler ensures only modal elements gain focus.
874    modalEventHandler = function( event ) {
875      target = null;
876      if ( event ) { //Mozilla
877        target = event.target;
878      } else { //IE
879        event = window.event;
880        target = event.srcElement;
881      }
882
883      var parents = $(target).parents().get();
884      for (var i = 0; i < parents.length; ++i) {
885        var position = $(parents[i]).css('position');
886        if (position == 'absolute' || position == 'fixed') {
887          return true;
888        }
889      }
890
891      if ($(target).is('#modalContent, body') || $(target).filter('*:visible').parents('#modalContent').length) {
892        // Allow the event only if target is a visible child node
893        // of #modalContent.
894        return true;
895      }
896      else {
897        getTabbableElements()[0].focus();
898      }
899
900      event.preventDefault();
901    };
902    $('body').bind( 'focus', modalEventHandler );
903    $('body').bind( 'keypress', modalEventHandler );
904
905    // Keypress handler Ensures you can only TAB to elements within the modal.
906    // Based on the psuedo-code from WAI-ARIA 1.0 Authoring Practices section
907    // 3.3.1 "Trapping Focus".
908    modalTabTrapHandler = function (evt) {
909      // We only care about the TAB key.
910      if (evt.which != 9) {
911        return true;
912      }
913
914      var tabbableElements = getTabbableElements(),
915          firstTabbableElement = tabbableElements[0],
916          lastTabbableElement = tabbableElements[tabbableElements.length - 1],
917          singleTabbableElement = firstTabbableElement == lastTabbableElement,
918          node = evt.target;
919
920      // If this is the first element and the user wants to go backwards, then
921      // jump to the last element.
922      if (node == firstTabbableElement && evt.shiftKey) {
923        if (!singleTabbableElement) {
924          lastTabbableElement.focus();
925        }
926        return false;
927      }
928      // If this is the last element and the user wants to go forwards, then
929      // jump to the first element.
930      else if (node == lastTabbableElement && !evt.shiftKey) {
931        if (!singleTabbableElement) {
932          firstTabbableElement.focus();
933        }
934        return false;
935      }
936      // If this element isn't in the dialog at all, then jump to the first
937      // or last element to get the user into the game.
938      else if ($.inArray(node, tabbableElements) == -1) {
939        // Make sure the node isn't in another modal (ie. WYSIWYG modal).
940        var parents = $(node).parents().get();
941        for (var i = 0; i < parents.length; ++i) {
942          var position = $(parents[i]).css('position');
943          if (position == 'absolute' || position == 'fixed') {
944            return true;
945          }
946        }
947
948        if (evt.shiftKey) {
949          lastTabbableElement.focus();
950        }
951        else {
952          firstTabbableElement.focus();
953        }
954      }
955    };
956    $('body').bind('keydown', modalTabTrapHandler);
957
958    // Create our content div, get the dimensions, and hide it
959    var modalContent = $('#modalContent').css('top','-1000px');
960    var $modalHeader = modalContent.find('.modal-header');
961    var mdcTop = wt + Math.max((winHeight / 2) - (modalContent.outerHeight() / 2), 0);
962    var mdcLeft = ( winWidth / 2 ) - ( modalContent.outerWidth() / 2);
963    $('#modalBackdrop').css(css).css('top', 0).css('height', docHeight + 'px').css('width', docWidth + 'px').show();
964    modalContent.css({top: mdcTop + 'px', left: mdcLeft + 'px'}).hide()[animation](speed);
965
966    // Bind a click for closing the modalContent
967    modalContentClose = function(){close(); return false;};
968    $('.close', $modalHeader).bind('click', modalContentClose);
969
970    // Bind a keypress on escape for closing the modalContent
971    modalEventEscapeCloseHandler = function(event) {
972      if (event.keyCode == 27) {
973        close();
974        return false;
975      }
976    };
977
978    $(document).bind('keydown', modalEventEscapeCloseHandler);
979
980    // Per WAI-ARIA 1.0 Authoring Practices, initial focus should be on the
981    // close button, but we should save the original focus to restore it after
982    // the dialog is closed.
983    var oldFocus = document.activeElement;
984    $('.close', $modalHeader).focus();
985
986    // Close the open modal content and backdrop
987    function close() {
988      // Unbind the events
989      $(window).unbind('resize',  modalContentResize);
990      $('body').unbind( 'focus', modalEventHandler);
991      $('body').unbind( 'keypress', modalEventHandler );
992      $('body').unbind( 'keydown', modalTabTrapHandler );
993      $('.close', $modalHeader).unbind('click', modalContentClose);
994      $(document).unbind('keydown', modalEventEscapeCloseHandler);
995      $(document).trigger('CToolsCloseModalBehaviors', $('#modalContent'));
996      $(document).trigger('CToolsDetachBehaviors', $('#modalContent'));
997
998      // Closing animation.
999      switch (animation) {
1000        case 'fadeIn':
1001          modalContent.fadeOut(speed, modalContentRemove);
1002          break;
1003
1004        case 'slideDown':
1005          modalContent.slideUp(speed, modalContentRemove);
1006          break;
1007
1008        case 'show':
1009          modalContent.hide(speed, modalContentRemove);
1010          break;
1011      }
1012    }
1013
1014    // Remove the content.
1015    modalContentRemove = function () {
1016      $('#modalContent').remove();
1017      $('#modalBackdrop').remove();
1018
1019      // Restore focus to where it was before opening the dialog.
1020      $(oldFocus).focus();
1021    };
1022
1023    // Move and resize the modalBackdrop and modalContent on window resize.
1024    modalContentResize = function () {
1025      // Reset the backdrop height/width to get accurate document size.
1026      $('#modalBackdrop').css('height', '').css('width', '');
1027
1028      // Position code lifted from:
1029      // http://www.quirksmode.org/viewport/compatibility.html
1030      if (self.pageYOffset) { // all except Explorer
1031        var wt = self.pageYOffset;
1032      } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
1033        var wt = document.documentElement.scrollTop;
1034      } else if (document.body) { // all other Explorers
1035        var wt = document.body.scrollTop;
1036      }
1037
1038      // Get our heights
1039      var docHeight = $(document).height();
1040      var docWidth = $(document).width();
1041      var winHeight = $(window).height();
1042      var winWidth = $(window).width();
1043      if( docHeight < winHeight ) docHeight = winHeight;
1044
1045      // Get where we should move content to
1046      var modalContent = $('#modalContent');
1047      var mdcTop = wt + Math.max((winHeight / 2) - (modalContent.outerHeight() / 2), 0);
1048      var mdcLeft = ( winWidth / 2 ) - ( modalContent.outerWidth() / 2);
1049
1050      // Apply the changes
1051      $('#modalBackdrop').css('height', docHeight + 'px').css('width', docWidth + 'px').show();
1052      modalContent.css('top', mdcTop + 'px').css('left', mdcLeft + 'px').show();
1053    };
1054    $(window).bind('resize', modalContentResize);
1055  };
1056
1057  /**
1058   * unmodalContent
1059   * @param content (The jQuery object to remove)
1060   * @param animation (fadeOut, slideUp, show)
1061   * @param speed (valid animation speeds slow, medium, fast or # in ms)
1062   */
1063  Drupal.CTools.Modal.unmodalContent = function(content, animation, speed)
1064  {
1065    // If our animation isn't set, make it just show/pop
1066    if (!animation) { var animation = 'show'; } else {
1067      // If our animation isn't "fade" then it always is show
1068      if (( animation != 'fadeOut' ) && ( animation != 'slideUp')) animation = 'show';
1069    }
1070    // Set a speed if we dont have one
1071    if ( !speed ) var speed = 'fast';
1072
1073    // Unbind the events we bound
1074    $(window).unbind('resize', modalContentResize);
1075    $('body').unbind('focus', modalEventHandler);
1076    $('body').unbind('keypress', modalEventHandler);
1077    $('body').unbind( 'keydown', modalTabTrapHandler );
1078    var $modalContent = $('#modalContent');
1079    var $modalHeader = $modalContent.find('.modal-header');
1080    $('.close', $modalHeader).unbind('click', modalContentClose);
1081    $(document).unbind('keydown', modalEventEscapeCloseHandler);
1082    $(document).trigger('CToolsDetachBehaviors', $modalContent);
1083
1084    // jQuery magic loop through the instances and run the animations or removal.
1085    content.each(function(){
1086      if ( animation == 'fade' ) {
1087        $('#modalContent').fadeOut(speed, function() {
1088          $('#modalBackdrop').fadeOut(speed, function() {
1089            $(this).remove();
1090          });
1091          $(this).remove();
1092        });
1093      } else {
1094        if ( animation == 'slide' ) {
1095          $('#modalContent').slideUp(speed,function() {
1096            $('#modalBackdrop').slideUp(speed, function() {
1097              $(this).remove();
1098            });
1099            $(this).remove();
1100          });
1101        } else {
1102          $('#modalContent').remove();
1103          $('#modalBackdrop').remove();
1104        }
1105      }
1106    });
1107  };
1108
1109$(function() {
1110  Drupal.ajax.prototype.commands.modal_display = Drupal.CTools.Modal.modal_display;
1111  Drupal.ajax.prototype.commands.modal_dismiss = Drupal.CTools.Modal.modal_dismiss;
1112});
1113
1114})(jQuery);
1115;
1116/**
1117* Provide the HTML to create the modal dialog.
1118*/
1119Drupal.theme.prototype.ModalFormsPopup = function () {
1120  var html = '';
1121
1122  html += '<div id="ctools-modal" class="popups-box">';
1123  html += '  <div class="ctools-modal-content modal-forms-modal-content">';
1124  html += '    <div class="popups-container">';
1125  html += '      <div class="modal-header popups-title">';
1126  html += '        <span id="modal-title" class="modal-title"></span>';
1127  html += '        <span class="popups-close close">' + Drupal.CTools.Modal.currentSettings.closeText + '</span>';
1128  html += '        <div class="clear-block"></div>';
1129  html += '      </div>';
1130  html += '      <div class="modal-scroll"><div id="modal-content" class="modal-content popups-body"></div></div>';
1131  html += '    </div>';
1132  html += '  </div>';
1133  html += '</div>';
1134
1135  return html;
1136}
1137;
1138(function ($) {
1139
1140Drupal.jQueryUiFilter = Drupal.jQueryUiFilter || {}
1141Drupal.jQueryUiFilter.accordionOptions = Drupal.jQueryUiFilter.accordionOptions || {}
1142
1143/**
1144 * Scroll to an accordion's active element.
1145 */
1146Drupal.jQueryUiFilter.accordionScrollTo = function(accordion) {
1147  var options = $(accordion).data('options') || {}
1148  if (!options['scrollTo'] || !$(accordion).find('.ui-state-active').length) {
1149    return;
1150  }
1151
1152  var top = $(accordion).find('.ui-state-active').offset().top;
1153  if (options['scrollTo']['duration']) {
1154    $('html, body').animate({scrollTop: top}, options['scrollTo']['duration']);
1155  }
1156  else {
1157    $('html, body').scrollTop(top);
1158  }
1159}
1160
1161/**
1162 * Accordion change event handler to bookmark active element in location.hash.
1163 */
1164Drupal.jQueryUiFilter.accordionChangeStart = function(event, ui) {
1165  var href = ui.newHeader.find('a').attr('href');
1166  if (href) {
1167    location.hash = href;
1168    return false;
1168 // Cancel event and let accordionHashChangeEvent handler activate the element.
1169  }
1170  else {
1171    return true;
1172  }
1173}
1174
1175/**
1176 * On hash change activate and scroll to an accordion element.
1177 */
1178Drupal.jQueryUiFilter.accordionHashChangeEvent = function() {
1179  $accordionHeader = $('.ui-accordion > .ui-accordion-header:has(a[href="' + location.hash + '"])')
1180  $accordion = $accordionHeader.parent();
1181  var index = $accordionHeader.prevAll('.ui-accordion-header').length;
1182
1183  if ($.ui.version == '1.8.7') {
1184    // NOTE: Accordion 'Active' property not change'ing http://bugs.jqueryui.com/ticket/4576
1185    $accordion.accordion('activate', index);
1186  }
1187  else {
1188    // NOTE: Accordion 'Active' property http://api.jqueryui.com/accordion/#option-active
1189    $accordion.accordion('option', 'active', index);
1190  }
1191}
1192
1193/**
1194 * jQuery UI filter accordion behavior.
1195 */
1196Drupal.behaviors.jQueryUiFilterAccordion  = {attach: function(context) {
1197  if (Drupal.settings.jQueryUiFilter.disabled) {
1198    return;
1199  }
1200
1201  var headerTag = Drupal.settings.jQueryUiFilter.accordionHeaderTag;
1202
1203  $('div.jquery-ui-filter-accordion', context).once('jquery-ui-filter-accordion', function () {
1204    var options = Drupal.jQueryUiFilter.getOptions('accordion');
1205
1206    // Look for jQuery UI filter header class.
1207    options['header'] = '.jquery-ui-filter-accordion-header';
1208
1209    if ($(this).hasClass('jquery-ui-filter-accordion-collapsed')) { // Set collapsed options
1210      options['collapsible'] = true;
1211      options['active'] = false;
1212    }
1213
1214    // Convert <h*> to div to remove tag and insure the accordion does not use the existing h3 style.
1215    // Sets active item based on location.hash.
1216    var index = 0;
1217    $(this).find(headerTag + '.jquery-ui-filter-accordion-header').each(function(){
1218      var id = this.id || $(this).text().toLowerCase().replace(/[^-a-z0-9]+/gm, '-');
1219      var hash = '#' + id;
1220      if (hash == location.hash) {
1221        options['active'] = index;
1222      }
1223      index++;
1224
1225      $(this).replaceWith('<div class="jquery-ui-filter-header jquery-ui-filter-accordion-header"><a href="' + hash + '">' + $(this).html() + '</a></div>');
1226    });
1227
1228    // DEBUG:
1229    // console.log(options);
1230
1231    // Save options as data and init accordion
1232    $(this).data('options', options).accordion(options);
1233
1234    // Scroll to active
1235    Drupal.jQueryUiFilter.accordionScrollTo(this);
1236
1237    // Bind accordion change event to record history
1238    if (options['history']) {
1239      $(this).bind('accordionchangestart', Drupal.jQueryUiFilter.accordionChangeStart);
1240    }
1241
1242    // Init hash change event handling once
1243    if (!Drupal.jQueryUiFilter.accordionInitialized) {
1244      Drupal.jQueryUiFilter.hashChange(Drupal.jQueryUiFilter.accordionHashChangeEvent);
1245    }
1246    Drupal.jQueryUiFilter.accordionInitialized = true;
1247  });
1248
1249}}
1250
1251})(jQuery);
1252;
1253(function ($) {
1254
1255/**
1256 * Equal height plugin.
1257 *
1258 * From: http://www.problogdesign.com/coding/30-pro-jquery-tips-tricks-and-strategies/
1259 */
1260if (jQuery.fn.equalHeight == undefined) {
1261  jQuery.fn.equalHeight = function () {
1262    var tallest = 0;
1263    this.each(function() {
1264      tallest = ($(this).height() > tallest)? $(this).height() : tallest;
1265    });
1266    return this.height(tallest);
1267  }
1268}
1269
1270Drupal.jQueryUiFilter = Drupal.jQueryUiFilter || {}
1271Drupal.jQueryUiFilter.tabsOptions = Drupal.jQueryUiFilter.tabsOptions || {}
1272
1273/**
1274 * Tabs pagings
1275 *
1276 * Inspired by : http://css-tricks.com/2361-jquery-ui-tabs-with-nextprevious/
1277 */
1278Drupal.jQueryUiFilter.tabsPaging = function(selector, options) {
1279  options = jQuery.extend({paging: {'back': '&#171; Previous', 'next': 'Next &#187;'}}, options);
1280
1281  var $tabs = $(selector);
1282  var numberOfTabs = $tabs.find(".ui-tabs-panel").size() - 1;
1283
1284  // Add back and next buttons.
1285  // NOTE: Buttons are not 'themeable' since they should look like a themerolled jQuery UI button.
1286  $tabs.find('.ui-tabs-panel').each(function(i){
1287    var html = '';
1288    if (i != 0) {
1289      html += '<button type="button" class="ui-tabs-prev" rel="' + (i-1) + '" style="float:left">' + Drupal.t(options.paging.back) + '</button>';
1290    }
1291    if (i != numberOfTabs) {
1292      html += '<button type="button" href="#" class="ui-tabs-next" rel="' + (i+1) + '" style="float:right">' + Drupal.t(options.paging.next) + '</button>';
1293    }
1294    $(this).append('<div class="ui-tabs-paging clearfix clear-block">' +  html + '</div>');
1295  });
1296
1297  // Init buttons
1298  $tabs.find('button.ui-tabs-prev, button.ui-tabs-next').button();
1299
1300  // Add event handler
1301  $tabs.find('.ui-tabs-next, .ui-tabs-prev').click(function() {
1302    if ($.ui.version == '1.8.7') {
1303      $tabs.tabs('select', parseInt($(this).attr("rel")));
1304    }
1305    else {
1306      $tabs.tabs('option', 'active', parseInt($(this).attr("rel")));
1307    }
1308    return false;
1309  });
1310}
1311
1312/**
1313 * Scroll to an accordion's active element.
1314 */
1315Drupal.jQueryUiFilter.tabsScrollTo = function(tabs) {
1316  var options = $(tabs).data('options') || {}
1317  if (!options['scrollTo']) {
1318    return;
1319  }
1320
1321  var top = $(tabs).offset().top;
1322  if (options['scrollTo']['duration']) {
1323    $('html, body').animate({scrollTop: top}, options['scrollTo']['duration']);
1324  }
1325  else {
1326    $('html, body').scrollTop(top);
1327  }
1328}
1329
1330
1331/**
1332 * Tabs select event handler to bookmark selected tab in location.hash.
1333 */
1334Drupal.jQueryUiFilter.tabsSelect = function(event, ui) {
1335  location.hash = $(ui.tab).attr('href');
1336}
1337
1338/**
1339 * On hash change select tab.
1340 *
1341 * Inspired by: http://benalman.com/code/projects/jquery-bbq/examples/fragment-jquery-ui-tabs/
1342 */
1343Drupal.jQueryUiFilter.tabsHashChangeEvent = function() {
1344  var $tab = $('.ui-tabs-nav > li:has(a[href="' + location.hash + '"])');
1345  $tabs = $tab.parent().parent();
1346
1347  var selected = $tab.prevAll().length;
1348
1349  if ($.ui.version == '1.8.7') {
1350    if ($tabs.tabs('option', 'selected') != selected) {
1351      $tabs.tabs('select', selected);
1352    }
1353  }
1354  else {
1355    if ($tabs.tabs('option', 'active') != selected) {
1356      $tabs.tabs('option', 'active', selected);
1357    }
1358  }
1359}
1360
1361/**
1362 * jQuery UI filter tabs behavior
1363 */
1364Drupal.behaviors.jQueryUiFilterTabs = {attach: function(context) {
1365  if (Drupal.settings.jQueryUiFilter.disabled) {
1366    return;
1367  }
1368
1369  var headerTag = Drupal.settings.jQueryUiFilter.tabsHeaderTag;
1370
1371  // Tabs
1372  $('div.jquery-ui-filter-tabs', context).once('jquery-ui-filter-tabs', function () {
1373    var options = Drupal.jQueryUiFilter.getOptions('tabs');
1374
1375    // Get <h*> text and add to tabs.
1376    // Sets selected tab based on location.hash.
1377    var scrollTo = false;
1378    var index = 0;
1379    var tabs = '<ul>';
1380    $(this).find(headerTag + '.jquery-ui-filter-tabs-header').each(function(){
1381      var id = this.id || $(this).text().toLowerCase().replace(/[^-a-z0-9]+/gm, '-');
1382      var hash = '#' + id;
1383
1384      if (hash == location.hash) {
1385        scrollTo = true;
1386        options['selected'] = index;
1387      }
1388      index++;
1389
1390      tabs += '<li><a href="' + hash + '">' + $(this).html() + '</a></li>';
1391      $(this).next('div.jquery-ui-filter-tabs-container').attr('id', id);
1392      $(this).remove();
1393    });
1394    tabs += '</ul>';
1395    $(this).prepend(tabs);
1396
1397    // DEBUG:
1398    // console.log(options);
1399
1400    // Save options as data and init tabs
1401    $(this).data('options', options).tabs(options);
1402
1403    // Equal height tab
1404    $(this).find('.ui-tabs-nav li').equalHeight();
1405
1406    // Add paging.
1407    if (options['paging']) {
1408      Drupal.jQueryUiFilter.tabsPaging(this, options);
1409    }
1410
1411    // Bind tabs select event to record history
1412    if (options['history']) {
1413      $(this).bind('tabsselect', Drupal.jQueryUiFilter.tabsSelect);
1414    }
1415
1416    // Scroll to selected tabs widget
1417    if (scrollTo) {
1418      Drupal.jQueryUiFilter.tabsScrollTo(this);
1419    }
1420
1421    // Init hash change event handling once
1422    if (!Drupal.jQueryUiFilter.hashChangeInit) {
1423      Drupal.jQueryUiFilter.hashChange(Drupal.jQueryUiFilter.tabsHashChangeEvent);
1424    }
1425    Drupal.jQueryUiFilter.hashChangeInit = true;
1426  });
1427}}
1428
1429})(jQuery);
1430;
1431/**
1432 * @file
1433 * Javascript for views-accordion.
1434 */
1435Drupal.behaviors.views_accordion = {
1436  attach: function(context) {
1437    if(Drupal.settings.views_accordion){
1438      (function ($) {
1439        $.each(Drupal.settings.views_accordion, function(id) {
1440          /* Our view settings */
1441          var usegroupheader = this.usegroupheader;
1442          var viewname = this.viewname;
1443          var display = this.display;
1444
1445          /* Our panel heightStyle setting */
1446          var heightStyle = (this.autoheight == 1) ? 'auto' : (this.fillspace == 1 ? 'fill' : 'content');
1447
1448          /* the selectors we have to play with */
1449          var displaySelector = '.view-id-' + viewname + '.view-display-id-' + display + ' > .view-content';
1450          var headerSelector = this.header;
1451
1452          /* The row count to be used if Row to display opened on start is set to random */
1453          var row_count = 0;
1454
1455          /* Prepare our markup for jquery ui accordion */
1456          $(displaySelector + ' ' + headerSelector + ':not(.ui-accordion-header)').each(function(i){
1457            // Hash to use for accordion navigation option.
1458            var hash = "#" + viewname + "-" + display + "-" + i;
1459            var $this = $(this);
1460            var $link = $this.find('a');
1461            // if the header is not already using an anchor tag, add one
1462            if($link.length == 0){
1463              // setup anchor tag for navigation
1464              $this.wrapInner('<a href="' + hash + '"></a>');
1465            }
1466            // if there are already, they wont be clickable with js enabled, we'll use them for accordion navigation
1467            else{
1468              // @FIXME ?
1469              // We are currently destroying the original link, though search crawlers will stil see it.
1470              // Links in accordions are NOT clickable and leaving them would kill deep linking.
1471              $link.get(0).href = hash;
1472            }
1473
1474            // Wrap the accordion content within a div if necessary
1475            if (!usegroupheader) {
1476              $this.siblings().wrapAll('<div></div>');
1477            }
1478            row_count++;
1479          });
1480
1481          if (this.rowstartopen == 'random') {
1482            this.rowstartopen = Math.floor(Math.random() * row_count);
1483          }
1484
1485          var options = {};
1486
1487          if (this.newoptions) {
1488            // Slide was removed from jQuery UI easings, provide sensible fallbacks.
1489            if (this.animated === 'slide' || this.animated === 'bounceslide') {
1490              this.animated = 'swing';
1491            }
1492
1493            /* jQuery UI accordion options format changed for jquery >= 1.9 */
1494            options = {
1495              header: headerSelector,
1496              active: this.rowstartopen,
1497              collapsible: this.collapsible,
1498              event: this.event,
1499              heightStyle: this.autoheight ? 'auto' : this.fillspace ? 'fill' : 'content',
1500            };
1501            if (this.animated === false) {
1502              options.animate = false;
1503            }
1504            else {
1505              options.animate = {
1506                easing: this.animated,
1507                duration: this.duration,
1508              }
1509            }
1510          }
1511          else {
1512            options = {
1513              header: headerSelector,
1514              animated: this.animated,
1515              active: this.rowstartopen,
1516              collapsible: this.collapsible,
1517              autoHeight: this.autoheight,
1518              heightStyle: heightStyle,
1519              event: this.event,
1520              fillSpace: this.fillspace,
1521              navigation: this.navigation,
1522              clearstyle: this.clearstyle
1523            };
1524          }
1525          /* jQuery UI accordion call */
1526          $(displaySelector + ':not(.ui-accordion)').accordion(options);
1527        });
1528      })(jQuery);
1529    }
1530  }
1531};
1532;
1533/**
1534 * @file
1535 * Some basic behaviors and utility functions for Views.
1536 */
1537(function ($) {
1538
1539  Drupal.Views = {};
1540
1541  /**
1542   * JQuery UI tabs, Views integration component.
1543   */
1544  Drupal.behaviors.viewsTabs = {
1545    attach: function (context) {
1546      if ($.viewsUi && $.viewsUi.tabs) {
1547        $('#views-tabset').once('views-processed').viewsTabs({
1548          selectedClass: 'active'
1549        });
1550      }
1551
1552      $('a.views-remove-link').once('views-processed').click(function(event) {
1553        var id = $(this).attr('id').replace('views-remove-link-', '');
1554        $('#views-row-' + id).hide();
1555        $('#views-removed-' + id).get(0).checked = true;
1556        event.preventDefault();
1557      });
1558      // Here is to handle display deletion
1559      // (checking in the hidden checkbox and hiding out the row).
1560      $('a.display-remove-link')
1561        .addClass('display-processed')
1562        .click(function() {
1563          var id = $(this).attr('id').replace('display-remove-link-', '');
1564          $('#display-row-' + id).hide();
1565          $('#display-removed-' + id).get(0).checked = true;
1566          return false;
1567        });
1568    }
1569  };
1570
1571  /**
1572   * Helper function to parse a querystring.
1573   */
1574  Drupal.Views.parseQueryString = function (query) {
1575    var args = {};
1576    var pos = query.indexOf('?');
1577    if (pos != -1) {
1578      query = query.substring(pos + 1);
1579    }
1580    var pairs = query.split('&');
1581    for (var i in pairs) {
1582      if (typeof(pairs[i]) == 'string') {
1583        var pair = pairs[i].split('=');
1584        // Ignore the 'q' path argument, if present.
1585        if (pair[0] != 'q' && pair[1]) {
1586          args[decodeURIComponent(pair[0].replace(/\+/g, ' '))] = decodeURIComponent(pair[1].replace(/\+/g, ' '));
1587        }
1588      }
1589    }
1590    return args;
1591  };
1592
1593  /**
1594   * Helper function to return a view's arguments based on a path.
1595   */
1596  Drupal.Views.parseViewArgs = function (href, viewPath) {
1597    // Provide language prefix.
1598    if (Drupal.settings.pathPrefix) {
1599      var viewPath = Drupal.settings.pathPrefix + viewPath;
1600    }
1601    var returnObj = {};
1602    var path = Drupal.Views.getPath(href);
1603    // Ensure there is a correct path.
1604    if (viewPath && path.substring(0, viewPath.length + 1) == viewPath + '/') {
1605      var args = decodeURIComponent(path.substring(viewPath.length + 1, path.length));
1606      returnObj.view_args = args;
1607      returnObj.view_path = path;
1608    }
1609    return returnObj;
1610  };
1611
1612  /**
1613   * Strip off the protocol plus domain from an href.
1614   */
1615  Drupal.Views.pathPortion = function (href) {
1616    // Remove e.g. http://example.com if present.
1617    var protocol = window.location.protocol;
1618    if (href.substring(0, protocol.length) == protocol) {
1619      // 2 is the length of the '//' that normally follows the protocol.
1620      href = href.substring(href.indexOf('/', protocol.length + 2));
1621    }
1622    return href;
1623  };
1624
1625  /**
1626   * Return the Drupal path portion of an href.
1627   */
1628  Drupal.Views.getPath = function (href) {
1629    href = Drupal.Views.pathPortion(href);
1630    href = href.substring(Drupal.settings.basePath.length, href.length);
1631    // 3 is the length of the '?q=' added to the URL without clean URLs.
1632    if (href.substring(0, 3) == '?q=') {
1633      href = href.substring(3, href.length);
1634    }
1635    var chars = ['#', '?', '&'];
1636    for (var i in chars) {
1637      if (href.indexOf(chars[i]) > -1) {
1638        href = href.substr(0, href.indexOf(chars[i]));
1639      }
1640    }
1641    return href;
1642  };
1643
1644})(jQuery);
1645;
1646/**
1647 * @file
1648 * Handles AJAX fetching of views, including filter submission and response.
1649 */
1650(function ($) {
1651
1652  /**
1653   * Attaches the AJAX behavior to exposed filter forms and key views links.
1654   */
1655  Drupal.behaviors.ViewsAjaxView = {};
1656  Drupal.behaviors.ViewsAjaxView.attach = function() {
1657    if (Drupal.settings && Drupal.settings.views && Drupal.settings.views.ajaxViews) {
1658      $.each(Drupal.settings.views.ajaxViews, function(i, settings) {
1659        Drupal.views.instances[i] = new Drupal.views.ajaxView(settings);
1660      });
1661    }
1662  };
1663
1664  Drupal.views = {};
1665  Drupal.views.instances = {};
1666
1667  /**
1668   * JavaScript object for a certain view.
1669   */
1670  Drupal.views.ajaxView = function(settings) {
1671    var selector = '.view-dom-id-' + settings.view_dom_id;
1672    this.$view = $(selector);
1673
1674    // If view is not present return to prevent errors.
1675    if (!this.$view.length) {
1676      return;
1677    }
1678
1679    // Retrieve the path to use for views' ajax.
1680    var ajax_path = Drupal.settings.views.ajax_path;
1681
1682    // If there are multiple views this might've ended up showing up multiple
1683    // times.
1684    if (ajax_path.constructor.toString().indexOf("Array") != -1) {
1685      ajax_path = ajax_path[0];
1686    }
1687
1688    // Check if there are any GET parameters to send to views.
1689    var queryString = window.location.search || '';
1690    if (queryString !== '') {
1691      // Remove the question mark and Drupal path component if any.
1692      var queryString = queryString.slice(1).replace(/q=[^&]+&?|&?render=[^&]+/, '');
1693      if (queryString !== '') {
1694        // If there is a '?' in ajax_path, clean url are on and & should be
1695        // used to add parameters.
1696        queryString = ((/\?/.test(ajax_path)) ? '&' : '?') + queryString;
1697      }
1698    }
1699
1700    this.element_settings = {
1701      url: ajax_path + queryString,
1702      submit: settings,
1703      setClick: true,
1704      event: 'click',
1705      selector: selector,
1706      progress: {
1707        type: 'throbber'
1708      }
1709    };
1710
1711    this.settings = settings;
1712
1713    // Add the ajax to exposed forms.
1714    this.$exposed_form = $('#views-exposed-form-' + settings.view_name.replace(/_/g, '-') + '-' + settings.view_display_id.replace(/_/g, '-'));
1715    this.$exposed_form.once(jQuery.proxy(this.attachExposedFormAjax, this));
1716
1717    // Store Drupal.ajax objects here for all pager links.
1718    this.links = [];
1719
1720    // Add the ajax to pagers.
1721    this.$view
1722      .once(jQuery.proxy(this.attachPagerAjax, this));
1723
1724    // Add a trigger to update this view specifically. In order to trigger a
1725    // refresh use the following code.
1726    //
1727    // @code
1728    // jQuery('.view-name').trigger('RefreshView');
1729    // @endcode
1730    // Add a trigger to update this view specifically.
1731    var self_settings = this.element_settings;
1732    self_settings.event = 'RefreshView';
1733    var self = this;
1734    this.$view.once('refresh', function () {
1735      self.refreshViewAjax = new Drupal.ajax(self.selector, self.$view, self_settings);
1736    });
1737  };
1738
1739  Drupal.views.ajaxView.prototype.attachExposedFormAjax = function() {
1740    var button = $('input[type=submit], button[type=submit], input[type=image]', this.$exposed_form);
1741    button = button[0];
1742
1743    // Call the autocomplete submit before doing AJAX.
1744    $(button).click(function () {
1745      if (Drupal.autocompleteSubmit) {
1746        Drupal.autocompleteSubmit();
1747      }
1748    });
1749
1750    this.exposedFormAjax = new Drupal.ajax($(button).attr('id'), button, this.element_settings);
1751  };
1752
1753  /**
1754   * Attach the ajax behavior to each link.
1755   */
1756  Drupal.views.ajaxView.prototype.attachPagerAjax = function() {
1757    this.$view.find('ul.pager > li > a, ol.pager > li > a, th.views-field a, .attachment .views-summary a')
1758      .each(jQuery.proxy(this.attachPagerLinkAjax, this));
1759  };
1760
1761  /**
1762   * Attach the ajax behavior to a single link.
1763   */
1764  Drupal.views.ajaxView.prototype.attachPagerLinkAjax = function(id, link) {
1765    var $link = $(link);
1766    var viewData = {};
1767    var href = $link.attr('href');
1768    // Don't attach to pagers inside nested views.
1769    if ($link.closest('.view')[0] !== this.$view[0] &&
1770      $link.closest('.view').parent().hasClass('attachment') === false) {
1771      return;
1772    }
1773
1774    // Provide a default page if none has been set. This must be done
1775    // prior to merging with settings to avoid accidentally using the
1776    // page landed on instead of page 1.
1777    if (typeof(viewData.page) === 'undefined') {
1778      viewData.page = 0;
1779    }
1780
1781    // Construct an object using the settings defaults and then overriding
1782    // with data specific to the link.
1783    $.extend(
1784      viewData,
1785      this.settings,
1786      Drupal.Views.parseQueryString(href),
1787      // Extract argument data from the URL.
1788      Drupal.Views.parseViewArgs(href, this.settings.view_base_path)
1789    );
1790
1791    // For anchor tags, these will go to the target of the anchor rather
1792    // than the usual location.
1793    $.extend(viewData, Drupal.Views.parseViewArgs(href, this.settings.view_base_path));
1794
1795    // Construct an object using the element settings defaults,
1796    // then overriding submit with viewData.
1797    var pager_settings = $.extend({}, this.element_settings);
1798    pager_settings.submit = viewData;
1799    this.pagerAjax = new Drupal.ajax(false, $link, pager_settings);
1800    this.links.push(this.pagerAjax);
1801  };
1802
1803  Drupal.ajax.prototype.commands.viewsScrollTop = function (ajax, response, status) {
1804    // Scroll to the top of the view. This will allow users
1805    // to browse newly loaded content after e.g. clicking a pager
1806    // link.
1807    var offset = $(response.selector).offset();
1808    // We can't guarantee that the scrollable object should be
1809    // the body, as the view could be embedded in something
1810    // more complex such as a modal popup. Recurse up the DOM
1811    // and scroll the first element that has a non-zero top.
1812    var scrollTarget = response.selector;
1813    while ($(scrollTarget).scrollTop() == 0 && $(scrollTarget).parent()) {
1814      scrollTarget = $(scrollTarget).parent();
1815    }
1816    // Only scroll upward.
1817    if (offset.top - 10 < $(scrollTarget).scrollTop()) {
1818      $(scrollTarget).animate({scrollTop: (offset.top - 10)}, 500);
1819    }
1820  };
1821
1822})(jQuery);
1823;
1824/*
1825 * jQuery Cycle Plugin (with Transition Definitions)
1826 * Examples and documentation at: http://jquery.malsup.com/cycle/
1827 * Copyright (c) 2007-2013 M. Alsup
1828 * Version: 3.0.3 (11-JUL-2013)
1829 * Dual licensed under the MIT and GPL licenses.
1830 * http://jquery.malsup.com/license.html
1831 * Requires: jQuery v1.7.1 or later
1832 */
1833(function($,undefined){var ver="3.0.3";function debug(s){if($.fn.cycle.debug){log(s);}}function log(){if(window.console&&console.log){console.log("[cycle] "+Array.prototype.join.call(arguments," "));}}$.expr[":"].paused=function(el){return el.cyclePause;};$.fn.cycle=function(options,arg2){var o={s:this.selector,c:this.context};if(this.length===0&&options!="stop"){if(!$.isReady&&o.s){log("DOM not ready, queuing slideshow");$(function(){$(o.s,o.c).cycle(options,arg2);});return this;}log("terminating; zero elements found by selector"+($.isReady?"":" (DOM not ready)"));return this;}return this.each(function(){var opts=handleArguments(this,options,arg2);if(opts===false){return;}opts.updateActivePagerLink=opts.updateActivePagerLink||$.fn.cycle.updateActivePagerLink;if(this.cycleTimeout){clearTimeout(this.cycleTimeout);}this.cycleTimeout=this.cyclePause=0;this.cycleStop=0;var $cont=$(this);var $slides=opts.slideExpr?$(opts.slideExpr,this):$cont.children();var els=$slides.get();if(els.length<2){log("terminating; too few slides: "+els.length);return;}var opts2=buildOptions($cont,$slides,els,opts,o);if(opts2===false){return;}var startTime=opts2.continuous?10:getTimeout(els[opts2.currSlide],els[opts2.nextSlide],opts2,!opts2.backwards);if(startTime){startTime+=(opts2.delay||0);if(startTime<10){startTime=10;}debug("first timeout: "+startTime);this.cycleTimeout=setTimeout(function(){go(els,opts2,0,!opts.backwards);},startTime);}});};function triggerPause(cont,byHover,onPager){var opts=$(cont).data("cycle.opts");if(!opts){return;}var paused=!!cont.cyclePause;if(paused&&opts.paused){opts.paused(cont,opts,byHover,onPager);}else{if(!paused&&opts.resumed){opts.resumed(cont,opts,byHover,onPager);}}}function handleArguments(cont,options,arg2){if(cont.cycleStop===undefined){cont.cycleStop=0;}if(options===undefined||options===null){options={};}if(options.constructor==String){switch(options){case"destroy":case"stop":var opts=$(cont).data("cycle.opts");if(!opts){return false;}cont.cycleStop++;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);}cont.cycleTimeout=0;if(opts.elements){$(opts.elements).stop();}$(cont).removeData("cycle.opts");if(options=="destroy"){destroy(cont,opts);}return false;case"toggle":cont.cyclePause=(cont.cyclePause===1)?0:1;checkInstantResume(cont.cyclePause,arg2,cont);triggerPause(cont);return false;case"pause":cont.cyclePause=1;triggerPause(cont);return false;case"resume":cont.cyclePause=0;checkInstantResume(false,arg2,cont);triggerPause(cont);return false;case"prev":case"next":opts=$(cont).data("cycle.opts");if(!opts){log('options not found, "prev/next" ignored');return false;}if(typeof arg2=="string"){opts.oneTimeFx=arg2;}$.fn.cycle[options](opts);return false;default:options={fx:options};}return options;}else{if(options.constructor==Number){var num=options;options=$(cont).data("cycle.opts");if(!options){log("options not found, can not advance slide");return false;}if(num<0||num>=options.elements.length){log("invalid slide index: "+num);return false;}options.nextSlide=num;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}if(typeof arg2=="string"){options.oneTimeFx=arg2;}go(options.elements,options,1,num>=options.currSlide);return false;}}return options;function checkInstantResume(isPaused,arg2,cont){if(!isPaused&&arg2===true){var options=$(cont).data("cycle.opts");if(!options){log("options not found, can not resume");return false;}if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}go(options.elements,options,1,!options.backwards);}}}
1833function removeFilter(el,opts){if(!$.support.opacity&&opts.cleartype&&el.style.filter){try{el.style.removeAttribute("filter");}catch(smother){}}}function destroy(cont,opts){if(opts.next){$(opts.next).unbind(opts.prevNextEvent);}if(opts.prev){$(opts.prev).unbind(opts.prevNextEvent);}if(opts.pager||opts.pagerAnchorBuilder){$.each(opts.pagerAnchors||[],function(){this.unbind().remove();});}opts.pagerAnchors=null;$(cont).unbind("mouseenter.cycle mouseleave.cycle");if(opts.destroy){opts.destroy(opts);}}function buildOptions($cont,$slides,els,options,o){var startingSlideSpecified;var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});var meta=$.isFunction($cont.data)?$cont.data(opts.metaAttr):null;if(meta){opts=$.extend(opts,meta);}if(opts.autostop){opts.countdown=opts.autostopCount||els.length;}var cont=$cont[0];$cont.data("cycle.opts",opts);opts.$cont=$cont;opts.stopCount=cont.cycleStop;opts.elements=els;opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];if(!$.support.opacity&&opts.cleartype){opts.after.push(function(){removeFilter(this,opts);});}if(opts.continuous){opts.after.push(function(){go(els,opts,0,!opts.backwards);});}saveOriginalOpts(opts);if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($slides);}if($cont.css("position")=="static"){$cont.css("position","relative");}if(opts.width){$cont.width(opts.width);}if(opts.height&&opts.height!="auto"){$cont.height(opts.height);}if(opts.startingSlide!==undefined){opts.startingSlide=parseInt(opts.startingSlide,10);if(opts.startingSlide>=els.length||opts.startSlide<0){opts.startingSlide=0;}else{startingSlideSpecified=true;}}else{if(opts.backwards){opts.startingSlide=els.length-1;}else{opts.startingSlide=0;}}if(opts.random){opts.randomMap=[];for(var i=0;i<els.length;i++){opts.randomMap.push(i);}opts.randomMap.sort(function(a,b){return Math.random()-0.5;});if(startingSlideSpecified){for(var cnt=0;cnt<els.length;cnt++){if(opts.startingSlide==opts.randomMap[cnt]){opts.randomIndex=cnt;}}}else{opts.randomIndex=1;opts.startingSlide=opts.randomMap[1];}}else{if(opts.startingSlide>=els.length){opts.startingSlide=0;}}opts.currSlide=opts.startingSlide||0;var first=opts.startingSlide;$slides.css({position:"absolute",top:0,left:0}).hide().each(function(i){var z;if(opts.backwards){z=first?i<=first?els.length+(i-first):first-i:els.length-i;}else{z=first?i>=first?els.length-(i-first):first-i:els.length-i;}$(this).css("z-index",z);});$(els[first]).css("opacity",1).show();removeFilter(els[first],opts);if(opts.fit){if(!opts.aspect){if(opts.width){$slides.width(opts.width);}if(opts.height&&opts.height!="auto"){$slides.height(opts.height);}}else{$slides.each(function(){var $slide=$(this);var ratio=(opts.aspect===true)?$slide.width()/$slide.height():opts.aspect;if(opts.width&&$slide.width()!=opts.width){$slide.width(opts.width);$slide.height(opts.width/ratio);}if(opts.height&&$slide.height()<opts.height){$slide.height(opts.height);$slide.width(opts.height*ratio);}});}}if(opts.center&&((!opts.fit)||opts.aspect)){$slides.each(function(){var $slide=$(this);$slide.css({"margin-left":opts.width?((opts.width-$slide.width())/2)+"px":0,"margin-top":opts.height?((opts.height-$slide.height())/2)+"px":0});});}if(opts.center&&!opts.fit&&!opts.slideResize){$slides.each(function(){var $slide=$(this);$slide.css({"margin-left":opts.width?((opts.width-$slide.width())/2)+"px":0,"margin-top":opts.height?((opts.height-$slide.height())/2)+"px":0});});}var reshape=(opts.containerResize||opts.containerResizeHeight)&&$cont.innerHeight()<1;if(reshape){var maxw=0,maxh=0;for(var j=0;j<els.length;j++){var $e=$(els[j]),e=$e[0],w=$e.outerWidth(),h=$e.outerHeight();if(!w){w=e.offsetWidth||e.width||$e.attr("width");}if(!h){h=e.offsetHeight||e.height||$e.attr("height");}maxw=w>maxw?w:maxw;maxh=h>maxh?h:maxh;}if(opts.containerResize&&maxw>0&&maxh>0){$cont.css({width:maxw+"px",height:maxh+"px"});}if(opts.containerResizeHeight&&maxh>0){$cont.css({height:maxh+"px"});}}var pauseFlag=false;if(opts.pause){$cont.bind("mouseenter.cycle",function(){pauseFlag=true;this.cyclePause++;triggerPause(cont,true);}).bind("mouseleave.cycle",function(){if(pauseFlag){this.cyclePause--;}triggerPause(cont,true);});}if(supportMultiTransitions(opts)===false){return false;}var requeue=false;options.requeueAttempts=options.requeueAttempts||0;$slides.each(function(){var $el=$(this);this.cycleH=(opts.fit&&opts.height)?opts.height:($el.height()||this.offsetHeight||this.height||$el.attr("height")||0);this.cycleW=(opts.fit&&opts.width)?opts.width:($el.width()||this.offsetWidth||this.width||$el.attr("width")||0);if($el.is("img")){var loading=(this.cycleH===0&&this.cycleW===0&&!this.complete);if(loading){if(o.s&&opts.requeueOnImageNotLoaded&&++options.requeueAttempts<100){log(options.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){$(o.s,o.c).cycle(options);},opts.requeueTimeout);requeue=true;return false;}else{log("could not determine size of image: "+this.src,this.cycleW,this.cycleH);}}}return true;});if(requeue){return false;}opts.cssBefore=opts.cssBefore||{};opts.cssAfter=opts.cssAfter||{};opts.cssFirst=opts.cssFirst||{};opts.animIn=opts.animIn||{};opts.animOut=opts.animOut||{};$slides.not(":eq("+first+")").css(opts.cssBefore);$($slides[first]).css(opts.cssFirst);if(opts.timeout){opts.timeout=parseInt(opts.timeout,10);if(opts.speed.constructor==String){opts.speed=$.fx.speeds[opts.speed]||parseInt(opts.speed,10);}if(!opts.sync){opts.speed=opts.speed/2;}var buffer=opts.fx=="none"?0:opts.fx=="shuffle"?500:250;
1833while((opts.timeout-opts.speed)<buffer){opts.timeout+=opts.speed;}}if(opts.easing){opts.easeIn=opts.easeOut=opts.easing;}if(!opts.speedIn){opts.speedIn=opts.speed;}if(!opts.speedOut){opts.speedOut=opts.speed;}opts.slideCount=els.length;opts.currSlide=opts.lastSlide=first;if(opts.random){if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{if(opts.backwards){opts.nextSlide=opts.startingSlide===0?(els.length-1):opts.startingSlide-1;}else{opts.nextSlide=opts.startingSlide>=(els.length-1)?0:opts.startingSlide+1;}}if(!opts.multiFx){var init=$.fn.cycle.transitions[opts.fx];if($.isFunction(init)){init($cont,$slides,opts);}else{if(opts.fx!="custom"&&!opts.multiFx){log("unknown transition: "+opts.fx,"; slideshow terminating");return false;}}}var e0=$slides[first];if(!opts.skipInitializationCallbacks){if(opts.before.length){opts.before[0].apply(e0,[e0,e0,opts,true]);}if(opts.after.length){opts.after[0].apply(e0,[e0,e0,opts,true]);}}if(opts.next){$(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,1);});}if(opts.prev){$(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,0);});}if(opts.pager||opts.pagerAnchorBuilder){buildPager(els,opts);}exposeAddSlide(opts,els);return opts;}function saveOriginalOpts(opts){opts.original={before:[],after:[]};opts.original.cssBefore=$.extend({},opts.cssBefore);opts.original.cssAfter=$.extend({},opts.cssAfter);opts.original.animIn=$.extend({},opts.animIn);opts.original.animOut=$.extend({},opts.animOut);$.each(opts.before,function(){opts.original.before.push(this);});$.each(opts.after,function(){opts.original.after.push(this);});}function supportMultiTransitions(opts){var i,tx,txs=$.fn.cycle.transitions;if(opts.fx.indexOf(",")>0){opts.multiFx=true;opts.fxs=opts.fx.replace(/\s*/g,"").split(",");for(i=0;i<opts.fxs.length;i++){var fx=opts.fxs[i];tx=txs[fx];if(!tx||!txs.hasOwnProperty(fx)||!$.isFunction(tx)){log("discarding unknown transition: ",fx);opts.fxs.splice(i,1);i--;}}if(!opts.fxs.length){log("No valid transitions named; slideshow terminating.");return false;}}else{if(opts.fx=="all"){opts.multiFx=true;opts.fxs=[];for(var p in txs){if(txs.hasOwnProperty(p)){tx=txs[p];if(txs.hasOwnProperty(p)&&$.isFunction(tx)){opts.fxs.push(p);}}}}}if(opts.multiFx&&opts.randomizeEffects){var r1=Math.floor(Math.random()*20)+30;for(i=0;i<r1;i++){var r2=Math.floor(Math.random()*opts.fxs.length);opts.fxs.push(opts.fxs.splice(r2,1)[0]);}debug("randomized fx sequence: ",opts.fxs);}return true;}function exposeAddSlide(opts,els){opts.addSlide=function(newSlide,prepend){var $s=$(newSlide),s=$s[0];if(!opts.autostopCount){opts.countdown++;}els[prepend?"unshift":"push"](s);if(opts.els){opts.els[prepend?"unshift":"push"](s);}opts.slideCount=els.length;if(opts.random){opts.randomMap.push(opts.slideCount-1);opts.randomMap.sort(function(a,b){return Math.random()-0.5;});}$s.css("position","absolute");$s[prepend?"prependTo":"appendTo"](opts.$cont);if(prepend){opts.currSlide++;opts.nextSlide++;}if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($s);}if(opts.fit&&opts.width){$s.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$s.height(opts.height);}s.cycleH=(opts.fit&&opts.height)?opts.height:$s.height();s.cycleW=(opts.fit&&opts.width)?opts.width:$s.width();$s.css(opts.cssBefore);if(opts.pager||opts.pagerAnchorBuilder){$.fn.cycle.createPagerAnchor(els.length-1,s,$(opts.pager),els,opts);}if($.isFunction(opts.onAddSlide)){opts.onAddSlide($s);}else{$s.hide();}};}$.fn.cycle.resetState=function(opts,fx){fx=fx||opts.fx;opts.before=[];opts.after=[];opts.cssBefore=$.extend({},opts.original.cssBefore);opts.cssAfter=$.extend({},opts.original.cssAfter);opts.animIn=$.extend({},opts.original.animIn);opts.animOut=$.extend({},opts.original.animOut);opts.fxFn=null;$.each(opts.original.before,function(){opts.before.push(this);});$.each(opts.original.after,function(){opts.after.push(this);});var init=$.fn.cycle.transitions[fx];if($.isFunction(init)){init(opts.$cont,$(opts.elements),opts);}};function go(els,opts,manual,fwd){var p=opts.$cont[0],curr=els[opts.currSlide],next=els[opts.nextSlide];if(manual&&opts.busy&&opts.manualTrump){debug("manualTrump in go(), stopping active transition");$(els).stop(true,true);opts.busy=0;clearTimeout(p.cycleTimeout);}if(opts.busy){debug("transition active, ignoring new tx request");return;}if(p.cycleStop!=opts.stopCount||p.cycleTimeout===0&&!manual){return;}if(!manual&&!p.cyclePause&&!opts.bounce&&((opts.autostop&&(--opts.countdown<=0))||(opts.nowrap&&!opts.random&&opts.nextSlide<opts.currSlide))){if(opts.end){opts.end(opts);}return;}var changed=false;if((manual||!p.cyclePause)&&(opts.nextSlide!=opts.currSlide)){changed=true;var fx=opts.fx;curr.cycleH=curr.cycleH||$(curr).height();curr.cycleW=curr.cycleW||$(curr).width();next.cycleH=next.cycleH||$(next).height();next.cycleW=next.cycleW||$(next).width();if(opts.multiFx){if(fwd&&(opts.lastFx===undefined||++opts.lastFx>=opts.fxs.length)){opts.lastFx=0;}else{if(!fwd&&(opts.lastFx===undefined||--opts.lastFx<0)){opts.lastFx=opts.fxs.length-1;}}fx=opts.fxs[opts.lastFx];}if(opts.oneTimeFx){fx=opts.oneTimeFx;opts.oneTimeFx=null;}$.fn.cycle.resetState(opts,fx);if(opts.before.length){$.each(opts.before,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});}var after=function(){opts.busy=0;$.each(opts.after,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});if(!p.cycleStop){queueNext();}};debug("tx firing("+fx+"); currSlide: "+opts.currSlide+"; nextSlide: "+opts.nextSlide);opts.busy=1;if(opts.fxFn){opts.fxFn(curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}else{if($.isFunction($.fn.cycle[opts.fx])){$.fn.cycle[opts.fx](curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}else{$.fn.cycle.custom(curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}}}else{queueNext();}
1833if(changed||opts.nextSlide==opts.currSlide){var roll;opts.lastSlide=opts.currSlide;if(opts.random){opts.currSlide=opts.nextSlide;if(++opts.randomIndex==els.length){opts.randomIndex=0;opts.randomMap.sort(function(a,b){return Math.random()-0.5;});}opts.nextSlide=opts.randomMap[opts.randomIndex];if(opts.nextSlide==opts.currSlide){opts.nextSlide=(opts.currSlide==opts.slideCount-1)?0:opts.currSlide+1;}}else{if(opts.backwards){roll=(opts.nextSlide-1)<0;if(roll&&opts.bounce){opts.backwards=!opts.backwards;opts.nextSlide=1;opts.currSlide=0;}else{opts.nextSlide=roll?(els.length-1):opts.nextSlide-1;opts.currSlide=roll?0:opts.nextSlide+1;}}else{roll=(opts.nextSlide+1)==els.length;if(roll&&opts.bounce){opts.backwards=!opts.backwards;opts.nextSlide=els.length-2;opts.currSlide=els.length-1;}else{opts.nextSlide=roll?0:opts.nextSlide+1;opts.currSlide=roll?els.length-1:opts.nextSlide-1;}}}}if(changed&&opts.pager){opts.updateActivePagerLink(opts.pager,opts.currSlide,opts.activePagerClass);}function queueNext(){var ms=0,timeout=opts.timeout;if(opts.timeout&&!opts.continuous){ms=getTimeout(els[opts.currSlide],els[opts.nextSlide],opts,fwd);if(opts.fx=="shuffle"){ms-=opts.speedOut;}}else{if(opts.continuous&&p.cyclePause){ms=10;}}if(ms>0){p.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.backwards);},ms);}}}$.fn.cycle.updateActivePagerLink=function(pager,currSlide,clsName){$(pager).each(function(){$(this).children().removeClass(clsName).eq(currSlide).addClass(clsName);});};function getTimeout(curr,next,opts,fwd){if(opts.timeoutFn){var t=opts.timeoutFn.call(curr,curr,next,opts,fwd);while(opts.fx!="none"&&(t-opts.speed)<250){t+=opts.speed;}debug("calculated timeout: "+t+"; speed: "+opts.speed);if(t!==false){return t;}}return opts.timeout;}$.fn.cycle.next=function(opts){advance(opts,1);};$.fn.cycle.prev=function(opts){advance(opts,0);};function advance(opts,moveForward){var val=moveForward?1:-1;var els=opts.elements;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}if(opts.random&&val<0){opts.randomIndex--;if(--opts.randomIndex==-2){opts.randomIndex=els.length-2;}else{if(opts.randomIndex==-1){opts.randomIndex=els.length-1;}}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{if(opts.random){opts.nextSlide=opts.randomMap[opts.randomIndex];}else{opts.nextSlide=opts.currSlide+val;if(opts.nextSlide<0){if(opts.nowrap){return false;}opts.nextSlide=els.length-1;}else{if(opts.nextSlide>=els.length){if(opts.nowrap){return false;}opts.nextSlide=0;}}}}var cb=opts.onPrevNextEvent||opts.prevNextClick;if($.isFunction(cb)){cb(val>0,opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,moveForward);return false;}function buildPager(els,opts){var $p=$(opts.pager);$.each(els,function(i,o){$.fn.cycle.createPagerAnchor(i,o,$p,els,opts);});opts.updateActivePagerLink(opts.pager,opts.startingSlide,opts.activePagerClass);}$.fn.cycle.createPagerAnchor=function(i,el,$p,els,opts){var a;if($.isFunction(opts.pagerAnchorBuilder)){a=opts.pagerAnchorBuilder(i,el);debug("pagerAnchorBuilder("+i+", el) returned: "+a);}else{a='<a href="#">'+(i+1)+"</a>";}if(!a){return;}var $a=$(a);if($a.parents("body").length===0){var arr=[];if($p.length>1){$p.each(function(){var $clone=$a.clone(true);$(this).append($clone);arr.push($clone[0]);});$a=$(arr);}else{$a.appendTo($p);}}opts.pagerAnchors=opts.pagerAnchors||[];opts.pagerAnchors.push($a);var pagerFn=function(e){e.preventDefault();opts.nextSlide=i;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}var cb=opts.onPagerEvent||opts.pagerClick;if($.isFunction(cb)){cb(opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,opts.currSlide<i);};if(/mouseenter|mouseover/i.test(opts.pagerEvent)){$a.hover(pagerFn,function(){});}else{$a.bind(opts.pagerEvent,pagerFn);}if(!/^click/.test(opts.pagerEvent)&&!opts.allowPagerClickBubble){$a.bind("click.cycle",function(){return false;});}var cont=opts.$cont[0];var pauseFlag=false;if(opts.pauseOnPagerHover){$a.hover(function(){pauseFlag=true;cont.cyclePause++;triggerPause(cont,true,true);},function(){if(pauseFlag){cont.cyclePause--;}triggerPause(cont,true,true);});}};$.fn.cycle.hopsFromLast=function(opts,fwd){var hops,l=opts.lastSlide,c=opts.currSlide;if(fwd){hops=c>l?c-l:opts.slideCount-l;}else{hops=c<l?l-c:l+opts.slideCount-c;}return hops;};function clearTypeFix($slides){debug("applying clearType background-color hack");function hex(s){s=parseInt(s,10).toString(16);return s.length<2?"0"+s:s;}function getBg(e){for(;e&&e.nodeName.toLowerCase()!="html";e=e.parentNode){var v=$.css(e,"background-color");
1833if(v&&v.indexOf("rgb")>=0){var rgb=v.match(/\d+/g);return"#"+hex(rgb[0])+hex(rgb[1])+hex(rgb[2]);}if(v&&v!="transparent"){return v;}}return"#ffffff";}$slides.each(function(){$(this).css("background-color",getBg(this));});}$.fn.cycle.commonReset=function(curr,next,opts,w,h,rev){$(opts.elements).not(curr).hide();if(typeof opts.cssBefore.opacity=="undefined"){opts.cssBefore.opacity=1;}opts.cssBefore.display="block";if(opts.slideResize&&w!==false&&next.cycleW>0){opts.cssBefore.width=next.cycleW;}if(opts.slideResize&&h!==false&&next.cycleH>0){opts.cssBefore.height=next.cycleH;}opts.cssAfter=opts.cssAfter||{};opts.cssAfter.display="none";$(curr).css("zIndex",opts.slideCount+(rev===true?1:0));$(next).css("zIndex",opts.slideCount+(rev===true?0:1));};$.fn.cycle.custom=function(curr,next,opts,cb,fwd,speedOverride){var $l=$(curr),$n=$(next);var speedIn=opts.speedIn,speedOut=opts.speedOut,easeIn=opts.easeIn,easeOut=opts.easeOut,animInDelay=opts.animInDelay,animOutDelay=opts.animOutDelay;$n.css(opts.cssBefore);if(speedOverri
1833de){if(typeof speedOverride=="number"){speedIn=speedOut=speedOverride;}else{speedIn=speedOut=1;}easeIn=easeOut=null;}var fn=function(){$n.delay(animInDelay).animate(opts.animIn,speedIn,easeIn,function(){cb();});};$l.delay(animOutDelay).animate(opts.animOut,speedOut,easeOut,function(){$l.css(opts.cssAfter);if(!opts.sync){fn();}});if(opts.sync){fn();}};$.fn.cycle.transitions={fade:function($cont,$slides,opts){$slides.not(":eq("+opts.currSlide+")").css("opacity",0);opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.opacity=0;});opts.animIn={opacity:1};opts.animOut={opacity:0};opts.cssBefore={top:0,left:0};}};$.fn.cycle.ver=function(){return ver;};$.fn.cycle.defaults={activePagerClass:"activeSlide",after:null,allowPagerClickBubble:false,animIn:null,animInDelay:0,animOut:null,animOutDelay:0,aspect:false,autostop:0,autostopCount:0,backwards:false,before:null,center:null,cleartype:!$.support.opacity,cleartypeNoBg:false,containerResize:1,containerResizeHeight:0,continuous:0,cssAfter:null,cssBefore:null,delay:0,easeIn:null,easeOut:null,easing:null,end:null,fastOnEvent:0,fit:0,fx:"fade",fxFn:null,height:"auto",manualTrump:true,metaAttr:"cycle",next:null,nowrap:0,onPagerEvent:null,onPrevNextEvent:null,pager:null,pagerAnchorBuilder:null,pagerEvent:"click.cycle",pause:0,pauseOnPagerHover:0,prev:null,prevNextEvent:"click.cycle",random:0,randomizeEffects:1,requeueOnImageNotLoaded:true,requeueTimeout:250,rev:0,shuffle:null,skipInitializationCallbacks:false,slideExpr:null,slideResize:1,speed:1000,speedIn:null,speedOut:null,startingSlide:undefined,sync:1,timeout:4000,timeoutFn:null,updateActivePagerLink:null,width:null};})(jQuery);
1834/*
1835 * jQuery Cycle Plugin Transition Definitions
1836 * This script is a plugin for the jQuery Cycle Plugin
1837 * Examples and documentation at: http://malsup.com/jquery/cycle/
1838 * Copyright (c) 2007-2010 M. Alsup
1839 * Version:	 2.73
1840 * Dual licensed under the MIT and GPL licenses:
1841 * http://www.opensource.org/licenses/mit-license.php
1842 * http://www.gnu.org/licenses/gpl.html
1843 */
1844(function($){$.fn.cycle.transitions.none=function($cont,$slides,opts){opts.fxFn=function(curr,next,opts,after){$(next).show();$(curr).hide();after();};};$.fn.cycle.transitions.fadeout=function($cont,$slides,opts){$slides.not(":eq("+opts.currSlide+")").css({display:"block",opacity:1});opts.before.push(function(curr,next,opts,w,h,rev){$(curr).css("zIndex",opts.slideCount+(rev!==true?1:0));$(next).css("zIndex",opts.slideCount+(rev!==true?0:1));});opts.animIn.opacity=1;opts.animOut.opacity=0;opts.cssBefore.opacity=1;opts.cssBefore.display="block";opts.cssAfter.zIndex=0;};$.fn.cycle.transitions.scrollUp=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssBefore.top=h;opts.cssBefore.left=0;opts.cssFirst.top=0;opts.animIn.top=0;opts.animOut.top=-h;};$.fn.cycle.transitions.scrollDown=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssFirst.top=0;opts.cssBefore.top=-h;opts.cssBefore.left=0;opts.animIn.top=0;opts.animOut.top=h;};$.fn.cycle.transitions.scrollLeft=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst.left=0;opts.cssBefore.left=w;opts.cssBefore.top=0;opts.animIn.left=0;opts.animOut.left=0-w;};$.fn.cycle.transitions.scrollRight=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst.left=0;opts.cssBefore.left=-w;opts.cssBefore.top=0;opts.animIn.left=0;opts.animOut.left=w;};$.fn.cycle.transitions.scrollHorz=function($cont,$slides,opts){$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts,fwd){if(opts.rev){fwd=!fwd;}$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.left=fwd?(next.cycleW-1):(1-next.cycleW);opts.animOut.left=fwd?-curr.cycleW:curr.cycleW;});opts.cssFirst.left=0;opts.cssBefore.top=0;opts.animIn.left=0;opts.animOut.top=0;};$.fn.cycle.transitions.scrollVert=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push(function(curr,next,opts,fwd){if(opts.rev){fwd=!fwd;}$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.top=fwd?(1-next.cycleH):(next.cycleH-1);opts.animOut.top=fwd?curr.cycleH:-curr.cycleH;});opts.cssFirst.top=0;opts.cssBefore.left=0;opts.animIn.top=0;opts.animOut.left=0;};$.fn.cycle.transitions.slideX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;});opts.cssBefore.left=0;opts.cssBefore.top=0;opts.cssBefore.width=0;opts.animIn.width="show";opts.animOut.width=0;};$.fn.cycle.transitions.slideY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;});opts.cssBefore.left=0;opts.cssBefore.top=0;opts.cssBefore.height=0;opts.animIn.height="show";opts.animOut.height=0;};$.fn.cycle.transitions.shuffle=function($cont,$slides,opts){var i,w=$cont.css("overflow","visible").width();$slides.css({left:0,top:0});opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);});if(!opts.speedAdjusted){opts.speed=opts.speed/2;opts.speedAdjusted=true;}opts.random=0;opts.shuffle=opts.shuffle||{left:-w,top:15};opts.els=[];for(i=0;i<$slides.length;i++){opts.els.push($slides[i]);}for(i=0;i<opts.currSlide;i++){opts.els.push(opts.els.shift());}opts.fxFn=function(curr,next,opts,cb,fwd){if(opts.rev){fwd=!fwd;}var $el=fwd?$(curr):$(next);$(next).css(opts.cssBefore);var count=opts.slideCount;$el.animate(opts.shuffle,opts.speedIn,opts.easeIn,function(){var hops=$.fn.cycle.hopsFromLast(opts,fwd);for(var k=0;k<hops;k++){if(fwd){opts.els.push(opts.els.shift());}else{opts.els.unshift(opts.els.pop());}}
1844if(fwd){for(var i=0,len=opts.els.length;i<len;i++){$(opts.els[i]).css("z-index",len-i+count);}}else{var z=$(curr).css("z-index");$el.css("z-index",parseInt(z,10)+1+count);}$el.animate({left:0,top:0},opts.speedOut,opts.easeOut,function(){$(fwd?this:curr).hide();if(cb){cb();}});});};$.extend(opts.cssBefore,{display:"block",opacity:1,top:0,left:0});};$.fn.cycle.transitions.turnUp=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=next.cycleH;opts.animIn.height=next.cycleH;opts.animOut.width=next.cycleW;});opts.cssFirst.top=0;opts.cssBefore.left=0;opts.cssBefore.height=0;opts.animIn.top=0;opts.animOut.height=0;};$.fn.cycle.transitions.turnDown=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssFirst.top=0;opts.cssBefore.left=0;opts.cssBefore.top=0;opts.cssBefore.height=0;opts.animOut.height=0;};$.fn.cycle.transitions.turnLeft=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=next.cycleW;opts.animIn.width=next.cycleW;});opts.cssBefore.top=0;opts.cssBefore.width=0;opts.animIn.left=0;opts.animOut.width=0;};$.fn.cycle.transitions.turnRight=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});$.extend(opts.cssBefore,{top:0,left:0,width:0});opts.animIn.left=0;opts.animOut.width=0;};$.fn.cycle.transitions.zoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false,true);opts.cssBefore.top=next.cycleH/2;opts.cssBefore.left=next.cycleW/2;$.extend(opts.animIn,{top:0,left:0,width:next.cycleW,height:next.cycleH});$.extend(opts.animOut,{width:0,height:0,top:curr.cycleH/2,left:curr.cycleW/2});});opts.cssFirst.top=0;opts.cssFirst.left=0;opts.cssBefore.width=0;opts.cssBefore.height=0;};$.fn.cycle.transitions.fadeZoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false);opts.cssBefore.left=next.cycleW/2;opts.cssBefore.top=next.cycleH/2;$.extend(opts.animIn,{top:0,left:0,width:next.cycleW,height:next.cycleH});});opts.cssBefore.width=0;opts.cssBefore.height=0;opts.animOut.opacity=0;};$.fn.cycle.transitions.blindX=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});opts.cssBefore.left=w;opts.cssBefore.top=0;opts.animIn.left=0;opts.animOut.left=w;};$.fn.cycle.transitions.blindY=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore.top=h;opts.cssBefore.left=0;opts.animIn.top=0;opts.animOut.top=h;};$.fn.cycle.transitions.blindZ=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();var w=$cont.width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore.top=h;opts.cssBefore.left=w;opts.animIn.top=0;opts.animIn.left=0;opts.animOut.top=h;opts.animOut.left=w;};$.fn.cycle.transitions.growX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=this.cycleW/2;opts.animIn.left=0;opts.animIn.width=this.cycleW;opts.animOut.left=0;});opts.cssBefore.top=0;opts.cssBefore.width=0;};$.fn.cycle.transitions.growY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=this.cycleH/2;opts.animIn.top=0;opts.animIn.height=this.cycleH;opts.animOut.top=0;});opts.cssBefore.height=0;opts.cssBefore.left=0;};$.fn.cycle.transitions.curtainX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true,true);opts.cssBefore.left=next.cycleW/2;opts.animIn.left=0;opts.animIn.width=this.cycleW;opts.animOut.left=curr.cycleW/2;opts.animOut.width=0;});opts.cssBefore.top=0;opts.cssBefore.width=0;};$.fn.cycle.transitions.curtainY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false,true);opts.cssBefore.top=next.cycleH/2;opts.animIn.top=0;opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH/2;opts.animOut.height=0;});opts.cssBefore.height=0;opts.cssBefore.left=0;};$.fn.cycle.transitions.cover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();
1844var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.cssAfter.display="";if(d=="right"){opts.cssBefore.left=-w;}else{if(d=="up"){opts.cssBefore.top=h;}else{if(d=="down"){opts.cssBefore.top=-h;}else{opts.cssBefore.left=w;}}}});opts.animIn.left=0;opts.animIn.top=0;opts.cssBefore.top=0;opts.cssBefore.left=0;};$.fn.cycle.transitions.uncover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(d=="right"){opts.animOut.left=w;}else{if(d=="up"){opts.animOut.top=-h;}else{if(d=="down"){opts.animOut.top=h;}else{opts.animOut.left=-w;}}}});opts.animIn.left=0;opts.animIn.top=0;opts.cssBefore.top=0;opts.cssBefore.left=0;};$.fn.cycle.transitions.toss=function($cont,$slides,opts){var w=$cont.css("overflow","visible").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(!opts.animOut.left&&!opts.animOut.top){$.extend(opts.animOut,{left:w*2,top:-h/2,opacity:0});}else{opts.animOut.opacity=0;}});opts.cssBefore.left=0;opts.cssBefore.top=0;opts.animIn.left=0;};$.fn.cycle.transitions.wipe=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.cssBefore=opts.cssBefore||{};var clip;if(opts.clip){if(/l2r/.test(opts.clip)){clip="rect(0px 0px "+h+"px 0px)";}else{if(/r2l/.test(opts.clip)){clip="rect(0px "+w+"px "+h+"px "+w+"px)";}else{if(/t2b/.test(opts.clip)){clip="rect(0px "+w+"px 0px 0px)";}else{if(/b2t/.test(opts.clip)){clip="rect("+h+"px "+w+"px "+h+"px 0px)";}else{if(/zoom/.test(opts.clip)){var top=parseInt(h/2,10);var left=parseInt(w/2,10);clip="rect("+top+"px "+left+"px "+top+"px "+left+"px)";}}}}}}opts.cssBefore.clip=opts.cssBefore.clip||clip||"rect(0px 0px 0px 0px)";var d=opts.cssBefore.clip.match(/(\d+)/g);var t=parseInt(d[0],10),r=parseInt(d[1],10),b=parseInt(d[2],10),l=parseInt(d[3],10);opts.before.push(function(curr,next,opts){if(curr==next){return;}var $curr=$(curr),$next=$(next);$.fn.cycle.commonReset(curr,next,opts,true,true,false);opts.cssAfter.display="block";var step=1,count=parseInt((opts.speedIn/13),10)-1;(function f(){var tt=t?t-parseInt(step*(t/count),10):0;var ll=l?l-parseInt(step*(l/count),10):0;var bb=b<h?b+parseInt(step*((h-b)/count||1),10):h;var rr=r<w?r+parseInt(step*((w-r)/count||1),10):w;$next.css({clip:"rect("+tt+"px "+rr+"px "+bb+"px "+ll+"px)"});(step++<=count)?setTimeout(f,13):$curr.css("display","none");})();});$.extend(opts.cssBefore,{display:"block",opacity:1,top:0,left:0});opts.animIn={left:0};opts.animOut={left:0};};})(jQuery);;
1845//  json2.js
1846//  2016-05-01
1847//  Public Domain.
1848//  NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
1849//  See http://www.JSON.org/js.html
1850//  This code should be minified before deployment.
1851//  See http://javascript.crockford.com/jsmin.html
1852
1853//  USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
1854//  NOT CONTROL.
1855
1856//  This file creates a global JSON object containing two methods: stringify
1857//  and parse. This file is provides the ES5 JSON capability to ES3 systems.
1858//  If a project might run on IE8 or earlier, then this file should be included.
1859//  This file does nothing on ES5 systems.
1860
1861//      JSON.stringify(value, replacer, space)
1862//          value       any JavaScript value, usually an object or array.
1863//          replacer    an optional parameter that determines how object
1864//                      values are stringified for objects. It can be a
1865//                      function or an array of strings.
1866//          space       an optional parameter that specifies the indentation
1867//                      of nested structures. If it is omitted, the text will
1868//                      be packed without extra whitespace. If it is a number,
1869//                      it will specify the number of spaces to indent at each
1870//                      level. If it is a string (such as "\t" or "&nbsp;"),
1871//                      it contains the characters used to indent at each level.
1872//          This method produces a JSON text from a JavaScript value.
1873//          When an object value is found, if the object contains a toJSON
1874//          method, its toJSON method will be called and the result will be
1875//          stringified. A toJSON method does not serialize: it returns the
1876//          value represented by the name/value pair that should be serialized,
1877//          or undefined if nothing should be serialized. The toJSON method
1878//          will be passed the key associated with the value, and this will be
1879//          bound to the value.
1880
1881//          For example, this would serialize Dates as ISO strings.
1882
1883//              Date.prototype.toJSON = function (key) {
1884//                  function f(n) {
1885//                      // Format integers to have at least two digits.
1886//                      return (n < 10)
1887//                          ? "0" + n
1888//                          : n;
1889//                  }
1890//                  return this.getUTCFullYear()   + "-" +
1891//                       f(this.getUTCMonth() + 1) + "-" +
1892//                       f(this.getUTCDate())      + "T" +
1893//                       f(this.getUTCHours())     + ":" +
1894//                       f(this.getUTCMinutes())   + ":" +
1895//                       f(this.getUTCSeconds())   + "Z";
1896//              };
1897
1898//          You can provide an optional replacer method. It will be passed the
1899//          key and value of each member, with this bound to the containing
1900//          object. The value that is returned from your method will be
1901//          serialized. If your method returns undefined, then the member will
1902//          be excluded from the serialization.
1903
1904//          If the replacer parameter is an array of strings, then it will be
1905//          used to select the members to be serialized. It filters the results
1906//          such that only members with keys listed in the replacer array are
1907//          stringified.
1908
1909//          Values that do not have JSON representations, such as undefined or
1910//          functions, will not be serialized. Such values in objects will be
1911//          dropped; in arrays they will be replaced with null. You can use
1912//          a replacer function to replace those with JSON values.
1913
1914//          JSON.stringify(undefined) returns undefined.
1915
1916//          The optional space parameter produces a stringification of the
1917//          value that is filled with line breaks and indentation to make it
1918//          easier to read.
1919
1920//          If the space parameter is a non-empty string, then that string will
1921//          be used for indentation. If the space parameter is a number, then
1922//          the indentation will be that many spaces.
1923
1924//          Example:
1925
1926//          text = JSON.stringify(["e", {pluribus: "unum"}]);
1927//          // text is '["e",{"pluribus":"unum"}]'
1928
1929//          text = JSON.stringify(["e", {pluribus: "unum"}], null, "\t");
1930//          // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
1931
1932//          text = JSON.stringify([new Date()], function (key, value) {
1933//              return this[key] instanceof Date
1934//                  ? "Date(" + this[key] + ")"
1935//                  : value;
1936//          });
1937//          // text is '["Date(---current time---)"]'
1938
1939//      JSON.parse(text, reviver)
1940//          This method parses a JSON text to produce an object or array.
1941//          It can throw a SyntaxError exception.
1942
1943//          The optional reviver parameter is a function that can filter and
1944//          transform the results. It receives each of the keys and values,
1945//          and its return value is used instead of the original value.
1946//          If it returns what it received, then the structure is not modified.
1947//          If it returns undefined then the member is deleted.
1948
1949//          Example:
1950
1951//          // Parse the text. Values that look like ISO date strings will
1952//          // be converted to Date objects.
1953
1954//          myData = JSON.parse(text, function (key, value) {
1955//              var a;
1956//              if (typeof value === "string") {
1957//                  a =
1958//   /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
1959//                  if (a) {
1960//                      return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
1961//                          +a[5], +a[6]));
1962//                  }
1963//              }
1964//              return value;
1965//          });
1966
1967//          myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
1968//              var d;
1969//              if (typeof value === "string" &&
1970//                      value.slice(0, 5) === "Date(" &&
1971//                      value.slice(-1) === ")") {
1972//                  d = new Date(value.slice(5, -1));
1973//                  if (d) {
1974//                      return d;
1975//                  }
1976//              }
1977//              return value;
1978//          });
1979
1980//  This is a reference implementation. You are free to copy, modify, or
1981//  redistribute.
1982
1983/*jslint
1984    eval, for, this
1985*/
1986
1987/*property
1988    JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
1989    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
1990    lastIndex, length, parse, prototype, push, replace, slice, stringify,
1991    test, toJSON, toString, valueOf
1992*/
1993
1994
1995// Create a JSON object only if one does not already exist. We create the
1996// methods in a closure to avoid creating global variables.
1997
1998if (typeof JSON !== "object") {
1999    JSON = {};
2000}
2001
2002(function () {
2003    "use strict";
2004
2005    var rx_one = /^[\],:{}\s]*$/;
2006    var rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g;
2007    var rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
2008    var rx_four = /(?:^|:|,)(?:\s*\[)+/g;
2009    var rx_escapable = /[\
vendor: 11,316 bytes, lines 2009-2350
2009\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
2010    var rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
2011
2012    function f(n) {
2013        // Format integers to have at least two digits.
2014        return n < 10
2015            ? "0" + n
2016            : n;
2017    }
2018
2019    function this_value() {
2020        return this.valueOf();
2021    }
2022
2023    if (typeof Date.prototype.toJSON !== "function") {
2024
2025        Date.prototype.toJSON = function () {
2026
2027            return isFinite(this.valueOf())
2028                ? this.getUTCFullYear() + "-" +
2029                        f(this.getUTCMonth() + 1) + "-" +
2030                        f(this.getUTCDate()) + "T" +
2031                        f(this.getUTCHours()) + ":" +
2032                        f(this.getUTCMinutes()) + ":" +
2033                        f(this.getUTCSeconds()) + "Z"
2034                : null;
2035        };
2036
2037        Boolean.prototype.toJSON = this_value;
2038        Number.prototype.toJSON = this_value;
2039        String.prototype.toJSON = this_value;
2040    }
2041
2042    var gap;
2043    var indent;
2044    var meta;
2045    var rep;
2046
2047
2048    function quote(string) {
2049
2050// If the string contains no control characters, no quote characters, and no
2051// backslash characters, then we can safely slap some quotes around it.
2052// Otherwise we must also replace the offending characters with safe escape
2053// sequences.
2054
2055        rx_escapable.lastIndex = 0;
2056        return rx_escapable.test(string)
2057            ? "\"" + string.replace(rx_escapable, function (a) {
2058                var c = meta[a];
2059                return typeof c === "string"
2060                    ? c
2061                    : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
2062            }) + "\""
2063            : "\"" + string + "\"";
2064    }
2065
2066
2067    function str(key, holder) {
2068
2069// Produce a string from holder[key].
2070
2071        var i;          // The loop counter.
2072        var k;          // The member key.
2073        var v;          // The member value.
2074        var length;
2075        var mind = gap;
2076        var partial;
2077        var value = holder[key];
2078
2079// If the value has a toJSON method, call it to obtain a replacement value.
2080
2081        if (value && typeof value === "object" &&
2082                typeof value.toJSON === "function") {
2083            value = value.toJSON(key);
2084        }
2085
2086// If we were called with a replacer function, then call the replacer to
2087// obtain a replacement value.
2088
2089        if (typeof rep === "function") {
2090            value = rep.call(holder, key, value);
2091        }
2092
2093// What happens next depends on the value's type.
2094
2095        switch (typeof value) {
2096        case "string":
2097            return quote(value);
2098
2099        case "number":
2100
2101// JSON numbers must be finite. Encode non-finite numbers as null.
2102
2103            return isFinite(value)
2104                ? String(value)
2105                : "null";
2106
2107        case "boolean":
2108        case "null":
2109
2110// If the value is a boolean or null, convert it to a string. Note:
2111// typeof null does not produce "null". The case is included here in
2112// the remote chance that this gets fixed someday.
2113
2114            return String(value);
2115
2116// If the type is "object", we might be dealing with an object or an array or
2117// null.
2118
2119        case "object":
2120
2121// Due to a specification blunder in ECMAScript, typeof null is "object",
2122// so watch out for that case.
2123
2124            if (!value) {
2125                return "null";
2126            }
2127
2128// Make an array to hold the partial results of stringifying this object value.
2129
2130            gap += indent;
2131            partial = [];
2132
2133// Is the value an array?
2134
2135            if (Object.prototype.toString.apply(value) === "[object Array]") {
2136
2137// The value is an array. Stringify every element. Use null as a placeholder
2138// for non-JSON values.
2139
2140                length = value.length;
2141                for (i = 0; i < length; i += 1) {
2142                    partial[i] = str(i, value) || "null";
2143                }
2144
2145// Join all of the elements together, separated with commas, and wrap them in
2146// brackets.
2147
2148                v = partial.length === 0
2149                    ? "[]"
2150                    : gap
2151                        ? "[\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "]"
2152                        : "[" + partial.join(",") + "]";
2153                gap = mind;
2154                return v;
2155            }
2156
2157// If the replacer is an array, use it to select the members to be stringified.
2158
2159            if (rep && typeof rep === "object") {
2160                length = rep.length;
2161                for (i = 0; i < length; i += 1) {
2162                    if (typeof rep[i] === "string") {
2163                        k = rep[i];
2164                        v = str(k, value);
2165                        if (v) {
2166                            partial.push(quote(k) + (
2167                                gap
2168                                    ? ": "
2169                                    : ":"
2170                            ) + v);
2171                        }
2172                    }
2173                }
2174            } else {
2175
2176// Otherwise, iterate through all of the keys in the object.
2177
2178                for (k in value) {
2179                    if (Object.prototype.hasOwnProperty.call(value, k)) {
2180                        v = str(k, value);
2181                        if (v) {
2182                            partial.push(quote(k) + (
2183                                gap
2184                                    ? ": "
2185                                    : ":"
2186                            ) + v);
2187                        }
2188                    }
2189                }
2190            }
2191
2192// Join all of the member texts together, separated with commas,
2193// and wrap them in braces.
2194
2195            v = partial.length === 0
2196                ? "{}"
2197                : gap
2198                    ? "{\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "}"
2199                    : "{" + partial.join(",") + "}";
2200            gap = mind;
2201            return v;
2202        }
2203    }
2204
2205// If the JSON object does not yet have a stringify method, give it one.
2206
2207    if (typeof JSON.stringify !== "function") {
2208        meta = {    // table of character substitutions
2209            "\b": "\\b",
2210            "\t": "\\t",
2211            "\n": "\\n",
2212            "\f": "\\f",
2213            "\r": "\\r",
2214            "\"": "\\\"",
2215            "\\": "\\\\"
2216        };
2217        JSON.stringify = function (value, replacer, space) {
2218
2219// The stringify method takes a value and an optional replacer, and an optional
2220// space parameter, and returns a JSON text. The replacer can be a function
2221// that can replace values, or an array of strings that will select the keys.
2222// A default replacer method can be provided. Use of the space parameter can
2223// produce text that is more easily readable.
2224
2225            var i;
2226            gap = "";
2227            indent = "";
2228
2229// If the space parameter is a number, make an indent string containing that
2230// many spaces.
2231
2232            if (typeof space === "number") {
2233                for (i = 0; i < space; i += 1) {
2234                    indent += " ";
2235                }
2236
2237// If the space parameter is a string, it will be used as the indent string.
2238
2239            } else if (typeof space === "string") {
2240                indent = space;
2241            }
2242
2243// If there is a replacer, it must be a function or an array.
2244// Otherwise, throw an error.
2245
2246            rep = replacer;
2247            if (replacer && typeof replacer !== "function" &&
2248                    (typeof replacer !== "object" ||
2249                    typeof replacer.length !== "number")) {
2250                throw new Error("JSON.stringify");
2251            }
2252
2253// Make a fake root object containing our value under the key of "".
2254// Return the result of stringifying the value.
2255
2256            return str("", {"": value});
2257        };
2258    }
2259
2260
2261// If the JSON object does not yet have a parse method, give it one.
2262
2263    if (typeof JSON.parse !== "function") {
2264        JSON.parse = function (text, reviver) {
2265
2266// The parse method takes a text and an optional reviver function, and returns
2267// a JavaScript value if the text is a valid JSON text.
2268
2269            var j;
2270
2271            function walk(holder, key) {
2272
2273// The walk method is used to recursively walk the resulting structure so
2274// that modifications can be made.
2275
2276                var k;
2277                var v;
2278                var value = holder[key];
2279                if (value && typeof value === "object") {
2280                    for (k in value) {
2281                        if (Object.prototype.hasOwnProperty.call(value, k)) {
2282                            v = walk(value, k);
2283                            if (v !== undefined) {
2284                                value[k] = v;
2285                            } else {
2286                                delete value[k];
2287                            }
2288                        }
2289                    }
2290                }
2291                return reviver.call(holder, key, value);
2292            }
2293
2294
2295// Parsing happens in four stages. In the first stage, we replace certain
2296// Unicode characters with escape sequences. JavaScript handles many characters
2297// incorrectly, either silently deleting them, or treating them as line endings.
2298
2299            text = String(text);
2300            rx_dangerous.lastIndex = 0;
2301            if (rx_dangerous.test(text)) {
2302                text = text.replace(rx_dangerous, function (a) {
2303                    return "\\u" +
2304                            ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
2305                });
2306            }
2307
2308// In the second stage, we run the text against regular expressions that look
2309// for non-JSON patterns. We are especially concerned with "()" and "new"
2310// because they can cause invocation, and "=" because it can cause mutation.
2311// But just to be safe, we want to reject all unexpected forms.
2312
2313// We split the second stage into 4 regexp operations in order to work around
2314// crippling inefficiencies in IE's and Safari's regexp engines. First we
2315// replace the JSON backslash pairs with "@" (a non-JSON character). Second, we
2316// replace all simple value tokens with "]" characters. Third, we delete all
2317// open brackets that follow a colon or comma or that begin the text. Finally,
2318// we look to see that the remaining characters are only whitespace or "]" or
2319// "," or ":" or "{" or "}". If that is so, then the text is safe for eval.
2320
2321            if (
2322                rx_one.test(
2323                    text
2324                        .replace(rx_two, "@")
2325                        .replace(rx_three, "]")
2326                        .replace(rx_four, "")
2327                )
2328            ) {
2329
2330// In the third stage we use the eval function to compile the text into a
2331// JavaScript structure. The "{" operator is subject to a syntactic ambiguity
2332// in JavaScript: it can begin a block or an object literal. We wrap the text
2333// in parens to eliminate the ambiguity.
2334
2335                j = eval("(" + text + ")");
2336
2337// In the optional fourth stage, we recursively walk the new structure, passing
2338// each name/value pair to a reviver function for possible transformation.
2339
2340                return (typeof reviver === "function")
2341                    ? walk({"": j}, "")
2342                    : j;
2343            }
2344
2345// If the text is not JSON parseable, then a SyntaxError is thrown.
2346
2347            throw new SyntaxError("JSON.parse");
2348        };
2349    }
2350}());
2351;
2352/**
2353 *  @file
2354 *  A simple jQuery Cycle Div Slideshow Rotator.
2355 */
2356
2357/**
2358 * This will set our initial behavior, by starting up each individual slideshow.
2359 */
2360(function ($) {
2361  Drupal.behaviors.viewsSlideshowCycle = {
2362    attach: function (context) {
2363      $('.views_slideshow_cycle_main:not(.viewsSlideshowCycle-processed)', context).addClass('viewsSlideshowCycle-processed').each(function() {
2364        var fullId = '#' + $(this).attr('id');
2365        var settings = Drupal.settings.viewsSlideshowCycle[fullId];
2366        settings.targetId = '#' + $(fullId + " :first").attr('id');
2367
2368        settings.slideshowId = settings.targetId.replace('#views_slideshow_cycle_teaser_section_', '');
2369        // Pager after function.
2370        var pager_after_fn = function(curr, next, opts) {
2371          // Need to do some special handling on first load.
2372          var slideNum = opts.currSlide;
2373          if (typeof settings.processedAfter == 'undefined' || !settings.processedAfter) {
2374            settings.processedAfter = 1;
2375            slideNum = (typeof settings.opts.startingSlide == 'undefined') ? 0 : settings.opts.startingSlide;
2376          }
2377          if (settings.pause_after_slideshow) {
2378            opts.counter += 1;
2379            if (opts.counter == settings.num_divs + 1) {
2380              opts.counter = 1;
2381              Drupal.viewsSlideshow.action({ "action": 'pause', "slideshowID": settings.slideshowId, "force": true });
2382            }
2383          }
2384          Drupal.viewsSlideshow.action({ "action": 'transitionEnd', "slideshowID": settings.slideshowId, "slideNum": slideNum });
2385        }
2386        // Pager before function.
2387        var pager_before_fn = function(curr, next, opts) {
2388          $(document).trigger('drupal:views_slideshow_cycle:before', {
2389            curr: curr, next: next, opts: opts, settings: settings
2390          });
2391
2392          var slideNum = opts.nextSlide;
2393
2394          // Remember last slide.
2395          if (settings.remember_slide) {
2396            createCookie(settings.vss_id, slideNum, settings.remember_slide_days);
2397          }
2398
2399          // Make variable height.
2400          if (!settings.fixed_height) {
2401            //get the height of the current slide
2402            var $ht = $(next).height();
2403            //set the container's height to that of the current slide
2404            $(next).parent().animate({height: $ht});
2405          }
2406
2407          // Need to do some special handling on first load.
2408          if (typeof settings.processedBefore == 'undefined' || !settings.processedBefore) {
2409            settings.processedBefore = 1;
2410            slideNum = (typeof opts.startingSlide == 'undefined') ? 0 : opts.startingSlide;
2411          }
2412
2413          Drupal.viewsSlideshow.action({ "action": 'transitionBegin', "slideshowID": settings.slideshowId, "slideNum": slideNum });
2414        }
2415        settings.loaded = false;
2416
2417        settings.opts = {
2418          speed:settings.speed,
2419          timeout:settings.timeout,
2420          delay:settings.delay,
2421          sync:settings.sync,
2422          random:settings.random,
2423          nowrap:settings.nowrap,
2424          pause_after_slideshow:settings.pause_after_slideshow,
2425          counter:0,
2426          after:pager_after_fn,
2427          before:pager_before_fn,
2428          cleartype:(settings.cleartype)? true : false,
2429          cleartypeNoBg:(settings.cleartypenobg)? true : false
2430        }
2431
2432        // Set the starting slide if we are supposed to remember the slide
2433        if (settings.remember_slide) {
2434          var startSlide = readCookie(settings.vss_id);
2435          if (startSlide == null) {
2436            startSlide = 0;
2437          }
2438          settings.opts.startingSlide = parseInt(startSlide);
2439        }
2440
2441        if (settings.effect == 'none') {
2442          settings.opts.speed = 1;
2443        }
2444        else {
2445          settings.opts.fx = settings.effect;
2446        }
2447
2448        // Take starting item from fragment.
2449        var hash = location.hash;
2450        if (hash) {
2451          var hash = hash.replace('#', '');
2452          var aHash = hash.split(';');
2453          var aHashLen = aHash.length;
2454
2455          // Loop through all the possible starting points.
2456          for (var i = 0; i < aHashLen; i++) {
2457            // Split the hash into two parts. One part is the slideshow id the
2458            // other is the slide number.
2459            var initialInfo = aHash[i].split(':');
2460            // The id in the hash should match our slideshow.
2461            // The slide number chosen shouldn't be larger than the number of
2462            // slides we have.
2463            if (settings.slideshowId == initialInfo[0] && settings.num_divs >
2463 initialInfo[1]) {
2464              settings.opts.startingSlide = parseInt(initialInfo[1]);
2465            }
2466          }
2467        }
2468
2469        // Pause on hover.
2470        if (settings.pause) {
2471          var mouseIn = function() {
2472            Drupal.viewsSlideshow.action({ "action": 'pause', "slideshowID": settings.slideshowId });
2473          }
2474
2475          var mouseOut = function() {
2476            Drupal.viewsSlideshow.action({ "action": 'play', "slideshowID": settings.slideshowId });
2477          }
2478
2479          if (jQuery.fn.hoverIntent) {
2480            $('#views_slideshow_cycle_teaser_section_' + settings.vss_id).hoverIntent(mouseIn, mouseOut);
2481          }
2482          else {
2483            $('#views_slideshow_cycle_teaser_section_' + settings.vss_id).hover(mouseIn, mouseOut);
2484          }
2485        }
2486
2487        // Play on hover.
2488        if (settings.play_on_hover) {
2489          var mouseIn = function() {
2490            Drupal.viewsSlideshow.action({ "action": 'play', "slideshowID": settings.slideshowId, "force": true });
2491          }
2492
2493          var mouseOut = function() {
2494            Drupal.viewsSlideshow.action({ "action": 'pause', "slideshowID": settings.slideshowId });
2495          }
2496
2497          if (jQuery.fn.hoverIntent) {
2498            $('#views_slideshow_cycle_teaser_section_' + settings.vss_id).hoverIntent(mouseIn, mouseOut);
2499          }
2500          else {
2501            $('#views_slideshow_cycle_teaser_section_' + settings.vss_id).hover(mouseIn, mouseOut);
2502          }
2503        }
2504
2505        // Pause on clicking of the slide.
2506        if (settings.pause_on_click) {
2507          $('#views_slideshow_cycle_teaser_section_' + settings.vss_id).click(function() {
2508            Drupal.viewsSlideshow.action({ "action": 'pause', "slideshowID": settings.slideshowId, "force": true });
2509          });
2510        }
2511
2512        if (typeof JSON != 'undefined') {
2513          var advancedOptions = JSON.parse(settings.advanced_options);
2514          for (var option in advancedOptions) {
2515            switch(option) {
2516
2517              // Standard Options
2518              case "activePagerClass":
2519              case "allowPagerClickBubble":
2520              case "autostop":
2521              case "autostopCount":
2522              case "backwards":
2523              case "bounce":
2524              case "cleartype":
2525              case "cleartypeNoBg":
2526              case "containerResize":
2527              case "continuous":
2528              case "delay":
2529              case "easeIn":
2530              case "easeOut":
2531              case "easing":
2532              case "fastOnEvent":
2533              case "fit":
2534              case "fx":
2535              case "manualTrump":
2536              case "metaAttr":
2537              case "next":
2538              case "nowrap":
2539              case "pager":
2540              case "pagerEvent":
2541              case "pause":
2542              case "pauseOnPagerHover":
2543              case "prev":
2544              case "prevNextEvent":
2545              case "random":
2546              case "randomizeEffects":
2547              case "requeueOnImageNotLoaded":
2548              case "requeueTimeout":
2549              case "rev":
2550              case "slideExpr":
2551              case "slideResize":
2552              case "speed":
2553              case "speedIn":
2554              case "speedOut":
2555              case "startingSlide":
2556              case "sync":
2557              case "timeout":
2558                var optionValue = advancedOptions[option];
2559                optionValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(optionValue);
2560                settings.opts[option] = optionValue;
2561                break;
2562
2563              // If width is set we need to disable resizing.
2564              case "width":
2565                var optionValue = advancedOptions["width"];
2566                optionValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(optionValue);
2567                settings.opts["width"] = optionValue;
2568                settings.opts["containerResize"] = 0;
2569                break;
2570
2571              // If height is set we need to set fixed_height to true.
2572              case "height":
2573                var optionValue = advancedOptions["height"];
2574                optionValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(optionValue);
2575                settings.opts["height"] = optionValue;
2576                settings.fixed_height = 1;
2577                break;
2578
2579              // These process options that look like {top:50, bottom:20}
2580              case "animIn":
2581              case "animInDelay":
2582              case "animOut":
2583              case "animOutDelay":
2584              case "cssBefore":
2585              case "cssAfter":
2586              case "shuffle":
2587                var cssValue = advancedOptions[option];
2588                cssValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(cssValue);
2589                settings.opts[option] = eval('(' + cssValue + ')');
2590                break;
2591
2592              // These options have their own functions.
2593              case "after":
2594                var afterValue = advancedOptions[option];
2595                afterValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(afterValue);
2596                // transition callback (scope set to element that was shown): function(currSlideElement, nextSlideElement, options, forwardFlag)
2597                settings.opts[option] = function(currSlideElement, nextSlideElement, options, forwardFlag) {
2598                  pager_after_fn(currSlideElement, nextSlideElement, options);
2599                  eval(afterValue);
2600                }
2601                break;
2602
2603              case "before":
2604                var beforeValue = advancedOptions[option];
2605                beforeValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(beforeValue);
2606                // transition callback (scope set to element to be shown):     function(currSlideElement, nextSlideElement, options, forwardFlag)
2607                settings.opts[option] = function(currSlideElement, nextSlideElement, options, forwardFlag) {
2608                  pager_before_fn(currSlideElement, nextSlideElement, options);
2609                  eval(beforeValue);
2610                }
2611                break;
2612
2613              case "end":
2614                var endValue = advancedOptions[option];
2615                endValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(endValue);
2616                // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options)
2617                settings.opts[option] = function(options) {
2618                  eval(endValue);
2619                }
2620                break;
2621
2622              case "fxFn":
2623                var fxFnValue = advancedOptions[option];
2624                fxFnValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(fxFnValue);
2625                // function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag)
2626                settings.opts[option] = function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag) {
2627                  eval(fxFnValue);
2628                }
2629                break;
2630
2631              case "onPagerEvent":
2632                var onPagerEventValue = advancedOptions[option];
2633                onPagerEventValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(onPagerEventValue);
2634                settings.opts[option] = function(zeroBasedSlideIndex, slideElement) {
2635                  eval(onPagerEventValue);
2636                }
2637                break;
2638
2639              case "onPrevNextEvent":
2640                var onPrevNextEventValue = advancedOptions[option];
2641                onPrevNextEventValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(onPrevNextEventValue);
2642                settings.opts[option] = function(isNext, zeroBasedSlideIndex, slideElement) {
2643                  eval(onPrevNextEventValue);
2644                }
2645                break;
2646
2647              case "pagerAnchorBuilder":
2648                var pagerAnchorBuilderValue = advancedOptions[option];
2649                pagerAnchorBuilderValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(pagerAnchorBuilderValue);
2650                // callback fn for building anchor links:  function(index, DOMelement)
2651                settings.opts[option] = function(index, DOMelement) {
2652                  var returnVal = '';
2653                  eval(pagerAnchorBuilderValue);
2654                  return returnVal;
2655                }
2656                break;
2657
2658              case "pagerClick":
2659                var pagerClickValue = advancedOptions[option];
2660                pagerClickValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(pagerClickValue);
2661                // callback fn for pager clicks:    function(zeroBasedSlideIndex, slideElement)
2662                settings.opts[option] = function(zeroBasedSlideIndex, slideElement) {
2663                  eval(pagerClickValue);
2664                }
2665                break;
2666
2667              case "paused":
2668                var pausedValue = advancedOptions[option];
2669                pausedValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(pausedValue);
2670                // undocumented callback when slideshow is paused:    function(cont, opts, byHover)
2671                settings.opts[option] = function(cont, opts, byHover) {
2672                  eval(pausedValue);
2673                }
2674                break;
2675
2676              case "resumed":
2677                var resumedValue = advancedOptions[option];
2678                resumedValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(resumedValue);
2679                // undocumented callback when slideshow is resumed:    function(cont, opts, byHover)
2680                settings.opts[option] = function(cont, opts, byHover) {
2681                  eval(resumedValue);
2682                }
2683                break;
2684
2685              case "timeoutFn":
2686                var timeoutFnValue = advancedOptions[option];
2687                timeoutFnValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(timeoutFnValue);
2688                settings.opts[option] = function(currSlideElement, nextSlideElement, options, forwardFlag) {
2689                  // Set a sane return value unless function overrides it.
2690                  var returnVal = settings.timeout;
2691                  eval(timeoutFnValue);
2692                  return returnVal;
2693                }
2694                break;
2695
2696              case "updateActivePagerLink":
2697                var updateActivePagerLinkValue = advancedOptions[option];
2698                updateActivePagerLinkValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(updateActivePagerLinkValue);
2699                // callback fn invoked to update the active pager link (adds/removes activePagerClass style)
2700                settings.opts[option] = function(pager, currSlideIndex) {
2701                  eval(updateActivePagerLinkValue);
2702                }
2703                break;
2704            }
2705          }
2706        }
2707
2708        // If selected wait for the images to be loaded.
2709        // otherwise just load the slideshow.
2710        if (settings.wait_for_image_load) {
2711          // For IE/Chrome/Opera we if there are images then we need to make
2712          // sure the images are loaded before starting the slideshow.
2713          settings.totalImages = $(settings.targetId + ' img').length;
2714          if (settings.totalImages) {
2715            settings.loadedImages = 0;
2716
2717            // Add a load event for each image.
2718            $(settings.targetId + ' img').each(function() {
2719              var $imageElement = $(this);
2720              $imageElement.bind('load', function () {
2721                Drupal.viewsSlideshowCycle.imageWait(fullId);
2722              });
2723
2724              // Removing the source and adding it again will fire the load event.
2725              var imgSrc = $imageElement.attr('src');
2726              $imageElement.attr('src', '');
2727              $imageElement.attr('src', imgSrc);
2728            });
2729
2730            // We need to set a timeout so that the slideshow doesn't wait
2731            // indefinitely for all images to load.
2732            setTimeout("Drupal.viewsSlideshowCycle.load('" + fullId + "')", settings.wait_for_image_load_timeout);
2733          }
2734          else {
2735            Drupal.viewsSlideshowCycle.load(fullId);
2736          }
2737        }
2738        else {
2739          Drupal.viewsSlideshowCycle.load(fullId);
2740        }
2741      });
2742    }
2743  };
2744
2745  /**
2746   * Views Slideshow swipe support.
2747   */
2748  Drupal.behaviors.viewsSlideshowSwipe = {
2749    attach: function (context) {
2750      var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0));
2751      if (isTouch === true && $('.views-slideshow-cycle-main-frame').length) {
2752        var $slider = $('.views-slideshow-cycle-main-frame'),
2753          opts = {
2754            start: {x: 0, y: 0},
2755            end: {x: 0, y: 0},
2756            hdiff: 0,
2757            vdiff: 0,
2758            length: 0,
2759            angle: null,
2760            direction: null,
2761          },
2762          optsReset = $.extend(true, {}, opts),
2763         H_THRESHOLD =  110, // roughly one inch effective resolution on ipad
2764         V_THRESHOLD = 50;
2765        $slider.data('bw', opts)
2766        .bind('touchstart.cycle', function (e) {
2767          var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
2768          if (e.originalEvent.touches.length == 1) {
2769            var data = $(this).data('bw');
2770            data.start.x = touch.pageX;
2771            data.start.y = touch.pageY;
2772            $(this).data('bw', data);
2773          }
2774        })
2775        .bind('touchend.cycle', function (e) {
2776          var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
2777          var data = $(this).data('bw');
2778          data.end.x = touch.pageX;
2779          data.end.y = touch.pageY;
2780          $(this).data('bw', data);
2781          if (data.start.x != 0 && data.start.y != 0) {
2782            data.vdiff = data.start.x - data.end.x;
2783            data.hdiff = data.end.y - data.start.y;
2784            if (Math.abs(data.vdiff) == data.start.x && Math.abs(data.hdiff) == data.start.y) {
2785              data.vdiff = 0;
2786              data.hdiff = 0;
2787            }
2788            var length = Math.round(Math.sqrt(Math.pow(data.vdiff,2) + Math.pow(data.hdiff,2)));
2789            var rads = Math.atan2(data.hdiff, data.vdiff);
2790            var angle = Math.round(rads*180/Math.PI);
2791            if (angle < 0) { angle = 360 - Math.abs(angle); }
2792            if (length > H_THRESHOLD && V_THRESHOLD > data.hdiff) {
2793              e.preventDefault();
2794              if (angle > 135 && angle < 225) {
2795                var cyopt = $slider.data('cycle.opts');
2796                if (cyopt.currSlide > 0) {
2797                  $slider.cycle((cyopt.currSlide - 1), 'scrollRight');
2798                }
2799                else {
2800                   $slider.cycle((cyopt.slideCount - 1), 'scrollRight');
2801                }
2802              }
2803              else if (angle > 315 || angle < 45) {
2804                $slider.cycle('next');
2805              }
2806            }
2807          }
2808          data = $.extend(true, {}, optsReset);
2809        });
2810      }
2811    }
2812  };
2813
2814  Drupal.viewsSlideshowCycle = Drupal.viewsSlideshowCycle || {};
2815
2816  // Cleanup the values of advanced options.
2817  Drupal.viewsSlideshowCycle.advancedOptionCleanup = function(value) {
2818    value = $.trim(value);
2819    value = value.replace(/\n/g, '');
2820    if (value.match(/^[\d.]+%$/)) {
2821      // noop
2822    }
2823    else if (!isNaN(parseInt(value))) {
2824      value = parseInt(value);
2825    }
2826    else if (value.toLowerCase() == 'true') {
2827      value = true;
2828    }
2829    else if (value.toLowerCase() == 'false') {
2830      value = false;
2831    }
2832
2833    return value;
2834  }
2835
2836  // This checks to see if all the images have been loaded.
2837  // If they have then it starts the slideshow.
2838  Drupal.viewsSlideshowCycle.imageWait = function(fullId) {
2839    if (++Drupal.settings.viewsSlideshowCycle[fullId].loadedImages == Drupal.settings.viewsSlideshowCycle[fullId].totalImages) {
2840      Drupal.viewsSlideshowCycle.load(fullId);
2841    }
2842  };
2843
2844  // Start the slideshow.
2845  Drupal.viewsSlideshowCycle.load = function (fullId) {
2846    var settings = Drupal.settings.viewsSlideshowCycle[fullId];
2847
2848    // Make sure the slideshow isn't already loaded.
2849    if (!settings.loaded) {
2850      $(settings.targetId).cycle(settings.opts);
2851      $(settings.targetId).parent().parent().addClass('views-slideshow-cycle-processed');
2852      settings.loaded = true;
2853
2854      // Start Paused
2855      if (settings.start_paused) {
2856        Drupal.viewsSlideshow.action({ "action": 'pause', "slideshowID": settings.slideshowId, "force": true });
2857      }
2858
2859      // Pause if hidden.
2860      if (settings.pause_when_hidden) {
2861        var checkPause = function(settings) {
2862          // If the slideshow is visible and it is paused then resume.
2863          // otherwise if the slideshow is not visible and it is not paused then
2864          // pause it.
2865          var visible = viewsSlideshowCycleIsVisible(settings.targetId, settings.pause_when_hidden_type, settings.amount_allowed_visible);
2866          if (visible) {
2867            Drupal.viewsSlideshow.action({ "action": 'play', "slideshowID": settings.slideshowId });
2868          }
2869          else {
2870            Drupal.viewsSlideshow.action({ "action": 'pause', "slideshowID": settings.slideshowId });
2871          }
2872        }
2873
2874        // Check when scrolled.
2875        $(window).scroll(function() {
2876         checkPause(settings);
2877        });
2878
2879        // Check when the window is resized.
2880        $(window).resize(function() {
2881          checkPause(settings);
2882        });
2883      }
2884    }
2885  };
2886
2887  Drupal.viewsSlideshowCycle.pause = function (options) {
2888    //Eat TypeError, cycle doesn't handle pause well if options isn't defined.
2889    try{
2890      if (options.pause_in_middle && $.fn.pause) {
2891        $('#views_slideshow_cycle_teaser_section_' + options.slideshowID).pause();
2892      }
2893      else {
2894        $('#views_slideshow_cycle_teaser_section_' + options.slideshowID).cycle('pause');
2895      }
2896    }
2897    catch(e){
2898      if(!e instanceof TypeError){
2899        throw e;
2900      }
2901    }
2902  };
2903
2904  Drupal.viewsSlideshowCycle.play = function (options) {
2905    Drupal.settings.viewsSlideshowCycle['#views_slideshow_cycle_main_' + options.slideshowID].paused = false;
2906    if (options.pause_in_middle && $.fn.resume) {
2907      $('#views_slideshow_cycle_teaser_section_' + options.slideshowID).resume();
2908    }
2909    else {
2910      $('#views_slideshow_cycle_teaser_section_' + options.slideshowID).cycle('resume');
2911    }
2912  };
2913
2914  Drupal.viewsSlideshowCycle.previousSlide = function (options) {
2915    $('#views_slideshow_cycle_teaser_section_' + options.slideshowID).cycle('prev');
2916  };
2917
2918  Drupal.viewsSlideshowCycle.nextSlide = function (options) {
2919    $('#views_slideshow_cycle_teaser_section_' + options.slideshowID).cycle('next');
2920  };
2921
2922  Drupal.viewsSlideshowCycle.goToSlide = function (options) {
2923    $('#views_slideshow_cycle_teaser_section_' + options.slideshowID).cycle(options.slideNum);
2924  };
2925
2926  // Verify that the value is a number.
2927  function IsNumeric(sText) {
2928    var ValidChars = "0123456789";
2929    var IsNumber=true;
2930    var Char;
2931
2932    for (var i=0; i < sText.length && IsNumber == true; i++) {
2933      Char = sText.charAt(i);
2934      if (ValidChars.indexOf(Char) == -1) {
2935        IsNumber = false;
2936      }
2937    }
2938    return IsNumber;
2939  }
2940
2941  /**
2942   * Cookie Handling Functions
2943   */
2944  function createCookie(name,value,days) {
2945    if (days) {
2946      var date = new Date();
2947      date.setTime(date.getTime()+(days*24*60*60*1000));
2948      var expires = "; expires="+date.toGMTString();
2949    }
2950    else {
2951      var expires = "";
2952    }
2953    document.cookie = name+"="+value+expires+"; path=/";
2954  }
2955
2956  function readCookie(name) {
2957    var nameEQ = name + "=";
2958    var ca = document.cookie.split(';');
2959    for(var i=0;i < ca.length;i++) {
2960      var c = ca[i];
2961      while (c.charAt(0)==' ') c = c.substring(1,c.length);
2962      if (c.indexOf(nameEQ) == 0) {
2963        return c.substring(nameEQ.length,c.length);
2964      }
2965    }
2966    return null;
2967  }
2968
2969  function eraseCookie(name) {
2970    createCookie(name,"",-1);
2971  }
2972
2973  /**
2974   * Checks to see if the slide is visible enough.
2975   * elem = element to check.
2976   * type = The way to calculate how much is visible.
2977   * amountVisible = amount that should be visible. Either in percent or px. If
2978   *                it's not defined then all of the slide must be visible.
2979   *
2980   * Returns true or false
2981   */
2982  function viewsSlideshowCycleIsVisible(elem, type, amountVisible) {
2983    // Get the top and bottom of the window;
2984    var docViewTop = $(window).scrollTop();
2985    var docViewBottom = docViewTop + $(window).height();
2986    var docViewLeft = $(window).scrollLeft();
2987    var docViewRight = docViewLeft + $(window).width();
2988
2989    // Get the top, bottom, and height of the slide;
2990    var elemTop = $(elem).offset().top;
2991    var elemHeight = $(elem).height();
2992    var elemBottom = elemTop + elemHeight;
2993    var elemLeft = $(elem).offset().left;
2994    var elemWidth = $(elem).width();
2995    var elemRight = elemLeft + elemWidth;
2996    var elemArea = elemHeight * elemWidth;
2997
2998    // Calculate what's hiding in the slide.
2999    var missingLeft = 0;
3000    var missingRight = 0;
3001    var missingTop = 0;
3002    var missingBottom = 0;
3003
3004    // Find out how much of the slide is missing from the left.
3005    if (elemLeft < docViewLeft) {
3006      missingLeft = docViewLeft - elemLeft;
3007    }
3008
3009    // Find out how much of the slide is missing from the right.
3010    if (elemRight > docViewRight) {
3011      missingRight = elemRight - docViewRight;
3012    }
3013
3014    // Find out how much of the slide is missing from the top.
3015    if (elemTop < docViewTop) {
3016      missingTop = docViewTop - elemTop;
3017    }
3018
3019    // Find out how much of the slide is missing from the bottom.
3020    if (elemBottom > docViewBottom) {
3021      missingBottom = elemBottom - docViewBottom;
3022    }
3023
3024    // If there is no amountVisible defined then check to see if the whole slide
3025    // is visible.
3026    if (type == 'full') {
3027      return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom)
3028      && (elemBottom <= docViewBottom) &&  (elemTop >= docViewTop)
3029      && (elemLeft >= docViewLeft) && (elemRight <= docViewRight)
3030      && (elemLeft <= docViewRight) && (elemRight >= docViewLeft));
3031    }
3032    else if(type == 'vertical') {
3033      var verticalShowing = elemHeight - missingTop - missingBottom;
3034
3035      // If user specified a percentage then find out if the current shown percent
3036      // is larger than the allowed percent.
3037      // Otherwise check to see if the amount of px shown is larger than the
3038      // allotted amount.
3039      if (typeof amountVisible === 'string' && amountVisible.indexOf('%')) {
3040        return (((verticalShowing/elemHeight)*100) >= parseInt(amountVisible));
3041      }
3042      else {
3043        return (verticalShowing >= parseInt(amountVisible));
3044      }
3045    }
3046    else if(type == 'horizontal') {
3047      var horizontalShowing = elemWidth - missingLeft - missingRight;
3048
3049      // If user specified a percentage then find out if the current shown percent
3050      // is larger than the allowed percent.
3051      // Otherwise check to see if the amount of px shown is larger than the
3052      // allotted amount.
3053      if (typeof amountVisible === 'string' && amountVisible.indexOf('%')) {
3054        return (((horizontalShowing/elemWidth)*100) >= parseInt(amountVisible));
3055      }
3056      else {
3057        return (horizontalShowing >= parseInt(amountVisible));
3058      }
3059    }
3060    else if(type == 'area') {
3061      var areaShowing = (elemWidth - missingLeft - missingRight) * (elemHeight - missingTop - missingBottom);
3062
3063      // If user specified a percentage then find out if the current shown percent
3064      // is larger than the allowed percent.
3065      // Otherwise check to see if the amount of px shown is larger than the
3066      // allotted amount.
3067      if (typeof amountVisible === 'string' && amountVisible.indexOf('%')) {
3068        return (((areaShowing/elemArea)*100) >= parseInt(amountVisible));
3069      }
3070      else {
3071        return (areaShowing >= parseInt(amountVisible));
3072      }
3073    }
3074  }
3075})(jQuery);
3076;
3077(function ($) {
3078
3079/**
3080 * Toggle the visibility of a fieldset using smooth animations.
3081 */
3082Drupal.toggleFieldset = function (fieldset) {
3083  var $fieldset = $(fieldset);
3084  if ($fieldset.is('.collapsed')) {
3085    var $content = $('> .fieldset-wrapper', fieldset).hide();
3086    $fieldset
3087      .removeClass('collapsed')
3088      .trigger({ type: 'collapsed', value: false })
3089      .find('> legend span.fieldset-legend-prefix').html(Drupal.t('Hide'));
3090    $content.slideDown({
3091      duration: 'fast',
3092      easing: 'linear',
3093      complete: function () {
3094        Drupal.collapseScrollIntoView(fieldset);
3095        fieldset.animating = false;
3096      },
3097      step: function () {
3098        // Scroll the fieldset into view.
3099        Drupal.collapseScrollIntoView(fieldset);
3100      }
3101    });
3102  }
3103  else {
3104    $fieldset.trigger({ type: 'collapsed', value: true });
3105    $('> .fieldset-wrapper', fieldset).slideUp('fast', function () {
3106      $fieldset
3107        .addClass('collapsed')
3108        .find('> legend span.fieldset-legend-prefix').html(Drupal.t('Show'));
3109      fieldset.animating = false;
3110    });
3111  }
3112};
3113
3114/**
3115 * Scroll a given fieldset into view as much as possible.
3116 */
3117Drupal.collapseScrollIntoView = function (node) {
3118  var h = document.documentElement.clientHeight || document.body.clientHeight || 0;
3119  var offset = document.documentElement.scrollTop || document.body.scrollTop || 0;
3120  var posY = $(node).offset().top;
3121  var fudge = 55;
3122  if (posY + node.offsetHeight + fudge > h + offset) {
3123    if (node.offsetHeight > h) {
3124      window.scrollTo(0, posY);
3125    }
3126    else {
3127      window.scrollTo(0, posY + node.offsetHeight - h + fudge);
3128    }
3129  }
3130};
3131
3132Drupal.behaviors.collapse = {
3133  attach: function (context, settings) {
3134    $('fieldset.collapsible', context).once('collapse', function () {
3135      var $fieldset = $(this);
3136      // Expand fieldset if there are errors inside, or if it contains an
3137      // element that is targeted by the URI fragment identifier.
3138      var anchor = location.hash && location.hash != '#' ? ', ' + location.hash : '';
3139      if ($fieldset.find('.error' + anchor).length) {
3140        $fieldset.removeClass('collapsed');
3141      }
3142
3143      var summary = $('<span class="summary"></span>');
3144      $fieldset.
3145        bind('summaryUpdated', function () {
3146          var text = $.trim($fieldset.drupalGetSummary());
3147          summary.html(text ? ' (' + text + ')' : '');
3148        })
3149        .trigger('summaryUpdated');
3150
3151      // Turn the legend into a clickable link, but retain span.fieldset-legend
3152      // for CSS positioning.
3153      var $legend = $('> legend .fieldset-legend', this);
3154
3155      $('<span class="fieldset-legend-prefix element-invisible"></span>')
3156        .append($fieldset.hasClass('collapsed') ? Drupal.t('Show') : Drupal.t('Hide'))
3157        .prependTo($legend)
3158        .after(' ');
3159
3160      // .wrapInner() does not retain bound events.
3161      var $link = $('<a class="fieldset-title" href="#"></a>')
3162        .prepend($legend.contents())
3163        .appendTo($legend)
3164        .click(function () {
3165          var fieldset = $fieldset.get(0);
3166          // Don't animate multiple times.
3167          if (!fieldset.animating) {
3168            fieldset.animating = true;
3169            Drupal.toggleFieldset(fieldset);
3170          }
3171          return false;
3172        });
3173
3174      $legend.append(summary);
3175    });
3176  }
3177};
3178
3179})(jQuery);
3180;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.