﻿var dnnJscriptVersion="6.0.0";if(typeof(Sys.Browser.Chrome)=="undefined"){Sys.Browser.Chrome={};if(navigator.userAgent.indexOf(" Chrome/")>-1){Sys.Browser.agent=Sys.Browser.Chrome;Sys.Browser.version=parseFloat(navigator.userAgent.match(/Chrome\/(\d+\.\d+)/)[1]);Sys.Browser.name="Chrome";Sys.Browser.hasDebuggerStatement=true}}else{if(Sys.Browser.agent===Sys.Browser.InternetExplorer&&Sys.Browser.version>10){HTMLAnchorElement.prototype.attachEvent=function(a,b){if(a.substr(0,2)=="on"){a=a.substr(2)}this.addEventListener(a,b,false)};HTMLAnchorElement.prototype.detachEvent=function(a,b){if(a.substr(0,2)=="on"){a=a.substr(2)}this.removeEventListener(a,b,false)}}}if($&&$.ui&&$.ui.dialog){$.extend($.ui.dialog.prototype.options,{open:function(){var e=$(document).find("html");e.css("overflow","hidden");var f=e.find("body").scrollTop();if(f>0){e.scrollTop(0);var d=$(this);d.data("cacheScrollTop",f)}var a=$(this).closest(".ui-dialog");if(!$("html").hasClass("mobileView")){var c=$(window).height();var b=a.outerHeight();if(c-20>=b){a.css({position:"fixed",left:"50%",top:"50%",marginLeft:"-"+(a.outerWidth()/2)+"px",marginTop:"-"+(a.outerHeight()/2)+"px",maxHeight:"inherit",overflow:"initial"})}else{a.css({position:"fixed",left:"50%",top:"0",marginLeft:"-"+(a.outerWidth()/2)+"px",marginTop:"0",maxHeight:(c-20)+"px",overflow:"auto"})}}a.find(".ui-dialog-titlebar-close").attr("aria-label","Close")},beforeClose:function(){var b=$(document).find("html");b.css("overflow","");var c=$(this).data("cacheScrollTop");if(c){b.find("body").scrollTop(c);$(this).data("cacheScrollTop",null)}var a=$(this).closest(".ui-dialog");a.css({overflow:"initial"})}})}var DNN_HIGHLIGHT_COLOR="#9999FF";var COL_DELIMITER=String.fromCharCode(18);var ROW_DELIMITER=String.fromCharCode(17);var QUOTE_REPLACEMENT=String.fromCharCode(19);var KEY_LEFT_ARROW=37;var KEY_UP_ARROW=38;var KEY_RIGHT_ARROW=39;var KEY_DOWN_ARROW=40;var KEY_RETURN=13;var KEY_ESCAPE=27;Type.registerNamespace("dnn");dnn.extend=function(a,b){for(s in b){a[s]=b[s]}return a};dnn.extend(dnn,{apiversion:new Number("04.02"),pns:"",ns:"dnn",diagnostics:null,vars:null,dependencies:new Array(),isLoaded:false,delay:[],_delayedSet:null,getVars:function(){if(this.vars==null){var a=dnn.dom.getById("__dnnVariable");if(a!=null){if(a.value.indexOf("`")==0){a.value=a.value.substring(1).replace(/`/g,'"')}if(a.value.indexOf("__scdoff")!=-1){COL_DELIMITER="~|~";ROW_DELIMITER="~`~";QUOTE_REPLACEMENT="~!~"}}if(a!=null&&a.value.length>0){this.vars=Sys.Serialization.JavaScriptSerializer.deserialize(a.value)}else{this.vars=[]}}return this.vars},getVar:function(key,def){if(this.getVars()[key]!=null){var re=eval("/"+QUOTE_REPLACEMENT+"/g");return this.getVars()[key].replace(re,'"')}return def},setVar:function(b,c){if(this.vars==null){this.getVars()}this.vars[b]=c;var a=dnn.dom.getById("__dnnVariable");if(a==null){a=dnn.dom.createElement("INPUT");a.type="hidden";a.id="__dnnVariable";dnn.dom.appendChild(dnn.dom.getByTagName("body")[0],a)}if(dnn.isLoaded){a.value=Sys.Serialization.JavaScriptSerializer.serialize(this.vars)}else{dnn._delayedSet={key:b,val:c}}return true},callPostBack:function(action){var postBack=dnn.getVar("__dnn_postBack");var data="";if(postBack.length>0){data+=action;for(var i=1;i<arguments.length;i++){var aryParam=arguments[i].split("=");data+=COL_DELIMITER+aryParam[0]+COL_DELIMITER+aryParam[1]}eval(postBack.replace("[DATA]",data));return true}return false},createDelegate:function(a,b){return Function.createDelegate(a,b)},doDelay:function(b,c,d,a){if(this.delay[b]==null){this.delay[b]=new dnn.delayObject(d,a,b);this.delay[b].num=window.setTimeout(dnn.createDelegate(this.delay[b],this.delay[b].complete),c)}},cancelDelay:function(a){if(this.delay[a]!=null){window.clearTimeout(this.delay[a].num);this.delay[a]=null}},decodeHTML:function(a){return a.toString().replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"')},encode:function(a,c){var b=a;if(encodeURIComponent){b=encodeURIComponent(b)}else{b=escape(b)}if(c==false){return b}return b.replace(/%/g,"%25")},encodeHTML:function(a){return a.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;").replace(/\"/g,"&quot;")},encodeJSON:function(a){return a.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"\u0027").replace(/\"/g,"&quot;").replace(/\\/g,"\\\\")},evalJSON:function(a){return Sys.Serialization.JavaScriptSerializer.deserialize(a)},escapeForEval:function(a){return a.replace(/\\/g,"\\\\").replace(/\'/g,"\\'").replace(/\r/g,"").replace(/\n/g,"\\n").replace(/\./,"\\.")},getEnumByValue:function(a,b){for(var c in a){if(typeof(a[c])=="number"&&a[c]==b){return c}}},_onload:function(){dnn.isLoaded=true;if(dnn._delayedSet){dnn.setVar(dnn._delayedSet.key,dnn._delayedSet.val)}},addIframeMask:function(c){if(dnn.dom.browser.isType("ie")&&(c.previousSibling==null||c.previousSibling.nodeName.toLowerCase()!="iframe")){var a=document.createElement("iframe");c.parentNode.insertBefore(a,c);var b=c.getBoundingClientRect();a.style.position="absolute";a.style.left=c.offsetLeft+"px";a.style.top=c.offsetTop+"px";a.style.width=(b.right-b.left)+"px";a.style.height=(b.bottom-b.top)+"px";a.style.opacity="0";a.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=0)";a.style.zIndex="-1";return a}return null},removeIframeMask:function(a){if(dnn.dom.browser.isType("ie")&&(a.previousSibling!=null&&a.previousSibling.nodeName.toLowerCase()=="iframe")){a.parentNode.removeChild(a.previousSibling)}}});dnn.delayObject=function(c,a,b){this.num=null;this.pfunc=c;this.context=a;this.type=b};dnn.delayObject.prototype={complete:function(){dnn.delay[this.type]=null;this.pfunc(this.context)}};dnn.delayObject.registerClass("dnn.delayObject");dnn.ScriptRequest=function(e,d,c){this.ctl=null;this.xmlhttp=null;this.src=null;this.text=null;if(e!=null&&e.length>0){var b=dnn.dom.scriptFile(e);var a=dnn.getVar(b+".resx","");if(a.length>0){this.src=a}else{this.src=e}}if(d!=null&&d.length>0){this.text=d}this.callBack=c;this.status="init";this.timeOut=5000;this._xmlhttpStatusChangeDelegate=dnn.createDelegate(this,this.xmlhttpStatusChange);this._statusChangeDelegate=dnn.createDelegate(this,this.statusChange);this._completeDelegate=dnn.createDelegate(this,this.complete);this._reloadDelegate=dnn.createDelegate(this,this.reload)};dnn.ScriptRequest.prototype={load:function(){this.status="loading";this.ctl=document.createElement("script");this.ctl.type="text/javascript";if(this.src!=null){if(dnn.dom.browser.isType(dnn.dom.browser.Safari)){this.xmlhttp=new XMLHttpRequest();this.xmlhttp.open("GET",this.src,true);this.xmlhttp.onreadystatechange=this._xmlhttpStatusChangeDelegate;this.xmlhttp.send(null);return}else{if(dnn.dom.browser.isType(dnn.dom.browser.InternetExplorer)){this.ctl.onreadystatechange=this._statusChangeDelegate}else{if(dnn.dom.browser.isType(dnn.dom.browser.Opera)==false){this.ctl.onload=this._completeDelegate}}this.ctl.src=this.src}dnn.dom.scriptElements[this.src]=this.ctl}else{if(dnn.dom.browser.isType(dnn.dom.browser.Safari)){this.ctl.innerHTML=dnn.encodeHTML(this.text)}else{this.ctl.text=this.text}}var a=dnn.dom.getByTagName("HEAD");if(a){if(dnn.dom.browser.isType(dnn.dom.browser.Opera)==false||this.src!=null){a[0].appendChild(this.ctl)}}else{alert("Cannot load dynamic script, no HEAD tag present.")}if(this.src==null||dnn.dom.browser.isType(dnn.dom.browser.Opera)){this.complete()}else{if(this.timeOut){dnn.doDelay("loadScript_"+this.src,this.timeOut,this._reloadDelegate,null)}}},xmlhttpStatusChange:function(){if(this.xmlhttp.readyState!=4){return}this.src=null;this.text=this.xmlhttp.responseText;this.load()},statusChange:function(){if((this.ctl.readyState=="loaded"||this.ctl.readyState=="complete")&&this.status!="complete"){this.complete()}},reload:function(){if(dnn.dom.scriptStatus(this.src)=="complete"){this.complete()}else{this.load()}},complete:function(){dnn.cancelDelay("loadScript_"+this.src);this.status="complete";if(typeof(this.callBack)!="undefined"){this.callBack(this)}this.dispose()},dispose:function(){this.callBack=null;if(this.ctl){if(this.ctl.onreadystatechange){this.ctl.onreadystatechange=new function(){}}else{if(this.ctl.onload){this.ctl.onload=null}}this.ctl=null}this.xmlhttp=null;this._xmlhttpStatusChangeDelegate=null;this._statusChangeDelegate=null;this._completeDelegate=null;this._reloadDelegate=null}};dnn.ScriptRequest.registerClass("dnn.ScriptRequest");Type.registerNamespace("dnn.dom");dnn.extend(dnn.dom,{pns:"dnn",ns:"dom",browser:null,__leakEvts:[],scripts:[],scriptElements:[],tweens:[],attachEvent:function(a,c,d){if(a.addEventListener){var b=c.substring(2);a.addEventListener(b,function(e){dnn.dom.event=new dnn.dom.eventObject(e,e.target);return d()},false)}else{a.attachEvent(c,function(){dnn.dom.event=new dnn.dom.eventObject(window.event,window.event.srcElement);return d()})}return true},cursorPos:function(b){if(b.value.length==0){return 0}var h=-1;if(b.selectionStart){h=b.selectionStart}else{if(b.createTextRange){var f=window.document.selection.createRange();var a=b.createTextRange();if(a==null||f==null||((f.text!="")&&a.inRange(f)==false)){return -1}if(f.text==""){if(a.boundingLeft==f.boundingLeft){h=0}else{var d=b.tagName.toLowerCase();if(d=="input"){var g=a.text;var c=1;while(c<g.length){a.findText(g.substring(c));if(a.boundingLeft==f.boundingLeft){break}c++}}else{if(d=="textarea"){var c=b.value.length+1;var e=document.selection.createRange().duplicate();while(e.parentElement()==b&&e.move("character",1)==1){--c}if(c==b.value.length+1){c=-1}}}h=c}}else{h=a.text.indexOf(f.text)}}}return h},cancelCollapseElement:function(a){dnn.cancelDelay(a.id+"col");a.style.display="none"},collapseElement:function(b,c,d){if(c==null){c=10}b.style.overflow="hidden";var a=new Object();a.num=c;a.ctl=b;a.pfunc=d;b.origHeight=b.offsetHeight;dnn.dom.__collapseElement(a)},__collapseElement:function(a){var c=a.num;var b=a.ctl;var d=b.origHeight/c;if(b.offsetHeight-(d*2)>0){b.style.height=(b.offsetHeight-d).toString()+"px";dnn.doDelay(b.id+"col",10,dnn.dom.__collapseElement,a)}else{b.style.display="none";if(a.pfunc!=null){a.pfunc()}}},cancelExpandElement:function(a){dnn.cancelDelay(a.id+"exp");a.style.overflow="";a.style.height=""},disableTextSelect:function(a){if(typeof a.onselectstart!="undefined"){a.onselectstart=function(){return false}}else{if(typeof a.style.MozUserSelect!="undefined"){a.style.MozUserSelect="none"}else{a.onmousedown=function(){return false}}}},expandElement:function(b,c,d){if(c==null){c=10}if(b.style.display=="none"&&b.origHeight==null){b.style.display="";b.style.overflow="";b.origHeight=b.offsetHeight;b.style.overflow="hidden";b.style.height="1px"}b.style.display="";var a=new Object();a.num=c;a.ctl=b;a.pfunc=d;dnn.dom.__expandElement(a)},__expandElement:function(a){var c=a.num;var b=a.ctl;var d=b.origHeight/c;if(b.offsetHeight+d<b.origHeight){b.style.height=(b.offsetHeight+d).toString()+"px";dnn.doDelay(b.id+"exp",10,dnn.dom.__expandElement,a)}else{b.style.overflow="";b.style.height="";if(a.pfunc!=null){a.pfunc()}}},deleteCookie:function(a,c,b){if(this.getCookie(a)){this.setCookie(a,"",-1,c,b);return true}return false},getAttr:function(b,a,c){if(b.getAttribute==null){return c}var d=b.getAttribute(a);if(d==null||d==""){return c}else{return d}},getById:function(b,a){return $get(b,a)},getByTagName:function(a,b){if(b==null){b=document}if(b.getElementsByTagName){return b.getElementsByTagName(a)}else{if(b.all&&b.all.tags){return b.all.tags(a)}else{return null}}},getParentByTagName:function(b,a){var c=b.parentNode;a=a.toLowerCase();while(c!=null){if(c.tagName&&c.tagName.toLowerCase()==a){return c}c=c.parentNode}return null},getCookie:function(c){var e=" "+document.cookie;var d=" "+c+"=";var b=null;var f=0;var a=0;if(e.length>0){f=e.indexOf(d);if(f!=-1){f+=d.length;a=e.indexOf(";",f);if(a==-1){a=e.length}b=unescape(e.substring(f,a))}}return(b)},getNonTextNode:function(a){if(this.isNonTextNode(a)){return a}while(a!=null&&this.isNonTextNode(a)){a=this.getSibling(a,1)}return a},addSafeHandler:function(b,a,c,d){b[a]=this.getObjMethRef(c,d);if(dnn.dom.browser.isType(dnn.dom.browser.InternetExplorer)){if(this.__leakEvts.length==0){dnn.dom.attachEvent(window,"onunload",dnn.dom.destroyHandlers)}this.__leakEvts[this.__leakEvts.length]=new dnn.dom.leakEvt(a,b,b[a])}},destroyHandlers:function(){var c=dnn.dom.__leakEvts.length-1;for(var a=c;a>=0;a--){var b=dnn.dom.__leakEvts[a];b.ctl.detachEvent(b.name,b.ptr);b.ctl[b.name]=null;dnn.dom.__leakEvts.length=dnn.dom.__leakEvts.length-1}},getObjMethRef:function(b,a){return(function(c){c=c||window.event;return b[a](c,this)})},getSibling:function(a,c){if(a!=null&&a.parentNode!=null){for(var b=0;b<a.parentNode.childNodes.length;b++){if(a.parentNode.childNodes[b].id==a.id){if(a.parentNode.childNodes[b+c]!=null){return a.parentNode.childNodes[b+c]}}}}return null},isNonTextNode:function(a){return(a.nodeType!=3&&a.nodeType!=8)},getScript:function(c){if(this.scriptElements[c]){return this.scriptElements[c]}var a=dnn.dom.getByTagName("SCRIPT");for(var b=0;b<a.length;b++){if(a[b].src!=null&&a[b].src.indexOf(c)>-1){this.scriptElements[c]=a[b];return a[b]}}},getScriptSrc:function(b){var a=dnn.getVar(b+".resx","");if(a.length>0){return a}return b},getScriptPath:function(){var a=dnn.dom.getScript("dnn.js");if(a){var b=a.src;if(b.indexOf("?")>-1){b=b.substr(0,b.indexOf("?"))}return b.replace("dnn.js","")}var c=dnn.getVar("__sp");if(c){return c}return""},scriptFile:function(b){var a=b.split("/");return a[a.length-1]},loadScript:function(e,d,b){var c;if(e!=null&&e.length>0){c=this.scriptFile(e);if(this.scripts[c]!=null){return}}var a=new dnn.ScriptRequest(e,d,b);if(c){this.scripts[c]=a}a.load();return a},loadScripts:function(a,b,c){if(dnn.scripts==null){var e=function(f,g,h){return(function(){dnn.dom.loadScripts(f,g,h)})};dnn.dom.loadScript(dnn.dom.getScriptPath()+"dnn.scripts.js",null,e(a,b,c));return}var d=new dnn.scripts.ScriptBatchRequest(a,b,c);d.load()},scriptStatus:function(c){var b=this.scriptFile(c);if(this.scripts[b]){return this.scripts[b].status}var a=this.getScript(c);if(a!=null){return"complete"}else{return""}},setScriptLoaded:function(b){var a=this.scriptFile(b);if(this.scripts[a]&&dnn.dom.scripts[a].status!="complete"){dnn.dom.scripts[a].complete()}},navigate:function(b,a){if(a!=null&&a.length>0){if(a=="_blank"||a=="_new"){window.open(b)}else{document.frames[a].location.href=b}}else{if(Sys.Browser.agent===Sys.Browser.InternetExplorer){window.navigate(b)}else{window.location.href=b}}return false},setCookie:function(b,f,h,e,d,c,a){var g;if(h){g=new Date();g.setTime(g.getTime()+(h*24*60*60*1000))}if(a){g=new Date();g.setTime(g.getTime()+(a))}document.cookie=b+"="+escape(f)+((g)?"; expires="+g.toGMTString():"")+((e)?"; path="+e:"")+((d)?"; domain="+d:"")+((c)?"; secure":"");if(document.cookie.length>0){return true}},getCurrentStyle:function(b,c){var a=Sys.UI.DomElement._getCurrentStyle(b);if(a){return a[c]}return""},getFormPostString:function(a){var c="";if(a!=null){if(a.tagName&&a.tagName.toLowerCase()=="form"){for(var b=0;b<a.elements.length;b++){c+=this.getElementPostString(a.elements[b])}}else{c=this.getElementPostString(a);for(var b=0;b<a.childNodes.length;b++){c+=this.getFormPostString(a.childNodes[b])}}}return c},getElementPostString:function(a){var c;if(a.tagName){c=a.tagName.toLowerCase()}if(c=="input"){var d=a.type.toLowerCase();if(d=="text"||d=="password"||d=="hidden"||((d=="checkbox"||d=="radio")&&a.checked)){return a.name+"="+dnn.encode(a.value,false)+"&"}}else{if(c=="select"){for(var b=0;b<a.options.length;b++){if(a.options[b].selected){return a.name+"="+dnn.encode(a.options[b].value,false)+"&"}}}else{if(c=="textarea"){return a.name+"="+dnn.encode(a.value,false)+"&"}}}return""},appendChild:function(b,a){return b.appendChild(a)},removeChild:function(a){return a.parentNode.removeChild(a)},createElement:function(a){return document.createElement(a.toLowerCase())}});dnn.dom.leakEvt=function(c,a,b){this.name=c;this.ctl=a;this.ptr=b};dnn.dom.leakEvt.registerClass("dnn.dom.leakEvt");dnn.dom.eventObject=function(b,a){this.object=b;this.srcElement=a};dnn.dom.eventObject.registerClass("dnn.dom.eventObject");dnn.dom.browserObject=function(){this.InternetExplorer="ie";this.Netscape="ns";this.Mozilla="mo";this.Opera="op";this.Safari="safari";this.Konqueror="kq";this.MacIE="macie";var b;var d=navigator.userAgent.toLowerCase();if(d.indexOf("konqueror")!=-1){b=this.Konqueror}else{if(d.indexOf("msie")!=-1&&d.indexOf("mac")!=-1){b=this.MacIE}else{if(Sys.Browser.agent===Sys.Browser.InternetExplorer){b=this.InternetExplorer}else{if(Sys.Browser.agent===Sys.Browser.FireFox){b=this.Mozilla}else{if(Sys.Browser.agent===Sys.Browser.Safari){b=this.Safari}else{if(Sys.Browser.agent===Sys.Browser.Opera){b=this.Opera}else{b=this.Mozilla}}}}}}this.type=b;this.version=Sys.Browser.version;var c=navigator.userAgent.toLowerCase();if(this.type==this.InternetExplorer){var a=navigator.appVersion.split("MSIE");this.version=parseFloat(a[1])}if(this.type==this.Netscape){var a=c.split("netscape");this.version=parseFloat(a[1].split("/")[1])}};dnn.dom.browserObject.prototype={toString:function(){return this.type+" "+this.version},isType:function(){for(var a=0;a<arguments.length;a++){if(dnn.dom.browser.type==arguments[a]){return true}}return false}};dnn.dom.browserObject.registerClass("dnn.dom.browserObject");dnn.dom.browser=new dnn.dom.browserObject();if(typeof($)=="undefined"){eval("function $() {var ary = new Array(); for (var i=0; i<arguments.length; i++) {var arg = arguments[i]; var ctl; if (typeof arg == 'string') ctl = dnn.dom.getById(arg); else ctl = arg; if (ctl != null && typeof(Element) != 'undefined' && typeof(Element.extend) != 'undefined') Element.extend(ctl); if (arguments.length == 1) return ctl; ary[ary.length] = ctl;} return ary;}")}try{document.execCommand("BackgroundImageCache",false,true)}catch(err){}Sys.Application.add_load(dnn._onload);
;;;!function(o,e){function i(o){for(var e=i.options,t=e.parser[e.strictMode?"strict":"loose"].exec(o),n={},a=14;a--;)n[e.key[a]]=t[a]||"";return n[e.q.name]={},n[e.key[12]].replace(e.q.parser,function(o,i,t){i&&(n[e.q.name][i]=t)}),n}i.options={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};var t=function(){var e=!1;return function(o){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|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.test(o)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(o.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||o.opera),e}();o.dnnModal={load:function(){try{if(void 0!==parent.location.href){var o=parent;if(void 0!==o.parent.$find)if(-1==location.href.indexOf("popUp")||o.location.href.indexOf("popUp")>-1){var e=o.jQuery("#iPopUp"),i=e.dialog("option","refresh"),t=e.dialog("option","closingUrl"),n=e.dialog("option","minWidth"),a=e.dialog("option","minHeight"),r=e.dialog("option","showReturn");t||(t=location.href),!0===e.dialog("isOpen")&&e.dialog("option",{close:function(o,e){dnnModal.refreshPopup({url:t,width:n,height:a,showReturn:r,refresh:i})}}).dialog("close")}else o.jQuery("#iPopUp").dialog({autoOpen:!1,title:document.title})}return!1}catch(o){return!0}},show:function(n,a,r,l,d,s){var p=e("#iPopUp");p.length&&(p[0].src="about:blank",p.remove()),p=e('<iframe id="iPopUp" name="iPopUp" src="about:blank" scrolling="auto" frameborder="0"></iframe>'),e(document.body).append(p),e(document).find("html").css("overflow","hidden");for(var c=document.styleSheets,h=!1,m=0,g=c.length;m<g;m++){var u=c[m].href;if("string"==typeof u&&u.indexOf("admin.css")>-1){h=!0;break}}var f=!h&&(e(o).width()<481||t);f?e("html").addClass("mobileView"):e("html").removeClass("mobileView");var w=0,b=function(){p.prev(".dnnLoading").remove()},v=function(){p.on("load",function(){b();var e=document.getElementById("iPopUp"),t=o.location.hostname.toLowerCase(),a=o.location.port.toLowerCase(),r=i(n),l=r.host.toLowerCase(),d=r.port.toLowerCase();if(l=l||t,d=d||a,t===l&&a===d)try{if(f){var s=e.contentDocument.body,c=e.contentDocument.documentElement;c.style.width=w+"px",s.className+="mobileView dnnFormPopup dnnFormPopupMobileView";var h=Math.max(s.scrollHeight,s.offsetHeight,c.clientHeight,c.scrollHeight,c.offsetHeight);p.css("height",h+100).dialog("option","position",{my:"top",at:"top"})}e.contentWindow.dnnModal.show=function(o,e,i,t,n,a){var r=parent.jQuery("#iPopUp");a||(a=location.href),r.dialog("isOpen")&&r.dialog("option",{close:function(){parent.dnnModal.show(o,e,i,t,n,a)}}).dialog("close")}}catch(o){}}),p[0].src=n,"function"==typeof e.ui.dialog.prototype.options.open&&e.ui.dialog.prototype.options.open.apply(this,arguments)};if(f){w=e(o).width()-100;var y=e("body").css("height");p.dialog({modal:!0,autoOpen:!0,dialogClass:"dnnFormPopup dnnFormPopupMobileView",resizable:!1,closeOnEscape:!0,refresh:d,showReturn:a,closingUrl:s,minHeight:r,position:{my:"top",at:"top"},draggable:!1,open:function(){e("#Form").hide(),e("body").css("height","auto"),p.parent().css({width:"auto",left:"0",right:"0",top:"0","box-shadow":"none"}),o.scrollTo(0,0),v()},close:function(){e("#Form").show(),y&&e("body").css("height",y),o.scrollTo(0,0),o.dnnModal.closePopUp(d,s)}})}else if(p.dialog({modal:!0,autoOpen:!0,dialogClass:"dnnFormPopup",position:{my:"center",at:"center"},minWidth:l,minHeight:r,maxWidth:1920,maxHeight:1080,resizable:!0,closeOnEscape:!0,refresh:d,showReturn:a,closingUrl:s,open:v,close:function(){o.dnnModal.closePopUp(d,s)}}).width(l-11).height(r-11),0===p.parent().find(".ui-dialog-title").next("a.dnnModalCtrl").length){var k=e('<a class="dnnModalCtrl"></a>');p.parent().find(".ui-dialog-titlebar-close").wrap(k);var x=e('<a href="#" class="dnnToggleMax"><span>Max</span></a>');p.parent().find(".ui-dialog-titlebar-close").before(x),x.click(function(i){i.preventDefault();var t,n,a=e(o),r="center",l="center",d=0,s=0;if(e("button.ui-dialog-titlebar-close").length&&(s=e("button.ui-dialog-titlebar-close").parent(".dnnModalCtrl").height(),d=e("button.ui-dialog-titlebar-close").parent(".dnnModalCtrl").width()),p.data("isMaximized")){var c=p.data("height")+100;c>=a.height()&&(c=p.data("height")),t=c-s,n=p.data("width"),p.data("isMaximized",!1)}else{p.data("height",p.dialog("option","minHeight")).data("width",p.dialog("option","minWidth"));var h=0;e("#personaBar-iframe").length&&(h=e("#personaBar-iframe").width()),n=a.outerWidth()-h-d/7.5-40,t=a.height()-s,r="right-"+d/5.5+" center",l="right center-"+s/11,p.data("isMaximized",!0)}p.dialog("option","height",t),p.dialog("option","width",n),p.dialog("option","position",{my:r,at:l,of:o})})}if(function(){var o=e('<div class="dnnLoading"></div>');o.css({width:p.width(),height:p.height()}),p.before(o)}(),"true"===a.toString())return!1},closePopUp:function(o,i){var t=parent,n=t.jQuery("#iPopUp");void 0!==o&&null!=o||(o=!0),"true"==o.toString()?(void 0!==i&&""!=i||(i=t.location.href),t.location.href=i,n.hide()):n.dialog("option","close",null).dialog("close"),e(t.document).find("html").css("overflow","")},refreshPopup:function(o){var e=parent,i=e.parent;e.location.href!==i.location.href&&e.location.href!==o.url?i.dnnModal.show(o.url,o.showReturn,o.height,o.width,o.refresh,o.closingUrl):dnnModal.closePopUp(o.refresh,o.url)}},o.dnnModal.load()}(window,jQuery);
;;;/*!
 * hoverIntent v1.10.1 // 2019.10.05 // jQuery v1.7.0+
 * http://briancherne.github.io/jquery-hoverIntent/
 *
 * You may use hoverIntent under the terms of the MIT license. Basically that
 * means you are free to use hoverIntent as long as this header is left intact.
 * Copyright 2007-2019 Brian Cherne
 */
!function(factory){"use strict";"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof module&&module.exports?module.exports=factory(require("jquery")):jQuery&&!jQuery.fn.hoverIntent&&factory(jQuery)}(function($){"use strict";function track(ev){cX=ev.pageX,cY=ev.pageY}var cX,cY,_cfg={interval:100,sensitivity:6,timeout:0},INSTANCE_COUNT=0,compare=function(ev,$el,s,cfg){if(Math.sqrt((s.pX-cX)*(s.pX-cX)+(s.pY-cY)*(s.pY-cY))<cfg.sensitivity)return $el.off(s.event,track),delete s.timeoutId,s.isActive=!0,ev.pageX=cX,ev.pageY=cY,delete s.pX,delete s.pY,cfg.over.apply($el[0],[ev]);s.pX=cX,s.pY=cY,s.timeoutId=setTimeout(function(){compare(ev,$el,s,cfg)},cfg.interval)};$.fn.hoverIntent=function(handlerIn,handlerOut,selector){var instanceId=INSTANCE_COUNT++,cfg=$.extend({},_cfg);$.isPlainObject(handlerIn)?(cfg=$.extend(cfg,handlerIn),$.isFunction(cfg.out)||(cfg.out=cfg.over)):cfg=$.isFunction(handlerOut)?$.extend(cfg,{over:handlerIn,out:handlerOut,selector:selector}):$.extend(cfg,{over:handlerIn,out:handlerIn,selector:handlerOut});function handleHover(e){var ev=$.extend({},e),$el=$(this),hoverIntentData=$el.data("hoverIntent");hoverIntentData||$el.data("hoverIntent",hoverIntentData={});var state=hoverIntentData[instanceId];state||(hoverIntentData[instanceId]=state={id:instanceId}),state.timeoutId&&(state.timeoutId=clearTimeout(state.timeoutId));var mousemove=state.event="mousemove.hoverIntent.hoverIntent"+instanceId;if("mouseenter"===e.type){if(state.isActive)return;state.pX=ev.pageX,state.pY=ev.pageY,$el.off(mousemove,track).on(mousemove,track),state.timeoutId=setTimeout(function(){compare(ev,$el,state,cfg)},cfg.interval)}else{if(!state.isActive)return;$el.off(mousemove,track),state.timeoutId=setTimeout(function(){!function(ev,$el,s,out){var data=$el.data("hoverIntent");data&&delete data[s.id],out.apply($el[0],[ev])}(ev,$el,state,cfg.out)},cfg.timeout)}}return this.on({"mouseenter.hoverIntent":handleHover,"mouseleave.hoverIntent":handleHover},cfg.selector)}});
;;;jQuery(function($){
	$('div.EDS_tabs').edsTabulator_1();
	$('div.EDS_accordion').edsAccordion_1();
	$('.responsAbilityMenu').responsAbilityMenu();
});

(function ($) {
	var menuInstanceKey = 'responsAbilityInstance',
		$window = $(window);

	$.fn.responsAbilityMenu = function () {
		return this.each(function () {
			var $mainWrapper = $(this),
				offsetTop = $mainWrapper.offset().top - parseFloat($mainWrapper.css('marginTop'));

			if ($mainWrapper.data(menuInstanceKey))
				return;

			$mainWrapper.data(menuInstanceKey, true);

			$mainWrapper
				.on('click', '.raMenuTriggerWrapper > .raMenuTrigger', function () {
					$mainWrapper.toggleClass('raMenuOpened');
				})
				.on('click', '.raMenuWrapper .raMenuExpandTrigger', function () {
					$(this).parents('li').eq(0).toggleClass('raItemOpened')
				});

			$window.on('scroll', function () {
				if ($window.scrollTop() >= offsetTop)
					$mainWrapper.addClass('raFixedMenu');
				else
					$mainWrapper.removeClass('raFixedMenu');
			});
		});
	};
})(jQuery);

(function ($, window) {
	var activeClass = 'edsTabulator_active';
	var tabTriggerSelector = '.edsTabulator_tabTrigger';

	function edsTabulator (elem) {
		var self = this,
			$mainWrapper = $(elem);

		$mainWrapper
			.on('click', tabTriggerSelector, function () {
				var $clicked = $(this),
					itemIndex = $clicked.index(),
					$tabContentWrappers = $('.edsTabulator_tabsWrapper .edsTabulator_tab', $mainWrapper);

				if ($clicked.hasClass(activeClass))
					return;

				$tabContentWrappers.removeClass(activeClass);
				$(tabTriggerSelector, $mainWrapper).removeClass(activeClass);

				$clicked.addClass(activeClass);
				$tabContentWrappers.eq(itemIndex).addClass(activeClass);
			});
	}

	edsTabulator.prototype = {};

	$.fn.edsTabulator_1 = function () {
		var instanceKey = 'edsTabulatorRun';

		return this.each(function () {
			var self = this;

			if (!$.data(self, instanceKey))
				$.data(self, instanceKey, new edsTabulator(self));
		});
	};

})(jQuery, window);

(function ($, window) {
	var activeClass = 'edsAccordion_active',
		sectionClass = 'edsAccordion_section',
		sectionContentWrapper = 'edsAccordion_contentWrapper';

	function edsAccordion (elem) {
		var self = this,
			$mainWrapper = $(elem);

		$mainWrapper
			.on('click', '.' + sectionClass + ' > .edsAccordion_title', function (e) {
				var $clicked = $(this),
					$section = $clicked.parent(),
					$sectionContentWrapper = $('> .' + sectionContentWrapper, $section),
					$activeSections = $('.' + sectionClass + '.' + activeClass, $mainWrapper),
					currentlyActive = $section.hasClass(activeClass);

				$('> .' + sectionContentWrapper, $activeSections)
					.stop(true)
					.animate(
						{
							height: 0
						},
						{
							duration: 200
						}
					);
				$activeSections.removeClass(activeClass);

				if (currentlyActive)
					return false;

				$sectionContentWrapper
					.stop(true)
					.animate(
						{
							height: $('> .edsAccordion_content', $sectionContentWrapper).outerHeight(true)
						},
						{
							duration: 200,
							complete: function () {
								$sectionContentWrapper.css('height', 'auto');
							}
						}
					);
				$section.addClass(activeClass);

				return false;
			});
	}

	edsAccordion.prototype = {};

	$.fn.edsAccordion_1 = function () {
		var instanceKey = 'edsAccordionRun';

		return this.each(function () {
			var elem = this;

			if (!$.data(elem, instanceKey))
				$.data(elem, instanceKey, new edsAccordion(elem));
		});
	};

})(jQuery, window);
;;;var DNN_COL_DELIMITER=String.fromCharCode(16);var DNN_ROW_DELIMITER=String.fromCharCode(15);var __dnn_m_bPageLoaded=false;if(window.addEventListener){window.addEventListener("load",__dnn_Page_OnLoad,false)}else{window.attachEvent("onload",__dnn_Page_OnLoad)}function __dnn_ClientAPIEnabled(){return typeof(dnn)!="undefined"&&typeof (dnn.dom)!="undefined"}function __dnn_Page_OnLoad(){if(__dnn_ClientAPIEnabled()){dnn.dom.attachEvent(window,"onscroll",__dnn_bodyscroll)}__dnn_m_bPageLoaded=true}function __dnn_KeyDown(iKeyCode,sFunc,e){if(e==null){e=window.event}if(e.keyCode==iKeyCode){eval(unescape(sFunc));return false}}function __dnn_bodyscroll(){var a=document.forms[0];if(__dnn_ClientAPIEnabled()&&__dnn_m_bPageLoaded&&typeof(a.ScrollTop)!="undefined"){a.ScrollTop.value=document.documentElement.scrollTop?document.documentElement.scrollTop:dnn.dom.getByTagName("body")[0].scrollTop}}function __dnn_setScrollTop(c){if(__dnn_ClientAPIEnabled()){if(c==null){c=document.forms[0].ScrollTop.value}var a=dnn.getVar("ScrollToControl");if(a!=null&&a.length>0){var b=dnn.dom.getById(a);if(b!=null){c=dnn.dom.positioning.elementTop(b);dnn.setVar("ScrollToControl","")}}if(document.getElementsByTagName("html")[0].style.overflow!="hidden"){window.scrollTo(0,c)}}}function __dnn_SetInitialFocus(a){var b=dnn.dom.getById(a);if(b!=null&&__dnn_CanReceiveFocus(b)){b.focus()}}function __dnn_CanReceiveFocus(b){if(b.style.display!="none"&&b.tabIndex>-1&&b.disabled==false&&b.style.visible!="hidden"){var a=b.parentElement;while(a!=null&&a.tagName!="BODY"){if(a.style.display=="none"||a.disabled||a.style.visible=="hidden"){return false}a=a.parentElement}return true}else{return false}}function __dnn_ContainerMaxMin_OnClick(i,b){var g=dnn.dom.getById(b);if(g!=null){var e=i.childNodes[0];var l=dnn.getVar("containerid_"+b);var j=dnn.getVar("cookieid_"+b);var d=e.src.toLowerCase().substr(e.src.lastIndexOf("/"));var a;var h;var k;if(dnn.getVar("min_icon_"+l)){k=dnn.getVar("min_icon_"+l)}else{k=dnn.getVar("min_icon")}if(dnn.getVar("max_icon_"+l)){h=dnn.getVar("max_icon_"+l)}else{h=dnn.getVar("max_icon")}a=h.toLowerCase().substr(h.lastIndexOf("/"));var c=5;var f=dnn.getVar("animf_"+b);if(f!=null){c=new Number(f)}if(d==a){e.src=k;dnn.dom.expandElement(g,c);e.title=dnn.getVar("min_text");if(j!=null){if(dnn.getVar("__dnn_"+l+":defminimized")=="true"){dnn.dom.setCookie(j,"true",365)}else{dnn.dom.deleteCookie(j)}}else{dnn.setVar("__dnn_"+l+"_Visible","true")}}else{e.src=h;dnn.dom.collapseElement(g,c);e.title=dnn.getVar("max_text");if(j!=null){if(dnn.getVar("__dnn_"+l+":defminimized")=="true"){dnn.dom.deleteCookie(j)}else{dnn.dom.setCookie(j,"false",365)}}else{dnn.setVar("__dnn_"+l+"_Visible","false")}}return true}return false}function __dnn_Help_OnClick(a){var b=dnn.dom.getById(a);if(b!=null){if(b.style.display=="none"){b.style.display=""}else{b.style.display="none"}return true}return false}function __dnn_SectionMaxMin(f,c){var d=dnn.dom.getById(c);if(d!=null){var g=f.getAttribute("max_icon");var e=f.getAttribute("min_icon");var a=f.getAttribute("userctr")!=null;var b;if(d.style.display=="none"){f.src=e;d.style.display="";if(a){b="True"}else{dnn.setVar(f.id+":exp",1)}}else{f.src=g;d.style.display="none";if(a){b="False"}else{dnn.setVar(f.id+":exp",0)}}if(a){dnncore.setUserProp(f.getAttribute("userctr"),f.getAttribute("userkey"),b,null)}return true}return false}function __dnn_enableDragDrop(){var b=dnn.getVar("__dnn_dragDrop").split(";");var e;for(var c=0;c<b.length;c++){e=b[c].split(" ");if(e[0].length>0){var a=dnn.dom.getById(e[0]);var d=dnn.dom.getById(e[1]);if(a!=null&&d!=null){a.setAttribute("moduleid",e[2]);dnn.dom.positioning.enableDragAndDrop(a,d,"__dnn_dragComplete()","__dnn_dragOver()")}}}}var __dnn_oPrevSelPane;var __dnn_oPrevSelModule;var __dnn_dragEventCount=0;function __dnn_dragOver(){__dnn_dragEventCount++;if(__dnn_dragEventCount%75!=0){return}var c=dnn.dom.getById(dnn.dom.positioning.dragCtr.contID);var a=__dnn_getMostSelectedPane(dnn.dom.positioning.dragCtr);if(__dnn_oPrevSelPane!=null){__dnn_oPrevSelPane.pane.style.border=__dnn_oPrevSelPane.origBorder}if(a!=null){__dnn_oPrevSelPane=a;a.pane.style.border="4px double "+DNN_HIGHLIGHT_COLOR;var e=__dnn_getPaneControlIndex(c,a);var b;var f;for(var d=0;d<a.controls.length;d++){if(e>d&&a.controls[d].id!=c.id){b=a.controls[d]}if(e<=d&&a.controls[d].id!=c.id){f=a.controls[d];break}}if(__dnn_oPrevSelModule!=null){dnn.dom.getNonTextNode(__dnn_oPrevSelModule.control).style.border=__dnn_oPrevSelModule.origBorder}if(f!=null){__dnn_oPrevSelModule=f;dnn.dom.getNonTextNode(f.control).style.borderTop="5px groove "+DNN_HIGHLIGHT_COLOR}else{if(b!=null){__dnn_oPrevSelModule=b;dnn.dom.getNonTextNode(b.control).style.borderBottom="5px groove "+DNN_HIGHLIGHT_COLOR}}}}function __dnn_dragComplete(){var f=dnn.dom.getById(dnn.dom.positioning.dragCtr.contID);var d=f.getAttribute("moduleid");if(__dnn_oPrevSelPane!=null){__dnn_oPrevSelPane.pane.style.border=__dnn_oPrevSelPane.origBorder}if(__dnn_oPrevSelModule!=null){dnn.dom.getNonTextNode(__dnn_oPrevSelModule.control).style.border=__dnn_oPrevSelModule.origBorder}var b=__dnn_getMostSelectedPane(dnn.dom.positioning.dragCtr);var e;if(b==null){var a=__dnn_Panes();for(var c=0;c<a.length;c++){if(a[c].id==f.parentNode.id){b=a[c]}}}if(b!=null){e=__dnn_getPaneControlIndex(f,b);__dnn_MoveToPane(b,f,e);dnn.callPostBack("MoveToPane","moduleid="+d,"pane="+b.paneName,"order="+e*2)}}function __dnn_MoveToPane(a,e,d){if(a!=null){var c=new Array();for(var b=d;b<a.controls.length;b++){if(a.controls[b].control.id!=e.id){c[c.length]=a.controls[b].control}dnn.dom.removeChild(a.controls[b].control)}dnn.dom.appendChild(a.pane,e);e.style.top=0;e.style.left=0;e.style.position="relative";for(var b=0;b<c.length;b++){dnn.dom.appendChild(a.pane,c[b])}__dnn_RefreshPanes()}else{e.style.top=0;e.style.left=0;e.style.position="relative"}}function __dnn_RefreshPanes(){var b=dnn.getVar("__dnn_Panes").split(";");var a=dnn.getVar("__dnn_PaneNames").split(";");__dnn_m_aryPanes=new Array();for(var c=0;c<b.length;c++){if(b[c].length>0){__dnn_m_aryPanes[__dnn_m_aryPanes.length]=new __dnn_Pane(dnn.dom.getById(b[c]),a[c])}}}var __dnn_m_aryPanes;var __dnn_m_aryModules;function __dnn_Panes(){if(__dnn_m_aryPanes==null){__dnn_m_aryPanes=new Array();__dnn_RefreshPanes()}return __dnn_m_aryPanes}function __dnn_Modules(a){if(__dnn_m_aryModules==null){__dnn_RefreshPanes()}return __dnn_m_aryModules[a]}function __dnn_getMostSelectedPane(g){var c=new dnn.dom.positioning.dims(g);var f=0;var a;var h;for(var e=0;e<__dnn_Panes().length;e++){var b=__dnn_Panes()[e];var d=new dnn.dom.positioning.dims(b.pane);a=dnn.dom.positioning.elementOverlapScore(d,c);if(a>f){f=a;h=b}}return h}function __dnn_getPaneControlIndex(f,b){if(b==null){return}var a=new dnn.dom.positioning.dims(f);var e;if(b.controls.length==0){return 0}for(var c=0;c<b.controls.length;c++){e=b.controls[c];var d=new dnn.dom.positioning.dims(e.control);if(a.t<d.t){return e.index}}if(e!=null){return e.index+1}else{return 0}}function __dnn_Pane(a,b){this.pane=a;this.id=a.id;this.controls=new Array();this.origBorder=a.style.border;this.paneName=b;var f=0;var e="";for(var d=0;d<a.childNodes.length;d++){var g=a.childNodes[d];if(dnn.dom.isNonTextNode(g)){if(__dnn_m_aryModules==null){__dnn_m_aryModules=new Array()}var c=g.getAttribute("moduleid");if(c!=null&&c.length>0){e+=c+"~";this.controls[this.controls.length]=new __dnn_PaneControl(g,f);__dnn_m_aryModules[c]=g.id;f+=1}}}this.moduleOrder=e}function __dnn_PaneControl(a,b){this.control=a;this.id=a.id;this.index=b;this.origBorder=a.style.border}function __dnn_ShowModalPage(a){dnnModal.show(a,true,550,950,true,"")}function __dnncore(){this.GetUserVal=0;this.SetUserVal=1}__dnncore.prototype={getUserProp:function(b,c,a){this._doUserCallBack(dnncore.GetUserVal,b,c,null,new dnncore.UserPropArgs(b,c,a))},setUserProp:function(c,d,a,b){this._doUserCallBack(dnncore.SetUserVal,c,d,a,new dnncore.UserPropArgs(c,d,b))},_doUserCallBack:function(c,d,e,a,b){if(dnn&&dnn.xmlhttp){var f=c+COL_DELIMITER+d+COL_DELIMITER+e+COL_DELIMITER+a;dnn.xmlhttp.doCallBack("__Page",f,dnncore._callBackSuccess,b,dnncore._callBackFail,null,true,null,0)}else{alert("Client Personalization not enabled")}},_callBackSuccess:function(a,b,c){if(b.pFunc){b.pFunc(b.namingCtr,b.key,a)}},_callBackFail:function(a,b){window.status=a}};__dnncore.prototype.UserPropArgs=function(b,c,a){this.namingCtr=b;this.key=c;this.pFunc=a};var dnncore=new __dnncore();
;;;(function ($) {
    if (typeof dnn == 'undefined') window.dnn = {};
    if (typeof dnn.searchSkinObject == 'undefined') {
        dnn.searchSkinObject = function (options) {
            var settings = {
                delayTriggerAutoSearch: 100,
                minCharRequiredTriggerAutoSearch: 2,
                searchType: 'S',
                enableWildSearch: true,
                cultureCode: 'en-US'
            };
            this.settings = $.extend({}, settings, options);
        };
        dnn.searchSkinObject.prototype = {
            _ignoreKeyCodes: [9, 13, 16, 17, 18, 19, 20, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45],
            init: function () {
                var throttle = null, self = this;
                var makeUrl = function (val, service) {
                    var url = service ? service.getServiceRoot('internalservices') + 'searchService/preview' : null;
                    if (!url) return null;
                    var params = {};
                    params['keywords'] = val.replace(/^\s+|\s+$/g, '');
                    if (!self.settings.enableWildSearch) params["forceWild"] = "0";
                    params['culture'] = self.settings.cultureCode;
                    if (self.settings.portalId >= 0)
                        params['portal'] = self.settings.portalId;
                    var urlAppend = [];
                    $.each(params, function (index, value) {
                        urlAppend.push([index, encodeURIComponent(value)].join('='));
                    });

                    if (urlAppend.length) {
                        url += url.indexOf('?') === -1 ? '?' : '&';
                        url += urlAppend.join('&');
                    }
                    return url;
                };

                var generatePreviewTemplate = function (data, $wrap) {
                    var preview = $('.searchSkinObjectPreview', $wrap);
                    if (preview.length)
                        preview.remove();

                    var markup = '<ul class="searchSkinObjectPreview">';
                    if (data && data.length) {
                        for (var i = 0; i < data.length; i++) {
                            var group = data[i];
                            if (group.Results && group.Results.length) {
                                var groupTitle = group.DocumentTypeName;
                                markup += '<li class="searchSkinObjectPreview_group">' + groupTitle + '</li>';
                                for (var j = 0; j < group.Results.length; j++) {
                                    var item = group.Results[j];
                                    var itemTitle = item.Title;
                                    var itemUrl = item.DocumentUrl;
                                    var itemDescription = item.Description;
                                    var itemSnippet = item.Snippet;
                                    markup += '<li data-url="' + itemUrl + '">';
                                    if (item.Attributes.Avatar) {
                                        markup += '<span><img src="' + item.Attributes.Avatar + '" class="userpic" /></span>';
                                    }
                                    markup += '<span>' + itemTitle + '</span>';
                                    if (itemDescription) {
                                        markup += '<p>' + itemDescription + '</p>';
                                    }
                                    if (itemSnippet) {
                                        markup += '<p>' + itemSnippet + '</p>';
                                    }
                                    markup += '</li>';
                                } // end for group items
                            }
                        } // end for group

                        var moreResults = $wrap.attr('data-moreresults');
                        markup += '<li><a href="javascript:void(0)" class="searchSkinObjectPreview_more">' + moreResults + '</a></li>';
                        markup += '</ul>';
                    }
                    else {
                        var noResult = $wrap.attr('data-noresult');
                        markup += '<li>' + noResult + '</li></ul>';
                    }

                    $wrap.append(markup);
                    preview = $('.searchSkinObjectPreview', $wrap);

                    //attach click event
                    $('li', preview).on('click', function () {
                        var navigateUrl = $(this).attr('data-url');
                        if (navigateUrl) {
                            window.location.href = navigateUrl;
                        }
                        return false;
                    });

                    //attach see more       
                    $('.searchSkinObjectPreview_more', $wrap).on('click', function () {
                        var $searchButton = $wrap.next();
                        if (!$searchButton.length) {
                            $searchButton = $wrap.parent().next();
                        }
                        $searchButton[0].click();
                        return false;
                    });
                };

                $('.searchInputContainer a.dnnSearchBoxClearText').on('click', function () {
                    var $this = $(this);
                    var $wrap = $this.parent();
                    $('.searchInputContainer input').val('').focus();
                    $this.removeClass('dnnShow');
                    $('.searchSkinObjectPreview', $wrap).remove();
                    return false;
                });

                $('.searchInputContainer').next().on('click', function() {
                    var $this = $(this);
                    var inputBox = $this.prev().find('input[type="text"]');
                    var val = inputBox.val();
                    if (val.length) {
                        return true;
                    }
                    return false;
                });

                $('.searchInputContainer input').on('keyup', function(e) {
                    var k = e.keyCode || e.witch;
                    if ($.inArray(k, self._ignoreKeyCodes) > -1) return;

                    var $this = $(this);
                    var $wrap = $this.parent();
                    var val = $this.val();
                    var container = $this.parent('.searchInputContainer');
                    if (!val) {

                        $('a.dnnSearchBoxClearText', $wrap).removeClass('dnnShow');
                        $('.searchSkinObjectPreview', $wrap).remove();
                    } else {
                        $('a.dnnSearchBoxClearText', $wrap).addClass('dnnShow');

                        if (self.settings.searchType != 'S' ||
                            val.length < self.settings.minCharRequiredTriggerAutoSearch) return;

                        if (throttle) {
                            clearTimeout(throttle);
                            delete throttle;
                        }

                        throttle = setTimeout(function() {
                            var service = $.dnnSF ? $.dnnSF(-1) : null;
                            var url = makeUrl(val, service);
                            if (url) {
                                $.ajax({
                                    url: url,
                                    beforeSend: service ? service.setModuleHeaders : null,
                                    success: function(result) {
                                        if (result)
                                            generatePreviewTemplate(result, container);
                                    },
                                    error: function() {
                                    },
                                    type: 'GET',
                                    dataType: 'json',
                                    contentType: "application/json"
                                });
                            }
                        }, self.settings.delayTriggerAutoSearch);
                    }
                })
                .on('paste', function() {
                    $(this).triggerHandler('keyup');
                })
                .on('keypress', function(e) {
                    var k = e.keyCode || e.which;
                    if (k == 13) {
                        var $this = $(this);
                        var $wrap = $this.parent();
                        var val = $this.val();
                        if (val.length) {
                            var $searchButton = $wrap.next();
                            if (!$searchButton.length) {
                                $searchButton = $wrap.parent().next();
                            }
                            $searchButton[0].click();
                            e.preventDefault();
                        } else {
                            e.preventDefault();
                        }
                    }
                });
            }
        };
    }
})(jQuery);

;;;
(function ($) { $.dnnSF = function (moduleId) { var base = this; base.getServiceRoot = function (moduleName) { var serviceRoot = dnn.getVar("sf_siteRoot", "/"); serviceRoot += "API/" + moduleName + "/"; return serviceRoot; }; base.getTabId = function () { return dnn.getVar("sf_tabId", -1); }; base.getModuleId = function () { return moduleId; }; base.setModuleHeaders = function (xhr) { var tabId = base.getTabId(); if (tabId > -1) { xhr.setRequestHeader("ModuleId", base.getModuleId()); xhr.setRequestHeader("TabId", tabId); } var afValue = base.getAntiForgeryValue(); if (afValue) { xhr.setRequestHeader("RequestVerificationToken", afValue); } }; base.getAntiForgeryKey = function () { return "__RequestVerificationToken"; }; base.getAntiForgeryValue = function () { return $('[name="__RequestVerificationToken"]').val(); }; return base; }; $.ServicesFramework = function (moduleId) { return new $.dnnSF(moduleId); }; })(jQuery);

;;;/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright Â© 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

(function (jQuery) {
    // t: current time, b: begInnIng value, c: change In value, d: duration
    jQuery.easing['jswing'] = jQuery.easing['swing'];

    jQuery.extend(jQuery.easing,
        {
            def: 'easeOutQuad',
            swing: function (x, t, b, c, d) {
                //alert(jQuery.easing.default);
                return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
            },
            easeInQuad: function (x, t, b, c, d) {
                return c * (t /= d) * t + b;
            },
            easeOutQuad: function (x, t, b, c, d) {
                return -c * (t /= d) * (t - 2) + b;
            },
            easeInOutQuad: function (x, t, b, c, d) {
                if ((t /= d / 2) < 1) return c / 2 * t * t + b;
                return -c / 2 * ((--t) * (t - 2) - 1) + b;
            },
            easeInCubic: function (x, t, b, c, d) {
                return c * (t /= d) * t * t + b;
            },
            easeOutCubic: function (x, t, b, c, d) {
                return c * ((t = t / d - 1) * t * t + 1) + b;
            },
            easeInOutCubic: function (x, t, b, c, d) {
                if ((t /= d / 2) < 1) return c / 2 * t * t * t + b;
                return c / 2 * ((t -= 2) * t * t + 2) + b;
            },
            easeInQuart: function (x, t, b, c, d) {
                return c * (t /= d) * t * t * t + b;
            },
            easeOutQuart: function (x, t, b, c, d) {
                return -c * ((t = t / d - 1) * t * t * t - 1) + b;
            },
            easeInOutQuart: function (x, t, b, c, d) {
                if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b;
                return -c / 2 * ((t -= 2) * t * t * t - 2) + b;
            },
            easeInQuint: function (x, t, b, c, d) {
                return c * (t /= d) * t * t * t * t + b;
            },
            easeOutQuint: function (x, t, b, c, d) {
                return c * ((t = t / d - 1) * t * t * t * t + 1) + b;
            },
            easeInOutQuint: function (x, t, b, c, d) {
                if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b;
                return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;
            },
            easeInSine: function (x, t, b, c, d) {
                return -c * Math.cos(t / d * (Math.PI / 2)) + c + b;
            },
            easeOutSine: function (x, t, b, c, d) {
                return c * Math.sin(t / d * (Math.PI / 2)) + b;
            },
            easeInOutSine: function (x, t, b, c, d) {
                return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;
            },
            easeInExpo: function (x, t, b, c, d) {
                return (t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b;
            },
            easeOutExpo: function (x, t, b, c, d) {
                return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b;
            },
            easeInOutExpo: function (x, t, b, c, d) {
                if (t == 0) return b;
                if (t == d) return b + c;
                if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
                return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
            },
            easeInCirc: function (x, t, b, c, d) {
                return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b;
            },
            easeOutCirc: function (x, t, b, c, d) {
                return c * Math.sqrt(1 - (t = t / d - 1) * t) + b;
            },
            easeInOutCirc: function (x, t, b, c, d) {
                if ((t /= d / 2) < 1) return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;
                return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;
            },
            easeInElastic: function (x, t, b, c, d) {
                var s = 1.70158; var p = 0; var a = c;
                if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3;
                if (a < Math.abs(c)) { a = c; var s = p / 4; }
                else var s = p / (2 * Math.PI) * Math.asin(c / a);
                return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
            },
            easeOutElastic: function (x, t, b, c, d) {
                var s = 1.70158; var p = 0; var a = c;
                if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3;
                if (a < Math.abs(c)) { a = c; var s = p / 4; }
                else var s = p / (2 * Math.PI) * Math.asin(c / a);
                return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;
            },
            easeInOutElastic: function (x, t, b, c, d) {
                var s = 1.70158; var p = 0; var a = c;
                if (t == 0) return b; if ((t /= d / 2) == 2) return b + c; if (!p) p = d * (.3 * 1.5);
                if (a < Math.abs(c)) { a = c; var s = p / 4; }
                else var s = p / (2 * Math.PI) * Math.asin(c / a);
                if (t < 1) return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
                return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;
            },
            easeInBack: function (x, t, b, c, d, s) {
                if (s == undefined) s = 1.70158;
                return c * (t /= d) * t * ((s + 1) * t - s) + b;
            },
            easeOutBack: function (x, t, b, c, d, s) {
                if (s == undefined) s = 1.70158;
                return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
            },
            easeInOutBack: function (x, t, b, c, d, s) {
                if (s == undefined) s = 1.70158;
                if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
                return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
            },
            easeInBounce: function (x, t, b, c, d) {
                return c - jQuery.easing.easeOutBounce(x, d - t, 0, c, d) + b;
            },
            easeOutBounce: function (x, t, b, c, d) {
                if ((t /= d) < (1 / 2.75)) {
                    return c * (7.5625 * t * t) + b;
                } else if (t < (2 / 2.75)) {
                    return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
                } else if (t < (2.5 / 2.75)) {
                    return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
                } else {
                    return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
                }
            },
            easeInOutBounce: function (x, t, b, c, d) {
                if (t < d / 2) return jQuery.easing.easeInBounce(x, t * 2, 0, c, d) * .5 + b;
                return jQuery.easing.easeOutBounce(x, t * 2 - d, 0, c, d) * .5 + c * .5 + b;
            }
        });

})(eds2_2);

/*
 *
 * TERMS OF USE - EASING EQUATIONS
 * 
 * Open source under the BSD License. 
 * 
 * Copyright Â© 2001 Robert Penner
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
 */
;;;/*
    RateIt
    version 0.99.2
    03/07/2011
    http://rateit.codeplex.com
    Twitter: @gjunge

*/
(function ($) {
	$.fn.rateit = function (p1, p2) {
		//quick way out.
		var options = {}; var mode = 'init';
		if (this.length == 0) return this;


		var tp1 = $.type(p1);
		if (tp1 == 'object' || p1 === undefined || p1 == null) {
			options = $.extend({}, $.fn.rateit.defaults, p1); //wants to init new rateit plugin(s).
		}
		else if (tp1 == 'string' && p2 === undefined) {
			return this.data('rateit-' + p1); //wants to get a value.
		}
		else if (tp1 == 'string') {
			mode = 'setvalue'
		}

		return this.each(function () {
			var item = $(this);

			//shorten all the item.data('rateit-XXX'), will save space in closure compiler, will be like item.data('XXX') will become x('XXX')
			var itemdata = function (k, v) {
				k = 'rateit-' + k;

				if (arguments.length === 1)
					return item.data(k);

				item.data(k, v);
				return v;
			};

			//add the rate it class.
			if (!item.hasClass('rateit')) item.addClass('rateit');

			var ltr = item.css('direction') != 'rtl';

			// set value mode
			if (mode == 'setvalue') {
				if (!itemdata('init')) throw 'Can\'t set value before init';


				//if readonly now and it wasn't readonly, remove the eventhandlers.
				if (p1 == 'readonly' && !itemdata('readonly')) {
					item.find('.rateit-range').unbind();
					itemdata('wired', false);
				}

				if (itemdata('backingfld')) {
					//if we have a backing field, check which fields we should update. 
					//In case of input[type=range], although we did read its attributes even in browsers that don't support it (using fld.attr())
					//we only update it in browser that support it (&& fld[0].min only works in supporting browsers), not only does it save us from checking if it is range input type, it also is unnecessary.
					var fld = $(itemdata('backingfld'));
					if (p1 == 'value') fld.val(p2);
					if (p1 == 'min' && fld[0].min) fld[0].min = p2;
					if (p1 == 'max' && fld[0].max) fld[0].max = p2;
					if (p1 == 'step' && fld[0].step) fld[0].step = p2;
				}

				itemdata(p1, p2);
			}

			//init rateit plugin
			if (!itemdata('init')) {

				//get our values, either from the data-* html5 attribute or from the options.
				itemdata('min', itemdata('min') || options.min);
				itemdata('max', itemdata('max') || options.max);
				itemdata('step', itemdata('step') || options.step);
				itemdata('readonly', itemdata('readonly') !== undefined ? itemdata('readonly') : options.readonly);
				itemdata('resetable', itemdata('resetable') !== undefined ? itemdata('resetable') : options.resetable);
				itemdata('backingfld', itemdata('backingfld') || options.backingfld);
				itemdata('starwidth', itemdata('starwidth') || options.starwidth);
				itemdata('starheight', itemdata('starheight') || options.starheight);
				itemdata('value', itemdata('value') || options.min);
				//are we LTR or RTL?

				if (itemdata('backingfld')) {
					//if we have a backing field, hide it, and get its value, and override defaults if range.
					var fld = $(itemdata('backingfld'));
					itemdata('value', fld.hide().val());

					if (fld[0].nodeName == 'INPUT') {
						if (fld[0].type == 'range' || fld[0].type == 'text') { //in browsers not support the range type, it defaults to text

							itemdata('min', parseInt(fld.attr('min')) || itemdata('min')); //if we would have done fld[0].min it wouldn't have worked in browsers not supporting the range type.
							itemdata('max', parseInt(fld.attr('max')) || itemdata('max'));
							itemdata('step', parseInt(fld.attr('step')) || itemdata('step'));
						}
					}
					if (fld[0].nodeName == 'SELECT' && fld[0].options.length > 1) {
						itemdata('min', Number(fld[0].options[0].value));
						itemdata('max', Number(fld[0].options[fld[0].length - 1].value));
						itemdata('step', Number(fld[0].options[1].value) - Number(fld[0].options[0].value));
					}
				}

				//Create the necessart tags.
				item.append('<div class="rateit-reset"></div><div class="rateit-range"><div class="rateit-selected" style="height:' + itemdata('starheight') + 'px"></div><div class="rateit-hover" style="height:' + itemdata('starheight') + 'px"></div></div>');

				//if we are in RTL mode, we have to change the float of the "reset button"
				if (!ltr) {
					item.find('.rateit-reset').css('float', 'right');
					item.find('.rateit-selected').addClass('rateit-selected-rtl');
					item.find('.rateit-hover').addClass('rateit-hover-rtl');
				}
				itemdata('init', true);
			}


			//set the range element to fit all the stars.
			var range = item.find('.rateit-range');
			range.width(itemdata('starwidth') * (itemdata('max') - itemdata('min'))).height(itemdata('starheight'));


			//set the value if we have it.
			if (itemdata('value')) {
				var score = (itemdata('value') - itemdata('min')) * itemdata('starwidth');
				item.find('.rateit-selected').width(score);
			}

			var resetbtn = item.find('.rateit-reset');

			var calcRawScore = function (element, event) {
				var pageX = (event.changedTouches) ? event.changedTouches[0].pageX : event.pageX;

				var offsetx = pageX - $(element).offset().left;
				if (!ltr) offsetx = range.width() - offsetx;
				if (offsetx > range.width()) offsetx = range.width();
				if (offsetx < 0) offsetx = 0;

				return score = Math.ceil(offsetx / itemdata('starwidth') * (1 / itemdata('step')));
			};


			//

			if (!itemdata('readonly')) {
				//if we are not read only, add all the events

				//if we have a reset button, set the event handler.
				if (itemdata('resetable')) {
					resetbtn.click(function () {
						itemdata('value', itemdata('min'));
						range.find('.rateit-hover').hide().width(0);
						range.find('.rateit-selected').width(0).show();
						if (itemdata('backingfld')) $(itemdata('backingfld')).val(itemdata('min'));
						item.trigger('reset');
					});

				}
				else {
					resetbtn.hide();
				}



				//when the mouse goes over the range div, we set the "hover" stars.
				if (!itemdata('wired')) {
					range.bind('touchmove touchend', touchHandler); //bind touch events
					range.mousemove(function (e) {
						var score = calcRawScore(this, e);
						var w = score * itemdata('starwidth') * itemdata('step');
						var h = range.find('.rateit-hover');
						if (h.data('width') != w) {
							range.find('.rateit-selected').hide();
							h.width(w).show().data('width', w);
							item.trigger('hover', [(score * itemdata('step')) + itemdata('min')]);
						}
					});
					//when the mouse leaves the range, we have to hide the hover stars, and show the current value.
					range.mouseleave(function (e) {
						range.find('.rateit-hover').hide().width(0).data('width', '');
						item.trigger('hover', [null]);
						range.find('.rateit-selected').show();
					});
					//when we click on the range, we have to set the value, hide the hover.
					range.mouseup(function (e) {
						var score = calcRawScore(this, e);

						var newvalue = (score * itemdata('step')) + itemdata('min');
						itemdata('value', newvalue);
						if (itemdata('backingfld')) {
							$(itemdata('backingfld')).val(newvalue);
						}
						range.find('.rateit-hover').hide();
						range.find('.rateit-selected').width(score * itemdata('starwidth') * itemdata('step')).show();
						item.trigger('hover', [null]).trigger('rated', [newvalue]);
					});

					itemdata('wired', true);
				}
				if (itemdata('resetable')) {
					resetbtn.show();
				}
			}
			else {
				resetbtn.hide();
			}
		});
	};

	//touch converter http://ross.posterous.com/2008/08/19/iphone-touch-events-in-javascript/
	function touchHandler(event) {

		var touches = event.originalEvent.changedTouches,
                first = touches[0],
                type = "";
		switch (event.type) {
			case "touchmove": type = "mousemove"; break;
			case "touchend": type = "mouseup"; break;
			default: return;
		}

		var simulatedEvent = document.createEvent("MouseEvent");
		simulatedEvent.initMouseEvent(type, true, true, window, 1,
                              first.screenX, first.screenY,
                              first.clientX, first.clientY, false,
                              false, false, false, 0/*left*/, null);

		first.target.dispatchEvent(simulatedEvent);
		event.preventDefault();
	};


	//some default values.
	$.fn.rateit.defaults = { min: 0, max: 5, step: 0.5, starwidth: 16, starheight: 16, readonly: false, resetable: true };
	eds2_2(document).ready(function ($) {
		//invoke it on all div.rateit elements. This could be removed if not wanted.
		$('div.rateit').rateit();
	});
})(eds2_2);
;;;/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 * Thanks to: Seamus Leahy for adding deltaX and deltaY
 *
 * Version: 3.0.6
 * 
 * Requires: 1.2.2+
 */
(function () {
var eds_mousewheel = function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})};

if (typeof jQuery !== 'undefined')
	eds_mousewheel(jQuery);

if (typeof eds2_2 !== 'undefined')
	eds_mousewheel(eds2_2);
})();

;;;(function ($) {
    $.fn.dnnTabs = function (options) {
        var opts = $.extend({}, $.fn.dnnTabs.defaultOptions, options),
        $wrap = this;

        // patch for period in selector - http://jsfiddle.net/9Mst9/2/
        $.ui.tabs.prototype._sanitizeSelector = function (hash) {
            return hash.replace(/:/g, "\\:").replace(/\./g, "\\\.");
        };

        $wrap.each(function () {
            var showEvent, cookieId;
            if (this.id) {
                cookieId = 'dnnTabs-' + this.id;
                if (opts.selected === -1) {
                    var cookieValue = dnn.dom.getCookie(cookieId);
                    if (cookieValue) {
                        opts.selected = cookieValue;
                    }
                    if (opts.selected === -1) {
                        opts.selected = 0;
                    }
                }
                showEvent = (function (cid) {
                    return function (event, ui) {
                        dnn.dom.setCookie(cid, ui.newTab.index(), opts.cookieDays, '/', '', false, opts.cookieMilleseconds);
                    };
                })(cookieId);
            } else {
                showEvent = function () {
                };
            }

            $wrap.tabs({
                activate: showEvent,
                active: opts.selected,
                disabled: opts.disabled,
                fx: {
                    opacity: opts.opacity,
                    duration: opts.duration
                }
            });

            if (window.location.hash && window.location.hash != '#') {
                var substr = window.location.hash.substr(0, 50);
                $('a[href="' + encodeURI(substr) + '"]', $wrap).trigger('click');
            }

            // page validation integration - select tab that contain tripped validators
            if (typeof window.Page_ClientValidate != "undefined" && $.isFunction(window.Page_ClientValidate)) {
                $wrap.find(opts.validationTriggerSelector).click(function () {
                    if (!window.Page_ClientValidate(opts.validationGroup)) {
                        var invalidControl = $wrap.find(opts.invalidItemSelector).eq(0);
                        var $parent = invalidControl.closest(".ui-tabs-panel");
                        if ($parent.length > 0) {
                            var tabId = $parent.attr("id");
                            $parent.parent().find("a[href='#" + tabId + "']").click();
                        }
                    }
                });
            };
        });

        return $wrap;
    };

    $.fn.dnnTabs.defaultOptions = {
        opacity: 'toggle',
        duration: 'fast',
        validationTriggerSelector: '.dnnPrimaryAction',
        validationGroup: '',
        invalidItemSelector: '.dnnFormError[style*="inline"]',
        regionToToggleSelector: 'fieldset',
        selected: -1,
        cookieDays: 0,
        cookieMilleseconds: 1200000 // twenty minutes
    };

})(jQuery);

(function ($) {
    $.fn.dnnConfirm = function (options) {
        var opts = $.extend({}, $.fn.dnnConfirm.defaultOptions, options),
        $wrap = this;
        $wrap.each(function () {
            var $this = $(this),
                defaultAction = $this.attr('href'),
                $dnnDialog;

            if (defaultAction || opts.isButton) {
                $dnnDialog = $("<div class='dnnDialog'></div>").html(opts.text).dialog(opts);
                $dnnDialog.parent().find('.ui-dialog-titlebar-close').html('Close');
                $this.click(function (e, isTrigger) {
                    if (isTrigger) {
                        return true;
                    }

                    if ($dnnDialog.is(':visible')) {
                        $dnnDialog.dialog("close");
                        return true;
                    }
                    $dnnDialog.dialog({
                        open: function () {
                            $('.ui-dialog-buttonpane').find('button:contains("' + opts.noText + '")').addClass('dnnConfirmCancel');
                        },
                        draggable: false,
                        buttons: [
                        {
                            text: opts.yesText,
                            click: function () {
                                $dnnDialog.dialog("close");
                                if ($.isFunction(opts.callbackTrue)) {
                                    opts.callbackTrue.call(this);
                                }
                                else {
                                    if (opts.isButton) {
                                        $this.trigger("click", [true]);
                                    }
                                    else {
                                        window.location.href = defaultAction;
                                    }
                                }
                            },
                            'class': opts.buttonYesClass
                        },
                        {
                            text: opts.noText,
                            click: function () {
                                $(this).dialog("close");
                                if ($.isFunction(opts.callbackFalse)) {
                                    opts.callbackFalse.call(this);
                                };
                            },
                            'class': opts.buttonNoClass
                        }
                        ]
                    });

                    $dnnDialog.dialog('open');
                    e.preventDefault();
                    return false;
                });
            }
        });
        return $wrap;
    };

    $.fn.dnnConfirm.defaultOptions = {
        text: 'Are you sure?',
        yesText: 'Yes',
        noText: 'No',
        buttonYesClass: 'dnnPrimaryAction',
        buttonNoClass: 'dnnSecondaryAction',
        actionUrl: window.location.href,
        autoOpen: false,
        resizable: false,
        modal: true,
        title: 'Confirm',
        dialogClass: 'dnnFormPopup dnnClear',
        isButton: false
    };

})(jQuery);

(function($) {
    if ($.dnnConfirm) return;

    $.dnnConfirm = function (opts) {
        var defaultAction = opts.actionUrl ? opts.actionUrl : 'javascript:void(0);';
        var shadowLink = $('<a href="' + defaultAction + '" />');
        shadowLink.dnnConfirm(opts).click();
    };
})(jQuery);

(function ($) {
    $.dnnAlert = function (options) {
        var opts = $.extend({}, $.dnnAlert.defaultOptions, options),
        $dnnDialog = $("<div class='dnnDialog'></div>").html(opts.text).dialog(opts);

        $dnnDialog.dialog({
            buttons: [
                {
                    text: opts.okText,
                    "class": opts.buttonOkClass,
                    click: function () {
                        $(this).dialog("close");
                        if ($.isFunction(opts.callback)) {
                            opts.callback.call(this);
                        };
                        return false;
                    }
                }
            ]
        });
        $dnnDialog.dialog('open');
    };

    $.dnnAlert.defaultOptions = {
        okText: 'Ok',
        autoOpen: false,
        resizable: false,
        modal: true,
        buttonOkClass: 'dnnPrimaryAction',
        dialogClass: 'dnnFormPopup dnnClear'
    };

})(jQuery);

(function ($) {
    $.fn.dnnPanels = function (options) {
        var opts = $.extend({}, $.fn.dnnPanels.defaultOptions, options),
        $wrap = this;

        $wrap.each(function () {
            var $this = $(this);
            if (typeof (opts.onExpand) === "function") {
                $this.on('onExpand', opts.onExpand);
            }
            if (typeof (opts.onHide) === "function") {
                $this.on('onHide', opts.onHide);
            }
            // wire up click event to perform slide toggle
            $this.find(opts.clickToToggleSelector).click(function (e) {
                var toggle = $(this).toggleClass(opts.toggleClass).parent().next(opts.regionToToggleSelector).slideToggle(function () {
                    var visible = $(this).is(':visible');
                    if (opts.saveState) {
                        var id = $(toggle).prev().attr("id");
                        var cookieId = id ? id.replace(/[^a-zA-Z0-9\-]+/g, "") : '';
                        if (cookieId) {
                            dnn.dom.setCookie(cookieId, visible, opts.cookieDays, '/', '', false, opts.cookieMilleseconds);
                        }
                    }
                    if (visible) {
                        $(this).trigger("onExpand");
                    }
                    else {
                        $(this).trigger("onHide");
                    }
                });

                e.preventDefault();
                e.stopImmediatePropagation();
                return false;
            });

            function collapsePanel($clicker, $region) {
                $clicker.removeClass(opts.toggleClass);
                $region.hide();
                $this.trigger("onHide");
            }

            function expandPanel($clicker, $region) {
                $clicker.addClass(opts.toggleClass);
                $region.show();
                $this.trigger("onExpand");
            }

            // walk over each selector and expand or collapse as necessary
            $this.find(opts.sectionHeadSelector).each(function (indexInArray, valueOfElement) {
                var $self = $(valueOfElement),
                    elementId = $self.attr("id"),
                    cookieId = elementId ? elementId.replace(/[^a-zA-Z0-9\-]+/g, "") : '',
                    cookieValue = cookieId ? dnn.dom.getCookie(cookieId) : '',
                    $clicker = $self.find(opts.clickToToggleIsolatedSelector),
                    $region = $self.next(opts.regionToToggleSelector),
                    $parentSeparator = $self.parents(opts.panelSeparatorSelector),
                    groupPanelIndex = $parentSeparator.find(opts.sectionHeadSelector).index($self);

                // default value
                var isOpen = false;
                if ((indexInArray === 0 && opts.defaultState == "first") || // cookie set to true OR first panel
                    ($parentSeparator.length > 0 && groupPanelIndex === 0 && opts.defaultState == "first") || // grouping is used & its the first panel in its group
                    (opts.defaultState == "open"))  // default open
                {
                    isOpen = true;
                }
                if (opts.saveState) {
                    if (cookieValue == "true") {
                        isOpen = true;
                    }
                    else if (cookieValue == "false") {
                        isOpen = false;
                    }
                }

                if (isOpen) {
                    expandPanel($clicker, $region);
                }
                else {
                    collapsePanel($clicker, $region);
                }
            });

            // page validation integration - expand collapsed panels that contain tripped validators
            $this.find(opts.validationTriggerSelector).click(function () {
                if (typeof window.Page_ClientValidate != "undefined" && $.isFunction(window.Page_ClientValidate)) {
                    if (!window.Page_ClientValidate(opts.validationGroup)) {
                        $this.find(opts.invalidItemSelector).each(function () {
                            var $parent = $(this).closest(opts.regionToToggleSelector);
                            if ($parent.is(':hidden')) {
                                $parent.prev(opts.sectionHeadSelector).find(opts.clickToToggleIsolatedSelector).click();
                            }
                        });
                    }
                }
            });
        });
        return $wrap;
    };

    $.fn.dnnPanels.defaultOptions = {
        clickToToggleSelector: 'h2.dnnFormSectionHead a',
        sectionHeadSelector: '.dnnFormSectionHead',
        regionToToggleSelector: 'fieldset',
        toggleClass: 'dnnSectionExpanded',
        clickToToggleIsolatedSelector: 'a',
        validationTriggerSelector: '.dnnPrimaryAction',
        invalidItemSelector: '.dnnFormError[style*="inline"]',
        validationGroup: '',
        panelSeparatorSelector: '.ui-tabs-panel',
        cookieDays: 0,
        cookieMilleseconds: 1200000, // twenty minutes
        saveState: true,
        defaultState: 'first' // open | closed | first
    };

})(jQuery);

(function ($) {
    $.fn.dnnPreview = function (options) {
        var opts = $.extend({}, $.fn.dnnPreview.defaultOptions, options),
        $wrap = this;

        $wrap.each(function () {
            var $this = $(this);
            $this.find(opts.linkSelector).click(function (e) {
                e.preventDefault();
                var params = "?";
                var skin, container;

                if (opts.useComboBox) {
                    var skinComboBox = $('#' + opts.skinSelector);
                    var containerComboBox = $('#' + opts.containerSelector);;

                    skin = skinComboBox.length ? skinComboBox[0].selectize.getValue() : '';
                    container = containerComboBox.length ? containerComboBox[0].selectize.getValue() : '';
                }
                else {
                    skin = $this.find(opts.skinSelector).val();
                    container = $this.find(opts.containerSelector).val();
                }
                if (skin) {
                    params += "SkinSrc=" + skin;
                }
                if (container) {
                    if (skin) {
                        params += "&";
                    }
                    params += "ContainerSrc=" + container;
                }
                if (opts.ModuleId) {
                    if (params !== "?") {
                        params += "&ModuleID=" + opts.ModuleId;
                    } else {
                        params += "ModuleID=" + opts.ModuleId;
                    }
                }
                if (params != "?") {
                    window.open(encodeURI(opts.baseUrl + params.replace(/.ascx/gi, '')), "skinpreview");
                }
                else {
                    $.dnnAlert({ text: opts.noSelectionMessage, okText: opts.alertOkText, closeText: opts.alertCloseText });
                }
            });
        });

        return $wrap;
    };

    $.fn.dnnPreview.defaultOptions = {
        baseUrl: window.location.protocol + "//" + window.location.host + window.location.pathname,
        linkSelector: 'a.dnnSecondaryAction',
        skinSelector: '',
        containerSelector: '',
        noSelectionMessage: 'Please select a preview option.',
        alertOkText: 'Ok',
        alertCloseText: 'close',
        useComboBox: false
    };

})(jQuery);

(function ($) {
    $.fn.dnnExpandAll = function (options) {
        var opts = $.extend({}, $.fn.dnnExpandAll.defaultOptions, options),
        $elem = this;

        if (($(opts.targetArea).find(opts.targetSelector + ':visible').length ===
            $(opts.targetArea).find(opts.targetSelector + opts.targetExpandedSelector + ':visible').length)
            && !$(this).hasClass('expanded')) {
            $(this).addClass('expanded').text(opts.collapseText);
        }

        $elem.click(function (e) {
            e.preventDefault();
            var $this = $(this);
            if ($this.hasClass('expanded')) {
                $this.removeClass('expanded').text(opts.expandText);
                $(opts.targetArea).find(opts.targetSelector + opts.targetExpandedSelector + ':visible').click();
            }
            else {
                $this.addClass('expanded').text(opts.collapseText);
                $(opts.targetArea).find(opts.targetSelector + ':visible').not(opts.targetExpandedSelector).click();
            }

            //stop event from called again
            e.stopImmediatePropagation();
        });

        return $elem;
    };
    $.fn.dnnExpandAll.defaultOptions = {
        expandText: 'Expand All',
        collapseText: 'Collapse All',
        targetArea: '#dnnHostSettings',
        targetSelector: 'h2.dnnFormSectionHead a',
        targetExpandedSelector: '.dnnSectionExpanded'
    };
})(jQuery);

(function ($) {
    $.fn.dnnTooltip = function (options) {
        var opts = $.extend({}, $.fn.dnnTooltip.defaultOptions, options),
        $wrap = this;

        $wrap.each(function () {
            var $this = $(this),
                dnnFormHelp = $this.prev();
            if ($this.data('initialized')) return;
            dnnFormHelp.on('click', function (e) {
                e.preventDefault();
            });
            var helpSelector = $this.find(opts.helpSelector);
            $this.parent().css({ position: 'relative' });
            $this.css({ position: 'absolute', right: '-29%' });
            var hoverOnToolTip = false, hoverOnPd = false;

            dnnFormHelp.hoverIntent({
                over: function () {
                    hoverOnPd = true;
                    var tooltipHeight = helpSelector.height();
                    var top = -(tooltipHeight + 30);
                    if ((tooltipHeight + 30) <= $this.parent().offset().top) {
                        helpSelector.parent().css({ top: top + 'px' });
                        $this.find("div.dnnFormHelpContent span").addClass("bottomArrow");
                        $this.find("div.dnnFormHelpContent span").removeClass("topArrow");

                    } else {
                        helpSelector.parent().css({ top: 30 + 'px' });                  
                        $this.find("div.dnnFormHelpContent span").addClass("topArrow");
                        $this.find("div.dnnFormHelpContent span").removeClass("bottomArrow");
                    }
                    helpSelector.css('visibility', 'visible');
                },
                out: function () {
                    hoverOnPd = false;
                    if (!$this.hasClass(opts.pinnedClass) && !hoverOnToolTip) {
                        helpSelector.css('visibility', 'hidden');
                    }
                },
                timeout: 200,
                interval: 200
            });

            helpSelector.hover(function () { hoverOnToolTip = true; }, function () {
                hoverOnToolTip = false;
                if (!$this.hasClass(opts.pinnedClass) && !hoverOnPd) {
                    helpSelector.css('visibility', 'hidden');
                }
            });

            var pinHelper = helpSelector.find(opts.pinSelector);

            pinHelper.on('click', function (e) {
                e.preventDefault();
                if ($this.hasClass(opts.pinnedClass)) {
                    helpSelector.css({ "left": '0', "top": '0' })
                        .css('visibility', 'hidden')
                        .draggable('destroy');
                    $this.removeClass(opts.pinnedClass);
                }
                else {

                    $this.addClass(opts.pinnedClass);
                    if ($.isFunction($().draggable)) {
                        helpSelector.draggable();
                    }
                }
            });

            $this.data('initialized', 1);
        });

        return $wrap;
    };

    $.fn.dnnTooltip.defaultOptions = {
        pinSelector: 'a.pinHelp',
        helpSelector: '.dnnFormHelpContent',
        pinnedClass: 'dnnTooltipPinned'
    };

})(jQuery);

(function ($) {
    var cb = function (e) {
        if (!e) e = window.event;
        e.cancelBubble = true;
        if (e.stopPropagation) e.stopPropagation();
    };

    /* DNN customized checkbox/radiobox */
    $.fn.dnnCheckbox = function (options) {
        var settings = {
            cls: 'dnnCheckbox'  /* checkbox  */
            , labelClass: 'dnnBoxLabel'
        };
        settings = $.extend(settings, options || {});

        var addEvents = function (object) {
            var checked = object.checked,
                disabled = object.disabled,
                $object = $(object);

            if (object.stateInterval)
                clearInterval(object.stateInterval);

            object.stateInterval = setInterval(
                function () {
                    if (object.disabled != disabled)
                        $object.trigger((disabled = !!object.disabled) ? 'disable' : 'enable');
                    if (object.checked != checked)
                        $object.trigger((checked = !!object.checked) ? 'check' : 'uncheck');
                },
                10 /* in miliseconds.*/
            );
            return $object;
        };

        return this.each(function () {
            var ch = this;

            if ($(ch).data("checkBoxWrapped")) {
                return;
            }
            $(ch).data("checkBoxWrapped", true);

            if ($(this).hasClass('normalCheckBox') || $(this).hasClass('normalRadioButton')) return;
            var parentCheckBoxHolder = $(this).closest('.normalCheckBox');
            var parentRadioButtonHolder = $(this).closest('.normalRadioButton');
            if (parentCheckBoxHolder.length || parentRadioButtonHolder.length) return;
            var $ch = addEvents(ch);
            if (ch.wrapper) ch.wrapper.remove();
            ch.wrapper = $('<span class="' + settings.cls + '"><span class="mark"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAMAAAAoyzS7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRFAAAAAAAApWe5zwAAAAF0Uk5TAEDm2GYAAAAMSURBVHjaYmAACDAAAAIAAU9tWeEAAAAASUVORK5CYII=" alt="checkbox" /></span></span>');
            ch.wrapperInner = ch.wrapper.children('span:eq(0)');
            ch.wrapper.hover(
                function (e) { ch.wrapperInner.addClass(settings.cls + '-hover'); cb(e); },
                function (e) { ch.wrapperInner.removeClass(settings.cls + '-hover'); cb(e); }
            );

            $ch.css({ position: 'absolute', zIndex: -1, opacity: 0 }).after(ch.wrapper);

            var label, parentLabel = false;
            label = $ch.closest('label');
            if (!label.length)
                label = false;
            else
                parentLabel = true;

            if (!label && $ch.attr('id')) {
                label = $('label[for="' + $ch.attr('id') + '"]');
                if (!label.length) label = false;
            }

            if (label) {
                label.addClass(settings.labelClass);
                if (!parentLabel) {
                    label.click(function (e) {
                        clickHandler(e);
                        return false;
                    });
                }
                else {
                    label.children().each(function () {
                        var $this = $(this);
                        if ($this.is('input')) return;

                        $this.click(function (e) {
                            clickHandler(e);
                            return false;
                        });
                    });
                }
            }

            if (!parentLabel) {
                ch.wrapper.click(function (e) {
                    clickHandler(e);
                    return false;
                });
            }

            function clickHandler(e) {
                if (ch.disabled) {
                    return;
                }
                $ch.triggerHandler('focus');
                var previousChecked = ch.checked;
                ch.click();
                if (ch.checked == previousChecked && ch.type == 'checkbox') {
                    ch.checked = !ch.checked;  //Fix for Firefox browser
                }
                $ch.trigger('change', [e]);
                cb(e);
            }

            $ch.on('disable', function () { ch.wrapperInner.addClass(settings.cls + '-disabled'); }).on('enable', function () { ch.wrapperInner.removeClass(settings.cls + '-disabled'); });
            $ch.on('check', function () { ch.wrapper.addClass(settings.cls + '-checked'); }).on('uncheck', function () { ch.wrapper.removeClass(settings.cls + '-checked'); });
            $ch.on('focus', function (e) { if (!e.isTrigger) ch.wrapper.addClass(settings.cls + '-focus'); }).on('blur', function () { ch.wrapper.removeClass(settings.cls + '-focus'); });

            /* Applying checkbox state */
            if (ch.checked)
                ch.wrapper.addClass(settings.cls + '-checked');
            if (ch.disabled)
                ch.wrapperInner.addClass(settings.cls + '-disabled');

        });
    };

    $.fn.dnnHelperTipDestroy = function () {
        return this.each(function () {
            var pd = this;
            if (pd.id) {
                $('div[data-tipholder="' + pd.id + '"]').remove();
            }
        });
    };

    $.fn.dnnHelperTip = function (options) {
        var settings = {
            cls: 'dnnHelperTip',
            helpContent: "This is hover helper tooltip",
            holderId: '',
            show: false // immediately show tooltip after call
        };
        settings = $.extend(settings, options || {});
        return this.each(function () {
            var pd = this,
                $pd = $(this);
            if (pd.tooltipWrapper) pd.tooltipWrapper.remove();

            pd.tooltipWrapper = $('<div class="' + settings.cls + '" data-tipholder="' + settings.holderId + '"> <div class="dnnFormHelpContent dnnClear"><span class="dnnHelpText">' + settings.helpContent + '</span></div></div>');
            $('body').append(pd.tooltipWrapper);
            pd.tooltipWrapper.css({ position: 'absolute' });
            pd.tooltipWrapperInner = $('.dnnFormHelpContent', pd.tooltipWrapper);

            var tooltipHeight = pd.tooltipWrapperInner.height();
            pd.tooltipWrapperInner.css({ left: '-10px', top: -(tooltipHeight + 30) + 'px' });
            var hoverOnPd = false;
            $pd.hover(
                function () {
                    hoverOnPd = true;
                    setTimeout(function () {
                        if (hoverOnPd)
                            pd.tooltipWrapperInner.css('visibility', 'visible');
                    }, 400);
                },
                function () {
                    hoverOnPd = false;
                    setTimeout(function () {
                        if (!hoverOnPd)
                            pd.tooltipWrapperInner.css('visibility', 'hidden');
                    }, 400);

                });

            if (settings.show) {
                hoverOnPd = true;
                setTimeout(function () {
                    pd.tooltipWrapperInner.css('visibility', 'visible');
                }, 400);
            }

            $pd.on('mousemove', function (e) {
                var x = e.pageX; var y = e.pageY;
                var pos = $('body').css('position');
                if (pos == 'relative') y -= 38;
                pd.tooltipWrapper.css({ left: x + 'px', top: y + 'px', 'z-index': '99999' });
            });
        });
    };

    $.fn.dnnProgressbar = function () {
        var $pd = $(this),
            pd = this;

        if (pd.tooltipWrapper) pd.tooltipWrapper.remove();
        pd.tooltipWrapper = $('<div class="dnnTooltip"> <div class="dnnFormHelpContent dnnClear"><span class="dnnHelpText"></span></div></div>').insertAfter($pd);
        pd.tooltipWrapperInner = $('.dnnFormHelpContent', pd.tooltipWrapper);
        pd.tooltipWrapperInner.css({ width: '32px', padding: '7px' });
        $pd.parent().css({ position: 'relative' });

        var hoverOnToolTip = false, hoverOnPd = false;
        $pd.hoverIntent({
            over: function () {
                hoverOnPd = true;
                var val = $(this).children(':first').progressbar('value');
                pd.update(val);
                pd.tooltipWrapperInner.css('visibility', 'visible');

            },
            out: function () {
                hoverOnPd = false;
                if (!hoverOnToolTip) {
                    pd.tooltipWrapperInner.css('visibility', 'hidden');
                }
            },
            timeout: 200,
            interval: 200
        });

        pd.tooltipWrapperInner.hover(function () { hoverOnToolTip = true; }, function () {
            hoverOnToolTip = false;
            if (!hoverOnPd) {
                pd.tooltipWrapperInner.hide();
            }
        });

        pd.update = function (value) {
            pd.tooltipWrapperInner.find('span').html(value + ' %');
            var pdTop = $pd.position().top,
			    tooltipHeight = pd.tooltipWrapperInner.height();

            pdTop -= (tooltipHeight + 10);
            var pdLeft = value > 50 ? (value - 4) + '%' : value > 0 ? (value - 2) + '%' : '10px';
            pd.tooltipWrapper.css({ position: 'absolute', left: pdLeft, top: pdTop + 'px' });
        };

        return this;
    };

    $.fn.dnnSpinner = function (options) {
        var opt = $.extend({
            type: 'range',
            typedata: '',
            width: '150px',
            looping: false
        }, options);

        var otypedata;

        if (options != null && options.typedata != null) {
            otypedata = $.extend({
                min: 1,
                max: 10,
                interval: 1,
                decimalplaces: 0
            }, options.typedata);
        }
        else {
            otypedata = $.extend({
                min: 1,
                max: 10,
                interval: 1,
                decimalplaces: 0
            });
        }
        opt.typedata = otypedata;

        var inputControl = this;
        if (!inputControl.is(':text'))
            return inputControl;

        if (inputControl.hasClass('dnnSpinnerInput')) {
            return inputControl;
        }
        else {
            inputControl.addClass('dnnSpinnerInput');
        }

        var strContainerDiv = '';
        strContainerDiv += '<div class="dnnSpinner">';
        strContainerDiv += '<div class="dnnSpinnerDisplay"></div>';
        strContainerDiv += '<div class="dnnSpinnerCtrl">';
        strContainerDiv += '<a class="dnnSpinnerTopButton"></a>';
        strContainerDiv += '<a class="dnnSpinnerBotButton"></a>';
        strContainerDiv += '</div></div>';
        var objContainerDiv = $(strContainerDiv).insertAfter(inputControl);
        inputControl.insertAfter($("div.dnnSpinnerDisplay", objContainerDiv));
        $("div.dnnSpinnerDisplay", objContainerDiv).click(function () {
            if (opt.type == 'range') {
                var displayCtrl = $(this);
                var innerInput = $('input[type="text"]', displayCtrl);
                if (innerInput.length < 1) {
                    var originalVal = displayCtrl.html();
                    innerInput = $('<input type="text" />').val(originalVal);
                    displayCtrl.html(innerInput);
                    innerInput.blur(function () {
                        var newVal = $(this).val();
                        if (newVal > opt.typedata.max) {
                            newVal = opt.typedata.max;
                        }
                        if (newVal < opt.typedata.min) {
                            newVal = opt.typedata.min;
                        }
                        $(this).remove();
                        selectedValue = parseInt(newVal);
                        inputControl.val(newVal);
                        displayCtrl.html(newVal);
                    }).keypress(function (e) {
                        var regex = new RegExp("^[0-9]+$");
                        var key = String.fromCharCode(!e.charCode ? e.which : e.charCode);
                        if (!regex.test(key)) {
                            event.preventDefault();
                            return false;
                        }
                        return true;
                    });
                }
                innerInput.focus();
            }

            inputControl.triggerHandler('focus');
        });
        inputControl.css('display', 'none');

        switch (opt.type) {
            case 'range':
                if (opt.defaultVal < opt.typedata.min || opt.defaultVal > opt.typedata.max) {
                    opt.defaultVal = opt.typedata.min;
                }
                if (opt.defaultVal % opt.typedata.interval > 0) {
                    opt.defaultVal = parseInt((opt.defaultVal / opt.typedata.interval).toFixed(0)) * opt.typedata.interval;
                }
                inputControl.val(opt.defaultVal.toFixed(opt.typedata.decimalplaces));
                ($("div.dnnSpinnerDisplay", objContainerDiv)).html(opt.defaultVal.toFixed(opt.typedata.decimalplaces));
                var selectedValue = opt.defaultVal;
                if ((opt.typedata.max - opt.typedata.min) > opt.typedata.interval) {
                    $("a.dnnSpinnerTopButton", objContainerDiv).click(function () {

                        if ((selectedValue + opt.typedata.interval) <= opt.typedata.max || opt.looping) {
                            if ((selectedValue + opt.typedata.interval) > opt.typedata.max) {
                                selectedValue = opt.typedata.min - opt.typedata.interval;
                            }
                            var valueData = (selectedValue + opt.typedata.interval).toFixed(opt.typedata.decimalplaces);
                            selectedValue += opt.typedata.interval;
                            ($("div.dnnSpinnerDisplay", objContainerDiv)).html(valueData);
                            inputControl.val(valueData);
                        }
                        inputControl.triggerHandler('focus');
                        return false;
                    });

                    $("a.dnnSpinnerBotButton", objContainerDiv).click(function () {
                        if ((selectedValue - opt.typedata.interval) >= opt.typedata.min || opt.looping) {
                            if ((selectedValue - opt.typedata.interval) < opt.typedata.min) {
                                selectedValue = opt.typedata.max + opt.typedata.interval;
                            }
                            var valueData = (selectedValue - opt.typedata.interval).toFixed(opt.typedata.decimalplaces);
                            selectedValue -= opt.typedata.interval;
                            ($("div.dnnSpinnerDisplay", objContainerDiv)).html(valueData);
                            inputControl.val(valueData);
                        }
                        inputControl.triggerHandler('focus');
                        return false;
                    });
                }

                break;
            case 'list':
                if (!opt.typedata.list || opt.typedata.list.lenght == 0) {
                    return inputControl;
                }

                var listItems = opt.typedata.list.split(',');
                var selectedIndex = jQuery.inArray(opt.defaultVal, listItems);
                if (selectedIndex < 0) {
                    selectedIndex = 0;
                    opt.defaultVal = listItems[0];
                }

                inputControl.val(opt.defaultVal);
                ($("div.dnnSpinnerDisplay", objContainerDiv)).html(opt.defaultVal);

                if (listItems.length > 1) {
                    // attach events;
                    $("a.dnnSpinnerBotButton", objContainerDiv).click(function () {
                        if (selectedIndex < (listItems.length - 1) || opt.looping) {
                            if (selectedIndex == listItems.length - 1) {
                                selectedIndex = -1;
                            }
                            selectedIndex++;
                            var valueData = listItems[selectedIndex];
                            ($("div.dnnSpinnerDisplay", objContainerDiv)).html(valueData);
                            inputControl.val(valueData);
                        }
                        inputControl.triggerHandler('focus');
                        return false;
                    });

                    $("a.dnnSpinnerTopButton", objContainerDiv).click(function () {
                        if (selectedIndex > 0 || opt.looping) {
                            if (selectedIndex == 0) {
                                selectedIndex = listItems.length;
                            }
                            selectedIndex--;
                            var valueData = listItems[selectedIndex];
                            ($("div.dnnSpinnerDisplay", objContainerDiv)).html(valueData);
                            inputControl.val(valueData);
                        }
                        inputControl.triggerHandler('focus');
                        return false;
                    });
                }

                break;
        };
        return inputControl;
    };
})(jQuery);

(function ($) {
    $.fn.dnnAutocomplete = function (options) {
        var url;
        if (arguments.length > 1) {
            url = options;
            options = arguments[1];
            options.url = url;
        } else if (typeof options === 'string') {
            url = options;
            options = { url: url };
        }
        var opts = $.extend({}, $.fn.dnnAutocomplete.defaults, options);
        return this.each(function () {
            var $this = $(this);
            $this.data('autocompleter', new $.dnnAutocompleter(
                $this,
                $.meta ? $.extend({}, opts, $this.data()) : opts
            ));
        });
    };

    $.fn.dnnAutocomplete.defaults = {
        inputClass: 'dnn_acInput',
        loadingClass: 'dnn_acLoading',
        resultsClass: 'dnn_acResults',
        selectClass: 'dnn_acSelect',
        queryParamName: 'q',
        contentTypeParamName: 'contentTypeId',
        extraParams: {},
        remoteDataType: false,
        lineSeparator: '\n',
        cellSeparator: '|',
        minChars: 2,
        maxItemsToShow: 10,
        delay: 400,
        useCache: false,
        maxCacheLength: 10,
        matchSubset: true,
        matchCase: false,
        matchInside: true,
        mustMatch: false,
        selectFirst: false,
        selectOnly: false,
        showResult: null,
        preventDefaultReturn: 1,
        preventDefaultTab: 0,
        autoFill: false,
        filterResults: true,
        sortResults: true,
        sortFunction: null,
        onItemSelect: null,
        onNoMatch: null,
        onFinish: null,
        matchStringConverter: null,
        beforeUseConverter: null,
        autoWidth: 'min-width',
        useDelimiter: false,
        delimiterChar: ',',
        delimiterKeyCode: 188,
        processData: null,
        onError: null,
        moduleId: null // dnn Module Id context if needed
    };

    var sanitizeResult = function (result) {
        var value, data;
        var type = typeof result;
        if (type === 'string') {
            value = result;
            data = {};
        } else if ($.isArray(result)) {
            value = result[0];
            data = result.slice(1);
        } else if (type === 'object') {
            value = result.value;
            data = result.data;
        } else value = '';
        value = String(value);
        if (typeof data !== 'object') {
            data = {};
        }
        return {
            value: value,
            data: data
        };
    };

    var sanitizeInteger = function (value, stdValue, options) {
        var num = parseInt(value, 10);
        options = options || {};
        if (isNaN(num) || (options.min && num < options.min)) {
            num = stdValue;
        }
        return num;
    };

    var makeUrlParam = function (name, value) {
        return [name, encodeURIComponent(value)].join('=');
    };

    var makeUrl = function (url, params) {
        var urlAppend = [];
        $.each(params, function (index, value) {
            urlAppend.push(makeUrlParam(index, value));
        });
        if (urlAppend.length) {
            url += url.indexOf('?') === -1 ? '?' : '&';
            url += urlAppend.join('&');
        }
        return url;
    };

    var sortValueAlpha = function (a, b, matchCase) {
        a = String(a.value);
        b = String(b.value);
        if (!matchCase) {
            a = a.toLowerCase();
            b = b.toLowerCase();
        }
        if (a > b) {
            return 1;
        }
        if (a < b) {
            return -1;
        }
        return 0;
    };

    $.dnnAutocompleter = function ($elem, options) {

        if (!$elem || !($elem instanceof $) || $elem.length !== 1 || $elem.get(0).tagName.toUpperCase() !== 'INPUT') {
            throw new Error('Invalid parameter for dnnAutocompleter, jQuery object with one element with INPUT tag expected.');
        }

        var self = this;
        this.options = options;
        this.cacheData_ = {};
        this.cacheLength_ = 0;
        this.selectClass_ = 'jquery-autocomplete-selected-item';
        this.keyTimeout_ = null;
        this.finishTimeout_ = null;
        this.lastKeyPressed_ = null;
        this.lastProcessedValue_ = null;
        this.lastSelectedValue_ = null;
        this.active_ = false;
        this.finishOnBlur_ = true;

        this.options.minChars = sanitizeInteger(this.options.minChars, $.fn.dnnAutocomplete.defaults.minChars, { min: 0 });
        this.options.maxItemsToShow = sanitizeInteger(this.options.maxItemsToShow, $.fn.dnnAutocomplete.defaults.maxItemsToShow, { min: 0 });
        this.options.maxCacheLength = sanitizeInteger(this.options.maxCacheLength, $.fn.dnnAutocomplete.defaults.maxCacheLength, { min: 1 });
        this.options.delay = sanitizeInteger(this.options.delay, $.fn.dnnAutocomplete.defaults.delay, { min: 0 });
        if (this.options.preventDefaultReturn != 2) {
            this.options.preventDefaultReturn = this.options.preventDefaultReturn ? 1 : 0;
        }
        if (this.options.preventDefaultTab != 2) {
            this.options.preventDefaultTab = this.options.preventDefaultTab ? 1 : 0;
        }

        this.dom = {};
        this.dom.$elem = $elem;
        this.dom.$elem.attr('autocomplete', 'off').addClass(this.options.inputClass);
        this.dom.$results = $('<div></div>').hide().addClass(this.options.resultsClass).css({
            position: 'absolute'
        });
        $('body').append(this.dom.$results);
        $elem.keydown(function (e) {
            self.lastKeyPressed_ = e.keyCode;
            switch (self.lastKeyPressed_) {
                case self.options.delimiterKeyCode: // comma = 188
                    if (self.options.useDelimiter && self.active_) {
                        self.selectCurrent();
                    }
                    break;

                    // ignore navigational & special keys
                case 35: // end
                case 36: // home
                case 16: // shift
                case 17: // ctrl
                case 18: // alt
                case 37: // left
                case 39: // right
                    break;

                case 38: // up
                    e.preventDefault();
                    if (self.active_) {
                        self.focusPrev();
                    } else {
                        self.activate();
                    }
                    return false;

                case 40: // down
                    e.preventDefault();
                    if (self.active_) {
                        self.focusNext();
                    } else {
                        self.activate();
                    }
                    return false;

                case 9: // tab
                    if (self.active_) {
                        self.selectCurrent();
                        if (self.options.preventDefaultTab) {
                            e.preventDefault();
                            return false;
                        }
                    }
                    if (self.options.preventDefaultTab === 2) {
                        e.preventDefault();
                        return false;
                    }
                    break;

                case 13: // return
                    if (self.active_) {
                        self.selectCurrent();
                        if (self.options.preventDefaultReturn) {
                            e.preventDefault();
                            return false;
                        }
                    }
                    if (self.options.preventDefaultReturn === 2) {
                        e.preventDefault();
                        return false;
                    }
                    break;

                case 27: // escape
                    if (self.active_) {
                        e.preventDefault();
                        self.deactivate(true);
                        return false;
                    }
                    break;

                default:
                    self.activate();

            }
            return true;
        });

        var onBlurFunction = function () {
            self.deactivate(true);
        };
        $elem.blur(function () {
            if (self.finishOnBlur_) {
                self.finishTimeout_ = setTimeout(onBlurFunction, 1000);
            }
        });

        $elem.parents('form').on('submit', onBlurFunction);

    };

    $.dnnAutocompleter.prototype.position = function () {
        var offset = this.dom.$elem.offset();
        var height = this.dom.$results.outerHeight();
        var totalHeight = window.outerHeight;
        var inputBottom = offset.top + this.dom.$elem.outerHeight();
        var bottomIfDown = inputBottom + height;
        // Set autocomplete results at the bottom of input
        var position = { top: inputBottom, left: offset.left };
        if (bottomIfDown > totalHeight) {
            // Try to set autocomplete results at the top of input
            var topIfUp = offset.top - height;
            if (topIfUp >= 0) {
                position.top = topIfUp;
            }
        }
        this.dom.$results.css(position);
    };

    $.dnnAutocompleter.prototype.cacheRead = function (filter) {
        var filterLength, searchLength, search, maxPos, pos;
        if (this.options.useCache) {
            filter = String(filter);
            filterLength = filter.length;
            if (this.options.matchSubset) {
                searchLength = 1;
            } else {
                searchLength = filterLength;
            }
            while (searchLength <= filterLength) {
                if (this.options.matchInside) {
                    maxPos = filterLength - searchLength;
                } else {
                    maxPos = 0;
                }
                pos = 0;
                while (pos <= maxPos) {
                    search = filter.substr(0, searchLength);
                    if (this.cacheData_[search] !== undefined) {
                        return this.cacheData_[search];
                    }
                    pos++;
                }
                searchLength++;
            }
        }
        return false;
    };

    $.dnnAutocompleter.prototype.cacheWrite = function (filter, data) {
        if (this.options.useCache) {
            if (this.cacheLength_ >= this.options.maxCacheLength) {
                this.cacheFlush();
            }
            filter = String(filter);
            if (this.cacheData_[filter] !== undefined) {
                this.cacheLength_++;
            }
            this.cacheData_[filter] = data;
            return this.cacheData_[filter];
        }
        return false;
    };

    $.dnnAutocompleter.prototype.cacheFlush = function () {
        this.cacheData_ = {};
        this.cacheLength_ = 0;
    };

    $.dnnAutocompleter.prototype.callHook = function (hook, data) {
        var f = this.options[hook];
        if (f && $.isFunction(f)) {
            return f(data, this);
        }
        return false;
    };

    $.dnnAutocompleter.prototype.activate = function () {
        var self = this;
        if (this.keyTimeout_) {
            clearTimeout(this.keyTimeout_);
        }
        this.keyTimeout_ = setTimeout(function () {
            self.activateNow();
        }, this.options.delay);
    };

    $.dnnAutocompleter.prototype.activateNow = function () {
        var value = this.beforeUseConverter(this.dom.$elem.val());
        if (value !== this.lastProcessedValue_ && value !== this.lastSelectedValue_) {
            this.fetchData(value);
        }
    };

    $.dnnAutocompleter.prototype.fetchData = function (value) {
        var self = this;
        var processResults = function (results, filter) {
            if (self.options.processData) {
                results = self.options.processData(results);
            }
            self.showResults(self.filterResults(results, filter), filter);
        };
        this.lastProcessedValue_ = value;
        if (value.length < this.options.minChars) {
            processResults([], value);
        } else if (this.options.data) {
            processResults(this.options.data, value);
        } else {
            this.fetchRemoteData(value, function (remoteData) {
                processResults(remoteData, value);
            });
        }
    };

    $.dnnAutocompleter.prototype.fetchRemoteData = function (filter, callback) {
        var data = this.cacheRead(filter);
        if (data) {
            callback(data);
        } else {
            var self = this;
            var ajaxCallback = function (d) {
                var parsed = false;
                if (d !== false) {
                    parsed = self.parseRemoteData(d);
                    self.cacheWrite(filter, parsed);
                }
                self.dom.$elem.removeClass(self.options.loadingClass);
                callback(parsed);
            };

            this.dom.$elem.addClass(this.options.loadingClass);
            // DNN service framework attached if needed
            var services = self.options.moduleId ? ($.dnnSF ? $.dnnSF(self.options.moduleId) : null) : null;
            $.ajax({
                url: this.makeUrl(filter),
                beforeSend: services ? services.setModuleHeaders : null,
                success: ajaxCallback,
                error: function (jqXhr, textStatus, errorThrown) {
                    if ($.isFunction(self.options.onError)) {
                        self.options.onError(jqXhr, textStatus, errorThrown);
                    } else {
                        ajaxCallback(false);
                    }
                },
                type: 'GET',
                dataType: 'json',
                contentType: "application/json"
            });
        }
    };

    $.dnnAutocompleter.prototype.setExtraParam = function (name, value) {
        var index = $.trim(String(name));
        if (index) {
            if (!this.options.extraParams) {
                this.options.extraParams = {};
            }
            if (this.options.extraParams[index] !== value) {
                this.options.extraParams[index] = value;
                this.cacheFlush();
            }
        }
    };

    $.dnnAutocompleter.prototype.makeUrl = function (param) {
        var url = this.options.url;
        var params = {};
        params[this.options.queryParamName] = param;
        return makeUrl(url, params);
    };

    $.dnnAutocompleter.prototype.parseRemoteData = function (remoteData) {
        var data = remoteData;
        if (typeof data['d'] != 'undefined') {
            data = $.parseJSON(data['d']);
        }
        return data;
    };

    $.dnnAutocompleter.prototype.filterResult = function (result, filter) {
        if (!result.value) {
            return false;
        }
        if (this.options.filterResults) {
            var pattern = this.matchStringConverter(filter);
            var testValue = this.matchStringConverter(result.value);
            if (!this.options.matchCase) {
                pattern = pattern.toLowerCase();
                testValue = testValue.toLowerCase();
            }
            var patternIndex = testValue.indexOf(pattern);
            if (this.options.matchInside) {
                return patternIndex > -1;
            } else {
                return patternIndex === 0;
            }
        }
        return true;
    };

    $.dnnAutocompleter.prototype.filterResults = function (results, filter) {
        var filtered = [];
        var i, result;

        for (i = 0; i < results.length; i++) {
            result = sanitizeResult(results[i]);
            if (this.filterResult(result, filter)) {
                filtered.push(result);
            }
        }
        if (this.options.sortResults) {
            filtered = this.sortResults(filtered, filter);
        }
        if (this.options.maxItemsToShow > 0 && this.options.maxItemsToShow < filtered.length) {
            filtered.length = this.options.maxItemsToShow;
        }
        return filtered;
    };

    $.dnnAutocompleter.prototype.sortResults = function (results, filter) {
        var self = this;
        var sortFunction = this.options.sortFunction;
        if (!$.isFunction(sortFunction)) {
            sortFunction = function (a, b) {
                return sortValueAlpha(a, b, self.options.matchCase);
            };
        }
        results.sort(function (a, b) {
            return sortFunction(a, b, filter, self.options);
        });
        return results;
    };

    $.dnnAutocompleter.prototype.matchStringConverter = function (s, a, b) {
        var converter = this.options.matchStringConverter;
        if ($.isFunction(converter)) {
            s = converter(s, a, b);
        }
        return s;
    };

    $.dnnAutocompleter.prototype.beforeUseConverter = function (s, a, b) {
        s = this.getValue();
        var converter = this.options.beforeUseConverter;
        if ($.isFunction(converter)) {
            s = converter(s, a, b);
        }
        return s;
    };

    $.dnnAutocompleter.prototype.enableFinishOnBlur = function () {
        this.finishOnBlur_ = true;
    };

    $.dnnAutocompleter.prototype.disableFinishOnBlur = function () {
        this.finishOnBlur_ = false;
    };

    $.dnnAutocompleter.prototype.createItemFromResult = function (result, filter) {
        var self = this;
        var $li = $('<li>' + this.showResult(result.value, result.data, filter) + '</li>');
        $li.data({ value: result.value, data: result.data })
            .click(function () {
                self.selectItem($li);
            })
            .mousedown(self.disableFinishOnBlur)
            .mouseup(self.enableFinishOnBlur)
        ;
        return $li;
    };

    $.dnnAutocompleter.prototype.getItems = function () {
        return $('>ul>li', this.dom.$results);
    };

    $.dnnAutocompleter.prototype.showResults = function (results, filter) {
        var numResults = results.length;
        var self = this;
        var $ul = $('<ul></ul>');
        var i, result, $li, autoWidth, first = false, $first = false;

        if (numResults) {
            for (i = 0; i < numResults; i++) {
                result = results[i];
                $li = this.createItemFromResult(result, filter);
                $ul.append($li);
                if (first === false) {
                    first = String(result.value);
                    $first = $li;
                    $li.addClass(this.options.firstItemClass);
                }
                if (i === numResults - 1) {
                    $li.addClass(this.options.lastItemClass);
                }
            }

            this.dom.$results.html($ul).show();

            // Always recalculate position since window size or
            // input element location may have changed.
            this.position();
            if (this.options.autoWidth) {
                autoWidth = this.dom.$elem.outerWidth() - this.dom.$results.outerWidth() + this.dom.$results.width();
                this.dom.$results.css(this.options.autoWidth, autoWidth);
            }
            this.getItems().hover(
                function () { self.focusItem(this); },
                function () { /* void */ }
            );
            if (this.autoFill(first, filter) || this.options.selectFirst || (this.options.selectOnly && numResults === 1)) {
                this.focusItem($first);
            }
            this.active_ = true;

            //Select the first one as default
            this.focusNext();

        } else {
            this.hideResults();
            this.active_ = false;
        }
    };

    $.dnnAutocompleter.prototype.showResult = function (value, data, filter) {
        if ($.isFunction(this.options.showResult)) {
            return this.options.showResult(value, data);
        } else {
            // add highlight keywords
            var regex = new RegExp('(' + filter + ')', 'gi');
            return value.replace(regex, function ($0, $1) {
                return ('<b>' + $1 + '</b>');
            });
        }
    };

    $.dnnAutocompleter.prototype.autoFill = function (value, filter) {
        var lcValue, lcFilter, valueLength, filterLength;
        if (this.options.autoFill && this.lastKeyPressed_ !== 8) {
            lcValue = String(value).toLowerCase();
            lcFilter = String(filter).toLowerCase();
            valueLength = value.length;
            filterLength = filter.length;
            if (lcValue.substr(0, filterLength) === lcFilter) {
                var d = this.getDelimiterOffsets();
                var pad = d.start ? ' ' : ''; // if there is a preceding delimiter
                this.setValue(pad + value);
                var start = filterLength + d.start + pad.length;
                var end = valueLength + d.start + pad.length;
                this.selectRange(start, end);
                return true;
            }
        }
        return false;
    };

    $.dnnAutocompleter.prototype.focusNext = function () {
        this.focusMove(+1);
    };

    $.dnnAutocompleter.prototype.focusPrev = function () {
        this.focusMove(-1);
    };

    $.dnnAutocompleter.prototype.focusMove = function (modifier) {
        var $items = this.getItems();
        modifier = sanitizeInteger(modifier, 0);
        if (modifier) {
            for (var i = 0; i < $items.length; i++) {
                if ($($items[i]).hasClass(this.selectClass_)) {
                    this.focusItem(i + modifier);
                    return;
                }
            }
        }
        this.focusItem(0);
    };

    $.dnnAutocompleter.prototype.focusItem = function (item) {
        var $item, $items = this.getItems();
        if ($items.length) {
            $items.removeClass(this.selectClass_).removeClass(this.options.selectClass);
            if (typeof item === 'number') {
                if (item < 0) {
                    item = 0;
                } else if (item >= $items.length) {
                    item = $items.length - 1;
                }
                $item = $($items[item]);
            } else {
                $item = $(item);
            }
            if ($item) {
                $item.addClass(this.selectClass_).addClass(this.options.selectClass);
            }
        }
    };

    $.dnnAutocompleter.prototype.selectCurrent = function () {
        var $item = $('li.' + this.selectClass_, this.dom.$results);
        if ($item.length === 1) {
            this.selectItem($item);
        } else {
            this.deactivate(false);
        }
    };

    $.dnnAutocompleter.prototype.selectItem = function ($li) {
        var value = $li.data('value');
        var data = $li.data('data');
        var displayValue = this.displayValue(value, data);
        var processedDisplayValue = this.beforeUseConverter(displayValue);
        this.lastProcessedValue_ = processedDisplayValue;
        this.lastSelectedValue_ = processedDisplayValue;
        var d = this.getDelimiterOffsets();
        var delimiter = this.options.delimiterChar;
        var elem = this.dom.$elem;
        var extraCaretPos = 0;
        if (this.options.useDelimiter) {
            // if there is a preceding delimiter, add a space after the delimiter
            if (elem.val().substring(d.start - 1, d.start) == delimiter && delimiter != ' ') {
                displayValue = ' ' + displayValue;
            }
            // if there is not already a delimiter trailing this value, add it
            if (elem.val().substring(d.end, d.end + 1) != delimiter && this.lastKeyPressed_ != this.options.delimiterKeyCode) {
                displayValue = displayValue + delimiter;
            } else {
                // move the cursor after the existing trailing delimiter
                extraCaretPos = 1;
            }
        }
        this.setValue(displayValue);
        this.setCaret(d.start + displayValue.length + extraCaretPos);
        this.callHook('onItemSelect', { value: value, data: data });
        this.deactivate(true);
        elem.trigger('result', value);
    };

    $.dnnAutocompleter.prototype.displayValue = function (value, data) {
        if ($.isFunction(this.options.displayValue)) {
            return this.options.displayValue(value, data);
        }
        return value;
    };

    $.dnnAutocompleter.prototype.hideResults = function () {
        this.dom.$results.hide();
    };

    $.dnnAutocompleter.prototype.deactivate = function (finish) {
        if (this.finishTimeout_) {
            clearTimeout(this.finishTimeout_);
        }
        if (this.keyTimeout_) {
            clearTimeout(this.keyTimeout_);
        }
        if (finish) {
            if (this.lastProcessedValue_ !== this.lastSelectedValue_) {
                if (this.options.mustMatch) {
                    this.setValue('');
                }
                this.callHook('onNoMatch');
            }
            if (this.active_) {
                this.callHook('onFinish');
            }
            this.lastKeyPressed_ = null;
            this.lastProcessedValue_ = null;
            this.lastSelectedValue_ = null;
            this.active_ = false;
        }
        this.hideResults();
    };

    $.dnnAutocompleter.prototype.selectRange = function (start, end) {
        var input = this.dom.$elem.get(0);
        if (input.setSelectionRange) {
            input.focus();
            input.setSelectionRange(start, end);
        } else if (input.createTextRange) {
            var range = input.createTextRange();
            range.collapse(true);
            range.moveEnd('character', end);
            range.moveStart('character', start);
            range.select();
        }
    };

    $.dnnAutocompleter.prototype.setCaret = function (pos) {
        this.selectRange(pos, pos);
    };

    $.dnnAutocompleter.prototype.getCaret = function () {
        var elem = this.dom.$elem, s, e, range;
        if (!$.support.cssFloat) {
            // ie
            var selection = document.selection;
            if (elem[0].tagName.toLowerCase() != 'textarea') {
                var val = elem.val();
                range = selection.createRange().duplicate();
                range.moveEnd('character', val.length);
                s = (range.text == '' ? val.length : val.lastIndexOf(range.text));
                range = selection.createRange().duplicate();
                range.moveStart('character', -val.length);
                e = range.text.length;
            } else {
                range = selection.createRange();
                var storedRange = range.duplicate();
                storedRange.moveToElementText(elem[0]);
                storedRange.setEndPoint('EndToEnd', range);
                s = storedRange.text.length - range.text.length;
                e = s + range.text.length;
            }
        } else {
            // ff, chrome, safari
            s = elem[0].selectionStart;
            e = elem[0].selectionEnd;
        }
        return {
            start: s,
            end: e
        };
    };

    $.dnnAutocompleter.prototype.setValue = function (value) {
        if (this.options.useDelimiter) {
            // set the substring between the current delimiters
            var val = this.dom.$elem.val();
            var d = this.getDelimiterOffsets();
            var preVal = val.substring(0, d.start);
            var postVal = val.substring(d.end);
            value = preVal + value + postVal;
        }
        this.dom.$elem.val(value).blur();
    };

    $.dnnAutocompleter.prototype.getValue = function () {
        var val = this.dom.$elem.val();
        if (this.options.useDelimiter) {
            var d = this.getDelimiterOffsets();
            return val.substring(d.start, d.end).trim();
        } else {
            return val;
        }
    };

    $.dnnAutocompleter.prototype.getDelimiterOffsets = function () {
        var val = this.dom.$elem.val();
        if (this.options.useDelimiter) {
            var preCaretVal = val.substring(0, this.getCaret().start);
            var start = preCaretVal.lastIndexOf(this.options.delimiterChar) + 1;
            var postCaretVal = val.substring(this.getCaret().start);
            var end = postCaretVal.indexOf(this.options.delimiterChar);
            if (end == -1) end = val.length;
            end += this.getCaret().start;
        } else {
            start = 0;
            end = val.length;
        }
        return {
            start: start,
            end: end
        };
    };
})(jQuery);

(function ($) {
    // dnn customized tags
    var delimiter = new Array();
    var tagsCallbacks = new Array();
    $.fn.dnnDoAutosize = function (o) {
        var minWidth = $(this).data('minwidth'),
            maxWidth = $(this).data('maxwidth'),
            val = '',
            input = $(this),
            testSubject = $('#' + $(this).data('tester_id'));

        if (val === (val = input.val())) { return; }

        // Enter new content into testSubject
        var escaped = val.replace(/&/g, '&amp;').replace(/\s/g, ' ').replace(/</g, '&lt;').replace(/>/g, '&gt;');
        testSubject.html(escaped);
        // Calculate new width + whether to change
        var testerWidth = testSubject.width(),
            newWidth = (testerWidth + o.comfortZone) >= minWidth ? testerWidth + o.comfortZone : minWidth,
            currentWidth = input.width(),
            isValidWidthChange = (newWidth < currentWidth && newWidth >= minWidth)
                                 || (newWidth > minWidth && newWidth < maxWidth);

        // Animate width
        if (isValidWidthChange) {
            input.width(newWidth);
        }
    };

    $.fn.dnnResetAutosize = function (options) {
	    var minWidth = $(this).data('minwidth') || options.minInputWidth || $(this).width(),
	        maxWidth = $(this).data('maxwidth') || options.maxInputWidth || ($(this).closest('.dnnTagsInput').width() - options.inputPadding),
	        $input = $(this);

		var left = 0;
		var $lastSpan = $(this).closest('.dnnTagsInput').find('> span').last();
		if ($lastSpan.length > 0) {
			left = $lastSpan.offset().left - $lastSpan.parent().offset().left + $lastSpan.outerWidth();
		}
		var availableWidth = maxWidth - left;
	    if (availableWidth < parseInt(minWidth)) {
		    availableWidth = maxWidth;
	    }

        $input.css('width', availableWidth);
    };

    $.fn.dnnAddTag = function (value, options) {
        options = jQuery.extend({ focus: false, callback: true }, options);
        this.each(function () {
            var id = $(this).attr('id');
            var tagslist = $(this).val().split(delimiter[id]);
            if (tagslist[0] == '') {
                tagslist = new Array();
            }
			value = value.replace(/<.*?>/g, '');
            value = jQuery.trim(value);
            var skipTag;
            if (options.unique) {
                skipTag = $(this).dnnTagExist(value);
                if (skipTag == true) {
                    //Marks fake input as not_valid to let styling it
                    $('#' + id + '_tag').addClass('dnnTagsInvalid');
                }
                else
                    $('#' + id + '_tag').removeClass('dnnTagsInvalid');
            } else {
                skipTag = false;
                $('#' + id + '_tag').removeClass('dnnTagsInvalid');
            }

            if (value != '' && skipTag != true) {
                $('<span>').addClass('tag').append(
                    $('<span>').text(value).append('&nbsp;&nbsp;'),
                    $('<a aria-label="remove">', {
                        href: '#',
                        title: 'Removing tag'
                    }).click(function () {
                        return $('#' + id).dnnRemoveTag(escape(value));
                    })
                ).insertBefore('#' + id + '_addTag');

                tagslist.push(value);

                $('#' + id + '_tag').val('');
                if (options.focus) {
                    $('#' + id + '_tag').focus();
                } else {
                    $('#' + id + '_tag').blur();
                }

                $.fn.dnnTagsInput.updateTagsField(this, tagslist);
                var f;
                if (options.callback && tagsCallbacks[id] && tagsCallbacks[id]['onAddTag']) {
                    f = tagsCallbacks[id]['onAddTag'];
                    f.call(this, value);
                }
                if (tagsCallbacks[id] && tagsCallbacks[id]['onChange']) {
                    var i = tagslist.length;
                    f = tagsCallbacks[id]['onChange'];
                    f.call(this, $(this), tagslist[i - 1]);
                }
            }
        });
        return false;
    };

    $.fn.dnnRemoveTag = function (value) {
        value = unescape(value);
        this.each(function () {
            var id = $(this).attr('id');
            var old = $(this).val().split(delimiter[id]);
            $('#' + id + '_tagsinput .tag').remove();
            var str = '';
            for (var i = 0; i < old.length; i++) {
                if (old[i] != value) {
                    str = str + delimiter[id] + old[i];
                }
            }
            $.fn.dnnTagsInput.importTags(this, str);
            if (tagsCallbacks[id] && tagsCallbacks[id]['onRemoveTag']) {
                var f = tagsCallbacks[id]['onRemoveTag'];
                f.call(this, value);
            }
        });

        return false;
    };

    $.fn.dnnTagExist = function (val) {
        var id = $(this).attr('id'),
            tagslist = $(this).val().split(delimiter[id]);
        return (jQuery.inArray(val, tagslist) >= 0);
    };

    $.fn.dnnImportTags = function (str) {
        var id = $(this).attr('id');
        $('#' + id + '_tagsinput .tag').remove();
        $.fn.dnnTagsInput.importTags(this, str);
    };

    $.fn.dnnTagsInput = function (options) {
        var onError = null;
        var triggerOnError = function (handler) {
            if (!onError) {
                onError = setTimeout(function () {
                    onError = null;
                    if (handler) handler();
                }, 0);
            }
        };
        var settings = jQuery.extend({
            interactive: true,
            defaultText: 'Add a tag',
            minChars: 0,
            maxChars: 50,
            maxTags: 16,
            lessThanMinCharsErrorText: 'A tag cannot be less than {0} characters long',
            lessThanMinCharsErrorTitle: 'Tag Length Not Reached',
            moreThanMaxCharsErrorText: 'A tag cannot be more than {0} characters long',
            moreThanMaxCharsErrorTitle: 'Tag Length Exceeded',
            moreThanMaxTagsErrorText: 'A maximum of {0} tags can be attached here',
            moreThanMaxTagsErrorTitle: 'Tags limit exceeded',
            onErrorLessThanMinChars: function () { // can be customised by module dev
                $.dnnAlert({ text: String.format(settings.lessThanMinCharsErrorText, settings.minChars), title: settings.lessThanMinCharsErrorTitle });
            },
            onErrorMoreThanMaxChars: function () { // can be customised by module dev
                $.dnnAlert({ text: String.format(settings.moreThanMaxCharsErrorText, settings.maxChars), title: settings.moreThanMaxCharsErrorTitle });
            },
            onErrorMoreThanMaxTags: function () { // can be customised by module dev
                $.dnnAlert({ text: String.format(settings.moreThanMaxTagsErrorText, settings.maxTags), title: settings.moreThanMaxTagsErrorTitle });
            },

            width: '45%',
            autocomplete: { selectFirst: false },
            'hide': true,
            'delimiter': ',',
            'unique': true,
            removeWithBackspace: true,
            placeholderColor: '#999',
            normalColor: '#666',
            autosize: true,
            comfortZone: 20,
            inputPadding: 6 * 2

        }, options);

        this.each(function () {
            var instance = $(this).data('dnnTagInput');
            if (instance) return this;
            if (settings.hide) {
                $(this).hide();
            }
            var id = $(this).attr('id');
            if (!id || delimiter[$(this).attr('id')]) {
                id = $(this).attr('id', 'tags' + new Date().getTime()).attr('id');
            }
            var data = jQuery.extend({
                pid: id,
                real_input: '#' + id,
                holder: '#' + id + '_tagsinput',
                input_wrapper: '#' + id + '_addTag',
                fake_input: '#' + id + '_tag'
            }, settings);

            $(this).data('dnnTagInput', data);

            delimiter[id] = data.delimiter;

            if (settings.onAddTag || settings.onRemoveTag || settings.onChange) {
                tagsCallbacks[id] = new Array();
                tagsCallbacks[id]['onAddTag'] = settings.onAddTag;
                tagsCallbacks[id]['onRemoveTag'] = settings.onRemoveTag;
                tagsCallbacks[id]['onChange'] = settings.onChange;
            }

            var markup = '<div id="' + id + '_tagsinput" class="dnnTagsInput">';
            markup += '<div id="' + id + '_addTag">';

            if (settings.interactive) {
                markup += '<input id="' + id + '_tag" value="" data-default="' + settings.defaultText + '" autocomplete="off" aria-label="Search" />';
            }

            markup += '</div>';
            markup = markup + '<div class="dnnTagsClear"></div></div>';

            $(markup).insertAfter(this);

            $(data.holder).css({
                'width': settings.width,
                'min-height': settings.height
            });

            $(data.fake_input).attr("maxlength", settings.maxChars);

            if ($(data.real_input).val() != '') {
                $.fn.dnnTagsInput.importTags($(data.real_input), $(data.real_input).val());
            }
            if (settings.interactive) {
                // placeholder stuff
                $(data.fake_input).dnnPlaceholder({
	                color: [settings.normalColor, settings.placeholderColor]
                });

                $(data.fake_input).dnnResetAutosize(settings);
                $(data.holder).on('click', data, function (event) {
                    $(event.data.real_input).triggerHandler('focus');
                    $(event.data.fake_input).triggerHandler('focus');
                    return false;
                });
                if (settings.autocomplete_url != undefined) {
                    if ($.dnnAutocompleter !== undefined) {
                        if (settings.advanced && settings.advanced.length) {
                            settings.autocomplete.advanced = settings.advanced;
                        }

                        $(data.fake_input).dnnAutocomplete(settings.autocomplete_url, settings.autocomplete);
                        $(data.fake_input).on('result', data, function (event, tag) {
                            if (tag) {
                                var tagslist = $(event.data.real_input).val().split(delimiter[id]);
                                if (tagslist[0] == '') {
                                    tagslist = new Array();
                                }
                                if (event.data.maxTags <= tagslist.length) {
                                    if (event.data.onErrorMoreThanMaxTags)
                                        triggerOnError(event.data.onErrorMoreThanMaxTags);
                                    $(data.fake_input).val('');
                                }
                                else
                                    $(event.data.real_input).dnnAddTag(tag, { focus: true, unique: (settings.unique) });
                            }
                        });
                    }
                } else {
                    // if a user tabs out of the field, create a new tag
                    // this is only available if autocomplete is not used.
                    $(data.fake_input).on('blur', data, function (event) {
                        var d = $(this).attr('data-default');
                        var tagslist = $(event.data.real_input).val().split(delimiter[id]);
                        if (tagslist[0] == '') {
                            tagslist = new Array();
                        }
                        if ($(event.data.fake_input).val() != '' && $(event.data.fake_input).val() != d) {
                            if (event.data.minChars > $(event.data.fake_input).val().length) {
                                if (event.data.onErrorLessThanMinChars)
                                    triggerOnError(event.data.onErrorLessThanMinChars);
                                $(data.fake_input).val('');
                            }
                            else if (event.data.maxChars < $(event.data.fake_input).val().length) {
                                if (event.data.onErrorMoreThanMaxChars)
                                    triggerOnError(event.data.onErrorMoreThanMaxChars);
                                $(data.fake_input).val('');
                            }
                            else if (event.data.maxTags <= tagslist.length) {
                                if (event.data.onErrorMoreThanMaxTags)
                                    triggerOnError(event.data.onErrorMoreThanMaxTags);
                                $(data.fake_input).val('');
                            }
                            else{
								var tags = $(event.data.fake_input).val().split(delimiter[id]);
								for(var i = 0; i < tags.length; i++){
									$(event.data.real_input).dnnAddTag(tags[i], { focus: true, unique: (settings.unique) });
								}
                            }
                            $(event.data.fake_input).dnnResetAutosize(settings);
                        }

                        return false;
                    });

                }

                function tagItems(data, event) {
                        var tagslist = $(event.data.real_input).val().split(delimiter[id]);
                        if (tagslist[0] == '') {
                            tagslist = new Array();
                        }
                        if (event.data.minChars > $(event.data.fake_input).val().length) {
                            if (event.data.onErrorLessThanMinChars)
                                triggerOnError(event.data.onErrorLessThanMinChars);
                            $(data.fake_input).val('');
                        }
                        else if (event.data.maxChars < $(event.data.fake_input).val().length) {
                            if (event.data.onErrorMoreThanMaxChars)
                                triggerOnError(event.data.onErrorMoreThanMaxChars);
                            $(data.fake_input).val('');
                        }
                        else if (event.data.maxTags <= tagslist.length) {
                            if (event.data.onErrorMoreThanMaxTags)
                                triggerOnError(event.data.onErrorMoreThanMaxTags);
                            $(data.fake_input).val('');
                        }
                        else {
                            var tags = $(event.data.fake_input).val().split(delimiter[id]);
                            for (var i = 0; i < tags.length; i++) {
                                $(event.data.real_input).dnnAddTag(tags[i], { focus: true, unique: (settings.unique) });
                            }
                        }

                        $(event.data.fake_input).dnnResetAutosize(settings);
                        return false;
                }

                var clickedOnAutoComplete = false;

                $(document).mousedown(function (e) {
                    if ($(e.target).hasClass("dnn_acSelect") || $(e.target).parent().hasClass('dnn_acSelect')) {
                        clickedOnAutoComplete = true;
                    }
                });

                var tagTooLongErrMsg = $('<span class="dnnFormError dnnFormMessage">' + String.format(settings.moreThanMaxCharsErrorText, settings.maxChars) + '</span>');
                // if user types a comma, create a new tag
                $(data.fake_input).on('keypress keydown blur', data, function (event) {
                    if ($(this).val() === "" || clickedOnAutoComplete) {
                        return;
                    }
                    var currValLength = $(this).val().length;
                    if ((currValLength >= settings.maxChars) && !(event.which == event.data.delimiter.charCodeAt(0) || event.which == 13 || event.which == 9)) {
                        tagTooLongErrMsg.insertAfter($(this)).show().delay(1500).fadeOut(1000);
                    }
                    if (event.which == event.data.delimiter.charCodeAt(0) || event.which == 13 || event.which == 9 || event.type == "blur") {
                        event.preventDefault();
                        if (!clickedOnAutoComplete) {
                            tagItems(data, event);
                        }
                        clickedOnAutoComplete = false;
                    } else if (event.data.autosize) {
                        $(event.data.fake_input).dnnDoAutosize(settings);
                    }
                    return true;
                });
                //Delete last tag on backspace
                data.removeWithBackspace && $(data.fake_input).on('keydown', function (event) {
                    if (event.keyCode == 8 && $(this).val() == '') {
                        event.preventDefault();
                        var lastTag = $(this).closest('.dnnTagsInput').find('.tag:last').text();
                        var lastTagId = $(this).attr('id').replace(/_tag$/, '');
                        lastTag = lastTag.replace(/[\s]+$/, '');
                        $('#' + lastTagId).dnnRemoveTag(escape(lastTag));
                        $(this).trigger('focus');
                    }
                });
                $(data.fake_input).blur();

                //Removes the not_valid class when user changes the value of the fake input
                if (data.unique) {
                    $(data.fake_input).keydown(function (event) {
                        if (event.keyCode == 8 || String.fromCharCode(event.which).match(/\w+|[áéíóúÁÉÍÓÚñÑ,/]+/)) {
                            $(this).removeClass('dnnTagsInvalid');
                        }
                    });
                }

            } // if settings.interactive
            return this;
        });
        return this;
    };

    $.fn.dnnTagsInput.updateTagsField = function (obj, tagslist) {
        var id = $(obj).attr('id');
        $(obj).val(tagslist.join(delimiter[id]));
    };

    $.fn.dnnTagsInput.importTags = function (obj, val) {
        $(obj).val('');
        var id = $(obj).attr('id');
        var tags = val.split(delimiter[id]);
        for (var i = 0; i < tags.length; i++) {
            $(obj).dnnAddTag(tags[i], { focus: false, callback: false });
        }
        if (tagsCallbacks[id] && tagsCallbacks[id]['onChange']) {
            var f = tagsCallbacks[id]['onChange'];
            f.call(obj, obj, tags[i]);
        }
    };

    $.fn.dnnPlaceholder = function (options) {
	    options = $.extend({}, {
	    	cssClass: 'dnnPlaceholder',
			color: []
	    }, options);

	    this.each(function () {
		    var $this = $(this);
			var instance = $this.data('dnnPlaceHolder');
			if (instance) return true;
			$this.data('dnnPlaceHolder', true);

			var placeholderSupported = ('placeholder' in $this[0]);
            if (placeholderSupported)
                $this.attr('placeholder', $this.attr('data-default'));
            else {
            	var $fakeInput = $('<input type="text" />')
					.attr('class', $this.attr('class'))
					.attr('style', $this.attr('style'))
					.val($this.attr('data-default'));

            	$this.hide().after($fakeInput);
				if (options.color.length === 2) {
					$fakeInput.css('color', options.color[1]);
					$this.css('color', options.color[0]);
				} else {
					$fakeInput.addClass(options.cssClass);
				}


	            $fakeInput.on('focus', function(event) {
		            $fakeInput.hide();
		            $this.show().focus();
	            });

				$this.on('blur', function (event) {
					var d = $this.attr('data-default');
					if ($this.val() === '') {
						$this.hide();
						$fakeInput.show();
					}
				});

				var events = $._data(this, 'events')['blur'];
				var first = events.pop();
				events.splice(0, 0, first);
            }

		    return true;
	    });

		return this;
	};
})(jQuery);

(function ($) {
    // dnnForm customised client side validation
    $.fn.toggleErrorMessage = function (options) {
        var defaultOptions = {
            errorMessage: "Error message",
            errorCls: "dnnFormError",
            show: true,
            removeErrorMessage: true
        };

        options = $.extend(defaultOptions, options);

        return this.each(function () {
            var dnnFormItem = $(this).closest('.dnnFormItem');
            if (options.show) {
                var errorSpan = dnnFormItem.find('span.dnnFormMessage.' + options.errorCls);
                if (errorSpan.length) {
                    errorSpan.html(options.errorMessage);
                } else {
                    errorSpan = $('<span class="dnnFormMessage ' + options.errorCls + '">' + options.errorMessage + '</span>');
                    dnnFormItem.append(errorSpan);
                }

                if (this.tagName.toLowerCase() == 'div') {
                    // customised controls
                    if ($(this).hasClass('RadComboBox')) {
                        // RadComboBox
                        $(this).addClass('dnnError');
                    }
                }
                else {
                    if ($(this).parent().hasClass('RadPicker')) {
                        // RadDate Picker
                        $(this).parent().find('input.riTextBox').css('border', '1px solid red');
                    }
                    else if ($(this).hasClass('dnnSpinnerInput')) {
                        // Spinner
                        $(this).parent().css('border', '1px solid red');
                    }
                    else {
                        // normal ctrl
                        $(this).css('border', '1px solid red');
                    }
                }
            }
            else {
                if (options.removeErrorMessage)
                    dnnFormItem.find('span.' + options.errorCls).remove();
                else
                    dnnFormItem.find('span.' + options.errorCls).hide();

                if (this.tagName.toLowerCase() == 'div') {
                    // customised controls
                    if ($(this).hasClass('RadComboBox')) {
                        // RadComboBox
                        $(this).removeClass('dnnError');

                    }
                }
                else {
                    if ($(this).hasClass('dnnSpinnerInput')) {
                        // Spinner
                        $(this).parent().css('border', '1px solid #ccc');
                    }
                    else {
                        // normal ctrl
                        $(this).css('border', '1px solid #ccc');
                    }
                }
            }
        });
    };
    $.fn.dnnFormSubmit = function (options) {
        var defaultOptions = {
            validates: []
        };

        options = $.extend(defaultOptions, options);

        return this.each(function () {
            $(this).click(function () {
                var formValidate = true;
                for (var i = 0; i < options.validates.length; i++) {
                    var ele = $('#' + options.validates[i].ele);
                    var func = options.validates[i].func;
                    if (ele.length) {
                        var eleVal = ele.val();
                        var eleError = func.call(ele.get(0), eleVal);
                        if (eleError) {
                            ele.toggleErrorMessage({ errorMessage: eleError, show: true });
                            formValidate = false;
                        }
                        else {
                            ele.toggleErrorMessage({ show: false });
                        }

                        //ele focus then remove error info
                        var hideErrorInfo = function () {
                            $(this).toggleErrorMessage({ show: false });
                        };

                        ele.off('focus', hideErrorInfo).on('focus', hideErrorInfo);
                    }
                }

                return formValidate;
            });
        });
    };

    // fix telerik custom datepicker popup arrow position       
    $.dnnRadPickerHack = function () {
        //when click this icon, hide error info
        var hideErrorInfo = function () {
            $(this).toggleErrorMessage({ show: false, removeErrorMessage: false });
        };
        var dnnRadPickerPopupFix = function () {
            if ($.support.cssFloat) {
                var id = $(this).attr('id');
                var popupId = id.replace('popupButton', 'calendar_wrapper');
                var popupElement = $('#' + popupId);
                var wrapperId = id.replace('popupButton', 'wrapper');
                var wrapperElement = $('#' + wrapperId);

                var popupElementTop = popupElement.parent().position().top;
                var wrapperElementTop = wrapperElement.offset().top;
                var popupTbl = popupElement.find('.RadCalendar_Default');
                var nextEle = popupTbl.next();
                if (nextEle.hasClass('RadCalendar_Default_PopupArrow_Down') || nextEle.hasClass('RadCalendar_Default_PopupArrow_Up'))
                    nextEle.remove();

                if (popupElementTop < wrapperElementTop) { // popup above the calendar ctrl, so show arrow down
                    popupTbl.after('<div class="RadCalendar_Default_PopupArrow_Down"></div>');
                }
                else { // popup below the calendar ctrl, so show arrow up
                    popupTbl.after('<div class="RadCalendar_Default_PopupArrow_Up"></div>');
                }
            }

            $(this).toggleErrorMessage({ show: false, removeErrorMessage: false });
        };
        $('.RadPicker_Default a.rcCalPopup').off('click', dnnRadPickerPopupFix).on('click', dnnRadPickerPopupFix);
        $('.RadPicker_Default .riTextBox').off('focus', hideErrorInfo).on('focus', hideErrorInfo);
    };

    // remove combobox inline style
    $.dnnComboBoxLoaded = function (sender) {
        if (sender.constructor.__typeName == "Telerik.Web.UI.RadComboBox") {
            $(sender._inputDomElement).closest(".RadComboBox").removeAttr("style");
        }
    };

    //fix combobox hide error info
    $.dnnComboBoxHack = function (sender) {
        $(('#' + sender._clientStateFieldID).replace('_ClientState', '')).toggleErrorMessage({ show: false, removeErrorMessage: false });
    };

    //fix combobox scroll
    $.dnnComboBoxScroll = function (sender) {
        if ($.support.cssFloat) {
            var container = $(('#' + sender._clientStateFieldID + ' .rcbScroll').replace('ClientState', 'DropDown'));
            if (container.data('scrollPane')) {
                container.data('scrollPane').data('jsp').reinitialise();
            } else {
                container.data('scrollPane', container.jScrollPane());
            }
        }
    };

    $.dnnComboBoxItemRequested = function (sender) {
        setTimeout(function() {
            var container = $(('#' + sender._clientStateFieldID + ' .rcbScroll').replace('ClientState', 'DropDown'));
            if (container.data('scrollPane')) {
                container.data('scrollPane').data('jsp').reinitialise();
            }
        }, 0);
    };

    // fix grid issues 
    $.dnnGridCreated = function (sender) {
        var clientId = sender.ClientID;
        var $grid = $('#' + clientId);
        $('input.rgSortDesc, input.rgSortAsc', $grid).click(function () {
            var href = $(this).parent().find('a').get(0).href;
            window.location = href;
            return false;
        });

        if ($grid.hasClass('dnnTooltipGrid')) {
            $grid.dnnHelperTipDestroy();
            $('.rgRow, .rgAltRow', $grid).each(function () {
                var info = "Here is some text will show up and explian more about this information";
                $(this).dnnHelperTip({ helpContent: info, holderId: clientId });
            });
        }

        var grid = $find(clientId);

        // while using customised checkbox - remove onclick event then attach onchange
        var headerCheck = $('.rgCheck', $grid);
        if (headerCheck.length) {
            headerCheck.each(function () {
                var checkbox = $(this).find('input[type="checkbox"]').get(0);
                var onclick = checkbox.onclick;
                checkbox.onchange = onclick;
                checkbox.onclick = null;
            });

            // when use customised scrollbar and customised checkbox, the row cannot be correctly selected
            $('.rgDataDiv input[type="checkbox"]', $grid).change(function () {
                var masterTable = grid.get_masterTableView();
                var rowIndex = $(this).closest('tr').get(0).rowIndex;
                var checked = this.checked;
                if (checked)
                    masterTable.selectItem(rowIndex);
                else
                    masterTable.deselectItem(rowIndex);
            });
        }

        // initialize dnnGrid customised scrollbar
        $('.rgDataDiv').each(function () {
            var $this = $(this);
            var ele = $this.get(0);
            ele.scrollPane = $this.jScrollPane();
            var api = ele.scrollPane.data('jsp');
            var throttleTimeout;
            $(window).on(
                'resize',
                function () {
                    if (!$.support.cssFloat) {
                        if (throttleTimeout) {
                            clearTimeout(throttleTimeout);
                            throttleTimeout = null;
                        }
                        throttleTimeout = setTimeout(
                            function () {
                                api.reinitialise();
                                throttleTimeout = null;
                            },
                            50
                        );
                    } else {
                        api.reinitialise();
                    }
                }
            );
            if (window.__rgDataDivScrollTopPersistArray && window.__rgDataDivScrollTopPersistArray.length) {
                var y = window.__rgDataDivScrollTopPersistArray.pop();
                api.scrollToY(y);
            }
        });
    };
})(jQuery);

(function ($) {
    var types = ['DOMMouseScroll', 'mousewheel'];
    if ($.event.fixHooks) {
        for (var i = types.length; i;) {
            $.event.fixHooks[types[--i]] = $.event.mouseHooks;
        }
    }
    $.event.special.mousewheel = {
        setup: function () {
            if (this.addEventListener) {
                for (var i = types.length; i;) {
                    this.addEventListener(types[--i], handler, false);
                }
            } else {
                this.onmousewheel = handler;
            }
        },

        teardown: function () {
            if (this.removeEventListener) {
                for (var i = types.length; i;) {
                    this.removeEventListener(types[--i], handler, false);
                }
            } else {
                this.onmousewheel = null;
            }
        }
    };

    $.fn.extend({
        mousewheel: function (fn) {
            return fn ? this.on("mousewheel", fn) : this.trigger("mousewheel");
        },

        unmousewheel: function (fn) {
            return this.off("mousewheel", fn);
        }
    });

    function handler(event) {
        var orgEvent = event || window.event,
            args = [].slice.call(arguments, 1),
            delta = 0,
            deltaX = 0,
            deltaY = 0;
        event = $.event.fix(orgEvent);
        event.type = "mousewheel";

        // Old school scrollwheel delta
        if (orgEvent.wheelDelta) { delta = orgEvent.wheelDelta / 120; }
        if (orgEvent.detail) { delta = -orgEvent.detail / 3; }

        // New school multidimensional scroll (touchpads) deltas
        deltaY = delta;

        // Gecko
        if (orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS) {
            deltaY = 0;
            deltaX = -1 * delta;
        }

        // Webkit
        if (orgEvent.wheelDeltaY !== undefined) { deltaY = orgEvent.wheelDeltaY / 120; }
        if (orgEvent.wheelDeltaX !== undefined) { deltaX = -1 * orgEvent.wheelDeltaX / 120; }

        // Add event and delta to the front of the arguments
        args.unshift(event, delta, deltaX, deltaY);
        return ($.event.dispatch || $.event.handle).apply(this, args);
    }

})(jQuery);

(function ($) {
    $.fn.dnnFileInput = function (options) {
        var opts = $.extend({}, $.fn.dnnFileInput.defaultOptions, options);

        return this.each(function () {
            var $ctrl = $(this);
            if ($ctrl.hasClass('normalFileUpload')) return;

            if (this.wrapper)
                return;

            //ignore decoration for elements in rad control.
            if ($ctrl.parents().hasClass("RadUpload"))
                return;

            // if this.wrapper is undefined, then we check if parent node is a wrapper
            if (this.parentNode && this.parentNode.tagName.toLowerCase() == 'span' && $ctrl.parent().hasClass('dnnInputFileWrapper')) {
                return;
            }

            this.wrapper = $("<span class='dnnInputFileWrapper " + opts.buttonClass + "'></span>");
            var text = $ctrl.data('text');
            text = text || 'Choose File';
            this.wrapper.text(text);
            $ctrl.wrap(this.wrapper);
            $ctrl.data("wrapper", $ctrl.parent());

            if (opts.showSelectedFileNameAsButtonText) {
                $ctrl.change(function () {
                    var val = $(this).val();
                    if (val != '') {
                        var lastIdx = val.lastIndexOf('\\') + 1;
                        val = val.substring(lastIdx, val.length);
                    } else {
                        val = text;
                    }
                    $(this).data("wrapper").get(0).childNodes[0].nodeValue = val;
                });
            }
        });
    };

    $.fn.dnnFileInput.defaultOptions = {
        buttonClass: 'dnnSecondaryAction',
        showSelectedFileNameAsButtonText: true
    };
})(jQuery);

(function ($) {
    var supportAjaxUpload = function () {
        var xhr = new XMLHttpRequest;
        return !!(xhr && ('upload' in xhr) && ('onprogress' in xhr.upload));
    };

    $.fn.dnnFileUpload = function (settings) {
        return this.each(function () {
            // set scope and settings, service
            var scope = $(this).attr('id');
            window.dnn.dnnFileUpload.setSettings(scope, settings);
            var service = $.dnnSF();

            // hide progress
            $('#' + settings.progressBarId).parent().hide();
            // detect draggable support or not
            var droppableSpan = $('#' + settings.dropZoneId + '>span');
            if ('draggable' in document.createElement('span')) {
                droppableSpan.show();
            }
            else {
                droppableSpan.hide();
            }

            // set file upload
            var url = service.getServiceRoot('internalservices') + 'fileupload/postfile';
            if (!supportAjaxUpload()) {
                var antiForgeryToken = $('input[name="__RequestVerificationToken"]').val();
                url += '?__RequestVerificationToken=' + antiForgeryToken;
            }

            $('#' + scope + ' input[type="file"]').fileupload({
                url: url,
                beforeSend: service.setModuleHeaders,
                dropZone: $('#' + settings.dropZoneId),
                pasteZone: null,
                replaceFileInput: false,
                submit: function (e, data) {
                    data.formData = { folder: settings.folder, filter: settings.fileFilter, overwrite: 'true' };
                    return true;
                },
                progressall: function (e, data) {
                    var progress = parseInt(data.loaded / data.total * 100, 10);
                    if (progress < 100) {
                        $('#' + settings.progressBarId).parent().show();
                        $('#' + settings.progressBarId + '>div').css('width', progress + '%');
                    }
                    else
                        $('#' + settings.progressBarId).parent().hide();
                },
                done: function (e, data) {
                    $('#' + settings.progressBarId).parent().hide();
                    var img = new Image();
                    $(img).on('load', function () {
                        $('#' + settings.dropZoneId + ' img').remove();
                        $(img).css({ 'max-width': 180, 'max-height': 150 }).insertBefore($('#' + settings.dropZoneId + ' span'));
                    });
                    var src;
                    if (data.dataType && typeof(data.result) == "object" && data.result.length) {
                        data.result = JSON.parse(data.result.text());
                    } else {
                        data.result = JSON.parse(data.result);
                    }
                    var testContent = $('<pre>' + data.result.FilePath + '</pre>');
                    if (testContent.length) {
                        src = testContent.text();
                    }
                    else
                        src = data.result;

                    if (src && $.trim(src)) {
                        var profileImagePath = dnn.getVar("sf_siteRoot", "/") + 'DnnImageHandler.ashx?mode=securefile&fileId=' + data.result.FileId + '&MaxWidth=180&MaxHeight=150';
                        img.src = profileImagePath;
                        
                        var fileName = data.result.FilePath.replace('\\', '/');
                        if (fileName.indexOf('/') > -1) {
                            fileName = fileName.split('/')[fileName.split('/').length - 1];
                        }
                        if (fileName.indexOf('?') > -1) {
                            fileName = fileName.split('?')[0];
                        }
                        
                        dnn[settings.filesComboId].refresh(dnn[settings.foldersComboId].selectedItem().key);
                        dnn[settings.filesComboId].selectedItem({ key: data.result.FileId, value: fileName});
                    }
                },
                fail: function (e, data) {
                    $('#' + settings.progressBarId).parent().hide();
                    var resp = JSON.parse(data.jqXHR.responseText);
                    alert(resp.Message);
                }
            });

            $('#' + scope + ' input[name=uploadFileButton]').click(function() {
                var instance = dnn[settings.fileUploadId];
                
                var options = instance.options;
                if (dnn[settings.foldersComboId].selectedItem() != null) {
                    instance.options.folderPicker.initialState.selectedItem = dnn[settings.foldersComboId].selectedItem();
                    instance.options.folderPath = window.dnn.dnnFileUpload.getSelectedPath(dnn[settings.foldersComboId]);
                }

                instance.show(options);
                
                window.dnn.dnnFileUpload.updateExpandPath(dnn[settings.foldersComboId], instance._panel._folderPicker.id());
                
                instance._panel.$element.on("onfileuploadcomplete", function (event, data) {
                    if (typeof data == "string") {
						// for modern browsers
                        data = JSON.parse(data);
                    }else{
						// for IE8-9						
						var b = data[0];
						data = JSON.parse(b.body.innerText);
					}
                    if (data && data.fileId) {
                        var folderPicker = instance._panel._folderPicker;
                        dnn[settings.foldersComboId].selectedItem(folderPicker.selectedItem());
                        window.dnn.dnnFileUpload.Folders_Changed(dnn[settings.foldersComboId].selectedItem(), dnn[settings.foldersComboId].$element);
                        window.dnn.dnnFileUpload.updateExpandPath(folderPicker, settings.foldersComboId);
                        
                        dnn[settings.filesComboId].refresh(dnn[settings.foldersComboId].selectedItem().key);
                        dnn[settings.filesComboId].selectedItem({ key: data.fileId.toString(), value: data.fileName });
                        window.dnn.dnnFileUpload.Files_Changed(dnn[settings.filesComboId].selectedItem(), dnn[settings.filesComboId].$element);
                    }
                });
            });

            // set initial thumb image
            setTimeout(function () {
                dnn[settings.filesComboId].options.services.parameters.parentId = settings.selectedFolderId;
                var filesCombo = dnn[settings.filesComboId];
                var selectedFileId = filesCombo.selectedItem() ? filesCombo.selectedItem().key : null;                
             	var fileId  = selectedFileId ? parseInt(selectedFileId) : 0;
                if (fileId > 0) {
                    var maxWidth = 180, maxHeight = 150;
                    var profileImagePath = dnn.getVar("sf_siteRoot", "/") + 'DnnImageHandler.ashx?mode=securefile&fileId=' + fileId + '&MaxWidth=' + maxWidth + '&MaxHeight=' + maxHeight;
                    var img = new Image();

                    $(img).on('load', function () {
                        $('#' + settings.dropZoneId + ' img').remove();
                        $(img).css({ 'max-width': maxWidth, 'max-height': maxHeight }).insertBefore($('#' + settings.dropZoneId + ' span'));
                    });
                    img.src = profileImagePath;        
                }
            }, 500);
        });
    };

    if (typeof window.dnn === 'undefined') window.dnn = {};
    window.dnn.dnnFileUpload = window.dnn.dnnFileUpload || {};
    window.dnn.dnnFileUpload.settings = {};
    window.dnn.dnnFileUpload.setSettings = function (scope, settings) {
        window.dnn.dnnFileUpload.settings[scope] = settings;
    };
    window.dnn.dnnFileUpload.getSettings = function (sender) {
        var scope = sender.closest('.dnnFileUploadScope').attr('id');
        return window.dnn.dnnFileUpload.settings[scope];
    };
    window.dnn.dnnFileUpload.Folders_Changed = function (node, sender) {
        var settings = window.dnn.dnnFileUpload.getSettings(sender);
        if (!settings) return false;

        if (node) {
            //get the selected folder path
            var selectedPathArray = dnn[settings.foldersComboId].selectedPath();
            if (selectedPathArray.length === 0 && settings.folder) {
                return settings.folder;
            }
            var selectedPath = "";
            if (selectedPathArray.length > 1) {
                for (var i = 1, size = selectedPathArray.length; i < size; i++) {
                    selectedPath += selectedPathArray[i].name + "/";
                }
            } 
            settings.folder = selectedPath;

            dnn[settings.filesComboId].refresh(node.key);
            dnn[settings.filesComboId].selectedItem(null);
            window.dnn.dnnFileUpload.Files_Changed({ key: null }, $('#' + settings.filesComboId));
        }
    };
    window.dnn.dnnFileUpload.Files_Changed = function (node, sender) {
        var settings = window.dnn.dnnFileUpload.getSettings(sender);
        if (!settings) return;

        if (node) {
            var fileId = node.key;
            if (fileId) {
                var maxWidth = 180, maxHeight = 150;
                var profileImagePath = dnn.getVar("sf_siteRoot", "/") + 'DnnImageHandler.ashx?mode=securefile&fileId=' + fileId + '&MaxWidth=' + maxWidth + '&MaxHeight=' + maxHeight;
                var img = new Image();

                $(img).on('load', function () {
                    $('#' + settings.dropZoneId + ' img').remove();
                    $(img).css({ 'max-width': maxWidth, 'max-height': maxHeight }).insertBefore($('#' + settings.dropZoneId + ' span'));
                });
                img.src = profileImagePath;        
            }
            else
                $('#' + settings.dropZoneId + ' img').remove();
        }
    };
    window.dnn.dnnFileUpload.updateExpandPath = function(dropDownList, targetId) {
        //set expand path
        var selectedPaths = dropDownList.selectedPath();
        var expandPath = "";
        if (selectedPaths.length == 0) { //which means the tree view hasn't opened.
            expandPath = dnn.getVar(dropDownList.id() + '_expandPath');
        }
        else if (selectedPaths.length > 1) {
            for (var i = 0; i < selectedPaths.length - 1; i++) {
                if (expandPath == "") {
                    expandPath = selectedPaths[i].id;
                } else {
                    expandPath = expandPath + "," + selectedPaths[i].id;
                }
            }
        }
        
        if (expandPath != "") {
            dnn.setVar(targetId + '_expandPath', expandPath);
        }
    };
    window.dnn.dnnFileUpload.getSelectedPath = function(dropDownList) {
        var selectedPathArray = dropDownList.selectedPath();
        var settings = window.dnn.dnnFileUpload.getSettings(dropDownList.$element);
        if (selectedPathArray.length === 0 && settings.folder) {
            return settings.folder;
        }
        var selectedPath = "";
        if (selectedPathArray.length > 1) {
            for (var i = 1, size = selectedPathArray.length; i < size; i++) {
                selectedPath += selectedPathArray[i].name + "/";
            }
        }
        return selectedPath;
    };
})(jQuery);

(function ($) {
    /* BELOW jscrollPane code */
    $.fn.jScrollPane = function (settings) {
        // JScrollPane "class" - public methods are available through $('selector').data('jsp')
        function JScrollPane(elem, s) {
            var settings, jsp = this, pane, paneWidth, paneHeight, container, contentWidth, contentHeight,
				percentInViewH, percentInViewV, isScrollableV, isScrollableH, verticalDrag, dragMaxY,
				verticalDragPosition, horizontalDrag, dragMaxX, horizontalDragPosition,
				verticalBar, verticalTrack, scrollbarWidth, verticalTrackHeight, verticalDragHeight, arrowUp, arrowDown,
				horizontalBar, horizontalTrack, horizontalTrackWidth, horizontalDragWidth, arrowLeft, arrowRight,
				reinitialiseInterval, originalPadding, originalPaddingTotalWidth, previousContentWidth,
				wasAtTop = true, wasAtLeft = true, wasAtBottom = false, wasAtRight = false,
				originalElement = elem.clone(false, false).empty(),
				mwEvent = $.fn.mwheelIntent ? 'mwheelIntent.jsp' : 'mousewheel.jsp';

            originalPadding = elem.css('paddingTop') + ' ' +
								elem.css('paddingRight') + ' ' +
								elem.css('paddingBottom') + ' ' +
								elem.css('paddingLeft');
            originalPaddingTotalWidth = (parseInt(elem.css('paddingLeft'), 10) || 0) +
										(parseInt(elem.css('paddingRight'), 10) || 0);

            function initialise(s) {

                var /*firstChild, lastChild, */isMaintainingPositon, lastContentX, lastContentY,
						hasContainingSpaceChanged, originalScrollTop, originalScrollLeft,
						maintainAtBottom = false, maintainAtRight = false;

                settings = s;

                if (pane === undefined) {
                    originalScrollTop = elem.scrollTop();
                    originalScrollLeft = elem.scrollLeft();

                    elem.css(
						{
						    overflow: 'hidden',
						    padding: 0
						}
					);
                    // TODO: Deal with where width/ height is 0 as it probably means the element is hidden and we should
                    // come back to it later and check once it is unhidden...
                    paneWidth = elem.innerWidth() + originalPaddingTotalWidth;
                    paneHeight = elem.innerHeight();

                    elem.width(paneWidth);

                    pane = $('<div class="jspPane" />').css('padding', originalPadding).append(elem.children());
                    container = $('<div class="jspContainer" />')
						.css({
						    'width': paneWidth + 'px',
						    'height': paneHeight + 'px'
						}
					).append(pane).appendTo(elem);

                    /*
					// Move any margins from the first and last children up to the container so they can still
					// collapse with neighbouring elements as they would before jScrollPane 
					firstChild = pane.find(':first-child');
					lastChild = pane.find(':last-child');
					elem.css(
						{
							'margin-top': firstChild.css('margin-top'),
							'margin-bottom': lastChild.css('margin-bottom')
						}
					);
					firstChild.css('margin-top', 0);
					lastChild.css('margin-bottom', 0);
					*/
                } else {
                    elem.css('width', '');

                    maintainAtBottom = settings.stickToBottom && isCloseToBottom();
                    maintainAtRight = settings.stickToRight && isCloseToRight();

                    hasContainingSpaceChanged = elem.innerWidth() + originalPaddingTotalWidth != paneWidth || elem.outerHeight() != paneHeight;

                    if (hasContainingSpaceChanged) {
                        paneWidth = elem.innerWidth() + originalPaddingTotalWidth;
                        paneHeight = elem.innerHeight();
                        container.css({
                            width: paneWidth + 'px',
                            height: paneHeight + 'px'
                        });
                    }

                    // If nothing changed since last check...
                    if (!hasContainingSpaceChanged && previousContentWidth == contentWidth && pane.outerHeight() == contentHeight) {
                        elem.width(paneWidth);
                        return;
                    }
                    previousContentWidth = contentWidth;

                    pane.css('width', '');
                    elem.width(paneWidth);

                    container.find('>.jspVerticalBar,>.jspHorizontalBar').remove().end();
                }

                pane.css('overflow', 'auto');
                if (s.contentWidth) {
                    contentWidth = s.contentWidth;
                } else {
                    contentWidth = pane[0].scrollWidth;
                }
                contentHeight = pane[0].scrollHeight;
                pane.css('overflow', '');

                percentInViewH = contentWidth / paneWidth;
                percentInViewV = contentHeight / paneHeight;
                isScrollableV = percentInViewV > 1;

                isScrollableH = percentInViewH > 1;

                if (!(isScrollableH || isScrollableV)) {
                    elem.removeClass('jspScrollable');
                    pane.css({
                        top: 0,
                        width: container.width() - originalPaddingTotalWidth
                    });
                    removeMousewheel();
                    removeFocusHandler();
                    removeKeyboardNav();
                    removeClickOnTrack();
                } else {
                    elem.addClass('jspScrollable');

                    isMaintainingPositon = settings.maintainPosition && (verticalDragPosition || horizontalDragPosition);
                    if (isMaintainingPositon) {
                        lastContentX = contentPositionX();
                        lastContentY = contentPositionY();
                    }

                    initialiseVerticalScroll();
                    initialiseHorizontalScroll();
                    resizeScrollbars();

                    if (isMaintainingPositon) {
                        scrollToX(maintainAtRight ? (contentWidth - paneWidth) : lastContentX, false);
                        scrollToY(maintainAtBottom ? (contentHeight - paneHeight) : lastContentY, false);
                    }

                    initFocusHandler();
                    initMousewheel();
                    initTouch();

                    if (settings.enableKeyboardNavigation) {
                        initKeyboardNav();
                    }
                    if (settings.clickOnTrack) {
                        initClickOnTrack();
                    }

                    observeHash();
                    if (settings.hijackInternalLinks) {
                        hijackInternalLinks();
                    }
                }

                if (settings.autoReinitialise && !reinitialiseInterval) {
                    reinitialiseInterval = setInterval(
						function () {
						    initialise(settings);
						},
						settings.autoReinitialiseDelay
					);
                } else if (!settings.autoReinitialise && reinitialiseInterval) {
                    clearInterval(reinitialiseInterval);
                }

                originalScrollTop && elem.scrollTop(0) && scrollToY(originalScrollTop, false);
                originalScrollLeft && elem.scrollLeft(0) && scrollToX(originalScrollLeft, false);

                elem.trigger('jsp-initialised', [isScrollableH || isScrollableV]);
            }

            function initialiseVerticalScroll() {
                if (isScrollableV) {

                    container.append(
						$('<div class="jspVerticalBar" />').append(
							$('<div class="jspCap jspCapTop" />'),
							$('<div class="jspTrack" />').append(
								$('<div class="jspDrag" />').append(
									$('<div class="jspDragTop" />'),
									$('<div class="jspDragBottom" />')
								)
							),
							$('<div class="jspCap jspCapBottom" />')
						)
					);

                    verticalBar = container.find('>.jspVerticalBar');
                    verticalTrack = verticalBar.find('>.jspTrack');
                    verticalDrag = verticalTrack.find('>.jspDrag');

                    if (settings.showArrows) {
                        arrowUp = $('<a class="jspArrow jspArrowUp" />').on(
							'mousedown.jsp', getArrowScroll(0, -1)
						).on('click.jsp', nil);
                        arrowDown = $('<a class="jspArrow jspArrowDown" />').on(
							'mousedown.jsp', getArrowScroll(0, 1)
						).on('click.jsp', nil);
                        if (settings.arrowScrollOnHover) {
                            arrowUp.on('mouseover.jsp', getArrowScroll(0, -1, arrowUp));
                            arrowDown.on('mouseover.jsp', getArrowScroll(0, 1, arrowDown));
                        }

                        appendArrows(verticalTrack, settings.verticalArrowPositions, arrowUp, arrowDown);
                    }

                    verticalTrackHeight = paneHeight;
                    container.find('>.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow').each(
						function () {
						    verticalTrackHeight -= $(this).outerHeight();
						}
					);


                    verticalDrag.hover(
						function () {
						    verticalDrag.addClass('jspHover');
						},
						function () {
						    verticalDrag.removeClass('jspHover');
						}
					).on(
						'mousedown.jsp',
						function (e) {
						    // Stop IE from allowing text selection
						    $('html').on('dragstart.jsp selectstart.jsp', nil);

						    verticalDrag.addClass('jspActive');

						    var startY = e.pageY - verticalDrag.position().top;

						    $('html').on(
								'mousemove.jsp',
								function (e) {
								    positionDragY(e.pageY - startY, false);
								}
							).on('mouseup.jsp mouseleave.jsp', cancelDrag);
						    return false;
						}
					);
                    sizeVerticalScrollbar();
                }
            }

            function sizeVerticalScrollbar() {
                verticalTrack.height(verticalTrackHeight + 'px');
                verticalDragPosition = 0;
                scrollbarWidth = settings.verticalGutter + verticalTrack.outerWidth();

                // Make the pane thinner to allow for the vertical scrollbar
                pane.width(paneWidth - scrollbarWidth - originalPaddingTotalWidth);

                // Add margin to the left of the pane if scrollbars are on that side (to position
                // the scrollbar on the left or right set it's left or right property in CSS)
                try {
                    if (verticalBar.position().left === 0) {
                        pane.css('margin-left', scrollbarWidth + 'px');
                    }
                } catch (err) {
                }
            }

            function initialiseHorizontalScroll() {
                if (isScrollableH) {

                    container.append(
						$('<div class="jspHorizontalBar" />').append(
							$('<div class="jspCap jspCapLeft" />'),
							$('<div class="jspTrack" />').append(
								$('<div class="jspDrag" />').append(
									$('<div class="jspDragLeft" />'),
									$('<div class="jspDragRight" />')
								)
							),
							$('<div class="jspCap jspCapRight" />')
						)
					);

                    horizontalBar = container.find('>.jspHorizontalBar');
                    horizontalTrack = horizontalBar.find('>.jspTrack');
                    horizontalDrag = horizontalTrack.find('>.jspDrag');

                    if (settings.showArrows) {
                        arrowLeft = $('<a class="jspArrow jspArrowLeft" />').on(
							'mousedown.jsp', getArrowScroll(-1, 0)
						).on('click.jsp', nil);
                        arrowRight = $('<a class="jspArrow jspArrowRight" />').on(
							'mousedown.jsp', getArrowScroll(1, 0)
						).on('click.jsp', nil);
                        if (settings.arrowScrollOnHover) {
                            arrowLeft.on('mouseover.jsp', getArrowScroll(-1, 0, arrowLeft));
                            arrowRight.on('mouseover.jsp', getArrowScroll(1, 0, arrowRight));
                        }
                        appendArrows(horizontalTrack, settings.horizontalArrowPositions, arrowLeft, arrowRight);
                    }

                    horizontalDrag.hover(
						function () {
						    horizontalDrag.addClass('jspHover');
						},
						function () {
						    horizontalDrag.removeClass('jspHover');
						}
					).on(
						'mousedown.jsp',
						function (e) {
						    // Stop IE from allowing text selection
						    $('html').on('dragstart.jsp selectstart.jsp', nil);

						    horizontalDrag.addClass('jspActive');

						    var startX = e.pageX - horizontalDrag.position().left;

						    $('html').on(
								'mousemove.jsp',
								function (e) {
								    positionDragX(e.pageX - startX, false);
								}
							).on('mouseup.jsp mouseleave.jsp', cancelDrag);
						    return false;
						}
					);
                    horizontalTrackWidth = container.innerWidth();
                    sizeHorizontalScrollbar();
                }
            }

            function sizeHorizontalScrollbar() {
                container.find('>.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow').each(
					function () {
					    horizontalTrackWidth -= $(this).outerWidth();
					}
				);

                horizontalTrack.width(horizontalTrackWidth + 'px');
                horizontalDragPosition = 0;
            }

            function resizeScrollbars() {
                if (isScrollableH && isScrollableV) {
                    var horizontalTrackHeight = horizontalTrack.outerHeight(),
						verticalTrackWidth = verticalTrack.outerWidth();
                    verticalTrackHeight -= horizontalTrackHeight;
                    $(horizontalBar).find('>.jspCap:visible,>.jspArrow').each(
						function () {
						    horizontalTrackWidth += $(this).outerWidth();
						}
					);
                    horizontalTrackWidth -= verticalTrackWidth;
                    paneHeight -= verticalTrackWidth;
                    paneWidth -= horizontalTrackHeight;
                    horizontalTrack.parent().append(
						$('<div class="jspCorner" />').css('width', horizontalTrackHeight + 'px')
					);
                    sizeVerticalScrollbar();
                    sizeHorizontalScrollbar();
                }
                // reflow content
                if (isScrollableH) {
                    pane.width((container.outerWidth() - originalPaddingTotalWidth) + 'px');
                }
                contentHeight = pane.outerHeight();
                percentInViewV = contentHeight / paneHeight;

                if (isScrollableH) {
                    horizontalDragWidth = Math.ceil(1 / percentInViewH * horizontalTrackWidth);
                    if (horizontalDragWidth > settings.horizontalDragMaxWidth) {
                        horizontalDragWidth = settings.horizontalDragMaxWidth;
                    } else if (horizontalDragWidth < settings.horizontalDragMinWidth) {
                        horizontalDragWidth = settings.horizontalDragMinWidth;
                    }
                    horizontalDrag.width(horizontalDragWidth + 'px');
                    dragMaxX = horizontalTrackWidth - horizontalDragWidth;
                    _positionDragX(horizontalDragPosition); // To update the state for the arrow buttons
                }
                if (isScrollableV) {
                    verticalDragHeight = Math.ceil(1 / percentInViewV * verticalTrackHeight);
                    if (verticalDragHeight > settings.verticalDragMaxHeight) {
                        verticalDragHeight = settings.verticalDragMaxHeight;
                    } else if (verticalDragHeight < settings.verticalDragMinHeight) {
                        verticalDragHeight = settings.verticalDragMinHeight;
                    }
                    verticalDrag.height(verticalDragHeight + 'px');
                    dragMaxY = verticalTrackHeight - verticalDragHeight;
                    _positionDragY(verticalDragPosition); // To update the state for the arrow buttons
                }
            }

            function appendArrows(ele, p, a1, a2) {
                var p1 = "before", p2 = "after", aTemp;

                // Sniff for mac... Is there a better way to determine whether the arrows would naturally appear
                // at the top or the bottom of the bar?
                if (p == "os") {
                    p = /Mac/.test(navigator.platform) ? "after" : "split";
                }
                if (p == p1) {
                    p2 = p;
                } else if (p == p2) {
                    p1 = p;
                    aTemp = a1;
                    a1 = a2;
                    a2 = aTemp;
                }

                ele[p1](a1)[p2](a2);
            }

            function getArrowScroll(dirX, dirY, ele) {
                return function () {
                    arrowScroll(dirX, dirY, this, ele);
                    this.blur();
                    return false;
                };
            }

            function arrowScroll(dirX, dirY, arrow, ele) {
                arrow = $(arrow).addClass('jspActive');

                var eve,
					scrollTimeout,
					isFirst = true,
					doScroll = function () {
					    if (dirX !== 0) {
					        jsp.scrollByX(dirX * settings.arrowButtonSpeed);
					    }
					    if (dirY !== 0) {
					        jsp.scrollByY(dirY * settings.arrowButtonSpeed);
					    }
					    scrollTimeout = setTimeout(doScroll, isFirst ? settings.initialDelay : settings.arrowRepeatFreq);
					    isFirst = false;
					};

                doScroll();

                eve = ele ? 'mouseout.jsp' : 'mouseup.jsp';
                ele = ele || $('html');
                ele.on(
					eve,
					function () {
					    arrow.removeClass('jspActive');
					    scrollTimeout && clearTimeout(scrollTimeout);
					    scrollTimeout = null;
					    ele.off(eve);
					}
				);
            }

            function initClickOnTrack() {
                removeClickOnTrack();
                if (isScrollableV) {
                    verticalTrack.on(
						'mousedown.jsp',
						function (e) {
						    if (e.originalTarget === undefined || e.originalTarget == e.currentTarget) {
						        var clickedTrack = $(this),
									offset = clickedTrack.offset(),
									direction = e.pageY - offset.top - verticalDragPosition,
									scrollTimeout,
									isFirst = true,
									doScroll = function () {
									    var offset = clickedTrack.offset(),
											pos = e.pageY - offset.top - verticalDragHeight / 2,
											contentDragY = paneHeight * settings.scrollPagePercent,
											dragY = dragMaxY * contentDragY / (contentHeight - paneHeight);
									    if (direction < 0) {
									        if (verticalDragPosition - dragY > pos) {
									            jsp.scrollByY(-contentDragY);
									        } else {
									            positionDragY(pos);
									        }
									    } else if (direction > 0) {
									        if (verticalDragPosition + dragY < pos) {
									            jsp.scrollByY(contentDragY);
									        } else {
									            positionDragY(pos);
									        }
									    } else {
									        cancelClick();
									        return;
									    }
									    scrollTimeout = setTimeout(doScroll, isFirst ? settings.initialDelay : settings.trackClickRepeatFreq);
									    isFirst = false;
									},
									cancelClick = function () {
									    scrollTimeout && clearTimeout(scrollTimeout);
									    scrollTimeout = null;
									    $(document).off('mouseup.jsp', cancelClick);
									};
						        doScroll();
						        $(document).on('mouseup.jsp', cancelClick);
						        return false;
						    }
						}
					);
                }

                if (isScrollableH) {
                    horizontalTrack.on(
						'mousedown.jsp',
						function (e) {
						    if (e.originalTarget === undefined || e.originalTarget == e.currentTarget) {
						        var clickedTrack = $(this),
									offset = clickedTrack.offset(),
									direction = e.pageX - offset.left - horizontalDragPosition,
									scrollTimeout,
									isFirst = true,
									doScroll = function () {
									    var offset = clickedTrack.offset(),
											pos = e.pageX - offset.left - horizontalDragWidth / 2,
											contentDragX = paneWidth * settings.scrollPagePercent,
											dragX = dragMaxX * contentDragX / (contentWidth - paneWidth);
									    if (direction < 0) {
									        if (horizontalDragPosition - dragX > pos) {
									            jsp.scrollByX(-contentDragX);
									        } else {
									            positionDragX(pos);
									        }
									    } else if (direction > 0) {
									        if (horizontalDragPosition + dragX < pos) {
									            jsp.scrollByX(contentDragX);
									        } else {
									            positionDragX(pos);
									        }
									    } else {
									        cancelClick();
									        return;
									    }
									    scrollTimeout = setTimeout(doScroll, isFirst ? settings.initialDelay : settings.trackClickRepeatFreq);
									    isFirst = false;
									},
									cancelClick = function () {
									    scrollTimeout && clearTimeout(scrollTimeout);
									    scrollTimeout = null;
									    $(document).off('mouseup.jsp', cancelClick);
									};
						        doScroll();
						        $(document).on('mouseup.jsp', cancelClick);
						        return false;
						    }
						}
					);
                }
            }

            function removeClickOnTrack() {
                if (horizontalTrack) {
                    horizontalTrack.off('mousedown.jsp');
                }
                if (verticalTrack) {
                    verticalTrack.off('mousedown.jsp');
                }
            }

            function cancelDrag() {
                $('html').off('dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp');

                if (verticalDrag) {
                    verticalDrag.removeClass('jspActive');
                }
                if (horizontalDrag) {
                    horizontalDrag.removeClass('jspActive');
                }
            }

            function positionDragY(destY, animate) {
                if (!isScrollableV) {
                    return;
                }
                if (destY < 0) {
                    destY = 0;
                } else if (destY > dragMaxY) {
                    destY = dragMaxY;
                }

                // can't just check if(animate) because false is a valid value that could be passed in...
                if (animate === undefined) {
                    animate = settings.animateScroll;
                }
                if (animate) {
                    jsp.animate(verticalDrag, 'top', destY, _positionDragY);
                } else {
                    verticalDrag.css('top', destY);
                    _positionDragY(destY);
                }

            }

            function _positionDragY(destY) {
                if (destY === undefined) {
                    destY = verticalDrag.position().top;
                }

                container.scrollTop(0);
                verticalDragPosition = destY;

                var isAtTop = verticalDragPosition === 0,
					isAtBottom = verticalDragPosition == dragMaxY,
					percentScrolled = destY / dragMaxY,
					destTop = -percentScrolled * (contentHeight - paneHeight);

                if (wasAtTop != isAtTop || wasAtBottom != isAtBottom) {
                    wasAtTop = isAtTop;
                    wasAtBottom = isAtBottom;
                    elem.trigger('jsp-arrow-change', [wasAtTop, wasAtBottom, wasAtLeft, wasAtRight]);
                }

                updateVerticalArrows(isAtTop, isAtBottom);
                pane.css('top', destTop);
                elem.trigger('jsp-scroll-y', [-destTop, isAtTop, isAtBottom]).trigger('scroll');
            }

            function positionDragX(destX, animate) {
                if (!isScrollableH) {
                    return;
                }
                if (destX < 0) {
                    destX = 0;
                } else if (destX > dragMaxX) {
                    destX = dragMaxX;
                }

                if (animate === undefined) {
                    animate = settings.animateScroll;
                }
                if (animate) {
                    jsp.animate(horizontalDrag, 'left', destX, _positionDragX);
                } else {
                    horizontalDrag.css('left', destX);
                    _positionDragX(destX);
                }
            }

            function _positionDragX(destX) {
                if (destX === undefined) {
                    destX = horizontalDrag.position().left;
                }

                container.scrollTop(0);
                horizontalDragPosition = destX;

                var isAtLeft = horizontalDragPosition === 0,
					isAtRight = horizontalDragPosition == dragMaxX,
					percentScrolled = destX / dragMaxX,
					destLeft = -percentScrolled * (contentWidth - paneWidth);

                if (wasAtLeft != isAtLeft || wasAtRight != isAtRight) {
                    wasAtLeft = isAtLeft;
                    wasAtRight = isAtRight;
                    elem.trigger('jsp-arrow-change', [wasAtTop, wasAtBottom, wasAtLeft, wasAtRight]);
                }

                updateHorizontalArrows(isAtLeft, isAtRight);
                pane.css('left', destLeft);
                elem.trigger('jsp-scroll-x', [-destLeft, isAtLeft, isAtRight]).trigger('scroll');
            }

            function updateVerticalArrows(isAtTop, isAtBottom) {
                if (settings.showArrows) {
                    arrowUp[isAtTop ? 'addClass' : 'removeClass']('jspDisabled');
                    arrowDown[isAtBottom ? 'addClass' : 'removeClass']('jspDisabled');
                }
            }

            function updateHorizontalArrows(isAtLeft, isAtRight) {
                if (settings.showArrows) {
                    arrowLeft[isAtLeft ? 'addClass' : 'removeClass']('jspDisabled');
                    arrowRight[isAtRight ? 'addClass' : 'removeClass']('jspDisabled');
                }
            }

            function scrollToY(destY, animate) {
                var percentScrolled = destY / (contentHeight - paneHeight);
                positionDragY(percentScrolled * dragMaxY, animate);
            }

            function scrollToX(destX, animate) {
                var percentScrolled = destX / (contentWidth - paneWidth);
                positionDragX(percentScrolled * dragMaxX, animate);
            }

            function scrollToElement(ele, stickToTop, animate) {
                var e, eleHeight, eleWidth, eleTop = 0, eleLeft = 0, viewportTop, viewportLeft, maxVisibleEleTop, maxVisibleEleLeft, destY, destX;

                // Legal hash values aren't necessarily legal jQuery selectors so we need to catch any
                // errors from the lookup...
                try {
                    e = $(ele);
                } catch (err) {
                    return;
                }
                eleHeight = e.outerHeight();
                eleWidth = e.outerWidth();

                container.scrollTop(0);
                container.scrollLeft(0);

                // loop through parents adding the offset top of any elements that are relatively positioned between
                // the focused element and the jspPane so we can get the true distance from the top
                // of the focused element to the top of the scrollpane...
                while (!e.is('.jspPane')) {
                    eleTop += e.position().top;
                    eleLeft += e.position().left;
                    e = e.offsetParent();
                    if (/^body|html$/i.test(e[0].nodeName)) {
                        // we ended up too high in the document structure. Quit!
                        return;
                    }
                }

                viewportTop = contentPositionY();
                maxVisibleEleTop = viewportTop + paneHeight;
                if (eleTop < viewportTop || stickToTop) { // element is above viewport
                    destY = eleTop - settings.verticalGutter;
                } else if (eleTop + eleHeight > maxVisibleEleTop) { // element is below viewport
                    destY = eleTop - paneHeight + eleHeight + settings.verticalGutter;
                }
                if (destY) {
                    scrollToY(destY, animate);
                }

                viewportLeft = contentPositionX();
                maxVisibleEleLeft = viewportLeft + paneWidth;
                if (eleLeft < viewportLeft || stickToTop) { // element is to the left of viewport
                    destX = eleLeft - settings.horizontalGutter;
                } else if (eleLeft + eleWidth > maxVisibleEleLeft) { // element is to the right viewport
                    destX = eleLeft - paneWidth + eleWidth + settings.horizontalGutter;
                }
                if (destX) {
                    scrollToX(destX, animate);
                }

            }

            function contentPositionX() {
                return -pane.position().left;
            }

            function contentPositionY() {
                return -pane.position().top;
            }

            function isCloseToBottom() {
                var scrollableHeight = contentHeight - paneHeight;
                return (scrollableHeight > 20) && (scrollableHeight - contentPositionY() < 10);
            }

            function isCloseToRight() {
                var scrollableWidth = contentWidth - paneWidth;
                return (scrollableWidth > 20) && (scrollableWidth - contentPositionX() < 10);
            }

            function initMousewheel() {
                container.off(mwEvent).on(
					mwEvent,
					function (event, delta, deltaX, deltaY) {
					    var dX = horizontalDragPosition, dY = verticalDragPosition;
					    jsp.scrollBy(deltaX * settings.mouseWheelSpeed, -deltaY * settings.mouseWheelSpeed, false);
					    // return true if there was no movement so rest of screen can scroll
					    return dX == horizontalDragPosition && dY == verticalDragPosition;
					}
				);
            }

            function removeMousewheel() {
                container.off(mwEvent);
            }

            function nil() {
                return false;
            }

            function initFocusHandler() {
                pane.find(':input,a').off('focus.jsp').on(
					'focus.jsp',
					function (e) {
					    scrollToElement(e.target, false);
					}
				);
            }

            function removeFocusHandler() {
                pane.find(':input,a').off('focus.jsp');
            }

            function initKeyboardNav() {
                var keyDown, elementHasScrolled, validParents = [];
                isScrollableH && validParents.push(horizontalBar[0]);
                isScrollableV && validParents.push(verticalBar[0]);

                // IE also focuses elements that don't have tabindex set.
                pane.focus(
					function () {
					    elem.focus();
					}
				);

                elem.attr('tabindex', 0)
					.off('keydown.jsp keypress.jsp')
					.on(
						'keydown.jsp',
						function (e) {
						    if (e.target !== this && !(validParents.length && $(e.target).closest(validParents).length)) {
						        return;
						    }
						    var dX = horizontalDragPosition, dY = verticalDragPosition;
						    switch (e.keyCode) {
						        case 40: // down
						        case 38: // up
						        case 34: // page down
						        case 32: // space
						        case 33: // page up
						        case 39: // right
						        case 37: // left
						            keyDown = e.keyCode;
						            keyDownHandler();
						            break;
						        case 35: // end
						            scrollToY(contentHeight - paneHeight);
						            keyDown = null;
						            break;
						        case 36: // home
						            scrollToY(0);
						            keyDown = null;
						            break;
						    }

						    elementHasScrolled = e.keyCode == keyDown && dX != horizontalDragPosition || dY != verticalDragPosition;
						    return !elementHasScrolled;
						}
					).off(
						'keypress.jsp', // For FF/ OSX so that we can cancel the repeat key presses if the JSP scrolls...
						function (e) {
						    if (e.keyCode == keyDown) {
						        keyDownHandler();
						    }
						    return !elementHasScrolled;
						}
					);

                if (settings.hideFocus) {
                    elem.css('outline', 'none');
                    if ('hideFocus' in container[0]) {
                        elem.attr('hideFocus', true);
                    }
                } else {
                    elem.css('outline', '');
                    if ('hideFocus' in container[0]) {
                        elem.attr('hideFocus', false);
                    }
                }

                function keyDownHandler() {
                    var dX = horizontalDragPosition, dY = verticalDragPosition;
                    switch (keyDown) {
                        case 40: // down
                            jsp.scrollByY(settings.keyboardSpeed, false);
                            break;
                        case 38: // up
                            jsp.scrollByY(-settings.keyboardSpeed, false);
                            break;
                        case 34: // page down
                        case 32: // space
                            jsp.scrollByY(paneHeight * settings.scrollPagePercent, false);
                            break;
                        case 33: // page up
                            jsp.scrollByY(-paneHeight * settings.scrollPagePercent, false);
                            break;
                        case 39: // right
                            jsp.scrollByX(settings.keyboardSpeed, false);
                            break;
                        case 37: // left
                            jsp.scrollByX(-settings.keyboardSpeed, false);
                            break;
                    }

                    elementHasScrolled = dX != horizontalDragPosition || dY != verticalDragPosition;
                    return elementHasScrolled;
                }
            }

            function removeKeyboardNav() {
                elem.attr('tabindex', '-1')
					.removeAttr('tabindex')
					.off('keydown.jsp keypress.jsp');
            }

            function observeHash() {
                if (location.hash && location.hash.length > 1) {
                    var e,
						retryInt,
						hash = escape(location.hash.substr(1)) // hash must be escaped to prevent XSS
                    ;
                    try {
                        e = $('#' + hash + ', a[name="' + hash + '"]');
                    } catch (err) {
                        return;
                    }

                    if (e.length && pane.find(hash)) {
                        // nasty workaround but it appears to take a little while before the hash has done its thing
                        // to the rendered page so we just wait until the container's scrollTop has been messed up.
                        if (container.scrollTop() === 0) {
                            retryInt = setInterval(
								function () {
								    if (container.scrollTop() > 0) {
								        scrollToElement(e, true);
								        $(document).scrollTop(container.position().top);
								        clearInterval(retryInt);
								    }
								},
								50
							);
                        } else {
                            scrollToElement(e, true);
                            $(document).scrollTop(container.position().top);
                        }
                    }
                }
            }

            function hijackInternalLinks() {
                // only register the link handler once
                if ($(document.body).data('jspHijack')) {
                    return;
                }

                // remember that the handler was bound
                $(document.body).data('jspHijack', true);

                // use live handler to also capture newly created links
                $(document.body).delegate('a[href*=#]', 'click', function (event) {
                    // does the link point to the same page?
                    // this also takes care of cases with a <base>-Tag or Links not starting with the hash #
                    // e.g. <a href="index.html#test"> when the current url already is index.html
                    var href = this.href.substr(0, this.href.indexOf('#')),
						locationHref = location.href,
						hash,
						element,
						container,
						jsp,
						scrollTop,
						elementTop;
                    if (location.href.indexOf('#') !== -1) {
                        locationHref = location.href.substr(0, location.href.indexOf('#'));
                    }
                    if (href !== locationHref) {
                        // the link points to another page
                        return;
                    }

                    // check if jScrollPane should handle this click event
                    hash = escape(this.href.substr(this.href.indexOf('#') + 1));

                    // find the element on the page
                    element;
                    try {
                        element = $('#' + hash + ', a[name="' + hash + '"]');
                    } catch (e) {
                        // hash is not a valid jQuery identifier
                        return;
                    }

                    if (!element.length) {
                        // this link does not point to an element on this page
                        return;
                    }

                    container = element.closest('.jspScrollable');
                    jsp = container.data('jsp');

                    // jsp might be another jsp instance than the one, that bound this event
                    // remember: this event is only bound once for all instances.
                    jsp.scrollToElement(element, true);

                    if (container[0].scrollIntoView) {
                        // also scroll to the top of the container (if it is not visible)
                        scrollTop = $(window).scrollTop();
                        elementTop = element.offset().top;
                        if (elementTop < scrollTop || elementTop > scrollTop + $(window).height()) {
                            container[0].scrollIntoView();
                        }
                    }

                    // jsp handled this event, prevent the browser default (scrolling :P)
                    event.preventDefault();
                });
            }

            // Init touch on iPad, iPhone, iPod, Android
            function initTouch() {
                var startX,
					startY,
					touchStartX,
					touchStartY,
					moved,
					moving = false;

                container.off('touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick').on(
					'touchstart.jsp',
					function (e) {
					    var touch = e.originalEvent.touches[0];
					    startX = contentPositionX();
					    startY = contentPositionY();
					    touchStartX = touch.pageX;
					    touchStartY = touch.pageY;
					    moved = false;
					    moving = true;
					}
				).on(
					'touchmove.jsp',
					function (ev) {
					    if (!moving) {
					        return;
					    }

					    var touchPos = ev.originalEvent.touches[0],
							dX = horizontalDragPosition, dY = verticalDragPosition;

					    jsp.scrollTo(startX + touchStartX - touchPos.pageX, startY + touchStartY - touchPos.pageY);

					    moved = moved || Math.abs(touchStartX - touchPos.pageX) > 5 || Math.abs(touchStartY - touchPos.pageY) > 5;

					    // return true if there was no movement so rest of screen can scroll
					    return dX == horizontalDragPosition && dY == verticalDragPosition;
					}
				).on(
					'touchend.jsp',
					function (e) {
					    moving = false;
					    /*if(moved) {
							return false;
						}*/
					}
				).on(
					'click.jsp-touchclick',
					function (e) {
					    if (moved) {
					        moved = false;
					        return false;
					    }
					}
				);
            }

            function destroy() {
                var currentY = contentPositionY(),
					currentX = contentPositionX();
                elem.removeClass('jspScrollable').off('.jsp');
                elem.replaceWith(originalElement.append(pane.children()));
                originalElement.scrollTop(currentY);
                originalElement.scrollLeft(currentX);

                // clear reinitialize timer if active
                if (reinitialiseInterval) {
                    clearInterval(reinitialiseInterval);
                }
            }

            // Public API
            $.extend(
				jsp,
				{
				    // Reinitialises the scroll pane (if it's internal dimensions have changed since the last time it
				    // was initialised). The settings object which is passed in will override any settings from the
				    // previous time it was initialised - if you don't pass any settings then the ones from the previous
				    // initialisation will be used.
				    reinitialise: function (s) {
				        s = $.extend({}, settings, s);
				        initialise(s);
				    },
				    // Scrolls the specified element (a jQuery object, DOM node or jQuery selector string) into view so
				    // that it can be seen within the viewport. If stickToTop is true then the element will appear at
				    // the top of the viewport, if it is false then the viewport will scroll as little as possible to
				    // show the element. You can also specify if you want animation to occur. If you don't provide this
				    // argument then the animateScroll value from the settings object is used instead.
				    scrollToElement: function (ele, stickToTop, animate) {
				        scrollToElement(ele, stickToTop, animate);
				    },
				    // Scrolls the pane so that the specified co-ordinates within the content are at the top left
				    // of the viewport. animate is optional and if not passed then the value of animateScroll from
				    // the settings object this jScrollPane was initialised with is used.
				    scrollTo: function (destX, destY, animate) {
				        scrollToX(destX, animate);
				        scrollToY(destY, animate);
				    },
				    // Scrolls the pane so that the specified co-ordinate within the content is at the left of the
				    // viewport. animate is optional and if not passed then the value of animateScroll from the settings
				    // object this jScrollPane was initialised with is used.
				    scrollToX: function (destX, animate) {
				        scrollToX(destX, animate);
				    },
				    // Scrolls the pane so that the specified co-ordinate within the content is at the top of the
				    // viewport. animate is optional and if not passed then the value of animateScroll from the settings
				    // object this jScrollPane was initialised with is used.
				    scrollToY: function (destY, animate) {
				        scrollToY(destY, animate);
				    },
				    // Scrolls the pane to the specified percentage of its maximum horizontal scroll position. animate
				    // is optional and if not passed then the value of animateScroll from the settings object this
				    // jScrollPane was initialised with is used.
				    scrollToPercentX: function (destPercentX, animate) {
				        scrollToX(destPercentX * (contentWidth - paneWidth), animate);
				    },
				    // Scrolls the pane to the specified percentage of its maximum vertical scroll position. animate
				    // is optional and if not passed then the value of animateScroll from the settings object this
				    // jScrollPane was initialised with is used.
				    scrollToPercentY: function (destPercentY, animate) {
				        scrollToY(destPercentY * (contentHeight - paneHeight), animate);
				    },
				    // Scrolls the pane by the specified amount of pixels. animate is optional and if not passed then
				    // the value of animateScroll from the settings object this jScrollPane was initialised with is used.
				    scrollBy: function (deltaX, deltaY, animate) {
				        jsp.scrollByX(deltaX, animate);
				        jsp.scrollByY(deltaY, animate);
				    },
				    // Scrolls the pane by the specified amount of pixels. animate is optional and if not passed then
				    // the value of animateScroll from the settings object this jScrollPane was initialised with is used.
				    scrollByX: function (deltaX, animate) {
				        var destX = contentPositionX() + Math[deltaX < 0 ? 'floor' : 'ceil'](deltaX),
							percentScrolled = destX / (contentWidth - paneWidth);
				        positionDragX(percentScrolled * dragMaxX, animate);
				    },
				    // Scrolls the pane by the specified amount of pixels. animate is optional and if not passed then
				    // the value of animateScroll from the settings object this jScrollPane was initialised with is used.
				    scrollByY: function (deltaY, animate) {
				        var destY = contentPositionY() + Math[deltaY < 0 ? 'floor' : 'ceil'](deltaY),
							percentScrolled = destY / (contentHeight - paneHeight);
				        positionDragY(percentScrolled * dragMaxY, animate);
				    },
				    // Positions the horizontal drag at the specified x position (and updates the viewport to reflect
				    // this). animate is optional and if not passed then the value of animateScroll from the settings
				    // object this jScrollPane was initialised with is used.
				    positionDragX: function (x, animate) {
				        positionDragX(x, animate);
				    },
				    // Positions the vertical drag at the specified y position (and updates the viewport to reflect
				    // this). animate is optional and if not passed then the value of animateScroll from the settings
				    // object this jScrollPane was initialised with is used.
				    positionDragY: function (y, animate) {
				        positionDragY(y, animate);
				    },
				    // This method is called when jScrollPane is trying to animate to a new position. You can override
				    // it if you want to provide advanced animation functionality. It is passed the following arguments:
				    //  * ele          - the element whose position is being animated
				    //  * prop         - the property that is being animated
				    //  * value        - the value it's being animated to
				    //  * stepCallback - a function that you must execute each time you update the value of the property
				    // You can use the default implementation (below) as a starting point for your own implementation.
				    animate: function (ele, prop, value, stepCallback) {
				        var params = {};
				        params[prop] = value;
				        ele.animate(
							params,
							{
							    'duration': settings.animateDuration,
							    'easing': settings.animateEase,
							    'queue': false,
							    'step': stepCallback
							}
						);
				    },
				    // Returns the current x position of the viewport with regards to the content pane.
				    getContentPositionX: function () {
				        return contentPositionX();
				    },
				    // Returns the current y position of the viewport with regards to the content pane.
				    getContentPositionY: function () {
				        return contentPositionY();
				    },
				    // Returns the width of the content within the scroll pane.
				    getContentWidth: function () {
				        return contentWidth;
				    },
				    // Returns the height of the content within the scroll pane.
				    getContentHeight: function () {
				        return contentHeight;
				    },
				    // Returns the horizontal position of the viewport within the pane content.
				    getPercentScrolledX: function () {
				        return contentPositionX() / (contentWidth - paneWidth);
				    },
				    // Returns the vertical position of the viewport within the pane content.
				    getPercentScrolledY: function () {
				        return contentPositionY() / (contentHeight - paneHeight);
				    },
				    // Returns whether or not this scrollpane has a horizontal scrollbar.
				    getIsScrollableH: function () {
				        return isScrollableH;
				    },
				    // Returns whether or not this scrollpane has a vertical scrollbar.
				    getIsScrollableV: function () {
				        return isScrollableV;
				    },
				    // Gets a reference to the content pane. It is important that you use this method if you want to
				    // edit the content of your jScrollPane as if you access the element directly then you may have some
				    // problems (as your original element has had additional elements for the scrollbars etc added into
				    // it).
				    getContentPane: function () {
				        return pane;
				    },
				    // Scrolls this jScrollPane down as far as it can currently scroll. If animate isn't passed then the
				    // animateScroll value from settings is used instead.
				    scrollToBottom: function (animate) {
				        positionDragY(dragMaxY, animate);
				    },
				    // Hijacks the links on the page which link to content inside the scrollpane. If you have changed
				    // the content of your page (e.g. via AJAX) and want to make sure any new anchor links to the
				    // contents of your scroll pane will work then call this function.
				    hijackInternalLinks: $.noop,
				    // Removes the jScrollPane and returns the page to the state it was in before jScrollPane was
				    // initialised.
				    destroy: function () {
				        destroy();
				    }
				}
			);

            initialise(s);
        }

        // Pluginifying code...
        settings = $.extend({}, $.fn.jScrollPane.defaults, settings);

        // Apply default speed
        $.each(['mouseWheelSpeed', 'arrowButtonSpeed', 'trackClickSpeed', 'keyboardSpeed'], function () {
            settings[this] = settings[this] || settings.speed;
        });

        return this.each(
			function () {
			    var elem = $(this), jspApi = elem.data('jsp');
			    if (jspApi) {
			        jspApi.reinitialise(settings);
			    } else {
			        $("script", elem).filter('[type="text/javascript"], :not([type])').remove();
			        jspApi = new JScrollPane(elem, settings);
			        elem.data('jsp', jspApi);
			    }
			}
		);
    };

    $.fn.jScrollPane.defaults = {
        showArrows: false,
        maintainPosition: true,
        stickToBottom: false,
        stickToRight: false,
        clickOnTrack: true,
        autoReinitialise: false,
        autoReinitialiseDelay: 500,
        verticalDragMinHeight: 30,
        verticalDragMaxHeight: 99999,
        horizontalDragMinWidth: 30,
        horizontalDragMaxWidth: 99999,
        contentWidth: undefined,
        animateScroll: false,
        animateDuration: 300,
        animateEase: 'linear',
        hijackInternalLinks: false,
        verticalGutter: 4,
        horizontalGutter: 4,
        mouseWheelSpeed: 0,
        arrowButtonSpeed: 0,
        arrowRepeatFreq: 50,
        arrowScrollOnHover: false,
        trackClickSpeed: 0,
        trackClickRepeatFreq: 70,
        verticalArrowPositions: 'split',
        horizontalArrowPositions: 'split',
        enableKeyboardNavigation: true,
        hideFocus: false,
        keyboardSpeed: 0,
        initialDelay: 300,        // Delay before starting repeating
        speed: 30,		// Default speed when others falsey
        scrollPagePercent: .8		// Percent of visible area scrolled when pageUp/Down or track area pressed
    };

})(jQuery);

(function ($) {
    $.fn.dnnSettingDropdown = function () {
        var clicked = function () {
            if ($(this).hasClass('dnnButtonDropdown')) {
                $(this).removeClass('dnnButtonDropdown').addClass('dnnButtonDropdown-clicked');
                $(this).next().show();
            }
        };

        var hideDropdown = function () {
            var btn = $(this).children(':first');
            if (btn.hasClass('dnnButtonDropdown-clicked')) {
                btn.removeClass('dnnButtonDropdown-clicked').addClass('dnnButtonDropdown');
                btn.next().fadeOut();
            }
        };

        var hoverConfig = {
            over: function () {
            },
            out: hideDropdown,
            timout: 600
        };

        return $(this).each(function () {
            $(this).off('click', clicked).on('click', clicked);
            $(this).parent().hoverIntent(hoverConfig);
        });
    };
})(jQuery);

(function ($) {
    $.fn.onEnter = function (fn) {
        return this.each(function () {
            var $this = $(this);
            $this.on('onEnter', fn);
            $this.keydown(function (e) {
                if ((e.which && e.which === 13) || (e.keyCode && e.keyCode === 13)) {
                    e.preventDefault();
                    e.stopPropagation();
                    $this.trigger('onEnter');
                }
            });
        });
    };
})(jQuery);

(function ($) {
    $.extend({
        onAjaxError: function (jqXhr, textStatus, errorThrown) {
            var title, text;
            if (jqXhr && jqXhr.status === 401) {
                dnnModal.show('../Login.aspx' + '?popUp=true', true, 300, 650, true, '');
                return;
            }
            if (jqXhr && jqXhr.responseText && jqXhr.statusText) {
                try {
                    title = jqXhr.statusText + " (" + jqXhr.status + ")";
                    text = JSON.parse(jqXhr.responseText).Message;
                }
                catch (e) {
                    text = errorThrown;
                }
            }
            $.dnnAlert({ title: title || "Error", text: text || "Unknown error" });
        }
    });
})(jQuery);

(function ($) {
	$.fn.dnnSliderInput = function (options) {
		var sliderOptions = $.extend({}, $.fn.dnnSliderInput.defaults, options);
    	return $(this).each(function () {
    		var $this = $(this);
		    var value = $this.val();
		    var $slider = $('<div class="dnnSliderInput"></div>');
		    $this.hide().after($slider);

		    $slider.slider(sliderOptions);
		    $slider.slider('value', value);

		    var $tooltip = $('<span class="dnnTooltip"><span class="dnnFormHelpContent dnnClear"><span class="dnnHelpText bottomArrow"></span></span></span>');

		    var calcTooltipPosition = function () {
			    setTimeout(function() {
				    var left = $slider.find('.ui-slider-handle')[0].style.left;
				    $tooltip.css('left', left);
			    }, 0);
		    };

		    $tooltip.find('.dnnHelpText').html(value);
		    $tooltip.data('initialized', true);
			$slider.append($tooltip);

		    calcTooltipPosition();
		    $slider.on('slide', function(event, ui) {
		    	$tooltip.find('.dnnHelpText').html(ui.value);
		    	$this.val(ui.value);
			    calcTooltipPosition();
		    });
	    });
    };

	$.fn.dnnSliderInput.defaults = {
		min: 0,
		max: 100,
		step: 1
	}
})(jQuery);

// please keep this func at last of this file, thanks
(function ($) {
    /* Start customised controls */
    var inputFocusFix = function () {
        var errorMsg = $(this).next();
        if (errorMsg.hasClass('dnnFormError'))
            errorMsg.hide();
    };
    var throttle = null;
    var dnnInitCustomisedCtrls = function () {
        if (throttle != null) {
            clearTimeout(throttle);
            throttle = null;
        }
        throttle = setTimeout(function () {
            $('.dnnForm input[type="checkbox"]').dnnCheckbox();
            $('.dnnForm input[type="radio"]').dnnCheckbox({ cls: 'dnnRadiobutton' });
            $('.dnnTooltip').dnnTooltip();
            $('.dnnForm input[type="text"], .dnnForm input[type="password"]').off('focus', inputFocusFix).on('focus', inputFocusFix);
            $('.dnnForm :file').dnnFileInput();
	        $('.dnnForm input[data-default]').dnnPlaceholder();
        }, 200);
        //change the window confirm style to DNN style
        $("*[onclick*='return confirm']").each(function () {
            var instance = $(this);
            var isButton = this.nodeName.toLowerCase() == "img" || this.nodeName.toLowerCase() == "input";
            var script = /return confirm\((['"])([\s\S]*?)\1\)/g.exec(instance.attr("onclick"));
            if (script != null) {
                var confirmContent = script[2].split("\\" + script[1]).join(script[1]);
                //restore unicode chars.
                confirmContent = confirmContent.replace(/\\u([\d\w]{4})/gi, function(match, charCode) {
                    return String.fromCharCode(parseInt(charCode, 16));
                });
                instance.attr("onclick", instance.attr("onclick").replace(script[0], "void(0)")).dnnConfirm({
                    text: confirmContent,
                    isButton: isButton
                });
            }
        });
    };
    var saveRgDataDivScrollTop = function () {
        window.__rgDataDivScrollTopPersistArray = [];
        $('.rgDataDiv').each(function () {
            var $this = $(this);
            var ele = $this.get(0);
            if (ele.scrollPane) {
                var api = ele.scrollPane.data('jsp');
                var y = api.getContentPositionY();
                window.__rgDataDivScrollTopPersistArray.push(y);
            }
        });
    };

    var handlerSendVerificationMailLink = function() {
        $(document.body).on('click', 'a.send-verification-mail', function(e) {
            e.preventDefault();

            var service = $.dnnSF();
            var url = service.getServiceRoot('InternalServices') + 'NewUserNotificationService/SendVerificationMail';
            var antiForgeryToken = $('input[name="__RequestVerificationToken"]').val();
            url += '?__RequestVerificationToken=' + antiForgeryToken;

            $.ajax({
                url: url,
                beforeSend: service ? service.setModuleHeaders : null,
                success: function(data) {
                    $.dnnAlert({ text: data.Result });
                },
                error: function (xhr, textStatus, errorThrown) {
                    if (xhr && xhr.responseText) {
                        $.dnnAlert({ text: eval('(' + xhr.responseText + ')').Message });
                    }
                },
                type: 'POST',
                dataType: 'json',
                contentType: "application/json"
            });
        });
    };

    window.__rgDataDivScrollTopPersistArray = [];
    $(document).ajaxComplete(dnnInitCustomisedCtrls);
    Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(saveRgDataDivScrollTop);
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(dnnInitCustomisedCtrls);
    $(dnnInitCustomisedCtrls);
    handlerSendVerificationMailLink();
})(jQuery);
;;;!function (jQuery) { var $ = jQuery; window.averta = {}, function ($) { function getVendorPrefix() { if ("result" in arguments.callee) return arguments.callee.result; var t = /^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/, i = document.getElementsByTagName("script")[0]; for (var e in i.style) if (t.test(e)) return arguments.callee.result = e.match(t)[0]; return "WebkitOpacity" in i.style ? arguments.callee.result = "Webkit" : "KhtmlOpacity" in i.style ? arguments.callee.result = "Khtml" : arguments.callee.result = "" } function checkStyleValue(t) { var i = (document.body || document.documentElement).style, e = t; if ("string" == typeof i[e]) return !0; v = ["Moz", "Webkit", "Khtml", "O", "ms"], e = e.charAt(0).toUpperCase() + e.substr(1); for (var s = 0; s < v.length; s++)if ("string" == typeof i[v[s] + e]) return !0; return !1 } function supportsTransitions() { return checkStyleValue("transition") } function supportsTransforms() { return checkStyleValue("transform") } function supports3DTransforms() { if (!supportsTransforms()) return !1; var t, i = document.createElement("i"), e = { WebkitTransform: "-webkit-transform", OTransform: "-o-transform", MSTransform: "-ms-transform", msTransform: "-ms-transform", MozTransform: "-moz-transform", Transform: "transform", transform: "transform" }; i.style.display = "block", document.body.insertBefore(i, null); for (var s in e) void 0 !== i.style[s] && (i.style[s] = "translate3d(1px,1px,1px)", t = window.getComputedStyle(i).getPropertyValue(e[s])); return document.body.removeChild(i), null != t && t.length > 0 && "none" !== t } window.package = function (t) { window[t] || (window[t] = {}) }; var extend = function (t, i) { for (var e in i) t[e] = i[e] }; Function.prototype.extend = function (t) { "function" == typeof t.prototype.constructor ? (extend(this.prototype, t.prototype), this.prototype.constructor = this) : (this.prototype.extend(t), this.prototype.constructor = this) }; var trans = { Moz: "-moz-", Webkit: "-webkit-", Khtml: "-khtml-", O: "-o-", ms: "-ms-", Icab: "-icab-" }; window._mobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), window._touch = "ontouchstart" in document, $(document).ready(function () { window._jcsspfx = getVendorPrefix(), window._csspfx = trans[window._jcsspfx], window._cssanim = supportsTransitions(), window._css3d = supports3DTransforms(), window._css2d = supportsTransforms() }), window.parseQueryString = function (t) { var i = {}; return t.replace(new RegExp("([^?=&]+)(=([^&]*))?", "g"), function (t, e, s, n) { i[e] = n }), i }; var fps60 = 50 / 3; if (window.requestAnimationFrame || (window.requestAnimationFrame = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (t, i) { window.setTimeout(t, fps60) }), window.getComputedStyle || (window.getComputedStyle = function (t, i) { return this.el = t, this.getPropertyValue = function (i) { var e = /(\-([a-z]){1})/g; return "float" == i && (i = "styleFloat"), e.test(i) && (i = i.replace(e, function () { return arguments[2].toUpperCase() })), t.currentStyle[i] ? t.currentStyle[i] : null }, t.currentStyle }), Array.prototype.indexOf || (Array.prototype.indexOf = function (t) { var i = this.length >>> 0, e = Number(arguments[1]) || 0; for ((e = e < 0 ? Math.ceil(e) : Math.floor(e)) < 0 && (e += i); e < i; e++)if (e in this && this[e] === t) return e; return -1 }), window.isMSIE = function (version) { if (!$.browser.msie) return !1; if (!version) return !0; var ieVer = $.browser.version.slice(0, $.browser.version.indexOf(".")); return "string" == typeof version ? -1 !== version.indexOf("<") || -1 !== version.indexOf(">") ? eval(ieVer + version) : eval(version + "==" + ieVer) : version == ieVer }, $.removeDataAttrs = function (t, i) { var e, s, n = [], o = t[0].attributes, a = o.length; for (i = i || [], e = 0; e < a; e++)"data-" === (s = o[e].name).substring(0, 5) && -1 === i.indexOf(s) && n.push(o[e].name); $.each(n, function (i, e) { t.removeAttr(e) }) }, jQuery) { $.jqLoadFix = function () { if (this.complete) { var t = this; setTimeout(function () { $(t).trigger("load") }, 1) } }, jQuery.uaMatch = jQuery.uaMatch || function (t) { t = t.toLowerCase(); var i = /(chrome)[ \/]([\w.]+)/.exec(t) || /(webkit)[ \/]([\w.]+)/.exec(t) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(t) || /(msie) ([\w.]+)/.exec(t) || t.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t) || []; return { browser: i[1] || "", version: i[2] || "0" } }, matched = jQuery.uaMatch(navigator.userAgent), browser = {}, matched.browser && (browser[matched.browser] = !0, browser.version = matched.version), browser.chrome ? browser.webkit = !0 : browser.webkit && (browser.safari = !0); var isIE11 = !!navigator.userAgent.match(/Trident\/7\./); isIE11 && (browser.msie = "true", delete browser.mozilla), jQuery.browser = browser, $.fn.preloadImg = function (t, i) { return this.each(function () { var e = $(this), s = this, n = new Image; n.onload = function (o) { null == o && (o = {}), e.attr("src", t), o.width = n.width, o.height = n.height, e.data("width", n.width), e.data("height", n.height), setTimeout(function () { i.call(s, o) }, 50), n = null }, n.src = t }), this } } }(jQuery), function () { "use strict"; averta.EventDispatcher = function () { this.listeners = {} }, averta.EventDispatcher.extend = function (t) { var i = new averta.EventDispatcher; for (var e in i) "constructor" != e && (t[e] = averta.EventDispatcher.prototype[e]) }, averta.EventDispatcher.prototype = { constructor: averta.EventDispatcher, addEventListener: function (t, i, e) { this.listeners[t] || (this.listeners[t] = []), this.listeners[t].push({ listener: i, ref: e }) }, removeEventListener: function (t, i, e) { if (this.listeners[t]) { for (var s = 0; s < this.listeners[t].length; ++s)i === this.listeners[t][s].listener && e === this.listeners[t][s].ref && this.listeners[t].splice(s--, 1); 0 === this.listeners[t].length && (this.listeners[t] = null) } }, dispatchEvent: function (t) { if (t.target = this, this.listeners[t.type]) for (var i = 0, e = this.listeners[t.type].length; i < e; ++i)this.listeners[t.type][i].listener.call(this.listeners[t.type][i].ref, t) } } }(), function (t) { "use strict"; var i = "ontouchstart" in document, e = window.navigator.pointerEnabled, s = !e && window.navigator.msPointerEnabled, n = e || s, o = (e ? "pointerdown " : "") + (s ? "MSPointerDown " : "") + (i ? "touchstart " : "") + "mousedown", a = (e ? "pointermove " : "") + (s ? "MSPointerMove " : "") + (i ? "touchmove " : "") + "mousemove", r = (e ? "pointerup " : "") + (s ? "MSPointerUp " : "") + (i ? "touchend " : "") + "mouseup", h = (e ? "pointercancel " : "") + (s ? "MSPointerCancel " : "") + "touchcancel"; averta.TouchSwipe = function (t) { this.$element = t, this.enabled = !0, t.bind(o, { target: this }, this.__touchStart), t[0].swipe = this, this.onSwipe = null, this.swipeType = "horizontal", this.noSwipeSelector = "input, textarea, button, .no-swipe, .ms-no-swipe", this.lastStatus = {} }; var l = averta.TouchSwipe.prototype; l.getDirection = function (t, i) { switch (this.swipeType) { case "horizontal": return t <= this.start_x ? "left" : "right"; case "vertical": return i <= this.start_y ? "up" : "down"; case "all": return Math.abs(t - this.start_x) > Math.abs(i - this.start_y) ? t <= this.start_x ? "left" : "right" : i <= this.start_y ? "up" : "down" } }, l.priventDefultEvent = function (t, i) { var e = Math.abs(t - this.start_x) > Math.abs(i - this.start_y); return "horizontal" === this.swipeType && e || "vertical" === this.swipeType && !e }, l.createStatusObject = function (t) { var i, e, s = {}; return i = this.lastStatus.distanceX || 0, e = this.lastStatus.distanceY || 0, s.distanceX = t.pageX - this.start_x, s.distanceY = t.pageY - this.start_y, s.moveX = s.distanceX - i, s.moveY = s.distanceY - e, s.distance = parseInt(Math.sqrt(Math.pow(s.distanceX, 2) + Math.pow(s.distanceY, 2))), s.duration = (new Date).getTime() - this.start_time, s.direction = this.getDirection(t.pageX, t.pageY), s }, l.__reset = function (t, i) { this.reset = !1, this.lastStatus = {}, this.start_time = (new Date).getTime(); var e = this.__getPoint(t, i); this.start_x = e.pageX, this.start_y = e.pageY }, l.__touchStart = function (e) { var s = e.data.target, o = e; if (s.enabled && !(t(e.target).closest(s.noSwipeSelector, s.$element).length > 0)) if (e = e.originalEvent, n && t(this).css("-ms-touch-action", "horizontal" === s.swipeType ? "pan-y" : "pan-x"), s.onSwipe) { if (!(s.touchStarted || i && s.start_time && "mousedown" === e.type && (new Date).getTime() - s.start_time < 600)) { var l = s.__getPoint(e, o); s.start_x = l.pageX, s.start_y = l.pageY, s.start_time = (new Date).getTime(), t(document).bind(r, { target: s }, s.__touchEnd).bind(a, { target: s }, s.__touchMove).bind(h, { target: s }, s.__touchCancel); var d = s.createStatusObject(l); d.phase = "start", s.onSwipe.call(null, d), i || o.preventDefault(), s.lastStatus = d, s.touchStarted = !0 } } else t.error("Swipe listener is undefined") }, l.__touchMove = function (t) { var i = t.data.target, e = t; if (t = t.originalEvent, i.touchStarted) { clearTimeout(i.timo), i.timo = setTimeout(function () { i.__reset(t, e) }, 60); var s = i.__getPoint(t, e), n = i.createStatusObject(s); i.priventDefultEvent(s.pageX, s.pageY) && e.preventDefault(), n.phase = "move", i.lastStatus = n, i.onSwipe.call(null, n) } }, l.__touchEnd = function (e) { var s = e.data.target, n = e; e = e.originalEvent, clearTimeout(s.timo); var o = s.lastStatus; i || n.preventDefault(), o.phase = "end", s.touchStarted = !1, s.priventEvt = null, t(document).unbind(r, s.__touchEnd).unbind(a, s.__touchMove).unbind(h, s.__touchCancel), o.speed = o.distance / o.duration, s.onSwipe.call(null, o) }, l.__touchCancel = function (t) { t.data.target.__touchEnd(t) }, l.__getPoint = function (t, e) { return i && -1 === t.type.indexOf("mouse") ? t.touches[0] : n ? t : e }, l.enable = function () { this.enabled || (this.enabled = !0) }, l.disable = function () { this.enabled && (this.enabled = !1) } }(jQuery), function () { "use strict"; averta.Ticker = function () { }; var t = averta.Ticker, i = [], e = 0, s = !0; t.add = function (s, n) { return i.push([s, n]), 1 === i.length && t.start(), e = i.length }, t.remove = function (s, n) { for (var o = 0, a = i.length; o < a; ++o)i[o] && i[o][0] === s && i[o][1] === n && i.splice(o, 1); 0 === (e = i.length) && t.stop() }, t.start = function () { s && (s = !1, n()) }, t.stop = function () { s = !0 }; var n = function () { if (!t.__stopped) { for (var s, o = 0; o !== e; o++)(s = i[o])[0].call(s[1]); requestAnimationFrame(n) } } }(), function () { "use strict"; Date.now || (Date.now = function () { return (new Date).getTime() }), averta.Timer = function (t, i) { this.delay = t, this.currentCount = 0, this.paused = !1, this.onTimer = null, this.refrence = null, i && this.start() }, averta.Timer.prototype = { constructor: averta.Timer, start: function () { this.paused = !1, this.lastTime = Date.now(), averta.Ticker.add(this.update, this) }, stop: function () { this.paused = !0, averta.Ticker.remove(this.update, this) }, reset: function () { this.currentCount = 0, this.paused = !0, this.lastTime = Date.now() }, update: function () { this.paused || Date.now() - this.lastTime < this.delay || (this.currentCount++ , this.lastTime = Date.now(), this.onTimer && this.onTimer.call(this.refrence, this.getTime())) }, getTime: function () { return this.delay * this.currentCount } } }(), function () { "use strict"; window.CSSTween = function (t, i, e, s) { this.$element = t, this.duration = i || 1e3, this.delay = e || 0, this.ease = s || "linear" }; var t = CSSTween.prototype; t.to = function (t, i) { return this.to_cb = t, this.to_cb_target = i, this }, t.from = function (t, i) { return this.fr_cb = t, this.fr_cb_target = i, this }, t.onComplete = function (t, i) { return this.oc_fb = t, this.oc_fb_target = i, this }, t.chain = function (t) { return this.chained_tween = t, this }, t.reset = function () { clearTimeout(this.start_to), clearTimeout(this.end_to) }, t.start = function () { var t = this.$element[0]; clearTimeout(this.start_to), clearTimeout(this.end_to), this.fresh = !0, this.fr_cb && (t.style[window._jcsspfx + "TransitionDuration"] = "0ms", this.fr_cb.call(this.fr_cb_target)); var i = this; return this.onTransComplete = function (e) { i.fresh && (i.reset(), t.style[window._jcsspfx + "TransitionDuration"] = "", t.style[window._jcsspfx + "TransitionProperty"] = "", t.style[window._jcsspfx + "TransitionTimingFunction"] = "", t.style[window._jcsspfx + "TransitionDelay"] = "", i.fresh = !1, i.chained_tween && i.chained_tween.start(), i.oc_fb && i.oc_fb.call(i.oc_fb_target)) }, this.start_to = setTimeout(function () { i.$element && (t.style[window._jcsspfx + "TransitionDuration"] = i.duration + "ms", t.style[window._jcsspfx + "TransitionProperty"] = i.transProperty || "all", i.delay > 0 ? t.style[window._jcsspfx + "TransitionDelay"] = i.delay + "ms" : t.style[window._jcsspfx + "TransitionDelay"] = "", t.style[window._jcsspfx + "TransitionTimingFunction"] = i.ease, i.to_cb && i.to_cb.call(i.to_cb_target), i.end_to = setTimeout(function () { i.onTransComplete() }, i.duration + (i.delay || 0))) }, 1), this } }(), function () { "use strict"; function t(t, e) { if (void 0 !== e.x || void 0 !== e.y) if (i) { var s = window._jcsspfx + "Transform"; void 0 !== e.x && (e[s] = (e[s] || "") + " translateX(" + e.x + "px)", delete e.x), void 0 !== e.y && (e[s] = (e[s] || "") + " translateY(" + e.y + "px)", delete e.y) } else void 0 !== e.x && (e["auto" !== t.css("right") ? "right" : "left"] = e.x + "px", delete e.x), void 0 !== e.y && (e["auto" !== t.css("bottom") ? "bottom" : "top"] = e.y + "px", delete e.y); return e } var i = null; window.CTween = {}, CTween.setPos = function (i, e) { i.css(t(i, e)) }, CTween.animate = function (e, s, n, o) { if (null == i && (i = window._cssanim), o = o || {}, t(e, n), i) { var a = new CSSTween(e, s, o.delay, EaseDic[o.ease]); return o.transProperty && (a.transProperty = o.transProperty), a.to(function () { e.css(n) }), o.complete && a.onComplete(o.complete, o.target), a.start(), a.stop = a.reset, a } var r; return o.delay && e.delay(o.delay), o.complete && (r = function () { o.complete.call(o.target) }), e.stop(!0).animate(n, s, o.ease || "linear", r), e }, CTween.fadeOut = function (t, i, e) { var s = {}; !0 === e ? s.complete = function () { t.remove() } : 2 === e && (s.complete = function () { t.css("display", "none") }), CTween.animate(t, i || 1e3, { opacity: 0 }, s) }, CTween.fadeIn = function (t, i, e) { !1 !== e && t.css("opacity", 0).css("display", ""), CTween.animate(t, i || 1e3, { opacity: 1 }) } }(), window.EaseDic = { linear: "linear", ease: "ease", easeIn: "ease-in", easeOut: "ease-out", easeInOut: "ease-in-out", easeInCubic: "cubic-bezier(.55,.055,.675,.19)", easeOutCubic: "cubic-bezier(.215,.61,.355,1)", easeInOutCubic: "cubic-bezier(.645,.045,.355,1)", easeInCirc: "cubic-bezier(.6,.04,.98,.335)", easeOutCirc: "cubic-bezier(.075,.82,.165,1)", easeInOutCirc: "cubic-bezier(.785,.135,.15,.86)", easeInExpo: "cubic-bezier(.95,.05,.795,.035)", easeOutExpo: "cubic-bezier(.19,1,.22,1)", easeInOutExpo: "cubic-bezier(1,0,0,1)", easeInQuad: "cubic-bezier(.55,.085,.68,.53)", easeOutQuad: "cubic-bezier(.25,.46,.45,.94)", easeInOutQuad: "cubic-bezier(.455,.03,.515,.955)", easeInQuart: "cubic-bezier(.895,.03,.685,.22)", easeOutQuart: "cubic-bezier(.165,.84,.44,1)", easeInOutQuart: "cubic-bezier(.77,0,.175,1)", easeInQuint: "cubic-bezier(.755,.05,.855,.06)", easeOutQuint: "cubic-bezier(.23,1,.32,1)", easeInOutQuint: "cubic-bezier(.86,0,.07,1)", easeInSine: "cubic-bezier(.47,0,.745,.715)", easeOutSine: "cubic-bezier(.39,.575,.565,1)", easeInOutSine: "cubic-bezier(.445,.05,.55,.95)", easeInBack: "cubic-bezier(.6,-.28,.735,.045)", easeOutBack: "cubic-bezier(.175, .885,.32,1.275)", easeInOutBack: "cubic-bezier(.68,-.55,.265,1.55)" }, function () { "use strict"; window.MSAligner = function (t, i, e) { this.$container = i, this.$img = e, this.type = t || "stretch", this.widthOnly = !1, this.heightOnly = !1 }; var t = MSAligner.prototype; t.init = function (t, i) { switch (this.baseWidth = t, this.baseHeight = i, this.imgRatio = t / i, this.imgRatio2 = i / t, this.type) { case "tile": this.$container.css("background-image", "url(" + this.$img.attr("src") + ")"), this.$img.remove(); break; case "center": this.$container.css("background-image", "url(" + this.$img.attr("src") + ")"), this.$container.css({ backgroundPosition: "center center", backgroundRepeat: "no-repeat" }), this.$img.remove(); break; case "stretch": this.$img.css({ width: "100%", height: "100%" }); break; case "fill": case "fit": this.needAlign = !0, this.align() } }, t.align = function () { if (this.needAlign) { var t = this.$container[0].offsetWidth, i = this.$container[0].offsetHeight, e = t / i; "fill" == this.type ? this.imgRatio < e ? (this.$img.width(t), this.$img.height(t * this.imgRatio2)) : (this.$img.height(i), this.$img.width(i * this.imgRatio)) : "fit" == this.type && (this.imgRatio < e ? (this.$img.height(i), this.$img.width(i * this.imgRatio)) : (this.$img.width(t), this.$img.height(t * this.imgRatio2))), this.setMargin() } }, t.setMargin = function () { var t = this.$container[0].offsetWidth, i = this.$container[0].offsetHeight; this.$img.css("margin-top", (i - this.$img[0].offsetHeight) / 2 + "px"), this.$img.css("margin-left", (t - this.$img[0].offsetWidth) / 2 + "px") } }(), function (t) { var i = function (e) { this.options = t.extend({}, i.defaultOptions, e), this.isEnabled = !1, !this.options.forcePolyfill && this.supportsPointerEvents() || (this.registerEvents(), this.isEnabled = !0) }; i.defaultOptions = { forcePolyfill: !1, selector: "*", listenOn: ["click", "dblclick", "mousedown", "mouseup"], pointerEventsNoneClass: null, pointerEventsAllClass: null, eventNamespace: "pointer-events-polyfill" }, i.prototype.registerEvents = function () { t(document).on(this.getEventNames(), this.options.selector, t.proxy(this.onElementClick, this)) }, i.prototype.getEventNames = function () { var t = this.options.eventNamespace ? "." + this.options.eventNamespace : ""; return this.options.listenOn.join(t + " ") + t }, i.prototype.supportsPointerEvents = function () { var t = document.createElement("a").style; return t.cssText = "pointer-events:auto", "auto" === t.pointerEvents }, i.prototype.isClickThrough = function (t) { var i = t.css("pointer-events"); return 0 !== t.length && "all" !== i && !t.is(":root") && !t.hasClass(this.options.pointerEventsAllClass) && !("none" !== i && !t.hasClass(this.options.pointerEventsNoneClass) && !this.isClickThrough(t.parent())) }, i.prototype.onElementClick = function (i) { var e = t(i.target); if (!this.isClickThrough(e)) return !0; e.hide(); var s = document.elementFromPoint(i.clientX, i.clientY); return i.target = s, t(s).trigger(i), "A" === s.tagName && (2 === i.which ? window.open(s.getAttribute("href"), "_blank") : s.click()), e.show(), !1 }, i.prototype.destroy = function () { t(document).off(this.getEventNames()), this.isEnabled = !1 }, window.pointerEventsPolyfill = function (t) { return new i(t) } }(jQuery), function () { "use strict"; var t = { bouncing: !0, snapping: !1, snapsize: null, friction: .05, outFriction: .05, outAcceleration: .09, minValidDist: .3, snappingMinSpeed: 2, paging: !1, endless: !1, maxSpeed: 160 }, i = function (i, e, s) { if (null === e || null === i) throw new Error("Max and Min values are required."); this.options = s || {}; for (var n in t) n in this.options || (this.options[n] = t[n]); this._max_value = e, this._min_value = i, this.value = i, this.end_loc = i, this.current_snap = this.getSnapNum(i), this.__extrStep = 0, this.__extraMove = 0, this.__animID = -1 }, e = i.prototype; e.changeTo = function (t, i, e, s, n) { if (this.stopped = !1, this._internalStop(), t = this._checkLimits(t), e = Math.abs(e || 0), this.options.snapping && (s = s || this.getSnapNum(t), !1 !== n && this._callsnapChange(s), this.current_snap = s), i) { this.animating = !0; var o = this, a = ++o.__animID, r = t - o.value, h = 0, l = t, d = 1 - o.options.friction, c = d + (e - 20) * d * 1.3 / o.options.maxSpeed, p = function () { if (a === o.__animID) { var i = t - o.value; if (!(Math.abs(i) > o.options.minValidDist && o.animating)) return o.animating && (o.value = t, o._callrenderer()), o.animating = !1, a !== o.__animID && (o.__animID = -1), void o._callonComplete("anim"); window.requestAnimationFrame(p), o.value = l - r * Math.exp(-++h * c), o._callrenderer() } }; p() } else this.value = t, this._callrenderer() }, e.drag = function (t) { this.start_drag && (this.drag_start_loc = this.value, this.start_drag = !1), this.animating = !1, this._deceleration = !1, this.value -= t, !this.options.endless && (this.value > this._max_value || this.value < 0) ? this.options.bouncing ? (this.__isout = !0, this.value += .6 * t) : this.value > this._max_value ? this.value = this._max_value : this.value = 0 : !this.options.endless && this.options.bouncing && (this.__isout = !1), this._callrenderer() }, e.push = function (t) { if (this.stopped = !1, this.options.snapping && Math.abs(t) <= this.options.snappingMinSpeed) this.cancel(); else { if (this.__speed = t, this.__startSpeed = t, this.end_loc = this._calculateEnd(), this.options.snapping) { var i = this.getSnapNum(this.value), e = this.getSnapNum(this.end_loc); if (this.options.paging) return i = this.getSnapNum(this.drag_start_loc), this.__isout = !1, void (t > 0 ? this.gotoSnap(i + 1, !0, t) : this.gotoSnap(i - 1, !0, t)); if (i === e) return void this.cancel(); this._callsnapChange(e), this.current_snap = e } this.animating = !1, this.__needsSnap = this.options.endless || this.end_loc > this._min_value && this.end_loc < this._max_value, this.options.snapping && this.__needsSnap && (this.__extraMove = this._calculateExtraMove(this.end_loc)), this._startDecelaration() } }, e.bounce = function (t) { this.animating || (this.stopped = !1, this.animating = !1, this.__speed = t, this.__startSpeed = t, this.end_loc = this._calculateEnd(), this._startDecelaration()) }, e.stop = function () { this.stopped = !0, this._internalStop() }, e.cancel = function () { this.start_drag = !0, this.__isout ? (this.__speed = 4e-4, this._startDecelaration()) : this.options.snapping && this.gotoSnap(this.getSnapNum(this.value), !0) }, e.renderCallback = function (t, i) { this.__renderHook = { fun: t, ref: i } }, e.snappingCallback = function (t, i) { this.__snapHook = { fun: t, ref: i } }, e.snapCompleteCallback = function (t, i) { this.__compHook = { fun: t, ref: i } }, e.getSnapNum = function (t) { return Math.floor((t + this.options.snapsize / 2) / this.options.snapsize) }, e.nextSnap = function () { this._internalStop(); var t = this.getSnapNum(this.value); !this.options.endless && (t + 1) * this.options.snapsize > this._max_value ? (this.__speed = 8, this.__needsSnap = !1, this._startDecelaration()) : this.gotoSnap(t + 1, !0) }, e.prevSnap = function () { this._internalStop(); var t = this.getSnapNum(this.value); !this.options.endless && (t - 1) * this.options.snapsize < this._min_value ? (this.__speed = -8, this.__needsSnap = !1, this._startDecelaration()) : this.gotoSnap(t - 1, !0) }, e.gotoSnap = function (t, i, e) { this.changeTo(t * this.options.snapsize, i, e, t) }, e.destroy = function () { this._internalStop(), this.__renderHook = null, this.__snapHook = null, this.__compHook = null }, e._internalStop = function () { this.start_drag = !0, this.animating = !1, this._deceleration = !1, this.__extrStep = 0 }, e._calculateExtraMove = function (t) { var i = t % this.options.snapsize; return i < this.options.snapsize / 2 ? -i : this.options.snapsize - i }, e._calculateEnd = function (t) { for (var i = this.__speed, e = this.value, s = 0; Math.abs(i) > this.options.minValidDist;)e += i, i *= this.options.friction, s++; return t ? s : e }, e._checkLimits = function (t) { return this.options.endless ? t : t < this._min_value ? this._min_value : t > this._max_value ? this._max_value : t }, e._callrenderer = function () { this.__renderHook && this.__renderHook.fun.call(this.__renderHook.ref, this, this.value) }, e._callsnapChange = function (t) { this.__snapHook && t !== this.current_snap && this.__snapHook.fun.call(this.__snapHook.ref, this, t, t - this.current_snap) }, e._callonComplete = function (t) { this.__compHook && !this.stopped && this.__compHook.fun.call(this.__compHook.ref, this, this.current_snap, t) }, e._computeDeceleration = function () { if (this.options.snapping && this.__needsSnap) { var t = (this.__startSpeed - this.__speed) / this.__startSpeed * this.__extraMove; this.value += this.__speed + t - this.__extrStep, this.__extrStep = t } else this.value += this.__speed; if (this.__speed *= this.options.friction, this.options.endless || this.options.bouncing || (this.value <= this._min_value ? (this.value = this._min_value, this.__speed = 0) : this.value >= this._max_value && (this.value = this._max_value, this.__speed = 0)), this._callrenderer(), !this.options.endless && this.options.bouncing) { var i = 0; this.value < this._min_value ? i = this._min_value - this.value : this.value > this._max_value && (i = this._max_value - this.value), this.__isout = Math.abs(i) >= this.options.minValidDist, this.__isout && (this.__speed * i <= 0 ? this.__speed += i * this.options.outFriction : this.__speed = i * this.options.outAcceleration) } }, e._startDecelaration = function () { if (!this._deceleration) { this._deceleration = !0; var t = this, i = function () { t._deceleration && (t._computeDeceleration(), Math.abs(t.__speed) > t.options.minValidDist || t.__isout ? window.requestAnimationFrame(i) : (t._deceleration = !1, t.__isout = !1, t.__needsSnap && t.options.snapping && !t.options.paging ? t.value = t._checkLimits(t.end_loc + t.__extraMove) : t.value = Math.round(t.value), t._callrenderer(), t._callonComplete("decel"))) }; i() } }, window.Controller = i }(), function (t, i, e) { t.MSLayerController = function (t) { this.slide = t, this.slider = t.slider, this.layers = [], this.layersCount = 0, this.preloadCount = 0, this.$layers = e("<div></div>").addClass("ms-slide-layers"), this.$staticLayers = e("<div></div>").addClass("ms-static-layers"), this.$fixedLayers = e("<div></div>").addClass("ms-fixed-layers"), this.$animLayers = e("<div></div>").addClass("ms-anim-layers") }; var s = MSLayerController.prototype; s.addLayer = function (t) { switch (t.slide = this.slide, t.controller = this, t.$element.data("position")) { case "static": this.hasStaticLayer = !0, t.$element.appendTo(this.$staticLayers); break; case "fixed": this.hasFixedLayer = !0, t.$element.appendTo(this.$fixedLayers); break; default: t.$element.appendTo(this.$animLayers) }t.create(), this.layers.push(t), this.layersCount++ , t.parallax && (this.hasParallaxLayer = !0), t.needPreload && this.preloadCount++ }, s.create = function () { this.slide.$element.append(this.$layers), this.$layers.append(this.$animLayers), this.hasStaticLayer && this.$layers.append(this.$staticLayers), "center" == this.slider.options.layersMode && (this.$layers.css("max-width", this.slider.options.width + "px"), this.hasFixedLayer && this.$fixedLayers.css("max-width", this.slider.options.width + "px")) }, s.loadLayers = function (t) { if (this._onReadyCallback = t, 0 !== this.preloadCount) for (var i = 0; i !== this.layersCount; ++i)this.layers[i].needPreload && this.layers[i].loadImage(); else this._onlayersReady() }, s.prepareToShow = function () { this.hasParallaxLayer && this._enableParallaxEffect(), this.hasFixedLayer && this.$fixedLayers.prependTo(this.slide.view.$element) }, s.showLayers = function () { this.layersHideTween && this.layersHideTween.stop(!0), this.fixedLayersHideTween && this.fixedLayersHideTween.stop(!0), this._resetLayers(), this.$animLayers.css("opacity", "").css("display", ""), this.hasFixedLayer && this.$fixedLayers.css("opacity", "").css("display", ""), this.ready && (this._initLayers(), this._locateLayers(), this._startLayers()) }, s.hideLayers = function () { if (this.slide.selected || this.slider.options.instantStartLayers) { var t = this; t.layersHideTween = CTween.animate(this.$animLayers, 500, { opacity: 0 }, { complete: function () { t._resetLayers() } }), this.hasFixedLayer && (this.fixedLayersHideTween = CTween.animate(this.$fixedLayers, 500, { opacity: 0 }, { complete: function () { t.$fixedLayers.detach() } })), this.hasParallaxLayer && this._disableParallaxEffect() } }, s.animHideLayers = function () { if (this.ready) for (var t = 0; t !== this.layersCount; ++t)this.layers[t].hide() }, s.setSize = function (t, i, e) { if (this.ready && (this.slide.selected || this.hasStaticLayer) && (e && this._initLayers(!0), this._locateLayers(!this.slide.selected)), this.slider.options.autoHeight && this.updateHeight(), "center" == this.slider.options.layersMode) { var s = Math.max(0, (t - this.slider.options.width) / 2) + "px"; this.$layers[0].style.left = s, this.$fixedLayers[0].style.left = s } }, s.updateHeight = function () { }, s._onlayersReady = function () { this.ready = !0, this.hasStaticLayer && !this.slide.isSleeping && this._initLayers(!1, !0), this._onReadyCallback.call(this.slide) }, s.onSlideSleep = function () { }, s.onSlideWakeup = function () { this.hasStaticLayer && this.ready && this._initLayers(!1, !0) }, s.getLayerById = function (t) { if (!t) return null; for (var i = 0; i < this.layersCount; ++i)if (this.layers[i].id === t) return this.layers[i]; return null }, s.destroy = function () { this.slide.selected && this.hasParallaxLayer && this._disableParallaxEffect(); for (var t = 0; t < this.layersCount; ++t)this.layers[t].$element.stop(!0).remove(); this.$layers.remove(), this.$staticLayers.remove(), this.$fixedLayers.remove(), this.$animLayers.remove() }, s._startLayers = function () { for (var t = 0; t !== this.layersCount; ++t) { var i = this.layers[t]; i.waitForAction || i.start() } }, s._initLayers = function (t, i) { if (!(this.init && !t || this.slider.init_safemode)) { this.init = !0 !== i; var e = 0; if (i && !this.staticsInit) for (this.staticsInit = !0; e !== this.layersCount; ++e)this.layers[e].staticLayer && this.layers[e].init(); else if (this.staticsInit && !t) for (; e !== this.layersCount; ++e)this.layers[e].staticLayer || this.layers[e].init(); else for (; e !== this.layersCount; ++e)this.layers[e].init() } }, s._locateLayers = function (t) { var i = 0; if (t) for (; i !== this.layersCount; ++i)this.layers[i].staticLayer && this.layers[i].locate(); else for (; i !== this.layersCount; ++i)this.layers[i].locate() }, s._resetLayers = function () { this.$animLayers.css("display", "none").css("opacity", 1); for (var t = 0; t !== this.layersCount; ++t)this.layers[t].reset() }, s._applyParallax = function (t, i, e) { for (var s = 0; s !== this.layersCount; ++s)null != this.layers[s].parallax && this.layers[s].moveParallax(t, i, e) }, s._enableParallaxEffect = function () { "swipe" === this.slider.options.parallaxMode ? this.slide.view.addEventListener(MSViewEvents.SCROLL, this._swipeParallaxMove, this) : this.slide.$element.on("mousemove", { that: this }, this._mouseParallaxMove).on("mouseleave", { that: this }, this._resetParalax) }, s._disableParallaxEffect = function () { "swipe" === this.slider.options.parallaxMode ? this.slide.view.removeEventListener(MSViewEvents.SCROLL, this._swipeParallaxMove, this) : this.slide.$element.off("mousemove", this._mouseParallaxMove).off("mouseleave", this._resetParalax) }, s._resetParalax = function (t) { t.data.that._applyParallax(0, 0) }, s._mouseParallaxMove = function (t) { var i = t.data.that, e = i.slide.$element.offset(), s = i.slider; if ("mouse:y-only" !== s.options.parallaxMode) n = t.pageX - e.left - i.slide.__width / 2; else var n = 0; if ("mouse:x-only" !== s.options.parallaxMode) o = t.pageY - e.top - i.slide.__height / 2; else var o = 0; i._applyParallax(-n, -o) }, s._swipeParallaxMove = function (t) { var i = this.slide.position - this.slide.view.__contPos; "v" === this.slider.options.dir ? this._applyParallax(0, i, !0) : this._applyParallax(i, 0, !0) } }(window, document, jQuery), function (t, i, e, s) { "use strict"; i.MSOverlayLayerController = function (t) { MSLayerController.apply(this, arguments) }, MSOverlayLayerController.extend(MSLayerController); var n = MSOverlayLayerController.prototype, o = MSLayerController.prototype; n.addLayer = function (t) { var i = t.$element.data("show-on"), e = t.$element.data("hide-on"); e && (t.hideOnSlides = e.replace(/\s+/g, "").split(",")), i && (t.showOnSlides = i.replace(/\s+/g, "").split(",")), o.addLayer.apply(this, arguments) }, n.create = function () { o.create.apply(this, arguments), this.slider.api.addEventListener(MSSliderEvent.CHANGE_START, this.checkLayers.bind(this)) }, n.checkLayers = function () { if (this.ready) for (var t = 0; t !== this.layersCount; ++t) { var i = this.layers[t]; i.waitForAction || (this._checkForShow(i) ? i.start() : i.hide()) } }, n._enableParallaxEffect = function () { this.slider.view.$element.on("mousemove", { that: this }, this._mouseParallaxMove).on("mouseleave", { that: this }, this._resetParalax) }, n._disableParallaxEffect = function () { this.slider.view.$element.off("mousemove", this._mouseParallaxMove).off("mouseleave", this._resetParalax) }, n._startLayers = function () { for (var t = 0; t !== this.layersCount; ++t) { var i = this.layers[t]; this._checkForShow(i) && !i.waitForAction && i.start() } }, n._checkForShow = function (t) { var i = this.slider.api.currentSlide.id, e = t.hideOnSlides, s = t.showOnSlides; return s ? !!i && -1 !== s.indexOf(i) : !i || !e || e.length && -1 === e.indexOf(i) } }(0, window, document), function (t, i, e, s) { "use strict"; i.MSOverlayLayers = function (t) { this.slider = t }; var n = MSOverlayLayers.prototype; n.setupLayerController = function () { this.layerController = new MSOverlayLayerController(this), this.slider.api.addEventListener(MSSliderEvent.RESIZE, this.setSize.bind(this)), this.slider.api.addEventListener(MSSliderEvent.CHANGE_START, this.setSize.bind(this)), this.setSize() }, n.setSize = function () { this.__width = this.$element.width(), this.__height = this.$element.height(), this.layerController.setSize(this.__width, this.__height) }, n.create = function () { this.layerController.create(), this.layerController.loadLayers(this._onLayersLoad), this.layerController.prepareToShow(), i.pointerEventsPolyfill && i.pointerEventsPolyfill({ selector: "#" + this.slider.$element.attr("id") + " .ms-overlay-layers", forcePolyfill: !1 }) }, n.getHeight = function () { return this.slider.api.currentSlide.getHeight() }, n.destroy = function () { this.layerController.destroy() }, n._onLayersLoad = function () { this.ready = !0, this.selected = !0, this.layersLoaded = !0, this.setSize(), this.layerController.showLayers() } }(0, window, document), function (t) { window.MSLayerEffects = {}; var i, e = { opacity: 0 }; MSLayerEffects.setup = function () { if (!i) { i = !0; var s = MSLayerEffects, n = window._jcsspfx + "Transform", o = window._jcsspfx + "TransformOrigin", a = t.browser.opera; _2d = window._css2d && window._cssanim && !a, s.defaultValues = { left: 0, top: 0, opacity: isMSIE("<=9") ? 1 : "", right: 0, bottom: 0 }, s.defaultValues[n] = "", s.rf = 1, s.presetEffParams = { random: "30|300", long: 300, short: 30, false: !1, true: !0, tl: "top left", bl: "bottom left", tr: "top right", br: "bottom right", rt: "top right", lb: "bottom left", lt: "top left", rb: "bottom right", t: "top", b: "bottom", r: "right", l: "left", c: "center" }, s.fade = function () { return e }, s.left = _2d ? function (t, i) { var e = !1 === i ? {} : { opacity: 0 }; return e[n] = "translateX(" + -t * s.rf + "px)", e } : function (t, i) { var e = !1 === i ? {} : { opacity: 0 }; return e.left = -t * s.rf + "px", e }, s.right = _2d ? function (t, i) { var e = !1 === i ? {} : { opacity: 0 }; return e[n] = "translateX(" + t * s.rf + "px)", e } : function (t, i) { var e = !1 === i ? {} : { opacity: 0 }; return e.left = t * s.rf + "px", e }, s.top = _2d ? function (t, i) { var e = !1 === i ? {} : { opacity: 0 }; return e[n] = "translateY(" + -t * s.rf + "px)", e } : function (t, i) { var e = !1 === i ? {} : { opacity: 0 }; return e.top = -t * s.rf + "px", e }, s.bottom = _2d ? function (t, i) { var e = !1 === i ? {} : { opacity: 0 }; return e[n] = "translateY(" + t * s.rf + "px)", e } : function (t, i) { var e = !1 === i ? {} : { opacity: 0 }; return e.top = t * s.rf + "px", e }, s.from = _2d ? function (t, i, e) { var o = !1 === e ? {} : { opacity: 0 }; return o[n] = "translateX(" + t * s.rf + "px) translateY(" + i * s.rf + "px)", o } : function (t, i, e) { var n = !1 === e ? {} : { opacity: 0 }; return n.top = i * s.rf + "px", n.left = t * s.rf + "px", n }, s.rotate = _2d ? function (t, i) { var e = { opacity: 0 }; return e[n] = " rotate(" + t + "deg)", i && (e[o] = i), e } : function (t, i) { return e }, s.rotateleft = _2d ? function (t, i, e, a) { var r = s.left(i, a); return r[n] += " rotate(" + t + "deg)", e && (r[o] = e), r } : function (t, i, e, n) { return s.left(i, n) }, s.rotateright = _2d ? function (t, i, e, a) { var r = s.right(i, a); return r[n] += " rotate(" + t + "deg)", e && (r[o] = e), r } : function (t, i, e, n) { return s.right(i, n) }, s.rotatetop = _2d ? function (t, i, e, a) { var r = s.top(i, a); return r[n] += " rotate(" + t + "deg)", e && (r[o] = e), r } : function (t, i, e, n) { return s.top(i, n) }, s.rotatebottom = _2d ? function (t, i, e, a) { var r = s.bottom(i, a); return r[n] += " rotate(" + t + "deg)", e && (r[o] = e), r } : function (t, i, e, n) { return s.bottom(i, n) }, s.rotatefrom = _2d ? function (t, i, e, a, r) { var h = s.from(i, e, r); return h[n] += " rotate(" + t + "deg)", a && (h[o] = a), h } : function (t, i, e, n, o) { return s.from(i, e, o) }, s.skewleft = _2d ? function (t, i, e) { var o = s.left(i, e); return o[n] += " skewX(" + t + "deg)", o } : function (t, i, e) { return s.left(i, e) }, s.skewright = _2d ? function (t, i, e) { var o = s.right(i, e); return o[n] += " skewX(" + -t + "deg)", o } : function (t, i, e) { return s.right(i, e) }, s.skewtop = _2d ? function (t, i, e) { var o = s.top(i, e); return o[n] += " skewY(" + t + "deg)", o } : function (t, i, e) { return s.top(i, e) }, s.skewbottom = _2d ? function (t, i, e) { var o = s.bottom(i, e); return o[n] += " skewY(" + -t + "deg)", o } : function (t, i, e) { return s.bottom(i, e) }, s.scale = _2d ? function (t, i, e, s) { var a = !1 === s ? {} : { opacity: 0 }; return a[n] = " scaleX(" + t + ") scaleY(" + i + ")", e && (a[o] = e), a } : function (t, i, e, s) { return !1 === s ? {} : { opacity: 0 } }, s.scaleleft = _2d ? function (t, i, e, a, r) { var h = s.left(e, r); return h[n] = " scaleX(" + t + ") scaleY(" + i + ")", a && (h[o] = a), h } : function (t, i, e, n, o) { return s.left(e, o) }, s.scaleright = _2d ? function (t, i, e, a, r) { var h = s.right(e, r); return h[n] = " scaleX(" + t + ") scaleY(" + i + ")", a && (h[o] = a), h } : function (t, i, e, n, o) { return s.right(e, o) }, s.scaletop = _2d ? function (t, i, e, a, r) { var h = s.top(e, r); return h[n] = " scaleX(" + t + ") scaleY(" + i + ")", a && (h[o] = a), h } : function (t, i, e, n, o) { return s.top(e, o) }, s.scalebottom = _2d ? function (t, i, e, a, r) { var h = s.bottom(e, r); return h[n] = " scaleX(" + t + ") scaleY(" + i + ")", a && (h[o] = a), h } : function (t, i, e, n, o) { return s.bottom(e, o) }, s.scalefrom = _2d ? function (t, i, e, a, r, h) { var l = s.from(e, a, h); return l[n] += " scaleX(" + t + ") scaleY(" + i + ")", r && (l[o] = r), l } : function (t, i, e, n, o, a) { return s.from(e, n, a) }, s.rotatescale = _2d ? function (t, i, e, a, r) { var h = s.scale(i, e, a, r); return h[n] += " rotate(" + t + "deg)", a && (h[o] = a), h } : function (t, i, e, n, o) { return s.scale(i, e, n, o) }, s.front = window._css3d ? function (t, i) { var e = !1 === i ? {} : { opacity: 0 }; return e[n] = "perspective(2000px) translate3d(0 , 0 ," + t + "px ) rotate(0.001deg)", e } : function (t) { return e }, s.back = window._css3d ? function (t, i) { var e = !1 === i ? {} : { opacity: 0 }; return e[n] = "perspective(2000px) translate3d(0 , 0 ," + -t + "px ) rotate(0.001deg)", e } : function (t) { return e }, s.rotatefront = window._css3d ? function (t, i, e, s) { var a = !1 === s ? {} : { opacity: 0 }; return a[n] = "perspective(2000px) translate3d(0 , 0 ," + i + "px ) rotate(" + (t || .001) + "deg)", e && (a[o] = e), a } : function (t, i, s, n) { return e }, s.rotateback = window._css3d ? function (t, i, e, s) { var a = !1 === s ? {} : { opacity: 0 }; return a[n] = "perspective(2000px) translate3d(0 , 0 ," + -i + "px ) rotate(" + (t || .001) + "deg)", e && (a[o] = e), a } : function (t, i, s, n) { return e }, s.rotate3dleft = window._css3d ? function (t, i, e, a, r, h) { var l = s.left(a, h); return l[n] += (t ? " rotateX(" + t + "deg)" : " ") + (i ? " rotateY(" + i + "deg)" : "") + (e ? " rotateZ(" + e + "deg)" : ""), r && (l[o] = r), l } : function (t, i, e, n, o, a) { return s.left(n, a) }, s.rotate3dright = window._css3d ? function (t, i, e, a, r, h) { var l = s.right(a, h); return l[n] += (t ? " rotateX(" + t + "deg)" : " ") + (i ? " rotateY(" + i + "deg)" : "") + (e ? " rotateZ(" + e + "deg)" : ""), r && (l[o] = r), l } : function (t, i, e, n, o, a) { return s.right(n, a) }, s.rotate3dtop = window._css3d ? function (t, i, e, a, r, h) { var l = s.top(a, h); return l[n] += (t ? " rotateX(" + t + "deg)" : " ") + (i ? " rotateY(" + i + "deg)" : "") + (e ? " rotateZ(" + e + "deg)" : ""), r && (l[o] = r), l } : function (t, i, e, n, o, a) { return s.top(n, a) }, s.rotate3dbottom = window._css3d ? function (t, i, e, a, r, h) { var l = s.bottom(a, h); return l[n] += (t ? " rotateX(" + t + "deg)" : " ") + (i ? " rotateY(" + i + "deg)" : "") + (e ? " rotateZ(" + e + "deg)" : ""), r && (l[o] = r), l } : function (t, i, e, n, o, a) { return s.bottom(n, a) }, s.rotate3dfront = window._css3d ? function (t, i, e, a, r, h) { var l = s.front(a, h); return l[n] += (t ? " rotateX(" + t + "deg)" : " ") + (i ? " rotateY(" + i + "deg)" : "") + (e ? " rotateZ(" + e + "deg)" : ""), r && (l[o] = r), l } : function (t, i, e, n, o, a) { return s.front(n, a) }, s.rotate3dback = window._css3d ? function (t, i, e, a, r, h) { var l = s.back(a, h); return l[n] += (t ? " rotateX(" + t + "deg)" : " ") + (i ? " rotateY(" + i + "deg)" : "") + (e ? " rotateZ(" + e + "deg)" : ""), r && (l[o] = r), l } : function (t, i, e, n, o, a) { return s.back(n, a) }, s.t = window._css3d ? function (t, i, e, a, r, h, l, d, c, p, u, m, f, v, _) { var w = !1 === t ? {} : { opacity: 0 }, g = "perspective(2000px) "; "n" !== i && (g += "translateX(" + i * s.rf + "px) "), "n" !== e && (g += "translateY(" + e * s.rf + "px) "), "n" !== a && (g += "translateZ(" + a * s.rf + "px) "), "n" !== r && (g += "rotate(" + r + "deg) "), "n" !== h && (g += "rotateX(" + h + "deg) "), "n" !== l && (g += "rotateY(" + l + "deg) "), "n" !== d && (g += "rotateZ(" + d + "deg) "), "n" !== u && (g += "skewX(" + u + "deg) "), "n" !== m && (g += "skewY(" + m + "deg) "), "n" !== c && (g += "scaleX(" + c + ") "), "n" !== p && (g += "scaleY(" + p + ")"), w[n] = g; var S = ""; return S += "n" !== f ? f + "% " : "50% ", S += "n" !== v ? v + "% " : "50% ", S += "n" !== _ ? _ + "px" : "", w[o] = S, w } : function (t, i, e, n, o, a, r, h, l, d, c, p, u, m, f) { var o = !1 === t ? {} : { opacity: 0 }; return "n" !== i && (o.left = i * s.rf + "px"), "n" !== e && (o.top = e * s.rf + "px"), o } } } }(jQuery), function (t) { window.MSLayerElement = function () { this.start_anim = { name: "fade", duration: 1e3, ease: "linear", delay: 0 }, this.end_anim = { duration: 1e3, ease: "linear" }, this.type = "text", this.resizable = !0, this.minWidth = -1, this.isVisible = !0, this.__cssConfig = ["margin-top", "padding-top", "margin-bottom", "padding-left", "margin-right", "padding-right", "margin-left", "padding-bottom", "font-size", "line-height", "width", "left", "right", "top", "bottom"], this.baseStyle = {} }; var i = MSLayerElement.prototype; i.setStartAnim = function (i) { t.extend(this.start_anim, i), t.extend(this.start_anim, this._parseEff(this.start_anim.name)), this.$element.css("visibility", "hidden") }, i.setEndAnim = function (i) { t.extend(this.end_anim, i) }, i.create = function () { if (this.$element.css("display", "none"), this.resizable = !1 !== this.$element.data("resize"), this.fixed = !0 === this.$element.data("fixed"), void 0 !== this.$element.data("widthlimit") && (this.minWidth = this.$element.data("widthlimit")), this.end_anim.name || (this.end_anim.name = this.start_anim.name), this.end_anim.time && (this.autoHide = !0), this.staticLayer = "static" === this.$element.data("position"), this.fixedLayer = "fixed" === this.$element.data("position"), this.layersCont = this.controller.$layers, this.staticLayer && this.$element.css("display", "").css("visibility", ""), void 0 !== this.$element.data("action")) { var i = this.slide.slider.slideController; this.$element.on(this.$element.data("action-event") || "click", function (e) { i.runAction(t(this).data("action")), e.preventDefault() }).addClass("ms-action-layer") } t.extend(this.end_anim, this._parseEff(this.end_anim.name)), this.slider = this.slide.slider, this.masked && (this.$mask = t("<div></div>").addClass("ms-layer-mask"), this.link ? (this.link.wrap(this.$mask), this.$mask = this.link.parent()) : (this.$element.wrap(this.$mask), this.$mask = this.$element.parent()), this.maskWidth && this.$mask.width(this.maskWidth), this.maskHeight && (this.$mask.height(this.maskHeight), -1 === this.__cssConfig.indexOf("height") && this.__cssConfig.push("height"))); var e = this.layerOrigin = this.$element.data("origin"); if (e) { var s = e.charAt(0), n = e.charAt(1), o = this.$element.data("offset-x"), a = this.$element.data("offset-y"), r = this.masked ? this.$mask[0] : this.$element[0]; switch (void 0 === a && (a = 0), s) { case "t": r.style.top = a + "px"; break; case "b": r.style.bottom = a + "px"; break; case "m": r.style.top = a + "px", this.middleAlign = !0 }switch (void 0 === o && (o = 0), n) { case "l": r.style.left = o + "px"; break; case "r": r.style.right = o + "px"; break; case "c": r.style.left = o + "px", this.centerAlign = !0 } } this.parallax = this.$element.data("parallax"), null != this.parallax && (this.parallax /= 100, this.$parallaxElement = t("<div></div>").addClass("ms-parallax-layer"), this.masked ? (this.$mask.wrap(this.$parallaxElement), this.$parallaxElement = this.$mask.parent()) : this.link ? (this.link.wrap(this.$parallaxElement), this.$parallaxElement = this.link.parent()) : (this.$element.wrap(this.$parallaxElement), this.$parallaxElement = this.$element.parent()), this._lastParaX = 0, this._lastParaY = 0, this._paraX = 0, this._paraY = 0, this.alignedToBot = this.layerOrigin && -1 !== this.layerOrigin.indexOf("b"), this.alignedToBot && this.$parallaxElement.css("bottom", 0), window._css3d ? this.parallaxRender = this._parallaxCSS3DRenderer : window._css2d ? this.parallaxRender = this._parallaxCSS2DRenderer : this.parallaxRender = this._parallax2DRenderer, "swipe" !== this.slider.options.parallaxMode && averta.Ticker.add(this.parallaxRender, this)), t.removeDataAttrs(this.$element, ["data-src"]) }, i.init = function () { this.initialized = !0; var t; this.$element.css("visibility", ""); for (var i = 0, e = this.__cssConfig.length; i < e; i++) { var s = this.__cssConfig[i]; if (this._isPosition(s) && this.masked) t = this.$mask.css(s); else if ("text" !== this.type || "width" !== s || this.masked || this.maskWidth) { t = this.$element.css(s); var n = "width" === s || "height" === s; n && this.masked && (this.maskWidth && "width" === s ? t = this.maskWidth + "px" : this.maskHeight && "height" === s && (t = this.maskHeight + "px")), n && "0px" === t && (t = this.$element.data(s) + "px") } else t = this.$element[0].style.width; this.layerOrigin && ("top" === s && -1 === this.layerOrigin.indexOf("t") && -1 === this.layerOrigin.indexOf("m") || "bottom" === s && -1 === this.layerOrigin.indexOf("b") || "left" === s && -1 === this.layerOrigin.indexOf("l") && -1 === this.layerOrigin.indexOf("c") || "right" === s && -1 === this.layerOrigin.indexOf("r")) || "auto" != t && "" != t && "normal" != t && (this.baseStyle[s] = parseInt(t)) } this.middleAlign && (this.baseHeight = this.$element.outerHeight(!1)), this.centerAlign && (this.baseWidth = this.$element.outerWidth(!1)) }, i.locate = function () { if (this.slide.ready) { var t, i, e, s = parseFloat(this.layersCont.css("width")), n = parseFloat(this.layersCont.css("height")); !this.staticLayer && "none" === this.$element.css("display") && this.isVisible && this.$element.css("display", "").css("visibility", "hidden"), this.staticLayer && this.$element.addClass("ms-hover-active"), t = this.resizeFactor = s / this.slide.slider.options.width; var o = this.masked ? this.$mask : this.$element; for (var a in this.baseStyle) i = this._isPosition(a), e = "width" === a || "height" === a, t = this.fixed && i ? 1 : this.resizeFactor, (this.resizable || i) && ("top" === a && this.middleAlign ? (o[0].style.top = "0px", this.baseHeight = o.outerHeight(!1), o[0].style.top = this.baseStyle.top * t + (n - this.baseHeight) / 2 + "px") : "left" === a && this.centerAlign ? (o[0].style.left = "0px", this.baseWidth = o.outerWidth(!1), o[0].style.left = this.baseStyle.left * t + (s - this.baseWidth) / 2 + "px") : i && this.masked ? o[0].style[a] = this.baseStyle[a] * t + "px" : e && ("width" === a && this.maskWidth || "height" === a && this.maskHeight) ? o[0].style[a] = this.baseStyle[a] * t + "px" : this.$element.css(a, this.baseStyle[a] * t + "px")); this.visible(this.minWidth < s) } }, i.start = function () { if (!this.isShowing && !this.staticLayer) { this.isShowing = !0, this.$element.removeClass("ms-hover-active"); var t, i; MSLayerEffects.rf = this.resizeFactor; var e = MSLayerEffects[this.start_anim.eff_name].apply(null, this._parseEffParams(this.start_anim.eff_params)), s = {}; for (t in e) this._checkPosKey(t, e) || (null != MSLayerEffects.defaultValues[t] && (s[t] = MSLayerEffects.defaultValues[t]), t in this.baseStyle && (i = this.baseStyle[t], this.middleAlign && "top" === t && (i += (parseInt(this.layersCont.height()) - this.$element.outerHeight(!1)) / 2), this.centerAlign && "left" === t && (i += (parseInt(this.layersCont.width()) - this.$element.outerWidth(!1)) / 2), e[t] = i + parseFloat(e[t]) + "px", s[t] = i + "px"), this.$element.css(t, e[t])); var n = this; clearTimeout(this.to), clearTimeout(this.clHide), this.to = setTimeout(function () { n.$element.css("visibility", ""), n._playAnimation(n.start_anim, s) }, n.start_anim.delay || .01), this.clTo = setTimeout(function () { n.show_cl = !0, n.$element.addClass("ms-hover-active") }, (this.start_anim.delay || .01) + this.start_anim.duration + 1), this.autoHide && (clearTimeout(this.hto), this.hto = setTimeout(function () { n.hide() }, n.end_anim.time)) } }, i.hide = function () { if (!this.staticLayer) { this.$element.removeClass("ms-hover-active"), this.isShowing = !1; var t = MSLayerEffects[this.end_anim.eff_name].apply(null, this._parseEffParams(this.end_anim.eff_params)); for (key in t) this._checkPosKey(key, t) || (key === window._jcsspfx + "TransformOrigin" && this.$element.css(key, t[key]), key in this.baseStyle && (t[key] = this.baseStyle[key] + parseFloat(t[key]) + "px")); this._playAnimation(this.end_anim, t), clearTimeout(this.clHide), 0 === t.opacity && (this.clHide = setTimeout(function () { this.$element.css("visibility", "hidden") }.bind(this), this.end_anim.duration + 1)), clearTimeout(this.to), clearTimeout(this.hto), clearTimeout(this.clTo) } }, i.reset = function () { this.staticLayer || (this.isShowing = !1, this.$element[0].style.display = "none", this.$element.css("opacity", ""), this.$element[0].style.transitionDuration = "", this.show_tween && this.show_tween.stop(!0), clearTimeout(this.to), clearTimeout(this.hto)) }, i.destroy = function () { this.reset(), this.$element.remove() }, i.visible = function (t) { this.isVisible != t && (this.isVisible = t, this.$element.css("display", t ? "" : "none")) }, i.moveParallax = function (t, i, e) { this._paraX = t, this._paraY = i, e && (this._lastParaX = t, this._lastParaY = i, this.parallaxRender()) }, i._playAnimation = function (t, i) { var e = {}; t.ease && (e.ease = t.ease), e.transProperty = window._csspfx + "transform,opacity", this.show_tween && this.show_tween.stop(!0), this.show_tween = CTween.animate(this.$element, t.duration, i, e) }, i._randomParam = function (t) { var i = Number(t.slice(0, t.indexOf("|"))), e = Number(t.slice(t.indexOf("|") + 1)); return i + Math.random() * (e - i) }, i._parseEff = function (t) { var i = []; if (-1 !== t.indexOf("(")) { var e, s = t.slice(0, t.indexOf("(")).toLowerCase(); i = t.slice(t.indexOf("(") + 1, -1).replace(/\"|\'|\s/g, "").split(","), t = s; for (var n = 0, o = i.length; n < o; ++n)(e = i[n]) in MSLayerEffects.presetEffParams && (e = MSLayerEffects.presetEffParams[e]), i[n] = e } return { eff_name: t, eff_params: i } }, i._parseEffParams = function (t) { for (var i = [], e = 0, s = t.length; e < s; ++e) { var n = t[e]; "string" == typeof n && -1 !== n.indexOf("|") && (n = this._randomParam(n)), i[e] = n } return i }, i._checkPosKey = function (t, i) { return "left" === t && !(t in this.baseStyle) && "right" in this.baseStyle ? (i.right = -parseInt(i.left) + "px", delete i.left, !0) : "top" === t && !(t in this.baseStyle) && "bottom" in this.baseStyle && (i.bottom = -parseInt(i.top) + "px", delete i.top, !0) }, i._isPosition = function (t) { return "top" === t || "left" === t || "bottom" === t || "right" === t }, i._parallaxCalc = function () { var t = this._paraX - this._lastParaX, i = this._paraY - this._lastParaY; this._lastParaX += t / 12, this._lastParaY += i / 12, Math.abs(t) < .019 && (this._lastParaX = this._paraX), Math.abs(i) < .019 && (this._lastParaY = this._paraY) }, i._parallaxCSS3DRenderer = function () { this._parallaxCalc(), this.$parallaxElement[0].style[window._jcsspfx + "Transform"] = "translateX(" + this._lastParaX * this.parallax + "px) translateY(" + this._lastParaY * this.parallax + "px) translateZ(0)" }, i._parallaxCSS2DRenderer = function () { this._parallaxCalc(), this.$parallaxElement[0].style[window._jcsspfx + "Transform"] = "translateX(" + this._lastParaX * this.parallax + "px) translateY(" + this._lastParaY * this.parallax + "px)" }, i._parallax2DRenderer = function () { this._parallaxCalc(), this.alignedToBot ? this.$parallaxElement[0].style.bottom = this._lastParaY * this.parallax + "px" : this.$parallaxElement[0].style.top = this._lastParaY * this.parallax + "px", this.$parallaxElement[0].style.left = this._lastParaX * this.parallax + "px" } }(jQuery), function (t) { window.MSImageLayerElement = function () { MSLayerElement.call(this), this.needPreload = !0, this.__cssConfig = ["width", "height", "margin-top", "padding-top", "margin-bottom", "padding-left", "margin-right", "padding-right", "margin-left", "padding-bottom", "left", "right", "top", "bottom"], this.type = "image" }, MSImageLayerElement.extend(MSLayerElement); var i = MSImageLayerElement.prototype, e = MSLayerElement.prototype; i.create = function () { if (this.link) { var i = this.$element.parent(); i.append(this.link), this.link.append(this.$element), this.link.removeClass("ms-layer"), this.$element.addClass("ms-layer"), i = null } if (e.create.call(this), void 0 != this.$element.data("src")) this.img_src = this.$element.data("src"), this.$element.removeAttr("data-src"); else { var s = this; this.$element.on("load", function (t) { 0 === --s.controller.preloadCount && s.controller._onlayersReady() }).each(t.jqLoadFix) } t.browser.msie && this.$element.on("dragstart", function (t) { t.preventDefault() }) }, i.loadImage = function () { var t = this; this.$element.preloadImg(this.img_src, function (i) { 0 === --t.controller.preloadCount && t.controller._onlayersReady() }) } }(jQuery), function (t) { window.MSVideoLayerElement = function () { MSLayerElement.call(this), this.__cssConfig.push("height"), this.type = "video" }, MSVideoLayerElement.extend(MSLayerElement); var i = MSVideoLayerElement.prototype, e = MSLayerElement.prototype; i.__playVideo = function () { this.img && CTween.fadeOut(this.img, 500, 2), CTween.fadeOut(this.video_btn, 500, 2), this.video_frame.attr("src", "about:blank").css("display", "block"), -1 == this.video_url.indexOf("?") && (this.video_url += "?"), this.video_frame.attr("src", this.video_url + "&autoplay=1") }, i.start = function () { e.start.call(this), this.$element.data("autoplay") && this.__playVideo() }, i.reset = function () { e.reset.call(this), (this.needPreload || this.$element.data("btn")) && (this.video_btn.css("opacity", 1).css("display", "block"), this.video_frame.attr("src", "about:blank").css("display", "none")), this.needPreload ? this.img.css("opacity", 1).css("display", "block") : this.video_frame.attr("src", this.video_url) }, i.create = function () { e.create.call(this), this.video_frame = this.$element.find("iframe").css({ width: "100%", height: "100%" }), this.video_url = this.video_frame.attr("src"); var i = 0 != this.$element.has("img").length; if (i || this.$element.data("btn")) { this.video_frame.attr("src", "about:blank").css("display", "none"); s = this; if (this.video_btn = t("<div></div>").appendTo(this.$element).addClass("ms-video-btn").click(function () { s.__playVideo() }), i) { if (this.needPreload = !0, this.img = this.$element.find("img:first").addClass("ms-video-img"), void 0 !== this.img.data("src")) this.img_src = this.img.data("src"), this.img.removeAttr("data-src"); else { var s = this; this.img.attr("src", this.img_src).on("load", function (t) { 0 === --s.controller.preloadCount && s.controller._onlayersReady() }).each(t.jqLoadFix) } t.browser.msie && this.img.on("dragstart", function (t) { t.preventDefault() }) } } }, i.loadImage = function () { var t = this; this.img.preloadImg(this.img_src, function (i) { 0 === --t.controller.preloadCount && t.controller._onlayersReady() }) } }(jQuery), function (t) { "use strict"; window.MSHotspotLayer = function () { MSLayerElement.call(this), this.__cssConfig = ["margin-top", "padding-top", "margin-bottom", "padding-left", "margin-right", "padding-right", "margin-left", "padding-bottom", "left", "right", "top", "bottom"], this.ease = "Expo", this.hide_start = !0, this.type = "hotspot" }, MSHotspotLayer.extend(MSLayerElement); var i = MSHotspotLayer.prototype, e = MSLayerElement.prototype; i._showTT = function () { this.show_cl && (clearTimeout(this.hto), this._tween && this._tween.stop(!0), this.hide_start && (this.align = this._orgAlign, this._locateTT(), this.tt.css({ display: "block" }), this._tween = CTween.animate(this.tt, 900, this.to, { ease: "easeOut" + this.ease }), this.hide_start = !1)) }, i._hideTT = function () { if (this.show_cl) { this._tween && this._tween.stop(!0); var t = this; clearTimeout(this.hto), this.hto = setTimeout(function () { t.hide_start = !0, t._tween = CTween.animate(t.tt, 900, t.from, { ease: "easeOut" + t.ease, complete: function () { t.tt.css("display", "none") } }) }, 200) } }, i._updateClassName = function (t) { this._lastClass && this.tt.removeClass(this._lastClass), this.tt.addClass(t), this._lastClass = t }, i._alignPolicy = function () { this.tt.outerHeight(!1); var t = Math.max(this.tt.outerWidth(!1), parseInt(this.tt.css("max-width"))), i = window.innerWidth; window.innerHeight; switch (this.align) { case "top": if (this.base_t < 0) return "bottom"; break; case "right": if (this.base_l + t > i || this.base_t < 0) return "bottom"; break; case "left": if (this.base_l < 0 || this.base_t < 0) return "bottom" }return null }, i._locateTT = function () { var t = this.$element.offset(), i = this.slide.slider.$element.offset(); this.pos_x = t.left - i.left - this.slide.slider.$element.scrollLeft(), this.pos_y = t.top - i.top - this.slide.slider.$element.scrollTop(), this.from = { opacity: 0 }, this.to = { opacity: 1 }, this._updateClassName("ms-tooltip-" + this.align), this.tt_arrow.css("margin-left", ""); switch (this.align) { case "top": e = Math.min(this.tt.outerWidth(!1), parseInt(this.tt.css("max-width"))); this.base_t = this.pos_y - this.tt.outerHeight(!1) - 15 - 15, this.base_l = this.pos_x - e / 2, this.base_l + e > window.innerWidth && (this.tt_arrow.css("margin-left", -7.5 + this.base_l + e - window.innerWidth + "px"), this.base_l = window.innerWidth - e), this.base_l < 0 && (this.base_l = 0, this.tt_arrow.css("margin-left", -7.5 + this.pos_x - this.tt.outerWidth(!1) / 2 + "px")), window._css3d ? (this.from[window._jcsspfx + "Transform"] = "translateY(-50px)", this.to[window._jcsspfx + "Transform"] = "") : (this.from.top = this.base_t - 50 + "px", this.to.top = this.base_t + "px"); break; case "bottom": var e = Math.min(this.tt.outerWidth(!1), parseInt(this.tt.css("max-width"))); this.base_t = this.pos_y + 15 + 15, this.base_l = this.pos_x - e / 2, this.base_l + e > window.innerWidth && (this.tt_arrow.css("margin-left", -7.5 + this.base_l + e - window.innerWidth + "px"), this.base_l = window.innerWidth - e), this.base_l < 0 && (this.base_l = 0, this.tt_arrow.css("margin-left", -7.5 + this.pos_x - this.tt.outerWidth(!1) / 2 + "px")), window._css3d ? (this.from[window._jcsspfx + "Transform"] = "translateY(50px)", this.to[window._jcsspfx + "Transform"] = "") : (this.from.top = this.base_t + 50 + "px", this.to.top = this.base_t + "px"); break; case "right": this.base_l = this.pos_x + 15 + 15, this.base_t = this.pos_y - this.tt.outerHeight(!1) / 2, window._css3d ? (this.from[window._jcsspfx + "Transform"] = "translateX(50px)", this.to[window._jcsspfx + "Transform"] = "") : (this.from.left = this.base_l + 50 + "px", this.to.left = this.base_l + "px"); break; case "left": this.base_l = this.pos_x - 15 - this.tt.outerWidth(!1) - 15, this.base_t = this.pos_y - this.tt.outerHeight(!1) / 2, window._css3d ? (this.from[window._jcsspfx + "Transform"] = "translateX(-50px)", this.to[window._jcsspfx + "Transform"] = "") : (this.from.left = this.base_l - 50 + "px", this.to.left = this.base_l + "px") }var s = this._alignPolicy(); if (null !== s) return this.align = s, void this._locateTT(); this.tt.css("top", parseInt(this.base_t) + "px").css("left", parseInt(this.base_l) + "px"), this.tt.css(this.from) }, i.start = function () { e.start.call(this), this.tt.appendTo(this.slide.slider.$element), this.tt.css("display", "none") }, i.reset = function () { e.reset.call(this), this.tt.detach() }, i.create = function () { var i = this; this._orgAlign = this.align = void 0 !== this.$element.data("align") ? this.$element.data("align") : "top", this.data = this.$element.html(), this.$element.html("").on("mouseenter", function () { i._showTT() }).on("mouseleave", function () { i._hideTT() }), this.point = t('<div><div class="ms-point-center"></div><div class="ms-point-border"></div></div>').addClass("ms-tooltip-point").appendTo(this.$element); var s = this.$element.data("link"), n = this.$element.data("target"); s && this.point.on("click", function () { window.open(s, n || "_self") }), this.tt = t("<div></div>").addClass("ms-tooltip").css("display", "hidden").css("opacity", 0), void 0 !== this.$element.data("width") && this.tt.css("width", this.$element.data("width")).css("max-width", this.$element.data("width")), this.tt_arrow = t("<div></div>").addClass("ms-tooltip-arrow").appendTo(this.tt), this._updateClassName("ms-tooltip-" + this.align), this.ttcont = t("<div></div>").addClass("ms-tooltip-cont").html(this.data).appendTo(this.tt), !0 === this.$element.data("stay-hover") && this.tt.on("mouseenter", function () { i.hide_start || (clearTimeout(i.hto), i._tween.stop(!0), i._showTT()) }).on("mouseleave", function () { i._hideTT() }), e.create.call(this) } }(jQuery), function (t) { window.MSButtonLayer = function () { MSLayerElement.call(this), this.type = "button" }, MSButtonLayer.extend(MSLayerElement); var i = MSButtonLayer.prototype, e = MSLayerElement.prototype, s = ["top", "left", "bottom", "right"]; i.create = function () { e.create.call(this), this.$element.wrap('<div class="ms-btn-container"></div>').css("position", "relative"), this.$container = this.$element.parent() }, i.locate = function () { e.locate.call(this); for (var t, i, n = 0; n < 4; n++)(t = s[n]) in this.baseStyle && (i = this.$element.css(t), this.$element.css(t, ""), this.$container.css(t, i)); this.$container.width(this.$element.outerWidth(!0)).height(this.$element.outerHeight(!0)) } }(), window.MSSliderEvent = function (t) { this.type = t }, MSSliderEvent.CHANGE_START = "ms_changestart", MSSliderEvent.CHANGE_END = "ms_changeend", MSSliderEvent.WAITING = "ms_waiting", MSSliderEvent.AUTOPLAY_CHANGE = "ms_autoplaychange", MSSliderEvent.VIDEO_PLAY = "ms_videoPlay", MSSliderEvent.VIDEO_CLOSE = "ms_videoclose", MSSliderEvent.INIT = "ms_init", MSSliderEvent.HARD_UPDATE = "ms_hard_update", MSSliderEvent.RESIZE = "ms_resize", MSSliderEvent.RESERVED_SPACE_CHANGE = "ms_rsc", MSSliderEvent.DESTROY = "ms_destroy", function (t, i, e) { "use strict"; t.MSSlide = function () { this.$element = null, this.$loading = e("<div></div>").addClass("ms-slide-loading"), this.view = null, this.index = -1, this.__width = 0, this.__height = 0, this.fillMode = "fill", this.selected = !1, this.pselected = !1, this.autoAppend = !0, this.isSleeping = !0, this.moz = e.browser.mozilla }; var s = MSSlide.prototype; s.onSwipeStart = function () { this.link && (this.linkdis = !0), this.video && (this.videodis = !0) }, s.onSwipeMove = function (t) { var i = Math.max(Math.abs(t.data.distanceX), Math.abs(t.data.distanceY)); this.swipeMoved = i > 4 }, s.onSwipeCancel = function (t) { this.swipeMoved ? this.swipeMoved = !1 : (this.link && (this.linkdis = !1), this.video && (this.videodis = !1)) }, s.setupLayerController = function () { this.hasLayers = !0, this.layerController = new MSLayerController(this) }, s.assetsLoaded = function () { this.ready = !0, this.slider.api._startTimer(), (this.selected || this.pselected && this.slider.options.instantStartLayers) && (this.hasLayers && this.layerController.showLayers(), this.vinit && (this.bgvideo.play(), this.autoPauseBgVid || (this.bgvideo.currentTime = 0))), this.isSleeping || this.setupBG(), CTween.fadeOut(this.$loading, 300, !0), (0 === this.slider.options.preload || "all" === this.slider.options.preload) && this.index < this.view.slideList.length - 1 ? this.view.slideList[this.index + 1].loadImages() : "all" === this.slider.options.preload && this.index === this.view.slideList.length - 1 && this.slider._removeLoading() }, s.setBG = function (t) { this.hasBG = !0; var i = this; this.$imgcont = e("<div></div>").addClass("ms-slide-bgcont"), this.$element.append(this.$loading).append(this.$imgcont), this.$bg_img = e(t).css("visibility", "hidden"), this.$imgcont.append(this.$bg_img), this.bgAligner = new MSAligner(i.fillMode, i.$imgcont, i.$bg_img), this.bgAligner.widthOnly = this.slider.options.autoHeight, i.slider.options.autoHeight && (i.pselected || i.selected) && i.slider.setHeight(i.slider.options.height), void 0 !== this.$bg_img.data("src") ? (this.bg_src = this.$bg_img.data("src"), this.$bg_img.removeAttr("data-src")) : this.$bg_img.one("load", function (t) { i._onBGLoad(t) }).each(e.jqLoadFix) }, s.setupBG = function () { !this.initBG && this.bgLoaded && (this.initBG = !0, this.$bg_img.css("visibility", ""), this.bgWidth = this.bgNatrualWidth || this.$bg_img.width(), this.bgHeight = this.bgNatrualHeight || this.$bg_img.height(), CTween.fadeIn(this.$imgcont, 300), this.slider.options.autoHeight && this.$imgcont.height(this.bgHeight * this.ratio), this.bgAligner.init(this.bgWidth, this.bgHeight), this.setSize(this.__width, this.__height), this.slider.options.autoHeight && (this.pselected || this.selected) && this.slider.setHeight(this.getHeight())) }, s.loadImages = function () { if (!this.ls) { if (this.ls = !0, this.bgvideo && this.bgvideo.load(), this.hasBG && this.bg_src) { var t = this; this.$bg_img.preloadImg(this.bg_src, function (i) { t._onBGLoad(i) }) } this.hasLayers && this.layerController.loadLayers(this._onLayersLoad), this.hasBG || this.hasLayers || this.assetsLoaded() } }, s._onLayersLoad = function () { this.layersLoaded = !0, this.hasBG && !this.bgLoaded || this.assetsLoaded() }, s._onBGLoad = function (t) { this.bgNatrualWidth = t.width, this.bgNatrualHeight = t.height, this.bgLoaded = !0, e.browser.msie && this.$bg_img.on("dragstart", function (t) { t.preventDefault() }), this.hasLayers && !this.layerController.ready || this.assetsLoaded() }, s.setBGVideo = function (i) { if (i[0].play) if (!t._mobile || this.slider.options.mobileBGVideo) { this.bgvideo = i[0]; var s = this; i.addClass("ms-slide-bgvideo"), !1 !== i.data("loop") && this.bgvideo.addEventListener("ended", function () { s.bgvideo.play() }), !1 !== i.data("mute") && (this.bgvideo.muted = !0), !0 === i.data("autopause") && (this.autoPauseBgVid = !0), this.bgvideo_fillmode = i.data("fill-mode") || "fill", "none" !== this.bgvideo_fillmode && (this.bgVideoAligner = new MSAligner(this.bgvideo_fillmode, this.$element, i), this.bgvideo.addEventListener("loadedmetadata", function () { s.vinit || (s.vinit = !0, s.video_aspect = s.bgVideoAligner.baseHeight / s.bgVideoAligner.baseWidth, s.bgVideoAligner.init(s.bgvideo.videoWidth, s.bgvideo.videoHeight), s._alignBGVideo(), CTween.fadeIn(e(s.bgvideo), 200), s.selected && s.bgvideo.play()) })), i.css("opacity", 0), this.$bgvideocont = e("<div></div>").addClass("ms-slide-bgvideocont").append(i), this.hasBG ? this.$imgcont.before(this.$bgvideocont) : this.$bgvideocont.appendTo(this.$element) } else i.remove() }, s._alignBGVideo = function () { this.bgvideo_fillmode && "none" !== this.bgvideo_fillmode && this.bgVideoAligner.align() }, s.setSize = function (t, i, e) { this.__width = t, this.slider.options.autoHeight && (this.bgLoaded ? (this.ratio = this.__width / this.bgWidth, i = Math.floor(this.ratio * this.bgHeight), this.$imgcont.height(i)) : (this.ratio = t / this.slider.options.width, i = this.slider.options.height * this.ratio)), this.__height = i, this.$element.width(t).height(i), this.hasBG && this.bgLoaded && this.bgAligner.align(), this._alignBGVideo(), this.hasLayers && this.layerController.setSize(t, i, e) }, s.getHeight = function () { return this.hasBG && this.bgLoaded ? this.bgHeight * this.ratio : Math.max(this.$element[0].clientHeight, this.slider.options.height * this.ratio) }, s.__playVideo = function () { this.vplayed || this.videodis || (this.vplayed = !0, this.slider.api.paused || (this.slider.api.pause(), this.roc = !0), this.vcbtn.css("display", ""), CTween.fadeOut(this.vpbtn, 500, !1), CTween.fadeIn(this.vcbtn, 500), CTween.fadeIn(this.vframe, 500), this.vframe.css("display", "block").attr("src", this.video + "&autoplay=1"), this.view.$element.addClass("ms-def-cursor"), this.moz && this.view.$element.css("perspective", "none"), this.view.swipeControl && this.view.swipeControl.disable(), this.slider.slideController.dispatchEvent(new MSSliderEvent(MSSliderEvent.VIDEO_PLAY))) }, s.__closeVideo = function () { if (this.vplayed) { this.vplayed = !1, this.roc && this.slider.api.resume(); var t = this; CTween.fadeIn(this.vpbtn, 500), CTween.animate(this.vcbtn, 500, { opacity: 0 }, { complete: function () { t.vcbtn.css("display", "none") } }), CTween.animate(this.vframe, 500, { opacity: 0 }, { complete: function () { t.vframe.attr("src", "about:blank").css("display", "none") } }), this.moz && this.view.$element.css("perspective", ""), this.view.swipeControl && this.view.swipeControl.enable(), this.view.$element.removeClass("ms-def-cursor"), this.slider.slideController.dispatchEvent(new MSSliderEvent(MSSliderEvent.VIDEO_CLOSE)) } }, s.create = function () { var i = this; this.hasLayers && this.layerController.create(), this.link && this.link.addClass("ms-slide-link").html("").click(function (t) { i.linkdis && t.preventDefault() }), this.video && (-1 === this.video.indexOf("?") && (this.video += "?"), this.vframe = e("<iframe></iframe>").addClass("ms-slide-video").css({ width: "100%", height: "100%", display: "none" }).attr("src", "about:blank").attr("allowfullscreen", "true").appendTo(this.$element), this.vpbtn = e("<div></div>").addClass("ms-slide-vpbtn").click(function () { i.__playVideo() }).appendTo(this.$element), this.vcbtn = e("<div></div>").addClass("ms-slide-vcbtn").click(function () { i.__closeVideo() }).appendTo(this.$element).css("display", "none"), t._touch && this.vcbtn.removeClass("ms-slide-vcbtn").addClass("ms-slide-vcbtn-mobile").append('<div class="ms-vcbtn-txt">Close video</div>').appendTo(this.view.$element.parent())), !this.slider.options.autoHeight && this.hasBG && (this.$imgcont.css("height", "100%"), "center" !== this.fillMode && "stretch" !== this.fillMode || (this.fillMode = "fill")), this.slider.options.autoHeight && this.$element.addClass("ms-slide-auto-height"), this.sleep(!0) }, s.destroy = function () { this.hasLayers && (this.layerController.destroy(), this.layerController = null), this.$element.remove(), this.$element = null }, s.prepareToSelect = function () { this.pselected || this.selected || (this.pselected = !0, (this.link || this.video) && (this.view.addEventListener(MSViewEvents.SWIPE_START, this.onSwipeStart, this), this.view.addEventListener(MSViewEvents.SWIPE_MOVE, this.onSwipeMove, this), this.view.addEventListener(MSViewEvents.SWIPE_CANCEL, this.onSwipeCancel, this), this.linkdis = !1, this.swipeMoved = !1), this.loadImages(), this.hasLayers && this.layerController.prepareToShow(), this.ready && (this.bgvideo && this.bgvideo.play(), this.hasLayers && this.slider.options.instantStartLayers && this.layerController.showLayers()), this.moz && this.$element.css("margin-top", "")) }, s.select = function () { this.selected || (this.selected = !0, this.pselected = !1, this.$element.addClass("ms-sl-selected"), this.hasLayers && (this.slider.options.autoHeight && this.layerController.updateHeight(), this.slider.options.instantStartLayers || this.layerController.showLayers()), this.ready && this.bgvideo && this.bgvideo.play(), this.videoAutoPlay && (this.videodis = !1, this.vpbtn.trigger("click"))) }, s.unselect = function () { this.pselected = !1, this.moz && this.$element.css("margin-top", "0.1px"), (this.link || this.video) && (this.view.removeEventListener(MSViewEvents.SWIPE_START, this.onSwipeStart, this), this.view.removeEventListener(MSViewEvents.SWIPE_MOVE, this.onSwipeMove, this), this.view.removeEventListener(MSViewEvents.SWIPE_CANCEL, this.onSwipeCancel, this)), this.bgvideo && (this.bgvideo.pause(), !this.autoPauseBgVid && this.vinit && (this.bgvideo.currentTime = 0)), this.hasLayers && this.layerController.hideLayers(), this.selected && (this.selected = !1, this.$element.removeClass("ms-sl-selected"), this.video && this.vplayed && (this.__closeVideo(), this.roc = !1)) }, s.sleep = function (t) { this.isSleeping && !t || (this.isSleeping = !0, this.autoAppend && this.$element.detach(), this.hasLayers && this.layerController.onSlideSleep()) }, s.wakeup = function () { this.isSleeping && (this.isSleeping = !1, this.autoAppend && this.view.$slideCont.append(this.$element), this.moz && this.$element.css("margin-top", "0.1px"), this.setupBG(), this.hasBG && this.bgAligner.align(), this.hasLayers && this.layerController.onSlideWakeup()) } }(window, document, jQuery), function (t) { "use strict"; var i = {}; window.MSSlideController = function (t) { this._delayProgress = 0, this._timer = new averta.Timer(100), this._timer.onTimer = this.onTimer, this._timer.refrence = this, this.currentSlide = null, this.slider = t, this.so = t.options, averta.EventDispatcher.call(this) }, MSSlideController.registerView = function (t, e) { if (t in i) throw new Error(t + ", is already registered."); i[t] = e }, MSSlideController.SliderControlList = {}, MSSlideController.registerControl = function (t, i) { if (t in MSSlideController.SliderControlList) throw new Error(t + ", is already registered."); MSSlideController.SliderControlList[t] = i }; var e = MSSlideController.prototype; e.setupView = function () { n = this; this.resize_listener = function () { n.__resize() }; var e = { spacing: this.so.space, mouseSwipe: this.so.mouse, loop: this.so.loop, autoHeight: this.so.autoHeight, swipe: this.so.swipe, speed: this.so.speed, dir: this.so.dir, viewNum: this.so.inView, critMargin: this.so.critMargin }; this.so.viewOptions && t.extend(e, this.so.viewOptions), this.so.autoHeight && (this.so.heightLimit = !1); var s = i[this.slider.options.view] || MSBasicView; if (!s._3dreq || window._css3d && !t.browser.msie || (s = s._fallback || MSBasicView), this.view = new s(e), this.so.overPause) { var n = this; this.slider.$element.mouseenter(function () { n.is_over = !0, n._stopTimer() }).mouseleave(function () { n.is_over = !1, n._startTimer() }) } }, e.onChangeStart = function () { this.change_started = !0, this.currentSlide && this.currentSlide.unselect(), this.currentSlide = this.view.currentSlide, this.currentSlide.prepareToSelect(), this.so.endPause && this.currentSlide.index === this.slider.slides.length - 1 && (this.pause(), this.skipTimer()), this.so.autoHeight && this.slider.setHeight(this.currentSlide.getHeight()), this.so.deepLink && this.__updateWindowHash(), this.dispatchEvent(new MSSliderEvent(MSSliderEvent.CHANGE_START)) }, e.onChangeEnd = function () { if (this.change_started = !1, this._startTimer(), this.currentSlide.select(), this.so.preload > 1) { var t, i, e, s = this.so.preload - 1; for (i = 1; i <= s; ++i) { if ((t = this.view.index + i) >= this.view.slideList.length) { if (!this.so.loop) { i = s; continue } t -= this.view.slideList.length } (e = this.view.slideList[t]) && e.loadImages() } for (s > this.view.slideList.length / 2 && (s = Math.floor(this.view.slideList.length / 2)), i = 1; i <= s; ++i) { if ((t = this.view.index - i) < 0) { if (!this.so.loop) { i = s; continue } t = this.view.slideList.length + t } (e = this.view.slideList[t]) && e.loadImages() } } this.dispatchEvent(new MSSliderEvent(MSSliderEvent.CHANGE_END)) }, e.onSwipeStart = function () { this.skipTimer() }, e.skipTimer = function () { this._timer.reset(), this._delayProgress = 0, this.dispatchEvent(new MSSliderEvent(MSSliderEvent.WAITING)) }, e.onTimer = function (t) { if (this._timer.getTime() >= 1e3 * this.view.currentSlide.delay && (this.skipTimer(), this.view.next(), this.hideCalled = !1), this._delayProgress = this._timer.getTime() / (10 * this.view.currentSlide.delay), this.so.hideLayers && !this.hideCalled && 1e3 * this.view.currentSlide.delay - this._timer.getTime() <= 300) { var i = this.view.currentSlide; i.hasLayers && i.layerController.animHideLayers(), this.hideCalled = !0 } this.dispatchEvent(new MSSliderEvent(MSSliderEvent.WAITING)) }, e._stopTimer = function () { this._timer && this._timer.stop() }, e._startTimer = function () { this.paused || this.is_over || !this.currentSlide || !this.currentSlide.ready || this.change_started || this._timer.start() }, e.__appendSlides = function () { var t, i, e = 0, s = this.view.slideList.length - 1; for (e; e < s; ++e)(t = this.view.slideList[e]).detached || (t.$element.detach(), t.detached = !0); for (this.view.appendSlide(this.view.slideList[this.view.index]), s = 3, e = 1; e <= s; ++e) { if ((i = this.view.index + e) >= this.view.slideList.length) { if (!this.so.loop) { e = s; continue } i -= this.view.slideList.length } (t = this.view.slideList[i]).detached = !1, this.view.appendSlide(t) } for (s > this.view.slideList.length / 2 && (s = Math.floor(this.view.slideList.length / 2)), e = 1; e <= s; ++e) { if ((i = this.view.index - e) < 0) { if (!this.so.loop) { e = s; continue } i = this.view.slideList.length + i } (t = this.view.slideList[i]).detached = !1, this.view.appendSlide(t) } }, e.__resize = function (t) { this.created && (this.width = this.slider.$element[0].clientWidth || this.so.width, this.so.fullwidth || (this.width = Math.min(this.width, this.so.width)), this.so.fullheight ? (this.so.heightLimit = !1, this.so.autoHeight = !1, this.height = this.slider.$element[0].clientHeight) : this.height = this.width / this.slider.aspect, this.so.autoHeight ? (this.currentSlide.setSize(this.width, null, t), this.view.setSize(this.width, this.currentSlide.getHeight(), t)) : this.view.setSize(this.width, Math.max(this.so.minHeight, this.so.heightLimit ? Math.min(this.height, this.so.height) : this.height), t), this.slider.$controlsCont && this.so.centerControls && this.so.fullwidth && this.view.$element.css("left", Math.min(0, -(this.slider.$element[0].clientWidth - this.so.width) / 2) + "px"), this.dispatchEvent(new MSSliderEvent(MSSliderEvent.RESIZE))) }, e.__dispatchInit = function () { this.dispatchEvent(new MSSliderEvent(MSSliderEvent.INIT)) }, e.__updateWindowHash = function () { var t = window.location.hash, i = this.so.deepLink, e = this.so.deepLinkType, s = "path" === e ? "/" : "=", n = "path" === e ? "/" : "&", o = i + s + (this.view.index + 1), a = new RegExp(i + s + "[0-9]+", "g"); "" === t ? window.location.hash = n + o : a.test(t) ? window.location.hash = t.replace(a, o) : window.location.hash = t + n + o }, e.__curentSlideInHash = function () { var t = window.location.hash, i = this.so.deepLink, e = "path" === this.so.deepLinkType ? "/" : "=", s = new RegExp(i + e + "[0-9]+", "g"); if (s.test(t)) { var n = Number(t.match(s)[0].match(/[0-9]+/g).pop()); if (!isNaN(n)) return n - 1 } return -1 }, e.__onHashChanged = function () { var t = this.__curentSlideInHash(); -1 !== t && this.gotoSlide(t) }, e.__findLayerById = function (t) { if (!this.currentSlide) return null; var i; return this.currentSlide.layerController && (i = this.currentSlide.layerController.getLayerById(t)), !i && this.slider.overlayLayers ? this.slider.overlayLayers.layerController.getLayerById(t) : i }, e.setup = function () { this.created = !0, this.paused = !this.so.autoplay, this.view.addEventListener(MSViewEvents.CHANGE_START, this.onChangeStart, this), this.view.addEventListener(MSViewEvents.CHANGE_END, this.onChangeEnd, this), this.view.addEventListener(MSViewEvents.SWIPE_START, this.onSwipeStart, this), this.currentSlide = this.view.slideList[this.so.start - 1], this.__resize(); var i = this.__curentSlideInHash(), e = -1 !== i ? i : this.so.start - 1; if (this.view.create(e), 0 === this.so.preload && this.view.slideList[0].loadImages(), this.scroller = this.view.controller, this.so.wheel) { var s = this, n = (new Date).getTime(); this.wheellistener = function (i) { var e = window.event || i.orginalEvent || i; e.preventDefault(); var o = (new Date).getTime(); if (!(o - n < 400)) { n = o; var a = Math.abs(e.detail || e.wheelDelta); t.browser.mozilla && (a *= 100); return e.detail < 0 || e.wheelDelta > 0 ? a >= 15 && s.previous(!0) : a >= 15 && s.next(!0), !1 } }, t.browser.mozilla ? this.slider.$element[0].addEventListener("DOMMouseScroll", this.wheellistener) : this.slider.$element.bind("mousewheel", this.wheellistener) } 0 === this.slider.$element[0].clientWidth && (this.slider.init_safemode = !0), this.__resize(); s = this; this.so.deepLink && t(window).on("hashchange", function () { s.__onHashChanged() }) }, e.index = function () { return this.view.index }, e.count = function () { return this.view.slidesCount }, e.next = function (t) { this.skipTimer(), this.view.next(t) }, e.previous = function (t) { this.skipTimer(), this.view.previous(t) }, e.gotoSlide = function (t) { t = Math.min(t, this.count() - 1), this.skipTimer(), this.view.gotoSlide(t) }, e.destroy = function (t) { this.dispatchEvent(new MSSliderEvent(MSSliderEvent.DESTROY)), this.slider.destroy(t) }, e._destroy = function () { this._timer.reset(), this._timer = null, t(window).unbind("resize", this.resize_listener), this.view.destroy(), this.view = null, this.so.wheel && (t.browser.mozilla ? this.slider.$element[0].removeEventListener("DOMMouseScroll", this.wheellistener) : this.slider.$element.unbind("mousewheel", this.wheellistener), this.wheellistener = null), this.so = null }, e.runAction = function (t) { var i = []; if (-1 !== t.indexOf("(")) { var e = t.slice(0, t.indexOf("(")); i = t.slice(t.indexOf("(") + 1, -1).replace(/\"|\'|\s/g, "").split(","), t = e } t in this ? this[t].apply(this, i) : console && console.log('Master Slider Error: Action "' + t + '" not found.') }, e.update = function (t) { this.slider.init_safemode && t && (this.slider.init_safemode = !1), this.__resize(t), t && this.dispatchEvent(new MSSliderEvent(MSSliderEvent.HARD_UPDATE)) }, e.locate = function () { this.__resize() }, e.resume = function () { this.paused && (this.paused = !1, this._startTimer()) }, e.pause = function () { this.paused || (this.paused = !0, this._stopTimer()) }, e.currentTime = function () { return this._delayProgress }, e.showLayer = function (t, i) { var e = this.__findLayerById(t); e && (i ? (clearTimeout(e.actionTimeout), e.actionTimeout = setTimeout(this.showLayer, i, t, 0)) : e.start()) }, e.hideLayer = function (t, i) { var e = this.__findLayerById(t); e && (i ? (clearTimeout(e.actionTimeout), e.actionTimeout = setTimeout(this.hideLayer, i, t, 0)) : e.hide()) }, e.toggleLayer = function (t, i) { var e = this.__findLayerById(t); e && (i ? (clearTimeout(e.actionTimeout), e.actionTimeout = setTimeout(this.toggleLayer, i, t, 0)) : e.isShowing ? e.hide() : e.start()) }, e.showLayers = function (i, e) { var s = this; t.each(i.replace(/\s+/g, "").split("|"), function (t, i) { s.showLayer(i, e) }) }, e.hideLayers = function (i, e) { var s = this; t.each(i.replace(/\s+/g, "").split("|"), function (t, i) { s.hideLayer(i, e) }) }, e.toggleLayers = function (i, e) { var s = this; t.each(i.replace(/\s+/g, "").split("|"), function (t, i) { s.toggleLayer(i, e) }) }, averta.EventDispatcher.extend(e) }(jQuery), function (t) { "use strict"; var i = { image: MSImageLayerElement, text: MSLayerElement, video: MSVideoLayerElement, hotspot: MSHotspotLayer, button: MSButtonLayer }; window.Multislider = function () { this.options = { forceInit: !0, autoplay: !1, loop: !1, mouse: !0, swipe: !0, grabCursor: !0, space: 0, fillMode: "fill", start: 1, view: "basic", width: 300, height: 150, inView: 15, critMargin: 1, mobileBGVideo: !1, heightLimit: !0, smoothHeight: !0, autoHeight: !1, minHeight: -1, fullwidth: !1, fullheight: !1, autofill: !1, layersMode: "center", hideLayers: !1, endPause: !1, centerControls: !0, overPause: !0, shuffle: !1, speed: 17, dir: "h", preload: 0, wheel: !1, layout: "boxed", autofillTarget: null, fullscreenMargin: 0, instantStartLayers: !1, parallaxMode: "mouse", rtl: !1, deepLink: null, deepLinkType: "path", disablePlugins: [] }, this.slides = [], this.activePlugins = [], this.$element = null, this.lastMargin = 0, this.leftSpace = 0, this.topSpace = 0, this.rightSpace = 0, this.bottomSpace = 0, this._holdOn = 0; var i = this; this.resize_listener = function () { i._resize() }, t(window).bind("resize", this.resize_listener) }, Multislider.author = "Averta Ltd. (www.averta.net)", Multislider.version = "2.51.2", Multislider.releaseDate = "Jun 2017", Multislider._plugins = []; var e = Multislider; e.registerPlugin = function (t) { -1 === e._plugins.indexOf(t) && e._plugins.push(t) }; var s = Multislider.prototype; s.__setupSlides = function () { var i, e = this, s = 0; this.$element.children(".ms-slide").each(function (n) { var o = t(this); (i = new MSSlide).$element = o, i.slider = e, i.delay = void 0 !== o.data("delay") ? o.data("delay") : 3, i.fillMode = void 0 !== o.data("fill-mode") ? o.data("fill-mode") : e.options.fillMode, i.index = s++ , i.id = o.data("id"); var a = o.children("img:not(.ms-layer)"); a.length > 0 && i.setBG(a[0]); var r = o.children("video"); if (r.length > 0 && i.setBGVideo(r), e.controls) for (var h = 0, l = e.controls.length; h < l; ++h)e.controls[h].slideAction(i); o.children("a").each(function (e) { var s = t(this); "video" === this.getAttribute("data-type") ? (i.video = this.getAttribute("href"), i.videoAutoPlay = s.data("autoplay"), s.remove()) : s.hasClass("ms-layer") || (i.link = t(this)) }); e.__createSlideLayers(i, o.find(".ms-layer")), e.slides.push(i), e.slideController.view.addSlide(i) }) }, s._setupOverlayLayers = function () { var t = this, i = this.$element.children(".ms-overlay-layers").eq(0); if (i.length) { var e = new MSOverlayLayers(this); e.$element = i, t.__createSlideLayers(e, i.find(".ms-layer")), this.view.$element.prepend(i), this.overlayLayers = e, e.create() } }, s.__createSlideLayers = function (e, s) { 0 != s.length && (e.setupLayerController(), s.each(function (s, n) { var o, a = t(this); "A" === n.nodeName && "image" === a.find(">img").data("type") && (a = (o = t(this)).find("img")); var r = new (i[a.data("type") || "text"]); r.$element = a, r.link = o, r.id = r.$element.data("id"), r.waitForAction = r.$element.data("wait"), r.masked = r.$element.data("masked"), r.maskWidth = r.$element.data("mask-width"), r.maskHeight = r.$element.data("mask-height"); var h = {}, l = {}; void 0 !== a.data("effect") && (h.name = a.data("effect")), void 0 !== a.data("ease") && (h.ease = a.data("ease")), void 0 !== a.data("duration") && (h.duration = a.data("duration")), void 0 !== a.data("delay") && (h.delay = a.data("delay")), a.data("hide-effect") && (l.name = a.data("hide-effect")), a.data("hide-ease") && (l.ease = a.data("hide-ease")), void 0 !== a.data("hide-duration") && (l.duration = a.data("hide-duration")), void 0 !== a.data("hide-time") && (l.time = a.data("hide-time")), r.setStartAnim(h), r.setEndAnim(l), e.layerController.addLayer(r) })) }, s._removeLoading = function () { t(window).unbind("resize", this.resize_listener), this.$element.removeClass("before-init").css("visibility", "visible").css("height", "").css("opacity", 0), CTween.fadeIn(this.$element), this.$loading.remove(), this.slideController && this.slideController.__resize() }, s._resize = function (t) { if (this.$loading) { var i = this.$loading[0].clientWidth / this.aspect; i = this.options.heightLimit ? Math.min(i, this.options.height) : i, this.$loading.height(i), this.$element.height(i) } }, s._shuffleSlides = function () { for (var t, i = this.$element.children(".ms-slide"), e = 0, s = i.length; e < s; ++e)e != (t = Math.floor(Math.random() * (s - 1))) && (this.$element[0].insertBefore(i[e], i[t]), i = this.$element.children(".ms-slide")) }, s._setupSliderLayout = function () { this._updateSideMargins(), this.lastMargin = this.leftSpace; var i = this.options.layout; "boxed" !== i && "partialview" !== i && (this.options.fullwidth = !0), "fullscreen" !== i && "autofill" !== i || (this.options.fullheight = !0, "autofill" === i && (this.$autofillTarget = t(this.options.autofillTarget), 0 === this.$autofillTarget.length && (this.$autofillTarget = this.$element.parent()))), "partialview" === i && this.$element.addClass("ms-layout-partialview"), "fullscreen" !== i && "fullwidth" !== i && "autofill" !== i || (t(window).bind("resize", { that: this }, this._updateLayout), this._updateLayout()), t(window).bind("resize", this.slideController.resize_listener) }, s._updateLayout = function (i) { var e = i ? i.data.that : this, s = e.options.layout, n = e.$element, o = t(window); if ("fullscreen" === s) document.body.style.overflow = "hidden", n.height(o.height() - e.options.fullscreenMargin - e.topSpace - e.bottomSpace), document.body.style.overflow = ""; else if ("autofill" === s) return void n.height(e.$autofillTarget.height() - e.options.fullscreenMargin - e.topSpace - e.bottomSpace).width(e.$autofillTarget.width() - e.leftSpace - e.rightSpace); n.width(o.width() - e.leftSpace - e.rightSpace); var a = -n.offset().left + e.leftSpace + e.lastMargin; n.css("margin-left", a), e.lastMargin = a }, s._init = function () { if (!(this._holdOn > 0) && this._docReady) { if (this.initialized = !0, "all" !== this.options.preload && this._removeLoading(), this.options.shuffle && this._shuffleSlides(), MSLayerEffects.setup(), this.slideController.setupView(), this.view = this.slideController.view, this.$controlsCont = t("<div></div>").addClass("ms-inner-controls-cont"), this.options.centerControls && this.$controlsCont.css("max-width", this.options.width + "px"), this.$controlsCont.prepend(this.view.$element), this.$msContainer = t("<div></div>").addClass("ms-container").prependTo(this.$element).append(this.$controlsCont), this.controls) for (var i = 0, e = this.controls.length; i < e; ++i)this.controls[i].setup(); if (this._setupSliderLayout(), this.__setupSlides(), this.slideController.setup(), this._setupOverlayLayers(), this.controls) for (i = 0, e = this.controls.length; i < e; ++i)this.controls[i].create(); if (this.options.autoHeight && this.slideController.view.$element.height(this.slideController.currentSlide.getHeight()), this.options.swipe && !window._touch && this.options.grabCursor && this.options.mouse) { var s = this.view.$element; s.mousedown(function () { s.removeClass("ms-grab-cursor"), s.addClass("ms-grabbing-cursor"), t.browser.msie && window.ms_grabbing_curosr && (s[0].style.cursor = "url(" + window.ms_grabbing_curosr + "), move") }).addClass("ms-grab-cursor"), t(document).mouseup(function () { s.removeClass("ms-grabbing-cursor"), s.addClass("ms-grab-cursor"), t.browser.msie && window.ms_grab_curosr && (s[0].style.cursor = "url(" + window.ms_grab_curosr + "), move") }) } this.slideController.__dispatchInit() } }, s.setHeight = function (t) { this.options.smoothHeight ? (this.htween && (this.htween.reset ? this.htween.reset() : this.htween.stop(!0)), this.htween = CTween.animate(this.slideController.view.$element, 500, { height: t }, { ease: "easeOutQuart" })) : this.slideController.view.$element.height(t) }, s.reserveSpace = function (t, i) { var e = t + "Space", s = this[e]; return this[e] += i, this._updateSideMargins(), s }, s._updateSideMargins = function () { this.$element.css("margin", this.topSpace + "px " + this.rightSpace + "px " + this.bottomSpace + "px " + this.leftSpace + "px") }, s._realignControls = function () { this.rightSpace = this.leftSpace = this.topSpace = this.bottomSpace = 0, this._updateSideMargins(), this.api.dispatchEvent(new MSSliderEvent(MSSliderEvent.RESERVED_SPACE_CHANGE)) }, s.control = function (t, i) { if (t in MSSlideController.SliderControlList) { this.controls || (this.controls = []); var e = new MSSlideController.SliderControlList[t](i); return e.slider = this, this.controls.push(e), this } }, s.holdOn = function () { this._holdOn++ }, s.release = function () { this._holdOn-- , this._init() }, s.setup = function (i, s) { if (this.$element = "string" == typeof i ? t("#" + i) : i.eq(0), this.setupMarkup = this.$element.html(), 0 !== this.$element.length) { this.$element.addClass("edsms__multiSlider").addClass("before-init"), t.browser.msie ? this.$element.addClass("ms-ie").addClass("ms-ie" + t.browser.version.slice(0, t.browser.version.indexOf("."))) : t.browser.webkit ? this.$element.addClass("ms-wk") : t.browser.mozilla && this.$element.addClass("ms-moz"), navigator.userAgent.toLowerCase().indexOf("android") > -1 && this.$element.addClass("ms-android"); var n = this; t.extend(this.options, s), this.aspect = this.options.width / this.options.height, this.$loading = t("<div></div>").addClass("ms-loading-container").insertBefore(this.$element).append(t("<div></div>").addClass("ms-loading")), this.$loading.parent().css("position", "relative"), this.options.autofill && (this.options.fullwidth = !0, this.options.fullheight = !0), this.options.fullheight && this.$element.addClass("ms-fullheight"), this._resize(), this.slideController = new MSSlideController(this), this.api = this.slideController; for (var o = 0, a = e._plugins.length; o !== a; o++) { var r = e._plugins[o]; -1 === this.options.disablePlugins.indexOf(r.name) && this.activePlugins.push(new r(this)) } return this.options.forceInit && Multislider.addJQReadyErrorCheck(this), t(document).ready(function () { n.initialized || (n._docReady = !0, n._init()) }), this } }, s.destroy = function (i) { for (var e = 0, s = this.activePlugins.length; e !== s; e++)this.activePlugins[e].destroy(); if (this.controls) for (e = 0, s = this.controls.length; e !== s; e++)this.controls[e].destroy(); this.slideController && this.slideController._destroy(), this.$loading && this.$loading.remove(), i ? this.$element.html(this.setupMarkup).css("visibility", "hidden") : this.$element.remove(); var n = this.options.layout; "fullscreen" !== n && "fullwidth" !== n || t(window).unbind("resize", this._updateLayout), this.view = null, this.slides = null, this.options = null, this.slideController = null, this.api = null, this.resize_listener = null, this.activePlugins = null } }(jQuery), function (t, i, e, s) { function n(i, e) { this.element = i, this.$element = t(i), this.settings = t.extend({}, a, e), this._defaults = a, this._name = o, this.init() } var o = "masterslider", a = { controls: {} }; t.extend(n.prototype, { init: function () { var t = this; this._slider = new Multislider; for (var i in this.settings.controls) this._slider.control(i, this.settings.controls[i]); this._slider.setup(this.$element, this.settings); var e = this._slider.api.dispatchEvent; this._slider.api.dispatchEvent = function (i) { t.$element.trigger(i.type), e.call(this, i) } }, api: function () { return this._slider.api }, slider: function () { return this._slider } }), t.fn[o] = function (i) { var e = arguments, s = "plugin_" + o; if (void 0 === i || "object" == typeof i) return this.each(function () { t.data(this, s) || t.data(this, s, new n(this, i)) }); if ("string" == typeof i && "_" !== i[0] && "init" !== i) { var a; return this.each(function () { var o = t.data(this, s); o instanceof n && "function" == typeof o[i] && (a = o[i].apply(o, Array.prototype.slice.call(e, 1))), o instanceof n && "function" == typeof o._slider.api[i] && (a = o._slider.api[i].apply(o._slider.api, Array.prototype.slice.call(e, 1))), "destroy" === i && t.data(this, s, null) }), void 0 !== a ? a : this } } }(jQuery, window, document), function (t, i, e, s) { "use strict"; var n = []; Multislider.addJQReadyErrorCheck = function (t) { n.push(t) }; var o = t.fn.ready, a = i.onerror; t.fn.ready = function () { return i.onerror = function () { if (0 !== n.length) for (var t = 0, i = n.length; t !== i; t++) { var e = n[t]; e.initialized || (e._docReady = !0, e._init()) } return !!a && a.apply(this, arguments) }, o.apply(this, arguments) } }(jQuery, window, document), window.MSViewEvents = function (t, i) { this.type = t, this.data = i }, MSViewEvents.SWIPE_START = "swipeStart", MSViewEvents.SWIPE_END = "swipeEnd", MSViewEvents.SWIPE_MOVE = "swipeMove", MSViewEvents.SWIPE_CANCEL = "swipeCancel", MSViewEvents.SCROLL = "scroll", MSViewEvents.CHANGE_START = "slideChangeStart", MSViewEvents.CHANGE_END = "slideChangeEnd", function (t) { "use strict"; window.MSBasicView = function (i) { this.options = { loop: !1, dir: "h", autoHeight: !1, spacing: 5, mouseSwipe: !0, swipe: !0, speed: 17, minSlideSpeed: 2, viewNum: 20, critMargin: 1 }, t.extend(this.options, i), this.dir = this.options.dir, this.loop = this.options.loop, this.spacing = this.options.spacing, this.__width = 0, this.__height = 0, this.__cssProb = "h" === this.dir ? "left" : "top", this.__offset = "h" === this.dir ? "offsetLeft" : "offsetTop", this.__dimension = "h" === this.dir ? "__width" : "__height", this.__translate_end = window._css3d ? " translateZ(0px)" : "", this.$slideCont = t("<div></div>").addClass("ms-slide-container"), this.$element = t("<div></div>").addClass("ms-view").addClass("ms-basic-view").append(this.$slideCont), this.currentSlide = null, this.index = -1, this.slidesCount = 0, this.slides = [], this.slideList = [], this.viewSlidesList = [], this.css3 = window._cssanim, this.start_buffer = 0, this.firstslide_snap = 0, this.slideChanged = !1, this.controller = new Controller(0, 0, { snapping: !0, snapsize: 100, paging: !0, snappingMinSpeed: this.options.minSlideSpeed, friction: (100 - .5 * this.options.speed) / 100, endless: this.loop }), this.controller.renderCallback("h" === this.dir ? this._horizUpdate : this._vertiUpdate, this), this.controller.snappingCallback(this.__snapUpdate, this), this.controller.snapCompleteCallback(this.__snapCompelet, this), averta.EventDispatcher.call(this) }; var i = MSBasicView.prototype; i.__snapCompelet = function (t, i) { this.slideChanged && (this.slideChanged = !1, this.__locateSlides(), this.start_buffer = 0, this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_END))) }, i.__snapUpdate = function (i, e, s) { if (this.loop) { var n = this.index + s; this.updateLoop(n), n >= this.slidesCount && (n -= this.slidesCount), n < 0 && (n = this.slidesCount + n), this.index = n } else { if (e < 0 || e >= this.slidesCount) return; this.index = e } this._checkCritMargins(), t.browser.mozilla && (this.slideList[this.index].$element[0].style.marginTop = "0.1px", this.currentSlide && (this.currentSlide.$element[0].style.marginTop = "")); var o = this.slideList[this.index]; o !== this.currentSlide && (this.currentSlide = o, this.autoUpdateZIndex && this.__updateSlidesZindex(), this.slideChanged = !0, this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_START))) }, i._checkCritMargins = function () { if (!this.normalMode) { var t = Math.floor(this.options.viewNum / 2), i = this.viewSlidesList.indexOf(this.slideList[this.index]), e = this[this.__dimension] + this.spacing, s = this.options.critMargin; this.loop ? (i <= s || i >= this.viewSlidesList.length - s) && (e *= i - t, this.__locateSlides(!1, e + this.start_buffer), this.start_buffer += e) : (i < s && this.index >= s || i >= this.viewSlidesList.length - s && this.index < this.slidesCount - s) && this.__locateSlides(!1) } }, i._vertiUpdate = function (t, i) { this.__contPos = i, this.dispatchEvent(new MSViewEvents(MSViewEvents.SCROLL)), this.css3 ? this.$slideCont[0].style[window._jcsspfx + "Transform"] = "translateY(" + -i + "px)" + this.__translate_end : this.$slideCont[0].style.top = -i + "px" }, i._horizUpdate = function (t, i) { this.__contPos = i, this.dispatchEvent(new MSViewEvents(MSViewEvents.SCROLL)), this.css3 ? this.$slideCont[0].style[window._jcsspfx + "Transform"] = "translateX(" + -i + "px)" + this.__translate_end : this.$slideCont[0].style.left = -i + "px" }, i.__updateViewList = function () { if (this.normalMode) this.viewSlidesList = this.slides; else { var t = this.viewSlidesList.slice(); this.viewSlidesList = []; var i, e = 0, s = Math.floor(this.options.viewNum / 2); if (this.loop) for (; e !== this.options.viewNum; e++)this.viewSlidesList.push(this.slides[this.currentSlideLoc - s + e]); else { for (e = 0; e !== s && this.index - e != -1; e++)this.viewSlidesList.unshift(this.slideList[this.index - e]); for (e = 1; e !== s && this.index + e !== this.slidesCount; e++)this.viewSlidesList.push(this.slideList[this.index + e]) } for (e = 0, i = t.length; e !== i; e++)-1 === this.viewSlidesList.indexOf(t[e]) && t[e].sleep(); t = null, this.currentSlide && this.__updateSlidesZindex() } }, i.__locateSlides = function (t, i) { this.__updateViewList(), i = this.loop ? i || 0 : this.slides.indexOf(this.viewSlidesList[0]) * (this[this.__dimension] + this.spacing); for (var e, s = this.viewSlidesList.length, n = 0; n !== s; n++) { var o = i + n * (this[this.__dimension] + this.spacing); (e = this.viewSlidesList[n]).wakeup(), e.position = o, e.$element[0].style[this.__cssProb] = o + "px" } !1 !== t && this.controller.changeTo(this.slideList[this.index].position, !1, null, null, !1) }, i.__createLoopList = function () { var t = [], i = 0, e = this.slidesCount / 2, s = this.slidesCount % 2 == 0 ? e - 1 : Math.floor(e), n = this.slidesCount % 2 == 0 ? e : Math.floor(e); for (this.currentSlideLoc = s, i = 1; i <= s; ++i)t.unshift(this.slideList[this.index - i < 0 ? this.slidesCount - i + this.index : this.index - i]); for (t.push(this.slideList[this.index]), i = 1; i <= n; ++i)t.push(this.slideList[this.index + i >= this.slidesCount ? this.index + i - this.slidesCount : this.index + i]); return t }, i.__getSteps = function (t, i) { var e = i < t ? this.slidesCount - t + i : i - t, s = Math.abs(this.slidesCount - e); return e < s ? e : -s }, i.__pushEnd = function () { var t = this.slides.shift(), i = this.slides[this.slidesCount - 2]; if (this.slides.push(t), this.normalMode) { var e = i.$element[0][this.__offset] + this.spacing + this[this.__dimension]; t.$element[0].style[this.__cssProb] = e + "px", t.position = e } }, i.__pushStart = function () { var t = this.slides.pop(), i = this.slides[0]; if (this.slides.unshift(t), this.normalMode) { var e = i.$element[0][this.__offset] - this.spacing - this[this.__dimension]; t.$element[0].style[this.__cssProb] = e + "px", t.position = e } }, i.__updateSlidesZindex = function () { var t = this.viewSlidesList.length; Math.floor(t / 2); if (this.loop) for (var i = this.viewSlidesList.indexOf(this.currentSlide), e = 0; e !== t; e++)this.viewSlidesList[e], this.viewSlidesList[e].$element.css("z-index", e <= i ? e + 1 : t - e); else { for (var s = this.currentSlide.index - this.viewSlidesList[0].index, e = 0; e !== t; e++)this.viewSlidesList[e].$element.css("z-index", e <= s ? e + 1 : t - e); this.currentSlide.$element.css("z-index", t) } }, i.addSlide = function (t) { t.view = this, this.slides.push(t), this.slideList.push(t), this.slidesCount++ }, i.appendSlide = function (t) { this.$slideCont.append(t.$element) }, i.updateLoop = function (t) { if (this.loop) for (var i = this.__getSteps(this.index, t), e = 0, s = Math.abs(i); e < s; ++e)i < 0 ? this.__pushStart() : this.__pushEnd() }, i.gotoSlide = function (t, i) { this.updateLoop(t), this.index = t; var e = this.slideList[t]; this._checkCritMargins(), this.controller.changeTo(e.position, !i, null, null, !1), e !== this.currentSlide && (this.slideChanged = !0, this.currentSlide = e, this.autoUpdateZIndex && this.__updateSlidesZindex(), this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_START)), i && this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_END))) }, i.next = function (t) { t && !this.loop && this.index + 1 >= this.slidesCount ? this.controller.bounce(10) : this.gotoSlide(this.index + 1 >= this.slidesCount ? 0 : this.index + 1) }, i.previous = function (t) { t && !this.loop && this.index - 1 < 0 ? this.controller.bounce(-10) : this.gotoSlide(this.index - 1 < 0 ? this.slidesCount - 1 : this.index - 1) }, i.setupSwipe = function () { this.swipeControl = new averta.TouchSwipe(this.$element), this.swipeControl.swipeType = "h" === this.dir ? "horizontal" : "vertical"; var t = this; "h" === this.dir ? this.swipeControl.onSwipe = function (i) { t.horizSwipeMove(i) } : this.swipeControl.onSwipe = function (i) { t.vertSwipeMove(i) } }, i.vertSwipeMove = function (t) { var i = t.phase; if ("start" === i) this.controller.stop(), this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_START, t)); else if ("move" === i && (!this.loop || Math.abs(this.currentSlide.position - this.controller.value + t.moveY) < this.cont_size / 2)) this.controller.drag(t.moveY), this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_MOVE, t)); else if ("end" === i || "cancel" === i) { var e = t.distanceY / t.duration * 50 / 3, s = Math.abs(t.distanceY / t.duration * 50 / 3); Math.abs(e) > .1 && Math.abs(e) >= s ? (this.controller.push(-e), e > this.controller.options.snappingMinSpeed && this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_END, t))) : (this.controller.cancel(), this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_CANCEL, t))) } }, i.horizSwipeMove = function (t) { var i = t.phase; if ("start" === i) this.controller.stop(), this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_START, t)); else if ("move" === i && (!this.loop || Math.abs(this.currentSlide.position - this.controller.value + t.moveX) < this.cont_size / 2)) this.controller.drag(t.moveX), this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_MOVE, t)); else if ("end" === i || "cancel" === i) { var e = t.distanceX / t.duration * 50 / 3, s = Math.abs(t.distanceY / t.duration * 50 / 3); Math.abs(e) > .1 && Math.abs(e) >= s ? (this.controller.push(-e), e > this.controller.options.snappingMinSpeed && this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_END, t))) : (this.controller.cancel(), this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_CANCEL, t))) } }, i.setSize = function (t, i, e) { if (this.lastWidth !== t || i !== this.lastHeight || e) { this.$element.width(t).height(i); for (var s = 0; s < this.slidesCount; ++s)this.slides[s].setSize(t, i, e); this.__width = t, this.__height = i, this.__created && (this.__locateSlides(), this.cont_size = (this.slidesCount - 1) * (this[this.__dimension] + this.spacing), this.loop || (this.controller._max_value = this.cont_size), this.controller.options.snapsize = this[this.__dimension] + this.spacing, this.controller.changeTo(this.currentSlide.position, !1, null, null, !1), this.controller.cancel(), this.lastWidth = t, this.lastHeight = i) } }, i.create = function (t) { this.__created = !0, this.index = Math.min(t || 0, this.slidesCount - 1), this.lastSnap = this.index, this.loop && (this.slides = this.__createLoopList()), this.normalMode = this.slidesCount <= this.options.viewNum; for (var i = 0; i < this.slidesCount; ++i)this.slides[i].create(); this.__locateSlides(), this.controller.options.snapsize = this[this.__dimension] + this.spacing, this.loop || (this.controller._max_value = (this.slidesCount - 1) * (this[this.__dimension] + this.spacing)), this.gotoSlide(this.index, !0), this.options.swipe && (window._touch || this.options.mouseSwipe) && this.setupSwipe() }, i.destroy = function () { if (this.__created) { for (var t = 0; t < this.slidesCount; ++t)this.slides[t].destroy(); this.slides = null, this.slideList = null, this.$element.remove(), this.controller.destroy(), this.controller = null } }, averta.EventDispatcher.extend(i), MSSlideController.registerView("basic", MSBasicView) }(jQuery), function (t) { "use strict"; window.MSWaveView = function (t) { MSBasicView.call(this, t), this.$element.removeClass("ms-basic-view").addClass("ms-wave-view"), this.$slideCont.css(window._csspfx + "transform-style", "preserve-3d"), this.autoUpdateZIndex = !0 }, MSWaveView.extend(MSBasicView), MSWaveView._3dreq = !0, MSWaveView._fallback = MSBasicView; var i = MSWaveView.prototype, e = MSBasicView.prototype; i._horizUpdate = function (t, i) { e._horizUpdate.call(this, t, i); for (var s, n, o = -i, a = 0; a < this.slidesCount; ++a)n = -o - (s = this.slideList[a]).position, this.__updateSlidesHoriz(s, n) }, i._vertiUpdate = function (t, i) { e._vertiUpdate.call(this, t, i); for (var s, n, o = -i, a = 0; a < this.slidesCount; ++a)n = -o - (s = this.slideList[a]).position, this.__updateSlidesVertic(s, n) }, i.__updateSlidesHoriz = function (t, i) { var e = Math.abs(100 * i / this.__width); t.$element[0].style[window._csspfx + "transform"] = "translateZ(" + 3 * -e + "px) rotateY(0.01deg)" }, i.__updateSlidesVertic = function (t, i) { this.__updateSlidesHoriz(t, i) }, MSSlideController.registerView("wave", MSWaveView) }(), function () { window.MSFadeBasicView = function (t) { MSWaveView.call(this, t), this.$element.removeClass("ms-wave-view").addClass("ms-fade-basic-view") }, MSFadeBasicView.extend(MSWaveView); var t = MSFadeBasicView.prototype; MSFadeBasicView.prototype; t.__updateSlidesHoriz = function (t, i) { var e = Math.abs(.6 * i / this.__width); e = 1 - Math.min(e, .6), t.$element.css("opacity", e) }, t.__updateSlidesVertic = function (t, i) { this.__updateSlidesHoriz(t, i) }, MSSlideController.registerView("fadeBasic", MSFadeBasicView), MSWaveView._fallback = MSFadeBasicView }(), function () { window.MSFadeWaveView = function (t) { MSWaveView.call(this, t), this.$element.removeClass("ms-wave-view").addClass("ms-fade-wave-view") }, MSFadeWaveView.extend(MSWaveView), MSFadeWaveView._3dreq = !0, MSFadeWaveView._fallback = MSFadeBasicView; var t = MSFadeWaveView.prototype; MSWaveView.prototype; t.__updateSlidesHoriz = function (t, i) { var e = Math.abs(100 * i / this.__width); e = Math.min(e, 100), t.$element.css("opacity", 1 - e / 300), t.$element[0].style[window._jcsspfx + "Transform"] = "scale(" + (1 - e / 800) + ") rotateY(0.01deg) " }, t.__updateSlidesVertic = function (t, i) { this.__updateSlidesHoriz(t, i) }, MSSlideController.registerView("fadeWave", MSFadeWaveView) }(), function (t) { "use strict"; window.MSFlowView = function (t) { MSWaveView.call(this, t), this.$element.removeClass("ms-wave-view").addClass("ms-flow-view") }, MSFlowView.extend(MSWaveView), MSFlowView._3dreq = !0, MSFlowView._fallback = MSFadeBasicView; var i = MSFlowView.prototype; MSWaveView.prototype; i.__updateSlidesHoriz = function (t, i) { var e = Math.abs(100 * i / this.__width), s = Math.min(.3 * e, 30) * (i < 0 ? -1 : 1), n = 1.2 * e; t.$element[0].style[window._jcsspfx + "Transform"] = "translateZ(" + 5 * -n + "px) rotateY(" + s + "deg) " }, i.__updateSlidesVertic = function (t, i) { var e = Math.abs(100 * i / this.__width), s = Math.min(.3 * e, 30) * (i < 0 ? -1 : 1), n = 1.2 * e; t.$element[0].style[window._jcsspfx + "Transform"] = "translateZ(" + 5 * -n + "px) rotateX(" + -s + "deg) " }, MSSlideController.registerView("flow", MSFlowView) }(), function () { window.MSFadeFlowView = function (t) { MSWaveView.call(this, t), this.$element.removeClass("ms-wave-view").addClass("ms-fade-flow-view") }, MSFadeFlowView.extend(MSWaveView), MSFadeFlowView._3dreq = !0; var t = MSFadeFlowView.prototype; MSWaveView.prototype; t.__calculate = function (t) { var i = Math.min(Math.abs(100 * t / this.__width), 100); return { value: i, rvalue: Math.min(.5 * i, 50) * (t < 0 ? -1 : 1) } }, t.__updateSlidesHoriz = function (t, i) { var e = this.__calculate(i); t.$element.css("opacity", 1 - e.value / 300), console.log(window._jcsspfx + "transform", "translateZ(" + -e.value + "px) rotateY(" + e.rvalue + "deg) "), t.$element[0].style[window._jcsspfx + "Transform"] = "translateZ(" + -e.value + "px) rotateY(" + e.rvalue + "deg) " }, t.__updateSlidesVertic = function (t, i) { var e = this.__calculate(i); t.$element.css("opacity", 1 - e.value / 300), t.$element[0].style[window._jcsspfx + "Transform"] = "translateZ(" + -e.value + "px) rotateX(" + -e.rvalue + "deg) " }, MSSlideController.registerView("fadeFlow", MSFadeFlowView) }(), function (t) { "use strict"; window.MSMaskView = function (t) { MSBasicView.call(this, t), this.$element.removeClass("ms-basic-view").addClass("ms-mask-view") }, MSMaskView.extend(MSBasicView); var i = MSMaskView.prototype, e = MSBasicView.prototype; i.addSlide = function (i) { i.view = this, i.$frame = t("<div></div>").addClass("ms-mask-frame").append(i.$element), i.$element[0].style.position = "relative", i.autoAppend = !1, this.slides.push(i), this.slideList.push(i), this.slidesCount++ }, i.setSize = function (t, i) { for (var s = this.slides[0].slider, n = 0; n < this.slidesCount; ++n)this.slides[n].$frame[0].style.width = t + "px", s.options.autoHeight || (this.slides[n].$frame[0].style.height = i + "px"); e.setSize.call(this, t, i) }, i._horizUpdate = function (t, i) { e._horizUpdate.call(this, t, i); var s = 0; if (this.css3) for (s = 0; s < this.slidesCount; ++s)this.slideList[s].$element[0].style[window._jcsspfx + "Transform"] = "translateX(" + (i - this.slideList[s].position) + "px)" + this.__translate_end; else for (s = 0; s < this.slidesCount; ++s)this.slideList[s].$element[0].style.left = i - this.slideList[s].position + "px" }, i._vertiUpdate = function (t, i) { e._vertiUpdate.call(this, t, i); var s = 0; if (this.css3) for (s = 0; s < this.slidesCount; ++s)this.slideList[s].$element[0].style[window._jcsspfx + "Transform"] = "translateY(" + (i - this.slideList[s].position) + "px)" + this.__translate_end; else for (s = 0; s < this.slidesCount; ++s)this.slideList[s].$element[0].style.top = i - this.slideList[s].position + "px" }, i.__pushEnd = function () { var t = this.slides.shift(), i = this.slides[this.slidesCount - 2]; if (this.slides.push(t), this.normalMode) { var e = i.$frame[0][this.__offset] + this.spacing + this[this.__dimension]; t.$frame[0].style[this.__cssProb] = e + "px", t.position = e } }, i.__pushStart = function () { var t = this.slides.pop(), i = this.slides[0]; if (this.slides.unshift(t), this.normalMode) { var e = i.$frame[0][this.__offset] - this.spacing - this[this.__dimension]; t.$frame[0].style[this.__cssProb] = e + "px", t.position = e } }, i.__updateViewList = function () { if (this.normalMode) this.viewSlidesList = this.slides; else { var t = this.viewSlidesList.slice(); this.viewSlidesList = []; var i, e = 0, s = Math.floor(this.options.viewNum / 2); if (this.loop) for (; e !== this.options.viewNum; e++)this.viewSlidesList.push(this.slides[this.currentSlideLoc - s + e]); else { for (e = 0; e !== s && this.index - e != -1; e++)this.viewSlidesList.unshift(this.slideList[this.index - e]); for (e = 1; e !== s && this.index + e !== this.slidesCount; e++)this.viewSlidesList.push(this.slideList[this.index + e]) } for (e = 0, i = t.length; e !== i; e++)-1 === this.viewSlidesList.indexOf(t[e]) && (t[e].sleep(), t[e].$frame.detach()); t = null } }, i.__locateSlides = function (t, i) { this.__updateViewList(), i = this.loop ? i || 0 : this.slides.indexOf(this.viewSlidesList[0]) * (this[this.__dimension] + this.spacing); for (var e, s = this.viewSlidesList.length, n = 0; n !== s; n++) { var o = i + n * (this[this.__dimension] + this.spacing); if (e = this.viewSlidesList[n], this.$slideCont.append(e.$frame), e.wakeup(!1), e.position = o, e.selected && e.bgvideo) try { e.bgvideo.play() } catch (t) { } e.$frame[0].style[this.__cssProb] = o + "px" } !1 !== t && this.controller.changeTo(this.slideList[this.index].position, !1, null, null, !1) }, MSSlideController.registerView("mask", MSMaskView) }(jQuery), function (t) { "use strict"; window.MSParallaxMaskView = function (t) { MSMaskView.call(this, t), this.$element.removeClass("ms-basic-view").addClass("ms-parallax-mask-view") }, MSParallaxMaskView.extend(MSMaskView), MSParallaxMaskView.parallaxAmount = .5; var i = MSParallaxMaskView.prototype, e = MSBasicView.prototype; i._horizUpdate = function (t, i) { e._horizUpdate.call(this, t, i); var s = 0; if (this.css3) for (s = 0; s < this.slidesCount; ++s)this.slideList[s].$element[0].style[window._jcsspfx + "Transform"] = "translateX(" + (i - this.slideList[s].position) * MSParallaxMaskView.parallaxAmount + "px)" + this.__translate_end; else for (s = 0; s < this.slidesCount; ++s)this.slideList[s].$element[0].style.left = (i - this.slideList[s].position) * MSParallaxMaskView.parallaxAmount + "px" }, i._vertiUpdate = function (t, i) { e._vertiUpdate.call(this, t, i); var s = 0; if (this.css3) for (s = 0; s < this.slidesCount; ++s)this.slideList[s].$element[0].style[window._jcsspfx + "Transform"] = "translateY(" + (i - this.slideList[s].position) * MSParallaxMaskView.parallaxAmount + "px)" + this.__translate_end; else for (s = 0; s < this.slidesCount; ++s)this.slideList[s].$element[0].style.top = (i - this.slideList[s].position) * MSParallaxMaskView.parallaxAmount + "px" }, MSSlideController.registerView("parallaxMask", MSParallaxMaskView) }(), function (t) { "use strict"; window.MSFadeView = function (t) { MSBasicView.call(this, t), this.$element.removeClass("ms-basic-view").addClass("ms-fade-view"), this.controller.renderCallback(this.__update, this) }, MSFadeView.extend(MSBasicView); var i = MSFadeView.prototype, e = MSBasicView.prototype; i.__update = function (t, i) { for (var e, s, n = -i, o = 0; o < this.slidesCount; ++o)s = -n - (e = this.slideList[o]).position, this.__updateSlides(e, s) }, i.__updateSlides = function (t, i) { var e = Math.abs(i / this[this.__dimension]); 1 - e <= 0 ? t.$element.fadeTo(0, 0).css("visibility", "hidden") : t.$element.fadeTo(0, 1 - e).css("visibility", "") }, i.__locateSlides = function (t, i) { this.__updateViewList(), i = this.loop ? i || 0 : this.slides.indexOf(this.viewSlidesList[0]) * (this[this.__dimension] + this.spacing); for (var e, s = this.viewSlidesList.length, n = 0; n !== s; n++) { var o = i + n * this[this.__dimension]; (e = this.viewSlidesList[n]).wakeup(), e.position = o } !1 !== t && this.controller.changeTo(this.slideList[this.index].position, !1, null, null, !1) }, i.__pushEnd = function () { var t = this.slides.shift(), i = this.slides[this.slidesCount - 2]; this.slides.push(t), t.position = i.position + this[this.__dimension] }, i.__pushStart = function () { var t = this.slides.pop(), i = this.slides[0]; this.slides.unshift(t), t.position = i.position - this[this.__dimension] }, i.create = function (t) { e.create.call(this, t), this.spacing = 0, this.controller.options.minValidDist = 10 }, MSSlideController.registerView("fade", MSFadeView) }(), function (t) { "use strict"; window.MSScaleView = function (t) { MSBasicView.call(this, t), this.$element.removeClass("ms-basic-view").addClass("ms-scale-view"), this.controller.renderCallback(this.__update, this) }, MSScaleView.extend(MSFadeView); var i = MSScaleView.prototype, e = MSFadeView.prototype; i.__updateSlides = function (t, i) { var e = Math.abs(i / this[this.__dimension]), s = t.$element[0]; 1 - e <= 0 ? (s.style.opacity = 0, s.style.visibility = "hidden", s.style[window._jcsspfx + "Transform"] = "") : (s.style.opacity = 1 - e, s.style.visibility = "", s.style[window._jcsspfx + "Transform"] = "perspective(2000px) translateZ(" + e * (i < 0 ? -.5 : .5) * 300 + "px)") }, i.create = function (t) { e.create.call(this, t), this.controller.options.minValidDist = .03 }, MSSlideController.registerView("scale", MSScaleView) }(), function (t) { "use strict"; window.MSStackView = function (t) { MSBasicView.call(this, t), this.$element.removeClass("ms-basic-view").addClass("ms-stack-view"), this.controller.renderCallback(this.__update, this), this.autoUpdateZIndex = !0 }, MSStackView.extend(MSFadeView), MSStackView._3dreq = !0, MSStackView._fallback = MSFadeView; var i = MSStackView.prototype, e = MSFadeView.prototype; i.__updateSlidesZindex = function () { for (var t = this.viewSlidesList.length, i = 0; i !== t; i++)this.viewSlidesList[i], this.viewSlidesList[i].$element.css("z-index", t - i) }, i.__updateSlides = function (t, i) { var e = Math.abs(i / this[this.__dimension]), s = t.$element[0]; 1 - e <= 0 ? (s.style.opacity = 1, s.style.visibility = "hidden", s.style[window._jcsspfx + "Transform"] = "") : (s.style.visibility = "", s.style[window._jcsspfx + "Transform"] = i < 0 ? "perspective(2000px) translateZ(" + -300 * e + "px)" : this.__translate + "(" + -e * this[this.__dimension] + "px)") }, i.create = function (t) { e.create.call(this, t), this.controller.options.minValidDist = .03, this.__translate = "h" === this.dir ? "translateX" : "translateY" }, MSSlideController.registerView("stack", MSStackView) }(), function () { "use strict"; window.MSFocusView = function (t) { MSWaveView.call(this, t), this.$element.removeClass("ms-wave-view").addClass("ms-focus-view"), this.options.centerSpace = this.options.centerSpace || 1 }, MSFocusView.extend(MSWaveView), MSFocusView._3dreq = !0, MSFocusView._fallback = MSFadeBasicView; var t = MSFocusView.prototype; MSWaveView.prototype; t.__calcview = function (t, i) { return i / 2 * t / (t + 2e3) * (t + 2e3) / 2e3 }, t.__updateSlidesHoriz = function (t, i) { var e = Math.abs(100 * i / this.__width); e = 15 * -Math.min(e, 100), t.$element.css(window._csspfx + "transform", "translateZ(" + (e + 1) + "px) rotateY(0.01deg) translateX(" + (i < 0 ? 1 : -1) * (-this.__calcview(e, this.__width) * this.options.centerSpace) + "px)") }, t.__updateSlidesVertic = function (t, i) { var e = Math.abs(100 * i / this.__width); e = 15 * -Math.min(e, 100), t.$element.css(window._csspfx + "transform", "translateZ(" + (e + 1) + "px) rotateY(0.01deg) translateY(" + (i < 0 ? 1 : -1) * (-this.__calcview(e, this.__width) * this.options.centerSpace) + "px)") }, MSSlideController.registerView("focus", MSFocusView) }(), function () { window.MSPartialWaveView = function (t) { MSWaveView.call(this, t), this.$element.removeClass("ms-wave-view").addClass("ms-partial-wave-view") }, MSPartialWaveView.extend(MSWaveView), MSPartialWaveView._3dreq = !0, MSPartialWaveView._fallback = MSFadeBasicView; var t = MSPartialWaveView.prototype; MSWaveView.prototype; t.__updateSlidesHoriz = function (t, i) { var e = Math.abs(100 * i / this.__width); t.hasBG && t.$bg_img.css("opacity", (100 - Math.abs(120 * i / this.__width / 3)) / 100), t.$element.css(window._csspfx + "transform", "translateZ(" + 3 * -e + "px) rotateY(0.01deg) translateX(" + .75 * i + "px)") }, t.__updateSlidesVertic = function (t, i) { var e = Math.abs(100 * i / this.__width); t.hasBG && t.$bg_img.css("opacity", (100 - Math.abs(120 * i / this.__width / 3)) / 100), t.$element.css(window._csspfx + "transform", "translateZ(" + 3 * -e + "px) rotateY(0.01deg) translateY(" + .75 * i + "px)") }, MSSlideController.registerView("partialWave", MSPartialWaveView) }(), function (t) { "use strict"; window.MSBoxView = function (t) { MSBasicView.call(this, t), this.$element.removeClass("ms-basic-view").addClass("ms-box-view"), this.controller.renderCallback(this.__update, this) }, MSBoxView.extend(MSFadeView), MSBoxView._3dreq = !0; var i = MSBoxView.prototype, e = MSFadeView.prototype; i.__updateSlides = function (t, i) { var e = Math.abs(i / this[this.__dimension]), s = t.$element[0]; 1 - e <= 0 ? (s.style.visibility = "hidden", s.style[window._jcsspfx + "Transform"] = "") : (s.style.visibility = "", s.style[window._jcsspfx + "Transform"] = "rotate" + this._rotateDir + "(" + e * (i < 0 ? 1 : -1) * 90 * this._calcFactor + "deg)", s.style[window._jcsspfx + "TransformOrigin"] = "50% 50% -" + t[this.__dimension] / 2 + "px", s.style.zIndex = Math.ceil(2 * (1 - e))) }, i.create = function (t) { e.create.call(this, t), this.controller.options.minValidDist = .03, this._rotateDir = "h" === this.options.dir ? "Y" : "X", this._calcFactor = "h" === this.options.dir ? 1 : -1 }, MSSlideController.registerView("box", MSBoxView) }(), function (t) { "use strict"; var i = function () { this.options = { prefix: "ms-", autohide: !0, overVideo: !0, customClass: null } }, e = i.prototype; e.slideAction = function (t) { }, e.setup = function () { this.cont = this.options.insertTo ? t(this.options.insertTo) : this.slider.$controlsCont, this.options.overVideo || this._hideOnvideoStarts() }, e.checkHideUnder = function () { this.options.hideUnder && (this.needsRealign = !this.options.insetTo && ("left" === this.options.align || "right" === this.options.align) && !1 === this.options.inset, t(window).bind("resize", { that: this }, this.onResize), this.onResize()) }, e.onResize = function (t) { var i = t && t.data.that || this, e = window.innerWidth; e <= i.options.hideUnder && !i.detached ? (i.hide(!0), i.detached = !0, i.onDetach()) : e >= i.options.hideUnder && i.detached && (i.detached = !1, i.visible(), i.onAppend()) }, e.create = function () { this.options.autohide && (this.hide(!0), this.slider.$controlsCont.mouseenter(t.proxy(this._onMouseEnter, this)).mouseleave(t.proxy(this._onMouseLeave, this)).mousedown(t.proxy(this._onMouseDown, this)), this.$element && this.$element.mouseenter(t.proxy(this._onMouseEnter, this)).mouseleave(t.proxy(this._onMouseLeave, this)).mousedown(t.proxy(this._onMouseDown, this)), t(document).mouseup(t.proxy(this._onMouseUp, this))), this.options.align && this.$element.addClass("ms-align-" + this.options.align), this.options.customClass && this.$element && this.$element.addClass(this.options.customClass) }, e._onMouseEnter = function () { this._disableAH || this.mdown || this.visible(), this.mleave = !1 }, e._onMouseLeave = function () { this.mdown || this.hide(), this.mleave = !0 }, e._onMouseDown = function () { this.mdown = !0 }, e._onMouseUp = function () { this.mdown && this.mleave && this.hide(), this.mdown = !1 }, e.onAppend = function () { this.needsRealign && this.slider._realignControls() }, e.onDetach = function () { this.needsRealign && this.slider._realignControls() }, e._hideOnvideoStarts = function () { var t = this; this.slider.api.addEventListener(MSSliderEvent.VIDEO_PLAY, function () { t._disableAH = !0, t.hide() }), this.slider.api.addEventListener(MSSliderEvent.VIDEO_CLOSE, function () { t._disableAH = !1, t.visible() }) }, e.hide = function (t) { if (t) this.$element.css("opacity", 0), this.$element.css("display", "none"); else { clearTimeout(this.hideTo); var i = this.$element; this.hideTo = setTimeout(function () { CTween.fadeOut(i, 400, !1) }, 20) } this.$element.addClass("ms-ctrl-hide") }, e.visible = function () { this.detached || (clearTimeout(this.hideTo), this.$element.css("display", ""), CTween.fadeIn(this.$element, 400, !1), this.$element.removeClass("ms-ctrl-hide")) }, e.destroy = function () { this.options && this.options.hideUnder && t(window).unbind("resize", this.onResize) }, window.BaseControl = i }(jQuery), function (t) { "use strict"; var i = function (i) { BaseControl.call(this), t.extend(this.options, i) }; i.extend(BaseControl); var e = i.prototype, s = BaseControl.prototype; e.setup = function () { var i = this; this.$next = t("<div></div>").addClass(this.options.prefix + "nav-next").bind("click", function () { i.slider.api.next(!0) }), this.$prev = t("<div></div>").addClass(this.options.prefix + "nav-prev").bind("click", function () { i.slider.api.previous(!0) }), s.setup.call(this), this.cont.append(this.$next), this.cont.append(this.$prev), this.checkHideUnder() }, e.hide = function (t) { if (t) return this.$prev.css("opacity", 0).css("display", "none"), void this.$next.css("opacity", 0).css("display", "none"); CTween.fadeOut(this.$prev, 400, !1), CTween.fadeOut(this.$next, 400, !1), this.$prev.addClass("ms-ctrl-hide"), this.$next.addClass("ms-ctrl-hide") }, e.visible = function () { this.detached || (CTween.fadeIn(this.$prev, 400), CTween.fadeIn(this.$next, 400), this.$prev.removeClass("ms-ctrl-hide").css("display", ""), this.$next.removeClass("ms-ctrl-hide").css("display", "")) }, e.destroy = function () { s.destroy(), this.$next.remove(), this.$prev.remove() }, window.MSArrows = i, MSSlideController.registerControl("arrows", i) }(jQuery), function (t) { "use strict"; var i = function (i) { BaseControl.call(this), this.options.dir = "h", this.options.wheel = "v" === i.dir, this.options.arrows = !1, this.options.speed = 17, this.options.align = null, this.options.inset = !1, this.options.margin = 10, this.options.space = 10, this.options.width = 100, this.options.height = 100, this.options.type = "thumbs", this.options.hover = !1, t.extend(this.options, i), this.thumbs = [], this.index_count = 0, this.__dimen = "h" === this.options.dir ? "width" : "height", this.__alignsize = "h" === this.options.dir ? "height" : "width", this.__jdimen = "h" === this.options.dir ? "outerWidth" : "outerHeight", this.__pos = "h" === this.options.dir ? "left" : "top", this.click_enable = !0 }; i.extend(BaseControl); var e = i.prototype, s = BaseControl.prototype; e.setup = function () { if (this.$element = t("<div></div>").addClass(this.options.prefix + "thumb-list"), "tabs" === this.options.type && this.$element.addClass(this.options.prefix + "tabs"), this.$element.addClass("ms-dir-" + this.options.dir), s.setup.call(this), this.slider.$controlsCont === this.cont ? this.$element.appendTo(this.slider.$element) : this.$element.appendTo(this.cont), this.$thumbscont = t("<div></div>").addClass("ms-thumbs-cont").appendTo(this.$element), this.options.arrows) { var i = this; this.$fwd = t("<div></div>").addClass("ms-thumblist-fwd").appendTo(this.$element).click(function () { i.controller.push(-15) }), this.$bwd = t("<div></div>").addClass("ms-thumblist-bwd").appendTo(this.$element).click(function () { i.controller.push(15) }) } if (!this.options.insetTo && this.options.align) { var e = this.options.align; this.options.inset ? this.$element.css(e, this.options.margin) : "top" === e ? this.$element.detach().prependTo(this.slider.$element).css({ "margin-bottom": this.options.margin, position: "relative" }) : "bottom" === e ? this.$element.css({ "margin-top": this.options.margin, position: "relative" }) : (this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this), this.align()), "v" === this.options.dir ? this.$element.width(this.options.width) : this.$element.height(this.options.height) } this.checkHideUnder() }, e.align = function (t) { if (!this.detached) { var i = this.options.align, e = this.slider.reserveSpace(i, this.options[this.__alignsize] + 2 * this.options.margin); this.$element.css(i, -e - this.options[this.__alignsize] - this.options.margin) } }, e.slideAction = function (i) { var e = i.$element.find(".ms-thumb"), s = this, n = t("<div></div>").addClass("ms-thumb-frame").append(e).append(t('<div class="ms-thumb-ol"></div>')).bind(this.options.hover ? "hover" : "click", function () { s.changeSlide(n) }); if (this.options.align && n.width(this.options.width - ("v" === this.options.dir && "tabs" === this.options.type ? 12 : 0)).height(this.options.height).css("margin-" + ("v" === this.options.dir ? "bottom" : "right"), this.options.space), n[0].index = this.index_count++ , this.$thumbscont.append(n), this.options.fillMode && e.is("img")) { var o = new window.MSAligner(this.options.fillMode, n, e); e[0].aligner = o, e.one("load", function (i) { var e = t(this); e[0].aligner.init(e.width(), e.height()), e[0].aligner.align() }).each(t.jqLoadFix) } t.browser.msie && e.on("dragstart", function (t) { t.preventDefault() }), this.thumbs.push(n) }, e.create = function () { s.create.call(this), this.__translate_end = window._css3d ? " translateZ(0px)" : "", this.controller = new Controller(0, 0, { snappingMinSpeed: 2, friction: (100 - .5 * this.options.speed) / 100 }), this.controller.renderCallback("h" === this.options.dir ? this._hMove : this._vMove, this); i = this; this.resize_listener = function () { i.__resize() }, t(window).bind("resize", this.resize_listener), this.thumbSize = this.thumbs[0][this.__jdimen](!0), this.setupSwipe(), this.__resize(); var i = this; this.options.wheel && (this.wheellistener = function (t) { var e = window.event || t.orginalEvent || t, s = Math.max(-1, Math.min(1, e.wheelDelta || -e.detail)); return i.controller.push(10 * -s), !1 }, t.browser.mozilla ? this.$element[0].addEventListener("DOMMouseScroll", this.wheellistener) : this.$element.bind("mousewheel", this.wheellistener)), this.slider.api.addEventListener(MSSliderEvent.CHANGE_START, this.update, this), this.slider.api.addEventListener(MSSliderEvent.HARD_UPDATE, this.realignThumbs, this), this.cindex = this.slider.api.index(), this.select(this.thumbs[this.cindex]) }, e._hMove = function (t, i) { this.__contPos = i, window._cssanim ? this.$thumbscont[0].style[window._jcsspfx + "Transform"] = "translateX(" + -i + "px)" + this.__translate_end : this.$thumbscont[0].style.left = -i + "px" }, e._vMove = function (t, i) { this.__contPos = i, window._cssanim ? this.$thumbscont[0].style[window._jcsspfx + "Transform"] = "translateY(" + -i + "px)" + this.__translate_end : this.$thumbscont[0].style.top = -i + "px" }, e.setupSwipe = function () { this.swipeControl = new averta.TouchSwipe(this.$element), this.swipeControl.swipeType = "h" === this.options.dir ? "horizontal" : "vertical"; var t = this; "h" === this.options.dir ? this.swipeControl.onSwipe = function (i) { t.horizSwipeMove(i) } : this.swipeControl.onSwipe = function (i) { t.vertSwipeMove(i) } }, e.vertSwipeMove = function (t) { if (!this.dTouch) { var i = t.phase; "start" === i ? this.controller.stop() : "move" === i ? this.controller.drag(t.moveY) : "end" !== i && "cancel" !== i || (Math.abs(t.distanceY / t.duration * 50 / 3) > .1 ? this.controller.push(-t.distanceY / t.duration * 50 / 3) : (this.click_enable = !0, this.controller.cancel())) } }, e.horizSwipeMove = function (t) { if (!this.dTouch) { var i = t.phase; "start" === i ? (this.controller.stop(), this.click_enable = !1) : "move" === i ? this.controller.drag(t.moveX) : "end" !== i && "cancel" !== i || (Math.abs(t.distanceX / t.duration * 50 / 3) > .1 ? this.controller.push(-t.distanceX / t.duration * 50 / 3) : (this.click_enable = !0, this.controller.cancel())) } }, e.update = function () { var t = this.slider.api.index(); this.cindex !== t && (null != this.cindex && this.unselect(this.thumbs[this.cindex]), this.cindex = t, this.select(this.thumbs[this.cindex]), this.dTouch || this.updateThumbscroll()) }, e.realignThumbs = function () { this.$element.find(".ms-thumb").each(function (t, i) { i.aligner && i.aligner.align() }) }, e.updateThumbscroll = function () { var t = this.thumbSize * this.cindex; if (NaN == this.controller.value && (this.controller.value = 0), t - this.controller.value < 0) this.controller.gotoSnap(this.cindex, !0); else if (t + this.thumbSize - this.controller.value > this.$element[this.__dimen]()) { var i = this.cindex - Math.floor(this.$element[this.__dimen]() / this.thumbSize) + 1; this.controller.gotoSnap(i, !0) } else; }, e.changeSlide = function (t) { this.click_enable && this.cindex !== t[0].index && this.slider.api.gotoSlide(t[0].index) }, e.unselect = function (t) { t.removeClass("ms-thumb-frame-selected") }, e.select = function (t) { t.addClass("ms-thumb-frame-selected") }, e.__resize = function () { var t = this.$element[this.__dimen](); if (this.ls !== t) { this.ls = t, this.thumbSize = this.thumbs[0][this.__jdimen](!0); var i = this.slider.api.count() * this.thumbSize; this.$thumbscont[0].style[this.__dimen] = i + "px", i <= t ? (this.dTouch = !0, this.controller.stop(), this.$thumbscont[0].style[this.__pos] = .5 * (t - i) + "px", this.$thumbscont[0].style[window._jcsspfx + "Transform"] = "") : (this.dTouch = !1, this.click_enable = !0, this.$thumbscont[0].style[this.__pos] = "", this.controller._max_value = i - t, this.controller.options.snapsize = this.thumbSize, this.updateThumbscroll()) } }, e.destroy = function () { s.destroy(), this.options.wheel && (t.browser.mozilla ? this.$element[0].removeEventListener("DOMMouseScroll", this.wheellistener) : this.$element.unbind("mousewheel", this.wheellistener), this.wheellistener = null), t(window).unbind("resize", this.resize_listener), this.$element.remove(), this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this), this.slider.api.removeEventListener(MSSliderEvent.CHANGE_START, this.update, this) }, window.MSThumblist = i, MSSlideController.registerControl("thumblist", i) }(jQuery), function (t) { "use strict"; var i = function (i) { BaseControl.call(this), this.options.dir = "h", this.options.inset = !0, this.options.margin = 10, this.options.space = 10, t.extend(this.options, i), this.bullets = [] }; i.extend(BaseControl); var e = i.prototype, s = BaseControl.prototype; e.setup = function () { if (s.setup.call(this), this.$element = t("<div></div>").addClass(this.options.prefix + "bullets").addClass("ms-dir-" + this.options.dir).appendTo(this.cont), this.$bullet_cont = t("<div></div>").addClass("ms-bullets-count").appendTo(this.$element), !this.options.insetTo && this.options.align) { var i = this.options.align; this.options.inset && this.$element.css(i, this.options.margin) } this.checkHideUnder() }, e.create = function () { s.create.call(this); var i = this; this.slider.api.addEventListener(MSSliderEvent.CHANGE_START, this.update, this), this.cindex = this.slider.api.index(); for (var e = 0; e < this.slider.api.count(); ++e) { var n = t("<div></div>").addClass("ms-bullet"); n[0].index = e, n.on("click", function () { i.changeSlide(this.index) }), this.$bullet_cont.append(n), this.bullets.push(n), "h" === this.options.dir ? n.css("margin", this.options.space / 2) : n.css("margin", this.options.space) } "h" === this.options.dir ? this.$element.width(n.outerWidth(!0) * this.slider.api.count()) : this.$element.css("margin-top", -this.$element.outerHeight(!0) / 2), this.select(this.bullets[this.cindex]) }, e.update = function () { var t = this.slider.api.index(); this.cindex !== t && (null != this.cindex && this.unselect(this.bullets[this.cindex]), this.cindex = t, this.select(this.bullets[this.cindex])) }, e.changeSlide = function (t) { this.cindex !== t && this.slider.api.gotoSlide(t) }, e.unselect = function (t) { t.removeClass("ms-bullet-selected") }, e.select = function (t) { t.addClass("ms-bullet-selected") }, e.destroy = function () { s.destroy(), this.slider.api.removeEventListener(MSSliderEvent.CHANGE_START, this.update, this), this.$element.remove() }, window.MSBulltes = i, MSSlideController.registerControl("bullets", i) }(jQuery), function (t) { "use strict"; var i = function (i) { BaseControl.call(this), this.options.dir = "h", this.options.autohide = !0, this.options.width = 4, this.options.color = "#3D3D3D", this.options.margin = 10, t.extend(this.options, i), this.__dimen = "h" === this.options.dir ? "width" : "height", this.__jdimen = "h" === this.options.dir ? "outerWidth" : "outerHeight", this.__pos = "h" === this.options.dir ? "left" : "top", this.__translate_end = window._css3d ? " translateZ(0px)" : "", this.__translate_start = "h" === this.options.dir ? " translateX(" : "translateY(" }; i.extend(BaseControl); var e = i.prototype, s = BaseControl.prototype; e.setup = function () { if (this.$element = t("<div></div>").addClass(this.options.prefix + "sbar").addClass("ms-dir-" + this.options.dir), s.setup.call(this), this.slider.$controlsCont === this.cont ? this.$element.appendTo(this.slider.$element) : this.$element.appendTo(this.cont), this.$bar = t("<div></div>").addClass(this.options.prefix + "bar").appendTo(this.$element), this.slider.options.loop && (console.log("WARNING, MSScrollbar cannot work with looped slider."), this.disable = !0, this.$element.remove()), "v" === this.options.dir ? this.$bar.width(this.options.width) : this.$bar.height(this.options.width), this.$bar.css("background-color", this.options.color), !this.options.insetTo && this.options.align) { "v" === this.options.dir ? this.$element.css({ right: "auto", left: "auto" }) : this.$element.css({ top: "auto", bottom: "auto" }); var i = this.options.align; this.options.inset ? this.$element.css(i, this.options.margin) : "top" === i ? this.$element.prependTo(this.slider.$element).css({ "margin-bottom": this.options.margin, position: "relative" }) : "bottom" === i ? this.$element.css({ "margin-top": this.options.margin, position: "relative" }) : (this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this), this.align()) } this.checkHideUnder() }, e.align = function (t) { if (!this.detached) { var i = this.options.align, e = this.slider.reserveSpace(i, 2 * this.options.margin + this.options.width); this.$element.css(i, -e - this.options.margin - this.options.width) } }, e.create = function () { if (!this.disable) { this.scroller = this.slider.api.scroller, this.slider.api.view.addEventListener(MSViewEvents.SCROLL, this._update, this), this.slider.api.addEventListener(MSSliderEvent.RESIZE, this._resize, this), this._resize(), this.options.autohide && this.$bar.css("opacity", "0") } }, e._resize = function () { this.vdimen = this.$element[this.__dimen](), this.bar_dimen = this.slider.api.view["__" + this.__dimen] * this.vdimen / this.scroller._max_value, this.$bar[this.__dimen](this.bar_dimen) }, e._update = function () { var t = this.scroller.value * (this.vdimen - this.bar_dimen) / this.scroller._max_value; if (this.lvalue !== t) { if (this.lvalue = t, this.options.autohide) { clearTimeout(this.hto), this.$bar.css("opacity", "1"); var i = this; this.hto = setTimeout(function () { i.$bar.css("opacity", "0") }, 150) } t < 0 ? this.$bar[0].style[this.__dimen] = this.bar_dimen + t + "px" : (t > this.vdimen - this.bar_dimen && (this.$bar[0].style[this.__dimen] = this.vdimen - t + "px"), window._cssanim ? this.$bar[0].style[window._jcsspfx + "Transform"] = this.__translate_start + t + "px)" + this.__translate_end : this.$bar[0].style[this.__pos] = t + "px") } }, e.destroy = function () { s.destroy(), this.slider.api.view.removeEventListener(MSViewEvents.SCROLL, this._update, this), this.slider.api.removeEventListener(MSSliderEvent.RESIZE, this._resize, this), this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this), this.$element.remove() }, window.MSScrollbar = i, MSSlideController.registerControl("scrollbar", i) }(jQuery), function (t) { "use strict"; var i = function (i) { BaseControl.call(this), this.options.autohide = !1, this.options.width = 4, this.options.color = "#FFFFFF", this.options.inset = !0, this.options.margin = 0, t.extend(this.options, i) }; i.extend(BaseControl); var e = i.prototype, s = BaseControl.prototype; e.setup = function () { if (s.setup.call(this), this.$element = t("<div></div>").addClass(this.options.prefix + "timerbar"), s.setup.call(this), this.slider.$controlsCont === this.cont ? this.$element.appendTo(this.slider.$element) : this.$element.appendTo(this.cont), this.$bar = t("<div></div>").addClass("ms-time-bar").appendTo(this.$element), "v" === this.options.dir ? (this.$bar.width(this.options.width), this.$element.width(this.options.width)) : (this.$bar.height(this.options.width), this.$element.height(this.options.width)), this.$bar.css("background-color", this.options.color), !this.options.insetTo && this.options.align) { this.$element.css({ top: "auto", bottom: "auto" }); var i = this.options.align; this.options.inset ? this.$element.css(i, this.options.margin) : "top" === i ? this.$element.prependTo(this.slider.$element).css({ "margin-bottom": this.options.margin, position: "relative" }) : "bottom" === i ? this.$element.css({ "margin-top": this.options.margin, position: "relative" }) : (this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this), this.align()) } this.checkHideUnder() }, e.align = function (t) { if (!this.detached) { var i = this.options.align, e = this.slider.reserveSpace(i, 2 * this.options.margin + this.options.width); this.$element.css(i, -e - this.options.margin - this.options.width) } }, e.create = function () { s.create.call(this), this.slider.api.addEventListener(MSSliderEvent.WAITING, this._update, this), this._update() }, e._update = function () { this.$bar[0].style.width = this.slider.api._delayProgress + "%" }, e.destroy = function () { s.destroy(), this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this), this.slider.api.removeEventListener(MSSliderEvent.WAITING, this._update, this), this.$element.remove() }, window.MSTimerbar = i, MSSlideController.registerControl("timebar", i) }(jQuery), function (t) { "use strict"; var i = function (i) { BaseControl.call(this), this.options.color = "#A2A2A2", this.options.stroke = 10, this.options.radius = 4, this.options.autohide = !1, t.extend(this.options, i) }; i.extend(BaseControl); var e = i.prototype, s = BaseControl.prototype; e.setup = function () { if (s.setup.call(this), this.$element = t("<div></div>").addClass(this.options.prefix + "ctimer").appendTo(this.cont), this.$canvas = t("<canvas></canvas>").addClass("ms-ctimer-canvas").appendTo(this.$element), this.$bar = t("<div></div>").addClass("ms-ctimer-bullet").appendTo(this.$element), !this.$canvas[0].getContext) return this.destroy(), void (this.disable = !0); this.ctx = this.$canvas[0].getContext("2d"), this.prog = 0, this.__w = 2 * (this.options.radius + this.options.stroke / 2), this.$canvas[0].width = this.__w, this.$canvas[0].height = this.__w, this.checkHideUnder() }, e.create = function () { if (!this.disable) { s.create.call(this), this.slider.api.addEventListener(MSSliderEvent.WAITING, this._update, this); var t = this; this.$element.click(function () { t.slider.api.paused ? t.slider.api.resume() : t.slider.api.pause() }), this._update() } }, e._update = function () { var i = this; t(this).stop(!0).animate({ prog: .01 * this.slider.api._delayProgress }, { duration: 200, step: function () { i._draw() } }) }, e._draw = function () { this.ctx.clearRect(0, 0, this.__w, this.__w), this.ctx.beginPath(), this.ctx.arc(.5 * this.__w, .5 * this.__w, this.options.radius, 1.5 * Math.PI, 1.5 * Math.PI + 2 * Math.PI * this.prog, !1), this.ctx.strokeStyle = this.options.color, this.ctx.lineWidth = this.options.stroke, this.ctx.stroke() }, e.destroy = function () { s.destroy(), this.disable || (t(this).stop(!0), this.slider.api.removeEventListener(MSSliderEvent.WAITING, this._update, this), this.$element.remove()) }, window.MSCircleTimer = i, MSSlideController.registerControl("circletimer", i) }(jQuery), function (t) { "use strict"; window.MSLightbox = function (i) { BaseControl.call(this, i), this.options.autohide = !1, t.extend(this.options, i), this.data_list = [] }, MSLightbox.fadeDuratation = 400, MSLightbox.extend(BaseControl); var i = MSLightbox.prototype, e = BaseControl.prototype; i.setup = function () { e.setup.call(this), this.$element = t("<div></div>").addClass(this.options.prefix + "lightbox-btn").appendTo(this.cont), this.checkHideUnder() }, i.slideAction = function (i) { t("<div></div>").addClass(this.options.prefix + "lightbox-btn").appendTo(i.$element).append(t(i.$element.find(".ms-lightbox"))) }, i.create = function () { e.create.call(this) }, MSSlideController.registerControl("lightbox", MSLightbox) }(jQuery), function (t) { "use strict"; window.MSSlideInfo = function (i) { BaseControl.call(this, i), this.options.autohide = !1, this.options.align = null, this.options.inset = !1, this.options.margin = 10, this.options.size = 100, this.options.dir = "h", t.extend(this.options, i), this.data_list = [] }, MSSlideInfo.fadeDuratation = 400, MSSlideInfo.extend(BaseControl); var i = MSSlideInfo.prototype, e = BaseControl.prototype; i.setup = function () { if (this.$element = t("<div></div>").addClass(this.options.prefix + "slide-info").addClass("ms-dir-" + this.options.dir), e.setup.call(this), this.slider.$controlsCont === this.cont ? this.$element.appendTo(this.slider.$element) : this.$element.appendTo(this.cont), !this.options.insetTo && this.options.align) { var i = this.options.align; this.options.inset ? this.$element.css(i, this.options.margin) : "top" === i ? this.$element.prependTo(this.slider.$element).css({ "margin-bottom": this.options.margin, position: "relative" }) : "bottom" === i ? this.$element.css({ "margin-top": this.options.margin, position: "relative" }) : (this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this), this.align()), "v" === this.options.dir ? this.$element.width(this.options.size) : this.$element.css("min-height", this.options.size) } this.checkHideUnder() }, i.align = function (t) { if (!this.detached) { var i = this.options.align, e = this.slider.reserveSpace(i, this.options.size + 2 * this.options.margin); this.$element.css(i, -e - this.options.size - this.options.margin) } }, i.slideAction = function (i) { var e = t(i.$element.find(".ms-info")); e.detach(), this.data_list[i.index] = e }, i.create = function () { e.create.call(this), this.slider.api.addEventListener(MSSliderEvent.CHANGE_START, this.update, this), this.cindex = this.slider.api.index(), this.switchEle(this.data_list[this.cindex]) }, i.update = function () { var t = this.slider.api.index(); this.switchEle(this.data_list[t]), this.cindex = t }, i.switchEle = function (t) { if (this.current_ele) { this.current_ele[0].tween && this.current_ele[0].tween.stop(!0), this.current_ele[0].tween = CTween.animate(this.current_ele, MSSlideInfo.fadeDuratation, { opacity: 0 }, { complete: function () { this.detach(), this[0].tween = null, t.css("position", "relative") }, target: this.current_ele }), t.css("position", "absolute") } this.__show(t) }, i.__show = function (t) { t.appendTo(this.$element).css("opacity", "0"), this.current_ele && t.height(Math.max(t.height(), this.current_ele.height())), clearTimeout(this.tou), this.tou = setTimeout(function () { CTween.fadeIn(t, MSSlideInfo.fadeDuratation), t.css("height", "") }, MSSlideInfo.fadeDuratation), t[0].tween && t[0].tween.stop(!0), this.current_ele = t }, i.destroy = function () { e.destroy(), clearTimeout(this.tou), this.current_ele && this.current_ele[0].tween && this.current_ele[0].tween.stop("true"), this.$element.remove(), this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this), this.slider.api.removeEventListener(MSSliderEvent.CHANGE_START, this.update, this) }, MSSlideController.registerControl("slideinfo", MSSlideInfo) }(jQuery), function (t) { window.MSGallery = function (i, e) { this.id = i, this.slider = e, this.telement = t("#" + i), this.botcont = t("<div></div>").addClass("ms-gallery-botcont").appendTo(this.telement), this.thumbcont = t("<div></div>").addClass("ms-gal-thumbcont hide-thumbs").appendTo(this.botcont), this.playbtn = t("<div></div>").addClass("ms-gal-playbtn").appendTo(this.botcont), this.thumbtoggle = t("<div></div>").addClass("ms-gal-thumbtoggle").appendTo(this.botcont), e.control("thumblist", { insertTo: this.thumbcont, autohide: !1, dir: "h" }), e.control("slidenum", { insertTo: this.botcont, autohide: !1 }), e.control("slideinfo", { insertTo: this.botcont, autohide: !1 }), e.control("timebar", { insertTo: this.botcont, autohide: !1 }), e.control("bullets", { insertTo: this.botcont, autohide: !1 }) }; var i = MSGallery.prototype; i._init = function () { var t = this; this.slider.api.paused || this.playbtn.addClass("btn-pause"), this.playbtn.click(function () { t.slider.api.paused ? (t.slider.api.resume(), t.playbtn.addClass("btn-pause")) : (t.slider.api.pause(), t.playbtn.removeClass("btn-pause")) }), this.thumbtoggle.click(function () { t.vthumbs ? (t.thumbtoggle.removeClass("btn-hide"), t.vthumbs = !1, t.thumbcont.addClass("hide-thumbs")) : (t.thumbtoggle.addClass("btn-hide"), t.thumbcont.removeClass("hide-thumbs"), t.vthumbs = !0) }) }, i.setup = function () { var i = this; t(document).ready(function () { i._init() }) } }(jQuery), function (t) { var i = function (t, i, e) { return "https://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=" + t + "&photoset_id=" + i + "&per_page=" + e + "&extras=url_o,description,date_taken,owner_name,views&format=json&jsoncallback=?" }, e = function (t, i, e) { return "https://api.flickr.com/services/rest/?&method=flickr.people.getPublicPhotos&api_key=" + t + "&user_id=" + i + "&per_page=" + e + "&extras=url_o,description,date_taken,owner_name,views&format=json&jsoncallback=?" }, s = function (t, i, e, s, n, o) { return "_o" === n && o ? o.url_o : "https://farm" + t + ".staticflickr.com/" + i + "/" + e + "_" + s + n + ".jpg" }; window.MSFlickrV2 = function (s, n) { var o = { count: 10, type: "photoset", thumbSize: "q", imgSize: "c" }; if (this.slider = s, this.slider.holdOn(), n.key) { t.extend(o, n), this.options = o; var a = this; "photoset" === this.options.type ? t.getJSON(i(this.options.key, this.options.id, this.options.count), function (t) { a._photosData(t) }) : t.getJSON(e(this.options.key, this.options.id, this.options.count), function (t) { a.options.type = "photos", a._photosData(t) }), "" !== this.options.imgSize && "-" !== this.options.imgSize && (this.options.imgSize = "_" + this.options.imgSize), this.options.thumbSize = "_" + this.options.thumbSize, this.slideTemplate = this.slider.$element.find(".ms-slide")[0].outerHTML, this.slider.$element.find(".ms-slide").remove() } else this.errMsg("Flickr API Key required. Please add it in settings.") }; var n = MSFlickrV2.prototype; n._photosData = function (i) { if ("fail" !== i.stat) { var e = this; this.options.author || this.options.desc; t.each(i[this.options.type].photo, function (i, s) { var n = e.slideTemplate.replace(/{{[\w-]+}}/g, function (t) { return t = t.replace(/{{|}}/g, ""), o[t] ? o[t](s, e) : "{{" + t + "}}" }); t(n).appendTo(e.slider.$element) }), e._initSlider() } else this.errMsg("Flickr API ERROR#" + i.code + ": " + i.message) }, n.errMsg = function (i) { this.slider.$element.css("display", "block"), this.errEle || (this.errEle = t('<div style="font-family:Arial; color:red; font-size:12px; position:absolute; top:10px; left:10px"></div>').appendTo(this.slider.$loading)), this.errEle.html(i) }, n._initSlider = function () { this.slider.release() }; var o = { image: function (t, i) { return s(t.farm, t.server, t.id, t.secret, i.options.imgSize, t) }, thumb: function (t, i) { return s(t.farm, t.server, t.id, t.secret, i.options.thumbSize) }, title: function (t, i) { return t.title }, "owner-name": function (t, i) { return t.ownername }, "date-taken": function (t, i) { return t.datetaken }, views: function (t, i) { return t.views }, description: function (t, i) { return t.description._content } } }(jQuery), function (t) { window.MSFacebookGallery = function (i, e) { var s = { count: 10, type: "photostream", thumbSize: "320", imgSize: "orginal", https: !1, token: "" }; this.slider = i, this.slider.holdOn(), t.extend(s, e), this.options = s, this.graph = "https://graph.facebook.com"; var n = this; "photostream" === this.options.type ? t.getJSON(this.graph + "/" + this.options.username + "/photos/uploaded/?fields=source,name,link,images,from&limit=" + this.options.count + "&access_token=" + this.options.token, function (t) { n._photosData(t) }) : t.getJSON(this.graph + "/" + this.options.albumId + "/photos?fields=source,name,link,images,from&limit=" + this.options.count + "&access_token=" + this.options.token, function (t) { n._photosData(t) }), this.slideTemplate = this.slider.$element.find(".ms-slide")[0].outerHTML, this.slider.$element.find(".ms-slide").remove() }; var i = MSFacebookGallery.prototype; i._photosData = function (i) { if (i.error) this.errMsg("Facebook API ERROR#" + i.error.code + "(" + i.error.type + "): " + i.error.message); else { for (var e = this, n = (this.options.author || this.options.desc, 0), o = i.data.length; n !== o; n++) { var a = e.slideTemplate.replace(/{{[\w-]+}}/g, function (t) { return t = t.replace(/{{|}}/g, ""), s[t] ? s[t](i.data[n], e) : "{{" + t + "}}" }); t(a).appendTo(e.slider.$element) } e._initSlider() } }, i.errMsg = function (i) { this.slider.$element.css("display", "block"), this.errEle || (this.errEle = t('<div style="font-family:Arial; color:red; font-size:12px; position:absolute; top:10px; left:10px"></div>').appendTo(this.slider.$loading)), this.errEle.html(i) }, i._initSlider = function () { this.slider.release() }; var e = function (t, i) { if ("orginal" === i) return t[0].source; for (var e = 0, s = t.length; e !== s; e++)if (-1 !== t[e].source.indexOf(i + "x" + i)) return t[e].source; return t[0].source }, s = { image: function (t, i) { return e(t.images, i.options.imgSize) }, thumb: function (t, i) { return e(t.images, i.options.thumbSize) }, name: function (t, i) { return t.name }, "owner-name": function (t, i) { return t.from.name }, link: function (t, i) { return t.link } } }(jQuery), function (t) { "use strict"; window.MSScrollParallax = function (t, i, e, s) { this.fade = s, this.slider = t, this.parallax = i / 100, this.bgparallax = e / 100, t.api.addEventListener(MSSliderEvent.INIT, this.init, this), t.api.addEventListener(MSSliderEvent.DESTROY, this.destory, this), t.api.addEventListener(MSSliderEvent.CHANGE_END, this.resetLayers, this), t.api.addEventListener(MSSliderEvent.CHANGE_START, this.updateCurrentSlide, this) }, window.MSScrollParallax.setup = function (t, i, e, s) { if (!window._mobile) return null == i && (i = 50), null == e && (e = 40), new MSScrollParallax(t, i, e, s) }; var i = window.MSScrollParallax.prototype; i.init = function (i) { this.slider.$element.addClass("ms-scroll-parallax"), this.sliderOffset = this.slider.$element.offset().top, this.updateCurrentSlide(); for (var e, s = this.slider.api.view.slideList, n = 0, o = s.length; n !== o; n++)(e = s[n]).hasLayers && (e.layerController.$layers.wrap('<div class="ms-scroll-parallax-cont"></div>'), e.$scrollParallaxCont = e.layerController.$layers.parent()); t(window).on("scroll", { that: this }, this.moveParallax).trigger("scroll") }, i.resetLayers = function (t) { if (this.lastSlide) { var i = this.lastSlide.$scrollParallaxCont; window._css2d ? (i && (i[0].style[window._jcsspfx + "Transform"] = ""), this.lastSlide.hasBG && (this.lastSlide.$imgcont[0].style[window._jcsspfx + "Transform"] = "")) : (i && (i[0].style.top = ""), this.lastSlide.hasBG && (this.lastSlide.$imgcont[0].style.top = "0px")) } }, i.updateCurrentSlide = function (t) { this.lastSlide = this.currentSlide, this.currentSlide = this.slider.api.currentSlide, this.moveParallax({ data: { that: this } }) }, i.moveParallax = function (i) { var e = i.data.that, s = e.slider, n = e.sliderOffset, o = t(window).scrollTop(), a = e.currentSlide.$scrollParallaxCont, r = n - o; r <= 0 ? (a && (window._css3d ? a[0].style[window._jcsspfx + "Transform"] = "translateY(" + -r * e.parallax + "px) translateZ(0.4px)" : window._css2d ? a[0].style[window._jcsspfx + "Transform"] = "translateY(" + -r * e.parallax + "px)" : a[0].style.top = -r * e.parallax + "px"), e.updateSlidesBG(-r * e.bgparallax + "px", !0), a && e.fade && a.css("opacity", 1 - Math.min(1, -r / s.api.height))) : (a && (window._css2d ? a[0].style[window._jcsspfx + "Transform"] = "" : a[0].style.top = ""), e.updateSlidesBG("0px", !1), a && e.fade && a.css("opacity", 1)) }, i.updateSlidesBG = function (i, e) { for (var s = this.slider.api.view.slideList, n = !e || t.browser.msie || t.browser.opera ? "" : "fixed", o = 0, a = s.length; o !== a; o++)s[o].hasBG && (s[o].$imgcont[0].style.position = n, s[o].$imgcont[0].style.top = i), s[o].$bgvideocont && (s[o].$bgvideocont[0].style.position = n, s[o].$bgvideocont[0].style.top = i) }, i.destory = function () { slider.api.removeEventListener(MSSliderEvent.INIT, this.init, this), slider.api.removeEventListener(MSSliderEvent.DESTROY, this.destory, this), slider.api.removeEventListener(MSSliderEvent.CHANGE_END, this.resetLayers, this), slider.api.removeEventListener(MSSliderEvent.CHANGE_START, this.updateCurrentSlide, this), t(window).off("scroll", this.moveParallax) } }(jQuery), function (t, i, e) { var s = 0; if (e.Multislider) { var n = function (t) { this.slider = t, this.PId = s++ , this.slider.options.keyboard && t.api.addEventListener(MSSliderEvent.INIT, this.init, this) }; n.name = "MSKeyboardNav"; var o = n.prototype; o.init = function () { var e = this.slider.api; t(i).on("keydown.kbnav" + this.PId, function (t) { var i = t.which; 37 === i || 40 === i ? e.previous(!0) : 38 !== i && 39 !== i || e.next(!0) }) }, o.destroy = function () { t(i).off("keydown.kbnav" + this.PId), this.slider.api.removeEventListener(MSSliderEvent.INIT, this.init, this) }, Multislider.registerPlugin(n) } }(jQuery, document, window), function (t, i, e) { var s = 0, n = t(e), o = t(i); if (e.Multislider) { var a = function (i) { this.PId = s++ , this.slider = i, this.$slider = i.$element, this.slider.options.startOnAppear && (i.holdOn(), o.ready(t.proxy(this.init, this))) }; a.name = "MSStartOnAppear"; var r = a.prototype; r.init = function () { this.slider.api; n.on("scroll.soa" + this.PId, t.proxy(this._onScroll, this)).trigger("scroll") }, r._onScroll = function () { var t = n.scrollTop() + n.height(); this.$slider.offset().top < t && (n.off("scroll.soa" + this.PId), this.slider.release()) }, r.destroy = function () { }, Multislider.registerPlugin(a) } }(jQuery, document, window), function (t, i, e) { var s = { "hue-rotate": "deg", blur: "px" }, n = { opacity: 1, contrast: 1, brightness: 1, saturate: 1, "hue-rotate": 0, invert: 0, sepia: 0, blur: 0, grayscale: 0 }; if (i.Multislider) { var o = function (t) { this.slider = t, this.slider.options.filters && t.api.addEventListener(MSSliderEvent.INIT, this.init, this) }; o.name = "MSFilters"; var a = o.prototype; a.init = function () { var t = this.slider.api.view; this.filters = this.slider.options.filters, this.slideList = t.slideList, this.slidesCount = t.slidesCount, this.dimension = t[t.__dimension], this.target = "slide" === this.slider.options.filterTarget ? "$element" : "$bg_img", this.filterName = $.browser.webkit ? "WebkitFilter" : "filter"; var i = t.controller.__renderHook.fun, e = t.controller.__renderHook.ref; t.controller.renderCallback(function (t, s) { i.call(e, t, s), this.applyEffect(s) }, this), this.applyEffect(t.controller.value) }, a.applyEffect = function (t) { for (var i, e, s = 0; s < this.slidesCount; ++s)e = this.slideList[s], i = Math.min(1, Math.abs(t - e.position) / this.dimension), e[this.target] && ($.browser.msie ? null != this.filters.opacity && e[this.target].opacity(1 - this.filters.opacity * i) : e[this.target][0].style[this.filterName] = this.generateStyle(i)) }, a.generateStyle = function (t) { var i = ""; for (var e in this.filters) s[e] || "", i += e + "(" + (n[e] + (this.filters[e] - n[e]) * t) + ") "; return i }, a.destroy = function () { this.slider.api.removeEventListener(MSSliderEvent.INIT, this.init, this) }, Multislider.registerPlugin(o) } }(document, window), function (t, i, e) { if (e.Multislider) { var s = function (t) { this.slider = t, t.api.addEventListener(MSSliderEvent.INIT, this.init, this) }; s.name = "MSScrollToAction"; var n = s.prototype; n.init = function () { var t = this.slider.api; t.scrollToEnd = a, t.scrollTo = o }, n.destroy = function () { }; var o = function (i, e) { this.slider.$element; 0 !== (i = t(i).eq(0)).length && (console.log(i.offset().top, e), null == e && (e = 1.4), t("html, body").animate({ scrollTop: i.offset().top }, 1e3 * e, "easeInOutQuad")) }, a = function (i) { var e = this.slider.$element; null == i && (i = 1.4), t("html, body").animate({ scrollTop: e.offset().top + e.outerHeight(!1) }, 1e3 * i, "easeInOutQuad") }; Multislider.registerPlugin(s) } }(jQuery, document, window), function (t, i, e, s) { "use strict"; if (i.MSReady) for (var n = 0, o = MSReady.length; n !== o; n++)MSReady[n].call(null, t) }(jQuery, window, document) }(eds2_2);
;;;/*!
 * jQuery Cookie Plugin v1.3
 * https://github.com/carhartl/jquery-cookie
 *
 * Copyright 2011, Klaus Hartl
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.opensource.org/licenses/GPL-2.0
 */
(function (document, undefined) {
var eds_cookie = function ($) {

	var pluses = /\+/g;

	function raw(s) {
		return s;
	}

	function decoded(s) {
		return decodeURIComponent(s.replace(pluses, ' '));
	}

	var config = $.cookie = function (key, value, options) {

		// write
		if (value !== undefined) {
			options = $.extend({}, config.defaults, options);

			if (value === null) {
				options.expires = -1;
			}

			if (typeof options.expires === 'number') {
				var days = options.expires, t = options.expires = new Date();
				t.setDate(t.getDate() + days);
			}

			value = config.json ? JSON.stringify(value) : String(value);

			return (document.cookie = [
				encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value),
				options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
				options.path    ? '; path=' + options.path : '',
				options.domain  ? '; domain=' + options.domain : '',
				options.secure  ? '; secure' : ''
			].join(''));
		}

		var decode = config.raw ? raw : decoded;
		var cookies = document.cookie.split('; ');
		for (var i = 0, l = cookies.length; i < l; i++) {
			var parts = cookies[i].split('=');
			if (decode(parts.shift()) === key) {
				var cookie = decode(parts.join('='));
				return config.json ? JSON.parse(cookie) : cookie;
			}
		}

		return null;
	};

	config.defaults = {};

	$.removeCookie = function (key, options) {
		if ($.cookie(key) !== null) {
			$.cookie(key, null, options);
			return true;
		}
		return false;
	};

};

if (typeof jQuery !== 'undefined')
	eds_cookie(jQuery);

if (typeof eds2_2 !== 'undefined')
	eds_cookie(eds2_2);

})(document);

;;;/*! tinyscrollbar - v2.4.2 - 2016-02-09
 * http://www.baijs.com/tinyscrollbar
 *
 * Copyright (c) 2016 Maarten Baijs <wieringen@gmail.com>;
 * Licensed under the MIT license */

!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(eds2_2)}(function(a){"use strict";function b(b,e){function f(){return o.update(),h(),o}function g(){t.css(y,o.thumbPosition),q.css(y,-o.contentPosition),r.css(x,o.trackSize),s.css(x,o.trackSize),t.css(x,o.thumbSize)}function h(){u&&(p[0].ontouchstart=function(a){1===a.touches.length&&(a.stopPropagation(),k(a.touches[0]))}),t.bind("mousedown",function(a){a.stopPropagation(),k(a)}),s.bind("mousedown",function(a){k(a,!0)}),a(window).resize(function(){o.update("relative")}),o.options.wheel&&window.addEventListener?b[0].addEventListener(v,l,!1):o.options.wheel&&(b[0].onmousewheel=l)}function i(){return o.contentPosition>0}function j(){return o.contentPosition<=o.contentSize-o.viewportSize-5}function k(b,d){o.hasContentToSroll&&(a("body").addClass("noSelect"),z=d?t.offset()[y]:w?b.pageX:b.pageY,u&&(document.ontouchmove=function(a){(o.options.touchLock||i()&&j())&&a.preventDefault(),a.touches[0][c+"Touch"]=1,m(a.touches[0])},document.ontouchend=n),a(document).bind("mousemove",m),a(document).bind("mouseup",n),t.bind("mouseup",n),s.bind("mouseup",n),m(b))}function l(c){if(o.hasContentToSroll){var d=c||window.event,e=-(d.deltaY||d.detail||-1/3*d.wheelDelta)/40,f=1===d.deltaMode?o.options.wheelSpeed:1;o.contentPosition-=e*f*o.options.wheelSpeed,o.contentPosition=Math.min(o.contentSize-o.viewportSize,Math.max(0,o.contentPosition)),o.thumbPosition=o.contentPosition/o.trackRatio,b.trigger("move"),t.css(y,o.thumbPosition),q.css(y,-o.contentPosition),(o.options.wheelLock||i()&&j())&&(d=a.event.fix(d),d.preventDefault())}c.stopPropagation()}function m(a){if(o.hasContentToSroll){var d=w?a.pageX:a.pageY,e=a[c+"Touch"]?z-d:d-z,f=Math.min(o.trackSize-o.thumbSize,Math.max(0,o.thumbPosition+e));o.contentPosition=f*o.trackRatio,b.trigger("move"),t.css(y,f),q.css(y,-o.contentPosition)}}function n(){o.thumbPosition=parseInt(t.css(y),10)||0,a("body").removeClass("noSelect"),a(document).unbind("mousemove",m),a(document).unbind("mouseup",n),t.unbind("mouseup",n),s.unbind("mouseup",n),document.ontouchmove=document.ontouchend=null}this.options=a.extend({},d,e),this._defaults=d,this._name=c;var o=this,p=b.find(".viewport"),q=b.find(".overview"),r=b.find(".scrollbar"),s=r.find(".track"),t=r.find(".thumb"),u="ontouchstart"in document.documentElement,v="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",w="x"===this.options.axis,x=w?"width":"height",y=w?"left":"top",z=0;return this.contentPosition=0,this.viewportSize=0,this.contentSize=0,this.contentRatio=0,this.trackSize=0,this.trackRatio=0,this.thumbSize=0,this.thumbPosition=0,this.hasContentToSroll=!1,this.update=function(a){var b=x.charAt(0).toUpperCase()+x.slice(1).toLowerCase();switch(this.viewportSize=p[0]["offset"+b],this.contentSize=q[0]["scroll"+b],this.contentRatio=this.viewportSize/this.contentSize,this.trackSize=this.options.trackSize||this.viewportSize,this.thumbSize=Math.min(this.trackSize,Math.max(this.options.thumbSizeMin,this.options.thumbSize||this.trackSize*this.contentRatio)),this.trackRatio=(this.contentSize-this.viewportSize)/(this.trackSize-this.thumbSize),this.hasContentToSroll=this.contentRatio<1,r.toggleClass("disable",!this.hasContentToSroll),a){case"bottom":this.contentPosition=Math.max(this.contentSize-this.viewportSize,0);break;case"relative":this.contentPosition=Math.min(Math.max(this.contentSize-this.viewportSize,0),Math.max(0,this.contentPosition));break;default:this.contentPosition=parseInt(a,10)||0}return this.thumbPosition=this.contentPosition/this.trackRatio,g(),o},f()}var c="eds_tinyscrollbar",d={axis:"y",wheel:!0,wheelSpeed:40,wheelLock:!0,touchLock:!0,trackSize:!1,thumbSize:!1,thumbSizeMin:20};a.fn[c]=function(d){return this.each(function(){a.data(this,"plugin_"+c)||a.data(this,"plugin_"+c,new b(a(this),d))})}});
;;;/*! fluidvids.js v2.4.1 | (c) 2014 @toddmotto | https://github.com/toddmotto/fluidvids */
!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t:e.edn_fluidvids=t()}(this,function(){"use strict";function e(e){return new RegExp("^(https?:)?//(?:"+d.players.join("|")+").*$","i").test(e)}function t(e,t){return parseInt(e,10)/parseInt(t,10)*100+"%"}function i(i){if((e(i.src)||e(i.data))&&!i.getAttribute("edn_data-fluidvids")){var n=document.createElement("div");i.parentNode.insertBefore(n,i),i.className+=(i.className?" ":"")+"edn_fluidvids-item",i.setAttribute("edn_data-fluidvids","loaded"),n.className+="edn_fluidvids",n.style.paddingTop=t(i.height,i.width),n.appendChild(i)}}function n(){var e=document.createElement("div");e.innerHTML="<p>x</p><style>"+o+"</style>",r.appendChild(e.childNodes[1])}var d={selector:["iframe","object"],players:["www.youtube.com","player.vimeo.com"]},o=[".edn_fluidvids {","width: 100%; max-width: 100%; position: relative;","}",".edn_fluidvids-item {","position: absolute; top: 0px; left: 0px; width: 100%; height: 100%;","}"].join(""),r=document.head||document.getElementsByTagName("head")[0];return d.render=function(){for(var e=document.querySelectorAll(d.selector.join()),t=e.length;t--;)i(e[t])},d.init=function(e){for(var t in e)d[t]=e[t];d.render(),n()},d});
;;;!function(e,i,t){"use strict";var n="chameleonSlider_2_1",a=function(e,i){return-1!==e.indexOf(i,e.length-i.length)};e.fn[n]=function(o){var s=e.extend(!0,{},{content_source:"",container_dimensions:{width:750,height:400,w_as_ratio:!1,h_as_ratio:!1,height_references_width:!1},autoplay:{enable:!0,interval:4e3,pause_on_hover:!0,autostart_video_playback:!1,indicator:{display:!0,position:{vertical:"top",horizontal:"left",h_offset:0,v_offset:0,h_as_ratio:!1,v_as_ratio:!1,v_center_point:!1,h_center_point:!1},dimensions:{height:2,width:750,h_as_ratio:!1,w_as_ratio:!1},orientation:"horizontal",flip_direction:!1}},arrows:{display:!0,auto_hide:!0,hide_speed:250,prev:{position:{vertical:"top",horizontal:"left",h_offset:0,v_offset:183,h_as_ratio:!1,v_as_ratio:!1,v_center_point:!1,h_center_point:!1}},next:{position:{vertical:"top",horizontal:"right",h_offset:0,v_offset:183,h_as_ratio:!1,v_as_ratio:!1,v_center_point:!1,h_center_point:!1}}},autoplay_toggle:{display:!0,auto_hide:!0,hide_speed:250,position:{vertical:"top",horizontal:"left",h_offset:347,v_offset:130,h_as_ratio:!1,v_as_ratio:!1,v_center_point:!1,h_center_point:!1}},scrollable_boxes:{item_info:{display:!0,container:{dimensions:{height:100,width:750,h_as_ratio:!1,w_as_ratio:!1},resize_to_content:!0,show_on_hover:!1,position:{vertical:"top",horizontal:"left",h_offset:0,v_offset:2,h_as_ratio:!1,v_as_ratio:!1,v_center_point:!1,h_center_point:!1}}},gallery_info:{display:!1,container:{dimensions:{height:100,width:750,h_as_ratio:!1,w_as_ratio:!1},resize_to_content:!0,show_on_hover:!1,position:{vertical:"top",horizontal:"left",h_offset:0,v_offset:2,h_as_ratio:!1,v_as_ratio:!1,v_center_point:!1,h_center_point:!1}}}},thumbs:{display:!0,auto_hide:!1,hide_speed:250,width:100,height:46,captions:!0,display_item_types:!1,pagination:{direction:"horizontal",duration:250,easing:"swing"},tooltips:{enabled:!1,title:!0,description:!1,position:{my:"bottom center",at:"top center"},classes:""},container:{transparent:!0,dimensions:{height:20,width:679,h_as_ratio:!1,w_as_ratio:!1},position:{vertical:"bottom",horizontal:"left",h_offset:35,v_offset:0,h_as_ratio:!1,v_as_ratio:!1,v_center_point:!1,h_center_point:!1}}},categories:{display:!1,auto_hide:!1,hide_speed:250,width:100,height:46,pagination:{direction:"horizontal",duration:250,easing:"swing"},container:{dimensions:{height:20,width:679,h_as_ratio:!1,w_as_ratio:!1},position:{vertical:"bottom",horizontal:"left",h_offset:35,v_offset:0,h_as_ratio:!1,v_as_ratio:!1,v_center_point:!1,h_center_point:!1}}},pagination:{display:!0,pages_at_once:7,direction:"horizontal",position:{vertical:"bottom",horizontal:"right",h_offset:35,v_offset:58,h_as_ratio:!1,v_as_ratio:!1,v_center_point:!1,h_center_point:!1}},title_boxes:{current_item:{display:!1,height:35,position:{vertical:"bottom",horizontal:"left",h_offset:0,v_offset:200,h_as_ratio:!1,v_as_ratio:!1,v_center_point:!1,h_center_point:!1}},current_gallery:{display:!1,height:35,position:{vertical:"top",horizontal:"left",h_offset:0,v_offset:0,h_as_ratio:!1,v_as_ratio:!1,v_center_point:!1,h_center_point:!1}}},buttons:{email:{display:!1,position:{vertical:"top",horizontal:"right",h_offset:35,v_offset:58,h_as_ratio:!1,v_as_ratio:!1,v_center_point:!1,h_center_point:!1},email_subject:"Look at this link"},download:{display:!1,position:{vertical:"top",horizontal:"left",h_offset:35,v_offset:58,h_as_ratio:!1,v_as_ratio:!1,v_center_point:!1,h_center_point:!1}},fullscreen:{display:!1,position:{vertical:"top",horizontal:"left",h_offset:35,v_offset:58,h_as_ratio:!1,v_as_ratio:!1,v_center_point:!1,h_center_point:!1}},exit_fullscreen:{display:!1,position:{vertical:"bottom",horizontal:"right",h_offset:35,v_offset:58,h_as_ratio:!1,v_as_ratio:!1,v_center_point:!1,h_center_point:!1}}},social_buttons:{display:!1,direction:"horizontal",load_after_effect:!0,position:{vertical:"bottom",horizontal:"right",h_offset:35,v_offset:58,h_as_ratio:!1,v_as_ratio:!1,v_center_point:!1,h_center_point:!1},buttons:{facebook:{display:!0,html:'<iframe src="//www.facebook.com/plugins/like.php?href={location_href_encoded}&amp;layout=button_count&amp;show_faces=true&amp;action=like&amp;font&amp;colorscheme=light&amp;height=20" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:20px; width: 100px;" allowTransparency="true"></iframe>'},google:{display:!0,html:'<g:plusone size="medium" href="{location_href}" annotation="bubble"></g:plusone><script type="text/javascript">gapi.plusone.go();<\/script>'},twitter:{display:!0,html:'<a href="//twitter.com/share" class="twitter-share-button" data-url="{location_href}" data-count="horizontal">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"><\/script>'}},hideable:!1,container:{width:100,height:100}},main_panel:{display:!0,fill_panel:!1,stretch_small_image:!1,top_left_align:!1,drag_navigation:!1,immediately_preload_all_images:!1,dimensions:{width:750,height:400,h_as_ratio:!1,w_as_ratio:!1},position:{vertical:"top",horizontal:"left",h_offset:0,v_offset:0,h_as_ratio:!1,v_as_ratio:!1,v_center_point:!1,h_center_point:!1},trim:{top:0,bottom:0,left:0,right:0},transition:{duration:800,effects:[]}},lightbox_title:!1,lightbox_description:!1,key_browse:!0,redirect_on_click:!1,redirect_on_click_target:"_self",lightbox_on_click:!1,module_id:0,portal_id:0,article_id:0,filter_values:"",filter_types:"",locale:"",inhouse_player:"flowplayer",flowplayer_src:"",fullscreen_provider:"pp",pretty_photo_options:{},smb_options:{},smbLight_options:{},cycle_current_category:!0,open_at:null,modify_browser_history:!1,videoVolume:1},o),r=i.history.location||i.location;return this.each(function(){var o,l,d,c,_,p,h,g,m,u,f,y,b,v,w,x,j,k,z=e(this),T={trys:0},q=e('<div class="loading_slider_overlay" />'),M=e('<div class="indicator" />'),C=e("<p />"),E={category:{},item:{}},O=0,L={},H=e(),P={interval:"",last_started:0,pause_time:0,start_pause_delta:0,time_remaining:0,pause:!1,user_paused:!1,fade_in:!1,reset:!1,transition_in_progres:!1,video_playing:!1},I={container_dimensions:{},thumbs:{page:{vertical_space:0,horizontal_space:0,width:0,height:0,count:0},container:{},width:0,height:0,per_page:0,per_row:0,row_count:0,window_width:0,window_height:0},categories:{page:{vertical_space:0,horizontal_space:0,width:0,height:0,count:0},container:{},width:0,height:0,per_page:0,per_row:0,row_count:0,window_width:0,window_height:0,render_categories:!0},autoplay:{indicator:{}},title_boxes:{current_item:{},current_gallery:{}},scrollable_boxes:{item_info:{},gallery_info:{}},pagination:{pages_at_once:0,page:{width:0,height:0}},main_panel:{dimensions:{},initialized:!1,disable_clicking:!1,disable_clicking_interval:""},preloaded_images:{},preloading_item:!1,buttons:{email:{},download:{},fullscreen:{},exit_fullscreen:{}},html5:{video:!1},youtube_iframe_api:{called:!1,loaded:!1},youtube_player_object:void 0,mouse_entered:!1,item_details_shown:!1},S=function(e){var i=e.src;if(e.sizes)for(var t=0,n=e.sizes.length;t<n;t++){var a=e.sizes[t];if(a.width<I.main_panel.dimensions.width)break;i=a.src}return i},A=function(e){return"number"==typeof e&&(e=E.category.items[e]),"image"==e.type||("video"==e.type||"audio"==e.type)&&s.lightbox_on_click},Y={init:function(){s.container_dimensions.w_as_ratio||s.container_dimensions.h_as_ratio?(o=z.parent(),I.container_dimensions={width:s.container_dimensions.w_as_ratio?Math.round(o.width()*s.container_dimensions.width):s.container_dimensions.width,height:0},I.container_dimensions.height=s.container_dimensions.h_as_ratio?Math.round((s.container_dimensions.height_references_width?I.container_dimensions.width:o.height())*s.container_dimensions.height):s.container_dimensions.height,e(i).bind("resize.chameleonSlider",function(){clearTimeout(l),l=setTimeout(function(){I.container_dimensions={width:s.container_dimensions.w_as_ratio?Math.round(o.width()*s.container_dimensions.width):s.container_dimensions.width,height:0},I.container_dimensions.height=s.container_dimensions.h_as_ratio?Math.round((s.container_dimensions.height_references_width?I.container_dimensions.width:o.height())*s.container_dimensions.height):s.container_dimensions.height,z.trigger("resize_slider")},200)})):I.container_dimensions={width:s.container_dimensions.width,height:s.container_dimensions.height},z.width(I.container_dimensions.width).height(I.container_dimensions.height).append(q).bind("destroy",function(){clearTimeout(P.interval)}),q.width(I.container_dimensions.width).height(I.container_dimensions.height).append(M).show(0);try{I.html5.video=!!t.createElement("video").canPlayType}catch(e){}s.modify_browser_history&&e(i).on("popstate",function(e){Y.parse_slider_url_hash(r.hash),Y.show_item(E.item.index,!0,void 0,!0)}),Y.get_content_source()},get_content_source:function(){T.trys>3?C.is(":visible")?C.html("Unable to display the items (requesting the items failed)"):M.fadeOut(250,function(){(C=e("<p>Unable to display the items (requesting the items failed)</p>")).appendTo(q).css({display:"block",top:Math.floor((I.container_dimensions.height-C.outerHeight(!0))/2)})}):(T.trys+=1,e.ajax({dataType:"json",type:"get",url:s.content_source,timeout:3e5,data:"mid="+s.module_id+"&portal_id="+s.portal_id+"&locale="+s.locale+"&article_id="+s.article_id+"&html5_player="+(I.html5.video?"1":"0")+(""===s.filter_values?"":"&filter_values="+s.filter_values+"&filter_types="+s.filter_types),success:Y.load,complete:Y.ajax_callback,cache:!1}))},ajax_callback:function(e,i){"success"!==i&&Y.get_content_source()},parse_slider_url_hash:function(i){var t,n=i.substring(1),a=n.indexOf("/"),o=void 0;-1!==(a=(t=n.substring(a+1)).indexOf("/"))&&(-1!==(a=(o=t.substring(a+1)).indexOf("/"))&&(o=o.substring(0,a)),o||(o=void 0),t=t.substring(0,t.indexOf("/"))),(c={ids:t.split("-"),indexes:[]}).indexes=Y.category_indexes_from_ids(e.extend([],c.ids),d),0==c.indexes.length&&(c.indexes=[0],c.ids=[d[0].id]),E.category=Y.get_category(c.indexes),E.category.item_count=E.category.items.length,E.item={id:0,index:Y.item_index_from_id(o)},E.item.id=E.category.items[E.item.index].id},load:function(t){var n,a=r.hash.substring(1),o=a.indexOf("/"),l=-1==o?"":a.substring(0,o);0!=t.content.length?(d=t.content,null!=s.open_at?((c={ids:s.open_at.categories,indexes:[]}).indexes=Y.category_indexes_from_ids(e.extend([],c.ids),d),0==c.indexes.length&&(c.indexes=[0],c.ids=[d[0].id]),E.category=Y.get_category(c.indexes),E.category.item_count=E.category.items.length,E.item={id:0,index:Y.item_index_from_id(s.open_at.item)},E.item.id=E.category.items[E.item.index].id):l=="slider_"+s.module_id||l=="gallery_"+s.module_id?(Y.parse_slider_url_hash("#"+a),"smb"==s.fullscreen_provider&&l=="gallery_"+s.module_id&&E.category.item_count>0&&(n=[],s.smb_options.openAt=0,e.each(E.category.items,function(e,i){i.id===E.item.id&&(s.smb_options.openAt=e),n.push(i.smb_object)}),e("<div />").data("socialMediaBox",n).socialMediaBox(s.smb_options))):(c={ids:[d[0].id],indexes:[0]},E.category=d[0],E.category.item_count=E.category.items.length,E.item={id:void 0,index:Y.item_index_from_id(void 0)}),"YT"in i&&"Player"in i.YT&&(I.youtube_iframe_api.called=!0,I.youtube_iframe_api.loaded=!0),s.buttons.exit_fullscreen.display&&Y.exit_fullscreen.init(),s.autoplay.enable&&Y.autoplay.init(),s.pagination.display&&Y.pagination.init(),s.social_buttons.display&&Y.social_buttons.init(),s.buttons.email.display&&Y.email_button.init(),s.buttons.download.display&&Y.download_button.init(),s.buttons.fullscreen.display&&Y.fullscreen_button.init(),s.autoplay_toggle.display&&Y.autoplay_toggle.init(),s.arrows.display&&Y.arrows.init(),s.categories.display&&Y.categories.init(),s.thumbs.display&&Y.thumbnails.init(),s.title_boxes.current_item.display&&Y.item_title.init(),s.title_boxes.current_gallery.display&&Y.gallery_title.init(),s.scrollable_boxes.item_info.display&&Y.item_info.init(),s.scrollable_boxes.gallery_info.display&&Y.gallery_info.init(),s.main_panel.display?Y.main_panel.init():Y.triggers()):M.fadeOut(250,function(){(C=e("<p>"+(t.user_friendly_msg?t.user_friendly_msg:"There are no items to display.")+"</p>")).appendTo(q).css({display:"block",top:Math.floor((I.container_dimensions.height-C.outerHeight(!0))/2)})})},show_item:function(e,i,t,n){if(i=void 0!==i,(e=parseInt(e,10))!==E.item.index||i){"function"==typeof Y._on_pre_item_change&&(Y._on_pre_item_change(),Y._on_pre_item_change=void 0),P.video_playing=!1,e<0?e=E.category.item_count-1:e>=E.category.item_count&&(e=0),Y.autoplay.reset(),O=E.item.index;var a=E.category.items[e];if(E.item.index=e,E.item.id=a.id,Y.pagination.select(e),Y.thumbnails.select(e),I.item_details_shown=!1,(s.main_panel.immediately_preload_all_images||A(a)&&I.preloaded_images[a.src]&&I.preloaded_images[a.src].loaded)&&(I.item_details_shown=!0,Y.social_buttons.display(e),Y.item_title.select(e),Y.item_info.display(e),Y.download_button.display(e),Y.email_button.display(e)),s.modify_browser_history&&!n){var o,l=r.href.indexOf("#");o=-1==l?r.href:r.href.substring(0,l),o+="#slider_"+s.module_id+"/"+c.ids.join("-")+"/"+E.item.id,history.pushState(null,null,o)}s.main_panel.display?I.preloading_item||(void 0===t?Y.main_panel.display(e):Y.main_panel.display(e,t)):z.trigger("slider_transition_finnished")}},next:function(){var e,i=d.length;if(!s.cycle_current_category&&E.item.index==E.category.item_count-1)return e=c.indexes.pop()+1,0!=c.indexes.length&&(i=Y.get_category(c.indexes).children.length),e<i?c.indexes.push(e):c.indexes.push(0),c.ids=Y.category_ids_from_indexes(c.indexes),E.category=Y.get_category(c.indexes),E.category.item_count=E.category.items.length,E.item={id:E.category.items[0].id,index:0},I.categories.render_categories=!1,void Y.change_category();Y.show_item(E.item.index+1)},prev:function(){var e,i=d.length;if(!s.cycle_current_category&&0==E.item.index)return e=c.indexes.pop()-1,0!=c.indexes.length&&(i=Y.get_category(c.indexes).children.length),e<0?c.indexes.push(i-1):c.indexes.push(e),c.ids=Y.category_ids_from_indexes(c.indexes),E.category=Y.get_category(c.indexes),E.category.item_count=E.category.items.length,E.item={id:E.category.items[E.category.items.length-1].id,index:E.category.items.length-1},I.categories.render_categories=!1,void Y.change_category();Y.show_item(E.item.index-1)},pagination:{init:function(){var i;m=e('<div class="pagination" />'),u=e('<ul class="pages_container" />'),m.append(u),m.css("visibility","hidden"),z.prepend(m),Y.position_element(m,s.pagination.position),i=e("<li><span></span></li>"),u.append(i),I.pagination.page.width=i.outerWidth(!0),I.pagination.page.height=i.outerHeight(!0),m.css("visibility",""),Y.pagination.display_category(),Y.pagination.select(E.item.index),u.delegate("li","click",function(){return Y.show_item(e(this).index()),!1})},display_category:function(){if(s.pagination.display){var i=0,t="";for(m.css("display","none"),u.html(""),I.pagination.pages_at_once=E.category.item_count<s.pagination.pages_at_once?E.category.item_count:s.pagination.pages_at_once,"horizontal"===s.pagination.direction?(m.addClass("horizontal"),m.width(I.pagination.pages_at_once*I.pagination.page.width),m.height(I.pagination.page.height),u.width(E.category.item_count*I.pagination.page.width),u.height(I.pagination.page.height)):(m.addClass("vertical"),m.width(I.pagination.page.width),m.height(I.pagination.pages_at_once*I.pagination.page.height),u.width(I.pagination.page.width),u.height(E.category.item_count*I.pagination.page.height));i<E.category.item_count;i++)t+="<li><span></span></li>";f=e(t),u.append(f),m.css("display","")}},select:function(e){if(s.pagination.display){var i=Math.floor(I.pagination.pages_at_once/2),t=e-i,n={};t<0?t=0:e>=E.category.item_count-i&&(t=E.category.item_count-I.pagination.pages_at_once),n="horizontal"==s.pagination.direction?{left:-t*I.pagination.page.width}:{top:-t*I.pagination.page.height},u.stop().animate(n,250),f.removeClass("current"),f.eq(e).addClass("current")}}},social_buttons:{init:function(){y=e('<div class="social_buttons '+s.social_buttons.direction+'" />'),s.social_buttons.hideable?(b=e('<div class="social_buttons_toggle '+s.social_buttons.direction+'" />'),z.prepend(b),Y.position_element(b,s.social_buttons.position),y.fadeTo(200,0,function(){y.hide()}).data("visible",!1),z.prepend(y),Y.position_element(y,e.extend({},s.social_buttons.position,{h_offset:s.social_buttons.position.h_offset+b.outerWidth(!0)+5})),b.click(function(){y.data("visible")?(y.data("visible",!1).stop().fadeTo(200,0,function(){y.empty().hide()}),b.removeClass("active")):(y.data("visible",!0).stop().fadeTo(200,1),Y.social_buttons.display(E.item.index),b.addClass("active"))})):(z.prepend(y),Y.position_element(y,s.social_buttons.position)),Y.social_buttons.display(E.item.index)},display:function(e){if(s.social_buttons.display&&(!s.social_buttons.hideable||y.data("visible"))){var i,t="",n="";for(i in y.html(""),"string"==typeof E.category.items[e].social_button_url?n=E.category.items[e].social_button_url:(n=-1==r.href.indexOf("#")?r.href:r.href.substring(0,r.href.indexOf("#")),n=Y.set_url_param(Y.set_url_param(n,"edgpid",E.category.items[e].id),"edgmid",s.module_id)+"#slider_"+s.module_id+"/"+c.ids.join("-")+"/"+E.category.items[e].id+"/"),s.social_buttons.buttons)s.social_buttons.buttons[i].display&&(t+='<div class="social_button">',t+=s.social_buttons.buttons[i].html.replace(/{location_href}/g,n).replace(/{location_href_encoded}/g,encodeURIComponent(n)),t+="</div>");P.transition_in_progres&&s.social_buttons.load_after_effect?(z.unbind("slider_transition_finnished.social_buttons"),z.bind("slider_transition_finnished.social_buttons",function(){y.html("").append(t)})):y.append(t)}}},_button:{init:function(i){I.buttons[i.type]=e('<a class="standalone_button'+(i.custom_class?" "+i.custom_class:"")+'" href="#">'+i.text+"</a>"),z.prepend(I.buttons[i.type]),Y.position_element(I.buttons[i.type],s.buttons[i.type].position)},display:function(e){e.target="string"==typeof e.target?e.target:"_self",I.buttons[e.type].attr({href:e.href,target:e.target})}},email_button:{init:function(){Y._button.init({type:"email",custom_class:"email",text:"Email this"}),Y.email_button.display(E.item.index)},display:function(e){var i,t=r.href.indexOf("#");s.buttons.email.display&&(i=-1==t?r.href:r.href.substring(0,t),i+="#slider_"+s.module_id+"/"+c.ids.join("-")+"/"+E.category.items[E.item.index].id,Y._button.display({type:"email",href:"mailto:?subject="+escape(s.buttons.email.email_subject)+"&body="+encodeURIComponent(i)}))}},download_button:{init:function(){Y._button.init({type:"download",custom_class:"download",text:"Download"}),Y.download_button.display(E.item.index)},display:function(e){var i=E.category.items[e].download_url;s.buttons.download.display&&(i=i||"#",Y._button.display({type:"download",href:i,target:"_blank"}),"#"==i?I.buttons.download.stop().fadeTo(200,0):I.buttons.download.stop().fadeTo(200,1))}},fullscreen_button:{init:function(){Y._button.init({type:"fullscreen",custom_class:"fullscreen",text:"Fullscreen"}),I.buttons.fullscreen.click(function(){return e(this)[n+"_fullscreen"](s.fullscreen_options),!1})}},exit_fullscreen:{init:function(){Y._button.init({type:"exit_fullscreen",custom_class:"exit_fullscreen",text:"Exit fullscreen"})}},main_panel:{init:function(){var n,a="mousedown",o="mousemove",r="mouseup";_=e('<div class="main_panel" />'),Y.main_panel.size(),p=e('<div class="items_wrapper" />'),_.append(p),z.prepend(_),(s.redirect_on_click||s.lightbox_on_click)&&(H=e('<a href="#" class="media_link" />'),s.redirect_on_click&&H.attr("target",s.redirect_on_click_target),_.append(H)),_.append('<div class="preloading_item" />'),!s.redirect_on_click&&s.lightbox_on_click&&(h=e('<div class="lightbox_links_container" style="display: none;"></div>'),p.append(h)),z.bind("slider_transition_finnished.main_panel",function(){P.transition_in_progres=!1}),Y.main_panel.display_category(!0),I.preloading_item||(Y.main_panel.display(E.item.index,""),Y.triggers()),s.main_panel.drag_navigation&&((n="ontouchstart"in i)&&(a="touchstart",o="touchmove",r="touchend"),_.delegate("a","click",function(e){I.main_panel.disable_clicking&&e.preventDefault()}).bind(a+".chameleon_"+s.module_id,function(e){n&&(e.originalEvent.touches&&e.originalEvent.touches.length?e=e.originalEvent.touches[0]:e.originalEvent.changedTouches&&e.originalEvent.changedTouches.length&&(e=e.originalEvent.changedTouches[0])),_.data("dragging",{start_position:{left:e.pageX,top:e.pageY}}),e.preventDefault()}),e(t).bind(o+".chameleon_"+s.module_id,function(e){var i,t;if("object"==typeof _.data("dragging")&&(t=_.data("dragging").start_position,I.main_panel.disable_clicking=!0,n&&(e.originalEvent.touches&&e.originalEvent.touches.length?e=e.originalEvent.touches[0]:e.originalEvent.changedTouches&&e.originalEvent.changedTouches.length&&(e=e.originalEvent.changedTouches[0])),!(Math.abs((t.top-e.pageY)/(e.pageX-t.left))>=1))){if(i=t.left-e.pageX,Math.abs(i)<50)return!1;_.data("dragging",!1),i<0?Y.prev():Y.next()}}).bind(r+".chameleon_"+s.module_id,function(e){_.data("dragging",!1),I.main_panel.disable_clicking_interval=setTimeout(function(){I.main_panel.disable_clicking=!1},10)})),I.main_panel.initialized=!0},size:function(){s.main_panel.display&&(I.main_panel.dimensions=Y.get_dimensions(s.main_panel.dimensions),I.main_panel.dimensions.height-=s.main_panel.trim.top+s.main_panel.trim.bottom,I.main_panel.dimensions.width-=s.main_panel.trim.left+s.main_panel.trim.right,Y.position_element(_,s.main_panel.position),_.width(I.main_panel.dimensions.width).height(I.main_panel.dimensions.height))},display_category:function(i){var t,n="",a=0,o=E.category.items[E.item.index],r=[];if(s.main_panel.display){if(A(o))if(I.preloading_item=!0,i)e("<img />").load(function(){I.preloading_item=!1,Y.main_panel.display(E.item.index,""),Y.triggers()}).error(function(){I.preloading_item=!1,Y.triggers()}).attr("src",o.src);else{_.addClass("loading_category");var l=function(){I.preloading_item=!1,Y.main_panel.display(E.item.index,""),_.removeClass("loading_category")};e("<img />").load(l).error(l).attr("src",o.src)}for(;a<E.category.item_count;a++){var d,c,p;if(t=E.category.items[a],s.main_panel.immediately_preload_all_images&&A(t)&&!I.preloaded_images[t.src]&&(I.preloaded_images[t.src]={loading:!0,loaded:!1},e("<img />").load({src:t.src},function(e){I.preloaded_images[e.data.src]={loading:!1,loaded:!0,width:this.width,height:this.height}}).attr("src",t.src)),!s.redirect_on_click&&s.lightbox_on_click)"image"==t.type||"video"==t.type||"audio"==t.type?(d=t.lightbox_url,c=t.download_url?t.download_url:"",p=t.src):(d="",c="",p=""),"pp"==s.fullscreen_provider?d&&(n+='<a href="'+d+'" rel="prettyPhoto_M'+s.module_id+'" edgmid="'+s.module_id+'" edgpid="'+t.id+'" downhref="'+c+(s.lightbox_description&&t.info?'" pptitle="'+t.info.replace('"',"&quot;"):"")+'"><img src="'+p+'" alt="'+(s.lightbox_title&&t.title?t.title:"")+'" /></a>'):"smb"==s.fullscreen_provider?e.isPlainObject(t.smb_object)&&!e.isEmptyObject(t.smb_object)&&r.push(t.smb_object):"smbLight"==s.fullscreen_provider&&e.isPlainObject(t.smbLight_object)&&!e.isEmptyObject(t.smbLight_object)&&r.push(t.smbLight_object)}!s.redirect_on_click&&s.lightbox_on_click&&("pp"==s.fullscreen_provider?(h.html(n),(g=h.find("> a")).prettyPhoto(s.pretty_photo_options)):"smb"==s.fullscreen_provider?h.data("socialMediaBox",r):"smbLight"==s.fullscreen_provider&&h.data("smbLightItems",r))}},display:function(i){var t,n="",a="",o=E.category.items[i];if(s.main_panel.display){P.transition_in_progres=!0,H.unbind("click"),2==arguments.length?a=n=arguments[1]:1==s.main_panel.transition.effects.length?a=n=s.main_panel.transition.effects[0]:s.main_panel.transition.effects.length>1&&(t=Math.floor(Math.random()*s.main_panel.transition.effects.length),a=n=s.main_panel.transition.effects[t]),"image"==o.type?(H.css("display","block"),s.redirect_on_click&&H.attr("href","string"==typeof o.on_click_url&&o.on_click_url?o.on_click_url:"#")):"video"==o.type||"audio"==o.type?(n="",a="",s.redirect_on_click||void 0!==o.html&&""!=o.html?H.css("display","none"):H.css("display","block")):"html"==o.type&&(a="","fade"!=n&&(n="show")),!s.redirect_on_click&&s.lightbox_on_click&&H.attr("href","#").click(function(){var i;return!I.main_panel.disable_clicking&&("pp"==s.fullscreen_provider?g.filter('a[edgpid="'+o.id+'"]').trigger("click"):"smb"==s.fullscreen_provider?(s.smb_options.openAt=0,e.each(h.data("socialMediaBox"),function(e,i){if(i.id===o.id)return s.smb_options.openAt=e,!1}),h.socialMediaBox(s.smb_options)):"smbLight"==s.fullscreen_provider&&(i=h.data("smbLightItems"),s.smbLight_options.openAt=0,e.each(i,function(e,i){if(i.id===o.id)return s.smbLight_options.openAt=e,!1}),new SmbLight_1(i,s.smbLight_options)),!1)}),"object"==typeof a?n=a.type:""==n&&(n="show"),null!=I.youtube_player_object&&(I.youtube_player_object.getIframe().src="",I.youtube_player_object.stopVideo(),I.youtube_player_object=void 0);var r=function(t){if(s.main_panel.immediately_preload_all_images||I.item_details_shown||(Y.social_buttons.display(E.item.index),Y.item_title.select(E.item.index),Y.item_info.display(E.item.index),Y.download_button.display(E.item.index),Y.email_button.display(E.item.index)),Y.main_panel._transitions[n]({item_index:i,effect_settings:a,item_src:t||o.src}),s.main_panel.fill_panel&&A(o)&&Y.main_panel._fit_image(p.find("> .item_container").filter(":last").find("> img")),!s.main_panel.immediately_preload_all_images){var l=E.category.items[E.item.index+1];if(l&&A(l)){var d=S(l);if(!I.preloaded_images[d]){I.preloaded_images[d]={loading:!0,loaded:!1};var c=E.category.id,_=E.item.index+1;e("<img />").load(function(e){I.preloaded_images[d]={loading:!1,loaded:!0,width:this.width,height:this.height},c==E.category.id&&_==E.item.index&&(r(d),Y.main_panel.remove_loading_effect("loading_item"))}).attr("src",d)}}}};if(A(o))if(s.main_panel.immediately_preload_all_images)r();else{var l=S(o);if(I.preloaded_images[l])I.preloaded_images[l].loaded&&(r(l),Y.main_panel.remove_loading_effect("loading_item"));else{Y.main_panel.show_loading_effect("loading_item"),I.preloaded_images[l]={loading:!0,loaded:!1};var d=E.category.id,c=E.item.index;e("<img />").load(function(e){I.preloaded_images[l]={loading:!1,loaded:!0,width:this.width,height:this.height},d==E.category.id&&c==E.item.index&&(r(l),Y.main_panel.remove_loading_effect("loading_item"))}).attr("src",l)}}else r()}},show_loading_effect:function(e){clearTimeout(_.data("loading_effect_timeout")),_.addClass(e+" loading_effect show_preload")},remove_loading_effect:function(e){_.removeClass("show_preload"),_.data("loading_effect_timeout",setTimeout(function(){_.removeClass(e+" loading_effect")},400))},_fit_image:function(i){var t=i.attr("src"),n=I.preloaded_images[t],a=function(e,i){var t,n,a,o=I.main_panel.dimensions.width,r=I.main_panel.dimensions.height;i.width==o&&i.height==r||(e.css({position:"relative"}),i.width>o||i.height>r||s.main_panel.stretch_small_image?(e.css({width:"100%",height:"auto"}),t=o/i.width,(n=Math.floor(i.height*t))<r?(t=r/i.height,a=Math.floor(i.width*t),e.css({height:"100%",width:"auto"}),s.main_panel.top_left_align||e.css({left:-Math.floor((a-o)/2)})):n>r&&!s.main_panel.top_left_align&&e.css({top:-Math.floor((n-r)/2)})):s.main_panel.top_left_align||(i.width<o&&e.css({left:Math.floor((o-i.width)/2)}),i.height<r&&e.css({top:Math.floor((r-i.height)/2)})))};n&&n.loaded?a(i,n):e("<img />").load({src:t,$img:i},function(e){I.preloaded_images[e.data.src]={loading:!1,loaded:!0,width:this.width,height:this.height},a(e.data.$img,I.preloaded_images[e.data.src])}).attr("src",t)},_transitions:{show:function(i){var t,n,a,o,r='<div class="item_container new_item">',l=E.category.items[i.item_index],d=p.find("> .item_container").eq(0),_=void 0===l.html||""==l.html?"":l.html,h="",g=!1;"html"!=l.type&&"video"!=l.type&&"audio"!=l.type||!_?r+='<img alt="'+("object"==typeof l.thumb&&l.thumb.caption?l.thumb.caption:"")+'" src="'+i.item_src+'" />':(""==(n=void 0===l.video_src||""==l.video_src?"":l.video_src)?s.autoplay.enable&&(h=Y._video.get_provider(_),a=Y._video.get_video_id(h,_)):(h=s.inhouse_player,a=n),""===h?r+=_:(g=!0,r+='<div id="'+(o="chameleon_video_container_"+s.module_id+"_"+c.indexes.join("-")+"_"+E.item.index+"_"+Math.round(1e5*Math.random()))+'"></div>')),t=e(r+="</div>"),p.find("> .item_container.new_item").removeClass("new_item"),t.css({width:I.main_panel.dimensions.width,height:I.main_panel.dimensions.height}).appendTo(p),g&&Y._video.player_setup({container:o,provider:h,id:a,dimensions:I.main_panel.dimensions}),d.hasClass("new_item")||d.remove(),g||z.trigger("slider_transition_finnished")},fade:function(i){var t,n=E.category.items[i.item_index],a="object"==typeof n.thumb&&n.thumb.caption?n.thumb.caption:"",o=void 0===n.html||""==n.html?"":n.html;"image"==n.type?t=e('<div class="item_container new_item"><img alt="'+a+'" src="'+i.item_src+'" /></div>'):o&&(t=e('<div class="item_container new_item">'+o+"</div>")),p.find("> .item_container.new_item").removeClass("new_item"),t.css({width:I.main_panel.dimensions.width,height:I.main_panel.dimensions.height,display:"none"}).appendTo(p).fadeIn(s.main_panel.transition.duration,function(){var e=p.find("> .item_container").eq(0);e.hasClass("new_item")||e.remove(),z.trigger("slider_transition_finnished")})},slide:function(i){var t=E.category.items[i.item_index],n="object"==typeof t.thumb&&t.thumb.caption?t.thumb.caption:"",a=e('<div class="item_container new_item"><img alt="'+n+'" src="'+i.item_src+'" /></div>'),o=p.find("> .item_container").filter(":last"),r="left",l=function(){var e=p.find("> .item_container").eq(0);e.hasClass("new_item")||e.remove(),z.trigger("slider_transition_finnished")};switch(i.effect_settings.force_horizontal?r=O<i.item_index?"left":"right":i.effect_settings.force_vertical?r=O<i.item_index?"up":"down":1==i.effect_settings.directions.length?r=i.effect_settings.directions[0]:i.effect_settings.directions.length>1&&(r=i.effect_settings.directions[Math.floor(Math.random()*i.effect_settings.directions.length)]),p.find("> .item_container.new_item").removeClass("new_item"),a.css({width:I.main_panel.dimensions.width,height:I.main_panel.dimensions.height}),r){case"down":a.css("top",-I.main_panel.dimensions.height).appendTo(p).animate({top:0},s.main_panel.transition.duration,"swing",l),o.animate({top:I.main_panel.dimensions.height},s.main_panel.transition.duration,"swing");break;case"up":a.css("top",I.main_panel.dimensions.height).appendTo(p).animate({top:0},s.main_panel.transition.duration,"swing",l),o.animate({top:-I.main_panel.dimensions.height},s.main_panel.transition.duration,"swing");break;case"right":a.css("left",-I.main_panel.dimensions.width).appendTo(p).animate({left:0},s.main_panel.transition.duration,"swing",l),o.animate({left:I.main_panel.dimensions.width},s.main_panel.transition.duration,"swing");break;default:a.css("left",I.main_panel.dimensions.width).appendTo(p).animate({left:0},s.main_panel.transition.duration,"swing",l),o.animate({left:-I.main_panel.dimensions.width},s.main_panel.transition.duration,"swing")}},stripes:function(i){var t,n,a,o=0,r=0,l=0,d=0,c=0,_=0,h=0,g=0,m=0,u=0,f=i.item_src,y=e.extend(!0,{orientation:"vertical",num_of_stripes:12,direction:0,start_at:0,randomize:{orientation:!1,direction:!1,start_at:!1}},i.effect_settings),b=Math.floor(s.main_panel.transition.duration/y.num_of_stripes),v=e('<div class="item_container new_item"></div>'),w=function(){var e=p.find("> .item_container").eq(0);e.hasClass("new_item")||e.remove(),z.trigger("slider_transition_finnished")},x=function(i,t){var n=o,a=r,p=function(){var e;e="horizontal"==y.orientation?{left:0,opacity:1}:{top:0,opacity:1},i.animate(e,{duration:s.main_panel.transition.duration,easing:"swing",complete:function(){0==y.start_at||2==y.start_at?t+1==y.num_of_stripes&&w():1==y.start_at?0==t&&w():t==Math.floor(y.num_of_stripes/2)&&w()}})};if("horizontal"==y.orientation?(c=t*r,_=0===y.direction?-o:1===y.direction?o:t%2==0?-o:o,h=m-c,g=u):(_=t*o,c=0===y.direction?-r:1===y.direction?r:t%2==0?-r:r,h=m,g=u-_),t+1==y.num_of_stripes&&(n=l,a=d),(i=e('<div class="fancy_effect_element" />')).css({width:n,height:a,top:c,left:_,opacity:0,background:"url('"+f+"') no-repeat "+g+"px "+h+"px "+z.css("background-color")}).appendTo(v),0===y.start_at)setTimeout(p,t*b+1);else if(1==y.start_at)setTimeout(p,(y.num_of_stripes-1-t)*b+1);else if(2==y.start_at||3==y.start_at){var x,j=0;y.num_of_stripes%2==0?(x=y.num_of_stripes/2,t<x?j=3==y.start_at?t:Math.abs(t-x+1):(j=t-x,3==y.start_at&&(j=x-1-j))):(x=Math.floor(y.num_of_stripes/2),j=t<x?x-t:t-x,3==y.start_at&&(j=x-j)),setTimeout(p,j*b+1)}};y.randomize.orientation&&(0==Math.floor(2*Math.random())?y.orientation="horizontal":y.orientation="vertical"),y.randomize.direction&&(y.direction=Math.floor(3*Math.random())),y.randomize.start_at&&(y.start_at=Math.floor(4*Math.random())),p.find("> .item_container.new_item").removeClass("new_item"),v.css({width:I.main_panel.dimensions.width,height:I.main_panel.dimensions.height}).appendTo(p),"horizontal"==y.orientation?(l=o=I.main_panel.dimensions.width,r=Math.ceil(I.main_panel.dimensions.height/y.num_of_stripes),d=0==(d=r*y.num_of_stripes-I.main_panel.dimensions.height)?r:r-d):(d=r=I.main_panel.dimensions.height,o=Math.ceil(I.main_panel.dimensions.width/y.num_of_stripes),l=0==(l=o*y.num_of_stripes-I.main_panel.dimensions.width)?o:o-l),t=I.preloaded_images[f],n=I.main_panel.dimensions.width,a=I.main_panel.dimensions.height,t.width==n&&t.height==a||(t.width<n?u=Math.floor((n-t.width)/2):t.width>n&&(u=-Math.floor((t.width-n)/2)),t.height<a?m=Math.floor((a-t.height)/2):t.height>a&&(m=-Math.floor((t.height-a)/2)));for(var j=0;j<y.num_of_stripes;j++)x(void 0,j)}}},_on_pre_item_change:void 0,_video:{get_provider:function(e){if("<iframe"==e.substring(0,7)){if(-1!==e.indexOf("youtube.com/embed/",7))return"youtube";if(-1!==e.indexOf("player.vimeo.com/video/",7))return"vimeo"}return""},get_video_id:function(i,t){var n,a;switch(i){case"youtube":case"vimeo":return-1!==(a=(n=e("<div>"+t+"</div>").find("iframe:first").attr("src")).indexOf("?"))&&(n=n.substring(0,a)),"/"==n[n.length-1]&&(n=n.substring(0,n.length-1)),n.substring(n.lastIndexOf("/")+1);default:return""}},player_setup:function(i){var t=e("#"+i.container);switch(t.css(i.dimensions),i.container=t,i.provider){case"youtube":Y._video._youtube_player(i);break;case"vimeo":Y._video._vimeo_player(i);break;case"flowplayer":Y._video._flow_player(i)}},_youtube_player:function(e){var n,a,o,l=e.container.attr("id")+"_object",d='<iframe id="'+l+'" type="text/html" width="'+e.dimensions.width+'" height="'+e.dimensions.height+'" src="//www.youtube.com/embed/'+e.id+"?enablejsapi=1&amp;wmode=transparent&amp;origin="+r.protocol+"//"+r.host+'" frameborder="0"></iframe>',c=function(){o=new YT.Player(l,{events:{onReady:function(){I.youtube_player_object=o,z.trigger("slider_transition_finnished"),s.autoplay.autostart_video_playback&&o.playVideo()},onStateChange:function(e){switch(e.data){case YT.PlayerState.PLAYING:P.video_playing=!0,Y.autoplay.reset();break;case YT.PlayerState.ENDED:setTimeout(Y.next,1e3)}}}})};e.container.append(d),I.youtube_iframe_api.called||(I.youtube_iframe_api.called=!0,(n=t.createElement("script")).src="//www.youtube.com/iframe_api",(a=t.getElementsByTagName("script")[0]).parentNode.insertBefore(n,a)),I.youtube_iframe_api.loaded?c():i.onYouTubeIframeAPIReady=function(){I.youtube_iframe_api.loaded=!0,c()}},_vimeo_player:function(t){var n=!1,a=function(e,i){var t={method:e};i&&(t.value=i),r[0].contentWindow.postMessage(JSON.stringify(t),"https://player.vimeo.com")},o=function(e){switch(JSON.parse(e.data).event){case"ready":z.trigger("slider_transition_finnished"),a("addEventListener","finish"),a("addEventListener","play"),s.autoplay.autostart_video_playback&&a("play");break;case"play":if(n)break;P.video_playing=n=!0,Y.autoplay.reset();break;case"finish":setTimeout(Y.next,1e3)}},r=e('<iframe src="//player.vimeo.com/video/'+t.id+'?api=1" width="'+t.dimensions.width+'" height="'+t.dimensions.height+'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>');Y._on_pre_item_change=function(){i.addEventListener?i.removeEventListener("message",o,!1):i.detachEvent("onmessage",o)},i.addEventListener?i.addEventListener("message",o,!1):i.attachEvent("onmessage",o),t.container.append(r)},_flow_player:function(e){var i=!1,t="";a(e.id,".mp4")?t="video/mp4":a(e.id,".webm")?t="video/webm":a(e.id,".ogg")?t="video/ogg":a(e.id,".flv")&&(t="video/flash"),flowplayer(e.container[0],{swf:s.flowplayer_src,volume:s.videoVolume,clip:{sources:[{type:t,src:e.id}]}}).on("ready",function(){z.trigger("slider_transition_finnished"),s.autoplay.autostart_video_playback&&flowplayer(e.container).play()}).on("resume",function(){s.autoplay.enable&&!i&&(i=!0,P.video_playing=!0,Y.autoplay.reset())}).on("finish",function(){s.autoplay.enable&&setTimeout(Y.next,1e3)})}},key_browse:function(){e(t).keyup(function(e){return 37===e.keyCode&&Y.prev(),39===e.keyCode&&Y.next(),!1})},_scrollable_boxes:{init:function(i){var t,n=s.scrollable_boxes[i.box];(t=I.scrollable_boxes[i.box]={jq:{container:e('<div class="scrollable_box'+(i.custom_class?" "+i.custom_class:"")+'" />').data("disabled",!1),viewport:e('<div class="viewport" />'),content:e('<div class="overview" />'),scrollbar:e()}}).jq.container.append(t.jq.viewport),t.jq.viewport.append(t.jq.content),z.prepend(t.jq.container),Y._scrollable_boxes.size(i.box),n.container.resize_to_content||t.jq.container.height(t.dimensions.height),Y._scrollable_boxes.display(i),n.container.show_on_hover&&z.hover(function(){I.mouse_entered=!0,0==t.jq.container.data("disabled")&&t.jq.container.stop(!0).fadeTo(200,1,function(){t.jq.container.css("display","block")})},function(){I.mouse_entered=!1,0==t.jq.container.data("disabled")&&t.jq.container.stop(!0).fadeTo(200,0,function(){t.jq.container.css("display","none")})})},size:function(i){var t=I.scrollable_boxes[i],n=s.scrollable_boxes[i];n.display&&(t.jq.scrollbar.remove(),t.jq.scrollbar=e('<div class="scrollbar"><div class="track"><div class="thumb"><div class="end"></div></div></div></div>'),t.dimensions=Y.get_dimensions(n.container.dimensions),Y.position_element(t.jq.container,n.container.position),t.dimensions.height>I.container_dimensions.height&&(t.dimensions.height=I.container_dimensions.height),t.dimensions.width>I.container_dimensions.width&&(t.dimensions.width=I.container_dimensions.width),t.jq.container.width(t.dimensions.width).css({maxHeight:t.dimensions.height}).append(t.jq.scrollbar).eds_tinyscrollbar({size:t.dimensions.height-(t.jq.scrollbar.outerHeight(!0)-t.jq.scrollbar.height())}).hide(0),t.jq.viewport.css({maxHeight:t.dimensions.height-t.jq.viewport.outerHeight(!0)}),n.container.resize_to_content||t.jq.container.height(t.dimensions.height))},display:function(e){var i=I.scrollable_boxes[e.box],t=s.scrollable_boxes[e.box],n=function(){var e=function(){i.jq.viewport.stop(!0).fadeTo(200,1,function(){i.jq.scrollbar.css("display","block")}),i.jq.scrollbar.hasClass("disable")||i.jq.scrollbar.stop(!0).fadeTo(200,1,function(){i.jq.scrollbar.css("display","block")})};i.jq.viewport.css({visibility:"",display:"none"}),t.container.show_on_hover?I.mouse_entered?e():(i.jq.viewport.css({display:"block"}),i.jq.scrollbar.hasClass("disable")||i.jq.scrollbar.css({display:"block"})):e()};t.display&&("string"==typeof e.content&&e.content?(i.jq.container.data("disabled",!1),i.jq.container.is(":visible")?(i.jq.container.css({height:i.jq.container.height()}),i.jq.scrollbar.stop(!0).fadeTo(200,0,function(){i.jq.scrollbar.css("display","none")}),i.jq.viewport.stop(!0).fadeTo(200,0,function(){i.jq.content.html(e.content),i.jq.viewport.css({visibility:"hidden",display:"block"}).removeClass("scrollable"),i.jq.container.data("plugin_eds_tinyscrollbar").update(),i.jq.scrollbar.hasClass("disable")||(i.jq.viewport.addClass("scrollable"),i.jq.container.data("plugin_eds_tinyscrollbar").update()),!t.container.resize_to_content||t.container.show_on_hover&&!I.mouse_entered?(i.jq.container.height(i.dimensions.height),n()):i.jq.container.animate({height:i.jq.viewport.outerHeight(!0)},200,n)})):(i.jq.container.css({visibility:"hidden",display:"block"}),i.jq.viewport.removeClass("scrollable"),i.jq.content.html(e.content),i.jq.container.data("plugin_eds_tinyscrollbar").update(),i.jq.scrollbar.hasClass("disable")?i.jq.scrollbar.css({display:"none"}):(i.jq.viewport.addClass("scrollable"),i.jq.scrollbar.css({display:"block",opacity:1}),i.jq.container.data("plugin_eds_tinyscrollbar").update()),i.jq.container.css({visibility:"",display:"none",height:t.container.resize_to_content?i.jq.viewport.outerHeight(!0):i.dimensions.height}),t.container.show_on_hover&&!I.mouse_entered||i.jq.container.stop(!0).fadeTo(200,1,function(){i.jq.container.css("display","block")}))):i.jq.container.data("disabled",!0).stop(!0).fadeTo(200,0,function(){i.jq.container.css("display","none")}))}},item_info:{init:function(){Y._scrollable_boxes.init({box:"item_info",custom_class:"item_info",content:E.category.items[E.item.index].info})},display:function(e){Y._scrollable_boxes.display({box:"item_info",content:E.category.items[e].info})}},gallery_info:{init:function(){Y._scrollable_boxes.init({box:"gallery_info",custom_class:"gallery_info",content:E.category.info})},display:function(){Y._scrollable_boxes.display({box:"gallery_info",content:E.category.info})}},autoplay_toggle:{init:function(){x=e('<a href="#" class="autoplay_toggle">Play/Pause</a>'),s.autoplay.enable?x.addClass("pause"):P.user_paused=!0,x.prependTo(z).click(function(){return P.user_paused?(P.user_paused=!1,x.addClass("pause"),s.autoplay.enable||(P.fade_in=!0,s.autoplay.enable=!0,Y.autoplay.init()),s.autoplay.pause_on_hover||Y.autoplay.start()):(x.removeClass("pause"),P.user_paused=!0,P.pause||Y.autoplay.pause()),!1}),Y.position_element(x,s.autoplay_toggle.position),E.category.item_count<2&&x.css("display","none"),s.autoplay_toggle.auto_hide&&(x.css("display","none"),z.hover(function(){E.category.item_count<2||x.stop().fadeTo(s.autoplay_toggle.hide_speed,1)},function(){x.stop().fadeTo(s.autoplay_toggle.hide_speed,0)}))},display_category:function(){var e="";s.autoplay_toggle.display&&(E.category.item_count<2&&(e="none"),x.css("display",e))}},autoplay:{init:function(){s.autoplay.indicator.display&&(v=e('<div class="indicator" />'),w=e('<div class="autoplay_container" />'),Y.autoplay.size(),"vertical"!=s.autoplay.indicator.orientation||s.autoplay.indicator.flip_direction?s.autoplay.indicator.flip_direction&&v.css({left:"auto",right:0}):v.css({top:"auto",bottom:0}),w.append(v).css("display","none"),P.fade_in?(z.append(w),w.fadeIn(300)):(z.prepend(w),w.css("display",""))),z.bind("slider_transition_finnished",function(){P.user_paused||P.pause||Y.autoplay.start()})},size:function(){s.autoplay.enable&&s.autoplay.indicator.display&&(I.autoplay.indicator=Y.get_dimensions(s.autoplay.indicator.dimensions),Y.position_element(w,s.autoplay.indicator.position),"vertical"==s.autoplay.indicator.orientation?v.width(I.autoplay.indicator.width):v.height(I.autoplay.indicator.height),w.css(I.autoplay.indicator))},start:function(){var e=s.autoplay.interval,i=!0;E.category.item_count<2?s.autoplay.indicator.display&&w.css("display","none"):s.autoplay.enable&&""==P.interval&&(P.last_started=(new Date).getTime(),P.reset=!1,0!=P.time_remaining&&(i=!1,e=P.time_remaining),s.autoplay.indicator.display&&(w.css("display",""),v.stop(),"vertical"==s.autoplay.indicator.orientation?(i&&v.height(0),v.animate({height:I.autoplay.indicator.height},e,"linear")):(i&&v.width(0),v.animate({width:I.autoplay.indicator.width},e,"linear"))),P.interval=setTimeout(Y.next,e))},pause:function(){s.autoplay.enable&&!P.reset&&(P.pause_time=(new Date).getTime(),P.start_pause_delta=P.pause_time-P.last_started,s.autoplay.indicator.display&&v.stop(),P.time_remaining=(0==P.time_remaining?s.autoplay.interval:P.time_remaining)-P.start_pause_delta,clearTimeout(P.interval),P.interval="")},reset:function(){s.autoplay.enable&&(clearTimeout(P.interval),P.interval="",P.time_remaining=0,P.reset=!0,s.autoplay.indicator.display&&(v.stop(),"vertical"==s.autoplay.indicator.orientation?v.height(0):v.width(0)))},display_category:function(){s.autoplay.enable&&s.autoplay.indicator.display&&(E.category.item_count<2?w.css("display","none"):w.css("display",""))}},_items_panel:{init:function(e){e.page.append(e.item).appendTo(L[e.panel].container),I[e.panel].width=e.item.outerWidth(!0),I[e.panel].height=e.item.outerHeight(!0),I[e.panel].page.horizontal_space=e.page.outerWidth(!0)-e.page.width(),I[e.panel].page.vertical_space=e.page.outerHeight(!0)-e.page.height(),e.page.remove(),s[e.panel].container.transparent||L[e.panel].wrapper.addClass("not_transparent")},calculate_pages:function(e){var i;I[e.panel].container=Y.get_dimensions(s[e.panel].container.dimensions),I[e.panel].page.width=I[e.panel].width+I[e.panel].page.horizontal_space,I[e.panel].page.width>I[e.panel].container.width?I[e.panel].container.width=I[e.panel].page.width:I[e.panel].page.width=I[e.panel].container.width-I[e.panel].page.horizontal_space,I[e.panel].page.height=I[e.panel].height+I[e.panel].page.vertical_space,I[e.panel].page.height>I[e.panel].container.height?I[e.panel].container.height=I[e.panel].page.height:I[e.panel].page.height=I[e.panel].container.height-I[e.panel].page.vertical_space,I[e.panel].per_row=Math.floor(I[e.panel].page.width/I[e.panel].width),I[e.panel].page.width=I[e.panel].per_row*I[e.panel].width,I[e.panel].row_count=Math.floor(I[e.panel].page.height/I[e.panel].height),I[e.panel].page.height=I[e.panel].row_count*I[e.panel].height,I[e.panel].per_page=I[e.panel].per_row*I[e.panel].row_count,I[e.panel].page.count=Math.ceil(e.item_count/I[e.panel].per_page),I[e.panel].page.count>1?(L[e.panel].pagination?(L[e.panel].pagination.next.css("display","block"),L[e.panel].pagination.prev.css("display","block")):(L[e.panel].wrapper.append('<a href="#" class="navigation '+s[e.panel].pagination.direction+' prev">Previous</a><a href="#" class="navigation '+s[e.panel].pagination.direction+' next">Next</a>'),L[e.panel].pagination={prev:L[e.panel].wrapper.find("> a.navigation.prev"),next:L[e.panel].wrapper.find("> a.navigation.next")},L[e.panel].pagination.next.click(function(){var i=L[e.panel].pages.filter(".current").index();return Y._items_panel.move_to_page(e.panel,i+1),!1}),L[e.panel].pagination.prev.click(function(){var i=L[e.panel].pages.filter(".current").index();return Y._items_panel.move_to_page(e.panel,i-1),!1})),"vertical"==s[e.panel].pagination.direction?((i=I[e.panel].height+I[e.panel].page.vertical_space+2*L[e.panel].pagination.prev.outerHeight(!0))>I[e.panel].container.height&&(I[e.panel].container.height=i),L[e.panel].pagination.next.css({top:I[e.panel].container.height-L[e.panel].pagination.next.height()}),I[e.panel].row_count=Math.floor((I[e.panel].container.height-2*L[e.panel].pagination.prev.outerHeight(!0)-I[e.panel].page.vertical_space)/I[e.panel].height),I[e.panel].page.height=I[e.panel].row_count*I[e.panel].height):((i=I[e.panel].width+I[e.panel].page.horizontal_space+2*L[e.panel].pagination.prev.outerWidth(!0))>I[e.panel].container.width&&(I[e.panel].container.width=i),I[e.panel].per_row=Math.floor((I[e.panel].container.width-2*L[e.panel].pagination.prev.outerWidth(!0)-I[e.panel].page.horizontal_space)/I[e.panel].width),I[e.panel].page.width=I[e.panel].per_row*I[e.panel].width),I[e.panel].per_page=I[e.panel].per_row*I[e.panel].row_count,I[e.panel].page.count=Math.ceil(e.item_count/I[e.panel].per_page)):L[e.panel].pagination&&(L[e.panel].pagination.next.css("display","none"),L[e.panel].pagination.prev.css("display","none")),L[e.panel].wrapper.css(I[e.panel].container),I[e.panel].window_width=I[e.panel].page.width+I[e.panel].page.horizontal_space,I[e.panel].window_height=I[e.panel].page.height+I[e.panel].page.vertical_space,L[e.panel].window.width(I[e.panel].window_width).height(I[e.panel].window_height).css({top:Math.floor((I[e.panel].container.height-I[e.panel].window_height)/2)}),"vertical"==s[e.panel].pagination.direction?L[e.panel].container.width(I[e.panel].window_width).height(0):L[e.panel].container.width(0).height(I[e.panel].window_height),Y.position_element(L[e.panel].wrapper,s[e.panel].container.position)},move_to_page:function(e,i){var t,n=L[e].pages.length-1;if(!(n<0||L[e].pages.eq(i).hasClass("current"))){if(i>n)return t="vertical"==s[e].pagination.direction?{top:n*-(I[e].page.height+I[e].page.vertical_space)-10}:{left:n*-(I[e].page.width+I[e].page.horizontal_space)-10},void L[e].container.animate(t,40,"swing",function(){t="vertical"==s[e].pagination.direction?{top:n*-(I[e].page.height+I[e].page.vertical_space)}:{left:n*-(I[e].page.width+I[e].page.horizontal_space)},L[e].container.animate(t,50,"swing")});if(i<0)return t="vertical"==s[e].pagination.direction?{top:10}:{left:10},void L[e].container.animate(t,40,"swing",function(){t="vertical"==s[e].pagination.direction?{top:0}:{left:0},L[e].container.animate(t,50,"swing")});L[e].pages.removeClass("current").eq(i).addClass("current"),t="vertical"==s[e].pagination.direction?{top:i*-(I[e].page.height+I[e].page.vertical_space)}:{left:i*-(I[e].page.width+I[e].page.horizontal_space)},L[e].container.stop(!0,!1).animate(t,s[e].pagination.duration,s[e].pagination.easing)}}},thumbnails:{init:function(){L.thumbs={container:e('<div class="thumb_container" />'),window:e('<div class="thumb_window" />'),wrapper:e('<div class="thumb_wrapper" />')},L.thumbs.window.append(L.thumbs.container),L.thumbs.wrapper.append(L.thumbs.window),z.prepend(L.thumbs.wrapper),Y._items_panel.init({panel:"thumbs",page:e("<ul />"),item:e('<li><img src="'+d[0].items[0].thumb.src+'" alt="" style="width: '+s.thumbs.width+"px !important; height: "+s.thumbs.height+'px !important;" /></li>')}),s.thumbs.auto_hide&&(L.thumbs.wrapper.css({display:"none"}),z.hover(function(){L.thumbs.wrapper.stop().fadeTo(s.thumbs.hide_speed,1)},function(){L.thumbs.wrapper.stop().fadeTo(s.thumbs.hide_speed,0)})),Y.thumbnails.display_category(!1),Y.thumbnails.select(E.item.index)},display_category:function(){var i,t,n,a,o,r,l=0,d=!(arguments.length>0&&!1===arguments[0]);if(s.thumbs.display){for(Y._items_panel.calculate_pages({panel:"thumbs",item_count:E.category.item_count}),L.thumbs.container.html("");l<E.category.item_count;l++)l%I.thumbs.per_page==0&&("vertical"==s.thumbs.pagination.direction?L.thumbs.container.height(L.thumbs.container.height()+I.thumbs.window_height):L.thumbs.container.width(L.thumbs.container.width()+I.thumbs.window_width),(i=e("<ul />")).width(I.thumbs.page.width).height(I.thumbs.page.height).appendTo(L.thumbs.container)),n=s.thumbs.captions&&"string"==typeof E.category.items[l].thumb.caption&&E.category.items[l].thumb.caption?'<div class="caption_wrapper"><div class="caption">'+E.category.items[l].thumb.caption+"</div></div>":"",a=s.thumbs.display_item_types?'<span class="item_type_icon '+E.category.items[l].type+'"></span>':"",t='<li><img style="width: '+s.thumbs.width+"px !important; height: "+s.thumbs.height+'px !important;" src="'+E.category.items[l].thumb.src+'" alt="" />'+a+n,d&&(e("<img />").load({index:l},function(i){L.thumbs.pages.find(".thumb_preloading").eq(i.data.index).fadeTo(500,0,function(){e(this).remove()})}).attr("src",E.category.items[l].thumb.src),t+='<div class="thumb_preloading"></div>'),i.append(t+"</li>"),s.thumbs.tooltips.enabled&&e.fn.qtip&&(r=!0,o="",E.category.items[l].thumb.tooltip&&(s.thumbs.tooltips.title&&E.category.items[l].thumb.tooltip.title&&(o='<p class="title">'+E.category.items[l].thumb.tooltip.title+"</p>",r=!1),s.thumbs.tooltips.description&&E.category.items[l].thumb.tooltip.description&&(o+='<div class="description">'+E.category.items[l].thumb.tooltip.description+"</div>",r=!1),r||i.find("> li").filter(":last").qtip({content:{text:o},position:s.thumbs.tooltips.position,style:{classes:"chameleon_slider_tooltip "+s.thumbs.tooltips.classes,tip:{corner:!0}}})));L.thumbs.pages=L.thumbs.container.find("> ul")}},trigger:function(){L.thumbs.container.delegate("ul > li","click",function(){var i=e(this);return Y.show_item(i.parent().index()*I.thumbs.per_page+i.index()),!1})},select:function(e){if(s.thumbs.display){var i=L.thumbs.pages.find("> li").eq(e);Y._items_panel.move_to_page("thumbs",i.parent().index()),L.thumbs.pages.find("> li.on").removeClass("on"),i.addClass("on")}}},categories:{init:function(){L.categories={container:e('<div class="categories_container" />'),window:e('<div class="categories_window" />'),wrapper:e('<div class="categories_wrapper '+s.categories.pagination.direction+'" />')},L.categories.window.append(L.categories.container),L.categories.wrapper.append(L.categories.window),z.prepend(L.categories.wrapper),Y._items_panel.init({panel:"categories",page:e("<ul />"),item:e('<li style="width: '+s.categories.width+"px; height: "+s.categories.height+'px;" />')}),s.categories.auto_hide&&(L.categories.wrapper.css({display:"none"}),z.hover(function(){L.categories.wrapper.stop().fadeTo(s.categories.hide_speed,1)},function(){L.categories.wrapper.stop().fadeTo(s.categories.hide_speed,0)})),Y.categories.display_categories()},display_categories:function(){var i,t,n,a,o,r,l,_,p=[],h=0,g=c.indexes[c.indexes.length-1];if(s.categories.display){if(I.categories.render_categories){for(1==c.indexes.length?p=d:((a=e.extend([],c.indexes)).pop(),p=Y.get_category(a).children,p=[{id:-1,name:"&lt;Back",open_parent:!0}].concat(p),g++),n=p.length,Y._items_panel.calculate_pages({panel:"categories",item_count:n}),L.categories.container.empty(),h=0;h<n;h++)h%I.categories.per_page==0&&("vertical"==s.categories.pagination.direction?L.categories.container.height(L.categories.container.height()+I.categories.window_height):L.categories.container.width(L.categories.container.width()+I.categories.window_width),(i=e("<ul />")).width(I.categories.page.width).height(I.categories.page.height).appendTo(L.categories.container)),o=void 0!==p[h].children&&p[h].children.length>0,t="<li"+(p[h].open_parent?' class="open_parent"':"")+(o?' class="has_children"':"")+' style="width: '+s.categories.width+"px; height: "+s.categories.height+'px;"><a href="#" class="'+(p[h].open_parent?"back_button":"category")+'"><span>'+p[h].name+"</span></a>",o&&(t+='<a href="#" class="open_children"></a>'),t+="</li>",i.append(t);L.categories.pages=L.categories.container.find("> ul"),r=(l=L.categories.pages.find("> li > a.category")).eq(0),_=s.categories.height-(r.outerHeight(!0)-r.height()),l.height(_),l.each(function(){var i=e(this).find("span"),t=i.height();_>t?i.css({top:Math.floor((_-t)/2)}):i.css({top:0})})}else c.indexes.length>1&&g++,I.categories.render_categories=!0;Y.categories.select(g)}},trigger:function(){L.categories.container.delegate("li > a","click",function(){var i=e(this),t=i.parent(),n=t.parent().index()*I.categories.per_page+t.index();if(L.categories.pages.find("> li").eq(0).hasClass("open_parent")&&n--,i.hasClass("category")){if(t.hasClass("on"))return!1;c.indexes.pop(),c.indexes.push(n),c.ids=Y.category_ids_from_indexes(c.indexes),E.category=Y.get_category(c.indexes),E.category.item_count=E.category.items.length,E.item={id:E.category.items[0].id,index:0},I.categories.render_categories=!1,Y.change_category()}else i.hasClass("open_children")?(c.indexes.pop(),c.indexes.push(n),c.indexes.push(0),c.ids=Y.category_ids_from_indexes(c.indexes),E.category=Y.get_category(c.indexes),E.category.item_count=E.category.items.length,E.item={id:E.category.items[0].id,index:0},Y.change_category()):i.hasClass("back_button")&&(c.indexes.pop(),c.ids=Y.category_ids_from_indexes(c.indexes),E.category=Y.get_category(c.indexes),E.category.item_count=E.category.items.length,E.item={id:E.category.items[0].id,index:0},Y.change_category());return!1})},select:function(e){var i=L.categories.pages.find("> li").eq(e);Y._items_panel.move_to_page("categories",i.parent().index()),L.categories.pages.find("> li.on").removeClass("on"),i.addClass("on")}},change_category:function(){Y.main_panel.display_category(),Y.categories.display_categories(),Y.thumbnails.display_category(),Y.pagination.display_category(),Y.gallery_title.select(),Y.gallery_info.display(),Y.arrows.display_category(),Y.autoplay_toggle.display_category(),Y.autoplay.display_category(),Y.show_item(E.item.index,!0)},arrows:{init:function(){j=e('<a href="#" class="navigation_button prev">Previous</a>'),k=e('<a href="#" class="navigation_button next">Next</a>'),z.prepend(j,k),Y.position_element(j,s.arrows.prev.position),Y.position_element(k,s.arrows.next.position),Y.arrows.display_category()},trigger:function(){j.click(function(){return Y.prev(),!1}),k.click(function(){return Y.next(),!1}),s.arrows.auto_hide&&(j.fadeTo(0,0),k.fadeTo(0,0),z.hover(function(){1!=E.category.item_count&&(j.stop().fadeTo(s.arrows.hide_speed,1),k.stop().fadeTo(s.arrows.hide_speed,1))},function(){j.stop().fadeTo(s.arrows.hide_speed,0),k.stop().fadeTo(s.arrows.hide_speed,0)}))},display_category:function(){var e="";1==E.category.item_count&&(e="none"),j.css("display",e),k.css("display",e)}},_title_box:{init:function(i){var t,n;I.title_boxes[i.box]=e('<span class="title_box'+(i.custom_class?" "+i.custom_class:"")+'" style="height: '+s.title_boxes[i.box].height+'px;"><span>T</span></span>'),t=I.title_boxes[i.box].find("> span"),I.title_boxes[i.box].css("visibility","hidden"),z.prepend(I.title_boxes[i.box]),Y.position_element(I.title_boxes[i.box],s.title_boxes[i.box].position),(n=Math.floor((s.title_boxes[i.box].height-t.height())/2))<0&&(n=0),t.css({top:n}).empty(),I.title_boxes[i.box].css("visibility","")},change_text:function(e){e.text?I.title_boxes[e.box].is(":visible")?I.title_boxes[e.box].stop().fadeTo(200,0,function(){I.title_boxes[e.box].fadeTo(400,1).find("> span").html(e.text)}):I.title_boxes[e.box].stop().fadeTo(400,1).find("> span").html(e.text):I.title_boxes[e.box].stop().fadeTo(200,0)}},item_title:{init:function(){Y._title_box.init({box:"current_item",custom_class:"current_item"}),Y.item_title.select(E.item.index)},select:function(e){s.title_boxes.current_item.display&&Y._title_box.change_text({box:"current_item",text:E.category.items[e].title})},size:function(){s.title_boxes.current_item.display&&Y.position_element(I.title_boxes.current_item,s.title_boxes.current_item.position)}},gallery_title:{init:function(){Y._title_box.init({box:"current_gallery",custom_class:"current_gallery"}),Y.gallery_title.select()},select:function(){s.title_boxes.current_gallery.display&&Y._title_box.change_text({box:"current_gallery",text:E.category.name})},size:function(){s.title_boxes.current_gallery.display&&Y.position_element(I.title_boxes.current_gallery,s.title_boxes.current_gallery.position)}},triggers:function(){s.arrows.display&&Y.arrows.trigger(),s.thumbs.display&&Y.thumbnails.trigger(),s.categories.display&&Y.categories.trigger(),s.key_browse&&Y.key_browse(),s.autoplay.enable&&Y.autoplay.start(),s.autoplay.pause_on_hover&&z.hover(function(){E.category.item_count<2||P.user_paused||P.pause||(P.pause=!0,Y.autoplay.pause())},function(){E.category.item_count<2||(P.pause=!1,P.video_playing||P.user_paused||P.transition_in_progres||Y.autoplay.start())}),z.bind("resize_slider",function(){Y.autoplay.reset(),z.css(I.container_dimensions),Y.main_panel.size(),Y.autoplay.size(),Y._scrollable_boxes.size("gallery_info"),Y._scrollable_boxes.size("item_info"),Y.gallery_title.size(),Y.item_title.size(),Y.thumbnails.display_category(!1),Y.categories.display_categories(),s.pagination.display&&Y.position_element(m,s.pagination.position),s.autoplay_toggle.display&&Y.position_element(x,s.autoplay_toggle.position),s.arrows.display&&(Y.position_element(j,s.arrows.prev.position),Y.position_element(k,s.arrows.next.position)),Y.show_item(E.item.index,!0,"")}),q.fadeOut(200,function(){q.remove()}),z.trigger("slider_initialized")},get_dimensions:function(e){var i;return i=arguments.length>1&&"object"==typeof arguments[1]?arguments[1]:{width:I.container_dimensions.width,height:I.container_dimensions.height},{width:e.w_as_ratio?Math.floor(i.width*e.width):e.width,height:e.h_as_ratio?Math.floor(i.height*e.height):e.height}},position_element:function(e,i){var t=i.v_as_ratio?Math.floor(i.v_offset*I.container_dimensions.height):i.v_offset,n=i.h_as_ratio?Math.floor(i.h_offset*I.container_dimensions.width):i.h_offset;i.v_center_point&&(t-=Math.floor(e.outerHeight()/2)),i.h_center_point&&(n-=Math.floor(e.outerWidth()/2)),"top"==i.vertical?e.css("top",t):e.css({top:"auto",bottom:t}),"left"==i.horizontal?e.css("left",n):e.css({left:"auto",right:n})},category_indexes_from_ids:function(i,t){var n,a=0,o=[];if(0==i.length)return[];for(n=e.isArray(t)?t.length:0;a<n;a++)if(t[a].id==i[0])return i.shift(),0!=i.length&&0==(o=Y.category_indexes_from_ids(i,t[a].children)).length?[]:[a].concat(o);return[]},category_ids_from_indexes:function(e){var i,t=e.length,n=1,a=d[e[0]];for(i=[a.id];n<t;n++)a=a.children[e[n]],i.push(a.id);return i},get_category:function(i){var t,n=i.length,a=1;if(!e.isArray(i)||0==i.length)return d[0];for(t=d[i[0]];a<n;a++)t=t.children[i[a]];return t},item_index_from_id:function(e){var i=E.category.items,t=i.length,n=0;if(null==e)return 0;for(;n<t;n++)if(i[n].id==e)return n;return 0},set_url_param:function(e,i){var t,n,a="",o="",s=i+(arguments.length>2?"="+arguments[2]:""),r=!1,l=!1;if(a=1!=(e=e.split("#")).length&&e[1],1==(e=e[0].split("?")).length||""==e[1])o=e[0]+"?"+s;else{for(n in o=e[0]+"?",t=e[1].split("&"))"string"==typeof t[n]&&((r=t[n].split("="))[0]==i?(l=!0,o+=s+"&"):1==r.length?o+=r[0]+"&":o+=r[0]+"="+r[1]+"&");l?o=o.substring(0,o.length-1):o+=s}return o+(!1===a?"":"#"+a)}};Y.init()})},e.fn[n+"_fullscreen"]=function(i){var a,o,s=function(){a.fadeTo(500,0,function(){o.trigger("destroy"),a.remove()}),e(t).unbind("keydown.chameleonslider_fullscreen_"+i.module_id)};a=e('<div id="chameleonSliderFullscreen_'+i.module_id+'" style="z-index: 15000; overflow: hidden; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, .5);"><div class="chameleon_slider '+i.theme+'" /></div>'),e("body").append(a),o=a.find("> .chameleon_slider"),e.extend(!0,i,{container_dimensions:{width:1,height:1,w_as_ratio:!0,h_as_ratio:!0},autoplay:{pause_on_hover:!1},buttons:{exit_fullscreen:{display:!0},fullscreen:{display:!1}},main_panel:{stretch_small_image:!0}}),o.bind("slider_initialized",function(){o.find("> .exit_fullscreen").click(function(){return s(),!1}),e(t).bind("keydown.chameleonslider_fullscreen_"+i.module_id,function(e){27==e.which&&s()})}),o[n](i)}}(eds2_2,window,document);
;;;/*!
 * imagesLoaded PACKAGED v3.1.4
 * JavaScript is all like "You images are done yet or what?"
 * MIT License
 */

(function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("eventEmitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(this,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function c(e){this.img=e}function f(e){this.src=e,v[e]=this}var a=e.eds2_2,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);for(var i=n.querySelectorAll("img"),r=0,o=i.length;o>r;r++){var s=i[r];this.addImage(s)}}},s.prototype.addImage=function(e){var t=new c(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),c.prototype=new t,c.prototype.check=function(){var e=v[this.img.src]||new f(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},c.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return f.prototype=new t,f.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},f.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},f.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},f.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},f.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},f.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s});
;;;!function(e,t){"use strict";var a={portalId:0,moduleId:0,tabId:0,autoplayVideo:!1,userLoggedIn:!1,googleReCaptchaSiteKey:"",websiteRoot:"",portfolioMode:!1,openAt:0,wrapperResizeDuration:200,flowplayerSwf:"",flowplayer:{key:"",logo:""},socialButtons:{facebook:!1,gplus:!1,twitter:!1,inshare:!1,pinterest:!1},cssClass:"",events:{onBeforeClose:function(){}},comments:{requireAuthorInfo:!0,useReCaptcha:!1,permissions:{show:!1,commenting:!1}},like:{permissions:{liking:!1}},mobile:!1,i18n:{}},o=0,i=1,s=2,n="positionAnimation",r="swipeAnimation",m=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,l=function(t,a){var o=this,i=o.items[t];if(i&&"image"==i.type){var s=o.images[i.src];if(s)"function"==typeof a&&(s.stats.preloadFinished?a(s.stats):s.callbacks.push(a));else{s=o.images[i.src]={callbacks:[],stats:{preloadFinished:!1,isLoaded:!1,width:0,height:0}},"function"==typeof a&&s.callbacks.push(a);var n=e('<img class="smbLightImage_'+i.id+'" />');n.imagesLoaded().progress(function(e,t){if(!o.viewClosed){var a=o.images[i.src];if(a.stats.preloadFinished=!0,a.stats.isLoaded=t.isLoaded,!o.smbPlus&&t.isLoaded&&o.$imagesWrapper.append(n),a.stats.width=n.width(),a.stats.height=n.height(),o.smbPlus)n.css(p.call(o,a.stats.width,a.stats.height,!1)),n.parent().removeClass("loading");else{var s=o.items[o.currentItemIndex];"image"==s.type&&s.src==i.src&&(o.initialItemLoaded=!0,$.call(o))}n=null;for(var r=0,m=a.callbacks.length;r<m;r++)a.callbacks[r](a.stats)}}),o.smbPlus&&n.appendTo(e("> div.item_"+t,o.$contentWrapper)),n.attr("src",i.src)}}},c=function(){for(var e=0,t=this.items.length;e<t;e++)l.call(this,e)},p=function(e,t,a,o){var i,s,n=this.overlayWidth-this.main.horizontalSpace,r=this.overlayHeight-this.main.verticalSpace,m=e,l=t;return(a||e>n||t>r)&&(m=n,l=r,(s=e/t)<(i=n/r)?m=Math.round(r/t*e):s>i&&(l=Math.round(n/e*t))),o&&(l=t),{width:m,height:l,top:Math.floor((r-l)/2),left:Math.floor((n-m)/2)}},d=function(e){var t=this,a=function(){t.$loadingOverlay.stop(!0).fadeTo(200,0,function(){t.$loadingOverlay.css("display","none")}),v.call(t)},o=function(e,a){0==t.options.wrapperResizeDuration?(t.$mainWrapper.css(e),a()):t.$mainWrapper.stop(!0).animate(e,{duration:t.options.wrapperResizeDuration,complete:function(){t.$mainWrapper.css("overflow",""),a()}})},i=function(){t.$mainWrapper.height()!=e.height?o({height:e.height,top:e.top},a):a()};t.$loadingOverlay.removeClass("inProgress"),t.$mainWrapper.width()!=e.width?o({width:e.width,left:e.left},i):i()},h=function(t){var a="",o="",i=this.items[t];switch(this.smbPlus||this.$mainWrapper.addClass("videoItem"),i.source){case"youtube":a='<iframe src="//www.youtube.com/embed/'+i.videoId+(this.options.autoplayVideo?"?autoplay=1":"")+'" frameborder="0" allowfullscreen></iframe>';break;case"vimeo":a='<iframe src="//player.vimeo.com/video/'+i.videoId+(this.options.autoplayVideo?"?autoplay=1":"")+'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';break;case"wistia":a='<iframe name="wistia_embed" src="//fast.wistia.net/embed/iframe/'+i.videoId+'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';break;case"flowplayer":W(i.src,".mp4")?o="video/mp4":W(i.src,".webm")?o="video/webm":W(i.src,".ogg")?o="video/ogg":W(i.src,".flv")&&(o="video/flash"),a='<div class="flowplayerContainer"></div>'}var s=this.$audioVideo;this.smbPlus?("flowplayer"!=i.source&&(a="<div>"+a+"</div>"),s=e("> div.item_"+this.currentItemIndex,this.$contentWrapper)):s.addClass("activeElement"),s.html(a).removeClass("loading"),"flowplayer"==i.source&&e("> .flowplayerContainer",s).flowplayer({swf:this.options.flowplayerSwf,ratio:i.height/i.width,autoplay:this.options.autoplayVideo,tooltip:!1,embed:!1,clip:{sources:[{type:o,src:i.src}]},key:this.options.flowplayer.key,logo:this.options.flowplayer.logo});var n=p.call(this,i.width,i.height,!0);this.smbPlus?e(">",s).css(n):d.call(this,n),this.initialItemLoaded=!0},u=function(t){this.smbPlus||this.$mainWrapper.addClass("audioItem");var a=this.$audioVideo,o='<audio src="'+t.src+'" />',i="> audio";this.smbPlus?(o="<div>"+o+"</div>",i="> div > audio",a=e("> div.item_"+this.currentItemIndex,this.$contentWrapper)):a.addClass("activeElement"),a.html(o).removeClass("loading"),audiojs.create(e(i,a)[0]);var s=p.call(this,460,36,!1,!0);this.smbPlus?e(">",a).css(s):d.call(this,s),this.initialItemLoaded=!0},v=function(){var e=this.items[this.currentItemIndex];"string"==typeof e.title&&""!=e.title&&this.$itemTitle.html(e.title).stop(!0).fadeTo(200,1),(this.options.socialButtons.facebook||this.options.socialButtons.twitter||this.options.socialButtons.gplus||this.options.socialButtons.inshare||this.options.socialButtons.pinterest&&"image"==e.type)&&"string"==typeof e.socialUrl&&""!=e.socialUrl?this.$socialButtonsTrigger.css("display",""):this.$socialButtonsTrigger.css("display","none")},g=function(e){var t=this.items.length;return e<0?e=t-1:e>=t&&(e=0),e},$=function(){if(this.$itemTitle.text("").stop(!0).fadeTo(0,0),this.$socialButtonsTrigger.removeClass("show"),this.$socialButtonsWrapper.removeClass("show").html(""),this.currentItemIndex=g.call(this,this.currentItemIndex),this.$root.removeClass("firstItem lastItem"),0===this.currentItemIndex&&this.$root.addClass("firstItem"),this.currentItemIndex===this.items.length-1&&this.$root.addClass("lastItem"),this.smbPlus){var t=g.call(this,this.currentItemIndex-1),a=g.call(this,this.currentItemIndex+1);e("> div.videoItem.item_"+t+",> div.audioItem.item_"+t+",> div.videoItem.item_"+a+",> div.audioItem.item_"+a,this.$contentWrapper).html(""),v.call(this)}var o=this.items[this.currentItemIndex],i="imageActive";"video"==o.type?i="videoActive":"audio"==o.type&&(i="audioActive"),this.$root.removeClass("imageActive videoActive audioActive").addClass(i),this.showItem()},C=function(){if(this.smbPlus){var e=this.$window.height();t.innerHeight&&(e=t.innerHeight),e+=1,this.$root.height(e),this.overlayWidth=this.$root.width(),this.overlayHeight=e}else this.overlayWidth=this.$contentWrapper.width(),this.overlayHeight=this.$contentWrapper.height();this.center()},f=function(e){var t=this;if(!(t.skipGestures||-1==e&&0==t.currentItemIndex||1==e&&t.currentItemIndex==this.items.length-1)){t.skipGestures=!0;var a=-t.currentItemIndex*t.overlayWidth;1==e?a-=t.overlayWidth:a+=t.overlayWidth,t.$contentWrapper.removeClass(n).addClass(r).css({transform:"translate3d("+a+"px, 0, 0)"}),setTimeout(function(){t.currentItemIndex+=e,$.call(t),t.skipGestures=!1},250)}},I=function(){this.initialItemLoaded&&(this.smbPlus?f.call(this,-1):(this.currentItemIndex-=1,$.call(this)))},y=function(){this.initialItemLoaded&&(this.smbPlus?f.call(this,1):(this.currentItemIndex+=1,$.call(this)))},w=function(){var e=this;"function"==typeof e.options.events.onBeforeClose&&!1===e.options.events.onBeforeClose({activeItem:e.currentItemIndex,displayItems:e.items})||(e.$document.off(".smbLightEvent"),e.$window.off(".smbLightEvent"),e.viewClosed=!0,e.$root.stop(!0).fadeOut(200,function(){e.$root.remove(),e.$body.removeClass("smbLightFixed")}),e.smbPlus&&(void 0===e.oldViewportMetaContent?e.$viewportMeta.remove():e.$viewportMeta.attr("content",e.oldViewportMetaContent),void 0===e.oldIeTapHighlight?e.$ieTapHighlight.remove():e.$ieTapHighlight.attr("content",e.oldIeTapHighlight)))},W=function(e,t){return-1!==e.indexOf(t,e.length-t.length)},k=function(){var t=this,a=t.items[t.currentItemIndex],o=t.comments[a.id],i="";if(t.$mainCommentsCount.text(o.count),t.$internalCommentsCount.text(o.count),0==o.cache.comments.length)return t.$commentList.html(""),void t.$commentsModal.addClass("noComments");t.$commentsModal.removeClass("noComments"),e.each(o.cache.comments,function(){var a=o.cache.authors[this.author],s=encodeURI(a.url),n='<li><a class="authorAvatar" href="'+s+'"><img src="'+encodeURI(a.avatar)+'" alt="" /></a><a class="author" href="'+s+'">'+e("<p />").text(a.name).html()+"</a><div>"+this.content+'</div><p class="datetime">'+this.dateHtml+"</p></li>";"asc"==t.commentSorting?i+=n:i=n+i}),t.$commentList.html(i)},b=function(o,i){return this.$body=e("body"),!this.$body.hasClass("smbLightFixed")&&0!=o.length&&(this.$body.addClass("smbLightFixed"),this.$window=e(t),this.$document=e(document),this.initialItemLoaded=!1,this.viewClosed=!1,this.items=o,this.options=e.extend(!0,{},a,i),this.currentItemIndex=this.options.openAt,(this.currentItemIndex<0||this.currentItemIndex>=o.length)&&(this.currentItemIndex=0),this.images={},!0)},x=function(){var t=this;t.$window.on("resize.smbLightEvent",function(){if(t.comments){var e=t.items[t.currentItemIndex],a=t.comments?t.comments[e.id]:void 0;t.desktopVersion&&a&&a.state.open&&t.$root.width(t.$window.width()-t.$commentsModal.outerWidth(!0))}C.call(t)}),t.$document.on("keyup.smbLightEvent",function(e){switch(e.keyCode){case 37:I.call(t);break;case 39:y.call(t);break;case 27:if(t.commentsOpened)return t.closeComments(),!1;w.call(t)}return!1}),t.$root.on("click",".navigation",function(){t.$root.hasClass("initializing")||(e(this).hasClass("prev")?I.call(t):y.call(t))}).on("click",".close",function(){w.call(t)}),t.$socialButtonsTrigger.on("click",function(){if(!t.$root.hasClass("initializing")){var a=t.items[t.currentItemIndex],o=encodeURIComponent(a.socialUrl),i="",s="";"string"==typeof a.title&&""!=a.title&&(s=a.title.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),s+=" "+a.socialUrl.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),i=encodeURIComponent(a.title));var n="";t.options.socialButtons.facebook&&(n='<div><iframe src="//www.facebook.com/plugins/like.php?href='+o+'&amp;width&amp;layout=button_count&amp;action=like&amp;show_faces=false&amp;share=false&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:21px; width: 135px;" allowTransparency="true"></iframe></div>'),t.options.socialButtons.twitter&&(n+='<div><a href="//twitter.com/share" class="twitter-share-button" data-url="'+o+'" data-text="'+s+'">Tweet</a><script type="text/javascript">twttr.widgets.load();<\/script></div>'),t.options.socialButtons.gplus&&(n+='<div><div class="g-plusone" data-size="medium" data-href="'+a.socialUrl+'"></div><script type="text/javascript">gapi.plusone.go();<\/script></div>'),t.options.socialButtons.inshare&&(n+='<div><script type="IN/Share" data-url="'+a.socialUrl+'" data-counter="right"><\/script><script type="text/javascript">if (IN.parse) IN.parse();<\/script></div>'),t.options.socialButtons.pinterest&&"image"==a.type&&(n+='<div><a href="//www.pinterest.com/pin/create/button/?url='+o+"&media="+encodeURIComponent(a.src)+"&description="+i+'" data-pin-do="buttonPin" data-pin-config="beside"><img src="//assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png" /></a></div>'),""!=n&&(t.$socialButtonsWrapper.toggleClass("show").html(n),t.options.socialButtons.pinterest&&"image"==a.type&&e.ajax({url:"//assets.pinterest.com/js/pinit.js",dataType:"script",cache:!0}),e(this).toggleClass("show"))}})},T=function(e){var t=this.options.i18n[e];return t||e};function L(t,a){var o,i=this,s="";if(b.call(i,t,a))return i.$root=e('<div class="smbLightOverlayWrapper initializing"><div class="contentWrapper" /></div>'),i.$root.addClass(i.options.cssClass),i.$contentWrapper=e("> div.contentWrapper",i.$root),t.length>1&&(s='<span class="navigation prev"><span /></span><span class="navigation next"><span /></span>'),s+='<span class="close"><span /></span><div class="socialButtonsWrapper"></div><span class="actions socialButtonsTrigger"><span>'+T.call(i,"Share")+"</span></span>",i.$mainWrapper=e('<div class="mainWrapper"><div class="viewWrapper"><div class="images"><p>'+T.call(i,"This image is currently unavailable")+'</p></div><div class="audioVideo" /></div>'+s+"</div>").appendTo(i.$contentWrapper),i.$itemTitle=e('<h2 class="itemTitle" />').appendTo(i.$mainWrapper),i.$loadingOverlay=e('<div class="loadingOverlay inProgress" />').appendTo(i.$mainWrapper),i.$imagesWrapper=e("> .viewWrapper > .images",i.$mainWrapper),i.$audioVideo=e("> .viewWrapper > .audioVideo",i.$mainWrapper),i.$socialButtonsWrapper=e(".socialButtonsWrapper",i.$mainWrapper),i.$socialButtonsTrigger=e(".socialButtonsTrigger",i.$mainWrapper),"image"==(o=i.items[i.currentItemIndex]).type?l.call(i,i.currentItemIndex,function(){c.call(i)}):c.call(i),i.$root.appendTo(i.$body),i.main={horizontalSpace:i.$mainWrapper.outerWidth(!0)-i.$mainWrapper.width(),verticalSpace:i.$mainWrapper.outerHeight(!0)-i.$mainWrapper.height()},C.call(i),i.$root.fadeTo(200,1,function(){"image"!=o.type&&$.call(i)}),x.call(i),i}function M(t,a){var o=this,i="";if(o.smbPlus=!0,b.call(o,t,a)){if(o.options.wrapperResizeDuration=0,o.$viewportMeta=e('meta[name="viewport"]'),o.oldViewportMetaContent=void 0,o.$viewportMeta.length>0?(o.oldViewportMetaContent=o.$viewportMeta.attr("content"),o.$viewportMeta.attr("content","user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1")):o.$viewportMeta=e('<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1" />').appendTo(e("head")),o.$ieTapHighlight=e('meta[name="msapplication-tap-highlight"]'),o.oldIeTapHighlight=void 0,o.$ieTapHighlight.length>0?(o.oldIeTapHighlight=o.$ieTapHighlight.attr("content"),o.$ieTapHighlight.attr("content","no")):o.$ieTapHighlight=e('<meta name="msapplication-tap-highlight" content="no" />').appendTo(e("head")),o.$root=e('<div class="smbLightOverlayWrapper smbPlus initializing"><div class="contentWrapper"></div></div>').addClass(o.options.cssClass),/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())||(o.$root.addClass("desktopUserAgent"),o.desktopVersion=!0),o.$contentWrapper=e("> div.contentWrapper",o.$root),i='<div class="mobileOverlay" /><div class="modalOverlay" />',t.length>1&&(i+='<span class="navigation prev"><span /></span><span class="navigation next"><span /></span>'),i+='<span class="close"><span /></span><div class="socialButtonsWrapper"></div><span class="actions socialButtonsTrigger"><span>'+T.call(o,"Share")+"</span></span>",o.$root.append(i),o.$itemTitle=e('<h2 class="itemTitle" />').appendTo(o.$root),o.$socialButtonsWrapper=e(".socialButtonsWrapper",o.$root),o.$socialButtonsTrigger=e(".socialButtonsTrigger",o.$root),o.$modalOverlay=e("> .modalOverlay",o.$root),o.options.comments.permissions.show){var s;o.comments={},o.$root.append('<span class="actions commentsTrigger"><span>0</span></span><div class="commentsModalWrapper"><div class="main"><div class="top"><span class="comments">0</span><span class="likes">0</span><span class="sort">'+T.call(o,"Sort")+'</span></div><ul /><p class="noComments">'+T.call(o,"No comments yet")+'</p><div class="newCommentWrapper"><textarea placeholder="'+T.call(o,"Write a comment")+'"></textarea><button>'+T.call(o,"Post")+'</button></div></div><div class="anonymCommentWrapper"><p>'+T.call(o,"Add a comment")+'</p><div class="authorName"><input type="text" placeholder="'+T.call(o,"Name")+'" /></div><div class="authorEmail"><input type="text" placeholder="'+T.call(o,"Email")+'" /></div><div class="authorTextarea"><textarea placeholder="'+T.call(o,"Write a comment")+'"></textarea></div>'+(o.options.comments.requireAuthorInfo&&o.options.comments.useReCaptcha?'<div class="captchaContainer"><p class="captchaError">'+T.call(o,"Please solve the test correctly.")+'</p><div class="captcha"></div></div>':"")+'<div class="actions"><button class="cancel">'+T.call(o,"Cancel")+'</button><button class="post">'+T.call(o,"Post")+'</button></div></div><span class="closeComments">'+T.call(o,"Hide")+'</span><p class="loading">'+T.call(o,"Loading comments")+"</p></div>"),o.$commentsTrigger=e("> .actions.commentsTrigger",o.$root),o.$mainCommentsCount=e("> span",o.$commentsTrigger),o.$commentsModal=e("> .commentsModalWrapper",o.$root),o.$commentsMainWrapper=e("> .main",o.$commentsModal),o.$newCommentWrapper=e("> .newCommentWrapper",o.$commentsMainWrapper),o.$newCommentInput=e("> textarea",o.$newCommentWrapper),o.$newCommentButton=e("> button",o.$newCommentWrapper),o.$commentsTopBar=e("> .top",o.$commentsMainWrapper),o.$internalCommentsCount=e("> .comments",o.$commentsTopBar),o.$commentsLikes=e("> .likes",o.$commentsTopBar),o.$commentsSorting=e("> .sort",o.$commentsTopBar),o.$commentList=e("> ul",o.$commentsMainWrapper),o.$anonymCommentWrapper=e("> .anonymCommentWrapper",o.$commentsModal),o.$anonymCommenterNameInput=e("> .authorName > input",o.$anonymCommentWrapper),o.$anonymCommenterEmailInput=e("> .authorEmail > input",o.$anonymCommentWrapper),o.$anonymCommentInput=e("> .authorTextarea > textarea",o.$anonymCommentWrapper),o.$anonymCommentCancel=e("> .actions > .cancel",o.$anonymCommentWrapper),o.$anonymCommentPost=e("> .actions > .post",o.$anonymCommentWrapper),o.$newCommentCaptchaContainer=e("> .captchaContainer",o.$anonymCommentWrapper),o.commentSorting="asc",o.addingAjaxRequest=void 0,o.commentsOpened=!1,o.commentsAnimationTimeout,o.$commentsTrigger.on("click",function(){o.desktopVersion&&1==o.commentsOpened?o.closeComments():(o.updateItemComments(),o.desktopVersion?(o.commentsOpened=!0,clearTimeout(o.commentsAnimationTimeout),o.$root.addClass("animateComments moveComments"),o.commentsAnimationTimeout=setTimeout(function(){o.$root.removeClass("animateComments moveComments"),o.$root.width(o.$root.width()-o.$commentsModal.outerWidth(!0)),C.call(o)},200)):(o.$root.addClass("modalActive"),o.$modalOverlay.stop(!0).animate({opacity:1},{duration:200})))}),o.$commentsSorting.on("click",function(){"asc"==o.commentSorting?o.commentSorting="desc":o.commentSorting="asc",o.$commentsSorting.toggleClass("desc","desc"==o.commentSorting),k.call(o)}),o.$commentsModal.on("click","> span.closeComments",function(){o.closeComments()}),o.$newCommentInput.on("change keyup",function(){var e=o.$newCommentInput.val();o.$newCommentWrapper.toggleClass("filledIn",""!==e)}).on("focus",function(){o.options.comments.requireAuthorInfo&&(o.$anonymCommenterNameInput.trigger("focus").val("").parent().removeClass("error"),o.$anonymCommenterEmailInput.val("").parent().removeClass("error"),o.$anonymCommentInput.val("").parent().removeClass("error"),o.$newCommentCaptchaContainer.removeClass("error"),o.options.comments.useReCaptcha&&(s?grecaptcha.reset(s):s=grecaptcha.render(e("> .captcha",o.$newCommentCaptchaContainer)[0],{sitekey:o.options.googleReCaptchaSiteKey,size:"compact"})),o.$commentsModal.addClass("showAnonymWindow"))}),o.$anonymCommentCancel.on("click",function(){o.$commentsModal.removeClass("showAnonymWindow"),o.$anonymCommentWrapper.removeClass("addingAnonComment"),o.addingAjaxRequest&&(o.addingAjaxRequest.abort(),o.addingAjaxRequest=void 0)});var l=function(t,a,i,s,n,r){var m=o.currentItemIndex,l=o.items[m],c=o.comments[l.id],p=o.options.comments.requireAuthorInfo?s:o.$newCommentInput.val(),d={action:"add_comment"},h=!1;""===p||o.$newCommentWrapper.hasClass("addingComment")||(o.$newCommentCaptchaContainer.removeClass("error"),o.$newCommentInput.val(""),o.$newCommentWrapper.removeClass("filledIn").addClass("addingComment"),d.comment=p,o.options.comments.requireAuthorInfo&&(d.name=a,d.email=i),n&&(d.captcha=n),o.addingAjaxRequest=e.ajax({data:d,dataType:"json",type:"POST",url:l.comments.backend,timeout:3e4,cache:!1,error:function(){},success:function(e){null!=e.status&&("success"==e.status?(c.cache.comments.push({author:e.author.id,content:e.comment,raw:p,id:e.id,dateHtml:e.dateHtml}),c.count+=1,null==c.cache.authors[e.author.id]&&(c.cache.authors[e.author.id]={avatar:e.author.avatar,name:e.author.name,url:e.author.url})):"captcha_error"==e.status&&(o.$newCommentCaptchaContainer.addClass("error"),h=!0))},complete:function(){o.addingAjaxRequest=void 0,c.state.open&&m==o.currentItemIndex&&(r&&(o.$anonymCommentWrapper.removeClass("addingAnonComment"),o.$anonymCommentPost.text(T.call(o,"Post"))),o.$newCommentWrapper.removeClass("addingComment"),h||(r&&(o.$commentsModal.removeClass("showAnonymWindow"),o.$newCommentCaptchaContainer.removeClass("error")),k.call(o)))}}))};o.$anonymCommentPost.on("click",function(){var e=o.$anonymCommenterNameInput.val(),t=o.$anonymCommenterEmailInput.val(),a=o.$anonymCommentInput.val(),i=!1,n=void 0;o.$anonymCommenterNameInput.attr("placeholder",T.call(o,"Name")),o.$anonymCommenterEmailInput.attr("placeholder",T.call(o,"Email")),o.$anonymCommentInput.attr("placeholder",T.call(o,"Write a comment")),o.$anonymCommenterNameInput.parent().removeClass("error"),o.$anonymCommenterEmailInput.parent().removeClass("error"),o.$anonymCommentInput.parent().removeClass("error"),e||(o.$anonymCommenterNameInput.attr("placeholder",T.call(o,"Please specify your name")).parent().addClass("error"),i=!0),t&&m.test(t)||(o.$anonymCommenterEmailInput.attr("placeholder",T.call(o,"Please specify your email")).parent().addClass("error"),i=!0),a||(o.$anonymCommentInput.attr("placeholder",T.call(o,"Please write a comment")).parent().addClass("error"),i=!0),o.options.comments.useReCaptcha&&0==(n=grecaptcha.getResponse(s)).length&&(o.$newCommentCaptchaContainer.addClass("error"),i=!0),i||(o.$anonymCommentWrapper.addClass("addingAnonComment"),o.$anonymCommentPost.text(T.call(o,"Commenting")),l(0,e,t,a,n,!0))}),o.$newCommentButton.on("click",l)}o.options.like.permissions.liking&&(o.$root.append('<span class="actions likeTrigger"><span>0</span></span>'),o.$likeTrigger=e("> .actions.likeTrigger",o.$root),o.$mainLikeCount=e("> span",o.$likeTrigger),o.$likeTrigger.on("click",function(){if(!o.$root.hasClass("initializing")){var t=o.currentItemIndex,a=o.items[t],i=!a.likes.likedByUser,s={portalId:o.options.portalId,moduleId:o.options.moduleId,mediaId:a.id};a.likes.likedByUser=i,i?a.likes.numOfLikes+=1:a.likes.numOfLikes>0&&(a.likes.numOfLikes-=1),o.$mainLikeCount.text(a.likes.numOfLikes),o.$likeTrigger.toggleClass("liked",i),"number"==typeof a.journalId?(s.action="like",s.journalid=a.journalId,s.liked=i):(s.action="media_like",s.vote=i?1:-1),e.ajax({data:s,dataType:"json",type:"POST",url:o.options.websiteRoot+"DesktopModules/EasyDNNGallery/Services/SocialMediaBox.ashx",timeout:1e4,cache:!1,error:function(){},success:function(){},complete:function(){}})}})),o.$root.appendTo(o.$body),o.main={horizontalSpace:0,verticalSpace:0},e.each(o.items,function(t){var a=e("<div />");a.addClass("loading item_"+t).data("itemIndex",t),"image"==this.type?a.addClass("imageItem"):"video"==this.type?a.addClass("videoItem"):"audio"==this.type&&a.addClass("audioItem"),a.appendTo(o.$contentWrapper)}),C.call(o),o.$root.addClass("show"),setTimeout(function(){$.call(o)},200);var c,p=new Hammer(e("> .mobileOverlay",o.$root)[0]);return o.skipGestures=!1,p.on("swipeleft swiperight panleft panright panend tap",function(e){var a=-o.currentItemIndex*o.overlayWidth,i=e.deltaX;if("tap"==e.type)return clearTimeout(c),void(o.$root.hasClass("hideControls")?o.$root.removeClass("hideControls fadeOutControls"):(o.$root.addClass("fadeOutControls"),c=setTimeout(function(){o.$root.addClass("hideControls")},500)));if(!o.skipGestures&&o.initialItemLoaded)if(("swipeleft"==e.type||"swiperight"==e.type)&&t.length>1)"swipeleft"==e.type&&(o.currentItemIndex<o.items.length-1?y.call(o):0==o.currentItemIndex&&I.call(o));else{if("panend"==e.type){if(0==o.currentItemIndex&&i>=0||o.currentItemIndex==o.items.length-1&&i<0||Math.abs(i)<o.overlayWidth/2)return void o.$contentWrapper.removeClass(r).addClass(n).css({transform:"translate3d("+a+"px, 0, 0)"});o.skipGestures=!0;var s=-o.overlayWidth,m=1;return i>0&&(s=o.overlayWidth,m=-1),s=a+s,o.$contentWrapper.addClass(n).removeClass(r).css({transform:"translate3d("+s+"px, 0, 0)"}),void setTimeout(function(){o.skipGestures=!1,o.currentItemIndex+=m,$.call(o)},550)}(0==o.currentItemIndex&&i>=0||o.currentItemIndex==o.items.length-1&&i<0)&&((i=1-Math.abs(i)/o.overlayWidth)<.5?(i=Math.round(o.overlayWidth/4),e.deltaX<1&&(i=-i)):i=Math.round(i*e.deltaX)),o.$contentWrapper.removeClass(n).removeClass(r).css({transform:"translate3d("+(a+i)+"px, 0, 0)"})}}),x.call(o),o}}L.prototype={center:function(){var e,t,a={},o=!1,i=0,s=0,n=!1,r=!1;if(this.initialItemLoaded){switch((e=this.items[this.currentItemIndex]).type){case"image":(t=this.images[e.src].stats).isLoaded?(i=t.width,s=t.height):(i=400,s=400);break;case"video":i=e.width,s=e.height,n=!0;break;case"audio":i=460,s=36,r=!0}a=p.call(this,i,s,n,r),o=!0}o||(a.width=this.$mainWrapper.width(),a.height=this.$mainWrapper.height(),a.left=Math.floor((this.overlayWidth-(a.width+this.main.horizontalSpace))/2),a.top=Math.floor((this.overlayHeight-(a.height+this.main.verticalSpace))/2)),this.$mainWrapper.stop(!0).css(a)},showItem:function(){var t=this;t.$imagesWrapper.removeClass("imageNotLoaded"),t.$loadingOverlay.addClass("inProgress").stop(!0).fadeTo(0,1,function(){t.$loadingOverlay.css("display","")}),t.$audioVideo.html(""),e("> .viewWrapper > div",t.$mainWrapper).removeClass("activeElement"),t.$mainWrapper.removeClass("audioItem").removeClass("videoItem").removeClass("imageItem");var a=t.items[t.currentItemIndex];switch(a.type){case"image":(function(t){var a,o,i=this.images[t.src].stats;i.preloadFinished&&(this.$mainWrapper.addClass("imageItem"),e("> img",this.$imagesWrapper).removeClass("activeElement").filter(".smbLightImage_"+t.id).addClass("activeElement"),i.isLoaded?(a=i.width,o=i.height):(a=400,o=400,this.$imagesWrapper.addClass("imageNotLoaded")),this.$imagesWrapper.addClass("activeElement"),d.call(this,p.call(this,a,o)))}).call(t,a);break;case"video":h.call(t,t.currentItemIndex);break;case"audio":u.call(t,a);break;default:t.initialItemLoaded=!0}t.initialItemLoaded&&t.$root.removeClass("initializing")}},M.prototype={center:function(){var t=this,a=0;t.options.comments.permissions.show&&((a=e(">",t.$commentsModal).height()-t.$commentsTopBar.outerHeight(!0)-t.$newCommentWrapper.outerHeight(!0))<0&&(a=0),t.$commentList.css("height",a)),t.$contentWrapper.removeClass(n).removeClass(r).css({width:t.items.length*t.overlayWidth,transform:"translate3d(-"+t.currentItemIndex*t.overlayWidth+"px, 0, 0)"}),e(">",t.$contentWrapper).width(t.overlayWidth).each(function(){var a=e(this),o=a.data("itemIndex"),i=t.items[o];if(!(a.hasClass("loading")||"image"!=i.type&&o!=t.currentItemIndex))if("image"==i.type){var s=t.images[i.src].stats;e("> img",a).css(p.call(t,s.width,s.height,!1))}else"video"==i.type?e("> div",a).css(p.call(t,i.width,i.height,!0)):"audio"==i.type&&e("> div",a).css(p.call(t,460,36,!1,!0))})},showItem:function(){var t=this,a=e("> div.item_"+t.currentItemIndex,t.$contentWrapper),i=t.currentItemIndex,s=t.items[i],m=function(){i>0&&l.call(t,g.call(t,i-1)),i<t.items.length-1&&l.call(t,g.call(t,i+1))};switch(t.$contentWrapper.removeClass(n).removeClass(r).css({transform:"translate3d(-"+i*t.overlayWidth+"px, 0, 0)"}),t.options.comments.permissions.show&&(t.$newCommentInput.val(""),t.$newCommentWrapper.removeClass("filledIn"),t.comments[s.id]||(t.comments[s.id]={state:{open:!1,commentsRequest:o},count:s.comments.count,cache:{authors:{},comments:[]}}),t.$mainCommentsCount.text(t.comments[s.id].count),t.desktopVersion&&(e.each(t.comments,function(){this.state.open=!1}),t.updateItemComments())),t.options.like.permissions.liking&&(t.$likeTrigger.toggleClass("liked",s.likes.likedByUser),t.$mainLikeCount.text(s.likes.numOfLikes)),s.type){case"image":if(a.data("initialized"))return;l.call(t,i,function(){t.currentItemIndex==i&&(t.initialItemLoaded=!0,m())}),a.data("initialized",!0);break;case"video":h.call(t,t.currentItemIndex);break;case"audio":u.call(t,s);break;default:t.initialItemLoaded=!0}"image"!=s.type&&m(),t.$root.removeClass("initializing")},updateItemComments:function(){var t=this,a=t.currentItemIndex,n=t.items[a],r=t.comments[n.id];r.state.open||t.$root.hasClass("initializing")||(r.state.open=!0,r.state.commentsRequest==o?(r.state.commentsRequest=i,t.$commentsModal.addClass("loading"),e.ajax({data:{action:"list_comments"},dataType:"json",type:"GET",url:n.comments.backend,timeout:15e3,cache:!1,error:function(){r.state.commentsRequest=o},success:function(e){r.cache=e,r.count=e.comments.length,r.state.commentsRequest=s},complete:function(){r.state.open&&a==t.currentItemIndex&&(t.$commentsModal.removeClass("loading"),k.call(t))}})):(k.call(t),t.$commentsModal.removeClass("loading")),t.$internalCommentsCount.text(r.count),t.$commentsLikes.text(n.likes.numOfLikes).toggleClass("liked",n.likes.likedByUser))},closeComments:function(){var e=this,t=e.items[e.currentItemIndex];e.comments[t.id].state.open=!1,e.desktopVersion?(clearTimeout(e.commentsAnimationTimeout),e.$root.addClass("moveComments"),e.$root.css("width",""),C.call(e),e.$root.addClass("animateComments").removeClass("moveComments"),e.commentsAnimationTimeout=setTimeout(function(){e.$root.removeClass("animateComments")},300)):(e.$root.removeClass("modalActive"),e.$modalOverlay.stop(!0).animate({opacity:0},{duration:200})),e.$commentsModal.removeClass("showAnonymWindow"),e.$anonymCommentWrapper.removeClass("addingAnonComment"),e.commentsOpened=!1}},t.SmbLight_1=function(e,t){return this instanceof SmbLight_1?t.mobile?new M(e,t):new L(e,t):new SmbLight_1(e,t)}}(eds2_2,window);
;;;/*! Hammer.JS - v2.0.4 - 2014-09-28
 * http://hammerjs.github.io/
 *
 * Copyright (c) 2014 Jorik Tangelder;
 * Licensed under the MIT license */
!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(k(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function h(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a}function i(a,b){return h(a,b,!0)}function j(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&h(d,c)}function k(a,b){return function(){return a.apply(b,arguments)}}function l(a,b){return typeof a==kb?a.apply(b?b[0]||d:d,b):a}function m(a,b){return a===d?b:a}function n(a,b,c){g(r(b),function(b){a.addEventListener(b,c,!1)})}function o(a,b,c){g(r(b),function(b){a.removeEventListener(b,c,!1)})}function p(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function q(a,b){return a.indexOf(b)>-1}function r(a){return a.trim().split(/\s+/g)}function s(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function t(a){return Array.prototype.slice.call(a,0)}function u(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];s(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function v(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g<ib.length;){if(c=ib[g],e=c?c+f:b,e in a)return e;g++}return d}function w(){return ob++}function x(a){var b=a.ownerDocument;return b.defaultView||b.parentWindow}function y(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){l(a.options.enable,[a])&&c.handler(b)},this.init()}function z(a){var b,c=a.options.inputClass;return new(b=c?c:rb?N:sb?Q:qb?S:M)(a,A)}function A(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&yb&&d-e===0,g=b&(Ab|Bb)&&d-e===0;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,B(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function B(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=E(b)),e>1&&!c.firstMultiple?c.firstMultiple=E(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=F(d);b.timeStamp=nb(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=J(h,i),b.distance=I(h,i),C(c,b),b.offsetDirection=H(b.deltaX,b.deltaY),b.scale=g?L(g.pointers,d):1,b.rotation=g?K(g.pointers,d):0,D(c,b);var j=a.element;p(b.srcEvent.target,j)&&(j=b.srcEvent.target),b.target=j}function C(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};(b.eventType===yb||f.eventType===Ab)&&(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function D(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Bb&&(i>xb||h.velocity===d)){var j=h.deltaX-b.deltaX,k=h.deltaY-b.deltaY,l=G(i,j,k);e=l.x,f=l.y,c=mb(l.x)>mb(l.y)?l.x:l.y,g=H(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function E(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:lb(a.pointers[c].clientX),clientY:lb(a.pointers[c].clientY)},c++;return{timeStamp:nb(),pointers:b,center:F(b),deltaX:a.deltaX,deltaY:a.deltaY}}function F(a){var b=a.length;if(1===b)return{x:lb(a[0].clientX),y:lb(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:lb(c/b),y:lb(d/b)}}function G(a,b,c){return{x:b/a||0,y:c/a||0}}function H(a,b){return a===b?Cb:mb(a)>=mb(b)?a>0?Db:Eb:b>0?Fb:Gb}function I(a,b,c){c||(c=Kb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function J(a,b,c){c||(c=Kb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function K(a,b){return J(b[1],b[0],Lb)-J(a[1],a[0],Lb)}function L(a,b){return I(b[0],b[1],Lb)/I(a[0],a[1],Lb)}function M(){this.evEl=Nb,this.evWin=Ob,this.allow=!0,this.pressed=!1,y.apply(this,arguments)}function N(){this.evEl=Rb,this.evWin=Sb,y.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function O(){this.evTarget=Ub,this.evWin=Vb,this.started=!1,y.apply(this,arguments)}function P(a,b){var c=t(a.touches),d=t(a.changedTouches);return b&(Ab|Bb)&&(c=u(c.concat(d),"identifier",!0)),[c,d]}function Q(){this.evTarget=Xb,this.targetIds={},y.apply(this,arguments)}function R(a,b){var c=t(a.touches),d=this.targetIds;if(b&(yb|zb)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=t(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return p(a.target,i)}),b===yb)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Ab|Bb)&&delete d[g[e].identifier],e++;return h.length?[u(f.concat(h),"identifier",!0),h]:void 0}function S(){y.apply(this,arguments);var a=k(this.handler,this);this.touch=new Q(this.manager,a),this.mouse=new M(this.manager,a)}function T(a,b){this.manager=a,this.set(b)}function U(a){if(q(a,bc))return bc;var b=q(a,cc),c=q(a,dc);return b&&c?cc+" "+dc:b||c?b?cc:dc:q(a,ac)?ac:_b}function V(a){this.id=w(),this.manager=null,this.options=i(a||{},this.defaults),this.options.enable=m(this.options.enable,!0),this.state=ec,this.simultaneous={},this.requireFail=[]}function W(a){return a&jc?"cancel":a&hc?"end":a&gc?"move":a&fc?"start":""}function X(a){return a==Gb?"down":a==Fb?"up":a==Db?"left":a==Eb?"right":""}function Y(a,b){var c=b.manager;return c?c.get(a):a}function Z(){V.apply(this,arguments)}function $(){Z.apply(this,arguments),this.pX=null,this.pY=null}function _(){Z.apply(this,arguments)}function ab(){V.apply(this,arguments),this._timer=null,this._input=null}function bb(){Z.apply(this,arguments)}function cb(){Z.apply(this,arguments)}function db(){V.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function eb(a,b){return b=b||{},b.recognizers=m(b.recognizers,eb.defaults.preset),new fb(a,b)}function fb(a,b){b=b||{},this.options=i(b,eb.defaults),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.element=a,this.input=z(this),this.touchAction=new T(this,this.options.touchAction),gb(this,!0),g(b.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function gb(a,b){var c=a.element;g(a.options.cssProps,function(a,d){c.style[v(c.style,d)]=b?a:""})}function hb(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var ib=["","webkit","moz","MS","ms","o"],jb=b.createElement("div"),kb="function",lb=Math.round,mb=Math.abs,nb=Date.now,ob=1,pb=/mobile|tablet|ip(ad|hone|od)|android/i,qb="ontouchstart"in a,rb=v(a,"PointerEvent")!==d,sb=qb&&pb.test(navigator.userAgent),tb="touch",ub="pen",vb="mouse",wb="kinect",xb=25,yb=1,zb=2,Ab=4,Bb=8,Cb=1,Db=2,Eb=4,Fb=8,Gb=16,Hb=Db|Eb,Ib=Fb|Gb,Jb=Hb|Ib,Kb=["x","y"],Lb=["clientX","clientY"];y.prototype={handler:function(){},init:function(){this.evEl&&n(this.element,this.evEl,this.domHandler),this.evTarget&&n(this.target,this.evTarget,this.domHandler),this.evWin&&n(x(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&o(this.element,this.evEl,this.domHandler),this.evTarget&&o(this.target,this.evTarget,this.domHandler),this.evWin&&o(x(this.element),this.evWin,this.domHandler)}};var Mb={mousedown:yb,mousemove:zb,mouseup:Ab},Nb="mousedown",Ob="mousemove mouseup";j(M,y,{handler:function(a){var b=Mb[a.type];b&yb&&0===a.button&&(this.pressed=!0),b&zb&&1!==a.which&&(b=Ab),this.pressed&&this.allow&&(b&Ab&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:vb,srcEvent:a}))}});var Pb={pointerdown:yb,pointermove:zb,pointerup:Ab,pointercancel:Bb,pointerout:Bb},Qb={2:tb,3:ub,4:vb,5:wb},Rb="pointerdown",Sb="pointermove pointerup pointercancel";a.MSPointerEvent&&(Rb="MSPointerDown",Sb="MSPointerMove MSPointerUp MSPointerCancel"),j(N,y,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=Pb[d],f=Qb[a.pointerType]||a.pointerType,g=f==tb,h=s(b,a.pointerId,"pointerId");e&yb&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Ab|Bb)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Tb={touchstart:yb,touchmove:zb,touchend:Ab,touchcancel:Bb},Ub="touchstart",Vb="touchstart touchmove touchend touchcancel";j(O,y,{handler:function(a){var b=Tb[a.type];if(b===yb&&(this.started=!0),this.started){var c=P.call(this,a,b);b&(Ab|Bb)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:tb,srcEvent:a})}}});var Wb={touchstart:yb,touchmove:zb,touchend:Ab,touchcancel:Bb},Xb="touchstart touchmove touchend touchcancel";j(Q,y,{handler:function(a){var b=Wb[a.type],c=R.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:tb,srcEvent:a})}}),j(S,y,{handler:function(a,b,c){var d=c.pointerType==tb,e=c.pointerType==vb;if(d)this.mouse.allow=!1;else if(e&&!this.mouse.allow)return;b&(Ab|Bb)&&(this.mouse.allow=!0),this.callback(a,b,c)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Yb=v(jb.style,"touchAction"),Zb=Yb!==d,$b="compute",_b="auto",ac="manipulation",bc="none",cc="pan-x",dc="pan-y";T.prototype={set:function(a){a==$b&&(a=this.compute()),Zb&&(this.manager.element.style[Yb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){l(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),U(a.join(" "))},preventDefaults:function(a){if(!Zb){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=q(d,bc),f=q(d,dc),g=q(d,cc);return e||f&&c&Hb||g&&c&Ib?this.preventSrc(b):void 0}},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var ec=1,fc=2,gc=4,hc=8,ic=hc,jc=16,kc=32;V.prototype={defaults:{},set:function(a){return h(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=Y(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=Y(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=Y(a,this),-1===s(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=Y(a,this);var b=s(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(c.options.event+(b?W(d):""),a)}var c=this,d=this.state;hc>d&&b(!0),b(),d>=hc&&b(!0)},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=kc)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(kc|ec)))return!1;a++}return!0},recognize:function(a){var b=h({},a);return l(this.options.enable,[this,b])?(this.state&(ic|jc|kc)&&(this.state=ec),this.state=this.process(b),void(this.state&(fc|gc|hc|jc)&&this.tryEmit(b))):(this.reset(),void(this.state=kc))},process:function(){},getTouchAction:function(){},reset:function(){}},j(Z,V,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(fc|gc),e=this.attrTest(a);return d&&(c&Bb||!e)?b|jc:d||e?c&Ab?b|hc:b&fc?b|gc:fc:kc}}),j($,Z,{defaults:{event:"pan",threshold:10,pointers:1,direction:Jb},getTouchAction:function(){var a=this.options.direction,b=[];return a&Hb&&b.push(dc),a&Ib&&b.push(cc),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&Hb?(e=0===f?Cb:0>f?Db:Eb,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Cb:0>g?Fb:Gb,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return Z.prototype.attrTest.call(this,a)&&(this.state&fc||!(this.state&fc)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=X(a.direction);b&&this.manager.emit(this.options.event+b,a),this._super.emit.call(this,a)}}),j(_,Z,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[bc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&fc)},emit:function(a){if(this._super.emit.call(this,a),1!==a.scale){var b=a.scale<1?"in":"out";this.manager.emit(this.options.event+b,a)}}}),j(ab,V,{defaults:{event:"press",pointers:1,time:500,threshold:5},getTouchAction:function(){return[_b]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Ab|Bb)&&!f)this.reset();else if(a.eventType&yb)this.reset(),this._timer=e(function(){this.state=ic,this.tryEmit()},b.time,this);else if(a.eventType&Ab)return ic;return kc},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===ic&&(a&&a.eventType&Ab?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=nb(),this.manager.emit(this.options.event,this._input)))}}),j(bb,Z,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[bc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&fc)}}),j(cb,Z,{defaults:{event:"swipe",threshold:10,velocity:.65,direction:Hb|Ib,pointers:1},getTouchAction:function(){return $.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Hb|Ib)?b=a.velocity:c&Hb?b=a.velocityX:c&Ib&&(b=a.velocityY),this._super.attrTest.call(this,a)&&c&a.direction&&a.distance>this.options.threshold&&mb(b)>this.options.velocity&&a.eventType&Ab},emit:function(a){var b=X(a.direction);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),j(db,V,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:2,posThreshold:10},getTouchAction:function(){return[ac]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime<b.time;if(this.reset(),a.eventType&yb&&0===this.count)return this.failTimeout();if(d&&f&&c){if(a.eventType!=Ab)return this.failTimeout();var g=this.pTime?a.timeStamp-this.pTime<b.interval:!0,h=!this.pCenter||I(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,h&&g?this.count+=1:this.count=1,this._input=a;var i=this.count%b.taps;if(0===i)return this.hasRequireFailures()?(this._timer=e(function(){this.state=ic,this.tryEmit()},b.interval,this),fc):ic}return kc},failTimeout:function(){return this._timer=e(function(){this.state=kc},this.options.interval,this),kc},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ic&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),eb.VERSION="2.0.4",eb.defaults={domEvents:!1,touchAction:$b,enable:!0,inputTarget:null,inputClass:null,preset:[[bb,{enable:!1}],[_,{enable:!1},["rotate"]],[cb,{direction:Hb}],[$,{direction:Hb},["swipe"]],[db],[db,{event:"doubletap",taps:2},["tap"]],[ab]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var lc=1,mc=2;fb.prototype={set:function(a){return h(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?mc:lc},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&ic)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===mc||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(fc|gc|hc)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof V)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(f(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(f(a,"remove",this))return this;var b=this.recognizers;return a=this.get(a),b.splice(s(b,a),1),this.touchAction.update(),this},on:function(a,b){var c=this.handlers;return g(r(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this},off:function(a,b){var c=this.handlers;return g(r(a),function(a){b?c[a].splice(s(c[a],b),1):delete c[a]}),this},emit:function(a,b){this.options.domEvents&&hb(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&gb(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},h(eb,{INPUT_START:yb,INPUT_MOVE:zb,INPUT_END:Ab,INPUT_CANCEL:Bb,STATE_POSSIBLE:ec,STATE_BEGAN:fc,STATE_CHANGED:gc,STATE_ENDED:hc,STATE_RECOGNIZED:ic,STATE_CANCELLED:jc,STATE_FAILED:kc,DIRECTION_NONE:Cb,DIRECTION_LEFT:Db,DIRECTION_RIGHT:Eb,DIRECTION_UP:Fb,DIRECTION_DOWN:Gb,DIRECTION_HORIZONTAL:Hb,DIRECTION_VERTICAL:Ib,DIRECTION_ALL:Jb,Manager:fb,Input:y,TouchAction:T,TouchInput:Q,MouseInput:M,PointerEventInput:N,TouchMouseInput:S,SingleTouchInput:O,Recognizer:V,AttrRecognizer:Z,Tap:db,Pan:$,Swipe:cb,Pinch:_,Rotate:bb,Press:ab,on:n,off:o,each:g,merge:i,extend:h,inherit:j,bindFn:k,prefixed:v}),typeof define==kb&&define.amd?define(function(){return eb}):"undefined"!=typeof module&&module.exports?module.exports=eb:a[c]=eb}(window,document,"Hammer");
//# sourceMappingURL=hammer.min.map
;;;