PageSourceSearch

https://www.discovertunisia.com/en/sites/default/files/js/js_-Iw_-KBbnJacV8-5GvT8vg6QiKhkdzmj-6-dhiH-Bns.js

js discovertunisia.com collected 2026-10-02 05:46:54 UTC 78,185 bytes, 1,160 lines download raw bytes

vendor: 1,592 bytes, lines 1-5
1/*
2 * jQuery FlexSlider v2.6.1
3 * Copyright 2012 WooThemes
4 * Contributing Author: Tyler Smith
5 */!function($){var e=!0;$.flexslider=function(t,a){var n=$(t);n.vars=$.extend({},$.flexslider.defaults,a);var i=n.vars.namespace,s=window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture,r=("ontouchstart"in window||s||window.DocumentTouch&&document instanceof DocumentTouch)&&n.vars.touch,o="click touchend MSPointerUp keyup",l="",c,d="vertical"===n.vars.direction,u=n.vars.reverse,v=n.vars.itemWidth>0,p="fade"===n.vars.animation,m=""!==n.vars.asNavFor,f={};$.data(t,"flexslider",n),f={init:function(){n.animating=!1,n.currentSlide=parseInt(n.vars.startAt?n.vars.startAt:0,10),isNaN(n.currentSlide)&&(n.currentSlide=0),n.animatingTo=n.currentSlide,n.atEnd=0===n.currentSlide||n.currentSlide===n.last,n.containerSelector=n.vars.selector.substr(0,n.vars.selector.search(" ")),n.slides=$(n.vars.selector,n),n.container=$(n.containerSelector,n),n.count=n.slides.length,n.syncExists=$(n.vars.sync).length>0,"slide"===n.vars.animation&&(n.vars.animation="swing"),n.prop=d?"top":"marginLeft",n.args={},n.manualPause=!1,n.stopped=!1,n.started=!1,n.startTimeout=null,n.transitions=!n.vars.video&&!p&&n.vars.useCSS&&function(){var e=document.createElement("div"),t=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var a in t)if(void 0!==e.style[t[a]])return n.pfx=t[a].replace("Perspective","").toLowerCase(),n.prop="-"+n.pfx+"-transform",!0;return!1}(),n.ensureAnimationEnd="",""!==n.vars.controlsContainer&&(n.controlsContainer=$(n.vars.c
5ontrolsContainer).length>0&&$(n.vars.controlsContainer)),""!==n.vars.manualControls&&(n.manualControls=$(n.vars.manualControls).length>0&&$(n.vars.manualControls)),""!==n.vars.customDirectionNav&&(n.customDirectionNav=2===$(n.vars.customDirectionNav).length&&$(n.vars.customDirectionNav)),n.vars.randomize&&(n.slides.sort(function(){return Math.round(Math.random())-.5}),n.container.empty().append(n.slides)),n.doMath(),n.setup("init"),n.vars.controlNav&&f.controlNav.setup(),n.vars.directionNav&&f.directionNav.setup(),n.vars.keyboard&&(1===$(n.containerSelector).length||n.vars.multipleKeyboard)&&$(document).bind("keyup",function(e){var t=e.keyCode;if(!n.animating&&(39===t||37===t)){var a=39===t?n.getTarget("next"):37===t?n.getTarget("prev"):!1;n.flexAnimate(a,n.vars.pauseOnAction)}}),n.vars.mousewheel&&n.bind("mousewheel",function(e,t,a,i){e.preventDefault();var s=0>t?n.getTarget("next"):n.getTarget("prev");n.flexAnimate(s,n.vars.pauseOnAction)}),n.vars.pausePlay&&f.pausePlay.setup(),n.vars.slideshow&&n.vars.pauseInvisible&&f.pauseInvisible.init(),n.vars.slideshow&&(n.vars.pauseOnHover&&n.hover(function(){n.manualPlay||n.manualPause||n.pause()},function(){n.manualPause||n.manualPlay||n.stopped||n.play()}),n.vars.pauseInvisible&&f.pauseInvisible.isHidden()||(n.vars.initDelay>0?n.startTimeout=setTimeout(n.play,n.vars.initDelay):n.play())),m&&f.asNav.setup(),r&&n.vars.touch&&f.touch(),(!p||p&&n.vars.smoothHeight)&&$(window).bind("resize orientationchange focus",f.resize),n.find("img").attr("draggable","false"),setTimeout(function(){n.vars.start(n)},200)},asNav:{setup:function(){n.asNav=!0,n.animatingTo=Math.floor(n.currentSlide/n.move),n.currentItem=n.currentSlide,n.slides.removeClass(i+"active-slide").eq(n.currentItem).addClass(i+"active-slide"),s?(t._slider=n,n.slides.each(function(){var e=this;e._gesture=new MSGesture,e._gesture.target=e,e.addEventListener("MSPointerDown",function(e){e.preventDefault(),e.currentTarget._gesture&&e.currentTarget._gesture.addPointer(e.pointerId)},!1),e.addEventListener("MSGestureTap",function(e){e.preventDefault();var t=$(this),a=t.index();$(n.vars.asNavFor).data("flexslider").animating||t.hasClass("active")||(n.direction=n.currentItem<a?"next":"prev",n.flexAnimate(a,n.vars.pauseOnAction,!1,!0,!0))})})):n.slides.on(o,function(e){e.preventDefault();var t=$(this),a=t.index(),s=t.offset().left-$(n).scrollLeft();0>=s&&t.hasClass(i+"active-slide")?n.flexAnimate(n.getTarget("prev"),!0):$(n.vars.asNavFor).data("flexslider").animating||t.hasClass(i+"active-slide")||(n.direction=n.currentItem<a?"next":"prev",n.flexAnimate(a,n.vars.pauseOnAction,!1,!0,!0))})}},controlNav:{setup:function(){n.manualControls?f.controlNav.setupManual():f.controlNav.setupPaging()},setupPaging:function(){var e="thumbnails"===n.vars.controlNav?"control-thumbs":"control-paging",t=1,a,s;if(n.controlNavScaffold=$('<ol class="'+i+"control-nav "+i+e+'"></ol>'),n.pagingCount>1)for(var r=0;r<n.pagingCount;r++){s=n.slides.eq(r),void 0===s.attr("data-thumb-alt")&&s.attr("data-thumb-alt","");var c=""!==s.attr("data-thumb-alt")?c=' alt="'+s.attr("data-thumb-alt")+'"':"";if(a="thumbnails"===n.vars.controlNav?'<img src="'+s.attr("data-thumb")+'"'+c+"/>":'<a href="#">'+t+"</a>","thumbnails"===n.vars.controlNav&&!0===n.vars.thumbCaptions){var d=s.attr("data-thumbcaption");""!==d&&void 0!==d&&(a+='<span class="'+i+'caption">'+d+"</span>")}n.controlNavScaffold.append("<li>"+a+"</li>"),t++}n.controlsContainer?$(n.controlsContainer).append(n.controlNavScaffold):n.append(n.controlNavScaffold),f.controlNav.set(),f.controlNav.active(),n.controlNavScaffold.delegate("a, img",o,function(e){if(e.preventDefault(),""===l||l===e.type){var t=$(this),a=n.controlNav.index(t);t.hasClass(i+"active")||(n.direction=a>n.currentSlide?"next":"prev",n.flexAnimate(a,n.vars.pauseOnAction))}""===l&&(l=e.type),f.setToClearWatchedEvent()})},setupManual:function(){n.controlNav=n.manualControls,f.controlNav.active(),n.controlNav.bind(o,function(e){if(e.preventDefault(),""===l||l===e.type){var t=$(this),a=n.controlNav.index(t);t.hasClass(i+"active")||(a>n.currentSlide?n.direction="next":n.direction="prev",n.flexAnimate(a,n.vars.pauseOnAction))}""===l&&(l=e.type),f.setToClearWatchedEvent()})}
vendor: 12,819 bytes, line 5
5,set:function(){var e="thumbnails"===n.vars.controlNav?"img":"a";n.controlNav=$("."+i+"control-nav li "+e,n.controlsContainer?n.controlsContainer:n)},active:function(){n.controlNav.removeClass(i+"active").eq(n.animatingTo).addClass(i+"active")},update:function(e,t){n.pagingCount>1&&"add"===e?n.controlNavScaffold.append($('<li><a href="#">'+n.count+"</a></li>")):1===n.pagingCount?n.controlNavScaffold.find("li").remove():n.controlNav.eq(t).closest("li").remove(),f.controlNav.set(),n.pagingCount>1&&n.pagingCount!==n.controlNav.length?n.update(t,e):f.controlNav.active()}},directionNav:{setup:function(){var e=$('<ul class="'+i+'direction-nav"><li class="'+i+'nav-prev"><a class="'+i+'prev" href="#">'+n.vars.prevText+'</a></li><li class="'+i+'nav-next"><a class="'+i+'next" href="#">'+n.vars.nextText+"</a></li></ul>");n.customDirectionNav?n.directionNav=n.customDirectionNav:n.controlsContainer?($(n.controlsContainer).append(e),n.directionNav=$("."+i+"direction-nav li a",n.controlsContainer)):(n.append(e),n.directionNav=$("."+i+"direction-nav li a",n)),f.directionNav.update(),n.directionNav.bind(o,function(e){e.preventDefault();var t;(""===l||l===e.type)&&(t=$(this).hasClass(i+"next")?n.getTarget("next"):n.getTarget("prev"),n.flexAnimate(t,n.vars.pauseOnAction)),""===l&&(l=e.type),f.setToClearWatchedEvent()})},update:function(){var e=i+"disabled";1===n.pagingCount?n.directionNav.addClass(e).attr("tabindex","-1"):n.vars.animationLoop?n.directionNav.removeClass(e).removeAttr("tabindex"):0===n.animatingTo?n.directionNav.removeClass(e).filter("."+i+"prev").addClass(e).attr("tabindex","-1"):n.animatingTo===n.last?n.directionNav.removeClass(e).filter("."+i+"next").addClass(e).attr("tabindex","-1"):n.directionNav.removeClass(e).removeAttr("tabindex")}},pausePlay:{setup:function(){var e=$('<div class="'+i+'pauseplay"><a href="#"></a></div>');n.controlsContainer?(n.controlsContainer.append(e),n.pausePlay=$("."+i+"pauseplay a",n.controlsContainer)):(n.append(e),n.pausePlay=$("."+i+"pauseplay a",n)),f.pausePlay.update(n.vars.slideshow?i+"pause":i+"play"),n.pausePlay.bind(o,function(e){e.preventDefault(),(""===l||l===e.type)&&($(this).hasClass(i+"pause")?(n.manualPause=!0,n.manualPlay=!1,n.pause()):(n.manualPause=!1,n.manualPlay=!0,n.play())),""===l&&(l=e.type),f.setToClearWatchedEvent()})},update:function(e){"play"===e?n.pausePlay.removeClass(i+"pause").addClass(i+"play").html(n.vars.playText):n.pausePlay.removeClass(i+"play").addClass(i+"pause").html(n.vars.pauseText)}},touch:function(){function e(e){e.stopPropagation(),n.animating?e.preventDefault():(n.pause(),t._gesture.addPointer(e.pointerId),T=0,c=d?n.h:n.w,f=Number(new Date),l=v&&u&&n.animatingTo===n.last?0:v&&u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:v&&n.currentSlide===n.last?n.limit:v?(n.itemW+n.vars.itemMargin)*n.move*n.currentSlide:u?(n.last-n.currentSlide+n.cloneOffset)*c:(n.currentSlide+n.cloneOffset)*c)}function a(e){e.stopPropagation();var a=e.target._slider;if(a){var n=-e.translationX,i=-e.translationY;return T+=d?i:n,m=T,y=d?Math.abs(T)<Math.abs(-n):Math.abs(T)<Math.abs(-i),e.detail===e.MSGESTURE_FLAG_INERTIA?void setImmediate(function(){t._gesture.stop()}):void((!y||Number(new Date)-f>500)&&(e.preventDefault(),!p&&a.transitions&&(a.vars.animationLoop||(m=T/(0===a.currentSlide&&0>T||a.currentSlide===a.last&&T>0?Math.abs(T)/c+2:1)),a.setProps(l+m,"setTouch"))))}}function i(e){e.stopPropagation();var t=e.target._slider;if(t){if(t.animatingTo===t.currentSlide&&!y&&null!==m){var a=u?-m:m,n=a>0?t.getTarget("next"):t.getTarget("prev");t.canAdvance(n)&&(Number(new Date)-f<550&&Math.abs(a)>50||Math.abs(a)>c/2)?t.flexAnimate(n,t.vars.pauseOnAction):p||t.flexAnimate(t.currentSlide,t.vars.pauseOnAction,!0)}r=null,o=null,m=null,l=null,T=0}}var r,o,l,c,m,f,g,h,S,y=!1,x=0,b=0,T=0;s?(t.style.msTouchAction="none",t._gesture=new MSGesture,t._gesture.target=t,t.addEventListener("MSPointerDown",e,!1),t._slider=n,t.addEventListener("MSGestureChange",a,!1),t.addEventListener("MSGestureEnd",i,!1)):(g=function(e){n.animating?e.preventDefault():(window.navigator.msPointerEnabled||1===e.touches.length)&&(n.pause(),c=d?n.h:n.w,f=Number(new Date),x=e.touches[0].pageX,b=e.touches[0].pageY,l=v&&u&&n.animatingTo===n.last?0:v&&u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:v&&n.currentSlide===n.last?n.limit:v?(n.itemW+n.vars.itemMargin)*n.move*n.currentSlide:u?(n.last-n.currentSlide+n.cloneOffset)*c:(n.currentSlide+n.cloneOffset)*c,r=d?b:x,o=d?x:b,t.addEventListener("touchmove",h,!1),t.addEventListener("touchend",S,!1))},h=function(e){x=e.touches[0].pageX,b=e.touches[0].pageY,m=d?r-b:r-x,y=d?Math.abs(m)<Math.abs(x-o):Math.abs(m)<Math.abs(b-o);var t=500;(!y||Number(new Date)-f>t)&&(e.preventDefault(),!p&&n.transitions&&(n.vars.animationLoop||(m/=0===n.currentSlide&&0>m||n.currentSlide===n.last&&m>0?Math.abs(m)/c+2:1),n.setProps(l+m,"setTouch")))},S=function(e){if(t.removeEventListener("touchmove",h,!1),n.animatingTo===n.currentSlide&&!y&&null!==m){var a=u?-m:m,i=a>0?n.getTarget("next"):n.getTarget("prev");n.canAdvance(i)&&(Number(new Date)-f<550&&Math.abs(a)>50||Math.abs(a)>c/2)?n.flexAnimate(i,n.vars.pauseOnAction):p||n.flexAnimate(n.currentSlide,n.vars.pauseOnAction,!0)}t.removeEventListener("touchend",S,!1),r=null,o=null,m=null,l=null},t.addEventListener("touchstart",g,!1))},resize:function(){!n.animating&&n.is(":visible")&&(v||n.doMath(),p?f.smoothHeight():v?(n.slides.width(n.computedW),n.update(n.pagingCount),n.setProps()):d?(n.viewport.height(n.h),n.setProps(n.h,"setTotal")):(n.vars.smoothHeight&&f.smoothHeight(),n.newSlides.width(n.computedW),n.setProps(n.computedW,"setTotal")))},smoothHeight:function(e){if(!d||p){var t=p?n:n.viewport;e?t.animate({height:n.slides.eq(n.animatingTo).innerHeight()},e):t.innerHeight(n.slides.eq(n.animatingTo).innerHeight())}},sync:function(e){var t=$(n.vars.sync).data("flexslider"),a=n.animatingTo;switch(e){case"animate":t.flexAnimate(a,n.vars.pauseOnAction,!1,!0);break;case"play":t.playing||t.asNav||t.play();break;case"pause":t.pause()}},uniqueID:function(e){return e.filter("[id]").add(e.find("[id]")).each(function(){var e=$(this);e.attr("id",e.attr("id")+"_clone")}),e},pauseInvisible:{visProp:null,init:function(){var e=f.pauseInvisible.getHiddenProp();if(e){var t=e.replace(/[H|h]idden/,"")+"visibilitychange";document.addEventListener(t,function(){f.pauseInvisible.isHidden()?n.startTimeout?clearTimeout(n.startTimeout):n.pause():n.started?n.play():n.vars.initDelay>0?setTimeout(n.play,n.vars.initDelay):n.play()})}},isHidden:function(){var e=f.pauseInvisible.getHiddenProp();return e?document[e]:!1},getHiddenProp:function(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;t<e.length;t++)if(e[t]+"Hidden"in document)return e[t]+"Hidden";return null}},setToClearWatchedEvent:function(){clearTimeout(c),c=setTimeout(function(){l=""},3e3)}},n.flexAnimate=function(e,t,a,s,o){if(n.vars.animationLoop||e===n.currentSlide||(n.direction=e>n.currentSlide?"next":"prev"),m&&1===n.pagingCount&&(n.direction=n.currentItem<e?"next":"prev"),!n.animating&&(n.canAdvance(e,o)||a)&&n.is(":visible")){if(m&&s){var l=$(n.vars.asNavFor).data("flexslider");if(n.atEnd=0===e||e===n.count-1,l.flexAnimate(e,!0,!1,!0,o),n.direction=n.currentItem<e?"next":"prev",l.direction=n.direction,Math.ceil((e+1)/n.visible)-1===n.currentSlide||0===e)return n.currentItem=e,n.slides.removeClass(i+"active-slide").eq(e).addClass(i+"active-slide"),!1;n.currentItem=e,n.slides.removeClass(i+"active-slide").eq(e).addClass(i+"active-slide"),e=Math.floor(e/n.visible)}if(n.animating=!0,n.animatingTo=e,t&&n.pause(),n.vars.before(n),n.syncExists&&!o&&f.sync("animate"),n.vars.controlNav&&f.controlNav.active(),v||n.slides.removeClass(i+"active-slide").eq(e).addClass(i+"active-slide"),n.atEnd=0===e||e===n.last,n.vars.directionNav&&f.directionNav.update(),e===n.last&&(n.vars.end(n),n.vars.animationLoop||n.pause()),p)r?(n.slides.eq(n.currentSlide).css({opacity:0,zIndex:1}),n.slides.eq(e).css({opacity:1,zIndex:2}),n.wrapup(c)):(n.slides.eq(n.currentSlide).css({zIndex:1}).animate({opacity:0},n.vars.animationSpeed,n.vars.easing),n.slides.eq(e).css({zIndex:2}).animate({opacity:1},n.vars.animationSpeed,n.vars.easing,n.wrapup));else{var c=d?n.slides.filter(":first").height():n.computedW,g,h,S;v?(g=n.vars.itemMargin,S=(n.itemW+g)*n.move*n.animatingTo,h=S>n.limit&&1!==n.visible?n.limit:S):h=0===n.currentSlide&&e===n.count-1&&n.vars.animationLoop&&"next"!==n.direction?u?(n.count+n.cloneOffset)*c:0:n.currentSlide===n.last&&0===e&&n.vars.animationLoop&&"prev"!==n.direction?u?0:(n.count+1)*c:u?(n.count-1-e+n.cloneOffset)*c:(e+n.cloneOffset)*c,n.setProps(h,"",n.vars.animationSpeed),n.transitions?(n.vars.animationLoop&&n.atEnd||(n.animating=!1,n.currentSlide=n.animatingTo),n.container.unbind("webkitTransitionEnd transitionend"),n.container.bind("webkitTransitionEnd transitionend",function(){clearTimeout(n.ensureAnimationEnd),n.wrapup(c)}),clearTimeout(n.ensureAnimationEnd),n.ensureAnimationEnd=setTimeout(function(){n.wrapup(c)},n.vars.animationSpeed+100)):n.container.animate(n.args,n.vars.animationSpeed,n.vars.easing,function(){n.wrapup(c)})}n.vars.smoothHeight&&f.smoothHeight(n.vars.animationSpeed)}},n.wrapup=function(e){p||v||(0===n.currentSlide&&n.animatingTo===n.last&&n.vars.animationLoop?n.setProps(e,"jumpEnd"):n.currentSlide===n.last&&0===n.animatingTo&&n.vars.animationLoop&&n.setProps(e,"jumpStart")),n.animating=!1,n.currentSlide=n.animatingTo,n.vars.after(n)},n.animateSlides=function(){!n.animating&&e&&n.flexAnimate(n.getTarget("next"))},n.pause=function(){clearInterval(n.animatedSlides),n.animatedSlides=null,n.playing=!1,n.vars.pausePlay&&f.pausePlay.update("play"),n.syncExists&&f.sync("pause")},n.play=function(){n.playing&&clearInterval(n.animatedSlides),n.animatedSlides=n.animatedSlides||setInterval(n.animateSlides,n.vars.slideshowSpeed),n.started=n.playing=!0,n.vars.pausePlay&&f.pausePlay.update("pause"),n.syncExists&&f.sync("play")},n.stop=function(){n.pause(),n.stopped=!0},n.canAdvance=function(e,t){var a=m?n.pagingCount-1:n.last;return t?!0:m&&n.currentItem===n.count-1&&0===e&&"prev"===n.direction?!0:m&&0===n.currentItem&&e===n.pagingCount-1&&"next"!==n.direction?!1:e!==n.currentSlide||m?n.vars.animationLoop?!0:n.atEnd&&0===n.currentSlide&&e===a&&"next"!==n.direction?!1:n.atEnd&&n.currentSlide===a&&0===e&&"next"===n.direction?!1:!0:!1},n.getTarget=function(e){return n.direction=e,"next"===e?n.currentSlide===n.last?0:n.currentSlide+1:0===n.currentSlide?n.last:n.currentSlide-1},n.setProps=function(e,t,a){var i=function(){var a=e?e:(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo,i=function(){if(v)return"setTouch"===t?e:u&&n.animatingTo===n.last?0:u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:n.animatingTo===n.last?n.limit:a;switch(t){case"setTotal":return u?(n.count-1-n.currentSlide+n.cloneOffset)*e:(n.currentSlide+n.cloneOffset)*e;case"setTouch":return u?e:e;case"jumpEnd":return u?e:n.count*e;case"jumpStart":return u?n.count*e:e;default:return e}}();return-1*i+"px"}();n.transitions&&(i=d?"translate3d(0,"+i+",0)":"translate3d("+i+",0,0)",a=void 0!==a?a/1e3+"s":"0s",n.container.css("-"+n.pfx+"-transition-duration",a),n.container.css("transition-duration",a)),n.args[n.prop]=i,(n.transitions||void 0===a)&&n.container.css(n.args),n.container.css("transform",i)},n.setup=function(e){if(p)n.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"}),"init"===e&&(r?n.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+n.vars.animationSpeed/1e3+"s ease",zIndex:1}).eq(n.currentSlide).css({opacity:1,zIndex:2}):0==n.vars.fadeFirstSlide?n.slides.css({opacity:0,display:"block",zIndex:1}).eq(n.currentSlide).css({zIndex:2}).css({opacity:1}):n.slides.css({opacity:0,display:"block",zIndex:1}).eq(n.currentSlide).css({zIndex:2}).animate({opacity:1},n.vars.animationSpeed,n.vars.easing)),n.vars.smoothHeight&&f.smoothHeight();else{var t,a;"init"===e&&(n.viewport=$('<div class="'+i+'viewport"></div>').css({overflow:"hidden",position:"relative"}).appendTo(n).append(n.container),n.cloneCount=0,n.cloneOffset=0,u&&(a=$.makeArray(n.slides).reverse(),n.slides=$(a),n.container.empty().append(n.slides))),n.vars.animationLoop&&!v&&(n.cloneCount=2,n.cloneOffset=1,"init"!==e&&n.container.find(".clone").remove(),n.container.append(f.uniqueID(n.slides.first().clone().addClass("clone")).attr("aria-hidden","true")).prepend(f.uniqueID(n.slides.last().clone().addClass("clone")).attr("aria-hidden","true"))),n.newSlides=$(n.vars.selector,n),t=u?n.count-1-n.currentSlide+n.cloneOffset:n.currentSlide+n.cloneOffset,d&&!v?(n.container.height(200*(n.count+n.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){n.newSlides.css({display:"block"}),n.doMath(),n.viewport.height(n.h),n.setProps(t*n.h,"init")}
5,"init"===e?100:0)):(n.container.width(200*(n.count+n.cloneCount)+"%"),n.setProps(t*n.computedW,"init"),setTimeout(function(){n.doMath(),n.newSlides.css({width:n.computedW,marginRight:n.computedM,"float":"left",display:"block"}),n.vars.smoothHeight&&f.smoothHeight()},"init"===e?100:0))}v||n.slides.removeClass(i+"active-slide").eq(n.currentSlide).addClass(i+"active-slide"),n.vars.init(n)},n.doMath=function(){var e=n.slides.first(),t=n.vars.itemMargin,a=n.vars.minItems,i=n.vars.maxItems;n.w=void 0===n.viewport?n.width():n.viewport.width(),n.h=e.height(),n.boxPadding=e.outerWidth()-e.width(),v?(n.itemT=n.vars.itemWidth+t,n.itemM=t,n.minW=a?a*n.itemT:n.w,n.maxW=i?i*n.itemT-t:n.w,n.itemW=n.minW>n.w?(n.w-t*(a-1))/a:n.maxW<n.w?(n.w-t*(i-1))/i:n.vars.itemWidth>n.w?n.w:n.vars.itemWidth,n.visible=Math.floor(n.w/n.itemW),n.move=n.vars.move>0&&n.vars.move<n.visible?n.vars.move:n.visible,n.pagingCount=Math.ceil((n.count-n.visible)/n.move+1),n.last=n.pagingCount-1,n.limit=1===n.pagingCount?0:n.vars.itemWidth>n.w?n.itemW*(n.count-1)+t*(n.count-1):(n.itemW+t)*n.count-n.w-t):(n.itemW=n.w,n.itemM=t,n.pagingCount=n.count,n.last=n.count-1),n.computedW=n.itemW-n.boxPadding,n.computedM=n.itemM},n.update=function(e,t){n.doMath(),v||(e<n.currentSlide?n.currentSlide+=1:e<=n.currentSlide&&0!==e&&(n.currentSlide-=1),n.animatingTo=n.currentSlide),n.vars.controlNav&&!n.manualControls&&("add"===t&&!v||n.pagingCount>n.controlNav.length?f.controlNav.update("add"):("remove"===t&&!v||n.pagingCount<n.controlNav.length)&&(v&&n.currentSlide>n.last&&(n.currentSlide-=1,n.animatingTo-=1),f.controlNav.update("remove",n.last))),n.vars.directionNav&&f.directionNav.update()},n.addSlide=function(e,t){var a=$(e);n.count+=1,n.last=n.count-1,d&&u?void 0!==t?n.slides.eq(n.count-t).after(a):n.container.prepend(a):void 0!==t?n.slides.eq(t).before(a):n.container.append(a),n.update(t,"add"),n.slides=$(n.vars.selector+":not(.clone)",n),n.setup(),n.vars.added(n)},n.removeSlide=function(e){var t=isNaN(e)?n.slides.index($(e)):e;n.count-=1,n.last=n.count-1,isNaN(e)?$(e,n.slides).remove():d&&u?n.slides.eq(n.last).remove():n.slides.eq(e).remove(),n.doMath(),n.update(t,"remove"),n.slides=$(n.vars.selector+":not(.clone)",n),n.setup(),n.vars.removed(n)},f.init()},$(window).blur(function(t){e=!1}).focus(function(t){e=!0}),$.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7e3,animationSpeed:600,initDelay:0,randomize:!1,fadeFirstSlide:!0,thumbCaptions:!1,pauseOnAction:!0,pauseOnHover:!1,pauseInvisible:!0,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",customDirectionNav:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:1,maxItems:0,move:0,allowOneSlide:!0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){},init:function(){}},$.fn.flexslider=function(e){if(void 0===e&&(e={}),"object"==typeof e)return this.each(function(){var t=$(this),a=e.selector?e.selector:".slides > li",n=t.find(a);1===n.length&&e.allowOneSlide===!1||0===n.length?(n.fadeIn(400),e.start&&e.start(t)):void 0===t.data("flexslider")&&new $.flexslider(this,e)});var t=$(this).data("flexslider");switch(e){case"play":t.play();break;case"pause":t.pause();break;case"stop":t.stop();break;case"next":t.flexAnimate(t.getTarget("next"),!0);break;case"prev":case"previous":t.flexAnimate(t.getTarget("prev"),!0);break;default:"number"==typeof e&&t.flexAnimate(e,!0)}}}(jQuery);;
6/**
7 *  @file
8 *  Initiate the BxSlider plugin.
9 */
10
11(function ($) {
12  Drupal.behaviors.viewsSlideshowBxslider = {
13    attach: function (context, settings) {
14      for (id in Drupal.settings.viewsSlideshowBxslider) {
15        var html_id = id.replace(/_/g, '-');
16        $('#' + html_id + ':not(.viewsSlideshowBxslider-processed)', context).addClass('viewsSlideshowBxslider-processed').each(function () {
17          // Fire up the gallery.
18          var settingsBxSlider = $.extend(
19            {},
20            Drupal.settings.viewsSlideshowBxslider[id]['general'],
21            Drupal.settings.viewsSlideshowBxslider[id]['controlsfieldset'],
22            Drupal.settings.viewsSlideshowBxslider[id]['pagerfieldset'],
23            Drupal.settings.viewsSlideshowBxslider[id]['autofieldset'],
24            Drupal.settings.viewsSlideshowBxslider[id]['carousel']
25          );
26
27          for (callback in Drupal.settings.viewsSlideshowBxslider[id]['callback']) {
28            Drupal.settings.viewsSlideshowBxslider[id]['callback'][callback]
29              = eval("Drupal.settings.viewsSlideshowBxslider[id]['callback'][callback] = (" + Drupal.settings.viewsSlideshowBxslider[id]['callback'][callback] + ")");
30          }
31          settingsBxSlider = $.extend({}, settingsBxSlider, Drupal.settings.viewsSlideshowBxslider[id]['callback']);
32          // Bind to window load, so that images are responsive.
33          $(window).bind('load', {
34            bxSlider: $(this)
35          }, function (event) {
36            event.data.bxSlider.bxSlider(settingsBxSlider);
37          });
38        });
39      }
40    }
41  };
42}(jQuery));
43;
44/*!
45 * jQuery UI Touch Punch 0.2.2
46 *
47 * Copyright 2011, Dave Furfero
48 * Dual licensed under the MIT or GPL Version 2 licenses.
49 *
50 * Depends:
51 *  jquery.ui.widget.js
52 *  jquery.ui.mouse.js
53 */
54(function ($) {
55
56  // Detect touch support
57  $.support.touch = 'ontouchend' in document;
58
59  // Ignore browsers without touch support
60  if (!$.support.touch) {
61    return;
62  }
63
64  var mouseProto = $.ui.mouse.prototype,
65      _mouseInit = mouseProto._mouseInit,
66      touchHandled;
67
68  /**
69   * Simulate a mouse event based on a corresponding touch event
70   * @param {Object} event A touch event
71   * @param {String} simulatedType The corresponding mouse event
72   */
73  function simulateMouseEvent (event, simulatedType) {
74
75    // Ignore multi-touch events
76    if (event.originalEvent.touches.length > 1) {
77      return;
78    }
79
80    event.preventDefault();
81
82    var touch = event.originalEvent.changedTouches[0],
83        simulatedEvent = document.createEvent('MouseEvents');
84    
85    // Initialize the simulated mouse event using the touch event's co
85ordinates
86    simulatedEvent.initMouseEvent(
87      simulatedType,    // type
88      true,             // bubbles                    
89      true,             // cancelable                 
90      window,           // view                       
91      1,                // detail                     
92      touch.screenX,    // screenX                    
93      touch.screenY,    // screenY                    
94      touch.clientX,    // clientX                    
95      touch.clientY,    // clientY                    
96      false,            // ctrlKey                    
97      false,            // altKey                     
98      false,            // shiftKey                   
99      false,            // metaKey                    
100      0,                // button                     
101      null              // relatedTarget              
102    );
103
104    // Dispatch the simulated event to the target element
105    event.target.dispatchEvent(simulatedEvent);
106  }
107
108  /**
109   * Handle the jQuery UI widget's touchstart events
110   * @param {Object} event The widget element's touchstart event
111   */
112  mouseProto._touchStart = function (event) {
113
114    var self = this;
115
116    // Ignore the event if another widget is already being handled
117    if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) {
118      return;
119    }
120
121    // Set the flag to prevent other widgets from inheriting the touch event
122    touchHandled = true;
123
124    // Track movement to determine if interaction was a click
125    self._touchMoved = false;
126
127    // Simulate the mouseover event
128    simulateMouseEvent(event, 'mouseover');
129
130    // Simulate the mousemove event
131    simulateMouseEvent(event, 'mousemove');
132
133    // Simulate the mousedown event
134    simulateMouseEvent(event, 'mousedown');
135  };
136
137  /**
138   * Handle the jQuery UI widget's touchmove events
139   * @param {Object} event The document's touchmove event
140   */
141  mouseProto._touchMove = function (event) {
142
143    // Ignore event if not handled
144    if (!touchHandled) {
145      return;
146    }
147
148    // Interaction was not a click
149    this._touchMoved = true;
150
151    // Simulate the mousemove event
152    simulateMouseEvent(event, 'mousemove');
153  };
154
155  /**
156   * Handle the jQuery UI widget's touchend events
157   * @param {Object} event The document's touchend event
158   */
159  mouseProto._touchEnd = function (event) {
160
161    // Ignore event if not handled
162    if (!touchHandled) {
163      return;
164    }
165
166    // Simulate the mouseup event
167    simulateMouseEvent(event, 'mouseup');
168
169    // Simulate the mouseout event
170    simulateMouseEvent(event, 'mouseout');
171
172    // If the touch interaction did not move, it should trigger a click
173    if (!this._touchMoved) {
174
175      // Simulate the click event
176      simulateMouseEvent(event, 'click');
177    }
178
179    // Unset the flag to allow other widgets to inherit the touch event
180    touchHandled = false;
181  };
182
183  /**
184   * A duck punch of the $.ui.mouse _mouseInit method to support touch events.
185   * This method extends the widget with bound touch event handlers that
186   * translate touch events to mouse events and pass them to the widget's
187   * original mouse event handling methods.
188   */
189  mouseProto._mouseInit = function () {
190    
191    var self = this;
192
193    // Delegate the touch handlers to the widget's element
194    self.element
195      .bind('touchstart', $.proxy(self, '_touchStart'))
196      .bind('touchmove', $.proxy(self, '_touchMove'))
197      .bind('touchend', $.proxy(self, '_touchEnd'));
198
199    // Call the original $.ui.mouse init method
200    _mouseInit.call(self);
201  };
202
203})(jQuery);;
204(function(){var g=void 0,l=!0,m=null,n=!1;function p(){return function(){}}
205(function(){ktools={h:function(){var a="en",c=[],d=new ktools.j;this.getLanguage=this.ga=function(){return a};this.getAvailableLanguages=this.ba=function(){return c};this.initLanguage=this.ra=function(c,b){a=c;for(var f=ktools.q.G(b),j=f.getElementsByTagName("data").length,i=g,k=0;k<j;k++)i=f.getElementsByTagName("data")[k].textContent!=g?f.getElementsByTagName("data")[k].textContent:g,i==g&&f.getElementsByTagName("data")[k].innerText&&(i=f.getElementsByTagName("data")[k].innerText),i==g&&f.getElementsByTagName("data")[k].innerHTML&&
206(i=f.getElementsByTagName("data")[k].innerHTML),i==g&&f.getElementsByTagName("data")[k].text&&(i=f.getElementsByTagName("data")[k].text),i==g&&f.getElementsByTagName("data")[k].firstChild&&(i=f.getElementsByTagName("data")[k].firstChild.data),d.add(f.getElementsByTagName("data")[k].getAttribute("name"),i)};this.getMessage=this.ha=function(c){return d.item(a+"_"+c)}}};ktools.I18N=ktools.h;ktools.h.a=m;ktools.I18N.instance=ktools.h.a;ktools.h.d=function(){this.a==m&&(this.a=new ktools.h);return this.a};
207ktools.I18N.getInstance=ktools.h.d;ktools.q=p();ktools.XML=ktools.q;ktools.q.G=function(a){var c=m,d=m,h=n;try{c=new XMLHttpRequest,c.open("GET",a,n)}catch(b){if("undefined"!=typeof window.ActiveXObject){d=new ActiveXObject("Microsoft.XMLDOM");for(d.async=n;4!=d.readyState;);d.load(a);h=l;return d}d=document.implementation.createDocument("","",m);d.onload=function(){return d};d.load(a);h=l}if(!h)return c.send(""),d=c.responseXML,h=l,d};ktools.XML.importXML=ktools.q.G;ktools.w=p();ktools.Device=ktools.w;
208ktools.w.Ca=function(){return"ontouchstart"in window||"ontouchstart"in document.documentElement||window.Ua&&document instanceof DocumentTouch};ktools.Device.isTouch=ktools.w.Ca;ktools.e=p();ktools.DOM=ktools.e;ktools.e.ia=function(a){for(var c=y=0;a&&!isNaN(a.offsetLeft)&&!isNaN(a.offsetTop);)c+=a.offsetLeft-a.scrollLeft,y+=a.offsetTop-a.scrollTop,a=a.offsetParent;return{x:c,y:y}};ktools.DOM.getOffset=ktools.e.ia;ktools.e.preventDefault=function(a){e=a?a:window.event;e.preventDefault?e.preventDefault():
209e.returnValue=n};ktools.DOM.preventDefault=ktools.e.preventDefault;ktools.e.Ra=function(a){e=a?a:window.event;e.stopPropagation?e.stopPropagation():e.cancelBubble=l};ktools.DOM.stopEventPropagation=ktools.e.Ra;ktools.n=p();ktools.String=ktools.n;ktools.n.Qa=function(a,c){return a.match("^"+c)==c};ktools.String.startsWith=ktools.n.Qa;ktools.n.W=function(a){var c=a,c=jQuery("<div/>").html(a).text();return unescape(c)};ktools.String.decode=ktools.n.W;ktools.v=p();ktools.Code=ktools.v;ktools.v.eval=function(a){a=
210a.replace(/(\r\n|\n|\r|\t)/gm,"");eval(a)};ktools.Code.eval=ktools.v.eval;ktools.z=p();ktools.Url=ktools.z;ktools.z.ja=function(a,c){var c=c.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),d=RegExp("[\\?&]"+c+"=([^&#]*)").exec(a);return d==m?"":d[1]};ktools.Url.getParam=ktools.z.ja;ktools.m=p();ktools.Color=ktools.m;ktools.m.pa=function(a,c){var d=/^#?[0-9a-f]{3,6}$/i.test(a);return"undefined"!=typeof a&&(7==a.length||4==a.length)&&d?a.toUpperCase():"undefined"!=typeof a&&(6==a.length||3==a.length)&&
211d?"#"+a.toUpperCase():"undefined"!=typeof c?c:"#FFFFFF"};ktools.Color.htmlColor=ktools.m.pa;ktools.m.oa=function(a){var c=[];c[0]=parseInt(a.substr(0,2),16);c[1]=parseInt(a.substr(2,2),16);c[2]=parseInt(a.substr(4,2),16);return c};ktools.Color.hex2rgb=ktools.m.oa;
211ktools.N=function(){function a(b){var a=b.indexOf(this.u);return-1==a?g:parseFloat(b.substring(a+this.u.length+1))}function c(b){for(var a=0,c=b.length;a<c;a++){var d=b[a].string,k=b[a].prop;this.u=b[a].versionSearch||b[a].identity;if(d){if(-1!=
212d.indexOf(b[a].subString))return b[a].identity}else if(k)return b[a].identity}}this.versionSearchString=this.u=this.version=this.version=this.OS=this.f=this.browser=this.browser="";var d=[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera",versionSearch:"Version"},{string:navigator.vendor,
213subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Trident",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,
214subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],h=[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.userAgent,subString:"iPad",identity:"iPad"},{string:navigator.platform,subString:"Linux",identity:"Linux"}];this.isIE=this.I=function(){return"Explorer"==
215this.browser};this.isVista=this.Da=function(){return-1!=navigator.userAgent.indexOf("Windows NT 6.0")};this.isXP=this.Ja=function(){return-1!=navigator.userAgent.indexOf("Windows NT 5")};this.isWindows7=this.Ha=function(){return-1!=navigator.userAgent.indexOf("Windows NT 6.1")};this.isWindows8=this.Ia=function(){return-1!=navigator.userAgent.indexOf("Windows NT 6.2")};this.isWindows=this.Ga=function(){return"Windows"==this.f};this.isLinux=this.ya=function(){return"Linux"==this.f};this.isWP8=this.Fa=
216function(){return-1!=navigator.userAgent.indexOf("Windows Phone 8")};this.isWP7=this.Ea=function(){return-1!=navigator.userAgent.indexOf("Windows Phone 7")};this.isAndroid=this.sa=function(){return-1!=navigator.userAgent.indexOf("Android")};this.isIE9=this.va=function(){return this.I()&&9==this.D()};this.isMac=this.za=function(){return"Mac"==this.f||this.s()};this.isIOS=this.s=function(){return"iPhone/iPod"==this.f||"iPad"==this.f};this.isIOSRetina=this.wa=function(){return this.s()&&1<window.devicePixelRatio};
217this.isMobileSafari=this.Aa=function(){return this.K()&&this.s()};this.isSafari=this.K=function(){return"Safari"==this.browser};this.isChrome=this.ta=function(){return"Chrome"==this.browser};this.isFirefox=this.ua=function(){return"Firefox"==this.browser||"Mozilla"==this.browser};this.isOpera=this.Ba=function(){return"Opera"==this.browser};this.getInternetExplorerVersion=this.D=function(){var a=-1;if("Microsoft Internet Explorer"==navigator.appName){var d=navigator.userAgent,c=/MSIE ([0-9]{1,}[.0-9]{0,})/;
218c.exec(d)!=m&&(a=parseFloat(RegExp.$1))}else"Netscape"==navigator.appName&&(d=navigator.userAgent,c=/Trident\/.*rv:([0-9]{1,}[.0-9]{0,})/,c.exec(d)!=m&&(a=parseFloat(RegExp.$1)));return a};this.init=this.qa=function(){this.browser=c(d)||"An unknown browser";this.version=a(navigator.userAgent)||a(navigator.appVersion)||"An unknown version";this.f=c(h)||"An unknown OS"}};ktools.BrowserDetect=ktools.N;ktools.P=function(a){var c=["webkit","moz","ms","o","khtml"],d=a||document.documentElement,h=n,b="",
219f="",j={enter:m,exit:m,change:m,resize:m},i=n;this.getExternal=this.b=function(){return j};this.setExternal=this.Pa=function(a){j=a};this.isFullscreen=this.A=function(){return""===b?document.fullscreen?document.fullscreen:document.fullScreen:"webkit"==b?document[b+"IsFullscreen"]?document[b+"IsFullscreen"]:document[b+"IsFullScreen"]:document[b+"Fullscreen"]?document[b+"Fullscreen"]:document[b+"FullScreen"]};this.getFullscreenElement=this.o=function(){if(h){var a=document;return""===b?a.$?a.$:a.Wa:
220a[b+"FullscreenElement"]?a[b+"FullscreenElement"]:a[b+"FullScreenElement"]}return m};this.getFullscreenEnabled=this.fa=function(){if(h)return l;var a=document;if(""===b)return a.aa?a.aa:a.Xa;if("webkit"==b){if(kolorBrowserDetect&&"Safari"==kolorBrowserDetect.browser&&7>
220kolorBrowserDetect.version)return n;if(a[b+"RequestFullscreen"])return a[b+"RequestFullscreen"];console.log(a[b+"RequestFullScreen"]);return a[b+"RequestFullScreen"]}return a[b+"FullscreenEnabled"]?a[b+"FullscreenEnabled"]:a[b+"FullScreenEnabled"]};
221this.supportsFullscreen=this.Sa=function(){debug&&console.log("ktools.Fullscreen.supportsFullscreen");f="";if("undefined"!=typeof document.exitFullscreen||"undefined"!=typeof document.exitFullScreen||"undefined"!=typeof document.cancelFullscreen||"undefined"!=typeof document.cancelFullScreen)h=l,f+="fullscreenchange";else for(var a=0,j=c.length;a<j;a++){b=c[a];if("undefined"!=typeof document[b+"CancelFullScreen"]||"undefined"!=typeof document[b+"CancelFullscreen"]||"undefined"!=typeof document[b+
222"ExitFullscreen"]||"undefined"!=typeof document[b+"ExitFullScreen"]){if("webkit"==b&&kolorBrowserDetect&&"Safari"==kolorBrowserDetect.browser&&7>kolorBrowserDetect.version){h=n;break}h=l;f="ms"==b?f+"MSFullscreenChange":f+b+"fullscreenchange";break}if("webkit"==b){var q=d;if(q.webkitSupportsFullscreen){h=q.webkitSupportsFullscreen;break}}}a="#"+d.id+":fullscreen { height: 100% !important; width: 100% !important; max-height: 100% !important; background-color: black; }";a+="#"+d.id+":fullscreen::backdrop { background-color: black; }";
223a+="#"+d.id+":full-screen { height: 100% !important; width: 100% !important; max-height: 100% !important; background-color: black; }";""!=b&&d.id&&("ms"==b?(a+="#"+d.id+":-"+b+"-fullscreen { height: 100% !important; width: 100% !important; max-height: 100% !important; background-color: black; }",a+="#"+d.id+":-"+b+"-fullscreen::-"+b+"-backdrop { background-color: black; }"):a+="#"+d.id+":-"+b+"-full-screen { height: 100% !important; width: 100% !important; max-height: 100% !important; background-color: black; }");
224j=document.createElement("style");j.type="text/css";j.styleSheet?j.styleSheet.cssText=a:j.appendChild(document.createTextNode(a));document.getElementsByTagName("head")[0].appendChild(j);var o=this;document.addEventListener?document.addEventListener(f,function(){i=o.o()!=m?l:n;if(o.b().change&&o.b().resize){o.b().change(i);o.b().resize()}}):f&&document.attachEvent(f,function(){i=o.o()!=m?l:n;if(o.b().change&&o.b().resize){o.b().change(i);o.b().resize()}});return h};this.request=this.Ma=function(){debug&&
225console.log("ktools.Fullscreen.request");if(h){if(!this.A()||!this.o())if(""===b)d.Na?d.Na():d.Ya();else if(d[b+"RequestFullscreen"])if("webkit"==b)d[b+"RequestFullscreen"](Element.M);else d[b+"RequestFullscreen"]();else if("webkit"==b)d[b+"RequestFullScreen"](Element.M);else d[b+"RequestFullScreen"]()}else this.b().enter&&this.b().enter()};this.exit=this.X=function(){debug&&console.log("ktools.Fullscreen.exit");if(h){if(this.A()||this.o()){var a=document;if(""===b)a.Z?a.Z():a.Y?a.Y():a.V?a.V():a.Va();
226else if(a[b+"ExitFullscreen"])a[b+"ExitFullscreen"]();else if(a[b+"ExitFullScreen"])a[b+"ExitFullScreen"]();else if(a[b+"CancelFullscreen"])a[b+"CancelFullscreen"]();else a[b+"CancelFullScreen"]()}}
226else this.b().exit&&this.b().exit()}};ktools.Fullscreen=ktools.P;ktools.l=function(){var a=[];this.add=this.add=function(c){a.push(c)};this.remove=this.remove=function(c){for(var d=0;d<a.length;d++)a[d]==c&&a.splice(d,1)};this.get=this.get=function(c){return a[c]};this.toArray=this.toArray=function(){return a};
227this.size=this.size=function(){return a.length}};ktools.Collection=ktools.l;ktools.j=function(){this.count=this.count=0;this.map=this.map={};this.add=this.add=function(a,c){if("undefined"!=typeof a){if(this.map[a]!=g)return this.count;this.map[a]=c;return++this.count}};this.update=this.update=function(a,c){if("undefined"!=typeof a)return this.map[a]=c,this.count};this.remove=this.remove=function(a){if(this.map[a]!=g)return delete this.map[a],--this.count};this.item=this.item=function(a){return this.map[a]};
228this.keys=this.keys=function(){var a=new ktools.l,c;for(c in this.map)a.add(c);return a.toArray()};this.values=this.Ta=function(){var a=new ktools.l,c;for(c in this.map)a.add(this.map[c]);return a.toArray()}};ktools.Map=ktools.j;ktools.c=function(){if(ktools.c.caller!=ktools.c.d)throw Error("This object cannot be instanciated, use getInstance.");var a=new ktools.j,c=new ktools.j;this.loadScript=this.g=function(d,c,b){if("undefined"==typeof a.item(d)){a.add(d,c);var f=document.createElement("script");
229f.type="text/javascript";f.readyState?f.onreadystatechange=function(){if("loaded"==f.readyState||"complete"==f.readyState)f.onreadystatechange=m,b&&b()}:f.onload=function(){b&&b()};f.src=c;document.getElementsByTagName("head")[0].appendChild(f);debug&&console.log("DynamicLoader : loadScript "+d)}else debug&&console.log("DynamicLoader : "+d+" already loading/loaded"),b&&b()};this.loadCss=this.p=function(a,h){debug&&console.log("preparing css "+a);if("undefined"==typeof c.item(a)){c.add(a,h);var b=
230document.createElement("link");b.type="text/css";b.rel="stylesheet";b.href=h;b.media="screen";b.title="dynamicLoadedSheet";document.getElementsByTagName("head")[0].appendChild(b);debug&&console.log("css "+a+" added")}else debug&&console.log("css "+a+" already added")}};ktools.DynamicLoader=ktools.c;ktools.c.a=m;ktools.DynamicLoader.instance=ktools.c.a;ktools.c.d=function(){this.a==m&&(this.a=new ktools.c);return this.a};ktools.DynamicLoader.getInstance=ktools.c.d;ktools.R=function(a,c,d,h){var b=
231this,f=h,j=n,i=new ktools.j;this.getName=this.getName=function(){return a};this.getUrl=this.k=function(){return c};this.getDependances=this.da=function(){return d};this.isLoaded=this.B=function(){return j};this.setLoaded=this.L=function(a){j=a};this.isPrimaryNode=this.J=function(){"undefined"==typeof f&&(f=n);return f};this.getParentsToCall=this.F=function(){return i};this.addParentToCall=this.C=function(a){"undefined"!=typeof a&&a!=m&&i.add(a.getName(),a)};this.loadScript=this.g=function(a){b.C(a);
232if(b.B())return b.r();if(0==d.length)ktools.c.d().g(b.getName(),b.k(),b.r);else for(a=0;a<d.length;a++)d[a].g(b)};this.callback=this.r=function(){debug&&console.log("script info : "+b.getName()+" loaded !");b.L(l);for(var a=b.F(),c=m,d=a.keys(),f=0;f<a.count;f++)c=a.item(d[f]),ktools.c.d().g(c.getName(),c.k(),c.r)}};ktools.Script=ktools.R;ktools.O=function(a,c){var d=this;this.getName=this.getName=function(){return a};this.getUrl=this.k=function(){return c};this.loadCss=this.p=function(){ktools.c.d().p(d.getName(),
233d.k())}};ktools.CssStyle=ktools.O;ktools.Q=function(a){var c=new ktools.l,d=new ktools.l,h=m,b=n,f=m;this.getPluginName=this.la=function(){return a};this.addScript=this.U=function(a){c.add(a)};this.getScripts=this.na=function(){return c};this.addCss=this.S=function(a){d.add(a)};this.getCss=this.ca=function(){return d};this.setEditorScript=this.Oa=function(a){h=a};this.getEditorScript=this.ea=function(){return h};this.register=this.Ka=function(a){f=a;return this};this.getRegistered=this.ma=function(){return f};
234this.isInitialized=this.xa=function(){for(var a=0;a<c.size();a++)b|=c.get(a).B();return b};this.initialize=this.H=function(){for(var a=m,b=0;b<d.size();b++)a=d.get(b),a.p();a=m;for(b=0;b<c.size();b++)a=c.get(b),a.J()&&a.g()}};ktools.KolorPlugin=ktools.Q;ktools.i=function(){this.pluginList=this.t=new ktools.j;this.addPlugin=this.T=function(a,c,d){this.t.add(a,c);("undefined"==typeof d||d)&&c.H()};this.removePlugin=this.La=function(a){this.t.remove(a)};this.getPlugin=this.ka=function(a){return this.t.item(a)}};
235ktools.KolorPluginList=ktools.i;ktools.i.a=m;ktools.KolorPluginList.instance=ktools.i.a;ktools.i.d=function(){this.a==m&&(this.a=new ktools.i);return this.a};ktools.KolorPluginList.getInstance=ktools.i.d})();})();;
236//krpano instance
237var krpano = null;
238//trace
239var debug = false;
240//is krpano loaded
241var krpanoLoaded = false;
242//is tour started
243var isTourStarted = false;
244//fullscreen object
245var kolorFullscreen = null;
246//browser detection
247var kolorBrowserDetect = null;
248//start z-index value
249var kolorStartIndex = 4000;
250//target url for cross domains application
251//var crossDomainTargetUrl = "";
252
253if ( debug ) {
254	if ( typeof(console) == 'undefined' ) {
255		console = {log : function (text) {} };
256	}
257}
258
259/* ======== FULLSCREEN STUFF ========================================== */
260
261/**
262 * @description Register Fullscreen on DOM ready.
263 */
264jQuery(document).ready(function() {
265	//add browser detection
266	kolorBrowserDetect = new ktools.BrowserDetect();
267	kolorBrowserDetect.init();
268	//kolorBrowserDetect.browser : Browser string
269	//kolorBrowserDetect.version : Browser version
270	//kolorBrowserDetect.OS : Platform OS
271	
272	//add fullscreen
273	kolorFullscreen = new ktools.Fullscreen(document.getElementById("tourDIV_visite_virtual"));
274	kolorFullscreen.supportsFullscreen();
275	//activate krpano fallback and update methods
276	kolorFullscreen.setExternal({
277		'enter': krPanoFullscreenEnter,
278		'exit': krPanoFullscreenExit,
279		'change': krpanoFullscreenChange,
280		'resize': krPanoFullscreenResize
281	});
282});
283
284/**
285 * @function
286 * @description Enter fullscreen fallback method for krpano.
287 * @return {void}
288 */
289function krPanoFullscreenEnter() {
290	getKrPanoInstance().call("enterFullScreenFallback");
291}
292
293/**
294 * @function
295 * @description Exit fullscreen fallback method for krpano.
296 * @return {void}
297 */
298function krPanoFullscreenExit() {
299	getKrPanoInstance().call("exitFullScreenFallback");
300}
301
302/**
303 * @function
304 * @description Launch method for krpano on fullscreen change event.
305 * @param {Boolean} state If true enter fullscreen event, else exit fullscreen event.
306 * @return {void}
307 */
308function krpanoFullscreenChange(state) {
309	if(state){
310		getKrPanoInstance().call("enterFullScreenChangeEvent");
311	}else{
312		getKrPanoInstance().call("exitFullScreenChangeEvent");
313	}
314}
315
316/**
317 * @function
318 * @description Launch resize method for krpano correct resize.
319 * @return {void}
320 */
321function krPanoFullscreenResize() {
322	getKrPanoInstance().call("resizeFullScreenEvent");
323}
324
325/**
326 * @function
327 * @description Set fullscreen mode.
328 * @param {String|Boolean} value The fullscreen status: 'true' for open or 'false' for close.
329 * @return {void}
330 */
331function setFullscreen(value) {
332	var state;
333	if(typeof value == "string")
334		state = (value.toLowerCase() == "true");
335	else
336		state = Boolean(value);
337
338	if (kolorFullscreen) {
339		if(state){
340			kolorFullscreen.request();
341		}else{
342			kolorFullscreen.exit();
343		}
344	}
345}
346
347/* ========== DIALOG BETWEEN KRPANO/JS STUFF ================================= */
348
349/**
350 * @function
351 * @description Get krpano instance.
352 * @return {Object} krpano instance.
353 */
354function getKrPanoInstance() {
355	if ( krpano == null ) {
356		krpano = document.getElementById('krpanoSWFObject');
357	}
358	return krpano;
359}
360
361/**
362 * @function
363 * @description Call krpano function.
364 * @param {String} fnName The krpano action name.
365 * @param {*} Following parameters are passed to the krPano function
366 * @return {void}
367 */
368function invokeKrFunction(fnName) {
369	var args = [].slice.call(arguments, 1);
370	var callString = fnName+'(';
371	for(var i=0, ii=args.length; i<ii; i++)
372	{
373		callString += args[i];
374		if(i != ii-1) { callString += ', '; }
375	}
376	callString += ');';
377	getKrPanoInstance().call(callString);
378}
379
380/**
381 * @function
382 * @description Get krpano identifier value.
383 * @param {String} identifier The qualifier.
384 * @param {String} type The converting type. Can be: 'int', 'float', 'string', 'boolean', 'object'.
385 * @return {Object}
386 */
387function getKrValue(identifier, type) {
388	if ( typeof identifier == "undefined" ){
389		return identifier;
390	}
391	
392	if(getKrPanoInstance().get(identifier) == null) {
393		return null;
394	}
395
396	switch ( type ) {
397		case "int":
398			return parseInt(getKrPanoInstance().get(identifier));
399		case "float":
400			return parseFloat(getKrPanoInstance().get(identifier));
401		case "string":
402			return String(getKrPanoInstance().get(identifier));
403		case "bool":
404			return Boolean(getKrPanoInstance().get(identifier) === 'true' || parseInt(getKrPano
404Instance().get(identifier)) === 1 || getKrPanoInstance().get(identifier) === 'yes' || getKrPanoInstance().get(identifier) === 'on');
405		default:
406			return getKrPanoInstance().get(identifier);
407	}
408}
409
410/**
411 * @function
412 * @description Invoke a function of a plugin engine.
413 * @param {String} pluginName The name/id of the plugin.
414 * @param {String} functionName The name of the function to invoke.
415 * @param {Object[]} arguments Additional arguments will be passed to the invoked function as an array.
416 * @return {Object}
417 */
418function invokePluginFunction(pluginName, functionName) {
419	if ( debug ) {
420		console.log("invokePluginFunction("+pluginName+", "+functionName+")");
421	}
422	
423	var plugin = ktools.KolorPluginList.getInstance().getPlugin(pluginName);
424	if (plugin == null) {
425		if ( debug ) { console.log("invokePluginFunction: plugin instance doesn't exist"); }
426		return false;
427	}
428	var engine = plugin.getRegistered();
429	if (engine == null) {
430		if ( debug ) { console.log("invokePluginFunction: plugin isn't registered"); }
431		return false;
432	}
433	var restArgs = [].slice.call(arguments, 2);
434	return engine[functionName](restArgs);
435}
436
437/**
438 * @function
439 * @description This function is called when krpano is ready.
440 * The ready state of krpano is told by its event onready (in fact it's not fully ready, included XML are not necessarily loaded) 
441 * @return {void}
442 */
443function eventKrpanoLoaded () {
444	if ( debug ) {
445		console.log('krpano is loaded');
446	}
447	
448	if (krpanoLoaded) { return false; }
449	
450	ktools.I18N.getInstance().initLanguage('en', crossDomainTargetUrl+name_visite_virtual+'_messages_en.xml');
451	krpanoLoaded = true;
452	addKolorArea('panotourmapsArea');
453}
454
455/**
456 * @function
457 * @description This function is called when tour is started.
458 * @return {void}
459 */
460function eventTourStarted () {
461	if ( debug ) {
462		console.log('tour is started');
463	}
464	
465	isTourStarted = true;
466}
467
468
469/* ========= KOLOR PLUGINS SCRIPTS ============================== */
470
471
472
473
474
475/** ---------------------- Start Plugin Map ----------------------- **/
476
477//KolorMap api providers
478var KolorMapApiProviders  = new Object();
479KolorMapApiProviders.Type = { googlev3: "googlev3", openlayers: "openlayers", microsoft7: "microsoft7" };
480KolorMapApiProviders.Url  = { googlev3: "https://maps.googleapis.com/maps/api/js?sensor=false&v=3.14&callback=handleApiReady", 
481		openlayers: "http://openlayers.org/api/2.12/OpenLayers.js",
482		microsoft7: "http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&s=1&onscriptload=handleApiReady"
483	};
484KolorMapApiProviders.Key = { googlev3: "&key=", openlayers: "", microsoft7: "" };
485KolorMapApiProviders.Script = { googlev3: "mxn.googlev3.core.js", openlayers: "mxn.openlayers.core.js", microsoft7: "mxn.microsoft7.core.js" };
486
487//store map loaded state
488var mapLoaded = new ktools.Map();
489var mapLoadedCounter = new ktools.Map();
490var mapPluginApiReadyCheck = new Array();
491//store the default marker ID to activate it once registered
492var mapMarkerDefault = new ktools.Map();
493//validate if the map has been instantiated
494var mapInstance = new ktools.Map();
495var mapInitCounter = new ktools.Map();
496
497//Add timestamp to mapstraction library to force IE to reload scripts
498var refreshIE = "";
499if (navigator.appName == "Microsoft Internet Explorer") {
500	var timestamp = new Date().getTime();
501	refreshIE = "?v="+timestamp;
502}
503
504//API provider keys
505var microsoft_key = "";
506
507/**
508 * @desc Check if a map API is loaded.
509 * @function
510 * @return {void}
511 */
512function handleApiReady() {
513	//get first plugName
514	var pluginName = mapPluginApiReadyCheck[0];
515	
516	if( debug ){
517		console.log('Proprietary map API is loaded for '+pluginName);
518	}
519	
520	if( pluginName != null ){
521		var counter = mapLoadedCounter.item(pluginName) - 1;
522		mapLoadedCounter.update(pluginName, counter);
523		
524		if(counter <= 0){
525			mapLoaded.update(pluginName, true);
526		}
527		
528		//remove first plugName
529		mapPluginApiReadyCheck.shift();
530	}
531}
532
533/** START PLUGIN MAP (for pluginName) */
534
535/**
536 * @desc Add KolorMap plugin instance when krpano is loaded.
537 * @function
538 * @param {String} pluginName The name of the plugin instance.
539 * @param {Object[]}
539 mapsApiArray Array of maps API names and keys couple.
540 * @param {String} mapAreaDiv The map area DOM div name, if exists.
541 * @return {void}
542 */
543function addKolorMap(pluginName, mapsApiArray, mapAreaDiv){
544	
545	var mapsApiLength = mapsApiArray.length;
546	if(mapsApiLength > 0){
547		// add map for maps API
548		
549		var mapApiOrder = new Array();
550		var hasOpenlayersMap = false;
551		//loop for maps API and maps API keys construction
552		for(var i=0; i < mapsApiLength; i++){
553			
554			mapPluginApiReadyCheck.push(pluginName);
555			
556			switch(mapsApiArray[i][0]){
557				case "microsoft7" :
558					//update the microsoft key
559					microsoft_key = mapsApiArray[i][1];
560					mapApiOrder[i] = [KolorMapApiProviders.Type.microsoft7, KolorMapApiProviders.Url.microsoft7, KolorMapApiProviders.Key.microsoft7, KolorMapApiProviders.Script.microsoft7];
561					break;
562				case "googlev3" :
563					//add key
564					KolorMapApiProviders.Key.googlev3 += mapsApiArray[i][1];
565					mapApiOrder[i] = [KolorMapApiProviders.Type.googlev3, KolorMapApiProviders.Url.googlev3, KolorMapApiProviders.Key.googlev3, KolorMapApiProviders.Script.googlev3];
566					break;
567				case "openlayers" :
568					hasOpenlayersMap = true;
569					mapApiOrder[i] = [KolorMapApiProviders.Type.openlayers, KolorMapApiProviders.Url.openlayers, KolorMapApiProviders.Key.openlayers, KolorMapApiProviders.Script.openlayers];
570					break;
571			}
572		}
573		
574		//init values for this plugin
575		mapLoaded.add(pluginName, false);
576		mapMarkerDefault.add(pluginName, {done: false});
577		mapInstance.add(pluginName, false);
578		//number of maps API to load
579		mapLoadedCounter.add(pluginName, mapsApiLength);
580		mapInitCounter.add(pluginName, 300); //try to load map only during 30 seconds max.
581		
582		var mapPlugin = new ktools.KolorPlugin(pluginName);
583		
584		// Libraries Dynamic loading
585		var mapApiScript = new ktools.Script(mapApiOrder[0][0], mapApiOrder[0][1]+mapApiOrder[0][2], [], false);
586		
587		if (mapsApiLength > 1) {
588			//add second map layer
589			var mapApiScript2 = new ktools.Script(mapApiOrder[1][0], mapApiOrder[1][1]+mapApiOrder[1][2], [mapApiScript], false);
590			if (mapsApiLength > 2) {
591				//add third map layer
592				var mapApiScript3 = new ktools.Script(mapApiOrder[2][0], mapApiOrder[2][1]+mapApiOrder[2][2], [mapApiScript2], false);
593				var mapstractionScript = new ktools.Script("maps_mapstraction", crossDomainTargetUrl+"graphics/KolorMap/lib/mxn.js"+refreshIE, [mapApiScript3], false);
594				var mapstractionScriptCore = new ktools.Script("maps_mapstraction_core", crossDomainTargetUrl+"graphics/KolorMap/lib/mxn.core.js"+refreshIE, [mapstractionScript], false);
595				var mapstractionScriptCoreLayer3 = new ktools.Script("maps_mapstraction_core_layer3", crossDomainTargetUrl+"graphics/KolorMap/lib/"+mapApiOrder[2][3]+refreshIE, [mapstractionScriptCore], false);
596				var mapstractionScriptCoreLayer2 = new ktools.Script("maps_mapstraction_core_layer2", crossDomainTargetUrl+"graphics/KolorMap/lib/"+mapApiOrder[1][3]+refreshIE, [mapstractionScriptCoreLayer3], false);
597				var mapstractionScriptCoreLayer1 = new ktools.Script("maps_mapstraction_core_layer1", crossDomainTargetUrl+"graphics/KolorMap/lib/"+mapApiOrder[0][3]+refreshIE, [mapstractionScriptCoreLayer2], false);
598			} else {
599				var mapstractionScript = new ktools.Script("maps_mapstraction", crossDomainTargetUrl+"graphics/KolorMap/lib/mxn.js"+refreshIE, [mapApiScript2], false);
600				var mapstractionScriptCore = new ktools.Script("maps_mapstraction_core", crossDomainTargetUrl+"graphics/KolorMap/lib/mxn.core.js"+refreshIE, [mapstractionScript], false);
601				var mapstractionScriptCoreLayer2 = new ktools.Script("maps_mapstraction_core_layer2", crossDomainTargetUrl+"graphics/KolorMap/lib/"+mapApiOrder[1][3]+refreshIE, [mapstractionScriptCore], false);
602				var mapstractionScriptCoreLayer1 = new ktools.Script("maps_mapstraction_core_layer1", crossDomainTargetUrl+"graphics/KolorMap/lib/"+mapApiOrder[0][3]+refreshIE, [mapstractionScriptCoreLayer2], false);
603			}
604		} else {
605			var mapstractionScript = new ktools.Script("maps_mapstraction", crossDomainTargetUrl+"graphics/KolorMap/lib/mxn.js"+refreshIE, [mapApiScript], false);
606			var mapstractionScriptCore = new ktools.Script("maps_mapstraction_core", crossDomainTargetUrl+"graphics/KolorMap/lib/mxn.core.js"+refreshIE, [mapstractionScript], false);
607			var mapstractionScriptCoreLayer1 = new ktools.Script("maps_mapstraction_core_layer1", crossDomainTargetUrl+"graphics/KolorMap/lib/"+mapApiOrder[0][3]+refreshIE, [mapstractionScriptCore], false);
608		}
609		
610		var kolorMapScript = new ktools.Script("kolormap", crossDomainTargetUrl+"graphics/KolorMap/js/KolorMap.min.js", [mapstractionScriptCoreLayer1], true);
611		mapPlugin.addScript(kolorMapScript);
612		
613		ktools.KolorPluginList.getInstance().addPlugin(mapPlugin.getPluginName(), mapPlugin, true);
614		
615		if(hasOpenlayersMap){
616			//delay for 1000ms for OpenLayers only
617			setTimeout(function() { handleApiReady(); }, 1000);
618		}
619		
620		//display
621		initKolorMapOnReady(pluginName, mapApiScript.getName(), mapAreaDiv);
622	}
623}
624
625/**
626 * @desc Init the KolorMap script to generate the map.
627 * @function
628 * @param {String} pluginName The name of the plugin instance.
629 * @param {String} defaultMapLayer the default map layer name.
630 * @param {String} mapAreaDiv The map area DOM div name, if exists.
631 * @return {void}
632 */
633function initKolorMapOnReady(pluginName, defaultMapLayer, mapAreaDiv) {
634	var err = "";
635	var reload = false;
636	
637	if ( !krpanoLoaded ) { 
638		err = "throw: krpano is not loaded";
639		reload = true;
640	}
641	
642	if ( !isTourStarted ) { 
643		err = "throw: tour is not started";
644		reload = true;
645	}
646	
647	if ( !mapLoaded.item(pluginName) ) {
648		err = "throw: plugin Map is not loaded";
649		reload = true;
650	}
651	
652	//map generation
653	if  ( typeof KolorMap == "undefined" || !ktools.KolorPluginList.getInstance().getPlugin(pluginName).isInitialized() ) {
654		err = "throw: KolorMap library not ready";
655		reload = true;
656	}
657	
658	//verify map instance
659	if(mapInstance.item(pluginName) && ktools.KolorPluginList.getInstance().getPlugin(pluginName).getRegistered()){
660		err = "throw: KolorMap already loaded";
661		reload = true;
662	}else{
663		mapInstance.update(pluginName, true);
664	}
665	
666	// verify if vr XML plugin is loaded
667	if (getKrValue('ptplugin['+pluginName+'].engine', 'string') == null){
668		err = "throw: KolorMap can't reach XML yet";
669		reload = true;
670	}
671	
672	// reload init if KolorMap is not ready
673	if(reload){
674		if ( debug ) {
675			console.log(err);
676		}
677		
678		if(mapInitCounter.item(pluginName) > 0){
679			// start counter only when tour is started
680			if (isTourStarted) {
681				mapInitCounter.update(pluginName, (mapInitCounter.item(pluginName) - 1));
682			}
683			// if not loaded, retry in 100 ms
684			setTimeout(function() { initKolorMapOnReady(pluginName, defaultMapLayer, mapAreaDiv); }, 100);
685			return;
686		}else{
687			// TODO change text value
688			alert("Connection timeout while making map API call. Try to reload the page.");
689			return;
690		}
691	}
692	
693	// prepare multimap swap selector
694	var selectorArray = new Array();
695	
696	//set the default map
697	if (getKrValue('ptplugin['+pluginName+'].multimap', 'bool')) {
698		
699		//default map is the first element
700		var defaultMap = new Object();
701		defaultMap['element'] = getKrValue('ptplugin['+pluginName+'].multiplemaps.map[0].element', 'string'); //sample: 'mapdiv'
702		defaultMap['provider'] = getKrValue('ptplugin['+pluginName+'].multiplemaps.map[0].provider', 'string'); //sample: mapApiScript.getName()
703		defaultMap['name'] = ktools.I18N.getInstance().getMessage(getKrValue('ptplugin['+pluginName+'].multiplemaps.map[0].name', 'string'));
704		selectorArray[0] = defaultMap;
705		
706		kolorMap = new KolorMap(defaultMap.element, defaultMap.provider);
707	}else{
708		if (mapAreaDiv) {
709			kolorMap = new KolorMap(mapAreaDiv, defaultMapLayer);
710		} else {
711			kolorMap = new KolorMap('mapDIV', defaultMapLayer);
712		}
713	}
714	
715	if ( debug ) {
716		console.log("instance: " + kolorMap);
717	}
718	
719	//add map default DOM div elements
720	if (mapAreaDiv) {
721		kolorMap.setMapLayer(mapAreaDiv);
722	} else {
723		kolorMap.setMapLayer('mapDIV');
724		kolorMap.setMapContainer('mapcontainer');
725		kolorMap.setPanoContainer('panoDIV_visite_virtual');
726		kolorMap.setTourContainer('tourDIV_visite_virtual');
727	}
728	
729	//map div position
730	kolorMap.setMapPosition(getKrValue('ptplugin['+pluginName+'].position', 'string'));
731	
732	//set url for maps images
733	kolorMap.setGraphicsUrl(crossDomainTargetUrl+"graphics/"+pluginName.toLowerCase()+"/");
734	
735	//set color and resizable option
736	kolorMap.setMapResizable(getKrValue('ptplugin['+pluginName+'].resizable', 'bool'));
737	kolorMap.setBgColor(getKrValue('ptplugin['+pluginName+'].bgcolor', 'string'));
738	
739	// set if map must be displayed or hidden
740	var displayOnStart = getKrValue('ptplugin['+pluginName+'].openatstart', 'bool');
741	
742	//init map size into DOM (needed for openlayers API);
743	if (mapAreaDiv) {
744		kolorMap.initMapLayer();
745	} else {
746		kolorMap.setMapSize(getKrValue('ptplugin['+pluginName+'].size', 'int'));
747		if(displayOnStart){
748			kolorMap.initMapSize();
749			kolorMap.initMapLayer();
750		}
751	}
752	
753	//add swap selector
754	if (getKrValue('ptplugin['+pluginName+'].multimap', 'bool')) {
755		
756		//second map
757		var secondMap = new Object();
758		secondMap['element'] = getKrValue('ptplugin['+pluginName+'].multiplemaps.map[1].element', 'string');
759		secondMap['provider'] = getKrValue('ptplugin['+pluginName+'].multiplemaps.map[1].provider', 'string');
760		secondMap['name'] = ktools.I18N.getInstance().getMessage(getKrValue('ptplugin['+pluginName+'].multiplemaps.map[1].name', 'string'));
761		selectorArray[1] = secondMap;
762		//add in DOM
763		jQuery('#mapcontainer').append('<div id="'+secondMap['element']+'"></div>');
764		
765		//third map
766		if (getKrValue('ptplugin['+pluginName+'].multiplemaps.map[2]')) {
767			var thirdMap = new Object();
768			thirdMap['element'] = getKrValue('ptplugin['+pluginName+'].multiplemaps.map[2].element', 'string');
769			thirdMap['provider'] = getKrValue('ptplugin['+pluginName+'].multiplemaps.map[2].provider', 'string');
770			thirdMap['name'] = ktools.I18N.getInstance().getMessage(getKrValue('ptplugin['+pluginName+'].multiplemaps.map[2].name', 'string'));
771			selectorArray[2] = thirdMap;
772			//add in DOM
773			jQuery('#mapcontainer').append('<div id="'+thirdMap['element']+'"></div>');
774		}
775		
776		kolorMap.addSwapSelector(pluginName, selectorArray, ktools.I18N.getInstance().getMessage(getKrValue('ptplugin['+pluginName+'].multiplemaps.label', 'string')));
777	}
778	
779	// initialize map position
780	var startPointLat = getKrValue('ptplugin['+pluginName+'].lat', 'float');
781	var startPointLng = getKrValue('ptplugin['+pluginName+'].lng', 'float');
782	var startPointZoom = getKrValue('ptplugin['+pluginName+'].zoom','int');
783	var startPoint = new mxn.LatLonPoint(startPointLat, startPointLng);
784	kolorMap.setStartPoint(startPoint, startPointZoom);
785	kolorMap.getMxnMap().setCenterAndZoom(startPoint, startPointZoom);
786	
787	// set map type
788	switch(getKrValue('ptplugin['+pluginName+'].maptypelayer','string')){
789		case 'satellite':
790			kolorMap.getMxnMap().setMapType(mxn.Mapstraction.SATELLITE);
791			break;
792		case 'hybrid':
793			kolorMap.getMxnMap().setMapType(mxn.Mapstraction.HYBRID);
794			break;
795		case 'physical':
796			kolorMap.getMxnMap().setMapType(mxn.Mapstraction.PHYSICAL);
797			break;
798		default:
799			//'road'
800			kolorMap.getMxnMap().setMapType(mxn.Mapstraction.ROAD);
801	}
802	
803	// add controls
804	var useZoom = getKrValue('ptplugin['+pluginName+'].controls.zoom', 'bool');
805	var usePan = getKrValue('ptplugin['+pluginName+'].controls.pan', 'bool');
806	var useMapType = getKrValue('ptplugin['+pluginName+'].controls.maptype', 'bool');
807	var useOverview = getKrValue('ptplugin['+pluginName+'].controls.overview', 'bool');
808	var useScale = getKrValue('ptplugin['+pluginName+'].controls.scale', 'bool');
809	var useSpecific = new Object();
810	if(getKrValue('ptplugin['+pluginName+'].controls.specific')){
811		if(getKrValue('ptplugin['+pluginName+'].controls.specific.streetview', 'bool')){
812			useSpecific.streetview = getKrValue('ptplugin['+pluginName+'].controls.specific.streetview', 'bool');
813		}
814	}
815	kolorMap.addControls(useZoom,usePan,useScale,useMapType,useOverview,useSpecific);
816	
817	// add ui controls
818	var useDragging = false;
819	var useScroll = false;
820	var useDblClick = false;
821	if(getKrValue('ptplugin['+pluginName+'].controls.ui')){
822		useDragging = getKrValue('ptplugin['+pluginName+'].controls.ui.draggable', 'bool');
823		useScroll = getKrValue('ptplugin['+pluginName+'].controls.ui.scrollable', 'bool');
824		useDblClick = getKrValue('ptplugin['+pluginName+'].controls.ui.dblclick', 'bool');
825	}
826	kolorMap.getMxnMap().setOption('enableDragging', useDragging);
827	kolorMap.getMxnMap().setOption('enableScrollWheelZoom', useScroll);
828	kolorMap.getMxnMap().setOption('disableDoubleClickZoom', !useDblClick);
829	
830	// generate radar(s)
831	var useRadars = false;
832	var radarOptions = {};
833	if(getKrValue('ptplugin['+pluginName+'].radar.visible','string') == "true"){
834		useRadars = true;
835		radarOptions = {
836			radius: getKrValue('ptplugin['+pluginName+'].radar.radius','int'), 
837			linkToZoom: getKrValue('ptplugin['+pluginName+'].radar.linktozoom','bool'), 
838			quality: getKrValue('ptplugin['+pluginName+'].radar.quality','int'), 
839			color: getKrValue('ptplugin['+pluginName+'].radar.linecolor','string'), 
840			opacity: getKrValue('ptplugin['+pluginName+'].radar.lineopacity','float'), 
841			width: getKrValue('ptplugin['+pluginName+'].radar.linewidth','int'), 
842			fillColor: getKrValue('ptplugin['+pluginName+'].radar.fillcolor','string'), 
843			fillOpacity: getKrValue('ptplugin['+pluginName+'].radar.fillopacity','float'),
844			enginePreset: 0
845		};
846	}
847	
848	// add markers
849	var markersLength = parseInt(getKrPanoInstance().get('ptplugin['+pluginName+'].marker.count'));
850	if(markersLength > 0){
851		for( var i=0; i < markersLength; i++ ){
852			var markerId = getKrValue('ptplugin['+pluginName+'].marker[' + i + '].name', 'string');
853			var markerPointLat = getKrValue('ptplugin['+pluginName+'].marker[' + i + '].lat', 'float');
854			var markerPointLng = getKrValue('ptplugin['+pluginName+'].marker[' + i + '].lng', 'float');
855			var markerLatLon = new mxn.LatLonPoint(markerPointLat, markerPointLng);
856			
857			// actions
858			var isDraggable = getKrValue('ptplugin['+pluginName+'].marker[' + i + '].draggable', 'bool');
859			var infoOnHover = getKrValue('ptplugin['+pluginName+'].marker[' + i + '].onhover', 'bool');
860			
861			// icon
862			var iconUrl = "";
863			var iconSize = null;
864			var iconAnchor = null;
865			var markerIcon = getKrValue('ptplugin['+pluginName+'].marker[' + i + '].markericon[0]','object');
866			if ( markerIcon != null ) {
867				iconUrl = markerIcon.url;
868				iconSize = new Array();
869				iconSize[0] = parseInt(markerIcon.iconwidth);
870				iconSize[1] = parseInt(markerIcon.iconheight);
871				iconAnchor = new Array();
872				switch ( markerIcon.iconanchor.toLowerCase() ) {
873					case "topleft":
874						iconAnchor[0] = 0;
875						iconAnchor[1] = 0;
876						break;
877					case "top"://topcenter
878						iconAnchor[0] = parseInt(iconSize[0]/2);
879						iconAnchor[1] = 0;
880						break;
881					case "topright":
882						iconAnchor[0] = iconSize[0];
883						iconAnchor[1] = 0;
884						break;
885					case "left"://middleleft
886						iconAnchor[0] = 0;
887						iconAnchor[1] = parseInt(iconSize[1]/2);
888						break;
889					case "center"://middlecenter
890						iconAnchor[0] = parseInt(iconSize[1]/2);
891						iconAnchor[1] = parseInt(iconSize[1]/2);
892						break;
893					case "right"://middleright
894						iconAnchor[0] = iconSize[0];
895						iconAnchor[1] = parseInt(iconSize[1]/2);
896						break;
897					case "bottomleft":
898						iconAnchor[0] = 0;
899						iconAnchor[1] = iconSize[1];
900						break;
901					case "bottomright":
902						iconAnchor[0] = iconSize[0];
903						iconAnchor[1] = iconSize[1];
904						break;
905					default:
906						//"bottom" : bottomcenter
907						iconAnchor[0] = parseInt(iconSize[0]/2);
908						iconAnchor[1] = iconSize[1];
909				}
910			}
911			
912			// add radar only for scene marker
913			if(useRadars && getKrValue('ptplugin['+pluginName+'].marker[' + i + '].isscene', 'bool')){
914				
915				// change radar heading
916				var markerPointHeading = getKrValue('ptplugin['+pluginName+'].marker[' + i + '].heading', 'float');
917				radarOptions.heading = markerPointHeading;
918				
919				var aMarkerRadar = kolorMap.addRadar(markerId, markerLatLon, radarOptions);
920			}
921			
922			//add marker (always after radar for openlayers layers z-index)
923			var aMarker = kolorMap.addMarker(markerId, pluginName, markerLatLon, iconUrl, iconSize, iconAnchor, jQuery.trim(ktools.I18N.getInstance().getMessage(getKrValue('ptplugin['+pluginName+'].marker[' + i + '].desc', 'string'))), getKrValue('ptplugin['+pluginName+'].marker[' + i + '].desctype', 'string'), infoOnHover, isDraggable);
924			
925			// set the marker's event
926			kolorMap.getMxnMap().addEventListener('click', mapMarkerEvent, aMarker);
927		}
928	}
929	
930	//register plugin
931	ktools.KolorPluginList.getInstance().getPlugin(pluginName).register(kolorMap);
932	
933	var kolorMapRegistred = ktools.KolorPluginList.getInstance().getPlugin(pluginName).getRegistered();
934	
935	//if the marker ID to activate have been initialized while the map wasn't registered, activate it now
936	if ( kolorMapRegistred ) {
937		
938		if (mapMarkerDefault.item(pluginName).done == false) {
939			var applySelection = true;
940			if (getKrValue('ptplugin['+pluginName+'].markerSelected.name','string') != "") {
941				setMapDefaultMarker(pluginName, getKrValue('ptplugin['+pluginName+'].markerSelected.name','string'), getKrValue('ptplugin['+pluginName+'].markerSelected.heading','float'), getKrValue('ptplugin['+pluginName+'].markerSelected.fov','float'));
942			} else if (mapMarkerDefault.item(pluginName).id != undefined) {
943				mapMarkerDefaultArray = [mapMarkerDefault.item(pluginName).id, mapMarkerDefault.item(pluginName).heading, mapMarkerDefault.item(pluginName).fov];
944			} else {
945				applySelection = false;
946			}
947			
948			if (applySelection) {
949				if ( debug ) {
950					console.log("activate the stored marker after init");
951				}
952				var mapMarkerDefaultArray = [mapMarkerDefault.item(pluginName).id, mapMarkerDefault.item(pluginName).heading, mapMarkerDefault.item(pluginName).fov];
953				kolorMapRegistred.changeCurrentMarker(mapMarkerDefaultArray);
954			}
955			mapMarkerDefault.update(pluginName, {done: true});
956		}
957	}else{
958		if ( debug ) {
959			console.log("KolorMap isn't really loaded");
960		}
961		mapInstance.update(pluginName, false);
962		//if not loaded, retry in 100 ms
963		setTimeout(function() { initKolorMapOnReady(pluginName, defaultMapLayer, mapAreaDiv); }, 100);
964		return;
965	}
966	
967	if (mapAreaDiv) {
968		//force refresh for openlayers
969		kolorMapRegistred.forceResizeMapLayer([mapAreaDiv]);
970	} else {
971		//hide map if needed
972		if(displayOnStart){
973			kolorMapRegistred.initResizableMap();
974		}else{
975			if ( kolorMapRegistred ) {
976				kolorMapRegistred.openCloseMap(["close"]);
977			}
978		}
979	}
980	
981	//call ready statement for krpano script
982	invokeKrFunction("kolorMapJsReady-"+pluginName);
983}
984
985/**
986 * @desc Store the map default marker with datas.
987 * @function
988 * @param {String} pluginName The plugin name.
989 * @param {String} markerId The marker ID.
990 * @param {String} krHeading The heading value from krpano.
991 * @param {String} krFov The fov value from krpano.
992 */
993function setMapDefaultMarker(pluginName, markerId, krHeading, krFov){
994	var mapMarkerDefaultObject = { id: markerId, heading: krHeading, fov: krFov, done: false };
995	mapMarkerDefault.update(pluginName, mapMarkerDefaultObject);
996}
997
998/**
999 * @desc Event on a map marker.
1000 * @function
1001 * @param {String} eventType The type of the event: 'click'.
1002 * @param {mxn.Marker} objectSource The marker object.
1003 * @param {Object} objdata Structured object additional informations.
1004 * @return {void}
1005 */
1006function mapMarkerEvent(eventType, objectSource, objdata) {
1007	if (debug) {
1008		console.log('Map marker event "' + eventType + '" for marker "' + objectSource.getAttribute("id") + '" on plugin "' + objectSource.getAttribute("plugName") + '"');
1009	}
1010	
1011	// if current marker is different select and activate the new marker
1012	if ( kolorMap.getActiveMarker() != objectSource ) {
1013		var jsMapMarkerAction = objectSource.getAttribute("plugName")+"GoMarker('" + objectSource.getAttribute("id") + "')";
1014		getKrPanoInstance().call(jsMapMarkerAction);
1015	}
1016	
1017	// call the marker 'jsclick' action
1018	var krMapMarkerAction = getKrValue('ptplugin['+objectSource.getAttribute("plugName")+'].marker[' + objectSource.getAttribute("id") + '].jsclick');
1019	getKrPanoInstance().call(krMapMarkerAction);
1020}
1021
1022/**
1023 * @desc Change api provider on the fly for the map.
1024 * @function
1025 * @param {String} pluginName The plugin name.
1026 * @param {String} element The DOM element containing the map layer.
1027 * @param {String} api The provider API selected for the map layer element.
1028 * @return {void}
1029 */
1030function swapProvider(pluginName, element, api){
1031	if ( ktools.KolorPluginList.getInstance().getPlugin(pluginName).getRegistered() != null ) {
1032		var kolorMapRegistred = ktools.KolorPluginList.getInstance().getPlugin(pluginName).getRegistered();
1033		kolorMapRegistred.swapProvider([element, api]);
1034	}
1035}
1036
1037/** ---------------------- End Plugin Map ----------------------- **/
1038/**
1039 * @function
1040 * @description Add an instance of kolorArea JS Engine, loads JS and CSS files then init and populate related plugin that's based on it.
1041 * @param {String} pPlugID The name of the plugin you want to give to the kolorArea instance. 
1042 * @return {void} 
1043 */
1044function addKolorArea(pPlugID)
1045{
1046	if(typeof ktools.KolorPluginList.getInstance().getPlugin(pPlugID) == "undefined")
1047	{
1048		var kolorAreaCSS = new ktools.CssStyle("KolorAreaCSS", crossDomainTargetUrl+"graphics/KolorArea/kolorArea.css");
1049		var kolorAreaJS = new ktools.Script("KolorAreaJS", crossDomainTargetUrl+"graphics/KolorArea/KolorArea.min.js", [], true);
1050		var kolorAreaPlugin = new ktools.KolorPlugin(pPlugID);
1051		kolorAreaPlugin.addScript(kolorAreaJS);
1052		kolorAreaPlugin.addCss(kolorAreaCSS);
1053		ktools.KolorPluginList.getInstance().addPlugin(kolorAreaPlugin.getPluginName(), 
1053kolorAreaPlugin, true);
1054	}
1055}
1056
1057/**
1058 * @function
1059 * @description Init, populate and show the kolorArea. 
1060 * @param {String} pPlugID The name of the plugin you want to init and show.
1061 * @param {String} pContent The content you want to inject into the kolorArea. I could be HTML string or any other string.
1062 * @return {void} 
1063 */
1064function showKolorArea(pPlugID, pContent)
1065{
1066	if(debug) { console.log("showKolorArea " + pPlugID); }
1067
1068	//Check if the KolorArea is loaded
1069	if(!ktools.KolorPluginList.getInstance().getPlugin(pPlugID).isInitialized() || typeof KolorArea == "undefined")
1070	{
1071		err = "KolorArea JS is not loaded !";
1072		if(debug){ console.log(err); }
1073		//If not loaded, retry in 100 ms
1074		setTimeout(function() { showKolorArea(pPlugID, pContent); }, 100);
1075		return;
1076	}
1077	
1078	//Check if the KolorArea is instantiate and registered with the ktools.Plugin Object
1079	//If not, instantiate the KolorArea and register it.
1080	if(ktools.KolorPluginList.getInstance().getPlugin(pPlugID).getRegistered() == null)
1081	{
1082		ktools.KolorPluginList.getInstance().getPlugin(pPlugID).register(new KolorArea(pPlugID, "panoDIV_visite_virtual"));
1083	}
1084	
1085	//Get the registered instance of KolorArea
1086	var kolorArea = ktools.KolorPluginList.getInstance().getPlugin(pPlugID).getRegistered();
1087
1088	//If kolorArea is not ready, populate datas
1089	if(!kolorArea.isReady())
1090	{
1091		var kolorAreaOptions = [];
1092		var optionName = '';
1093		var optionValue = '';
1094		
1095		//Build the Options data for the KolorArea
1096		var optionLength = parseInt(getKrPanoInstance().get("ptplugin["+pPlugID+"].settings[0].option.count"));
1097		
1098		for(var j = 0; j < optionLength; j++)
1099		{
1100			optionName = getKrValue("ptplugin["+pPlugID+"].settings[0].option["+j+"].name","string");
1101			if (optionName == 'zorder') {
1102				optionValue = kolorStartIndex + getKrValue("ptplugin["+pPlugID+"].settings[0].option["+j+"].value", getKrValue("ptplugin["+pPlugID+"].settings[0].option["+j+"].type", "string"));
1103			} else {
1104				optionValue = getKrValue("ptplugin["+pPlugID+"].settings[0].option["+j+"].value", getKrValue("ptplugin["+pPlugID+"].settings[0].option["+j+"].type", "string"));
1105			}
1106			kolorAreaOptions[optionName] = optionValue;
1107		}
1108
1109		kolorArea.setKolorAreaOptions(kolorAreaOptions);
1110
1111		//KolorArea is now ready !
1112		kolorArea.setReady(true);
1113		//call ready statement for krpano script
1114		invokeKrFunction("kolorAreaJsReady-"+pPlugID);
1115	}
1116
1117	kolorArea.setKolorAreaContent(pContent);
1118	kolorArea.openKolorArea();
1119};
1120(function ($) {
1121  Drupal.behaviors.simple_subscription = {
1122      attach: function(context, settings) {
1123        
1124        /*
1125         * If the field is empty, this adds a class to the form and the predefined text to the e-mail
1126         * input field
1127         */
1128        $('#simple-subscription-form .edit-mail', context).blur(function() {
1129          var val = $(this).val();
1130          if (!val) {
1131            $('#simple-subscription-form').addClass('simple-subscription-empty');
1132            $(this).val(Drupal.settings.simple_subscription.input_content);
1133          } 
1134          else if (val == Drupal.settings.simple_subscription.input_content) {
1135            $('#simple-subscription-form').addClass('simple-subscription-empty');
1136          };    
1137        }).focus(function() {
1138          if ($('#simple-subscription-form').hasClass('simple-subscription-empty')) {
1139            $(this).val("");
1140            $('#simple-subscription-form').removeClass('simple-subscription-empty');
1141          }
1142        }).blur();
1143
1144        
1145        /*
1146         * Removes the default text in the input field, when the user submits the form without
1147         * filling it first.
1148         */
1149        $('#simple-subscription-form', context).submit(function() {
1150          if ($(this).hasClass('simple-subscription-empty')) {
1151            $('#simple-subscription-form').removeClass('simple-subscription-empty');
1152            $('#simple-subscription-form .edit-mail').val("");
1153          }
1154        });    
1155        
1156      }
1157    };  
1158}(jQuery));
1159
1160;

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.