!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){"use strict";function b(a){if(a instanceof Date)return a;if(String(a).match(g))return String(a).match(/^[0-9]*$/)&&(a=Number(a)),String(a).match(/\-/)&&(a=String(a).replace(/\-/g,"/")),new Date(a);throw new Error("Couldn't cast `"+a+"` to a date object.")}function c(a){var b=a.toString().replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");return new RegExp(b)}function d(a){return function(b){var d=b.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi);if(d)for(var f=0,g=d.length;f1?c:d}var f=[],g=[],h={precision:100,elapse:!1,defer:!1};g.push(/^[0-9]*$/.source),g.push(/([0-9]{1,2}\/){2}[0-9]{4}([0-9]{1,2}(:[0-9]{2}){2})?/.source),g.push(/[0-9]{4}([\/\-][0-9]{1,2}){2}([0-9]{1,2}(:[0-9]{2}){2})?/.source),g=new RegExp(g.join("|"));var i={Y:"years",m:"months",n:"daysToMonth",d:"daysToWeek",w:"weeks",W:"weeksToMonth",H:"hours",M:"minutes",S:"seconds",D:"totalDays",I:"totalHours",N:"totalMinutes",T:"totalSeconds"},j=function(b,c,d){this.el=b,this.$el=a(b),this.interval=null,this.offset={},this.options=a.extend({},h),this.instanceNumber=f.length,f.push(this),this.$el.data("countdown-instance",this.instanceNumber),d&&("function"==typeof d?(this.$el.on("update.countdown",d),this.$el.on("stoped.countdown",d),this.$el.on("finish.countdown",d)):this.options=a.extend({},h,d)),this.setFinalDate(c),this.options.defer===!1&&this.start()};a.extend(j.prototype,{start:function(){null!==this.interval&&clearInterval(this.interval);var a=this;this.update(),this.interval=setInterval(function(){a.update.call(a)},this.options.precision)},stop:function(){clearInterval(this.interval),this.interval=null,this.dispatchEvent("stoped")},toggle:function(){this.interval?this.stop():this.start()},pause:function(){this.stop()},resume:function(){this.start()},remove:function(){this.stop.call(this),f[this.instanceNumber]=null,delete this.$el.data().countdownInstance},setFinalDate:function(a){this.finalDate=b(a)},update:function(){if(0===this.$el.closest("html").length)return void this.remove();var b,c=void 0!==a._data(this.el,"events"),d=new Date;b=this.finalDate.getTime()-d.getTime(),b=Math.ceil(b/1e3),b=!this.options.elapse&&b<0?0:Math.abs(b),this.totalSecsLeft!==b&&c&&(this.totalSecsLeft=b,this.elapsed=d>=this.finalDate,this.offset={seconds:this.totalSecsLeft%60,minutes:Math.floor(this.totalSecsLeft/60)%60,hours:Math.floor(this.totalSecsLeft/60/60)%24,days:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToWeek:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToMonth:Math.floor(this.totalSecsLeft/60/60/24%30.4368),weeks:Math.floor(this.totalSecsLeft/60/60/24/7),weeksToMonth:Math.floor(this.totalSecsLeft/60/60/24/7)%4,months:Math.floor(this.totalSecsLeft/60/60/24/30.4368),years:Math.abs(this.finalDate.getFullYear()-d.getFullYear()),totalDays:Math.floor(this.totalSecsLeft/60/60/24),totalHours:Math.floor(this.totalSecsLeft/60/60),totalMinutes:Math.floor(this.totalSecsLeft/60),totalSeconds:this.totalSecsLeft},this.options.elapse||0!==this.totalSecsLeft?this.dispatchEvent("update"):(this.stop(),this.dispatchEvent("finish")))},dispatchEvent:function(b){var c=a.Event(b+".countdown");c.finalDate=this.finalDate,c.elapsed=this.elapsed,c.offset=a.extend({},this.offset),c.strftime=d(this.offset),this.$el.trigger(c)}}),a.fn.countdown=function(){var b=Array.prototype.slice.call(arguments,0);return this.each(function(){var c=a(this).data("countdown-instance");if(void 0!==c){var d=f[c],e=b[0];j.prototype.hasOwnProperty(e)?d[e].apply(d,b.slice(1)):null===String(e).match(/^[$A-Z_][0-9A-Z_$]*$/i)?(d.setFinalDate.call(d,e),d.start()):a.error("Method %s does not exist on jQuery.countdown".replace(/\%s/gi,e))}else new j(this,b[0],b[1])})}}); jQuery(document).ready(function($){ var items=$('.w3-sj-slides'), heights=[], tallest; if(items.length){ function normalizeHeights(){ items.each(function(){ heights.push($(this).height()); }); tallest=Math.max.apply(null, heights); items.each(function(){ $(this).css('min-height',tallest + 'px'); }); }; normalizeHeights(); $(window).on('resize orientationchange', function (){ tallest=0, heights.length=0; items.each(function(){ $(this).css('min-height','0'); }); normalizeHeights(); }); } var totalItems=$('.w3-sj-items').length; var currentIndex=$('div.w3-sj-active').index(); $('.num').html(''+currentIndex+'/'+totalItems+''); $('.carouselExampleControls').on('click', function (){ currentIndex=$('div.w3-sj-active').index(); $('.num').html(''+currentIndex+'/'+totalItems+''); }); $('.sscw-countdown').each(function(){ var $countdown=$(this); $countdown.countdown($countdown.data('date'), function(event){ var htmlCounter=''; if(event.strftime('%-D')==0){ htmlCounter=event.strftime('%H
'+ sscw_params.text_hours +'
:%M
'+ sscw_params.text_mins +'
:%S
'+ sscw_params.text_secs +'
'); }else{ htmlCounter=event.strftime('%D
'+ sscw_params.text_days +'
:%H
'+ sscw_params.text_hours +'
:%M
'+ sscw_params.text_mins +'
:%S
'+ sscw_params.text_secs +'
'); } $(this).html(htmlCounter); }); }); $('.sscw-countdown-single').each(function (){ var $countdown=$(this); $countdown.countdown($countdown.data('date'), function(event){ var htmlCounter=''; if(event.strftime('%-D')==0){ htmlCounter=event.strftime('%H
:%M
:%S
'); }else{ htmlCounter=event.strftime('%D
:%H
:%M
:%S
'); } $(this).html(htmlCounter); }); }); $('.sscw-countdown-raw').each(function (){ var $countdown=$(this); var opts=$(this).data('options'); $countdown.countdown($countdown.data('date'), function(event){ var htmlCounter=''; if(event.strftime('%-D')!=0){ htmlCounter+='%D:'; } htmlCounter+='%H:%M:%S'; if(opts!==undefined){ var options=opts.split('|'); for(var i=0; i < options.length; i++){ var option=options[i]; if(option=='spancolon'||option=='colonspan'){ htmlCounter=htmlCounter.split(':').join(':'); continue; } if(option=='box'){ htmlCounter=htmlCounter.replace('%D', '%D'); htmlCounter=htmlCounter.replace('%H', '%H'); htmlCounter=htmlCounter.replace('%M', '%M'); htmlCounter=htmlCounter.replace('%S', '%S'); } if(option=='label'){ htmlCounter=htmlCounter.replace('%D', '%Dروز'); htmlCounter=htmlCounter.replace('%H', '%Hساعت'); htmlCounter=htmlCounter.replace('%M', '%Mدقیقه'); htmlCounter=htmlCounter.replace('%S', '%Sثانیه'); }} } $(this).html(event.strftime(htmlCounter)); }); }); }); var slideIndex=1; showDivs(slideIndex); function plusDivs(n){ showDivs(slideIndex +=n); } function showDivs(n){ var i; var x=document.getElementsByClassName("w3-sj-items"); if(n > x.length){slideIndex=1} if(n < 1){slideIndex=x.length} for (i=0; i < x.length; i++){ x[i].style.display="none"; } for (i=0; i < x.length; i++){ x[i].className=x[i].className.replace(" w3-sj-active", ""); } if(x[slideIndex-1]!==undefined){ x[slideIndex-1].style.display="block"; x[slideIndex-1].className +=" w3-sj-active"; }} function hasClass(element, className){ return (' ' + element.className + ' ').indexOf(' ' + className+ ' ') > -1; } var inSpecialBox=false; setInterval(function(){ if(! inSpecialBox){ plusDivs(1); var totalItems=document.getElementsByClassName('w3-sj-items'); var currentIndex=1; for(var i=0; i < totalItems.length; i++){ if(hasClass(totalItems[i], 'w3-sj-active')){ currentIndex=i + 1; break; }} try{ document.getElementsByClassName("num")[0].innerHTML=''+currentIndex+'/'+totalItems.length+''; }catch(e){}} }, 7000); var specialBox=document.getElementsByClassName('w3-sj-box'); if(specialBox.length){ specialBox[0].onmouseenter=function(){ inSpecialBox=true; } specialBox[0].onmousemove=function(){ inSpecialBox=true; } specialBox[0].onmouseleave=function(){ inSpecialBox=false; }}; jQuery(function ($){ function animatedScrollTo($anchor, $stickyNavHeight=0){ $('html, body').animate({ scrollTop: $anchor.offset().top - $stickyNavHeight }, 500); } function moveScroller(){ var $anchor=$(".woocommerce-tabs"); var $scroller=$(".woocommerce-tabs .tabs"); var $navHeight=$(".fusion-secondary-main-menu").height(); var $tabsWidth=$scroller.width(); var move=function (){ var st=$(window).scrollTop(); var ot=$anchor.offset().top - 18; var oh=$anchor.height(); if(st > ot&&st < ot + oh - 80){ $anchor.addClass("isFixed"); $scroller.css({ 'top': $navHeight, 'width': $tabsWidth }); $scroller.attr("data-sticky", "true"); }else if(st > ot + oh - 30||st < ot){ $anchor.removeClass("isFixed"); $scroller.attr("data-sticky", "false"); }}; $(window).scroll(move); move(); } if($(".woocommerce-tabs .tabs").length > 0){ $(".woocommerce-tabs .tabs").on('click', 'li', function (){ if($(".woocommerce-tabs .tabs").attr("data-sticky")=="true"){ var $navHeight=$(".fusion-secondary-main-menu").height(); animatedScrollTo($(".woocommerce-tabs"), $navHeight); }}); moveScroller(); }}); window.addComment=function(u){var v,y,p,f=u.document,I={commentReplyClass:"comment-reply-link",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=u.MutationObserver||u.WebKitMutationObserver||u.MozMutationObserver,i="querySelector"in f&&"addEventListener"in u,n=!!f.documentElement.dataset;function t(){r(),e&&new e(d).observe(f.body,{childList:!0,subtree:!0})}function r(e){if(i&&(v=h(I.cancelReplyId),y=h(I.commentFormId),v)){v.addEventListener("touchstart",a),v.addEventListener("click",a);var t=function(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode)return y.removeEventListener("keydown",t),e.preventDefault(),y.submit.click(),!1};y&&y.addEventListener("keydown",t);for(var n,r=function(e){var t=I.commentReplyClass;e&&e.childNodes||(e=f);t=f.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return t}(e),d=0,o=r.length;d":">",'"':""","'":"'","`":"`"},f=v.invert(m),b=function(t){function r(n){return t[n]}var n="(?:"+v.keys(t).join("|")+")",e=RegExp(n),u=RegExp(n,"g");return function(n){return e.test(n=null==n?"":""+n)?n.replace(u,r):n}};v.escape=b(m),v.unescape=b(f),v.result=function(n,t,r){t=null==n?void 0:n[t];return v.isFunction(t=void 0===t?r:t)?t.call(n):t};var N=0;v.uniqueId=function(n){var t=++N+"";return n?n+t:t},v.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};function B(n){return"\\"+R[n]}var T=/(.)^/,R={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},q=/\\|'|\r|\n|\u2028|\u2029/g;v.template=function(i,n,t){n=v.defaults({},n=!n&&t?t:n,v.templateSettings);var t=RegExp([(n.escape||T).source,(n.interpolate||T).source,(n.evaluate||T).source].join("|")+"|$","g"),o=0,a="__p+='";i.replace(t,function(n,t,r,e,u){return a+=i.slice(o,u).replace(q,B),o=u+n.length,t?a+="'+\n((__t=("+t+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":e&&(a+="';\n"+e+"\n__p+='"),n}),a+="';\n",a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+(a=!n.variable?"with(obj||{}){\n"+a+"}\n":a)+"return __p;\n";try{var r=new Function(n.variable||"obj","_",a)}catch(n){throw n.source=a,n}t=function(n){return r.call(this,n,v)},n=n.variable||"obj";return t.source="function("+n+"){\n"+a+"}",t},v.chain=function(n){n=v(n);return n._chain=!0,n};function K(n,t){return n._chain?v(t).chain():t}v.mixin=function(r){v.each(v.functions(r),function(n){var t=v[n]=r[n];v.prototype[n]=function(){var n=[this._wrapped];return i.apply(n,arguments),K(this,t.apply(v,n))}})},v.mixin(v),v.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var r=e[t];v.prototype[t]=function(){var n=this._wrapped;return r.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],K(this,n)}}),v.each(["concat","join","slice"],function(n){var t=e[n];v.prototype[n]=function(){return K(this,t.apply(this._wrapped,arguments))}}),v.prototype.value=function(){return this._wrapped},v.prototype.valueOf=v.prototype.toJSON=v.prototype.value,v.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return v})}.call(this); window.wp=window.wp||{},function(i){var e="undefined"==typeof _wpUtilSettings?{}:_wpUtilSettings;wp.template=_.memoize(function(t){var n,s={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(e){return(n=n||_.template(i("#tmpl-"+t).html(),s))(e)}}),wp.ajax={settings:e.ajax||{},post:function(e,t){return wp.ajax.send({data:_.isObject(e)?e:_.extend(t||{},{action:e})})},send:function(e,n){var t;return _.isObject(e)?n=e:(n=n||{}).data=_.extend(n.data||{},{action:e}),n=_.defaults(n||{},{type:"POST",url:wp.ajax.settings.url,context:this}),(e=(t=i.Deferred(function(t){n.success&&t.done(n.success),n.error&&t.fail(n.error),delete n.success,delete n.error,t.jqXHR=i.ajax(n).done(function(e){"1"!==e&&1!==e||(e={success:!0}),_.isObject(e)&&!_.isUndefined(e.success)?t[e.success?"resolveWith":"rejectWith"](this,[e.data]):t.rejectWith(this,[e])}).fail(function(){t.rejectWith(this,arguments)})})).promise()).abort=function(){return t.jqXHR.abort(),this},e}}}(jQuery); !function(C,d,e,n){function t(t){var a=this;a.$form=t,a.$attributeFields=t.find(".variations select"),a.$singleVariation=t.find(".single_variation"),a.$singleVariationWrap=t.find(".single_variation_wrap"),a.$resetVariations=t.find(".reset_variations"),a.$product=t.closest(".product"),a.variationData=t.data("product_variations"),a.useAjax=!1===a.variationData,a.xhr=!1,a.loading=!0,a.$singleVariationWrap.show(),a.$form.off(".wc-variation-form"),a.getChosenAttributes=a.getChosenAttributes.bind(a),a.findMatchingVariations=a.findMatchingVariations.bind(a),a.isMatch=a.isMatch.bind(a),a.toggleResetLink=a.toggleResetLink.bind(a),t.on("click.wc-variation-form",".reset_variations",{variationForm:a},a.onReset),t.on("reload_product_variations",{variationForm:a},a.onReload),t.on("hide_variation",{variationForm:a},a.onHide),t.on("show_variation",{variationForm:a},a.onShow),t.on("click",".single_add_to_cart_button",{variationForm:a},a.onAddToCart),t.on("reset_data",{variationForm:a},a.onResetDisplayedVariation),t.on("reset_image",{variationForm:a},a.onResetImage),t.on("change.wc-variation-form",".variations select",{variationForm:a},a.onChange),t.on("found_variation.wc-variation-form",{variationForm:a},a.onFoundVariation),t.on("check_variations.wc-variation-form",{variationForm:a},a.onFindVariation),t.on("update_variation_values.wc-variation-form",{variationForm:a},a.onUpdateAttributes),setTimeout(function(){t.trigger("check_variations"),t.trigger("wc_variation_form"),a.loading=!1},100)}t.prototype.onReset=function(t){t.preventDefault(),t.data.variationForm.$attributeFields.val("").change(),t.data.variationForm.$form.trigger("reset_data")},t.prototype.onReload=function(t){var a=t.data.variationForm;a.variationData=a.$form.data("product_variations"),a.useAjax=!1===a.variationData,a.$form.trigger("check_variations")},t.prototype.onHide=function(t){t.preventDefault(),t.data.variationForm.$form.find(".single_add_to_cart_button").removeClass("wc-variation-is-unavailable").addClass("disabled wc-variation-selection-needed"),t.data.variationForm.$form.find(".woocommerce-variation-add-to-cart").removeClass("woocommerce-variation-add-to-cart-enabled").addClass("woocommerce-variation-add-to-cart-disabled")},t.prototype.onShow=function(t,a,i){t.preventDefault(),i?(t.data.variationForm.$form.find(".single_add_to_cart_button").removeClass("disabled wc-variation-selection-needed wc-variation-is-unavailable"),t.data.variationForm.$form.find(".woocommerce-variation-add-to-cart").removeClass("woocommerce-variation-add-to-cart-disabled").addClass("woocommerce-variation-add-to-cart-enabled")):(t.data.variationForm.$form.find(".single_add_to_cart_button").removeClass("wc-variation-selection-needed").addClass("disabled wc-variation-is-unavailable"),t.data.variationForm.$form.find(".woocommerce-variation-add-to-cart").removeClass("woocommerce-variation-add-to-cart-enabled").addClass("woocommerce-variation-add-to-cart-disabled")),wp.mediaelement&&t.data.variationForm.$form.find(".wp-audio-shortcode, .wp-video-shortcode").not(".mejs-container").filter(function(){return!C(this).parent().hasClass("mejs-mediaelement")}).mediaelementplayer(wp.mediaelement.settings)},t.prototype.onAddToCart=function(t){C(this).is(".disabled")&&(t.preventDefault(),C(this).is(".wc-variation-is-unavailable")?d.alert(wc_add_to_cart_variation_params.i18n_unavailable_text):C(this).is(".wc-variation-selection-needed")&&d.alert(wc_add_to_cart_variation_params.i18n_make_a_selection_text))},t.prototype.onResetDisplayedVariation=function(t){var a=t.data.variationForm;a.$product.find(".product_meta").find(".sku").wc_reset_content(),a.$product.find(".product_weight, .woocommerce-product-attributes-item--weight .woocommerce-product-attributes-item__value").wc_reset_content(),a.$product.find(".product_dimensions, .woocommerce-product-attributes-item--dimensions .woocommerce-product-attributes-item__value").wc_reset_content(),a.$form.trigger("reset_image"),a.$singleVariation.slideUp(200).trigger("hide_variation")},t.prototype.onResetImage=function(t){t.data.variationForm.$form.wc_variations_image_update(!1)},t.prototype.onFindVariation=function(t){var a=t.data.variationForm,i=a.getChosenAttributes(),e=i.data;if(i.count===i.chosenCount)if(a.useAjax)a.xhr&&a.xhr.abort(),a.$form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),e.product_id=parseInt(a.$form.data("product_id"),10),e.custom_data=a.$form.data("custom_data"),a.xhr=C.ajax({url:wc_add_to_cart_variation_params.wc_ajax_url.toString().replace("%%endpoint%%","get_variation"),type:"POST",data:e,success:function(t){t?a.$form.trigger("found_variation",[t]):(a.$form.trigger("reset_data"),i.chosenCount=0,a.loading||(a.$form.find(".single_variation").after('

