PageSourceSearch

https://arapacis.it/sites/default/files/js/js_wVa5Fb4ige0r9qANmEqs_T_VMDSXcuVVnVeK_xLU1Wc.js

js arapacis.it collected 2026-10-02 06:06:58 UTC 230,862 bytes, 4,494 lines download raw bytes

1Drupal.locale = { 'pluralFormula': function ($n) { return Number(($n!=1)); }, 'strings': {"":{"An AJAX HTTP error occurred.":"Si \u00e8 verificato un errore HTTP in AJAX.","HTTP Result Code: !status":"Codice HTTP di risposta: !status","An AJAX HTTP request terminated abnormally.":"Una richiesta AJAX HTTP \u00e8 terminata in modo anomalo.","Debugging information follows.":"Di seguito le informazioni di debug.","Path: !uri":"Percorso: !uri","StatusText: !statusText":"StatusText: !statusText","ResponseText: !responseText":"ResponseText: !responseText","ReadyState: !readyState":"ReadyState: !readyState","CustomMessage: !customMessage":"Messaggio personalizzato: !customMessage","Next":"Seguente","Disabled":"Disattivato","Enabled":"Attivato","Edit":"Modifica","Sunday":"Domenica","Monday":"Luned\u00ec","Tuesday":"Marted\u00ec","Wednesday":"Mercoled\u00ec","Thursday":"Gioved\u00ec","Friday":"Venerd\u00ec","Saturday":"Sabato","Add":"Aggiungi","View":"Visualizza","Upload":"Carica","Configure":"Configura","All":"Tutti","Done":"Fatto","This field is required.":"Questo campo \u00e8 obbligatorio.","Prev":"Precedente","Mon":"Lun","Tue":"Mar","Wed":"Mer","Thu":"Gio","Fri":"Ven","Sat":"Sab","Sun":"Dom","January":"Gennaio","February":"Febbraio","March":"Marzo","April":"Aprile","May":"Mag","June":"Giugno","July":"Luglio","August":"Agosto","September":"Settembre","October":"Ottobre","November":"Novembre","December":"Dicembre","Show":"Mostra","Select all rows in this table":"Seleziona tutte le righe in questa tabella","Deselect all rows in this table":"Deseleziona tutte le righe in questa tabella","Today":"Oggi","Jan":"Gen","Feb":"Feb","Mar":"Mar","Apr":"Apr","Jun":"Giu","Jul":"Lug","Aug":"Ago","Sep":"Set","Oct":"Ott","Nov":"Nov","Dec":"Dic","Su":"Do","Mo":"Lu","Tu":"Ma","We":"Me","Th":"Gi","Fr":"Ve","Sa":"Sa","Not published":"Non pubblicato","Please wait...":"Attendere prego...","Hide":"Nascondi","Loading":"Caricamento","mm\/dd\/yy":"mm\/gg\/aa","Only files with the following extensions are allowed: %files-allowed.":"Sono consentiti solo i file con le seguenti estensioni: %files-allowed.","By @name on @date":"Da @name il @date","By @name":"Da @name","Not in menu":"Non nel menu","Alias: @alias":"Alias: @alias","No alias":"Nessun alias","New revision":"Nuova revisione","Drag to re-order":"Trascina per riordinare","Changes made in this table will not be saved until the form is submitted.":"I cambiamenti fatti a questa tabella non saranno salvati finch\u00e8 il form non viene inviato.","The changes to these blocks will not be saved until the \u003Cem\u003ESave blocks\u003C\/em\u003E button is clicked.":"I cambiamenti a questi blocchi non saranno salvati finch\u00e9 il bottone \u003Cem\u003ESalva blocchi\u003C\/em\u003E \u00e8 cliccato.","Flag translations as outdated":"Segna traduzioni come obsolete","Show shortcuts":"Mostra scorciatoie","This permission is inherited from the authenticated user role.":"Questo permesso viene ereditato dal ruolo utente autenticato.","No revision":"Nessuna revisione","@number comments per page":"@number commenti per pagina","Requires a title":"Richiede un titolo","Not restricted":"Non limitato","(active tab)":"(scheda attiva)","Not customizable":"Non personalizzabile","Restricted to certain pages":"Limitato a certe pagine","The block cannot be placed in this region.":"Il blocco non pu\u00f2 essere posizionato in questa regione.","Customize dashboard":"Personalizza la dashboard","Hide summary":"Nascondi sommario","Edit summary":"Modifica sommario","Don\u0027t display post information":"Non mostrare le informazioni di pubblicazione","@title dialog":"Finestra di dialogo @title","The selected file %filename cannot be uploaded. Only files with the following extensions are allowed: %extensions.":"Il file selezionato %filename non pu\u00f2 essere caricato. Sono consentiti solo file con le seguenti estensioni: %extensions.","Re-order rows by numerical weight instead of dragging.":"Riordina le righe utilizzando il peso numerico invece del trascinamento.","Show row weights":"Visualizza i pesi delle righe","Hide row weights":"Nascondi i pesi delle righe","Autocomplete popup":"Popup di autocompletamento","Searching for matches...":"Ricerca in corso...","Hide shortcuts":"Nascondi scorciatoie","The response failed verification so will not be processed.":"La risposta non ha superato la verifica, quindi non verr\u00e0 elaborata.","The callback URL is not local and n
1ot trusted: !url":"L\u0027URL di callback non \u00e8 locale o non \u00e8 affidabile: !url","No results":"Nessun risultato","Read more":"Leggi tutto","The content of this section has been blocked for compliance with EU cookie regulation.":"Il contenuto di questa sezione \u00e8 stato bloccato per conformit\u00e0 con la normativa UE sui cookie.","To view the frame you need accept youtube cookies":"Per visualizzare il frame \u00e8 necessario accettare i cookie di youtube","To view the Video content you must accept YouTube cookies by clicking on the Privacy banner at the bottom of the page.":"Per visualizzare i contenuti video \u00e8 necessario accettare i cookie di YouTube cliccando sul banner Privacy in fondo pagina","To view this content you must accept the cookies. Click here or on the Cookie Preferences banner at the bottom and accept the video\/social cookies.":"Per visualizzare questo contenuto \u00e8 necessario accettare i cookie. Clicca qui o sul banner in fondo Preferenze Cookie e accetta i cookie video\/social."}} };;
2/*
3 * jQuery FlexSlider v1.8
4 * http://www.woothemes.com/flexslider/
5 *
6 * Copyright 2012 WooThemes
7 * Free to use under the MIT license.
8 * http://www.opensource.org/licenses/mit-license.php
9 *
10 * Contributing Author: Tyler Smith
11 */
12(function(a){a.flexslider=function(c,b){var d=a(c);a.data(c,"flexslider",d);d.init=function(){d.vars=a.extend({},a.flexslider.defaults,b);a.data(c,"flexsliderInit",true);d.container=a(".slides",d).first();d.slides=a(".slides:first > li",d);d.count=d.slides.length;d.animating=false;d.currentSlide=d.vars.slideToStart;d.animatingTo=d.currentSlide;d.atEnd=(d.currentSlide==0)?true:false;d.eventType=("ontouchstart" in document.documentElement)?"touchstart":"click";d.cloneCount=0;d.cloneOffset=0;d.manualPause=false;d.vertical=(d.vars.slideDirection=="vertical");d.prop=(d.vertical)?"top":"marginLeft";d.args={};d.transitions="webkitTransition" in document.body.style;if(d.transitions){d.prop="-webkit-transform"}if(d.vars.controlsContainer!=""){d.controlsContainer=a(d.vars.controlsContainer).eq(a(".slides").index(d.container));d.containerExists=d.controlsContainer.length>0}if(d.vars.manualControls!=""){d.manualControls=a(d.vars.manualControls,((d.containerExists)?d.
12controlsContainer:d));d.manualExists=d.manualControls.length>0}if(d.vars.randomize){d.slides.sort(function(){return(Math.round(Math.random())-0.5)});d.container.empty().append(d.slides)}if(d.vars.animation.toLowerCase()=="slide"){if(d.transitions){d.setTransition(0)}d.css({overflow:"hidden"});if(d.vars.animationLoop){d.cloneCount=2;d.cloneOffset=1;d.container.append(d.slides.filter(":first").clone().addClass("clone")).prepend(d.slides.filter(":last").clone().addClass("clone"))}d.newSlides=a(".slides:first > li",d);var m=(-1*(d.currentSlide+d.cloneOffset));if(d.vertical){d.newSlides.css({display:"block",width:"100%","float":"left"});d.container.height((d.count+d.cloneCount)*200+"%").css("position","absolute").width("100%");setTimeout(function(){d.css({position:"relative"}).height(d.slides.filter(":first").height());d.args[d.prop]=(d.transitions)?"translate3d(0,"+m*d.height()+"px,0)":m*d.height()+"px";d.container.css(d.args)},100)}else{d.args[d.prop]=(d.transitions)?"translate3d("+m*d.width()+"px,0,0)":m*d.width()+"px";d.container.width((d.count+d.cloneCount)*200+"%").css(d.args);setTimeout(function(){d.newSlides.width(d.width()).css({"float":"left",display:"block"})},100)}}else{d.transitions=false;d.slides.css({width:"100%","float":"left",marginRight:"-100%"}).eq(d.currentSlide).fadeIn(d.vars.animationDuration)}if(d.vars.controlNav){if(d.manualExists){d.controlNav=d.manualControls}else{var e=a('<ol class="flex-control-nav"></ol>');var s=1;for(var t=0;t<d.count;t++){e.append("<li><a>"+s+"</a></li>");s++}if(d.containerExists){a(d.controlsContainer).append(e);d.controlNav=a(".flex-control-nav li a",d.controlsContainer)}else{d.append(e);d.controlNav=a(".flex-control-nav li a",d)}}d.controlNav.eq(d.currentSlide).addClass("active");d.controlNav.bind(d.eventType,function(i){i.preventDefault();if(!a(this).hasClass("active")){(d.controlNav.index(a(this))>d.currentSlide)?d.direction="next":d.direction="prev";d.flexAnimate(d.controlNav.index(a(this)),d.vars.pauseOnAction)}})}if(d.vars.directionNav){var v=a('<ul class="flex-direction-nav"><li><a class="prev" href="#">'+d.vars.prevText+'</a></li><li><a class="next" href="#">'+d.vars.nextText+"</a></li></ul>");if(d.containerExists){a(d.controlsContainer).append(v);d.directionNav=a(".flex-direction-nav li a",d.controlsContainer)}else{d.append(v);d.directionNav=a(".flex-direction-nav li a",d)}if(!d.vars.animationLoop){if(d.currentSlide==0){d.directionNav.filter(".prev").addClass("disabled")}else{if(d.currentSlide==d.count-1){d.directionNav.filter(".next").addClass("disabled")}}}d.directionNav.bind(d.eventType,function(i){i.preventDefault();var j=(a(this).hasClass("next"))?d.getTarget("next"):d.getTarget("prev");if(d.canAdvance(j)){d.flexAnimate(j,d.vars.pauseOnAction)}})}if(d.vars.keyboardNav&&a("ul.slides").length==1){function h(i){if(d.animating){return}else{if(i.keyCode!=39&&i.keyCode!=37){return}else{if(i.keyCode==39){var j=d.getTarget("next")}else{if(i.keyCode==37){var j=d.getTarget("prev")}}if(d.canAdvance(j)){d.flexAnimate(j,d.vars.pauseOnAction)}}}}a(document).bind("keyup",h)}if(d.vars.mousewheel){d.mousewheelEvent=(/Firefox/i.test(navigator.userAgent))?"DOMMouseScroll":"mousewheel";d.bind(d.mousewheelEvent,function(y){y.preventDefault();y=y?y:window.event;var i=y.detail?y.detail*-1:y.originalEvent.wheelDelta/40,j=(i<0)?d.getTarget("next"):d.getTarget("prev");if(d.canAdvance(j)){d.flexAnimate(j,d.vars.pauseOnAction)}})}if(d.vars.slideshow){if(d.vars.pauseOnHover&&d.vars.slideshow){d.hover(function(){d.pause()},function(){if(!d.manualPause){d.resume()}})}d.animatedSlides=setInterval(d.animateSlides,d.vars.slideshowSpeed)}if(d.vars.pausePlay){var q=a('<div class="flex-pauseplay"><span></span></div>');if(d.containerExists){d.controlsContainer.append(q);d.pausePlay=a(".flex-pauseplay span",d.controlsContainer)}else{d.append(q);d.pausePlay=a(".flex-pauseplay span",d)}var n=(d.vars.slideshow)?"pause":"play";d.pausePlay.addClass(n).text((n=="pause")?d.vars.pauseText:d.vars.playText);d.pausePlay.bind(d.eventType,function(i){i.preventDefault();if(a(this).hasClass("pause")){d.pause();d.manualPause=true}else{d.resume();d.manualPause=false}})}if("ontouchstart" in document.documentElement){var w,u,l,r,o,x,p=false;d.each(function(){if("ontouchstart" in document.documentElement){this.addEventListener("touchstart",g,false)}});function g(i){if(d.animating){i.preventDefault()}else{if(i.touches.length==1){d.pause();r=(d.vertical)?d.height():d.width();x=Number(new Date());l=(d.vertical)?(d.currentSlide+d.cloneOffset)*d.height():(d.currentSlide+d.cloneOffset)*d.width();w=(d.vertical)?i.touches[0].pageY:i.touches[0].pageX;u=(d.vertical)?i.touches[0].pageX:i.touches[0].pageY;d.setTransition(0);this.addEventListener("touchmove",k,false);this.addEventListener("touchend",f,false)}}}function k(i){o=(d.vertical)?w-i.touches[0].pageY:w-i.touches[0].pageX;p=(d.vertical)?(Math.abs(o)<Math.abs(i.touches[0].pageX-u)):(Math.abs(o)<Math.abs(i.touches[0].pageY-u));if(!p){i.preventDefault();if(d.vars.animation=="slide"&&d.transitions){if(!d.vars.animationLoop){o=o/((d.currentSlide==0&&o<0||d.currentSlide==d.count-1&&o>0)?(Math.abs(o)/r+2):1)}d.args[d.prop]=(d.vertical)?"translate3d(0,"+(-l-o)+"px,0)":"translate3d("+(-l-o)+"px,0,0)";d.container.css(d.args)}}}function f(j){d.animating=false;
12if(d.animatingTo==d.currentSlide&&!p&&!(o==null)){var i=(o>0)?d.getTarget("next"):d.getTarget("prev");if(d.canAdvance(i)&&Number(new Date())-x<550&&Math.abs(o)>20||Math.abs(o)>r/2){d.flexAnimate(i,d.vars.pauseOnAction)}else{d.flexAnimate(d.currentSlide,d.vars.pauseOnAction)}}this.removeEventListener("touchmove",k,false);this.removeEventListener("touchend",f,false);w=null;u=null;o=null;l=null}}if(d.vars.animation.toLowerCase()=="slide"){a(window).resize(function(){if(!d.animating&&d.is(":visible")){if(d.vertical){d.height(d.slides.filter(":first").height());d.args[d.prop]=(-1*(d.currentSlide+d.cloneOffset))*d.slides.filter(":first").height()+"px";if(d.transitions){d.setTransition(0);d.args[d.prop]=(d.vertical)?"translate3d(0,"+d.args[d.prop]+",0)":"translate3d("+d.args[d.prop]+",0,0)"}d.container.css(d.args)}else{d.newSlides.width(d.width());d.args[d.prop]=(-1*(d.currentSlide+d.cloneOffset))*d.width()+"px";if(d.transitions){d.setTransition(0);d.args[d.prop]=(d.vertical)?"translate3d(0,"+d.args[d.prop]+",0)":"translate3d("+d.args[d.prop]+",0,0)"}d.container.css(d.args)}}})}d.vars.start(d)};d.flexAnimate=function(g,f){if(!d.animating&&d.is(":visible")){d.animating=true;d.animatingTo=g;d.vars.before(d);if(f){d.pause()}if(d.vars.controlNav){d.controlNav.removeClass("active").eq(g).addClass("active")}d.atEnd=(g==0||g==d.count-1)?true:false;if(!d.vars.animationLoop&&d.vars.directionNav){if(g==0){d.directionNav.removeClass("disabled").filter(".prev").addClass("disabled")}else{if(g==d.count-1){d.directionNav.removeClass("disabled").filter(".next").addClass("disabled")}else{d.directionNav.removeClass("disabled")}}}if(!d.vars.animationLoop&&g==d.count-1){d.pause();d.vars.end(d)}if(d.vars.animation.toLowerCase()=="slide"){var e=(d.vertical)?d.slides.filter(":first").height():d.slides.filter(":first").width();if(d.currentSlide==0&&g==d.count-1&&d.vars.animationLoop&&d.direction!="next"){d.slideString="0px"}else{if(d.currentSlide==d.count-1&&g==0&&d.vars.animationLoop&&d.direction!="prev"){d.slideString=(-1*(d.count+1))*e+"px"}else{d.slideString=(-1*(g+d.cloneOffset))*e+"px"}}d.args[d.prop]=d.slideString;if(d.transitions){d.setTransition(d.vars.animationDuration);d.args[d.prop]=(d.vertical)?"translate3d(0,"+d.slideString+",0)":"translate3d("+d.slideString+",0,0)";d.container.css(d.args).one("webkitTransitionEnd transitionend",function(){d.wrapup(e)})}else{d.container.animate(d.args,d.vars.animationDuration,function(){d.wrapup(e)})}}else{d.slides.eq(d.currentSlide).fadeOut(d.vars.animationDuration);d.slides.eq(g).fadeIn(d.vars.animationDuration,function(){d.wrapup()})}}};d.wrapup=function(e){if(d.vars.animation=="slide"){if(d.currentSlide==0&&d.animatingTo==d.count-1&&d.vars.animationLoop){d.args[d.prop]=(-1*d.count)*e+"px";if(d.transitions){d.setTransition(0);d.args[d.prop]=(d.vertical)?"translate3d(0,"+d.args[d.prop]+",0)":"translate3d("+d.args[d.prop]+",0,0)"}d.container.css(d.args)}else{if(d.currentSlide==d.count-1&&d.animatingTo==0&&d.vars.animationLoop){d.args[d.prop]=-1*e+"px";if(d.transitions){d.setTransition(0);d.args[d.prop]=(d.vertical)?"translate3d(0,"+d.args[d.prop]+",0)":"translate3d("+d.args[d.prop]+",0,0)"}d.container.css(d.args)}}}d.animating=false;d.currentSlide=d.animatingTo;d.vars.after(d)};d.animateSlides=function(){if(!d.animating){d.flexAnimate(d.getTarget("next"))}};d.pause=function(){clearInterval(d.animatedSlides);if(d.vars.pausePlay){d.pausePlay.removeClass("pause").addClass("play").text(d.vars.playText)}};d.resume=function(){d.animatedSlides=setInterval(d.animateSlides,d.vars.slideshowSpeed);if(d.vars.pausePlay){d.pausePlay.removeClass("play").addClass("pause").text(d.vars.pauseText)}};d.canAdvance=function(e){if(!d.vars.animationLoop&&d.atEnd){if(d.currentSlide==0&&e==d.count-1&&d.direction!="next"){return false}else{if(d.currentSlide==d.count-1&&e==0&&d.direction=="next"){return false}else{return true}}}else{return true}};d.getTarget=function(e){d.direction=e;if(e=="next"){return(d.currentSlide==d.count-1)?0:d.currentSlide+1}else{return(d.currentSlide==0)?d.count-1:d.currentSlide-1}};d.setTransition=function(e){d.container.css({"-webkit-transition-duration":(e/1000)+"s"})};d.init()};a.flexslider.defaults={animation:"fade",slideDirection:"horizontal",slideshow:true,slideshowSpeed:7000,animationDuration:600,directionNav:true,controlNav:true,keyboardNav:true,mousewheel:false,prevText:"Previous",nextText:"Next",pausePlay:false,pauseText:"Pause",playText:"Play",randomize:false,slideToStart:0,animationLoop:true,pauseOnAction:true,pauseOnHover:false,controlsContainer:"",manualControls:"",start:function(){},before:function(){},after:function(){},end:function(){}};a.fn.flexslider=function(b){return this.each(function(){if(a(this).find(".slides li").length==1){a(this).find(".slides li").fadeIn(400)}else{if(a(this).data("flexsliderInit")!=true){new a.flexslider(this,b)}}})}})(jQuery);;
13jQuery(document).ready(function() {
14
15  jQuery('.flexslider').flexslider({
16    controlNav: true,               //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
17    directionNav: false 
18  }); 
19
20});;
vendor: 11,960 bytes, lines 21-26
21/*!
22	Colorbox 1.6.4
23	license: MIT
24	http://www.jacklmoore.com/colorbox
25*/
26(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,605 bytes, lines 26-28
26;
27/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */
28!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){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];return e.apply(t,o)}),s||(s=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return new e(...n)});const u=D(Array.prototype.forEach),m=D(Array.prototype.lastIndexOf),p=D(Array.prototype.pop),f=D(Array.prototype.push),d=D(Array.prototype.splice),h=D(String.prototype.toLowerCase),g=D(String.prototype.toString),T=D(String.prototype.match),y=D(String.prototype.replace),E=D(String.prototype.indexOf),A=D(String.prototype.trim),_=D(Object.prototype.hasOwnProperty),b=D(RegExp.prototype.test),S=(N=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(N,t)});var N;function D(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);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 R(e,o){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;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 w(e){for(let t=0;t<e.length;t++){_(e,t)||(e[t]=null)}return e}function C(t){const n=l(null);for(const[o,r]of e(t)){_(t,o)&&(Array.isArray(r)?n[o]=w(r):r&&"object"==typeof r&&r.constructor===Object?n[o]=C(r):n[o]=r)}return n}function O(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return D(n.get);if("function"==typeof n.value)return D(n.value)}e=o(e)}return function(){return null}}const v=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","search","section","select","shadow","slot","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"]),k=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),x=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"]),L=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"]),I=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"]),M=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=i(["#text"]),z=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","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","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","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
28spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),P=i(["accent-height","accumulate","additive","alignment-baseline","amplitude","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","exponent","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","intercept","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","mask-type","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","slope","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","tablevalues","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"]),F=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"]),H=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),G=a(/<%[\w\W]*|[\w\W]*%>/gm),W=a(/\$\{[\w\W]*/gm),Y=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=a(/^(?:\w+script|data):/i),$=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:j,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:V,DATA_ATTR:Y,DOCTYPE_NAME:K,ERB_EXPR:G,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:B,TMPLIT_EXPR:W});const J=1,Q=3,ee=7,te=8,ne=9,oe=function(){return"undefined"==typeof window?null:window};var re=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe();const o=e=>t(e);if(o.version="3.3.3",o.removed=[],!n||!n.document||n.document.nodeType!==ne||!n.Element)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:N,Node:D,Element:w,NodeFilter:B,NamedNodeMap:G=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:W,DOMParser:Y,trustedTypes:j}=n,q=w.prototype,$=O(q,"cloneNode"),V=O(q,"remove"),re=O(q,"nextSibling"),ie=O(q,"childNodes"),ae=O(q,"parentNode");if("function"==typeof N){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let le,ce="";const{implementation:se,createNodeIterator:ue,createDocumentFragment:me,getElementsByTagName:pe}=r,{importNode:fe}=a;let de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof e&&"function"==typeof ae&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:he,ERB_EXPR:ge,TMPLIT_EXPR:Te,DATA_ATTR:ye,ARIA_ATTR:Ee,IS_SCRIPT_OR_DATA:Ae,ATTR_WHITESPACE:_e,CUSTOM_ELEMENT:be}=Z;let{IS_ALLOWED_URI:Se}=Z,Ne=null;const De=R({},[...v,...k,...x,...I,...U]);let Re=null;const we=R({},[...z,...P,...F,...H]);let Ce=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}})),Oe=null,ve=null;
vendor: 4,218 bytes, line 28
28const ke=Object.seal(l(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let xe=!0,Le=!0,Ie=!1,Me=!0,Ue=!1,ze=!0,Pe=!1,Fe=!1,He=!1,Be=!1,Ge=!1,We=!1,Ye=!0,je=!1,Xe=!0,qe=!1,$e={},Ke=null;const Ve=R({},["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 Ze=null;const Je=R({},["audio","video","img","source","image","track"]);let Qe=null;const et=R({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),tt="http://www.w3.org/1998/Math/MathML",nt="http://www.w3.org/2000/svg",ot="http://www.w3.org/1999/xhtml";let rt=ot,it=!1,at=null;const lt=R({},[tt,nt,ot],g);let ct=R({},["mi","mo","mn","ms","mtext"]),st=R({},["annotation-xml"]);const ut=R({},["title","style","font","a","script"]);let mt=null;const pt=["application/xhtml+xml","text/html"];let ft=null,dt=null;const ht=r.createElement("form"),gt=function(e){return e instanceof RegExp||e instanceof Function},Tt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!dt||dt!==e){if(e&&"object"==typeof e||(e={}),e=C(e),mt=-1===pt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,ft="application/xhtml+xml"===mt?g:h,Ne=_(e,"ALLOWED_TAGS")?R({},e.ALLOWED_TAGS,ft):De,Re=_(e,"ALLOWED_ATTR")?R({},e.ALLOWED_ATTR,ft):we,at=_(e,"ALLOWED_NAMESPACES")?R({},e.ALLOWED_NAMESPACES,g):lt,Qe=_(e,"ADD_URI_SAFE_ATTR")?R(C(et),e.ADD_URI_SAFE_ATTR,ft):et,Ze=_(e,"ADD_DATA_URI_TAGS")?R(C(Je),e.ADD_DATA_URI_TAGS,ft):Je,Ke=_(e,"FORBID_CONTENTS")?R({},e.FORBID_CONTENTS,ft):Ve,Oe=_(e,"FORBID_TAGS")?R({},e.FORBID_TAGS,ft):C({}),ve=_(e,"FORBID_ATTR")?R({},e.FORBID_ATTR,ft):C({}),$e=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,xe=!1!==e.ALLOW_ARIA_ATTR,Le=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ue=e.SAFE_FOR_TEMPLATES||!1,ze=!1!==e.SAFE_FOR_XML,Pe=e.WHOLE_DOCUMENT||!1,Be=e.RETURN_DOM||!1,Ge=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ye=!1!==e.SANITIZE_DOM,je=e.SANITIZE_NAMED_PROPS||!1,Xe=!1!==e.KEEP_CONTENT,qe=e.IN_PLACE||!1,Se=e.ALLOWED_URI_REGEXP||X,rt=e.NAMESPACE||ot,ct=e.MATHML_TEXT_INTEGRATION_POINTS||ct,st=e.HTML_INTEGRATION_POINTS||st,Ce=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&gt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ce.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&gt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ce.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ce.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ue&&(Le=!1),Ge&&(Be=!0),$e&&(Ne=R({},U),Re=l(null),!0===$e.html&&(R(Ne,v),R(Re,z)),!0===$e.svg&&(R(Ne,k),R(Re,P),R(Re,H)),!0===$e.svgFilters&&(R(Ne,x),R(Re,P),R(Re,H)),!0===$e.mathMl&&(R(Ne,I),R(Re,F),R(Re,H))),_(e,"ADD_TAGS")||(ke.tagCheck=null),_(e,"ADD_ATTR")||(ke.attributeCheck=null),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?ke.tagCheck=e.ADD_TAGS:(Ne===De&&(Ne=C(Ne)),R(Ne,e.ADD_TAGS,ft))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?ke.attributeCheck=e.ADD_ATTR:(Re===we&&(Re=C(Re)),R(Re,e.ADD_ATTR,ft))),e.ADD_URI_SAFE_ATTR&&R(Qe,e.ADD_URI_SAFE_ATTR,ft),e.FORBID_CONTENTS&&(Ke===Ve&&(Ke=C(Ke)),R(Ke,e.FORBID_CONTENTS,ft)),e.ADD_FORBID_CONTENTS&&(Ke===Ve&&(Ke=C(Ke)),R(Ke,e.ADD_FORBID_CONTENTS,ft)),Xe&&(Ne["#text"]=!0),Pe&&R(Ne,["html","head","body"]),Ne.table&&(R(Ne,["tbody"]),delete Oe.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');le=e.TRUSTED_TYPES_POLICY,ce=le.createHTML("")}else void 0===le&&(le=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;
vendor: 7,610 bytes, line 28
28const 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}}(j,c)),null!==le&&"string"==typeof ce&&(ce=le.createHTML(""));i&&i(e),dt=e}},yt=R({},[...k,...x,...L]),Et=R({},[...I,...M]),At=function(e){f(o.removed,{element:e});try{ae(e).removeChild(e)}catch(t){V(e)}},_t=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)if(Be||Ge)try{At(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},bt=function(e){let t=null,n=null;if(He)e="<remove></remove>"+e;else{const t=T(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===mt&&rt===ot&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=le?le.createHTML(e):e;if(rt===ot)try{t=(new Y).parseFromString(o,mt)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(rt,"template",null);try{t.documentElement.innerHTML=it?ce:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),rt===ot?pe.call(t,Pe?"html":"body")[0]:Pe?t.documentElement:i},St=function(e){return ue.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},Nt=function(e){return e instanceof W&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof G)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Dt=function(e){return"function"==typeof D&&e instanceof D};function Rt(e,t,n){u(e,(e=>{e.call(o,t,n,dt)}))}const wt=function(e){let t=null;if(Rt(de.beforeSanitizeElements,e,null),Nt(e))return At(e),!0;const n=ft(e.nodeName);if(Rt(de.uponSanitizeElement,e,{tagName:n,allowedTags:Ne}),ze&&e.hasChildNodes()&&!Dt(e.firstElementChild)&&b(/<[/\w!]/g,e.innerHTML)&&b(/<[/\w!]/g,e.textContent))return At(e),!0;if(e.nodeType===ee)return At(e),!0;if(ze&&e.nodeType===te&&b(/<[/\w]/g,e.data))return At(e),!0;if(!(ke.tagCheck instanceof Function&&ke.tagCheck(n))&&(!Ne[n]||Oe[n])){if(!Oe[n]&&Ot(n)){if(Ce.tagNameCheck instanceof RegExp&&b(Ce.tagNameCheck,n))return!1;if(Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(n))return!1}if(Xe&&!Ke[n]){const t=ae(e)||e.parentNode,n=ie(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=$(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,re(e))}}}return At(e),!0}return e instanceof w&&!function(e){let t=ae(e);t&&t.tagName||(t={namespaceURI:rt,tagName:"template"});const n=h(e.tagName),o=h(t.tagName);return!!at[e.namespaceURI]&&(e.namespaceURI===nt?t.namespaceURI===ot?"svg"===n:t.namespaceURI===tt?"svg"===n&&("annotation-xml"===o||ct[o]):Boolean(yt[n]):e.namespaceURI===tt?t.namespaceURI===ot?"math"===n:t.namespaceURI===nt?"math"===n&&st[o]:Boolean(Et[n]):e.namespaceURI===ot?!(t.namespaceURI===nt&&!st[o])&&!(t.namespaceURI===tt&&!ct[o])&&!Et[n]&&(ut[n]||!yt[n]):!("application/xhtml+xml"!==mt||!at[e.namespaceURI]))}(e)?(At(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ue&&e.nodeType===Q&&(t=e.textContent,u([he,ge,Te],(e=>{t=y(t,e," ")})),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),Rt(de.afterSanitizeElements,e,null),!1):(At(e),!0)},Ct=function(e,t,n){if(ve[t])return!1;if(Ye&&("id"===t||"name"===t)&&(n in r||n in ht))return!1;if(Le&&!ve[t]&&b(ye,t));else if(xe&&b(Ee,t));else if(ke.attributeCheck instanceof Function&&ke.attributeCheck(t,e));else if(!Re[t]||ve[t]){if(!(Ot(e)&&(Ce.tagNameCheck instanceof RegExp&&b(Ce.tagNameCheck,e)||Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(e))&&(Ce.attributeNameCheck instanceof RegExp&&b(Ce.attributeNameCheck,t)||Ce.attributeNameCheck instanceof Function&&Ce.attributeNameCheck(t,e))||"is"===t&&Ce.allowCustomizedBuiltInElements&&(Ce.tagNameCheck instanceof RegExp&&b(Ce.tagNameCheck,n)||Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(n))))return!1}else if(Qe[t]);else if(b(Se,y(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!Ze[e]){if(Ie&&!b(Ae,y(n,_e,"")));else if(n)return!1}else;return!0},Ot=function(e){return"annotation-xml"!==e&&T(e,be)},vt=function(e){Rt(de.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Nt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Re,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=ft(a),m=c;let f="value"===a?m:A(m);if(n.attrName=s,n.attrValue=f,n.keepAttr=!0,n.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,n),f=n.attrValue,!je||"id"!==s&&"name"!==s||(_t(a,e),f="user-content-"+f),ze&&b(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){_t(a,e);continue}if("attributename"===s&&T(f,"href")){_t(a,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){_t(a,e);continue}if(!Me&&b(/\/>/i,f)){_t(a,e);continue}Ue&&u([he,ge,Te],(e=>{f=y(f,e," ")}));const d=ft(e.nodeName);if(Ct(d,s,f)){if(le&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(d,s)){case"TrustedHTML":f=le.createHTML(f);break;case"TrustedScriptURL":f=le.createScriptURL(f)}if(f!==m)try{l?e.setAttributeNS(l,a,f):e.setAttribute(a,f),Nt(e)?At(e):p(o.removed)}catch(t){_t(a,e)}}else _t(a,e)}Rt(de.afterSanitizeAttributes,e,null)},kt=function e(t){let n=null;const o=St(t);for(Rt(de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)Rt(de.uponSanitizeShadowNode,n,null),wt(n),vt(n),n.content instanceof s&&e(n.content);Rt(de.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(it=!e,it&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Dt(e)){if("function"!=typeof e.toString)throw S("toString is not a function");if("string"!=typeof(e=e.toString()))throw S("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Fe||Tt(t),o.removed=[],"string"==typeof e&&(qe=!1),qe){if(e.nodeName){const t=ft(e.nodeName);if(!Ne[t]||Oe[t])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof D)n=bt("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===J&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!Be&&!Ue&&!Pe&&-1===e.indexOf("<"))return le&&We?le.createHTML(e):e;if(n=bt(e),!n)return Be?null:We?ce:""}n&&He&&At(n.firstChild);const c=St(qe?e:n);for(;i=c.nextNode();)wt(i),vt(i),i.content instanceof s&&kt(i.content);if(qe)return e;if(Be){if(Ge)for(l=me.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(Re.shadowroot||Re.shadowrootmode)&&(l=fe.call(a,l,!0)),l}let m=Pe?n.outerHTML:n.innerHTML;return Pe&&Ne["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&b(K,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),Ue&&u([he,ge,Te],(e=>{m=y(m,e," ")})),le&&We?le.createHTML(m):m},o.setConfig=function(){Tt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Fe=!0},o.clearConfig=function(){dt=null,Fe=!1},o.isValidAttribute=function(e,t,n){dt||Tt({});const o=ft(e),r=ft(t);return Ct(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&f(de[e],t)},o.removeHook=function(e,t){if(void 0!==t){const n=m(de[e],t);
28return-1===n?void 0:d(de[e],n,1)[0]}return p(de[e])},o.removeHooks=function(e){de[e]=[]},o.removeAllHooks=function(){de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();return re}));
29
30;
31/**
32 * @file
33 * Colorbox module init js.
34 */
35
36(function ($) {
37
38Drupal.behaviors.initColorbox = {
39  attach: function (context, settings) {
40    if (!$.isFunction($('a, area, input', context).colorbox) || typeof settings.colorbox === 'undefined') {
41      return;
42    }
43
44    if (settings.colorbox.mobiledetect && window.matchMedia) {
45      // Disable Colorbox for small screens.
46      var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")");
47      if (mq.matches) {
48        return;
49      }
50    }
51
52    // Use "data-colorbox-gallery" if set otherwise use "rel".
53    settings.colorbox.rel = function () {
54      if ($(this).data('colorbox-gallery')) {
55        return $(this).data('colorbox-gallery');
56      }
57      else {
58        return $(this).attr('rel');
59      }
60    };
61
62    $('.colorbox', context)
63      .once('init-colorbox').each(function(){
64        // Only images are supported for the "colorbox" class.
65        // The "photo" setting forces the href attribute to be treated as an image.
66        var extendParams = {
67          photo: true
68        };
69        // If a title attribute is supplied, sanitize it.
70        var title = $(this).attr('title');
71        if (title) {
72          extendParams.title = Drupal.colorbox.sanitizeMarkup(title);
73        }
74        $(this).colorbox($.extend({}, settings.colorbox, extendParams));
75      });
76
77    $(context).bind('cbox_complete', function () {
78      Drupal.attachBehaviors($('#cboxLoadedContent'));
79    });
80  }
81};
82
83// Create colorbox namespace if it doesn't exist.
84if (!Drupal.hasOwnProperty('colorbox')) {
85  Drupal.colorbox = {};
86}
87
88/**
89 * Global function to allow sanitizing captions and control strings.
90 *
91 * @param markup
92 *   String containing potential markup.
93 * @return @string
94 *  Sanitized string with potentially dangerous markup removed.
95 */
96Drupal.colorbox.sanitizeMarkup = function(markup) {
97  // If DOMPurify installed, allow some HTML. Otherwise, treat as plain text.
98  if (typeof DOMPurify !== 'undefined') {
99    var purifyConfig = {
100      ALLOWED_TAGS: [
101        'a',
102        'b',
103        'strong',
104        'i',
105        'em',
106        'u',
107        'cite',
108        'code',
109        'br'
110      ],
111      ALLOWED_ATTR: [
112        'href',
113        'hreflang',
114        'title',
115        'target'
116      ]
117    }
118    if (Drupal.settings.hasOwnProperty('dompurify_custom_config')) {
119      purifyConfig = Drupal.settings.dompurify_custom_config;
120    }
121    return DOMPurify.sanitize(markup, purifyConfig);
122  }
123  else {
124    return Drupal.checkPlain(markup);
125  }
126}
127
128})(jQuery);
129;
130/**
131 * @file
132 * Colorbox module load js.
133 */
134(function ($) {
135
136Drupal.behaviors.initColorboxLoad = {
137  attach: function (context, settings) {
138    if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') {
139      return;
140    }
141
142    if (settings.colorbox.mobiledetect && window.matchMedia) {
143      // Disable Colorbox for small screens.
144      var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")");
145      if (mq.matches) {
146        return;
147      }
148    }
149
150    $.urlParams = function (url) {
151      var p = {},
152          e,
153          a = /\+/g,  // Regex for replacing addition symbol with a space.
154          r = /([^&=]+)=?([^&]*)/g,
155          d = function (s) { return decodeURIComponent(s.replace(a, ' ')); },
156          q = url.split('?');
157      while (e = r.exec(q[1])) {
158        e[1] = d(e[1]);
159        e[2] = d(e[2]);
160        switch (e[2].toLowerCase()) {
161          case 'true':
162          case 'yes':
163            e[2] = true;
164            break;
165          case 'false':
166          case 'no':
167            e[2] = false;
168            break;
169        }
170        if (e[1] == 'width') { e[1] = 'innerWidth'; }
171        if (e[1] == 'height') { e[1] = 'innerHeight'; }
172        if (e[2]) {
173          e[2] = Drupal.checkPlain(e[2]);
174        }
175        p[e[1]] = e[2];
176      }
177      return p;
178    };
179
180    $('.colorbox-load', context)
181      .once('init-colorbox-load', function () {
182        var href = $(this).attr('href');
183
184        var params = $.urlParams(href);
185
186        // Always load in an iframe.
187        params.iframe = true;
188
189        // Set inner width and height if not already specified.
190        if (!params.hasOwnProperty('innerWidth')) {
191          params.innerWidth = $(window).width() * .8;
192        }
193        if (!params.hasOwnProperty('innerHeight')) {
194          params.innerHeight = $(window).height() * .8;
195        }
196
197        if (!params.hasOwnProperty('title')) {
198          // If a title attribute is supplied, sanitize it.
199          var title = $(this).attr('title');
200          if (title) {
201            params.title = Drupal.colorbox.sanitizeMarkup(title);
202          }
203        }
204        $(this).colorbox($.extend({}, settings.colorbox, params));
205      });
206  }
207};
208
209})(jQuery);
210;
211/**
212 * @file
213 * Colorbox module inline js.
214 */
215
216(function ($) {
217
218Drupal.behaviors.initColorboxInline = {
219  attach: function (context, settings) {
220    if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') {
221      return;
222    }
223
224    if (settings.colorbox.mobiledetect && window.matchMedia) {
225      // Disable Colorbox for small screens.
226      var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")");
227      if (mq.matches) {
228        return;
229      }
230    }
231
232    $.urlParam = function(name, url){
233      if (name == 'fragment') {
234        var results = new RegExp('(#[^&#]*)').exec(url);
235      }
236      else {
237        var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(url);
238      }
239      if (!results) { return ''; }
240      return results[1] || '';
241    };
242    $('.colorbox-inline', context).once('init-colorbox-inline').colorbox({
243      transition:settings.colorbox.transition,
244      speed:settings.colorbox.speed,
245      opacity:settings.colorbox.opacity,
246      slideshow:settings.colorbox.slideshow,
247      slideshowAuto:settings.colorbox.slideshowAuto,
248      slideshowSpeed:settings.colorbox.slideshowSpeed,
249      slideshowStart:settings.colorbox.slideshowStart,
250      slideshowStop:settings.colorbox.slideshowStop,
251      current:settings.colorbox.current,
252      previous:settings.colorbox.previous,
253      next:settings.colorbox.next,
254      close:settings.colorbox.close,
255      overlayClose:settings.colorbox.overlayClose,
256      maxWidth:settings.colorbox.maxWidth,
257      maxHeight:settings.colorbox.maxHeight,
258      innerWidth:function(){
259        return $.urlParam('width', $(this).attr('href'));
260      },
261      innerHeight:function(){
262        return $.urlParam('height', $(this).attr('href'));
263      },
264      title:function(){
265        return Drupal.colorbox.sanitizeMarkup(
266          decodeURIComponent($.urlParam('title', $(this).attr('href'))));
267      },
268      iframe:function(){
269        return $.urlParam('iframe', $(this).attr('href'));
270      },
271      inline:function(){
272        return $.urlParam('inline', $(this).attr('href'));
273      },
274      href:function(){
275        return $.urlParam('fragment', $(this).attr('href'));
276      }
277    });
278  }
279};
280
281})(jQuery);
282;
283/**
284 * @file
285 * Some basic behaviors and utility functions for Views.
286 */
287(function ($) {
288
289  Drupal.Views = {};
290
291  /**
292   * JQuery UI tabs, Views integration component.
293   */
294  Drupal.behaviors.viewsTabs = {
295    attach: function (context) {
296      if ($.viewsUi && $.viewsUi.tabs) {
297        $('#views-tabset').once('views-processed').viewsTabs({
298          selectedClass: 'active'
299        });
300      }
301
302      $('a.views-remove-link').once('views-processed').click(function (event) {
303        var id = $(this).attr('id').replace('views-remove-link-', '');
304        $('#views-row-' + id).hide();
305        $('#views-removed-' + id).get(0).checked = true;
306        event.preventDefault();
307      });
308      // Here is to handle display deletion
309      // (checking in the hidden checkbox and hiding out the row).
310      $('a.display-remove-link')
311        .addClass('display-processed')
312        .click(function () {
313          var id = $(this).attr('id').replace('display-remove-link-', '');
314          $('#display-row-' + id).hide();
315          $('#display-removed-' + id).get(0).checked = true;
316          return false;
317        });
318    }
319  };
320
321  /**
322   * Helper function to parse a querystring.
323   */
324  Drupal.Views.parseQueryString = function (query) {
325    var args = {};
326    var pos = query.indexOf('?');
327    if (pos != -1) {
328      query = query.substring(pos + 1);
329    }
330    var pairs = query.split('&');
331    for (var i in pairs) {
332      if (typeof(pairs[i]) == 'string') {
333        var pair = pairs[i].split('=');
334        // Ignore the 'q' path argument, if present.
335        if (pair[0] != 'q' && pair[1]) {
336          args[decodeURIComponent(pair[0].replace(/\+/g, ' '))] = decodeURIComponent(pair[1].replace(/\+/g, ' '));
337        }
338      }
339    }
340    return args;
341  };
342
343  /**
344   * Helper function to return a view's arguments based on a path.
345   */
346  Drupal.Views.parseViewArgs = function (href, viewPath) {
347    // Provide language prefix.
348    if (Drupal.settings.pathPrefix) {
349      var viewPath = Drupal.settings.pathPrefix + viewPath;
350    }
351    var returnObj = {};
352    var path = Drupal.Views.getPath(href);
353    // Ensure there is a correct path.
354    if (viewPath && path.substring(0, viewPath.length + 1) == viewPath + '/') {
355      var args = decodeURIComponent(path.substring(viewPath.length + 1, path.length));
356      returnObj.view_args = args;
357      returnObj.view_path = path;
358    }
359    return returnObj;
360  };
361
362  /**
363   * Strip off the protocol plus domain from an href.
364   */
365  Drupal.Views.pathPortion = function (href) {
366    // Remove e.g. http://example.com if present.
367    var protocol = window.location.protocol;
368    if (href.substring(0, protocol.length) == protocol) {
369      // 2 is the length of the '//' that normally follows the protocol.
370      href = href.substring(href.indexOf('/', protocol.length + 2));
371    }
372    return href;
373  };
374
375  /**
376   * Return the Drupal path portion of an href.
377   */
378  Drupal.Views.getPath = function (href) {
379    href = Drupal.Views.pathPortion(href);
380    href = href.substring(Drupal.settings.basePath.length, href.length);
381    // 3 is the length of the '?q=' added to the URL without clean URLs.
382    if (href.substring(0, 3) == '?q=') {
383      href = href.substring(3, href.length);
384    }
385    var chars = ['#', '?', '&'];
386    for (var i in chars) {
387      if (href.indexOf(chars[i]) > -1) {
388        href = href.substr(0, href.indexOf(chars[i]));
389      }
390    }
391    return href;
392  };
393
394})(jQuery);
395;
396(function ($) {
397
398/**
399 * A progressbar object. Initialized with the given id. Must be inserted into
400 * the DOM afterwards through progressBar.element.
401 *
402 * method is the function which will perform the HTTP request to get the
403 * progress bar state. Either "GET" or "POST".
404 *
405 * e.g. pb = new progressBar('myProgressBar');
406 *      some_element.appendChild(pb.element);
407 */
408Drupal.progressBar = function (id, updateCallback, method, errorCallback) {
409  var pb = this;
410  this.id = id;
411  this.method = method || 'GET';
412  this.updateCallback = updateCallback;
413  this.errorCallback = errorCallback;
414
415  // The WAI-ARIA setting aria-live="polite" will announce changes after users
416  // have completed their current activity and not interrupt the screen reader.
417  this.element = $('<div class="progress" aria-live="polite"></div>').attr('id', id);
418  this.element.html('<div class="bar"><div class="filled"></div></div>' +
419                    '<div class="percentage"></div>' +
420                    '<div class="message">&nbsp;</div>');
421};
422
423/**
424 * Set the percentage and status message for the progressbar.
425 */
426Drupal.progressBar.prototype.setProgress = function (percentage, message) {
427  if (percentage >= 0 && percentage <= 100) {
428    $('div.filled', this.element).css('width', percentage + '%');
429    $('div.percentage', this.element).html(percentage + '%');
430  }
431  $('div.message', this.element).html(message);
432  if (this.updateCallback) {
433    this.updateCallback(percentage, message, this);
434  }
435};
436
437/**
438 * Start monitoring progress via Ajax.
439 */
440Drupal.progressBar.prototype.startMonitoring = function (uri, delay) {
441  this.delay = delay;
442  this.uri = uri;
443  this.sendPing();
444};
445
446/**
447 * Stop monitoring progress via Ajax.
448 */
449Drupal.progressBar.prototype.stopMonitoring = function () {
450  clearTimeout(this.timer);
451  // This allows monitoring to be stopped from within the callback.
452  this.uri = null;
453};
454
455/**
456 * Request progress data from server.
457 */
458Drupal.progressBar.prototype.sendPing = function () {
459  if (this.timer) {
460    clearTimeout(this.timer);
461  }
462  if (this.uri) {
463    var pb = this;
464    // When doing a post request, you need non-null data. Otherwise a
465    // HTTP 411 or HTTP 406 (with Apache mod_security) error may result.
466    $.ajax({
467      type: this.method,
468      url: this.uri,
469      data: '',
470      dataType: 'json',
471      success: function (progress) {
472        // Display errors.
473        if (progress.status == 0) {
474          pb.displayError(progress.data);
475          return;
476        }
477        // Update display.
478        pb.setProgress(progress.percentage, progress.message);
479        // Schedule next timer.
480        pb.timer = setTimeout(function () { pb.sendPing(); }, pb.delay);
481      },
482      error: function (xmlhttp) {
483        pb.displayError(Drupal.ajaxError(xmlhttp, pb.uri));
484      }
485    });
486  }
487};
488
489/**
490 * Display errors on the page.
491 */
492Drupal.progressBar.prototype.displayError = function (string) {
493  var error = $('<div class="messages error"></div>').html(string);
494  $(this.element).before(error).hide();
495
496  if (this.errorCallback) {
497    this.errorCallback(this);
498  }
499};
500
501})(jQuery);
502;
503(function ($) {
504  // Implement a show/hide.
505  Drupal.behaviors.menu_attach_block = {
506    attach: function (context, settings) {
507      // Attach hover events, if this link has been defined as hoverable.
508      $('a.menu-attach-block-drop-link.expand-on-hover', context).hover(
509          /**
510           * Show on mouse in.
511           */
512          function() {
513            // Show the block if it is not already shown.
514            if (!($(this).hasClass('dropped'))) {
515              expand_toggle($(this));
516            }
517          },
518          /**
519           * Hide on mouse out.
520           */
521          function() {
522            expand_toggle($(this));
523          }
524      );
525
526      // Attach click events for links configured to use that.
527      $('a.menu-attach-block-drop-link.expand-on-click', context).click(function(event) {
528        expand_toggle($(this));
529        event.preventDefault();
530      });
531
532      /**
533       * Shows a block embedded inside a menu item.
534       *
535       * @param link
536       *   The link attached to this menu item, which triggers block show.
537       */
538      function expand_toggle(link) {
539        if (link.hasClass('menu-ajax-enabled')) {
540          // Load contents using AJAX.
541          if (!link.hasClass('menu-ajax-loaded')) {
542            ajax_path = Drupal.settings.basePath + 'menu_attach_block/ajax/' + (link).attr('data-block-id');
543            $.ajax({
544              type: 'GET',
545              url: ajax_path,
546              data: '',
547              dataType: 'HTML',
548              success: function ($block_html) {
549                $(link).next('.menu-attach-block-wrapper').html($block_html);
550                Drupal.attachBehaviors(link);
551              }
552            });
553          }
554        }
555        // Show/hide the link.
556        $(link).next('.menu-attach-block-wrapper').slideToggle('fast');
557        $(link).toggleClass('dropped');
558      }
559    }
560  }
561}(jQuery));
562;
563(function ($) {
564	
565  /**
566   * VSCC Controls
567   */
568
569  // Add views slieshow api calls for views slideshow text controls.
570  Drupal.behaviors.vscc = {
571    attach: function (context) {
572
573      // Process previous link
574      $('.vscc_controls_previous:not(.vscc-previous-processed)', context).addClass('vscc-previous-processed').each(function() {
575        var uniqueID = $(this).attr('id').replace('vscc_controls_previous_', '');
576        $(this).click(function() {
577          Drupal.viewsSlideshow.action({ "action": 'previousSlide', "slideshowID": uniqueID });
578          return false;
579        });
580      });
581
582      // Process next link
583      $('.vscc_controls_next:not(.vscc-next-processed)', context).addClass('vscc-next-processed').each(function() {
584        var uniqueID = $(this).attr('id').replace('vscc_controls_next_', '');
585        $(this).click(function() {
586          Drupal.viewsSlideshow.action({ "action": 'nextSlide', "slideshowID": uniqueID });
587          return false;
588        });
589      });
590
591      // Process pause link
592      $('.vscc_controls_pause:not(.vscc-pause-processed)', context).addClass('vscc-pause-processed').each(function() {
593        var uniqueID = $(this).attr('id').replace('vscc_controls_pause_', '');
594        $(this).click(function() {
595          if (Drupal.settings.viewsSlideshow[uniqueID].paused) {
596            Drupal.viewsSlideshow.action({ "action": 'play', "slideshowID": uniqueID, "force": true });
597          }
598          else {
599            Drupal.viewsSlideshow.action({ "action": 'pause', "slideshowID": uniqueID, "force": true });
600          }
601          return false;
602        });
603      });
604    }
605  };
606
607  Drupal.vsccControls = Drupal.vsccControls || {};
608
609  /**
610   * Implement the pause hook for configurable controls.
611   */
612  Drupal.vsccControls.pause = function (options) {
613    $('#vscc_controls_pause_' + options.slideshowID + ' span.vscc-pause').hide();
614    $('#vscc_controls_pause_' + options.slideshowID + ' span.vscc-resume').show();
615  };
616
617  /**
618   * Implement the play hook for configurable controls.
619   */
620  Drupal.vsccControls.play = function (options) {
621    $('#vscc_controls_pause_' + options.slideshowID + ' span.vscc-resume').hide();
622    $('#vscc_controls_pause_' + options.slideshowID + ' span.vscc-pause').show();
623  };
624})(jQuery);;
625/*!
626 * jQuery Cycle Plugin (with Transition Definitions)
627 * Examples and documentation at: http://jquery.malsup.com/cycle/
628 * Copyright (c) 2007-2013 M. Alsup
629 * Version: 3.0.3 (11-JUL-2013)
630 * Dual licensed under the MIT and GPL licenses.
631 * http://jquery.malsup.com/license.html
632 * Requires: jQuery v1.7.1 or later
633 */
634;(function($, undefined) {
635"use strict";
636
637var ver = '3.0.3';
638
639function debug(s) {
640	if ($.fn.cycle.debug)
641		log(s);
642}		
643function log() {
644	/*global console */
645	if (window.console && console.log)
646		console.log('[cycle] ' + Array.prototype.join.call(arguments,' '));
647}
648$.expr[':'].paused = function(el) {
649	return el.cyclePause;
650};
651
652
653// the options arg can be...
654//   a number  - indicates an immediate transition should occur to the given slide index
655//   a string  - 'pause', 'resume', 'toggle', 'next', 'prev', 'stop', 'destroy' or the name of a transition effect (ie, 'fade', 'zoom', etc)
656//   an object - properties to control the slideshow
657//
658// the arg2 arg can be...
659//   the name of an fx (only used in conjunction with a numeric value for 'options')
660//   the value true (only used in first arg == 'resume') and indicates
661//	 that the resume should occur immediately (not wait for next timeout)
662
663$.fn.cycle = function(options, arg2) {
664	var o = { s: this.selector, c: this.context };
665
666	// in 1.3+ we can fix mistakes with the ready state
667	if (this.length === 0 && options != 'stop') {
668		if (!$.isReady && o.s) {
669			log('DOM not ready, queuing slideshow');
670			$(function() {
671				$(o.s,o.c).cycle(options,arg2);
672			});
673			return this;
674		}
675		// is your DOM ready?  http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
676		log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
677		return this;
678	}
679
680	// iterate the matched nodeset
681	return this.each(function() {
682		var opts = handleArguments(this, options, arg2);
683		if (opts === false)
684			return;
685
686		opts.updateActivePagerLink = opts.updateActivePagerLink || $.fn.cycle.updateActivePagerLink;
687		
688		// stop existing slideshow for this container (if there is one)
689		if (this.cycleTimeout)
690			clearTimeout(this.cycleTimeout);
691		this.cycleTimeout = this.cyclePause = 0;
692		this.cycleStop = 0; // issue #108
693
694		var $cont = $(this);
695		var $slides = opts.slideExpr ? $(opts.slideExpr, this) : $cont.children();
696		var els = $slides.get();
697
698		if (els.length < 2) {
699			log('terminating; too few slides: ' + els.length);
700			return;
701		}
702
703		var opts2 = buildOptions($cont, $slides, els, opts, o);
704		if (opts2 === false)
705			return;
706
707		var startTime = opts2.continuous ? 10 : getTimeout(els[opts2.currSlide], els[opts2.nextSlide], opts2, !opts2.backwards);
708
709		// if it's an auto slideshow, kick it off
710		if (startTime) {
711			startTime += (opts2.delay || 0);
712			if (startTime < 10)
713				startTime = 10;
714			debug('first timeout: ' + startTime);
715			this.cycleTimeout = setTimeout(function(){go(els,opts2,0,!opts.backwards);}, startTime);
716		}
717	});
718};
719
720function triggerPause(cont, byHover, onPager) {
721	var opts = $(cont).data('cycle.opts');
722	if (!opts)
723		return;
724	var paused = !!cont.cyclePause;
725	if (paused && opts.paused)
726		opts.paused(cont, opts, byHover, onPager);
727	else if (!paused && opts.resumed)
728		opts.resumed(cont, opts, byHover, onPager);
729}
730
731// process the args that were passed to the plugin fn
732function handleArguments(cont, options, arg2) {
733	if (cont.cycleStop === undefined)
734		cont.cycleStop = 0;
735	if (options === undefined || options === null)
736		options = {};
737	if (options.constructor == String) {
738		switch(options) {
739		case 'destroy':
740		case 'stop':
741			var opts = $(cont).data('cycle.opts');
742			if (!opts)
743				return false;
744			cont.cycleStop++; // callbacks look for change
745			if (cont.cycleTimeout)
746				clearTimeout(cont.cycleTimeout);
747			cont.cycleTimeout = 0;
748			if (opts.elements)
749				$(opts.elements).stop();
750			$(cont).removeData('cycle.opts');
751			if (options == 'destroy')
752				destroy(cont, opts);
753			return false;
754		case 'toggle':
755			cont.cyclePause = (cont.cyclePause === 1) ? 0 : 1;
756			checkInstantResume(cont.cyclePause, arg2, cont);
757			triggerPause(cont);
758			return false;
759		case 'pause':
760			cont.cyclePause = 1;
761			triggerPause(cont);
762			return false;
763		case 'resume':
764			cont.cyclePause = 0;
765			checkInstantResume(false, arg2, cont);
766			triggerPause(cont);
767			return false;
768		case 'prev':
769		case 'next':
770			opts = $(cont).data('cycle.opts');
771			if (!opts) {
772				log('options not found, "prev/next" ignored');
773				return false;
774			}
775			if (typeof arg2 == 'string') 
776				opts.oneTimeFx = arg2;
777			$.fn.cycle[options](opts);
778			return false;
779		default:
780			options = { fx: options };
781		}
782		return options;
783	}
784	else if (options.constructor == Number) {
785		// go to the requested slide
786		var num = options;
787		options = $(cont).data('cycle.opts');
788		if (!options) {
789			log('options not found, can not advance slide');
790			return false;
791		}
792		if (num < 0 || num >= options.elements.length) {
793			log('invalid slide index: ' + num);
794			return false;
795		}
796		options.nextSlide = num;
797		if (cont.cycleTimeout) {
798			clearTimeout(cont.cycleTimeout);
799			cont.cycleTimeout = 0;
800		}
801		if (typeof arg2 == 'string')
802			options.oneTimeFx = arg2;
803		go(options.elements, options, 1, num >= options.currSlide);
804		return false;
805	}
806	return options;
807	
808	function checkInstantResume(isPaused, arg2, cont) {
809		if (!isPaused && arg2 === true) { // resume now!
810			var options = $(cont).data('cycle.opts');
811			if (!options) {
812				log('options not found, can not resume');
813				return false;
814			}
815			if (cont.cycleTimeout) {
816				clearTimeout(cont.cycleTimeout);
817				cont.cycleTimeout = 0;
818			}
819			go(options.elements, options, 1, !options.backwards);
820		}
821	}
822}
823
824function removeFilter(el, opts) {
825	if (!$.support.opacity && opts.cleartype && el.style.filter) {
826		try { el.style.removeAttribute('filter'); }
827		catch(smother) {} // handle old opera versions
828	}
829}
830
831// unbind event handlers
832function destroy(cont, opts) {
833	if (opts.next)
834		$(opts.next).unbind(opts.prevNextEvent);
835	if (opts.prev)
836		$(opts.prev).unbind(opts.prevNextEvent);
837	
838	if (opts.pager || opts.pagerAnchorBuilder)
839		$.each(opts.pagerAnchors || [], function() {
840			this.unbind().remove();
841		});
842	opts.pagerAnchors = null;
843	$(cont).unbind('mouseenter.cycle mouseleave.cycle');
844	if (opts.destroy) // callback
845		opts.destroy(opts);
846}
847
848// one-time initialization
849function buildOptions($cont, $slides, els, options, o) {
850	var startingSlideSpecified;
851	// support metadata plugin (v1.0 and v2.0)
852	var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {});
853	var meta = $.isFunction($cont.data) ? $cont.data(opts.metaAttr) : null;
854	if (meta)
855		opts = $.extend(opts, meta);
856	if (opts.autostop)
857		opts.countdown = opts.autostopCount || els.length;
858
859	var cont = $cont[0];
860	$cont.data('cycle.opts', opts);
861	opts.$cont = $cont;
862	opts.stopCount = cont.cycleStop;
863	opts.elements = els;
864	opts.before = opts.before ? [opts.before] : [];
865	opts.after = opts.after ? [opts.after] : [];
866
867	// push some after callbacks
868	if (!$.support.opacity && opts.cleartype)
869		opts.after.push(function() { removeFilter(this, opts); });
870	if (opts.continuous)
871		opts.after.push(function() { go(els,opts,0,!opts.backwards); });
872
873	saveOriginalOpts(opts);
874
875	// clearType corrections
876	if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
877		clearTypeFix($slides);
878
879	// container requires non-static position so that slides can be position within
880	if ($cont.css('position') == 'static')
881		$cont.css('position', 'relative');
882	if (opts.width)
883		$cont.width(opts.width);
884	if (opts.height && opts.height != 'auto')
885		$cont.height(opts.height);
886
887	if (opts.startingSlide !== undefined) {
888		opts.startingSlide = parseInt(opts.startingSlide,10);
889		if (opts.startingSlide >= els.length || opts.startSlide < 0)
890			opts.startingSlide = 0; // catch bogus input
891		else 
892			startingSlideSpecified = true;
893	}
894	else if (opts.backwards)
895		opts.startingSlide = els.length - 1;
896	else
897		opts.startingSlide = 0;
898
899	// if random, mix up the slide array
900	if (opts.random) {
901		opts.randomMap = [];
902		for (var i = 0; i < els.length; i++)
903			opts.randomMap.push(i);
904		opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;});
905		if (startingSlideSpecified) {
906			// try to find the specified starting slide and if found set start slide index in the map accordingly
907			for ( var cnt = 0; cnt < els.length; cnt++ ) {
908				if ( opts.startingSlide == opts.randomMap[cnt] ) {
909					opts.randomIndex = cnt;
910				}
911			}
912		}
913		else {
914			opts.randomIndex = 1;
915			opts.startingSlide = opts.randomMap[1];
916		}
917	}
918	else if (opts.startingSlide >= els.length)
919		opts.startingSlide = 0; // catch bogus input
920	opts.currSlide = opts.startingSlide || 0;
921	var first = opts.startingSlide;
922
923	// set position and zIndex on all the slides
924	$slides.css({position: 'absolute', top:0, left:0}).hide().each(function(i) {
925		var z;
926		if (opts.backwards)
927			z = first ? i <= first ? els.length + (i-first) : first-i : els.length-i;
928		else
929			z = first ? i >= first ? els.length - (i-first) : first-i : els.length-i;
930		$(this).css('z-index', z);
931	});
932
933	// make sure first slide is visible
934	$(els[first]).css('opacity',1).show(); // opacity bit needed to handle restart use case
935	removeFilter(els[first], opts);
936
937	// stretch slides
938	if (opts.fit) {
939		if (!opts.aspect) {
940	        if (opts.width)
941	            $slides.width(opts.width);
942	        if (opts.height && opts.height != 'auto')
943	            $slides.height(opts.height);
944		} else {
945			$slides.each(function(){
946				var $slide = $(this);
947				var ratio = (opts.aspect === true) ? $slide.width()/$slide.height() : opts.aspect;
948				if( opts.width && $slide.width() != opts.width ) {
949					$slide.width( opts.width );
950					$slide.height( opts.width / ratio );
951				}
952
953				if( opts.height && $slide.height() < opts.height ) {
954					$slide.height( opts.height );
955					$slide.width( opts.height * ratio );
956				}
957			});
958		}
959	}
960
961	if (opts.center && ((!opts.fit) || opts.aspect)) {
962		$slides.each(function(){
963			var $slide = $(this);
964			$slide.css({
965				"margin-left": opts.width ?
966					((opts.width - $slide.width()) / 2) + "px" :
967					0,
968				"margin-top": opts.height ?
969					((opts.height - $slide.height()) / 2) + "px" :
970					0
971			});
972		});
973	}
974
975	if (opts.center && !opts.fit && !opts.slideResize) {
976		$slides.each(function(){
977			var $slide = $(this);
978			$slide.css({
979				"margin-left": opts.width ? ((opts.width - $slide.width()) / 2) + "px" : 0,
980				"margin-top": opts.height ? ((opts.height - $slide.height()) / 2) + "px" : 0
981			});
982		});
983	}
984		
985	// stretch container
986	var reshape = (opts.containerResize || opts.containerResizeHeight) && $cont.innerHeight() < 1;
987	if (reshape) { // do this only if container has no size http://tinyurl.com/da2oa9
988		var maxw = 0, maxh = 0;
989		for(var j=0; j < els.length; j++) {
990			var $e = $(els[j]), e = $e[0], w = $e.outerWidth(), h = $e.outerHeight();
991			if (!w) w = e.offsetWidth || e.width || $e.attr('width');
992			if (!h) h = e.offsetHeight || e.height || $e.attr('height');
993			maxw = w > maxw ? w : maxw;
994			maxh = h > maxh ? h : maxh;
995		}
996		if (opts.containerResize && maxw > 0 && maxh > 0)
997			$cont.css({width:maxw+'px',height:maxh+'px'});
998		if (opts.containerResizeHeight && maxh > 0)
999			$cont.css({height:maxh+'px'});
1000	}
1001
1002	var pauseFlag = false;  // https://github.com/malsup/cycle/issues/44
1003	if (opts.pause)
1004		$cont.bind('mouseenter.cycle', function(){
1005			pauseFlag = true;
1006			this.cyclePause++;
1007			triggerPause(cont, true);
1008		}).bind('mouseleave.cycle', function(){
1009				if (pauseFlag)
1010					this.cyclePause--;
1011				triggerPause(cont, true);
1012		});
1013
1014	if (supportMultiTransitions(opts) === false)
1015		return false;
1016
1017	// apparently a lot of people use image slideshows without height/width attributes on the images.
1018	// Cycle 2.50+ requires the sizing info for every slide; this block tries to deal with that.
1019	var requeue = false;
1020	options.requeueAttempts = options.requeueAttempts || 0;
1021	$slides.each(function() {
1022		// try to get height/width of each slide
1023		var $el = $(this);
1024		this.cycleH = (opts.fit && opts.height) ? opts.height : ($el.height() || this.offsetHeight || this.height || $el.attr('height') || 0);
1025		this.cycleW = (opts.fit && opts.width) ? opts.width : ($el.width() || this.offsetWidth || this.width || $el.attr('width') || 0);
1026
1027		if ( $el.is('img') ) {
1028			var loading = (this.cycleH === 0 && this.cycleW === 0 && !this.complete);
1029			// don't requeue for images that are still loading but have a valid size
1030			if (loading) {
1031				if (o.s && opts.requeueOnImageNotLoaded && ++options.requeueAttempts < 100) { // track retry count so we don't loop forever
1032					log(options.requeueAttempts,' - img slide not loaded, requeuing slideshow: ', this.src, this.cycleW, this.cycleH);
1033					setTimeout(function() {$(o.s,o.c).cycle(options);}, opts.requeueTimeout);
1034					requeue = true;
1035					return false; // break each loop
1036				}
1037				else {
1038					log('could not determine size of image: '+this.src, this.cycleW, this.cycleH);
1039				}
1040			}
1041		}
1042		return true;
1043	});
1044
1045	if (requeue)
1046		return false;
1047
1048	opts.cssBefore = opts.cssBefore || {};
1049	opts.cssAfter = opts.cssAfter || {};
1050	opts.cssFirst = opts.cssFirst || {};
1051	opts.animIn = opts.animIn || {};
1052	opts.animOut = opts.animOut || {};
1053
1054	$slides.not(':eq('+first+')').css(opts.cssBefore);
1055	$($slides[first]).css(opts.cssFirst);
1056
1057	if (opts.timeout) {
1058		opts.timeout = parseInt(opts.timeout,10);
1059		// ensure that timeout and speed settings are sane
1060		if (opts.speed.constructor == String)
1061			opts.speed = $.fx.speeds[opts.speed] || parseInt(opts.speed,10);
1062		if (!opts.sync)
1063			opts.speed = opts.speed / 2;
1064		
1065		var buffer = opts.fx == 'none' ? 0 : opts.fx == 'shuffle' ? 500 : 250;
1066		while((opts.timeout - opts.speed) < buffer) // sanitize timeout
1067			opts.timeout += opts.speed;
1068	}
1069	if (opts.easing)
1070		opts.easeIn = opts.easeOut = opts.easing;
1071	if (!opts.speedIn)
1072		opts.speedIn = opts.speed;
1073	if (!opts.speedOut)
1074		opts.speedOut = opts.speed;
1075
1076	opts.slideCount = els.length;
1077	opts.currSlide = opts.lastSlide = first;
1078	if (opts.random) {
1079		if (++opts.randomIndex == els.length)
1080			opts.randomIndex = 0;
1081		opts.nextSlide = opts.randomMap[opts.randomIndex];
1082	}
1083	else if (opts.backwards)
1084		opts.nextSlide = opts.startingSlide === 0 ? (els.length-1) : opts.startingSlide-1;
1085	else
1086		opts.nextSlide = opts.startingSlide >= (els.length-1) ? 0 : opts.startingSlide+1;
1087
1088	// run transition init fn
1089	if (!opts.multiFx) {
1090		var init = $.fn.cycle.transitions[opts.fx];
1091		if ($.isFunction(init))
1092			init($cont, $slides, opts);
1093		else if (opts.fx != 'custom' && !opts.multiFx) {
1094			log('unknown transition: ' + opts.fx,'; slideshow terminating');
1095			return false;
1096		}
1097	}
1098
1099	// fire artificial events
1100	var e0 = $slides[first];
1101	if (!opts.skipInitializationCallbacks) {
1102		if (opts.before.length)
1103			opts.before[0].apply(e0, [e0, e0, opts, true]);
1104		if (opts.after.length)
1105			opts.after[0].apply(e0, [e0, e0, opts, true]);
1106	}
1107	if (opts.next)
1108		$(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,1);});
1109	if (opts.prev)
1110		$(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,0);});
1111	if (opts.pager || opts.pagerAnchorBuilder)
1112		buildPager(els,opts);
1113
1114	exposeAddSlide(opts, els);
1115
1116	return opts;
1117}
1118
1119// save off original opts so we can restore after clearing state
1120function saveOriginalOpts(opts) {
1121	opts.original = { before: [], after: [] };
1122	opts.original.cssBefore = $.extend({}, opts.cssBefore);
1123	opts.original.cssAfter  = $.extend({}, opts.cssAfter);
1124	opts.original.animIn	= $.extend({}, opts.animIn);
1125	opts.original.animOut   = $.extend({}, opts.animOut);
1126	$.each(opts.before, function() { opts.original.before.push(this); });
1127	$.each(opts.after,  function() { opts.original.after.push(this); });
1128}
1129
1130function supportMultiTransitions(opts) {
1131	var i, tx, txs = $.fn.cycle.transitions;
1132	// look for multiple effects
1133	if (opts.fx.indexOf(',') > 0) {
1134		opts.multiFx = true;
1135		opts.fxs = opts.fx.replace(/\s*/g,'').split(',');
1136		// discard any bogus effect names
1137		for (i=0; i < opts.fxs.length; i++) {
1138			var fx = opts.fxs[i];
1139			tx = txs[fx];
1140			if (!tx || !txs.hasOwnProperty(fx) || !$.isFunction(tx)) {
1141				log('discarding unknown transition: ',fx);
1142				opts.fxs.splice(i,1);
1143				i--;
1144			}
1145		}
1146		// if we have an empty list then we threw everything away!
1147		if (!opts.fxs.length) {
1148			log('No valid transitions named; slideshow terminating.');
1149			return false;
1150		}
1151	}
1152	else if (opts.fx == 'all') {  // auto-gen the list of transitions
1153		opts.multiFx = true;
1154		opts.fxs = [];
1155		for (var p in txs) {
1156			if (txs.hasOwnProperty(p)) {
1157				tx = txs[p];
1158				if (txs.hasOwnProperty(p) && $.isFunction(tx))
1159					opts.fxs.push(p);
1160			}
1161		}
1162	}
1163	if (opts.multiFx && opts.randomizeEffects) {
1164		// munge the fxs array to make effect selection random
1165		var r1 = Math.floor(Math.random() * 20) + 30;
1166		for (i = 0; i < r1; i++) {
1167			var r2 = Math.floor(Math.random() * opts.fxs.length);
1168			opts.fxs.push(opts.fxs.splice(r2,1)[0]);
1169		}
1170		debug('randomized fx sequence: ',opts.fxs);
1171	}
1172	return true;
1173}
1174
1175// provide a mechanism for adding slides after the slideshow has started
1176function exposeAddSlide(opts, els) {
1177	opts.addSlide = function(newSlide, prepend) {
1178		var $s = $(newSlide), s = $s[0];
1179		if (!opts.autostopCount)
1180			opts.countdown++;
1181		els[prepend?'unshift':'push'](s);
1182		if (opts.els)
1183			opts.els[prepend?'unshift':'push'](s); // shuffle needs this
1184		opts.slideCount = els.length;
1185
1186		// add the slide to the random map and resort
1187		if (opts.random) {
1188			opts.randomMap.push(opts.slideCount-1);
1189			opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;});
1190		}
1191
1192		$s.css('position','absolute');
1193		$s[prepend?'prependTo':'appendTo'](opts.$cont);
1194
1195		if (prepend) {
1196			opts.currSlide++;
1197			opts.nextSlide++;
1198		}
1199
1200		if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
1201			clearTypeFix($s);
1202
1203		if (opts.fit && opts.width)
1204			$s.width(opts.width);
1205		if (opts.fit && opts.height && opts.height != 'auto')
1206			$s.height(opts.height);
1207		s.cycleH = (opts.fit && opts.height) ? opts.height : $s.height();
1208		s.cycleW = (opts.fit && opts.width) ? opts.width : $s.width();
1209
1210		$s.css(opts.cssBefore);
1211
1212		if (opts.pager || opts.pagerAnchorBuilder)
1213			$.fn.cycle.createPagerAnchor(els.length-1, s, $(opts.pager), els, opts);
1214
1215		if ($.isFunction(opts.onAddSlide))
1216			opts.onAddSlide($s);
1217		else
1218			$s.hide(); // default behavior
1219	};
1220}
1221
1222// reset internal state; we do this on every pass in order to support multiple effects
1223$.fn.cycle.resetState = function(opts, fx) {
1224	fx = fx || opts.fx;
1225	opts.before = []; opts.after = [];
1226	opts.cssBefore = $.extend({}, opts.original.cssBefore);
1227	opts.cssAfter  = $.extend({}, opts.original.cssAfter);
1228	opts.animIn	= $.extend({}, opts.original.animIn);
1229	opts.animOut   = $.extend({}, opts.original.animOut);
1230	opts.fxFn = null;
1231	$.each(opts.original.before, function() { opts.before.push(this); });
1232	$.each(opts.original.after,  function() { opts.after.push(this); });
1233
1234	// re-init
1235	var init = $.fn.cycle.transitions[fx];
1236	if ($.isFunction(init))
1237		init(opts.$cont, $(opts.elements), opts);
1238};
1239
1240// this is the main engine fn, it handles the timeouts, callbacks and slide index mgmt
1241function go(els, opts, manual, fwd) {
1242	var p = opts.$cont[0], curr = els[opts.currSlide], next = els[opts.nextSlide];
1243
1244	// opts.busy is true if we're in the middle of an animation
1245	if (manual && opts.busy && opts.manualTrump) {
1246		// let manual transitions requests trump active ones
1247		debug('manualTrump in go(), stopping active transition');
1248		$(els).stop(true,true);
1249		opts.busy = 0;
1250		clearTimeout(p.cycleTimeout);
1251	}
1252
1253	// don't begin another timeout-based transition if there is one active
1254	if (opts.busy) {
1255		debug('transition active, ignoring new tx request');
1256		return;
1257	}
1258
1259
1260	// stop cycling if we have an outstanding stop request
1261	if (p.cycleStop != opts.stopCount || p.cycleTimeout === 0 && !manual)
1262		return;
1263
1264	// check to see if we should stop cycling based on autostop options
1265	if (!manual && !p.cyclePause && !opts.bounce &&
1266		((opts.autostop && (--opts.countdown <= 0)) ||
1267		(opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) {
1268		if (opts.end)
1269			opts.end(opts);
1270		return;
1271	}
1272
1273	// if slideshow is paused, only transition on a manual trigger
1274	var changed = false;
1275	if ((manual || !p.cyclePause) && (opts.nextSlide != opts.currSlide)) {
1276		changed = true;
1277		var fx = opts.fx;
1278		// keep trying to get the slide size if we don't have it yet
1279		curr.cycleH = curr.cycleH || $(curr).height();
1280		curr.cycleW = curr.cycleW || $(curr).width();
1281		next.cycleH = next.cycleH || $(next).height();
1282		next.cycleW = next.cycleW || $(next).width();
1283
1284		// support multiple transition types
1285		if (opts.multiFx) {
1286			if (fwd && (opts.lastFx === undefined || ++opts.lastFx >= opts.fxs.length))
1287				opts.lastFx = 0;
1288			else if (!fwd && (opts.lastFx === undefined || --opts.lastFx < 0))
1289				opts.lastFx = opts.fxs.length - 1;
1290			fx = opts.fxs[opts.lastFx];
1291		}
1292
1293		// one-time fx overrides apply to:  $('div').cycle(3,'zoom');
1294		if (opts.oneTimeFx) {
1295			fx = opts.oneTimeFx;
1296			opts.oneTimeFx = null;
1297		}
1298
1299		$.fn.cycle.resetState(opts, fx);
1300
1301		// run the before callbacks
1302		if (opts.before.length)
1303			$.each(opts.before, function(i,o) {
1304				if (p.cycleStop != opts.stopCount) return;
1305				o.apply(next, [curr, next, opts, fwd]);
1306			});
1307
1308		// stage the after callacks
1309		var after = function() {
1310			opts.busy = 0;
1311			$.each(opts.after, function(i,o) {
1312				if (p.cycleStop != opts.stopCount) return;
1313				o.apply(next, [curr, next, opts, fwd]);
1314			});
1315			if (!p.cycleStop) {
1316				// queue next transition
1317				queueNext();
1318			}
1319		};
1320
1321		debug('tx firing('+fx+'); currSlide: ' + opts.currSlide + '; nextSlide: ' + opts.nextSlide);
1322		
1323		// get ready to perform the transition
1324		opts.busy = 1;
1325		if (opts.fxFn) // fx function provided?
1326			opts.fxFn(curr, next, opts, after, fwd, manual && opts.fastOnEvent);
1327		else if ($.isFunction($.fn.cycle[opts.fx])) // fx plugin ?
1328			$.fn.cycle[opts.fx](curr, next, opts, after, fwd, manual && opts.fastOnEvent);
1329		else
1330			$.fn.cycle.custom(curr, next, opts, after, fwd, manual && opts.fastOnEvent);
1331	}
1332	else {
1333		queueNext();
1334	}
1335
1336	if (changed || opts.nextSlide == opts.currSlide) {
1337		// calculate the next slide
1338		var roll;
1339		opts.lastSlide = opts.currSlide;
1340		if (opts.random) {
1341			opts.currSlide = opts.nextSlide;
1342			if (++opts.randomIndex == els.length) {
1343				opts.randomIndex = 0;
1344				opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;});
1345			}
1346			opts.nextSlide = opts.randomMap[opts.randomIndex];
1347			if (opts.nextSlide == opts.currSlide)
1348				opts.nextSlide = (opts.currSlide == opts.slideCount - 1) ? 0 : opts.currSlide + 1;
1349		}
1350		else if (opts.backwards) {
1351			roll = (opts.nextSlide - 1) < 0;
1352			if (roll && opts.bounce) {
1353				opts.backwards = !opts.backwards;
1354				opts.nextSlide = 1;
1355				opts.currSlide = 0;
1356			}
1357			else {
1358				opts.nextSlide = roll ? (els.length-1) : opts.nextSlide-1;
1359				opts.currSlide = roll ? 0 : opts.nextSlide+1;
1360			}
1361		}
1362		else { // sequence
1363			roll = (opts.nextSlide + 1) == els.length;
1364			if (roll && opts.bounce) {
1365				opts.backwards = !opts.backwards;
1366				opts.nextSlide = els.length-2;
1367				opts.currSlide = els.length-1;
1368			}
1369			else {
1370				opts.nextSlide = roll ? 0 : opts.nextSlide+1;
1371				opts.currSlide = roll ? els.length-1 : opts.nextSlide-1;
1372			}
1373		}
1374	}
1375	if (changed && opts.pager)
1376		opts.updateActivePagerLink(opts.pager, opts.currSlide, opts.activePagerClass);
1377	
1378	function queueNext() {
1379		// stage the next transition
1380		var ms = 0, timeout = opts.timeout;
1381		if (opts.timeout && !opts.continuous) {
1382			ms = getTimeout(els[opts.currSlide], els[opts.nextSlide], opts, fwd);
1383         if (opts.fx == 'shuffle')
1384            ms -= opts.speedOut;
1385      }
1386		else if (opts.continuous && p.cyclePause) // continuous shows work off an after callback, not this timer logic
1387			ms = 10;
1388		if (ms > 0)
1389			p.cycleTimeout = setTimeout(function(){ go(els, opts, 0, !opts.backwards); }, ms);
1390	}
1391}
1392
1393// invoked after transition
1394$.fn.cycle.updateActivePagerLink = function(pager, currSlide, clsName) {
1395   $(pager).each(function() {
1396       $(this).children().removeClass(clsName).eq(currSlide).addClass(clsName);
1397   });
1398};
1399
1400// calculate timeout value for current transition
1401function getTimeout(curr, next, opts, fwd) {
1402	if (opts.timeoutFn) {
1403		// call user provided calc fn
1404		var t = opts.timeoutFn.call(curr,curr,next,opts,fwd);
1405		while (opts.fx != 'none' && (t - opts.speed) < 250) // sanitize timeout
1406			t += opts.speed;
1407		debug('calculated timeout: ' + t + '; speed: ' + opts.speed);
1408		if (t !== false)
1409			return t;
1410	}
1411	return opts.timeout;
1412}
1413
1414// expose next/prev function, caller must pass in state
1415$.fn.cycle.next = function(opts) { advance(opts,1); };
1416$.fn.cycle.prev = function(opts) { advance(opts,0);};
1417
1418// advance slide forward or back
1419function advance(opts, moveForward) {
1420	var val = moveForward ? 1 : -1;
1421	var els = opts.elements;
1422	var p = opts.$cont[0], timeout = p.cycleTimeout;
1423	if (timeout) {
1424		clearTimeout(timeout);
1425		p.cycleTimeout = 0;
1426	}
1427	if (opts.random && val < 0) {
1428		// move back to the previously display slide
1429		opts.randomIndex--;
1430		if (--opts.randomIndex == -2)
1431			opts.randomIndex = els.length-2;
1432		else if (opts.randomIndex == -1)
1433			opts.randomIndex = els.length-1;
1434		opts.nextSlide = opts.randomMap[opts.randomIndex];
1435	}
1436	else if (opts.random) {
1437		opts.nextSlide = opts.randomMap[opts.randomIndex];
1438	}
1439	else {
1440		opts.nextSlide = opts.currSlide + val;
1441		if (opts.nextSlide < 0) {
1442			if (opts.nowrap) return false;
1443			opts.nextSlide = els.length - 1;
1444		}
1445		else if (opts.nextSlide >= els.length) {
1446			if (opts.nowrap) return false;
1447			opts.nextSlide = 0;
1448		}
1449	}
1450
1451	var cb = opts.onPrevNextEvent || opts.prevNextClick; // prevNextClick is deprecated
1452	if ($.isFunction(cb))
1453		cb(val > 0, opts.nextSlide, els[opts.nextSlide]);
1454	go(els, opts, 1, moveForward);
1455	return false;
1456}
1457
1458function buildPager(els, opts) {
1459	var $p = $(opts.pager);
1460	$.each(els, function(i,o) {
1461		$.fn.cycle.createPagerAnchor(i,o,$p,els,opts);
1462	});
1463	opts.updateActivePagerLink(opts.pager, opts.startingSlide, opts.activePagerClass);
1464}
1465
1466$.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) {
1467	var a;
1468	if ($.isFunction(opts.pagerAnchorBuilder)) {
1469		a = opts.pagerAnchorBuilder(i,el);
1470		debug('pagerAnchorBuilder('+i+', el) returned: ' + a);
1471	}
1472	else
1473		a = '<a href="#">'+(i+1)+'</a>';
1474		
1475	if (!a)
1476		return;
1477	var $a = $(a);
1478	// don't reparent if anchor is in the dom
1479	if ($a.parents('body').length === 0) {
1480		var arr = [];
1481		if ($p.length > 1) {
1482			$p.each(function() {
1483				var $clone = $a.clone(true);
1484				$(this).append($clone);
1485				arr.push($clone[0]);
1486			});
1487			$a = $(arr);
1488		}
1489		else {
1490			$a.appendTo($p);
1491		}
1492	}
1493
1494	opts.pagerAnchors =  opts.pagerAnchors || [];
1495	opts.pagerAnchors.push($a);
1496	
1497	var pagerFn = function(e) {
1498		e.preventDefault();
1499		opts.nextSlide = i;
1500		var p = opts.$cont[0], timeout = p.cycleTimeout;
1501		if (timeout) {
1502			clearTimeout(timeout);
1503			p.cycleTimeout = 0;
1504		}
1505		var cb = opts.onPagerEvent || opts.pagerClick; // pagerClick is deprecated
1506		if ($.isFunction(cb))
1507			cb(opts.nextSlide, els[opts.nextSlide]);
1508		go(els,opts,1,opts.currSlide < i); // trigger the trans
1509//		return false; // <== allow bubble
1510	};
1511	
1512	if ( /mouseenter|mouseover/i.test(opts.pagerEvent) ) {
1513		$a.hover(pagerFn, function(){/* no-op */} );
1514	}
1515	else {
1516		$a.bind(opts.pagerEvent, pagerFn);
1517	}
1518	
1519	if ( ! /^click/.test(opts.pagerEvent) && !opts.allowPagerClickBubble)
1520		$a.bind('click.cycle', function(){return false;}); // suppress click
1521	
1522	var cont = opts.$cont[0];
1523	var pauseFlag = false; // https://github.com/malsup/cycle/issues/44
1524	if (opts.pauseOnPagerHover) {
1525		$a.hover(
1526			function() { 
1527				pauseFlag = true;
1528				cont.cyclePause++; 
1529				triggerPause(cont,true,true);
1530			}, function() { 
1531				if (pauseFlag)
1532					cont.cyclePause--; 
1533				triggerPause(cont,true,true);
1534			} 
1535		);
1536	}
1537};
1538
1539// helper fn to calculate the number of slides between the current and the next
1540$.fn.cycle.hopsFromLast = function(opts, fwd) {
1541	var hops, l = opts.lastSlide, c = opts.currSlide;
1542	if (fwd)
1543		hops = c > l ? c - l : opts.slideCount - l;
1544	else
1545		hops = c < l ? l - c : l + opts.slideCount - c;
1546	return hops;
1547};
1548
1549// fix clearType problems in ie6 by setting an explicit bg color
1550// (otherwise text slides look horrible during a fade transition)
1551function clearTypeFix($slides) {
1552	debug('applying clearType background-color hack');
1553	function hex(s) {
1554		s = parseInt(s,10).toString(16);
1555		return s.length < 2 ? '0'+s : s;
1556	}
1557	function getBg(e) {
1558		for ( ; e && e.nodeName.toLowerCase() != 'html'; e = e.parentNode) {
1559			var v = $.css(e,'background-color');
1560			if (v && v.indexOf('rgb') >= 0 ) {
1561				var rgb = v.match(/\d+/g);
1562				return '#'+ hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]);
1563			}
1564			if (v && v != 'transparent')
1565				return v;
1566		}
1567		return '#ffffff';
1568	}
1569	$slides.each(function() { $(this).css('background-color', getBg(this)); });
1570}
1571
1572// reset common props before the next transition
1573$.fn.cycle.commonReset = function(curr,next,opts,w,h,rev) {
1574	$(opts.elements).not(curr).hide();
1575	if (typeof opts.cssBefore.opacity == 'undefined')
1576		opts.cssBefore.opacity = 1;
1577	opts.cssBefore.display = 'block';
1578	if (opts.slideResize && w !== false && next.cycleW > 0)
1579		opts.cssBefore.width = next.cycleW;
1580	if (opts.slideResize && h !== false && next.cycleH > 0)
1581		opts.cssBefore.height = next.cycleH;
1582	opts.cssAfter = opts.cssAfter || {};
1583	opts.cssAfter.display = 'none';
1584	$(curr).css('zIndex',opts.slideCount + (rev === true ? 1 : 0));
1585	$(next).css('zIndex',opts.slideCount + (rev === true ? 0 : 1));
1586};
1587
1588// the actual fn for effecting a transition
1589$.fn.cycle.custom = function(curr, next, opts, cb, fwd, speedOverride) {
1590	var $l = $(curr), $n = $(next);
1591	var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut, animInDelay = opts.animInDelay, animOutDelay = opts.animOutDelay;
1592	$n.css(opts.cssBefore);
1593	if (speedOverride) {
1594		if (typeof speedOverride == 'number')
1595			speedIn = speedOut = speedOverride;
1596		else
1597			speedIn = speedOut = 1;
1598		easeIn = easeOut = null;
1599	}
1600	var fn = function() {
1601		$n.delay(animInDelay).animate(opts.animIn, speedIn, easeIn, function() {
1602			cb();
1603		});
1604	};
1605	$l.delay(animOutDelay).animate(opts.animOut, speedOut, easeOut, function() {
1606		$l.css(opts.cssAfter);
1607		if (!opts.sync) 
1608			fn();
1609	});
1610	if (opts.sync) fn();
1611};
1612
1613// transition definitions - only fade is defined here, transition pack defines the rest
1614$.fn.cycle.transitions = {
1615	fade: function($cont, $slides, opts) {
1616		$slides.not(':eq('+opts.currSlide+')').css('opacity',0);
1617		opts.before.push(function(curr,next,opts) {
1618			$.fn.cycle.commonReset(curr,next,opts);
1619			opts.cssBefore.opacity = 0;
1620		});
1621		opts.animIn	   = { opacity: 1 };
1622		opts.animOut   = { opacity: 0 };
1623		opts.cssBefore = { top: 0, left: 0 };
1624	}
1625};
1626
1627$.fn.cycle.ver = function() { return ver; };
1628
1629// override these globally if you like (they are all optional)
1630$.fn.cycle.defaults = {
1631    activePagerClass: 'activeSlide', // class name used for the active pager link
1632    after:            null,     // transition callback (scope set to element that was shown):  function(currSlideElement, nextSlideElement, options, forwardFlag)
1633    allowPagerClickBubble: false, // allows or prevents click event on pager anchors from bubbling
1634    animIn:           null,     // properties that define how the slide animates in
1635    animInDelay:      0,        // allows delay before next slide transitions in	
1636    animOut:          null,     // properties that define how the slide animates out
1637    animOutDelay:     0,        // allows delay before current slide transitions out
1638    aspect:           false,    // preserve aspect ratio during fit resizing, cropping if necessary (must be used with fit option)
1639    autostop:         0,        // true to end slideshow after X transitions (where X == slide count)
1640    autostopCount:    0,        // number of transitions (optionally used with autostop to define X)
1641    backwards:        false,    // true to start slideshow at last slide and move backwards through the stack
1642    before:           null,     // transition callback (scope set to element to be shown):     function(currSlideElement, nextSlideElement, options, forwardFlag)
1643    center:           null,     // set to true to have cycle add top/left margin to each slide (use with width and height options)
1644    cleartype:        !$.support.opacity,  // true if clearType corrections should be applied (for IE)
1645    cleartypeNoBg:    false,    // set to true to disable extra cleartype fixing (leave false to force background color setting on slides)
1646    containerResize:  1,        // resize container to fit largest slide
1647    containerResizeHeight:  0,  // resize containers height to fit the largest slide but leave the width dynamic
1648    continuous:       0,        // true to start next transition immediately after current one completes
1649    cssAfter:         null,     // properties that defined the state of the slide after transitioning out
1650    cssBefore:        null,     // properties that define the initial state of the slide before transitioning in
1651    delay:            0,        // additional delay (in ms) for first transition (hint: can be negative)
1652    easeIn:           null,     // easing for "in" transition
1653    easeOut:          null,     // easing for "out" transition
1654    easing:           null,     // easing method for both in and out transitions
1655    end:              null,     // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options)
1656    fastOnEvent:      0,        // force fast transitions when triggered manually (via pager or prev/next); value == time in ms
1657    fit:              0,        // force slides to fit container
1658    fx:               'fade',   // name of transition effect (or comma separated names, ex: 'fade,scrollUp,shuffle')
1659    fxFn:             null,     // function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag)
1660    height:           'auto',   // container height (if the 'fit' option is true, the slides will be set to this height as well)
1661    manualTrump:      true,     // causes manual transition to stop an active transition instead of being ignored
1662    metaAttr:         'cycle',  // data- attribute that holds the option data for the slideshow
1663    next:             null,     // element, jQuery object, or jQuery selector string for the element to use as event trigger for next slide
1664    nowrap:           0,        // true to prevent slideshow from wrapping
1665    onPagerEvent:     null,     // callback fn for pager events: function(zeroBasedSlideIndex, slideElement)
1666    onPrevNextEvent:  null,     // callback fn for prev/next events: function(isNext, zeroBasedSlideIndex, slideElement)
1667    pager:            null,     // element, jQuery object, or jQuery selector string for the element to use as pager container
1668    pagerAnchorBuilder: null,   // callback fn for building anchor links:  function(index, DOMelement)
1669    pagerEvent:       'click.cycle', // name of event which drives the pager navigation
1670    pause:            0,        // true to enable "pause on hover"
1671    pauseOnPagerHover: 0,       // true to pause when hovering over pager link
1672    prev:             null,     // element, jQuery object, or jQuery selector string for the element to use as event trigger for previous slide
1673    prevNextEvent:    'click.cycle',// event which drives the manual transition to the previous or next slide
1674    random:           0,        // true for random, false for sequence (not applicable to shuffle fx)
1675    randomizeEffects: 1,        // valid when multiple effects are used; true to make the effect sequence random
1676    requeueOnImageNotLoaded: true, // requeue the slideshow if any image slides are not yet loaded
1677    requeueTimeout:   250,      // ms delay for requeue
1678    rev:              0,        // causes animations to transition in reverse (for effects that support it such as scrollHorz/scrollVert/shuffle)
1679    shuffle:          null,     // coords for shuffle animation, ex: { top:15, left: 200 }
1680    skipInitializationCallbacks: false, // set to true to disable the first before/after callback that occurs prior to any transition
1681    slideExpr:        null,     // expression for selecting slides (if something other than all children is required)
1682    slideResize:      1,        // force slide width/height to fixed size before every transition
1683    speed:            1000,     // speed of the transition (any valid fx speed value)
1684    speedIn:          null,     // speed of the 'in' transition
1685    speedOut:         null,     // speed of the 'out' transition
1686    startingSlide:    undefined,// zero-based index of the first slide to be displayed
1687    sync:             1,        // true if in/out transitions should occur simultaneously
1688    timeout:          4000,     // milliseconds between slide transitions (0 to disable auto advance)
1689    timeoutFn:        null,     // callback for determining per-slide timeout value:  function(currSlideElement, nextSlideElement, options, forwardFlag)
1690    updateActivePagerLink: null,// callback fn invoked to update the active pager link (adds/removes activePagerClass style)
1691    width:            null      // container width (if the 'fit' option is true, the slides will be set to this width as well)
1692};
1693
1694}
1694)(jQuery);
1695
1696
1697/*!
1698 * jQuery Cycle Plugin Transition Definitions
1699 * This script is a plugin for the jQuery Cycle Plugin
1700 * Examples and documentation at: http://malsup.com/jquery/cycle/
1701 * Copyright (c) 2007-2010 M. Alsup
1702 * Version:	 2.73
1703 * Dual licensed under the MIT and GPL licenses:
1704 * http://www.opensource.org/licenses/mit-license.php
1705 * http://www.gnu.org/licenses/gpl.html
1706 */
1707(function($) {
1708"use strict";
1709
1710//
1711// These functions define slide initialization and properties for the named
1712// transitions. To save file size feel free to remove any of these that you
1713// don't need.
1714//
1715$.fn.cycle.transitions.none = function($cont, $slides, opts) {
1716	opts.fxFn = function(curr,next,opts,after){
1717		$(next).show();
1718		$(curr).hide();
1719		after();
1720	};
1721};
1722
1723// not a cross-fade, fadeout only fades out the top slide
1724$.fn.cycle.transitions.fadeout = function($cont, $slides, opts) {
1725	$slides.not(':eq('+opts.currSlide+')').css({ display: 'block', 'opacity': 1 });
1726	opts.before.push(function(curr,next,opts,w,h,rev) {
1727		$(curr).css('zIndex',opts.slideCount + (rev !== true ? 1 : 0));
1728		$(next).css('zIndex',opts.slideCount + (rev !== true ? 0 : 1));
1729	});
1730	opts.animIn.opacity = 1;
1731	opts.animOut.opacity = 0;
1732	opts.cssBefore.opacity = 1;
1733	opts.cssBefore.display = 'block';
1734	opts.cssAfter.zIndex = 0;
1735};
1736
1737// scrollUp/Down/Left/Right
1738$.fn.cycle.transitions.scrollUp = function($cont, $slides, opts) {
1739	$cont.css('overflow','hidden');
1740	opts.before.push($.fn.cycle.commonReset);
1741	var h = $cont.height();
1742	opts.cssBefore.top = h;
1743	opts.cssBefore.left = 0;
1744	opts.cssFirst.top = 0;
1745	opts.animIn.top = 0;
1746	opts.animOut.top = -h;
1747};
1748$.fn.cycle.transitions.scrollDown = function($cont, $slides, opts) {
1749	$cont.css('overflow','hidden');
1750	opts.before.push($.fn.cycle.commonReset);
1751	var h = $cont.height();
1752	opts.cssFirst.top = 0;
1753	opts.cssBefore.top = -h;
1754	opts.cssBefore.left = 0;
1755	opts.animIn.top = 0;
1756	opts.animOut.top = h;
1757};
1758$.fn.cycle.transitions.scrollLeft = function($cont, $slides, opts) {
1759	$cont.css('overflow','hidden');
1760	opts.before.push($.fn.cycle.commonReset);
1761	var w = $cont.width();
1762	opts.cssFirst.left = 0;
1763	opts.cssBefore.left = w;
1764	opts.cssBefore.top = 0;
1765	opts.animIn.left = 0;
1766	opts.animOut.left = 0-w;
1767};
1768$.fn.cycle.transitions.scrollRight = function($cont, $slides, opts) {
1769	$cont.css('overflow','hidden');
1770	opts.before.push($.fn.cycle.commonReset);
1771	var w = $cont.width();
1772	opts.cssFirst.left = 0;
1773	opts.cssBefore.left = -w;
1774	opts.cssBefore.top = 0;
1775	opts.animIn.left = 0;
1776	opts.animOut.left = w;
1777};
1778$.fn.cycle.transitions.scrollHorz = function($cont, $slides, opts) {
1779	$cont.css('overflow','hidden').width();
1780	opts.before.push(function(curr, next, opts, fwd) {
1781		if (opts.rev)
1782			fwd = !fwd;
1783		$.fn.cycle.commonReset(curr,next,opts);
1784		opts.cssBefore.left = fwd ? (next.cycleW-1) : (1-next.cycleW);
1785		opts.animOut.left = fwd ? -curr.cycleW : curr.cycleW;
1786	});
1787	opts.cssFirst.left = 0;
1788	opts.cssBefore.top = 0;
1789	opts.animIn.left = 0;
1790	opts.animOut.top = 0;
1791};
1792$.fn.cycle.transitions.scrollVert = function($cont, $slides, opts) {
1793	$cont.css('overflow','hidden');
1794	opts.before.push(function(curr, next, opts, fwd) {
1795		if (opts.rev)
1796			fwd = !fwd;
1797		$.fn.cycle.commonReset(curr,next,opts);
1798		opts.cssBefore.top = fwd ? (1-next.cycleH) : (next.cycleH-1);
1799		opts.animOut.top = fwd ? curr.cycleH : -curr.cycleH;
1800	});
1801	opts.cssFirst.top = 0;
1802	opts.cssBefore.left = 0;
1803	opts.animIn.top = 0;
1804	opts.animOut.left = 0;
1805};
1806
1807// slideX/slideY
1808$.fn.cycle.transitions.slideX = function($cont, $slides, opts) {
1809	opts.before.push(function(curr, next, opts) {
1810		$(opts.elements).not(curr).hide();
1811		$.fn.cycle.commonReset(curr,next,opts,false,true);
1812		opts.animIn.width = next.cycleW;
1813	});
1814	opts.cssBefore.left = 0;
1815	opts.cssBefore.top = 0;
1816	opts.cssBefore.width = 0;
1817	opts.animIn.width = 'show';
1818	opts.animOut.width = 0;
1819};
1820$.fn.cycle.transitions.slideY = function($cont, $slides, opts) {
1821	opts.before.push(function(curr, next, opts) {
1822		$(opts.elements).not(curr).hide();
1823		$.fn.cycle.commonReset(curr,next,opts,true,false);
1824		opts.animIn.height = next.cycleH;
1825	});
1826	opts.cssBefore.left = 0;
1827	opts.cssBefore.top = 0;
1828	opts.cssBefore.height = 0;
1829	opts.animIn.height = 'show';
1830	opts.animOut.height = 0;
1831};
1832
1833// shuffle
1834$.fn.cycle.transitions.shuffle = function($cont, $slides, opts) {
1835	var i, w = $cont.css('overflow', 'visible').width();
1836	$slides.css({left: 0, top: 0});
1837	opts.before.push(function(curr,next,opts) {
1838		$.fn.cycle.commonReset(curr,next,opts,true,true,true);
1839	});
1840	// only adjust speed once!
1841	if (!opts.speedAdjusted) {
1842		opts.speed = opts.speed / 2; // shuffle has 2 transitions
1843		opts.speedAdjusted = true;
1844	}
1845	opts.random = 0;
1846	opts.shuffle = opts.shuffle || {left:-w, top:15};
1847	opts.els = [];
1848	for (i=0; i < $slides.length; i++)
1849		opts.els.push($slides[i]);
1850
1851	for (i=0; i < opts.currSlide; i++)
1852		opts.els.push(opts.els.shift());
1853
1854	// custom transition fn (hat tip to Benjamin Sterling for this bit of sweetness!)
1855	opts.fxFn = function(curr, next, opts, cb, fwd) {
1856		if (opts.rev)
1857			fwd = !fwd;
1858		var $el = fwd ? $(curr) : $(next);
1859		$(next).css(opts.cssBefore);
1860		var count = opts.slideCount;
1861		$el.animate(opts.shuffle, opts.speedIn, opts.easeIn, function() {
1862			var hops = $.fn.cycle.hopsFromLast(opts, fwd);
1863			for (var k=0; k < hops; k++) {
1864				if (fwd)
1865					opts.els.push(opts.els.shift());
1866				else
1867					opts.els.unshift(opts.els.pop());
1868			}
1869			if (fwd) {
1870				for (var i=0, len=opts.els.length; i < len; i++)
1871					$(opts.els[i]).css('z-index', len-i+count);
1872			}
1873			else {
1874				var z = $(curr).css('z-index');
1875				$el.css('z-index', parseInt(z,10)+1+count);
1876			}
1877			$el.animate({left:0, top:0}, opts.speedOut, opts.easeOut, function() {
1878				$(fwd ? this : curr).hide();
1879				if (cb) cb();
1880			});
1881		});
1882	};
1883	$.extend(opts.cssBefore, { display: 'block', opacity: 1, top: 0, left: 0 });
1884};
1885
1886// turnUp/Down/Left/Right
1887$.fn.cycle.transitions.turnUp = function($cont, $slides, opts) {
1888	opts.before.push(function(curr, next, opts) {
1889		$.fn.cycle.commonReset(curr,next,opts,true,false);
1890		opts.cssBefore.top = next.cycleH;
1891		opts.animIn.height = next.cycleH;
1892		opts.animOut.width = next.cycleW;
1893	});
1894	opts.cssFirst.top = 0;
1895	opts.cssBefore.left = 0;
1896	opts.cssBefore.height = 0;
1897	opts.animIn.top = 0;
1898	opts.animOut.height = 0;
1899};
1900$.fn.cycle.transitions.turnDown = function($cont, $slides, opts) {
1901	opts.before.push(function(curr, next, opts) {
1902		$.fn.cycle.commonReset(curr,next,opts,true,false);
1903		opts.animIn.height = next.cycleH;
1904		opts.animOut.top   = curr.cycleH;
1905	});
1906	opts.cssFirst.top = 0;
1907	opts.cssBefore.left = 0;
1908	opts.cssBefore.top = 0;
1909	opts.cssBefore.height = 0;
1910	opts.animOut.height = 0;
1911};
1912$.fn.cycle.transitions.turnLeft = function($cont, $slides, opts) {
1913	opts.before.push(function(curr, next, opts) {
1914		$.fn.cycle.commonReset(curr,next,opts,false,true);
1915		opts.cssBefore.left = next.cycleW;
1916		opts.animIn.width = next.cycleW;
1917	});
1918	opts.cssBefore.top = 0;
1919	opts.cssBefore.width = 0;
1920	opts.animIn.left = 0;
1921	opts.animOut.width = 0;
1922};
1923$.fn.cycle.transitions.turnRight = function($cont, $slides, opts) {
1924	opts.before.push(function(curr, next, opts) {
1925		$.fn.cycle.commonReset(curr,next,opts,false,true);
1926		opts.animIn.width = next.cycleW;
1927		opts.animOut.left = curr.cycleW;
1928	});
1929	$.extend(opts.cssBefore, { top: 0, left: 0, width: 0 });
1930	opts.animIn.left = 0;
1931	opts.animOut.width = 0;
1932};
1933
1934// zoom
1935$.fn.cycle.transitions.zoom = function($cont, $slides, opts) {
1936	opts.before.push(function(curr, next, opts) {
1937		$.fn.cycle.commonReset(curr,next,opts,false,false,true);
1938		opts.cssBefore.top = next.cycleH/2;
1939		opts.cssBefore.left = next.cycleW/2;
1940		$.extend(opts.animIn, { top: 0, left: 0, width: next.cycleW, height: next.cycleH });
1941		$.extend(opts.animOut, { width: 0, height: 0, top: curr.cycleH/2, left: curr.cycleW/2 });
1942	});
1943	opts.cssFirst.top = 0;
1944	opts.cssFirst.left = 0;
1945	opts.cssBefore.width = 0;
1946	opts.cssBefore.height = 0;
1947};
1948
1949// fadeZoom
1950$.fn.cycle.transitions.fadeZoom = function($cont, $slides, opts) {
1951	opts.before.push(function(curr, next, opts) {
1952		$.fn.cycle.commonReset(curr,next,opts,false,false);
1953		opts.cssBefore.left = next.cycleW/2;
1954		opts.cssBefore.top = next.cycleH/2;
1955		$.extend(opts.animIn, { top: 0, left: 0, width: next.cycleW, height: next.cycleH });
1956	});
1957	opts.cssBefore.width = 0;
1958	opts.cssBefore.height = 0;
1959	opts.animOut.opacity = 0;
1960};
1961
1962// blindX
1963$.fn.cycle.transitions.blindX = function($cont, $slides, opts) {
1964	var w = $cont.css('overflow','hidden').width();
1965	opts.before.push(function(curr, next, opts) {
1966		$.fn.cycle.commonReset(curr,next,opts);
1967		opts.animIn.width = next.cycleW;
1968		opts.animOut.left   = curr.cycleW;
1969	});
1970	opts.cssBefore.left = w;
1971	opts.cssBefore.top = 0;
1972	opts.animIn.left = 0;
1973	opts.animOut.left = w;
1974};
1975// blindY
1976$.fn.cycle.transitions.blindY = function($cont, $slides, opts) {
1977	var h = $cont.css('overflow','hidden').height();
1978	opts.before.push(function(curr, next, opts) {
1979		$.fn.cycle.commonReset(curr,next,opts);
1980		opts.animIn.height = next.cycleH;
1981		opts.animOut.top   = curr.cycleH;
1982	});
1983	opts.cssBefore.top = h;
1984	opts.cssBefore.left = 0;
1985	opts.animIn.top = 0;
1986	opts.animOut.top = h;
1987};
1988// blindZ
1989$.fn.cycle.transitions.blindZ = function($cont, $slides, opts) {
1990	var h = $cont.css('overflow','hidden').height();
1991	var w = $cont.width();
1992	opts.before.push(function(curr, next, opts) {
1993		$.fn.cycle.commonReset(curr,next,opts);
1994		opts.animIn.height = next.cycleH;
1995		opts.animOut.top   = curr.cycleH;
1996	});
1997	opts.cssBefore.top = h;
1998	opts.cssBefore.left = w;
1999	opts.animIn.top = 0;
2000	opts.animIn.left = 0;
2001	opts.animOut.top = h;
2002	opts.animOut.left = w;
2003};
2004
2005// growX - grow horizontally from centered 0 width
2006$.fn.cycle.transitions.growX = function($cont, $slides, opts) {
2007	opts.before.push(function(curr, next, opts) {
2008		$.fn.cycle.commonReset(curr,next,opts,false,true);
2009		opts.cssBefore.left = this.cycleW/2;
2010		opts.animIn.left = 0;
2011		opts.animIn.width = this.cycleW;
2012		opts.animOut.left = 0;
2013	});
2014	opts.cssBefore.top = 0;
2015	opts.cssBefore.width = 0;
2016};
2017// growY - grow vertically from centered 0 height
2018$.fn.cycle.transitions.growY = function($cont, $slides, opts) {
2019	opts.before.push(function(curr, next, opts) {
2020		$.fn.cycle.commonReset(curr,next,opts,true,false);
2021		opts.cssBefore.top = this.cycleH/2;
2022		opts.animIn.top = 0;
2023		opts.animIn.height = this.cycleH;
2024		opts.animOut.top = 0;
2025	});
2026	opts.cssBefore.height = 0;
2027	opts.cssBefore.left = 0;
2028};
2029
2030// curtainX - squeeze in both edges horizontally
2031$.fn.cycle.transitions.curtainX = function($cont, $slides, opts) {
2032	opts.before.push(function(curr, next, opts) {
2033		$.fn.cycle.commonReset(curr,next,opts,false,true,true);
2034		opts.cssBefore.left = next.cycleW/2;
2035		opts.animIn.left = 0;
2036		opts.animIn.width = this.cycleW;
2037		opts.animOut.left = curr.cycleW/2;
2038		opts.animOut.width = 0;
2039	});
2040	opts.cssBefore.top = 0;
2041	opts.cssBefore.width = 0;
2042};
2043// curtainY - squeeze in both edges vertically
2044$.fn.cycle.transitions.curtainY = function($cont, $slides, opts) {
2045	opts.before.push(function(curr, next, opts) {
2046		$.fn.cycle.commonReset(curr,next,opts,true,false,true);
2047		opts.cssBefore.top = next.cycleH/2;
2048		opts.animIn.top = 0;
2049		opts.animIn.height = next.cycleH;
2050		opts.animOut.top = curr.cycleH/2;
2051		opts.animOut.height = 0;
2052	});
2053	opts.cssBefore.height = 0;
2054	opts.cssBefore.left = 0;
2055};
2056
2057// cover - curr slide covered by next slide
2058$.fn.cycle.transitions.cover = function($cont, $slides, opts) {
2059	var d = opts.direction || 'left';
2060	var w = $cont.css('overflow','hidden').width();
2061	var h = $cont.height();
2062	opts.before.push(function(curr, next, opts) {
2063		$.fn.cycle.commonReset(curr,next,opts);
2064		opts.cssAfter.display = '';
2065		if (d == 'right')
2066			opts.cssBefore.left = -w;
2067		else if (d == 'up')
2068			opts.cssBefore.top = h;
2069		else if (d == 'down')
2070			opts.cssBefore.top = -h;
2071		else
2072			opts.cssBefore.left = w;
2073	});
2074	opts.animIn.left = 0;
2075	opts.animIn.top = 0;
2076	opts.cssBefore.top = 0;
2077	opts.cssBefore.left = 0;
2078};
2079
2080// uncover - curr slide moves off next slide
2081$.fn.cycle.transitions.uncover = function($cont, $slides, opts) {
2082	var d = opts.direction || 'left';
2083	var w = $cont.css('overflow','hidden').width();
2084	var h = $cont.height();
2085	opts.before.push(function(curr, next, opts) {
2086		$.fn.cycle.commonReset(curr,next,opts,true,true,true);
2087		if (d == 'right')
2088			opts.animOut.left = w;
2089		else if (d == 'up')
2090			opts.animOut.top = -h;
2091		else if (d == 'down')
2092			opts.animOut.top = h;
2093		else
2094			opts.animOut.left = -w;
2095	});
2096	opts.animIn.left = 0;
2097	opts.animIn.top = 0;
2098	opts.cssBefore.top = 0;
2099	opts.cssBefore.left = 0;
2100};
2101
2102// toss - move top slide and fade away
2103$.fn.cycle.transitions.toss = function($cont, $slides, opts) {
2104	var w = $cont.css('overflow','visible').width();
2105	var h = $cont.height();
2106	opts.before.push(function(curr, next, opts) {
2107		$.fn.cycle.commonReset(curr,next,opts,true,true,true);
2108		// provide default toss settings if animOut not provided
2109		if (!opts.animOut.left && !opts.animOut.top)
2110			$.extend(opts.animOut, { left: w*2, top: -h/2, opacity: 0 });
2111		else
2112			opts.animOut.opacity = 0;
2113	});
2114	opts.cssBefore.left = 0;
2115	opts.cssBefore.top = 0;
2116	opts.animIn.left = 0;
2117};
2118
2119// wipe - clip animation
2120$.fn.cycle.transitions.wipe = function($cont, $slides, opts) {
2121	var w = $cont.css('overflow','hidden').width();
2122	var h = $cont.height();
2123	opts.cssBefore = opts.cssBefore || {};
2124	var clip;
2125	if (opts.clip) {
2126		if (/l2r/.test(opts.clip))
2127			clip = 'rect(0px 0px '+h+'px 0px)';
2128		else if (/r2l/.test(opts.clip))
2129			clip = 'rect(0px '+w+'px '+h+'px '+w+'px)';
2130		else if (/t2b/.test(opts.clip))
2131			clip = 'rect(0px '+w+'px 0px 0px)';
2132		else if (/b2t/.test(opts.clip))
2133			clip = 'rect('+h+'px '+w+'px '+h+'px 0px)';
2134		else if (/zoom/.test(opts.clip)) {
2135			var top = parseInt(h/2,10);
2136			var left = parseInt(w/2,10);
2137			clip = 'rect('+top+'px '+left+'px '+top+'px '+left+'px)';
2138		}
2139	}
2140
2141	opts.cssBefore.clip = opts.cssBefore.clip || clip || 'rect(0px 0px 0px 0px)';
2142
2143	var d = opts.cssBefore.clip.match(/(\d+)/g);
2144	var t = parseInt(d[0],10), r = parseInt(d[1],10), b = parseInt(d[2],10), l = parseInt(d[3],10);
2145
2146	opts.before.push(function(curr, next, opts) {
2147		if (curr == next) return;
2148		var $curr = $(curr), $next = $(next);
2149		$.fn.cycle.commonReset(curr,next,opts,true,true,false);
2150		opts.cssAfter.display = 'block';
2151
2152		var step = 1, count = parseInt((opts.speedIn / 13),10) - 1;
2153		(function f() {
2154			var tt = t ? t - parseInt(step * (t/count),10) : 0;
2155			var ll = l ? l - parseInt(step * (l/count),10) : 0;
2156			var bb = b < h ? b + parseInt(step * ((h-b)/count || 1),10) : h;
2157			var rr = r < w ? r + parseInt(step * ((w-r)/count || 1),10) : w;
2158			$next.css({ clip: 'rect('+tt+'px '+rr+'px '+bb+'px '+ll+'px)' });
2159			(step++ <= count) ? setTimeout(f, 13) : $curr.css('display', 'none');
2160		})();
2161	});
2162	$.extend(opts.cssBefore, { display: 'block', opacity: 1, top: 0, left: 0 });
2163	opts.animIn	   = { left: 0 };
2164	opts.animOut   = { left: 0 };
2165};
2166
2167})(jQuery);
2168;
2169/**
2170 *  @file
2171 *  A simple jQuery Cycle Div Slideshow Rotator.
2172 */
2173
2174/**
2175 * This will set our initial behavior, by starting up each individual slideshow.
2176 */
2177(function ($) {
2178  Drupal.behaviors.viewsSlideshowCycle = {
2179    attach: function (context) {
2180      $('.views_slideshow_cycle_main:not(.viewsSlideshowCycle-processed)', context).addClass('viewsSlideshowCycle-processed').each(function() {
2181        var fullId = '#' + $(this).attr('id');
2182        var settings = Drupal.settings.viewsSlideshowCycle[fullId];
2183        settings.targetId = '#' + $(fullId + " :first").attr('id');
2184
2185        settings.slideshowId = settings.targetId.replace('#views_slideshow_cycle_teaser_section_', '');
2186        // Pager after function.
2187        var pager_after_fn = function(curr, next, opts) {
2188          // Need to do some special handling on first load.
2189          var slideNum = opts.currSlide;
2190          if (typeof settings.processedAfter == 'undefined' || !sett
2190ings.processedAfter) {
2191            settings.processedAfter = 1;
2192            slideNum = (typeof settings.opts.startingSlide == 'undefined') ? 0 : settings.opts.startingSlide;
2193          }
2194          if (settings.pause_after_slideshow) {
2195            opts.counter += 1;
2196            if (opts.counter == settings.num_divs + 1) {
2197              opts.counter = 1;
2198              Drupal.viewsSlideshow.action({ "action": 'pause', "slideshowID": settings.slideshowId, "force": true });
2199            }
2200          }
2201          Drupal.viewsSlideshow.action({ "action": 'transitionEnd', "slideshowID": settings.slideshowId, "slideNum": slideNum });
2202        }
2203        // Pager before function.
2204        var pager_before_fn = function(curr, next, opts) {
2205          $(document).trigger('drupal:views_slideshow_cycle:before', {
2206            curr: curr, next: next, opts: opts, settings: settings
2207          });
2208
2209          var slideNum = opts.nextSlide;
2210
2211          // Remember last slide.
2212          if (settings.remember_slide) {
2213            createCookie(settings.vss_id, slideNum, settings.remember_slide_days);
2214          }
2215
2216          // Make variable height.
2217          if (!settings.fixed_height) {
2218            //get the height of the current slide
2219            var $ht = $(next).height();
2220            //set the container's height to that of the current slide
2221            $(next).parent().animate({height: $ht});
2222          }
2223
2224          // Need to do some special handling on first load.
2225          if (typeof settings.processedBefore == 'undefined' || !settings.processedBefore) {
2226            settings.processedBefore = 1;
2227            slideNum = (typeof opts.startingSlide == 'undefined') ? 0 : opts.startingSlide;
2228          }
2229
2230          Drupal.viewsSlideshow.action({ "action": 'transitionBegin', "slideshowID": settings.slideshowId, "slideNum": slideNum });
2231        }
2232        settings.loaded = false;
2233
2234        settings.opts = {
2235          speed:settings.speed,
2236          timeout:settings.timeout,
2237          delay:settings.delay,
2238          sync:settings.sync,
2239          random:settings.random,
2240          nowrap:settings.nowrap,
2241          pause_after_slideshow:settings.pause_after_slideshow,
2242          counter:0,
2243          after:pager_after_fn,
2244          before:pager_before_fn,
2245          cleartype:(settings.cleartype)? true : false,
2246          cleartypeNoBg:(settings.cleartypenobg)? true : false
2247        }
2248
2249        // Set the starting slide if we are supposed to remember the slide
2250        if (settings.remember_slide) {
2251          var startSlide = readCookie(settings.vss_id);
2252          if (startSlide == null) {
2253            startSlide = 0;
2254          }
2255          settings.opts.startingSlide = parseInt(startSlide);
2256        }
2257
2258        if (settings.effect == 'none') {
2259          settings.opts.speed = 1;
2260        }
2261        else {
2262          settings.opts.fx = settings.effect;
2263        }
2264
2265        // Take starting item from fragment.
2266        var hash = location.hash;
2267        if (hash) {
2268          var hash = hash.replace('#', '');
2269          var aHash = hash.split(';');
2270          var aHashLen = aHash.length;
2271
2272          // Loop through all the possible starting points.
2273          for (var i = 0; i < aHashLen; i++) {
2274            // Split the hash into two parts. One part is the slideshow id the
2275            // other is the slide number.
2276            var initialInfo = aHash[i].split(':');
2277            // The id in the hash should match our slideshow.
2278            // The slide number chosen shouldn't be larger than the number of
2279            // slides we have.
2280            if (settings.slideshowId == initialInfo[0] && settings.num_divs > initialInfo[1]) {
2281              settings.opts.startingSlide = parseInt(initialInfo[1]);
2282            }
2283          }
2284        }
2285
2286        // Pause on hover.
2287        if (settings.pause) {
2288          var mouseIn = function() {
2289            Drupal.viewsSlideshow.action({ "action": 'pause', "slideshowID": settings.slideshowId });
2290          }
2291
2292          var mouseOut = function() {
2293            Drupal.viewsSlideshow.action({ "action": 'play', "slideshowID": settings.slideshowId });
2294          }
2295
2296          if (jQuery.fn.hoverIntent) {
2297            $('#views_slideshow_cycle_teaser_section_' + settings.vss_id).hoverIntent(mouseIn, mouseOut);
2298          }
2299          else {
2300            $('#views_slideshow_cycle_teaser_section_' + settings.vss_id).hover(mouseIn, mouseOut);
2301          }
2302        }
2303
2304        // Play on hover.
2305        if (settings.play_on_hover) {
2306          var mouseIn = function() {
2307            Drupal.viewsSlideshow.action({ "action": 'play', "slideshowID": settings.slideshowId, "force": true });
2308          }
2309
2310          var mouseOut = function() {
2311            Drupal.viewsSlideshow.action({ "action": 'pause', "slideshowID": settings.slideshowId });
2312          }
2313
2314          if (jQuery.fn.hoverIntent) {
2315            $('#views_slideshow_cycle_teaser_section_' + settings.vss_id).hoverIntent(mouseIn, mouseOut);
2316          }
2317          else {
2318            $('#views_slideshow_cycle_teaser_section_' + settings.vss_id).hover(mouseIn, mouseOut);
2319          }
2320        }
2321
2322        // Pause on clicking of the slide.
2323        if (settings.pause_on_click) {
2324          $('#views_slideshow_cycle_teaser_section_' + settings.vss_id).click(function() {
2325            Drupal.viewsSlideshow.action({ "action": 'pause', "slideshowID": settings.slideshowId, "force": true });
2326          });
2327        }
2328
2329        if (typeof JSON != 'undefined') {
2330          var advancedOptions = JSON.parse(settings.advanced_options);
2331          for (var option in advancedOptions) {
2332            switch(option) {
2333
2334              // Standard Options
2335              case "activePagerClass":
2336              case "allowPagerClickBubble":
2337              case "autostop":
2338              case "autostopCount":
2339              case "backwards":
2340              case "bounce":
2341              case "cleartype":
2342              case "cleartypeNoBg":
2343              case "containerResize":
2344              case "continuous":
2345              case "delay":
2346              case "easeIn":
2347              case "easeOut":
2348              case "easing":
2349              case "fastOnEvent":
2350              case "fit":
2351              case "fx":
2352              case "manualTrump":
2353              case "metaAttr":
2354              case "next":
2355              case "nowrap":
2356              case "pager":
2357              case "pagerEvent":
2358              case "pause":
2359              case "pauseOnPagerHover":
2360              case "prev":
2361              case "prevNextEvent":
2362              case "random":
2363              case "randomizeEffects":
2364              case "requeueOnImageNotLoaded":
2365              case "requeueTimeout":
2366              case "rev":
2367              case "slideExpr":
2368              case "slideResize":
2369              case "speed":
2370              case "speedIn":
2371              case "speedOut":
2372              case "startingSlide":
2373              case "sync":
2374              case "timeout":
2375                var optionValue = advancedOptions[option];
2376                optionValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(optionValue);
2377                settings.opts[option] = optionValue;
2378                break;
2379
2380              // If width is set we need to disable resizing.
2381              case "width":
2382                var optionValue = advancedOptions["width"];
2383                optionValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(optionValue);
2384                settings.opts["width"] = optionValue;
2385                settings.opts["containerResize"] = 0;
2386                break;
2387
2388              // If height is set we need to set fixed_height to true.
2389              case "height":
2390                var optionValue = advancedOptions["height"];
2391                optionValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(optionValue);
2392                settings.opts["height"] = optionValue;
2393                settings.fixed_height = 1;
2394                break;
2395
2396              // These process options that look like {top:50, bottom:20}
2397              case "animIn":
2398              case "animInDelay":
2399              case "animOut":
2400              case "animOutDelay":
2401              case "cssBefore":
2402              case "cssAfter":
2403              case "shuffle":
2404                var cssValue = advancedOptions[option];
2405                cssValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(cssValue);
2406                settings.opts[option] = eval('(' + cssValue + ')');
2407                break;
2408
2409              // These options have their own functions.
2410              case "after":
2411                var afterValue = advancedOptions[option];
2412                afterValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(afterValue);
2413                // transition callback (scope set to element that was shown): function(currSlideElement, nextSlideElement, options, forwardFlag)
2414                settings.opts[option] = function(currSlideElement, nextSlideElement, options, forwardFlag) {
2415                  pager_after_fn(currSlideElement, nextSlideElement, options);
2416                  eval(afterValue);
2417                }
2418                break;
2419
2420              case "before":
2421                var beforeValue = advancedOptions[option];
2422                beforeValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(beforeValue);
2423                // transition callback (scope set to element to be shown):     function(currSlideElement, nextSlideElement, options, forwardFlag)
2424                settings.opts[option] = function(currSlideElement, nextSlideElement, options, forwardFlag) {
2425                  pager_before_fn(currSlideElement, nextSlideElement, options);
2426                  eval(beforeValue);
2427                }
2428                break;
2429
2430              case "end":
2431                var endValue = advancedOptions[option];
2432                endValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(endValue);
2433                // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options)
2434                settings.opts[option] = function(options) {
2435                  eval(endValue);
2436                }
2437                break;
2438
2439              case "fxFn":
2440                var fxFnValue = advancedOptions[option];
2441                fxFnValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(fxFnValue);
2442                // function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag)
2443                settings.opts[option] = function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag) {
2444                  eval(fxFnValue);
2445                }
2446                break;
2447
2448              case "onPagerEvent":
2449                var onPagerEventValue = advancedOptions[option];
2450                onPagerEventValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(onPagerEventValue);
2451                settings.opts[option] = function(zeroBasedSlideIndex, slideElement) {
2452                  eval(onPagerEventValue);
2453                }
2454                break;
2455
2456              case "onPrevNextEvent":
2457                var onPrevNextEventValue = advancedOptions[option];
2458                onPrevNextEventValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(onPrevNextEventValue);
2459                settings.opts[option] = function(isNext, zeroBasedSlideIndex, slideElement) {
2460                  eval(onPrevNextEventValue);
2461                }
2462                break;
2463
2464              case "pagerAnchorBuilder":
2465                var pagerAnchorBuilderValue = advancedOptions[option];
2466                pagerAnchorBuilderValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(pagerAnchorBuilderValue);
2467                // callback fn for building anchor links:  function(index, DOMelement)
2468                settings.opts[option] = function(index, DOMelement) {
2469                  var returnVal = '';
2470                  eval(pagerAnchorBuilderValue);
2471                  return returnVal;
2472                }
2473                break;
2474
2475              case "pagerClick":
2476                var pagerClickValue = advancedOptions[option];
2477                pagerClickValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(pagerClickValue);
2478                // callback fn for pager clicks:    function(zeroBasedSlideIndex, slideElement)
2479                settings.opts[option] = function(zeroBasedSlideIndex, slideElement) {
2480                  eval(pagerClickValue);
2481                }
2482                break;
2483
2484              case "paused":
2485                var pausedValue = advancedOptions[option];
2486                pausedValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(pausedValue);
2487                // undocumented callback when slideshow is paused:    function(cont, opts, byHover)
2488                settings.opts[option] = function(cont, opts, byHover) {
2489                  eval(pausedValue);
2490                }
2491                break;
2492
2493              case "resumed":
2494                var resumedValue = advancedOptions[option];
2495                resumedValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(resumedValue);
2496                // undocumented callback when slideshow is resumed:    function(cont, opts, byHover)
2497                settings.opts[option] = function(cont, opts, byHover) {
2498                  eval(resumedValue);
2499                }
2500                break;
2501
2502              case "timeoutFn":
2503                var timeoutFnValue = advancedOptions[option];
2504                timeoutFnValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(timeoutFnValue);
2505                settings.opts[option] = function(currSlideElement, nextSlideElement, options, forwardFlag) {
2506                  // Set a sane return value unless function overrides it.
2507                  var returnVal = settings.timeout;
2508                  eval(timeoutFnValue);
2509                  return returnVal;
2510                }
2511                break;
2512
2513              case "updateActivePagerLink":
2514                var updateActivePagerLinkValue = advancedOptions[option];
2515                updateActivePagerLinkValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(updateActivePagerLinkValue);
2516                // callback fn invoked to update the active pager link (adds/removes activePagerClass style)
2517                settings.opts[option] = function(pager, currSlideIndex) {
2518                  eval(updateActivePagerLinkValue);
2519                }
2520                break;
2521            }
2522          }
2523        }
2524
2525        // If selected wait for the images to be loaded.
2526        // otherwise just load the slideshow.
2527        if (settings.wait_for_image_load) {
2528          // For IE/Chrome/Opera we if there are images then we need to make
2529          // sure the images are loaded before starting the slideshow.
2530          settings.totalImages = $(settings.targetId + ' img').length;
2531          if (settings.totalImages) {
2532            settings.loadedImages = 0;
2533
2534            // Add a load event for each image.
2535            $(settings.targetId + ' img').each(function() {
2536              var $imageElement = $(this);
2537              $imageElement.bind('load', function () {
2538                Drupal.viewsSlideshowCycle.imageWait(fullId);
2539              });
2540
2541              // Removing the source and adding it again will fire the load event.
2542              var imgSrc = $imageElement.attr('src');
2543              $imageElement.attr('src', '');
2544              $imageElement.attr('src', imgSrc);
2545            });
2546
2547            // We need to set a timeout so that the slideshow doesn't wait
2548            // indefinitely for all images to load.
2549            setTimeout("Drupal.viewsSlideshowCycle.load('" + fullId + "')", settings.wait_for_image_load_timeout);
2550          }
2551          else {
2552            Drupal.viewsSlideshowCycle.load(fullId);
2553          }
2554        }
2555        else {
2556          Drupal.viewsSlideshowCycle.load(fullId);
2557        }
2558      });
2559    }
2560  };
2561
2562  /**
2563   * Views Slideshow swipe support.
2564   */
2565  Drupal.behaviors.viewsSlideshowSwipe = {
2566    attach: function (context) {
2567      var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0));
2568      if (isTouch === true && $('.views-slideshow-cycle-main-frame').length) {
2569        var $slider = $('.views-slideshow-cycle-main-frame'),
2570          opts = {
2571            start: {x: 0, y: 0},
2572            end: {x: 0, y: 0},
2573            hdiff: 0,
2574            vdiff: 0,
2575            length: 0,
2576            angle: null,
2577            direction: null,
2578          },
2579          optsReset = $.extend(true, {}, opts),
2580         H_THRESHOLD =  110, // roughly one inch effective resolution on ipad
2581         V_THRESHOLD = 50;
2582        $slider.data('bw', opts)
2583        .bind('touchstart.cycle', function (e) {
2584          var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
2585          if (e.originalEvent.touches.length == 1) {
2586            var data = $(this).data('bw');
2587            data.start.x = touch.pageX;
2588            data.start.y = touch.pageY;
2589            $(this).data('bw', data);
2590          }
2591        })
2592        .bind('touchend.cycle', function (e) {
2593          var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
2594          var data = $(this).data('bw');
2595          data.end.x = touch.pageX;
2596          data.end.y = touch.pageY;
2597          $(this).data('bw', data);
2598          if (data.start.x != 0 && data.start.y != 0) {
2599            data.vdiff = data.start.x - data.end.x;
2600            data.hdiff = data.end.y - data.start.y;
2601            if (Math.abs(data.vdiff) == data.start.x && Math.abs(data.hdiff) == data.start.y) {
2602              data.vdiff = 0;
2603              data.hdiff = 0;
2604            }
2605            var length = Math.round(Math.sqrt(Math.pow(data.vdiff,2) + Math.pow(data.hdiff,2)));
2606            var rads = Math.atan2(data.hdiff, data.vdiff);
2607            var angle = Math.round(rads*180/Math.PI);
2608            if (angle < 0) { angle = 360 - Math.abs(angle); }
2609            if (length > H_THRESHOLD && V_THRESHOLD > data.hdiff) {
2610              e.preventDefault();
2611              if (angle > 135 && angle < 225) {
2612                var cyopt = $slider.data('cycle.opts');
2613                if (cyopt.currSlide > 0) {
2614                  $slider.cycle((cyopt.currSlide - 1), 'scrollRight');
2615                }
2616                else {
2617                   $slider.cycle((cyopt.slideCount - 1), 'scrollRight');
2618                }
2619              }
2620              else if (angle > 315 || angle < 45) {
2621                $slider.cycle('next');
2622              }
2623            }
2624          }
2625          data = $.extend(true, {}, optsReset);
2626        });
2627      }
2628    }
2629  };
2630
2631  Drupal.viewsSlideshowCycle = Drupal.viewsSlideshowCycle || {};
2632
2633  // Cleanup the values of advanced options.
2634  Drupal.viewsSlideshowCycle.advancedOptionCleanup = function(value) {
2635    value = $.trim(value);
2636    value = value.replace(/\n/g, '');
2637    if (value.match(/^[\d.]+%$/)) {
2638      // noop
2639    }
2640    else if (!isNaN(parseInt(value))) {
2641      value = parseInt(value);
2642    }
2643    else if (value.toLowerCase() == 'true') {
2644      value = true;
2645    }
2646    else if (value.toLowerCase() == 'false') {
2647      value = false;
2648    }
2649
2650    return value;
2651  }
2652
2653  // This checks to see if all the images have been loaded.
2654  // If they have then it starts the slideshow.
2655  Drupal.viewsSlideshowCycle.imageWait = function(fullId) {
2656    if (++Drupal.settings.viewsSlideshowCycle[fullId].loadedImages == Drupal.settings.viewsSlideshowCycle[fullId].totalImages) {
2657      Drupal.viewsSlideshowCycle.load(fullId);
2658    }
2659  };
2660
2661  // Start the slideshow.
2662  Drupal.viewsSlideshowCycle.load = function (fullId) {
2663    var settings = Drupal.settings.viewsSlideshowCycle[fullId];
2664
2665    // Make sure the slideshow isn't already loaded.
2666    if (!settings.loaded) {
2667      $(settings.targetId).cycle(settings.opts);
2668      $(settings.targetId).parent().parent().addClass('views-slideshow-cycle-processed');
2669      settings.loaded = true;
2670
2671      // Start Paused
2672      if (settings.start_paused) {
2673        Drupal.viewsSlideshow.action({ "action": 'pause', "slideshowID": settings.slideshowId, "force": true });
2674      }
2675
2676      // Pause if hidden.
2677      if (settings.pause_when_hidden) {
2678        var checkPause = function(settings) {
2679          // If the slideshow is visible and it is paused then resume.
2680          // otherwise if the slideshow is not visible and it is not paused then
2681          // pause it.
2682          var visible = viewsSlideshowCycleIsVisible(settings.targetId, settings.pause_when_hidden_type, settings.amount_allowed_visible);
2683          if (visible) {
2684            Drupal.viewsSlideshow.action({ "action": 'play', "slideshowID": settings.slideshowId });
2685          }
2686          else {
2687            Drupal.viewsSlideshow.action({ "action": 'pause', "slideshowID": settings.slideshowId });
2688          }
2689        }
2690
2691        // Check when scrolled.
2692        $(window).scroll(function() {
2693         checkPause(settings);
2694        });
2695
2696        // Check when the window is resized.
2697        $(window).resize(function() {
2698          checkPause(settings);
2699        });
2700      }
2701    }
2702  };
2703
2704  Drupal.viewsSlideshowCycle.pause = function (options) {
2705    //Eat TypeError, cycle doesn't handle pause well if options isn't defined.
2706    try{
2707      if (options.pause_in_middle && $.fn.pause) {
2708        $('#views_slideshow_cycle_teaser_section_' + options.slideshowID).pause();
2709      }
2710      else {
2711        $('#views_slideshow_cycle_teaser_section_' + options.slideshowID).cycle('pause');
2712      }
2713    }
2714    catch(e){
2715      if(!e instanceof TypeError){
2716        throw e;
2717      }
2718    }
2719  };
2720
2721  Drupal.viewsSlideshowCycle.play = function (options) {
2722    Drupal.settings.viewsSlideshowCycle['#views_slideshow_cycle_main_' + options.slideshowID].paused = false;
2723    if (options.pause_in_middle && $.fn.resume) {
2724      $('#views_slideshow_cycle_teaser_section_' + options.slideshowID).resume();
2725    }
2726    else {
2727      $('#views_slideshow_cycle_teaser_section_' + options.slideshowID).cycle('resume');
2728    }
2729  };
2730
2731  Drupal.viewsSlideshowCycle.previousSlide = function (options) {
2732    $('#views_slideshow_cycle_teaser_section_' + options.slideshowID).cycle('prev');
2733  };
2734
2735  Drupal.viewsSlideshowCycle.nextSlide = function (options) {
2736    $('#views_slideshow_cycle_teaser_section_' + options.slideshowID).cycle('next');
2737  };
2738
2739  Drupal.viewsSlideshowCycle.goToSlide = function (options) {
2740    $('#views_slideshow_cycle_teaser_section_' + options.slideshowID).cycle(options.slideNum);
2741  };
2742
2743  // Verify that the value is a number.
2744  function IsNumeric(sText) {
2745    var ValidChars = "0123456789";
2746    var IsNumber=true;
2747    var Char;
2748
2749    for (var i=0; i < sText.length && IsNumber == true; i++) {
2750      Char = sText.charAt(i);
2751      if (ValidChars.indexOf(Char) == -1) {
2752        IsNumber = false;
2753      }
2754    }
2755    return IsNumber;
2756  }
2757
2758  /**
2759   * Cookie Handling Functions
2760   */
2761  function createCookie(name,value,days) {
2762    if (days) {
2763      var date = new Date();
2764      date.setTime(date.getTime()+(days*24*60*60*1000));
2765      var expires = "; expires="+date.toGMTString();
2766    }
2767    else {
2768      var expires = "";
2769    }
2770    document.cookie = name+"="+value+expires+"; path=/";
2771  }
2772
2773  function readCookie(name) {
2774    var nameEQ = name + "=";
2775    var ca = document.cookie.split(';');
2776    for(var i=0;i < ca.length;i++) {
2777      var c = ca[i];
2778      while (c.charAt(0)==' ') c = c.substring(1,c.length);
2779      if (c.indexOf(nameEQ) == 0) {
2780        return c.substring(nameEQ.length,c.length);
2781      }
2782    }
2783    return null;
2784  }
2785
2786  function eraseCookie(name) {
2787    createCookie(name,"",-1);
2788  }
2789
2790  /**
2791   * Checks to see if the slide is visible enough.
2792   * elem = element to check.
2793   * type = The way to calculate how much is visible.
2794   * amountVisible = amount that should be visible. Either in percent or px. If
2795   *                it's not defined then all of the slide must be visible.
2796   *
2797   * Returns true or false
2798   */
2799  function viewsSlideshowCycleIsVisible(elem, type, amountVisible) {
2800    // Get the top and bottom of the window;
2801    var docViewTop = $(window).scrollTop();
2802    var docViewBottom = docViewTop + $(window).height();
2803    var docViewLeft = $(window).scrollLeft();
2804    var docViewRight = docViewLeft + $(window).width();
2805
2806    // Get the top, bottom, and height of the slide;
2807    var elemTop = $(elem).offset().top;
2808    var elemHeight = $(elem).height();
2809    var elemBottom = elemTop + elemHeight;
2810    var elemLeft = $(elem).offset().left;
2811    var elemWidth = $(elem).width();
2812    var elemRight = elemLeft + elemWidth;
2813    var elemArea = elemHeight * elemWidth;
2814
2815    // Calculate what's hiding in the slide.
2816    var missingLeft = 0;
2817    var missingRight = 0;
2818    var missingTop = 0;
2819    var missingBottom = 0;
2820
2821    // Find out how much of the slide is missing from the left.
2822    if (elemLeft < docViewLeft) {
2823      missingLeft = docViewLeft - elemLeft;
2824    }
2825
2826    // Find out how much of the slide is missing from the right.
2827    if (elemRight > docViewRight) {
2828      missingRight = elemRight - docViewRight;
2829    }
2830
2831    // Find out how much of the slide is missing from the top.
2832    if (elemTop < docViewTop) {
2833      missingTop = docViewTop - elemTop;
2834    }
2835
2836    // Find out how much of the slide is missing from the bottom.
2837    if (elemBottom > docViewBottom) {
2838      missingBottom = elemBottom - docViewBottom;
2839    }
2840
2841    // If there is no amountVisible defined then check to see if the whole slide
2842    // is visible.
2843    if (type == 'full') {
2844      return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom)
2845      && (elemBottom <= docViewBottom) &&  (elemTop >= docViewTop)
2846      && (elemLeft >= docViewLeft) && (elemRight <= docViewRight)
2847      && (elemLeft <= docViewRight) && (elemRight >= docViewLeft));
2848    }
2849    else if(type == 'vertical') {
2850      var verticalShowing = elemHeight - missingTop - missingBottom;
2851
2852      // If user specified a percentage then find out if the current shown percent
2853      // is larger than the allowed percent.
2854      // Otherwise check to see if the amount of px shown is larger than the
2855      // allotted amount.
2856      if (typeof amountVisible === 'string' && amountVisible.indexOf('%')) {
2857        return (((verticalShowing/elemHeight)*100) >= parseInt(amountVisible));
2858      }
2859      else {
2860        return (verticalShowing >= parseInt(amountVisible));
2861      }
2862    }
2863    else if(type == 'horizontal') {
2864      var horizontalShowing = elemWidth - missingLeft - missingRight;
2865
2866      // If user specified a percentage then find out if the current shown percent
2867      // is larger than the allowed percent.
2868      // Otherwise check to see if the amount of px shown is larger than the
2869      // allotted amount.
2870      if (typeof amountVisible === 'string' && amountVisible.indexOf('%')) {
2871        return (((horizontalShowing/elemWidth)*100) >= parseInt(amountVisible));
2872      }
2873      else {
2874        return (horizontalShowing >= parseInt(amountVisible));
2875      }
2876    }
2877    else if(type == 'area') {
2878      var areaShowing = (elemWidth - missingLeft - missingRight) * (elemHeight - missingTop - missingBottom);
2879
2880      // If user specified a percentage then find out if the current shown percent
2881      // is larger than the allowed percent.
2882      // Otherwise check to see if the amount of px shown is larger than the
2883      // allotted amount.
2884      if (typeof amountVisible === 'string' && amountVisible.indexOf('%')) {
2885        return (((areaShowing/elemArea)*100) >= parseInt(amountVisible));
2886      }
2887      else {
2888        return (areaShowing >= parseInt(amountVisible));
2889      }
2890    }
2891  }
2892})(jQuery);
2893;
2894/*!
2895 * jCarousel - Riding carousels with jQuery
2896 *   http://sorgalla.com/jcarousel/
2897 *
2898 * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
2899 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
2900 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
2901 *
2902 * Built on top of the jQuery library
2903 *   http://jquery.com
2904 *
2905 * Inspired by the "Carousel Component" by Bill Scott
2906 *   http://billwscott.com/carousel/
2907 */
2908
2909(function(c){var d={vertical:false,rtl:false,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,setupCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,animationStepCallback:null,buttonNextHTML:"<div></div>",buttonPrevHTML:"<div></div>",buttonNextEvent:"click",buttonPrevEvent:"click",buttonNextCallback:null,buttonPrevCallback:null,itemFallbackDimension:null},b=false;
2909c(window).bind("load.jcarousel",function(){b=true});c.jcarousel=function(l,g){this.options=c.extend({},d,g||{});this.locked=false;this.autoStopped=false;this.container=null;this.clip=null;this.list=null;this.buttonNext=null;this.buttonPrev=null;this.buttonNextState=null;this.buttonPrevState=null;if(!g||g.rtl===undefined){this.options.rtl=(c(l).attr("dir")||c("html").attr("dir")||"").toLowerCase()=="rtl"}this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical?(this.options.rtl?"right":"left"):"top";var q="",n=l.className.split(" ");for(var k=0;k<n.length;k++){if(n[k].indexOf("jcarousel-skin")!=-1){c(l).removeClass(n[k]);q=n[k];break}}if(l.nodeName.toUpperCase()=="UL"||l.nodeName.toUpperCase()=="OL"){this.list=c(l);this.clip=this.list.parents(".jcarousel-clip");this.container=this.list.parents(".jcarousel-container")}else{this.container=c(l);this.list=this.container.find("ul,ol").eq(0);this.clip=this.container.find(".jcarousel-clip")}if(this.clip.size()===0){this.clip=this.list.wrap("<div></div>").parent()}if(this.container.size()===0){this.container=this.clip.wrap("<div></div>").parent()}if(q!==""&&this.container.parent()[0].className.indexOf("jcarousel-skin")==-1){this.container.wrap('<div class=" '+q+'"></div>')}this.buttonPrev=c(".jcarousel-prev",this.container);if(this.buttonPrev.size()===0&&this.options.buttonPrevHTML!==null){this.buttonPrev=c(this.options.buttonPrevHTML).appendTo(this.container)}this.buttonPrev.addClass(this.className("jcarousel-prev"));this.buttonNext=c(".jcarousel-next",this.container);if(this.buttonNext.size()===0&&this.options.buttonNextHTML!==null){this.buttonNext=c(this.options.buttonNextHTML).appendTo(this.container)}this.buttonNext.addClass(this.className("jcarousel-next"));this.clip.addClass(this.className("jcarousel-clip")).css({position:"relative"});this.list.addClass(this.className("jcarousel-list")).css({overflow:"hidden",position:"relative",top:0,margin:0,padding:0}).css((this.options.rtl?"right":"left"),0);this.container.addClass(this.className("jcarousel-container")).css({position:"relative"});if(!this.options.vertical&&this.options.rtl){this.container.addClass("jcarousel-direction-rtl").attr("dir","rtl")}var m=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;var p=this.list.children("li");var r=this;if(p.size()>0){var f=0,h=this.options.offset;p.each(function(){r.format(this,h++);f+=r.dimension(this,m)});this.list.css(this.wh,(f+100)+"px");if(!g||g.size===undefined){this.options.size=p.size()}}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display","block");this.funcNext=function(){r.next();return false};this.funcPrev=function(){r.prev();return false};this.funcResize=function(){if(r.resizeTimer){clearTimeout(r.resizeTimer)}r.resizeTimer=setTimeout(function(){r.reload()},100)};if(this.options.initCallback!==null){this.options.initCallback(this,"init")}if(!b&&a.isSafari()){this.buttons(false,false);c(window).bind("load.jcarousel",function(){r.setup()})}else{this.setup()}};var a=c.jcarousel;a.fn=a.prototype={jcarousel:"0.2.9"};a.fn.extend=a.extend=c.extend;a.fn.extend({setup:function(){this.first=null;this.last=null;this.prevFirst=null;this.prevLast=null;this.animating=false;this.timer=null;this.resizeTimer=null;this.tail=null;this.inTail=false;if(this.locked){return}this.list.css(this.lt,this.pos(this.options.offset)+"px");var e=this.pos(this.options.start,true);this.prevFirst=this.prevLast=null;this.animate(e,false);c(window).unbind("resize.jcarousel",this.funcResize).bind("resize.jcarousel",this.funcResize);if(this.options.setupCallback!==null){this.options.setupCallback(this)}},reset:function(){this.list.empty();this.list.css(this.lt,"0px");this.list.css(this.wh,"10px");if(this.options.initCallback!==null){this.options.initCallback(this,"reset")}this.setup()},reload:function(){if(this.tail!==null&&this.inTail){this.list.css(this.lt,a.intval(this.list.css(this.lt))+this.tail)}this.tail=null;this.inTail=false;if(this.options.reloadCallback!==null){this.options.reloadCallback(this)}if(this.options.visible!==null){var g=this;var h=Math.ceil(this.clipping()/this.options.visible),f=0,e=0;this.list.children("li").each(function(j){f+=g.dimension(this,h);
2909if(parseInt(jQuery(this).attr("jcarouselindex"))<g.first){e=f}});this.list.css(this.wh,f+"px");this.list.css(this.lt,-e+"px")}this.scroll(this.first,false)},lock:function(){this.locked=true;this.buttons()},unlock:function(){this.locked=false;this.buttons()},size:function(e){if(e!==undefined){this.options.size=e;if(!this.locked){this.buttons()}}return this.options.size},has:function(g,h){if(h===undefined||!h){h=g}if(this.options.size!==null&&h>this.options.size){h=this.options.size}for(var f=g;f<=h;f++){var k=this.get(f);if(!k.length||k.hasClass("jcarousel-item-placeholder")){return false}}return true},get:function(e){return c(">.jcarousel-item-"+e,this.list)},add:function(l,q){var m=this.get(l),h=0,g=c(q);if(m.length===0){var p,k=a.intval(l);m=this.create(l);while(true){p=this.get(--k);if(k<=0||p.length){if(k<=0){this.list.prepend(m)}else{p.after(m)}break}}}else{h=this.dimension(m)}if(g.get(0).nodeName.toUpperCase()=="LI"){m.replaceWith(g);m=g}else{m.empty().append(q)}this.format(m.removeClass(this.className("jcarousel-item-placeholder")),l);var o=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;var f=this.dimension(m,o)-h;if(l>0&&l<this.first){this.list.css(this.lt,a.intval(this.list.css(this.lt))-f+"px")}this.list.css(this.wh,a.intval(this.list.css(this.wh))+f+"px");return m},remove:function(f){var g=this.get(f);if(!g.length||(f>=this.first&&f<=this.last)){return}var h=this.dimension(g);if(f<this.first){this.list.css(this.lt,a.intval(this.list.css(this.lt))+h+"px")}g.remove();this.list.css(this.wh,a.intval(this.list.css(this.wh))-h+"px")},next:function(){if(this.tail!==null&&!this.inTail){this.scrollTail(false)}else{this.scroll(((this.options.wrap=="both"||this.options.wrap=="last")&&this.options.size!==null&&this.last==this.options.size)?1:this.first+this.options.scroll)}},prev:function(){if(this.tail!==null&&this.inTail){this.scrollTail(true)}else{this.scroll(((this.options.wrap=="both"||this.options.wrap=="first")&&this.options.size!==null&&this.first==1)?this.options.size:this.first-this.options.scroll)}},scrollTail:function(e){if(this.locked||this.animating||!this.tail){return}this.pauseAuto();var f=a.intval(this.list.css(this.lt));f=!e?f-this.tail:f+this.tail;this.inTail=!e;this.prevFirst=this.first;this.prevLast=this.last;this.animate(f)},scroll:function(f,e){if(this.locked||this.animating){return}this.pauseAuto();this.animate(this.pos(f),e)},pos:function(C,k){var n=a.intval(this.list.css(this.lt));if(this.locked||this.animating){return n}if(this.options.wrap!="circular"){C=C<1?1:(this.options.size&&C>this.options.size?this.options.size:C)}var z=this.first>C;var E=this.options.wrap!="circular"&&this.first<=1?1:this.first;var H=z?this.get(E):this.get(this.last);var B=z?E:E-1;var F=null,A=0,w=false,G=0,D;while(z?--B>=C:++B<C){F=this.get(B);w=!F.length;if(F.length===0){F=this.create(B).addClass(this.className("jcarousel-item-placeholder"));H[z?"before":"after"](F);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(B<=0||B>this.options.size)){D=this.get(this.index(B));if(D.length){F=this.add(B,D.clone(true))}}}H=F;G=this.dimension(F);if(w){A+=G}if(this.first!==null&&(this.options.wrap=="circular"||(B>=1&&(this.options.size===null||B<=this.options.size)))){n=z?n+G:n-G}}var s=this.clipping(),u=[],h=0,t=0;H=this.get(C-1);B=C;while(++h){F=this.get(B);w=!F.length;if(F.length===0){F=this.create(B).addClass(this.className("jcarousel-item-placeholder"));if(H.length===0){this.list.prepend(F)}else{H[z?"before":"after"](F)}if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(B<=0||B>this.options.size)){D=this.get(this.index(B));if(D.length){F=this.add(B,D.clone(true))}}}H=F;G=this.dimension(F);if(G===0){throw new Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...")}if(this.options.wrap!="circular"&&this.options.size!==null&&B>this.options.size){u.push(F)}else{if(w){A+=G}}t+=G;if(t>=s){break}B++}for(var r=0;r<u.length;r++){u[r].remove()}if(A>0){this.list.css(this.wh,this.dimension(this.list)+A+"px");if(z){n-=A;this.list.css(this.lt,a.intval(this.list.css(this.lt))-A+"px")}}var q=C+h-1;if(this.options.wrap!="circular"&&this.options.size&&q>this.options.size){q=this.options.size}if(B>q){h=0;B=q;t=0;while(++h){F=this.get(B--);if(!F.length){break}t+=this.dimension(F);if(t>=s){break}}}var o=q-h+1;if(this.options.wrap!="circular"&&o<1){o=1}if(this.inTail&&z){n+=this.tail;this.inTail=false}this.tail=null;if(this.options.wrap!="circular"&&q==this.options.size&&(q-h+1)>=1){var y=a.intval(this.get(q).css(!this.options.vertical?"marginRight":"marginBottom"));if((t-y)>s){this.tail=t-s-y}}if(k&&C===this.options.size&&this.tail){n-=this.tail;this.inTail=true}while(C-->o){n+=this.dimension(this.get(C))}this.prevFirst=this.first;this.prevLast=this.last;this.first=o;this.last=q;return n},animate:function(i,e){if(this.locked||this.animating){return}this.animating=true;var f=this;var g=function(){f.animating=false;if(i===0){f.list.css(f.lt,0)}if(!f.autoStopped&&(f.options.wrap=="circular"||f.options.wrap=="both"||f.options.wrap=="last"||f.options.size===null||f.last<f.options.size||(f.last==f.options.size&&f.tail!==null&&!f.inTail))){f.startAuto()}f.buttons();f.notify("onAfterAnimation");if(f.options.wrap=="circular"&&f.options.size!==null){for(var k=f.prevFirst;k<=f.prevLast;k++){if(k!==null&&!(k>=f.first&&k<=f.last)&&(k<1||k>f.options.size)){f.remove(k)}}}};this.notify("onBeforeAnimation");if(!this.options.animation||e===false){this.list.css(this.lt,i+"px");g()}else{var j=!this.options.vertical?(this.options.rtl?{right:i}:{left:i}):{top:i};var h={duration:this.options.animation,easing:this.options.easing,complete:g};if(c.isFunction(this.options.animationStepCallback)){h.step=this.options.animationStepCallback}this.list.animate(j,h)}},startAuto:function(f){if(f!==undefined){this.options.auto=f}if(this.options.auto===0){return this.stopAuto()}if(this.timer!==null){return}this.autoStopped=false;var e=this;this.timer=window.setTimeout(function(){e.next()},this.options.auto*1000)},stopAuto:function(){this.pauseAuto();this.autoStopped=true},pauseAuto:function(){if(this.timer===null){return}window.clearTimeout(this.timer);this.timer=null},buttons:function(g,f){if(g==null){g=!this.locked&&this.options.size!==0&&((this.options.wrap&&this.options.wrap!="first")||this.options.size===null||this.last<this.options.size);if(!this.locked&&(!this.options.wrap||this.options.wrap=="first")&&this.options.size!==null&&this.last>=this.options.size){g=this.tail!==null&&!this.inTail}}if(f==null){f=!this.locked&&this.options.size!==0&&((this.options.wrap&&this.options.wrap!="last")||this.first>1);if(!this.locked&&(!this.options.wrap||this.options.wrap=="last")&&this.options.size!==null&&this.first==1){f=this.tail!==null&&this.inTail}}var e=this;if(this.buttonNext.size()>0){this.buttonNext.unbind(this.options.buttonNextEvent+".jcarousel",this.funcNext);if(g){this.buttonNext.bind(this.options.buttonNextEvent+".jcarousel",this.funcNext)}this.buttonNext[g?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",g?false:true);if(this.options.buttonNextCallback!==null&&this.buttonNext.data("jcarou
2909selstate")!=g){this.buttonNext.each(function(){e.options.buttonNextCallback(e,this,g)}).data("jcarouselstate",g)}}else{if(this.options.buttonNextCallback!==null&&this.buttonNextState!=g){this.options.buttonNextCallback(e,null,g)}}if(this.buttonPrev.size()>0){this.buttonPrev.unbind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev);if(f){this.buttonPrev.bind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev)}this.buttonPrev[f?"removeClass":"addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",f?false:true);if(this.options.buttonPrevCallback!==null&&this.buttonPrev.data("jcarouselstate")!=f){this.buttonPrev.each(function(){e.options.buttonPrevCallback(e,this,f)}).data("jcarouselstate",f)}}else{if(this.options.buttonPrevCallback!==null&&this.buttonPrevState!=f){this.options.buttonPrevCallback(e,null,f)}}this.buttonNextState=g;this.buttonPrevState=f},notify:function(e){var f=this.prevFirst===null?"init":(this.prevFirst<this.first?"next":"prev");this.callback("itemLoadCallback",e,f);if(this.prevFirst!==this.first){this.callback("itemFirstInCallback",e,f,this.first);this.callback("itemFirstOutCallback",e,f,this.prevFirst)}if(this.prevLast!==this.last){this.callback("itemLastInCallback",e,f,this.last);this.callback("itemLastOutCallback",e,f,this.prevLast)}this.callback("itemVisibleInCallback",e,f,this.first,this.last,this.prevFirst,this.prevLast);this.callback("itemVisibleOutCallback",e,f,this.prevFirst,this.prevLast,this.first,this.last)},callback:function(j,m,e,k,h,g,f){if(this.options[j]==null||(typeof this.options[j]!="object"&&m!="onAfterAnimation")){return}var n=typeof this.options[j]=="object"?this.options[j][m]:this.options[j];if(!c.isFunction(n)){return}var o=this;if(k===undefined){n(o,e,m)}else{if(h===undefined){this.get(k).each(function(){n(o,this,k,e,m)})}else{var p=function(q){o.get(q).each(function(){n(o,this,q,e,m)})};for(var l=k;l<=h;l++){if(l!==null&&!(l>=g&&l<=f)){p(l)}}}}},create:function(e){return this.format("<li></li>",e)},format:function(k,h){k=c(k);var g=k.get(0).className.split(" ");for(var f=0;f<g.length;f++){if(g[f].indexOf("jcarousel-")!=-1){k.removeClass(g[f])}}k.addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-"+h)).css({"float":(this.options.rtl?"right":"left"),"list-style":"none"}).attr("jcarouselindex",h);return k},className:function(e){return e+" "+e+(!this.options.vertical?"-horizontal":"-vertical")},dimension:function(h,i){var g=c(h);if(i==null){return !this.options.vertical?((g.innerWidth()+a.intval(g.css("margin-left"))+a.intval(g.css("margin-right"))+a.intval(g.css("border-left-width"))+a.intval(g.css("border-right-width")))||a.intval(this.options.itemFallbackDimension)):((g.innerHeight()+a.intval(g.css("margin-top"))+a.intval(g.css("margin-bottom"))+a.intval(g.css("border-top-width"))+a.intval(g.css("border-bottom-width")))||a.intval(this.options.itemFallbackDimension))}else{var f=!this.options.vertical?i-a.intval(g.css("marginLeft"))-a.intval(g.css("marginRight")):i-a.intval(g.css("marginTop"))-a.intval(g.css("marginBottom"));c(g).css(this.wh,f+"px");return this.dimension(g)}},clipping:function(){return !this.options.vertical?this.clip[0].offsetWidth-a.intval(this.clip.css("borderLeftWidth"))-a.intval(this.clip.css("borderRightWidth")):this.clip[0].offsetHeight-a.intval(this.clip.css("borderTopWidth"))-a.intval(this.clip.css("borderBottomWidth"))},index:function(e,f){if(f==null){f=this.options.size}return Math.round((((e-1)/f)-Math.floor((e-1)/f))*f)+1}});a.extend({defaults:function(e){return c.extend(d,e||{})},intval:function(e){e=parseInt(e,10);return isNaN(e)?0:e},windowLoaded:function(){b=true},isSafari:function(){var g=navigator.userAgent.toLowerCase(),f=/(chrome)[ \/]([\w.]+)/.exec(g)||/(webkit)[ \/]([\w.]+)/.exec(g)||[],e=f[1]||"";return e==="webkit"}});c.fn.jcarousel=function(g){if(typeof g=="string"){var e=c(this).data("jcarousel"),f=Array.prototype.slice.call(arguments,1);return e[g].apply(e,f)}else{return this.each(function(){var h=c(this).data("jcarousel");if(h){if(g){c.extend(h.options,g)}h.reload()}
2909else{c(this).data("jcarousel",new a(this,g))}})}}})(jQuery);
2910;
2911/**
2912 * @file
2913 * Add jCarousel behaviors to the page and provide Views-support.
2914 */
2915
2916(function($) {
2917
2918Drupal.behaviors.jcarousel = {};
2919Drupal.behaviors.jcarousel.attach = function(context, settings) {
2920  settings = settings || Drupal.settings;
2921
2922  // If no carousels exist on this part of the page, work no further. 
2923  if (!settings.jcarousel || !settings.jcarousel.carousels) {
2924    return;
2925  }
2926
2927  $("ul.jcarousel li").css("display", "");
2928
2929  $.each(settings.jcarousel.carousels, function(key, options) {
2930    var $carousel = $(options.selector + ':not(.jcarousel-processed)', context);
2931
2932    // If this carousel has already been processed or doesn't exist, move on.
2933    if (!$carousel.length) {
2934      return;
2935    }
2936
2937    // Callbacks need to be converted from a string to an actual function.
2938    $.each(options, function(optionKey) {
2939      if (optionKey.match(/Callback$/) && typeof options[optionKey] == 'string') {
2940        var callbackFunction = window;
2941        var callbackParents = options[optionKey].split('.');
2942        $.each(callbackParents, function(objectParent) {
2943          callbackFunction = callbackFunction[callbackParents[objectParent]];
2944        });
2945        options[optionKey] = callbackFunction;
2946      }
2947    });
2948
2949    // Add standard options required for AJAX functionality.
2950    if (options.ajax && !options.itemLoadCallback) {
2951      options.itemLoadCallback = Drupal.jcarousel.ajaxLoadCallback;
2952    }
2953
2954    // If auto-scrolling, pause animation when hoving over the carousel.
2955    if (options.auto && options.autoPause && !options.initCallback) {
2956      options.initCallback = function(carousel, state) {
2957        Drupal.jcarousel.autoPauseCallback(carousel, state);
2958      };
2959    }
2960
2961    // Add responsive behavior.
2962    if (options.responsive  && !options.reloadCallback) {
2963      options.vertical = false;
2964      options.visible = null;
2965      options.reloadCallback = Drupal.jcarousel.reloadCallback;
2966    }
2967
2968    // Add navigation to the carousel if enabled.
2969    if (!options.setupCallback) {
2970      options.setupCallback = function(carousel) {
2971        Drupal.jcarousel.setupCarousel(carousel);
2972        if (options.navigation) {
2973          Drupal.jcarousel.addNavigation(carousel, options.navigation);
2974        }
2975        if (options.responsive) {
2976          carousel.reload();
2977        }
2978      };
2979      if (options.navigation && !options.itemVisibleInCallback) {
2980        options.itemLastInCallback = {
2981          onAfterAnimation: Drupal.jcarousel.updateNavigationActive
2982        };
2983      }
2984    }
2985
2986    if (!options.hasOwnProperty('buttonNextHTML') && !options.hasOwnProperty('buttonPrevHTML')) {
2987      options.buttonNextHTML = Drupal.theme('jCarouselButton', 'next');
2988      options.buttonPrevHTML = Drupal.theme('jCarouselButton', 'previous');
2989    }
2990
2991    // Initialize the jcarousel.
2992    $carousel.addClass('jcarousel-processed').jcarousel(options);
2993  });
2994};
2995
2996Drupal.jcarousel = {};
2997Drupal.jcarousel.reloadCallback = function(carousel) {
2998  // Set the clip and container to auto width so that they will fill
2999  // the available space.
3000  carousel.container.css('width', 'auto');
3001  carousel.clip.css('width', 'auto');
3002  var clipWidth = carousel.clip.width();
3003  var containerExtra = carousel.container.width() - carousel.clip.outerWidth(true);
3004  // Determine the width of an item.
3005  var itemWidth = carousel.list.find('li').first().outerWidth(true);
3006  var numItems = Math.floor(carousel.clip.width() / itemWidth) || 1;
3007  // Set the new scroll number.
3008  carousel.options.scroll = numItems;
3009  var newClipWidth = numItems * itemWidth;
3010  var newContainerWidth = newClipWidth + containerExtra;
3011  // Resize the clip and container.
3012  carousel.clip.width(newClipWidth);
3013  carousel.container.width(newContainerWidth);
3014};
3015Drupal.jcarousel.ajaxLoadCallback = function(jcarousel, state) {
3016  // Check if the requested items already exist.
3017  if (state == 'init' || jcarousel.has(jcarousel.first, jcarousel.last)) {
3018    return;
3019  }
3020
3021  var $list = jcarousel.list;
3022  var $view = $list.parents('.view:first');
3023  var ajaxPath = Drupal.settings.jcarousel.ajaxPath;
3024  var target = $view.get(0);
3025
3026  // Find this view's settings in the Views AJAX settings.
3027  var settings;
3028  $.each(Drupal.settings.jcarousel.carousels, function(domID, carouselSettings) {
3029    if ($list.is('.' + domID)) {
3030      settings = carouselSettings['view_options'];
3031    }
3032  });
3033
3034  // Copied from ajax_view.js:
3035  var viewData = { 'js': 1, 'first': jcarousel.first - 1, 'last': jcarousel.last };
3036  // Construct an object using the settings defaults and then overriding
3037  // with data specific to the link.
3038  $.extend(
3039    viewData,
3040    settings
3041  );
3042
3043  $.ajax({
3044    url: ajaxPath,
3045    type: 'GET',
3046    data: viewData,
3047    success: function(response) {
3048      Drupal.jcarousel.ajaxResponseCallback(jcarousel, target, response);
3049    },
3050    error: function(xhr) {
3051      Drupal.jcarousel.ajaxErrorCallback(xhr, ajaxPath);
3052    },
3053    dataType: 'json'
3054  });
3055
3056};
3057
3058/**
3059 * Init callback for jCarousel. Pauses the carousel when hovering over.
3060 */
3061Drupal.jcarousel.autoPauseCallback = function(carousel, state) {
3062  function pauseAuto() {
3063    carousel.stopAuto();
3064  }
3065  function resumeAuto() {
3066    carousel.startAuto();
3067  }
3068  carousel.clip.hover(pauseAuto, resumeAuto);
3069  carousel.buttonNext.hover(pauseAuto, resumeAuto);
3070  carousel.buttonPrev.hover(pauseAuto, resumeAuto);
3071};
3072
3073/**
3074 * Setup callback for jCarousel. Calculates number of pages.
3075 */
3076Drupal.jcarousel.setupCarousel = function(carousel) {
3077  // Determine the number of pages this carousel includes.
3078  // This only works for a positive starting point. Also, .first is 1-based
3079  // while .last is a count, so we need to reset the .first number to be
3080  // 0-based to make the math work.
3081  carousel.pageSize = carousel.last - (carousel.first - 1);
3082
3083  // jCarousel's Views integration sets "size" in the carousel options. Use that
3084  // if available, otherwise count the number of items in the carousel.
3085  var itemCount = carousel.options.size ? carousel.options.size : $(carou
3085sel.list).children('li').length;
3086  carousel.pageCount =  Math.ceil(itemCount / carousel.pageSize);
3087  carousel.pageNumber = 1;
3088
3089  // Disable the previous/next arrows if there is only one page.
3090  if (carousel.options.wrap != 'circular' && carousel.pageCount == 1) {
3091    carousel.buttons(false, false);
3092  }
3093
3094  // Always remove the hard-coded display: block from the navigation.
3095  carousel.buttonNext.css('display', '');
3096  carousel.buttonPrev.css('display', '');
3097}
3098
3099/**
3100 * Setup callback for jCarousel. Adds the navigation to the carousel if enabled.
3101 */
3102Drupal.jcarousel.addNavigation = function(carousel, position) {
3103  // Don't add a pager if there's only one page of results.
3104  if (carousel.pageCount <= 1) {
3105    return;
3106  }
3107
3108  // Add a class to the wrapper so it can adjust CSS.
3109  $(carousel.list).parents('.jcarousel-container:first').addClass('jcarousel-navigation-' + position);
3110
3111  var navigation = $('<ul class="jcarousel-navigation"></ul>');
3112
3113  for (var i = 1; i <= carousel.pageCount; i++) {
3114    var pagerItem = $(Drupal.theme('jCarouselPageLink', i));
3115    var listItem = $('<li></li>').attr('jcarousel-page', i).append(pagerItem);
3116    navigation.append(listItem);
3117
3118    // Make the first page active by default.
3119    if (i === 1) {
3120      listItem.addClass('active');
3121    }
3122
3123    // Scroll to the correct page when a pager is clicked.
3124    pagerItem.bind('click', function() {
3125      // We scroll to the new page based on item offsets. This works with
3126      // circular carousels that do not divide items evenly, making it so that
3127      // going back or forward in pages will not skip or repeat any items.
3128      var newPageNumber = $(this).parent().attr('jcarousel-page');
3129      var itemOffset = (newPageNumber - carousel.pageNumber) * carousel.pageSize;
3130
3131      if (itemOffset) {
3132        carousel.scroll(carousel.first + itemOffset);
3133      }
3134
3135      return false;
3136    });
3137  }
3138
3139  $(carousel.list).parents('.jcarousel-clip:first')[position](navigation);
3140}
3141
3142/**
3143 * itemVisibleInCallback for jCarousel. Update the navigation after page change.
3144 */
3145Drupal.jcarousel.updateNavigationActive = function(carousel, item, idx, state) {
3146  // The navigation doesn't even exist yet when this is called on init.
3147  var $listItems = $(carousel.list).parents('.jcarousel-container:first').find('.jcarousel-navigation li');
3148  if ($listItems.length == 0) {
3149    return;
3150  }
3151
3152  // jCarousel does some very odd things with circular wraps. Items before the
3153  // first item are given negative numbers and items after the last are given
3154  // numbers beyond the total number of items. This complicated logic calculates
3155  // which page number is active based off this numbering scheme.
3156  var pageNumber = Math.ceil(idx / carousel.pageSize);
3157  if (pageNumber <= 0 || pageNumber > carousel.pageCount) {
3158    pageNumber = pageNumber % carousel.pageCount;
3159    pageNumber = pageNumber == 0 ? carousel.pageCount : pageNumber;
3160    pageNumber = pageNumber < 0 ? pageNumber + carousel.pageCount : pageNumber;
3161  }
3162  carousel.pageNumber = pageNumber;
3163  var currentPage = $listItems.get(carousel.pageNumber - 1);
3164
3165  // Set the current page to be active.
3166  $listItems.not(currentPage).removeClass('active');
3167  $(currentPage).addClass('active');
3168}
3169
3170/**
3171 * AJAX callback for all jCarousel-style views.
3172 */
3173Drupal.jcarousel.ajaxResponseCallback = function(jcarousel, target, response) {
3174  if (response.debug) {
3175    alert(response.debug);
3176  }
3177
3178  var $view = $(target);
3179  var jcarousel = $view.find('ul.jcarousel').data('jcarousel');
3180
3181  // Add items to the jCarousel.
3182  $('ul.jcarousel > li', response.display).each(function(i) {
3183    var itemNumber = this.className.replace(/.*?jcarousel-item-(\d+).*/, '$1');
3184    jcarousel.add(itemNumber, this.innerHTML);
3185  });
3186
3187  // Add Drupal behaviors to the content of the carousel to affect new items.
3188  Drupal.attachBehaviors(jcarousel.list.get(0));
3189
3190  // Treat messages the same way that Views typically handles messages.
3191  if (response.messages) {
3192    // Show any messages (but first remove old ones, if there are any).
3193    $view.find('.views-messages').remove().end().prepend(response.messages);
3194  }
3195};
3196
3197/**
3198 * Display error messages using the same mechanism as Views module.
3199 */
3200Drupal.jcarousel.ajaxErrorCallback = function (xhr, path) {
3201  var error_text = '';
3202
3203  if ((xhr.status == 500 && xhr.responseText) || xhr.status == 200) {
3204    error_text = xhr.responseText;
3205
3206    // Replace all &lt; and &gt; by < and >
3207    error_text = error_text.replace("/&(lt|gt);/g", function (m, p) {
3208      return (p == "lt")? "<" : ">";
3209    });
3210
3211    // Now, replace all html tags by empty spaces
3212    error_text = error_text.replace(/<("[^"]*"|'[^']*'|[^'">])*>/gi,"");
3213
3214    // Fix end lines
3215    error_text = error_text.replace(/[\n]+\s+/g,"\n");
3216  }
3217  else if (xhr.status == 500) {
3218    error_text = xhr.status + ': ' + Drupal.t("Internal server error. Please see server or PHP logs for error information.");
3219  }
3220  else {
3221    error_text = xhr.status + ': ' + xhr.statusText;
3222  }
3223
3224  alert(Drupal.t("An error occurred at @path.\n\nError Description: @error", {'@path': path, '@error': error_text}));
3225};
3226
3227Drupal.theme.prototype.jCarouselButton = function(type) {
3228  // Use links for buttons for accessibility.
3229  return '<a href="javascript:void(0)"></a>';
3230};
3231
3232Drupal.theme.prototype.jCarouselPageLink = function(pageNumber) {
3233  return '<a href="javascript:void(0)"><span>' + (pageNumber) + '</span></a>';
3234};
3235
3236})(jQuery);
3237;
3238/**
3239 * @file
3240 * Handles AJAX fetching of views, including filter submission and response.
3241 */
3242(function ($) {
3243
3244  /**
3245   * Attaches the AJAX behavior to exposed filter forms and key views links.
3246   */
3247  Drupal.behaviors.ViewsAjaxView = {};
3248  Drupal.behaviors.ViewsAjaxView.attach = function () {
3249    if (Drupal.settings && Drupal.settings.views && Drupal.settings.views.ajaxViews) {
3250      $.each(Drupal.settings.views.ajaxViews, function (i, settings) {
3251        Drupal.views.instances[i] = new Drupal.views.ajaxView(settings);
3252      });
3253    }
3254  };
3255
3256  Drupal.views = {};
3257  Drupal.views.instances = {};
3258
3259  /**
3260   * JavaScript object for a certain view.
3261   */
3262  Drupal.views.ajaxView = function (settings) {
3263    var selector = '.view-dom-id-' + settings.view_dom_id;
3264    this.$view = $(selector);
3265
3266    // If view is not present return to prevent errors.
3267    if (!this.$view.length) {
3268      return;
3269    }
3270
3271    // Retrieve the path to use for views' ajax.
3272    var ajax_path = Drupal.settings.views.ajax_path;
3273
3274    // If there are multiple views this might've ended up showing up multiple
3275    // times.
3276    if (ajax_path.constructor.toString().indexOf("Array") != -1) {
3277      ajax_path = ajax_path[0];
3278    }
3279
3280    // Check if there are any GET parameters to send to views.
3281    var queryString = window.location.search || '';
3282    if (queryString !== '') {
3283      // Remove the question mark and Drupal path component if any.
3284      var queryString = queryString.slice(1).replace(/q=[^&]+&?|&?render=[^&]+/, '');
3285      if (queryString !== '') {
3286        // If there is a '?' in ajax_path, clean url are on and & should be
3287        // used to add parameters.
3288        queryString = ((/\?/.test(ajax_path)) ? '&' : '?') + queryString;
3289      }
3290    }
3291
3292    this.element_settings = {
3293      url: ajax_path + queryString,
3294      submit: settings,
3295      setClick: true,
3296      event: 'click',
3297      selector: selector,
3298      progress: {
3299        type: 'throbber'
3300      }
3301    };
3302
3303    this.settings = settings;
3304
3305    // Add the ajax to exposed forms.
3306    this.$exposed_form = $('#views-exposed-form-' + settings.view_name.replace(/_/g, '-') + '-' + settings.view_display_id.replace(/_/g, '-'));
3307    this.$exposed_form.once(jQuery.proxy(this.attachExposedFormAjax, this));
3308
3309    // Store Drupal.ajax objects here for all pager links.
3310    this.links = [];
3311
3312    // Add the ajax to pagers.
3313    this.$view
3314      .once(jQuery.proxy(this.attachPagerAjax, this));
3315
3316    // Add a trigger to update this view specifically. In order to trigger a
3317    // refresh use the following code.
3318    //
3319    // @code
3320    // jQuery('.view-name').trigger('RefreshView');
3321    // @endcode
3322    // Add a trigger to update this view specifically.
3323    var self_settings = this.element_settings;
3324    self_settings.event = 'RefreshView';
3325    var self = this;
3326    this.$view.once('refresh', function () {
3327      self.refreshViewAjax = new Drupal.ajax(self.selector, self.$view, self_settings);
3328    });
3329  };
3330
3331  Drupal.views.ajaxView.prototype.attachExposedFormAjax = function () {
3332    var button = $('input[type=submit], button[type=submit], input[type=image]', this.$exposed_form);
3333    button = button[0];
3334
3335    // Call the autocomplete submit before doing AJAX.
3336    $(button).click(function () {
3337      if (Drupal.autocompleteSubmit) {
3338        Drupal.autocompleteSubmit();
3339      }
3340    });
3341
3342    this.exposedFormAjax = new Drupal.ajax($(button).attr('id'), button, this.element_settings);
3343  };
3344
3345  /**
3346   * Attach the ajax behavior to each link.
3347   */
3348  Drupal.views.ajaxView.prototype.attachPagerAjax = function () {
3349    this.$view.find('ul.pager > li > a, ol.pager > li > a, th.views-field a, .attachment .views-summary a')
3350      .each(jQuery.proxy(this.attachPagerLinkAjax, this));
3351  };
3352
3353  /**
3354   * Attach the ajax behavior to a single link.
3355   */
3356  Drupal.views.ajaxView.prototype.attachPagerLinkAjax = function (id, link) {
3357    var $link = $(link);
3358    var viewData = {};
3359    var href = $link.attr('href');
3360    // Don't attach to pagers inside nested views.
3361    if ($link.closest('.view')[0] !== this.$view[0] &&
3362      $link.closest('.view').parent().hasClass('attachment') === false) {
3363      return;
3364    }
3365
3366    // Provide a default page if none has been set. This must be done
3367    // prior to merging with settings to avoid accidentally using the
3368    // page landed on instead of page 1.
3369    if (typeof(viewData.page) === 'undefined') {
3370      viewData.page = 0;
3371    }
3372
3373    // Construct an object using the settings defaults and then overriding
3374    // with data specific to the link.
3375    $.extend(
3376      viewData,
3377      this.settings,
3378      Drupal.Views.parseQueryString(href),
3379      // Extract argument data from the URL.
3380      Drupal.Views.parseViewArgs(href, this.settings.view_base_path)
3381    );
3382
3383    // For anchor tags, these will go to the target of the anchor rather
3384    // than the usual location.
3385    $.extend(viewData, Drupal.Views.parseViewArgs(href, this.settings.view_base_path));
3386
3387    // Construct an object using the element settings defaults,
3388    // then overriding submit with viewData.
3389    var pager_settings = $.extend({}, this.element_settings);
3390    pager_settings.submit = viewData;
3391    this.pagerAjax = new Drupal.ajax(false, $link, pager_settings);
3392    this.links.push(this.pagerAjax);
3393  };
3394
3395  Drupal.ajax.prototype.commands.viewsScrollTop = function (ajax, response, status) {
3396    // Scroll to the top of the view. This will allow users
3397    // to browse newly loaded content after e.g. clicking a pager
3398    // link.
3399    var offset = $(response.selector).offset();
3400    // We can't guarantee that the scrollable object should be
3401    // the body, as the view could be embedded in something
3402    // more complex such as a modal popup. Recurse up the DOM
3403    // and scroll the first element that has a non-zero top.
3404    var scrollTarget = response.selector;
3405    while ($(scrollTarget).scrollTop() == 0 && $(scrollTarget).parent()) {
3406      scrollTarget = $(scrollTarget).parent();
3407    }
3408    // Only scroll upward.
3409    if (offset.top - 10 < $(scrollTarget).scrollTop()) {
3410      $(scrollTarget).animate({scrollTop: (offset.top - 10)}, 500);
3411    }
3412  };
3413
3414})(jQuery);
3415;
3416/**
3417 * @file
3418 * JavaScript functions of Views Refresh module.
3419 */
3420
3421(function ($) {
3422  'use strict';
3423
3424  function attachEvents(view, dom_id, settings, page) {
3425    var selector = '.view-dom-id-' + dom_id;
3426    // Retrieve the path to use for views' ajax.
3427    var ajax_path = Drupal.settings.views.ajax_path + '/views-refresh';
3428
3429    // If there are multiple views this might've ended up showing up multiple times.
3430    if (ajax_path.constructor.toString().indexOf("Array") !== -1) {
3431      ajax_path = ajax_path[0];
3432    }
3433
3434    // Check if there are any GET parameters to send to views.
3435    var queryString = window.location.search || '';
3436    if (queryString !== '') {
3437      // Remove the question mark and Drupal path component if any.
3438      queryString = queryString.slice(1).replace(/q=[^&]+&?|&?render=[^&]+/, '');
3439      if (queryString !== '') {
3440        // If there is a '?' in ajax_path, clean url are on and & should be used to add parameters.
3441        queryString = ((/\?/.test(ajax_path)) ? '&' : '?') + queryString;
3442      }
3443    }
3444
3445    var pageOptions = $.extend({}, settings, (page ? {page: page} : {}));
3446    var noScrollOptions = $.extend({}, pageOptions, {views_refresh_noscroll: 1});
3447    var pageFirstOptions = $.extend({}, settings, {});
3448    var noScrollFirstOptions = $.extend({}, pageFirstOptions, {views_refresh_noscroll: 1});
3449
3450    var ajaxSettings = {
3451      url: ajax_path + queryString,
3452      setClick: true,
3453      selector: selector,
3454      progress: { type: 'throbber' }
3455    };
3456
3457    var refreshAjax = new Drupal.ajax(selector, view, $.extend({}, ajaxSettings, {submit: noScrollOptions, event: 'views_refresh'}));
3458    var refreshScrollAjax = new Drupal.ajax(selector, view, $.extend({}, ajaxSettings, {submit: pageOptions, event: 'views_refresh_scroll'}));
3459    var refreshFirstAjax = new Drupal.ajax(selector, view, $.extend({}, ajaxSettings, {submit: noScrollFirstOptions, event: 'views_refresh_first'}));
3460    var refreshScrollFirstAjax = new Drupal.ajax(selector, view, $.extend({}, ajaxSettings, {submit: pageFirstOptions, event: 'views_refresh_scroll_first'}));
3461  }
3462
3463  Drupal.ajax.prototype.commands.viewsRefresh = function (ajax, response, status) {
3464    var view = $(response.selector);
3465    var event = response.first ? (response.scroll ? 'views_refresh_scroll_first' : 'views_refresh_first') : (response.scroll ? 'views_refresh_scroll' : 'views_refresh');
3466    view.trigger(event);
3467  };
3468
3469  Drupal.behaviors.viewsRefresh = {
3470    attach: function (context) {
3471      if (Drupal.settings && Drupal.settings.viewsRefresh && Drupal.settings.views && Drupal.settings.views.ajaxViews) {
3472        $.each(Drupal.settings.viewsRefresh, function (dom_id, page) {
3473          var view = $('.view-dom-id-' + dom_id).once('views-refresh-processed');
3474          if ((view.length > 0) && (Drupal.settings.views.ajaxViews['views_dom_id:' + dom_id])) {
3475            attachEvents(view, dom_id, Drupal.settings.views.ajaxViews['views_dom_id:' + dom_id], page);
3476          }
3477        });
3478      }
3479    }
3480  };
3481
3482})(jQuery);
3483;
3484(function ($) {
3485Drupal.behaviors.lang_dropdown = {
3486  attach: function (context, settings) {
3487    var settings = settings || Drupal.settings;
3488
3489    if (settings.lang_dropdown) {
3490      var flags, msddSettings;
3491      for (key in settings.lang_dropdown) {
3492        msddSettings = settings.lang_dropdown[key].jsWidget;
3493        flags = msddSettings.languageicons;
3494        if (flags) {
3495          $.each(flags, function(index, value) {
3496            if (msddSettings.widget == "msdropdown") {
3497              $('select#lang-dropdown-select-' + key + ' option[value="' + index + '"]', context).attr('data-image', value);
3498            }
3499            else if (msddSettings.widget == "ddslick" && Boolean(msddSettings.showSelectedHTML)) {
3500              $('select#lang-dropdown-select-' + key + ' option[value="' + index + '"]', context).attr('data-imagesrc', value);
3501            }
3502          });
3503        }
3504
3505        if (msddSettings.widget == "msdropdown") {
3506          try {
3507            $('select#lang-dropdown-select-' + key, context).msDropDown({
3508              visibleRows: msddSettings.visibleRows,
3509              roundedCorner: Boolean(msddSettings.roundedCorner),
3510              animStyle: msddSettings.animStyle,
3511              event: msddSettings.event,
3512              mainCSS: msddSettings.mainCSS
3513            });
3514          }
3515          catch (e) {
3516            if (console) { console.log(e); }
3517          }
3518        }
3519        else if (msddSettings.widget == "chosen") {
3520          $('select#lang-dropdown-select-' + key, context).chosen({
3521            disable_search: msddSettings.disable_search,
3522            no_results_text: msddSettings.no_results_text
3523          });
3524        }
3525        else if (msddSettings.widget == "ddslick") {
3526          $('select#lang-dropdown-select-' + key, context).ddslick({
3527            width: (msddSettings.width == 0) ? null : msddSettings.width,
3528            height: (msddSettings.height == 0) ? null : msddSettings.height,
3529            showSelectedHTML: Boolean(msddSettings.showSelectedHTML),
3530            imagePosition: msddSettings.imagePosition,
3531            onSelected: function(data) {
3532              // ddselect also fires this function on initialization, so we have
3533              // to make sure this select has already been initialized.
3534              if (!data.selectedItem.parent().data('ddslick-has-been-initialized')) {
3535                data.selectedItem.parent().data('ddslick-has-been-initialized', true);
3536                return;
3537              }
3538
3539              var lang = data.selectedData.value;
3540              var href = $('#lang-dropdown-select-'+key, context).parents('form').find('input[name="' + lang + '"]').val();
3541              window.location.href = href;
3542            }
3543          });
3544        }
3545      }
3546    }
3547
3548    $('select.lang-dropdown-select-element', context).change(function() {
3549      var lang = this.options[this.selectedIndex].value;
3550      var href = $(this).closest('form').find('input[name="' + lang + '"]').val();
3551      window.location.href = href;
3552    });
3553
3554    $('form.lang-dropdown-form', context).after('<div style="clear:both;"></div>');
3555  }
3556};
3557})(jQuery);
3558;
3559jQuery(document).ready(function ($) {
3560    console.log("Calendario attivo");
3561    jQuery("#throbber").hide();
3562
3563
3564    jQuery( "#datepicker" ).datepicker({
3565        onSelect: function(dateText, inst) {
3566            jQuery("#throbber").show();
3567            date=jQuery(this).datepicker('getDate');
3568            day  = date.getDate(),
3569                month = date.getMonth() + 1,
3570                year =  date.getFullYear();
3571            location.href="calendario?between_date_filter[value][date]="+('0'+day).slice(-2)+"/"+('0'+month).slice(-2)+"/"+year;
3572            jQuery("#throbber").delay(3000).hide(0);
3573        }
3574    });
3575
3576    /*jQuery("#after-content-third").css("height", "initial");
3577    jQuery("#bloccocalhome").css("height", "initial");
3578    */
3579
3580
3581    var responsive_viewport = jQuery(window).width();
3582    //console.log(responsive_viewport);
3583    if (responsive_viewport <= 982) {
3584        /*-- disposizione su colonna singola --*/
3585        jQuery("#after-content-third").insertBefore("#after-content-first");
3586        /*
3587        jQuery("#after-content-third").css("height", "initial");
3588        jQuery("#bloccocalhome").css("height", "initial");
3589
3590         */
3591    }else{
3592        /*-- disposizione su tre colonne --*/
3593        jQuery("#after-content-third").insertAfter("#after-content-second");
3594        /*
3595        var h_after = jQuery("#after-content").height();
3596        var h_right = jQuery("#after-content-third").height();
3597        if (h_right<h_after){
3598            jQuery("#after-content-third").css("height", h_after);
3599            jQuery("#bloccocalhome").css("height", h_after);
3600        }
3601        */
3602
3603    }
3604});
3605/*
3606jQuery( "#datepicker" ).datepicker({
3607    onSelect: function(dateText, inst) {
3608        date=jQuery(this).datepicker('getDate');
3609        day  = date.getDate(),
3610            month = date.getMonth() + 1,
3611            year =  date.getFullYear();
3612        location.href="calendario?between_date_filter[value][date]="+('0'+day).slice(-2)+"/"+('0'+month).slice(-2)+"/"+year
3613    }
3614});
3615*/
3616
3617
3618jQuery(window).resize(function() {
3619    var responsive_viewport = jQuery(window).width();
3620    //console.log(responsive_viewport);
3621    jQuery("#bloccocalhome").css("height", "440px");
3622    console.log(responsive_viewport);
3623    if (responsive_viewport <= 982) {
3624        /*-- disposizione su colonna singola --*/
3625        jQuery("#after-content-third").insertBefore("#after-content-first");
3626        jQuery("#after-content-third").css("height", "initial");
3627        jQuery("#bloccocalhome").css("height", "initial");
3628    }else{
3629        /*-- disposizione su tre colonne --*/
3630        jQuery("#after-content-third").insertAfter("#after-content-second");
3631        var h_after = jQuery("#after-content").height();
3632        var h_right = jQuery("#after-content-third").height();
3633        /*
3634        if (h_right<h_after){
3635            var valtoadd= h_after + 30;
3636            console.log(valtoadd);
3637            jQuery("#after-content-third").css("height", valtoadd);
3638            jQuery("#bloccocalhome").css("height", valtoadd);
3639        }
3640
3641         */
3642    }
3643});
3644;
3645/*
3646 * sf-Touchscreen v1.3b - Provides touchscreen compatibility for the jQuery Superfish plugin.
3647 *
3648 * Developer's note:
3649 * Built as a part of the Superfish project for Drupal (http://drupal.org/project/superfish)
3650 * Found any bug? have any cool ideas? contact me right away! http://drupal.org/user/619294/contact
3651 *
3652 * jQuery version: 1.3.x or higher.
3653 *
3654 * Dual licensed under the MIT and GPL licenses:
3655 *  http://www.opensource.org/licenses/mit-license.php
3656 *  http://www.gnu.org/licenses/gpl.html
3657 */
3658
3659(function($){
3660  $.fn.sftouchscreen = function(options){
3661    options = $.extend({
3662      mode: 'inactive',
3663      breakpoint: 768,
3664      breakpointUnit: 'px',
3665      useragent: '',
3666      behaviour: 2,
3667      disableHover: false
3668    }, options);
3669
3670    function activate(menu){
3671      var eventHandler = (('ontouchstart' in window) || (window.DocumentTouch && document instanceof DocumentTouch)) ? ['click touchstart','mouseup touchend'] : ['click','mouseup'];
3672      // Select hyperlinks from parent menu items.
3673      menu.find('li:has(ul)').children('a,span.nolink').each(function(){
3674        var item = $(this),
3675        parent = item.closest('li');
3676        if (options.disableHover){
3677          parent.unbind('mouseenter mouseleave');
3678        }
3679        if (options.behaviour == 2){
3680          if (parent.children('a.menuparent,span.nolink.menuparent').length > 0 && parent.children('ul').children('.sf-clone-parent').length == 0){
3681            var
3682            // Cloning the hyperlink of the parent menu item.
3683            cloneLink = parent.children('a.menuparent,span.nolink.menuparent').clone(),
3684            // Wrapping the hyerplinks in <li>.
3685            cloneLink = $('<li class="sf-clone-parent" />').html(cloneLink);
3686            // Removing unnecessary stuff.
3687            cloneLink.find('.sf-sub-indicator').remove(),
3688            // Adding a helper class and attaching them to the sub-menus.
3689            parent.children('ul').addClass('sf-has-clone-parent').prepend(cloneLink);
3690          }
3691        }
3692        // No .toggle() here as it's not possible to reset it.
3693        item.bind(eventHandler[0], function(event){
3694          // Already clicked?
3695          if (item.hasClass('sf-clicked')){
3696            // Depending on the preferred behaviour, either proceed to the URL.
3697            if (options.behaviour == 0){
3698              window.location = item.attr('href');
3699            }
3700            // or collapse the sub-menu.
3701            else if (options.behaviour == 1 || options.behaviour == 2){
3702              event.preventDefault();
3703              item.removeClass('sf-clicked');
3704              parent.hideSuperfishUl().find('a,span.nolink').removeClass('sf-clicked');
3705            }
3706          }
3707          // Prevent the default action otherwise.
3708          else {
3709            event.preventDefault();
3710            item.addClass('sf-clicked');
3711            parent.showSuperfishUl().siblings('li:has(ul)').hideSuperfishUl().find('.sf-clicked').removeClass('sf-clicked');
3712          }
3713        });
3714      });
3715
3716      $(document).bind(eventHandler[1], function(event){
3717        if (menu.not(event.target) && menu.has(event.target).length === 0){
3718          menu.find('.sf-clicked').removeClass('sf-clicked');
3719          menu.find('li:has(ul)').hideSuperfishUl();
3720        }
3721      });
3722    }
3723    // Return original object to support chaining.
3724    // This is not necessary actually because of the way the module uses these plugins.
3725    for (var b = 0; b < this.length; b++) {
3726      var menu = $(this).eq(b),
3727      mode = options.mode;
3728      // The rest is crystal clear, isn't it? :)
3729      if (mode == 'always_active'){
3730        activate(menu);
3731      }
3732      else if (mode == 'window_width'){
3733        var breakpoint = (options.breakpointUnit == 'em') ? (options.breakpoint * parseFloat($('body').css('font-size'))) : options.breakpoint,
3734        windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
3735        timer;
3736        if ((typeof Modernizr === 'undefined' || typeof Modernizr.mq !== 'function') && windowWidth < breakpoint){
3737          activate(menu);
3738        }
3739        else if (typeof Modernizr !== 'undefined' && typeof Modernizr.mq === 'function' && Modernizr.mq('(max-width:' + (breakpoint - 1) + 'px)')) {
3740          activate(menu);
3741        }
3742        $(window).resize(function(){
3743          clearTimeout(timer);
3744          timer = setTimeout(function(){
3745            var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
3746            if ((typeof Modernizr === 'undefined' || typeof Modernizr.mq !== 'function') && windowWidth < breakpoint){
3747              activate(menu);
3748            }
3749            else if (typeof Modernizr !== 'undefined' && typeof Modernizr.mq === 'function' && Modernizr.mq('(max-width:' + (breakpoint - 1) + 'px)')) {
3750              activate(menu);
3751            }
3752          }, 50);
3753        });
3754      }
3755      else if (mode == 'useragent_custom'){
3756        if (options.useragent != ''){
3757          var ua = RegExp(options.useragent, 'i');
3758          if (navigator.userAgent.match(ua)){
3759            activate(menu);
3760          }
3761        }
3762      }
3763      else if (mode == 'useragent_predefined' && navigator.userAgent.match(/(android|bb\d+|meego)|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i)){
3764        activate(menu);
3765      }
3766    }
3767    return this;
3768  }
3769})(jQuery);
3770;
3771/*
3772 * sf-Smallscreen v1.2b - Provides small-screen compatibility for the jQuery Superfish plugin.
3773 *
3774 * Developer's note:
3775 * Built as a part of the Superfish project for Drupal (http://drupal.org/project/superfish)
3776 * Found any bug? have any cool ideas? contact me right away! http://drupal.org/user/619294/contact
3777 *
3778 * jQuery version: 1.3.x or higher.
3779 *
3780 * Dual licensed under the MIT and GPL licenses:
3781 *  http://www.opensource.org/licenses/mit-license.php
3782 *  http://www.gnu.org/licenses/gpl.html
3783  */
3784
3785(function($){
3786  $.fn.sfsmallscreen = function(options){
3787    options = $.extend({
3788      mode: 'inactive',
3789      type: 'accordion',
3790      breakpoint: 768,
3791      breakpointUnit: 'px',
3792      useragent: '',
3793      title: '',
3794      addSelected: false,
3795      menuClasses: false,
3796      hyperlinkClasses: false,
3797      excludeClass_menu: '',
3798      excludeClass_hyperlink: '',
3799      includeClass_menu: '',
3800      includeClass_hyperlink: '',
3801      accordionButton: 1,
3802      expandText: 'Expand',
3803      collapseText: 'Collapse'
3804    }, options);
3805
3806    // We need to clean up the menu from anything unnecessary.
3807    function refine(menu){
3808      var
3809      refined = menu.clone(),
3810      // Things that should not be in the small-screen menus.
3811      rm = refined.find('span.sf-sub-indicator, span.sf-description'),
3812      // This is a helper class for those who need to add extra markup that shouldn't exist
3813      // in the small-screen versions.
3814      rh = refined.find('.sf-smallscreen-remove'),
3815      // Mega-menus has to be removed too.
3816      mm = refined.find('ul.sf-megamenu');
3817      for (var a = 0; a < rh.length; a++){
3818        rh.eq(a).replaceWith(rh.eq(a).html());
3819      }
3820      for (var b = 0; b < rm.length; b++){
3821        rm.eq(b).remove();
3822      }
3823      if (mm.length > 0){
3824        mm.removeClass('sf-megamenu');
3825        var ol = refined.find('div.sf-megamenu-column > ol');
3826        for (var o = 0; o < ol.length; o++){
3827          ol.eq(o).replaceWith('<ul>' + ol.eq(o).html() + '</ul>');
3828        }
3829        var elements = ['div.sf-megamenu-column','.sf-megamenu-wrapper > ol','li.sf-megamenu-wrapper'];
3830        for (var i = 0; i < elements.length; i++){
3831          obj = refined.find(elements[i]);
3832          for (var t = 0; t < obj.length; t++){
3833            obj.eq(t).replaceWith(obj.eq(t).html());
3834          }
3835        }
3836        refined.find('.sf-megamenu-column').removeClass('sf-megamenu-column');
3837      }
3838      refined.add(refined.find('*')).css({width:''});
3839      return refined;
3840    }
3841
3842    // Creating <option> elements out of the menu.
3843    function toSelect(menu, level){
3844      var
3845      items = '',
3846      childLI = $(menu).children('li');
3847      for (var a = 0; a < childLI.length; a++){
3848        var list = childLI.eq(a), parent = list.children('a, span');
3849        for (var b = 0; b < parent.length; b++){
3850          var
3851          item = parent.eq(b),
3852          path = item.is('a') ? item.attr('href') : '',
3853          // Class names modification.
3854          itemClone = item.clone(),
3855          classes = (options.hyperlinkClasses) ? ((options.excludeClass_hyperlink && itemClone.hasClass(options.excludeClass_hyperlink)) ? itemClone.removeClass(options.excludeClass_hyperlink).attr('class') : itemClone.attr('class')) : '',
3856          classes = (options.includeClass_hyperlink && !itemClone.hasClass(options.includeClass_hyperlink)) ? ((options.hyperlinkClasses) ? itemClone.addClass(options.includeClass_hyperlink).attr('class') : options.includeClass_hyperlink) : classes;
3857          // Retaining the active class if requested.
3858          if (options.addSelected && item.hasClass('active')){
3859            classes += ' active';
3860          }
3861          // <option> has to be disabled if the item is not a link.
3862          disable = item.is('span') || item.attr('href')=='#' ? ' disabled="disabled"' : '',
3863          // Crystal clear.
3864          subIndicator = 1 < level ? Array(level).join('-') + ' ' : '';
3865          // Preparing the <option> element.
3866          items += '<option value="' + path + '" class="' + classes + '"' + disable + '>' + subIndicator + $.trim(item.text()) +'</option>',
3867          childUL = list.find('> ul');
3868          // Using the function for the sub-menu of this item.
3869          for (var u = 0; u < childUL.length; u++){
3870            items += toSelect(childUL.eq(u), level + 1);
3871          }
3872        }
3873      }
3874      return items;
3875    }
3876
3877    // Create the new version, hide the original.
3878    function convert(menu){
3879      var menuID = menu.attr('id'),
3880      // Creating a refined version of the menu.
3881      refinedMenu = refine(menu);
3882      // Currently the plugin provides two reactions to small screens.
3883      // Converting the menu to a <select>
3883 element, and converting to an accordion version of the menu.
3884      if (options.type == 'accordion'){
3885        var
3886        toggleID = menuID + '-toggle',
3887        accordionID = menuID + '-accordion';
3888        // Making sure the accordion does not exist.
3889        if ($('#' + accordionID).length == 0){
3890          var
3891          // Getting the style class.
3892          styleClass = menu.attr('class').split(' ').filter(function(item){
3893            return item.indexOf('sf-style-') > -1 ? item : '';
3894          }),
3895          // Creating the accordion.
3896          accordion = $(refinedMenu).attr('id', accordionID);
3897          // Removing unnecessary classes.
3898          accordion.removeClass('sf-horizontal sf-vertical sf-navbar sf-shadow sf-js-enabled');
3899          // Adding necessary classes.
3900          accordion.addClass('sf-accordion sf-hidden');
3901          // Removing style attributes and any unnecessary class.
3902          accordion.children('li').removeAttr('style').removeClass('sfHover');
3903          // Doing the same and making sure all the sub-menus are off-screen (hidden).
3904          accordion.find('ul').removeAttr('style').not('.sf-hidden').addClass('sf-hidden');
3905          // Creating the accordion toggle switch.
3906          var toggle = '<div class="sf-accordion-toggle ' + styleClass + '"><a href="#" id="' + toggleID + '"><span>' + options.title + '</span></a></div>';
3907
3908          // Adding Expand\Collapse buttons if requested.
3909          if (options.accordionButton == 2){
3910            var parent = accordion.find('li.menuparent');
3911            for (var i = 0; i < parent.length; i++){
3912              parent.eq(i).prepend('<a href="#" class="sf-accordion-button">' + options.expandText + '</a>');
3913            }
3914          }
3915          // Inserting the according and hiding the original menu.
3916          menu.before(toggle).before(accordion).hide();
3917
3918          var
3919          accordionElement = $('#' + accordionID),
3920          // Deciding what should be used as accordion buttons.
3921          buttonElement = (options.accordionButton < 2) ? 'a.menuparent,span.nolink.menuparent' : 'a.sf-accordion-button',
3922          button = accordionElement.find(buttonElement);
3923
3924          // Attaching a click event to the toggle switch.
3925          $('#' + toggleID).bind('click', function(e){
3926            // Preventing the click.
3927            e.preventDefault();
3928            // Adding the sf-expanded class.
3929            $(this).toggleClass('sf-expanded');
3930
3931            if (accordionElement.hasClass('sf-expanded')){
3932              // If the accordion is already expanded:
3933              // Hiding its expanded sub-menus and then the accordion itself as well.
3934              accordionElement.add(accordionElement.find('li.sf-expanded')).removeClass('sf-expanded')
3935              .end().find('ul').hide()
3936              // This is a bit tricky, it's the same trick that has been in use in the main plugin for sometime.
3937              // Basically we'll add a class that keeps the sub-menu off-screen and still visible,
3938              // and make it invisible and removing the class one moment before showing or hiding it.
3939              // This helps screen reader software access all the menu items.
3940              .end().hide().addClass('sf-hidden').show();
3941              // Changing the caption of any existing accordion buttons to 'Expand'.
3942              if (options.accordionButton == 2){
3943                accordionElement.find('a.sf-accordion-button').text(options.expandText);
3944              }
3945            }
3946            else {
3947              // But if it's collapsed,
3948              accordionElement.addClass('sf-expanded').hide().removeClass('sf-hidden').show();
3949            }
3950          });
3951
3952          // Attaching a click event to the buttons.
3953          button.bind('click', function(e){
3954            // Making sure the buttons does not exist already.
3955            if ($(this).closest('li').children('ul').length > 0){
3956              e.preventDefault();
3957              // Selecting the parent menu items.
3958              var parent = $(this).closest('li');
3959              // Creating and inserting Expand\Collapse buttons to the parent menu items,
3960              // of course only if not already happened.
3961              if (options.accordionButton == 1 && parent.children('a.menuparent,span.nolink.menuparent').length > 0 && parent.children('ul').children('li.sf-clone-parent').length == 0){
3962                var
3963                // Cloning the hyperlink of the parent menu item.
3964                cloneLink = parent.children('a.menuparent,span.nolink.menuparent').clone(),
3965                // Wrapping the hyerplinks in <li>.
3966                cloneLink = $('<li class="sf-clone-parent" />').html(cloneLink);
3967                // Adding a helper class and attaching them to the sub-menus.
3968                parent.children('ul').addClass('sf-has-clone-parent').prepend(cloneLink);
3969              }
3970              // Once the button is clicked, collapse the sub-menu if it's expanded.
3971              if (parent.hasClass('sf-expanded')){
3972                parent.children('ul').slideUp('fast', function(){
3973                  // Doing the accessibility trick after hiding the sub-menu.
3974                  $(this).closest('li').removeClass('sf-expanded').end().addClass('sf-hidden').show();
3975                });
3976                // Changing the caption of the inserted Collapse link to 'Expand', if any is inserted.
3977                if (options.accordionButton == 2 && parent.children('.sf-accordion-button').length > 0){
3978                  parent.children('.sf-accordion-button').text(options.expandText);
3979                }
3980              }
3981              // Otherwise, expand the sub-menu.
3982              else {
3983                // Doing the accessibility trick and then showing the sub-menu.
3984                parent.children('ul').hide().removeClass('sf-hidden').slideDown('fast')
3985                // Changing the caption of the inserted Expand link to 'Collape', if any is inserted.
3986                .end().addClass('sf-expanded').children('a.sf-accordion-button').text(options.collapseText)
3987                // Hiding any expanded sub-menu of the same level.
3988                .end().siblings('li.sf-expanded').children('ul')
3989                .slideUp('fast', function(){
3990                  // Doing the accessibility trick after hiding it.
3991                  $(this).closest('li').removeClass('sf-expanded').end().addClass('sf-hidden').show();
3992                })
3993                // Assuming Expand\Collapse buttons do exist, resetting captions, in those hidden sub-menus.
3994                .parent().children('a.sf-accordion-button').text(options.expandText);
3995              }
3996            }
3997          });
3998        }
3999      }
4000      else {
4001        var
4002        // Class names modification.
4003        menuClone = menu.clone(), classes = (options.menuClasses) ? ((options.excludeClass_menu && menuClone.hasClass(options.excludeClass_menu)) ? menuClone.removeClass(options.excludeClass_menu).attr('class') : menuClone.attr('class')) : '',
4004        classes = (options.includeClass_menu && !menuClone.hasClass(options.includeClass_menu)) ? ((options.menuClasses) ? menuClone.addClass(options.includeClass_menu).attr('class') : options.includeClass_menu) : classes,
4005        classes = (classes) ? ' class="' + classes + '"' : '';
4006
4007        // Making sure the <select> element does not exist already.
4008        if ($('#' + menuID + '-select').length == 0){
4009          // Creating the <option> elements.
4010          var newMenu = toSelect(refinedMenu, 1),
4011          // Creating the <select> element and assigning an ID and class name.
4012          selectList = $('<select' + classes + ' id="' + menuID + '-select"/>')
4013          // Attaching the title and the items to the <select> element.
4014          .html('<option>' + options.title + '</option>' + newMenu)
4015          // Attaching an event then.
4016          .change(function(){
4017            // Except for the first option that is the menu title and not a real menu item.
4018            if ($('option:selected', this).index()){
4019              window.location = selectList.val();
4020            }
4021          });
4022          // Applying the addSelected option to it.
4023          if (options.addSelected){
4024            selectList.find('.active').attr('selected', !0);
4025          }
4026          // Finally inserting the <select> element into the document then hiding the original menu.
4027          menu.before(selectList).hide();
4028        }
4029      }
4030    }
4031
4032    // Turn everything back to normal.
4033    function turnBack(menu){
4034      var
4035      id = '#' + menu.attr('id');
4036      // Removing the small screen version.
4037      $(id + '-' + options.type).remove();
4038      // Removing the accordion toggle switch as well.
4039      if (options.type == 'accordion'){
4040        $(id + '-toggle').parent('div').remove();
4041      }
4042      // Crystal clear!
4043      $(id).show();
4044    }
4045
4046    // Return original object to support chaining.
4047    // Although this is unnecessary because of the way the module uses these plugins.
4048    for (var s = 0; s < this.length; s++){
4049      var
4050      menu = $(this).eq(s),
4051      mode = options.mode;
4052      // The rest is crystal clear, isn't it? :)
4053      if (mode == 'always_active'){
4054        convert(menu);
4055      }
4056      else if (mode == 'window_width'){
4057        var breakpoint = (options.breakpointUnit == 'em') ? (options.breakpoint * parseFloat($('body').css('font-size'))) : options.breakpoint,
4058        windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
4059        timer;
4060        if ((typeof Modernizr === 'undefined' || typeof Modernizr.mq !== 'function') && windowWidth < breakpoint){
4061          convert(menu);
4062        }
4063        else if (typeof Modernizr !== 'undefined' && typeof Modernizr.mq === 'function' && Modernizr.mq('(max-width:' + (breakpoint - 1) + 'px)')) {
4064          convert(menu);
4065        }
4066        $(window).resize(function(){
4067          clearTimeout(timer);
4068          timer = setTimeout(function(){
4069            var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
4070            if ((typeof Modernizr === 'undefined' || typeof Modernizr.mq !== 'function') && windowWidth < breakpoint){
4071              convert(menu);
4072            }
4073            else if (typeof Modernizr !== 'undefined' && typeof Modernizr.mq === 'function' && Modernizr.mq('(max-width:' + (breakpoint - 1) + 'px)')) {
4074              convert(menu);
4075            }
4076            else {
4077              turnBack(menu);
4078            }
4079          }, 50);
4080        });
4081      }
4082      else if (mode == 'useragent_custom'){
4083        if (options.useragent != ''){
4084          var ua = RegExp(options.useragent, 'i');
4085          if (navigator.userAgent.match(ua)){
4086            convert(menu);
4087          }
4088        }
4089      }
4090      else if (mode == 'useragent_predefined' && navigator.userAgent.match(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i)){
4091        convert(menu);
4092      }
4093    }
4094    return this;
4095  }
4096})(jQuery);
4097;
4098/*
4099 * Supposition v0.2 - an optional enhancer for Superfish jQuery menu widget.
4100 *
4101 * Copyright (c) 2008 Joel Birch - based mostly on work by Jesse Klaasse and credit goes largely to him.
4102 * Special thanks to Karl Swedberg for valuable input.
4103 *
4104 * Dual licensed under the MIT and GPL licenses:
4105 *  http://www.opensource.org/licenses/mit-license.php
4106 *  http://www.gnu.org/licenses/gpl.html
4107 */
4108/*
4109 * This is not the original jQuery Supposition plugin.
4110 * Please refer to the README for more information.
4111 */
4112
4113(function($){
4114  $.fn.supposition = function(){
4115    var $w = $(window), /*do this once instead of every onBeforeShow call*/
4116    _offset = function(dir) {
4117      return window[dir == 'y' ? 'pageYOffset' : 'pageXOffset']
4118      || document.documentElement && document.documentElement[dir=='y' ? 'scrollTop' : 'scrollLeft']
4119      || document.body[dir=='y' ? 'scrollTop' : 'scrollLeft'];
4120    },
4121    onHide = function(){
4122      this.css({bottom:''});
4123    },
4124    onBeforeShow = function(){
4125      this.each(function(){
4126        var $u = $(this);
4127        $u.css('display','block');
4128        var $mul = $u.closest('.sf-menu'),
4129        level = $u.parents('ul').length,
4130        menuWidth = $u.width(),
4131        menuParentWidth = $u.closest('li').outerWidth(true),
4132        menuParentLeft = $u.closest('li').offset().left,
4133        totalRight = $w.width() + _offset('x'),
4134        menuRight = $u.offset().left + menuWidth,
4135        exactMenuWidth = (menuRight > (menuParentWidth + menuParentLeft)) ? menuWidth - (menuRight - (menuParentWidth + menuParentLeft)) : menuWidth;
4136        if ($u.parents('.sf-js-enabled').hasClass('rtl')) {
4137          if (menuParentLeft < exactMenuWidth) {
4138            if (($mul.hasClass('sf-horizontal') && level == 1) || ($mul.hasClass('sf-navbar') && level == 2)){
4139              $u.css({left:0,right:'auto'});
4140            }
4141            else {
4142              $u.css({left:menuParentWidth + 'px',right:'auto'});
4143            }
4144          }
4145        }
4146        else {
4147          if (menuRight > totalRight && menuParentLeft > menuWidth) {
4148            if (($mul.hasClass('sf-horizontal') && level == 1) || ($mul.hasClass('sf-navbar') && level == 2)){
4149              $u.css({right:0,left:'auto'});
4150            }
4151            else {
4152              $u.css({right:menuParentWidth + 'px',left:'auto'});
4153            }
4154          }
4155        }
4156        var windowHeight = $w.height(),
4157        offsetTop = $u.offset().top,
4158        menuParentShadow = ($mul.hasClass('sf-shadow') && $u.css('padding-bottom').length > 0) ? parseInt($u.css('padding-bottom').slice(0,-2)) : 0,
4159        menuParentHeight = ($mul.hasClass('sf-vertical')) ? '-' + menuParentShadow : $u.parent().outerHeight(true) - menuParentShadow,
4160        menuHeight = $u.height(),
4161        baseline = windowHeight + _offset('y');
4162        var expandUp = ((offsetTop + menuHeight > baseline) && (offsetTop > menuHeight));
4163        if (expandUp) {
4164          $u.css({bottom:menuParentHeight + 'px',top:'auto'});
4165        }
4166        $u.css('display','none');
4167      });
4168    };
4169
4170    return this.each(function() {
4171      var o = $.fn.superfish.o[this.serial]; /* get this menu's options */
4172
4173      /* if callbacks already set, store them */
4174      var _onBeforeShow = o.onBeforeShow,
4175      _onHide = o.onHide;
4176
4177      $.extend($.fn.superfish.o[this.serial],{
4178        onBeforeShow: function() {
4179          onBeforeShow.call(this); /* fire our Supposition callback */
4180          _onBeforeShow.call(this); /* fire stored callbacks */
4181        },
4182        onHide: function() {
4183          onHide.call(this); /* fire our Supposition callback */
4184          _onHide.call(this); /* fire stored callbacks */
4185        }
4186      });
4187    });
4188  };
4189})(jQuery);;
4190/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
4191 * Licensed under the MIT License (LICENSE.txt).
4192 *
4193 * Version 2.1.2
4194 */
4195(function(a){a.fn.bgiframe=(a.browser.msie&&/msie 6\.0/i.test(navigator.userAgent)?function(d){d=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},d);var c='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+d.src+'"style="display:block;position:absolute;z-index:-1;'+(d.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(d.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":b(d.top))+";left:"+(d.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":b(d.left))+";width:"+(d.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":b(d.width))+";height:"+(d.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":b(d.height))+';"/>';return this.each(function(){if(a(this).children("iframe.bgiframe").length===0){this.insertBefore(document.createElement(c),this.firstChild)}})}:function(){return this});a.fn.bgIframe=a.fn.bgiframe;function b(c){return c&&c.constructor===Number?c+"px":c}})(jQuery);;
4196/*
4197 * Superfish v1.4.8 - jQuery menu widget
4198 * Copyright (c) 2008 Joel Birch
4199 *
4200 * Dual licensed under the MIT and GPL licenses:
4201 *  http://www.opensource.org/licenses/mit-license.php
4202 *  http://www.gnu.org/licenses/gpl.html
4203 *
4204 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
4205 */
4206/*
4207 * This is not the original jQuery Superfish plugin.
4208 * Please refer to the README for more information.
4209 */
4210
4211(function($){
4212  $.fn.superfish = function(op){
4213    var sf = $.fn.superfish,
4214      c = sf.c,
4215      $arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
4216      over = function(){
4217        var $$ = $(this), menu = getMenu($$);
4218        clearTimeout(menu.sfTimer);
4219        $$.showSuperfishUl().siblings().hideSuperfishUl();
4220      },
4221      out = function(){
4222        var $$ = $(this), menu = getMenu($$), o = sf.op;
4223        clearTimeout(menu.sfTimer);
4224        menu.sfTimer=setTimeout(function(){
4225          if ($$.children('.sf-clicked').length == 0){
4226            o.retainPath=($.inArray($$[0],o.$path)>-1);
4227            $$.hideSuperfishUl();
4228            if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
4229          }
4230        },o.delay);
4231      },
4232      getMenu = function($menu){
4233        var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
4234        sf.op = sf.o[menu.serial];
4235        return menu;
4236      },
4237      addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
4238
4239    return this.each(function() {
4240      var s = this.serial = sf.o.length;
4241      var o = $.extend({},sf.defaults,op);
4242      o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels),
4243      p = o.$path;
4244      for (var l = 0; l < p.length; l++){
4245        p.eq(l).addClass([o.hoverClass,c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass);
4246      }
4247      sf.o[s] = sf.op = o;
4248
4249      $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
4250        if (o.autoArrows) addArrow( $(this).children('a:first-child, span.nolink:first-child') );
4251      })
4252      .not('.'+c.bcClass)
4253        .hideSuperfishUl();
4254
4255      var $a = $('a, span.nolink',this);
4256      $a.each(function(i){
4257        var $li = $a.eq(i).parents('li');
4258        $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
4259      });
4260      o.onInit.call(this);
4261
4262    }).each(function() {
4263      var menuClasses = [c.menuClass],
4264      addShadow = true;
4265      if ($.browser !== undefined){
4266        if ($.browser.msie && $.browser.version < 7){
4267          addShadow = false;
4268        }
4269      }
4270      if (sf.op.dropShadows && addShadow){
4271        menuClasses.push(c.shadowClass);
4272      }
4273      $(this).addClass(menuClasses.join(' '));
4274    });
4275  };
4276
4277  var sf = $.fn.superfish;
4278  sf.o = [];
4279  sf.op = {};
4280  sf.IE7fix = function(){
4281    var o = sf.op;
4282    if ($.browser !== undefined){
4283      if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity != undefined) {
4284        this.toggleClass(sf.c.shadowClass+'-off');
4285      }
4286    }
4287  };
4288  sf.c = {
4289    bcClass: 'sf-breadcrumb',
4290    menuClass: 'sf-js-enabled',
4291    anchorClass: 'sf-with-ul',
4292    arrowClass: 'sf-sub-indicator',
4293    shadowClass: 'sf-shadow'
4294  };
4295  sf.defaults = {
4296    hoverClass: 'sfHover',
4297    pathClass: 'overideThisToUse',
4298    pathLevels: 1,
4299    delay: 800,
4300    animation: {opacity:'show'},
4301    speed: 'fast',
4302    autoArrows: true,
4303    dropShadows: true,
4304    disableHI: false, // true disables hoverIntent detection
4305    onInit: function(){}, // callback functions
4306    onBeforeShow: function(){},
4307    onShow: function(){},
4308    onHide: function(){}
4309  };
4310  $.fn.extend({
4311    hideSuperfishUl : function(){
4312      var o = sf.op,
4313        not = (o.retainPath===true) ? o.$path : '';
4314      o.retainPath = false;
4315      var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
4316          .children('ul').addClass('sf-hidden');
4317      o.onHide.call($ul);
4318      return this;
4319    },
4320    showSuperfishUl : function(){
4321      var o = sf.op,
4322        sh = sf.c.shadowClass+'-off',
4323        $ul = this.addClass(o.hoverClass)
4324          .children('ul.sf-hidden').hide().removeClass('sf-hidden');
4325      sf.IE7fix.call($ul);
4326      o.onBeforeShow.call($ul);
4327      $ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
4328      return this;
4329    }
4330  });
4331})(jQuery);;
4332/*
4333 * Supersubs v0.4b - jQuery plugin
4334 * Copyright (c) 2013 Joel Birch
4335 *
4336 * Dual licensed under the MIT and GPL licenses:
4337 *  http://www.opensource.org/licenses/mit-license.php
4338 *  http://www.gnu.org/licenses/gpl.html
4339 *
4340 * This plugin automatically adjusts submenu widths of suckerfish-style menus to that of
4341 * their longest list item children. If you use this, please expect bugs and report them
4342 * to the jQuery Google Group with the word 'Superfish' in the subject line.
4343 *
4344 */
4345/*
4346 * This is not the original jQuery Supersubs plugin.
4347 * Please refer to the README for more information.
4348 */
4349
4350(function($){ // $ will refer to jQuery within this closure
4351  $.fn.supersubs = function(options){
4352    var opts = $.extend({}, $.fn.supersubs.defaults, options);
4353    // return original object to support chaining
4354    // Although this is unnecessary due to the way the module uses these plugins.
4355    for (var a = 0; a < this.length; a++) {
4356      // cache selections
4357      var $$ = $(this).eq(a),
4358      // support metadata
4359      o = $.meta ? $.extend({}, opts, $$.data()) : opts;
4360      // Jump one level if it's a "NavBar"
4361      if ($$.hasClass('sf-navbar')) {
4362        $$ = $$.children('li').children('ul');
4363      }
4364      // cache all ul elements
4365      var $ULs = $$.find('ul'),
4366      // get the font size of menu.
4367      // .css('fontSize') returns various results cross-browser, so measure an em dash instead
4368      fontsize = $('<li id="menu-fontsize">&#8212;</li>'),
4369      size = fontsize.attr('style','padding:0;position:absolute;top:-99999em;width:auto;')
4370      .appendTo($$)[0].clientWidth; //clientWidth is faster than width()
4371      // remove em dash
4372      fontsize.remove();
4373
4374      // loop through each ul in menu
4375      for (var b = 0; b < $ULs.length; b++) {
4376        var
4377        // cache this ul
4378        $ul = $ULs.eq(b);
4379        // If a multi-column sub-menu, and only if correctly configured.
4380        if (o.megamenu && $ul.hasClass('sf-megamenu') && $ul.find('.sf-megamenu-column').length > 0){
4381          // Look through each column.
4382          var $column = $ul.find('div.sf-megamenu-column > ol'),
4383          // Overall width.
4384          mwWidth = 0;
4385          for (var d = 0; d < $column.length; d++){
4386            resize($column.eq(d));
4387            // New column width, in pixels.
4388            var colWidth = $column.width();
4389            // Just a trick to convert em unit to px.
4390            $column.css({width:colWidth})
4391            // Making column parents the same size.
4392            .parents('.sf-megamenu-column').css({width:colWidth});
4393            // Overall width.
4394            mwWidth += parseInt(colWidth);
4395          }
4396          // Resizing the columns container too.
4397          $ul.add($ul.find('li.sf-megamenu-wrapper, li.sf-megamenu-wrapper > ol')).css({width:mwWidth});
4398        }
4399        else {
4400          resize($ul);
4401        }
4402      }
4403    }
4404    function resize($ul){
4405      var
4406      // get all (li) children of this ul
4407      $LIs = $ul.children(),
4408      // get all anchor grand-children
4409      $As = $LIs.children('a');
4410      // force content to one line and save current float property
4411      $LIs.css('white-space','nowrap');
4412      // remove width restrictions and floats so elements remain vertically stacked
4413      $ul.add($LIs).add($As).css({float:'none',width:'auto'});
4414      // this ul will now be shrink-wrapped to longest li due to position:absolute
4415      // so save its width as ems.
4416      var emWidth = $ul.get(0).clientWidth / size;
4417      // add more width to ensure lines don't turn over at certain sizes in various browsers
4418      emWidth += o.extraWidth;
4419      // restrict to at least minWidth and at most maxWidth
4420      if (emWidth > o.maxWidth) {emWidth = o.maxWidth;}
4421      else if (emWidth < o.minWidth) {emWidth = o.minWidth;}
4422      emWidth += 'em';
4423      // set ul to width in ems
4424      $ul.css({width:emWidth});
4425      // restore li floats to avoid IE bugs
4426      // set li width to full width of this ul
4427      // revert white-space to normal
4428      $LIs.add($As).css({float:'',width:'',whiteSpace:''});
4429      // update offset position of descendant ul to reflect new width of parent.
4430      // set it to 100% in case it isn't already set to this in the CSS
4431      for (var c = 0; c < $LIs.length; c++) {
4432        var $childUl = $LIs.eq(c).children('ul');
4433        var offsetDirection = $childUl.css('left') !== undefined ? 'left' : 'right';
4434        $childUl.css(offsetDirection,'100%');
4435      }
4436    }
4437    return this;
4438  };
4439  // expose defaults
4440  $.fn.supersubs.defaults = {
4441    megamenu: true, // define width for multi-column sub-menus and their columns.
4442    minWidth: 12, // requires em unit.
4443    maxWidth: 27, // requires em unit.
4444    extraWidth: 1 // extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values
4445  };
4446})(jQuery); // plugin code ends
4447;
4448/**
4449 * @file
4450 * The Superfish Drupal Behavior to apply the Superfish jQuery plugin to lists.
4451 */
4452
4453(function ($) {
4454  Drupal.behaviors.superfish = {
4455    attach: function (context, settings) {
4456      // Take a look at each list to apply Superfish to.
4457      $.each(settings.superfish || {}, function(index, options) {
4458        // Process all Superfish lists.
4459        $('#superfish-' + options.id, context).once('superfish', function() {
4460          var list = $(this);
4461
4462          // Check if we are to apply the Supersubs plug-in to it.
4463          if (options.plugins || false) {
4464            if (options.plugins.supersubs || false) {
4465              list.supersubs(options.plugins.supersubs);
4466            }
4467          }
4468
4469          // Apply Superfish to the list.
4470          list.superfish(options.sf);
4471
4472          // Check if we are to apply any other plug-in to it.
4473          if (options.plugins || false) {
4474            if (options.plugins.touchscreen || false) {
4475              list.sftouchscreen(options.plugins.touchscreen);
4476            }
4477            if (options.plugins.smallscreen || false) {
4478              list.sfsmallscreen(options.plugins.smallscreen);
4479            }
4480            if (options.plugins.automaticwidth || false) {
4481              list.sfautomaticwidth();
4482            }
4483            if (options.plugins.supposition || false) {
4484              list.supposition();
4485            }
4486            if (options.plugins.bgiframe || false) {
4487              list.find('ul').bgIframe({opacity:false});
4488            }
4489          }
4490        });
4491      });
4492    }
4493  };
4494})(jQuery);;

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.