﻿!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);
;;;$(document).ready(function () {
    $("#menuBtn").click(function () {
        $("#menu").slideToggle();
    });

    if (matchMedia) {
        var mq = window.matchMedia("(min-width: 650px)");
        mq.addListener(WidthChange);
        WidthChange(mq);
    }

    // media query change
    function WidthChange(mq) {
        if (mq.matches) {
            $("#menu").show();
        } else {
            $("#menu").hide();
        }
    }

    // FOR ADA - 1.3.1 Info and Relationships - HTML is used to format content
    $('table').removeAttr('border').removeAttr('cellpadding').removeAttr('cellspacing').removeAttr('align').removeAttr('width');
    $('tr').removeAttr('valign');
    $('td').removeAttr('valign').removeAttr('align');
    $('img').removeAttr('align');
    $('iframe').removeAttr('align').removeAttr('frameborder').removeAttr('scrolling');


    // FOR ADA - 1.3.1 Info and Relationships - "u" tag used to format text
    $("u").replaceWith(function () { return "<span style='text-decoration: underline;'>" + this.innerHTML + "</span>"; });

    // FOR ADA - login page
    $('label#dnn_ctr2756_Login_Login_DNN_lblLogin').text('Login Here').addClass('hideLoginLabel');
    $('label#dnn_ctr2756_Login_Login_DNN_lblLoginRememberMe').text('Remember Login').addClass('hideLoginLabel');
    $('#dnn_ctr2756_Login_DNN > .dnnForm > .dnnFormItem:nth-child(5) > label').text('Reset Password').addClass('hideLoginLabel');
    $('.hideLoginLabel').css('visibility', 'hidden');

    // FOR ADA - calendar - old events module
    //$('#dnn_ctr463_Events_EventMonth_dpGoToDate_dateInput').attr('title', 'Select a Date');
    //$('#dnn_ctr463_Events_EventMonth_SelectLocation_ddlLocations_Input').attr('title', 'Select a Location');
    //$('#dnn_ctr463_Events_EventDetails_txtUserEmailiCal').attr('title', 'Email this Event');
    //$('#dnn_ctr463_Events_EventDetails_imgEmail').attr('alt', 'Email');
    //$('#dnn_ctr463_Events_EventDetails_cmdPrint img').attr('alt', 'Print');
    //$('a#dnn_ctr463_Events_EventDetails_cmdPrint').attr('href', '#').css('display', 'none');

    // FOR ADA - calendar - new EDN calendar
    $('td.day ul li a').each(function () {
        var aText = $(this).text().replace(/"|'/g,'');
        var aHref = $(this).attr('href');
        var aTitle = aText + "-" + aHref;
        $(this).attr('title', aTitle);
    });

    // FOR ADA - home gallery links
    setTimeout(function(){
        $('#M514 > a').each(function () {
            var imgAlt = $(this).find('img').attr('alt');
            $(this).attr('title', imgAlt);
        });
    }, 100);
});
;;;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();
;;;const defaultOptions = {
	fullscreenTitle: 'Fullscreen'
};

class EdssmbFullscreen {
	constructor( options) {
		this.options = {
			...defaultOptions,
			...options
		};
	}

	initPlugin() {
		this.fullscreenAPI = this.getFullscreenAPI();
	}

	toggleFullscreen() {
		if (this.fullscreenAPI) {
			if (this.fullscreenAPI.isFullscreen()) {
				this.fullscreenAPI.exit();
			} else {
				this.fullscreenAPI.request(document.querySelector(`.smbLightOverlayWrapper`));
			}
		}
	}

	getFullscreenAPI() {
		let api;
		let enterFS;
		let exitFS;
		let elementFS;
		let changeEvent;
		let errorEvent;

		if (document.fullscreenEnabled) {
			enterFS = 'requestFullscreen';
			exitFS = 'exitFullscreen';
			elementFS = 'fullscreenElement';
			changeEvent = 'fullscreenchange';
			errorEvent = 'fullscreenerror';
		} else if (document.webkitFullscreenEnabled) {
			enterFS = 'webkitRequestFullscreen';
			exitFS = 'webkitExitFullscreen';
			elementFS = 'webkitFullscreenElement';
			changeEvent = 'webkitfullscreenchange';
			errorEvent = 'webkitfullscreenerror';
		}
		if (enterFS) {
			api = {
				request: function (el) {
					if (enterFS === 'webkitRequestFullscreen') {
						el[enterFS](Element.ALLOW_KEYBOARD_INPUT);
					} else {
						el[enterFS]();
					}
				},
				exit: function () {
					return document[exitFS]();
				},
				isFullscreen: function () {
					return document[elementFS];
				},
				change: changeEvent,
				error: errorEvent
			};
		}
		return api;
	}
}
(function ($, window) {
	'use strict';

	var defaultOptions = {
			portalId: 0,
			moduleId: 0,
			tabId: 0,
			autoplayVideo: false,
			userLoggedIn: false,
			googleReCaptchaSiteKey: '',
			websiteRoot: '',
			portfolioMode:false,
			openAt: 0,
			wrapperResizeDuration: 200,
			flowplayerSwf: '',
			flowplayer: {
				key: '',
				logo: ''
			},
			socialButtons: {
				facebook: false,
				gplus: false,
				twitter: false,
				inshare: false,
				pinterest: false
			},
			cssClass: '',
			events: {
				onBeforeClose: function () {}
			},
			comments: {
				requireAuthorInfo: true,
				useReCaptcha: false,
				permissions: {
					show: false,
					commenting: false
				}
			},
			like: {
				permissions: {
					liking: false
				}
			},
			mobile: false,
			i18n: {}
		},
		sdssmbFullscreen = new EdssmbFullscreen(),
		ajaxState = {
			UNSET: 0,
			SENT: 1,
			DONE: 2
		},

		activeClass = 'activeElement',
		imageNotLoadedClass = 'imageNotLoaded',
		smbLightBodyClass = 'smbLightFixed',

		audioItemTypeClass = 'audioItem',
		videoItemTypeClass = 'videoItem',
		imageItemTypeClass = 'imageItem',
		positionAnimationClass = 'positionAnimation',
		swipeAnimationClass = 'swipeAnimation',
		itemDomInitKey = 'initialized',

		emailVerification = /^(([^<>()[\]\\.,;:\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,}))$/,

		preloadImage = function (itemIndex, callback) {
			var self = this,
				item = self.items[itemIndex];

			if (item.type != 'image')
				return;

			var imageMeta = self.images[item.src];

			if (imageMeta) {
				if (typeof callback == 'function') {
					if (imageMeta.stats.preloadFinished)
						callback(imageMeta.stats);
					else
						imageMeta.callbacks.push(callback);
				}

				return;
			}

			imageMeta = self.images[item.src] = {
				callbacks: [],
				stats: {
					preloadFinished: false,
					isLoaded: false,
					width: 0,
					height: 0
				}
			};

			if (typeof callback == 'function')
				imageMeta.callbacks.push(callback);

			var $img = $('<img class="smbLightImage_' + item.id + '" alt="'+item.altTag +'" />');

			$img.imagesLoaded()
				.progress(function(instance, imageInfo) {
					if (self.viewClosed)
						return;

					var imageMeta = self.images[item.src];

					imageMeta.stats.preloadFinished = true;
					imageMeta.stats.isLoaded = imageInfo.isLoaded;

					if (!self.smbPlus && imageInfo.isLoaded)
						self.$imagesWrapper.append($img);

					imageMeta.stats.width = $img.width();
					imageMeta.stats.height = $img.height();

					if (self.smbPlus) {
						$img.css(getItemDimensions.call(self, imageMeta.stats.width, imageMeta.stats.height, false));

						$img.parent().removeClass('loading');
					} else {
						var currentItem = self.items[self.currentItemIndex];

						if (currentItem.type == 'image' && currentItem.src == item.src) {
							self.initialItemLoaded = true;
							showItem.call(self);
						}
					}

					$img = null;

					for (var i = 0, l = imageMeta.callbacks.length; i < l; i++) {
						imageMeta.callbacks[i](imageMeta.stats);
					}
				});

			if (self.smbPlus) {
				$img.appendTo($('> div.item_' + itemIndex, self.$contentWrapper));
			}

			$img.attr('src', item.src);
		},

		preloadImages = function () {
			var self = this,
				i = 0,
				numberOfItems = self.items.length;

			for (; i < numberOfItems; i++) {
				preloadImage.call(self, i);
			};
		},

		getItemDimensions = function (itemWidth, itemHeight, maximizeDimensions, fixedHeight) {
			var self = this,

				containerRatio,
				itemRatio,

				maxItemWidth = self.overlayWidth - self.main.horizontalSpace,
				maxItemHeight = self.overlayHeight - self.main.verticalSpace,
				displayWidth = itemWidth,
				displayHeight = itemHeight;

			if (maximizeDimensions || itemWidth > maxItemWidth || itemHeight > maxItemHeight) {
				containerRatio = maxItemWidth / maxItemHeight;
				itemRatio = itemWidth / itemHeight;

				displayWidth = maxItemWidth;
				displayHeight = maxItemHeight;

				if (itemRatio < containerRatio) {
					displayWidth = Math.round(maxItemHeight / itemHeight * itemWidth);
				} else if (itemRatio > containerRatio) {
					displayHeight = Math.round(maxItemWidth / itemWidth * itemHeight);
				}
			}

			if (fixedHeight)
				displayHeight = itemHeight;

			return {
				width: displayWidth,
				height: displayHeight,
				top: Math.floor((maxItemHeight - displayHeight) / 2),
				left: Math.floor((maxItemWidth - displayWidth) / 2)
			};
		},

		setItemDimensions = function (itemDimensions) {
			var self = this,

				resizeFinished = function () {
					self.$loadingOverlay
						.stop(true)
						.fadeTo(200, 0, function () {
							self.$loadingOverlay.css('display', 'none');
						});

					setItemInfo.call(self);
				},

				doResize = function (properties, complete) {
					if (self.options.wrapperResizeDuration == 0) {
						self.$mainWrapper.css(properties);
						complete();
					} else {
						self.$mainWrapper
							.stop(true)
							.animate(
								properties,
								{
									duration: self.options.wrapperResizeDuration,
									complete: function () {
										self.$mainWrapper.css('overflow', '');
										complete();
									}
								}
							);
					}
				},

				resizeHeight = function () {
					if (self.$mainWrapper.height() != itemDimensions.height)
						doResize(
							{
								height: itemDimensions.height,
								top: itemDimensions.top
							},
							resizeFinished
						);
					else
						resizeFinished();
				};

			self.$loadingOverlay.removeClass('inProgress');

			if (self.$mainWrapper.width() != itemDimensions.width)
				doResize(
					{
						width: itemDimensions.width,
						left: itemDimensions.left
					},
					resizeHeight
				);
			else
				resizeHeight();
		},

		showImage = function (currentItem) {
			var self = this,
				imageInfo = self.images[currentItem.src].stats,
				width,
				height;

			if (!imageInfo.preloadFinished)
				return;

			self.$mainWrapper.addClass(imageItemTypeClass);

			$('> img', self.$imagesWrapper)
				.removeClass(activeClass)
				.filter('.smbLightImage_' + currentItem.id)
					.addClass(activeClass);

			if (imageInfo.isLoaded) {
				width = imageInfo.width;
				height = imageInfo.height;
			} else {
				width = 400;
				height = 400;

				self.$imagesWrapper.addClass(imageNotLoadedClass);
			}

			self.$imagesWrapper.addClass(activeClass);

			setItemDimensions.call(
				self,
				getItemDimensions.call(self, width, height)
			);
		},

		showVideo = function (currentItemIndex) {
			var self = this,
				videoHtml = '',
				videoType = '',
				currentItem = self.items[currentItemIndex];

			if (!self.smbPlus)
				self.$mainWrapper.addClass(videoItemTypeClass);

			switch (currentItem.source) {
			case 'youtube':
				videoHtml = '<iframe src="//www.youtube.com/embed/' +
					currentItem.videoId + (self.options.autoplayVideo ? '?autoplay=1' : '') +
					'" frameborder="0" allowfullscreen></iframe>';
				break;

			case 'vimeo':
				videoHtml = '<iframe src="//player.vimeo.com/video/' +
					currentItem.videoId + (self.options.autoplayVideo ? '?autoplay=1' : '') +
					'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
				break;

			case 'wistia':
				videoHtml = '<iframe name="wistia_embed" src="//fast.wistia.net/embed/iframe/' +
					currentItem.videoId +
					'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
				break;
				case 'facebook':
					videoHtml = currentItem.src;
					break;
			case 'flowplayer':
				if (stringEndsWith(currentItem.src, '.mp4')) {
					videoType = 'video/mp4';
				} else if (stringEndsWith(currentItem.src, '.webm')) {
					videoType = 'video/webm';
				} else if (stringEndsWith(currentItem.src, '.ogg')) {
					videoType = 'video/ogg';
				} else if (stringEndsWith(currentItem.src, '.flv')) {
					videoType = 'video/flash';
				}

				videoHtml = '<div class="flowplayerContainer"></div>';
			}

			var $playerContainer = self.$audioVideo;

			if (self.smbPlus) {
				if (currentItem.source != 'flowplayer')
					videoHtml = '<div>' + videoHtml + '</div>';

				$playerContainer = $('> div.item_' + self.currentItemIndex, self.$contentWrapper);
			} else
				$playerContainer.addClass(activeClass);

			$playerContainer
				.html(videoHtml)
				.removeClass('loading');

			if (currentItem.source == 'flowplayer')
				$('> .flowplayerContainer', $playerContainer)
					.flowplayer({
						swf: self.options.flowplayerSwf,
						ratio: currentItem.height / currentItem.width,
						autoplay: self.options.autoplayVideo,
						tooltip: false,
						embed: false,
						clip: {
							sources: [
								{
									type: videoType,
									src: currentItem.src
								}
							]
						},
						key: self.options.flowplayer.key,
						logo: self.options.flowplayer.logo
					});

			var playerCss = getItemDimensions.call(self, currentItem.width, currentItem.height, true);

			if (self.smbPlus)
				$('>', $playerContainer).css(playerCss);
			else
				setItemDimensions.call(
					self,
					playerCss
				);

			self.initialItemLoaded = true;
		},

		showAudio = function (currentItem) {
			var self = this;

			if (!self.smbPlus)
				self.$mainWrapper.addClass(audioItemTypeClass);

			var $playerContainer = self.$audioVideo,
				audioHtml = '<audio src="' + currentItem.src + '" />',
				selector = '> audio';

			if (self.smbPlus) {
				audioHtml = '<div>' + audioHtml + '</div>';
				selector = '> div > audio';
				$playerContainer = $('> div.item_' + self.currentItemIndex, self.$contentWrapper);
			} else
				$playerContainer.addClass(activeClass);

			$playerContainer
				.html(audioHtml)
				.removeClass('loading');

			audiojs.create($(selector, $playerContainer)[0]);

			var playerCss = getItemDimensions.call(self, 460, 36, false, true);

			if (self.smbPlus)
				$('>', $playerContainer).css(playerCss);
			else
				setItemDimensions.call(
					self,
					playerCss
				);

			self.initialItemLoaded = true;
		},

		setItemInfo = function () {
			var self = this,
				currentItem = self.items[self.currentItemIndex];

			if (typeof currentItem.title == 'string' && currentItem.title != '')
				self.$itemTitle
					.html(currentItem.title)
					.stop(true)
					.fadeTo(200, 1);

			if (
				(
					self.options.socialButtons.facebook
					|| self.options.socialButtons.twitter
					|| self.options.socialButtons.gplus
					|| self.options.socialButtons.inshare
					|| (self.options.socialButtons.pinterest && currentItem.type == 'image')
				)
				&& typeof currentItem.socialUrl == 'string'
				&& currentItem.socialUrl != ''
			)
				self.$socialButtonsTrigger.css('display', '');
			else
				self.$socialButtonsTrigger.css('display', 'none');
		},

		validItemIndex = function (index) {
			var numberOfItems = this.items.length;

			if (index < 0)
				index = numberOfItems - 1;
			else if (index >= numberOfItems)
				index = 0;

			return index;
		},

		showItem = function () {
			var self = this;

			self.$itemTitle
				.text('')
				.stop(true)
				.fadeTo(0, 0);

			self.$socialButtonsTrigger.removeClass('show');
			self.$socialButtonsWrapper
				.removeClass('show')
				.html('');

			self.currentItemIndex = validItemIndex.call(self, self.currentItemIndex);

			self.$root.removeClass('firstItem lastItem');

			if (self.currentItemIndex === 0)
				self.$root.addClass('firstItem');

			if (self.currentItemIndex === self.items.length - 1)
				self.$root.addClass('lastItem');

			if (self.smbPlus) {
				var prevItemIndex = validItemIndex.call(self, self.currentItemIndex - 1),
					nextItemIndex = validItemIndex.call(self, self.currentItemIndex + 1);

				$(
					'> div.videoItem.item_' + prevItemIndex + ',' +
					'> div.audioItem.item_' + prevItemIndex + ',' +
					'> div.videoItem.item_' + nextItemIndex + ',' +
					'> div.audioItem.item_' + nextItemIndex,
					self.$contentWrapper
				)
					.html('');

				setItemInfo.call(self);
			}

			var item = self.items[self.currentItemIndex],
				itemTypeClass = 'imageActive';

			if (item.type == 'video')
				itemTypeClass = 'videoActive';
			else if (item.type == 'audio')
				itemTypeClass = 'audioActive';

			self.$root
				.removeClass('imageActive videoActive audioActive')
				.addClass(itemTypeClass);

			self.showItem();
		},

		size = function () {
			var self = this;

			if (self.smbPlus) {
				var windowHeight = self.$window.height();

				if (window.innerHeight)
					windowHeight = window.innerHeight;

				windowHeight += 1;

				self.$root.height(windowHeight);
				self.overlayWidth = self.$root.width();
				self.overlayHeight = windowHeight;
			} else {
				self.overlayWidth = self.$contentWrapper.width();
				self.overlayHeight = self.$contentWrapper.height();
			}

			self.center();
		},

		swipe = function (indexModifier) {
			var self = this;

			if (
				self.skipGestures ||
				indexModifier == -1 && self.currentItemIndex == 0 ||
				indexModifier == 1 && self.currentItemIndex == this.items.length - 1
			)
				return;

			self.skipGestures = true;

			var newX = - self.currentItemIndex * self.overlayWidth;

			if (indexModifier == 1)
				newX -= self.overlayWidth;
			else
				newX += self.overlayWidth;

			self.$contentWrapper
				.removeClass(positionAnimationClass)
				.addClass(swipeAnimationClass)
				.css({
					transform: 'translate3d(' + newX + 'px, 0, 0)'
				});

			setTimeout(function () {
				self.currentItemIndex += indexModifier;
				showItem.call(self);

				self.skipGestures = false;
			}, 250);
		},

		showPrevItem = function () {
			var self = this;

			if (!self.initialItemLoaded)
				return;

			if (self.smbPlus) {
				swipe.call(self, -1);

				return;
			}

			self.currentItemIndex -= 1;
			showItem.call(self);
		},

		showNextItem = function () {
			var self = this;

			if (!self.initialItemLoaded)
				return;

			if (self.smbPlus) {
				swipe.call(self, 1);

				return;
			}

			self.currentItemIndex += 1;
			showItem.call(self);
		},

		close = function () {
			var self = this;

			if (
				typeof self.options.events.onBeforeClose == 'function' &&
				self.options.events.onBeforeClose({
					activeItem: self.currentItemIndex,
					displayItems: self.items
				}) === false
			)
				return;

			self.$document.off('.smbLightEvent');
			self.$window.off('.smbLightEvent');

			self.viewClosed = true;

			self.$root
				.stop(true)
				.fadeOut(200, function () {
					self.$root.remove();

					self.$body.removeClass(smbLightBodyClass);
				});

			if (self.smbPlus) {
				if (self.oldViewportMetaContent === undefined)
					self.$viewportMeta.remove();
				else
					self.$viewportMeta.attr('content', self.oldViewportMetaContent);

				if (self.oldIeTapHighlight === undefined)
					self.$ieTapHighlight.remove();
				else
					self.$ieTapHighlight.attr('content', self.oldIeTapHighlight);
			}
		},

		inFullscreenMode = function () {
			if (document.fullscreenElement && document.fullscreenElement != null)
				return true;
			else if (document.mozFullScreenElement && document.mozFullScreenElement != null)
				return true;
			else if (document.webkitFullscreenElement && document.webkitFullscreenElement != null)
				return true;

			return false;
		},

		eventListener = function (events, callback) {
			var el = this,
				registerEvent = function (ev) {
					if (el.addEventListener)
						el.addEventListener(ev, callback, false);
					else if (el.attachEvent)
						el.attachEvent(ev, callback);
				},
				eventsArray,
				i,
				l;

			if (events.indexOf(' ') == -1) {
				registerEvent(events);
				return;
			}

			eventsArray = events.split(' ');
			i = 0;
			l = eventsArray.length;

			for (; i < l; i++) {
				if (eventsArray[i] == '')
					break;

				registerEvent(eventsArray[i])
			}
		},

		stringEndsWith = function (s, e) {
			return s.indexOf(e, s.length - e.length) !== -1;
		},

		updateCommentsUi = function () {
			var self = this,
				currentItem = self.items[self.currentItemIndex],
				itemCommentMeta = self.comments[currentItem.id],
				commentsHtml = '';

			self.$mainCommentsCount.text(itemCommentMeta.count);
			self.$internalCommentsCount.text(itemCommentMeta.count);

			if (itemCommentMeta.cache.comments.length == 0) {
				self.$commentList.html('');
				self.$commentsModal.addClass('noComments');

				return;
			}

			self.$commentsModal.removeClass('noComments');

			$.each(itemCommentMeta.cache.comments, function () {
				var author = itemCommentMeta.cache.authors[this.author],
					encodedAuthorUrl = encodeURI(author.url),
					commentHtml =
						'<li>' +
							'<a class="authorAvatar" href="' + encodedAuthorUrl + '"><img src="' + encodeURI(author.avatar) + '" alt="" /></a>'+
							'<a class="author" href="' + encodedAuthorUrl + '">' + $('<p />').text(author.name).html() + '</a>' +
							'<div>' + this.content + '</div>' +
							'<p class="datetime">' + this.dateHtml + '</p>' +
						'</li>';

				if (self.commentSorting == 'asc')
					commentsHtml += commentHtml;
				else
					commentsHtml = commentHtml + commentsHtml;
			});

			self.$commentList.html(commentsHtml);
		},

		initEnviroment = function (items, options) {
			var self = this;

			self.$body = $('body');

			if (self.$body.hasClass(smbLightBodyClass) || items.length == 0)
				return false;

			self.$body.addClass(smbLightBodyClass);

			self.$window = $(window);
			self.$document = $(document);
			self.initialItemLoaded = false;
			self.viewClosed = false;
			self.items = items;
			self.options = $.extend(true, {}, defaultOptions, options);

			self.currentItemIndex = self.options.openAt;

			if (self.currentItemIndex < 0 || self.currentItemIndex >= items.length)
				self.currentItemIndex = 0;

			self.images = {};

			return true;
		},

		postInit = function () {
			var self = this;

			self.$window
				.on('resize.smbLightEvent', function () {
					if (self.comments) {
						var currentItem = self.items[self.currentItemIndex],
							itemCommentMeta = self.comments ? self.comments[currentItem.id] : undefined;

						if (self.desktopVersion && itemCommentMeta && itemCommentMeta.state.open)
							self.$root.width(self.$window.width() - self.$commentsModal.outerWidth(true));
					}
					size.call(self);
				});

			self.$document
				.on('keyup.smbLightEvent', function(e) {
					switch (e.keyCode) {
					case 37:
						showPrevItem.call(self);
						break;

					case 39:
						showNextItem.call(self);
						break;

					case 27:
						if (self.commentsOpened) {
							self.closeComments();
							return false;
						}

						close.call(self);
						break;

					default:
					}

					return false;
				});

			self.$root
				.on('click', '.navigation', function () {
					if (self.$root.hasClass('initializing'))
						return;

					if ($(this).hasClass('prev'))
						showPrevItem.call(self);
					else
						showNextItem.call(self);
				})
				.on('click', '.close', function () {
					close.call(self);
				});

			self.$socialButtonsTrigger.on('click', function () {

				if (self.$root.hasClass('initializing'))
					return;

				var currentItem = self.items[self.currentItemIndex];

				var encodedUri = encodeURIComponent(currentItem.socialUrl);
				var escapedTitle = '';
				var encodedTitle = '';
				var twitterTitle = '';

				if (typeof currentItem.title == 'string' && currentItem.title != '') {
					twitterTitle = escapedTitle = currentItem.title
						.replace(/&/g, '&amp;')
						.replace(/"/g, '&quot;')
						.replace(/'/g, '&#39;')
						.replace(/</g, '&lt;')
						.replace(/>/g, '&gt;');

					twitterTitle += ' ' + currentItem.socialUrl
						.replace(/&/g, '&amp;')
						.replace(/"/g, '&quot;')
						.replace(/'/g, '&#39;')
						.replace(/</g, '&lt;')
						.replace(/>/g, '&gt;');

					encodedTitle = encodeURIComponent(currentItem.title);
				}

				if (currentItem.title == '' || currentItem.title == undefined || !currentItem.title) {
					twitterTitle = escapedTitle = ''
						.replace(/&/g, '&amp;')
						.replace(/"/g, '&quot;')
						.replace(/'/g, '&#39;')
						.replace(/</g, '&lt;')
						.replace(/>/g, '&gt;');

					twitterTitle += ' ' + currentItem.socialUrl
						.replace(/&/g, '&amp;')
						.replace(/"/g, '&quot;')
						.replace(/'/g, '&#39;')
						.replace(/</g, '&lt;')
						.replace(/>/g, '&gt;');

					encodedTitle = '';
				}

				var socialButtonsHtml = '';

				if (self.options.socialButtons.facebook)
					socialButtonsHtml = '<div><iframe src="//www.facebook.com/plugins/like.php?href=' + encodedUri + '&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>';

				if (self.options.socialButtons.twitter)
					socialButtonsHtml += '<div><a href="//twitter.com/share" class="twitter-share-button" data-url="' + encodedUri + '" data-text="' + twitterTitle + '">Tweet</a><script type="text/javascript">twttr.widgets.load();</script></div>';

				if (self.options.socialButtons.inshare)
					socialButtonsHtml += '<div><script type="IN/Share" data-url="' + currentItem.socialUrl + '" data-counter="right"></script><script type="text/javascript">if (IN.parse) IN.parse();</script></div>';

				if (self.options.socialButtons.pinterest && currentItem.type == 'image')
					socialButtonsHtml += '<div><a href="//www.pinterest.com/pin/create/button/?url=' + encodedUri + '&media=' + encodeURIComponent(currentItem.src) + '&description=' + encodedTitle + '" data-pin-do="buttonPin" data-pin-config="beside"><img src="//assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png" /></a></div>';

				if (socialButtonsHtml == '')
					return;

				self.$socialButtonsWrapper
					.toggleClass('show')
					.html(socialButtonsHtml);

				if (self.options.socialButtons.pinterest && currentItem.type == 'image')
					$.ajax({url: '//assets.pinterest.com/js/pinit.js', dataType: 'script', cache: true});

				$(this).toggleClass('show');
			});

			if (self.$fullScreenTrigger) {
				self.$fullScreenTrigger.on('click', function () {


					sdssmbFullscreen.toggleFullscreen();
					return;
				})
			}
		},

		_ = function (s) {
			var self = this,
				translation = self.options.i18n[s];

			if (!translation)
				return s;

			return translation;
		};

	function Standard (items, options) {
		var self = this,
			currentItem,
			controlsHtml = '';

		if (!initEnviroment.call(self, items, options))
			return;

		self.$root = $('<div class="smbLightOverlayWrapper initializing"><div class="contentWrapper"></div></div>');
		self.$root.addClass(self.options.cssClass);

		self.$contentWrapper = $('> div.contentWrapper', self.$root);

		if (items.length > 1)
			controlsHtml = '<span class="navigation prev"><span></span></span>' +
				'<span class="navigation next"><span></span></span>';

		controlsHtml += '<span class="close"><span></span></span>' +
			'<div class="socialButtonsWrapper"></div>' +
			'<span class="actions socialButtonsTrigger"><span>' + _.call(self, 'Share') + '</span></span>';

		self.$mainWrapper = $(
			'<div class="mainWrapper">' +
				'<div class="viewWrapper">' +
					'<div class="images"><p>' + _.call(self, 'This image is currently unavailable') + '</p></div>' +
					'<div class="audioVideo"></div>' +
				'</div>' +
				controlsHtml +
			'</div>'
		)
			.appendTo(self.$contentWrapper);

		self.$itemTitle = $('<h2 class="itemTitle" />').appendTo(self.$mainWrapper);
		self.$loadingOverlay = $('<div class="loadingOverlay inProgress"></div>').appendTo(self.$mainWrapper);
		self.$imagesWrapper = $('> .viewWrapper > .images', self.$mainWrapper);
		self.$audioVideo = $('> .viewWrapper > .audioVideo', self.$mainWrapper);
		self.$socialButtonsWrapper = $('.socialButtonsWrapper', self.$mainWrapper);
		self.$socialButtonsTrigger = $('.socialButtonsTrigger', self.$mainWrapper);

		currentItem = self.items[self.currentItemIndex];
		if (currentItem.type == 'image') {
			preloadImage.call(
				self,
				self.currentItemIndex,
				function () {
					preloadImages.call(self);
				}
			);
		} else {
			preloadImages.call(self);
		}

		self.$root.appendTo(self.$body);

		self.main = {
			horizontalSpace: self.$mainWrapper.outerWidth(true) - self.$mainWrapper.width(),
			verticalSpace: self.$mainWrapper.outerHeight(true) - self.$mainWrapper.height()
		};

		size.call(self);

		self.$root
			.fadeTo(
				200,
				1,
				function () {
					if (currentItem.type == 'image')
						return;

					showItem.call(self);
				}
			);

		postInit.call(self);

		return self;
	}

	Standard.prototype = {
		center: function () {
			var self = this,
				css = {},
				currentItem,
				imageInfo,
				dimensionsSet = false,

				width = 0,
				height = 0,
				maximizeItem = false,
				fixedHeight = false;

			if (self.initialItemLoaded) {
				currentItem = self.items[self.currentItemIndex];

				switch (currentItem.type) {
				case 'image':
					imageInfo = self.images[currentItem.src].stats;

					if (imageInfo.isLoaded) {
						width = imageInfo.width;
						height = imageInfo.height;
					} else {
						width = 400;
						height = 400;
					}
					break;

				case 'video':
					width = currentItem.width;
					height = currentItem.height;
					maximizeItem = true;
					break;

				case 'audio':
					width = 460;
					height = 36;
					fixedHeight = true;
					break;
				}

				css = getItemDimensions.call(self, width, height, maximizeItem, fixedHeight);

				dimensionsSet = true;
			}

			if (!dimensionsSet) {
				css.width = self.$mainWrapper.width();
				css.height = self.$mainWrapper.height();

				css.left = Math.floor((self.overlayWidth - (css.width + self.main.horizontalSpace)) / 2);
				css.top = Math.floor((self.overlayHeight - (css.height + self.main.verticalSpace)) / 2);
			}

			self.$mainWrapper
				.stop(true)
				.css(css);
		},
		showItem: function () {
			var self = this;

			self.$imagesWrapper.removeClass(imageNotLoadedClass);

			self.$loadingOverlay
				.addClass('inProgress')
				.stop(true)
				.fadeTo(0, 1, function () {
					self.$loadingOverlay.css('display', '');
				});

			self.$audioVideo.html('');

			$('> .viewWrapper > div', self.$mainWrapper).removeClass(activeClass);

			self.$mainWrapper
				.removeClass(audioItemTypeClass)
				.removeClass(videoItemTypeClass)
				.removeClass(imageItemTypeClass);

			var currentItem = self.items[self.currentItemIndex];

			switch (currentItem.type) {
			case 'image':
				showImage.call(self, currentItem);
				break;

			case 'video':
				showVideo.call(self, self.currentItemIndex);
				break;

			case 'audio':
				showAudio.call(self, currentItem);
				break;

			default:
				self.initialItemLoaded = true;
			}

			if (self.initialItemLoaded)
				self.$root.removeClass('initializing');
		}
	};

	function Mobile (items, options) {
		var self = this,
			currentItem,
			touch = {
				newTouch: false,
				startX: 0
			},
			controlsHtml = '';

		self.smbPlus = true;

		if (!initEnviroment.call(self, items, options))
			return;

		self.options.wrapperResizeDuration = 0;

		self.$viewportMeta = $('meta[name="viewport"]');
		self.oldViewportMetaContent = undefined;

		if (self.$viewportMeta.length > 0) {
			self.oldViewportMetaContent = self.$viewportMeta.attr('content');
			self.$viewportMeta.attr('content', 'user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1');
		} else
			self.$viewportMeta = $('<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1" />').appendTo($('head'));

		self.$ieTapHighlight = $('meta[name="msapplication-tap-highlight"]');
		self.oldIeTapHighlight = undefined;

		if (self.$ieTapHighlight.length > 0) {
			self.oldIeTapHighlight = self.$ieTapHighlight.attr('content');
			self.$ieTapHighlight.attr('content', 'no');
		} else
			self.$ieTapHighlight = $('<meta name="msapplication-tap-highlight" content="no" />').appendTo($('head'));

		self.$root = $(
			'<div class="smbLightOverlayWrapper smbPlus initializing">' +
				'<div class="contentWrapper"></div>' +
			'</div>'
		)
			.addClass(self.options.cssClass);

		if (!/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())) {
			self.$root.addClass('desktopUserAgent');
			self.desktopVersion = true;
		}

		self.$contentWrapper = $('> div.contentWrapper', self.$root);

		controlsHtml = '<div class="mobileOverlay"></div><div class="modalOverlay"></div>';

		if (items.length > 1)
			controlsHtml += '<span class="navigation prev"><span></span></span>' +
				'<span class="navigation next"><span></span></span>';

		controlsHtml += '<span class="close"><span></span></span>' +
			'<div class="socialButtonsWrapper"></div>' +
			'<span class="actions socialButtonsTrigger"><span>' + _.call(self, 'Share') + '</span></span>';
		sdssmbFullscreen.initPlugin();
		if (sdssmbFullscreen.fullscreenAPI) {
			controlsHtml += '<span class="close"><span></span></span>' +
				'<span class="actions fullScreenTrigger"><span>' + _.call(self, 'Fullscreen') + '</span></span>';
		}
		self.$root.append(controlsHtml);

		self.$itemTitle = $('<h2 class="itemTitle" />').appendTo(self.$root);
		self.$socialButtonsWrapper = $('.socialButtonsWrapper', self.$root);
		self.$socialButtonsTrigger = $('.socialButtonsTrigger', self.$root);
		self.$fullScreenTrigger = $('.fullScreenTrigger', self.$root);
		self.$modalOverlay = $('> .modalOverlay', self.$root);

		if (self.options.comments.permissions.show) {
			self.comments = {};
			self.$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">' + _.call(self, 'Sort') + '</span>' +
						'</div>' +
						'<ul></ul>' +
						'<p class="noComments">' + _.call(self, 'No comments yet') + '</p>' +
						'<div class="newCommentWrapper">' +
							'<textarea placeholder="' + _.call(self, 'Write a comment') + '"></textarea>' +
							'<button>' + _.call(self, 'Post') + '</button>' +
						'</div>' +
					'</div>' +
					'<div class="anonymCommentWrapper">' +
						'<p>' + _.call(self, 'Add a comment') + '</p>' +
						'<div class="authorName"><input type="text" placeholder="' + _.call(self, 'Name') + '" /></div>' +
						'<div class="authorEmail"><input type="text" placeholder="' + _.call(self, 'Email') + '" /></div>' +
						'<div class="authorTextarea"><textarea placeholder="' + _.call(self, 'Write a comment') + '"></textarea></div>' +
						(self.options.comments.requireAuthorInfo && self.options.comments.useReCaptcha
							? '<div class="captchaContainer"><p class="captchaError">' + _.call(self, 'Please solve the test correctly.') + '</p><div class="captcha"></div></div>'
							: ''
						) +
						'<div class="actions"><button class="cancel">' + _.call(self, 'Cancel') + '</button><button class="post">' + _.call(self, 'Post') + '</button></div>' +
					'</div>' +
					'<span class="closeComments">' + _.call(self, 'Hide') + '</span>' +
					'<p class="loading">' + _.call(self, 'Loading comments') + '</p>' +
				'</div>'
			);
			self.$commentsTrigger = $('> .actions.commentsTrigger', self.$root);
			self.$mainCommentsCount = $('> span', self.$commentsTrigger);
			self.$commentsModal = $('> .commentsModalWrapper', self.$root);
			self.$commentsMainWrapper = $('> .main', self.$commentsModal);
			self.$newCommentWrapper = $('> .newCommentWrapper', self.$commentsMainWrapper);
			self.$newCommentInput = $('> textarea', self.$newCommentWrapper);
			self.$newCommentButton = $('> button', self.$newCommentWrapper);
			self.$commentsTopBar = $('> .top', self.$commentsMainWrapper);
			self.$internalCommentsCount = $('> .comments', self.$commentsTopBar);
			self.$commentsLikes = $('> .likes', self.$commentsTopBar);
			self.$commentsSorting = $('> .sort', self.$commentsTopBar);
			self.$commentList = $('> ul', self.$commentsMainWrapper);
			self.$anonymCommentWrapper = $('> .anonymCommentWrapper', self.$commentsModal);
			self.$anonymCommenterNameInput = $('> .authorName > input', self.$anonymCommentWrapper);
			self.$anonymCommenterEmailInput = $('> .authorEmail > input', self.$anonymCommentWrapper);
			self.$anonymCommentInput = $('> .authorTextarea > textarea', self.$anonymCommentWrapper);
			self.$anonymCommentCancel = $('> .actions > .cancel', self.$anonymCommentWrapper);
			self.$anonymCommentPost = $('> .actions > .post', self.$anonymCommentWrapper);
			self.$newCommentCaptchaContainer = $('> .captchaContainer', self.$anonymCommentWrapper);

			self.commentSorting = 'asc';

			self.addingAjaxRequest = undefined;

			self.commentsOpened = false;
			self.commentsAnimationTimeout;

			var reCaptchaId;

			self.$commentsTrigger.on('click', function () {
				if (self.desktopVersion && self.commentsOpened == true) {
					self.closeComments();
					return;
				}

				self.updateItemComments();

				if (self.desktopVersion) {
					self.commentsOpened = true;
					clearTimeout(self.commentsAnimationTimeout);

					self.$root.addClass('animateComments moveComments');

					self.commentsAnimationTimeout = setTimeout(function () {
						self.$root.removeClass('animateComments moveComments');

						self.$root.width(self.$root.width() - self.$commentsModal.outerWidth(true));
						size.call(self);
					}, 200);
				} else {
					self.$root.addClass('modalActive');

					self.$modalOverlay
						.stop(true)
						.animate(
							{
								opacity: 1
							},
							{
								duration: 200
							}
						);
				}
			});

			self.$commentsSorting.on('click', function () {
				if (self.commentSorting == 'asc')
					self.commentSorting = 'desc';
				else
					self.commentSorting = 'asc';

				self.$commentsSorting.toggleClass('desc', self.commentSorting == 'desc');

				updateCommentsUi.call(self);
			});

			self.$commentsModal.on('click', '> span.closeComments', function () {
				self.closeComments();
			});

			self.$newCommentInput
				.on('change keyup', function () {
					var val = self.$newCommentInput.val();

					self.$newCommentWrapper.toggleClass('filledIn', val !== '');
				})
				.on('focus', function () {
					if (!self.options.comments.requireAuthorInfo)
						return;

					self.$anonymCommenterNameInput
						.trigger('focus')
						.val('')
						.parent()
							.removeClass('error');
					self.$anonymCommenterEmailInput
						.val('')
						.parent()
							.removeClass('error');
					self.$anonymCommentInput
						.val('')
						.parent()
							.removeClass('error');
					self.$newCommentCaptchaContainer.removeClass('error');

					if (self.options.comments.useReCaptcha) {
						if (reCaptchaId)
							grecaptcha.reset(reCaptchaId);
						else
							reCaptchaId = grecaptcha.render($('> .captcha', self.$newCommentCaptchaContainer)[0], {
								sitekey: self.options.googleReCaptchaSiteKey,
								size: 'compact'
							});
					}

					self.$commentsModal.addClass('showAnonymWindow');
				});

			self.$anonymCommentCancel.on('click', function () {
				self.$commentsModal.removeClass('showAnonymWindow');
				self.$anonymCommentWrapper.removeClass('addingAnonComment');

				if (self.addingAjaxRequest) {
					self.addingAjaxRequest.abort();
					self.addingAjaxRequest = undefined;
				}
			});

			var submitComment = function (e, authorName, authorEmail, comment, captcha, anonComment) {
				var activeItemIndex = self.currentItemIndex,
					currentItem = self.items[activeItemIndex],
					itemCommentMeta = self.comments[currentItem.id],
					newComment = self.options.comments.requireAuthorInfo ? comment : self.$newCommentInput.val(),
					params = {
						action: 'add_comment'
					},
					error = false;

				if (newComment === '' || self.$newCommentWrapper.hasClass('addingComment'))
					return;

				self.$newCommentCaptchaContainer.removeClass('error');
				self.$newCommentInput.val('');
				self.$newCommentWrapper
					.removeClass('filledIn')
					.addClass('addingComment');

				params.comment = newComment;

				if (self.options.comments.requireAuthorInfo) {
					params.name = authorName;
					params.email = authorEmail;
				}

				if (captcha)
					params.captcha = captcha;

				self.addingAjaxRequest = $.ajax({
					data: params,
					dataType: 'json',
					type: 'POST',
					url: currentItem.comments.backend,
					timeout: 30000,
					cache: false,
					error: function () {},
					success: function (response) {
						if (response.status == undefined)
							return;

						if (response.status == 'success') {
							itemCommentMeta.cache.comments.push({
								author: response.author.id,
								content: response.comment,
								raw: newComment,
								id: response.id,
								dateHtml: response.dateHtml
							});
							itemCommentMeta.count += 1;

							if (itemCommentMeta.cache.authors[response.author.id] == undefined)
								itemCommentMeta.cache.authors[response.author.id] = {
									avatar: response.author.avatar,
									name: response.author.name,
									url: response.author.url
								};
						} else if (response.status == 'captcha_error') {
							self.$newCommentCaptchaContainer.addClass('error');
							error = true;
						}
					},
					complete: function () {
						self.addingAjaxRequest = undefined;

						if (!itemCommentMeta.state.open || activeItemIndex != self.currentItemIndex)
							return;

						if (anonComment) {
							self.$anonymCommentWrapper.removeClass('addingAnonComment');
							self.$anonymCommentPost.text(_.call(self, 'Post'));
						}

						self.$newCommentWrapper.removeClass('addingComment');

						if (error)
							return;

						if (anonComment) {
							self.$commentsModal.removeClass('showAnonymWindow');
							self.$newCommentCaptchaContainer.removeClass('error');
						}

						updateCommentsUi.call(self);
					}
				});
			};

			self.$anonymCommentPost.on('click', function () {
				var authorName = self.$anonymCommenterNameInput.val(),
					authorEmail = self.$anonymCommenterEmailInput.val(),
					comment = self.$anonymCommentInput.val(),
					hasErrors = false,
					captcha = undefined;

				self.$anonymCommenterNameInput.attr('placeholder', _.call(self, 'Name'));
				self.$anonymCommenterEmailInput.attr('placeholder', _.call(self, 'Email'));
				self.$anonymCommentInput.attr('placeholder', _.call(self, 'Write a comment'));

				self.$anonymCommenterNameInput.parent().removeClass('error');
				self.$anonymCommenterEmailInput.parent().removeClass('error');
				self.$anonymCommentInput.parent().removeClass('error');

				if (!authorName) {
					self.$anonymCommenterNameInput
						.attr('placeholder', _.call(self, 'Please specify your name'))
						.parent()
							.addClass('error');
					hasErrors = true;
				}

				if (!authorEmail || !emailVerification.test(authorEmail)) {
					self.$anonymCommenterEmailInput
						.attr('placeholder', _.call(self, 'Please specify your email'))
						.parent()
							.addClass('error');
					hasErrors = true;
				}

				if (!comment) {
					self.$anonymCommentInput
						.attr('placeholder', _.call(self, 'Please write a comment'))
						.parent()
							.addClass('error');
					hasErrors = true;
				}

				if (self.options.comments.useReCaptcha) {
					captcha = grecaptcha.getResponse(reCaptchaId);

					if (captcha.length == 0) {
						self.$newCommentCaptchaContainer.addClass('error');

						hasErrors = true;
					}
				}

				if (hasErrors) {
					return;
				}

				self.$anonymCommentWrapper.addClass('addingAnonComment');
				self.$anonymCommentPost.text(_.call(self, 'Commenting'));

				submitComment({}, authorName, authorEmail, comment, captcha, true);
			});

			self.$newCommentButton.on('click', submitComment);
		}

		if (self.options.like.permissions.liking) {
			self.$root.append('<span class="actions likeTrigger"><span>0</span></span>');

			self.$likeTrigger = $('> .actions.likeTrigger', self.$root);
			self.$mainLikeCount = $('> span', self.$likeTrigger);

			self.$likeTrigger.on('click', function () {
				if (self.$root.hasClass('initializing'))
					return;

				var activeItemIndex = self.currentItemIndex,
					currentItem = self.items[activeItemIndex],
					liked = !currentItem.likes.likedByUser,
					params = {
						portalId: self.options.portalId,
						moduleId: self.options.moduleId,
						mediaId: currentItem.id
					};

				currentItem.likes.likedByUser = liked;

				if (liked)
					currentItem.likes.numOfLikes += 1;
				else
					if (currentItem.likes.numOfLikes > 0)
						currentItem.likes.numOfLikes -= 1;

				self.$mainLikeCount.text(currentItem.likes.numOfLikes);
				self.$likeTrigger.toggleClass('liked', liked);

				if (typeof currentItem.journalId == 'number') {
					params.action = 'like';
					params.journalid = currentItem.journalId;
					params.liked = liked;
				} else {
					params.action = 'media_like';
					params.vote = liked ? 1 : -1;
				}

				$.ajax({
					data: params,
					dataType: 'json',
					type: 'POST',
					url: self.options.websiteRoot + 'DesktopModules/EasyDNNGallery/Services/SocialMediaBox.ashx',
					timeout: 10000,
					cache: false,
					error: function () {},
					success: function () {},
					complete: function () {}
				});
			});
		}

		self.$root.appendTo(self.$body);

		self.main = {
			horizontalSpace: 0,
			verticalSpace: 0
		};

		$.each(self.items, function (itemIndex) {
			var $itemDiv = $('<div></div>');

			$itemDiv
				.addClass('loading item_' + itemIndex)
				.data('itemIndex', itemIndex);

			if (this.type == 'image') {
				$itemDiv.addClass('imageItem');
			} else if (this.type == 'video') {
				$itemDiv.addClass('videoItem');
			} else if (this.type == 'audio') {
				$itemDiv.addClass('audioItem');
			}

			$itemDiv.appendTo(self.$contentWrapper)
		});

		size.call(self);

		self.$root.addClass('show');

		setTimeout(function () {
			showItem.call(self);
		}, 200);

		var hammerTime = new Hammer($('> .mobileOverlay', self.$root)[0]);

		self.skipGestures = false;
		var tapTimeout;

		hammerTime.on('swipeleft swiperight panleft panright panend tap', function (event) {
			var currentItemOffset = - (self.currentItemIndex * self.overlayWidth),
				deltaX = event.deltaX;

			if (event.type == 'tap') {
				clearTimeout(tapTimeout);

				if (self.$root.hasClass('hideControls')) {
					self.$root.removeClass('hideControls fadeOutControls');
				} else {
					self.$root.addClass('fadeOutControls');
					tapTimeout = setTimeout(function () {
						self.$root.addClass('hideControls');
					}, 500);
				}

				return;
			}

			if (self.skipGestures || !self.initialItemLoaded)
				return;

			if ((event.type == 'swipeleft' || event.type == 'swiperight') && items.length > 1) {
				if (event.type == 'swipeleft')
					if (self.currentItemIndex < self.items.length - 1)
						showNextItem.call(self);
				else
					if (self.currentItemIndex == 0)
						showPrevItem.call(self);

				return;
			}

			if (event.type == 'panend') {
				if (
					self.currentItemIndex == 0 && deltaX >= 0 ||
					self.currentItemIndex == self.items.length - 1 && deltaX < 0 ||
					Math.abs(deltaX) < self.overlayWidth / 2
				) {
					self.$contentWrapper
						.removeClass(swipeAnimationClass)
						.addClass(positionAnimationClass)
						.css({
							transform: 'translate3d(' + currentItemOffset + 'px, 0, 0)'
						});

					return;
				}

				self.skipGestures = true;

				var newX = - self.overlayWidth;
				var indexModifier = 1;

				if (deltaX > 0) {
					newX = self.overlayWidth;
					indexModifier = -1;
				}

				newX = currentItemOffset + newX;

				self.$contentWrapper
					.addClass(positionAnimationClass)
					.removeClass(swipeAnimationClass)
					.css({
						transform: 'translate3d(' + newX + 'px, 0, 0)'
					});

				setTimeout(function () {
					self.skipGestures = false;
					self.currentItemIndex += indexModifier;
					showItem.call(self);
				}, 550);

				return;
			}

			if (
				self.currentItemIndex == 0 && deltaX >= 0 ||
				self.currentItemIndex == self.items.length - 1 && deltaX < 0
			) {
				deltaX = 1 - Math.abs(deltaX) / self.overlayWidth;

				if (deltaX < .5) {
					deltaX = Math.round(self.overlayWidth / 4);

					if (event.deltaX < 1)
						deltaX = - deltaX;
				} else
					deltaX = Math.round(deltaX * event.deltaX);
			}

			self.$contentWrapper
				.removeClass(positionAnimationClass)
				.removeClass(swipeAnimationClass)
				.css({
					transform: 'translate3d(' + (currentItemOffset + deltaX) + 'px, 0, 0)'
				});
		});

		postInit.call(self);

		return self;
	}

	Mobile.prototype = {
		center: function () {
			var self = this,
				commentListHeight = 0;

			if (self.options.comments.permissions.show) {
				commentListHeight = $('>', self.$commentsModal).height() - self.$commentsTopBar.outerHeight(true) - self.$newCommentWrapper.outerHeight(true);

				if (commentListHeight < 0)
					commentListHeight = 0;

				self.$commentList.css('height', commentListHeight);
			};

			self.$contentWrapper
				.removeClass(positionAnimationClass)
				.removeClass(swipeAnimationClass)
				.css({
					width: self.items.length * self.overlayWidth,
					transform: 'translate3d(-' + self.currentItemIndex * self.overlayWidth + 'px, 0, 0)'
				});

			$('>', self.$contentWrapper)
				.width(self.overlayWidth)
				.each(function () {
					var $itemContainer = $(this),
						itemIndex = $itemContainer.data('itemIndex'),
						item = self.items[itemIndex];

					if ($itemContainer.hasClass('loading') || (item.type != 'image' && itemIndex != self.currentItemIndex))
						return;

					if (item.type == 'image') {
						var imageStats = self.images[item.src].stats;

						$('> img', $itemContainer).css(getItemDimensions.call(self, imageStats.width, imageStats.height, false));
					} else if (item.type == 'video') {
						$('> div', $itemContainer).css(getItemDimensions.call(self, item.width, item.height, true));
					} else if (item.type == 'audio') {
						$('> div', $itemContainer).css(getItemDimensions.call(self, 460, 36, false, true));
					}
				});
		},
		showItem: function () {
			var self = this,
				$currentDomItem = $('> div.item_' + self.currentItemIndex, self.$contentWrapper),
				thisItemIndex = self.currentItemIndex,
				currentItem = self.items[thisItemIndex],
				preloadNeighbours = function () {
					if (thisItemIndex > 0)
						preloadImage.call(
							self,
							validItemIndex.call(self, thisItemIndex - 1)
						);

					if (thisItemIndex < self.items.length - 1)
						preloadImage.call(
							self,
							validItemIndex.call(self, thisItemIndex + 1)
						);
				};

			self.$contentWrapper
				.removeClass(positionAnimationClass)
				.removeClass(swipeAnimationClass)
				.css({
					transform: 'translate3d(-' + thisItemIndex * self.overlayWidth + 'px, 0, 0)'
				});

			if (self.options.comments.permissions.show) {
				self.$newCommentInput.val('');
				self.$newCommentWrapper.removeClass('filledIn');

				if (!self.comments[currentItem.id])
					self.comments[currentItem.id] = {
						state: {
							open: false,
							commentsRequest: ajaxState.UNSET
						},
						count: currentItem.comments.count,
						cache: {
							authors: {},
							comments: []
						}
					};

				self.$mainCommentsCount.text(self.comments[currentItem.id].count);

				if (self.desktopVersion) {
					$.each(self.comments, function () {
						this.state.open = false;
					});

					self.updateItemComments();
				}
			}

			if (self.options.like.permissions.liking) {
				self.$likeTrigger.toggleClass('liked', currentItem.likes.likedByUser);
				self.$mainLikeCount.text(currentItem.likes.numOfLikes);
			}

			switch (currentItem.type) {
			case 'image':
				if ($currentDomItem.data(itemDomInitKey))
					return;

				preloadImage.call(
					self,
					thisItemIndex,
					function () {
						if (self.currentItemIndex != thisItemIndex)
							return;

						self.initialItemLoaded = true;
						preloadNeighbours();
					}
				);

				$currentDomItem.data(itemDomInitKey, true);
				break;

			case 'video':
				showVideo.call(self, self.currentItemIndex);
				break;

			case 'audio':
				showAudio.call(self, currentItem);
				break;

			default:
				self.initialItemLoaded = true;
			}

			if (currentItem.type != 'image')
				preloadNeighbours();

			self.$root.removeClass('initializing');
		},
		updateItemComments: function () {
			var self = this,
				activeItemIndex = self.currentItemIndex,
				currentItem = self.items[activeItemIndex],
				itemCommentMeta = self.comments[currentItem.id];

			if (itemCommentMeta.state.open || self.$root.hasClass('initializing'))
				return;

			itemCommentMeta.state.open = true;

			if (itemCommentMeta.state.commentsRequest == ajaxState.UNSET) {
				itemCommentMeta.state.commentsRequest = ajaxState.SENT;

				self.$commentsModal.addClass('loading');

				$.ajax({
					data: {
						action: 'list_comments'
					},
					dataType: 'json',
					type: 'GET',
					url: currentItem.comments.backend,
					timeout: 15000,
					cache: false,
					error: function () {
						itemCommentMeta.state.commentsRequest = ajaxState.UNSET;
					},
					success: function (response) {
						itemCommentMeta.cache = response;
						itemCommentMeta.count = response.comments.length;
						itemCommentMeta.state.commentsRequest = ajaxState.DONE;
					},
					complete: function () {
						if (!itemCommentMeta.state.open || activeItemIndex != self.currentItemIndex)
							return;

						self.$commentsModal.removeClass('loading');
						updateCommentsUi.call(self);
					}
				});
			} else {
				updateCommentsUi.call(self);
				self.$commentsModal.removeClass('loading');
			}

			self.$internalCommentsCount.text(itemCommentMeta.count);
			self.$commentsLikes
				.text(currentItem.likes.numOfLikes)
				.toggleClass('liked', currentItem.likes.likedByUser);
		},
		closeComments: function () {
			var self= this,
				currentItem = self.items[self.currentItemIndex],
				itemCommentMeta = self.comments[currentItem.id];

			itemCommentMeta.state.open = false;

			if (self.desktopVersion) {
				clearTimeout(self.commentsAnimationTimeout);

				self.$root.addClass('moveComments');
				self.$root.css('width', '');
				size.call(self);

				self.$root
					.addClass('animateComments')
					.removeClass('moveComments');

				self.commentsAnimationTimeout = setTimeout(function () {
					self.$root.removeClass('animateComments');
				}, 300);
			} else {
				self.$root.removeClass('modalActive');

				self.$modalOverlay
					.stop(true)
					.animate(
						{
							opacity: 0
						},
						{
							duration: 200
						}
					);
			}

			self.$commentsModal.removeClass('showAnonymWindow');
			self.$anonymCommentWrapper.removeClass('addingAnonComment');
			self.commentsOpened = false;
		}
	};

	window.SmbLight_1 = function (items, options) {

		if (!(this instanceof SmbLight_1))
			return new SmbLight_1(items, options);

		if (options.mobile)
			return new Mobile(items, options);

		return new Standard(items, options);
	}

})(eds3_5_jq, 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
;;;/*!
 * Isotope PACKAGED v3.0.5
 *
 * Licensed GPLv3 for open source use
 * or Isotope Commercial License for commercial use
 *
 * https://isotope.metafizzy.co
 * Copyright 2017 Metafizzy
 */
!function (t, e) { "function" == typeof define && define.amd ? define("jquery-bridget/jquery-bridget", ["jquery"], function (i) { return e(t, i) }) : "object" == typeof module && module.exports ? module.exports = e(t, require("eds3_5_jq")) : t.jQueryBridget = e(t, t.eds3_5_jq) }(window, function (t, e) { "use strict"; function i(i, s, a) { function h(t, e, o) { var n, s = "$()." + i + '("' + e + '")'; return t.each(function (t, h) { var u = a.data(h, i); if (!u) return void r(i + " not initialized. Cannot call methods, i.e. " + s); var c = u[e]; if (!c || "_" == e.charAt(0)) return void r(s + " is not a valid method"); var d = c.apply(u, o); n = void 0 === n ? d : n }), void 0 !== n ? n : t } function u(t, e) { t.each(function (t, o) { var n = a.data(o, i); n ? (n.option(e), n._init()) : (n = new s(o, e), a.data(o, i, n)) }) } a = a || e || t.eds3_5_jq, a && (s.prototype.option || (s.prototype.option = function (t) { a.isPlainObject(t) && (this.options = a.extend(!0, this.options, t)) }), a.fn[i] = function (t) { if ("string" == typeof t) { var e = n.call(arguments, 1); return h(this, t, e) } return u(this, t), this }, o(a)) } function o(t) { !t || t && t.bridget || (t.bridget = i) } var n = Array.prototype.slice, s = t.console, r = "undefined" == typeof s ? function () { } : function (t) { s.error(t) }; return o(e || t.eds3_5_jq), i }), function (t, e) { "function" == typeof define && define.amd ? define("ev-emitter/ev-emitter", e) : "object" == typeof module && module.exports ? module.exports = e() : t.EvEmitter = e() }("undefined" != typeof window ? window : this, function () { function t() { } var e = t.prototype; return e.on = function (t, e) { if (t && e) { var i = this._events = this._events || {}, o = i[t] = i[t] || []; return -1 == o.indexOf(e) && o.push(e), this } }, e.once = function (t, e) { if (t && e) { this.on(t, e); var i = this._onceEvents = this._onceEvents || {}, o = i[t] = i[t] || {}; return o[e] = !0, this } }, e.off = function (t, e) { var i = this._events && this._events[t]; if (i && i.length) { var o = i.indexOf(e); return -1 != o && i.splice(o, 1), this } }, e.emitEvent = function (t, e) { var i = this._events && this._events[t]; if (i && i.length) { i = i.slice(0), e = e || []; for (var o = this._onceEvents && this._onceEvents[t], n = 0; n < i.length; n++) { var s = i[n], r = o && o[s]; r && (this.off(t, s), delete o[s]), s.apply(this, e) } return this } }, e.allOff = function () { delete this._events, delete this._onceEvents }, t }), function (t, e) { "use strict"; "function" == typeof define && define.amd ? define("get-size/get-size", [], function () { return e() }) : "object" == typeof module && module.exports ? module.exports = e() : t.getSize = e() }(window, function () { "use strict"; function t(t) { var e = parseFloat(t), i = -1 == t.indexOf("%") && !isNaN(e); return i && e } function e() { } function i() { for (var t = { width: 0, height: 0, innerWidth: 0, innerHeight: 0, outerWidth: 0, outerHeight: 0 }, e = 0; u > e; e++) { var i = h[e]; t[i] = 0 } return t } function o(t) { var e = getComputedStyle(t); return e || a("Style returned " + e + ". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"), e } function n() { if (!c) { c = !0; var e = document.createElement("div"); e.style.width = "200px", e.style.padding = "1px 2px 3px 4px", e.style.borderStyle = "solid", e.style.borderWidth = "1px 2px 3px 4px", e.style.boxSizing = "border-box"; var i = document.body || document.documentElement; i.appendChild(e); var n = o(e); s.isBoxSizeOuter = r = 200 == t(n.width), i.removeChild(e) } } function s(e) { if (n(), "string" == typeof e && (e = document.querySelector(e)), e && "object" == typeof e && e.nodeType) { var s = o(e); if ("none" == s.display) return i(); var a = {}; a.width = e.offsetWidth, a.height = e.offsetHeight; for (var c = a.isBorderBox = "border-box" == s.boxSizing, d = 0; u > d; d++) { var l = h[d], f = s[l], p = parseFloat(f); a[l] = isNaN(p) ? 0 : p } var m = a.paddingLeft + a.paddingRight, g = a.paddingTop + a.paddingBottom, y = a.marginLeft + a.marginRight, v = a.marginTop + a.marginBottom, _ = a.borderLeftWidth + a.borderRightWidth, x = a.borderTopWidth + a.borderBottomWidth, z = c && r, I = t(s.width); I !== !1 && (a.width = I + (z ? 0 : m + _)); var b = t(s.height); return b !== !1 && (a.height = b + (z ? 0 : g + x)), a.innerWidth = a.width - (m + _), a.innerHeight = a.height - (g + x), a.outerWidth = a.width + y, a.outerHeight = a.height + v, a } } var r, a = "undefined" == typeof console ? e : function (t) { console.error(t) }, h = ["paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "marginLeft", "marginRight", "marginTop", "marginBottom", "borderLeftWidth", "borderRightWidth", "borderTopWidth", "borderBottomWidth"], u = h.length, c = !1; return s }), function (t, e) { "use strict"; "function" == typeof define && define.amd ? define("desandro-matches-selector/matches-selector", e) : "object" == typeof module && module.exports ? module.exports = e() : t.matchesSelector = e() }(window, function () { "use strict"; var t = function () { var t = window.Element.prototype; if (t.matches) return "matches"; if (t.matchesSelector) return "matchesSelector"; for (var e = ["webkit", "moz", "ms", "o"], i = 0; i < e.length; i++) { var o = e[i], n = o + "MatchesSelector"; if (t[n]) return n } }(); return function (e, i) { return e[t](i) } }), function (t, e) { "function" == typeof define && define.amd ? define("fizzy-ui-utils/utils", ["desandro-matches-selector/matches-selector"], function (i) { return e(t, i) }) : "object" == typeof module && module.exports ? module.exports = e(t, require("desandro-matches-selector")) : t.fizzyUIUtils = e(t, t.matchesSelector) }(window, function (t, e) { var i = {}; i.extend = function (t, e) { for (var i in e) t[i] = e[i]; return t }, i.modulo = function (t, e) { return (t % e + e) % e }, i.makeArray = function (t) { var e = []; if (Array.isArray(t)) e = t; else if (t && "object" == typeof t && "number" == typeof t.length) for (var i = 0; i < t.length; i++) e.push(t[i]); else e.push(t); return e }, i.removeFrom = function (t, e) { var i = t.indexOf(e); -1 != i && t.splice(i, 1) }, i.getParent = function (t, i) { for (; t.parentNode && t != document.body;) if (t = t.parentNode, e(t, i)) return t }, i.getQueryElement = function (t) { return "string" == typeof t ? document.querySelector(t) : t }, i.handleEvent = function (t) { var e = "on" + t.type; this[e] && this[e](t) }, i.filterFindElements = function (t, o) { t = i.makeArray(t); var n = []; return t.forEach(function (t) { if (t instanceof HTMLElement) { if (!o) return void n.push(t); e(t, o) && n.push(t); for (var i = t.querySelectorAll(o), s = 0; s < i.length; s++) n.push(i[s]) } }), n }, i.debounceMethod = function (t, e, i) { var o = t.prototype[e], n = e + "Timeout"; t.prototype[e] = function () { var t = this[n]; t && clearTimeout(t); var e = arguments, s = this; this[n] = setTimeout(function () { o.apply(s, e), delete s[n] }, i || 100) } }, i.docReady = function (t) { var e = document.readyState; "complete" == e || "interactive" == e ? setTimeout(t) : document.addEventListener("DOMContentLoaded", t) }, i.toDashed = function (t) { return t.replace(/(.)([A-Z])/g, function (t, e, i) { return e + "-" + i }).toLowerCase() }; var o = t.console; return i.htmlInit = function (e, n) { i.docReady(function () { var s = i.toDashed(n), r = "data-" + s, a = document.querySelectorAll("[" + r + "]"), h = document.querySelectorAll(".js-" + s), u = i.makeArray(a).concat(i.makeArray(h)), c = r + "-options", d = t.eds3_5_jq; u.forEach(function (t) { var i, s = t.getAttribute(r) || t.getAttribute(c); try { i = s && JSON.parse(s) } catch (a) { return void (o && o.error("Error parsing " + r + " on " + t.className + ": " + a)) } var h = new e(t, i); d && d.data(t, n, h) }) }) }, i }), function (t, e) { "function" == typeof define && define.amd ? define("outlayer/item", ["ev-emitter/ev-emitter", "get-size/get-size"], e) : "object" == typeof module && module.exports ? module.exports = e(require("ev-emitter"), require("get-size")) : (t.Outlayer = {}, t.Outlayer.Item = e(t.EvEmitter, t.getSize)) }(window, function (t, e) { "use strict"; function i(t) { for (var e in t) return !1; return e = null, !0 } function o(t, e) { t && (this.element = t, this.layout = e, this.position = { x: 0, y: 0 }, this._create()) } function n(t) { return t.replace(/([A-Z])/g, function (t) { return "-" + t.toLowerCase() }) } var s = document.documentElement.style, r = "string" == typeof s.transition ? "transition" : "WebkitTransition", a = "string" == typeof s.transform ? "transform" : "WebkitTransform", h = { WebkitTransition: "webkitTransitionEnd", transition: "transitionend" }[r], u = { transform: a, transition: r, transitionDuration: r + "Duration", transitionProperty: r + "Property", transitionDelay: r + "Delay" }, c = o.prototype = Object.create(t.prototype); c.constructor = o, c._create = function () { this._transn = { ingProperties: {}, clean: {}, onEnd: {} }, this.css({ position: "absolute" }) }, c.handleEvent = function (t) { var e = "on" + t.type; this[e] && this[e](t) }, c.getSize = function () { this.size = e(this.element) }, c.css = function (t) { var e = this.element.style; for (var i in t) { var o = u[i] || i; e[o] = t[i] } }, c.getPosition = function () { var t = getComputedStyle(this.element), e = this.layout._getOption("originLeft"), i = this.layout._getOption("originTop"), o = t[e ? "left" : "right"], n = t[i ? "top" : "bottom"], s = this.layout.size, r = -1 != o.indexOf("%") ? parseFloat(o) / 100 * s.width : parseInt(o, 10), a = -1 != n.indexOf("%") ? parseFloat(n) / 100 * s.height : parseInt(n, 10); r = isNaN(r) ? 0 : r, a = isNaN(a) ? 0 : a, r -= e ? s.paddingLeft : s.paddingRight, a -= i ? s.paddingTop : s.paddingBottom, this.position.x = r, this.position.y = a }, c.layoutPosition = function () { var t = this.layout.size, e = {}, i = this.layout._getOption("originLeft"), o = this.layout._getOption("originTop"), n = i ? "paddingLeft" : "paddingRight", s = i ? "left" : "right", r = i ? "right" : "left", a = this.position.x + t[n]; e[s] = this.getXValue(a), e[r] = ""; var h = o ? "paddingTop" : "paddingBottom", u = o ? "top" : "bottom", c = o ? "bottom" : "top", d = this.position.y + t[h]; e[u] = this.getYValue(d), e[c] = "", this.css(e), this.emitEvent("layout", [this]) }, c.getXValue = function (t) { var e = this.layout._getOption("horizontal"); return this.layout.options.percentPosition && !e ? t / this.layout.size.width * 100 + "%" : t + "px" }, c.getYValue = function (t) { var e = this.layout._getOption("horizontal"); return this.layout.options.percentPosition && e ? t / this.layout.size.height * 100 + "%" : t + "px" }, c._transitionTo = function (t, e) { this.getPosition(); var i = this.position.x, o = this.position.y, n = parseInt(t, 10), s = parseInt(e, 10), r = n === this.position.x && s === this.position.y; if (this.setPosition(t, e), r && !this.isTransitioning) return void this.layoutPosition(); var a = t - i, h = e - o, u = {}; u.transform = this.getTranslate(a, h), this.transition({ to: u, onTransitionEnd: { transform: this.layoutPosition }, isCleaning: !0 }) }, c.getTranslate = function (t, e) { var i = this.layout._getOption("originLeft"), o = this.layout._getOption("originTop"); return t = i ? t : -t, e = o ? e : -e, "translate3d(" + t + "px, " + e + "px, 0)" }, c.goTo = function (t, e) { this.setPosition(t, e), this.layoutPosition() }, c.moveTo = c._transitionTo, c.setPosition = function (t, e) { this.position.x = parseInt(t, 10), this.position.y = parseInt(e, 10) }, c._nonTransition = function (t) { this.css(t.to), t.isCleaning && this._removeStyles(t.to); for (var e in t.onTransitionEnd) t.onTransitionEnd[e].call(this) }, c.transition = function (t) { if (!parseFloat(this.layout.options.transitionDuration)) return void this._nonTransition(t); var e = this._transn; for (var i in t.onTransitionEnd) e.onEnd[i] = t.onTransitionEnd[i]; for (i in t.to) e.ingProperties[i] = !0, t.isCleaning && (e.clean[i] = !0); if (t.from) { this.css(t.from); var o = this.element.offsetHeight; o = null } this.enableTransition(t.to), this.css(t.to), this.isTransitioning = !0 }; var d = "opacity," + n(a); c.enableTransition = function () { if (!this.isTransitioning) { var t = this.layout.options.transitionDuration; t = "number" == typeof t ? t + "ms" : t, this.css({ transitionProperty: d, transitionDuration: t, transitionDelay: this.staggerDelay || 0 }), this.element.addEventListener(h, this, !1) } }, c.onwebkitTransitionEnd = function (t) { this.ontransitionend(t) }, c.onotransitionend = function (t) { this.ontransitionend(t) }; var l = { "-webkit-transform": "transform" }; c.ontransitionend = function (t) { if (t.target === this.element) { var e = this._transn, o = l[t.propertyName] || t.propertyName; if (delete e.ingProperties[o], i(e.ingProperties) && this.disableTransition(), o in e.clean && (this.element.style[t.propertyName] = "", delete e.clean[o]), o in e.onEnd) { var n = e.onEnd[o]; n.call(this), delete e.onEnd[o] } this.emitEvent("transitionEnd", [this]) } }, c.disableTransition = function () { this.removeTransitionStyles(), this.element.removeEventListener(h, this, !1), this.isTransitioning = !1 }, c._removeStyles = function (t) { var e = {}; for (var i in t) e[i] = ""; this.css(e) }; var f = { transitionProperty: "", transitionDuration: "", transitionDelay: "" }; return c.removeTransitionStyles = function () { this.css(f) }, c.stagger = function (t) { t = isNaN(t) ? 0 : t, this.staggerDelay = t + "ms" }, c.removeElem = function () { this.element.parentNode.removeChild(this.element), this.css({ display: "" }), this.emitEvent("remove", [this]) }, c.remove = function () { return r && parseFloat(this.layout.options.transitionDuration) ? (this.once("transitionEnd", function () { this.removeElem() }), void this.hide()) : void this.removeElem() }, c.reveal = function () { delete this.isHidden, this.css({ display: "" }); var t = this.layout.options, e = {}, i = this.getHideRevealTransitionEndProperty("visibleStyle"); e[i] = this.onRevealTransitionEnd, this.transition({ from: t.hiddenStyle, to: t.visibleStyle, isCleaning: !0, onTransitionEnd: e }) }, c.onRevealTransitionEnd = function () { this.isHidden || this.emitEvent("reveal") }, c.getHideRevealTransitionEndProperty = function (t) { var e = this.layout.options[t]; if (e.opacity) return "opacity"; for (var i in e) return i }, c.hide = function () { this.isHidden = !0, this.css({ display: "" }); var t = this.layout.options, e = {}, i = this.getHideRevealTransitionEndProperty("hiddenStyle"); e[i] = this.onHideTransitionEnd, this.transition({ from: t.visibleStyle, to: t.hiddenStyle, isCleaning: !0, onTransitionEnd: e }) }, c.onHideTransitionEnd = function () { this.isHidden && (this.css({ display: "none" }), this.emitEvent("hide")) }, c.destroy = function () { this.css({ position: "", left: "", right: "", top: "", bottom: "", transition: "", transform: "" }) }, o }), function (t, e) { "use strict"; "function" == typeof define && define.amd ? define("outlayer/outlayer", ["ev-emitter/ev-emitter", "get-size/get-size", "fizzy-ui-utils/utils", "./item"], function (i, o, n, s) { return e(t, i, o, n, s) }) : "object" == typeof module && module.exports ? module.exports = e(t, require("ev-emitter"), require("get-size"), require("fizzy-ui-utils"), require("./item")) : t.Outlayer = e(t, t.EvEmitter, t.getSize, t.fizzyUIUtils, t.Outlayer.Item) }(window, function (t, e, i, o, n) { "use strict"; function s(t, e) { var i = o.getQueryElement(t); if (!i) return void (h && h.error("Bad element for " + this.constructor.namespace + ": " + (i || t))); this.element = i, u && (this.$element = u(this.element)), this.options = o.extend({}, this.constructor.defaults), this.option(e); var n = ++d; this.element.outlayerGUID = n, l[n] = this, this._create(); var s = this._getOption("initLayout"); s && this.layout() } function r(t) { function e() { t.apply(this, arguments) } return e.prototype = Object.create(t.prototype), e.prototype.constructor = e, e } function a(t) { if ("number" == typeof t) return t; var e = t.match(/(^\d*\.?\d*)(\w*)/), i = e && e[1], o = e && e[2]; if (!i.length) return 0; i = parseFloat(i); var n = p[o] || 1; return i * n } var h = t.console, u = t.eds3_5_jq, c = function () { }, d = 0, l = {}; s.namespace = "outlayer", s.Item = n, s.defaults = { containerStyle: { position: "relative" }, initLayout: !0, originLeft: !0, originTop: !0, resize: !0, resizeContainer: !0, transitionDuration: "0.4s", hiddenStyle: { opacity: 0, transform: "scale(0.001)" }, visibleStyle: { opacity: 1, transform: "scale(1)" } }; var f = s.prototype; o.extend(f, e.prototype), f.option = function (t) { o.extend(this.options, t) }, f._getOption = function (t) { var e = this.constructor.compatOptions[t]; return e && void 0 !== this.options[e] ? this.options[e] : this.options[t] }, s.compatOptions = { initLayout: "isInitLayout", horizontal: "isHorizontal", layoutInstant: "isLayoutInstant", originLeft: "isOriginLeft", originTop: "isOriginTop", resize: "isResizeBound", resizeContainer: "isResizingContainer" }, f._create = function () { this.reloadItems(), this.stamps = [], this.stamp(this.options.stamp), o.extend(this.element.style, this.options.containerStyle); var t = this._getOption("resize"); t && this.bindResize() }, f.reloadItems = function () { this.items = this._itemize(this.element.children) }, f._itemize = function (t) { for (var e = this._filterFindItemElements(t), i = this.constructor.Item, o = [], n = 0; n < e.length; n++) { var s = e[n], r = new i(s, this); o.push(r) } return o }, f._filterFindItemElements = function (t) { return o.filterFindElements(t, this.options.itemSelector) }, f.getItemElements = function () { return this.items.map(function (t) { return t.element }) }, f.layout = function () { this._resetLayout(), this._manageStamps(); var t = this._getOption("layoutInstant"), e = void 0 !== t ? t : !this._isLayoutInited; this.layoutItems(this.items, e), this._isLayoutInited = !0 }, f._init = f.layout, f._resetLayout = function () { this.getSize() }, f.getSize = function () { this.size = i(this.element) }, f._getMeasurement = function (t, e) { var o, n = this.options[t]; n ? ("string" == typeof n ? o = this.element.querySelector(n) : n instanceof HTMLElement && (o = n), this[t] = o ? i(o)[e] : n) : this[t] = 0 }, f.layoutItems = function (t, e) { t = this._getItemsForLayout(t), this._layoutItems(t, e), this._postLayout() }, f._getItemsForLayout = function (t) { return t.filter(function (t) { return !t.isIgnored }) }, f._layoutItems = function (t, e) { if (this._emitCompleteOnItems("layout", t), t && t.length) { var i = []; t.forEach(function (t) { var o = this._getItemLayoutPosition(t); o.item = t, o.isInstant = e || t.isLayoutInstant, i.push(o) }, this), this._processLayoutQueue(i) } }, f._getItemLayoutPosition = function () { return { x: 0, y: 0 } }, f._processLayoutQueue = function (t) { this.updateStagger(), t.forEach(function (t, e) { this._positionItem(t.item, t.x, t.y, t.isInstant, e) }, this) }, f.updateStagger = function () { var t = this.options.stagger; return null === t || void 0 === t ? void (this.stagger = 0) : (this.stagger = a(t), this.stagger) }, f._positionItem = function (t, e, i, o, n) { o ? t.goTo(e, i) : (t.stagger(n * this.stagger), t.moveTo(e, i)) }, f._postLayout = function () { this.resizeContainer() }, f.resizeContainer = function () { var t = this._getOption("resizeContainer"); if (t) { var e = this._getContainerSize(); e && (this._setContainerMeasure(e.width, !0), this._setContainerMeasure(e.height, !1)) } }, f._getContainerSize = c, f._setContainerMeasure = function (t, e) { if (void 0 !== t) { var i = this.size; i.isBorderBox && (t += e ? i.paddingLeft + i.paddingRight + i.borderLeftWidth + i.borderRightWidth : i.paddingBottom + i.paddingTop + i.borderTopWidth + i.borderBottomWidth), t = Math.max(t, 0), this.element.style[e ? "width" : "height"] = t + "px" } }, f._emitCompleteOnItems = function (t, e) { function i() { n.dispatchEvent(t + "Complete", null, [e]) } function o() { r++, r == s && i() } var n = this, s = e.length; if (!e || !s) return void i(); var r = 0; e.forEach(function (e) { e.once(t, o) }) }, f.dispatchEvent = function (t, e, i) { var o = e ? [e].concat(i) : i; if (this.emitEvent(t, o), u) if (this.$element = this.$element || u(this.element), e) { var n = u.Event(e); n.type = t, this.$element.trigger(n, i) } else this.$element.trigger(t, i) }, f.ignore = function (t) { var e = this.getItem(t); e && (e.isIgnored = !0) }, f.unignore = function (t) { var e = this.getItem(t); e && delete e.isIgnored }, f.stamp = function (t) { t = this._find(t), t && (this.stamps = this.stamps.concat(t), t.forEach(this.ignore, this)) }, f.unstamp = function (t) { t = this._find(t), t && t.forEach(function (t) { o.removeFrom(this.stamps, t), this.unignore(t) }, this) }, f._find = function (t) { return t ? ("string" == typeof t && (t = this.element.querySelectorAll(t)), t = o.makeArray(t)) : void 0 }, f._manageStamps = function () { this.stamps && this.stamps.length && (this._getBoundingRect(), this.stamps.forEach(this._manageStamp, this)) }, f._getBoundingRect = function () { var t = this.element.getBoundingClientRect(), e = this.size; this._boundingRect = { left: t.left + e.paddingLeft + e.borderLeftWidth, top: t.top + e.paddingTop + e.borderTopWidth, right: t.right - (e.paddingRight + e.borderRightWidth), bottom: t.bottom - (e.paddingBottom + e.borderBottomWidth) } }, f._manageStamp = c, f._getElementOffset = function (t) { var e = t.getBoundingClientRect(), o = this._boundingRect, n = i(t), s = { left: e.left - o.left - n.marginLeft, top: e.top - o.top - n.marginTop, right: o.right - e.right - n.marginRight, bottom: o.bottom - e.bottom - n.marginBottom }; return s }, f.handleEvent = o.handleEvent, f.bindResize = function () { t.addEventListener("resize", this), this.isResizeBound = !0 }, f.unbindResize = function () { t.removeEventListener("resize", this), this.isResizeBound = !1 }, f.onresize = function () { this.resize() }, o.debounceMethod(s, "onresize", 100), f.resize = function () { this.isResizeBound && this.needsResizeLayout() && this.layout() }, f.needsResizeLayout = function () { var t = i(this.element), e = this.size && t; return e && t.innerWidth !== this.size.innerWidth }, f.addItems = function (t) { var e = this._itemize(t); return e.length && (this.items = this.items.concat(e)), e }, f.appended = function (t) { var e = this.addItems(t); e.length && (this.layoutItems(e, !0), this.reveal(e)) }, f.prepended = function (t) { var e = this._itemize(t); if (e.length) { var i = this.items.slice(0); this.items = e.concat(i), this._resetLayout(), this._manageStamps(), this.layoutItems(e, !0), this.reveal(e), this.layoutItems(i) } }, f.reveal = function (t) { if (this._emitCompleteOnItems("reveal", t), t && t.length) { var e = this.updateStagger(); t.forEach(function (t, i) { t.stagger(i * e), t.reveal() }) } }, f.hide = function (t) { if (this._emitCompleteOnItems("hide", t), t && t.length) { var e = this.updateStagger(); t.forEach(function (t, i) { t.stagger(i * e), t.hide() }) } }, f.revealItemElements = function (t) { var e = this.getItems(t); this.reveal(e) }, f.hideItemElements = function (t) { var e = this.getItems(t); this.hide(e) }, f.getItem = function (t) { for (var e = 0; e < this.items.length; e++) { var i = this.items[e]; if (i.element == t) return i } }, f.getItems = function (t) { t = o.makeArray(t); var e = []; return t.forEach(function (t) { var i = this.getItem(t); i && e.push(i) }, this), e }, f.remove = function (t) { var e = this.getItems(t); this._emitCompleteOnItems("remove", e), e && e.length && e.forEach(function (t) { t.remove(), o.removeFrom(this.items, t) }, this) }, f.destroy = function () { var t = this.element.style; t.height = "", t.position = "", t.width = "", this.items.forEach(function (t) { t.destroy() }), this.unbindResize(); var e = this.element.outlayerGUID; delete l[e], delete this.element.outlayerGUID, u && u.removeData(this.element, this.constructor.namespace) }, s.data = function (t) { t = o.getQueryElement(t); var e = t && t.outlayerGUID; return e && l[e] }, s.create = function (t, e) { var i = r(s); return i.defaults = o.extend({}, s.defaults), o.extend(i.defaults, e), i.compatOptions = o.extend({}, s.compatOptions), i.namespace = t, i.data = s.data, i.Item = r(n), o.htmlInit(i, t), u && u.bridget && u.bridget(t, i), i }; var p = { ms: 1, s: 1e3 }; return s.Item = n, s }), function (t, e) { "function" == typeof define && define.amd ? define("isotope-layout/js/item", ["outlayer/outlayer"], e) : "object" == typeof module && module.exports ? module.exports = e(require("outlayer")) : (t.Isotope = t.Isotope || {}, t.Isotope.Item = e(t.Outlayer)) }(window, function (t) { "use strict"; function e() { t.Item.apply(this, arguments) } var i = e.prototype = Object.create(t.Item.prototype), o = i._create; i._create = function () { this.id = this.layout.itemGUID++, o.call(this), this.sortData = {} }, i.updateSortData = function () { if (!this.isIgnored) { this.sortData.id = this.id, this.sortData["original-order"] = this.id, this.sortData.random = Math.random(); var t = this.layout.options.getSortData, e = this.layout._sorters; for (var i in t) { var o = e[i]; this.sortData[i] = o(this.element, this) } } }; var n = i.destroy; return i.destroy = function () { n.apply(this, arguments), this.css({ display: "" }) }, e }), function (t, e) { "function" == typeof define && define.amd ? define("isotope-layout/js/layout-mode", ["get-size/get-size", "outlayer/outlayer"], e) : "object" == typeof module && module.exports ? module.exports = e(require("get-size"), require("outlayer")) : (t.Isotope = t.Isotope || {}, t.Isotope.LayoutMode = e(t.getSize, t.Outlayer)) }(window, function (t, e) { "use strict"; function i(t) { this.isotope = t, t && (this.options = t.options[this.namespace], this.element = t.element, this.items = t.filteredItems, this.size = t.size) } var o = i.prototype, n = ["_resetLayout", "_getItemLayoutPosition", "_manageStamp", "_getContainerSize", "_getElementOffset", "needsResizeLayout", "_getOption"]; return n.forEach(function (t) { o[t] = function () { return e.prototype[t].apply(this.isotope, arguments) } }), o.needsVerticalResizeLayout = function () { var e = t(this.isotope.element), i = this.isotope.size && e; return i && e.innerHeight != this.isotope.size.innerHeight }, o._getMeasurement = function () { this.isotope._getMeasurement.apply(this, arguments) }, o.getColumnWidth = function () { this.getSegmentSize("column", "Width") }, o.getRowHeight = function () { this.getSegmentSize("row", "Height") }, o.getSegmentSize = function (t, e) { var i = t + e, o = "outer" + e; if (this._getMeasurement(i, o), !this[i]) { var n = this.getFirstItemSize(); this[i] = n && n[o] || this.isotope.size["inner" + e] } }, o.getFirstItemSize = function () { var e = this.isotope.filteredItems[0]; return e && e.element && t(e.element) }, o.layout = function () { this.isotope.layout.apply(this.isotope, arguments) }, o.getSize = function () { this.isotope.getSize(), this.size = this.isotope.size }, i.modes = {}, i.create = function (t, e) { function n() { i.apply(this, arguments) } return n.prototype = Object.create(o), n.prototype.constructor = n, e && (n.options = e), n.prototype.namespace = t, i.modes[t] = n, n }, i }), function (t, e) { "function" == typeof define && define.amd ? define("masonry-layout/masonry", ["outlayer/outlayer", "get-size/get-size"], e) : "object" == typeof module && module.exports ? module.exports = e(require("outlayer"), require("get-size")) : t.Masonry = e(t.Outlayer, t.getSize) }(window, function (t, e) { var i = t.create("masonry"); i.compatOptions.fitWidth = "isFitWidth"; var o = i.prototype; return o._resetLayout = function () { this.getSize(), this._getMeasurement("columnWidth", "outerWidth"), this._getMeasurement("gutter", "outerWidth"), this.measureColumns(), this.colYs = []; for (var t = 0; t < this.cols; t++) this.colYs.push(0); this.maxY = 0, this.horizontalColIndex = 0 }, o.measureColumns = function () { if (this.getContainerWidth(), !this.columnWidth) { var t = this.items[0], i = t && t.element; this.columnWidth = i && e(i).outerWidth || this.containerWidth } var o = this.columnWidth += this.gutter, n = this.containerWidth + this.gutter, s = n / o, r = o - n % o, a = r && 1 > r ? "round" : "floor"; s = Math[a](s), this.cols = Math.max(s, 1) }, o.getContainerWidth = function () { var t = this._getOption("fitWidth"), i = t ? this.element.parentNode : this.element, o = e(i); this.containerWidth = o && o.innerWidth }, o._getItemLayoutPosition = function (t) { t.getSize(); var e = t.size.outerWidth % this.columnWidth, i = e && 1 > e ? "round" : "ceil", o = Math[i](t.size.outerWidth / this.columnWidth); o = Math.min(o, this.cols); for (var n = this.options.horizontalOrder ? "_getHorizontalColPosition" : "_getTopColPosition", s = this[n](o, t), r = { x: this.columnWidth * s.col, y: s.y }, a = s.y + t.size.outerHeight, h = o + s.col, u = s.col; h > u; u++) this.colYs[u] = a; return r }, o._getTopColPosition = function (t) { var e = this._getTopColGroup(t), i = Math.min.apply(Math, e); return { col: e.indexOf(i), y: i } }, o._getTopColGroup = function (t) { if (2 > t) return this.colYs; for (var e = [], i = this.cols + 1 - t, o = 0; i > o; o++) e[o] = this._getColGroupY(o, t); return e }, o._getColGroupY = function (t, e) { if (2 > e) return this.colYs[t]; var i = this.colYs.slice(t, t + e); return Math.max.apply(Math, i) }, o._getHorizontalColPosition = function (t, e) { var i = this.horizontalColIndex % this.cols, o = t > 1 && i + t > this.cols; i = o ? 0 : i; var n = e.size.outerWidth && e.size.outerHeight; return this.horizontalColIndex = n ? i + t : this.horizontalColIndex, { col: i, y: this._getColGroupY(i, t) } }, o._manageStamp = function (t) { var i = e(t), o = this._getElementOffset(t), n = this._getOption("originLeft"), s = n ? o.left : o.right, r = s + i.outerWidth, a = Math.floor(s / this.columnWidth); a = Math.max(0, a); var h = Math.floor(r / this.columnWidth); h -= r % this.columnWidth ? 0 : 1, h = Math.min(this.cols - 1, h); for (var u = this._getOption("originTop"), c = (u ? o.top : o.bottom) + i.outerHeight, d = a; h >= d; d++) this.colYs[d] = Math.max(c, this.colYs[d]) }, o._getContainerSize = function () { this.maxY = Math.max.apply(Math, this.colYs); var t = { height: this.maxY }; return this._getOption("fitWidth") && (t.width = this._getContainerFitWidth()), t }, o._getContainerFitWidth = function () { for (var t = 0, e = this.cols; --e && 0 === this.colYs[e];) t++; return (this.cols - t) * this.columnWidth - this.gutter }, o.needsResizeLayout = function () { var t = this.containerWidth; return this.getContainerWidth(), t != this.containerWidth }, i }), function (t, e) { "function" == typeof define && define.amd ? define("isotope-layout/js/layout-modes/masonry", ["../layout-mode", "masonry-layout/masonry"], e) : "object" == typeof module && module.exports ? module.exports = e(require("../layout-mode"), require("masonry-layout")) : e(t.Isotope.LayoutMode, t.Masonry) }(window, function (t, e) { "use strict"; var i = t.create("masonry"), o = i.prototype, n = { _getElementOffset: !0, layout: !0, _getMeasurement: !0 }; for (var s in e.prototype) n[s] || (o[s] = e.prototype[s]); var r = o.measureColumns; o.measureColumns = function () { this.items = this.isotope.filteredItems, r.call(this) }; var a = o._getOption; return o._getOption = function (t) { return "fitWidth" == t ? void 0 !== this.options.isFitWidth ? this.options.isFitWidth : this.options.fitWidth : a.apply(this.isotope, arguments) }, i }), function (t, e) { "function" == typeof define && define.amd ? define("isotope-layout/js/layout-modes/fit-rows", ["../layout-mode"], e) : "object" == typeof exports ? module.exports = e(require("../layout-mode")) : e(t.Isotope.LayoutMode) }(window, function (t) { "use strict"; var e = t.create("fitRows"), i = e.prototype; return i._resetLayout = function () { this.x = 0, this.y = 0, this.maxY = 0, this._getMeasurement("gutter", "outerWidth") }, i._getItemLayoutPosition = function (t) { t.getSize(); var e = t.size.outerWidth + this.gutter, i = this.isotope.size.innerWidth + this.gutter; 0 !== this.x && e + this.x > i && (this.x = 0, this.y = this.maxY); var o = { x: this.x, y: this.y }; return this.maxY = Math.max(this.maxY, this.y + t.size.outerHeight), this.x += e, o }, i._getContainerSize = function () { return { height: this.maxY } }, e }), function (t, e) { "function" == typeof define && define.amd ? define("isotope-layout/js/layout-modes/vertical", ["../layout-mode"], e) : "object" == typeof module && module.exports ? module.exports = e(require("../layout-mode")) : e(t.Isotope.LayoutMode) }(window, function (t) { "use strict"; var e = t.create("vertical", { horizontalAlignment: 0 }), i = e.prototype; return i._resetLayout = function () { this.y = 0 }, i._getItemLayoutPosition = function (t) { t.getSize(); var e = (this.isotope.size.innerWidth - t.size.outerWidth) * this.options.horizontalAlignment, i = this.y; return this.y += t.size.outerHeight, { x: e, y: i } }, i._getContainerSize = function () { return { height: this.y } }, e }), function (t, e) { "function" == typeof define && define.amd ? define(["outlayer/outlayer", "get-size/get-size", "desandro-matches-selector/matches-selector", "fizzy-ui-utils/utils", "isotope-layout/js/item", "isotope-layout/js/layout-mode", "isotope-layout/js/layout-modes/masonry", "isotope-layout/js/layout-modes/fit-rows", "isotope-layout/js/layout-modes/vertical"], function (i, o, n, s, r, a) { return e(t, i, o, n, s, r, a) }) : "object" == typeof module && module.exports ? module.exports = e(t, require("outlayer"), require("get-size"), require("desandro-matches-selector"), require("fizzy-ui-utils"), require("isotope-layout/js/item"), require("isotope-layout/js/layout-mode"), require("isotope-layout/js/layout-modes/masonry"), require("isotope-layout/js/layout-modes/fit-rows"), require("isotope-layout/js/layout-modes/vertical")) : t.Isotope = e(t, t.Outlayer, t.getSize, t.matchesSelector, t.fizzyUIUtils, t.Isotope.Item, t.Isotope.LayoutMode) }(window, function (t, e, i, o, n, s, r) {
	function a(t, e) { return function (i, o) { for (var n = 0; n < t.length; n++) { var s = t[n], r = i.sortData[s], a = o.sortData[s]; if (r > a || a > r) { var h = void 0 !== e[s] ? e[s] : e, u = h ? 1 : -1; return (r > a ? 1 : -1) * u } } return 0 } } var h = t.eds3_5_jq, u = String.prototype.trim ? function (t) { return t.trim() } : function (t) { return t.replace(/^\s+|\s+$/g, "") }, c = e.create("isotope", { layoutMode: "masonry", isJQueryFiltering: !0, sortAscending: !0 }); c.Item = s, c.LayoutMode = r; var d = c.prototype; d._create = function () { this.itemGUID = 0, this._sorters = {}, this._getSorters(), e.prototype._create.call(this), this.modes = {}, this.filteredItems = this.items, this.sortHistory = ["original-order"]; for (var t in r.modes) this._initLayoutMode(t) }, d.reloadItems = function () { this.itemGUID = 0, e.prototype.reloadItems.call(this) }, d._itemize = function () { for (var t = e.prototype._itemize.apply(this, arguments), i = 0; i < t.length; i++) { var o = t[i]; o.id = this.itemGUID++ } return this._updateItemsSortData(t), t }, d._initLayoutMode = function (t) { var e = r.modes[t], i = this.options[t] || {}; this.options[t] = e.options ? n.extend(e.options, i) : i, this.modes[t] = new e(this) }, d.layout = function () { return !this._isLayoutInited && this._getOption("initLayout") ? void this.arrange() : void this._layout() }, d._layout = function () { var t = this._getIsInstant(); this._resetLayout(), this._manageStamps(), this.layoutItems(this.filteredItems, t), this._isLayoutInited = !0 }, d.arrange = function (t) { this.option(t), this._getIsInstant(); var e = this._filter(this.items); this.filteredItems = e.matches, this._bindArrangeComplete(), this._isInstant ? this._noTransition(this._hideReveal, [e]) : this._hideReveal(e), this._sort(), this._layout() }, d._init = d.arrange, d._hideReveal = function (t) { this.reveal(t.needReveal), this.hide(t.needHide) }, d._getIsInstant = function () { var t = this._getOption("layoutInstant"), e = void 0 !== t ? t : !this._isLayoutInited; return this._isInstant = e, e }, d._bindArrangeComplete = function () { function t() { e && i && o && n.dispatchEvent("arrangeComplete", null, [n.filteredItems]) } var e, i, o, n = this; this.once("layoutComplete", function () { e = !0, t() }), this.once("hideComplete", function () { i = !0, t() }), this.once("revealComplete", function () { o = !0, t() }) }, d._filter = function (t) { var e = this.options.filter; e = e || "*"; for (var i = [], o = [], n = [], s = this._getFilterTest(e), r = 0; r < t.length; r++) { var a = t[r]; if (!a.isIgnored) { var h = s(a); h && i.push(a), h && a.isHidden ? o.push(a) : h || a.isHidden || n.push(a) } } return { matches: i, needReveal: o, needHide: n } }, d._getFilterTest = function (t) {
		return h && this.options.isJQueryFiltering ? function (e) { return h(e.element).is(t) } : "function" == typeof t ? function (e) { return t(e.element) } : function (e) { return o(e.element, t) }
	}, d.updateSortData = function (t) { var e; t ? (t = n.makeArray(t), e = this.getItems(t)) : e = this.items, this._getSorters(), this._updateItemsSortData(e) }, d._getSorters = function () { var t = this.options.getSortData; for (var e in t) { var i = t[e]; this._sorters[e] = l(i) } }, d._updateItemsSortData = function (t) { for (var e = t && t.length, i = 0; e && e > i; i++) { var o = t[i]; o.updateSortData() } }; var l = function () { function t(t) { if ("string" != typeof t) return t; var i = u(t).split(" "), o = i[0], n = o.match(/^\[(.+)\]$/), s = n && n[1], r = e(s, o), a = c.sortDataParsers[i[1]]; return t = a ? function (t) { return t && a(r(t)) } : function (t) { return t && r(t) } } function e(t, e) { return t ? function (e) { return e.getAttribute(t) } : function (t) { var i = t.querySelector(e); return i && i.textContent } } return t }(); c.sortDataParsers = { parseInt: function (t) { return parseInt(t, 10) }, parseFloat: function (t) { return parseFloat(t) } }, d._sort = function () { if (this.options.sortBy) { var t = n.makeArray(this.options.sortBy); this._getIsSameSortBy(t) || (this.sortHistory = t.concat(this.sortHistory)); var e = a(this.sortHistory, this.options.sortAscending); this.filteredItems.sort(e) } }, d._getIsSameSortBy = function (t) { for (var e = 0; e < t.length; e++) if (t[e] != this.sortHistory[e]) return !1; return !0 }, d._mode = function () { var t = this.options.layoutMode, e = this.modes[t]; if (!e) throw new Error("No layout mode: " + t); return e.options = this.options[t], e }, d._resetLayout = function () { e.prototype._resetLayout.call(this), this._mode()._resetLayout() }, d._getItemLayoutPosition = function (t) { return this._mode()._getItemLayoutPosition(t) }, d._manageStamp = function (t) { this._mode()._manageStamp(t) }, d._getContainerSize = function () { return this._mode()._getContainerSize() }, d.needsResizeLayout = function () { return this._mode().needsResizeLayout() }, d.appended = function (t) { var e = this.addItems(t); if (e.length) { var i = this._filterRevealAdded(e); this.filteredItems = this.filteredItems.concat(i) } }, d.prepended = function (t) { var e = this._itemize(t); if (e.length) { this._resetLayout(), this._manageStamps(); var i = this._filterRevealAdded(e); this.layoutItems(this.filteredItems), this.filteredItems = i.concat(this.filteredItems), this.items = e.concat(this.items) } }, d._filterRevealAdded = function (t) { var e = this._filter(t); return this.hide(e.needHide), this.reveal(e.matches), this.layoutItems(e.matches, !0), e.matches }, d.insert = function (t) { var e = this.addItems(t); if (e.length) { var i, o, n = e.length; for (i = 0; n > i; i++) o = e[i], this.element.appendChild(o.element); var s = this._filter(e).matches; for (i = 0; n > i; i++) e[i].isLayoutInstant = !0; for (this.arrange(), i = 0; n > i; i++) delete e[i].isLayoutInstant; this.reveal(s) } }; var f = d.remove; return d.remove = function (t) { t = n.makeArray(t); var e = this.getItems(t); f.call(this, t); for (var i = e && e.length, o = 0; i && i > o; o++) { var s = e[o]; n.removeFrom(this.filteredItems, s) } }, d.shuffle = function () { for (var t = 0; t < this.items.length; t++) { var e = this.items[t]; e.sortData.random = Math.random() } this.options.sortBy = "random", this._sort(), this._layout() }, d._noTransition = function (t, e) { var i = this.options.transitionDuration; this.options.transitionDuration = 0; var o = t.apply(this, e); return this.options.transitionDuration = i, o }, d.getFilteredItemElements = function () { return this.filteredItems.map(function (t) { return t.element }) }, c
}), function (t, e) { "function" == typeof define && define.amd ? define("packery/js/rect", e) : "object" == typeof module && module.exports ? module.exports = e() : (t.Packery = t.Packery || {}, t.Packery.Rect = e()) }(window, function () { function t(e) { for (var i in t.defaults) this[i] = t.defaults[i]; for (i in e) this[i] = e[i] } t.defaults = { x: 0, y: 0, width: 0, height: 0 }; var e = t.prototype; return e.contains = function (t) { var e = t.width || 0, i = t.height || 0; return this.x <= t.x && this.y <= t.y && this.x + this.width >= t.x + e && this.y + this.height >= t.y + i }, e.overlaps = function (t) { var e = this.x + this.width, i = this.y + this.height, o = t.x + t.width, n = t.y + t.height; return this.x < o && e > t.x && this.y < n && i > t.y }, e.getMaximalFreeRects = function (e) { if (!this.overlaps(e)) return !1; var i, o = [], n = this.x + this.width, s = this.y + this.height, r = e.x + e.width, a = e.y + e.height; return this.y < e.y && (i = new t({ x: this.x, y: this.y, width: this.width, height: e.y - this.y }), o.push(i)), n > r && (i = new t({ x: r, y: this.y, width: n - r, height: this.height }), o.push(i)), s > a && (i = new t({ x: this.x, y: a, width: this.width, height: s - a }), o.push(i)), this.x < e.x && (i = new t({ x: this.x, y: this.y, width: e.x - this.x, height: this.height }), o.push(i)), o }, e.canFit = function (t) { return this.width >= t.width && this.height >= t.height }, t }), function (t, e) { if ("function" == typeof define && define.amd) define("packery/js/packer", ["./rect"], e); else if ("object" == typeof module && module.exports) module.exports = e(require("./rect")); else { var i = t.Packery = t.Packery || {}; i.Packer = e(i.Rect) } }(window, function (t) { function e(t, e, i) { this.width = t || 0, this.height = e || 0, this.sortDirection = i || "downwardLeftToRight", this.reset() } var i = e.prototype; i.reset = function () { this.spaces = []; var e = new t({ x: 0, y: 0, width: this.width, height: this.height }); this.spaces.push(e), this.sorter = o[this.sortDirection] || o.downwardLeftToRight }, i.pack = function (t) { for (var e = 0; e < this.spaces.length; e++) { var i = this.spaces[e]; if (i.canFit(t)) { this.placeInSpace(t, i); break } } }, i.columnPack = function (t) { for (var e = 0; e < this.spaces.length; e++) { var i = this.spaces[e], o = i.x <= t.x && i.x + i.width >= t.x + t.width && i.height >= t.height - .01; if (o) { t.y = i.y, this.placed(t); break } } }, i.rowPack = function (t) { for (var e = 0; e < this.spaces.length; e++) { var i = this.spaces[e], o = i.y <= t.y && i.y + i.height >= t.y + t.height && i.width >= t.width - .01; if (o) { t.x = i.x, this.placed(t); break } } }, i.placeInSpace = function (t, e) { t.x = e.x, t.y = e.y, this.placed(t) }, i.placed = function (t) { for (var e = [], i = 0; i < this.spaces.length; i++) { var o = this.spaces[i], n = o.getMaximalFreeRects(t); n ? e.push.apply(e, n) : e.push(o) } this.spaces = e, this.mergeSortSpaces() }, i.mergeSortSpaces = function () { e.mergeRects(this.spaces), this.spaces.sort(this.sorter) }, i.addSpace = function (t) { this.spaces.push(t), this.mergeSortSpaces() }, e.mergeRects = function (t) { var e = 0, i = t[e]; t: for (; i;) { for (var o = 0, n = t[e + o]; n;) { if (n == i) o++; else { if (n.contains(i)) { t.splice(e, 1), i = t[e]; continue t } i.contains(n) ? t.splice(e + o, 1) : o++ } n = t[e + o] } e++, i = t[e] } return t }; var o = { downwardLeftToRight: function (t, e) { return t.y - e.y || t.x - e.x }, rightwardTopToBottom: function (t, e) { return t.x - e.x || t.y - e.y } }; return e }), function (t, e) { "function" == typeof define && define.amd ? define("packery/js/item", ["outlayer/outlayer", "./rect"], e) : "object" == typeof module && module.exports ? module.exports = e(require("outlayer"), require("./rect")) : t.Packery.Item = e(t.Outlayer, t.Packery.Rect) }(window, function (t, e) { var i = document.documentElement.style, o = "string" == typeof i.transform ? "transform" : "WebkitTransform", n = function () { t.Item.apply(this, arguments) }, s = n.prototype = Object.create(t.Item.prototype), r = s._create; s._create = function () { r.call(this), this.rect = new e }; var a = s.moveTo; return s.moveTo = function (t, e) { var i = Math.abs(this.position.x - t), o = Math.abs(this.position.y - e), n = this.layout.dragItemCount && !this.isPlacing && !this.isTransitioning && 1 > i && 1 > o; return n ? void this.goTo(t, e) : void a.apply(this, arguments) }, s.enablePlacing = function () { this.removeTransitionStyles(), this.isTransitioning && o && (this.element.style[o] = "none"), this.isTransitioning = !1, this.getSize(), this.layout._setRectSize(this.element, this.rect), this.isPlacing = !0 }, s.disablePlacing = function () { this.isPlacing = !1 }, s.removeElem = function () { this.element.parentNode.removeChild(this.element), this.layout.packer.addSpace(this.rect), this.emitEvent("remove", [this]) }, s.showDropPlaceholder = function () { var t = this.dropPlaceholder; t || (t = this.dropPlaceholder = document.createElement("div"), t.className = "packery-drop-placeholder", t.style.position = "absolute"), t.style.width = this.size.width + "px", t.style.height = this.size.height + "px", this.positionDropPlaceholder(), this.layout.element.appendChild(t) }, s.positionDropPlaceholder = function () { this.dropPlaceholder.style[o] = "translate(" + this.rect.x + "px, " + this.rect.y + "px)" }, s.hideDropPlaceholder = function () { this.layout.element.removeChild(this.dropPlaceholder) }, n }), function (t, e) { "function" == typeof define && define.amd ? define("packery/js/packery", ["get-size/get-size", "outlayer/outlayer", "./rect", "./packer", "./item"], e) : "object" == typeof module && module.exports ? module.exports = e(require("get-size"), require("outlayer"), require("./rect"), require("./packer"), require("./item")) : t.Packery = e(t.getSize, t.Outlayer, t.Packery.Rect, t.Packery.Packer, t.Packery.Item) }(window, function (t, e, i, o, n) { function s(t, e) { return t.position.y - e.position.y || t.position.x - e.position.x } function r(t, e) { return t.position.x - e.position.x || t.position.y - e.position.y } function a(t, e) { var i = e.x - t.x, o = e.y - t.y; return Math.sqrt(i * i + o * o) } i.prototype.canFit = function (t) { return this.width >= t.width - 1 && this.height >= t.height - 1 }; var h = e.create("packery"); h.Item = n; var u = h.prototype; u._create = function () { e.prototype._create.call(this), this.packer = new o, this.shiftPacker = new o, this.isEnabled = !0, this.dragItemCount = 0; var t = this; this.handleDraggabilly = { dragStart: function () { t.itemDragStart(this.element) }, dragMove: function () { t.itemDragMove(this.element, this.position.x, this.position.y) }, dragEnd: function () { t.itemDragEnd(this.element) } }, this.handleUIDraggable = { start: function (e, i) { i && t.itemDragStart(e.currentTarget) }, drag: function (e, i) { i && t.itemDragMove(e.currentTarget, i.position.left, i.position.top) }, stop: function (e, i) { i && t.itemDragEnd(e.currentTarget) } } }, u._resetLayout = function () { this.getSize(), this._getMeasurements(); var t, e, i; this._getOption("horizontal") ? (t = 1 / 0, e = this.size.innerHeight + this.gutter, i = "rightwardTopToBottom") : (t = this.size.innerWidth + this.gutter, e = 1 / 0, i = "downwardLeftToRight"), this.packer.width = this.shiftPacker.width = t, this.packer.height = this.shiftPacker.height = e, this.packer.sortDirection = this.shiftPacker.sortDirection = i, this.packer.reset(), this.maxY = 0, this.maxX = 0 }, u._getMeasurements = function () { this._getMeasurement("columnWidth", "width"), this._getMeasurement("rowHeight", "height"), this._getMeasurement("gutter", "width") }, u._getItemLayoutPosition = function (t) { if (this._setRectSize(t.element, t.rect), this.isShifting || this.dragItemCount > 0) { var e = this._getPackMethod(); this.packer[e](t.rect) } else this.packer.pack(t.rect); return this._setMaxXY(t.rect), t.rect }, u.shiftLayout = function () { this.isShifting = !0, this.layout(), delete this.isShifting }, u._getPackMethod = function () { return this._getOption("horizontal") ? "rowPack" : "columnPack" }, u._setMaxXY = function (t) { this.maxX = Math.max(t.x + t.width, this.maxX), this.maxY = Math.max(t.y + t.height, this.maxY) }, u._setRectSize = function (e, i) { var o = t(e), n = o.outerWidth, s = o.outerHeight; (n || s) && (n = this._applyGridGutter(n, this.columnWidth), s = this._applyGridGutter(s, this.rowHeight)), i.width = Math.min(n, this.packer.width), i.height = Math.min(s, this.packer.height) }, u._applyGridGutter = function (t, e) { if (!e) return t + this.gutter; e += this.gutter; var i = t % e, o = i && 1 > i ? "round" : "ceil"; return t = Math[o](t / e) * e }, u._getContainerSize = function () { return this._getOption("horizontal") ? { width: this.maxX - this.gutter } : { height: this.maxY - this.gutter } }, u._manageStamp = function (t) { var e, o = this.getItem(t); if (o && o.isPlacing) e = o.rect; else { var n = this._getElementOffset(t); e = new i({ x: this._getOption("originLeft") ? n.left : n.right, y: this._getOption("originTop") ? n.top : n.bottom }) } this._setRectSize(t, e), this.packer.placed(e), this._setMaxXY(e) }, u.sortItemsByPosition = function () { var t = this._getOption("horizontal") ? r : s; this.items.sort(t) }, u.fit = function (t, e, i) { var o = this.getItem(t); o && (this.stamp(o.element), o.enablePlacing(), this.updateShiftTargets(o), e = void 0 === e ? o.rect.x : e, i = void 0 === i ? o.rect.y : i, this.shift(o, e, i), this._bindFitEvents(o), o.moveTo(o.rect.x, o.rect.y), this.shiftLayout(), this.unstamp(o.element), this.sortItemsByPosition(), o.disablePlacing()) }, u._bindFitEvents = function (t) { function e() { o++, 2 == o && i.dispatchEvent("fitComplete", null, [t]) } var i = this, o = 0; t.once("layout", e), this.once("layoutComplete", e) }, u.resize = function () { this.isResizeBound && this.needsResizeLayout() && (this.options.shiftPercentResize ? this.resizeShiftPercentLayout() : this.layout()) }, u.needsResizeLayout = function () { var e = t(this.element), i = this._getOption("horizontal") ? "innerHeight" : "innerWidth"; return e[i] != this.size[i] }, u.resizeShiftPercentLayout = function () { var e = this._getItemsForLayout(this.items), i = this._getOption("horizontal"), o = i ? "y" : "x", n = i ? "height" : "width", s = i ? "rowHeight" : "columnWidth", r = i ? "innerHeight" : "innerWidth", a = this[s]; if (a = a && a + this.gutter) { this._getMeasurements(); var h = this[s] + this.gutter; e.forEach(function (t) { var e = Math.round(t.rect[o] / a); t.rect[o] = e * h }) } else { var u = t(this.element)[r] + this.gutter, c = this.packer[n]; e.forEach(function (t) { t.rect[o] = t.rect[o] / c * u }) } this.shiftLayout() }, u.itemDragStart = function (t) { if (this.isEnabled) { this.stamp(t); var e = this.getItem(t); e && (e.enablePlacing(), e.showDropPlaceholder(), this.dragItemCount++, this.updateShiftTargets(e)) } }, u.updateShiftTargets = function (t) { this.shiftPacker.reset(), this._getBoundingRect(); var e = this._getOption("originLeft"), o = this._getOption("originTop"); this.stamps.forEach(function (t) { var n = this.getItem(t); if (!n || !n.isPlacing) { var s = this._getElementOffset(t), r = new i({ x: e ? s.left : s.right, y: o ? s.top : s.bottom }); this._setRectSize(t, r), this.shiftPacker.placed(r) } }, this); var n = this._getOption("horizontal"), s = n ? "rowHeight" : "columnWidth", r = n ? "height" : "width"; this.shiftTargetKeys = [], this.shiftTargets = []; var a, h = this[s]; if (h = h && h + this.gutter) { var u = Math.ceil(t.rect[r] / h), c = Math.floor((this.shiftPacker[r] + this.gutter) / h); a = (c - u) * h; for (var d = 0; c > d; d++) this._addShiftTarget(d * h, 0, a) } else a = this.shiftPacker[r] + this.gutter - t.rect[r], this._addShiftTarget(0, 0, a); var l = this._getItemsForLayout(this.items), f = this._getPackMethod(); l.forEach(function (t) { var e = t.rect; this._setRectSize(t.element, e), this.shiftPacker[f](e), this._addShiftTarget(e.x, e.y, a); var i = n ? e.x + e.width : e.x, o = n ? e.y : e.y + e.height; if (this._addShiftTarget(i, o, a), h) for (var s = Math.round(e[r] / h), u = 1; s > u; u++) { var c = n ? i : e.x + h * u, d = n ? e.y + h * u : o; this._addShiftTarget(c, d, a) } }, this) }, u._addShiftTarget = function (t, e, i) { var o = this._getOption("horizontal") ? e : t; if (!(0 !== o && o > i)) { var n = t + "," + e, s = -1 != this.shiftTargetKeys.indexOf(n); s || (this.shiftTargetKeys.push(n), this.shiftTargets.push({ x: t, y: e })) } }, u.shift = function (t, e, i) { var o, n = 1 / 0, s = { x: e, y: i }; this.shiftTargets.forEach(function (t) { var e = a(t, s); n > e && (o = t, n = e) }), t.rect.x = o.x, t.rect.y = o.y }; var c = 120; u.itemDragMove = function (t, e, i) { function o() { s.shift(n, e, i), n.positionDropPlaceholder(), s.layout() } var n = this.isEnabled && this.getItem(t); if (n) { e -= this.size.paddingLeft, i -= this.size.paddingTop; var s = this, r = new Date; this._itemDragTime && r - this._itemDragTime < c ? (clearTimeout(this.dragTimeout), this.dragTimeout = setTimeout(o, c)) : (o(), this._itemDragTime = r) } }, u.itemDragEnd = function (t) { function e() { o++, 2 == o && (i.element.classList.remove("is-positioning-post-drag"), i.hideDropPlaceholder(), n.dispatchEvent("dragItemPositioned", null, [i])) } var i = this.isEnabled && this.getItem(t); if (i) { clearTimeout(this.dragTimeout), i.element.classList.add("is-positioning-post-drag"); var o = 0, n = this; i.once("layout", e), this.once("layoutComplete", e), i.moveTo(i.rect.x, i.rect.y), this.layout(), this.dragItemCount = Math.max(0, this.dragItemCount - 1), this.sortItemsByPosition(), i.disablePlacing(), this.unstamp(i.element) } }, u.bindDraggabillyEvents = function (t) { this._bindDraggabillyEvents(t, "on") }, u.unbindDraggabillyEvents = function (t) { this._bindDraggabillyEvents(t, "off") }, u._bindDraggabillyEvents = function (t, e) { var i = this.handleDraggabilly; t[e]("dragStart", i.dragStart), t[e]("dragMove", i.dragMove), t[e]("dragEnd", i.dragEnd) }, u.bindUIDraggableEvents = function (t) { this._bindUIDraggableEvents(t, "on") }, u.unbindUIDraggableEvents = function (t) { this._bindUIDraggableEvents(t, "off") }, u._bindUIDraggableEvents = function (t, e) { var i = this.handleUIDraggable; t[e]("dragstart", i.start)[e]("drag", i.drag)[e]("dragstop", i.stop) }; var d = u.destroy; return u.destroy = function () { d.apply(this, arguments), this.isEnabled = !1 }, h.Rect = i, h.Packer = o, h }), function (t, e) { "function" == typeof define && define.amd ? define(["isotope/js/layout-mode", "packery/js/packery"], e) : "object" == typeof module && module.exports ? module.exports = e(require("isotope-layout/js/layout-mode"), require("packery")) : e(t.Isotope.LayoutMode, t.Packery) }(window, function (t, e) { var i = t.create("packery"), o = i.prototype, n = { _getElementOffset: !0, _getMeasurement: !0 }; for (var s in e.prototype) n[s] || (o[s] = e.prototype[s]); var r = o._resetLayout; o._resetLayout = function () { this.packer = this.packer || new e.Packer, this.shiftPacker = this.shiftPacker || new e.Packer, r.apply(this, arguments) }; var a = o._getItemLayoutPosition; o._getItemLayoutPosition = function (t) { return t.rect = t.rect || new e.Rect, a.call(this, t) }; var h = o.needsResizeLayout; o.needsResizeLayout = function () { return this._getOption("horizontal") ? this.needsVerticalResizeLayout() : h.call(this) }; var u = o._getOption; return o._getOption = function (t) { return "horizontal" == t ? void 0 !== this.options.isHorizontal ? this.options.isHorizontal : this.options.horizontal : u.apply(this.isotope, arguments) }, i });
;;;/*!
 * 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.eds3_5_jq,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 ($, window, document, undefined) {
	var defaultOptions = {
		portalId: 0,
		moduleId: 0,
		tabId: 0,
		userId: 0,
		groupId: 0,
		googleReCaptchaSiteKey: '',
		websiteRoot: '/',
		isotope: false,
		rating: false,
		likes: false,
		votes: false,
		dynamicLoading: false,
		dynamicLoadingOnScroll: false,
		shareThis: false,
		addThis: false,
		addThisProfileID: '',
		audioJs: false,
		initialPage: 1,
		userLoggedIn: false,
		communityMode: false,
		enableUserUpload: false,
		enableMediaEdit: false,
		enableGalleryEdit: false,
		enableCategoryEdit: false,
		useHtmlEditpr: false,
		supportswebp: false,
		contentParent: {
			type: '',
			id: 0
		},
		itemsRemaining: 0,
		lightbox: {
			provider: 'smb',
			options: {},
			items: [],
			events: {
				redirectBeforeClose: false
			}
		},
		comments: {
			enable: false,
			requireAuthorInfo: true,
			useReCaptcha: false,
			permissions: {
				commenting: true,
				editing: false,
				deleting: false
			}
		},
		map: {
			enable: false,
			markers: [],
			options: {
				latitude: 0,
				longitude: 0,
				zoom: 12,
				mapTypeId: 'HYBRID'
			}
		},
		flowplayerSwf: '',
		itemsUrl: ''
	},
		$window = $(window),
		$document = $(document),
		itemDataKey = 'itemData',
		summernoteToolbar = [
				['font', ['bold', 'underline', 'clear']],
				['fontname', ['fontname']],
				['color', ['color']],
				['para', ['ul', 'ol', 'paragraph']],
				['insert', ['link']],
				['view', ['fullscreen', 'codeview']],
				['close', ['close']]
			];

	function GravityGallery(elem, options) {
		var self = this;
		self.$mainWrapper = $(elem);
		self.$itemsList = $('.edsgg__itemsListContainer', self.$mainWrapper);

		self.options = $.extend(
			true,
			{},
			defaultOptions,
			$.isPlainObject(options) ? options : {}
		);

		self.currentPage = self.options.initialPage;
		self.itemLoadingInProgress = false;
		self.itemsRemaining = self.options.itemsRemaining;

		if (self.options.isotope)
			self.$itemsList.isotope({
				itemSelector: '.edsgg__itemContainer',
				sortBy: 'original-order',
				masonry: {
					fitWidth: true
				}
			});

		if (self.options.likes)
			self.initLikes();

		if (self.options.dynamicLoading)
			self.initDynamicLoading();

		if ($.isArray(self.options.lightbox.items) && self.options.lightbox.items.length != 0 || $.isPlainObject(self.options.lightbox.items)) {
			if (self.options.lightbox.provider == 'smb')
				self.initSmb();
			else
				self.initSmbLight();
		}

		if (self.options.comments.enable)
			self.initComments();

		self.$mainWrapper.on('click', '.edsgg__itemContainer .edsgg__exifData .edsgg__extendedExifTableToggle', function () {
			var $exifData = $(this).parents('.edsgg__exifData'),
				$extendedExifTableWrapper = $('.edsgg__extendedExifTableWrapper', $exifData),

				showExtendedClass = 'edsgg__showExtendedExif';

			$exifData.toggleClass(showExtendedClass);

			if ($exifData.hasClass(showExtendedClass))
				$extendedExifTableWrapper
					.stop(true)
					.slideDown(200);
			else
				$extendedExifTableWrapper
					.stop(true)
					.slideUp(200);
		});

		if (self.options.map.enable)
			self.initMap();

		if (self.options.enableUserUpload)
			self.initUserUpload();

		self.initReinit();
		self.reinitialize();
	}

	GravityGallery.prototype = {
		initUserUpload: function () {
			function setFineUploaderSettings() {
				var newfineUploaderSettings = simpleVideoFineUploaderSettings(self.options.moduleId);
				newfineUploaderSettings.params["galleryId"] = $('option:selected', '#edsgg_GallerySelect' + self.options.moduleId).val();
				newfineUploaderSettings.params["postToJournal"] = $('#edsgg_PostToJournal' + self.options.moduleId).is(":checked");
				newfineUploaderSettings.params["roleid"] = $('input[name=eds_gg_userUploadGalleryRole' + self.options.moduleId + ']').val();
				eds3_5_jq('#galleryImageFineUploaderContainer' + self.options.moduleId).edsFineUploader_1_3('setParams', newfineUploaderSettings.params);
			}
			var self = this;
			var fineUploaderSettings = simpleVideoFineUploaderSettings(self.options.moduleId);
			if (self.options.useMultiUpload) {
				fineUploaderSettings.params["galleryId"] = $('option:selected', '#edsgg_GallerySelect' + self.options.moduleId).val();
				fineUploaderSettings.params["postToJournal"] = $('#edsgg_PostToJournal' + self.options.moduleId).is(":checked");
				fineUploaderSettings.params["roleid"] = $('input[name=eds_gg_userUploadGalleryRole' + self.options.moduleId + ']').val();
				eds3_5_jq('#galleryImageFineUploaderContainer' + self.options.moduleId).edsFineUploader_1_3(fineUploaderSettings);
				$('#edsgg_GallerySelect' + self.options.moduleId).change(function () {
					setFineUploaderSettings();
				});
				$('#edsgg_PostToJournal' + self.options.moduleId).change(function () {
					setFineUploaderSettings();
				});
			}
			else {
				$('#eds_gg_btnSinglefileUpload' + self.options.moduleId).click(function () {
					$('#edsgg_uploadFileMessage' + self.options.moduleId).hide();
					$('.eds_modalWrapper input[name=eds_gg_FormNeedRefresh]', self.$mainWrapper).val("true");
					var fileUpload = $('#eds_gg_singlefileUpload' + self.options.moduleId).get(0);
					var file = fileUpload.files;
					var formData = new FormData();
					formData.append(file[0].name, file[0]);
					$.ajax({
						url: fineUploaderSettings.endpoint + '&moduleid=' + self.options.moduleId + '&galleryid=' + $('option:selected', '#edsgg_GallerySelect' + self.options.moduleId).val(),
						type: "POST",
						contentType: false,
						cache: false,
						processData: false,
						data: formData,
						dataType: "json",
						success: function (response) {

							if (response.success !== undefined && response.success === true) {
								$('#edsgg_uploadFileMessage' + self.options.moduleId).show();
								$('#eds_gg_singlefileUpload' + self.options.moduleId).val("");
							}
						},
						error: function (err) {
						}
					});
				});
			}
			eds3_5_jq('div.edg_Tabulator').edsTabulator_1();

			self.$mainWrapper.on('click', '.edsgg__userUpload' + self.options.moduleId + ' .edsgg__userUpload_addEmbedVideo', function (e) {
				var videoUrl = $('input[name=edsgg_embedVideoUrl' + self.options.moduleId + ']').val();
				var urlRegex = new RegExp("[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?","gi");
				$('#edsgg_embedVideoMessage' + self.options.moduleId).hide();
				$('#edsgg_embedVideoErrorMessage' + self.options.moduleId).hide();
				$('#edsgg_embedVideoMessageNovalidUrl' + self.options.moduleId).hide();
				if (!urlRegex.test(videoUrl)) {
					$('#edsgg_embedVideoMessageNovalidUrl' + self.options.moduleId).show();
					return;
				}
				var params = {
					moduleid: self.options.moduleId,
					tabid: self.options.tabId,
					galleryid: $('option:selected', '#edsgg_GallerySelect' + self.options.moduleId).val(),
					embed: 'true',
					videourl: encodeURIComponent(videoUrl)
				};
				$.ajax({
					type: 'GET',
					url: fineUploaderSettings.endpoint,
					cache: false,
					dataType: 'json',
					timeout: 150000,
					data: params,
					success: function (response) {
						if (response.success !== undefined && response.success === true) {
							$('#edsgg_embedVideoUrl' + self.options.moduleId).val('');
							$('#edsgg_embedVideoMessage' + self.options.moduleId).show();
						}
						else if (response.success !== undefined && response.success === false) {
							$('#edsgg_embedVideoErrorMessage' + self.options.moduleId).show();
							$('#edsgg_embedVideoErrorMessage' + self.options.moduleId).text(response.message);
						}
					},
					complete: function () {
						$('.eds_modalWrapper input[name=eds_gg_FormNeedRefresh]', self.$mainWrapper).val("true");
					}
				});
				return false;
			})
		},
		reinitialize: function () {
			var self = this,
				imageLoadedKey = 'imageLoaded';

			if (self.options.isotope)
				$('> .edsgg__itemContainer img', self.$itemsList)
					.imagesLoaded()
						.progress(function (instance, image) {
							var $img = $(image.img);

							if ($img.data(imageLoadedKey))
								return;

							$img.data(imageLoadedKey, true);

							self.$itemsList.isotope('layout');
						});

			if (self.options.shareThis && window.st) {
				window.st.initialize()
				
			}

			if (self.options.rating)
				self.initRating();

			if (self.options.audioJs)
				audiojs.createAll();

			fluidvids.init({
				selector: '.edsgg__embedWrapper iframe',
				players: ['www.youtube.com', 'player.vimeo.com', 'fast.wistia.net']
			});

			if ($().flowplayer != undefined)
				$('.edsgg__flowplayer', self.$mainWrapper).flowplayer({
					swf: self.options.flowplayerSwf
				});
			if (self.options.enableMediaEdit)
				self.initMediaEditing();
			if (self.options.enableGalleryEdit)
				self.initGalleryEditing();
			if (self.options.enableCategoryEdit)
				self.initCategoryEditing();
			self.initMediaReporting();
		},
		initMap: function () {
			var self = this,
				itemMap = new google.maps.Map(
					$('.edsgg__gMap', self.$mainWrapper)[0],
					{
						center: new google.maps.LatLng(self.options.map.options.latitude, self.options.map.options.longitude),
						zoom: self.options.map.options.zoom,
						mapTypeId: google.maps.MapTypeId[self.options.map.options.mapTypeId]
					}
				),
				infoWindow,
				markers = self.options.map.markers,
				marker,
				i;

			if ($.isArray(markers) && markers.length != 0) {
				for (i = 0; i < markers.length; i++) {
					marker = new google.maps.Marker({
						position: new google.maps.LatLng(markers[i].latitude, markers[i].longitude),
						map: itemMap,
						title: typeof markers[i].title == 'string' ? markers[i].title : ''
					});

					if (typeof markers[i].content == 'string' && markers[i].content != '') {
						infoWindow = new google.maps.InfoWindow();

						google.maps.event.addListener(
							marker,
							'click',
							function () {
								infoWindow.setContent(markers[i].content);
								infoWindow.open(itemMap, marker);
							}
						);
					}
				}
			}
		},
		initRating: function () {
			var self = this,
				dataKey = 'rateitEventRegistered';


			if ($().rateit != undefined)
				$('.edsgg__mediaRatingAction', self.$mainWrapper).rateit();

			$('div.edsgg__mediaRatingAction', self.$mainWrapper).each(function () {
				var $mediaRatingAction = $(this);

				if ($mediaRatingAction.data(dataKey))
					return;

				$mediaRatingAction.data(dataKey, true);

				$mediaRatingAction.bind('rated', function () {
					var $rateIt = $(this),
						$itemContainer = $mediaRatingAction.parents('.edsgg__itemContainer');

					$rateIt.rateit('readonly', true);

					$.ajax({
						type: 'GET',
						url: self.options.websiteRoot + 'DesktopModules/EasyDNNGallery/Services/SocialMediaBox.ashx',
						cache: false,
						dataType: 'json',
						timeout: 150000,
						data: {
							action: 'rate',
							portalId: self.options.portalId,
							moduleId: self.options.moduleId,
							entry: $itemContainer.data(itemDataKey).mediaId,
							rating: $rateIt.rateit('value')
						},
						success: function (response) {
							if (response.status != undefined && response.status == 'success') {
								$('.edsgg__mediaRatingValue', $itemContainer).text(response.score);
							}
						}
					});
				});
			});
		},
		initLikes: function () {
			var self = this;

			self.$mainWrapper.on('click', '.edsgg__likeAction', function () {
				var $this = $(this),
					$itemContainer = $this.parents('.edsgg__itemContainer'),
					$likeActions = $('.edsgg__likeAction', $itemContainer),
					inProgressClass = 'edsgg__actionInProgress',
					ajaxRequestKey = 'likeAjaxRequest',
					secondRequestKey = 'secondLikeAjaxRequest',
					previousRequest = $itemContainer.data(ajaxRequestKey),
					itemData = $itemContainer.data(itemDataKey),

					generateRequest = function (completeCallback) {
						var newLikes,
							likedClass = 'edsgg__liked',
							params = {
								portalId: self.options.portalId,
								moduleId: self.options.moduleId,
								mediaId: itemData.mediaId
							};

						if (itemData.likes.likedByUser) {
							$likeActions.removeClass(likedClass);
							itemData.likes.likedByUser = false;
						} else {
							$likeActions.addClass(likedClass);
							itemData.likes.likedByUser = true;
						}

						newLikes = parseInt(itemData.likes.numberOf, 10) + (itemData.likes.likedByUser ? 1 : -1);

						itemData.likes.numberOf = newLikes;
						$('.edsgg__numberOfLikes', $itemContainer).text(newLikes);

						if (typeof itemData.journalId == 'number') {
							params.action = 'like';
							params.journalid = itemData.journalId;
							params.liked = itemData.likes.likedByUser;
						} else {
							params.action = 'media_like';
							params.vote = itemData.likes.likedByUser ? 1 : -1;
						}

						$itemContainer.data(ajaxRequestKey, $.ajax({
							type: 'GET',
							url: self.options.websiteRoot + 'DesktopModules/EasyDNNGallery/Services/SocialMediaBox.ashx',
							cache: false,
							dataType: 'json',
							timeout: 150000,
							data: params,
							complete: completeCallback
						}));
					};

				if (!self.options.userLoggedIn && previousRequest) {
					if ($likeActions.hasClass(inProgressClass))
						return;

					$likeActions.addClass(inProgressClass);

					$itemContainer.data(secondRequestKey, function () {
						generateRequest(function () {
							$likeActions.removeClass(inProgressClass);

							$itemContainer
								.data(secondRequestKey, null)
								.data(ajaxRequestKey, null);
						});
					});

					return;
				}

				if (previousRequest && previousRequest.readyState != 4)
					previousRequest.abort();

				generateRequest(function () {
					if ($likeActions.hasClass(inProgressClass))
						$itemContainer.data(secondRequestKey)();
					else
						$itemContainer.data(ajaxRequestKey, null);
				});
			});
		},
		initDynamicLoading: function () {
			var self = this,
				loadMedia = function () {
					var params = {
						portalId: self.options.portalId,
						moduleId: self.options.moduleId,
						emodule: self.options.moduleId,
						tabId: self.options.tabId,
						page: self.currentPage + 1,
						supportswebp: self.options.supportswebp
					};

					if (self.itemsRemaining == 0 || self.itemLoadingInProgress)
						return false;

					if (self.options.userId)
						params.userId = self.options.userId;
					else if (self.options.groupId)
						params.groupId = self.options.groupId;

					self.itemLoadingInProgress = true;

					$('.edsgg__loadMediaTrigger', self.$mainWrapper).addClass('loading');

					if (self.options.contentParent.type != '')
						if (self.options.contentParent.type == 'category')
							params.ecategory = self.options.contentParent.id;
						else if (self.options.contentParent.type == 'gallery')
							params.egallery = self.options.contentParent.id;

					$.ajax({
						type: 'GET',
						url: self.options.websiteRoot + 'DesktopModules/EasyDNNGallery/Services/LoadMediaHtmlData.ashx',
						cache: false,
						dataType: 'json',
						timeout: 150000,
						data: params,
						success: function (response) {
							var $items;

							if (response.status != undefined && response.status == 'success') {
								var $allItems = $(response.itemsHtml),
									isotopeItems = [];

								$allItems.each(function () {
									var item = this;

									if ($(item).hasClass('edsgg__itemContainer'))
										if (self.options.isotope)
											isotopeItems.push(item);

									self.$itemsList.append(item);
								});

								if (self.options.isotope)
									self.$itemsList.isotope('insert', isotopeItems);

								self.reinitialize();

								$('.edsgg__loadMediaTriggerText > span', self.$mainWrapper).text(response.buttonText);

								self.itemsRemaining = response.itemsRemaining;
								if (self.itemsRemaining == 0)
									$('.edsgg__loadMediaWrapper', self.$mainWrapper).addClass('hide');

								self.currentPage++;
							}
						},
						complete: function () {
							self.itemLoadingInProgress = false;

							$('.edsgg__loadMediaTrigger', self.$mainWrapper).removeClass('loading');
						}
					});

					return false;
				};

			if (self.itemsRemaining == 0)
				return;

			if (self.options.dynamicLoadingOnScroll)
				$window.scroll(function () {
					if ($document.height() - $window.scrollTop() - $window.height() < 500)
						loadMedia();
				});

			self.$mainWrapper.on('click', '.edsgg__loadMediaTrigger', loadMedia);
		},
		initReinit: function () {
			var self = this,
				reinitGravity = function () {
					self.reinitialize();
				}
			self.$mainWrapper.on('click', '.edsgg__galleryReInitM' + self.options.moduleId, reinitGravity);
		},
		initSmb: function () {
			var self = this;

			self.$mainWrapper.on('click', '.edsgg__itemDetailsAndLightboxTrigger', function (e) {
				var $this = $(this),
					$itemContainer = $this.parents('.edsgg__itemContainer'),
					itemId = $itemContainer.data(itemDataKey).mediaId,
					items = self.options.lightbox.items,
					itemToOpen = self.options.lightbox.items[0],
					smbOptions = {
						openAt: 0
					};


				if ($this.attr('href') != '#')
					return;

				if (self.options.contentParent.type == 'category' && $.isPlainObject(self.options.lightbox.items) && $.isArray(self.options.lightbox.items[itemId])) {
					items = self.options.lightbox.items[itemId];
				} else {
					$.each(items, function (i, item) {
						if (item.id == itemId) {
							smbOptions.openAt = i;
							itemToOpen = item;
							return false;
						}
					});
				}
				var $selectedItem = $('.edg__gravityPortfolio_active', self.$moduleWrapper), selGalleryId = 0;
				if ($selectedItem.length > 0) {
					selGalleryId = $($selectedItem).data('galleryid');
				}
				if (self.options.lightbox.options.portfolioMode && selGalleryId != 0 && selGalleryId != -1 && $('.edsgg__galleryReInitM' + self.options.moduleId).length > 0 && ($('.edsgg__galleryReInitM' + self.options.moduleId, self.$moduleWrapper).data('galleryid') != '0' && $('.edsgg__galleryReInitM' + self.options.moduleId, self.$moduleWrapper).data('galleryid') != '-1')) {
					items = [];
					items = $.grep(self.options.lightbox.items, function (h) {
						return h.galleryId == itemToOpen.galleryId;
					});

					$.each(items, function (i, item) {
						if (item.id == itemId) {
							smbOptions.openAt = i;
							return false;
						}
					});
				}

				if (self.options.lightbox.events.redirectBeforeClose) {
					smbOptions.events = {
						onBeforeClose: function (state) {
							var activeItem = state.displayItems[state.activeItem];

							if (activeItem.id == itemId)
								return;

							if (typeof self.options.itemsUrl == 'string' && self.options.itemsUrl != '') {
								var pattern = new RegExp('--itemId--', 'gi');
								window.location = self.options.itemsUrl.replace(pattern, activeItem.id);
								return false;
							}
						}
					}
				}

				smbOptions = $.extend(true, {}, self.options.lightbox.options, smbOptions);

				$('<p />')
					.data('socialMediaBox', items)
					.socialMediaBox(smbOptions);

				e.preventDefault();
			});
		},
		initSmbLight: function () {
			var self = this;

			self.$mainWrapper.on('click', '.edsgg__itemDetailsAndLightboxTrigger', function (e) {
				var $this = $(this),
					$itemContainer = $this.parents('.edsgg__itemContainer'),
					itemId = $itemContainer.data(itemDataKey).mediaId,
					items = self.options.lightbox.items,
					itemToOpen = self.options.lightbox.items[0],
					smbOptions = {
						openAt: 0
					};

				if ($this.attr('href') != '#')
					return;

				if (self.options.contentParent.type == 'category' && $.isPlainObject(self.options.lightbox.items) && $.isArray(self.options.lightbox.items[itemId])) {
					items = self.options.lightbox.items[itemId];
				} else {
					$.each(items, function (i, item) {
						if (item.id == itemId) {
							smbOptions.openAt = i;
							itemToOpen = item;
							return false;
						}
					});
				}

				var $selectedItem = $('.edg__gravityPortfolio_active', self.$moduleWrapper), selGalleryId = 0;
				if ($selectedItem.length > 0) {
					selGalleryId = $($selectedItem).data('galleryid');
				}
				if (self.options.lightbox.options.portfolioMode && $('.edsgg__galleryReInitM' + self.options.moduleId).length && ($('.edsgg__galleryReInitM' + self.options.moduleId, self.$moduleWrapper).data('galleryid') != '0' && $('.edsgg__galleryReInitM' + self.options.moduleId, self.$moduleWrapper).data('galleryid') != '-1')) {
					items = [];
					items = $.grep(self.options.lightbox.items, function (h) {
						return h.galleryId == itemToOpen.galleryId;
					});
					$.each(items, function (i, item) {
						if (item.id == itemId) {
							smbOptions.openAt = i;
							return false;
						}
					});
				}
				if (self.options.lightbox.events.redirectBeforeClose) {
					smbOptions.events = {
						onBeforeClose: function (state) {
							var activeItem = state.displayItems[state.activeItem];

							if (activeItem.id == itemId)
								return;

							if (typeof self.options.itemsUrl == 'string' && self.options.itemsUrl != '') {
								var pattern = new RegExp('--itemId--', 'gi');
								window.location = self.options.itemsUrl.replace(pattern, activeItem.id);
								return false;
							}
						}
					}
				}

				smbOptions = $.extend(true, {}, self.options.lightbox.options, smbOptions);

				new SmbLight_1(items, smbOptions);

				e.preventDefault();
			});
		},
		initComments: function () {
			var self = this,
				emailValidation = /^(([^<>()[\]\\.,;:\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,}))$/,
				$commentsListContainer = $('.edsgg__itemContainer .edsgg__itemCommentsWrapper .edsgg__commentsListContainer', self.$mainWrapper),
				$commentsCommentFormWrapper = $('.edsgg__itemContainer .edsgg__itemCommentsWrapper .edsgg__commentsCommentFormWrapper', self.$mainWrapper),
				commentVotedClass = 'edsgg__commentVoting_voted',
				commentGoodVoteClass = 'edsgg__commentVoting_upvote',
				commentBadVoteClass = 'edsgg__commentVoting_downvote',
				captchaId,
				reCaptchaInit = function () {
					captchaId = grecaptcha.render($('.edsgg__commentsCaptchaPlaceholder', $commentsCommentFormWrapper)[0], {
						sitekey: self.options.googleReCaptchaSiteKey,
						size: 'compact'
					});
				};

			$commentsListContainer.on('click', '.edsgg__commentVoting_trigger', function () {
				var $this = $(this),
					$commentContentWrapper = $this.parents('.edsgg__commentContentWrapper').eq(0),
					$commentContainer = $commentContentWrapper.parent(),
					goodVotes = $commentContainer.data('goodVotes'),
					badVotes = $commentContainer.data('badVotes'),
					goodVoteTriggered = $this.hasClass(commentGoodVoteClass),
					userVoted = $commentContainer.data('userVoted'),
					previousRequest = $commentContainer.data('commentVoteRequest');

				if (previousRequest && previousRequest.readyState != 4)
					previousRequest.abort();

				if ($this.hasClass(commentVotedClass)) {
					$this.removeClass(commentVotedClass);
					userVoted = '';

					if (goodVoteTriggered) {
						if (goodVotes > 0)
							goodVotes -= 1;
					} else {
						if (badVotes > 0)
							badVotes -= 1;
					}
				} else {
					$this.addClass(commentVotedClass);

					if (goodVoteTriggered) {
						goodVotes += 1;

						if (userVoted == 'bad' && badVotes > 0)
							badVotes -= 1;

						userVoted = 'good';

						$('.' + commentBadVoteClass, $commentContentWrapper).removeClass(commentVotedClass);
					} else {
						badVotes += 1;

						if (userVoted == 'good' && goodVotes > 0)
							goodVotes -= 1;

						userVoted = 'bad';

						$('.' + commentGoodVoteClass, $commentContentWrapper).removeClass(commentVotedClass);
					}
				}

				$commentContainer
					.data('commentVoteRequest', $.ajax({
						type: 'GET',
						url: self.options.websiteRoot + 'DesktopModules/EasyDNNGallery/Services/SocialMediaBox.ashx',
						dataType: 'json',
						data: {
							portalId: self.options.portalId,
							moduleId: self.options.moduleId,
							action: 'comment_vote',
							commentId: $commentContainer.data('commentId'),
							voteType: goodVoteTriggered ? 'good' : 'bad'
						},
						complete: function () {
							$commentContainer.data('commentVoteRequest', undefined);
						}
					}))
					.data('badVotes', badVotes)
					.data('goodVotes', goodVotes)
					.data('userVoted', userVoted);

				$('.edsgg__commentVoting_badVotes', $commentContentWrapper).text(badVotes);
				$('.edsgg__commentVoting_goodVotes', $commentContentWrapper).text(goodVotes);
			});

			if (self.options.comments.permissions.commenting) {
				if (self.options.comments.requireAuthorInfo && self.options.comments.useReCaptcha)
					if (window.grecaptcha)
						reCaptchaInit();
					else
						window.edsgg_recaptchaCallback = function () {
							reCaptchaInit();
						};

				$commentsCommentFormWrapper.on('click', '.edsgg__commentsSubmitComment', function (e) {
					var $this = $(this),
						$itemContainer = $commentsCommentFormWrapper.parents('.edsgg__itemContainer'),
						$noCommentError = $('.edsgg__commentsNoCommentError', $commentsCommentFormWrapper),
						$authorEmailInvalidError = $('.edsgg__commentsInvalidEmailError', $commentsCommentFormWrapper),
						$authorNoEmailError = $('.edsgg__commentsNoEmailError', $commentsCommentFormWrapper),
						$authorNoNameError = $('.edsgg__commentsNoNameError', $commentsCommentFormWrapper),
						$authorNoCaptchaError = $('.edsgg__commentsNoCaptchaError', $commentsCommentFormWrapper),
						$commentsListContainer = $('.edsgg__commentsListContainer', $commentsCommentFormWrapper.parents('.edsgg__itemCommentsWrapper')),

						$commentInput = $('.edsgg__commentsCommentInput', $commentsCommentFormWrapper),
						$authorNameInput = $('.edsgg__commentsAuthorNameInput', $commentsCommentFormWrapper),
						$authorEmailInput = $('.edsgg__commentsAuthorEmailInput', $commentsCommentFormWrapper),

						$numberOfComments = $('.edsgg__numberOfComments', $itemContainer),

						itemData = $itemContainer.data(itemDataKey),
						comment = $commentInput.val(),
						authorName,
						authorEmail,
						params = {
							portalId: self.options.portalId,
							moduleId: self.options.moduleId,
							action: 'add_comment',
							entry: itemData.mediaId,
							gravityGallery: 1,
							tabid: self.options.tabId,
							mediaurl: window.location.href
						},
						errorOccurred = false,

						targetIdMatch,
						journalTargetId = 0,
						journalType = 'summary',
						replyingToComment = false;

					if ($commentsCommentFormWrapper.hasClass('edsgg__addingComment'))
						return;

					if (self.options.communityMode && itemData.journalId) {
						targetIdMatch = location.href.match(/\/userid\/\d+\//i);
						if (targetIdMatch != null) {
							journalTargetId = targetIdMatch[0].match(/\d+/)[0];
							journalType = 'profile';
						} else {
							targetIdMatch = location.href.match(/\/groupid\/\d+\//i);
							if (targetIdMatch != null) {
								journalTargetId = targetIdMatch[0].match(/\d+/)[0];
								journalType = 'group';
							}
						}

						params.journalid = itemData.journalId;
						params.journalType = journalType;
						params.journalModuleId = 0;
						params.journalTarget = journalTargetId;
					}

					$noCommentError.removeClass('show');
					$authorEmailInvalidError.removeClass('show');
					$authorNoEmailError.removeClass('show');
					$authorNoNameError.removeClass('show');
					$authorNoCaptchaError.removeClass('show');

					if (typeof comment != 'string' || comment == '') {
						errorOccurred = true;
						$noCommentError.addClass('show');
					}

					if (self.options.comments.requireAuthorInfo) {
						authorName = $authorNameInput.val();
						authorEmail = $authorEmailInput.val();

						if (typeof authorName != 'string' || authorName == '') {
							errorOccurred = true;
							$authorNoNameError.addClass('show');
						}

						if (typeof authorEmail != 'string' || authorEmail == '') {
							errorOccurred = true;
							$authorNoEmailError.addClass('show');
						} else if (!emailValidation.test(authorEmail)) {
							errorOccurred = true;
							$authorEmailInvalidError.addClass('show');
						}

						if (self.options.comments.useReCaptcha) {
							params.captcha = grecaptcha.getResponse(captchaId);

							if (params.captcha.length == 0) {
								$authorNoCaptchaError.addClass('show');
								errorOccurred = true;
							}
						}
					}

					if (!errorOccurred) {
						params.comment = comment;

						if (self.options.comments.requireAuthorInfo) {
							params.name = authorName;
							params.email = authorEmail;
						}

						if ($commentsCommentFormWrapper.hasClass('edsgg__replyingToComment')) {
							params.parentId = $commentsCommentFormWrapper.data('parentId');
							replyingToComment = true;
						}

						$commentsCommentFormWrapper.addClass('edsgg__addingComment');

						$.ajax({
							type: 'POST',
							url: self.options.websiteRoot + 'DesktopModules/EasyDNNGallery/Services/SocialMediaBox.ashx',
							dataType: 'json',
							data: params,
							success: function (response) {
								var $itemCommentContainer;

								if (!response.status)
									return;

								if (response.status == 'success') {
									if (replyingToComment) {
										$itemCommentContainer = $($commentsCommentFormWrapper.data('parentElement'))
											.removeClass('edsgg__noChildComments');
										$('> .edsgg__childCommentsContainer', $itemCommentContainer).append(response.gravityCommentHTML);
									} else {
										$commentsListContainer
											.removeClass('noComments')
											.append(response.gravityCommentHTML);
									}

									$commentInput.val('');
									$authorNameInput.val('');
									$authorEmailInput.val('');

									itemData.comments.numberOf += 1;
									$numberOfComments.text(itemData.comments.numberOf);

									if (self.options.comments.requireAuthorInfo && self.options.comments.useReCaptcha)
										grecaptcha.reset(captchaId);
								} else if (response.status == 'captcha_error') {
									$authorNoCaptchaError.addClass('show');

									if (self.options.comments.requireAuthorInfo && self.options.comments.useReCaptcha)
										grecaptcha.reset(captchaId);
								}
							},
							complete: function () {
								$commentsCommentFormWrapper.removeClass('edsgg__addingComment edsgg__replyingToComment');
							}
						});
					}
				});

				$commentsListContainer.on('click', '.edsgg__replyComment', function () {
					var $this = $(this),
						$itemCommentContainer = $this.parents('.edsgg__commentContentWrapper').parent();

					$commentsCommentFormWrapper
						.addClass('edsgg__replyingToComment')
						.data('parentId', $itemCommentContainer.data('commentId'))
						.data('parentElement', $itemCommentContainer[0]);

					$('.edsgg__replyingToMessage > a', $commentsCommentFormWrapper).attr('href', '#' + $itemCommentContainer[0].id);
					$('.edsgg__commentsCommentInput', $commentsCommentFormWrapper).val('').focus();
				});
			}

			if (self.options.comments.permissions.editing) {
				$commentsListContainer.on('click', '.edsgg__itemCommentContainer .edsgg__editComment', function () {
					var $this = $(this),
						$commentContentWrapper = $this.parents('.edsgg__commentContentWrapper'),
						$itemCommentContainer = $commentContentWrapper.parent();

					if ($itemCommentContainer.hasClass('edsgg__editingComment'))
						return;

					$('.edsgg__editCommentContainer .edsgg__editCommentContent', $commentContentWrapper).val($itemCommentContainer.data('rawComment'));

					$itemCommentContainer.addClass('edsgg__editingComment');
				});

				$commentsListContainer.on('click', '.edsgg__itemCommentContainer .edsgg__editCommentContainer .edsgg__editCommentCancelTrigger', function () {
					var $this = $(this),
						$editCommentContainer = $this.parents('.edsgg__editCommentContainer');

					$editCommentContainer.parents('.edsgg__commentContentWrapper').parent().removeClass('edsgg__editingComment');

					$('.edsgg__editCommentContent', $editCommentContainer).val('');
				});

				$commentsListContainer.on('click', '.edsgg__itemCommentContainer .edsgg__editCommentContainer .edsgg__editCommentSaveTrigger', function () {
					var $this = $(this),
						$editCommentContainer = $this.parents('.edsgg__editCommentContainer'),
						$commentContentWrapper = $editCommentContainer.parents('.edsgg__commentContentWrapper'),
						$itemCommentContainer = $commentContentWrapper.parent(),
						$newComment = $('.edsgg__editCommentContent', $editCommentContainer),

						commentId = $itemCommentContainer.data('commentId'),
						commentContent = $newComment.val();

					if ($itemCommentContainer.hasClass('edsgg__savingChanges'))
						return;

					if (commentContent == '') {
						$('.edsgg__commentsNoCommentError', $editCommentContainer).addClass('show');

						return;
					}

					$itemCommentContainer.addClass('edsgg__savingChanges');

					$('.edsgg__commentsNoCommentError', $editCommentContainer).removeClass('show');

					$.ajax({
						type: 'GET',
						url: self.options.websiteRoot + 'DesktopModules/EasyDNNGallery/Services/SocialMediaBox.ashx',
						dataType: 'json',
						data: {
							portalId: self.options.portalId,
							moduleId: self.options.moduleId,
							action: 'edit_comment',
							comment: commentContent,
							id: commentId
						},
						success: function (response) {
							if (response.status != undefined && response.status == 'success') {
								$('.edsgg__commentContent', $commentContentWrapper).html(response.comment);
								$newComment.val('');

								$itemCommentContainer.data('rawComment', commentContent);
							}
						},
						complete: function () {
							$itemCommentContainer.removeClass('edsgg__savingChanges edsgg__editingComment')
						}
					});
				});
			}

			if (self.options.comments.permissions.deleting) {
				$commentsListContainer.on('click', '.edsgg__itemCommentContainer .edsgg__deleteComment', function () {
					var $this = $(this),
						$itemCommentContainer = $this.parents('.edsgg__commentContentWrapper').parent(),
						$itemContainer = $itemCommentContainer.parents('.edsgg__itemContainer'),
						$numberOfComments = $('.edsgg__numberOfComments', $itemContainer),

						itemData = $itemContainer.data(itemDataKey),
						commentRemoved = false,
						commentId = $itemCommentContainer.data('commentId');

					if (confirm('Do you really want to delete this comment?')) {
						if ($itemCommentContainer.hasClass('edsgg__deletingComment'))
							return;

						$itemCommentContainer.addClass('edsgg__deletingComment');

						$.ajax({
							type: 'GET',
							url: self.options.websiteRoot + 'DesktopModules/EasyDNNGallery/Services/SocialMediaBox.ashx',
							dataType: 'json',
							data: {
								portalId: self.options.portalId,
								moduleId: self.options.moduleId,
								action: 'delete_comment',
								id: commentId
							},
							success: function (response) {
								if (response.status != undefined && response.status == 'success') {
									commentRemoved = true;

									if ($('.edsgg__childCommentsContainer >', $itemCommentContainer).length == 0)
										$itemCommentContainer.slideUp(200, function () {
											var $commentContainerParent = $itemCommentContainer.parent(),
												noMoreChildComments = false;

											if ($commentContainerParent.hasClass('edsgg__childCommentsContainer') && $itemCommentContainer.siblings().length == 0)
												noMoreChildComments = true;

											$itemCommentContainer.remove();

											if (noMoreChildComments)
												$commentContainerParent.parent().addClass('edsgg__noChildComments');
										});
									else
										$itemCommentContainer.addClass('edsgg__deleted');

									if (itemData.comments.numberOf > 0)
										itemData.comments.numberOf -= 1;

									$numberOfComments.text(itemData.comments.numberOf);

									if (commentId == $commentsCommentFormWrapper.data('parentId'))
										$commentsCommentFormWrapper
											.removeClass('edsgg__replyingToComment')
											.data('parentId', undefined);
								}
							},
							complete: function () {
								$itemCommentContainer.removeClass('edsgg__deletingComment');
							}
						});
					}
				});
			}
		},
		initMediaEditing: function () {
			var self = this,
			$mediaEditingTrigger = $('.edsgg__userMediaEdit', self.$mainWrapper)
			$mediaEditingTrigger.on('click', function () {
				var medaiIdToEdit = $(this).data('mediaid');
				
				$.ajax({
					type: 'GET',
					url: self.options.websiteRoot + 'DesktopModules/EasyDNNGallery/Services/EditMediaData.ashx',
					cache: false,
					dataType: 'json',
					timeout: 150000,
					data: {
						action: 'getmedia',
						portalId: self.options.portalId,
						moduleId: self.options.moduleId,
						mediaId: medaiIdToEdit
					},
					success: function (response) {
						if (response.status != undefined && response.status == 'success') {
							$('#eds_gg_editMediaContainer' + self.options.moduleId, self.$mainWrapper).show();
							$('#eds_gg_editMediaDeletedConfirmContainer' + self.options.moduleId, self.$mainWrapper).hide();
							$('#eds_gg_mediatitle' + self.options.moduleId, self.$mainWrapper).val(response.mediaTitle);
							$('#eds_gg_mediadescription' + self.options.moduleId, self.$mainWrapper).val(response.mediatDescription);
							$('#eds_gg_mediatags' + self.options.moduleId, self.$mainWrapper).val(response.mediaTags);
							var $select = $('#eds_gg_mediatags' + self.options.moduleId, self.$mainWrapper).selectize();
							var selectize = $select[0].selectize;
							selectize.clear();
							var arrayLength = response.mediaTags.length;
							for (var i = 0; i < arrayLength; i++) {
								selectize.createItem(response.mediaTags[i]);
							}
							
							$('input[name=eds_gg_editMediaId' + self.options.moduleId + ']').val(medaiIdToEdit);
							$('#eds_gg_mediathumbnail' + self.options.moduleId, self.$mainWrapper).attr("src", response.mediaThumbnail);

							if(self.options.useHtmlEditpr ==true)
							{
								$('#eds_gg_mediadescription' + self.options.moduleId, self.$mainWrapper).summernote({
									toolbar: summernoteToolbar,
									height: 110
								});
							}
							$('#edn_userUploadModalTrigger_' + medaiIdToEdit, self.$mainWrapper).click();
						}
					}
				});
				return false;
			})
		},
		initMediaReporting: function () {
			var self = this,
			$mediaEditingTrigger = $('.edsgg__userMediaReport', self.$mainWrapper)
			$mediaEditingTrigger.on('click', function () {
				var medaiIdToEdit = $(this).data('mediaid');
				$('input[name=eds_gg_reportMediaId' + self.options.moduleId + ']').val(medaiIdToEdit);
				$('#edn_userReportModalTrigger_' + medaiIdToEdit, self.$mainWrapper).click();
				return false;
			})
		},
		initGalleryEditing: function () {
			var self = this,
			$galleryEditingTrigger = $('.edsgg__userGalleryEdit', self.$mainWrapper);
			$galleryEditingTrigger.on('click', function () {
				var galleryIdToEdit = $(this).data('galleryid');
				$.ajax({
					type: 'GET',
					url: self.options.websiteRoot + 'DesktopModules/EasyDNNGallery/Services/EditMediaData.ashx',
					cache: false,
					dataType: 'json',
					timeout: 150000,
					data: {
						action: 'getgallery',
						portalId: self.options.portalId,
						moduleId: self.options.moduleId,
						galleryId: galleryIdToEdit
					},
					success: function (response) {
						if (response.status != undefined && response.status == 'success') {
							$('#eds_gg_editGalleryContainer' + self.options.moduleId, self.$mainWrapper).show();
							$('#eds_gg_editGalleryDeletedConfirmContainer' + self.options.moduleId, self.$mainWrapper).hide();
							$('#eds_gg_GalleryTiTleEdit' + self.options.moduleId, self.$mainWrapper).val(response.galleryTitle);
							$('#eds_gg_GalleryDescriptionEdit' + self.options.moduleId, self.$mainWrapper).val(response.galleryDescription);
							$('input[name=eds_gg_editGalleryId' + self.options.moduleId + ']').val(galleryIdToEdit);
							$('#edn_editGalleryModalTrigger_' + galleryIdToEdit, self.$mainWrapper).click();
							if (response.mediaToDisplay == "0")
								$('#edsgg_DeleteGalleryData' + self.options.moduleId, self.$mainWrapper).show();
							if ($('#edsgg_userCreateGallerySecurityOptions' + self.options.moduleId).length) {
								$('#edsgg_userCreateGallerySecurityOptions' + self.options.moduleId).val(response.privacyOptions);
							}
						}
					}
				});
				return false;
			})
		},
		initCategoryEditing: function () {
			var self = this,
			$categoryEditingTrigger = $('.edsgg__userCategoryEdit', self.$mainWrapper);
			$categoryEditingTrigger.on('click', function () {
				var categoryIdToEdit = $(this).data('categoryid');
				$.ajax({
					type: 'GET',
					url: self.options.websiteRoot + 'DesktopModules/EasyDNNGallery/Services/EditMediaData.ashx',
					cache: false,
					dataType: 'json',
					timeout: 150000,
					data: {
						action: 'getcategory',
						portalId: self.options.portalId,
						moduleId: self.options.moduleId,
						categoryId: categoryIdToEdit
					},
					success: function (response) {
						if (response.status != undefined && response.status == 'success') {
							$('#eds_gg_editcategorytitle' + self.options.moduleId, self.$mainWrapper).val(response.categoryTitle);
							$('#eds_gg_editcategorydescription' + self.options.moduleId, self.$mainWrapper).val(response.categoryDescription);
							$('input[name=eds_gg_editCategoryId' + self.options.moduleId + ']').val(categoryIdToEdit);
							$('#edn_editCategoryModalTrigger_' + categoryIdToEdit, self.$mainWrapper).click();
							if (response.numberofGalleries == "0")
								$('#edsgg_DeleteCategoryData' + self.options.moduleId, self.$mainWrapper).show();
						}
					}
				});
				return false;
			})
		},
	};

	$.fn.edsGravityGallery = function () {
		var args = arguments,
			gravityGalleryInstanceKey = 'eds_gravityGallery';

		return this.each(function () {
			var self = this;

			if (!$.data(self, gravityGalleryInstanceKey))
				$.data(self, gravityGalleryInstanceKey, new GravityGallery(self, args[0]));
		});
	};
})(eds3_5_jq, window, document);

(function ($, window, undefined) {
	var requestSent = false;
	window.GravityGalleryActions = {
		saveMediaData: function (portalId, moduleId) {
			if (requestSent)
				return;
			var $mainWrapper = $('#main_eds_Gallery_Wrapper' + moduleId);
			var mediaTitle = $('#eds_gg_mediatitle' + moduleId, $mainWrapper).val(),
				mediaDescription = $('#eds_gg_mediadescription' + moduleId, $mainWrapper).val(),
				mediaTags = $('#eds_gg_mediatags' + moduleId, $mainWrapper).val(),
				medaiIdToEdit = $('input[name=eds_gg_editMediaId' + moduleId + ']').val();
			$.ajax({
				type: 'POST',
				url: '/DesktopModules/EasyDNNGallery/Services/EditMediaData.ashx',
				cache: false,
				dataType: 'json',
				timeout: 150000,
				data: {
					action: 'savemedia',
					portalId: portalId,
					moduleId: moduleId,
					mediaId: medaiIdToEdit,
					title: mediaTitle,
					description: mediaDescription,
					tags: mediaTags
				},
				success: function (response) {
					if (response.status != undefined && response.status == 'success') {
						$('#edsgg_EditMediaMessage' + moduleId).show();
					}
					else if (response.status !== undefined && response.status == 'error') {
						$('#edsgg_EditMediaErrorMessage' + moduleId).show();
						$('#edsgg_EditMediaErrorMessage' + moduleId).text(response.message);
					}
				},
				complete: function () {
					$('.eds_modalWrapper input[name=eds_gg_FormNeedRefresh]', self.$mainWrapper).val("true");
					requestSent = false;
				}
			});
		},
		openDeleteMediaDialog: function (portalId, moduleId) {
						$('#eds_gg_editMediaContainer' + moduleId).hide();
						$('#eds_gg_editMediaDeletedConfirmContainer' + moduleId).show();
		},
		closeDeleteMediaDialog: function (portalId, moduleId) {
			$('#eds_gg_editMediaContainer' + moduleId).show();
			$('#eds_gg_editMediaDeletedConfirmContainer' + moduleId).hide();
		},
		deleteMediaData: function (portalId, moduleId) {
			if (requestSent)
				return;
			var $mainWrapper = $('#main_eds_Gallery_Wrapper' + moduleId),
				medaiIdToEdit = $('input[name=eds_gg_editMediaId' + moduleId + ']').val();
			$.ajax({
				type: 'GET',
				url: '/DesktopModules/EasyDNNGallery/Services/EditMediaData.ashx',
				cache: false,
				dataType: 'json',
				timeout: 150000,
				data: {
					action: 'deletemedia',
					portalId: portalId,
					moduleId: moduleId,
					mediaId: medaiIdToEdit
				},
				success: function (response) {
					if (response.status != undefined && response.status == 'success') {
						$('#eds_gg_editMediaContainer' + moduleId).hide();
						$('#eds_gg_editMediaDeletedConfirmContainer' + moduleId).hide();
						$('#eds_gg_editMediaDeletedContainer' + moduleId).show();
						$('.eds_modalWrapper input[name=eds_gg_editMediaDeleted]').val("true");
					}
					else if (response.status !== undefined && response.status == 'error') {
						$('#edsgg_EditMediaErrorMessage' + moduleId).show();
						$('#edsgg_EditMediaErrorMessage' + moduleId).text(response.message);
					}
				},
				complete: function () {
					$('.eds_modalWrapper input[name=eds_gg_FormNeedRefresh]', self.$mainWrapper).val("true");
					requestSent = false;
				}
			});
		},
		saveGalleryData: function (portalId, moduleId) {
			if (requestSent)
				return;
			var $mainWrapper = $('#main_eds_Gallery_Wrapper' + moduleId),
				galleryTitle = $('#eds_gg_GalleryTiTleEdit' + moduleId, $mainWrapper).val(),
				galleryDescription = $('#eds_gg_GalleryDescriptionEdit' + moduleId, $mainWrapper).val(),
				galleryIdToEdit = $('input[name=eds_gg_editGalleryId' + moduleId + ']', $mainWrapper).val(),
				privacyOption = "0";
			if (!galleryTitle.trim()) {
				$('#edsgg_CreateGalleryNoTitleErrorMessage' + moduleId).show();
				return;
			}
			if ($('#edsgg_userCreateGallerySecurityOptions' + moduleId).length) {
				privacyOption = $('option:selected', '#edsgg_userCreateGallerySecurityOptions' + moduleId).val();
			}
			$.ajax({
				type: 'GET',
				url: '/DesktopModules/EasyDNNGallery/Services/EditMediaData.ashx',
				cache: false,
				dataType: 'json',
				timeout: 150000,
				data: {
					action: 'savegallery',
					portalId: portalId,
					moduleId: moduleId,
					galleryId: galleryIdToEdit,
					title: galleryTitle,
					description: galleryDescription,
					privacy: privacyOption
				},
				success: function (response) {
					if (response.status != undefined && response.status == 'success') {
						$('#edsgg_EditGalleryMessage' + moduleId).show();
					}
					else if (response.status !== undefined && response.status == 'error') {
						$('#edsgg_EditGalleryErrorMessage' + moduleId).show();
						$('#edsgg_EditGalleryErrorMessage' + moduleId).text(response.message);
					}
				},
				complete: function () {
					$('.eds_modalWrapper input[name=eds_gg_FormNeedRefresh]', self.$mainWrapper).val("true");
					requestSent = false;
				}
			});
		},
		openDeleteGalleryDialog: function (portalId, moduleId) {
			$('#eds_gg_editGalleryContainer' + moduleId).hide();
			$('#eds_gg_editGalleryDeletedConfirmContainer' + moduleId).show();
					},
		closeDeleteGalleryDialog: function (portalId, moduleId) {
			$('#eds_gg_editGalleryContainer' + moduleId).show();
			$('#eds_gg_editGalleryDeletedConfirmContainer' + moduleId).hide();
			},
		deleteGalleryData: function (portalId, moduleId) {
			if (requestSent)
				return;
			var $mainWrapper = $('#main_eds_Gallery_Wrapper' + moduleId),
				galleryIdToDelete = $('input[name=eds_gg_editGalleryId' + moduleId + ']', $mainWrapper).val();
			$.ajax({
				type: 'GET',
				url: '/DesktopModules/EasyDNNGallery/Services/EditMediaData.ashx',
				cache: false,
				dataType: 'json',
				timeout: 150000,
				data: {
					action: 'deletegallery',
					portalId: portalId,
					moduleId: moduleId,
					galleryId: galleryIdToDelete
				},
				success: function (response) {
					if (response.status != undefined && response.status == 'success') {
						$('#eds_gg_editGalleryContainer' + moduleId).hide();
						$('#eds_gg_editGalleryDeletedConfirmContainer' + moduleId).hide();
						$('#eds_gg_editGalleryDeletedContainer' + moduleId).show();
					}
					else if (response.status !== undefined && response.status == 'error') {
						$('#edsgg_EditGalleryErrorMessage' + moduleId).show();
						$('#edsgg_EditGalleryErrorMessage' + moduleId).text(response.message);
					}
				},
				complete: function () {
					$('.eds_modalWrapper input[name=eds_gg_FormNeedRefresh]', self.$mainWrapper).val("true");
					requestSent = false;
				}
			});
		},
		createGallery: function (portalId, moduleId) {
			if (requestSent)
				return;
			$('#edsgg_CreateGalleryErrorMessage' + moduleId).hide();
			$('#edsgg_CreateGalleryMessage' + moduleId).hide();
			$('#edsgg_CreateGalleryNoTitleErrorMessage' + moduleId).hide();
			var $mainWrapper = $('#main_eds_Gallery_Wrapper' + moduleId),
				galleryTitle = $('#eds_gg_gallerytitle' + moduleId, $mainWrapper).val(),
				galleryDescription = $('#eds_gg_gallerydescription' + moduleId, $mainWrapper).val(),
				parentCategoryId = $('option:selected', '#edsgg_userCreateGalleryCategorySelect' + moduleId).val(),
				privacySettings = $('option:selected', '#edsgg_userCreateGallerySecurityOptions' + moduleId).val(),
				group = $('input[name=eds_gg_userCreateGalleryRole' + moduleId + ']').val();
			if (!galleryTitle.trim()) {
				$('#edsgg_CreateGalleryNoTitleErrorMessage' + moduleId).show();
				return;
			}
			$.ajax({
				type: 'GET',
				url: '/DesktopModules/EasyDNNGallery/Services/EditMediaData.ashx',
				cache: false,
				dataType: 'json',
				timeout: 150000,
				data: {
					action: 'creategallery',
					portalId: portalId,
					moduleId: moduleId,
					categoryId: parentCategoryId,
					title: galleryTitle,
					description: galleryDescription,
					privacy: privacySettings,
					role: group
				},
				success: function (response) {
					if (response.status != undefined && response.status == 'success') {
						$('#edsgg_CreateGalleryMessage' + moduleId).show();
						$('#eds_gg_gallerytitle' + moduleId, $mainWrapper).val("");
						$('#eds_gg_gallerydescription' + moduleId, $mainWrapper).val("");
					}
					else if (response.status !== undefined && response.status == 'error') {
						$('#edsgg_CreateGalleryErrorMessage' + moduleId).show();
						$('#edsgg_CreateGalleryErrorMessage' + moduleId).text(response.message);
					}
				},
				complete: function () {
					$('.eds_modalWrapper input[name=eds_gg_FormNeedRefresh]', self.$mainWrapper).val("true");
					requestSent = false;
				}
			});
		},
		saveCategoryData: function (portalId, moduleId) {
			if (requestSent)
				return;
			var $mainWrapper = $('#main_eds_Gallery_Wrapper' + moduleId),
				categoryTitle = $('#eds_gg_editcategorytitle' + moduleId, $mainWrapper).val(),
				categoryDescription = $('#eds_gg_editcategorydescription' + moduleId, $mainWrapper).val(),
				categoryIdToEdit = $('input[name=eds_gg_editCategoryId' + moduleId + ']', $mainWrapper).val();
			if (!categoryTitle.trim()) {
				$('#edsgg_EditCategoryNoTitleErrorMessage' + moduleId).show();
				return;
			}
			$.ajax({
				type: 'GET',
				url: '/DesktopModules/EasyDNNGallery/Services/EditMediaData.ashx',
				cache: false,
				dataType: 'json',
				timeout: 150000,
				data: {
					action: 'savecategory',
					portalId: portalId,
					moduleId: moduleId,
					categoryId: categoryIdToEdit,
					title: categoryTitle,
					description: categoryDescription
				},
				success: function (response) {
					if (response.status != undefined && response.status == 'success') {
						$('#edsgg_EditCategoryMessage' + moduleId).show();
					}
					else if (response.status !== undefined && response.status == 'error') {
						$('#edsgg_EditCategoryErrorMessage' + moduleId).show();
						$('#edsgg_EditCategoryErrorMessage' + moduleId).text(response.message);
					}
				},
				complete: function () {
					$('.eds_modalWrapper input[name=eds_gg_FormNeedRefresh]', self.$mainWrapper).val("true");
					requestSent = false;
				}
			});
		},
		createCategory: function (portalId, moduleId) {
			if (requestSent)
				return;
			$('#edsgg_CreateCategoryErrorMessage' + moduleId).hide();
			$('#edsgg_CreateCategoryMessage' + moduleId).hide();
			$('#edsgg_CreateCategoryNoTitleErrorMessage' + moduleId).hide();
			var $mainWrapper = $('#eds_gg_modalWrapperCreateCategory' + moduleId),
				categoryTitle = $('#eds_gg_categorytitle' + moduleId, $mainWrapper).val(),
				categoryDescription = $('#eds_gg_categorydescription' + moduleId, $mainWrapper).val(),
				parentCategoryId = $('option:selected', '#edsgg_userCreateCategoryCategorySelect' + moduleId).val();
			if (!categoryTitle.trim()) {
				$('#edsgg_CreateCategoryNoTitleErrorMessage' + moduleId).show();
				return;
			}
			$.ajax({
				type: 'GET',
				url: '/DesktopModules/EasyDNNGallery/Services/EditMediaData.ashx',
				cache: false,
				dataType: 'json',
				timeout: 150000,
				data: {
					action: 'createcategory',
					portalId: portalId,
					moduleId: moduleId,
					categoryId: parentCategoryId,
					title: categoryTitle,
					description: categoryDescription
				},
				success: function (response) {
					if (response.status != undefined && response.status == 'success') {
						$('#edsgg_CreateCategoryMessage' + moduleId).show();
						$('#eds_gg_categorytitle' + moduleId, $mainWrapper).val("");
						$('#eds_gg_categorydescription' + moduleId, $mainWrapper).val("");
					}
					else if (response.status !== undefined && response.status == 'error') {
						$('#edsgg_CreateCategoryErrorMessage' + moduleId).show();
						$('#edsgg_CreateCategoryErrorMessage' + moduleId).text(response.message);
					}
				},
				complete: function () {
					$('.eds_modalWrapper input[name=eds_gg_FormNeedRefresh]', self.$mainWrapper).val("true");
					requestSent = false;
				}
			});
		},
		deleteCategoryData: function (portalId, moduleId) {
			if (requestSent)
				return;
			var $mainWrapper = $('#main_eds_Gallery_Wrapper' + moduleId),
				categoryIdToEdit = $('input[name=eds_gg_editCategoryId' + moduleId + ']', $mainWrapper).val();
			$.ajax({
				type: 'GET',
				url: '/DesktopModules/EasyDNNGallery/Services/EditMediaData.ashx',
				cache: false,
				dataType: 'json',
				timeout: 150000,
				data: {
					action: 'deletecategory',
					portalId: portalId,
					moduleId: moduleId,
					categoryId: categoryIdToEdit
				},
				success: function (response) {
					if (response.status != undefined && response.status == 'success') {
						$('#eds_gg_editCategoryDeletedContainer' + moduleId).show();
						$('#eds_gg_editCategoryContainer' + moduleId).hide();
					}
					else if (response.status !== undefined && response.status == 'error') {
						$('#edsgg_EditCategoryErrorMessage' + moduleId).show();
						$('#edsgg_EditCategoryErrorMessage' + moduleId).text(response.message);
					}
				},
				complete: function () {
					$('.eds_modalWrapper input[name=eds_gg_FormNeedRefresh]', self.$mainWrapper).val("true");
					requestSent = false;
				}
			});
		},
		reportMedia: function (portalId, moduleId) {
			if (requestSent)
				return;
			var $mainWrapper = $('#main_eds_Gallery_Wrapper' + moduleId),
				medaiIdToReport = $('input[name=eds_gg_reportMediaId' + moduleId + ']').val(),
				selectedReason = $('input[name=eds_gg_reportReason' + moduleId + ']:checked').val();
			$.ajax({
				type: 'GET',
				url: '/DesktopModules/EasyDNNGallery/Services/EditMediaData.ashx',
				cache: false,
				dataType: 'json',
				timeout: 150000,
				data: {
					action: 'reportmedia',
					portalId: portalId,
					moduleId: moduleId,
					mediaId: medaiIdToReport,
					reasonId: selectedReason
				},
				success: function (response) {
					if (response.status != undefined && response.status == 'success') {
						$('#eds_gg_reportMediaContainer' + moduleId).hide();
						$('#eds_gg_reportedMediaCloseContainer' + moduleId).show();
					}
					else if (response.status !== undefined && response.status == 'error') {
					}
				},
				complete: function () {
					$('.eds_modalWrapper input[name=eds_gg_FormNeedRefresh]', self.$mainWrapper).val("true");
					requestSent = false;
				}
			});
		}
	}
})(eds3_5_jq, window);

/*! Fluidvids v2.2.0 | (c) 2014 @toddmotto | github.com/toddmotto/fluidvids */
!function (a, b) { "function" == typeof define && define.amd ? define(b) : "object" == typeof exports ? module.exports = b : a.fluidvids = b() }(this, function () { "use strict"; var a = { selector: "iframe", players: ["www.youtube.com", "player.vimeo.com", "fast.wistia.net"] }, b = document.head || document.getElementsByTagName("head")[0], c = ".edsgg_fluidVideo{width:100%;position:relative;}.edsgg_fluidVideo iframe{position:absolute;top:0px;left:0px;width:100%;height:100%;}", d = function (b) { var c = new RegExp("^(https?:)?//(?:" + a.players.join("|") + ").*$", "i"); return c.test(b) }, e = function (a) { if (!a.getAttribute("data-fluidvids")) { var b = document.createElement("div"), c = parseInt(a.height ? a.height : a.offsetHeight, 10) / parseInt(a.width ? a.width : a.offsetWidth, 10) * 100; a.parentNode.insertBefore(b, a), a.setAttribute("data-fluidvids", "loaded"), b.className += "edsgg_fluidVideo", b.style.paddingTop = c + "%", b.appendChild(a) } }, f = function () { var a = document.createElement("div"); a.innerHTML = "<p>x</p><style>" + c + "</style>", b.appendChild(a.childNodes[1]) }; return a.apply = function () { for (var b = document.querySelectorAll(a.selector), c = 0; c < b.length; c++) { var f = b[c]; d(f.src) && e(f) } }, a.init = function (b) { for (var c in b) a[c] = b[c]; a.apply(), f() }, a });

;;;