function debugLine(n,t,i){var r,f,u,e;if(n===!0&&(n="true"),n===!1&&(n="false"),r=n,"object"==typeof n){r="";for(name in n)f=n[name],r+=" "+name+": "+f}(1!=t||i||(r+=" "+Math.random()),1==i)&&(u=jQuery("#debug_line"),u.width(200),u.height()>=500&&u.html(""),e=u.html(),r=e+"<br> -------------- <br>"+r),jQuery("#debug_line").show().html(r)}function debugSide(n){var t="",i;for(name in n)i=n[name],t+=name+" : "+i+"<br>";jQuery("#debug_side").show().html(t)}function trace(n){"undefined"!=typeof console&&console.log(n)}function UGFunctions(){function i(n,t,i){t.addEventListener?t.addEventListener(n,i,!1):t.attachEvent?t.attachEvent("on"+n,i):t[n]=i}var u=null,n=this,t={starTime:0,arrThemes:[],isTouchDevice:-1,isRgbaSupported:-1,timeCache:{},dataCache:{},lastEventType:"",lastEventTime:0,handle:null};this.debugVar="",this.z__________FULL_SCREEN___________=function(){},this.toFullscreen=function(n){if(n.requestFullscreen)n.requestFullscreen();else if(n.mozRequestFullScreen)n.mozRequestFullScreen();else if(n.webkitRequestFullscreen)n.webkitRequestFullscreen();else{if(!n.msRequestFullscreen)return!1;n.msRequestFullscreen()}return!0},this.exitFullscreen=function(){if(0==n.isFullScreen())return!1;if(document.exitFullscreen)document.exitFullscreen();else if(document.cancelFullScreen)document.cancelFullScreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.webkitExitFullscreen)document.webkitExitFullscreen();else{if(!document.msExitFullscreen)return!1;document.msExitFullscreen()}return!0},this.addFullScreenChangeEvent=function(n){document.webkitCancelFullScreen?i("webkitfullscreenchange",document,n):document.msExitFullscreen?i("MSFullscreenChange",document,n):document.mozCancelFullScreen?i("mozfullscreenchange",document,n):i("fullscreenchange",document,n)},this.destroyFullScreenChangeEvent=function(){jQuery(document).unbind("fullscreenChange"),jQuery(document).unbind("mozfullscreenchange"),jQuery(document).unbind("webkitfullscreenchange"),jQuery(document).unbind("MSFullscreenChange")},this.getFullScreenElement=function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement},this.isFullScreen=function(){var n=document.fullscreen||document.mozFullScreen||document.webkitIsFullScreen||document.msFullscreenElement;return n=n?!0:!1},this.z__________GET_PROPS___________=function(){},this.getBrowserPrefix=function(){var t,i,r,n;if(null!==u)return u;t=["webkit","Moz","ms","O"],i=document.createElement("div");for(r in t)if(n=t[r],n+"Transform"in i.style)return n=n.toLowerCase(),u=n,n;return u="",""},this.getImageInsideParentDataByImage=function(t,i,r){var f=t.parent(),u=n.getImageOriginalSize(t);return n.getImageInsideParentData(f,u.width,u.height,i,r)},this.getImageInsideParentData=function(n,t,i,r,u,f,e){var u,c,f,e,a;u||(u={}),c={},"undefined"==typeof f&&(f=n.width()),"undefined"==typeof e&&(e=n.height()),u.padding_left&&(f-=u.padding_left),u.padding_right&&(f-=u.padding_right),u.padding_top&&(e-=u.padding_top),u.padding_bottom&&(e-=u.padding_bottom);var o=null,s="100%",h=null,l=null,v="display:block;margin:0px auto;";return t>0&&i>0&&("down"==r&&f>t&&e>i?(s=i,o=t,l=(f-o)/2,h=(e-s)/2):"fill"==r?(a=t/i,s=e,o=s*a,f>o?(o=f,s=o/a,l=0,h=Math.round((s-e)/-2)):(h=0,l=Math.round((o-f)/-2))):(a=t/i,s=e,o=s*a,h=0,l=(f-o)/2,"fitvert"!=r&&o>f&&(o=f,s=o/a,l=0,h=(e-s)/2)),o=Math.floor(o),s=Math.floor(s),h=Math.floor(h),l=Math.floor(l),v="position:absolute;"),u.padding_top&&(h+=u.padding_top),u.padding_left&&(l+=u.padding_left),c.imageWidth=o,c.imageHeight=s,c.imageTop=h,c.imageLeft=l,c.imageRight=l+o,c.imageBottom=0==h||"100%"==s?null:h+s,c.style=v,c},this.getElementCenterPosition=function(t,i){var s=t.parent(),e=n.getElementSize(t),o=n.getElementSize(s),u=o.width,f=o.height,r;return i&&void 0!==i.padding_top&&(f-=i.padding_top),i&&void 0!==i.padding_bottom&&(f-=i.padding_bottom),i&&void 0!==i.padding_left&&(u-=i.padding_left),i&&void 0!==i.padding_right&&(u-=i.padding_right),r={},r.left=Math.round((u-e.width)/2),r.top=Math.round((f-e.height)/2),i&&void 0!==i.padding_top&&(r.top+=i.padding_top),i&&void 0!==i.padding_left&&(r.left+=i.padding_left),r},this.getElementCenterPoint=function(t,i){var i,u,r;return i||(i=!1),u=n.getElementSize(t),r={},r.x=u.width/2,r.y=u.height/2,1==i&&(r.x+=u.left,r.y+=u.top),r.x=Math.round(r.x),r.y=Math.round(r.y),r},this.getMousePosition=function(n,t){var i={pageX:n.pageX,pageY:n.pageY,clientX:n.clientX,clientY:n.clientY},r;return(n.originalEvent&&n.originalEvent.touches&&n.originalEvent.touches.length>0&&(i.pageX=n.originalEvent.touches[0].pageX,i.pageY=n.originalEvent.touches[0].pageY,i.clientX=n.originalEvent.touches[0].clientX,i.clientY=n.originalEvent.touches[0].clientY),t)&&(r=t.offset(),i.mouseX=i.pageX-r.left,i.mouseY=i.pageY-r.top),i},this.getMouseElementPoint=function(t,i){var r={x:t.pageX,y:t.pageY};return n.getElementLocalPoint(r,i)},this.getElementLocalPoint=function(n,t){var i={},r=t.offset();return i.x=Math.round(n.x-r.left),i.y=Math.round(n.y-r.top),i},this.getImageOriginalSize=function(n,t,i){var u,r,f;if("undefined"!=typeof t&&"undefined"!=typeof i)return{width:t,height:i};if(u=n[0],"undefined"==typeof u)throw new Error("getImageOriginalSize error - Image not found");return(r={},"undefined"==typeof u.naturalWidth)?"number"==typeof n.data("naturalWidth")?(r={},r.width=n.data("naturalWidth"),r.height=n.data("naturalHeight"),r):(f=new Image,f.src=u.src,f.complete?(r.width=f.width,r.height=f.height,n.data("naturalWidth",r.width),n.data("naturalHeight",r.height),r):{width:0,height:0}):(r.width=u.naturalWidth,r.height=u.naturalHeight,r)},this.getimageRatio=function(t){var i=n.getImageOriginalSize(t),r=n.getElementSize(t);return r.width/i.width},this.isImageFitParent=function(t){var u=t.parent(),i=n.getElementSize(t),r=n.getElementSize(u);return i.width<=r.width&&i.height<=r.height?!0:!1},this.getElementSize=function(n){if(void 0===n)throw new Error("Can't get size, empty element");var t=n.position();return t.height=n.outerHeight(),t.width=n.outerWidth(),t.left=Math.round(t.left),t.top=Math.round(t.top),t.right=t.left+t.width,t.bottom=t.top+t.height,t},this.isElementBiggerThenParent=function(t){var u=t.parent(),i=n.getElementSize(t),r=n.getElementSize(u);return i.width>r.width||i.height>r.height?!0:!1},this.isPointInsideElement=function(n,t){var r=n.x>=0&&n.x<t.width,i;return 0==r?!1:(i=n.y>=0&&n.y<t.height,0==i?!1:!0)},this.getElementRelativePos=function(t,i,r,u){var u,f,e;u||(u=t.parent()),f="number"==typeof t?{width:t,height:t}:n.getElementSize(t),e=n.getElementSize(u);switch(i){case"top":case"left":i=0,r&&(i+=r);break;case"center":i=Math.round((e.width-f.width)/2),r&&(i+=r);break;case"right":i=e.width-f.width,r&&(i-=r);break;case"middle":i=Math.round((e.height-f.height)/2),r&&(i+=r);break;case"bottom":i=e.height-f.height,r&&(i-=r)}return i},this.z_________SET_ELEMENT_PROPS_______=function(){},this.zoomImageInsideParent=function(t,i,r,u,f,e,o){var r,f,p,nt,rt,tt,it;r||(r=1.2),f||(f="fit");var w,v,b,k,s=r,ut=t.parent(),l=n.getElementSize(t),a=n.getImageOriginalSize(t),y=!1,d=0,g=0,h=0,c=0;if(u?(p=n.getMouseElementPoint(u,t),y=n.isPointInsideElement(p,l),h=p.x,c=p.y):y=!1,0==y&&(nt=n.getElementCenterPoint(t),h=nt.x,c=nt.y),1==i)w=l.height*s,v=l.width*s,0!=h&&(d=-(h*s-h)),0!=c&&(g=-(c*s-c));else{if(w=l.height/s,v=l.width/s,rt=n.getImageInsideParentData(ut,a.width,a.height,f,o),v<rt.imageWidth)return n.scaleImageFitParent(t,a.width,a.height,f,o),!0;1==y&&(0!=h&&(d=-(h/s-h)),0!=c&&(g=-(c/s-c)))}return e&&(tt=1,0!=a.width&&(tt=v/a.width),tt>e)?!1:((n.setElementSize(t,v,w),0==i&&0==y)?(it=n.getElementCenterPosition(t),b=it.left,k=it.top):(b=l.left+d,k=l.top+g),n.placeElement(t,b,k),!0)},this.placeElement=function(t,i,r,u,f,e){var e,o,s,h;if((0==jQuery.isNumeric(i)||0==jQuery.isNumeric(r))&&(e||(e=t.parent()),o=n.getElementSize(t),s=n.getElementSize(e)),0==jQuery.isNumeric(i))switch(i){case"left":i=0,u&&(i+=u);break;case"center":i=Math.round((s.width-o.width)/2),u&&(i+=u);break;case"right":i=s.width-o.width,u&&(i-=u)}if(0==jQuery.isNumeric(r))switch(r){case"top":r=0,f&&(r+=f);break;case"middle":case"center":r=Math.round((s.height-o.height)/2),f&&(r+=f);break;case"bottom":r=s.height-o.height,f&&(r-=f)}h={position:"absolute",margin:"0px"},null!==i&&(h.left=i),null!==r&&(h.top=r),t.css(h)},this.placeElementInParentCenter=function(t){n.placeElement(t,"center","middle")},this.setElementSizeAndPosition=function(n,t,i,r,u){var f={width:r+"px",height:u+"px",left:t+"px",top:i+"px",position:"absolute",margin:"0px"};n.css(f)},this.setElementSize=function(n,t,i){var r={width:t+"px"};null!==i&&"undefined"!=typeof i&&(r.height=i+"px"),n.css(r)},this.cloneElementSizeAndPos=function(t,i,r,u,f){var e=t.position();if(void 0==e)throw new Error("Can't get size, empty element");r===!0?(e.height=t.outerHeight(),e.width=t.outerWidth()):(e.height=t.height(),e.width=t.width()),e.left=Math.round(e.left),e.top=Math.round(e.top),u&&(e.left+=u),f&&(e.top+=f),n.setElementSizeAndPosition(i,e.left,e.top,e.width,e.height)},this.placeImageInsideParent=function(t,i,r,u,f,e){var o=n.getImageInsideParentData(i,r,u,f,e),s="<img",h;return null!==o.imageWidth&&(s+=" width = '"+o.imageWidth+"'",o.style+="width:"+o.imageWidth+";"),null!=o.imageHeight&&("100%"==o.imageHeight?(s+=" height = '"+o.imageHeight+"'",o.style+="height:"+o.imageHeight+";"):(s+=" height = '"+o.imageHeight+"'",o.style+="height:"+o.imageHeight+"px;")),null!==o.imageTop&&(o.style+="top:"+o.imageTop+"px;"),null!==o.imageLeft&&(o.style+="left:"+o.imageLeft+"px;"),t=t.replace('"','"'),s+=" style='"+o.style+"'",s+=' src="'+t+'"',s+=">",i.html(s),h=i.children("img")},this.scaleImageCoverParent=function(t,i,r){var e,o;"number"==typeof i?(e=i,o=r):(e=i.outerWidth(),o=i.outerHeight());var c=n.getImageOriginalSize(t),a=c.width,v=c.height,l=a/v,f=o,u=f*l,s=0,h=0;e>u?(u=e,f=u/l,h=0,s=Math.round((f-o)/-2)):(s=0,h=Math.round((u-e)/-2)),u=Math.round(u),f=Math.round(f),t.css({width:u+"px",height:f+"px",left:h+"px",top:s+"px"})},this.scaleImageFitParent=function(t,i,r,u,f){var h=t.parent(),e=n.getImageInsideParentData(h,i,r,u,f),s=!1,o={};return null!==e.imageWidth&&(s=!0,t.removeAttr("width"),o.width=e.imageWidth+"px"),null!=e.imageHeight&&(s=!0,t.removeAttr("height"),o.height=e.imageHeight+"px"),null!==e.imageTop&&(s=!0,o.top=e.imageTop+"px"),null!==e.imageLeft&&(s=!0,o.left=e.imageLeft+"px"),1==s&&(o.position="absolute",o.margin="0px 0px",t.css(o)),e},this.scaleImageByHeight=function(t,i,r,u){var f=n.getImageOriginalSize(t,r,u),e=f.width/f.height,o=Math.round(i*e);i=Math.round(i),n.setElementSize(t,o,i)},this.scaleImageByWidth=function(t,i,r,u){var f=n.getImageOriginalSize(t,r,u),e=f.width/f.height,o=Math.round(i/e);i=Math.round(i),n.setElementSize(t,i,o)},this.scaleImageExactSizeInParent=function(t,i,r,u,f,e){var d=t.parent(),s=n.getElementSize(d),k,c,o,l;s.width<u&&(u=s.width),s.height<f&&(f=s.height);var h=n.getImageInsideParentData(null,i,r,e,null,u,f),y=u,p=f,w=h.imageLeft,a=h.imageLeft,b=h.imageTop,v=h.imageTop,g=Math.round((s.width-u)/2),nt=Math.round((s.height-f)/2),tt=h.imageWidth+w+a,c=u-tt;return 0!=c&&(a+=c),k=h.imageHeight+b+v,c=f-k,0!=c&&(v+=c),t.removeAttr("width"),t.removeAttr("height"),o={position:"absolute",margin:"0px 0px"},o.width=y+"px",o.height=p+"px",o.left=g+"px",o.top=nt+"px",o["padding-left"]=w+"px",o["padding-top"]=b+"px",o["padding-right"]=a+"px",o["padding-bottom"]=v+"px",t.css(o),l={},l.imageWidth=y,l.imageHeight=p,l},this.showElement=function(n,t,i){n.show().fadeTo(0,1),t&&t.show().fadeTo(0,1),i&&i.show().fadeTo(0,1)},this.z_________GALLERY_RELATED_FUNCTIONS_______=function(){},this.disableButton=function(t,i){if(!i)var i="ug-button-disabled";0==n.isButtonDisabled(t,i)&&t.addClass(i)},this.convertCustomPrefixOptions=function(n,t,i){if(!t)return n;var r={};return jQuery.each(n,function(n,u){if(0===n.indexOf(t+"_"+i+"_")){var f=n.replace(t+"_"+i+"_",i+"_");r[f]=u}else r[n]=u}),r},this.enableButton=function(t,i){if(!i)var i="ug-button-disabled";1==n.isButtonDisabled(t,i)&&t.removeClass(i)},this.isButtonDisabled=function(n,t){if(!t)var t="ug-button-disabled";return n.hasClass(t)?!0:!1},this.z_________MATH_FUNCTIONS_______=function(){},this.normalizeSetting=function(n,t,i,r,u,f){var f,e;return f||(f=!1),e=(u-i)/(r-i),u=n+(t-n)*e,1==f&&(n>u&&(u=n),u>t&&(u=t)),u},this.getNormalizedValue=function(n,t,i,r,u){var f=(u-n)/(t-n);return u=n+(r-i)*f},this.getDistance=function(n,t,i,r){return Math.round(Math.sqrt(Math.abs((i-n)*(i-n)+(r-t)*(r-t))))},this.getMiddlePoint=function(n,t,i,r){var u={};return u.x=n+Math.round((i-n)/2),u.y=t+Math.round((r-t)/2),u},this.getNumItemsInSpace=function(n,t,i){return Math.floor((n+i)/(t+i))},this.getNumItemsInSpaceRound=function(n,t,i){return Math.round((n+i)/(t+i))},this.getSpaceByNumItems=function(n,t,i){return n*t+(n-1)*i},this.getItemSizeInSpace=function(n,t,i){return Math.floor((n-(t-1)*i)/t)},this.getColX=function(n,t,i){return n*(t+i)},this.getColByIndex=function(n,t){return t%n},this.getColRowByIndex=function(n,t){var i=Math.floor(n/t),r=Math.floor(n%t);return{col:r,row:i}},this.getIndexByRowCol=function(n,t,i){if(0>n||0>t)return-1;return n*i+t},this.getPrevRowSameColIndex=function(t,i){var r=n.getColRowByIndex(t,i);return n.getIndexByRowCol(r.row-1,r.col,i)},this.getNextRowSameColIndex=function(t,i){var r=n.getColRowByIndex(t,i);return n.getIndexByRowCol(r.row+1,r.col,i)},this.z_________DATA_FUNCTIONS_______=function(){},this.setGlobalData=function(n,t){jQuery.data(document.body,n,t)},this.getGlobalData=function(n){return jQuery.data(document.body,n)},this.z_________EVENT_DATA_FUNCTIONS_______=function(){},this.handleScrollTop=function(i){var u;if(0==n.isTouchDevice())return null;var r=n.getStoredEventData(i),f=15,e=15;return(null===r.scrollDir&&(Math.abs(r.diffMouseX)>f?r.scrollDir="hor":Math.abs(r.diffMouseY)>e&&Math.abs(r.diffMouseY)>Math.abs(r.diffMouseX)&&(r.scrollDir="vert",r.scrollStartY=r.lastMouseClientY,r.scrollOrigin=jQuery(document).scrollTop(),t.dataCache[i].scrollStartY=r.lastMouseClientY,t.dataCache[i].scrollOrigin=r.scrollOrigin),t.dataCache[i].scrollDir=r.scrollDir),"vert"!==r.scrollDir)?r.scrollDir:(u=(jQuery(document).scrollTop(),r.scrollOrigin-(r.lastMouseClientY-r.scrollStartY)),u>=0&&jQuery(document).scrollTop(u),r.scrollDir)},this.wasVerticalScroll=function(t){var i=n.getStoredEventData(t);return"vert"===i.scrollDir?!0:!1},this.storeEventData=function(i,r,u){var f=n.getMousePosition(i),o=jQuery.now(),e={startTime:o,lastTime:o,startMouseX:f.pageX,startMouseY:f.pageY,lastMouseX:f.pageX,lastMouseY:f.pageY,startMouseClientY:f.clientY,lastMouseClientY:f.clientY,scrollTop:jQuery(document).scrollTop(),scrollDir:null};u&&(e=jQuery.extend(e,u)),t.dataCache[r]=e},this.updateStoredEventData=function(i,r,u){if(!t.dataCache[r])throw new Error("updateEventData error: must have stored cache object");var f=t.dataCache[r],e=n.getMousePosition(i);f.lastTime=jQuery.now(),void 0!==e.pageX&&(f.lastMouseX=e.pageX,f.lastMouseY=e.pageY,f.lastMouseClientY=e.clientY),u&&(f=jQuery.extend(f,u)),t.dataCache[r]=f},this.getStoredEventData=function(n,i){if(!t.dataCache[n])throw new Error("updateEventData error: must have stored cache object");var r=t.dataCache[n];return r.diffMouseX=r.lastMouseX-r.startMouseX,r.diffMouseY=r.lastMouseY-r.startMouseY,r.diffMouseClientY=r.lastMouseClientY-r.startMouseClientY,r.diffTime=r.lastTime-r.startTime,i===!0?(r.startMousePos=r.lastMouseY,r.lastMousePos=r.lastMouseY,r.diffMousePos=r.diffMouseY):(r.startMousePos=r.lastMouseX,r.lastMousePos=r.lastMouseX,r.diffMousePos=r.diffMouseX),r},this.isApproveStoredEventClick=function(i,r){if(!t.dataCache[i])return!0;var u=n.getStoredEventData(i,r),f=Math.abs(u.diffMousePos);return u.diffTime>400?!1:f>30?!1:!0},this.clearStoredEventData=function(n){t.dataCache[n]=null},this.z_________CHECK_SUPPORT_FUNCTIONS_______=function(){},this.isCanvasExists=function(){var n=jQuery('<canvas width="500" height="500" > <\/canvas>')[0];return"function"==typeof n.getContext?!0:!1},this.isScrollbarExists=function(){return window.innerWidth>document.documentElement.clientWidth},this.isTouchDevice=function(){if(-1!==t.isTouchDevice)return t.isTouchDevice;try{document.createEvent("TouchEvent"),t.isTouchDevice=!0}catch(n){t.isTouchDevice=!1}return t.isTouchDevice},this.isRgbaSupported=function(){var n,i,r;if(-1!==t.isRgbaSupported)return t.isRgbaSupported;n=document.getElementsByTagName("script")[0],i=n.style.color;try{n.style.color="rgba(1,5,13,0.44)"}catch(u){}return r=n.style.color!=i,n.style.color=i,t.isRgbaSupported=r,r},this.z_________GENERAL_FUNCTIONS_______=function(){},this.checkMinJqueryVersion=function(n){for(var i,r,u=jQuery.fn.jquery.split("."),f=n.split("."),t=0,e=u.length;e>t;t++){if(i=parseInt(u[t]),r=parseInt(f[t]),"undefined"==typeof f[t])return!0;if(r>i)return!1;if(i>r)return!0}return!0},this.getCssSizeParam=function(n){return jQuery.isNumeric(n)?n+"px":n},this.convertHexToRGB=function(n,t){var i=n.replace("#","");return i===n?n:(r=parseInt(i.substring(0,2),16),g=parseInt(i.substring(2,4),16),b=parseInt(i.substring(4,6),16),result="rgba("+r+","+g+","+b+","+t+")",result)},this.timestampToString=function(n){var t=new Date(n),i=t.getDate()+"/"+t.getMonth();return i+=" "+t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()+":"+t.getMilliseconds()},this.getArrTouches=function(n){var t=[];return n.originalEvent&&n.originalEvent.touches&&n.originalEvent.touches.length>0&&(t=n.originalEvent.touches),t},this.getArrTouchPositions=function(n){for(var r,i=[],t=0;t<n.length;t++)r={pageX:n[t].pageX,pageY:n[t].pageY},i.push(r);return i},this.startTimeDebug=function(){t.starTime=jQuery.now()},this.showTimeDebug=function(){var n=jQuery.now(),i=n-t.starTime;debugLine({"Time Passed":i},!0)},this.initProgressIndicator=function(t,i,r){var u;switch("bar"!=t&&0==n.isCanvasExists()&&(t="bar"),t){case"bar":u=new UGProgressBar,u.putHidden(r,i);break;default:case"pie":u=new UGProgressPie,u.putHidden(r,i);break;case"pie2":i.type_fill=!0,u=new UGProgressPie,u.putHidden(r,i)}return u},this.setButtonMobileReady=function(n){n.on("touchstart",function(){jQuery(this).addClass("ug-nohover")}),n.on("mousedown touchend",function(n){return n.stopPropagation(),n.stopImmediatePropagation(),!1})},this.registerTheme=function(n){t.arrThemes.push(n)},this.getArrThemes=function(){return t.arrThemes},this.isThemeRegistered=function(n){return-1!==jQuery.inArray(n,t.arrThemes)?!0:!1},this.getFirstRegisteredTheme=function(){if(0==t.arrThemes.length)return"";return t.arrThemes[0]},this.isTimePassed=function(n,i){var i,r,u;return i||(i=100),r=jQuery.now(),lastTime=0==t.timeCache.hasOwnProperty(n)?0:t.timeCache[n],u=r-lastTime,t.timeCache[n]=r,i>=u?!1:!0},this.whenContiniousEventOver=function(n,i,r){if(!r)var r=300;1==t.timeCache.hasOwnProperty(n)&&null!=t.timeCache[n]&&(clearTimeout(t.timeCache[n]),t.timeCache[n]=null),t.timeCache[n]=setTimeout(i,r)},this.validateClickTouchstartEvent=function(n){var i=!0,r=jQuery.now()-t.lastEventTime;return"click"==n&&"touchstart"==t.lastEventType&&1e3>r&&(i=!1),t.lastEventTime=jQuery.now(),t.lastEventType=n,i},this.addClassOnHover=function(n,t){if(!t)var t="ug-button-hover";n.hover(function(){jQuery(this).addClass(t)},function(){jQuery(this).removeClass(t)})},this.destroyButton=function(n){n.off("mouseenter"),n.off("mouseleave"),n.off("click"),n.off("touchstart"),n.off("touchend"),n.off("mousedown")},this.setButtonOnClick=function(t,i){n.setButtonMobileReady(t),t.on("click touchstart",function(t){return objThis=jQuery(this),t.stopPropagation(),t.stopImmediatePropagation(),0==n.validateClickTouchstartEvent(t.type)?!0:void i(objThis,t)})},this.loadJs=function(n,t){var i,r;t===!0&&(n=location.protocol+"//"+n),i=document.createElement("script"),i.src=n,r=document.getElementsByTagName("script")[0],r.parentNode.insertBefore(i,r)},this.loadCss=function(n,t){t===!0&&(n=location.protocol+"//"+n);var i=document.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("type","text/css"),i.setAttribute("href",n),document.getElementsByTagName("head")[0].appendChild(i)},this.addEvent=function(n,t,i){"undefined"!=typeof n.addEventListener?n.addEventListener(t,i,!1):n.attachEvent&&n.attachEvent("on"+t,i)},this.checkImagesLoaded=function(n,t,i){function r(n,r){f++,"function"==typeof i&&setTimeout(function(){i(n,r)}),f==u&&"function"==typeof t&&setTimeout(function(){t()})}var f=0,u=n.length;return 0==u&&t?(t(),!1):void setTimeout(function(){for(var f,i,t=0;u>t;t++)f=n[t],void 0!==f.naturalWidth&&0!==f.naturalWidth?r(n[t],!1):(i=jQuery("<img/>"),i.data("index",t),i.on("load",function(){var t=jQuery(this).data("index");r(n[t],!1)}),i.on("error",function(){var t=jQuery(this).data("index");r(n[t],!0)}),i.attr("src",f.src))})},this.waitForWidth=function(n,i){var r=n.width();return 0!=r?(i(),!1):void(t.handle=setInterval(function(){r=n.width(),0!=r&&(clearInterval(t.handle),i())},300))},this.arrayShuffle=function(n){if("object"!=typeof n)return n;for(var i,r,t=n.length;t;i=parseInt(Math.random()*t),r=n[--t],n[t]=n[i],n[i]=r);return n},this.getObjectLength=function(n){var t=0,i;for(i in n)t++;return t},this.normalizePercent=function(n){return 0>n&&(n=0),n>1&&(n=1),n},this.stripTags=function(n){return n.replace(/(<([^>]+)>)/gi,"")},this.htmlentitles=function(n){return jQuery("<div/>").text(n).html()},this.z_________END_GENERAL_FUNCTIONS_______=function(){}}function UGThumbsGeneral(){function s(n,i,u,f){var e={width:n+"px",height:i+"px"},o={width:n-t.thumbInnerReduce+"px",height:i-t.thumbInnerReduce+"px"},s=".ug-thumb-loader, .ug-thumb-error, .ug-thumb-border-overlay, .ug-thumb-overlay";u?(f!==!0&&u.css(e),u.children(s).css(o)):(r.children(".ug-thumb-wrapper").css(e),r.find(s).css(o))}function h(t,i,r,u){var u,f,e;u||(u=!1),p.isFakeFullscreen()&&(u=!0),f=t.children(".ug-thumb-border-overlay"),e={},e["border-width"]=i+"px",0!=i&&(e["border-color"]=r),u&&u===!0?(f.css(e),0==i?f.hide():f.show()):(0==i?f.stop().fadeOut(n.thumb_transition_duration):f.show().stop().fadeIn(n.thumb_transition_duration),g(f,e))}function c(i,r,u){var e=i.children(".ug-thumb-overlay"),f=n.thumb_transition_duration;u&&u===!0&&(f=0),r?e.stop(!0).fadeTo(f,t.colorOverlayOpacity):e.stop(!0).fadeTo(f,0)}function l(t,i,r){var e=t.children("img.ug-thumb-image"),f=t.children("img.ug-thumb-image-overlay"),u=n.thumb_transition_duration;r&&r===!0&&(u=0),i?f.stop(!0).fadeTo(u,1):(e.fadeTo(0,1),f.stop(!0).fadeTo(u,0))}function w(r,u){if(t.isEffectBorder&&h(r,n.thumb_selected_border_width,n.thumb_selected_border_color,u),t.isEffectOverlay){var e=1==n.thumb_overlay_reverse?!0:!1;c(r,e,u)}t.isEffectImage&&l(r,!1,u),f.trigger(i.events.SETSELECTEDSTYLE,r)}function k(n){var r=i.getItemByThumb(n);return r.isLoaded=!0,r.isThumbImageLoaded=!1,1==t.customThumbs?(f.trigger(i.events.IMAGELOADERROR,n),!0):(n.children(".ug-thumb-loader").hide(),void n.children(".ug-thumb-error").show())}function d(){if(n.thumb_round_corners_radius<=0)return!1;var t={"border-radius":n.thumb_round_corners_radius+"px"};r.find(".ug-thumb-wrapper, .ug-thumb-wrapper .ug-thumb-border-overlay").css(t)}function g(t,i){t.stop(!0).animate(i,{duration:n.thumb_transition_duration,easing:n.thumb_transition_easing,queue:!1})}function a(n){1==o(n)?w(n,!0,"redraw"):i.setThumbNormalStyle(n,!0,"redraw")}function nt(t,r){if(1==n.thumb_fixed_size)u.scaleImageCoverParent(r,t);else{"height"==n.thumb_resize_by?u.scaleImageByHeight(r,n.thumb_height):u.scaleImageByWidth(r,n.thumb_width);var o=u.getElementSize(r);u.placeElement(r,0,0),s(o.width,o.height,t)}t.children(".ug-thumb-loader").hide(),r.show(),0==n.thumb_image_overlay_effect?r.fadeTo(0,1):(1==n.thumb_image_overlay_effect&&tt(r),r.fadeTo(0,0),a(t)),f.trigger(i.events.AFTERPLACEIMAGE,t)}function tt(n){var r=n.siblings(".ug-thumb-image-overlay"),i,f;if(0==r.length)return!1;i=u.getElementSize(n),f={width:i.width+"px",height:i.height+"px",left:i.left+"px",top:i.top+"px"},r.css(f),0==t.customThumbs&&r.fadeTo(0,1)}function it(){var t="",i=n.thumb_image_overlay_type.split(","),r,u;for(r in i){u=i[r];switch(u){case"bw":t+=" ug-bw-effect";break;case"blur":t+=" ug-blur-effect";break;case"sepia":t+=" ug-sepia-effect"}}return t}function o(n){return n.hasClass("ug-thumb-selected")?!0:!1}function rt(n,t){t=jQuery(t);var r=(i.getItemByThumb(t),u.getElementSize(t));s(r.width,r.height,t,!0),a(t)}function ut(n){return 1==t.touchEnabled?(objThumbs.off("mouseenter").off("mouseleave"),!0):void(0==o(n)&&i.setThumbOverStyle(n))}function ft(n){return 1==t.touchEnabled?!0:void(0==o(n)&&i.setThumbNormalStyle(n,!1))}function et(n,r){var r,e,u;return r||(r=!1),e=jQuery(n),u=e.parents(".ug-thumb-wrapper"),0==u.parent().length?!1:(objItem=i.getItemByThumb(u),1==objItem.isLoaded&&r===!1?!1:(i.triggerImageLoadedEvent(u,e),void(1==t.customThumbs?f.trigger(i.events.PLACEIMAGE,[u,e]):nt(u,e,objItem))))}function ot(n,t,r){objItem=i.getItemByThumb(t),objItem.isLoaded=!0,objItem.isThumbImageLoaded=!0;var f=u.getImageOriginalSize(r);objItem.thumbWidth=f.width,objItem.thumbHeight=f.height,objItem.thumbRatioByWidth=f.width/f.height,objItem.thumbRatioByHeight=f.height/f.width}var st,v,y,e,r,i=this,f=jQuery(i),p=new UniteGalleryMain,u=new UGFunctions;this.events={SETOVERSTYLE:"thumbmouseover",SETNORMALSTYLE:"thumbmouseout",SETSELECTEDSTYLE:"thumbsetselected",PLACEIMAGE:"thumbplaceimage",AFTERPLACEIMAGE:"thumb_after_place_image",IMAGELOADERROR:"thumbimageloaderror",THUMB_IMAGE_LOADED:"thumb_image_loaded"};var n={thumb_width:88,thumb_height:50,thumb_fixed_size:!0,thumb_resize_by:"height",thumb_border_effect:!0,thumb_border_width:0,thumb_border_color:"#000000",thumb_over_border_width:0,thumb_over_border_color:"#d9d9d9",thumb_selected_border_width:1,thumb_selected_border_color:"#d9d9d9",thumb_round_corners_radius:0,thumb_color_overlay_effect:!0,thumb_overlay_color:"#000000",thumb_overlay_opacity:.4,thumb_overlay_reverse:!1,thumb_image_overlay_effect:!1,thumb_image_overlay_type:"bw",thumb_transition_duration:200,thumb_transition_easing:"easeOutQuad",thumb_show_loader:!0,thumb_loader_type:"dark",thumb_wrapper_as_link:!1,thumb_link_newpage:!1},t={touchEnabled:!1,num_thumbs_checking:0,customThumbs:!1,funcSetCustomThumbHtml:null,isEffectBorder:!1,isEffectOverlay:!1,isEffectImage:!1,colorOverlayOpacity:1,thumbInnerReduce:0,allowOnResize:!0},b={timeout_thumb_check:100,thumb_max_check_times:600,eventSizeChange:"thumb_size_change"};this.init=function(i,r){v=i.getObjects(),p=i,st=jQuery(i),y=v.g_objWrapper,e=v.g_arrItems,n=jQuery.extend(n,r),t.isEffectBorder=n.thumb_border_effect,t.isEffectOverlay=n.thumb_color_overlay_effect,t.isEffectImage=n.thumb_image_overlay_effect},this._____________EXTERNAL_SETTERS__________=function(){},this.setHtmlThumbs=function(i){var y,w,s,f,h,l,a,b,u,o,v,c;for(r=i,y=p.getNumItems(),1==t.isEffectImage&&(w=it()),s=0;y>s;s++){f=e[s],h="",0==t.customThumbs&&(h=" ug-thumb-generated");var k=f.index+1,d="style='z-index:"+k+";'",b="<div class='ug-thumb-wrapper"+h+"' "+d+"><\/div>";1==n.thumb_wrapper_as_link&&(l=f.link,""==f.link&&(l="javascript:void(0)"),a="",1==n.thumb_link_newpage&&f.link&&(a=" target='_blank'"),b="<a href='"+l+"'"+a+" class='ug-thumb-wrapper"+h+"'><\/a>"),u=jQuery(b),o=f.objThumbImage,0==t.customThumbs&&(1==n.thumb_show_loader&&o&&(v="ug-thumb-loader-dark","bright"==n.thumb_loader_type&&(v="ug-thumb-loader-bright"),u.append("<div class='ug-thumb-loader "+v+"'><\/div>"),u.append("<div class='ug-thumb-error' style='display:none'><\/div>")),o&&((o.addClass("ug-thumb-image"),1==n.thumb_image_overlay_effect)&&(c=o.clone().appendTo(u),c.addClass("ug-thumb-image-overlay "+w).removeClass("ug-thumb-image"),c.fadeTo(0,0),f.objImageOverlay=c),u.append(o))),t.isEffectBorder&&u.append("<div class='ug-thumb-border-overlay'><\/div>"),t.isEffectOverlay&&u.append("<div class='ug-thumb-overlay'><\/div>"),r.append(u),t.customThumbs&&t.funcSetCustomThumbHtml(u,f),e[s].objThumbWrapper=u}},this.setThumbNormalStyle=function(r,u){if(1==t.customThumbs&&r.removeClass("ug-thumb-over"),t.isEffectBorder&&h(r,n.thumb_border_width,n.thumb_border_color,u),t.isEffectOverlay){var o=1==n.thumb_overlay_reverse?!1:!0;c(r,o,u)}t.isEffectImage&&l(r,!0,u),f.trigger(i.events.SETNORMALSTYLE,r)},this.setThumbOverStyle=function(r){if(1==t.customThumbs&&r.addClass("ug-thumb-over"),t.isEffectBorder&&h(r,n.thumb_over_border_width,n.thumb_over_border_color),t.isEffectOverlay){var u=1==n.thumb_overlay_reverse?!0:!1;c(r,u)}1==t.isEffectImage&&l(r,!1),f.trigger(i.events.SETOVERSTYLE,r)},this.setHtmlProperties=function(){var i,f;0==t.customThumbs&&(1==n.thumb_fixed_size&&s(n.thumb_width,n.thumb_height),d()),(r.children(".ug-thumb-wrapper").each(function(){var n=jQuery(this);a(n)}),t.isEffectOverlay&&n.thumb_overlay_color)&&(i={},u.isRgbaSupported()?(f=u.convertHexToRGB(n.thumb_overlay_color,n.thumb_overlay_opacity),i["background-color"]=f):(i["background-color"]=n.thumb_overlay_color,t.colorOverlayOpacity=n.thumb_overlay_opacity),r.find(".ug-thumb-wrapper .ug-thumb-overlay").css(i))},this.setThumbSelected=function(n){return 1==t.customThumbs&&n.removeClass("ug-thumb-over"),1==o(n)?!0:(n.addClass("ug-thumb-selected"),void w(n))},this.setThumbUnselected=function(n){n.removeClass("ug-thumb-selected"),i.setThumbNormalStyle(n,!1,"set unselected")},this.setOptions=function(t){n=jQuery.extend(n,t)},this.setThumbInnerReduce=function(n){t.thumbInnerReduce=n},this.setCustomThumbs=function(n,i,r){if(t.customThumbs=!0,"function"!=typeof n)throw new Error("The argument should be function");t.funcSetCustomThumbHtml=n,-1==jQuery.inArray("overlay",i)&&(t.isEffectOverlay=!1),-1==jQuery.inArray("border",i)&&(t.isEffectBorder=!1),t.isEffectImage=!1,r&&r.allow_onresize===!1&&(t.allowOnResize=!1)},this._____________EXTERNAL_GETTERS__________=function(){},this.getOptions=function(){return n},this.getNumThumbs=function(){return e.length},this.getThumbImage=function(n){return n.find(".ug-thumb-image")},this.getThumbByIndex=function(n){var t=i.getThumbs(),r;if(n>=t.length||0>n)throw new Error("Wrong thumb index");return r=jQuery(t[n])},this.getThumbs=function(){return r.children(".ug-thumb-wrapper")},this.getItemByThumb=function(n){var t=n.data("index"),i;return void 0===t&&(t=n.index()),i=e[t]},this.isThumbLoaded=function(n){var t=i.getItemByThumb(n);return t.isLoaded},this.getGlobalThumbSize=function(){return{width:n.thumb_width,height:n.thumb_height}},this._____________EXTERNAL_OTHERS__________=function(){},this.initEvents=function(){var n=r.find(".ug-thumb-wrapper");n.on("touchstart",function(){t.touchEnabled=!0,n.off("mouseenter").off("mouseleave")}),1==t.allowOnResize&&y.on(b.eventSizeChange,rt),n.hover(function(){var t=jQuery(this);ut(t)},function(){var t=jQuery(this);ft(t)}),f.on(i.events.THUMB_IMAGE_LOADED,ot)},this.destroy=function(){var n=r.find(".ug-thumb-wrapper");n.off("touchstart"),y.off(b.eventSizeChange),n.off("mouseenter"),n.off("mouseleave"),f.off(i.events.THUMB_IMAGE_LOADED)},this.loadThumbsImages=function(){var n=r.find(".ug-thumb-image");u.checkImagesLoaded(n,null,function(n,t){if(0==t)et(n,!0);else{var i=jQuery(n).parent();k(i)}})},this.triggerImageLoadedEvent=function(n,t){f.trigger(i.events.THUMB_IMAGE_LOADED,[n,t])},this.hideThumbs=function(){r.find(".ug-thumb-wrapper").hide()}}function UGThumbsStrip(){function ft(t,i){k=t.getObjects(),l=t,l.attachThumbsPanel("strip",r),w=jQuery(t),d=k.g_objWrapper,rt=k.g_arrItems,n=jQuery.extend(n,i),f=n.strip_vertical_type,1==f&&(n=jQuery.extend(n,ut),n=jQuery.extend(n,i),i.thumb_resize_by="width"),u.init(t,i),g()}function g(){var t=u.getOptions();h.isNotFixedThumbs=t.thumb_fixed_size===!1,f=n.strip_vertical_type}function et(){u.setHtmlProperties(),ot(),ht(),nt(),0==h.isRunOnce&&(1==n.strip_control_touch&&(s=new UGTouchThumbsControl,s.init(r)),1==n.strip_control_avia&&(c=new UGAviaControl,c.init(r)),v(),u.loadThumbsImages(),kt()),h.isRunOnce=!0}function a(i){t.stripSize=i,t.stripActiveSize=0==f?t.stripSize-n.strip_padding_left-n.strip_padding_right:t.stripSize-n.strip_padding_top-n.strip_padding_bottom,t.stripActiveSize<0&&(t.stripActiveSize=0)}function ot(){var h=e.children(".ug-thumb-wrapper"),i=jQuery(h[0]),r=i.outerWidth(),s=i.outerHeight(),n=u.getOptions();0==f?(t.thumbSize=r,t.thumbSecondSize=1==n.thumb_fixed_size?s:n.thumb_height,a(o.width()),t.stripInnerSize=e.width()):(t.thumbSize=s,t.thumbSecondSize=1==n.thumb_fixed_size?r:n.thumb_width,a(o.height()),t.stripInnerSize=e.height())}function st(n){0==f?e.width(n):e.height(n),t.stripInnerSize=n,v(),jQuery(r).trigger(r.events.INNER_SIZE_CHANGE)}function nt(){var c=e.children(".ug-thumb-wrapper"),o=0,r=0,t,s;for(0==f&&(r=n.strip_padding_top),i=0;i<c.length;i++){if(t=jQuery(c[i]),1==h.isNotFixedThumbs){if(objItem=u.getItemByThumb(t),0==objItem.isLoaded)continue;t.show()}p.placeElement(t,o,r),0==f?o+=t.outerWidth()+n.strip_space_between_thumbs:r+=t.outerHeight()+n.strip_space_between_thumbs}s=0==f?o-n.strip_space_between_thumbs:r-n.strip_space_between_thumbs,st(s)}function ht(){var r,u,n,i;0==f?(r=t.thumbSecondSize,n={},n.height=r+"px",i={},i.height=r+"px"):(u=t.thumbSecondSize,n={},n.width=u+"px",i={},i.width=u+"px"),o.css(n),e.css(i)}function tt(n){var i=r.getInnerStripPos(),t=i+n;t=r.fixInnerStripLimits(t),r.positionInnerStrip(t,!0)}function ct(n){var i=b(n),t=-1*i.min;t=r.fixInnerStripLimits(t),r.positionInnerStrip(t,!0)}function lt(n){var u=b(n),i=-1*u.max+t.stripSize;i=r.fixInnerStripLimits(i),r.positionInnerStrip(i,!0)}function it(n){var t,i,r,u;if(0==y())return!1;t=dt(),i=b(n),i.min<t.minPosThumbs?(r=n.prev(),ct(r.length?r:n)):i.max>t.maxPosThumbs&&(u=n.next(),lt(u.length?u:n))}function at(){var t=l.getSelectedItem(),n;if(null==t)return!0;n=t.objThumbWrapper,n&&it(n)}function vt(){if(0==y())return!1;var n=r.getInnerStripPos(),t=r.fixInnerStripLimits(n);n!=t&&r.positionInnerStrip(t,!0)}function v(){var n=y();1==n?(c&&c.enable(),s&&s.enable()):(c&&c.disable(),s&&s.disable())}function yt(){return y()?!1:void(0==f?p.placeElement(e,n.strip_thumbs_align,0):p.placeElement(e,0,n.strip_thumbs_align))}function pt(n){var t,i;if(r.isTouchMotionActive()&&(t=s.isSignificantPassed(),1==t))return!0;i=u.getItemByThumb(n),l.selectItem(i)}function wt(){clearTimeout(h.handle),h.handle=setTimeout(function(){nt()},50)}function bt(){var n=l.getSelectedItem();u.setThumbSelected(n.objThumbWrapper),it(n.objThumbWrapper)}function kt(){u.initEvents();var n=o.find(".ug-thumb-wrapper");n.on("click touchend",function(){var t=jQuery(this);pt(t)}),w.on(l.events.ITEM_CHANGE,bt),h.isNotFixedThumbs&&jQuery(u).on(u.events.AFTERPLACEIMAGE,wt)}function y(){return t.stripInnerSize>t.stripActiveSize?!0:!1}function dt(){var n={},i=r.getInnerStripPos();return n.minPosThumbs=-1*i+1,n.maxPosThumbs=-1*i+t.stripSize-1,n}function b(n){var i={},r=n.position();return 0==f?(i.min=r.left,i.max=r.left+t.thumbSize):(i.min=r.top,i.max=r.top+t.thumbSize),i}var w,k,d,rt,o,e,c,s,r=this,l=new UniteGalleryMain,p=new UGFunctions,f=!1,u=new UGThumbsGeneral,p=new UGFunctions,n={strip_vertical_type:!1,strip_thumbs_align:"left",strip_space_between_thumbs:6,strip_thumb_touch_sensetivity:15,strip_scroll_to_thumb_duration:500,strip_scroll_to_thumb_easing:"easeOutCubic",strip_control_avia:!0,strip_control_touch:!0,strip_padding_top:0,strip_padding_bottom:0,strip_padding_left:0,strip_padding_right:0},h={isRunOnce:!1,is_placed:!1,isNotFixedThumbs:!1,handle:null},t={stripSize:0,stripActiveSize:0,stripInnerSize:0,thumbSize:0,thumbSecondSize:0},ut;this.events={STRIP_MOVE:"stripmove",INNER_SIZE_CHANGE:"size_change"},ut={strip_thumbs_align:"top",thumb_resize_by:"width"},this.setHtml=function(t){if(!t){var t=d;null!=n.parent_container&&(t=n.parent_container)}t.append("<div class='ug-thumbs-strip'><div class='ug-thumbs-strip-inner'><\/div><\/div>"),o=t.children(".ug-thumbs-strip"),e=o.children(".ug-thumbs-strip-inner"),u.setHtmlThumbs(e),1==h.isNotFixedThumbs&&u.hideThumbs()},this.destroy=function(){var n=o.find(".ug-thumb-wrapper");n.off("click"),n.off("touchend"),w.off(l.events.ITEM_CHANGE),jQuery(u).off(u.events.AFTERPLACEIMAGE),s&&s.destroy(),c&&c.destroy(),u.destroy()},this.________EXTERNAL_GENERAL___________=function(){},this.init=function(n,t){ft(n,t)},this.run=function(){et()},this.positionInnerStrip=function(t,i){var i,u;void 0===i&&(i=!1),u=0==f?{left:t+"px"}:{top:t+"px"},0==i?(e.css(u),r.triggerStripMoveEvent()):(r.triggerStripMoveEvent(),e.stop(!0).animate(u,{duration:n.strip_scroll_to_thumb_duration,easing:n.strip_scroll_to_thumb_easing,queue:!1,progress:function(){r.triggerStripMoveEvent()},always:function(){r.triggerStripMoveEvent()}}))},this.triggerStripMoveEvent=function(){jQuery(r).trigger(r.events.STRIP_MOVE)},this.isTouchMotionActive=function(){if(!s)return!1;return s.isTouchActive()},this.isItemThumbVisible=function(n){var u=n.objThumbWrapper,i=u.position(),e=-1*r.getInnerStripPos(),o;if(0==f)var s=e+t.stripSize,h=i.left,c=i.left+u.width();else var s=e+t.stripSize,h=i.top,c=i.top+u.height();return o=!1,c>=e&&s>=h&&(o=!0),o},this.getInnerStripPos=function(){return 0==f?e.position().left:e.position().top},this.getInnerStripLimits=function(){var i={};return i.maxPos=0==f?n.strip_padding_left:n.strip_padding_top,i.minPos=-(t.stripInnerSize-t.stripActiveSize),i},this.fixInnerStripLimits=function(n){var t=r.getInnerStripLimits();return n>t.maxPos&&(n=t.maxPos),n<t.minPos&&(n=t.minPos),n},this.scrollForeward=function(){tt(-t.stripSize)},this.scrollBack=function(){tt(t.stripSize)},this.________EXTERNAL_SETTERS___________=function(){},this.setOptions=function(t){n=jQuery.extend(n,t),u.setOptions(t),g()},this.setSizeVertical=function(n){var u,r,i;if(0==f)throw new Error("setSizeVertical error, the strip size is not vertical");u=t.thumbSecondSize,r={},r.width=u+"px",r.height=n+"px",o.css(r),a(n),i={},i.width=u+"px",i.left="0px",i.top="0px",e.css(i),h.is_placed=!0,v()},this.setSizeHorizontal=function(i){var s,u,c,r;if(1==f)throw new Error("setSizeHorizontal error, the strip size is not horizontal");s=t.thumbSecondSize+n.strip_padding_top+n.strip_padding_bottom,u={},u.width=i+"px",u.height=s+"px",o.css(u),a(i),c=n.strip_padding_left,r={},r.height=s+"px",r.left=c+"px",r.top="0px",e.css(r),h.is_placed=!0,v()},this.setPosition=function(n,t,i,r){p.placeElement(o,n,t,i,r)},this.resize=function(i){0==f?(o.width(i),t.stripActiveSize=i-n.strip_padding_left-n.strip_padding_right):(o.height(i),t.stripActiveSize=i-n.strip_padding_top-n.strip_padding_bottom),a(i),v(),vt(),yt(),at()},this.setThumbUnselected=function(n){u.setThumbUnselected(n)},this.setCustomThumbs=function(n){u.setCustomThumbs(n)},this.________EXTERNAL_GETTERS___________=function(){},this.getObjects=function(){var t=u.getOptions(),i=jQuery.extend(n,t);return{g_gallery:l,g_objGallery:w,g_objWrapper:d,g_arrItems:rt,g_objStrip:o,g_objStripInner:e,g_aviaControl:c,g_touchThumbsControl:s,isVertical:f,g_options:i,g_thumbs:u}},this.getObjThumbs=function(){return u},this.getSelectedThumb=function(){var n=l.getSelectedItemIndex();return-1==n?null:u.getThumbByIndex(n)},this.getSizeAndPosition=function(){return p.getElementSize(o)},this.getHeight=function(){return o.outerHeight()},this.getWidth=function(){return o.outerWidth()},this.getSizes=function(){return t},this.isVertical=function(){return f},this.isPlaced=function(){return h.is_placed},this.isMoveEnabled=function(){return y()}}function UGTouchThumbsControl(){function c(){var i=jQuery.now(),t={};return t.passedTime=n.lastTime-n.startTime,t.lastActiveTime=i-n.buttonReleaseTime,t.passedDistance=n.lastPos-n.startPos,t.passedDistanceAbs=Math.abs(t.passedDistance),t}function y(){i.thumb_touch_slowFactor=h.normalizeSetting(5e-5,.01,1,100,v.strip_thumb_touch_sensetivity,!0)}function o(n){return 0==e?h.getMousePosition(n).pageX:h.getMousePosition(n).pageY}function p(i){var e=n.mousePos-i,r=n.innerPos-e,u=t.getInnerStripLimits(),f;r>u.maxPos&&(f=r-u.maxPos,r=u.maxPos+f/3),r<u.minPos&&(f=u.minPos-r,r=u.minPos-f/3),t.positionInnerStrip(r)}function w(i){var r=t.getInnerStripPos();n.mousePos=i,n.innerPos=r,n.lastPortionPos=r,n.lastDeltaTime=0,n.lastDeltaPos=0,n.startTime=jQuery.now(),n.startPos=n.innerPos,n.lastTime=n.startTime,n.lastPos=n.startPos,n.speed=0}function l(){var t=jQuery.now(),r=t-n.lastTime;r>=i.touch_portion_time&&(n.lastDeltaTime=t-n.lastTime,n.lastDeltaTime>i.touch_portion_time&&(n.lastDeltaTime=i.touch_portion_time),n.lastDeltaPos=n.lastPos-n.lastPortionPos,n.lastPortionPos=n.lastPos,n.lastTime=t)}function b(){var nt=i.thumb_touch_slowFactor,v=i.minDeltaTime,ft=i.minPath,et=t.getInnerStripPos(),ot=jQuery.now(),o=ot-n.lastTime,c=et-n.lastPortionPos,tt,h,s,k,rt,l,d,ut,g;v>o&&n.lastDeltaTime>0&&(o=n.lastDeltaTime,c=n.lastDeltaPos+c),v>o&&(o=v),tt=c>0?1:-1,h=0,o>0&&(h=c/o),s=h*h/(2*nt)*tt,Math.abs(s)<=ft&&(s=0);var y=t.getInnerStripPos(),u=y+s,r=t.fixInnerStripLimits(u),p=t.getInnerStripLimits(),w=i.limitsBreakAddition,b=!1,it=r;(u>p.maxPos&&(b=!0,r=w,w>u&&(r=u)),u<p.minPos)&&(b=!0,k=p.minPos-w,r=k,u>k&&(r=u)),rt=r-y,l=Math.abs(Math.round(h/nt)),(0!=s&&(l=l*rt/s),y!=r)&&(d={left:r+"px"},1==e&&(d={top:r+"px"}),f.animate(d,{duration:l,easing:i.animationEasing,queue:!0,progress:a})),1==b&&(ut=i.returnAnimateSpeed,g={left:it+"px"},1==e&&(g={top:it+"px"}),f.animate(g,{duration:ut,easing:i.returnAnimationEasing,queue:!0,progress:a}))}function a(){n.lastPos=t.getInnerStripPos(),t.triggerStripMoveEvent()}function k(){return 1==n.loop_active?!0:(n.loop_active=!0,void(n.handle=setInterval(l,10)))}function s(t){if(0==n.loop_active)return!0;if(t){var i=o(t);b(i)}n.loop_active=!1,n.handle=clearInterval(n.handle)}function d(t){return 0==n.isControlEnabled?!0:(n.buttonReleaseTime=jQuery.now(),0==n.touch_active?(s(t),!0):(t.preventDefault(),n.touch_active=!1,s(t),void u.removeClass("ug-dragging")))}function g(t){if(0==n.isControlEnabled)return!0;t.preventDefault(),n.touch_active=!0;var i=o(t);f.stop(!0),w(i),k(),u.addClass("ug-dragging")}function nt(i){if(0==n.isControlEnabled||0==n.touch_active)return!0;if(i.preventDefault(),0==i.buttons)return n.touch_active=!1,s(i),!0;var r=o(i);n.lastPos=t.getInnerStripPos(),p(r),l()}function tt(){u.bind("mousedown touchstart",g),jQuery(window).add("body").bind("mouseup touchend",d),jQuery("body").bind("mousemove touchmove",nt)}var t,it,rt,r,u,f,v,e,h=new UGFunctions,i={touch_portion_time:200,thumb_touch_slowFactor:0,minDeltaTime:70,minPath:10,limitsBreakAddition:30,returnAnimateSpeed:500,animationEasing:"easeOutCubic",returnAnimationEasing:"easeOutCubic"},n={touch_active:!1,loop_active:!1,mousePos:0,innerPos:0,startPos:0,startTime:0,lastTime:0,buttonReleaseTime:0,lastPos:0,lastPortionPos:0,lastDeltaTime:0,lastDeltaPos:0,speed:0,handle:"",touchEnabled:!1,isControlEnabled:!0};this.enable=function(){n.isControlEnabled=!0},this.disable=function(){n.isControlEnabled=!1},this.init=function(n){t=n,r=n.getObjects(),it=r.g_gallery,rt=r.g_objGallery,u=r.g_objStrip,f=r.g_objStripInner,v=r.g_options,e=r.isVertical,y(),tt()},this.isSignificantPassed=function(){var n=c();return n.passedTime>300?!0:n.passedDistanceAbs>30?!0:!1},this.isTouchActive=function(){if(1==n.touch_active||1==f.is(":animated"))return!0;var t=c();return t.lastActiveTime<50?!0:!1},this.destroy=function(){u.unbind("mousedown"),u.unbind("touchstart"),jQuery(window).add("body").unbind("mouseup").unbind("touchend"),jQuery("body").unbind("mousemove").unbind("touchmove")}}function UGPanelsBase(){function c(t,r){var u;switch(n.orientation){case"right":case"left":u={left:t+"px"};break;case"top":case"bottom":u={top:t+"px"}}i.stop(!0).animate(u,{duration:300,easing:"easeInOutQuad",queue:!1,complete:function(){r&&r()}})}function l(t){switch(n.orientation){case"right":case"left":h.placeElement(i,t,null);break;case"top":case"bottom":h.placeElement(i,null,t)}}function o(){f.trigger(u.events.FINISH_MOVE)}var n,u,i,s,f,t,e,r=new UniteGalleryMain,a=this,h=new UGFunctions;this.init=function(t,i,o,h,c){n=i,u=o,r=t,s=h,f=c,e=jQuery(r)},this.setHtml=function(f){var e,o;e=(i=f,"strip"==n.panelType)?s.strippanel_enable_handle:s.gridpanel_enable_handle,(1==e&&(t=new UGPanelHandle,t.init(u,i,s,n.panelType,r),t.setHtml()),n.isDisabledAtStart===!0)&&(o="<div class='ug-overlay-disabled'><\/div>",i.append(o),setTimeout(function(){i.children(".ug-overlay-disabled").hide()},n.disabledAtStartTimeout))},this.placeElements=function(){t&&t.placeHandle()},this.initEvents=function(){t&&(t.initEvents(),e.on(r.events.SLIDER_ACTION_START,function(){t.hideHandle()}),e.on(r.events.SLIDER_ACTION_END,function(){t.showHandle()}))},this.destroy=function(){t&&(t.destroy(),e.off(r.events.SLIDER_ACTION_START),e.off(r.events.SLIDER_ACTION_END))},this.openPanel=function(t){if(!t)var t=!1;return i.is(":animated")?!1:0==n.isClosed?!1:(n.isClosed=!1,f.trigger(u.events.OPEN_PANEL),void(t===!1?c(n.originalPos,o):(l(n.originalPos),o())))},this.closePanel=function(t){var t,r;if((t||(t=!1),i.is(":animated"))||1==n.isClosed)return!1;r=a.getClosedPanelDest(),n.isClosed=!0,f.trigger(u.events.CLOSE_PANEL),t===!1?c(r,o):(l(r),o())},this.setClosedState=function(t){n.originalPos=t,f.trigger(u.events.CLOSE_PANEL),n.isClosed=!0},this.setOpenedState=function(){f.trigger(u.events.OPEN_PANEL),n.isClosed=!1},this.getClosedPanelDest=function(){var t,u=h.getElementSize(i),f;switch(n.orientation){case"left":n.originalPos=u.left,t=-n.panelWidth;break;case"right":n.originalPos=u.left,f=r.getSize(),t=f.width;break;case"top":n.originalPos=u.top,t=-n.panelHeight;break;case"bottom":n.originalPos=u.top,f=r.getSize(),t=f.height}return t},this.isPanelClosed=function(){return n.isClosed},this.setDisabledAtStart=function(t){return 0>=t?!1:(n.isDisabledAtStart=!0,void(n.disabledAtStartTimeout=t))}}function UGPanelHandle(){function f(){t.removeClass("ug-button-hover")}function e(){t.addClass("ug-button-closed")}function o(){t.removeClass("ug-button-closed")}function s(n){return n.stopPropagation(),n.stopImmediatePropagation(),0==r.validateClickTouchstartEvent(n.type)?!0:void(i.isPanelClosed()?i.openPanel():i.closePanel())}function h(){var t=i.getOrientation();switch(t){case"right":case"left":"top"!=n.panel_handle_align&&"bottom"!=n.panel_handle_align&&(n.panel_handle_align="top");break;case"bottom":"left"!=n.panel_handle_align&&"right"!=n.panel_handle_align&&(n.panel_handle_align="left");break;case"top":"left"!=n.panel_handle_align&&"right"!=n.panel_handle_align&&(n.panel_handle_align="right")}}var u,i,t,r=new UGFunctions,n={panel_handle_align:"top",panel_handle_offset:0,panel_handle_skin:0};this.init=function(t,r,f,e,o){switch(i=t,u=r,e){case"grid":n.panel_handle_align=f.gridpanel_handle_align,n.panel_handle_offset=f.gridpanel_handle_offset,n.panel_handle_skin=f.gridpanel_handle_skin;break;case"strip":n.panel_handle_align=f.strippanel_handle_align,n.panel_handle_offset=f.strippanel_handle_offset,n.panel_handle_skin=f.strippanel_handle_skin;break;default:throw new Error("Panel handle error: wrong panel type: "+e);}var s=o.getOptions(),h=s.gallery_skin;""==n.panel_handle_skin&&(n.panel_handle_skin=h)},this.setHtml=function(){var f=i.getOrientation(),r="ug-panel-handle-tip";switch(f){case"right":r+=" ug-handle-tip-left";break;case"left":r+=" ug-handle-tip-right";break;case"bottom":r+=" ug-handle-tip-top";break;case"top":r+=" ug-handle-tip-bottom"}u.append("<div class='"+r+" ug-skin-"+n.panel_handle_skin+"'><\/div>"),t=u.children(".ug-panel-handle-tip")},this.initEvents=function(){r.addClassOnHover(t),t.bind("click touchstart",s),jQuery(i).on(i.events.OPEN_PANEL,function(){f(),o()}),jQuery(i).on(i.events.CLOSE_PANEL,function(){f(),e()})},this.destroy=function(){r.destroyButton(t),jQuery(i).off(i.events.OPEN_PANEL),jQuery(i).off(i.events.CLOSE_PANEL)},this.placeHandle=function(){var u=r.getElementSize(t),f;h(),f=i.getOrientation();switch(f){case"left":r.placeElement(t,"right",n.panel_handle_align,-u.width);break;case"right":r.placeElement(t,-u.width,n.panel_handle_align,0,n.panel_handle_offset);break;case"top":r.placeElement(t,n.panel_handle_align,"bottom",n.panel_handle_offset,-u.height);break;case"bottom":r.placeElement(t,n.panel_handle_align,"top",n.panel_handle_offset,-u.height);break;default:throw new Error("Wrong panel orientation: "+f);}},this.hideHandle=function(){1==t.is(":visible")&&t.hide()},this.showHandle=function(){0==t.is(":visible")&&t.show()}}function UGStripPanel(){function p(t,i){var e,o,h;u=t,a=jQuery(u),n=jQuery.extend(n,i),e=!1,1==n.strippanel_vertical_type&&(n=jQuery.extend(n,ht),e=!0),0==n.strippanel_enable_buttons&&(n=jQuery.extend(n,ct),e=!0),1==e&&(n=jQuery.extend(n,i)),o=u.getOptions(),h=o.gallery_skin,""==n.strippanel_buttons_skin&&(n.strippanel_buttons_skin=h),v=u.getElement(),s.init(u,f,y,n,st),r=new UGThumbsStrip,r.init(u,n)}function w(){if(0==n.strippanel_vertical_type){if(0==f.panelWidth)throw new Error("Strip panel error: The width not set, please set width");}else if(0==f.panelHeight)throw new Error("Strip panel error: The height not set, please set height");if(null==f.orientation)throw new Error("Wrong orientation, please set panel orientation before run");return!0}function b(){return 1==f.isFirstRun&&0==w()?!1:(r.run(),c(),l(),ot(),f.isFirstRun=!1,void h())}function k(i){var i,u,f;i||(i=v),(i.append("<div class='ug-strip-panel'><\/div>"),o=i.children(".ug-strip-panel"),1==n.strippanel_enable_buttons)&&(u="ug-strip-arrow-left",f="ug-strip-arrow-right",1==n.strippanel_vertical_type&&(u="ug-strip-arrow-up",f="ug-strip-arrow-down"),o.append("<div class='ug-strip-arrow "+u+" ug-skin-"+n.strippanel_buttons_skin+"'><div class='ug-strip-arrow-tip'><\/div><\/div>"),o.append("<div class='ug-strip-arrow "+f+" ug-skin-"+n.strippanel_buttons_skin+"'><div class='ug-strip-arrow-tip'><\/div><\/div>")),s.setHtml(o),r.setHtml(o),1==n.strippanel_enable_buttons&&(e=o.children("."+u),t=o.children("."+f)),d()}function d(){""!=n.strippanel_background_color&&o.css("background-color",n.strippanel_background_color)}function g(){var s=r.getHeight(),c=f.panelWidth,l,a,h,u,v;t&&(e.height(s),t.height(s),l=e.children(".ug-strip-arrow-tip"),i.placeElement(l,"center","middle"),a=t.children(".ug-strip-arrow-tip"),i.placeElement(a,"center","middle")),h=s+n.strippanel_padding_top+n.strippanel_padding_bottom,o.width(c),o.height(h),f.panelHeight=h,u=c-n.strippanel_padding_left-n.strippanel_padding_right,t&&(v=t.outerWidth(),u=u-2*v-2*n.strippanel_padding_buttons),r.resize(u)}function nt(){var s=r.getWidth(),c=f.panelHeight,l,a,h,u,v;t&&(e.width(s),t.width(s),l=e.children(".ug-strip-arrow-tip"),i.placeElement(l,"center","middle"),a=t.children(".ug-strip-arrow-tip"),i.placeElement(a,"center","middle")),h=s+n.strippanel_padding_left+n.strippanel_padding_right,o.width(h),o.height(c),f.panelWidth=h,u=c-n.strippanel_padding_top-n.strippanel_padding_bottom,t&&(v=t.outerHeight(),u=u-2*v-2*n.strippanel_padding_buttons),r.resize(u)}function c(){0==n.strippanel_vertical_type?g():nt()}function tt(){t&&(i.placeElement(e,"left","top",n.strippanel_padding_left,n.strippanel_padding_top),i.placeElement(t,"right","top",n.strippanel_padding_right,n.strippanel_padding_top));var u=n.strippanel_padding_left;t&&(u+=t.outerWidth()+n.strippanel_padding_buttons),r.setPosition(u,n.strippanel_padding_top)}function it(){t&&(i.placeElement(e,"left","top",n.strippanel_padding_left,n.strippanel_padding_top),i.placeElement(t,"left","bottom",n.strippanel_padding_left,n.strippanel_padding_bottom));var u=n.strippanel_padding_top;t&&(u+=t.outerHeight()+n.strippanel_padding_buttons),r.setPosition(n.strippanel_padding_left,u)}function l(){0==n.strippanel_vertical_type?tt():it(),s.placeElements()}function rt(t){return i.isButtonDisabled(t)?!0:void("advance_item"==n.strippanel_buttons_role?u.nextItem():r.scrollForeward())}function ut(t){return i.isButtonDisabled(t)?!0:void("advance_item"==n.strippanel_buttons_role?u.prevItem():r.scrollBack())}function h(){if(!t)return!0;if(0==r.isMoveEnabled())return i.disableButton(e),i.disableButton(t),!0;var n=r.getInnerStripLimits(),u=r.getInnerStripPos();u>=n.maxPos?i.disableButton(e):i.enableButton(e),u<=n.minPos?i.disableButton(t):i.enableButton(t)}function ft(){h()}function et(){u.isLastItem()?i.disableButton(t):i.enableButton(t),u.isFirstItem()?i.disableButton(e):i.enableButton(e)}function ot(){if(1==f.isEventsInited)return!1;if(f.isEventsInited=!0,t)if(i.addClassOnHover(t,"ug-button-hover"),i.addClassOnHover(e,"ug-button-hover"),i.setButtonOnClick(e,ut),i.setButtonOnClick(t,rt),"advance_item"!=n.strippanel_buttons_role)jQuery(r).on(r.events.STRIP_MOVE,ft),jQuery(r).on(r.events.INNER_SIZE_CHANGE,h),a.on(u.events.SIZE_CHANGE,h);else{var o=u.getOptions();0==o.gallery_carousel&&jQuery(u).on(u.events.ITEM_CHANGE,et)}s.initEvents()}var a,v,o,t,e,y=this,st=jQuery(this),u=new UniteGalleryMain,i=new UGFunctions,r=new UGThumbsStrip,s=new UGPanelsBase;this.events={FINISH_MOVE:"gridpanel_move_finish",OPEN_PANEL:"open_panel",CLOSE_PANEL:"close_panel"};var n={strippanel_vertical_type:!1,strippanel_padding_top:8,strippanel_padding_bottom:8,strippanel_padding_left:0,strippanel_padding_right:0,strippanel_enable_buttons:!0,strippanel_buttons_skin:"",strippanel_padding_buttons:2,strippanel_buttons_role:"scroll_strip",strippanel_enable_handle:!0,strippanel_handle_align:"top",strippanel_handle_offset:0,strippanel_handle_skin:"",strippanel_background_color:""},ht={strip_vertical_type:!0,strippanel_padding_left:8,strippanel_padding_right:8,strippanel_padding_top:0,strippanel_padding_bottom:0},ct={strippanel_padding_left:8,strippanel_padding_right:8,strippanel_padding_top:8,strippanel_padding_bottom:8},f={panelType:"strip",panelWidth:0,panelHeight:0,isEventsInited:!1,isClosed:!1,orientation:null,originalPos:null,isFirstRun:!0};this.destroy=function(){t&&(i.destroyButton(t),i.destroyButton(e),jQuery(r).off(r.events.STRIP_MOVE),jQuery(u).off(u.events.ITEM_CHANGE),jQuery(u).off(u.events.SIZE_CHANGE)),s.destroy(),r.destroy()},this.getOrientation=function(){return f.orientation},this.setOrientation=function(n){f.orientation=n},this.init=function(n,t){p(n,t)},this.run=function(){b()},this.setHtml=function(n){k(n)},this.getElement=function(){return o},this.getSize=function(){return i.getElementSize(o)},this.setWidth=function(n){f.panelWidth=n},this.setHeight=function(n){f.panelHeight=n},this.resize=function(n){y.setWidth(n),c(),l()},this.__________Functions_From_Base_____=function(){},this.isPanelClosed=function(){return s.isPanelClosed()},this.getClosedPanelDest=function(){return s.getClosedPanelDest()},this.openPanel=function(n){s.openPanel(n)},this.closePanel=function(n){s.closePanel(n)},this.setOpenedState=function(n){s.setOpenedState(n)},this.setClosedState=function(n){s.setClosedState(n)},this.setCustomThumbs=function(n){r.setCustomThumbs(n)},this.setDisabledAtStart=function(n){s.setDisabledAtStart(n)}}function UGGridPanel(){function v(r,u){var f,e,h;s=r,l(),u&&u.vertical_scroll&&(n.gridpanel_vertical_scroll=u.vertical_scroll),n=jQuery.extend(n,u),1==t.isHorType?(n=jQuery.extend(n,vt),n=jQuery.extend(n,u)):1==n.gridpanel_vertical_scroll&&(n=jQuery.extend(n,at),n=jQuery.extend(n,u),n.grid_panes_direction="bottom"),f=s.getOptions(),e=f.gallery_skin,""==n.gridpanel_arrows_skin&&(n.gridpanel_arrows_skin=e),h=r.getObjects(),c=h.g_objWrapper,o.init(s,t,ct,n,lt),i=new UGThumbsGrid,i.init(s,n)}function l(){if(null==t.orientation)throw new Error("Wrong orientation, please set panel orientation before run");}function y(){l(),b(),i.run(),g(),nt(),ht(),tt()}function p(){c.append("<div class='ug-grid-panel'><\/div>"),u=c.children(".ug-grid-panel"),t.isHorType?(u.append("<div class='grid-arrow grid-arrow-left-hortype ug-skin-"+n.gridpanel_arrows_skin+"'><\/div>"),u.append("<div class='grid-arrow grid-arrow-right-hortype ug-skin-"+n.gridpanel_arrows_skin+"'><\/div>"),f=u.children(".grid-arrow-left-hortype"),e=u.children(".grid-arrow-right-hortype")):0==n.gridpanel_vertical_scroll?(u.append("<div class='grid-arrow grid-arrow-left ug-skin-"+n.gridpanel_arrows_skin+"'><\/div>"),u.append("<div class='grid-arrow grid-arrow-right ug-skin-"+n.gridpanel_arrows_skin+"'><\/div>"),f=u.children(".grid-arrow-left"),e=u.children(".grid-arrow-right")):(u.append("<div class='grid-arrow grid-arrow-up ug-skin-"+n.gridpanel_arrows_skin+"'><\/div>"),u.append("<div class='grid-arrow grid-arrow-down ug-skin-"+n.gridpanel_arrows_skin+"'><\/div>"),f=u.children(".grid-arrow-up"),e=u.children(".grid-arrow-down")),o.setHtml(u),f.fadeTo(0,0),e.fadeTo(0,0),i.setHtml(u),w()}function w(){""!=n.gridpanel_background_color&&u.css("background-color",n.gridpanel_background_color)}function b(){"center"==n.gridpanel_grid_align&&(n.gridpanel_grid_align="middle")}function k(){var u=n.gridpanel_padding_border_top+n.gridpanel_padding_border_bottom,f=t.panelHeight-u,o;if(0==n.gridpanel_arrows_always_on&&(o=i.getNumPanesEstimationByHeight(f),1==o))return f;var s=r.getElementSize(e),h=s.height,u=h+n.gridpanel_arrows_padding_vert;return 1==n.gridpanel_vertical_scroll&&(u*=2),u+=n.gridpanel_padding_border_top+n.gridpanel_padding_border_bottom,f=t.panelHeight-u}function d(){var u=n.gridpanel_padding_border_left+n.gridpanel_padding_border_right,f=t.panelWidth-u,o,s,h;return 0==n.gridpanel_arrows_always_on&&(o=i.getNumPanesEstimationByWidth(f),1==o)?f:(s=r.getElementSize(e),h=s.width,u+=2*(h+n.gridpanel_arrows_padding_hor),f=t.panelWidth-u)}function g(){var r=!1,u;1==n.gridpanel_arrows_always_on?r=!0:(u=i.getNumPanes(),u>1&&(r=!0)),1==r?(e.show().fadeTo(0,1),f.show().fadeTo(0,1),t.arrowsVisible=!0):(e.hide(),f.hide(),t.arrowsVisible=!1)}function nt(){var f=i.getSize();1==t.isHorType?t.panelHeight=f.height+n.gridpanel_padding_border_top+n.gridpanel_padding_border_bottom:t.panelWidth=f.width+n.gridpanel_padding_border_left+n.gridpanel_padding_border_right,r.setElementSize(u,t.panelWidth,t.panelHeight)}function tt(){return 1==t.isEventsInited?!1:(t.isEventsInited=!0,f&&(r.addClassOnHover(f),i.attachPrevPaneButton(f)),e&&(r.addClassOnHover(e),i.attachNextPaneButton(e)),void o.initEvents())}function h(){return n.gridpanel_padding_border_left}function a(){var u=n.gridpanel_grid_align,t=0,f,e;switch(u){case"top":t=n.gridpanel_padding_border_top;break;case"bottom":t=n.gridpanel_padding_border_bottom}f=h(),e=i.getElement(),r.placeElement(e,f,u,0,t)}function it(){var s,c,l,a,o=r.getElementSize(f),u=i.getSize(),v,y;switch(n.gridpanel_grid_align){default:case"top":s=n.gridpanel_padding_border_top+o.height+n.gridpanel_arrows_padding_vert;break;case"middle":s="middle";break;case"bottom":s=t.panelHeight-u.height-o.height-n.gridpanel_padding_border_bottom-n.gridpanel_arrows_padding_vert}v=h(),y=i.getElement(),r.placeElement(y,v,s),u=i.getSize();switch(n.gridpanel_arrows_align_vert){default:case"center":case"middle":c=(u.top-o.height)/2,l=u.bottom+(t.panelHeight-u.bottom-o.height)/2,a=0;break;case"grid":c=u.top-o.height-n.gridpanel_arrows_padding_vert_vert,l=u.bottom+n.gridpanel_arrows_padding_vert,a=0;break;case"border":case"borders":c=n.gridpanel_padding_border_top,l="bottom",a=n.gridpanel_padding_border_bottom}r.placeElement(f,"center",c),r.placeElement(e,"center",l,0,a)}function rt(){1==t.arrowsVisible?it():a()}function ut(){var o,v,s,c=r.getElementSize(f),u=i.getSize(),l=n.gridpanel_padding_border_top,y,a,p,w,b;switch(n.gridpanel_grid_align){case"middle":switch(n.gridpanel_arrows_align_vert){default:a=u.height+n.gridpanel_arrows_padding_vert+c.height,l=(t.panelHeight-a)/2;break;case"border":case"borders":y=t.panelHeight-c.height-n.gridpanel_padding_border_bottom,l=(y-u.height)/2}break;case"bottom":a=u.height+c.height+n.gridpanel_arrows_padding_vert,l=t.panelHeight-a-n.gridpanel_padding_border_bottom}p=i.getElement(),w=h(),r.placeElement(p,w,l),u=i.getSize();switch(n.gridpanel_arrows_align_vert){default:case"center":case"middle":o=u.bottom+(t.panelHeight-u.bottom-c.height)/2,s=0;break;case"grid":o=u.bottom+n.gridpanel_arrows_padding_vert,s=0;break;case"border":case"borders":o="bottom",s=n.gridpanel_padding_border_bottom}v=-c.width/2-n.gridpanel_space_between_arrows/2,r.placeElement(f,"center",o,v,s),b=Math.abs(v),r.placeElement(e,"center",o,b,s)}function ft(){1==t.arrowsVisible?ut():a()}function et(){var h,c,l,s,o=r.getElementSize(f),u=i.getSize(),a;switch(n.gridpanel_grid_align){default:case"left":h=n.gridpanel_padding_border_left+n.gridpanel_arrows_padding_hor+o.width;break;case"middle":case"center":h="center";break;case"right":h=t.panelWidth-u.width-o.width-n.gridpanel_padding_border_right-n.gridpanel_arrows_padding_hor}a=i.getElement();switch(r.placeElement(a,h,n.gridpanel_padding_border_top),u=i.getSize(),n.gridpanel_arrows_align_vert){default:case"center":case"middle":s=(u.height-o.height)/2+u.top;break;case"top":s=n.gridpanel_padding_border_top+n.gridpanel_arrows_padding_vert;break;case"bottom":s=t.panelHeight-n.gridpanel_padding_border_bottom-n.gridpanel_arrows_padding_vert-o.height}switch(n.gridpanel_arrows_align_hor){default:case"borders":c=n.gridpanel_padding_border_left,l=t.panelWidth-n.gridpanel_padding_border_right-o.width;break;case"grid":c=u.left-n.gridpanel_arrows_padding_hor-o.width,l=u.right+n.gridpanel_arrows_padding_hor;break;case"center":c=(u.left-o.width)/2,l=u.right+(t.panelWidth-u.right-o.width)/2}r.placeElement(f,c,s),r.placeElement(e,l,s)}function ot(){var u,e=i.getSize(),f;switch(n.gridpanel_grid_align){default:case"left":u=n.gridpanel_padding_border_left;break;case"middle":case"center":u="center";break;case"right":u=t.panelWidth-e.width-n.gridpanel_padding_border_right}f=i.getElement(),r.placeElement(f,u,n.gridpanel_padding_border_top)}function st(){1==t.arrowsVisible?et():ot()}function ht(){0==t.isHorType?1==n.gridpanel_vertical_scroll?rt():ft():st(),o.placeElements()}var c,u,e,f,ct=this,lt=jQuery(this),s=new UniteGalleryMain,r=new UGFunctions,i=new UGThumbsGrid,o=new UGPanelsBase;this.events={FINISH_MOVE:"gridpanel_move_finish",OPEN_PANEL:"open_panel",CLOSE_PANEL:"close_panel"};var n={gridpanel_vertical_scroll:!0,gridpanel_grid_align:"middle",gridpanel_padding_border_top:10,gridpanel_padding_border_bottom:4,gridpanel_padding_border_left:10,gridpanel_padding_border_right:10,gridpanel_arrows_skin:"",gridpanel_arrows_align_vert:"middle",gridpanel_arrows_padding_vert:4,gridpanel_arrows_align_hor:"center",gridpanel_arrows_padding_hor:10,gridpanel_space_between_arrows:20,gridpanel_arrows_always_on:!1,gridpanel_enable_handle:!0,gridpanel_handle_align:"top",gridpanel_handle_offset:0,gridpanel_handle_skin:"",gridpanel_background_color:""},at={gridpanel_grid_align:"middle",gridpanel_padding_border_top:2,gridpanel_padding_border_bottom:2},vt={gridpanel_grid_align:"center"},t={panelType:"grid",isHorType:!1,arrowsVisible:!1,panelHeight:0,panelWidth:0,originalPosX:null,isEventsInited:!1,isClosed:!1,orientation:null};this.destroy=function(){f&&r.destroyButton(f),e&&r.destroyButton(e),o.destroy(),i.destroy()},this.getOrientation=function(){return t.orientation},this.setOrientation=function(n){switch(t.orientation=n,n){case"right":case"left":t.isHorType=!1;break;case"top":case"bottom":t.isHorType=!0;break;default:throw new Error("Wrong grid panel orientation: "+n);}},this.setHeight=function(n){if(1==t.isHorType)throw new Error("setHeight is not appliable to this orientatio ("+t.orientation+"). Please use setWidth");t.panelHeight=n;var r=k();i.setMaxHeight(r)},this.setWidth=function(n){if(0==t.isHorType)throw new Error("setWidth is not appliable to this orientatio ("+t.orientation+"). Please use setHeight");t.panelWidth=n;var r=d();i.setMaxWidth(r)},this.init=function(n,t){v(n,t)},this.setHtml=function(){p()},this.run=function(){y()},this.getElement=function(){return u},this.getSize=function(){return r.getElementSize(u)},this.__________Functions_From_Base_____=function(){},this.isPanelClosed=function(){return o.isPanelClosed()},this.getClosedPanelDest=function(){return o.getClosedPanelDest()},this.openPanel=function(n){o.openPanel(n)},this.closePanel=function(n){o.closePanel(n)},this.setOpenedState=function(n){o.setOpenedState(n)},this.setClosedState=function(n){o.setClosedState(n)},this.setDisabledAtStart=function(n){o.setDisabledAtStart(n)}}function UGThumbsGrid(){function rt(i,r,f){if(w=i.getObjects(),h=i,h.attachThumbsPanel("grid",u),p=jQuery(i),b=w.g_objWrapper,it=w.g_arrItems,f===!0&&(n.isTilesMode=!0),n.numThumbs=it.length,ht(r),1==n.isTilesMode){s.setFixedMode(),s.setApproveClickFunction(gt),s.init(i,t);var o=s.getOptions();n.tileMaxHeight=o.tile_height,n.tileMaxWidth=o.tile_width,e=s.getObjThumbs()}else r.thumb_fixed_size=!0,e.init(i,r)}function ut(t){var i=b;t&&(i=t),i.append("<div class='ug-thumbs-grid'><div class='ug-thumbs-grid-inner'><\/div><\/div>"),f=i.children(".ug-thumbs-grid"),o=f.children(".ug-thumbs-grid-inner"),1==n.isTilesMode?s.setHtml(o):e.setHtmlThumbs(o)}function ft(){if(0==n.isHorizontal){if(0==n.gridHeight)throw new Error("You must set height before run.");}else if(0==n.gridWidth)throw new Error("You must set width before run.");}function et(){var i=h.getSelectedItem(),r,t;(ft(),1==n.isFirstTimeRun)?(ei(),1==n.isTilesMode?(k(),v(),s.run()):(e.setHtmlProperties(),v(),e.loadThumbsImages())):1==n.isTilesMode&&(r=k(),1==r&&(v(),s.run())),(vt(),1==n.isFirstTimeRun&&n.isTilesMode)&&(t=e.getThumbs(),t.each(function(t,i){b.trigger(n.eventSizeChange,jQuery(i))}),t.fadeTo(0,1)),null!=i&&d(i.index),c.trigger(u.events.PANE_CHANGE,n.currentPane),n.isFirstTimeRun=!1}function a(){var t;return t=1==n.isTilesMode?s.getGlobalTileSize():e.getGlobalThumbSize()}function k(){if(0==n.isTilesMode)throw new Error("Dynamic size can be set only in tiles mode");var i=!1,f=h.isMobileMode(),e=n.spaceBetweenCols;1==f?(n.spaceBetweenCols=t.grid_space_between_mobile,n.spaceBetweenRows=t.grid_space_between_mobile):(n.spaceBetweenCols=t.grid_space_between_cols,n.spaceBetweenRows=t.grid_space_between_rows),n.spaceBetweenCols!=e&&(i=!0);var o=a(),c=o.width,u=n.tileMaxWidth,l=r.getNumItemsInSpace(n.gridWidth,n.tileMaxWidth,n.spaceBetweenCols);return l<t.grid_min_cols&&(u=r.getItemSizeInSpace(n.gridWidth,t.grid_min_cols,n.spaceBetweenCols)),s.setTileSizeOptions(u),u!=c&&(i=!0),i}function ot(){var e=a(),s=e.height,u=n.gridWidth,i=t.grid_num_rows*s+(t.grid_num_rows-1)*n.spaceBetweenRows+2*t.grid_padding;n.gridHeight=i,r.setElementSize(f,u,i),r.setElementSize(o,u,i),n.innerWidth=u,n.innerHeight=i}function st(){var e=a(),s=e.width,i=t.grid_num_cols*s+(t.grid_num_cols-1)*n.spaceBetweenCols+2*t.grid_padding,u=n.gridHeight;n.gridWidth=i,r.setElementSize(f,i,u),r.setElementSize(o,i,u),n.innerWidth=i,n.innerHeight=u}function v(){0==n.isHorizontal?st():ot()}function d(n){var t=tt(n);return-1==t?!1:void u.gotoPane(t,"scroll")}function ht(i){t=jQuery.extend(t,i),e.setOptions(i),n.isNavigationVertical="top"==t.grid_panes_direction||"bottom"==t.grid_panes_direction,n.spaceBetweenCols=t.grid_space_between_cols,n.spaceBetweenRows=t.grid_space_between_rows}function ct(){var k=o.children(".ug-thumb-wrapper"),u=0,e=0,c=0,s=0,v=0,h=0,y,l,p,a,w,b;for(n.innerWidth=0,n.numPanes=1,n.arrPanes=[],n.numThumbsInPane=0,n.arrPanes.push(s),y=k.length,i=0;i<y;i++)l=jQuery(k[i]),r.placeElement(l,u,e),p=l.outerWidth(),a=l.outerHeight(),u>v&&(v=u),w=e+a,w>h&&(h=w),b=v+p,b>n.innerWidth&&(n.innerWidth=b),u+=p+n.spaceBetweenCols,c++,c>=t.grid_num_cols&&(e+=a+n.spaceBetweenRows,u=s,c=0),1==n.numPanes&&n.numThumbsInPane++,e+a>n.gridHeight&&(e=0,s=n.innerWidth+n.spaceBetweenCols,u=s,c=0,1==n.isMaxHeight&&1==n.numPanes&&(n.gridHeight=h,f.height(n.gridHeight)),i<y-1&&(n.numPanes++,n.arrPanes.push(s)));o.width(n.innerWidth),1==n.isMaxHeight&&1==n.numPanes&&(n.gridHeight=h,f.height(h))}function lt(){var w=o.children(".ug-thumb-wrapper"),h=0,u=0,e=0,c=0,l=0,b=0,p,a,k,v,s,y;for(n.innerWidth=0,n.numPanes=1,n.arrPanes=[],n.numThumbsInPane=0,n.arrPanes.push(l),p=w.length,i=0;i<p;i++)a=jQuery(w[i]),r.placeElement(a,h,u),k=a.outerWidth(),v=a.outerHeight(),h+=k+n.spaceBetweenCols,s=u+v,s>e&&(e=s),c++,c>=t.grid_num_cols&&(u+=v+n.spaceBetweenRows,h=l,c=0),1==n.numPanes&&n.numThumbsInPane++,s=u+v,y=b+n.gridHeight,s>y&&(1==n.isMaxHeight&&1==n.numPanes&&(n.gridHeight=e,f.height(n.gridHeight),y=n.gridHeight),u=y+n.spaceBetweenRows,b=u,l=0,h=l,c=0,i<p-1&&(n.numPanes++,n.arrPanes.push(u)));o.height(e),n.innerHeight=e,1==n.isMaxHeight&&1==n.numPanes&&(n.gridHeight=e,f.height(e))}function at(){var b=o.children(".ug-thumb-wrapper"),e=t.grid_padding,k=t.grid_padding,l=k,s=e,h=0,d=0,v=0,a=0,p=0,g,u,c;for(n.innerWidth=0,n.numPanes=1,n.arrPanes=[],n.numThumbsInPane=0,n.arrPanes.push(e-t.grid_padding),g=b.length,i=0;i<g;i++){var w=jQuery(b[i]),y=w.outerWidth(),nt=w.outerHeight();s-e+y>n.gridWidth&&(p++,l=0,p>=t.grid_num_rows?(p=0,e=s,l=k,v=0,1==n.numPanes&&(n.gridWidth=h+t.grid_padding,f.width(n.gridWidth),n.gridHeight=a+t.grid_padding,f.height(n.gridHeight)),n.numPanes++,n.arrPanes.push(e-t.grid_padding)):(s=e,l=v+n.spaceBetweenRows)),r.placeElement(w,s,l),c=s+y,c>h&&(h=c),u=l+nt,u>v&&(v=u),u>a&&(a=u),u>d&&(d=u),c=h+y,c>n.innerWidth&&(n.innerWidth=c),s+=y+n.spaceBetweenCols,1==n.numPanes&&n.numThumbsInPane++}n.innerWidth=h+t.grid_padding,n.innerHeight=a+t.grid_padding,o.width(n.innerWidth),o.height(n.innerHeight),1==n.numPanes&&(n.gridWidth=h+t.grid_padding,n.gridHeight=a+t.grid_padding,f.width(n.gridWidth),f.height(n.gridHeight))}function vt(){0==n.isHorizontal?n.isNavigationVertical?lt():ct():at()}function yt(t){if(0>t||t>=n.numThumbs)throw new Error("Thumb not exists: "+t);return!0}function pt(t){if(t>=n.numPanes||0>t)throw new Error("Pane "+index+" doesn't exists.");return!0}function wt(n){var t=nt(n);return 0==t?!1:void o.css(t)}function g(n){var i=nt(n);return 0==i?!1:void o.stop(!0).animate(i,{duration:t.grid_transition_duration,easing:t.grid_transition_easing,queue:!1})}function y(){var t=-n.arrPanes[n.currentPane];g(t)}function bt(){return 1==n.isNavigationVertical?n.gridHeight:n.gridWidth}function nt(t){var i={};return 1==n.isNavigationVertical?i.top=t+"px":i.left=t+"px",i}function l(){var t=r.getElementSize(o);return 1==n.isNavigationVertical?t.top:t.left}function tt(t){if(0==yt(t))return-1;return Math.floor(t/n.numThumbsInPane)}function kt(){if(1==n.numPanes)return!1;var t=r.getStoredEventData(n.storedEventID),u=t.diffTime,f=l(),i=Math.abs(f-t.startInnerPos);return i>30?!0:i>5&&u>300?!0:!1}function dt(){var t=r.getStoredEventData(n.storedEventID),f=l(),i,u;return diffPos=Math.abs(t.startInnerPos-f),i=bt(),u=Math.round(3*i/8),diffPos>=u?!0:t.diffTime<300&&diffPos>25?!0:!1}function gt(){if(1==n.numPanes)return!0;return r.isApproveStoredEventClick(n.storedEventID,n.isNavigationVertical)}function ni(){if(1==kt())return!0;var t=jQuery(this),i=e.getItemByThumb(t);h.selectItem(i)}function ti(t){if(1==n.numPanes||1==n.touchActive)return!0;0==n.isTilesMode&&t.preventDefault(),n.touchActive=!0;var i={startInnerPos:l()};r.storeEventData(t,n.storedEventID,i)}function ii(){if(0==t.grid_vertical_scroll_ondrag||1==n.isNavigationVertical)return!1;var i=r.handleScrollTop(n.storedEventID);return"vert"===i?!0:!1}function ri(i){var f,o;if(0==n.touchActive||(i.preventDefault(),r.updateStoredEventData(i,n.storedEventID),f=r.getStoredEventData(n.storedEventID,n.isNavigationVertical),o=ii(),o))return!0;var e=f.diffMousePos,u=f.startInnerPos+e,s=e>0?"prev":"next",h=n.arrPanes[n.numPanes-1];0==t.grid_carousel&&u>0&&"prev"==s&&(u/=3),0==t.grid_carousel&&-h>u&&"next"==s&&(u=f.startInnerPos+e/3),wt(u)}function ui(i){var f;if(0==n.touchActive)return!0;if(r.updateStoredEventData(i,n.storedEventID),f=r.getStoredEventData(n.storedEventID,n.isNavigationVertical),n.touchActive=!1,0==dt())return y(),!0;var e=l(),o=e-f.startInnerPos,s=o>0?"prev":"next";"next"==s?0==t.grid_carousel&&u.isLastPane()?y():u.nextPane():0==t.grid_carousel&&u.isFirstPane()?y():u.prevPane()}function fi(){var n=h.getSelectedItem();e.setThumbSelected(n.objThumbWrapper),d(n.index)}function ei(){if(0==n.isTilesMode){e.initEvents();var t=f.find(".ug-thumb-wrapper");t.on("click touchend",ni),p.on(h.events.ITEM_CHANGE,fi)}else s.initEvents();f.bind("mousedown touchstart",ti),jQuery("body").bind("mousemove touchmove",ri),jQuery(window).add("body").bind("mouseup touchend",ui)}var p,w,b,it,f,o,u=this,c=jQuery(this),h=new UniteGalleryMain,r=new UGFunctions,e=new UGThumbsGeneral,s=new UGTileDesign,t={grid_panes_direction:"left",grid_num_cols:2,grid_min_cols:2,grid_num_rows:2,grid_space_between_cols:10,grid_space_between_rows:10,grid_space_between_mobile:10,grid_transition_duration:300,grid_transition_easing:"easeInOutQuad",grid_carousel:!1,grid_padding:0,grid_vertical_scroll_ondrag:!1},n;this.events={PANE_CHANGE:"pane_change"},n={eventSizeChange:"thumb_size_change",isHorizontal:!1,isMaxHeight:!1,isMaxWidth:!1,gridHeight:0,gridWidth:0,innerWidth:0,innerHeight:0,numPanes:0,arrPanes:0,numThumbs:0,currentPane:0,numThumbsInPane:0,isNavigationVertical:!1,touchActive:!1,startScrollPos:0,isFirstTimeRun:!0,isTilesMode:!1,storedEventID:"thumbsgrid",tileMaxWidth:null,tileMaxHeight:null,spaceBetweenCols:null,spaceBetweenRows:null},this.destroy=function(){if(0==n.isTilesMode){var t=f.find(".ug-thumb-wrapper");t.off("click"),t.off("touchend"),p.on(h.events.ITEM_CHANGE),e.destroy()}else s.destroy();f.unbind("mousedown"),f.unbind("touchstart"),jQuery("body").unbind("mousemove"),jQuery("body").unbind("touchmove"),jQuery(window).add("body").unbind("touchend"),jQuery(window).add("body").unbind("mouseup"),c.off(u.events.PANE_CHANGE)},this.__________EXTERNAL_GENERAL_________=function(){},this.setThumbUnselected=function(n){e.setThumbUnselected(n)},this.isItemThumbVisible=function(t){var i=t.index,r=tt(i);return r==n.currentPane?!0:!1},this.__________EXTERNAL_API_________=function(){},this.getNumPanesEstimationByHeight=function(i){var u,r;1==n.isTilesMode?r=t.tile_height:(u=e.getOptions(),r=u.thumb_height);var o=e.getNumThumbs(),f=Math.ceil(o/t.grid_num_cols),s=f*r+(f-1)*n.spaceBetweenRows;return Math.ceil(s/i)},this.getNumPanesEstimationByWidth=function(i){var u,r;n.isTilesMode?r=t.tile_width:(u=e.getOptions(),r=u.thumb_width);var o=e.getNumThumbs(),f=Math.ceil(o/t.grid_num_rows),s=f*r+(f-1)*n.spaceBetweenCols;return Math.ceil(s/i)},this.getHeightEstimationByWidth=function(i){var f;if(0==n.isTilesMode)throw new Error("This function works only with tiles mode");var o=e.getNumThumbs(),s=r.getNumItemsInSpace(i,t.tile_width,n.spaceBetweenCols),u=Math.ceil(o/s);return u>t.grid_num_rows&&(u=t.grid_num_rows),f=r.getSpaceByNumItems(u,t.tile_height,n.spaceBetweenRows),f+=2*t.grid_padding},this.getElement=function(){return f},this.getSize=function(){return r.getElementSize(f)},this.getNumPanes=function(){return n.numPanes},this.isFirstPane=function(){return 0==n.currentPane?!0:!1},this.isLastPane=function(){return n.currentPane==n.numPanes-1?!0:!1},this.getPaneInfo=function(){return{pane:n.currentPane,total:n.numPanes}},this.getPane=function(){return n.currentPane},this.setWidth=function(t){n.gridWidth=t,n.isHorizontal=!0},this.setMaxWidth=function(t){n.gridWidth=t,n.isMaxWidth=!0,n.isHorizontal=!0},this.setHeight=function(t){n.gridHeight=t,n.isHorizontal=!1},this.setMaxHeight=function(t){n.gridHeight=t,n.isMaxHeight=!0,n.isHorizontal=!1},this.gotoPane=function(t){if(0==pt(t)||t==n.currentPane)return!1;var r=-n.arrPanes[t];n.currentPane=t,g(r),c.trigger(u.events.PANE_CHANGE,t)},this.nextPane=function(){var i=n.currentPane+1;if(i>=n.numPanes){if(0==t.grid_carousel)return!0;i=0}u.gotoPane(i,"next")},this.prevPane=function(){var i=n.currentPane-1;return 0>i&&(i=n.numPanes-1,0==t.grid_carousel)?!1:void u.gotoPane(i,"prev")},this.attachNextPaneButton=function(n){return r.setButtonOnClick(n,u.nextPane),1==t.grid_carousel?!0:(u.isLastPane()&&n.addClass("ug-button-disabled"),void c.on(u.events.PANE_CHANGE,function(){u.isLastPane()?n.addClass("ug-button-disabled"):n.removeClass("ug-button-disabled")}))},this.attachPrevPaneButton=function(n){return r.setButtonOnClick(n,u.prevPane),1==t.grid_carousel?!0:(u.isFirstPane()&&n.addClass("ug-button-disabled"),void c.on(u.events.PANE_CHANGE,function(){u.isFirstPane()?n.addClass("ug-button-disabled"):n.removeClass("ug-button-disabled")}))},this.attachBullets=function(t){t.setActive(n.currentPane),jQuery(t).on(t.events.BULLET_CLICK,function(n,i){u.gotoPane(i,"theme"),t.setActive(i)}),jQuery(u).on(u.events.PANE_CHANGE,function(n,i){t.setActive(i)})},this.getObjTileDesign=function(){return s},this.init=function(n,t,i){rt(n,t,i)},this.run=function(){et()},this.setHtml=function(n){ut(n)}}function UGTiles(){function dt(n,t){g_objects=n.getObjects(),c=n,ft=jQuery(n),w=g_objects.g_objWrapper,ir=g_objects.g_arrItems,i=jQuery.extend(i,t),gt(),u.init(n,i),h=u.getObjThumbs()}function gt(){i.tiles_min_columns<1&&(i.tiles_min_columns=1),0!=i.tiles_max_columns&&i.tiles_max_columns<i.tiles_min_columns&&(i.tiles_max_columns=i.tiles_min_columns)}function ni(n){var n,t;n||(n=w),e=n,t=i.tiles_type,n.addClass("ug-tiletype-"+t),u.setHtml(n),n.children(".ug-thumb-wrapper").hide()}function b(){if(e.addClass("ug-tiles-rest-mode"),s.isTransInited=!0,1==i.tiles_enable_transition){e.addClass("ug-tiles-transit");var n=u.getOptions();1==n.tile_enable_image_effect&&0==n.tile_image_effect_reverse&&e.addClass("ug-tiles-transit-overlays"),s.isTransActive=!0}}function l(){return f.getElementSize(e).width}function nt(){return 0==s.isTransInited?!1:(e.addClass("ug-tiles-transition-active"),e.removeClass("ug-tiles-rest-mode"),0==s.isTransActive?!1:void u.disableEvents())}function tt(){return 0==s.isTransInited?!1:(e.removeClass("ug-tiles-transition-active"),void e.addClass("ug-tiles-rest-mode"))}function it(){1==s.isTransActive?(setTimeout(function(){u.enableEvents(),u.triggerSizeChangeEventAllTiles(),tt()},800),s.handle&&clearTimeout(s.handle),s.handle=setTimeout(function(){tt(),u.triggerSizeChangeEventAllTiles(),s.handle=null},2e3)):(u.triggerSizeChangeEventAllTiles(),tt())}function et(){t.colWidth=(t.availWidth-t.colGap*(t.numCols-1))/t.numCols,t.colWidth=Math.floor(t.colWidth),t.totalWidth=f.getSpaceByNumItems(t.numCols,t.colWidth,t.colGap)}function k(){var n,r;(t.colWidth=i.tiles_col_width,t.minCols=i.tiles_min_columns,t.maxCols=i.tiles_max_columns,t.colGap=0==c.isMobileMode()?i.tiles_space_between_cols:i.tiles_space_between_cols_mobile,t.galleryWidth=l(),t.availWidth=t.galleryWidth,1==i.tiles_include_padding&&(t.availWidth=t.galleryWidth-2*t.colGap),1==i.tiles_exact_width)?(t.numCols=f.getNumItemsInSpace(t.availWidth,t.colWidth,t.colGap),t.maxCols>0&&t.numCols>t.maxCols&&(t.numCols=t.maxCols),t.numCols<t.minCols?(t.numCols=t.minCols,et()):t.totalWidth=t.numCols*(t.colWidth+t.colGap)-t.colGap):(n=f.getNumItemsInSpaceRound(t.availWidth,t.colWidth,t.colGap),n<t.minCols?n=t.minCols:0!=t.maxCols&&n>t.maxCols&&(n=t.maxCols),t.numCols=n,et());switch(i.tiles_align){case"center":default:t.addX=Math.round((t.galleryWidth-t.totalWidth)/2);break;case"left":t.addX=0;break;case"right":t.addX=t.galleryWidth-t.totalWidth}for(t.maxColHeight=0,t.arrPosx=[],col=0;col<t.numCols;col++)r=f.getColX(col,t.colWidth,t.colGap),t.arrPosx[col]=r+t.addX;t.colHeights=[0]}function ti(){var n=0,i=999999999;for(col=0;col<t.numCols;col++){if(void 0==t.colHeights[col]||0==t.colHeights[col])return col;t.colHeights[col]<i&&(n=col,i=t.colHeights[col])}return n}function rt(n,r,o,s){var s,h,c,a,v,l;if((null===s||"undefined"==typeof s)&&(s=ti()),h=0,void 0!==t.colHeights[s]&&(h=t.colHeights[s]),c=u.getTileHeightByWidth(t.colWidth,n),null===c){if(1==i.tiles_enable_transition)throw new Error("Can't know tile height, please turn off transition");a=f.getElementSize(n),c=a.height}v=t.arrPosx[s],f.placeElement(n,v,h),l=h+c,t.colHeights[s]=l+t.colGap,t.maxColHeight<l&&(t.maxColHeight=l),1==r&&n.show().fadeTo(0,1),1==o&&e.height(t.maxColHeight)}function y(n){var o,r,l,c,a;for(n||(n=!1),k(),o=h.getThumbs(),nt(),u.resizeAllTiles(t.colWidth,u.resizemode.VISIBLE_ELEMENTS),r=0;r<o.length;r++)l=jQuery(o[r]),c=void 0,1==i.tiles_keep_order&&(c=f.getColByIndex(t.numCols,r)),rt(l,n,!1,c);it(),a=e.height(),1==s.isTransActive&&a>t.maxColHeight?setTimeout(function(){e.height(t.maxColHeight)},700):e.height(t.maxColHeight)}function ii(n){var r=n.index(),e=c.getItem(r),i,u;return e.ordered_placed===!0?!1:(i=f.getPrevRowSameColIndex(r,t.numCols),0>i)?!0:(u=c.getItem(i),u.ordered_placed===!0?!0:!1)}function ot(n,i){var s,l,r,e,a;if(i!==!0&&(s=ii(n),0==s))return!1;var o=n.index(),v=f.getColByIndex(t.numCols,o),y=c.getItem(o);if(u.resizeTile(n,t.colWidth),rt(n,!0,!0,v),y.ordered_placed=!0,l=c.getNumItems(),r=f.getNextRowSameColIndex(o,t.numCols),r>=l)return!1;e=h.getThumbByIndex(r),a=c.getItem(r),h.isThumbLoaded(e),h.isThumbLoaded(e)&&!a.ordered_placed&&ot(e,!0)}function ri(n,r){if(1==r)return!1;n=jQuery(n);var f=jQuery(n).parent();h.triggerImageLoadedEvent(f,n),1==i.tiles_keep_order?ot(f):(u.resizeTile(f,t.colWidth),rt(f,!0,!0))}function ui(){var n=h.getThumbs(),u,o,c,r;if(k(),u=Math.abs(t.galleryWidth-t.totalWidth),1==i.tiles_set_initial_height&&0==f.isScrollbarExists()&&25>u&&(o=(n.length,Math.ceil(n.length/t.numCols)),c=o*i.tiles_col_width*.75,e.height(c),k()),n.fadeTo(0,0),r=jQuery(e).find("img.ug-thumb-image"),1==s.isFixedMode)g.trigger(d.events.TILES_FIRST_PLACED),y(!0),f.checkImagesLoaded(r,function(){b()});else{var a=t.numCols,v=t.galleryWidth,l=!1;f.checkImagesLoaded(r,function(){k(),(a!=t.numCols||v!=t.galleryWidth)&&y(!1),b()},function(n,t){0==l&&g.trigger(d.events.TILES_FIRST_PLACED),l=!0,ri(n,t)})}}function st(){var e=l(),o=h.getThumbs(),t=i.tiles_justified_row_height,s=[],c=0,a=i.tiles_justified_space_between,p=o.length,r,g;jQuery.each(o,function(n,i){i=jQuery(i);var r=h.getItemByThumb(i),u=r.thumbWidth,f=r.thumbHeight;f!==t&&(u=Math.floor(r.thumbRatioByWidth*t)),s[n]=u,c+=u}),r=Math.ceil(c/e),r>p&&(r=p);var nt=c/r,n=[],u=0,v=[],f=[],w=0,b=0;jQuery.each(o,function(t,i){var r=s[t];w+r/2>(b+1)*nt&&(v[n.length]=u,n.push(f),f=[],u=0,b++),w+=r,u+=r,f.push(i)}),v[n.length]=u,n.push(f);var k=[],d=[],y=0;return jQuery.each(n,function(n,i){var c=(i.length,v[n]),o=(i.length-1)*a,l=(e-o)/c,f=Math.round(t*l),u;y+=f,n>0&&(y+=a),d.push(f);var p=f/t,r=[],h=o;jQuery.each(i,function(n,t){var u=jQuery(t),f=u.index(),e=s[f],i=Math.round(e*p);r[n]=i,h+=i}),u=h-e,jQuery.each(r,function(n,t){return 0==u?!1:(0>u?(r[n]=t+1,u++):(r[n]=t-1,u--),void(n==r.length-1&&0!=u&&(r[n]-=u)))}),k[n]=r}),g={arrRows:n,arrRowWidths:k,arrRowHeights:d,gap:a,totalHeight:y}}function ht(n){var n,o,t,s,i,r;n||(n=!1),o=l(),t=st(),e.height(t.totalHeight),s=l(),s!=o&&(t=st()),nt(),i=0,r=0,jQuery.each(t.arrRows,function(e,o){var c=t.arrRowWidths[e],h=t.arrRowHeights[e],s=0;jQuery.each(o,function(e,o){var l=jQuery(o),v=h,a=c[e];u.resizeTile(l,a,v,u.resizemode.VISIBLE_ELEMENTS),f.placeElement(l,s,i),s+=a,s>r&&(r=s),s+=t.gap,1==n&&jQuery(o).show()}),i+=h+t.gap}),it()}function fi(){var t=jQuery(w).find("img.ug-thumb-image"),n=h.getThumbs();n.fadeTo(0,0),f.checkImagesLoaded(t,function(){setTimeout(function(){ht(!0),n.fadeTo(0,1),g.trigger(d.events.TILES_FIRST_PLACED),b()})},function(n){n=jQuery(n);var i=jQuery(n).parent();h.triggerImageLoadedEvent(i,n)})}function ei(){var n=jQuery(w).find("img.ug-thumb-image"),t=h.getThumbs();t.fadeTo(0,0),f.checkImagesLoaded(n,function(){1==c.isMobileMode()?y(!0):lt(!0),g.trigger(d.events.TILES_FIRST_PLACED),b()},function(n){n=jQuery(n);var i=jQuery(n).parent();h.triggerImageLoadedEvent(i,n)})}function ct(){var t=l(),u;n.galleryWidth=t,r={},n.colWidth=i.tiles_nested_col_width,n.optimalTileWidth=i.tiles_nested_optimal_tile_width,n.currentGap=i.tiles_space_between_cols,1==c.isMobileMode()&&(n.currentGap=i.tiles_space_between_cols_mobile),null==n.colWidth?n.colWidth=Math.floor(n.optimalTileWidth/n.nestedOptimalCols):n.nestedOptimalCols=n.optimalTileWidth>n.colWidth?Math.ceil(n.optimalTileWidth/n.colWidth):1,n.maxColumns=f.getNumItemsInSpace(t,n.colWidth,n.currentGap),n.colWidth=f.getItemSizeInSpace(t,n.maxColumns,n.currentGap),n.gridY=0,o=[],trace(n),u=h.getThumbs();switch(u.each(function(){var n=jQuery(this),t=oi(n);o.push(t)}),n.nestedOptimalCols=n.optimalTileWidth>n.colWidth?Math.ceil(n.optimalTileWidth/n.colWidth):1,n.totalWidth=n.maxColumns*(n.colWidth+n.currentGap)-n.currentGap,i.tiles_align){case"center":default:n.addX=Math.round((n.galleryWidth-n.totalWidth)/2);break;case"left":n.addX=0;break;case"right":n.addX=n.galleryWidth-n.totalWidth}n.maxGridY=0}function lt(t){var f=l(),r,u;ct(),at(),r=n.maxGridY*(n.colWidth+n.currentGap)-n.currentGap,e.height(r),u=l(),u!=f&&(ct(),at()),0==i.tiles_nested_debug&&di(t)}function oi(t){var r,f,i={},s=n.colWidth,h=n.currentGap,c=u.getTileImageSize(t),v=t.index(),l=Math.ceil(si(v)*(n.nestedOptimalCols/3)+2*n.nestedOptimalCols/3),e=c.width,o=c.height,a=e/o;return e>o?(r=l,f=Math.round(r/a),0==f&&(f=1)):(f=l,r=Math.round(f*a),0==r&&(r=1)),i.dimWidth=r,i.dimHeight=f,i.width=r*s+h*(r-1),i.height=f*s+h*(f-1),i.imgWidth=e,i.imgHeight=o,i.left=0,i.top=0,i}function si(n){return Math.abs(Math.sin(Math.abs(1e3*Math.sin(n))))}function hi(t,i){var r;if(0==i){for(r=n.currentItem;r<o.length;r++)ut(r,!0);n.currentItem=o.length-1}else ut(n.currentItem,!0);for(r=0;r<=n.currentItem;r++)kt(r,!0);n.currentItem++}function at(n){if(1==i.tiles_nested_debug)return"undefined"==typeof n&&(n=!0),hi(!0,n),!1;for(var t=0;t<o.length;t++)ut(t,!0)}function ut(t,i){var i,o,e,u,s;for(i||(i=!1),n.maxColHeight=0,o=f.getObjectLength(r),e=n.gridY;o+1>=e;e++){for(u=0;u<n.maxColumns;u++)if(0==v(n.gridY)||0==bt(n.gridY,u))return s=wi(u),void ci(t,s,u);n.gridY++}}function ci(t,i,r){var u=jQuery.extend(!0,{},o[t]),s=u.dimWidth,y=i-u.dimWidth,e=n.nestedOptimalCols,d=i<=u.dimWidth||.33*e>=y||e>=i,c,f,l,h,b,k;if(d)a(t,i);else if(e>=y)e>=4?1==pt(Math.floor(i/2),r)?a(t,Math.floor(i/2)+1):a(t,Math.floor(i/2)):a(objImage,i);else if(1==pt(s,r))switch(s>=e){case!0:a(t,s-1);break;case!1:a(t,s+1)}if(u=jQuery.extend(!0,{},o[t]),c=yi(t,u.dimWidth,r),n.columnsValueToEnableHeightResize<=c[0]&&n.maxColumns>=2*n.nestedOptimalCols){f=pi(r,u),l=p(t,f.newHeight,!0),o[t].dimHeight=l.dimHeight;var v=vi(c,l.dimWidth,r),g=li(v),w=!1;return g>=2&&(w=!0),f.newHeight>=u.dimHeight&&(u=p(t,f.newHeight,!0)),h=ai(f.idToResize,f.newHeight,u.dimHeight),u.top=n.gridY,u.left=r,h.push({tileID:t,sizes:u}),b=yt(h),k=yt(v),k>b||1==w?void vt(h):void vt(v)}u.left=r,u.top=n.gridY,o[t]=u,wt(t,u,r,n.gridY),n.maxGridY=u.top+u.dimHeight}function li(t){for(var o=0,s=0,u=0;u<t.length-1;u++){var i=t[u].sizes,f=-1,e=-1;v(i.top+i.dimHeight)&&n.maxColumns>i.left+i.dimWidth&&(f=r[i.top+i.dimHeight-1][i.left+i.dimWidth],e=r[i.top+i.dimHeight][i.left+i.dimWidth]),f!=e&&o++}for(u=0;u<t.length-1;u++){var i=t[u].sizes,f=-1,e=-1;v(i.top+i.dimHeight)&&i.left-1>=0&&(f=r[i.top+i.dimHeight-1][i.left-1],e=r[i.top+i.dimHeight][i.left-1]),f!=e&&s++}return Math.max(s,o)}function ai(t,i,r){var u=o[t],e=u.dimHeight,s=(u.dimWidth,u.left),h=u.top,c=(parseInt(h/(n.colWidth+n.currentGap)),parseInt(s/(n.colWidth+n.currentGap)),e-i+r),l=p(t,c,!0),f=[];return f.push({tileID:t,sizes:l}),f}function vt(n){for(var i,r,t=0;t<n.length;t++)i=n[t].sizes,r=n[t].tileID,o[r]=jQuery.extend(!0,{},i),wt(r,i,i.left,i.top)}function vi(n,t){for(var f,i,s,u,l=0,h=0,e=[],v=0,c=0,r=0;r<n[1].length;r++)u=n[1][r],f=o[n[1][r]],(h+=f.dimHeight,0!=r)?(l+=f.dimHeight,e.push([u,f.dimHeight])):(i=a(u,t,!0),l+=i.dimHeight,e.push([n[1][r],i.dimHeight]));v=f.left,c=f.top;for(var w=h,y=[],r=e.length-1;r>=0;r--)u=e[r][0],0!=r?(s=Math.max(Math.round(h/3),Math.floor(e[r][1]*(h/l))),w-=s,i=p(u,s,!0),i.left=v,i.top=c,y.push({tileID:u,sizes:i}),c+=i.dimHeight):(s=w,i=p(u,s,!0),i.left=v,i.top=c,y.push({tileID:u,sizes:i}));return y}function yi(t,i,u){var f=n.gridY-1,o=0,h=0,c=1,s=[],e=[];if(s.push(t),f>=0){for(h=0;f>=0;){if(o=r[f][u],"undefined"!=typeof r[f][u-1]&&r[f][u-1]==r[f][u]||"undefined"!=typeof r[f][u+i]&&r[f][u+i-1]==r[f][u+i]||r[f][u]!=r[f][u+i-1])return e.push(c),e.push(s),e;h!=o&&(c++,s.push(o)),f--,h=o}return e.push(c),e.push(s),e}return[0,[]]}function pi(t,i){var f=0,e=0,c=i.dimWidth,l=i.dimHeight,a=0,v=0,s=jQuery.map(r,function(n){return[n]}),u,o,h,y;if("undefined"==typeof s[n.gridY]||"undefined"==typeof s[n.gridY][t-1])e=0;else for(u=0;;){if("undefined"==typeof r[n.gridY+u]||-1==r[n.gridY+u][t-1])break;a=r[n.gridY+u][t-2],u++,e++}if("undefined"==typeof s[n.gridY]||"undefined"==typeof s[n.gridY][t+c])f=0;else for(u=0;;){if("undefined"==typeof r[n.gridY+u]||-1==r[n.gridY+u][t+c])break;v=r[n.gridY+u][t+c+1],u++,f++}return o=0,h=0,Math.abs(l-e)<Math.abs(l-f)&&0!=e?(o=e,h=a):0!=f?(o=f,h=v):o=l,y={newHeight:o,idToResize:h}}function a(t,i,r){var f;r||(r=!1);var e=n.colWidth,s=n.currentGap,u=o[t],h=u.imgWidth,c=u.imgHeight,l=h/c;if(dimWidth=i,dimHeight=Math.round(dimWidth/l),1==r)return f=jQuery.extend(!0,{},u),f.dimWidth=dimWidth,f.dimHeight=dimHeight,f.width=dimWidth*e+s*(dimWidth-1),f.height=dimHeight*e+s*(dimHeight-1),f;u.dimWidth=dimWidth,u.dimHeight=dimHeight,u.width=dimWidth*e+s*(dimWidth-1),u.height=dimHeight*e+s*(dimHeight-1)}function p(t,i,r){var f;r||(r=!1);var u=o[t],e=u.dimWidth,s=n.colWidth,h=n.currentGap;if(1==r)return f=jQuery.extend(!0,{},u),f.dimHeight=i,f.width=e*s+h*(e-1),f.height=i*s+h*(i-1),f;u.dimHeight=i,u.width=e*s+h*(e-1),u.height=i*s+h*(i-1)}function yt(n){for(var t,r=0,u=0,i=0;i<n.length;i++){if(t=o[n[i].tileID],0==t.dimHeight||0==t.height)return;resizeVal=t.dimWidth/t.dimHeight/(t.imgWidth/t.imgHeight),resizeVal<1&&(resizeVal=1/resizeVal),r+=resizeVal,u++}return r/u}function pt(t,i){var u=n.gridY-1;return 0>=u||0==v(u)?!1:r[u][i+t-1]!=r[u][i+t]?!0:!1}function wi(t){var r=t,i=0;if(1==v(n.gridY))for(;0==bt(n.gridY,r);)i++,r++;else i=n.maxColumns;return i}function v(n){return"undefined"==typeof r[n]?!1:!0}function wt(n,t,i,r){for(var f,u=0;u<t.dimHeight;u++)for(f=0;f<t.dimWidth;f++)0==v(r+u)&&bi(r+u),ki(r+u,i+f,n)}function bi(t){r[t]={};for(var i=0;i<n.maxColumns;i++)r[t][i]=-1}function bt(n,t){return-1!=r[n][t]}function ki(n,t,i){r[n][t]=i}function di(t){var t,i;for(t||(t=!1),nt(),i=0;i<o.length;i++)kt(i,t);e.height(n.maxColHeight),it()}function kt(t,i){var e=h.getThumbByIndex(t),r=o[t],s=r.top*(n.colWidth+n.currentGap),c=n.addX+r.left*(n.colWidth+n.currentGap);u.resizeTile(e,r.width,r.height,u.resizemode.VISIBLE_ELEMENTS),f.placeElement(e,c,s),s+r.height>n.maxColHeight&&(n.maxColHeight=s+r.height),1==i&&e.fadeTo(0,1)}function gi(){if(1==s.isFirstTimeRun)return!0;switch(i.tiles_type){case"columns":y(!1);break;case"justified":ht(!1);break;case"nested":var n=c.isMobileMode();1==n?y(!1):lt(!1)}}function nr(){ft.on(c.events.SIZE_CHANGE,gi),u.initEvents()}function tr(){switch(w.children(".ug-tile").show(),1==s.isFirstTimeRun&&nr(),u.run(),i.tiles_type){default:case"columns":ui();break;case"justified":fi();break;case"nested":ei()}s.isFirstTimeRun=!1}var ft,w,e,ir,r,o,d=this,g=jQuery(this),c=new UniteGalleryMain,f=new UGFunctions,u=new UGTileDesign,h=new UGThumbsGeneral,t={},i={tiles_type:"columns",tiles_col_width:250,tiles_align:"center",tiles_exact_width:!1,tiles_space_between_cols:3,tiles_space_between_cols_mobile:3,tiles_include_padding:!0,tiles_min_columns:2,tiles_max_columns:0,tiles_keep_order:!1,tiles_set_initial_height:!0,tiles_justified_row_height:150,tiles_justified_space_between:3,tiles_nested_optimal_tile_width:250,tiles_nested_col_width:null,tiles_nested_debug:!1,tiles_enable_transition:!0},s,n;this.events={THUMB_SIZE_CHANGE:"thumb_size_change",TILES_FIRST_PLACED:"tiles_first_placed"},s={isFixedMode:!1,isFirstTimeRun:!0,handle:null,isTransActive:!1,isTransInited:!1},n={colWidth:null,nestedOptimalCols:5,gridY:0,maxColumns:0,columnsValueToEnableHeightResize:3,resizeLeftRightToColumn:!0,currentItem:0,currentGap:null,optimalTileWidth:null,maxGridY:0},this.destroy=function(){ft.off(c.events.SIZE_CHANGE),u.destroy()},this.setFixedSizeMode=function(){s.isFixedMode=!0,u.setFixedMode()},this.init=function(n,t){dt(n,t)},this.setHtml=function(n){ni(n)},this.getObjTileDesign=function(){return u},this.run=function(){tr()}}function UGTileDesign(){function et(u,e){var s,h,o,l;f=u,ti=jQuery(u),s=f.getObjects(),c=s.g_objWrapper,ii=f.getArrItems(),n=jQuery.extend(n,ri),n=jQuery.extend(n,e),ot(),r.init(u,n),h={allow_onresize:!1},o=["overlay"],t.funcCustomTileHtml&&(o=[]),r.setCustomThumbs(st,o,h),l=r.getOptions(),n=jQuery.extend(n,l),t.ratioByWidth=n.tile_width/n.tile_height,t.ratioByHeight=n.tile_height/n.tile_width,n.tile_size_by==i.sizeby.GLOBAL_RATIO&&t.isTextpanelOutside&&(t.hasImageContainer=!0)}function ot(){if(1==n.tile_enable_overlay?(n.thumb_overlay_opacity=n.tile_overlay_opacity,n.thumb_overlay_color=n.tile_overlay_color):0==n.tile_enable_icons?n.thumb_color_overlay_effect=!1:n.thumb_overlay_opacity=0,n.tile_as_link&&(n.thumb_wrapper_as_link=!0,n.thumb_link_newpage=n.tile_link_newpage),1==n.tile_enable_outline&&0==n.tile_enable_border&&(n.tile_enable_outline=!1),t.tileInnerReduce=0,n.tile_enable_border&&(t.tileInnerReduce=2*n.tile_border_width,r.setThumbInnerReduce(t.tileInnerReduce)),t.isSaparateIcons=!u.isRgbaSupported(),1==n.tile_enable_textpanel){switch(n.tile_textpanel_position){case"top":n.tile_textpanel_align="top";case"bottom":t.isTextpanelOutside=!0,n.tile_textpanel_always_on=!0,n.tile_textpanel_offset=0;break;case"inside_top":n.tile_textpanel_align="top";break;case"middle":n.tile_textpanel_align="middle",n.tile_textpanel_appear_type="fade"}0==n.tile_textpanel_always_on&&(t.isSaparateIcons=!0)}0!=n.tile_textpanel_offset&&(n.tile_textpanel_appear_type="fade",n.tile_textpanel_margin=n.tile_textpanel_offset),"title_and_desc"==n.tile_textpanel_source&&(n.tile_textpanel_enable_description=!0,n.tile_textpanel_desc_style_as_title=!0)}function p(){var i=f.isMobileMode();switch(t.isTextPanelHidden=!1,1==i&&0==n.tile_textpanel_always_on&&(t.isTextPanelHidden=!0),t.isVideoplayIconAlwaysOn=n.tile_videoplay_icon_always_on,n.tile_videoplay_icon_always_on){case"always":t.isVideoplayIconAlwaysOn=!0;break;case"never":t.isVideoplayIconAlwaysOn=!1;break;case"mobile_only":t.isVideoplayIconAlwaysOn=1==i?!0:!1;break;case"desktop_only":t.isVideoplayIconAlwaysOn=0==i?!0:!1}}function st(r,o){var a,rt,b,s,h,v,k,ut,d,y,g,p,nt,tt,et,c,ft,l,it,ot,st,ht,w;if(r.addClass("ug-tile"),t.funcCustomTileHtml)return t.funcCustomTileHtml(r,o),!1;if(a="",1==t.hasImageContainer&&(a+="<div class='ug-image-container ug-trans-enabled'>"),rt="ug-thumb-image",(0==n.tile_enable_image_effect||1==n.tile_image_effect_reverse)&&(rt+=" ug-trans-enabled"),b=u.stripTags(o.title),b=u.htmlentitles(b),a+="<img src='"+o.urlThumb+"' alt='"+b+"' class='"+rt+"'>",1==t.hasImageContainer&&(a+="<\/div>"),r.append(a),n.tile_size_by==i.sizeby.GLOBAL_RATIO&&r.fadeTo(0,0),s={},(1==n.tile_enable_background&&(s["background-color"]=n.tile_background_color),1==n.tile_enable_border&&(s["border-width"]=n.tile_border_width+"px",s["border-style"]="solid",s["border-color"]=n.tile_border_color,n.tile_border_radius&&(s["border-radius"]=n.tile_border_radius+"px")),1==n.tile_enable_outline&&(s.outline="1px solid "+n.tile_outline_color),1==n.tile_enable_shadow)&&(h=n.tile_shadow_h+"px ",h+=n.tile_shadow_v+"px ",h+=n.tile_shadow_blur+"px ",h+=n.tile_shadow_spread+"px ",h+=n.tile_shadow_color,s["box-shadow"]=h),r.css(s),v="",n.tile_enable_icons?(0==n.tile_as_link&&1==n.tile_enable_action&&(k="ug-button-play ug-icon-zoom","image"!=o.type&&(k="ug-button-play ug-icon-play"),v+="<div class='ug-tile-icon "+k+"' style='display:none'><\/div>"),(o.link&&1==n.tile_show_link_icon||1==n.tile_as_link)&&(0==n.tile_as_link?(ut="",1==n.tile_link_newpage&&(ut=" target='_blank'"),v+="<a href='"+o.link+"'"+ut+" class='ug-tile-icon ug-icon-link'><\/a>"):v+="<div class='ug-tile-icon ug-icon-link' style='display:none'><\/div>"),d=t.isSaparateIcons,y=(0==d&&"image"!=o.type&&1==t.isVideoplayIconAlwaysOn&&(d=!0),d)?r:r.children(".ug-thumb-overlay"),y.append(v),g=y.children("."+k),0==g.length?g=null:g.hide(),p=y.children(".ug-icon-link"),0==p.length?p=null:p.hide(),p||1!=n.tile_enable_action||r.addClass("ug-tile-clickable")):1==n.tile_enable_action&&r.addClass("ug-tile-clickable"),1==n.tile_enable_image_effect&&(nt="",0==n.tile_image_effect_reverse&&(nt=" ug-trans-enabled"),tt="<div class='ug-tile-image-overlay"+nt+"' >",et=" ug-"+n.tile_image_effect_type+"-effect",tt+="<img src='"+o.urlThumb+"' alt='"+o.title+"' class='"+et+nt+"'>",tt+="<\/div>",r.append(tt),1==n.tile_image_effect_reverse&&r.children(".ug-tile-image-overlay").fadeTo(0,0)),1==n.tile_enable_textpanel){c=new UGTextPanel,c.init(f,n,"tile"),ft="",(1==n.tile_textpanel_always_on||1==t.isTextpanelOutside)&&(ft="ug-trans-enabled"),c.appendHTML(r,ft),l=o.title,it="";switch(n.tile_textpanel_source){case"desc":case"description":l=o.description;break;case"desc_title":""!=o.description&&(l=o.description);break;case"title_and_desc":l=o.title,it=o.description}(c.setTextPlain(l,it),0==n.tile_textpanel_always_on&&c.getElement().fadeTo(0,0),r.data("objTextPanel",c),1==n.tile_textpanel_always_on)&&(ot=e(r),ot.css("z-index",2)),1==t.isTextpanelOutside&&(st="<div class='ug-tile-cloneswrapper'><\/div>",r.append(st),ht=r.children(".ug-tile-cloneswrapper"),w=new UGTextPanel,w.init(f,n,"tile"),w.appendHTML(ht),w.setTextPlain(l,it),r.data("objTextPanelClone",w))}null!==o.addHtml&&r.append(o.addHtml)}function w(n){return n.children(".ug-tile-image-overlay")}function ht(n){return n.children(".ug-thumb-overlay")}function ct(n){if(0==t.hasImageContainer)return null;return n.children(".ug-image-container")}function lt(n){return n.find(".ug-tile-image-overlay img")}function b(n){return n.data("objTextPanel")}function at(n){return n.data("objTextPanelClone")}function e(n){return n.children(".ug-textpanel")}function vt(n){var t=n.find(".ug-tile-cloneswrapper .ug-textpanel");if(0==t.length)throw new Error("text panel cloned element not found");return t}function o(n){var i,r;return(i=1==t.isTextpanelOutside?vt(n):e(n),!i)?0:(r=u.getElementSize(i),r.height)}function k(n){var t=n.find(".ug-icon-link");return 0==t.length?null:t}function yt(r){var f=t.ratioByHeight,u;switch(n.tile_size_by){default:f=t.ratioByHeight;break;case i.sizeby.IMAGE_RATIO:if(!r)throw new Error("tile should be given for tile ratio");if(u=i.getItemByTile(r),"undefined"!=typeof u.thumbRatioByHeight){if(0==u.thumbRatioByHeight)throw trace(u),new Error("the item ratio not inited yet");f=u.thumbRatioByHeight}break;case i.sizeby.CUSTOM:return null}return f}function d(n){var t=n.find(".ug-button-play");return 0==t.length?null:t}function s(n){return n.hasClass("ug-thumb-over")?!0:!1}function g(n){return n.hasClass("ug-tile-clickable")}function nt(i){return 1==n.tile_enable_icons&&1==t.isVideoplayIconAlwaysOn&&"image"!=i.type?!0:!1}function tt(r,f,e,s){var y=w(r),c=i.getTileImage(r),p=lt(r),h,a,v,l;f-=t.tileInnerReduce,e-=t.tileInnerReduce,h=null,1==t.isTextpanelOutside&&(a=o(r),(e-=a,"top"==n.tile_textpanel_position&&(h=a),1==t.hasImageContainer)&&(v=ct(r),u.setElementSize(v,f,e),null!==h&&u.placeElement(v,0,h))),0==n.tile_enable_image_effect?(u.scaleImageCoverParent(c,f,e),0==t.hasImageContainer&&null!==h&&u.placeElement(c,0,h)):(l="nothing",s===!0&&0==t.isTextpanelOutside&&(l=1==n.tile_image_effect_reverse?"effect":"image"),"effect"!=l&&(u.setElementSize(y,f,e),null!==h&&u.placeElement(y,0,h),u.scaleImageCoverParent(p,f,e)),"image"!=l&&(1==t.hasImageContainer?u.scaleImageCoverParent(c,f,e):"effect"==l?(u.scaleImageCoverParent(c,f,e),null!==h&&u.placeElement(c,0,h)):u.cloneElementSizeAndPos(p,c,!1,null,h)))}function l(r,u,f,e){var c=null,l,a,s,h,v,y;if(f&&(c=f-t.tileInnerReduce),e&&(e-=t.tileInnerReduce),"clone"==u)return l=at(r),l.refresh(!0,!0,c),a=i.getItemByTile(r),a.textPanelCloneSizeSet=!0,!1;if(s=b(r),!s)return!1;h=null,1==t.isTextpanelOutside&&(h=o(r)),s.refresh(!1,!0,c,h),v=1==n.tile_textpanel_always_on||"fade"==n.tile_textpanel_appear_type,v&&(1==t.isTextpanelOutside&&e&&"bottom"==n.tile_textpanel_position?(y=e-h,s.positionPanel(y)):s.positionPanel())}function it(r){var s=(i.getItemByTile(r),d(r)),h=k(r),f=u.getElementSize(r),p,rt,c,ut,w;tt(r,f.width,f.height),1==n.tile_enable_textpanel&&l(r,"regular",f.width,f.height);var ft=f.width-t.tileInnerReduce,nt=f.height-t.tileInnerReduce,it=0;if(1==t.isTextpanelOutside&&(p=o(r),nt-=p,"top"==n.tile_textpanel_position&&(it=p)),rt=ht(r),(u.setElementSizeAndPosition(rt,0,it,ft,nt),s||h)&&(c=0,1==n.tile_enable_textpanel&&0==t.isTextPanelHidden&&0==t.isTextpanelOutside&&(ut=e(r),w=u.getElementSize(ut),w.height>0&&(c=Math.floor(w.height/-2)))),s&&h){var v=u.getElementSize(s),b=u.getElementSize(h),a=n.tile_space_between_icons,g=v.width+a+b.width,y=Math.floor((f.width-g)/2);a>y&&(a=Math.floor((f.width-v.width-b.width)/3),g=v.width+a+b.width,y=Math.floor((f.width-g)/2)),u.placeElement(s,y,"middle",0,c),u.placeElement(h,y+v.width+a,"middle",0,c)}else s&&u.placeElement(s,"center","middle",0,c),h&&u.placeElement(h,"center","middle",0,c);s&&s.show(),h&&h.show()}function rt(t,r){var u=(i.getItemByTile(t),w(t)),f=n.thumb_transition_duration,e;0==n.tile_image_effect_reverse?(e=i.getTileImage(t),r?(e.fadeTo(0,1),u.stop(!0).fadeTo(f,0)):u.stop(!0).fadeTo(f,1)):r?u.stop(!0).fadeTo(f,1):u.stop(!0).fadeTo(f,0)}function ut(t,i){var f=n.thumb_transition_duration,r=e(t),o;if(!r)return!0;if("slide"==n.tile_textpanel_appear_type){if(o=u.getElementSize(r),0==o.width)return!1;var l=-o.height,a=0,s={},h={},c="bottom";"inside_top"==n.tile_textpanel_position&&(c="top"),s[c]=l+"px",h[c]=a+"px",1==i?(r.fadeTo(0,1),0==r.is(":animated")&&r.css(s),h.opacity=1,r.stop(!0).animate(h,f)):r.stop(!0).animate(s,f)}else 1==i?r.stop(!0).fadeTo(f,1):r.stop(!0).fadeTo(f,0)}function a(t,i,r){var u=n.thumb_transition_duration;r&&r===!0&&(u=0);var f=d(t),e=k(t),o=i?1:0;f&&f.stop(!0).fadeTo(u,o),e&&e.stop(!0).fadeTo(u,o)}function pt(r,u){if(u=jQuery(u),n.tile_enable_image_effect&&rt(u,!0),1==n.tile_enable_textpanel&&0==n.tile_textpanel_always_on&&0==t.isTextPanelHidden&&ut(u,!0),t.isSaparateIcons&&1==n.tile_enable_icons){var f=1==n.thumb_overlay_reverse,e=i.getItemByTile(u);0==nt(e)&&a(u,f,!1)}}function wt(r,u){if(u=jQuery(u),n.tile_enable_image_effect&&rt(u,!1),1==n.tile_enable_textpanel&&0==n.tile_textpanel_always_on&&ut(u,!1),1==t.isSaparateIcons&&1==n.tile_enable_icons){var f=1==n.thumb_overlay_reverse?!1:!0,e=i.getItemByTile(u);0==nt(e)?a(u,f,!1):a(u,!0,!0)}}function bt(n){var t=r.getThumbs().not(n);t.each(function(n,t){r.setThumbNormalStyle(jQuery(t))})}function kt(t,i,u){return i=jQuery(i),1==n.tile_visible_before_image&&i.data("image_placed")!==!0&&u!==!0?!0:(it(i),void r.setThumbNormalStyle(i))}function ft(n,t,i){it(t),i.fadeTo(0,1),t.data("image_placed",!0)}function v(n){return 1==g(n)?(y.trigger(i.events.TILE_CLICK,n),!0):void(0==s(n)&&(bt(n),r.setThumbOverStyle(n)))}function dt(n){var r=jQuery(this),f=r.prop("tagName").toLowerCase(),u=!0;if(t.funcParentApproveClick&&0==t.funcParentApproveClick()&&(u=!1),"a"==f)0==u&&n.preventDefault();else if(0==s(r))1==u&&v(r);else{if(0==g(r))return!0;1==u&&y.trigger(i.events.TILE_CLICK,r)}}function gt(n){n.stopPropagation();var r=jQuery(this).parents(".ug-tile"),u=!0;return t.funcParentApproveClick&&0==t.funcParentApproveClick()&&(u=!1),0==s(r)?(v(r),!0):1==u?(y.trigger(i.events.TILE_CLICK,r),!1):void 0}function ni(i){var r=jQuery(this).parents(".ug-tile");t.funcParentApproveClick&&0==t.funcParentApproveClick()&&i.preventDefault(),0==s(r)&&0==n.tile_as_link&&(i.preventDefault(),v(r))}var ti,h,c,ii,i=this,y=jQuery(this),f=new UniteGalleryMain,u=new UGFunctions,r=new UGThumbsGeneral;this.resizemode={FULL:"full",WRAPPER_ONLY:"wrapper_only",VISIBLE_ELEMENTS:"visible_elements"},this.sizeby={GLOBAL_RATIO:"global_ratio",TILE_RATIO:"tile_ratio",IMAGE_RATIO:"image_ratio",CUSTOM:"custom"},this.events={TILE_CLICK:"tile_click"};var n={tile_width:250,tile_height:200,tile_size_by:i.sizeby.IMAGE_RATIO,tile_visible_before_image:!1,tile_enable_background:!0,tile_background_color:"#F0F0F0",tile_enable_border:!1,tile_border_width:3,tile_border_color:"#F0F0F0",tile_border_radius:0,tile_enable_outline:!1,tile_outline_color:"#8B8B8B",tile_enable_shadow:!1,tile_shadow_h:1,tile_shadow_v:1,tile_shadow_blur:3,tile_shadow_spread:2,tile_shadow_color:"#8B8B8B",tile_enable_action:!0,tile_as_link:!1,tile_link_newpage:!0,tile_enable_overlay:!0,tile_overlay_opacity:.4,tile_overlay_color:"#000000",tile_enable_icons:!0,tile_show_link_icon:!1,tile_videoplay_icon_always_on:"never",tile_space_between_icons:26,tile_enable_image_effect:!1,tile_image_effect_type:"bw",tile_image_effect_reverse:!1,tile_enable_textpanel:!1,tile_textpanel_source:"title",tile_textpanel_always_on:!1,tile_textpanel_appear_type:"slide",tile_textpanel_position:"inside_bottom",tile_textpanel_offset:0},ri={thumb_color_overlay_effect:!0,thumb_overlay_reverse:!0,thumb_image_overlay_effect:!1,tile_textpanel_enable_description:!1,tile_textpanel_bg_opacity:.6,tile_textpanel_padding_top:8,tile_textpanel_padding_bottom:8},t={ratioByHeight:0,ratioByWidth:0,eventSizeChange:"thumb_size_change",funcCustomTileHtml:null,funcCustomPositionElements:null,funcParentApproveClick:null,isSaparateIcons:!1,tileInnerReduce:0,isTextpanelOutside:!1,hasImageContainer:!1,isVideoplayIconAlwaysOn:!1,isTextPanelHidden:!1};this.loadTileImage=function(n){var t=i.getTileImage(n);u.checkImagesLoaded(t,null,function(t){ft(null,n,jQuery(t))})},this.setHtml=function(n){h=n,p(),r.setHtmlThumbs(n)},this.initEvents=function(){r.initEvents(),jQuery(r).on(r.events.SETOVERSTYLE,pt),jQuery(r).on(r.events.SETNORMALSTYLE,wt),jQuery(r).on(r.events.PLACEIMAGE,ft),c.on(t.eventSizeChange,kt),h.delegate(".ug-tile .ug-button-play","click",gt),h.delegate(".ug-tile","click",dt),h.delegate(".ug-tile .ug-icon-link","click",ni)},this.destroy=function(){if(jQuery(r).off(r.events.SETOVERSTYLE),jQuery(r).off(r.events.SETNORMALSTYLE),jQuery(r).off(r.events.PLACEIMAGE),c.off(t.eventSizeChange),1==n.tile_enable_textpanel){var i=r.getThumbs();jQuery.each(i,function(n,t){var i=b(jQuery(t));i&&i.destroy()})}r.destroy()},this.init=function(n,t,i){et(n,t,i)},this.setFixedMode=function(){n.tile_size_by=i.sizeby.GLOBAL_RATIO,n.tile_visible_before_image=!0},this.setApproveClickFunction=function(n){t.funcParentApproveClick=n},this.resizeTile=function(r,f,e,o){var f,e;(1==t.isTextpanelOutside&&l(r,"clone",f),f)?e||(e=i.getTileHeightByWidth(f,r)):(f=n.tile_width,e=n.tile_height);switch(u.setElementSize(r,f,e),o){default:case i.resizemode.FULL:i.triggerSizeChangeEvent(r,!0);break;case i.resizemode.WRAPPER_ONLY:return!0;case i.resizemode.VISIBLE_ELEMENTS:if(t.funcCustomTileHtml)return i.triggerSizeChangeEvent(r,!0),!0;tt(r,f,e,!0),1==n.tile_enable_textpanel&&1==n.tile_textpanel_always_on&&f&&l(r,"regular",f,e)}},this.resizeAllTiles=function(t,u){var f,e;p(),f=null,n.tile_size_by==i.sizeby.GLOBAL_RATIO&&(f=i.getTileHeightByWidth(t)),e=r.getThumbs(),e.each(function(n,r){i.resizeTile(jQuery(r),t,f,u)})},this.triggerSizeChangeEvent=function(n,i){if(!n)return!1;if(!i)var i=!1;c.trigger(t.eventSizeChange,[n,i])},this.triggerSizeChangeEventAllTiles=function(n){var t=r.getThumbs();t.each(function(){var t=jQuery(this);i.triggerSizeChangeEvent(t,n)})},this.disableEvents=function(){var n=r.getThumbs();n.css("pointer-events","none")},this.enableEvents=function(){var n=r.getThumbs();n.css("pointer-events","auto")},this.setOptions=function(t){n=jQuery.extend(n,t),r.setOptions(t)},this.setTileSizeOptions=function(r){if(n.tile_size_by!==i.sizeby.GLOBAL_RATIO)throw new Error("setNewTileOptions works with global ration only");n.tile_width=r,n.tile_height=Math.floor(r*t.ratioByHeight)},this.setCustomFunctions=function(n,i){t.funcCustomTileHtml=n,t.funcCustomPositionElements=i},this.run=function(){var t=r.getThumbs();n.tile_size_by==i.sizeby.GLOBAL_RATIO&&i.resizeAllTiles(n.tile_width,i.resizemode.WRAPPER_ONLY),1==n.tile_enable_image_effect&&0==n.tile_image_effect_reverse&&t.children(".ug-thumb-image").fadeTo(0,0),r.setHtmlProperties(),1==n.tile_visible_before_image&&(t.children(".ug-thumb-image").fadeTo(0,0),r.loadThumbsImages())},this._____________EXTERNAL_GETTERS____________=function(){},this.getObjThumbs=function(){return r},this.getOptions=function(){return n},this.getTileImage=function(n){return n.find("img.ug-thumb-image")},this.getItemByTile=function(n){return r.getItemByThumb(n)},this.getTileHeightByWidth=function(r,u){var e=yt(u),f;return null===e?null:(f=Math.floor((r-t.tileInnerReduce)*e)+t.tileInnerReduce,u&&1==t.isTextpanelOutside&&n.tile_size_by==i.sizeby.IMAGE_RATIO&&(f+=o(u)),f)},this.getTileImageSize=function(n){var t=i.getItemByTile(n),r;if(!t.thumbWidth||!t.thumbHeight)throw new Error("Can't get image size - image not inited.");return r={width:t.thumbWidth,height:t.thumbHeight}},this.getGlobalTileSize=function(){if(n.tile_size_by!=i.sizeby.GLOBAL_RATIO)throw new Error("The size has to be global ratio");return{width:n.tile_width,height:n.tile_height}}}function UGAviaControl(){function s(n){return 0==e?n.pageX:n.pageY}function h(){jQuery("body").on("touchstart",function(){return 0==n.isControlEnabled?!0:void(n.touchEnabled=!0)}),jQuery("body").mousemove(function(t){var i,f;if(0==n.isControlEnabled)return!0;if(1==n.touchEnabled)return jQuery("body").off("mousemove"),!0;n.isMouseInsideStrip=r.ismouseover(),i=u.isTouchMotionActive(),1==n.isMouseInsideStrip&&0==i?(f=s(t),p(f)):o()})}function c(n){var h=t.strip_padding_top,e=(t.strip_padding_bottom,r.height()),c=f.height(),l,s;if(e>c)return null;var a=r.offset(),v=a.top,i=n-v-h;if(0>i)return null;var u=t.thumb_height,o=e-t.thumb_height,y=o-u;return u>i&&(i=u),i>o&&(i=o),l=(i-u)/y,s=(c-e)*l,s=-1*Math.round(s)+h}function l(n){var e=t.strip_padding_left,a=t.strip_padding_right,o=r.width()-e-a,c=f.width(),l,h;if(o>c)return null;var v=r.offset(),y=v.left,i=n-y-e,u=t.thumb_width,s=o-t.thumb_width,p=s-u;return u>i&&(i=u),i>s&&(i=s),l=(i-u)/p,h=(c-o)*l,h=-1*Math.round(h)+e}function a(){var i,t,r,f;if(0==n.is_strip_moving)return!1;i=u.getInnerStripPos(),Math.floor(i)==Math.floor(n.strip_finalPos)&&o(),r=Math.abs(n.strip_finalPos-i),1>r?t=r:(t=r/4,t>0&&1>t&&(t=1)),n.strip_finalPos<i&&(t=-1*t),f=i+t,u.positionInnerStrip(f)}function v(){return 1==n.isStripMoving?!1:(n.isStripMoving=!0,void(n.handle_timeout=setInterval(a,10)))}function o(){return 0==n.isStripMoving?!1:(n.isStripMoving=!1,void(n.handle_timeout=clearInterval(n.handle_timeout)))}function y(n){return 0==e?l(n):c(n)}function p(t){var i=y(t);return null===i?!1:(n.is_strip_moving=!0,n.strip_finalPos=i,void v())}var u,w,i,r,f,t,e,n={touchEnabled:!1,isMouseInsideStrip:!1,strip_finalPos:0,handle_timeout:"",isStripMoving:!1,isControlEnabled:!0};this.enable=function(){n.isControlEnabled=!0},this.disable=function(){n.isControlEnabled=!1},this.init=function(n){u=n,i=n.getObjects(),w=i.g_gallery,r=i.g_objStrip,f=i.g_objStripInner,t=i.g_options,e=i.isVertical,h()},this.destroy=function(){jQuery("body").off("touchstart"),jQuery("body").off("mousemove")}}function UGSlider(){function hi(r,f,o){var l,a,v;u=r,o&&(ct=o,f=i.convertCustomPrefixOptions(f,ct,"slider")),it=jQuery(r),l=u.getObjects(),(ot=l.g_objWrapper,kr=l.g_objThumbs,f.hasOwnProperty("slider_progress_indicator_type")&&(n.slider_progress_indicator_type=f.slider_progress_indicator_type),"bar"==n.slider_progress_indicator_type&&(n=jQuery.extend(n,si)),f&&t.setOptions(f),li(),1==n.slider_enable_bullets)&&(c=new UGBullets,a={bullets_skin:n.slider_bullets_skin,bullets_space_between:n.slider_bullets_space_between},c.init(u,a)),n.slider_enable_text_panel&&(s=new UGTextPanel,s.init(u,n,"slider")),n.slider_enable_zoom_panel&&(h=new UGZoomButtonsPanel,h.init(t,n)),v=u.getGalleryID(),e.init(n,!1,v)}function ci(){if(1==r.isRunOnce)return!1;if(r.isRunOnce=!0,n.slider_background_color){var u=n.slider_background_color;1!=n.slider_background_opacity&&(u=i.convertHexToRGB(u,n.slider_background_opacity)),f.css("background-color",u)}else 1!=n.slider_background_opacity&&(u=i.convertHexToRGB("#000000",n.slider_background_opacity),f.css("background-color",u));1==n.slider_control_swipe&&(d=new UGTouchSliderControl,d.init(t,n)),1==n.slider_control_zoom&&(l=new UGZoomSliderControl,l.init(t,n)),s&&s.run(),pr()}function li(){var i=u.getOptions(),t=i.gallery_skin;""==n.slider_bullets_skin&&(n.slider_bullets_skin=t),""==n.slider_arrows_skin&&(n.slider_arrows_skin=t),""==n.slider_zoompanel_skin&&(n.slider_zoompanel_skin=t),""==n.slider_play_button_skin&&(n.slider_play_button_skin=t),""==n.slider_fullscreen_button_skin&&(n.slider_fullscreen_button_skin=t),n.video_enable_closebutton=n.slider_video_enable_closebutton,"zoom"!=i.gallery_mousewheel_role&&(n.slider_zoom_mousewheel=!1)}function lt(t,i){var u="ug-type-square",r;return"round"==n.slider_videoplay_button_type&&(u="ug-type-round"),r="",r+="<div class='ug-slide-wrapper ug-slide"+i+"'>",r+="<div class='ug-item-wrapper'><\/div>",r+="<div class='ug-slider-preloader "+t+"'><\/div>",r+="<div class='ug-button-videoplay "+u+"' style='display:none'><\/div>",r+="<\/div>"}function ai(t){var l,o,k,d;t&&(ot=t),l=wr(),o=(u.getOptions(),"<div class='ug-slider-wrapper'>"),(o+="<div class='ug-slider-inner'>",o+=lt(l,1),o+=lt(l,2),o+=lt(l,3),o+="<\/div>",1==n.slider_enable_arrows&&(o+="<div class='ug-slider-control ug-arrow-left ug-skin-"+n.slider_arrows_skin+"'><\/div>",o+="<div class='ug-slider-control ug-arrow-right ug-skin-"+n.slider_arrows_skin+"'><\/div>"),1==n.slider_enable_play_button&&(o+="<div class='ug-slider-control ug-button-play ug-skin-"+n.slider_play_button_skin+"'><\/div>"),1==n.slider_enable_fullscreen_button&&(o+="<div class='ug-slider-control ug-button-fullscreen ug-skin-"+n.slider_fullscreen_button_skin+"'><\/div>"),o+="<\/div>",ot.append(o),f=ot.children(".ug-slider-wrapper"),a=f.children(".ug-slider-inner"),v=a.children(".ug-slide1"),y=a.children(".ug-slide2"),p=a.children(".ug-slide3"),v.data("slidenum",1),y.data("slidenum",2),p.data("slidenum",3),c&&c.appendHTML(f),1==n.slider_enable_arrows&&(st=f.children(".ug-arrow-left"),ht=f.children(".ug-arrow-right")),1==n.slider_enable_play_button&&(w=f.children(".ug-button-play")),1==n.slider_enable_fullscreen_button&&(b=f.children(".ug-button-fullscreen")),1==n.slider_enable_progress_indicator)&&(nt=i.initProgressIndicator(n.slider_progress_indicator_type,n,f),k=nt.getType(),"bar"==k&&"pie"==n.slider_progress_indicator_type&&(n.slider_progress_indicator_type="bar",n=jQuery.extend(n,si)),u.setProgressIndicator(nt)),1==n.slider_enable_text_panel&&(s.appendHTML(f),0==n.slider_textpanel_always_on)&&(d=s.getElement(),d.hide().data("isHidden",!0),r.isTextPanelSaparateHover=!0),1==n.slider_enable_zoom_panel&&h.appendHTML(f),e.setHtml(a)}function at(n){var r=ft(n),t;i.placeElementInParentCenter(r),t=et(n),i.placeElementInParentCenter(t)}function vi(){var t,r;(c&&(objBullets=c.getElement(),i.placeElement(objBullets,n.slider_bullets_align_hor,n.slider_bullets_align_vert,n.slider_bullets_offset_hor,n.slider_bullets_offset_vert),i.placeElement(objBullets,n.slider_bullets_align_hor,n.slider_bullets_align_vert,n.slider_bullets_offset_hor,n.slider_bullets_offset_vert)),1==n.slider_enable_arrows&&(i.placeElement(st,n.slider_arrow_left_align_hor,n.slider_arrow_left_align_vert,n.slider_arrow_left_offset_hor,n.slider_arrow_left_offset_vert),i.placeElement(ht,n.slider_arrow_right_align_hor,n.slider_arrow_left_align_vert,n.slider_arrow_right_offset_hor,n.slider_arrow_right_offset_vert)),0==n.slider_controls_always_on&&wt(!0),nt)&&(t=nt.getElement(),"bar"==n.slider_progress_indicator_type?(r=f.width(),nt.setSize(r),i.placeElement(t,"left",n.slider_progress_indicator_align_vert,0,n.slider_progress_indicator_offset_vert)):i.placeElement(t,n.slider_progress_indicator_align_hor,n.slider_progress_indicator_align_vert,n.slider_progress_indicator_offset_hor,n.slider_progress_indicator_offset_vert)),s&&s.positionPanel(),yi(),at(v),at(y),at(p),nr()}function yi(){if(w&&i.placeElement(w,n.slider_play_button_align_hor,n.slider_play_button_align_vert,n.slider_play_button_offset_hor,n.slider_play_button_offset_vert),b&&i.placeElement(b,n.slider_fullscreen_button_align_hor,n.slider_fullscreen_button_align_vert,n.slider_fullscreen_button_offset_hor,n.slider_fullscreen_button_offset_vert),h){var t=h.getElement();i.placeElement(t,n.slider_zoompanel_align_hor,n.slider_zoompanel_align_vert,n.slider_zoompanel_offset_hor,n.slider_zoompanel_offset_vert)}}function tt(){var f,r,e,o,n=t.getSlidesReference(),s=0,h=0,u=0;e=t.isSlideHasItem(n.objNextSlide),o=t.isSlideHasItem(n.objPrevSlide),o?(u=n.objPrevSlide.outerWidth(),n.objPrevSlide.css("z-index",1)):n.objPrevSlide.hide(),r=u+n.objCurrentSlide.outerWidth(),f=r,e?(f=r+n.objNextSlide.outerWidth(),n.objPrevSlide.css("z-index",2)):n.objNextSlide.hide(),n.objCurrentSlide.css("z-index",3),i.placeElement(n.objCurrentSlide,u,s),a.css({left:-u+"px",width:f+"px"}),o&&(i.placeElement(n.objPrevSlide,h,s),i.showElement(n.objPrevSlide)),e&&(i.showElement(n.objNextSlide),i.placeElement(n.objNextSlide,r,s))}function g(n){var t=n.data("index"),i;return void 0===t||null==t?!1:(i=u.getItem(t),i?void k(n,i):!1)}function pi(n){n.stop(!0).show(100)}function dt(n){n.stop(!0).hide(100)}function wi(t,r){var u=n.slider_image_border_width;if(10>=u)return u;var o=i.getElementSize(t),f=o.width,e=o.height;if(r&&(r.hasOwnProperty("imageWidth")&&(f=r.imageWidth),r.hasOwnProperty("imageHeight")&&(e=r.imageHeight)),0>=f)return u;var s=e>f?f:e,h=2*u,c=h/s;return c<n.slider_image_border_maxratio?u:(u=s*n.slider_image_border_maxratio/2,u=Math.round(u))}function rt(t,i,r){var u={},f;1==n.slider_image_border&&(u["border-style"]="solid",f=wi(t,r),u["border-width"]=f+"px",u["border-color"]=n.slider_image_border_color,u["border-radius"]=n.slider_image_border_radius),"image"!=i&&1==n.slider_video_constantsize&&(u["background-color"]="#000000"),1==n.slider_image_shadow&&(u["box-shadow"]="3px 3px 10px 0px #353535"),t.css(u)}function vt(t,r){var u=n.slider_video_constantsize_width,f=n.slider_video_constantsize_height,e=n.slider_video_constantsize_scalemode;return i.scaleImageExactSizeInParent(t,r.imageWidth,r.imageHeight,u,f,e)}function ut(r,f,e){var v=r.children(".ug-item-wrapper"),y=ft(r),l,p,a,c,s,h;if("undefined"==typeof f.urlImage||""==f.urlImage)throw new Error("The slide don't have big image defined ( data-image='imageurl' ). Please check gallery items.","showbig");l=f.urlImage,p=r.data("urlImage"),r.data("urlImage",l),a=t.getScaleMode(r),c=t.getSlideType(r),(objPadding=t.getObjImagePadding(),p==l&&e!==!0)?(s=v.children("img"),(0==f.imageWidth||0==f.imageHeight)&&u.checkFillImageSize(s,f),h={},h="image"!=c&&1==n.slider_video_constantsize?vt(s,f):i.scaleImageFitParent(s,f.imageWidth,f.imageHeight,a,objPadding),rt(s,c,h),o.trigger(t.events.AFTER_PUT_IMAGE,r)):(s=i.placeImageInsideParent(l,v,f.imageWidth,f.imageHeight,a,objPadding),1==f.isBigImageLoaded)?(h=(s.fadeTo(0,1),dt(y),"image"!=c&&1==n.slider_video_constantsize)?vt(s,f):i.getImageInsideParentData(v,f.imageWidth,f.imageHeight,a,objPadding),rt(s,c,h),o.trigger(t.events.AFTER_PUT_IMAGE,r)):(s.fadeTo(0,0),pi(y),r.data("isLoading",!0),t.isSlideCurrent(r)&&o.trigger(t.events.CURRENTSLIDE_LOAD_START),s.data("itemIndex",f.index),s.on("load",function(){var r=jQuery(this),c=r.data("itemIndex"),e,s;r.fadeTo(0,1);var f=r.parent().parent(),h=t.getSlideType(f),l=ft(f),a=t.getObjImagePadding(),v=t.getScaleMode(f);dt(l),f.data("isLoading",!1),t.isSlideCurrent(f)&&o.trigger(t.events.CURRENTSLIDE_LOAD_END),u.onItemBigImageLoaded(null,r),e=u.getItem(c),s={},"image"!=h&&1==n.slider_video_constantsize?vt(r,e):s=i.scaleImageFitParent(r,e.imageWidth,e.imageHeight,v,a),r.fadeTo(0,1),rt(r,h,s),o.trigger(t.events.AFTER_PUT_IMAGE,f)}))}function k(t,i){var r,f;try{if(r=t.children(".ug-item-wrapper"),null==i)return r.html(""),t.removeData("index"),t.removeData("type"),t.removeData("urlImage"),!1;t.data("index"),t.data("index",i.index),t.data("type",i.type),1==n.slider_enable_links&&"image"==i.type&&(i.link?t.addClass("ug-slide-clickable"):t.removeClass("ug-slide-clickable")),ut(t,i),f=et(t);switch(i.type){case"image":f.hide();break;default:f.show()}}catch(e){throw"undefined"!=typeof e.fileName&&"showbig"==e.fileName&&u.showErrorMessageReplaceGallery(e.message),r.html(""),new Error(e);}}function gt(){if(!s||1==ni())return!1;var t=s.getElement(),i=0;(1==r.isTextPanelSaparateHover||1==n.slider_textpanel_always_on)&&(i=n.slider_controls_appear_duration),t.stop().fadeTo(i,0),t.data("isHidden",!0)}function yt(){if(!s||0==ni())return!1;var t=s.getElement(),i=0;(1==r.isTextPanelSaparateHover||1==n.slider_textpanel_always_on)&&(t.show(),s.positionElements(),i=n.slider_controls_appear_duration),t.stop().show().fadeTo(i,1),t.data("isHidden",!1)}function ni(){var n=s.getElement(),t=n.data("isHidden");return t===!1?!1:!0}function bi(n,i){var i,r;if(void 0==i&&(i=t.getCurrentSlide()),r=t.getSlideType(i),r!=n)throw new Error("Wrong slide type: "+r+", should be: "+n);return!0}function ti(){var o=t.getCurrentSlide(),h=t.getSlideImage(o),s=i.getElementSize(o),r=s.left,u=s.top,f;1==n.slider_video_constantsize?(f=i.getElementSize(h),r+=f.left,u+=f.top):(r+=n.slider_video_padding_left,u+=n.slider_video_padding_top),e.setPosition(r,u)}function ii(){var i=n.slider_video_constantsize_width,r=n.slider_video_constantsize_height,t;e.setSize(i,r),t=e.getObject(),rt(t,"video")}function ki(i,r,u){o.trigger(t.events.TRANSITION_START);var f=n.slider_transition;switch(u&&(f=u),t.stopSlideAction(null,!0),f){default:case"fade":ui(r);break;case"slide":ri(i,r);break;case"lightbox_open":ui(r,!1,!0)}}function ri(u,f){var v=t.isAnimating(),s,c,l,h;if(1==v)return r.itemWaiting=f,!0;null!=r.itemWaiting&&(r.itemWaiting=null),s=t.getSlidesReference();switch(u){case"right":k(s.objPrevSlide,f),tt(),c=i.getElementSize(s.objPrevSlide),h=-c.left,t.switchSlideNums("right");break;case"left":k(s.objNextSlide,f),tt(),l=i.getElementSize(s.objNextSlide),h=-l.left,t.switchSlideNums("left");break;default:throw new Error("wrong direction: "+u);}var y=n.slider_transition_speed,p=n.slider_transition_easing,w={duration:y,easing:p,queue:!1,always:function(){if(t.stopSlideAction(),e.hide(),null!=r.itemWaiting){var n=br(r.itemWaiting);ri(n,r.itemWaiting)}else t.placeNabourItems(),o.trigger(t.events.TRANSITION_END)}};a.animate({left:h+"px"},w)}function pt(t,i,r){r?t.fadeTo(n.slider_transition_speed,i,r):t.fadeTo(n.slider_transition_speed,i)}function ui(n,u,f){var u,s,h,c,l;u||(u=!1),s=t.getSlidesReference(),k(s.objNextSlide,n),h=i.getElementSize(s.objCurrentSlide),i.placeElement(s.objNextSlide,h.left,h.top),c=r.numCurrent,(r.numCurrent=r.numNext,r.numNext=c,o.trigger(t.events.ITEM_CHANGED),s.objNextSlide.stop(!0),s.objCurrentSlide.stop(!0),1==u)?(s.objCurrentSlide.fadeTo(0,0),s.objNextSlide.fadeTo(0,1),t.placeNabourItems(),o.trigger(t.events.TRANSITION_END),f!==!0&&e.hide()):((s.objNextSlide.fadeTo(0,0),pt(s.objCurrentSlide,0,function(){t.placeNabourItems(),o.trigger(t.events.TRANSITION_END),f!==!0&&e.hide()}),1==e.isVisible())&&(l=e.getObject(),pt(l,0)),pt(s.objNextSlide,1))}function di(){1==n.slider_fullscreen_button_mobilehide&&b&&b.hide(),1==n.slider_play_button_mobilehide&&w&&w.hide(),1==n.slider_zoompanel_mobilehide&&h&&h.getElement().hide()}function gi(){1==n.slider_fullscreen_button_mobilehide&&b&&b.show(),1==n.slider_play_button_mobilehide&&w&&w.show(),1==n.slider_zoompanel_mobilehide&&h&&h.getElement().show()}function nr(){var n=u.isMobileMode();n?di():gi()}function fi(){return f.children(".ug-slider-control")}function wt(t){var t,u;if(0==i.isTimePassed("sliderControlsToggle")||0==r.isControlsVisible)return!1;t||(t=!1),u=fi(),t===!0?u.stop().fadeTo(0,0).hide():u.stop().fadeTo(n.slider_controls_appear_duration,0,function(){u.hide()}),r.isControlsVisible=!1}function ei(t){var t,u;if(0==i.isTimePassed("sliderControlsToggle"))return!1;if(1==r.isControlsVisible)return!0;t||(t=!1),u=fi(),t===!0?u.stop().show():(u.stop().show().fadeTo(0,0),u.fadeTo(n.slider_controls_appear_duration,1)),r.isControlsVisible=!0}function tr(){0==r.isControlsVisible?ei():wt()}function ir(n){if(n==r.currentControlsMode)return!1;switch(n){case"image":h&&h.getElement().show();break;case"video":h&&h.getElement().hide();break;default:throw new Error("wrong controld mode: "+n);}r.currentControlsMode=n}function rr(n,i,f){var e=u.getSelectedItem(),o;t.setItem(e,!1,f),o=e.index,c&&c.setActive(o),s&&0==r.isTextPanelSaparateHover&&yt(),ir("image"==e.type?"image":"video")}function ur(n,t){u.selectItem(t)}function fr(n){return d&&0==d.isTapEventOccured(n)?!0:void o.trigger(t.events.CLICK,n)}function er(){var r=t.getCurrentSlide(),u=r.hasClass("ug-slide-clickable"),i=t.getCurrentItem();return u?(0==n.slider_links_newpage?location.href=i.link:window.open(i.link,"_blank"),!0):void(0==n.slider_controls_always_on&&1==n.slider_controls_appear_ontap&&1==t.isCurrentSlideType("image")&&(tr(),s&&1==n.slider_textpanel_always_on&&t.isCurrentSlideType("image")&&t.isCurrentSlideImageFit()&&yt()))}function or(){s&&t.isCurrentSlideType("image")&&0==t.isCurrentSlideImageFit()&&gt()}function sr(){ei()}function hr(){wt()}function cr(n){var i=n.parent();t.startSlideAction(i)}function lr(){u.isPlayMode()&&u.pausePlaying(),o.trigger(t.events.ACTION_START)}function ar(){u.isPlayMode()&&u.continuePlaying(),o.trigger(t.events.ACTION_END)}function vr(n,t){v.data("index")==t&&(objItem=u.getItem(t),ut(v,objItem,!0)),y.data("index")==t&&(objItem=u.getItem(t),ut(y,objItem,!0)),p.data("index")==t&&(objItem=u.getItem(t),ut(p,objItem,!0))}function yr(n,r){r=jQuery(r);var u=t.getSlideImage(r),e=et(r),f=i.getElementSize(u);i.placeElement(e,"center","middle",f.left,f.top,u)}function bt(n){var t=et(n);i.addClassOnHover(t),i.setButtonOnClick(t,cr)}function pr(){it.on(u.events.ITEM_IMAGE_UPDATED,vr),it.on(u.events.ITEM_CHANGE,rr),c&&jQuery(c).on(c.events.BULLET_CLICK,ur),1==n.slider_enable_arrows&&(i.addClassOnHover(ht,"ug-arrow-hover"),i.addClassOnHover(st,"ug-arrow-hover"),u.setNextButton(ht),u.setPrevButton(st)),0==n.slider_controls_always_on&&f.hover(sr,hr),f.on("touchend click",fr),o.on(t.events.CLICK,er),s&&1==r.isTextPanelSaparateHover&&f.hover(yt,gt),w&&(i.addClassOnHover(w,"ug-button-hover"),u.setPlayButton(w)),b&&(i.addClassOnHover(b,"ug-button-hover"),u.setFullScreenToggleButton(b)),l&&o.on(t.events.ZOOM_CHANGE,or),h&&h.initEvents(),e.initEvents(),jQuery(e).on(e.events.SHOW,lr),jQuery(e).on(e.events.HIDE,ar),bt(v),bt(y),bt(p),o.on(t.events.AFTER_PUT_IMAGE,yr),f.delegate(".ug-item-wrapper img","mouseenter",function(){o.trigger(t.events.IMAGE_MOUSEENTER)}),f.delegate(".ug-item-wrapper img","mouseleave",function(n){var i=t.isMouseInsideSlideImage(n);0==i&&o.trigger(t.events.IMAGE_MOUSELEAVE)})}function wr(){var t;switch(n.slider_loader_type){default:case 1:t="ug-loader1";break;case 2:t="ug-loader2";break;case 3:t="ug-loader3";break;case 4:t="ug-loader4";break;case 5:t="ug-loader5";break;case 6:t="ug-loader6";break;case 7:t="ug-loader7";break;case 8:t="ug-loader8";break;case 9:t="ug-loader9"}return"black"==n.slider_loader_color&&(t+=" ug-loader-black"),t}function kt(n){switch(n){case 1:return v;case 2:return y;case 3:return p;default:throw new Error("wrong num: "+n);}}function br(n){var r=t.getSlidesReference(),u=r.objCurrentSlide.data("index"),f=n.index,i="left";return u>f&&(i="right"),i}function ft(n){var n,i;return n||(n=t.getCurrentSlide()),i=n.children(".ug-slider-preloader")}function et(n){return n.children(".ug-button-videoplay")}function oi(n){var n,i,r;return(n||(n=t.getCurrentSlide()),i=n.data("index"),void 0==i)?null:r=u.getItem(i)}var it,ot,kr,f,a,v,y,p,st,ht,d,l,h,ct,t=this,o=jQuery(t),u=new UniteGalleryMain,w=null,b=null,c=null,e=new UGVideoPlayer,i=new UGFunctions,nt=null,s=null;this.events={ITEM_CHANGED:"item_changed",BEFORE_SWITCH_SLIDES:"before_switch",BEFORE_RETURN:"before_return",AFTER_RETURN:"after_return",ZOOM_START:"slider_zoom_start",ZOOM_END:"slider_zoom_end",ZOOMING:"slider_zooming",ZOOM_CHANGE:"slider_zoom_change",START_DRAG:"start_drag",AFTER_DRAG_CHANGE:"after_drag_change",ACTION_START:"action_start",ACTION_END:"action_end",CLICK:"slider_click",TRANSITION_START:"slider_transition_start",TRANSITION_END:"slider_transition_end",AFTER_PUT_IMAGE:"after_put_image",IMAGE_MOUSEENTER:"slider_image_mouseenter",IMAGE_MOUSELEAVE:"slider_image_mouseleave",CURRENTSLIDE_LOAD_START:"slider_current_loadstart",CURRENTSLIDE_LOAD_END:"slider_current_loadend"};var n={slider_scale_mode:"fill",slider_scale_mode_media:"fill",slider_scale_mode_fullscreen:"down",slider_item_padding_top:0,slider_item_padding_bottom:0,slider_item_padding_left:0,slider_item_padding_right:0,slider_background_color:"",slider_background_opacity:1,slider_image_padding_top:0,slider_image_padding_bottom:0,slider_image_padding_left:0,slider_image_padding_right:0,slider_image_border:!1,slider_image_border_width:10,slider_image_border_color:"#ffffff",slider_image_border_radius:0,slider_image_border_maxratio:.35,slider_image_shadow:!1,slider_video_constantsize:!1,slider_video_constantsize_scalemode:"fit",slider_video_constantsize_width:854,slider_video_constantsize_height:480,slider_video_padding_top:0,slider_video_padding_bottom:0,slider_video_padding_left:0,slider_video_padding_right:0,slider_video_enable_closebutton:!0,slider_transition:"slide",slider_transition_speed:300,slider_transition_easing:"easeInOutQuad",slider_control_swipe:!0,slider_control_zoom:!0,slider_zoom_mousewheel:!0,slider_vertical_scroll_ondrag:!1,slider_loader_type:1,slider_loader_color:"white",slider_enable_links:!0,slider_links_newpage:!1,slider_enable_bullets:!1,slider_bullets_skin:"",slider_bullets_space_between:-1,slider_bullets_align_hor:"center",slider_bullets_align_vert:"bottom",slider_bullets_offset_hor:0,slider_bullets_offset_vert:10,slider_enable_arrows:!0,slider_arrows_skin:"",slider_arrow_left_align_hor:"left",slider_arrow_left_align_vert:"middle",slider_arrow_left_offset_hor:20,slider_arrow_left_offset_vert:0,slider_arrow_right_align_hor:"right",slider_arrow_right_align_vert:"middle",slider_arrow_right_offset_hor:20,slider_arrow_right_offset_vert:0,slider_enable_progress_indicator:!0,slider_progress_indicator_type:"pie",slider_progress_indicator_align_hor:"right",slider_progress_indicator_align_vert:"top",slider_progress_indicator_offset_hor:10,slider_progress_indicator_offset_vert:10,slider_enable_play_button:!0,slider_play_button_skin:"",slider_play_button_align_hor:"left",slider_play_button_align_vert:"top",slider_play_button_offset_hor:40,slider_play_button_offset_vert:8,slider_play_button_mobilehide:!1,slider_enable_fullscreen_button:!0,slider_fullscreen_button_skin:"",slider_fullscreen_button_align_hor:"left",slider_fullscreen_button_align_vert:"top",slider_fullscreen_button_offset_hor:11,slider_fullscreen_button_offset_vert:9,slider_fullscreen_button_mobilehide:!1,slider_enable_zoom_panel:!0,slider_zoompanel_skin:"",slider_zoompanel_align_hor:"left",slider_zoompanel_align_vert:"top",slider_zoompanel_offset_hor:12,slider_zoompanel_offset_vert:92,slider_zoompanel_mobilehide:!1,slider_controls_always_on:!1,slider_controls_appear_ontap:!0,slider_controls_appear_duration:300,slider_enable_text_panel:!0,slider_textpanel_always_on:!0,slider_videoplay_button_type:"square"},si={slider_progress_indicator_align_hor:"left",slider_progress_indicator_align_vert:"bottom",slider_progress_indicator_offset_hor:0,slider_progress_indicator_offset_vert:0},r={isRunOnce:!1,isTextPanelSaparateHover:!1,numPrev:1,numCurrent:2,numNext:3,isControlsVisible:!0,currentControlsMode:"image"};this.switchSlideNums=function(n){var i;switch(o.trigger(t.events.BEFORE_SWITCH_SLIDES),n){case"left":i=r.numCurrent,r.numCurrent=r.numNext,r.numNext=r.numPrev,r.numPrev=i;break;case"right":i=r.numCurrent,r.numCurrent=r.numPrev,r.numPrev=r.numNext,r.numNext=i;break;default:throw new Error("wrong direction: "+n);}o.trigger(t.events.ITEM_CHANGED)},this.destroy=function(){o.off(t.events.AFTER_PUT_IMAGE),it.off(u.events.ITEM_IMAGE_UPDATED),it.off(u.events.ITEM_CHANGE),c&&jQuery(c).on(c.events.BULLET_CLICK),f.off("mouseenter"),f.off("mouseleave"),f.off("touchend"),f.off("click"),o.off(t.events.CLICK),l&&o.off(t.events.ZOOM_CHANGE),o.off(t.events.BEFORE_SWITCH_SLIDES),jQuery(e).off(e.events.SHOW),jQuery(e).off(e.events.HIDE),e.destroy(),f.undelegate(".ug-item-wrapper img","mouseenter"),f.undelegate(".ug-item-wrapper img","mouseleave")},this.________EXTERNAL_GENERAL___________=function(){},this.init=function(n,t,i){hi(n,t,i)},this.getSlideImage=function(n){var n,i;return n||(n=t.getCurrentSlide()),i=n.find(".ug-item-wrapper img")},this.setHtml=function(n){ai(n)},this.run=function(){ci()},this.isInnerInPlace=function(){var n=t.getSlidesReference(),r=i.getElementSize(n.objCurrentSlide),u=-r.left,f=i.getElementSize(a);return u==f.left?!0:!1},this.isAnimating=function(){return a.is(":animated")},this.isSlideCurrent=function(n){var t=n.data("slidenum");return r.numCurrent==t?!0:!1},this.isSlideHasItem=function(n){var t=n.data("index");return void 0===t||null===t?!1:!0},this.getObjImagePadding=function(){return{padding_top:n.slider_image_padding_top,padding_bottom:n.slider_image_padding_bottom,padding_left:n.slider_image_padding_left,padding_right:n.slider_image_padding_right}},this.getSlidesReference=function(){return{objPrevSlide:kt(r.numPrev),objNextSlide:kt(r.numNext),objCurrentSlide:kt(r.numCurrent)}},this.getCurrentSlide=function(){var n=t.getSlidesReference();return n.objCurrentSlide},this.getCurrentItemIndex=function(){var i=t.getSlidesReference(),n=i.objCurrentSlide.data("index");return(null===n||void 0===n)&&(n=-1),n},this.getCurrentItem=function(){var n=t.getCurrentItemIndex(),i;return-1==n?null:i=u.getItem(n)},this.getSlideType=function(n){void 0==n&&(n=t.getCurrentSlide());return n.data("type")},this.isMouseInsideSlideImage=function(n){var u=t.getSlideImage(),r=i.getMousePosition(n),f,e;return void 0===r.pageX&&(r=d.getLastMousePos()),f=i.getMouseElementPoint(r,u),e=i.getElementSize(u),isMouseInside=i.isPointInsideElement(f,e),isMouseInside},this.isCurrentSlideType=function(n){var i=t.getSlideType();return i==n?!0:!1},this.isCurrentSlideLoadingImage=function(){var n=t.getCurrentSlide(),i=n.data("isLoading");return i===!0?!0:!1},this.setItem=function(n,i,r){var s=t.getSlidesReference(),e=s.objCurrentSlide.data("index"),o=n.index,h,f;if(o==e)return!0;h=void 0==e,h?(k(s.objCurrentSlide,n),t.placeNabourItems()):(f="left",u.getNumItems(),"next"==r?f="left":"prev"==r||e>o?f="right":e>o&&(f="right"),ki(f,n,i))},this.placeNabourItems=function(){var n=t.getSlidesReference(),i=n.objCurrentSlide.data("index"),r=u.getPrevItem(i),f=u.getNextItem(i);k(n.objNextSlide,f),k(n.objPrevSlide,r),tt()},this.________EXTERNAL_API___________=function(){},this.stopSlideAction=function(n,i){n||(n=t.getCurrentSlide()),i===!0?e.pause():e.hide()},this.startSlideAction=function(i){i||(i=t.getCurrentSlide());var r=oi(i);if("image"==r.type)return!0;switch(1==n.slider_video_constantsize&&ii(),ti(),e.show(),r.type){case"youtube":e.playYoutube(r.videoid);break;case"vimeo":e.playVimeo(r.videoid);break;case"html5video":e.playHtml5Video(r.videoogv,r.videowebm,r.videomp4,r.urlImage);break;case"soundcloud":e.playSoundCloud(r.trackid);break;case"wistia":e.playWistia(r.videoid)}},this.getScaleMode=function(i){var i,r;return i||(i=t.getCurrentSlide()),r=t.getSlideType(i),"image"!=r?n.slider_scale_mode_media:n.slider_scale_mode==n.slider_scale_mode_fullscreen?n.slider_scale_mode:1==u.isFullScreen()?n.slider_scale_mode_fullscreen:n.slider_scale_mode},this.getObjects=function(){return{g_objSlider:f,g_objInner:a,g_options:n,g_objZoomSlider:l}},this.getObjZoom=function(){return l},this.getOptions=function(){return n},this.getElement=function(){return f},this.getVideoObject=function(){return e},this.isCurrentSlideImageFit=function(){var n=t.getCurrentSlide(),r,u;return(t.getSlideType(n),bi("image",n),r=t.getSlideImage(n),0==r.length)?!1:u=i.isImageFitParent(r)},this.isCurrentImageInPlace=function(){var n=t.getSlideImage();if(0==n.length)return!1;var u=t.getScaleMode(),f=t.getObjImagePadding(),r=oi(),e=n.parent(),o=i.getImageInsideParentData(e,r.imageWidth,r.imageHeight,u,f),s=i.getElementSize(n);return o.imageWidth==s.width?!0:!1},this.isSlideActionActive=function(){return e.isVisible()},this.isSwiping=function(){if(!d)return!1;return d.isTouchActive()},this.isPreloading=function(){var n=ft();return n.is(":visible")?!0:!1},this.setOptions=function(t){ct&&(t=i.convertCustomPrefixOptions(t,ct,"slider")),n=jQuery.extend(n,t)},this.setSize=function(i,r){var c,o,u,l,w,b;if(0>i||0>r)return!0;c={},c.width=i+"px",c.height=r+"px",f.css(c),o={},o.height=r+"px",o.top="0px",o.left="0px",a.css(o),u={},u.height=r+"px",u.width=i+"px",v.css(u),y.css(u),p.css(u);var k=i-n.slider_item_padding_left-n.slider_item_padding_right,d=r-n.slider_item_padding_top-n.slider_item_padding_bottom,h={};h.width=k+"px",h.height=d+"px",h.top=n.slider_item_padding_top+"px",h.left=n.slider_item_padding_left+"px",f.find(".ug-item-wrapper").css(h),s&&s.setSizeByParent(),vi(),g(v),g(y),g(p),tt(),l=t.getSlideType(),"image"!=l&&1==n.slider_video_constantsize?ii():(w=i-n.slider_video_padding_left-n.slider_video_padding_right,b=r-n.slider_video_padding_top-n.slider_video_padding_bottom,e.setSize(w,b)),ti()},this.refreshSlideItems=function(){return 1==t.isAnimating()?!0:(g(v),g(y),g(p),void tt())},this.isMouseOver=function(){return f.ismouseover()},this.setPosition=function(n,t){i.placeElement(f,n,t)},this.zoomIn=function(){return l?void l.zoomIn():!0},this.zoomOut=function(){return l?void l.zoomOut():!0},this.zoomBack=function(){return l?void l.zoomBack():!0}}function UGTextPanel(){function c(i,u){var u,c,l,f,o,s,a,v;u||(u=n.textpanel_padding_top),f=u,r&&(c=f,e.placeElement(r,0,c),l=e.getElementSize(r),f=l.bottom),o="",(t&&(o=jQuery.trim(t.text())),""!=o)&&(s=f,r&&(s+=n.textpanel_padding_title_description),e.placeElement(t,0,s),a=e.getElementSize(t),f=a.bottom),n.textpanel_height||1!=h.setInternalHeight||(v=f+n.textpanel_padding_bottom,b(v,i))}function a(){var i=0,u;return(r&&(i+=r.outerHeight()),t)&&(u="",t&&(u=jQuery.trim(t.text())),""!=u&&(r&&(i+=n.textpanel_padding_title_description),i+=t.outerHeight())),i}function p(){var n=a(),t=(o.height()-n)/2;c(!1,t)}function w(){var t=a(),i=o.height()-t-n.textpanel_padding_bottom;c(!1,i)}function b(t,r){var r,u,e;r||(r=!1),1==r?(f&&(u=f.height(),t>u&&f.height(t)),e={height:t+"px"},i.add(o).animate(e,n.textpanel_fade_duration)):(f&&f.height(t),i.add(o).height(t))}function v(){var s,u,e;1==n.textpanel_enable_bg&&(f=i.children(".ug-textpanel-bg"),f.fadeTo(0,n.textpanel_bg_opacity),s={"background-color":n.textpanel_bg_color},s=jQuery.extend(s,n.textpanel_bg_css),f.css(s)),1==n.textpanel_enable_title&&(r=o.children(".ug-textpanel-title"),u={},null!==n.textpanel_title_color&&(u.color=n.textpanel_title_color),null!==n.textpanel_title_font_family&&(u["font-family"]=n.textpanel_title_font_family),null!==n.textpanel_title_text_align&&(u["text-align"]=n.textpanel_title_text_align),null!==n.textpanel_title_font_size&&(u["font-size"]=n.textpanel_title_font_size+"px"),null!==n.textpanel_title_bold&&(u["font-weight"]=n.textpanel_title_bold===!0?"bold":"normal"),n.textpanel_css_title&&(u=jQuery.extend(u,n.textpanel_css_title)),r.css(u)),1==n.textpanel_enable_description&&(t=o.children(".ug-textpanel-description"),e={},null!==n.textpanel_desc_color&&(e.color=n.textpanel_desc_color),null!==n.textpanel_desc_font_family&&(e["font-family"]=n.textpanel_desc_font_family),null!==n.textpanel_desc_text_align&&(e["text-align"]=n.textpanel_desc_text_align),null!==n.textpanel_desc_font_size&&(e["font-size"]=n.textpanel_desc_font_size+"px"),null!==n.textpanel_desc_bold&&(e["font-weight"]=n.textpanel_desc_bold===!0?"bold":"normal"),n.textpanel_css_title&&(e=jQuery.extend(e,n.textpanel_css_description)),t.css(e))}function k(){var n=s.getSelectedItem();u.setText(n.title,n.description)}function d(){jQuery(s).on(s.events.ITEM_CHANGE,k)}var i,y,r,t,f,o,s,u=this,e=new UGFunctions,l="",n={textpanel_align:"bottom",textpanel_margin:0,textpanel_text_valign:"middle",textpanel_padding_top:10,textpanel_padding_bottom:10,textpanel_height:null,textpanel_padding_title_description:5,textpanel_padding_right:11,textpanel_padding_left:11,textpanel_fade_duration:200,textpanel_enable_title:!0,textpanel_enable_description:!0,textpanel_enable_bg:!0,textpanel_bg_color:"#000000",textpanel_bg_opacity:.4,textpanel_title_color:null,textpanel_title_font_family:null,textpanel_title_text_align:null,textpanel_title_font_size:null,textpanel_title_bold:null,textpanel_css_title:{},textpanel_desc_color:null,textpanel_desc_font_family:null,textpanel_desc_text_align:null,textpanel_desc_font_size:null,textpanel_desc_bold:null,textpanel_css_description:{},textpanel_desc_style_as_title:!1,textpanel_bg_css:{}},h={isFirstTime:!0,setInternalHeight:!0};this.positionElements=function(t){if(!n.textpanel_height||"top"==n.textpanel_text_valign)return c(t),!1;switch(n.textpanel_text_valign){default:case"top":c(!1);break;case"bottom":w();break;case"center":case"middle":p()}},this.init=function(t,i,r){if(s=t,r&&(l=r,i=e.convertCustomPrefixOptions(i,l,"textpanel")),i&&(n=jQuery.extend(n,i)),0==n.textpanel_enable_title&&0==n.textpanel_enable_description)throw new Error("Textpanel Error: The title or description must be enabled");n.textpanel_height&&n.textpanel_height<0&&(n.textpanel_height=null),1==n.textpanel_desc_style_as_title&&(n.textpanel_desc_color||(n.textpanel_desc_color=n.textpanel_title_color),n.textpanel_desc_bold||(n.textpanel_desc_bold=n.textpanel_title_bold),n.textpanel_desc_font_family||(n.textpanel_desc_font_family=n.textpanel_title_font_family),n.textpanel_desc_font_size||(n.textpanel_desc_font_size=n.textpanel_title_font_size),n.textpanel_desc_text_align||(n.textpanel_desc_text_align=n.textpanel_title_text_align))},this.appendHTML=function(t,r){y=t,r=r?" "+r:"";var u="<div class='ug-textpanel"+r+"'>";1==n.textpanel_enable_bg&&(u+="<div class='ug-textpanel-bg"+r+"'><\/div>"),u+="<div class='ug-textpanel-textwrapper"+r+"'>",1==n.textpanel_enable_title&&(u+="<div class='ug-textpanel-title"+r+"'><\/div>"),1==n.textpanel_enable_description&&(u+="<div class='ug-textpanel-description"+r+"'><\/div>"),u+="<\/div><\/div>",t.append(u),i=t.children(".ug-textpanel"),o=i.children(".ug-textpanel-textwrapper"),v()},this.destroy=function(){jQuery(s).off(s.events.ITEM_CHANGE)},this.run=function(){u.setSizeByParent(),d()},this.setPanelSize=function(s,c){var c,l,a;(h.setInternalHeight=!0,c)?h.setInternalHeight=!1:c=80,n.textpanel_height&&(c=n.textpanel_height),i.width(s),i.height(c),f&&(f.width(s),f.height(c)),l=s-n.textpanel_padding_left-n.textpanel_padding_right,a=n.textpanel_padding_left,e.setElementSizeAndPosition(o,a,0,l,c),r&&r.width(l),t&&t.width(l),0==h.isFirstTime&&u.positionElements(!1)},this.setSizeByParent=function(){var n=e.getElementSize(y);u.setPanelSize(n.width)},this.setTextPlain=function(n,i){r&&r.html(n),t&&t.html(i)},this.setText=function(t,i){1==h.isFirstTime?(u.setTextPlain(t,i),h.isFirstTime=!1,u.positionElements(!1)):o.stop().fadeTo(n.textpanel_fade_duration,0,function(){u.setTextPlain(t,i),u.positionElements(!0),jQuery(this).fadeTo(n.textpanel_fade_duration,1)})},this.positionPanel=function(t,r){var u={};if(void 0!==t&&null!==t)u.top=t,u.bottom="auto";else switch(n.textpanel_align){case"top":u.top=n.textpanel_margin+"px";break;case"bottom":u.top="auto",u.bottom=n.textpanel_margin+"px";break;case"middle":u.top=e.getElementRelativePos(i,"middle",n.textpanel_margin)}void 0!==r&&null!==r&&(u.left=r),i.css(u)},this.setOptions=function(t){l&&(t=e.convertCustomPrefixOptions(t,l,"textpanel")),n=jQuery.extend(n,t)},this.getElement=function(){return i},this.getSize=function(){return e.getElementSize(i)},this.refresh=function(n,t,i,r){v(),i?u.setPanelSize(i,r):u.setSizeByParent(),u.positionElements(!1),t!==!0&&u.positionPanel(),n===!0&&u.show()},this.hide=function(){i.hide()},this.show=function(){i.show()},this.getOptions=function(){return n},this.getOption=function(t){return 0==n.hasOwnProperty(t)?null:n[t]}}function UGZoomButtonsPanel(){function u(n){return n?n.hasClass("ug-zoompanel-button-disabled")?!0:!1:!0}function s(n){n&&n.addClass("ug-zoompanel-button-disabled")}function h(n){n&&n.removeClass("ug-zoompanel-button-disabled")}function c(){if(0==t.isCurrentSlideType("image"))return!0;var r=t.isCurrentSlideImageFit();1==r?0==u(n)&&(s(n),s(i)):1==u(n)&&(h(n),h(i))}var f,l,e,n,i,a=this,t=new UGSlider,r=new UGFunctions,o={slider_zoompanel_skin:""};this.init=function(n,i){t=n,i&&(o=jQuery.extend(o,i))},this.appendHTML=function(t){l=t;var r="<div class='ug-slider-control ug-zoompanel ug-skin-"+o.slider_zoompanel_skin+"'>";r+="<div class='ug-zoompanel-button ug-zoompanel-plus'><\/div>",r+="<div class='ug-zoompanel-button ug-zoompanel-minus ug-zoompanel-button-disabled'><\/div>",r+="<div class='ug-zoompanel-button ug-zoompanel-return ug-zoompanel-button-disabled'><\/div>",r+="<\/div>",t.append(r),f=t.children(".ug-zoompanel"),e=f.children(".ug-zoompanel-plus"),n=f.children(".ug-zoompanel-minus"),i=f.children(".ug-zoompanel-return")},this.setObjects=function(t,r,u){e=t,n=r,i=u,n&&n.addClass("ug-zoompanel-button-disabled"),i&&i.addClass("ug-zoompanel-button-disabled")},this.getElement=function(){return f},a.initEvents=function(){r.addClassOnHover(e,"ug-button-hover"),r.addClassOnHover(n,"ug-button-hover"),r.addClassOnHover(i,"ug-button-hover"),r.setButtonOnClick(e,function(){return 1==u(e)?!0:void t.zoomIn()}),r.setButtonOnClick(n,function(){return 1==u(n)?!0:void t.zoomOut()}),r.setButtonOnClick(i,function(){return 1==u(i)?!0:void t.zoomBack()}),jQuery(t).on(t.events.ZOOM_CHANGE,c),jQuery(t).on(t.events.ITEM_CHANGED,c)}}function UGBullets(){function f(){var e="",o="",u,f;for(-1!=n.bullets_space_between&&(o=" style='margin-left:"+n.bullets_space_between+"px'"),u=0;i>u;u++)e+=0==u?"<div class='ug-bullet'><\/div>":"<div class='ug-bullet'"+o+"><\/div>";(t.html(e),r)||(f=t.find(".ug-bullet:first-child"),f.length&&(r=f.width()))}function l(n){if(1==u.isActive(n))return!0;var t=n.index();jQuery(u).trigger(u.events.BULLET_CLICK,t)}function e(){var n=t.children(".ug-bullet");y.setButtonOnClick(n,l),n.on("mousedown mouseup",function(){return!1})}function o(n){if(0>n||n>=i)throw new Error("wrong bullet index: "+n);}function s(){if(1==c.isInited)return!0;throw new Error("The bullets are not inited!");}var t,a,r,u=this,i=0,h=new UniteGalleryMain,v=-1,y=new UGFunctions,c={isInited:!1},n={bullets_skin:"",bullets_addclass:"",bullets_space_between:-1};this.events={BULLET_CLICK:"bullet_click"},this.init=function(t,r,u){h=t,i=u?u:h.getNumItems(),c.isInited=!0,n=jQuery.extend(n,r),""==n.bullets_skin&&(n.bullets_skin=n.gallery_skin)},this.getBulletsWidth=function(){if(0==i||!r)return 0;return i*r+(i-1)*n.bullets_space_between},this.appendHTML=function(i){var r,u;a=i,s(),r="",""!=n.bullets_addclass&&(r=" "+n.bullets_addclass),u="<div class='ug-slider-control ug-bullets ug-skin-"+n.bullets_skin+r+"'>",u+="<\/div>",t=jQuery(u),i.append(t),f(),e()},this.updateNumBullets=function(n){i=n,f(),e()},this.getElement=function(){return t},this.setActive=function(n){var i,r;s(),o(n),i=t.children(".ug-bullet"),i.removeClass("ug-bullet-active"),r=jQuery(i[n]),r.addClass("ug-bullet-active"),v=n},this.isActive=function(n){var i;return i=(o(n),"number"!=typeof n)?n:t.children(".ug-bullet")[n],i.hasClass("ug-bullet-active")?!0:!1},this.getNumBullets=function(){return i}}function UGProgressBar(){var n,t,r=this,u=0,f=new UGFunctions,i={slider_progressbar_color:"#ffffff",slider_progressbar_opacity:.6,slider_progressbar_line_width:5};this.put=function(r,u){u&&(i=jQuery.extend(i,u)),r.append("<div class='ug-progress-bar'><div class='ug-progress-bar-inner'><\/div><\/div>"),n=r.children(".ug-progress-bar"),t=n.children(".ug-progress-bar-inner"),t.css("background-color",i.slider_progressbar_color),n.height(i.slider_progressbar_line_width),t.height(i.slider_progressbar_line_width),t.width("0%");var f=i.slider_progressbar_opacity,e=t[0];e.style.opacity=f,e.style.filter="alpha(opacity="+100*f+")"},this.putHidden=function(t,i){r.put(t,i),n.hide()},this.getElement=function(){return n},this.setSize=function(i){n.width(i),t.width(i),r.draw()},this.setPosition=function(t,i,r,u){f.placeElement(n,t,i,r,u)},this.draw=function(){var n=100*u;t.width(n+"%")},this.setProgress=function(n){u=f.normalizePercent(n),r.draw()},this.getType=function(){return"bar"}}function UGProgressPie(){function i(i){var i,o,u,c;i||(i=0),o=Math.min(n.slider_progresspie_width,n.slider_progresspie_height)/2,u=t[0].getContext("2d"),0==r&&(r=!0,u.rotate(1.5*Math.PI),u.translate(-2*o,0)),u.clearRect(0,0,n.slider_progresspie_width,n.slider_progresspie_height);var f=n.slider_progresspie_width/2,e=n.slider_progresspie_height/2,h=0,s=i*Math.PI*2;1==n.slider_progresspie_type_fill?(u.beginPath(),u.moveTo(f,e),u.arc(f,e,o,h,s),u.lineTo(f,e),u.fillStyle=n.slider_progresspie_color1,u.fill(),u.closePath()):(u.globalCompositeOperation="source-over",u.beginPath(),u.moveTo(f,e),u.arc(f,e,o,h,s),u.lineTo(f,e),u.fillStyle=n.slider_progresspie_color1,u.fill(),u.closePath(),u.globalCompositeOperation="destination-out",c=o-n.slider_progresspie_stroke_width,u.beginPath(),u.moveTo(f,e),u.arc(f,e,c,h,s),u.lineTo(f,e),u.fillStyle=n.slider_progresspie_color1,u.fill(),u.closePath()),1==n.slider_progresspie_type_fill&&(h=s,s=2*Math.PI,u.beginPath(),u.arc(f,e,o,h,s),u.lineTo(f,e),u.fillStyle=n.slider_progresspie_color2,u.fill(),u.closePath())}var f,t,e=this,r=!1,u=new UGFunctions,n={slider_progresspie_type_fill:!1,slider_progresspie_color1:"#B5B5B5",slider_progresspie_color2:"#E5E5E5",slider_progresspie_stroke_width:6,slider_progresspie_width:30,slider_progresspie_height:30};this.put=function(i,r){r&&(n=jQuery.extend(n,r)),i.append("<canvas class='ug-canvas-pie' width='"+n.slider_progresspie_width+"' height='"+n.slider_progresspie_height+"'><\/canvas>"),t=i.children(".ug-canvas-pie")},this.putHidden=function(n,r){e.put(n,r),i(.1),t.hide()},this.getElement=function(){return t},this.setPosition=function(n,i){u.placeElement(t,n,i)},this.getSize=function(){return{width:n.slider_progresspie_width,height:n.slider_progresspie_height}},this.setProgress=function(n){n=u.normalizePercent(n),f=n,i(n)},this.getType=function(){return"pie"}}function UGTouchSliderControl(){function e(n){var n;n||(n=t.getSlidesReference());var u=i.getElementSize(n.objCurrentSlide),f=-u.left,e=i.getElementSize(r);return f-e.left}function v(){var i=t.getSlidesReference(),o=e(i),s=Math.round(3*i.objCurrentSlide.width()/8),r,u,f;return Math.abs(o)>=s?!0:(r=Math.abs(n.lastMouseX-n.startMouseX),Math.abs(n.lastMouseY-n.startMouseY),20>r)?!1:(u=jQuery.now(),f=u-n.startTime,500>f?!0:!1)}function h(e){var e,s,o;if(1==t.isInnerInPlace())return!1;(f.trigger(t.events.BEFORE_RETURN),e)||(e=t.getSlidesReference()),s=i.getElementSize(e.objCurrentSlide),o=-s.left,r.animate({left:o+"px"},{duration:u.slider_transition_return_speed,easing:u.slider_transition_continuedrag_easing,queue:!1,progress:function(){if(1==n.isDragVideo){var e=i.getElementSize(r),s=e.left,h=s-o,c=n.videoStartX+h;n.videoObject.css("left",c)}},complete:function(){f.trigger(t.events.AFTER_RETURN)}})}function y(n){t.getVideoObject().hide(),t.switchSlideNums(n),t.placeNabourItems()}function c(){var o=t.getSlidesReference(),a=e(o),c,s,v,p,l;if(0==a)return!1;c=a>0?"left":"right",s=!1;switch(c){case"right":t.isSlideHasItem(o.objPrevSlide)?(v=i.getElementSize(o.objPrevSlide),l=-v.left):s=!0;break;case"left":t.isSlideHasItem(o.objNextSlide)?(p=i.getElementSize(o.objNextSlide),l=-p.left):s=!0}1==s?h(o):r.stop().animate({left:l+"px"},{duration:u.slider_transition_continuedrag_speed,easing:u.slider_transition_continuedrag_easing,queue:!1,progress:function(){if(1==n.isDragVideo){var t=i.getElementSize(r),u=t.left,f=u-n.startPosx,e=n.videoStartX+f;n.videoObject.css("left",e)}},always:function(){y(c),f.trigger(t.events.AFTER_DRAG_CHANGE)}})}function p(i){var e=n.lastMouseX-n.startMouseX,h,o,c,u,a,v,y,p;if(0==e)return!0;if(h=0>e?"left":"right",o=t.getObjZoom(),o){if(c=o.isPanEnabled(i,h),1==c)return n.isInitDataValid=!1,!0;if(0==n.isInitDataValid)return l(i),!0}u=n.startPosx+e,e>0&&u>0?u/=3:0>e&&(a=u+r.width(),v=s.width(),v>a&&(u=n.startPosx+e/3)),(0==n.isDragging&&(n.isDragging=!0,f.trigger(t.events.START_DRAG)),r.css("left",u+"px"),1==n.isDragVideo)&&(y=u-n.startPosx,p=n.videoStartX+y,n.videoObject.css("left",p))}function l(t){var u=i.getMousePosition(t),f,e;n.startMouseX=u.pageX,n.startMouseY=u.pageY,n.lastMouseX=n.startMouseX,n.lastMouseY=n.startMouseY,n.startTime=jQuery.now(),f=i.getArrTouches(t),n.startArrTouches=i.getArrTouchPositions(f),e=i.getElementSize(r),n.startPosx=e.left,n.isInitDataValid=!0,n.isDragVideo=!1,i.storeEventData(t,n.storedEventID)}function o(){n.touch_active=!1}function a(t,i){n.touch_active=!0,l(i)}function w(u){u.preventDefault(),n.isDragging=!1,1==t.isAnimating()&&r.stop(!0,!0);var f=i.getArrTouches(u);return f.length>1?(1==n.touch_active&&o("1"),!0):1==n.touch_active?!0:void a("1",u)}function b(t){var r,f;if(0==n.touch_active)return!0;if(0==t.buttons)return o("2"),c(),!0;i.updateStoredEventData(t,n.storedEventID),t.preventDefault(),r=i.getMousePosition(t),n.lastMouseX=r.pageX,n.lastMouseY=r.pageY,f=null,1==u.slider_vertical_scroll_ondrag&&(f=i.handleScrollTop(n.storedEventID)),"vert"!==f&&p(t)}function k(r){var s=i.getArrTouches(r),u=s.length,l=t.isInnerInPlace(),f,e;if(1==l&&0==n.touch_active&&0==u)return!0;0==u&&1==n.touch_active?(o("3"),f=!1,e=i.wasVerticalScroll(n.storedEventID),0==e&&(f=v()),1==f?c():h()):1==u&&0==n.touch_active&&a("2",r)}function d(){s.bind("mousedown touchstart",w),jQuery("body").bind("mousemove touchmove",b),jQuery(window).add("body").bind("mouseup touchend",k)}var s,r,f,t=new UGSlider,i=new UGFunctions,u={slider_transition_continuedrag_speed:250,slider_transition_continuedrag_easing:"linear",slider_transition_return_speed:300,slider_transition_return_easing:"easeInOutQuad"},n={touch_active:!1,startMouseX:0,startMouseY:0,lastMouseX:0,lastMouseY:0,startPosx:0,startTime:0,isInitDataValid:!1,slides:null,lastNumTouches:0,isDragging:!1,storedEventID:"touchSlider",videoStartX:0,isDragVideo:!1,videoObject:null};this.isTapEventOccured=function(r){var f=i.getArrTouches(r),u=f.length;if(0!=u||0!=n.lastNumTouches)return n.lastNumTouches=u,!1;n.lastNumTouches=u;var o=t.getSlidesReference(),s=(e(o),Math.abs(n.lastMouseX-n.startMouseX)),h=Math.abs(n.lastMouseY-n.startMouseY),c=jQuery.now(),l=c-n.startTime;return 20>s&&50>h&&500>l?!0:!1},this.init=function(n,i){t=n,f=jQuery(t),g_objects=n.getObjects(),s=g_objects.g_objSlider,r=g_objects.g_objInner,u=jQuery.extend(u,i),d()},this.getLastMousePos=function(){return{pageX:n.lastMouseX,pageY:n.lastMouseY}},this.isTouchActive=function(){return n.touch_active}}function UGZoomSliderControl(){function y(n,t){i=n,r=jQuery(i),g_objects=n.getObjects(),s=g_objects.g_objSlider,ft=g_objects.g_objInner,u=jQuery.extend(u,t),ut()}function h(){var n=i.getScaleMode();return"down"!=n&&(n="fit"),n}function e(){var u=jQuery.now(),e=u-n.storeImageLastTime,r,f;return 20>e?!1:(r=i.getSlidesReference(),n.objSlide=r.objCurrentSlide,n.objImage=r.objCurrentSlide.find("img"),0==n.objImage.length)?!1:(n.objImageSize=t.getElementSize(n.objImage),n.objParent=n.objImage.parent(),n.objParentSize=t.getElementSize(n.objParent),f=h(),objPadding=i.getObjImagePadding(),n.objFitImageSize=t.getImageInsideParentDataByImage(n.objImage,f,objPadding),u=jQuery.now(),n.storeImageLastTime=u,!0)}function f(n,f){var v=i.getSlidesReference(),e=v.objCurrentSlide.find("img"),l=h(),o,s,c,a;r.trigger(i.events.ZOOM_START),o=!0,s=i.getObjImagePadding(),"back"==n?(c=t.getImageOriginalSize(e),t.scaleImageFitParent(e,c.width,c.height,l,s)):(a="in"==n?!0:!1,o=t.zoomImageInsideParent(e,a,u.slider_zoom_step,f,l,u.slider_zoom_max_ratio,s)),1==o&&(r.trigger(i.events.ZOOMING),r.trigger(i.events.ZOOM_CHANGE),r.trigger(i.events.ZOOM_END))}function o(n,i,r){var u=t.getArrTouches(i);if(r===!0){if(1!=u.length)return!1}else if(u.length>1)return!1;return t.isElementBiggerThenParent(n)?!0:!1}function p(i){var r=t.getMousePosition(i);n.startMouseX=r.pageX,n.startMouseY=r.pageY,n.lastMouseX=n.startMouseX,n.lastMouseY=n.startMouseY,n.startImageX=n.objImageSize.left,n.startImageY=n.objImageSize.top,n.panXActive=n.objImageSize.width>n.objParentSize.width,n.panYActive=n.objImageSize.height>n.objParentSize.height}function c(t){n.isPanActive=!0,p(t)}function w(r){var u,c,l;if(void 0==n.objImage||0==n.objImage.length)return!0;var f=t.getMousePosition(r),e=(f.pageX-n.startMouseX,f.pageY-n.startMouseY,f.pageX-n.lastMouseX),o=f.pageY-n.lastMouseY,s=0>e?"left":"right",h=0>o?"up":"down";n.lastMouseX=f.pageX,n.lastMouseY=f.pageY,u=t.getElementSize(n.objImage),0==n.panYActive?o=0:"down"==h&&u.top>0?o/=3:"up"==h&&u.bottom<n.objParentSize.height&&(o/=3),0==n.panXActive||0==i.isInnerInPlace()?e=0:"right"==s&&u.left>0?e/=3:"left"==s&&u.right<n.objParentSize.width&&(e/=3),c=u.left+e,l=u.top+o,t.placeElement(n.objImage,c,l)}function b(){var f=!1,e=!1,o=0,s=0,r=t.getElementSize(n.objImage),l=i.getObjImagePadding(),h=t.getElementCenterPosition(n.objImage,l),c;n.panXActive=n.objImageSize.width>n.objParentSize.width,n.panYActive=n.objImageSize.height>n.objParentSize.height,1==n.panYActive?r.top>0?(s=0,e=!0):r.bottom<n.objParentSize.height&&(s=n.objParentSize.height-r.height,e=!0):r.top!=h.top&&(e=!0,s=h.top),1==n.panXActive?r.left>0?(o=0,f=!0):r.right<n.objParentSize.width&&(o=n.objParentSize.width-r.width,f=!0):r.left!=h.left&&(f=!0,o=h.left),c={},1==e&&(c.top=s+"px"),1==f&&(c.left=o+"px"),(1==e||1==f)&&n.objImage.animate(c,{duration:u.slider_zoom_return_pan_duration,easing:u.slider_zoom_return_pan_easing,queue:!1})}function k(){return n.objImage&&n.objImage.is(":animated")?!0:!1}function d(u){n.isZoomActive=!0,n.startDistance=t.getDistance(u[0].pageX,u[0].pageY,u[1].pageX,u[1].pageY),0==n.startDistance&&(n.startDistance=1),n.startMiddlePoint=t.getMiddlePoint(u[0].pageX,u[0].pageY,u[1].pageX,u[1].pageY),n.objImageSize=t.getElementSize(n.objImage),n.startImageX=n.objImageSize.left,n.startImageY=n.objImageSize.top,n.imageOrientPoint=t.getElementLocalPoint(n.startMiddlePoint,n.objImage);var f=t.isPointInsideElement(n.imageOrientPoint,n.objImageSize);0==f&&(n.imageOrientPoint=t.getElementCenterPoint(n.objImage)),r.trigger(i.events.ZOOM_START)}function l(u){if(0==n.isZoomActive)return!1;var f=t.getArrTouches(u);2!=f.length&&(n.isZoomActive=!1,r.trigger(i.events.ZOOM_END))}function a(i){if(1==n.isZoomActive)return!0;var r=t.getArrTouches(i);return 2!=r.length?!0:void d(r)}function g(f){var e=t.getArrTouches(f),a=t.getDistance(e[0].pageX,e[0].pageY,e[1].pageX,e[1].pageY),o=a/n.startDistance,s=t.getMiddlePoint(e[0].pageX,e[0].pageY,e[1].pageX,e[1].pageY),h=n.objImageSize.width*o,v=n.objImageSize.height*o,c=t.getImageOriginalSize(n.objImage),l=1;if(c.width>0&&(l=h/c.width),l>u.slider_zoom_max_ratio)return!0;panX=-(n.imageOrientPoint.x*o-n.imageOrientPoint.x),panY=-(n.imageOrientPoint.y*o-n.imageOrientPoint.y);var y=s.x-n.startMiddlePoint.x,p=s.y-n.startMiddlePoint.y,w=n.startImageX+panX+y,b=n.startImageY+panY+p;t.setElementSizeAndPosition(n.objImage,w,b,h,v),r.trigger(i.events.ZOOMING),r.trigger(i.events.ZOOM_CHANGE)}function v(){var i,r;if(void 0==n.objImage||0==n.objImage.length)return!0;i=t.getElementSize(n.objImage),i.width<n.objFitImageSize.imageWidth?(n.objImage.css({position:"absolute",margin:"none"}),r={top:n.objFitImageSize.imageTop+"px",left:n.objFitImageSize.imageLeft+"px",width:n.objFitImageSize.imageWidth+"px",height:n.objFitImageSize.imageHeight+"px"},n.objImage.animate(r,{duration:u.slider_zoom_return_pan_duration,easing:u.slider_zoom_return_pan_easing,queue:!1})):b()}function nt(t){return 0==i.isCurrentSlideType("image")?!0:(e(),void 0==n.objImage||0==n.objImage.length?!0:(t.preventDefault(),1==k()&&n.objImage.stop(!0),1==n.isZoomActive?l(t):a(t),void(1==n.isZoomActive?n.isPanActive=!1:1==o(n.objImage,t)&&1==n.isZoomedOnce&&c(t))))}function tt(t){var r,u,f,s;if(0==i.isCurrentSlideType("image"))return!0;if(r=jQuery(t.target),1==r.data("ug-button"))return!1;if(e(),void 0==n.objImage||0==n.objImage.length)return!0;if(u=n.isPanActive,f=n.isZoomActive,0==i.isInnerInPlace())return n.isZoomActive=!1,n.isPanActive=!1,!0;(1==n.isZoomActive?l(t):a(t),1==n.isZoomActive)?n.isPanActive=!1:(s=o(n.objImage,t,!0),1==n.isPanActive?n.isPanActive=!1:1==s&&c(t)),(u||f)&&0==n.isZoomActive&&0==n.isPanActive&&v()}function it(t){return 0==i.isCurrentSlideType("image")?!0:void(1==n.isZoomActive?g(t):1==n.isPanActive&&w(t))}function rt(n,r){if(0==u.slider_zoom_mousewheel||0==i.isCurrentSlideType("image"))return!0;n.preventDefault();var s=r>0,h=t.getMousePosition(n),c=1==s?"in":"out";f(c,h)}function ut(){s.on("mousewheel",rt),s.bind("mousedown touchstart",nt),jQuery("body").bind("mousemove touchmove",it),jQuery(window).add("body").bind("mouseup touchend",tt),r.bind(i.events.BEFORE_RETURN,function(){v()}),r.bind(i.events.ITEM_CHANGED,function(){n.isZoomedOnce=!1}),r.bind(i.events.ZOOM_CHANGE,function(){n.isZoomedOnce=!0})}var s,ft,r,i=new UGSlider,t=new UGFunctions,u={slider_zoom_step:1.2,slider_zoom_max_ratio:6,slider_zoom_return_pan_duration:400,slider_zoom_return_pan_easing:"easeOutCubic"},n={isPanActive:!1,startMouseX:0,startMouseY:0,lastMouseX:0,lastMouseY:0,startImageX:0,startImageY:0,panXActive:!1,panYActive:!1,objImage:null,objImageSize:null,objParent:null,objParentSize:null,objSlide:null,storeImageLastTime:0,isZoomActive:!1,startDistance:0,startMiddlePoint:null,imageOrientPoint:null,objFitImageSize:null,isZoomedOnce:!1};this.________EXTERNAL_____________=function(){},this.isPanEnabled=function(t,r){if((e(),void 0==n.objImage||0==n.objImage.length)||0==n.isZoomedOnce||0==o(n.objImage,t)||0==i.isInnerInPlace())return!1;if("left"==r){if(n.objImageSize.right<=n.objParentSize.width)return!1}else if(n.objImageSize.left>=0)return!1;return!0},this.init=function(n,t){y(n,t)},this.zoomIn=function(){f("in")},this.zoomOut=function(){f("out")},this.zoomBack=function(){f("back")}}function UGWistiaAPI(){function u(){return"undefined"!=typeof Wistia}function f(t,i,u,f,e){n=null,r=!1;var s=t+"_video",h="<div id='"+s+"' class='wistia_embed' style='width:"+u+";height:"+f+";' data-video-width='"+u+"' data-video-height='"+f+"'>&nbsp;<\/div>";jQuery("#"+t).html(h),n=Wistia.embed(i,{version:"v1",videoWidth:u,videoHeight:f,container:s,autoPlay:e}),r=!0,o()}function o(){n.bind("play",function(){i.trigger(t.events.START_PLAYING)}),n.bind("pause",function(){i.trigger(t.events.STOP_PLAYING)}),n.bind("end",function(){i.trigger(t.events.STOP_PLAYING),i.trigger(t.events.VIDEO_ENDED)})}this.isAPILoaded=!1;var e,n,t=this,i=jQuery(this),r=!1;this.events={START_PLAYING:"start_playing",STOP_PLAYING:"stop_playing",VIDEO_ENDED:"video_ended"},this.loadAPI=function(){return 1==g_ugWistiaAPI.isAPILoaded?!0:u()?(g_ugWistiaAPI.isAPILoaded=!0,!0):(g_ugFunctions.loadJs("fast.wistia.com/assets/external/E-v1.js",!0),void(g_ugWistiaAPI.isAPILoaded=!0))},this.doCommand=function(t){if(null==n||0==r)return!1;switch(t){case"play":n.play();break;case"pause":n.pause()}},this.pause=function(){t.doCommand("pause")},this.play=function(){t.doCommand("play")},this.putVideo=function(n,t,i,r,o){return u()?(f(n,t,i,r,o),!0):(this.loadAPI(),void(e=setInterval(function(){u()&&(f(n,t,i,r,o),clearInterval(e))},500)))},this.isPlayerReady=function(){return r&&n?!0:!1}}function UGSoundCloudAPI(){function u(){return"undefined"!=typeof SC}function f(t,r,u,f,e){var h,s,c;n=null,g_isPlayerReady=!1,h=t+"_iframe",s=location.protocol+"//w.soundcloud.com/player/?url=http://api.soundcloud.com/tracks/"+r,s+="&amp;buying=false&amp;liking=false&amp;download=false&amp;sharing=false&amp;show_artwork=true&show_comments=false&amp;show_playcount=true&amp;show_user=false&amp;hide_related=true&amp;visual=true&amp;start_track=0&amp;callback=true",s+=e===!0?"&amp;auto_play=true":"&amp;auto_play=false",c="<iframe id='"+h+"' src="+s+" width='"+u+"' height='"+f+"' frameborder='0' scrolling='no' webkitallowfullscreen mozallowfullscreen allowfullscreen><\/iframe>",jQuery("#"+t).html(c),n=SC.Widget(h),n.bind(SC.Widget.Events.READY,function(){n&&(g_isPlayerReady=!0,o())}),i=t}function o(){n.bind(SC.Widget.Events.PLAY,function(){r.trigger(t.events.START_PLAYING)}),n.bind(SC.Widget.Events.PAUSE,function(){r.trigger(t.events.STOP_PLAYING)}),n.bind(SC.Widget.Events.FINISH,function(){r.trigger(t.events.STOP_PLAYING),r.trigger(t.events.VIDEO_ENDED)})}this.isAPILoaded=!1;var e,n,i,t=this,r=jQuery(this);this.events={START_PLAYING:"start_playing",STOP_PLAYING:"stop_playing",VIDEO_ENDED:"video_ended"},this.loadAPI=function(){return 1==g_ugSoundCloudAPI.isAPILoaded?!0:u()?(g_ugSoundCloudAPI.isAPILoaded=!0,!0):(g_ugFunctions.loadJs("w.soundcloud.com/player/api.js",!0),void(g_ugSoundCloudAPI.isAPILoaded=!0))},this.putSound=function(n,t,i,r,o){return u()?(f(n,t,i,r,o),!0):(this.loadAPI(),void(e=setInterval(function(){u()&&(f(n,t,i,r,o),clearInterval(e))},500)))},this.doCommand=function(t){if(null==n||0==g_isPlayerReady)return!1;switch(t){case"play":n.play();break;case"pause":n.pause()}},this.pause=function(){t.doCommand("pause")},this.play=function(){t.doCommand("play")},this.destroy=function(){g_isPlayerReady=!1,n=null,i&&(jQuery("#"+i).html(""),i=null)}}function UGHtml5MediaAPI(){function r(){return"undefined"!=typeof mejs}function u(t,i,r,u,f){var h,o;n=null,g_isPlayerReady=!1;var s=location.protocol+"//cdnjs.cloudflare.com/ajax/libs/mediaelement/2.18.1/flashmediaelement-cdn.swf",a=location.protocol+"//cdnjs.cloudflare.com/ajax/libs/mediaelement/2.18.1/silverlightmediaelement.xap",c=t+"_video",l="";f&&f===!0&&(l="autoplay='autoplay'"),h="",i.posterImage&&(h="poster='"+i.posterImage+"'"),o="<video id='"+c+"' width='"+r+"' height='"+u+"'  controls='controls' preload='none' "+l+" "+h+">",""!=i.mp4&&(o+="<source type='video/mp4' src='"+i.mp4+"' />"),""!=i.webm&&(o+="<source type='video/webm' src='"+i.webm+"' />"),""!=i.ogv&&(o+="<source type='video/ogg' src='"+i.ogv+"' />"),o+="<object width='"+r+"' height='"+u+"' type='application/x-shockwave-flash' data='"+s+"'>",o+="<param name='movie' value='"+s+"' />",o+="<param name='flashvars' value='controls=true&file="+i.mp4+"' />",o+="<\/object>",o+="<\/video>",jQuery("#"+t).html(o),new MediaElement(c,{enablePluginDebug:!1,flashName:s,silverlightName:a,success:function(t){g_isPlayerReady=!0,n=t,0==f&&n.pause(),e()},error:function(n){trace(n)}})}function e(){g_ugFunctions.addEvent(n,"play",function(){i.trigger(t.events.START_PLAYING)}),g_ugFunctions.addEvent(n,"pause",function(){i.trigger(t.events.STOP_PLAYING)}),g_ugFunctions.addEvent(n,"ended",function(){i.trigger(t.events.STOP_PLAYING),i.trigger(t.events.VIDEO_ENDED)})}this.isAPILoaded=!1;var f,n,t=this,i=jQuery(this);this.events={START_PLAYING:"start_playing",STOP_PLAYING:"stop_playing",VIDEO_ENDED:"video_ended"},this.loadAPI=function(){return 1==g_ugHtml5MediaAPI.isAPILoaded?!0:r()?(g_ugHtml5MediaAPI.isAPILoaded=!0,!0):(g_ugFunctions.loadJs("cdnjs.cloudflare.com/ajax/libs/mediaelement/2.18.1/mediaelement.min.js",!0),g_ugFunctions.loadCss("cdnjs.cloudflare.com/ajax/libs/mediaelement/2.18.1/mediaelementplayer.min.css",!0),void(g_ugHtml5MediaAPI.isAPILoaded=!0))},this.putVideo=function(n,t,i,e,o){return r()?(u(n,t,i,e,o),!0):(this.loadAPI(),void(f=setInterval(function(){r()&&(u(n,t,i,e,o),clearInterval(f))},500)))},this.doCommand=function(t){if(null==n||0==g_isPlayerReady)return!1;switch(t){case"play":n.play();break;case"pause":n.pause()}},this.pause=function(){t.doCommand("pause")},this.play=function(){t.doCommand("play")}}function UGVimeoAPI(){function u(){return"undefined"!=typeof Froogaloop}function e(t,r,u,e,o){var s,c,l;n=null,i=!1,s=location.protocol+"//player.vimeo.com/video/"+r+"?api=1",o===!0&&(s+="&amp;byline=0&amp;autoplay=1&amp;title=0&amp;portrait=0"),c="<iframe src="+s+" width='"+u+"' height='"+e+"' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen><\/iframe>",jQuery("#"+t).html(c),l=jQuery("#"+t+" iframe")[0],n=Froogaloop(l),n.addEvent("ready",function(){n&&(i=!0,h())}),f=t}function h(){return n?(n.addEvent("cuechange",function(){1==s&&t.play()}),n.addEvent("play",function(){r.trigger(t.events.START_PLAYING)}),n.addEvent("pause",function(){r.trigger(t.events.STOP_PLAYING)}),void n.addEvent("finish",function(){r.trigger(t.events.STOP_PLAYING),r.trigger(t.events.VIDEO_ENDED)})):!1}this.isAPILoaded=!1;var o,f,t=this,r=jQuery(this),n=null,i=!1,s=!1;this.events={START_PLAYING:"start_playing",STOP_PLAYING:"stop_playing",VIDEO_ENDED:"video_ended"},this.loadAPI=function(){return 1==g_ugVimeoAPI.isAPILoaded?!0:u()?(g_ugVimeoAPI.isAPILoaded=!0,!0):(g_ugFunctions.loadJs("f.vimeocdn.com/js/froogaloop2.min.js",!0),void(g_ugVimeoAPI.isAPILoaded=!0))},this.doCommand=function(t){if(null==n||0==i)return!1;switch(t){default:n.api(t)}},this.pause=function(){t.doCommand("pause")},this.play=function(){t.doCommand("play")},this.destroy=function(){n&&(n.api("unload"),n=null,i=!1),f&&jQuery("#"+f).html("")},this.putVideo=function(n,t,i,r,f){return u()?(e(n,t,i,r,f),!0):(this.loadAPI(),void(o=setInterval(function(){u()&&(e(n,t,i,r,f),clearInterval(o))},500)))},this.isPlayerReady=function(){return i&&n?!0:!1},this.changeVideo=function(i,r){return 0==t.isPlayerReady()?!1:(s=r,void n.api("loadVideo",i))},this.getVideoImages=function(n,t,i){var r=location.protocol+"//vimeo.com/api/v2/video/"+n+".json";jQuery.get(r,{},function(n){var r={};r.preview=n[0].thumbnail_large,r.thumb=n[0].thumbnail_medium,i(t,r)})}}function UGYoutubeAPI(){function f(t,r,f,e,o){n&&i&&n.destroy();var h={controls:2,showinfo:u.video_youtube_showinfo,rel:0};o===!0&&(h.autoplay=1),i=!1,n=new YT.Player(t,{height:e,width:f,videoId:r,playerVars:h,events:{onReady:c,onStateChange:l}}),s=t}function e(){return"undefined"!=typeof YT&&"undefined"!=typeof YT.Player?!0:!1}function c(){i=!0}function l(){if("function"!=typeof n.getPlayerState)return trace("Youtube API error: can't get player state"),!1;var i=n.getPlayerState();switch(i){case YT.PlayerState.PLAYING:r.trigger(t.events.START_PLAYING);break;case YT.PlayerState.ENDED:r.trigger(t.events.STOP_PLAYING),r.trigger(t.events.VIDEO_ENDED);break;default:h==YT.PlayerState.PLAYING&&r.trigger(t.events.STOP_PLAYING)}h=i}this.isAPILoaded=!1;var o,s,t=this,n=null,i=!1,r=jQuery(this),h=-1,u={video_youtube_showinfo:!0};this.events={START_PLAYING:"start_playing",STOP_PLAYING:"stop_playing",VIDEO_ENDED:"video_ended"},this.setOptions=function(n){u=jQuery.extend(u,n)},this.putVideo=function(n,t,i,r,u){return e()?(f(n,t,i,r,u),!0):(this.loadAPI(),void(o=setInterval(function(){e()&&(f(n,t,i,r,u),clearInterval(o))},500)))},this.loadAPI=function(){return 1==g_ugYoutubeAPI.isAPILoaded?!0:"undefined"!=typeof YT?(g_ugYoutubeAPI.isAPILoaded=!0,!0):(g_ugFunctions.loadJs("https://www.youtube.com/player_api",!1),void(g_ugYoutubeAPI.isAPILoaded=!0))},this.doCommand=function(t,r){if(!n)return!0;if(0==i)return!1;switch(t){case"play":if("function"!=typeof n.playVideo)return!1;n.playVideo();break;case"pause":if("function"!=typeof n.pauseVideo)return!1;n.pauseVideo();break;case"seek":if("function"!=typeof n.seekTo)return!1;n.seekTo(r);break;case"stopToBeginning":var u=n.getPlayerState();switch(n.pauseVideo(),u){case YT.PlayerState.PLAYING:case YT.PlayerState.ENDED:case YT.PlayerState.PAUSED:n.seekTo(0)}}},this.play=function(){t.doCommand("play")},this.pause=function(){t.doCommand("pause")},this.destroy=function(){try{n&&(i=!1,n.clearVideo(),n.destroy())}catch(t){jQuery("#"+s).html("")}},this.stopToBeginning=function(){t.doCommand("stopToBeginning")},this.changeVideo=function(i,r){return 0==t.isPlayerReady()?!1:void(r&&1==r?n.loadVideoById(i,0,"large"):n.cueVideoById(i,0,"large"))},this.isPlayerReady=function(){return i&&n?!0:!1},this.getVideoImages=function(n){var t={};return t.preview="https://i.ytimg.com/vi/"+n+"/sddefault.jpg",t.thumb="https://i.ytimg.com/vi/"+n+"/default.jpg",t}}function UGVideoPlayer(){function it(){s.hide()}function c(){w.trigger(s.events.PLAY_START),i&&i.hide()}function l(){w.trigger(s.events.PLAY_STOP),i&&i.show()}function y(){w.trigger(s.events.VIDEO_ENDED)}function rt(){i&&(b.setButtonMobileReady(i),b.setButtonOnClick(i,it)),jQuery(t).on(t.events.START_PLAYING,c),jQuery(t).on(t.events.STOP_PLAYING,l),jQuery(t).on(t.events.VIDEO_ENDED,y),jQuery(u).on(u.events.START_PLAYING,c),jQuery(u).on(u.events.STOP_PLAYING,l),jQuery(u).on(u.events.VIDEO_ENDED,y),jQuery(e).on(e.events.START_PLAYING,c),jQuery(e).on(e.events.STOP_PLAYING,l),jQuery(e).on(e.events.VIDEO_ENDED,y),jQuery(f).on(f.events.START_PLAYING,c),jQuery(f).on(f.events.STOP_PLAYING,l),jQuery(f).on(f.events.VIDEO_ENDED,y),jQuery(o).on(o.events.START_PLAYING,c),jQuery(o).on(o.events.STOP_PLAYING,l),jQuery(o).on(o.events.VIDEO_ENDED,y)}function v(n){var r=["youtube","vimeo","html5","soundcloud","wistia"],s,i;for(s in r)if(i=r[s],i!=n)switch(i){case"youtube":t.pause(),t.destroy(),p.hide();break;case"vimeo":u.pause(),u.destroy(),d.hide();break;case"html5":e.pause(),g.hide();break;case"soundcloud":f.pause(),f.destroy(),nt.hide();break;case"wistia":o.pause(),tt.hide()}}var a,r,p,d,g,i,nt,tt,s=this,w=jQuery(this),b=new UGFunctions,t=new UGYoutubeAPI,u=new UGVimeoAPI,e=new UGHtml5MediaAPI,f=new UGSoundCloudAPI,o=new UGWistiaAPI,h=null,k={video_enable_closebutton:!0},n;this.events={SHOW:"video_show",HIDE:"video_hide",PLAY_START:"video_play_start",PLAY_STOP:"video_play_stop",VIDEO_ENDED:"video_ended"},n={standAloneMode:!1,youtubeInnerID:"",vimeoPlayerID:"",html5PlayerID:"",wistiaPlayerID:"",soundCloudPlayerID:""},this.init=function(i,r,u){if(a=u,!a)throw new Error("missing gallery ID for video player, it's a must!");k=jQuery.extend(k,i),t.setOptions(k),r&&1==r&&(n.standAloneMode=!0)},this.setHtml=function(t){n.youtubeInnerID=a+"_youtube_inner",n.vimeoPlayerID=a+"_videoplayer_vimeo",n.html5PlayerID=a+"_videoplayer_html5",n.wistiaPlayerID=a+"_videoplayer_wistia",n.soundCloudPlayerID=a+"_videoplayer_soundcloud";var u="<div class='ug-videoplayer' style='display:none'>";u+="<div class='ug-videoplayer-wrapper ug-videoplayer-youtube' style='display:none'><div id='"+n.youtubeInnerID+"'><\/div><\/div>",u+="<div id='"+n.vimeoPlayerID+"' class='ug-videoplayer-wrapper ug-videoplayer-vimeo' style='display:none'><\/div>",u+="<div id='"+n.html5PlayerID+"' class='ug-videoplayer-wrapper ug-videoplayer-html5'><\/div>",u+="<div id='"+n.soundCloudPlayerID+"' class='ug-videoplayer-wrapper ug-videoplayer-soundcloud'><\/div>",u+="<div id='"+n.wistiaPlayerID+"' class='ug-videoplayer-wrapper ug-videoplayer-wistia'><\/div>",0==n.standAloneMode&&1==k.video_enable_closebutton&&(u+="<div class='ug-videoplayer-button-close'><\/div>"),u+="<\/div>",t.append(u),r=t.children(".ug-videoplayer"),p=r.children(".ug-videoplayer-youtube"),d=r.children(".ug-videoplayer-vimeo"),g=r.children(".ug-videoplayer-html5"),nt=r.children(".ug-videoplayer-soundcloud"),tt=r.children(".ug-videoplayer-wistia"),0==n.standAloneMode&&1==k.video_enable_closebutton&&(i=r.children(".ug-videoplayer-button-close"))},this.destroy=function(){i&&(i.off("click"),i.off("touchend")),jQuery(t).off(t.events.START_PLAYING),jQuery(t).off(t.events.STOP_PLAYING),jQuery(u).off(u.events.START_PLAYING),jQuery(u).off(u.events.STOP_PLAYING),jQuery(e).off(e.events.START_PLAYING),jQuery(e).off(e.events.STOP_PLAYING),jQuery(f).off(f.events.START_PLAYING,c),jQuery(f).off(f.events.STOP_PLAYING,l),jQuery(o).off(o.events.START_PLAYING,c),jQuery(o).off(o.events.STOP_PLAYING,l),h=null},this.initEvents=function(){rt()},this.setSize=function(n,t){b.setElementSize(r,n,t),i&&b.placeElement(i,"right","top")},this.setPosition=function(n,t){b.placeElement(r,n,t)},this.getObject=function(){return r},this.show=function(){return 1==s.isVisible()?!0:(r.show(),r.fadeTo(0,1),i&&i.show(),void w.trigger(s.events.SHOW))},this.hide=function(){return 0==s.isVisible()?!0:(v(),h=null,r.hide(),void w.trigger(s.events.HIDE))},this.getActiveAPI=function(){switch(h){case"youtube":return t;case"vimeo":return u;case"wistia":return o;case"soundcloud":return f;case"html5":return e;default:return null}},this.pause=function(){var n=s.getActiveAPI();return null==n?!1:void("function"==typeof n.pause&&n.pause())},this.isVisible=function(){return r.is(":visible")},this.playYoutube=function(i,r){var r,u;"undefined"==typeof r&&(r=!0),v("youtube"),p.show(),u=p.children("#"+n.youtubeInnerID),0==u.length&&p.append("<div id='"+n.youtubeInnerID+"'><\/div>"),1==t.isPlayerReady()&&1==n.standAloneMode?t.changeVideo(i,r):t.putVideo(n.youtubeInnerID,i,"100%","100%",r),h="youtube"},this.playVimeo=function(t,i){if("undefined"==typeof i)var i=!0;v("vimeo"),d.show(),u.putVideo(n.vimeoPlayerID,t,"100%","100%",i),h="vimeo"},this.playHtml5Video=function(t,i,r,u,f){var f,o;"undefined"==typeof f&&(f=!0),v("html5"),g.show(),o={ogv:t,webm:i,mp4:r,posterImage:u},e.putVideo(n.html5PlayerID,o,"100%","100%",f),h="html5"},this.playSoundCloud=function(t,i){if("undefined"==typeof i)var i=!0;v("soundcloud"),nt.show(),f.putSound(n.soundCloudPlayerID,t,"100%","100%",i),h="soundcloud"},this.playWistia=function(t,i){if("undefined"==typeof i)var i=!0;v("wistia"),tt.show(),o.putVideo(n.wistiaPlayerID,t,"100%","100%",i),h="wistia"}}function ugCheckForMinJQueryVersion(){var n=g_ugFunctions.checkMinJqueryVersion("1.8.0");if(0==n)throw new Error("The gallery can run from jquery 1.8 You have jQuery "+jQuery.fn.jquery+" Please update your jQuery library.");}function ugCheckForErrors(n,t){function u(){if("undefined"==typeof jQuery)throw new Error("jQuery library not included");}function f(){if("function"==typeof jQuery.fn.unitegallery)return!0;var n="You have some jquery.js library include that comes after the gallery files js include.";throw n+="<br> This include eliminates the gallery libraries, and make it not work.","cms"==t?(n+="<br><br> To fix it you can:<br>&nbsp;&nbsp;&nbsp; 1. In the Gallery Settings -> Troubleshooting set option:  <strong><b>Put JS Includes To Body<\/b><\/strong> option to true.",n+="<br>&nbsp;&nbsp;&nbsp; 2. Find the double jquery.js include and remove it."):n+="<br><br> Please find and remove this jquery.js include and the gallery will work. <br> * There should be only one jquery.js include before all other js includes in the page.",new Error(n);}var i,r;try{"jquery"==t?(u(),ugCheckForMinJQueryVersion()):(ugCheckForMinJQueryVersion(),f())}catch(e){return i=e.message,(i="Unite Gallery Error: "+i,i="<div style='font-size:16px;color:#BC0C06;max-width:900px;border:1px solid red;padding:10px;'>"+i+"<\/div>","jquery"==t)?(r=document.getElementById(n),r.innerHTML=i,r.style.display="block"):jQuery(n).show().html(i),!1}return!0}function UniteGalleryMain(){function at(n){var t=n;return-1==t.indexOf("UGTheme_")&&(t="UGTheme_"+t),t}function vt(objCustomOptions){var defaultTheme,themeFunction;objCustomOptions.hasOwnProperty("gallery_theme")?i.gallery_theme=objCustomOptions.gallery_theme:(defaultTheme=i.gallery_theme,0==g_ugFunctions.isThemeRegistered(defaultTheme)&&(i.gallery_theme=g_ugFunctions.getFirstRegisteredTheme())),themeFunction=at(i.gallery_theme);try{i.gallery_theme=eval(themeFunction)}catch(e){}i.gallery_theme=eval(themeFunction),p=new i.gallery_theme,p.init(t,objCustomOptions)}function yt(){i=jQuery.extend({},n.originalOptions),l=-1,v=null,u=void 0,s=void 0,u=void 0}function pt(){try{ugCheckForMinJQueryVersion()}catch(n){nt(n.message)}"object"==typeof r.outerWidth()&&nt("You have some buggy script. most chances jquery-ui.js that destroy jquery outerWidth, outerHeight functions. The gallery can't run. Please update jquery-ui.js to latest version."),setTimeout(function(){ugCheckForErrors(c,"cms")},5e3)}function b(u,f,o,s){var l="object"==typeof f,h,v;if(l&&(n.objCustomOptions=f),1==n.isRunFirstTime){if(c=u,r=jQuery(c),0==r.length)return trace("div with id: "+c+" not found"),!1;li=r.parent(),pt(),n.originalOptions=jQuery.extend({},i),l&&(i=jQuery.extend(i,f)),1==i.gallery_enable_cache&&i.gallery_initial_catid&&ht(i.gallery_initial_catid),t.setSizeClass(),h=r.children(),ut(h),ft(),r.find("img").fadeTo(0,0).hide(),r.show(),tt()}else if(t.destroy(),yt(),i=jQuery.extend(i,n.objCustomOptions),o){if(s&&1==i.gallery_enable_cache&&ht(s,o),"noitems"==o)return a("No items in this category",""),!1;r.html(o),h=r.children(),ut(h),ft(),r.children().fadeTo(0,0).hide(),r.show(),tt()}1==n.isRunFirstTime&&1==i.gallery_enable_tabs&&(w=new UGTabs,w.init(t,i)),l&&wt(n.objCustomOptions),bt(),1==i.gallery_shuffle&&t.shuffleItems(),vt(n.objCustomOptions),kt(),dt(),v=r.width(),0==v?e.waitForWidth(r,g):g()}function g(){t.setSizeClass(),0==n.isFreestyleMode&&1==i.gallery_preserve_ratio&&rt(),p.run(),w&&n.isRunFirstTime&&w.run(),et(),ei(),h>0&&t.selectItem(0),1==i.gallery_autoplay&&t.startPlayMode(),n.isRunFirstTime=!1}function a(n,t){var t,i;"undefined"==typeof t&&(t="<b>Unite Gallery Error: <\/b>"),n=t+n,i="<div class='ug-error-message-wrapper'><div class='ug-error-message'>"+n+"<\/div><\/div>",r.children().remove(),r.html(i),r.show()}function nt(n){throw a(n),new Error(n);}function wt(){i.gallery_images_preload_type||(i.gallery_images_preload_type="minimal"),(void 0==i.gallery_min_height||i.gallery_height<i.gallery_min_height)&&(i.gallery_min_height=0),(void 0==i.gallery_min_width||i.gallery_width<i.gallery_min_width)&&(i.gallery_min_width=0)}function bt(){if(!i.gallery_theme)throw new Error("The gallery can't run without theme");if(jQuery.isNumeric(i.gallery_height)&&i.gallery_height<i.gallery_min_height)throw new Error("The <b>gallery_height<\/b> option must be bigger then <b>gallery_min_height option<\/b>");if(i.gallery_width<i.gallery_min_width)throw new Error("The <b>gallery_width<\/b> option must be bigger then <b>gallery_min_width option<\/b>");}function kt(){r.addClass("ug-gallery-wrapper"),r.append("<div class='ug-overlay-disabled' style='display:none'><\/div>"),t.setSizeClass()}function tt(){r.children().remove()}function it(){var i=t.getSize();n.lastWidth=i.width,n.lastHeight=i.height}function rt(){var u=t.getSize(),f=u.width/u.height,n;f!=u.orig_ratio&&(n=u.width/u.orig_ratio,n=Math.round(n),n<i.gallery_min_height&&(n=i.gallery_min_height),r.height(n))}function dt(){var f=e.getCssSizeParam(i.gallery_width),t={"max-width":f,"min-width":e.getCssSizeParam(i.gallery_min_width)},u;0==n.isFreestyleMode?(u=e.getCssSizeParam(i.gallery_height),t.height=u):t.overflow="visible",i.gallery_background_color&&(t["background-color"]=i.gallery_background_color),r.css(t)}function ut(i){var c,l,r,v,b,a,y,p,e,s,k,d,g,f,nt;o=[];for(var rt=t.isMobileMode(),tt=0,w=0;w<i.length;w++){var u=jQuery(i[w]),c=u.prop("tagName").toLowerCase(),it="";if("a"==c&&(it=u.attr("href"),u=u.children(),c=u.prop("tagName").toLowerCase()),l=u.data("type"),void 0==l&&(l="image"),r={},r.type=l,"img"==c)v=u.data("lazyload-src"),v&&""!=v&&(u.attr("src",v),jQuery.removeData(u,"lazyload-src")),b=u.attr("src"),a=u.data("thumb"),"undefined"!=typeof a&&""!=a?(r.urlThumb=a,r.urlImage=b,u.attr("src",a)):(r.urlThumb=b,r.urlImage=u.data("image")),r.title=u.attr("alt"),r.objThumbImage=u;else{if("image"==l)throw new Error("The item should not be image type");r.urlThumb=u.data("thumb"),r.title=u.data("title"),r.objThumbImage=null,r.urlImage=u.data("image")}1==rt&&(y=u.data("thumb-mobile"),"undefined"!=typeof y&&""!=y&&(r.urlThumb=y,"img"==c&&u.attr("src",r.urlThumb)),p=u.data("image-mobile"),"undefined"!=typeof p&&""!=p&&(r.urlImage=p)),r.link=it,r.description=u.attr("title"),r.description||(r.description=u.data("description")),r.description||(r.description=""),r.isLoaded=!1,r.isThumbImageLoaded=!1,r.objPreloadImage=null,r.isBigImageLoadStarted=!1,r.isBigImageLoaded=!1,r.isBigImageLoadError=!1,r.imageWidth=0,r.imageHeight=0,r.thumbWidth=0,r.thumbHeight=0,r.thumbRatioByWidth=0,r.thumbRatioByHeight=0,e=u.data("width"),s=u.data("height"),e&&"number"==typeof e&&s&&"number"==typeof s&&(r.thumbWidth=e,r.thumbHeight=s,r.thumbRatioByWidth=e/s,r.thumbRatioByHeight=s/e),r.addHtml=null,k=void 0==r.urlImage||""==r.urlImage,d=void 0==r.urlThumb||""==r.urlThumb;switch(r.type){case"youtube":(r.videoid=u.data("videoid"),k||d)&&(g=g_ugYoutubeAPI.getVideoImages(r.videoid),k&&(r.urlImage=g.preview),d&&(r.urlThumb=g.thumb,"img"==c&&u.attr("src",r.urlThumb))),n.isYoutubePresent=!0;break;case"vimeo":r.videoid=u.data("videoid"),n.isVimeoPresent=!0;break;case"html5video":r.videoogv=u.data("videoogv"),r.videowebm=u.data("videowebm"),r.videomp4=u.data("videomp4"),n.isHtml5VideoPresent=!0;break;case"soundcloud":r.trackid=u.data("trackid"),n.isSoundCloudPresent=!0;break;case"wistia":r.videoid=u.data("videoid"),n.isWistiaPresent=!0;break;case"custom":f=u.children("img"),f.length&&(f=jQuery(f[0]),r.urlThumb=f.attr("src"),r.title=f.attr("alt"),r.objThumbImage=f),nt=u.children().not("img:first-child"),nt.length&&(r.addHtml=nt.clone())}r.objThumbImage&&(r.objThumbImage.removeAttr("data-description",""),r.objThumbImage.removeAttr("data-image",""),r.objThumbImage.removeAttr("data-thumb",""),r.objThumbImage.removeAttr("title","")),r.index=tt,o.push(r),tt++}h=o.length}function ft(){n.isYoutubePresent&&g_ugYoutubeAPI.loadAPI(),n.isVimeoPresent&&g_ugVimeoAPI.loadAPI(),n.isHtml5VideoPresent&&g_ugHtml5MediaAPI.loadAPI(),n.isSoundCloudPresent&&g_ugSoundCloudAPI.loadAPI(),n.isWistiaPresent&&g_ugWistiaAPI.loadAPI()}function et(){if("visible"!=i.gallery_images_preload_type||s||(i.gallery_images_preload_type="minimal"),1==n.isAllItemsPreloaded)return!0;switch(i.gallery_images_preload_type){case"all":jQuery(o).each(function(){y(this)});break;case"visible":jQuery(o).each(function(){var n=this,t=s.isItemThumbVisible(n);1==t&&y(n)})}}function gt(n){if(1==n.isBigImageLoadStarted||1==n.isBigImageLoaded||1==n.isBigImageLoadError)return!1;switch(i.gallery_images_preload_type){case"all":y(n);break;case"visible":var t=s.isItemThumbVisible(n);1==t&&y(n)}}function y(n){if(1==n.isBigImageLoadStarted||1==n.isBigImageLoaded||1==n.isBigImageLoadError)return!0;var i=n.urlImage;return""==i||void 0==i?(n.isBigImageLoadError=!0,!1):(n.isBigImageLoadStarted=!0,n.objPreloadImage=jQuery("<img/>").attr("src",i),n.objPreloadImage.data("itemIndex",n.index),n.objPreloadImage.on("load",t.onItemBigImageLoaded),n.objPreloadImage.on("error",function(){var u=jQuery(this),i=u.data("itemIndex"),n=o[i],r;n.isBigImageLoadError=!0,n.isBigImageLoaded=!1,r=jQuery(this).attr("src"),console.log("Can't load image: "+r),f.trigger(t.events.ITEM_IMAGE_UPDATED,[i,n.urlImage]),n.objThumbImage.attr("src",n.urlThumb)}),void ni())}function ni(){if(1==n.isAllItemsPreloaded)return!1;for(var t in o)if(0==o[t].isBigImageLoadStarted)return!1;n.isAllItemsPreloaded=!0}function ti(){1==i.gallery_pause_on_mouseover&&0==t.isFullScreen()&&1==n.isPlayMode&&u&&0==u.isSlideActionActive()&&t.pausePlaying()}function ot(){if(1==i.gallery_pause_on_mouseover&&1==n.isPlayMode&&u&&0==u.isSlideActionActive()){var f=u.isCurrentSlideLoadingImage();0==f&&t.continuePlaying()}}function ii(n){var i=jQuery(n.target),r;if(i.is("textarea")||i.is("select")||i.is("input"))return!0;r=n.charCode?n.charCode:n.keyCode?n.keyCode:n.which?n.which:0;switch(r){case 39:t.nextItem(),n.preventDefault();break;case 37:t.prevItem(),n.preventDefault()}f.trigger(t.events.GALLERY_KEYPRESS,r)}function k(){var u=t.getSize(),e,o;if(0==u.width)return!0;t.setSizeClass(),u=t.getSize(),(u.width!=n.lastWidth||u.height!=n.lastHeight)&&(e=!1,n.funcCustomHeight&&(o=n.funcCustomHeight(u),o&&(r.height(o),e=!0)),0==e&&1==i.gallery_preserve_ratio&&0==n.isFreestyleMode&&rt(),it(),f.trigger(t.events.SIZE_CHANGE))}function st(){"visible"==i.gallery_images_preload_type&&0==n.isAllItemsPreloaded&&et()}function ri(){var n=e.isFullScreen(),i=n?t.events.ENTER_FULLSCREEN:t.events.EXIT_FULLSCREEN,u=e.getGlobalData("fullscreenID");return c!==u?!0:(n?r.addClass("ug-fullscreen"):r.removeClass("ug-fullscreen"),f.trigger(i),void k())}function ui(n,i){var r=t.getItem(i);gt(r)}function fi(){1==t.isPlayMode()&&t.continuePlaying()}function ei(){if(r.on("dragstart",function(n){n.preventDefault()}),f.on(t.events.ITEM_IMAGE_UPDATED,ui),s)switch(n.thumbsType){case"strip":jQuery(s).on(s.events.STRIP_MOVE,st);break;case"grid":jQuery(s).on(s.events.PANE_CHANGE,st)}if("advance"==i.gallery_mousewheel_role&&0==n.isFreestyleMode&&r.on("mousewheel",t.onGalleryMouseWheel),it(),jQuery(window).resize(function(){r.css("width","auto"),e.whenContiniousEventOver("gallery_resize",k,n.resizeDelay)}),e.addFullScreenChangeEvent(ri),u){if(jQuery(u).on(u.events.ITEM_CHANGED,function(){var n=u.getCurrentItemIndex();-1!=n&&t.selectItem(n)}),1==i.gallery_pause_on_mouseover){var o=u.getElement();o.hover(ti,ot),f.on(t.events.ENTER_FULLSCREEN,function(){ot()})}ct(u,u.events.ACTION_START,t.events.SLIDER_ACTION_START),ct(u,u.events.ACTION_END,t.events.SLIDER_ACTION_END),jQuery(u).on(u.events.CURRENTSLIDE_LOAD_END,fi)}1==i.gallery_control_keyboard&&jQuery(document).keydown(ii)}function ht(n,t){var i;t?(i=t,"noitems"!=i&&(i=jQuery(t).clone())):i=r.children().clone(),d[n]=i}function oi(n){n||(n=r),n.removeClass("ug-under-480"),n.removeClass("ug-under-780"),n.removeClass("ug-under-960")}function ct(n,t,i){jQuery(n).on(t,function(){f.trigger(i,[this])})}function lt(){var r=jQuery.now(),f=r-n.playTimeLastStep,u;(n.playTimePassed+=f,n.playTimeLastStep=r,n.objProgress)&&(u=n.playTimePassed/i.gallery_play_interval,n.objProgress.setProgress(u)),n.playTimePassed>=i.gallery_play_interval&&(t.nextItem(),n.playTimePassed=0)}function si(){return null==v?!0:(s&&s.setThumbUnselected(v.objThumbWrapper),v=null,void(l=-1))}function hi(){jQuery("body").addClass("ug-body-fullscreen"),r.addClass("ug-fake-fullscreen"),n.isFakeFullscreen=!0,f.trigger(t.events.ENTER_FULLSCREEN),f.trigger(t.events.SIZE_CHANGE)}function ci(){jQuery("body").removeClass("ug-body-fullscreen"),r.removeClass("ug-fake-fullscreen"),n.isFakeFullscreen=!1,f.trigger(t.events.EXIT_FULLSCREEN),f.trigger(t.events.SIZE_CHANGE)}var t=this,c,f=jQuery(t),r,li,s,u,e=new UGFunctions,w,o=[],h,v=null,l=-1,p,d={},i,n;this.events={ITEM_CHANGE:"item_change",SIZE_CHANGE:"size_change",ENTER_FULLSCREEN:"enter_fullscreen",EXIT_FULLSCREEN:"exit_fullscreen",START_PLAY:"start_play",STOP_PLAY:"stop_play",PAUSE_PLAYING:"pause_playing",CONTINUE_PLAYING:"continue_playing",SLIDER_ACTION_START:"slider_action_start",SLIDER_ACTION_END:"slider_action_end",ITEM_IMAGE_UPDATED:"item_image_updated",GALLERY_KEYPRESS:"gallery_keypress",GALLERY_BEFORE_REQUEST_ITEMS:"gallery_before_request_items",OPEN_LIGHTBOX:"open_lightbox",CLOSE_LIGHTBOX:"close_lightbox"},i={gallery_width:900,gallery_height:500,gallery_min_width:150,gallery_min_height:100,gallery_theme:"default",gallery_skin:"default",gallery_images_preload_type:"minimal",gallery_autoplay:!1,gallery_play_interval:3e3,gallery_pause_on_mouseover:!0,gallery_mousewheel_role:"zoom",gallery_control_keyboard:!0,gallery_carousel:!0,gallery_preserve_ratio:!0,gallery_background_color:"",gallery_debug_errors:!1,gallery_shuffle:!1,gallery_urlajax:null,gallery_enable_tabs:!1,gallery_enable_cache:!0,gallery_initial_catid:""},n={objCustomOptions:{},isAllItemsPreloaded:!1,isFreestyleMode:!1,lastWidth:0,lastHeigh:0,handleResize:null,isInited:!1,isPlayMode:!1,isPlayModePaused:!1,playTimePassed:0,playTimeLastStep:0,playHandle:"",playStepInterval:33,objProgress:null,isFakeFullscreen:!1,thumbsType:null,isYoutubePresent:!1,isVimeoPresent:!1,isHtml5VideoPresent:!1,isSoundCloudPresent:!1,isWistiaPresent:!1,resizeDelay:100,isRunFirstTime:!0,originalOptions:{},funcCustomHeight:null},this.onItemBigImageLoaded=function(n,t){var t,u,i,r;t||(t=jQuery(this)),u=t.data("itemIndex"),i=o[u],i.isBigImageLoaded=!0,r=e.getImageOriginalSize(t),i.imageWidth=r.width,i.imageHeight=r.height},this.checkFillImageSize=function(n,t){var i,t,r;if(!t){if(i=n.data("itemIndex"),void 0===i)throw new Error("Wrong image given to gallery.checkFillImageSize");t=o[i]}r=e.getImageOriginalSize(n),t.imageWidth=r.width,t.imageHeight=r.height},this.setFreestyleMode=function(){n.isFreestyleMode=!0},this.attachThumbsPanel=function(t,i){n.thumbsType=t,s=i},this.initSlider=function(i,r){if(!i)var i={};i=jQuery.extend(n.objCustomOptions,i),u=new UGSlider,u.init(t,i,r)},this.onGalleryMouseWheel=function(n,i){n.preventDefault(),i>0?t.prevItem():t.nextItem()},this.destroy=function(){if(r.off("dragstart"),f.off(t.events.ITEM_IMAGE_UPDATED),s)switch(n.thumbsType){case"strip":jQuery(s).off(s.events.STRIP_MOVE);break;case"grid":jQuery(s).off(s.events.PANE_CHANGE)}if(r.off("mousewheel"),jQuery(window).off("resize"),e.destroyFullScreenChangeEvent(),u){jQuery(u).off(u.events.ITEM_CHANGED);var o=u.getElement();o.off("mouseenter"),o.off("mouseleave"),f.off(t.events.ENTER_FULLSCREEN),jQuery(u).off(u.events.ACTION_START),jQuery(u).off(u.events.ACTION_END),jQuery(u).off(u.events.CURRENTSLIDE_LOAD_END)}1==i.gallery_control_keyboard&&jQuery(document).off("keydown"),p&&"function"==typeof p.destroy&&p.destroy(),r.html("")},this.getArrItems=function(){return o},this.getObjects=function(){return{g_galleryID:c,g_objWrapper:r,g_objThumbs:s,g_objSlider:u,g_options:i,g_arrItems:o,g_numItems:h}},this.getObjSlider=function(){return u},this.getItem=function(n){if(0>n)throw new Error("item with index: "+n+" not found");if(n>=h)throw new Error("item with index: "+n+" not found");return o[n]},this.getWidth=function(){var n=t.getSize();return n.width},this.getHeight=function(){var n=t.getSize();return n.height},this.getSize=function(){var n=e.getElementSize(r);return n.orig_width=i.gallery_width,n.orig_height=i.gallery_height,n.orig_ratio=n.orig_width/n.orig_height,n},this.getGalleryID=function(){return c.replace("#","")},this.getNextItem=function(n,t){var r,u;if("object"==typeof n&&(n=n.index),r=n+1,t!==!0&&1==h)return null;if(r>=h){if(1!=i.gallery_carousel&&t!==!0)return null;r=0}return u=o[r]},this.getPrevItem=function(n){var t,r;if("object"==typeof n&&(n=n.index),t=n-1,0>t){if(1!=i.gallery_carousel&&forceCarousel!==!0)return null;t=h-1}return r=o[t]},this.getSelectedItem=function(){return v},this.getSelectedItemIndex=function(){return l},this.getNumItems=function(){return h},this.isLastItem=function(){return l==h-1?!0:!1},this.isFirstItem=function(){return 0==l?!0:!1},this.getOptions=function(){return i},this.getElement=function(){return r},this.___________SET_CONTROLS___________=function(){},this.setNextButton=function(n){n.data("ug-button",!0),e.setButtonOnClick(n,t.nextItem)},this.setPrevButton=function(n){n.data("ug-button",!0),e.setButtonOnClick(n,t.prevItem)},this.setFullScreenToggleButton=function(n){n.data("ug-button",!0),e.setButtonOnClick(n,t.toggleFullscreen),f.on(t.events.ENTER_FULLSCREEN,function(){n.addClass("ug-fullscreenmode")}),f.on(t.events.EXIT_FULLSCREEN,function(){n.removeClass("ug-fullscreenmode")})},this.destroyFullscreenButton=function(n){e.destroyButton(n),f.off(t.events.ENTER_FULLSCREEN),f.off(t.events.EXIT_FULLSCREEN)},this.setPlayButton=function(n){n.data("ug-button",!0),e.setButtonOnClick(n,t.togglePlayMode),f.on(t.events.START_PLAY,function(){n.addClass("ug-stop-mode")}),f.on(t.events.STOP_PLAY,function(){n.removeClass("ug-stop-mode")})},this.destroyPlayButton=function(n){e.destroyButton(n),f.off(t.events.START_PLAY),f.off(t.events.STOP_PLAY)},this.setProgressIndicator=function(t){n.objProgress=t},this.setTextContainers=function(n,i){f.on(t.events.ITEM_CHANGE,function(){var r=t.getSelectedItem();n.html(r.title),i.html(r.description)})},this.showDisabledOverlay=function(){r.children(".ug-overlay-disabled").show()},this.hideDisabledOverlay=function(){r.children(".ug-overlay-disabled").hide()},this.___________END_SET_CONTROLS___________=function(){},this.___________PLAY_MODE___________=function(){},this.startPlayMode=function(){if(n.isPlayMode=!0,n.isPlayModePaused=!1,n.playTimePassed=0,n.playTimeLastStep=jQuery.now(),n.playHandle=setInterval(lt,n.playStepInterval),n.objProgress){var i=n.objProgress.getElement();n.objProgress.setProgress(0),i.show()}f.trigger(t.events.START_PLAY),u&&1==u.isCurrentSlideLoadingImage()&&t.pausePlaying()},this.resetPlaying=function(){return 0==n.isPlayMode?!0:(n.playTimePassed=0,void(n.playTimeLastStep=jQuery.now()))},this.pausePlaying=function(){return 1==n.isPlayModePaused?!0:(n.isPlayModePaused=!0,clearInterval(n.playHandle),void f.trigger(t.events.PAUSE_PLAYING))},this.continuePlaying=function(){return 0==n.isPlayModePaused?!0:(n.isPlayModePaused=!1,n.playTimeLastStep=jQuery.now(),void(n.playHandle=setInterval(lt,n.playStepInterval)))},this.stopPlayMode=function(){if(n.isPlayMode=!1,clearInterval(n.playHandle),n.playTimePassed=0,n.objProgress){var i=n.objProgress.getElement();i.hide()}f.trigger(t.events.STOP_PLAY)},this.isPlayMode=function(){return n.isPlayMode},this.togglePlayMode=function(){0==t.isPlayMode()?t.startPlayMode():t.stopPlayMode()},this.___________GENERAL_EXTERNAL___________=function(){},this.shuffleItems=function(){o=e.arrayShuffle(o);for(var n in o)o[n].index=parseInt(n)},this.setOptions=function(n){i=jQuery.extend(i,n)},this.selectItem=function(i,r){var e,o;if("number"==typeof i&&(i=t.getItem(i)),e=i.index,e==l)return!0;(si(),v=i,l=e,f.trigger(t.events.ITEM_CHANGE,[i,r]),1==n.isPlayMode)&&(t.resetPlaying(),o=u.isCurrentSlideLoadingImage(),1==o&&t.pausePlaying())},this.nextItem=function(){var n=l+1;return 0==h?!0:0==i.gallery_carousel&&n>=h?!0:(n>=h&&(n=0),void t.selectItem(n,"next"))},this.prevItem=function(){var n=l-1;return-1==l&&(n=0),0==h?!0:0==i.gallery_carousel&&0>n?!0:(0>n&&(n=h-1),void t.selectItem(n,"prev"))},this.isFullScreen=function(){return 1==n.isFakeFullscreen?!0:1==e.isFullScreen()?!0:!1},this.isFakeFullscreen=function(){return n.isFakeFullscreen},this.toFullScreen=function(){e.setGlobalData("fullscreenID",c);var n=r.get(0),t=e.toFullscreen(n);0==t&&hi()},this.exitFullScreen=function(){1==n.isFakeFullscreen?ci():e.exitFullscreen()},this.toggleFullscreen=function(){0==t.isFullScreen()?t.toFullScreen():t.exitFullScreen()},this.resize=function(n,t,i){r.css("width","auto"),r.css("max-width",n+"px"),t&&r.height(t),i||i===!0||k()},this.setSizeClass=function(n,i){var n,f,i,u;return n||(n=r),i||(f=t.getSize(),i=f.width),0==i&&(i=jQuery(window).width()),u="",480>=i?u="ug-under-480":780>=i?u="ug-under-780":960>i&&(u="ug-under-960"),1==n.hasClass(u)?!0:(oi(n),void(""!=u&&n.addClass(u)))},this.isMobileMode=function(){return r.hasClass("ug-under-480")?!0:!1},this.changeItems=function(n,t){if(!n)var n="noitems";b(c,"nochange",n,t)},this.showErrorMessageReplaceGallery=function(n){a(n)},this.setFuncCustomHeight=function(t){n.funcCustomHeight=t},this.__________AJAX_REQUEST_______=function(){},this.ajaxRequest=function(n,t,r,u){var o="html",f,t,e;if(1==r&&(o="json"),!u||"function"!=typeof u)throw new Error("ajaxRequest error: success function should be passed");if(f=i.gallery_urlajax,""==f)throw new Error("ajaxRequest error: Ajax url don't passed");"undefined"==typeof t&&(t={}),e={action:"unitegallery_ajax_action",client_action:n,galleryID:c,data:t},jQuery.ajax({type:"post",url:i.gallery_urlajax,dataType:"json",data:e,success:function(n){return n?-1==n||0===n?(a("ajax error!!!"),!1):"undefined"==typeof n.success?(a("The 'success' param is a must!"),!1):0==n.success?(a(n.message),!1):void u(n):(a("Empty ajax response!","Ajax Error"),!1)},error:function(n,t){console.log("Ajax Error!!! "+t)}})},this.requestNewItems=function(n,r,u){var e=i.gallery_enable_cache,o;(u||(u=n),1==r&&(e=!1),1==e&&d.hasOwnProperty(u))?(o=d[u],t.changeItems(o,u)):(f.trigger(t.events.GALLERY_BEFORE_REQUEST_ITEMS),t.ajaxRequest("front_get_cat_items",{catid:n},!0,function(n){var i=n.html;t.changeItems(i,u)}))},this.run=function(n,t){var r;if(i.gallery_debug_errors,t&&t.hasOwnProperty("gallery_debug_errors")&&(i.gallery_debug_errors=t.gallery_debug_errors),1==i.gallery_debug_errors)try{b(n,t)}catch(e){if("object"==typeof e){var r=e.message,f=e.lineNumber,u=e.fileName;e.stack,r+=" <br><br> in file: "+u,r+=" <b> line "+f+"<\/b>",trace(e)}else r=e;r=r.replace("Error:",""),a(r)}else b(n,t)}}function UGLightbox(){function kt(r,f){l=r,v=jQuery(r),i=jQuery.extend(i,gi),i=jQuery.extend(i,f),n.originalOptions=jQuery.extend({},i),"compact"==i.lightbox_type&&(n.isCompact=!0,i=jQuery.extend(i,nr),i=jQuery.extend(i,f)),ot(),1==n.putSlider?(l.initSlider(i,"lightbox"),g_objects=r.getObjects(),t=g_objects.g_objSlider):t=null,1==i.lightbox_show_textpanel?u.init(l,i,"lightbox"):u=null}function ot(){1==n.isCompact&&1==i.lightbox_show_textpanel&&(i.lightbox_slider_image_padding_bottom=n.initTextPanelHeight),1==n.isCompact&&"inside"==i.lightbox_arrows_position&&(n.isArrowsInside=!0),1==n.isArrowsInside&&0==i.lightbox_arrows_inside_alwayson&&(n.isArrowsOnHoverMode=!0),0==i.lightbox_show_textpanel&&(n.isTopPanelEnabled=!1,n.topPanelHeight=0,i.lightbox_slider_image_padding_top=0)}function dt(){var f="",l="";1==n.isCompact&&(l=" ug-lightbox-compact"),f+="<div class='ug-gallery-wrapper ug-lightbox"+l+"'>",f+="<div class='ug-lightbox-overlay'><\/div>",0==n.isCompact&&n.isTopPanelEnabled?(f+="<div class='ug-lightbox-top-panel'>",f+="<div class='ug-lightbox-top-panel-overlay'><\/div>",i.lightbox_show_numbers&&(f+="<div class='ug-lightbox-numbers'><\/div>"),f+="<\/div>"):i.lightbox_show_numbers&&(f+="<div class='ug-lightbox-numbers'><\/div>"),f+="<div class='ug-lightbox-button-close'><\/div>",f+="<div class='ug-lightbox-arrow-left'><\/div>",f+="<div class='ug-lightbox-arrow-right'><\/div>",f+="<\/div>",o=jQuery(f),jQuery("body").append(o),t&&t.setHtml(o),a=o.children(".ug-lightbox-overlay"),0==n.isCompact&&1==n.isTopPanelEnabled&&(e=o.children(".ug-lightbox-top-panel"),0==e.length&&(e=null)),c=o.find(".ug-lightbox-button-close"),i.lightbox_show_numbers&&(s=o.find(".ug-lightbox-numbers")),r=o.children(".ug-lightbox-arrow-left"),h=o.children(".ug-lightbox-arrow-right"),u&&(e?u.appendHTML(e):u.appendHTML(o))}function gt(){if(null!==i.lightbox_overlay_color&&a.css("background-color",i.lightbox_overlay_color),null!==i.lightbox_overlay_opacity&&a.fadeTo(0,i.lightbox_overlay_opacity),e&&null!==i.lightbox_top_panel_opacity&&e.children(".ug-lightbox-top-panel-overlay").fadeTo(0,i.lightbox_top_panel_opacity),s){var n={};null!==i.lightbox_numbers_size&&(n["font-size"]=i.lightbox_numbers_size+"px"),i.lightbox_numbers_color&&(n.color=i.lightbox_numbers_color),null!==i.lightbox_numbers_padding_right&&(n["padding-right"]=i.lightbox_numbers_padding_right+"px"),null!==i.lightbox_numbers_padding_top&&(n["padding-top"]=i.lightbox_numbers_padding_top+"px"),s.css(n)}}function st(n){if(!t)return!0;var i={slider_image_padding_top:n};t.setOptions(i),t.refreshSlideItems()}function g(){var f;if(!e||!u||(f=e.height(),0==f)||0==e.is(":visible"))return!1;var r=f,s=u.getSize(),o=s.height;f!=n.topPanelHeight&&(r=n.topPanelHeight),o>r&&(r=o),f!=r&&(e.height(r),t&&0==t.isAnimating()&&st(r))}function ni(n){var t={},r=i.lightbox_textpanel_width,f=47,e=40,o=n.width-f-e;r>o?(t.textpanel_padding_left=f,t.textpanel_padding_right=e,t.textpanel_title_text_align="center",t.textpanel_desc_text_align="center"):(t.textpanel_padding_left=Math.floor((n.width-r)/2),t.textpanel_padding_right=t.textpanel_padding_left,t.textpanel_title_text_align="left",t.textpanel_desc_text_align="left",i.lightbox_textpanel_title_text_align&&(t.textpanel_title_text_align=i.lightbox_textpanel_desc_text_align),i.lightbox_textpanel_desc_text_align&&(t.textpanel_desc_text_align=i.lightbox_textpanel_desc_text_align)),u.setOptions(t),u.refresh(!0,!0),g("positionTextPanelWide"),u.positionPanel()}function ti(){return e?void e.hide():!1}function ii(){return e?void e.show():!1}function nt(i){var s,r,h,i,c,l,e,a;return 0==n.isOpened?!1:u?t?(s=f.getElementSize(o),r=u.getSize(),0==r.width||r.height>120)?!1:(i||(h=t.getSlideImage(),i=f.getElementSize(h)),0==i.height||0==i.width)?!1:(c=i.bottom+r.height,c<s.height)?!1:(l=t.getOptions(),e=r.height,e!=l.slider_image_padding_bottom&&(a={slider_image_padding_bottom:e},0==t.isAnimating()))?(t.setOptions(a),t.refreshSlideItems(),!0):!1:!1:!1}function ri(i,r){if(!i)var e=t.getSlideImage(),i=f.getElementSize(e);n.textPanelTop=i.bottom,r===!0&&u.positionPanel(n.textPanelTop,n.textPanelLeft)}function tt(i){var a=(f.getElementSize(o),t.getSlideImage()),r=f.getElementSize(a),e,h,c,l;if(0==r.width)return!1;n.textPanelLeft=r.left,n.textPanelTop=r.bottom,e=r.width,s&&(h=f.getElementSize(s),e-=h.width,c=r.right-h.width,f.placeElement(s,c,n.textPanelTop)),u&&(u.show(),u.refresh(!0,!0,e),ri(r)),l=nt(r),0==l&&(n.positionFrom="handleCompactTextpanelSizes",u&&(u.positionPanel(n.textPanelTop,n.textPanelLeft),i===!0&&(i(),p())))}function w(){if(0==t.isCurrentSlideType("image"))return!0;return 1==t.isCurrentImageInPlace()}function b(u,e){var c,p,b;if(0==n.isArrowsInside||!r)return!1;if(c=w(),r.show(),h.show(),n.positionFrom="positionArrowsInside",1==n.isArrowsOnHoverMode&&1==c&&0==it()&&rt(!0),0==c)var a=f.getElementRelativePos(r,"left",i.lightbox_arrows_offset),s=f.getElementRelativePos(r,"middle"),v=f.getElementRelativePos(h,"right",i.lightbox_arrows_offset),y=s;else var o=t.getSlideImage(),l=f.getElementSize(o),a=(f.getElementSize(t.getElement()),f.getElementRelativePos(r,"left",0,o)+l.left+i.lightbox_arrows_inside_offset),s=f.getElementRelativePos(r,"middle",0,o)+l.top,v=f.getElementRelativePos(r,"right",0,o)+l.left-i.lightbox_arrows_inside_offset,y=s;e===!0?(p={left:a,top:s},b={left:v,top:y},r.stop().animate(p,{duration:n.fadeDuration}),h.stop().animate(b,{duration:n.fadeDuration})):(r.stop(),h.stop(),f.placeElement(r,a,s),f.placeElement(h,v,y)),1==u&&ut(e)}function k(r,u){var e,s,p;n.positionFrom=null;var b=w(),l=2,a=f.getElementRelativePos(c,"right",2,o);if(0==b)s=l,e=a;else{var k=t.getSlideImage(),v=f.getElementSize(k),h=f.getElementSize(t.getElement()),y=f.getElementSize(c);h.top==h.height&&(h.top=0),e=h.left+v.right-y.width/2+i.lightbox_compact_closebutton_offsetx,s=h.top+v.top-y.height/2-i.lightbox_compact_closebutton_offsety,l>s&&(s=l),e>a&&(e=a)}u===!0?(p={left:e,top:s},c.stop().animate(p,{duration:n.fadeDuration})):(c.stop(),f.placeElement(c,e,s)),r===!0&&ei(u)}function ht(){c&&c.stop().fadeTo(n.fadeDuration,0),lt(),at(),n.positionFrom="hideCompactElements",1==n.isArrowsInside&&rt()}function ui(){c&&c.hide(),r&&1==n.isArrowsInside&&(r.hide(),h.hide()),s&&s.hide(),u&&u.hide()}function ct(){var s=f.getElementSize(o),l,a;e&&f.setElementSizeAndPosition(e,0,0,s.width,n.topPanelHeight),r&&0==n.isArrowsInside&&(1==i.lightbox_hide_arrows_onvideoplay&&(r.show(),h.show()),f.placeElement(r,"left","middle",i.lightbox_arrows_offset),f.placeElement(h,"right","middle",i.lightbox_arrows_offset)),0==n.isCompact&&f.placeElement(c,"right","top",2,2),u&&(n.positionFrom="positionElements",0==n.isCompact?ni(s):(d(),p()));var v=s.width,y=s.height,w=0,b=0;t&&(e&&(l=e.height(),a={slider_image_padding_top:l},t.setOptions(a)),t.setSize(v,y),t.setPosition(b,w))}function lt(){u&&u.getElement().stop().fadeTo(n.fadeDuration,0)}function at(){s&&s.stop().fadeTo(n.fadeDuration,0)}function it(){if(!n.lastMouseX)return!0;var i={pageX:n.lastMouseX,pageY:n.lastMouseY};return t.isMouseInsideSlideImage(i)}function rt(t,i){return r?1==n.isArrowsOnHoverMode&&i===!1?(1==it(),!0):void(t===!0?(r.stop().fadeTo(0,0),h.stop().fadeTo(0,0)):(r.stop().fadeTo(n.fadeDuration,0),h.stop().fadeTo(n.fadeDuration,0))):!1}function fi(){if(!r||0==r.is(":visible"))return!0;var n=r.css("opacity");return 1!=n?!0:!1}function ut(i,u){return r?1==n.isArrowsOnHoverMode&&u!==!0&&1==w()?!0:1==t.isSwiping()?!0:(i!==!0&&(r.stop(),h.stop()),r.fadeTo(n.fadeDuration,1),void h.fadeTo(n.fadeDuration,1)):!1}function ei(t){t!==!0&&c.stop(),c.fadeTo(n.fadeDuration,1)}function ft(n){if(!u)return!1;if(!n)var n=t.getCurrentItem();u.setTextPlain(n.title,n.description)}function et(n){var n,i,r;if(!s)return!1;n||(n=t.getCurrentItem()),i=l.getNumItems(),r=n.index+1,s.html(r+" / "+i)}function d(){return u?void u.getElement().show().stop().fadeTo(n.fadeDuration,1):!1}function p(){s&&s.stop().fadeTo(n.fadeDuration,1)}function vt(){return 0==n.isCompact?!0:void ht()}function oi(){if(0==n.isCompact)return!0;if(n.positionFrom="onZoomChange",k(!1,!0),b(!1,!0),1==n.isCompact){var i=t.isCurrentSlideType("image")&&1==t.isCurrentImageInPlace();0==i?(lt(),at()):(n.positionFrom="onZoomChange",d(),p())}}function yt(){if(0==n.isCompact)return!0;n.positionFrom="onSliderAfterReturn",k(!0),b(!0);var t=nt();0==t&&tt(),d(),p()}function si(i,r){return r=jQuery(r),0==n.isCompact?!0:0==t.isSlideCurrent(r)?!0:(n.positionFrom="onSliderAfterPutImage",k(!0),b(!0),void tt())}function hi(){var u=t.getOptions(),f=u.slider_image_padding_top,i,r;e&&(i=e.height(),i!=f&&st(i)),1==n.isCompact&&((ft(),et(),n.positionFrom="onSliderTransitionEnd",k(!0),b(!0),0==t.isSlideActionActive())&&(r=nt(),0==r&&tt()),d(),p())}function ci(i,r){0==n.isCompact?(s&&et(r),u&&(ft(r),0==n.isRightNowOpened&&(u.positionElements(!1),g("onchange"),u.positionPanel()))):0==t.isAnimating()&&(u&&ft(r),s&&et(r)),0==n.isSliderChangedOnce&&(n.isSliderChangedOnce=!0,di.trigger(y.events.LIGHTBOX_INIT))}function li(r,u){var o=t.getSlideType(),f,e;if("image"!=o&&0==n.isCompact&&t.isSlideActionActive())return!0;if(f=t.isPreloading(),1==f)return y.close("slider"),!0;1==i.lightbox_close_on_emptyspace&&(e=t.isMouseInsideSlideImage(u),0==e&&y.close("slider_inside"))}function ai(){ct()}function vi(){e?ti():s&&s.hide(),r&&1==i.lightbox_hide_arrows_onvideoplay&&(r.hide(),h.hide())}function yi(){e?(ii(),g("onStopVideo")):s&&s.show(),r&&1==i.lightbox_hide_arrows_onvideoplay&&(r.show(),h.show())}function pt(t,i){switch(i){case 27:1==n.isOpened&&y.close("keypress")}}function wt(){1==n.isArrowsOnHoverMode&&ut(!1,!0)}function bt(){n.positionFrom="hideCompactElements",1==n.isArrowsOnHoverMode&&1==w()&&rt(!1,!0)}function pi(i){n.lastMouseX=i.pageX,n.lastMouseY=i.pageY;var u=fi();1==u&&it()&&0==t.isAnimating()&&(n.positionFrom="onMouseMove",r&&0==r.is(":animated")&&ut(!1,!0))}function wi(r,u,f,e){if(0==n.isOpened)return!0;switch(i.gallery_mousewheel_role){default:case"zoom":var o=t.getSlideType();"image"!=o&&r.preventDefault();break;case"none":r.preventDefault();break;case"advance":l.onGalleryMouseWheel(r,u,f,e)}}function bi(){if(a.on("touchstart",function(n){n.preventDefault()}),a.on("touchend",function(){y.close("overlay")}),f.addClassOnHover(h,"ug-arrow-hover"),f.addClassOnHover(r,"ug-arrow-hover"),f.addClassOnHover(c),l.setNextButton(h),l.setPrevButton(r),c.click(function(){y.close("button")}),v.on(l.events.ITEM_CHANGE,ci),t){jQuery(t).on(t.events.TRANSITION_END,hi),jQuery(t).on(t.events.CLICK,li);var i=t.getVideoObject();jQuery(i).on(i.events.PLAY_START,vi),jQuery(i).on(i.events.PLAY_STOP,yi),jQuery(t).on(t.events.START_DRAG,vt),jQuery(t).on(t.events.TRANSITION_START,vt),jQuery(t).on(t.events.AFTER_DRAG_CHANGE,yt),jQuery(t).on(t.events.AFTER_RETURN,yt),jQuery(t).on(t.events.AFTER_PUT_IMAGE,si),jQuery(t).on(t.events.ZOOM_CHANGE,oi),jQuery(t).on(t.events.IMAGE_MOUSEENTER,wt),jQuery(t).on(t.events.IMAGE_MOUSELEAVE,bt)}jQuery(window).resize(function(){return 0==n.isOpened?!0:void f.whenContiniousEventOver("lightbox_resize",ai,100)}),v.on(l.events.GALLERY_KEYPRESS,pt),1==n.isArrowsOnHoverMode&&jQuery(document).bind("mousemove",pi),o.on("mousewheel",wi)}function ki(){n.isCompact=!1,ot(),i=jQuery.extend({},n.originalOptions),t.setOptions(i)}var v,o,a,r,h,c,s,e,y=this,di=jQuery(this),l=new UniteGalleryMain,t=new UGSlider,f=new UGFunctions,u=new UGTextPanel,i={lightbox_type:"wide",lightbox_show_textpanel:!0,lightbox_textpanel_width:550,lightbox_hide_arrows_onvideoplay:!0,lightbox_arrows_position:"sides",lightbox_arrows_offset:10,lightbox_arrows_inside_offset:10,lightbox_arrows_inside_alwayson:!1,lightbox_overlay_color:null,lightbox_overlay_opacity:1,lightbox_top_panel_opacity:null,lightbox_show_numbers:!0,lightbox_numbers_size:null,lightbox_numbers_color:null,lightbox_numbers_padding_top:null,lightbox_numbers_padding_right:null,lightbox_compact_closebutton_offsetx:1,lightbox_compact_closebutton_offsety:1,lightbox_close_on_emptyspace:!0};this.events={LIGHTBOX_INIT:"lightbox_init"};var n={topPanelHeight:44,initTextPanelHeight:26,isOpened:!1,isRightNowOpened:!1,putSlider:!0,isCompact:!1,fadeDuration:300,positionFrom:null,textPanelTop:null,textPanelLeft:null,isArrowsInside:!1,isArrowsOnHoverMode:!1,lastMouseX:null,lastMouseY:null,originalOptions:null,isSliderChangedOnce:!1,isTopPanelEnabled:!0},gi={lightbox_slider_controls_always_on:!0,lightbox_slider_enable_bullets:!1,lightbox_slider_enable_arrows:!1,lightbox_slider_enable_progress_indicator:!1,lightbox_slider_enable_play_button:!1,lightbox_slider_enable_fullscreen_button:!1,lightbox_slider_enable_zoom_panel:!1,lightbox_slider_enable_text_panel:!1,lightbox_slider_scale_mode_media:"down",lightbox_slider_scale_mode:"down",lightbox_slider_loader_type:3,lightbox_slider_loader_color:"black",lightbox_slider_transition:"fade",lightbox_slider_image_padding_top:n.topPanelHeight,lightbox_slider_image_padding_bottom:0,lightbox_slider_video_padding_top:0,lightbox_slider_video_padding_bottom:0,lightbox_textpanel_align:"middle",lightbox_textpanel_padding_top:5,lightbox_textpanel_padding_bottom:5,slider_video_constantsize:!1,lightbox_slider_image_border:!1,lightbox_textpanel_enable_title:!0,lightbox_textpanel_enable_description:!1,lightbox_textpanel_desc_style_as_title:!0,lightbox_textpanel_enable_bg:!1,video_enable_closebutton:!1,lightbox_slider_video_enable_closebutton:!1,video_youtube_showinfo:!1,lightbox_slider_enable_links:!1},nr={lightbox_overlay_opacity:.6,lightbox_slider_image_border:!0,lightbox_slider_image_shadow:!0,lightbox_slider_image_padding_top:30,lightbox_slider_image_padding_bottom:30,slider_video_constantsize:!0,lightbox_textpanel_align:"bottom",lightbox_textpanel_title_text_align:"left",lightbox_textpanel_desc_text_align:"left",lightbox_textpanel_padding_left:10,lightbox_textpanel_padding_right:10};this.destroy=function(){if(jQuery(document).unbind("mousemove"),a.off("touchstart"),a.off("touchend"),c.off("click"),v.off(l.events.ITEM_CHANGE),t){jQuery(t).off(t.events.TRANSITION_END),jQuery(t).off(t.events.CLICK),jQuery(t).off(t.events.START_DRAG),jQuery(t).off(t.events.TRANSITION_START),jQuery(t).off(t.events.AFTER_DRAG_CHANGE),jQuery(t).off(t.events.AFTER_RETURN);var n=t.getVideoObject();jQuery(n).off(n.events.PLAY_START),jQuery(n).off(n.events.PLAY_STOP),jQuery(t).on(t.events.IMAGE_MOUSEENTER,wt),jQuery(t).on(t.events.IMAGE_MOUSELEAVE,bt),t.destroy()}jQuery(window).unbind("resize"),v.off(l.events.GALLERY_KEYPRESS,pt),o.off("mousewheel"),o.remove()},this.open=function(f){var e=l.getItem(f),s;(n.isOpened=!0,n.isRightNowOpened=!0,setTimeout(function(){n.isRightNowOpened=!1},100),t&&t.setItem(e,"lightbox_open"),u&&u.setTextPlain(e.title,e.description),a.stop().fadeTo(0,0),o.show(),o.fadeTo(0,1),a.stop().fadeTo(n.fadeDuration,i.lightbox_overlay_opacity),ct(),1==n.isCompact)&&(s=t.isPreloading(),1==s?ui():1==n.isArrowsInside&&(r.hide(),h.hide())),t&&t.startSlideAction(),v.trigger(l.events.OPEN_LIGHTBOX,e)},this.close=function(){n.isOpened=!1,1==n.isCompact&&ht(),t&&t.stopSlideAction();var r=t.getSlideType();"image"!=r?o.hide():o.fadeTo(n.fadeDuration,0,function(){o.hide()}),v.trigger(l.events.CLOSE_LIGHTBOX)},this.init=function(n,t){kt(n,t)},this.putHtml=function(){var t=l.isMobileMode();t&&1==n.isCompact&&ki(),dt()},this.run=function(){gt(),t&&t.run(),bi()}}function UGCarousel(){function ft(i,r){g_objects=i.getObjects(),p=i,fi=jQuery(i),h=g_objects.g_objWrapper,rt=g_objects.g_arrItems,t=jQuery.extend(t,r),f.setFixedMode(),f.setApproveClickFunction(ui),f.init(i,t),ut=f.getObjThumbs(),t=f.getOptions(),n.initTileWidth=t.tile_width,n.initTileHeight=t.tile_height,n.tileWidth=t.tile_width}function et(n){var n,t;n||(n=h),t="<div class='ug-carousel-wrapper'><div class='ug-carousel-inner'><\/div><\/div>",h.append(t),e=h.children(".ug-carousel-wrapper"),u=e.children(".ug-carousel-inner"),f.setHtml(u),ut.getThumbs().fadeTo(0,1)}function w(i,r){var r,u;r||(r=n.initTileHeight/n.initTileWidth*i),n.tileWidth=i,u={tile_width:i,tile_height:r},f.setOptions(u),t.tile_width=i,t.tile_height=r,f.resizeAllTiles(i),y(!0)}function ot(){var o,u,s;if(null===n.carouselMaxWidth)throw new Error("The carousel width not set");n.tileWidth<n.initTileWidth?(u=n.carouselMaxWidth-2*t.carousel_padding,u>n.initTileWidth&&(u=n.initTileWidth),w(u),o=i.getNumItemsInSpace(n.carouselMaxWidth,u,t.carousel_space_between_tiles)):(o=i.getNumItemsInSpace(n.carouselMaxWidth,n.tileWidth,t.carousel_space_between_tiles),0>=o&&(o=1,u=n.carouselMaxWidth-2*t.carousel_padding,w(u))),s=i.getSpaceByNumItems(o,n.tileWidth,t.carousel_space_between_tiles),s+=2*t.carousel_padding,e.width(s),1==n.isFirstTimeRun?(ri(),f.run(),jQuery.each(rt,function(t,i){i.objThumbWrapper.data("index",t),h.trigger(n.eventSizeChange,[i.objThumbWrapper,!0]),i.objTileOriginal=i.objThumbWrapper.clone(!0,!0)}),y(!0),1==t.carousel_autoplay&&r.startAutoplay()):(1==t.carousel_autoplay&&r.pauseAutoplay(),l(0,!1),1==t.carousel_autoplay&&r.startAutoplay()),bt(),n.isFirstTimeRun=!1}function a(){return i.getElementSize(u).left}function b(n){return i.getMousePosition(n).pageX}function c(){return u.children(".ug-thumb-wrapper")}function s(r){return i.getNumItemsInSpace(r,n.tileWidth,t.carousel_space_between_tiles)}function k(){return c().length}function v(n){g(n);var t=c();return jQuery(t[n])}function st(){return u.children(".ug-thumb-wrapper").first()}function ht(){return u.children(".ug-thumb-wrapper").last()}function ct(n,t,i){var u=n.data("index"),f,e,r,o;if(void 0==u)throw new Error("every tile should have index!");for(f=[],e=0;t>e;e++){if(r="prev"==i?p.getPrevItem(u,!0):p.getNextItem(u,!0),!r)throw new Error("the item to add is empty");o=r.objTileOriginal.clone(!0,!0),u=r.index,o.addClass("cloned"),f.push(o)}return f}function lt(){var r=i.getElementSize(e),t=i.getElementSize(u),f=t.width-r.width+t.left;return n.sideSpace-f}function at(){var t=-a();return n.sideSpace-t}function vt(){var n=i.getElementSize(e);return n.width}function d(){var n=vt();return s(n)}function y(r){var r;r||(r=!1);var o,s=c(),h=0,f=0;return jQuery.each(s,function(n,r){r=jQuery(r),i.placeElement(r,h,0);var u=i.getElementSize(r);h+=u.width+t.carousel_space_between_tiles,f=Math.max(f,u.height),n==s.length-1&&(o=u.right)}),u.width(o),f+=2*t.carousel_padding,r===!0&&(u.height(f),e.height(f)),l(n.numCurrent,!1),o}function g(n){if(n>c().length-1)throw new Error("Wrogn tile number: "+n);}function nt(t,i){var r,e,o;r="left"==i?st():ht(),e="left"==i?"prev":"next",o=ct(r,t,e),jQuery.each(o,function(t,r){"left"==i?u.prepend(r):u.append(r),h.trigger(n.eventSizeChange,r),f.loadTileImage(r)})}function tt(n,t){g(u);for(var r=c(),u=r.length,i=0;n>i;i++)"left"==t?jQuery(r[i]).remove():jQuery(r[u-1-i]).remove()}function yt(n){var t={left:n+"px"};u.css(t)}function l(r,f,e){var f,o,s;if(void 0===f&&(f=!0,u.is(":animated")))return!0;var c=v(r),l=i.getElementSize(c),a=-l.left+t.carousel_padding,h={left:a+"px"};f===!0?(o=t.carousel_scroll_duration,s=t.carousel_scroll_easing,e===!0&&(o=n.scrollShortDuration,s=n.scrollShortEasing),u.stop(!0).animate(h,{duration:o,easing:s,queue:!1,complete:function(){n.numCurrent=r,it(!0)}})):(n.numCurrent=r,u.css(h))}function pt(){var t=-a(),n=s(t),r=i.getElementSize(v(n)).left,u=i.getElementSize(v(n+1)).left;return Math.abs(r-t)<Math.abs(u-t)?n:n+1}function wt(){var n=pt();l(n,!0,!0)}function it(){var t=at(),i=lt(),r=0,e=0,f=0,u=0,h=k(),o;if(t>n.spaceActionSize?(r=s(t),nt(r,"left"),n.numCurrent+=r):t<-n.spaceActionSize&&(f=s(Math.abs(t)),tt(f,"left"),n.numCurrent-=f),i>n.spaceActionSize?(e=s(i),nt(e,"right")):i<-n.spaceActionSize&&(u=s(Math.abs(i)),tt(u,"right")),u>h)throw new Error("Can't remove more then num tiles");return o=!1,(r||e||f||u)&&(y(),o=!0),o}function bt(){i.placeElement(u,0,t.carousel_padding),it()}function kt(){"left"==t.carousel_autoplay_direction?r.scrollRight(1):r.scrollLeft(1)}function dt(t){return 1==n.touchActive?!0:(n.touchActive=!0,r.pauseAutoplay(),n.startTime=jQuery.now(),n.startMousePos=b(t),n.startInnerPos=a(),n.lastTime=n.startTime,n.lastMousePos=n.startMousePos,void i.storeEventData(t,n.storedEventID))}function gt(r){var e;if(0==n.touchActive||(i.updateStoredEventData(r,n.storedEventID),r.preventDefault(),e=null,1==t.carousel_vertical_scroll_ondrag&&(e=i.handleScrollTop(n.storedEventID)),"vert"===e))return!0;n.lastMousePos=b(r);var o=n.lastMousePos-n.startMousePos,f=n.startInnerPos+o,s=o>0?"prev":"next",h=i.getElementSize(u).width;f>0&&"prev"==s&&(f/=3),-h>f&&"next"==s&&(f=n.startInnerPos+o/3),yt(f)}function ni(){return 0==n.touchActive?!0:(n.touchActive=!1,wt(),void r.unpauseAutoplay())}function ti(){return 0==t.carousel_autoplay_pause_onhover?!0:void(1==n.isPlayMode&&0==n.isPaused&&r.pauseAutoplay())}function ii(){return 0==t.carousel_autoplay_pause_onhover?!0:void r.unpauseAutoplay()}function ri(){f.initEvents(),e.bind("mousedown touchstart",dt),jQuery("body").bind("mousemove touchmove",gt),jQuery(window).add("body").bind("mouseup touchend",ni),e.hover(ti,ii)}function ui(){var t=n.lastTime-n.startTime,i=Math.abs(n.lastMousePos-n.startMousePos);return t>300?!1:i>30?!1:!0}var fi,h,rt,e,u,r=this,o=jQuery(this),p=new UniteGalleryMain,i=new UGFunctions,f=new UGTileDesign,ut=new UGThumbsGeneral,t={carousel_padding:8,carousel_space_between_tiles:20,carousel_navigation_numtiles:3,carousel_scroll_duration:500,carousel_scroll_easing:"easeOutCubic",carousel_autoplay:!0,carousel_autoplay_timeout:3e3,carousel_autoplay_direction:"right",carousel_autoplay_pause_onhover:!0,carousel_vertical_scroll_ondrag:!1},n;this.events={START_PLAY:"carousel_start_play",PAUSE_PLAY:"carousel_pause_play",STOP_PLAY:"carousel_stop_play"},n={eventSizeChange:"thumb_size_change",isFirstTimeRun:!0,carouselMaxWidth:null,tileWidth:0,initTileWidth:0,initTileHeight:0,sideSpace:1500,spaceActionSize:500,numCurrent:0,touchActive:!1,startInnerPos:0,lastTime:0,startTime:0,startMousePos:0,lastMousePos:0,scrollShortDuration:200,scrollShortEasing:"easeOutQuad",handle:null,isPlayMode:!1,isPaused:!1,storedEventID:"carousel"},this.startAutoplay=function(){n.isPlayMode=!0,n.isPaused=!1,o.trigger(r.events.START_PLAY),n.handle&&clearInterval(n.handle),n.handle=setInterval(kt,t.carousel_autoplay_timeout)},this.unpauseAutoplay=function(){return 0==n.isPlayMode?!0:0==n.isPaused?!0:void r.startAutoplay()},this.pauseAutoplay=function(){return 0==n.isPlayMode?!0:(n.isPaused=!0,n.handle&&clearInterval(n.handle),void o.trigger(r.events.PAUSE_PLAY))},this.stopAutoplay=function(){return 0==n.isPlayMode?!0:(n.isPaused=!1,n.isPlayMode=!1,n.handle&&clearInterval(n.handle),void o.trigger(r.events.STOP_PLAY))},this.destroy=function(){n.handle&&clearInterval(n.handle),o.off(r.events.START_PLAY),o.off(r.events.STOP_PLAY),e.unbind("mousedown"),e.unbind("touchstart"),jQuery("body").unbind("mousemove"),jQuery("body").unbind("touchmove"),jQuery(window).add("body").unbind("mouseup").unbind("touchend"),e.off("mouseenter").off("mouseleave"),f.destroy()},this.init=function(n,t,i){i&&this.setMaxWidth(i),ft(n,t)},this.setMaxWidth=function(t){n.carouselMaxWidth=t},this.setHtml=function(n){et(n)},this.getElement=function(){return e},this.getObjTileDesign=function(){return f},this.getEstimatedHeight=function(){return t.tile_height+2*t.carousel_padding},this.run=function(){ot()},this.scrollRight=function(i){var i,u,r;i&&"object"!=typeof i||(i=t.carousel_navigation_numtiles),u=d(),i>u&&(i=u),r=n.numCurrent-i,0>=r&&(r=0),l(r)},this.scrollLeft=function(i){var i,u,f,r;i&&"object"!=typeof i||(i=t.carousel_navigation_numtiles),u=d(),i>u&&(i=u),f=k(),r=n.numCurrent+i,r>=f&&(r=f-1),l(r)},this.setScrollLeftButton=function(n){i.setButtonMobileReady(n),i.setButtonOnClick(n,r.scrollLeft)},this.setScrollRightButton=function(n){i.setButtonMobileReady(n),i.setButtonOnClick(n,r.scrollRight)},this.setPlayPauseButton=function(t){i.setButtonMobileReady(t),1==n.isPlayMode&&0==n.isPaused&&t.addClass("ug-pause-icon"),o.on(r.events.START_PLAY,function(){t.addClass("ug-pause-icon")}),o.on(r.events.STOP_PLAY,function(){t.removeClass("ug-pause-icon")}),i.setButtonOnClick(t,function(){0==n.isPlayMode||1==n.isPaused?r.startAutoplay():r.stopAutoplay()})}}function UGTabs(){function f(u,f){r=u,c=jQuery(r),n=jQuery.extend(n,f),"select"==n.tabs_type?i=jQuery(n.tabs_container):t=jQuery(n.tabs_container+" .ug-tab")}function e(){h()}function u(n){r.requestNewItems(n)}function o(){var r=n.tabs_class_selected,i=jQuery(this),f;return i.hasClass(r)?!0:(t.not(i).removeClass(r),i.addClass(r),f=i.data("catid"),f?void u(f):!0)}function s(){var t=jQuery(this),n=t.val();return n?void u(n):!0}function h(){"select"==n.tabs_type?i.change(s):t.click(o)}var c,t,i,r=(jQuery(this),new UniteGalleryMain),n=(new UGFunctions,{tabs_type:"tabs",tabs_container:"#ug_tabs",tabs_class_selected:"ug-tab-selected"});this.events={},this.destroy=function(){i&&i.off("change"),t&&t.off("click")},this.init=function(n,t){f(n,t)},this.run=function(){e()}}function UG_API(n){function u(n){var i={index:n.index,title:n.title,description:n.description,urlImage:n.urlImage,urlThumb:n.urlThumb},r=n.objThumbImage.data(),t;for(t in r){switch(t){case"image":case"description":continue}i[t]=r[t]}return i}var i,r=this,t=(jQuery(r),new UniteGalleryMain),f=[];t=n,i=jQuery(n),this.events={API_INIT_FUNCTIONS:"api_init",API_ON_EVENT:"api_on_event"},this.on=function(n,e,o){switch(o!==!0&&f.push({event:n,func:e}),n){case"item_change":i.on(t.events.ITEM_CHANGE,function(){var i=t.getSelectedItem(),n=u(i);e(n.index,n)});break;case"resize":i.on(t.events.SIZE_CHANGE,e);break;case"enter_fullscreen":i.on(t.events.ENTER_FULLSCREEN,e);break;case"exit_fullscreen":i.on(t.events.EXIT_FULLSCREEN,e);break;case"play":i.on(t.events.START_PLAY,e);break;case"stop":i.on(t.events.STOP_PLAY,e);break;case"pause":i.on(t.events.PAUSE_PLAYING,e);break;case"continue":i.on(t.events.CONTINUE_PLAYING,e);break;case"open_lightbox":i.on(t.events.OPEN_LIGHTBOX,e);break;case"close_lightbox":i.on(t.events.CLOSE_LIGHTBOX,e);break;default:console&&console.log("wrong api event: "+n)}i.trigger(r.events.API_ON_EVENT,[n,e])},this.play=function(){t.startPlayMode()},this.stop=function(){t.stopPlayMode()},this.togglePlay=function(){t.togglePlayMode()},this.enterFullscreen=function(){t.toFullScreen()},this.exitFullscreen=function(){t.exitFullScreen()},this.toggleFullscreen=function(){t.toggleFullscreen()},this.resetZoom=function(){var n=t.getObjSlider();return n?void n.zoomBack():!1},this.zoomIn=function(){var n=t.getObjSlider();return n?void n.zoomIn():!1},this.zoomOut=function(){var n=t.getObjSlider();return n?void n.zoomOut():!1},this.nextItem=function(){t.nextItem()},this.prevItem=function(){t.prevItem()},this.selectItem=function(n){t.selectItem(n)},this.resize=function(n,i){i?t.resize(n,i):t.resize(n)},this.getItem=function(n){var i=t.getItem(n);return u(i)},this.getNumItems=function(){return t.getNumItems()},this.reloadGallery=function(n){if(!n)var n={};t.run(null,n),f.map(function(n){r.on(n.event,n.func,!0)})},this.destroy=function(){t.destroy()},i.trigger(r.events.API_INIT_FUNCTIONS,r)}function UGTheme_compact(){function b(f,s){i=f,n=jQuery.extend(n,s),k(s),i.setOptions(n),n.theme_load_panel==!0?(t.init(f,n),t.setOrientation(n.theme_panel_position)):t=null,n.theme_load_slider==!0&&i.initSlider(n),e=f.getObjects(),u=jQuery(f),o=e.g_objWrapper,n.theme_load_slider==!0&&(r=e.g_objSlider)}function k(t){if(n=jQuery.extend(n,a),n.theme_load_panel==!0)switch(n.theme_panel_position){case"left":case"right":f.isVertical=!0,n.strippanel_vertical_type=!0}switch(n.theme_panel_position){case"left":n=jQuery.extend(n,v);break;case"right":n=jQuery.extend(n,y);break;case"top":n=jQuery.extend(n,w);break;case"bottom":n=jQuery.extend(n,p)}n=jQuery.extend(n,t)}function h(){t&&(nt(),tt()),r&&(r.run(),c())}function d(){g(),h(),et()}function g(){o.addClass("ug-theme-grid"),t&&t.setHtml(),r&&r.setHtml()}function nt(){var n=i.getSize();f.isVertical==!1?t.setWidth(n.width):t.setHeight(n.height),t.run()}function tt(){var h=l(),c=t.isPanelClosed(),e=t.getElement(),i="bottom",r="left",u=h||c,f,o;u?(f=t.getClosedPanelDest(),o=s.getElementRelativePos(e,n.theme_panel_position),t.setClosedState(o)):t.setOpenedState();switch(n.theme_panel_position){case"right":case"left":r=n.theme_panel_position,u&&(r=f);break;case"top":case"bottom":i=n.theme_panel_position,u&&(i=f);break;default:throw new Error("Wrong panel position: "+n.theme_panel_position);}s.placeElement(e,r,i,0,0)}function c(){var u=s.getElementSize(o),f=u.width,e=u.height,h=0,c=0,i;if(t){i=t.getSize();switch(n.theme_panel_position){case"left":c=i.right,f=u.width-i.right;break;case"right":f=i.left;break;case"top":e=u.height-i.bottom,h=i.bottom;break;case"bottom":e=i.top}}r.setSize(f,e),r.setPosition(c,h)}function l(){if(!n.theme_hide_panel_under_width)return!1;var t=jQuery(window).width(),i=n.theme_hide_panel_under_width;return t<=i?!0:!1}function it(){if(!n.theme_hide_panel_under_width)return!1;var i=l();i==!0?(t.closePanel(!0),f.isMobileModeWasEnabled=!0):f.isMobileModeWasEnabled==!0&&(t.openPanel(!0),f.isMobileModeWasEnabled=!1)}function rt(){h(),t&&it()}function ut(){c()}function ft(){i.showDisabledOverlay()}function et(){u.on(i.events.SIZE_CHANGE,rt);u.on(i.events.GALLERY_BEFORE_REQUEST_ITEMS,ft);if(t)jQuery(t).on(t.events.FINISH_MOVE,ut)}var ot=this,i=new UniteGalleryMain,u,e,o,r,s=new UGFunctions,t=new UGStripPanel,n={theme_load_slider:!0,theme_load_panel:!0,theme_panel_position:"bottom",theme_hide_panel_under_width:480},a={slider_controls_always_on:!0,slider_enable_text_panel:!1,slider_vertical_scroll_ondrag:!0,strippanel_enable_buttons:!1},v={slider_enable_text_panel:!0,slider_zoompanel_align_hor:"right",slider_fullscreen_button_align_hor:"right",slider_play_button_align_hor:"right",slider_zoompanel_offset_vert:9,slider_zoompanel_offset_hor:11,slider_play_button_offset_hor:88,slider_play_button_offset_vert:8,slider_fullscreen_button_offset_hor:52,slider_fullscreen_button_offset_vert:9,slider_progress_indicator_align_hor:"right",slider_progress_indicator_offset_vert:36,slider_progress_indicator_offset_hor:63},y={slider_enable_text_panel:!0,slider_zoompanel_offset_vert:9,slider_zoompanel_offset_hor:11,slider_play_button_offset_hor:88,slider_play_button_offset_vert:8,slider_fullscreen_button_offset_hor:52,slider_fullscreen_button_offset_vert:9,slider_progress_indicator_align_hor:"left",slider_progress_indicator_offset_vert:36,slider_progress_indicator_offset_hor:63},p={slider_zoompanel_align_hor:"right",slider_zoompanel_offset_vert:10,slider_progress_indicator_align_hor:"left",slider_progress_indicator_offset_vert:36,slider_progress_indicator_offset_hor:16},w={slider_zoompanel_align_vert:"bottom",slider_zoompanel_offset_vert:10,slider_play_button_align_hor:"right",slider_play_button_align_vert:"bottom",slider_fullscreen_button_align_vert:"bottom",slider_fullscreen_button_align_hor:"right",slider_progress_indicator_align_vert:"bottom",slider_progress_indicator_offset_vert:40},f={isVertical:!1,isMobileModeWasEnabled:!1};this.destroy=function(){u.off(i.events.SIZE_CHANGE),u.off(i.events.GALLERY_BEFORE_REQUEST_ITEMS),t&&jQuery(t).off(t.events.FINISH_MOVE),t.destroy(),r.destroy()},this.run=function(){d()},this.init=function(n,t){b(n,t)}}function UGTheme_tiles(){function v(r,s){f=r,n=jQuery.extend(n,a),n=jQuery.extend(n,s),y(),f.setOptions(n),f.setFreestyleMode(),c=r.getObjects(),o=jQuery(r),t=c.g_objWrapper,u.init(r,n),i.init(r,n),e=u.getObjTileDesign()}function y(){n.theme_enable_preloader==!0&&(h.showPreloader=!0);switch(n.theme_appearance_order){case"shuffle":f.shuffleItems();break;case"keep":n.tiles_keep_order=!0}}function p(){t.addClass("ug-theme-tiles"),t.append("<div class='ug-tiles-wrapper' style='position:relative'><\/div>"),h.showPreloader==!0&&(t.append("<div class='ug-tiles-preloader ug-preloader-trans'><\/div>"),r=t.children(".ug-tiles-preloader"),r.fadeTo(0,0)),s=t.children(".ug-tiles-wrapper"),n.theme_gallery_padding&&t.css({"padding-left":n.theme_gallery_padding+"px","padding-right":n.theme_gallery_padding+"px"}),u.setHtml(s),i.putHtml()}function w(){r&&(r.fadeTo(0,1),t.height(n.theme_preloading_height),l.placeElement(r,"center",n.theme_preloader_vertpos)),nt(),u.run(),i.run()}function b(){p(),w()}function k(n,t){t=jQuery(t);var r=e.getItemByTile(t),u=r.index;i.open(u)}function d(){if(s.hide(),r){r.show();var n=l.getElementSize(r),i=n.bottom+30;t.height(i)}}function g(){n.theme_auto_open!==null&&(i.open(n.theme_auto_open),n.theme_auto_open=null)}function nt(){if(r)jQuery(u).on(u.events.TILES_FIRST_PLACED,function(){t.height("auto"),r.hide()});jQuery(e).on(e.events.TILE_CLICK,k);o.on(f.events.GALLERY_BEFORE_REQUEST_ITEMS,d);jQuery(i).on(i.events.LIGHTBOX_INIT,g)}var tt=this,f=new UniteGalleryMain,o,c,t,u=new UGTiles,i=new UGLightbox,r,s,l=new UGFunctions,e=new UGTileDesign,n={theme_enable_preloader:!0,theme_preloading_height:200,theme_preloader_vertpos:100,theme_gallery_padding:0,theme_appearance_order:"normal",theme_auto_open:null},a={gallery_width:"100%"},h={showPreloader:!1};this.destroy=function(){jQuery(e).off(e.events.TILE_CLICK),jQuery(u).off(u.events.TILES_FIRST_PLACED),o.off(f.events.GALLERY_BEFORE_REQUEST_ITEMS),jQuery(i).off(i.events.LIGHTBOX_INIT),u.destroy(),i.destroy()},this.run=function(){b()},this.init=function(n,t){v(n,t)}}function UGTheme_slider(){function s(){f.addClass("ug-theme-slider"),t&&t.setHtml()}function e(){var i=n.getHeight(),r=n.getWidth();t.setSize(r,i),t.setPosition(0,0)}function h(){e()}function c(){u.on(n.events.SIZE_CHANGE,h)}function l(){e(),t.run()}var a=this,n=new UniteGalleryMain,u,r,f,v,t,y=new UGFunctions,i={},o={gallery_autoplay:!0,slider_scale_mode:"fill",slider_controls_always_on:!0,slider_enable_text_panel:!1,slider_controls_appear_ontap:!0,slider_enable_bullets:!0,slider_enable_arrows:!0,slider_enable_play_button:!1,slider_enable_fullscreen_button:!1,slider_enable_zoom_panel:!1,slider_vertical_scroll_ondrag:!0};this.init=function(e,s){n=e,i=jQuery.extend(i,o),i=jQuery.extend(i,s),n.setOptions(i),n.initSlider(i),r=e.getObjects(),u=jQuery(e),f=r.g_objWrapper,t=r.g_objSlider},this.run=function(){s(),l(),c()}}function UGTheme_carousel(){function k(i,r){f=i,n=jQuery.extend(n,b),n=jQuery.extend(n,r),f.setOptions(n),f.setFreestyleMode(),v=i.getObjects(),e=jQuery(i),u=v.g_objWrapper,h.init(i,n),t.init(i,n),o=t.getObjTileDesign()}function d(){if(u.addClass("ug-theme-carousel"),t.setHtml(u),n.theme_enable_navigation==!0){var r="<div class='ug-tile-navigation-wrapper' style='position:absolute'>";r+="<div class='ug-button-tile-navigation ug-button-tile-left'><\/div>",n.theme_navigation_enable_play==!0&&(r+="<div class='ug-button-tile-navigation ug-button-tile-play'><\/div>"),r+="<div class='ug-button-tile-navigation ug-button-tile-right'><\/div>",r+="<\/div>",u.append(r),i=u.children(".ug-tile-navigation-wrapper"),c=i.children(".ug-button-tile-left"),a=i.children(".ug-button-tile-right"),c.css("margin-right",n.theme_space_between_arrows+"px"),n.theme_navigation_enable_play==!0&&(s=i.children(".ug-button-tile-play"),s.css("margin-right",n.theme_space_between_arrows+"px"))}h.putHtml(),u.append("<div class='ug-tiles-preloader ug-preloader-trans'><\/div>"),l=u.children(".ug-tiles-preloader"),l.fadeTo(0,0)}function y(){var t=f.getSize().width;return t-=n.theme_gallery_padding*2}function g(){var r=t.getEstimatedHeight(),u;return i&&(u=i.height(),r+=u+n.theme_navigation_margin),r}function nt(){var i=g(),n;u.height(i),n=y(),et(),t.setMaxWidth(n),t.run(),h.run(),p()}function tt(){d(),nt()}function p(){var f=t.getElement(),e=r.getElementSize(f),o=0,s,h,c,a,v;i&&(s=r.getElementSize(i),o=s.height),h=e.height,o>0&&(h+=n.theme_navigation_margin+o),c=0,i&&(a=e.height+n.theme_navigation_margin,n.theme_navigation_position=="top"&&(c=s.height+n.theme_navigation_margin,a=0)),r.placeElement(f,n.theme_carousel_align,c,n.theme_carousel_offset,0),e=r.getElementSize(f),i&&(v=e.left+r.getElementRelativePos(i,n.theme_navigation_align,n.theme_navigation_offset_hor,f),r.placeElement(i,v,a)),u.height(h),r.placeElement(l,"center",50)}function it(n,t){t=jQuery(t);var i=o.getItemByTile(t),r=i.index;h.open(r)}function rt(){var n=y();t.setMaxWidth(n),t.run(),p()}function ut(){t.stopAutoplay(),t.getElement().hide(),i&&i.hide(),l.fadeTo(0,1)}function ft(n,i){i.carouselStartAutoplay=function(){t.startAutoplay()},i.carouselStopAutoplay=function(){t.stopAutoplay()},i.carouselPause=function(){t.pauseAutoplay()},i.carouselUnpause=function(){t.unpauseAutoplay()},i.scrollLeft=function(n){t.scrollLeft(n)},i.scrollRight=function(n){t.scrollRight(n)}}function et(){i&&(t.setScrollLeftButton(a),t.setScrollRightButton(c),s&&t.setPlayPauseButton(s));e.on(f.events.SIZE_CHANGE,rt);e.on(f.events.GALLERY_BEFORE_REQUEST_ITEMS,ut);jQuery(o).on(o.events.TILE_CLICK,it);e.on(w.events.API_INIT_FUNCTIONS,ft)}var ot=this,f=new UniteGalleryMain,e,v,u,h=new UGLightbox,t=new UGCarousel,r=new UGFunctions,o=new UGTileDesign,i,c,a,s,l,w=new UG_API,n={theme_gallery_padding:0,theme_carousel_align:"center",theme_carousel_offset:0,theme_enable_navigation:!0,theme_navigation_position:"bottom",theme_navigation_enable_play:!0,theme_navigation_align:"center",theme_navigation_offset_hor:0,theme_navigation_margin:20,theme_space_between_arrows:5},b={gallery_width:"100%",tile_width:160,tile_height:160,tile_enable_border:!0,tile_enable_outline:!0,carousel_vertical_scroll_ondrag:!0},st={};this.destroy=function(){i&&(r.destroyButton(a),r.destroyButton(c),s&&r.destroyButton(s)),e.off(f.events.SIZE_CHANGE),jQuery(o).off(o.events.TILE_CLICK),e.off(f.events.GALLERY_BEFORE_REQUEST_ITEMS),t.destroy(),h.destroy()},this.run=function(){tt()},this.init=function(n,t){k(n,t)}}var g_ugFunctions=new UGFunctions;!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof exports?module.exports=n:n(jQuery)}(function(n){function u(i){var r=i||window.event,y=c.call(arguments,1),s=0,e=0,u=0,l=0,a,v;if(i=n.event.fix(r),i.type="mousewheel","detail"in r&&(u=-1*r.detail),"wheelDelta"in r&&(u=r.wheelDelta),"wheelDeltaY"in r&&(u=r.wheelDeltaY),"wheelDeltaX"in r&&(e=-1*r.wheelDeltaX),"axis"in r&&r.axis===r.HORIZONTAL_AXIS&&(e=-1*u,u=0),s=0===u?e:u,"deltaY"in r&&(u=-1*r.deltaY,s=u),"deltaX"in r&&(e=r.deltaX,0===u&&(s=-1*e)),0!==u||0!==e)return 1===r.deltaMode?(a=n.data(this,"mousewheel-line-height"),s*=a,u*=a,e*=a):2===r.deltaMode&&(v=n.data(this,"mousewheel-page-height"),s*=v,u*=v,e*=v),l=Math.max(Math.abs(u),Math.abs(e)),(!t||t>l)&&(t=l,o(r,l)&&(t/=40)),o(r,l)&&(s/=40,e/=40,u/=40),s=Math[s>=1?"floor":"ceil"](s/t),e=Math[e>=1?"floor":"ceil"](e/t),u=Math[u>=1?"floor":"ceil"](u/t),i.deltaX=e,i.deltaY=u,i.deltaFactor=t,i.deltaMode=0,y.unshift(i,s,e,u),f&&clearTimeout(f),f=setTimeout(h,200),(n.event.dispatch||n.event.handle).apply(this,y)}function h(){t=null}function o(n,t){return r.settings.adjustOldDeltas&&"mousewheel"===n.type&&t%120==0}var f,t,s=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],i="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],c=Array.prototype.slice,e,r;if(n.event.fixHooks)for(e=s.length;e;)n.event.fixHooks[s[--e]]=n.event.mouseHooks;r=n.event.special.mousewheel={version:"3.1.9",setup:function(){if(this.addEventListener)for(var t=i.length;t;)this.addEventListener(i[--t],u,!1);else this.onmousewheel=u;n.data(this,"mousewheel-line-height",r.getLineHeight(this)),n.data(this,"mousewheel-page-height",r.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var n=i.length;n;)this.removeEventListener(i[--n],u,!1);else this.onmousewheel=null},getLineHeight:function(t){return parseInt(n(t)["offsetParent"in n.fn?"offsetParent":"parent"]().css("fontSize"),10)},getPageHeight:function(t){return n(t).height()},settings:{adjustOldDeltas:!0}},n.fn.extend({mousewheel:function(n){return n?this.bind("mousewheel",n):this.trigger("mousewheel")},unmousewheel:function(n){return this.unbind("mousewheel",n)}})}),jQuery.easing.jswing=jQuery.easing.swing,jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(n,t,i,r,u){return jQuery.easing[jQuery.easing.def](n,t,i,r,u)},easeInQuad:function(n,t,i,r,u){return r*(t/=u)*t+i},easeOutQuad:function(n,t,i,r,u){return-r*(t/=u)*(t-2)+i},easeInOutQuad:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t+i:-r/2*(--t*(t-2)-1)+i},easeInCubic:function(n,t,i,r,u){return r*(t/=u)*t*t+i},easeOutCubic:function(n,t,i,r,u){return r*((t=t/u-1)*t*t+1)+i},easeInOutCubic:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t*t+i:r/2*((t-=2)*t*t+2)+i},easeInQuart:function(n,t,i,r,u){return r*(t/=u)*t*t*t+i},easeOutQuart:function(n,t,i,r,u){return-r*((t=t/u-1)*t*t*t-1)+i},easeInOutQuart:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t*t*t+i:-r/2*((t-=2)*t*t*t-2)+i},easeInQuint:function(n,t,i,r,u){return r*(t/=u)*t*t*t*t+i},easeOutQuint:function(n,t,i,r,u){return r*((t=t/u-1)*t*t*t*t+1)+i},easeInOutQuint:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t*t*t*t+i:r/2*((t-=2)*t*t*t*t+2)+i},easeInSine:function(n,t,i,r,u){return-r*Math.cos(t/u*(Math.PI/2))+r+i},easeOutSine:function(n,t,i,r,u){return r*Math.sin(t/u*(Math.PI/2))+i},easeInOutSine:function(n,t,i,r,u){return-r/2*(Math.cos(Math.PI*t/u)-1)+i},easeInExpo:function(n,t,i,r,u){return 0==t?i:r*Math.pow(2,10*(t/u-1))+i},easeOutExpo:function(n,t,i,r,u){return t==u?i+r:r*(-Math.pow(2,-10*t/u)+1)+i},easeInOutExpo:function(n,t,i,r,u){return 0==t?i:t==u?i+r:(t/=u/2)<1?r/2*Math.pow(2,10*(t-1))+i:r/2*(-Math.pow(2,-10*--t)+2)+i},easeInCirc:function(n,t,i,r,u){return-r*(Math.sqrt(1-(t/=u)*t)-1)+i},easeOutCirc:function(n,t,i,r,u){return r*Math.sqrt(1-(t=t/u-1)*t)+i},easeInOutCirc:function(n,t,i,r,u){return(t/=u/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+i:r/2*(Math.sqrt(1-(t-=2)*t)+1)+i},easeInElastic:function(n,t,i,r,u){var o=1.70158,f=0,e=r;return 0==t?i:1==(t/=u)?i+r:((f||(f=.3*u),e<Math.abs(r))?(e=r,o=f/4):o=f/(2*Math.PI)*Math.asin(r/e),-(e*Math.pow(2,10*(t-=1))*Math.sin(2*(t*u-o)*Math.PI/f))+i)},easeOutElastic:function(n,t,i,r,u){var o=1.70158,f=0,e=r;return 0==t?i:1==(t/=u)?i+r:((f||(f=.3*u),e<Math.abs(r))?(e=r,o=f/4):o=f/(2*Math.PI)*Math.asin(r/e),e*Math.pow(2,-10*t)*Math.sin(2*(t*u-o)*Math.PI/f)+r+i)},easeInOutElastic:function(n,t,i,r,u){var o=1.70158,f=0,e=r;return 0==t?i:2==(t/=u/2)?i+r:((f||(f=.3*u*1.5),e<Math.abs(r))?(e=r,o=f/4):o=f/(2*Math.PI)*Math.asin(r/e),1>t?-.5*e*Math.pow(2,10*(t-=1))*Math.sin(2*(t*u-o)*Math.PI/f)+i:e*Math.pow(2,-10*(t-=1))*Math.sin(2*(t*u-o)*Math.PI/f)*.5+r+i)},easeInBack:function(n,t,i,r,u,f){return void 0==f&&(f=1.70158),r*(t/=u)*t*((f+1)*t-f)+i},easeOutBack:function(n,t,i,r,u,f){return void 0==f&&(f=1.70158),r*((t=t/u-1)*t*((f+1)*t+f)+1)+i},easeInOutBack:function(n,t,i,r,u,f){return void 0==f&&(f=1.70158),(t/=u/2)<1?r/2*t*t*(((f*=1.525)+1)*t-f)+i:r/2*((t-=2)*t*(((f*=1.525)+1)*t+f)+2)+i},easeInBounce:function(n,t,i,r,u){return r-jQuery.easing.easeOutBounce(n,u-t,0,r,u)+i},easeOutBounce:function(n,t,i,r,u){return(t/=u)<1/2.75?7.5625*r*t*t+i:2/2.75>t?r*(7.5625*(t-=1.5/2.75)*t+.75)+i:2.5/2.75>t?r*(7.5625*(t-=2.25/2.75)*t+.9375)+i:r*(7.5625*(t-=2.625/2.75)*t+.984375)+i},easeInOutBounce:function(n,t,i,r,u){return u/2>t?.5*jQuery.easing.easeInBounce(n,2*t,0,r,u)+i:.5*jQuery.easing.easeOutBounce(n,2*t-u,0,r,u)+.5*r+i}}),!function(n,t){function f(n,t,i){var r=h[t.type]||{};return null==n?i||!t.def?null:t.def:(n=r.floor?~~n:parseFloat(n),isNaN(n)?t.def:r.mod?(n+r.mod)%r.mod:0>n?0:r.max<n?r.max:n)}function s(t){var f=i(),o=f._rgba=[];return t=t.toLowerCase(),r(y,function(n,i){var r,s=i.re.exec(t),h=s&&i.parse(s),e=i.space||"rgba";if(h)return r=f[e](h),f[u[e].cache]=r[u[e].cache],o=f._rgba=r._rgba,!1}),o.length?("0,0,0,0"===o.join()&&n.extend(o,e.transparent),f):e[t]}function o(n,t,i){return i=(i+1)%1,1>6*i?n+(t-n)*i*6:1>2*i?t:2>3*i?n+(t-n)*(2/3-i)*6:n}if("undefined"==typeof n.cssHooks)return!1;var e,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",v=/^([\-+])=\s*(\d+\.?\d*)/,y=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(n){return[n[1],n[2],n[3],n[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(n){return[2.55*n[1],2.55*n[2],2.55*n[3],n[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(n){return[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(n){return[parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(n){return[n[1],n[2]/100,n[3]/100,n[4]]}}],i=n.Color=function(t,i,r,u){return new n.Color.fn.parse(t,i,r,u)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},h={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=i.support={},l=n("<p>")[0],r=n.each;l.style.cssText="background-color:rgba(1,1,1,.5)",c.rgba=l.style.backgroundColor.indexOf("rgba")>-1,r(u,function(n,t){t.cache="_"+n,t.props.alpha={idx:3,type:"percent",def:1}}),i.fn=n.extend(i.prototype,{parse:function(o,h,c,l){if(o===t)return this._rgba=[null,null,null,null],this;(o.jquery||o.nodeType)&&(o=n(o).css(h),h=t);var a=this,v=n.type(o),y=this._rgba=[];return h!==t&&(o=[o,h,c,l],v="array"),"string"===v?this.parse(s(o)||e._default):"array"===v?(r(u.rgba.props,function(n,t){y[t.idx]=f(o[t.idx],t)}),this):"object"===v?(o instanceof i?r(u,function(n,t){o[t.cache]&&(a[t.cache]=o[t.cache].slice())}):r(u,function(t,i){var u=i.cache;r(i.props,function(n,t){if(!a[u]&&i.to){if("alpha"===n||null==o[n])return;a[u]=i.to(a._rgba)}a[u][t.idx]=f(o[n],t,!0)}),a[u]&&n.inArray(null,a[u].slice(0,3))<0&&(a[u][3]=1,i.from&&(a._rgba=i.from(a[u])))}),this):void 0},is:function(n){var e=i(n),t=!0,f=this;return r(u,function(n,i){var o,u=e[i.cache];return u&&(o=f[i.cache]||i.to&&i.to(f._rgba)||[],r(i.props,function(n,i){if(null!=u[i.idx])return t=u[i.idx]===o[i.idx]})),t}),t},_space:function(){var n=[],t=this;return r(u,function(i,r){t[r.cache]&&n.push(i)}),n.pop()},transition:function(n,t){var e=i(n),c=e._space(),o=u[c],l=0===this.alpha()?i("transparent"):this,a=l[o.cache]||o.to(l._rgba),s=a.slice();return e=e[o.cache],r(o.props,function(n,i){var c=i.idx,r=a[c],u=e[c],o=h[i.type]||{};null!==u&&(null===r?s[c]=u:(o.mod&&(u-r>o.mod/2?r+=o.mod:r-u>o.mod/2&&(r-=o.mod)),s[c]=f((u-r)*t+r,i)))}),this[c](s)},blend:function(t){if(1===this._rgba[3])return this;var r=this._rgba.slice(),u=r.pop(),f=i(t)._rgba;return i(n.map(r,function(n,t){return(1-u)*f[t]+u*n}))},toRgbaString:function(){var i="rgba(",t=n.map(this._rgba,function(n,t){return null==n?t>2?1:0:n});return 1===t[3]&&(t.pop(),i="rgb("),i+t.join()+")"},toHslaString:function(){var i="hsla(",t=n.map(this.hsla(),function(n,t){return null==n&&(n=t>2?1:0),t&&3>t&&(n=Math.round(100*n)+"%"),n});return 1===t[3]&&(t.pop(),i="hsl("),i+t.join()+")"},toHexString:function(t){var i=this._rgba.slice(),r=i.pop();return t&&i.push(~~(255*r)),"#"+n.map(i,function(n){return n=(n||0).toString(16),1===n.length?"0"+n:n}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),i.fn.parse.prototype=i.fn,u.hsla.to=function(n){if(null==n[0]||null==n[1]||null==n[2])return[null,null,null,n[3]];var s,h,i=n[0]/255,r=n[1]/255,f=n[2]/255,c=n[3],u=Math.max(i,r,f),e=Math.min(i,r,f),t=u-e,o=u+e,l=.5*o;return s=e===u?0:i===u?60*(r-f)/t+360:r===u?60*(f-i)/t+120:60*(i-r)/t+240,h=0===t?0:.5>=l?t/o:t/(2-o),[Math.round(s)%360,h,l,null==c?1:c]},u.hsla.from=function(n){if(null==n[0]||null==n[1]||null==n[2])return[null,null,null,n[3]];var r=n[0]/360,u=n[1],t=n[2],e=n[3],i=.5>=t?t*(1+u):t+u-t*u,f=2*t-i;return[Math.round(255*o(f,i,r+1/3)),Math.round(255*o(f,i,r)),Math.round(255*o(f,i,r-1/3)),e]},r(u,function(u,e){var s=e.props,o=e.cache,h=e.to,c=e.from;i.fn[u]=function(u){if(h&&!this[o]&&(this[o]=h(this._rgba)),u===t)return this[o].slice();var l,a=n.type(u),v="array"===a||"object"===a?u:arguments,e=this[o].slice();return r(s,function(n,t){var i=v["object"===a?n:t.idx];null==i&&(i=e[t.idx]),e[t.idx]=f(i,t)}),c?(l=i(c(e)),l[o]=e,l):i(e)},r(s,function(t,r){i.fn[t]||(i.fn[t]=function(i){var f,e=n.type(i),h="alpha"===t?this._hsla?"hsla":"rgba":u,o=this[h](),s=o[r.idx];return"undefined"===e?s:("function"===e&&(i=i.call(this,s),e=n.type(i)),null==i&&r.empty?this:("string"===e&&(f=v.exec(i),f&&(i=s+parseFloat(f[2])*("+"===f[1]?1:-1))),o[r.idx]=i,this[h](o)))})})}),i.hook=function(t){var u=t.split(" ");r(u,function(t,r){n.cssHooks[r]={set:function(t,u){var o,f,e="";if("transparent"!==u&&("string"!==n.type(u)||(o=s(u)))){if(u=i(o||u),!c.rgba&&1!==u._rgba[3]){for(f="backgroundColor"===r?t.parentNode:t;(""===e||"transparent"===e)&&f&&f.style;)try{e=n.css(f,"backgroundColor"),f=f.parentNode}catch(h){}u=u.blend(e&&"transparent"!==e?e:"_default")}u=u.toRgbaString()}try{t.style[r]=u}catch(h){}}},n.fx.step[r]=function(t){t.colorInit||(t.start=i(t.elem,r),t.end=i(t.end),t.colorInit=!0),n.cssHooks[r].set(t.elem,t.start.transition(t.end,t.pos))}})},i.hook(a),n.cssHooks.borderColor={expand:function(n){var t={};return r(["Top","Right","Bottom","Left"],function(i,r){t["border"+r+"Color"]=n}),t}},e=n.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),!function(n){function t(){var i=this===document?n(this):n(this).contents();i.mousemove(function(t){n.mlp={x:t.pageX,y:t.pageY}}),i.find("iframe").load(t)}n.mlp={x:0,y:0},n(t),n.fn.ismouseover=function(){var t=!1;return this.eq(0).each(function(){var r=n(this).is("iframe")?n(this).contents().find("body"):n(this),i=r.offset();t=i.left<=n.mlp.x&&i.left+r.outerWidth()>n.mlp.x&&i.top<=n.mlp.y&&i.top+r.outerHeight()>n.mlp.y}),t}}(jQuery);var g_ugYoutubeAPI=new UGYoutubeAPI,g_ugVimeoAPI=new UGVimeoAPI,g_ugHtml5MediaAPI=new UGHtml5MediaAPI,g_ugSoundCloudAPI=new UGSoundCloudAPI,g_ugWistiaAPI=new UGWistiaAPI;jQuery.fn.unitegallery=function(n){var r=jQuery(this),u="#"+r.attr("id"),n,t,i;return n||(n={}),t=new UniteGalleryMain,t.run(u,n),i=new UG_API(t)},typeof g_ugFunctions!="undefined"?g_ugFunctions.registerTheme("compact"):jQuery(document).ready(function(){g_ugFunctions.registerTheme("compact")}),typeof g_ugFunctions!="undefined"?g_ugFunctions.registerTheme("tiles"):jQuery(document).ready(function(){g_ugFunctions.registerTheme("tiles")}),typeof g_ugFunctions!="undefined"?g_ugFunctions.registerTheme("slider"):jQuery(document).ready(function(){g_ugFunctions.registerTheme("slider")}),typeof g_ugFunctions!="undefined"?g_ugFunctions.registerTheme("carousel"):jQuery(document).ready(function(){g_ugFunctions.registerTheme("carousel")})