'+wc_add_to_cart_variation_params.i18n_no_matching_variations_text+"

"),a.$form.find(".wc-no-matching-variations").slideDown(200)))},complete:function(){a.$form.unblock()}});else{a.$form.trigger("update_variation_values");var r=a.findMatchingVariations(a.variationData,e).shift();r?a.$form.trigger("found_variation",[r]):(a.$form.trigger("reset_data"),i.chosenCount=0,a.loading||(a.$form.find(".single_variation").after('

'+wc_add_to_cart_variation_params.i18n_no_matching_variations_text+"

"),a.$form.find(".wc-no-matching-variations").slideDown(200)))}else a.$form.trigger("update_variation_values"),a.$form.trigger("reset_data");a.toggleResetLink(0"),c=e.val()||"",_=!0;if(!e.data("attribute_html")){var d=e.clone();d.find("option").removeAttr("disabled attached").removeAttr("selected"),e.data("attribute_options",d.find("option"+n).get()),e.data("attribute_html",d.html())}s.html(e.data("attribute_html"));var m=C.extend(!0,{},F);m[r]="";var l=y.findMatchingVariations(y.variationData,m);for(var v in l)if("undefined"!=typeof l[v]){var g=l[v].attributes;for(var f in g)if(g.hasOwnProperty(f)){var u=g[f],h="";if(f===r)if(l[v].variation_is_active&&(h="enabled"),u){u=C("
").html(u).text();var p=s.find("option");if(p.length)for(var w=0,b=p.length;w 0||trident > 0) return true; return false; } function supportsTransitions(){ var b=document.body||document.documentElement, s=b.style, p='transition'; if(typeof s[p]=='string'){ $("html").addClass("csstransformspreserve3d"); return true; } var v=['Moz', 'webkit', 'Webkit', 'Khtml', 'O', 'ms']; p=p.charAt(0).toUpperCase() + p.substr(1); for (var i=0; i 0){ moveItems.call(); }else{ $(self.currentItem).addClass('photostack-flip'); self.isShuffling=false; if(typeof self.options.callback==='function'){ self.options.callback(self.currentItem); }} }}; if(self.items.indexOf(item)===self.current&&self.started&&iter===0){ self.currentItem.style.WebkitTransform='translate(' + self.centerItem.x + 'px,' + self.centerItem.y + 'px) rotate(0deg)'; self.currentItem.style.msTransform='translate(' + self.centerItem.x + 'px,' + self.centerItem.y + 'px) rotate(0deg)'; self.currentItem.style.transform='translate(' + self.centerItem.x + 'px,' + self.centerItem.y + 'px) rotate(0deg)'; if(self.currentItem.querySelector('.photostack-back')){ self._addItemPerspective(); } $(self.currentItem).addClass('photostack-current'); }else{ item.style.WebkitTransform='translate(' + translation.x + 'px,' + translation.y + 'px) rotate(' + Math.floor(Math.random() * (maxrot - minrot + 1) + minrot) + 'deg)'; item.style.msTransform='translate(' + translation.x + 'px,' + translation.y + 'px) rotate(' + Math.floor(Math.random() * (maxrot - minrot + 1) + minrot) + 'deg)'; item.style.transform='translate(' + translation.x + 'px,' + translation.y + 'px) rotate(' + Math.floor(Math.random() * (maxrot - minrot + 1) + minrot) + 'deg)'; } if(self.started){ if(support.transitions){ item.addEventListener(transEndEventName, onEndTransitionFn); }else{ onEndTransitionFn(); }} }); }; moveItems.call(); } Photostack.prototype._getSizes=function(){ this.sizes={ inner:{ width:this.inner.offsetWidth, height:this.inner.offsetHeight }, item:{ width:this.currentItem.offsetWidth, height:this.currentItem.offsetHeight }}; this.centerItem={ x:this.sizes.inner.width / 2 - this.sizes.item.width / 2, y:this.sizes.inner.height / 2 - this.sizes.item.height / 2 };} Photostack.prototype._isOverlapping=function(itemVal){ var dxArea=this.sizes.item.width + this.sizes.item.width / 3, dyArea=this.sizes.item.height + this.sizes.item.height / 3, areaVal={ x:this.sizes.inner.width / 2 - dxArea / 2, y:this.sizes.inner.height / 2 - dyArea / 2 }, dxItem=this.sizes.item.width, dyItem=this.sizes.item.height; if(!((itemVal.x + dxItem) < areaVal.x || itemVal.x >(areaVal.x + dxArea) || (itemVal.y + dyItem) < areaVal.y || itemVal.y >(areaVal.y + dyArea))){ var left=Math.random() < 0.5, randExtraX=Math.floor(Math.random() * (dxItem/4 + 1)), randExtraY=Math.floor(Math.random() * (dyItem/4 + 1)), noOverlapX=left ? (itemVal.x - areaVal.x + dxItem) * -1 - randExtraX:(areaVal.x + dxArea) - (itemVal.x + dxItem) + dxItem + randExtraX, noOverlapY=left ? (itemVal.y - areaVal.y + dyItem) * -1 - randExtraY:(areaVal.y + dyArea) - (itemVal.y + dyItem) + dyItem + randExtraY; return { overlapping:true, noOverlap:{ x:noOverlapX, y:noOverlapY }} } return { overlapping:false }} Photostack.prototype._addItemPerspective=function(){ $(this.el).addClass('photostack-perspective'); } Photostack.prototype._removeItemPerspective=function(){ $(this.el).removeClass('photostack-perspective'); $(this.currentItem).removeClass('photostack-flip'); } Photostack.prototype._rotateItem=function(callback){ if($(this.el).hasClass('photostack-perspective')&&!this.isRotating&&!this.isShuffling){ this.isRotating=true; var self=this, onEndTransitionFn=function(){ if(support.transitions&&support.preserve3d){ this.removeEventListener(transEndEventName, onEndTransitionFn); } self.isRotating=false; if(typeof callback==='function'){ callback(); }}; if(this.flipped){ $(this.navDots[ this.current ]).removeClass('flip'); if(support.preserve3d){ this.currentItem.style.WebkitTransform='translate(' + this.centerItem.x + 'px,' + this.centerItem.y + 'px) rotateY(0deg)'; this.currentItem.style.transform='translate(' + this.centerItem.x + 'px,' + this.centerItem.y + 'px) rotateY(0deg)'; }else{ $(this.currentItem).removeClass('photostack-showback'); }}else{ $(this.navDots[ this.current ]).addClass('flip'); if(support.preserve3d){ this.currentItem.style.WebkitTransform='translate(' + this.centerItem.x + 'px,' + this.centerItem.y + 'px) translate(' + this.sizes.item.width + 'px) rotateY(-179.9deg)'; this.currentItem.style.transform='translate(' + this.centerItem.x + 'px,' + this.centerItem.y + 'px) translate(' + this.sizes.item.width + 'px) rotateY(-179.9deg)'; }else{ $(this.currentItem).addClass('photostack-showback'); }} this.flipped = !this.flipped; if(support.transitions&&support.preserve3d){ this.currentItem.addEventListener(transEndEventName, onEndTransitionFn); }else{ onEndTransitionFn(); }} } window.Photostack=Photostack; })(jQuery, jQuery, window); (function(){var n,r,t,i,u=function(n,t){return function(){return n.apply(t,arguments)}},f=function(n,t){for(var i in t)e.call(t,i)&&(n[i]=t[i]);function r(){this.constructor=n}return r.prototype=t.prototype,n.prototype=new r,n.__super__=t.prototype,n},e={}.hasOwnProperty;i=function(){function n(){this.options_index=0;this.parsed=[]}return n.prototype.add_node=function(n){return n.nodeName.toUpperCase()==="OPTGROUP"?this.add_group(n):this.add_option(n)},n.prototype.add_group=function(n){var i,t,f,e,r,u;for(i=this.parsed.length,this.parsed.push({array_index:i,group:!0,label:n.label,title:n.title?n.title:void 0,children:0,disabled:n.disabled,classes:n.className}),r=n.childNodes,u=[],t=0,f=r.length;t"+n.group_label+"<\/b>"+n.html:n.html},n.prototype.mouse_enter=function(){return this.mouse_on_container=!0},n.prototype.mouse_leave=function(){return this.mouse_on_container=!1},n.prototype.input_focus=function(){if(this.is_multiple){if(!this.active_field)return setTimeout(function(n){return function(){return n.container_mousedown()}}(this),50)}else if(!this.active_field)return this.activate_field()},n.prototype.input_blur=function(){if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(n){return function(){return n.blur_test()}}(this),100)},n.prototype.label_click_handler=function(n){return this.is_multiple?this.container_mousedown(n):this.activate_field()},n.prototype.results_option_build=function(n){var u,t,i,r,o,f,e;for(u="",e=0,f=this.results_data,r=0,o=f.length;r=this.max_shown_results)break;return u},n.prototype.result_add_option=function(n){var t,i;return n.search_match?this.include_option_in_results(n)?(t=[],n.disabled||n.selected&&this.is_multiple||t.push("active-result"),!n.disabled||n.selected&&this.is_multiple||t.push("disabled-result"),n.selected&&t.push("result-selected"),n.group_array_index!=null&&t.push("group-option"),n.classes!==""&&t.push(n.classes),i=document.createElement("li"),i.className=t.join(" "),i.style.cssText=n.style,i.setAttribute("data-option-array-index",n.array_index),i.innerHTML=n.highlighted_html||n.html,n.title&&(i.title=n.title),this.outerHTML(i)):"":""},n.prototype.result_add_group=function(n){var i,t;return(n.search_match||n.group_match)?(n.active_options>0)?(i=[],i.push("group-result"),n.classes&&i.push(n.classes),t=document.createElement("li"),t.className=i.join(" "),t.innerHTML=n.highlighted_html||this.escape_html(n.label),n.title&&(t.title=n.title),this.outerHTML(t)):"":""},n.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},n.prototype.reset_single_select_options=function(){var n,u,i,r,t;for(i=this.results_data,t=[],n=0,u=i.length;n"+this.escape_html(c)+"<\/em>"+this.escape_html(y)),i!=null&&(i.group_match=!0)):n.group_array_index!=null&&this.results_data[n.group_array_index].search_match&&(n.search_match=!0)));return this.result_clear_highlight(),e<1&&t.length?(this.update_results_content(""),this.no_results(t)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},n.prototype.get_search_regex=function(n){var i,t;return t=this.search_contains?n:"(^|\\s|\\b)"+n+"[^\\s]*",this.enable_split_word_search||this.search_contains||(t="^"+t),i=this.case_sensitive_search?"":"i",new RegExp(t,i)},n.prototype.search_string_match=function(n,t){var i;return i=t.exec(n),!this.search_contains&&(i!=null?i[1]:void 0)&&(i.index+=1),i},n.prototype.choices_count=function(){var n,i,r,t;if(this.selected_option_count!=null)return this.selected_option_count;for(this.selected_option_count=0,t=this.form_field.options,n=0,i=t.length;n0?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:n.preventDefault();this.results_showing&&this.result_select(n);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},n.prototype.clipboard_event_checker=function(){if(!this.is_disabled)return setTimeout(function(n){return function(){return n.results_search()}}(this),50)},n.prototype.container_width=function(){return this.options.width!=null?this.options.width:this.form_field.offsetWidth+"px"},n.prototype.include_option_in_results=function(n){return this.is_multiple&&!this.display_selected_options&&n.selected?!1:!this.display_disabled_options&&n.disabled?!1:n.empty?!1:!0},n.prototype.search_results_touchstart=function(n){return this.touch_started=!0,this.search_results_mouseover(n)},n.prototype.search_results_touchmove=function(n){return this.touch_started=!1,this.search_results_mouseout(n)},n.prototype.search_results_touchend=function(n){if(this.touch_started)return this.search_results_mouseup(n)},n.prototype.outerHTML=function(n){var t;return n.outerHTML?n.outerHTML:(t=document.createElement("div"),t.appendChild(n),t.innerHTML)},n.prototype.get_single_html=function(){return'\n '+this.default_text+'<\/span>\n
<\/b><\/div>\n<\/a>\n
\n