PageSourceSearch

https://markmanoutdoorphotography.com/zf/script/en-US/lynx/unix/JQH452SS9KYH/layout.js

js markmanoutdoorphotography.com collected 2026-09-27 12:32:53 UTC 1,576,970 bytes, 6,942 lines download raw bytes

1;var __zfl_start=new Date().getTime();//          
2/*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */�
vendor: 32,013 bytes, lines 2-3
2
3!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+Math.random()}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)
3
vendor: 9,806 bytes, line 4
4},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}}
vendor: 17,252 bytes, line 4
4,n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ab=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ib={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qb[0].contentDocument,b.write(),b.close(),c=sb(a,b),qb.detach()),rb[a]=c),c}var ub=/^margin/,vb=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)};function xb(a,b,c){var d,e,f,g,h=a.style;return c=c||wb(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),vb.test(g)&&ub.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function yb(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var zb=/^(none|table(?!-c[ea]).+)/,Ab=new RegExp("^("+Q+")(.*)$","i"),Bb=new RegExp("^([+-])=("+Q+")","i"),Cb={position:"absolute",visibility:"hidden",display:"block"},Db={letterSpacing:"0",fontWeight:"400"},Eb=["Webkit","O","Moz","ms"];function Fb(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Eb.length;while(e--)if(b=Eb[e]+c,b in a)return b;return d}function Gb(a,b,c){var d=Ab.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Hb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ib(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wb(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xb(a,b,f),(0>e||null==e)&&(e=a.style[b]),vb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Hb(a,b,c||(g?"border":"content"),d,f)+"px"}function Jb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",tb(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Bb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xb(a,b,d)),"normal"===e&&b in Db&&(e=Db[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?zb.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Cb,function(){return Ib(a,b,d)}):Ib(a,b,d):void 0},set:function(a,c,d){var e=d&&wb(a);return Gb(a,c,d?Hb(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=yb(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ub.test(a)||(n.cssHooks[a+b].set=Gb)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Jb(this,!0)},hide:function(){return Jb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Kb(a,b,c,d,e){return new Kb.prototype.init(a,b,c,d,e)}n.Tween=Kb,Kb.prototype={constructor:Kb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Kb.propHooks[this.prop];return a&&a.get?a.get(this):Kb.propHooks._default.get(this)},run:function(a){var b,c=Kb.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Kb.propHooks._default.set(this),this}},Kb.prototype.init.prototype=Kb.prototype,Kb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Kb.propHooks.scrollTop=Kb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Kb.prototype.init,n.fx.step={};var Lb,Mb,Nb=/^(?:toggle|show|hide)$/,Ob=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pb=/queueHooks$/,Qb=[Vb],Rb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Ob.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Ob.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sb(){return setTimeout(function(){Lb=void 0}),Lb=n.now()}function Tb(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ub(a,b,c){for(var d,e=(Rb[b]||[]).concat(Rb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Vb(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||tb(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Nb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?tb(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ub(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wb(a,b){var c,d,e,f,g;
vendor: 7,746 bytes, lines 4-5
4for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xb(a,b,c){var d,e,f=0,g=Qb.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Lb||Sb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Lb||Sb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wb(k,j.opts.specialEasing);g>f;f++)if(d=Qb[f].call(j,a,k,j.opts))return d;return n.map(k,Ub,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xb,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Rb[c]=Rb[c]||[],Rb[c].unshift(b)},prefilter:function(a,b){b?Qb.unshift(a):Qb.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xb(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Tb(b,!0),a,d,e)}}),n.each({slideDown:Tb("show"),slideUp:Tb("hide"),slideToggle:Tb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Lb=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Lb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Mb||(Mb=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Mb),Mb=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Yb,Zb,$b=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Zb:Yb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))
5},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Zb={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$b[b]||n.find.attr;$b[b]=function(a,b,d){var e,f;return d||(f=$b[b],$b[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$b[b]=f),e}});var _b=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_b.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ac=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];
vendor: 17,345 bytes, line 5
5while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ac," ").indexOf(b)>=0)return!0;return!1}});var bc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cc=n.now(),dc=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var ec,fc,gc=/#.*$/,hc=/([?&])_=[^&]*/,ic=/^(.*?):[ \t]*([^\r\n]*)$/gm,jc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,kc=/^(?:GET|HEAD)$/,lc=/^\/\//,mc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,nc={},oc={},pc="*/".concat("*");try{fc=location.href}catch(qc){fc=l.createElement("a"),fc.href="",fc=fc.href}ec=mc.exec(fc.toLowerCase())||[];function rc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function sc(a,b,c,d){var e={},f=a===oc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function tc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function uc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function vc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:fc,type:"GET",isLocal:jc.test(ec[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":pc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?tc(tc(a,n.ajaxSettings),b):tc(n.ajaxSettings,a)},ajaxPrefilter:rc(nc),ajaxTransport:rc(oc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=ic.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||fc)+"").replace(gc,"").replace(lc,ec[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=mc.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===ec[1]&&h[2]===ec[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(ec[3]||("http:"===ec[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),sc(nc,k,b,v),2===t)return v;i=k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!kc.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(dc.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=hc.test(d)?d.replace(hc,"$1_="+cc++):d+(dc.test(d)?"&":"?")+"_="+cc++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+pc+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=sc(oc,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=uc(k,v,f)),u=vc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var wc=/%20/g,xc=/\[\]$/,yc=/\r?\n/g,zc=/^(?:submit|button|image|reset|file)$/i,Ac=/^(?:input|select|textarea|keygen)/i;function Bc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||xc.test(a)?d(a,e):Bc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Bc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Bc(c,a[c],b,e);return d.join("&").replace(wc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Ac.test(this.nodeName)&&!zc.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(yc,"\r\n")}}):{name:b.name,value:c.replace(yc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Cc=0,Dc={},Ec={0:200,1223:204},Fc=n.ajaxSettings.xhr();a.ActiveXObject&&n(a).on("unload",function(){for(var a in Dc)Dc[a]()}),k.cors=!!Fc&&"withCredentials"in Fc,k.ajax=Fc=!!Fc,n.ajaxTransport(function(a){var b;return k.cors||Fc&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Cc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Dc[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Ec[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Dc[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Gc=[],Hc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Gc.pop()||n.expando+"_"+cc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Hc.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Hc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Hc,"$1"+e):b.jsonp!==!1&&(b.url+=(dc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Gc.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Ic=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Ic)return Ic.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Jc=a.document.documentElement;function Kc(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Kc(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Jc;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Jc})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Kc(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=yb(k.pixelPosition,function(a,c){return c?(c=xb(a,b),vb.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Lc=a.jQuery,Mc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Mc),b&&a.jQuery===n&&(a.jQuery=Lc),n},typeof b===U&&(a.jQuery=a.$=n),n});
vendor: 6,623 bytes, lines 5-8
5
6//          
7/*! jQuery Color [email protected] http://github.com/jquery/jquery-color | jquery.org/license */
8(function(a,b){function m(a,b,c){var d=h[b.type]||{};return a==null?c||!b.def?null:b.def:(a=d.floor?~~a:parseFloat(a),isNaN(a)?b.def:d.mod?(a+d.mod)%d.mod:0>a?0:d.max<a?d.max:a)}function n(b){var c=f(),d=c._rgba=[];return b=b.toLowerCase(),l(e,function(a,e){var f,h=e.re.exec(b),i=h&&e.parse(h),j=e.space||"rgba";if(i)return f=c[j](i),c[g[j].cache]=f[g[j].cache],d=c._rgba=f._rgba,!1}),d.length?(d.join()==="0,0,0,0"&&a.extend(d,k.transparent),c):k[b]}function o(a,b,c){return c=(c+1)%1,c*6<1?a+(b-a)*c*6:c*2<1?b:c*3<2?a+(b-a)*(2/3-c)*6:a}var c="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",d=/^([\-+])=\s*(\d+\.?\d*)/,e=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(a){return[a[1],a[2],a[3],a[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(a){return[a[1]*2.55,a[2]*2.55,a[3]*2.55,a[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(a){return[a[1],a[2]/100,a[3]/100,a[4]]}}],f=a.Color=function(b,c,d,e){return new a.Color.fn.parse(b,c,d,e)},g={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}},i=f.support={},j=a("<p>")[0],k,l=a.each;j.style.cssText="background-color:rgba(1,1,1,.5)",i.rgba=j.style.backgroundColor.indexOf("rgba")>-1,l(g,function(a,b){b.cache="_"+a,b.props.alpha={idx:3,type:"percent",def:1}}),f.fn=a.extend(f.prototype,{parse:function(c,d,e,h){if(c===b)return this._rgba=[null,null,null,null],this;if(c.jquery||c.nodeType)c=a(c).css(d),d=b;var i=this,j=a.type(c),o=this._rgba=[];d!==b&&(c=[c,d,e,h],j="array");if(j==="string")return this.parse(n(c)||k._default);if(j==="array")return l(g.rgba.props,function(a,b){o[b.idx]=m(c[b.idx],b)}),this;if(j==="object")return c instanceof f?l(g,function(a,b){c[b.cache]&&(i[b.cache]=c[b.cache].slice())}):l(g,function(b,d){var e=d.cache;l(d.props,function(a,b){if(!i[e]&&d.to){if(a==="alpha"||c[a]==null)return;i[e]=d.to(i._rgba)}i[e][b.idx]=m(c[a],b,!0)}),i[e]&&a.inArray(null,i[e].slice(0,3))<0&&(i[e][3]=1,d.from&&(i._rgba=d.from(i[e])))}),this},is:function(a){var b=f(a),c=!0,d=this;return l(g,function(a,e){var f,g=b[e.cache];return g&&(f=d[e.cache]||e.to&&e.to(d._rgba)||[],l(e.props,function(a,b){if(g[b.idx]!=null)return c=g[b.idx]===f[b.idx],c})),c}),c},_space:function(){var a=[],b=this;return l(g,function(c,d){b[d.cache]&&a.push(c)}),a.pop()},transition:function(a,b){var c=f(a),d=c._space(),e=g[d],i=this.alpha()===0?f("transparent"):this,j=i[e.cache]||e.to(i._rgba),k=j.slice();return c=c[e.cache],l(e.props,function(a,d){var e=d.idx,f=j[e],g=c[e],i=h[d.type]||{};if(g===null)return;f===null?k[e]=g:(i.mod&&(g-f>i.mod/2?f+=i.mod:f-g>i.mod/2&&(f-=i.mod)),k[e]=m((g-f)*b+f,d))}),this[d](k)},blend:function(b){if(this._rgba[3]===1)return this;var c=this._rgba.slice(),d=c.pop(),e=f(b)._rgba;return f(a.map(c,function(a,b){return(1-d)*e[b]+d*a}))},toRgbaString:function(){var b="rgba(",c=a.map(this._rgba,function(a,b){return a==null?b>2?1:0:a});return c[3]===1&&(c.pop(),b="rgb("),b+c.join()+")"},toHslaString:function(){var b="hsla(",c=a.map(this.hsla(),function(a,b){return a==null&&(a=b>2?1:0),b&&b<3&&(a=Math.round(a*100)+"%"),a});return c[3]===1&&(c.pop(),b="hsl("),b+c.join()+")"},toHexString:function(b){var c=this._rgba.slice(),d=c.pop();return b&&c.push(~~(d*255)),"#"+a.map(c,function(a){return a=(a||0).toString(16),a.length===1?"0"+a:a}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}}),f.fn.parse.prototype=f.fn,g.hsla.to=function(a){if(a[0]==null||a[1]==null||a[2]==null)return[null,null,null,a[3]];var b=a[0]/255,c=a[1]/255,d=a[2]/255,e=a[3],f=Math.max(b,c,d),g=Math.min(b,c,d),h=f-g,i=f+g,j=i*.5,k,l;return g===f?k=0:b===f?k=60*(c-d)/h+360:c===f?k=60*(d-b)/h+120:k=60*(b-c)/h+240,h===0?l=0:j<=.5?l=h/i:l=h/(2-i),[Math.round(k)%360,l,j,e==null?1:e]},g.hsla.from=function(a){if(a[0]==null||a[1]==null||a[2]==null)return[null,null,null,a[3]];var b=a[0]/360,c=a[1],d=a[2],e=a[3],f=d<=.5?d*(1+c):d+c-d*c,g=2*d-f;return[Math.round(o(g,f,b+1/3)*255),Math.round(o(g,f,b)*255),Math.round(o(g,f,b-1/3)*255),e]},l(g,function(c,e){var g=e.props,h=e.cache,i=e.to,j=e.from;f.fn[c]=function(c){i&&!this[h]&&(this[h]=i(this._rgba));if(c===b)return this[h].slice();var d,e=a.type(c),k=e==="array"||e==="object"?c:arguments,n=this[h].slice();return l(g,function(a,b){var c=k[e==="object"?a:b.idx];c==null&&(c=n[b.idx]),n[b.idx]=m(c,b)}),j?(d=f(j(n)),d[h]=n,d):f(n)},l(g,function(b,e){if(f.fn[b])return;f.fn[b]=function(f){var g=a.type(f),h=b==="alpha"?this._hsla?"hsla":"rgba":c,i=this[h](),j=i[e.idx],k;return g==="undefined"?j:(g==="function"&&(f=f.call(this,j),g=a.type(f)),f==null&&e.empty?this:(g==="string"&&(k=d.exec(f),k&&(f=j+parseFloat(k[2])*(k[1]==="+"?1:-1))),i[e.idx]=f,this[h](i)))}})}),f.hook=function(b){var c=b.split(" ");l(c,function(b,c){a.cssHooks[c]={set:function(b,d){var e,g,h="";if(d!=="transparent"&&(a.type(d)!=="string"||(e=n(d)))){d=f(e||d);if(!i.rgba&&d._rgba[3]!==1){g=c==="backgroundColor"?b.parentNode:b;while((h===""||h==="transparent")&&g&&g.style)try{h=a.css(g,"backgroundColor"),g=g.parentNode}catch(j){}d=d.blend(h&&h!=="transparent"?h:"_default")}d=d.toRgbaString()}try{b.style[c]=d}catch(j){}}},a.fx.step[c]=function(b){b.colorInit||(b.start=f(b.elem,c),b.end=f(b.end),b.colorInit=!0),a.cssHooks[c].set(b.elem,b.start.transition(b.end,b.pos))}})},f.hook(c),a.cssHooks.borderColor={expand:function(a){var b={};return l(["Top","Right","Bottom","Left"],function(c,d){b["border"+d+"Color"]=a}),b}},k=a.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);
vendor: 4,074 bytes, lines 9-22
9//          
10/*
11 *	jQuery dotdotdot 1.8.3
12 *
13 *	Copyright (c) Fred Heusschen
14 *	www.frebsite.nl
15 *
16 *	Plugin website:
17 *	dotdotdot.frebsite.nl
18 *
19 *	Licensed under the MIT license.
20 *	http://en.wikipedia.org/wiki/MIT_License
21 */
22!function(t,e){"use strict";function n(t,e,n){var r=t.children(),a=!1;t.empty();for(var i=0,d=r.length;i<d;i++){var l=r.eq(i);if(t.append(l),n&&t.append(n),o(t,e)){l.remove(),a=!0;break}n&&n.detach()}return a}function r(e,n,i,d,l){var s=!1,c="a, table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, blockquote, select, optgroup, option, textarea, script, style",u="script, .dotdotdot-keep";return e.contents().detach().each(function(){var h=this,f=t(h);if("undefined"==typeof h)return!0;if(f.is(u))e.append(f);else{if(s)return!0;e.append(f),!l||f.is(d.after)||f.find(d.after).length||e[e.is(c)?"after":"append"](l),o(i,d)&&(s=3==h.nodeType?a(f,n,i,d,l):r(f,n,i,d,l)),s||l&&l.detach()}}),n.addClass("is-truncated"),s}function a(e,n,r,a,d){var c=e[0];if(!c)return!1;var h=s(c),f=h.indexOf(" ")!==-1?" ":" ",p="letter"==a.wrap?"":f,g=h.split(p),v=-1,w=-1,m=0,b=g.length-1;if(a.fallbackToLetter&&0===m&&0===b&&(p="",g=h.split(p),b=g.length-1),a.maxLength)h=i(h.trim().substr(0,a.maxLength),a),l(c,h);else{for(;m<=b&&(0!==m||0!==b);){var y=Math.floor((m+b)/2);if(y==w)break;w=y,l(c,g.slice(0,w+1).join(p)+a.ellipsis),r.children().each(function(){t(this).toggle().toggle()}),o(r,a)?(b=w,a.fallbackToLetter&&0===m&&0===b&&(p="",g=g[0].split(p),v=-1,w=-1,m=0,b=g.length-1)):(v=w,m=w)}if(v==-1||1===g.length&&0===g[0].length){var x=e.parent();e.detach();var C=d&&d.closest(x).length?d.length:0;if(x.contents().length>C?c=u(x.contents().eq(-1-C),n):(c=u(x,n,!0),C||x.detach()),c&&(h=i(s(c),a),l(c,h),C&&d)){var T=d.parent();t(c).parent().append(d),t.trim(T.html())||T.remove()}}else h=i(g.slice(0,v+1).join(p),a),l(c,h)}return!0}function o(t,e){return t.innerHeight()>e.maxHeight||e.maxLength&&t.text().trim().length>e.maxLength}function i(e,n){for(;t.inArray(e.slice(-1),n.lastCharacter.remove)>-1;)e=e.slice(0,-1);return t.inArray(e.slice(-1),n.lastCharacter.noEllipsis)<0&&(e+=n.ellipsis),e}function d(t){return{width:t.innerWidth(),height:t.innerHeight()}}function l(t,e){t.innerText?t.innerText=e:t.nodeValue?t.nodeValue=e:t.textContent&&(t.textContent=e)}function s(t){return t.innerText?t.innerText:t.nodeValue?t.nodeValue:t.textContent?t.textContent:""}function c(t){do t=t.previousSibling;while(t&&1!==t.nodeType&&3!==t.nodeType);return t}function u(e,n,r){var a,o=e&&e[0];if(o){if(!r){if(3===o.nodeType)return o;if(t.trim(e.text()))return u(e.contents().last(),n)}for(a=c(o);!a;){if(e=e.parent(),e.is(n)||!e.length)return!1;a=c(e[0])}if(a)return u(t(a),n)}return!1}function h(e,n){return!!e&&("string"==typeof e?(e=t(e,n),!!e.length&&e):!!e.jquery&&e)}function f(t){for(var e=t.innerHeight(),n=["paddingTop","paddingBottom"],r=0,a=n.length;r<a;r++){var o=parseInt(t.css(n[r]),10);isNaN(o)&&(o=0),e-=o}return e}if(!t.fn.dotdotdot){t.fn.dotdotdot=function(e){if(0===this.length)return t.fn.dotdotdot.debug('No element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){t(this).dotdotdot(e)});var a=this,i=a.contents();a.data("dotdotdot")&&a.trigger("destroy.dot"),a.data("dotdotdot-style",a.attr("style")||""),a.css("word-wrap","break-word"),"nowrap"===a.css("white-space")&&a.css("white-space","normal"),a.bind_events=function(){return a.bind("update.dot",function(e,d){switch(a.removeClass("is-truncated"),e.preventDefault(),e.stopPropagation(),typeof l.height){case"number":l.maxHeight=l.height;break;case"function":l.maxHeight=l.height.call(a[0]);break;default:l.maxHeight=f(a)}l.maxHeight+=l.tolerance,"undefined"!=typeof d&&(("string"==typeof d||"nodeType"in d&&1===d.nodeType)&&(d=t("<div />").append(d).contents()),d instanceof t&&(i=d)),g=a.wrapInner('<div class="dotdotdot" />').children(),g.contents().detach().end().append(i.clone(!0)).find("br").replaceWith("  <br />  ").end().css({height:"auto",width:"auto",border:"none",padding:0,margin:0});var c=!1,u=!1;
22return s.afterElement&&(c=s.afterElement.clone(!0),c.show(),s.afterElement.detach()),o(g,l)&&(u="children"==l.wrap?n(g,l,c):r(g,a,g,l,c)),g.replaceWith(g.contents()),g=null,t.isFunction(l.callback)&&l.callback.call(a[0],u,i),s.isTruncated=u,u}).bind("isTruncated.dot",function(t,e){return t.preventDefault(),t.stopPropagation(),"function"==typeof e&&e.call(a[0],s.isTruncated),s.isTruncated}).bind("originalContent.dot",function(t,e){return t.preventDefault(),t.stopPropagation(),"function"==typeof e&&e.call(a[0],i),i}).bind("destroy.dot",function(t){t.preventDefault(),t.stopPropagation(),a.unwatch().unbind_events().contents().detach().end().append(i).attr("style",a.data("dotdotdot-style")||"").removeClass("is-truncated").data("dotdotdot",!1)}),a},a.unbind_events=function(){return a.unbind(".dot"),a},a.watch=function(){if(a.unwatch(),"window"==l.watch){var e=t(window),n=e.width(),r=e.height();e.bind("resize.dot"+s.dotId,function(){n==e.width()&&r==e.height()&&l.windowResizeFix||(n=e.width(),r=e.height(),u&&clearInterval(u),u=setTimeout(function(){a.trigger("update.dot")},100))})}else c=d(a),u=setInterval(function(){if(a.is(":visible")){var t=d(a);c.width==t.width&&c.height==t.height||(a.trigger("update.dot"),c=t)}},500);return a},a.unwatch=function(){return t(window).unbind("resize.dot"+s.dotId),u&&clearInterval(u),a};var l=t.extend(!0,{},t.fn.dotdotdot.defaults,e),s={},c={},u=null,g=null;return l.lastCharacter.remove instanceof Array||(l.lastCharacter.remove=t.fn.dotdotdot.defaultArrays.lastCharacter.remove),l.lastCharacter.noEllipsis instanceof Array||(l.lastCharacter.noEllipsis=t.fn.dotdotdot.defaultArrays.lastCharacter.noEllipsis),s.afterElement=h(l.after,a),s.isTruncated=!1,s.dotId=p++,a.data("dotdotdot",!0).bind_events().trigger("update.dot"),l.watch&&a.watch(),a},t.fn.dotdotdot.defaults={ellipsis:"... ",wrap:"word",fallbackToLetter:!0,lastCharacter:{},tolerance:0,callback:null,after:null,height:null,watch:!1,windowResizeFix:!0,maxLength:null},t.fn.dotdotdot.defaultArrays={lastCharacter:{remove:[" "," ",",",";",".","!","?"],noEllipsis:[]}},t.fn.dotdotdot.debug=function(t){};var p=1,g=t.fn.html;t.fn.html=function(n){return n!=e&&!t.isFunction(n)&&this.data("dotdotdot")?this.trigger("update",[n]):g.apply(this,arguments)};var v=t.fn.text;t.fn.text=function(n){return n!=e&&!t.isFunction(n)&&this.data("dotdotdot")?(n=t("<div />").text(n).html(),this.trigger("update",[n])):v.apply(this,arguments)}}}(jQuery),jQuery(document).ready(function(t){t(".dot-ellipsis").each(function(){var e=t(this).hasClass("dot-resize-update"),n=t(this).hasClass("dot-timer-update"),r=0,a=t(this).attr("class").split(/\s+/);t.each(a,function(t,e){var n=e.match(/^dot-height-(\d+)$/);null!==n&&(r=Number(n[1]))});var o={};n&&(o.watch=!0),e&&(o.watch="window"),r>0&&(o.height=r),t(this).dotdotdot(o)})}),jQuery(window).on("load",function(){jQuery(".dot-ellipsis.dot-load-update").trigger("update.dot")});
23//          
24/*
25 * jQuery Easing v1.3.2 - http://gsgd.co.uk/sandbox/jquery/easing/
26 * Open source under the BSD License.
27 * Copyright © 2008 George McGinley Smith
28 * All rights reserved.
29 * https://raw.github.com/gdsmith/jquery-easing/master/LICENSE
30*/
31
32(function(h){h.extend(h.easing,{easeInQuad:function(e,a,c,b,d){return b*(a/=d)*a+c},easeOutQuad:function(e,a,c,b,d){return-b*(a/=d)*(a-2)+c},easeInOutQuad:function(e,a,c,b,d){return 1>(a/=d/2)?b/2*a*a+c:-b/2*(--a*(a-2)-1)+c},easeInCubic:function(e,a,c,b,d){return b*(a/=d)*a*a+c},easeOutCubic:function(e,a,c,b,d){return b*((a=a/d-1)*a*a+1)+c},easeInOutCubic:function(e,a,c,b,d){return 1>(a/=d/2)?b/2*a*a*a+c:b/2*((a-=2)*a*a+2)+c},easeInQuart:function(e,a,c,b,d){return b*(a/=d)*a*a*a+c},easeOutQuart:function(e,a,c,b,d){return-b*((a=a/d-1)*a*a*a-1)+c},easeInOutQuart:function(e,a,c,b,d){return 1>(a/=d/2)?b/2*a*a*a*a+c:-b/2*((a-=2)*a*a*a-2)+c},easeInQuint:function(e,a,c,b,d){return b*(a/=d)*a*a*a*a+c},easeOutQuint:function(e,a,c,b,d){return b*((a=a/d-1)*a*a*a*a+1)+c},easeInOutQuint:function(e,a,c,b,d){return 1>(a/=d/2)?b/2*a*a*a*a*a+c:b/2*((a-=2)*a*a*a*a+2)+c},easeInSine:function(e,a,c,b,d){return-b*Math.cos(a/d*(Math.PI/2))+b+c},easeOutSine:function(e,a,c,b,d){return b*Math.sin(a/d*(Math.PI/2))+c},easeInOutSine:function(e,a,c,b,d){return-b/2*(Math.cos(Math.PI*a/d)-1)+c},easeInExpo:function(e,a,c,b,d){return 0==a?c:b*Math.pow(2,10*(a/d-1))+c},easeOutExpo:function(e,a,c,b,d){return a==d?c+b:b*(-Math.pow(2,-10*a/d)+1)+c},easeInOutExpo:function(e,a,c,b,d){return 0==a?c:a==d?c+b:1>(a/=d/2)?b/2*Math.pow(2,10*(a-1))+c:b/2*(-Math.pow(2,-10*--a)+2)+c},easeInCirc:function(e,a,c,b,d){return-b*(Math.sqrt(1-(a/=d)*a)-1)+c},easeOutCirc:function(e,a,c,b,d){return b*Math.sqrt(1-(a=a/d-1)*a)+c},easeInOutCirc:function(e,a,c,b,d){return 1>(a/=d/2)?-b/2*(Math.sqrt(1-a*a)-1)+c:b/2*(Math.sqrt(1-(a-=2)*a)+1)+c},easeInElastic:function(e,a,c,b,d){e=1.70158;var f=0,g=b;if(0==a)return c;if(1==(a/=d))return c+b;f||(f=.3*d);g<Math.abs(b)?(g=b,e=f/4):e=f/(2*Math.PI)*Math.asin(b/g);return-(g*Math.pow(2,10*--a)*Math.sin(2*(a*d-e)*Math.PI/f))+c},easeOutElastic:function(e,a,c,b,d){e=1.70158;var f=0,g=b;if(0==a)return c;if(1==(a/=d))return c+b;f||(f=.3*d);g<Math.abs(b)?(g=b,e=f/4):e=f/(2*Math.PI)*Math.asin(b/g);return g*Math.pow(2,-10*a)*Math.sin(2*(a*d-e)*Math.PI/f)+b+c},easeInOutElastic:function(e,a,c,b,d){e=1.70158;var f=0,g=b;if(0==a)return c;if(2==(a/=d/2))return c+b;f||(f=.3*d*1.5);g<Math.abs(b)?(g=b,e=f/4):e=f/(2*Math.PI)*Math.asin(b/g);return 1>a?-.5*g*Math.pow(2,10*--a)*Math.sin(2*(a*d-e)*Math.PI/f)+c:g*Math.pow(2,-10*--a)*Math.sin(2*(a*d-e)*Math.PI/f)*.5+b+c},easeInBack:function(e,a,c,b,d,f){void 0==f&&(f=1.70158);return b*(a/=d)*a*((f+1)*a-f)+c}
32,easeOutBack:function(e,a,c,b,d,f){void 0==f&&(f=1.70158);return b*((a=a/d-1)*a*((f+1)*a+f)+1)+c},easeInOutBack:function(e,a,c,b,d,f){void 0==f&&(f=1.70158);return 1>(a/=d/2)?b/2*a*a*(((f*=1.525)+1)*a-f)+c:b/2*((a-=2)*a*(((f*=1.525)+1)*a+f)+2)+c},easeInBounce:function(e,a,c,b,d){return b-h.easing.easeOutBounce(e,d-a,0,b,d)+c},easeOutBounce:function(e,a,c,b,d){return(a/=d)<1/2.75?7.5625*b*a*a+c:a<2/2.75?b*(7.5625*(a-=1.5/2.75)*a+.75)+c:a<2.5/2.75?b*(7.5625*(a-=2.25/2.75)*a+.9375)+c:b*(7.5625*(a-=2.625/2.75)*a+.984375)+c},easeInOutBounce:function(e,a,c,b,d){return a<d/2?.5*h.easing.easeInBounce(e,2*a,0,b,d)+c:.5*h.easing.easeOutBounce(e,2*a-d,0,b,d)+.5*b+c}})})(jQuery);
33//          
34/*!
35 * jQuery Mousewheel 3.1.13
36 *
37 * Copyright 2015 jQuery Foundation and other contributors
38 * Released under the MIT license.
39 * http://jquery.org/license
40 */
41!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
42//          
43/* == malihu jquery custom scrollbar plugin == Version: 3.1.5, License: MIT License (MIT) */�
vendor: 26,309 bytes, lines 43-44
43
44!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e:e(jQuery,window,document)}(function(e){!function(t){var o="function"==typeof define&&define.amd,a="undefined"!=typeof module&&module.exports,n="https:"==document.location.protocol?"https:":"http:",i="cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js";o||(a?require("jquery-mousewheel")(e):e.event.special.mousewheel||e("head").append(decodeURI("%3Cscript src="+n+"//"+i+"%3E%3C/script%3E"))),t()}(function(){var t,o="mCustomScrollbar",a="mCS",n=".mCustomScrollbar",i={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,documentTouchScroll:!0,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:"auto",autoUpdateTimeout:60},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},r=0,l={},s=window.attachEvent&&!window.addEventListener?1:0,c=!1,d=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],u={init:function(t){var t=e.extend(!0,{},i,t),o=f.call(this);if(t.live){var s=t.liveSelector||this.selector||n,c=e(s);if("off"===t.live)return void m(s);l[s]=setTimeout(function(){c.mCustomScrollbar(t),"once"===t.live&&c.length&&m(s)},500)}else m(s);return t.setWidth=t.set_width?t.set_width:t.setWidth,t.setHeight=t.set_height?t.set_height:t.setHeight,t.axis=t.horizontalScroll?"x":p(t.axis),t.scrollInertia=t.scrollInertia>0&&t.scrollInertia<17?17:t.scrollInertia,"object"!=typeof t.mouseWheel&&1==t.mouseWheel&&(t.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),t.mouseWheel.scrollAmount=t.mouseWheelPixels?t.mouseWheelPixels:t.mouseWheel.scrollAmount,t.mouseWheel.normalizeDelta=t.advanced.normalizeMouseWheelDelta?t.advanced.normalizeMouseWheelDelta:t.mouseWheel.normalizeDelta,t.scrollButtons.scrollType=g(t.scrollButtons.scrollType),h(t),e(o).each(function(){var o=e(this);if(!o.data(a)){o.data(a,{idx:++r,opt:t,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:o.css("direction"),cbOffsets:null,trigger:null,poll:{size:{o:0,n:0},img:{o:0,n:0},change:{o:0,n:0}}});var n=o.data(a),i=n.opt,l=o.data("mcs-axis"),s=o.data("mcs-scrollbar-position"),c=o.data("mcs-theme");l&&(i.axis=l),s&&(i.scrollbarPosition=s),c&&(i.theme=c,h(i)),v.call(this),n&&i.callbacks.onCreate&&"function"==typeof i.callbacks.onCreate&&i.callbacks.onCreate.call(this),e("#mCSB_"+n.idx+"_container img:not(."+d[2]+")").addClass(d[2]),u.update.call(null,o)}})},update:function(t,o){var n=t||f.call(this);return e(n).each(function(){var t=e(this);if(t.data(a)){var n=t.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container"),l=e("#mCSB_"+n.idx),s=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];if(!r.length)return;n.tweenRunning&&Q(t),o&&n&&i.callbacks.onBeforeUpdate&&"function"==typeof i.callbacks.onBeforeUpdate&&i.callbacks.onBeforeUpdate.call(this),t.hasClass(d[3])&&t.removeClass(d[3]),t.hasClass(d[4])&&t.removeClass(d[4]),l.css("max-height","none"),l.height()!==t.height()&&l.css("max-height",t.height()),_.call(this),"y"===i.axis||i.advanced.autoExpandHorizontalScroll||r.css("width",x(r)),n.overflowed=y.call(this),M.call(this),i.autoDraggerLength&&S.call(this),b.call(this),T.call(this);var c=[Math.abs(r[0].offsetTop),Math.abs(r[0].offsetLeft)];"x"!==i.axis&&(n.overflowed[0]?s[0].height()>s[0].parent().height()?B.call(this):(G(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}),n.contentReset.y=null):(B.call(this),"y"===i.axis?k.call(this):"yx"===i.axis&&n.overflowed[1]&&G(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==i.axis&&(n.overflowed[1]?s[1].width()>s[1].parent().width()?B.call(this):(G(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}),n.contentReset.x=null):(B.call(this),"x"===i.axis?k.call(this):"yx"===i.axis&&n.overflowed[0]&&G(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),o&&n&&(2===o&&i.callbacks.onImageLoad&&"function"==typeof i.callbacks.onImageLoad?i.callbacks.onImageLoad.call(this):3===o&&i.callbacks.onSelectorChange&&"function"==typeof i.callbacks.onSelectorChange?i.callbacks.onSelectorChange.call(this):i.callbacks.onUpdate&&"function"==typeof i.callbacks.onUpdate&&i.callbacks.onUpdate.call(this)),N.call(this)}})},scrollTo:function(t,o){if("undefined"!=typeof t&&null!=t){var n=f.call(this);return e(n).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l={trigger:"external",scrollInertia:r.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},s=e.extend(!0,{},l,o),c=Y.call(this,t),d=s.scrollInertia>0&&s.scrollInertia<17?17:s.scrollInertia;c[0]=X.call(this,c[0],"y"),c[1]=X.call(this,c[1],"x"),s.moveDragger&&(c[0]*=i.scrollRatio.y,c[1]*=i.scrollRatio.x),s.dur=ne()?0:d,setTimeout(function(){null!==c[0]&&"undefined"!=typeof c[0]&&"x"!==r.axis&&i.overflowed[0]&&(s.dir="y",s.overwrite="all",G(n,c[0].toString(),s)),null!==c[1]&&"undefined"!=typeof c[1]&&"y"!==r.axis&&i.overflowed[1]&&(s.dir="x",s.overwrite="none",G(n,c[1].toString(),s))},s.timeout)}})}},stop:function(){var t=f.call(this);return e(t).each(function(){var t=e(this);t.data(a)&&Q(t)})},disable:function(t){var o=f.call(this);return e(o).each(function(){var o=e(this);if(o.data(a)){o.data(a);N.call(this,"remove"),k.call(this),t&&B.call(this),M.call(this,!0),o.addClass(d[3])}})},destroy:function(){var t=f.call(this);return e(t).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx),s=e("#mCSB_"+i.idx+"_container"),c=e(".mCSB_"+i.idx+"_scrollbar");r.live&&m(r.liveSelector||e(t).selector),N.call(this,"remove"),k.call(this),B.call(this),n.removeData(a),$(this,"mcs"),c.remove(),s.find("img."+d[2]).removeClass(d[2]),l.replaceWith(s.contents()),n.removeClass(o+" _"+a+"_"+i.idx+" "+d[6]+" "+d[7]+" "+d[5]+" "+d[3]).addClass(d[4])}})}},f=function(){return"object"!=typeof e(this)||e(this).length<1?n:this},h=function(t){var o=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],a=["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"],n=["minimal","minimal-dark"],i=["minimal","minimal-dark"],r=["minimal","minimal-dark"];t.autoDraggerLength=e.inArray(t.theme,o)>-1?!1:t.autoDraggerLength,t.autoExpandScrollbar=e.inArray(t.theme,a)>-1?!1:t.autoExpandScrollbar,t.scrollButtons.enable=e.inArray(t.theme,n)>-1?!1:t.scrollButtons.enable,t.autoHideScrollbar=e.inArray(t.theme,i)>-1?!0:t.autoHideScrollbar,t.scrollbarPosition=e.inArray(t.theme,r)>-1?"outside":t.scrollbarPosition},m=function(e){l[e]&&(clearTimeout(l[e]),$(l,e))},p=function(e){return"yx"===e||"xy"===e||"auto"===e?"yx":"x"===e||"horizontal"===e?"x":"y"},g=function(e){return"stepped"===e||"pixels"===e||"step"===e||"click"===e?"stepped":"stepless"},v=function(){var t=e(this),n=t.data(a),i=n.opt,r=i.autoExpandScrollbar?" "+d[1]+"_expand":"",l=["<div id='mCSB_"+n.idx+"_scrollbar_vertical' class='mCSB_scrollTools mCSB_"+n.idx+"_scrollbar mCS-"+i.theme+" mCSB_scrollTools_vertical"+r+"'><div class='"+d[12]+"'><div id='mCSB_"+n.idx+"_dragger_vertical' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>","<div id='mCSB_"+n.idx+"_scrollbar_horizontal' class='mCSB_scrollTools mCSB_"+n.idx+"_scrollbar mCS-"+i.theme+" mCSB_scrollTools_horizontal"+r+"'><div class='"+d[12]+"'><div id='mCSB_"+n.idx+"_dragger_horizontal' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>"],s="yx"===i.axis?"mCSB_vertical_horizontal":"x"===i.axis?"mCSB_horizontal":"mCSB_vertical",c="yx"===i.axis?l[0]+l[1]:"x"===i.axis?l[1]:l[0],u="yx"===i.axis?"<div id='mCSB_"+n.idx+"_container_wrapper' class='mCSB_container_wrapper' />":"",f=i.autoHideScrollbar?" "+d[6]:"",h="x"!==i.axis&&"rtl"===n.langDir?" "+d[7]:"";i.setWidth&&t.css("width",i.setWidth),i.setHeight&&t.css("height",i.setHeight),i.setLeft="y"!==i.axis&&"rtl"===n.langDir?"989999px":i.setLeft,t.addClass(o+" _"+a+"_"+n.idx+f+h).wrapInner("<div id='mCSB_"+n.idx+"' class='mCustomScrollBox mCS-"+i.theme+" "+s+"'><div id='mCSB_"+n.idx+"_container' class='mCSB_container' style='position:relative; top:"+i.setTop+"; left:"+i.setLeft+";' dir='"+n.langDir+"' /></div>");var m=e("#mCSB_"+n.idx),p=e("#mCSB_"+n.idx+"_container");"y"===i.axis||i.advanced.autoExpandHorizontalScroll||p.css("width",x(p)),"outside"===i.scrollbarPosition?("static"===t.css("position")&&t.css("position","relative"),t.css("overflow","visible"),m.addClass("mCSB_outside").after(c)):(m.addClass("mCSB_inside").append(c),p.wrap(u)),w.call(this);var g=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];g[0].css("min-height",g[0].height()),g[1].css("min-width",g[1].width())},x=function(t){var o=[t[0].scrollWidth,Math.max.apply(Math,t.children().map(function(){return e(this).outerWidth(!0)}).get())],a=t.parent().width();return o[0]>a?o[0]:o[1]>a?o[1]:"100%"},_=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx+"_container");if(n.advanced.autoExpandHorizontalScroll&&"y"!==n.axis){i.css({width:"auto","min-width":0,"overflow-x":"scroll"});var r=Math.ceil(i[0].scrollWidth);3===n.advanced.autoExpandHorizontalScroll||2!==n.advanced.autoExpandHorizontalScroll&&r>i.parent().width()?i.css({width:r,"min-width":"100%","overflow-x":"inherit"}):i.css({"overflow-x":"inherit",position:"absolute"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:Math.ceil(i[0].getBoundingClientRect().right+.4)-Math.floor(i[0].getBoundingClientRect().left),"min-width":"100%",position:"relative"}).unwrap()}},w=function(){var t=e(this),o=t.data(a),n=o.opt,i=e(".mCSB_"+o.idx+"_scrollbar:first"),r=oe(n.scrollButtons.tabindex)?"tabindex='"+n.scrollButtons.tabindex+"'":"",l=["<a href='#' class='"+d[13]+"' "+r+" />","<a href='#' class='"+d[14]+"' "+r+" />","<a href='#' class='"+d[15]+"' "+r+" />","<a href='#' class='"+d[16]+"' "+r+" />"],s=["x"===n.axis?l[2]:l[0],"x"===n.axis?l[3]:l[1],l[2],l[3]];n.scrollButtons.enable&&i.prepend(s[0]).append(s[1]).next(".mCSB_scrollTools").prepend(s[2]).append(s[3])},S=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")],l=[n.height()/i.outerHeight(!1),n.width()/i.outerWidth(!1)],c=[parseInt(r[0].css("min-height")),Math.round(l[0]*r[0].parent().height()),parseInt(r[1].css("min-width")),Math.round(l[1]*r[1].parent().width())],d=s&&c[1]<c[0]?c[0]:c[1],u=s&&c[3]<c[2]?c[2]:c[3];r[0].css({height:d,"max-height":r[0].parent().height()-10}).find(".mCSB_dragger_bar").css({"line-height":c[0]+"px"}),r[1].css({width:u,"max-width":r[1].parent().width()-10})},b=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")],l=[i.outerHeight(!1)-n.height(),i.outerWidth(!1)-n.width()],s=[l[0]/(r[0].parent().height()-r[0].height()),l[1]/(r[1].parent().width()-r[1].width())];o.scrollRatio={y:s[0],x:s[1]}},C=function(e,t,o){var a=o?d[0]+"_expanded":"",n=e.closest(".mCSB_scrollTools");"active"===t?(e.toggleClass(d[0]+" "+a),n.toggleClass(d[1]),e[0]._draggable=e[0]._draggable?0:1):e[0]._draggable||("hide"===t?(e.removeClass(d[0]),n.removeClass(d[1])):(e.addClass(d[0]),n.addClass(d[1])))},y=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=null==o.overflowed?i.height():i.outerHeight(!1),l=null==o.overflowed?i.width():i.outerWidth(!1),s=i[0].scrollHeight,c=i[0].scrollWidth;return s>r&&(r=s),c>l&&(l=c),[r>n.height(),l>n.width()]},B=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx),r=e("#mCSB_"+o.idx+"_container"),l=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")];if(Q(t),("x"!==n.axis&&!o.overflowed[0]||"y"===n.axis&&o.overflowed[0])&&(l[0].add(r).css("top",0),G(t,"_resetY")),"y"!==n.axis&&!o.overflowed[1]||"x"===n.axis&&o.overflowed[1]){var s=dx=0;"rtl"===o.langDir&&(s=i.width()-r.outerWidth(!1),dx=Math.abs(s/o.scrollRatio.x)),r.css("left",s),l[1].css("left",dx),G(t,"_resetX")}},T=function(){function t(){r=setTimeout(function(){e.event.special.mousewheel?(clearTimeout(r),W.call(o[0])):t()},100)}var o=e(this),n=o.data(a),i=n.opt;if(!n.bindEvents){if(I.call(this),i.contentTouchScroll&&D.call(this),E.call(this),i.mouseWheel.enable){var r;t()}P.call(this),U.call(this),i.advanced.autoScrollOnFocus&&H.call(this),i.scrollButtons.enable&&F.call(this),i.keyboard.enable&&q.call(this),n.bindEvents=!0}},k=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=".mCSB_"+o.idx+"_scrollbar",l=e("#mCSB_"+o.idx+",#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,"+r+" ."+d[12]+",#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal,"+r+">a"),s=e("#mCSB_"+o.idx+"_container");n.advanced.releaseDraggableSelectors&&l.add(e(n.advanced.releaseDraggableSelectors)),n.advanced.extraDraggableSelectors&&l.add(e(n.advanced.extraDraggableSelectors)),o.bindEvents&&(e(document).add(e(!A()||top.document)).unbind("."+i),l.each(function(){e(this).unbind("."+i)}),clearTimeout(t[0]._focusTimeout),$(t[0],"_focusTimeout"),clearTimeout(o.sequential.step),$(o.sequential,"step"),clearTimeout(s[0].onCompleteTimeout),$(s[0],"onCompleteTimeout"),o.bindEvents=!1)},M=function(t){var o=e(this),n=o.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container_wrapper"),l=r.length?r:e("#mCSB_"+n.idx+"_container"),s=[e("#mCSB_"+n.idx+"_scrollbar_vertical"),e("#mCSB_"+n.idx+"_scrollbar_horizontal")],c=[s[0].find(".mCSB_dragger"),s[1].find(".mCSB_dragger")];"x"!==i.axis&&(n.overflowed[0]&&!t?(s[0].add(c[0]).add(s[0].children("a")).css("display","block"),l.removeClass(d[8]+" "+d[10])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[0].css("display","none"),l.removeClass(d[10])):(s[0].css("display","none"),l.addClass(d[10])),l.addClass(d[8]))),"y"!==i.axis&&(n.overflowed[1]&&!t?(s[1].add(c[1]).add(s[1].children("a")).css("display","block"),l.removeClass(d[9]+" "+d[11])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[1].css("display","none"),l.removeClass(d[11])):(s[1].css("display","none"),l.addClass(d[11])),l.addClass(d[9]))),n.overflowed[0]||n.overflowed[1]?o.removeClass(d[5]):o.addClass(d[5])},O=function(t){var o=t.type,a=t.target.ownerDocument!==document&&null!==frameElement?[e(frameElement).offset().top,e(frameElement).offset().left]:null,n=A()&&t.target.ownerDocument!==top.document&&null!==frameElement?[e(t.view.frameElement).offset().top,e(t.view.frameElement).offset().left]:[0,0];switch(o){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return a?[t.originalEvent.pageY-a[0]+n[0],t.originalEvent.pageX-a[1]+n[1],!1]:[t.originalEvent.pageY,t.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var i=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],r=t.originalEvent.touches.length||t.originalEvent.changedTouches.length;return t.target.ownerDocument!==document?[i.screenY,i.screenX,r>1]:[i.pageY,i.pageX,r>1];default:return a?[t.pageY-a[0]+n[0],t.pageX-a[1]+n[1],!1]:[t.pageY,t.pageX,!1]}},I=function(){function t(e,t,a,n){if(h[0].idleTimer=d.scrollInertia<233?250:0,o.attr("id")===f[1])var i="x",s=(o[0].offsetLeft-t+n)*l.scrollRatio.x;else var i="y",s=(o[0].offsetTop-e+a)*l.scrollRatio.y;G(r,s.toString(),{dir:i,drag:!0})}var o,n,i,r=e(this),l=r.data(a),d=l.opt,u=a+"_"+l.idx,f=["mCSB_"+l.idx+"_dragger_vertical","mCSB_"+l.idx+"_dragger_horizontal"],h=e("#mCSB_"+l.idx+"_container"),m=e("#"+f[0]+",#"+f[1]),p=d.advanced.releaseDraggableSelectors?m.add(e(d.advanced.releaseDraggableSelectors)):m,g=d.advanced.extraDraggableSelectors?e(!A()||top.document).add(e(d.advanced.extraDraggableSelectors)):e(!A()||top.document);m.bind("contextmenu."+u,function(e){e.preventDefault()}).bind("mousedown."+u+" touchstart."+u+" pointerdown."+u+" MSPointerDown."+u,function(t){if(t.stopImmediatePropagation(),t.preventDefault(),ee(t)){c=!0,s&&(document.onselectstart=function(){return!1}),L.call(h,!1),Q(r),o=e(this);var a=o.offset(),l=O(t)[0]-a.top,u=O(t)[1]-a.left,f=o.height()+a.top,m=o.width()+a.left;f>l&&l>0&&m>u&&u>0&&(n=l,i=u),C(o,"active",d.autoExpandScrollbar)}}).bind("touchmove."+u,function(e){e.stopImmediatePropagation(),e.preventDefault();var a=o.offset(),r=O(e)[0]-a.top,l=O(e)[1]-a.left;t(n,i,r,l)}),e(document).add(g).bind("mousemove."+u+" pointermove."+u+" MSPointerMove."+u,function(e){if(o){var a=o.offset(),r=O(e)[0]-a.top,l=O(e)[1]-a.left;if(n===r&&i===l)return;t(n,i,r,l)}}).add(p).bind("mouseup."+u+" touchend."+u+" pointerup."+u+" MSPointerUp."+u,function(){o&&(C(o,"active",d.autoExpandScrollbar),o=null),c=!1,s&&(document.onselectstart=null),L.call(h,!0)})},D=function(){function o(e){if(!te(e)||c||O(e)[2])return void(t=0);t=1,b=0,C=0,d=1,y.removeClass("mCS_touch_action");var o=I.offset();u=O(e)[0]-o.top,f=O(e)[1]-o.left,z=[O(e)[0],O(e)[1]]}function n(e){if(te(e)&&!c&&!O(e)[2]&&(T.documentTouchScroll||e.preventDefault(),e.stopImmediatePropagation(),(!C||b)&&d)){g=K();var t=M.offset(),o=O(e)[0]-t.top,a=O(e)[1]-t.left,n="mcsLinearOut";if(E.push(o),W.push(a),z[2]=Math.abs(O(e)[0]-z[0]),z[3]=Math.abs(O(e)[1]-z[1]),B.overflowed[0])var i=D[0].parent().height()-D[0].height(),r=u-o>0&&o-u>-(i*B.scrollRatio.y)&&(2*z[3]<z[2]||"yx"===T.axis);if(B.overflowed[1])var l=D[1].parent().width()-D[1].width(),h=f-a>0&&a-f>-(l*B.scrollRatio.x)&&(2*z[2]<z[3]||"yx"===T.axis);r||h?(U||e.preventDefault(),b=1):(C=1,y.addClass("mCS_touch_action")),U&&e.preventDefault(),w="yx"===T.axis?[u-o,f-a]:"x"===T.axis?[null,f-a]:[u-o,null],I[0].idleTimer=250,B.overflowed[0]&&s(w[0],R,n,"y","all",!0),B.overflowed[1]&&s(w[1],R,n,"x",L,!0)}}function i(e){if(!te(e)||c||O(e)[2])return void(t=0);t=1,e.stopImmediatePropagation(),Q(y),p=K();var o=M.offset();h=O(e)[0]-o.top,m=O(e)[1]-o.left,E=[],W=[]}function r(e){if(te(e)&&!c&&!O(e)[2]){d=0,e.stopImmediatePropagation(),b=0,C=0,v=K();var t=M.offset(),o=O(e)[0]-t.top,a=O(e)[1]-t.left;if(!(v-g>30)){_=1e3/(v-p);var n="mcsEaseOut",i=2.5>_,r=i?[E[E.length-2],W[W.length-2]]:[0,0];x=i?[o-r[0],a-r[1]]:[o-h,a-m];var u=[Math.abs(x[0]),Math.abs(x[1])];_=i?[Math.abs(x[0]/4),Math.abs(x[1]/4)]:[_,_];var f=[Math.abs(I[0].offsetTop)-x[0]*l(u[0]/_[0],_[0]),Math.abs(I[0].offsetLeft)-x[1]*l(u[1]/_[1],_[1])];w="yx"===T.axis?[f[0],f[1]]:"x"===T.axis?[null,f[1]]:[f[0],null],S=[4*u[0]+T.scrollInertia,4*u[1]+T.scrollInertia];var y=parseInt(T.contentTouchScroll)||0;w[0]=u[0]>y?w[0]:0,w[1]=u[1]>y?w[1]:0,B.overflowed[0]&&s(w[0],S[0],n,"y",L,!1),B.overflowed[1]&&s(w[1],S[1],n,"x",L,!1)}}}function l(e,t){var o=[1.5*t,2*t,t/1.5,t/2];return e>90?t>4?o[0]:o[3]:e>60?t>3?o[3]:o[2]:e>30?t>8?o[1]:t>6?o[0]:t>4?t:o[2]:t>8?t:o[3]}function s(e,t,o,a,n,i){e&&G(y,e.toString(),{dur:t,scrollEasing:o,dir:a,overwrite:n,drag:i})}var d,u,f,h,m,p,g,v,x,_,w,S,b,C,y=e(this),B=y.data(a),T=B.opt,k=a+"_"+B.idx,M=e("#mCSB_"+B.idx),I=e("#mCSB_"+B.idx+"_container"),D=[e("#mCSB_"+B.idx+"_dragger_vertical"),e("#mCSB_"+B.idx+"_dragger_horizontal")],E=[],W=[],R=0,L="yx"===T.axis?"none":"all",z=[],P=I.find("iframe"),H=["touchstart."+k+" pointerdown."+k+" MSPointerDown."+k,"touchmove."+k+" pointermove."+k+" MSPointerMove."+k,"touchend."+k+" pointerup."+k+" MSPointerUp."+k],U=void 0!==document.body.style.touchAction&&""!==document.body.style.touchAction;I.bind(H[0],function(e){o(e)}).bind(H[1],function(e){n(e)}),M.bind(H[0],function(e){i(e)}).bind(H[2],function(e){r(e)}),P.length&&P.each(function(){e(this).bind("load",function(){A(this)&&e(this.contentDocument||this.contentWindow.document).bind(H[0],function(e){o(e),i(e)}).bind(H[1],function(e){n(e)}).bind(H[2],function(e){r(e)})})})},E=function(){function o(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function n(e,t,o){d.type=o&&i?"stepped":"stepless",d.scrollAmount=10,j(r,e,t,"mcsLinearOut",o?60:null)}var i,r=e(this),l=r.data(a),s=l.opt,d=l.sequential,u=a+"_"+l.idx,f=e("#mCSB_"+l.idx+"_container"),h=f.parent();f.bind("mousedown."+u,function(){t||i||(i=1,c=!0)}).add(document).bind("mousemove."+u,function(e){if(!t&&i&&o()){var a=f.offset(),r=O(e)[0]-a.top+f[0].offsetTop,c=O(e)[1]-a.left+f[0].offsetLeft;r>0&&r<h.height()&&c>0&&c<h.width()?d.step&&n("off",null,"stepped"):("x"!==s.axis&&l.overflowed[0]&&(0>r?n("on",38):r>h.height()&&n("on",40)),"y"!==s.axis&&l.overflowed[1]&&(0>c?n("on",37):c>h.width()&&n("on",39)))}}).bind("mouseup."+u+" dragend."+u,function(){t||(i&&(i=0,n("off",null)),c=!1)})},W=function(){function t(t,a){if(Q(o),!z(o,t.target)){var r="auto"!==i.mouseWheel.deltaFactor?parseInt(i.mouseWheel.deltaFactor):s&&t.deltaFactor<100?100:t.deltaFactor||100,d=i.scrollInertia;if("x"===i.axis||"x"===i.mouseWheel.axis)var u="x",f=[Math.round(r*n.scrollRatio.x),parseInt(i.mouseWheel.scrollAmount)],h="auto"!==i.mouseWheel.scrollAmount?f[1]:f[0]>=l.width()?.9*l.width():f[0],m=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetLeft),p=c[1][0].offsetLeft,g=c[1].parent().width()-c[1].width(),v="y"===i.mouseWheel.axis?t.deltaY||a:t.deltaX;else var u="y",f=[Math.round(r*n.scrollRatio.y),parseInt(i.mouseWheel.scrollAmount)],h="auto"!==i.mouseWheel.scrollAmount?f[1]:f[0]>=l.height()?.9*l.height():f[0],m=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetTop),p=c[0][0].offsetTop,g=c[0].parent().height()-c[0].height(),v=t.deltaY||a;"y"===u&&!n.overflowed[0]||"x"===u&&!n.overflowed[1]||((i.mouseWheel.invert||t.webkitDirectionInvertedFromDevice)&&(v=-v),i.mouseWheel.normalizeDelta&&(v=0>v?-1:1),(v>0&&0!==p||0>v&&p!==g||i.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),t.deltaFactor<5&&!i.mouseWheel.normalizeDelta&&(h=t.deltaFactor,d=17),G(o,(m-v*h).toString(),{dir:u,dur:d}))}}if(e(this).data(a)){var o=e(this),n=o.data(a),i=n.opt,r=a+"_"+n.idx,l=e("#mCSB_"+n.idx),c=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")],d=e("#mCSB_"+n.idx+"_container").find("iframe");d.length&&d.each(function(){e(this).bind("load",function(){A(this)&&e(this.contentDocument||this.contentWindow.document).bind("mousewheel."+r,function(e,o){t(e,o)})})}),l.bind("mousewheel."+r,function(e,o){t(e,o)})}},R=new Object,A=function(t){var o=!1,a=!1,n=null;if(void 0===t?a="#empty":void 0!==e(t).attr("id")&&(a=e(t).attr("id")),a!==!1&&void 0!==R[a])return R[a];if(t){try{var i=t.contentDocument||t.contentWindow.document;n=i.body.innerHTML}catch(r){}o=null!==n}else{try{var i=top.document;n=i.body.innerHTML}catch(r){}o=null!==n}return a!==!1&&(R[a]=o),o},L=function(e){var t=this.find("iframe");if(t.length){var o=e?"auto":"none";t.css("pointer-events",o)}},z=function(t,o){var n=o.nodeName.toLowerCase(),i=t.data(a).opt.mouseWheel.disableOver,r=["select","textarea"];return e.inArray(n,i)>-1&&!(e.inArray(n,r)>-1&&!e(o).is(":focus"))},P=function(){var t,o=e(this),n=o.data(a),i=a+"_"+n.idx,r=e("#mCSB_"+n.idx+"_container"),l=r.parent(),s=e(".mCSB_"+n.idx+"_scrollbar ."+d[12]);s.bind("mousedown."+i+" touchstart."+i+" pointerdown."+i+" MSPointerDown."+i,function(o){c=!0,e(o.target).hasClass("mCSB_dragger")||(t=1)}).bind("touchend."+i+" pointerup."+i+" MSPointerUp."+i,function(){c=!1}).bind("click."+i,function(a){if(t&&(t=0,e(a.target).hasClass(d[12])||e(a.target).hasClass("mCSB_draggerRail"))){Q(o);var i=e(this),s=i.find(".mCSB_dragger");if(i.parent(".mCSB_scrollTools_horizontal").length>0){if(!n.overflowed[1])return;var c="x",u=a.pageX>s.offset().left?-1:1,f=Math.abs(r[0].offsetLeft)-u*(.9*l.width())}else{if(!n.overflowed[0])return;var c="y",u=a.pageY>s.offset().top?-1:1,f=Math.abs(r[0].offsetTop)-u*(.9*l.height())}G(o,f.toString(),{dir:c,scrollEasing:"mcsEaseInOut"})}})},H=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=e("#mCSB_"+o.idx+"_container"),l=r.parent();r.bind("focusin."+i,function(){var o=e(document.activeElement),a=r.find(".mCustomScrollBox").length,i=0;o.is(n.advanced.autoScrollOnFocus)&&(Q(t),clearTimeout(t[0]._focusTimeout),t[0]._focusTimer=a?(i+17)*a:0,t[0]._focusTimeout=setTimeout(function(){var e=[ae(o)[0],ae(o)[1]],a=[r[0].offsetTop,r[0].offsetLeft],s=[a[0]+e[0]>=0&&a[0]+e[0]<l.height()-o.outerHeight(!1),a[1]+e[1]>=0&&a[0]+e[1]<l.width()-o.outerWidth(!1)],c="yx"!==n.axis||s[0]||s[1]?"all":"none";"x"===n.axis||s[0]||G(t,e[0].toString(),{dir:"y",scrollEasing:"mcsEaseInOut",overwrite:c,dur:i}),"y"===n.axis||s[1]||G(t,e[1].toString(),{dir:"x",scrollEasing:"mcsEaseInOut",overwrite:c,dur:i})},t[0]._focusTimer))})},U=function(){var t=e(this),o=t.data(a),n=a+"_"+o.idx,i=e("#mCSB_"+o.idx+"_container").parent();i.bind("scroll."+n,function(){0===i.scrollTop()&&0===i.scrollLeft()||e(".mCSB_"+o.idx+"_scrollbar").css("visibility","hidden")})},F=function(){var t=e(this),o=t.data(a),n=o.opt,i=o.sequential,r=a+"_"+o.idx,l=".mCSB_"+o.idx+"_scrollbar",s=e(l+">a");s.bind("contextmenu."+r,function(e){e.preventDefault()}).bind("mousedown."+r+" touchstart."+r+" pointerdown."+r+" MSPointerDown."+r+" mouseup."+r+" touchend."+r+" pointerup."+r+" MSPointerUp."+r+" mouseout."+r+" pointerout."+r+" MSPointerOut."+r+" click."+r,function(a){function r(e,o){i.scrollAmount=n.scrollButtons.scrollAmount,j(t,e,o)}if(a.preventDefault(),ee(a)){var l=e(this).attr("class");switch(i.type=n.scrollButtons.scrollType,a.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===i.t
vendor: 7,775 bytes, lines 44-45
44ype)return;c=!0,o.tweenRunning=!1,r("on",l);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===i.type)return;c=!1,i.dir&&r("off",l);break;case"click":if("stepped"!==i.type||o.tweenRunning)return;r("on",l)}}})},q=function(){function t(t){function a(e,t){r.type=i.keyboard.scrollType,r.scrollAmount=i.keyboard.scrollAmount,"stepped"===r.type&&n.tweenRunning||j(o,e,t)}switch(t.type){case"blur":n.tweenRunning&&r.dir&&a("off",null);break;case"keydown":case"keyup":var l=t.keyCode?t.keyCode:t.which,s="on";if("x"!==i.axis&&(38===l||40===l)||"y"!==i.axis&&(37===l||39===l)){if((38===l||40===l)&&!n.overflowed[0]||(37===l||39===l)&&!n.overflowed[1])return;"keyup"===t.type&&(s="off"),e(document.activeElement).is(u)||(t.preventDefault(),t.stopImmediatePropagation(),a(s,l))}else if(33===l||34===l){if((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type){Q(o);var f=34===l?-1:1;if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=Math.abs(c[0].offsetLeft)-f*(.9*d.width());else var h="y",m=Math.abs(c[0].offsetTop)-f*(.9*d.height());G(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}else if((35===l||36===l)&&!e(document.activeElement).is(u)&&((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type)){if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=35===l?Math.abs(d.width()-c.outerWidth(!1)):0;else var h="y",m=35===l?Math.abs(d.height()-c.outerHeight(!1)):0;G(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}}var o=e(this),n=o.data(a),i=n.opt,r=n.sequential,l=a+"_"+n.idx,s=e("#mCSB_"+n.idx),c=e("#mCSB_"+n.idx+"_container"),d=c.parent(),u="input,textarea,select,datalist,keygen,[contenteditable='true']",f=c.find("iframe"),h=["blur."+l+" keydown."+l+" keyup."+l];f.length&&f.each(function(){e(this).bind("load",function(){A(this)&&e(this.contentDocument||this.contentWindow.document).bind(h[0],function(e){t(e)})})}),s.attr("tabindex","0").bind(h[0],function(e){t(e)})},j=function(t,o,n,i,r){function l(e){u.snapAmount&&(f.scrollAmount=u.snapAmount instanceof Array?"x"===f.dir[0]?u.snapAmount[1]:u.snapAmount[0]:u.snapAmount);var o="stepped"!==f.type,a=r?r:e?o?p/1.5:g:1e3/60,n=e?o?7.5:40:2.5,s=[Math.abs(h[0].offsetTop),Math.abs(h[0].offsetLeft)],d=[c.scrollRatio.y>10?10:c.scrollRatio.y,c.scrollRatio.x>10?10:c.scrollRatio.x],m="x"===f.dir[0]?s[1]+f.dir[1]*(d[1]*n):s[0]+f.dir[1]*(d[0]*n),v="x"===f.dir[0]?s[1]+f.dir[1]*parseInt(f.scrollAmount):s[0]+f.dir[1]*parseInt(f.scrollAmount),x="auto"!==f.scrollAmount?v:m,_=i?i:e?o?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",w=!!e;return e&&17>a&&(x="x"===f.dir[0]?s[1]:s[0]),G(t,x.toString(),{dir:f.dir[0],scrollEasing:_,dur:a,onComplete:w}),e?void(f.dir=!1):(clearTimeout(f.step),void(f.step=setTimeout(function(){l()},a)))}function s(){clearTimeout(f.step),$(f,"step"),Q(t)}var c=t.data(a),u=c.opt,f=c.sequential,h=e("#mCSB_"+c.idx+"_container"),m="stepped"===f.type,p=u.scrollInertia<26?26:u.scrollInertia,g=u.scrollInertia<1?17:u.scrollInertia;switch(o){case"on":if(f.dir=[n===d[16]||n===d[15]||39===n||37===n?"x":"y",n===d[13]||n===d[15]||38===n||37===n?-1:1],Q(t),oe(n)&&"stepped"===f.type)return;l(m);break;case"off":s(),(m||c.tweenRunning&&f.dir)&&l(!0)}},Y=function(t){var o=e(this).data(a).opt,n=[];return"function"==typeof t&&(t=t()),t instanceof Array?n=t.length>1?[t[0],t[1]]:"x"===o.axis?[null,t[0]]:[t[0],null]:(n[0]=t.y?t.y:t.x||"x"===o.axis?null:t,n[1]=t.x?t.x:t.y||"y"===o.axis?null:t),"function"==typeof n[0]&&(n[0]=n[0]()),"function"==typeof n[1]&&(n[1]=n[1]()),n},X=function(t,o){if(null!=t&&"undefined"!=typeof t){var n=e(this),i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx+"_container"),s=l.parent(),c=typeof t;o||(o="x"===r.axis?"x":"y");var d="x"===o?l.outerWidth(!1)-s.width():l.outerHeight(!1)-s.height(),f="x"===o?l[0].offsetLeft:l[0].offsetTop,h="x"===o?"left":"top";switch(c){case"function":return t();case"object":var m=t.jquery?t:e(t);if(!m.length)return;return"x"===o?ae(m)[1]:ae(m)[0];case"string":case"number":if(oe(t))return Math.abs(t);if(-1!==t.indexOf("%"))return Math.abs(d*parseInt(t)/100);if(-1!==t.indexOf("-="))return Math.abs(f-parseInt(t.split("-=")[1]));if(-1!==t.indexOf("+=")){var p=f+parseInt(t.split("+=")[1]);return p>=0?0:Math.abs(p)}if(-1!==t.indexOf("px")&&oe(t.split("px")[0]))return Math.abs(t.split("px")[0]);if("top"===t||"left"===t)return 0;if("bottom"===t)return Math.abs(s.height()-l.outerHeight(!1));if("right"===t)return Math.abs(s.width()-l.outerWidth(!1));if("first"===t||"last"===t){var m=l.find(":"+t);return"x"===o?ae(m)[1]:ae(m)[0]}return e(t).length?"x"===o?ae(e(t))[1]:ae(e(t))[0]:(l.css(h,t),void u.update.call(null,n[0]))}}},N=function(t){function o(){return clearTimeout(f[0].autoUpdate),0===l.parents("html").length?void(l=null):void(f[0].autoUpdate=setTimeout(function(){return c.advanced.updateOnSelectorChange&&(s.poll.change.n=i(),s.poll.change.n!==s.poll.change.o)?(s.poll.change.o=s.poll.change.n,void r(3)):c.advanced.updateOnContentResize&&(s.poll.size.n=l[0].scrollHeight+l[0].scrollWidth+f[0].offsetHeight+l[0].offsetHeight+l[0].offsetWidth,s.poll.size.n!==s.poll.size.o)?(s.poll.size.o=s.poll.size.n,void r(1)):!c.advanced.updateOnImageLoad||"auto"===c.advanced.updateOnImageLoad&&"y"===c.axis||(s.poll.img.n=f.find("img").length,s.poll.img.n===s.poll.img.o)?void((c.advanced.updateOnSelectorChange||c.advanced.updateOnContentResize||c.advanced.updateOnImageLoad)&&o()):(s.poll.img.o=s.poll.img.n,void f.find("img").each(function(){n(this)}))},c.advanced.autoUpdateTimeout))}function n(t){function o(e,t){return function(){
45return t.apply(e,arguments)}}function a(){this.onload=null,e(t).addClass(d[2]),r(2)}if(e(t).hasClass(d[2]))return void r();var n=new Image;n.onload=o(n,a),n.src=t.src}function i(){c.advanced.updateOnSelectorChange===!0&&(c.advanced.updateOnSelectorChange="*");var e=0,t=f.find(c.advanced.updateOnSelectorChange);return c.advanced.updateOnSelectorChange&&t.length>0&&t.each(function(){e+=this.offsetHeight+this.offsetWidth}),e}function r(e){clearTimeout(f[0].autoUpdate),u.update.call(null,l[0],e)}var l=e(this),s=l.data(a),c=s.opt,f=e("#mCSB_"+s.idx+"_container");return t?(clearTimeout(f[0].autoUpdate),void $(f[0],"autoUpdate")):void o()},V=function(e,t,o){return Math.round(e/t)*t-o},Q=function(t){var o=t.data(a),n=e("#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal");n.each(function(){Z.call(this)})},G=function(t,o,n){function i(e){return s&&c.callbacks[e]&&"function"==typeof c.callbacks[e]}function r(){return[c.callbacks.alwaysTriggerOffsets||w>=S[0]+y,c.callbacks.alwaysTriggerOffsets||-B>=w]}function l(){var e=[h[0].offsetTop,h[0].offsetLeft],o=[x[0].offsetTop,x[0].offsetLeft],a=[h.outerHeight(!1),h.outerWidth(!1)],i=[f.height(),f.width()];t[0].mcs={content:h,top:e[0],left:e[1],draggerTop:o[0],draggerLeft:o[1],topPct:Math.round(100*Math.abs(e[0])/(Math.abs(a[0])-i[0])),leftPct:Math.round(100*Math.abs(e[1])/(Math.abs(a[1])-i[1])),direction:n.dir}}var s=t.data(a),c=s.opt,d={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:c.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},n=e.extend(d,n),u=[n.dur,n.drag?0:n.dur],f=e("#mCSB_"+s.idx),h=e("#mCSB_"+s.idx+"_container"),m=h.parent(),p=c.callbacks.onTotalScrollOffset?Y.call(t,c.callbacks.onTotalScrollOffset):[0,0],g=c.callbacks.onTotalScrollBackOffset?Y.call(t,c.callbacks.onTotalScrollBackOffset):[0,0];if(s.trigger=n.trigger,0===m.scrollTop()&&0===m.scrollLeft()||(e(".mCSB_"+s.idx+"_scrollbar").css("visibility","visible"),m.scrollTop(0).scrollLeft(0)),"_resetY"!==o||s.contentReset.
vendor: 6,004 bytes, line 45
45y||(i("onOverflowYNone")&&c.callbacks.onOverflowYNone.call(t[0]),s.contentReset.y=1),"_resetX"!==o||s.contentReset.x||(i("onOverflowXNone")&&c.callbacks.onOverflowXNone.call(t[0]),s.contentReset.x=1),"_resetY"!==o&&"_resetX"!==o){if(!s.contentReset.y&&t[0].mcs||!s.overflowed[0]||(i("onOverflowY")&&c.callbacks.onOverflowY.call(t[0]),s.contentReset.x=null),!s.contentReset.x&&t[0].mcs||!s.overflowed[1]||(i("onOverflowX")&&c.callbacks.onOverflowX.call(t[0]),s.contentReset.x=null),c.snapAmount){var v=c.snapAmount instanceof Array?"x"===n.dir?c.snapAmount[1]:c.snapAmount[0]:c.snapAmount;o=V(o,v,c.snapOffset)}switch(n.dir){case"x":var x=e("#mCSB_"+s.idx+"_dragger_horizontal"),_="left",w=h[0].offsetLeft,S=[f.width()-h.outerWidth(!1),x.parent().width()-x.width()],b=[o,0===o?0:o/s.scrollRatio.x],y=p[1],B=g[1],T=y>0?y/s.scrollRatio.x:0,k=B>0?B/s.scrollRatio.x:0;break;case"y":var x=e("#mCSB_"+s.idx+"_dragger_vertical"),_="top",w=h[0].offsetTop,S=[f.height()-h.outerHeight(!1),x.parent().height()-x.height()],b=[o,0===o?0:o/s.scrollRatio.y],y=p[0],B=g[0],T=y>0?y/s.scrollRatio.y:0,k=B>0?B/s.scrollRatio.y:0}b[1]<0||0===b[0]&&0===b[1]?b=[0,0]:b[1]>=S[1]?b=[S[0],S[1]]:b[0]=-b[0],t[0].mcs||(l(),i("onInit")&&c.callbacks.onInit.call(t[0])),clearTimeout(h[0].onCompleteTimeout),J(x[0],_,Math.round(b[1]),u[1],n.scrollEasing),!s.tweenRunning&&(0===w&&b[0]>=0||w===S[0]&&b[0]<=S[0])||J(h[0],_,Math.round(b[0]),u[0],n.scrollEasing,n.overwrite,{onStart:function(){n.callbacks&&n.onStart&&!s.tweenRunning&&(i("onScrollStart")&&(l(),c.callbacks.onScrollStart.call(t[0])),s.tweenRunning=!0,C(x),s.cbOffsets=r())},onUpdate:function(){n.callbacks&&n.onUpdate&&i("whileScrolling")&&(l(),c.callbacks.whileScrolling.call(t[0]))},onComplete:function(){if(n.callbacks&&n.onComplete){"yx"===c.axis&&clearTimeout(h[0].onCompleteTimeout);var e=h[0].idleTimer||0;h[0].onCompleteTimeout=setTimeout(function(){i("onScroll")&&(l(),c.callbacks.onScroll.call(t[0])),i("onTotalScroll")&&b[1]>=S[1]-T&&s.cbOffsets[0]&&(l(),c.callbacks.onTotalScroll.call(t[0])),i("onTotalScrollBack")&&b[1]<=k&&s.cbOffsets[1]&&(l(),c.callbacks.onTotalScrollBack.call(t[0])),s.tweenRunning=!1,h[0].idleTimer=0,C(x,"hide")},e)}}})}},J=function(e,t,o,a,n,i,r){function l(){S.stop||(x||m.call(),x=K()-v,s(),x>=S.time&&(S.time=x>S.time?x+f-(x-S.time):x+f-1,S.time<x+1&&(S.time=x+1)),S.time<a?S.id=h(l):g.call())}function s(){a>0?(S.currVal=u(S.time,_,b,a,n),w[t]=Math.round(S.currVal)+"px"):w[t]=o+"px",p.call()}function c(){f=1e3/60,S.time=x+f,h=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return s(),setTimeout(e,.01)},S.id=h(l)}function d(){null!=S.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(S.id):clearTimeout(S.id),S.id=null)}function u(e,t,o,a,n){switch(n){case"linear":case"mcsLinear":return o*e/a+t;case"mcsLinearOut":return e/=a,e--,o*Math.sqrt(1-e*e)+t;case"easeInOutSmooth":return e/=a/2,1>e?o/2*e*e+t:(e--,-o/2*(e*(e-2)-1)+t);case"easeInOutStrong":return e/=a/2,1>e?o/2*Math.pow(2,10*(e-1))+t:(e--,o/2*(-Math.pow(2,-10*e)+2)+t);case"easeInOut":case"mcsEaseInOut":return e/=a/2,1>e?o/2*e*e*e+t:(e-=2,o/2*(e*e*e+2)+t);case"easeOutSmooth":return e/=a,e--,-o*(e*e*e*e-1)+t;case"easeOutStrong":return o*(-Math.pow(2,-10*e/a)+1)+t;case"easeOut":case"mcsEaseOut":default:var i=(e/=a)*e,r=i*e;return t+o*(.499999999999997*r*i+-2.5*i*i+5.5*r+-6.5*i+4*e)}}e._mTween||(e._mTween={top:{},left:{}});var f,h,r=r||{},m=r.onStart||function(){},p=r.onUpdate||function(){},g=r.onComplete||function(){},v=K(),x=0,_=e.offsetTop,w=e.style,S=e._mTween[t];"left"===t&&(_=e.offsetLeft);var b=o-_;S.stop=0,"none"!==i&&d(),c()},K=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},Z=function(){var e=this;e._mTween||(e._mTween={top:{},left:{}});for(var t=["top","left"],o=0;o<t.length;o++){var a=t[o];e._mTween[a].id&&(window.requestAnimationFrame?window.cancelAnimationFrame(e._mTween[a].id):clearTimeout(e._mTween[a].id),e._mTween[a].id=null,e._mTween[a].stop=1)}},$=function(e,t){try{delete e[t]}catch(o){e[t]=null}},ee=function(e){return!(e.which&&1!==e.which)},te=function(e){var t=e.originalEvent.pointerType;return!(t&&"touch"!==t&&2!==t)},oe=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},ae=function(e){var t=e.parents(".mCSB_container");return[e.offset().top-t.offset().top,e.offset().left-t.offset().left]},ne=function(){function e(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;t<e.length;t++)if(e[t]+"Hidden"in document)return e[t]+"Hidden";return null}var t=e();return t?document[t]:!1};e.fn[o]=function(t){return u[t]?u[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist"):u.init.apply(this,arguments)},e[o]=function(t){return u[t]?u[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist"):u.init.apply(this,arguments)},e[o].defaults=i,window[o]=!0,e(window).bind("load",function(){e(n)[o](),e.extend(e.expr[":"],{mcsInView:e.expr[":"].mcsInView||function(t){var o,a,n=e(t),i=n.parents(".mCSB_container");if(i.length)return o=i.parent(),a=[i[0].offsetTop,i[0].offsetLeft],a[0]+ae(n)[0]>=0&&a[0]+ae(n)[0]<o.height()-n.outerHeight(!1)&&a[1]+ae(n)[1]>=0&&a[1]+ae(n)[1]<o.width()-n.outerWidth(!1)},mcsInSight:e.expr[":"].mcsInSight||function(t,o,a){var n,i,r,l,s=e(t),c=s.parents(".mCSB_container"),d="exact"===a[3]?[[1,0],[1,0]]:[[.9,.1],[.6,.4]];if(c.length)return n=[s.outerHeight(!1),s.outerWidth(!1)],r=[c[0].offsetTop+ae(s)[0],c[0].offsetLeft+ae(s)[1]],i=[c.parent()[0].offsetHeight,c.parent()[0].offsetWidth],l=[n[0]<i[0]?d[0]:d[1],n[1]<i[1]?d[0]:d[1]],r[0]-i[0]*l[0][0]<0&&r[0]+n[0]-i[0]*l[0][1]>=0&&r[1]-i[1]*l[1][0]<0&&r[1]+n[1]-i[1]*l[1][1]>=0},mcsOverflow:e.expr[":"].mcsOverflow||function(t){var o=e(t).data(a);if(o)return o.overflowed[0]||o.overflowed[1]}})})})});
45
46$.fn.extend({disableTextSelect:function(){return this.addClass("user-select-none");},iff:function(condition){if($.isFunction(condition))condition=condition.apply(this);
47return condition?this:$();},showIf:function(condition){return condition?this.show():this.hide();},checked:function(c){if(c===undefined)return this.length>0?this[0].checked:undefined;
48this.each(function(){this.checked=c;});},textNodes:function(){var ret=[];var contents=this.contents();var textNodeType=typeof Node!='undefined'?Node.TEXT_NODE:3;
49for(var i=0;i<contents.length;i++){var c=contents[i];var textContent=c.textContent;if(c.nodeType===textNodeType&&textContent.replace(/^\s+|\s+$/g,""))ret.push(c);
50var sub=$(c).textNodes();for(var j=0;j<sub.length;j++){ret.push(sub[j]);}}return $(ret,this);},textMetrics:function(){var origin=this.textNodes().parent();origin=origin.length>0?origin:this;
51var tag=origin.get(0).tagName;var styles=['font-family','font-style','font-variant','font-weight','font-size','line-height','word-spacing','letter-spacing','text-decoration',
52'text-transform','text-align','text-indent'];var $text=$(['<',tag,'></',tag,'>'].join(''));$text.css({'position':'absolute','left':'-1000px','top':'-1000px','visibility':'hidden'});
53var relevantStyles={};for(var i in styles){relevantStyles[styles[i]]=origin.css(styles[i]);}$text.css(relevantStyles);var originalText=origin.text().replace(/^\s+|\s+$/g,
54"");$text.html(originalText);$('body').append($text);var width=$text.outerWidth(),height=$text.outerHeight();var ret={width:width,height:height,lineHeight:relevantStyles['line-height'],
55characterAvgWidth:width/originalText.length};$text.remove();return ret;},ensureScroll:function(rect){var sx=this.scrollLeft(),sy=this.scrollTop();if(rect instanceof jQuery){var mo=this.offset(),
56ro=rect.offset(),r={left:ro.left-mo.left+sx,top:ro.top-mo.top+sy};r.right=r.left+rect.outerWidth();r.bottom=r.top+rect.outerHeight();rect=r;}var nx=Math.floor(Math.min(Math.max(sx,
57rect.right-this.width()),rect.left)),ny=Math.floor(Math.min(Math.max(sy,rect.bottom-this.height()),rect.top));if(nx!=sx)this.scrollLeft(nx);if(ny!=sy)this.scrollTop(ny);
58return this;},lineClamp:function(lines){if(this.length==0)return this;if(typeof lines!='number')lines=2;var m=this.textMetrics(),h=parseFloat(m.lineHeight)*lines,
59style={height:h,overflow:'hidden'},clamp=this.outerHeight()+4>h;clamp&&this.addClass('line-clamp');clamp&&this.css(style);return this;},isInView:function(full){var el=this.get(0),
60rect=el.getBoundingClientRect();return full===true?(rect.top>=0&&rect.left>=0&&rect.bottom<=$(window).height()&&rect.right<=$(window).width()):(rect.bottom>=0&&rect.right>=0&&rect.top<=$(window).height()&&rect.left<=$(window).width());
61},forceRedraw:function(){var w=this.width(),h=this.height();return this;},prepareRemove:function(){this.filter('VIDEO').each(function(){this.pause();this.src='';
62});return this;}});jQuery.extend({initObject:function(){var res={},key,val;for(var i=0;i<arguments.length;i+=2){key=arguments[i];val=arguments[i+1];res[key]=val;}return res;
63},objectToArray:function(object,callback){var res=[];if(callback==null)$.each(object,function(){res.push(this);});else $.each(object,function(){res.push(callback.apply(this,
64arguments));});return res;},keys:function(object){var res=[];for(var key in object)if(object.hasOwnProperty(key))res.push(key);return res;},ownProperties:function(object){var res={};
65for(var key in object)if(object.hasOwnProperty(key))res[key]=true;return res;},mapObject:function(object,callback){var res={};for(var key in object){if(object.hasOwnProperty(key)){var val=callback.call(null,
66key,object[key]);if(val!==undefined)res[key]=val;}}return res;},lookup:function(array,predicate){for(var i=0,e;i<array.length;i++){if(predicate(e=array[i]))return e;
67}return undefined;},max:function(values,maxfn){var maxVal=null,maxObj=null,maxIndex=null;if($.isArray(values)||(values.length!==null&&values.length!==undefined)){if(typeof maxfn==='function'){maxObj=values[0];
68maxVal=maxfn.call(maxObj,i,maxObj);maxIndex=0;for(var i=1;i<values.length;i++){var obj=values[i];var val=maxfn.call(obj,i,obj);if(val>maxVal){maxVal=val;maxObj=values[i];
69maxIndex=i;}}}else{maxObj=values[0];maxVal=maxObj;maxIndex=0;for(var i=1;i<values.length;i++){var obj=values[i];if(obj>maxObj){maxVal=obj;maxObj=obj;maxIndex=i;}}}}else{for(var n in values){if(values.hasOwnProperty(n)){var obj=values[n];
70var val=maxfn.call(obj,i,obj);if(!maxVal||val>maxVal){maxVal=val;maxObj=obj;maxIndex=n;}}else{var obj=values[n];if(!maxObj||obj>maxObj){maxVal=obj;maxObj=obj;maxIndex=n;
71}}}}return{element:maxObj,index:maxIndex,value:maxVal};},min:function(values,minfn){var minVal=null,minObj=null,minIndex=null;if($.isArray(values)||(values.length!==null&&values.length!==undefined)){if(typeof minfn==='function'){minObj=values[0];
72minVal=minfn.call(minObj,0,minObj);minIndex=0;for(var i=1;i<values.length;i++){var obj=values[i];var val=minfn.call(obj,i,obj);if(val<minVal){minVal=val;minObj=values[i];
73minIndex=i;}}}else{minObj=values[0];minVal=minObj;minIndex=0;for(var i=1;i<values.length;i++){var obj=values[i];if(obj>minObj){minVal=obj;minObj=obj;minIndex=i;}}}}else{if(typeof minfn==='function'){for(var n in values){if(values.hasOwnProperty(n)){var obj=values[n];
74var val=minfn.call(obj,i,obj);if(minVal===null||val<maxVal){minVal=val;minObj=obj;minIndex=n;}}}}else{var obj=values[n];if(!minObj||obj<minObj){minVal=obj;minObj=obj;
75minIndex=n;}}}return{element:minObj,index:minIndex,value:minVal};},first:function(obj,pred){pred=typeof pred==='function'?pred:function(){return true;};if($.isArray(obj)){for(var i=0;
76i<obj.length;i++){if(pred.call(obj[i],obj[i]))return{key:i,value:obj[i]};}}else if(typeof obj==='object'){for(name in obj){if(obj.hasOwnProperty(name)&&pred.call(obj[name],
77obj[name])){return{key:name,value:obj[name]};}}}},any:function(obj,pred){return!!($.first(obj,pred));},none:function(obj,pred){return!($.first(obj,pred));},all:function(obj,
78pred){pred=typeof pred==='function'?pred:function(){return true;};if($.isArray(obj)){for(var i=0;i<obj.length;i++){if(!pred.call(obj[i],obj[i]))return false;}}else if(typeof obj==='object'){for(name in obj){if(obj.hasOwnProperty(name)&&!pred.call(obj[name],
79obj[name])){return false;}}}return true;},intersect:function(val1,val2,map1,map2,returnMapped){function genMapFunc(val,map){if($.isFunction(map))return function(idxOrProp){return map.call(val[idxOrProp]);
80};else if(typeof map=='string'||map instanceof String)return function(idxOrProp){return val[idxOrProp][map];};else return function(idxOrProp){return val[idxOrProp];
81};}var map1=genMapFunc(val1,map1);var map2=genMapFunc(val2,map2);var set={},ret,i,prop;if($.isArray(val1)){ret=[];for(i=0;i<val2.length;i++)set[map2(i)]=true;for(i=0;
82i<val1.length;i++){var t=map1(i);if(set[t]===true)ret.push(returnMapped?t:val1[i]);}}else{ret={};for(prop in val2){if(val2.hasOwnProperty(prop))set[map2(prop)]=true;
83}for(prop in val1){if(val1.hasOwnProperty(prop)){var t=map1(prop);if(set[map1(prop)]===true)ret[prop]=returnMapped?t:val1[prop];}}}return ret;},throttle:function(func,
84wait,options){var context,args,result;var timeout=null;var previous=0;if(!options)options={};var later=function(){previous=options.leading===false?0:new Date().getTime();
85timeout=null;result=func.apply(context,args);if(!timeout)context=args=null;};return function(){var now=new Date().getTime();if(!previous&&options.leading===false)previous=now;
86var remaining=wait-(now-previous);context=this;args=arguments;if(remaining<=0||remaining>wait){if(timeout){clearTimeout(timeout);timeout=null;}previous=now;result=func.apply(context,
87args);if(!timeout)context=args=null;}else if(!timeout&&options.trailing!==false){timeout=setTimeout(later,remaining);}return result;};},debounce:function(func,wait,
88immediate){var timeout,args,context,timestamp,result;var later=function(){var last=new Date().getTime()-timestamp;if(last<wait&&last>=0){timeout=setTimeout(later,
89wait-last);}else{timeout=null;if(!immediate){result=func.apply(context,args);if(!timeout)context=args=null;}}};return function(){context=this;args=arguments;timestamp=new Date().getTime();
90var callNow=immediate&&!timeout;if(!timeout)timeout=setTimeout(later,wait);if(callNow){result=func.apply(context,args);context=args=null;}return result;};},parseQueryString:function(url){if(url===undefined||url===null)url=window.location.search.substr(1).split('&');
91if(url=="")return{};var b={};for(var i=0;i<url.length;++i){var p=url[i].split('=');if(p.length!=2)continue;b[p[0]]=decodeURIComponent(p[1].replace(/\+/g," "));}return b;
92},updateQueryString:function(params,url){if(!url)url=window.location.href;for(var key in params){if(!params.hasOwnProperty(key))continue;var value=params[key];var re=new RegExp("([?&])"+key+"=.*?(&|#|$)(.*)",
93"gi"),hash;if(re.test(url)){if(typeof value!=='undefined'&&value!==null)url=url.replace(re,'$1'+key+"="+value+'$2$3');else{hash=url.split('#');url=hash[0].replace(re,
94'$1$3').replace(/(&|\?)$/,'');if(typeof hash[1]!=='undefined'&&hash[1]!==null)url+='#'+hash[1];}}else{if(typeof value!=='undefined'&&value!==null){var separator=url.indexOf('?')!==-1?'&':'?';
95hash=url.split('#');url=hash[0]+separator+key+'='+value;if(typeof hash[1]!=='undefined'&&hash[1]!==null)url+='#'+hash[1];}}}return url;},getScrollbarWidth:function(){var div=$("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>"+"<div style='height:100px;width:auto;'></div></div>"),
96innerDiv=div.children()[0];$("body").append(div);var width1=innerDiv.offsetWidth;div.css("overflow","scroll");var width2=innerDiv.offsetWidth;if(width1===width2){width2=div[0].clientWidth;
97}div.remove();return width1-width2;},mousemovethr:function(threshold,handler){threshold=threshold||0;var mx0=null,my0=null;return function(e){var mx=e.pageX,my=e.pageY;
98if(mx0===null&&my0===null){mx0=mx;my0=my;return;}if(Math.abs(mx-mx0)<threshold&&Math.abs(my-my0)<threshold)return;mx0=mx;my0=my;handler.apply(this,arguments);};}});
99jQuery.extend({queryString:(function(a){return $.parseQueryString(a);})(window.location.search.substr(1).split('&')),});;//          
100/*! svg.js v2.5.1 MIT*/;!function(t,e){"function"==typeof define&&define.amd?define(function(){return e(t,t.document)}):"object"==typeof exports?module.exports=t.document?e(t,t.document):function(t){return e(t,t.document)}:t.SVG=e(t,t.document)}("undefined"!=typeof window?window:this,function(t,e){function i(t,e,i,n){return i+n.replace(g.regex.dots," .")}function n(t){for(var e=t.slice(0),i=e.length;i--;)Array.isArray(e[i])&&(e[i]=n(e[i]));return e}function r(t,e){return t instanceof e}function s(t,e){return(t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector).call(t,e)}function o(t){return t.toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()})}function a(t){return t.charAt(0).toUpperCase()+t.slice(1)}function h(t){return 4==t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}function u(t){var e=t.toString(16);return 1==e.length?"0"+e:e}function l(t,e,i){if(null==e||null==i){var n=t.bbox();null==e?e=n.width/n.height*i:null==i&&(i=n.height/n.width*e)}return{width:e,height:i}}function c(t,e,i){return{x:e*t.a+i*t.c+0,y:e*t.b+i*t.d+0}}function f(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}function d(t){return t instanceof g.Matrix||(t=new g.Matrix(t)),t}function p(t,e){t.cx=null==t.cx?e.bbox().cx:t.cx,t.cy=null==t.cy?e.bbox().cy:t.cy}function m(t){for(var e=0,i=t.length,n="";e<i;e++)n+=t[e][0],null!=t[e][1]&&(n+=t[e][1],null!=t[e][2]&&(n+=" ",n+=t[e][2],null!=t[e][3]&&(n+=" ",n+=t[e][3],n+=" ",n+=t[e][4],null!=t[e][5]&&(n+=" ",n+=t[e][5],n+=" ",n+=t[e][6],null!=t[e][7]&&
vendor: 5,610 bytes, line 100
100(n+=" ",n+=t[e][7])))));return n+" "}function x(e){for(var i=e.childNodes.length-1;i>=0;i--)e.childNodes[i]instanceof t.SVGElement&&x(e.childNodes[i]);return g.adopt(e).id(g.eid(e.nodeName))}function y(t){return null==t.x&&(t.x=0,t.y=0,t.width=0,t.height=0),t.w=t.width,t.h=t.height,t.x2=t.x+t.width,t.y2=t.y+t.height,t.cx=t.x+t.width/2,t.cy=t.y+t.height/2,t}function v(t){var e=t.toString().match(g.regex.reference);if(e)return e[1]}var g=this.SVG=function(t){if(g.supported)return t=new g.Doc(t),g.parser.draw||g.prepare(),t};if(g.ns="http://www.w3.org/2000/svg",g.xmlns="http://www.w3.org/2000/xmlns/",g.xlink="http://www.w3.org/1999/xlink",g.svgjs="http://svgjs.com/svgjs",g.supported=function(){return!!e.createElementNS&&!!e.createElementNS(g.ns,"svg").createSVGRect}(),!g.supported)return!1;g.did=1e3,g.eid=function(t){return"Svgjs"+a(t)+g.did++},g.create=function(t){var i=e.createElementNS(this.ns,t);return i.setAttribute("id",this.eid(t)),i},g.extend=function(){var t,e,i,n;for(t=[].slice.call(arguments),e=t.pop(),n=t.length-1;n>=0;n--)if(t[n])for(i in e)t[n].prototype[i]=e[i];g.Set&&g.Set.inherit&&g.Set.inherit()},g.invent=function(t){var e="function"==typeof t.create?t.create:function(){this.constructor.call(this,g.create(t.create))};return t.inherit&&(e.prototype=new t.inherit),t.extend&&g.extend(e,t.extend),t.construct&&g.extend(t.parent||g.Container,t.construct),e},g.adopt=function(e){if(!e)return null;if(e.instance)return e.instance;var i;return i="svg"==e.nodeName?e.parentNode instanceof t.SVGElement?new g.Nested:new g.Doc:"linearGradient"==e.nodeName?new g.Gradient("linear"):"radialGradient"==e.nodeName?new g.Gradient("radial"):g[a(e.nodeName)]?new(g[a(e.nodeName)]):new g.Element(e),i.type=e.nodeName,i.node=e,e.instance=i,i instanceof g.Doc&&i.namespace().defs(),i.setData(JSON.parse(e.getAttribute("svgjs:data"))||{}),i},g.prepare=function(){var t=e.getElementsByTagName("body")[0],i=(t?new g.Doc(t):g.adopt(e.documentElement).nested()).size(2,0);g.parser={body:t||e.documentElement,draw:i.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden"),poly:i.polyline().node,path:i.path().node,native:g.create("svg")}},g.parser={native:g.create("svg")},e.addEventListener("DOMContentLoaded",function(){g.parser.draw||g.prepare()},!1),g.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},g.utils={map:function(t,e){var i,n=t.length,r=[];for(i=0;i<n;i++)r.push(e(t[i]));return r},filter:function(t,e){var i,n=t.length,r=[];for(i=0;i<n;i++)e(t[i])&&r.push(t[i]);return r},radians:function(t){return t%360*Math.PI/180},degrees:function(t){return 180*t/Math.PI%360},filterSVGElements:function(e){return this.filter(e,function(e){return e instanceof t.SVGElement})}},g.defaults={attrs:{"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","font-size":16,"font-family":"Helvetica, Arial, sans-serif","text-anchor":"start"}},g.Color=function(t){var e;this.r=0,this.g=0,this.b=0,t&&("string"==typeof t?g.regex.isRgb.test(t)?(e=g.regex.rgb.exec(t.replace(g.regex.whitespace,"")),this.r=parseInt(e[1]),this.g=parseInt(e[2]),this.b=parseInt(e[3])):g.regex.isHex.test(t)&&(e=g.regex.hex.exec(h(t)),this.r=parseInt(e[1],16),this.g=parseInt(e[2],16),this.b=parseInt(e[3],16)):"object"==typeof t&&(this.r=t.r,this.g=t.g,this.b=t.b))},g.extend(g.Color,{toString:function(){return this.toHex()},toHex:function(){return"#"+u(this.r)+u(this.g)+u(this.b)},toRgb:function(){return"rgb("+[this.r,this.g,this.b].join()+")"},brightness:function(){return this.r/255*.3+this.g/255*.59+this.b/255*.11},morph:function(t){return this.destination=new g.Color(t),this},at:function(t){return this.destination?(t=t<0?0:t>1?1:t,new g.Color({r:~~(this.r+(this.destination.r-this.r)*t),g:~~(this.g+(this.destination.g-this.g)*t),b:~~(this.b+(this.destination.b-this.b)*t)})):this}}),g.Color.test=function(t){return t+="",g.regex.isHex.test(t)||g.regex.isRgb.test(t)},g.Color.isRgb=function(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b},g.Color.isColor=function(t){return g.Color.isRgb(t)||g.Color.test(t)},g.Array=function(t,e){t=(t||[]).valueOf(),0==t.length&&e&&(t=e.valueOf()),this.value=this.parse(t)},g.extend(g.Array,{morph:function(t){if(this.destination=this.parse(t),this.value.length!=this.destination.length){for(var e=this.value[this.value.length-1],i=this.destination[this.destination.length-1];this.value.length>this.destination.length;)this.destination.push(i);for(;this.value.length<this.destination.length;)this.value.push(e)}return this},settle:function(){for(var t=0,e=this.value.length,i=[];t<e;t++)i.indexOf(this.value[t])==-1&&i.push(this.value[t]);return this.value=i},at:function(t){if(!this.destination)return this;for(var e=0,i=this.value.length,n=[];e<i;e++)n.push(this.value[e]+(this.destination[e]-this.value[e])*t);return new g.Array(n)},toString:function(){return this.value.join(" ")}
100,valueOf:function(){return this.value},parse:function(t){return t=t.valueOf(),Array.isArray(t)?t:this.split(t)},split:function(t){return t.trim().split(g.regex.delimiter).map(parseFloat)},reverse:function(){return this.value.reverse(),this},clone:function(){var t=new this.constructor;return t.value=n(this.value),t}}),g.PointArray=function(t,e){g.Array.call(this,t,e||[[0,0]])},g.PointArray.prototype=new g.Array,g.PointArray.prototype.constructor=g.PointArray,g.extend(g.PointArray,{toString:function(){for(var t=0,e=this.value.length,i=[];t<e;t++)i.push(this.value[t].join(","));return i.join(" ")},toLine:function(){return{x1:this.value[0][0],y1:this.value[0][1],x2:this.value[1][0],y2:this.value[1][1]}},at:function(t){if(!this.destination)return this;for(var e=0,i=this.value.length,n=[];e<i;e++)n.push([this.value[e][0]+(this.destination[e][0]-this.value[e][0])*t,this.value[e][1]+(this.destination[e][1]-this.value[e][1])*t]);return new g.PointArray(n)},parse:function(t){var e=[];if(t=t.valueOf(),Array.isArray(t)){if(Array.isArray(t[0]))return t}else t=t.trim().split(g.regex.delimiter).map(parseFloat);t.length%2!==0&&t.pop();for(var i=0,n=t.length;i<n;i+=2)e.push([t[i],t[i+1]]);return e},move:function(t,e){var i=this.bbox();if(t-=i.x,e-=i.y,!isNaN(t)&&!isNaN(e))for(var n=this.value.length-1;n>=0;n--)this.value[n]=[this.value[n][0]+t,this.value[n][1]+e];return this},size:function(t,e){var i,n=this.bbox();for(i=this.value.length-1;i>=0;i--)n.width&&(this.value[i][0]=(this.value[i][0]-n.x)*t/n.width+n.x),n.height&&(this.value[i][1]=(this.value[i][1]-n.y)*e/n.height+n.y);return this},bbox:function(){return g.parser.poly.setAttribute("points",this.toString()),g.parser.poly.getBBox()}}),g.PathArray=function(t,e){g.Array.call(this,t,e||[["M",0,0]])},g.PathArray.prototype=new g.Array,g.PathArray.prototype.constructor=g.PathArray,g.extend(g.PathArray,{toString:function(){return m(this.value)},move:function(t,e){var i=this.bbox();if(t-=i.x,e-=i.y,!isNaN(t)&&!isNaN(e))for(var n,r=this.value.length-1;r>=0;r--)n=this.value[r][0],"M"==n||"L"==n||"T"==n?(this.value[r][1]+=t,this.value[r][2]+=e):"H"==n?this.value[r][1]+=t:"V"==n?this.value[r][1]+=e:"C"==n||"S"==n||"Q"==n?(this.value[r][1]+=t,this.value[r][2]+=e,this.value[r][3]+=t,this.value[r][4]+=e,"C"==n&&(this.value[r][5]+=t,this.value[r][6]+=e)):"A"==n&&(this.value[r][6]+=t,this.value[r][7]+=e);return this},size:function(t,e){var i,n,r=this.bbox();for(i=this.value.length-1;i>=0;i--)n=this.value[i][0],"M"==n||"L"==n||"T"==n?(this.value[i][1]=(this.value[i][1]-r.x)*t/r.width+r.x,this.value[i][2]=(this.value[i][2]-r.y)*e/r.height+r.y):"H"==n?this.value[i][1]=(this.value[i][1]-r.x)*t/r.width+r.x:"V"==n?this.value[i][1]=(this.value[i][1]-r.y)*e/r.height+r.y:"C"==n||"S"==n||"Q"==n?(this.value[i][1]=(this.value[i][1]-r.x)*t/r.width+r.x,this.value[i][2]=(this.value[i][2]-r.y)*e/r.height+r.y,this.value[i][3]=(this.value[i][3]-r.x)*t/r.width+r.x,this.value[i][4]=(this.value[i][4]-r.y)*e/r.height+r.y,"C"==n&&(this.value[i][5]=(this.value[i][5]-r.x)*t/r.width+r.x,this.value[i][6]=(this.value[i][6]-r.y)*e/r.height+r.y)):"A"==n&&(this.value[i][1]=this.value[i][1]*t/r.width,this.value[i][2]=this.value[i][2]*e/r.height,this.value[i][6]=(this.value[i][6]-r.x)*t/r.width+r.x,this.value[i][7]=(this.value[i][7]-r.y)*e/r.height+r.y);return this},equalCommands:function(t){var e,i,n;for(t=new g.PathArray(t),n=this.value.length===t.value.length,e=0,i=this.value.length;n&&e<i;e++)n=this.value[e][0]===t.value[e][0];return n},morph:function(t){return t=new g.PathArray(t),this.equalCommands(t)?this.destination=t:this.destination=null,this},at:function(t){if(!this.destination)return this;var e,i,n,r,s=this.value,o=this.destination.value,a=[],h=new g.PathArray;for(e=0,i=s.length;e<i;e++){for(a[e]=[s[e][0]],n=1,r=s[e].length;n<r;n++)a[e][n]=s[e][n]+(o[e][n]-s[e][n])*t;"A"===a[e][0]&&(a[e][4]=+(0!=a[e][4]),a[e][5]=+(0!=a[e][5]))}return h.value=a,h},parse:function(t){if(t instanceof g.PathArray)return t.valueOf();var e,n,r,s,o,a,h=0,u=0,l={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7};t="string"==typeof t?t.replace(g.regex.numbersWithDots,i).replace(g.regex.pathLetters," $& ").replace(g.regex.hyphen,"$1 -").trim().split(g.regex.delimiter):t.reduce(function(t,e){return[].concat.call(t,e)},[]);var a=[];do{for(g.regex.isPathLetter.test(t[0])?(s=t[0],t.shift()):"M"==s?s="L":"m"==s&&(s="l"),o=[s.toUpperCase()],e=0;e<l[o[0]];++e)o.push(parseFloat(t.shift()));s==o[0]?"M"==s||"L"==s||"C"==s||"Q"==s||"S"==s||"T"==s?(h=o[l[o[0]]-1],u=o[l[o[0]]]):"V"==s?u=o[1]:"H"==s?h=o[1]:"A"==s&&(h=o[6],u=o[7]):"m"==s||"l"==s||"c"==s||"s"==s||"q"==s||"t"==s?(o[1]+=h,o[2]+=u,null!=o[3]&&(o[3]+=h,o[4]+=u),null!=o[5]&&
vendor: 5,579 bytes, line 100
100(o[5]+=h,o[6]+=u),h=o[l[o[0]]-1],u=o[l[o[0]]]):"v"==s?(o[1]+=u,u=o[1]):"h"==s?(o[1]+=h,h=o[1]):"a"==s&&(o[6]+=h,o[7]+=u,h=o[6],u=o[7]),"M"==o[0]&&(n=h,r=u),"Z"==o[0]&&(h=n,u=r),a.push(o)}while(t.length);return a},bbox:function(){return g.parser.path.setAttribute("d",this.toString()),g.parser.path.getBBox()}}),g.Number=g.invent({create:function(t,e){this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-3.4e38:3.4e38:"string"==typeof t?(e=t.match(g.regex.numberAndUnit),e&&(this.value=parseFloat(e[1]),"%"==e[5]?this.value/=100:"s"==e[5]&&(this.value*=1e3),this.unit=e[5])):t instanceof g.Number&&(this.value=t.valueOf(),this.unit=t.unit)},extend:{toString:function(){return("%"==this.unit?~~(1e8*this.value)/1e6:"s"==this.unit?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(t){return t=new g.Number(t),new g.Number(this+t,this.unit||t.unit)},minus:function(t){return t=new g.Number(t),new g.Number(this-t,this.unit||t.unit)},times:function(t){return t=new g.Number(t),new g.Number(this*t,this.unit||t.unit)},divide:function(t){return t=new g.Number(t),new g.Number(this/t,this.unit||t.unit)},to:function(t){var e=new g.Number(this);return"string"==typeof t&&(e.unit=t),e},morph:function(t){return this.destination=new g.Number(t),t.relative&&(this.destination.value+=this.value),this},at:function(t){return this.destination?new g.Number(this.destination).minus(this).times(t).plus(this):this}}}),g.Element=g.invent({create:function(t){this._stroke=g.defaults.attrs.stroke,this._event=null,this.dom={},(this.node=t)&&(this.type=t.nodeName,this.node.instance=this,this._stroke=t.getAttribute("stroke")||this._stroke)},extend:{x:function(t){return this.attr("x",t)},y:function(t){return this.attr("y",t)},cx:function(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)},cy:function(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)},move:function(t,e){return this.x(t).y(e)},center:function(t,e){return this.cx(t).cy(e)},width:function(t){return this.attr("width",t)},height:function(t){return this.attr("height",t)},size:function(t,e){var i=l(this,t,e);return this.width(new g.Number(i.width)).height(new g.Number(i.height))},clone:function(t,e){this.writeDataToDom();var i=x(this.node.cloneNode(!0));return t?t.add(i):this.after(i),i},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(t){return this.after(t).remove(),t},addTo:function(t){return t.put(this)},putIn:function(t){return t.add(this)},id:function(t){return this.attr("id",t)},inside:function(t,e){var i=this.bbox();return t>i.x&&e>i.y&&t<i.x+i.width&&e<i.y+i.height},show:function(){return this.style("display","")},hide:function(){return this.style("display","none")},visible:function(){return"none"!=this.style("display")},toString:function(){return this.attr("id")},classes:function(){var t=this.attr("class");return null==t?[]:t.trim().split(g.regex.delimiter)},hasClass:function(t){return this.classes().indexOf(t)!=-1},addClass:function(t){if(!this.hasClass(t)){var e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter(function(e){return e!=t}).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)},reference:function(t){return g.get(this.attr(t))},parent:function(e){var i=this;if(!i.node.parentNode)return null;if(i=g.adopt(i.node.parentNode),!e)return i;for(;i&&i.node instanceof t.SVGElement;){if("string"==typeof e?i.matches(e):i instanceof e)return i;i=g.adopt(i.node.parentNode)}},doc:function(){return this instanceof g.Doc?this:this.parent(g.Doc)},parents:function(t){var e=[],i=this;do{if(i=i.parent(t),!i||!i.node)break;e.push(i)}while(i.parent);return e},matches:function(t){return s(this.node,t)},native:function(){return this.node},svg:function(t){var i=e.createElement("svg");if(!(t&&this instanceof g.Parent))return i.appendChild(t=e.createElement("svg")),this.writeDataToDom(),t.appendChild(this.node.cloneNode(!0)),i.innerHTML.replace(/^<svg>/,"").replace(/<\/svg>$/,"");i.innerHTML="<svg>"+t.replace(/\n/,"").replace(/<(\w+)([^<]+?)\/>/g,"<$1$2></$1>")+"</svg>";for(var n=0,r=i.firstChild.childNodes.length;n<r;n++)this.node.appendChild(i.firstChild.firstChild);return this},writeDataToDom:function(){if(this.each||this.lines){var t=this.each?this:this.lines();t.each(function(){this.writeDataToDom()})}return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(t){return this.dom=t,this},is:function(t){return r(this,t)}}}),g.easing={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return-Math.cos(t*Math.PI/2)+1}},g.morph=function(t){return function(e,i){return new g.MorphObj(e,i).at(t)}},g.Situation=g.invent({create:function(t){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new g.Number(t.duration).valueOf(),this.delay=new g.Number(t.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=t.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),g.FX=g.invent({create:function(t){this._target=t,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1}
vendor: 22,981 bytes, lines 100-101
100,extend:{animate:function(t,e,i){"object"==typeof t&&(e=t.ease,i=t.delay,t=t.duration);var n=new g.Situation({duration:t||1e3,delay:i||0,ease:g.easing[e||"-"]||e});return this.queue(n),this},delay:function(t){var e=new g.Situation({duration:t,delay:0,ease:g.easing["-"]});return this.queue(e)},target:function(t){return t&&t instanceof g.Element?(this._target=t,this):this._target},timeToAbsPos:function(t){return(t-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(t){return this.situation.duration/this._speed*t+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=t.requestAnimationFrame(function(){this.step()}.bind(this))},stopAnimFrame:function(){t.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(t){return("function"==typeof t||t instanceof g.Situation)&&this.situations.push(t),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof g.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var t,e,i=this.situation;if(i.init)return this;for(t in i.animations)e=this.target()[t](),i.animations[t]instanceof g.Number&&(e=new g.Number(e)),i.animations[t]=e.morph(i.animations[t]);for(t in i.attrs)i.attrs[t]=new g.MorphObj(this.target().attr(t),i.attrs[t]);for(t in i.styles)i.styles[t]=new g.MorphObj(this.target().style(t),i.styles[t]);return i.initialTransformation=this.target().matrixify(),i.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(t,e){var i=this.active;return this.active=!1,e&&this.clearQueue(),t&&this.situation&&(!i&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},reset:function(){if(this.situation){var t=this.situation;this.stop(),this.situation=t,this.atStart()}return this},finish:function(){for(this.stop(!0,!1);this.dequeue().situation&&this.stop(!0,!1););return this.clearQueue().clearCurrent(),this},atStart:function(){return this.at(0,!0)},atEnd:function(){return this.situation.loops===!0&&(this.situation.loops=this.situation.loop+1),"number"==typeof this.situation.loops?this.at(this.situation.loops,!0):this.at(1,!0)},at:function(t,e){var i=this.situation.duration/this._speed;return this.absPos=t,e||(this.situation.reversed&&(this.absPos=1-this.absPos),this.absPos+=this.situation.loop),this.situation.start=+new Date-this.absPos*i,this.situation.finish=this.situation.start+i,this.step(!0)},speed:function(t){return 0===t?this.pause():t?(this._speed=t,this.at(this.absPos,!0)):this._speed},loop:function(t,e){var i=this.last();return i.loops=null==t||t,i.loop=0,e&&(i.reversing=!0),this},pause:function(){return this.paused=!0,this.stopAnimFrame(),this},play:function(){return this.paused?(this.paused=!1,this.at(this.absPos,!0)):this},reverse:function(t){var e=this.last();return"undefined"==typeof t?e.reversed=!e.reversed:e.reversed=t,this},progress:function(t){return t?this.situation.ease(this.pos):this.pos},after:function(t){var e=this.last(),i=function i(n){n.detail.situation==e&&(t.call(this,e),this.off("finished.fx",i))};return this.target().on("finished.fx",i),this._callStart()},during:function(t){var e=this.last(),i=function(i){i.detail.situation==e&&t.call(this,i.detail.pos,g.morph(i.detail.pos),i.detail.eased,e)};return this.target().off("during.fx",i).on("during.fx",i),this.after(function(){this.off("during.fx",i)}),this._callStart()},afterAll:function(t){var e=function e(i){t.call(this),this.off("allfinished.fx",e)};return this.target().off("allfinished.fx",e).on("allfinished.fx",e),this._callStart()},duringAll:function(t){var e=function(e){t.call(this,e.detail.pos,g.morph(e.detail.pos),e.detail.eased,e.detail.situation)};return this.target().off("during.fx",e).on("during.fx",e),this.afterAll(function(){this.off("during.fx",e)}),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(t,e,i){return this.last()[i||"animations"][t]=e,this._callStart()},step:function(t){if(t||(this.absPos=this.timeToAbsPos(+new Date)),this.situation.loops!==!1){var e,i,n;e=Math.max(this.absPos,0),i=Math.floor(e),this.situation.loops===!0||i<this.situation.loops?(this.pos=e-i,n=this.situation.loop,this.situation.loop=i):(this.absPos=this.situation.loops,this.pos=1,n=this.situation.loop-1,this.situation.loop=this.situation.loops),this.situation.reversing&&(this.situation.reversed=this.situation.reversed!=Boolean((this.situation.loop-n)%2))}else this.absPos=Math.min(this.absPos,1),this.pos=this.absPos;this.pos<0&&(this.pos=0),this.situation.reversed&&(this.pos=1-this.pos);var r=this.situation.ease(this.pos);for(var s in this.situation.once)s>this.lastPos&&s<=r&&(this.situation.once[s].call(this.target(),this.pos,r),delete this.situation.once[s]);return this.active&&this.target().fire("during",{pos:this.pos,eased:r,fx:this,situation:this.situation}),this.situation?(this.eachAt(),1==this.pos&&!this.situation.reversed||this.situation.reversed&&0==this.pos?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.target().off(".fx"),this.active=!1),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=r,this):this},eachAt:function(){var t,e,i=this,n=this.target(),r=this.situation;for(t in r.animations)e=[].concat(r.animations[t]).map(function(t){return"string"!=typeof t&&t.at?t.at(r.ease(i.pos),i.pos):t}),n[t].apply(n,e);for(t in r.attrs)e=[t].concat(r.attrs[t]).map(function(t){return"string"!=typeof t&&t.at?t.at(r.ease(i.pos),i.pos):t}),n.attr.apply(n,e);for(t in r.styles)e=[t].concat(r.styles[t]).map(function(t){return"string"!=typeof t&&t.at?t.at(r.ease(i.pos),i.pos):t}),n.style.apply(n,e);if(r.transforms.length){for(e=r.initialTransformation,t=0,len=r.transforms.length;t<len;t++){var s=r.transforms[t];s instanceof g.Matrix?e=s.relative?e.multiply((new g.Matrix).morph(s).at(r.ease(this.pos))):e.morph(s).at(r.ease(this.pos)):(s.relative||s.undo(e.extract()),e=e.multiply(s.at(r.ease(this.pos))))}n.matrix(e)}return this},once:function(t,e,i){return i||(t=this.situation.ease(t)),this.situation.once[t]=e,this},_callStart:function(){return setTimeout(function(){this.start()}.bind(this),0),this}},parent:g.Element,construct:{animate:function(t,e,i){return(this.fx||(this.fx=new g.FX(this))).animate(t,e,i)},delay:function(t){return(this.fx||(this.fx=new g.FX(this))).delay(t)},stop:function(t,e){return this.fx&&this.fx.stop(t,e),this},finish:function(){return this.fx&&this.fx.finish(),this},pause:function(){return this.fx&&this.fx.pause(),this},play:function(){return this.fx&&this.fx.play(),this},speed:function(t){if(this.fx){if(null==t)return this.fx.speed();this.fx.speed(t)}return this}}}),g.MorphObj=g.invent({create:function(t,e){return g.Color.isColor(e)?new g.Color(t).morph(e):g.regex.numberAndUnit.test(e)?new g.Number(t).morph(e):(this.value=t,void(this.destination=e))},extend:{at:function(t,e){return e<1?this.value:this.destination},valueOf:function(){return this.value}}}),g.extend(g.FX,{attr:function(t,e,i){if("object"==typeof t)for(var n in t)this.attr(n,t[n]);else this.add(t,e,"attrs");return this},style:function(t,e){if("object"==typeof t)for(var i in t)this.style(i,t[i]);else this.add(t,e,"styles");return this},x:function(t,e){if(this.target()instanceof g.G)return this.transform({x:t},e),this;var i=new g.Number(t);return i.relative=e,this.add("x",i)},y:function(t,e){if(this.target()instanceof g.G)return this.transform({y:t},e),this;var i=new g.Number(t);return i.relative=e,this.add("y",i)},cx:function(t){return this.add("cx",new g.Number(t))},cy:function(t){return this.add("cy",new g.Number(t))},move:function(t,e){return this.x(t).y(e)},center:function(t,e){return this.cx(t).cy(e)},size:function(t,e){if(this.target()instanceof g.Text)this.attr("font-size",t);else{var i;t&&e||(i=this.target().bbox()),t||(t=i.width/i.height*e),e||(e=i.height/i.width*t),this.add("width",new g.Number(t)).add("height",new g.Number(e))}return this},plot:function(){return this.add("plot",arguments.length>1?[].slice.call(arguments):arguments[0])},leading:function(t){return this.target().leading?this.add("leading",new g.Number(t)):this},viewbox:function(t,e,i,n){return this.target()instanceof g.Container&&this.add("viewbox",new g.ViewBox(t,e,i,n)),this},update:function(t){if(this.target()instanceof g.Stop){if("number"==typeof t||t instanceof g.Number)return this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]});null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset)}return this}}),g.Box=g.invent({create:function(t,e,i,n){return"object"!=typeof t||t instanceof g.Element?(4==arguments.length&&(this.x=t,this.y=e,this.width=i,this.height=n),void y(this)):g.Box.call(this,null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height)},extend:{merge:function(t){var e=new this.constructor;return e.x=Math.min(this.x,t.x),e.y=Math.min(this.y,t.y),e.width=Math.max(this.x+this.width,t.x+t.width)-e.x,e.height=Math.max(this.y+this.height,t.y+t.height)-e.y,y(e)},transform:function(t){var e=1/0,i=-(1/0),n=1/0,r=-(1/0),s=[new g.Point(this.x,this.y),new g.Point(this.x2,this.y),new g.Point(this.x,this.y2),new g.Point(this.x2,this.y2)];return s.forEach(function(s){s=s.transform(t),e=Math.min(e,s.x),i=Math.max(i,s.x),n=Math.min(n,s.y),r=Math.max(r,s.y)}),bbox=new this.constructor,bbox.x=e,bbox.width=i-e,bbox.y=n,bbox.height=r-n,y(bbox),bbox}}}),g.BBox=g.invent({create:function(t){if(g.Box.apply(this,[].slice.call(arguments)),t instanceof g.Element){var i;try{if(e.documentElement.contains){if(!e.documentElement.contains(t.node))throw new Exception("Element not in the dom")}else{for(var n=t.node;n.parentNode;)n=n.parentNode;if(n!=e)throw new Exception("Element not in the dom")}i=t.node.getBBox()}catch(e){if(t instanceof g.Shape){var r=t.clone(g.parser.draw).show();i=r.node.getBBox(),r.remove()}else i={x:t.node.clientLeft,y:t.node.clientTop,width:t.node.clientWidth,height:t.node.clientHeight}}g.Box.call(this,i)}},inherit:g.Box,parent:g.Element,construct:{bbox:function(){return new g.BBox(this)}}}),g.BBox.prototype.constructor=g.BBox,g.extend(g.Element,{tbox:function(){return console.warn("Use of TBox is deprecated and mapped to RBox. Use .rbox() instead."),this.rbox(this.doc())}}),g.RBox=g.invent({create:function(t){g.Box.apply(this,[].slice.call(arguments)),t instanceof g.Element&&g.Box.call(this,t.node.getBoundingClientRect())},inherit:g.Box,parent:g.Element,extend:{addOffset:function(){return this.x+=t.pageXOffset,this.y+=t.pageYOffset,this}},construct:{rbox:function(t){return t?new g.RBox(this).transform(t.screenCTM().inverse()):new g.RBox(this).addOffset()}}}),g.RBox.prototype.constructor=g.RBox,g.Matrix=g.invent({create:function(t){var e,i=f([1,0,0,1,0,0]);for(t=t instanceof g.Element?t.matrixify():"string"==typeof t?f(t.split(g.regex.delimiter).map(parseFloat)):6==arguments.length?f([].slice.call(arguments)):Array.isArray(t)?f(t):"object"==typeof t?t:i,e=b.length-1;e>=0;--e)this[b[e]]=t&&"number"==typeof t[b[e]]?t[b[e]]:i[b[e]]},extend:{extract:function(){var t=c(this,0,1),e=c(this,1,0),i=180/Math.PI*Math.atan2(t.y,t.x)-90;return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(i*Math.PI/180)+this.f*Math.sin(i*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(i*Math.PI/180)+this.e*Math.sin(-i*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),skewX:-i,skewY:180/Math.PI*Math.atan2(e.y,e.x),scaleX:Math.sqrt(this.a*this.a+this.b*this.b),scaleY:Math.sqrt(this.c*this.c+this.d*this.d),rotation:i,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new g.Matrix(this)}},clone:function(){return new g.Matrix(this)},morph:function(t){return this.destination=new g.Matrix(t),this},at:function(t){if(!this.destination)return this;var e=new g.Matrix({a:this.a+(this.destination.a-this.a)*t,b:this.b+(this.destination.b-this.b)*t,c:this.c+(this.destination.c-this.c)*t,d:this.d+(this.destination.d-this.d)*t,e:this.e+(this.destination.e-this.e)*t,f:this.f+(this.destination.f-this.f)*t});return e},multiply:function(t){return new g.Matrix(this.native().multiply(d(t).native()))},inverse:function(){return new g.Matrix(this.native().inverse())},translate:function(t,e){return new g.Matrix(this.native().translate(t||0,e||0))},scale:function(t,e,i,n){return 1==arguments.length?e=t:3==arguments.length&&(n=i,i=e,e=t),this.around(i,n,new g.Matrix(t,0,0,e,0,0))},rotate:function(t,e,i){return t=g.utils.radians(t),this.around(e,i,new g.Matrix(Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t),0,0))},flip:function(t,e){return e="number"==typeof t?t:e,"x"==t?this.scale(-1,1,e,0):"y"==t?this.scale(1,-1,0,e):this.scale(-1,-1,e,e)},skew:function(t,e,i,n){return 1==arguments.length?e=t:3==arguments.length&&(n=i,i=e,e=t),t=g.utils.radians(t),e=g.utils.radians(e),this.around(i,n,new g.Matrix(1,Math.tan(e),Math.tan(t),1,0,0))},skewX:function(t,e,i){return this.skew(t,0,e,i)},skewY:function(t,e,i){return this.skew(0,t,e,i)},around:function(t,e,i){return this.multiply(new g.Matrix(1,0,0,1,t||0,e||0)).multiply(i).multiply(new g.Matrix(1,0,0,1,-t||0,-e||0))},native:function(){for(var t=g.parser.native.createSVGMatrix(),e=b.length-1;e>=0;e--)t[b[e]]=this[b[e]];return t},toString:function(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}},parent:g.Element,construct:{ctm:function(){return new g.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof g.Nested){var t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new g.Matrix(e)}return new g.Matrix(this.node.getScreenCTM())}}}),g.Point=g.invent({create:function(t,e){var i,n={x:0,y:0};i=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:null!=t?{x:t,y:null!=e?e:t}:n,this.x=i.x,this.y=i.y},extend:{clone:function(){return new g.Point(this)},morph:function(t,e){return this.destination=new g.Point(t,e),this},at:function(t){
101if(!this.destination)return this;var e=new g.Point({x:this.x+(this.destination.x-this.x)*t,y:this.y+(this.destination.y-this.y)*t});return e},native:function(){var t=g.parser.native.createSVGPoint();return t.x=this.x,t.y=this.y,t},transform:function(t){return new g.Point(this.native().matrixTransform(t.native()))}}}),g.extend(g.Element,{point:function(t,e){return new g.Point(t,e).transform(this.screenCTM().inverse())}}),g.extend(g.Element,{attr:function(t,e,i){if(null==t){for(t={},e=this.node.attributes,i=e.length-1;i>=0;i--)t[e[i].nodeName]=g.regex.isNumber.test(e[i].nodeValue)?parseFloat(e[i].nodeValue):e[i].nodeValue;return t}if("object"==typeof t)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return e=this.node.getAttribute(t),null==e?g.defaults.attrs[t]:g.regex.isNumber.test(e)?parseFloat(e):e;"stroke-width"==t?this.attr("stroke",parseFloat(e)>0?this._stroke:null):"stroke"==t&&(this._stroke=e),"fill"!=t&&"stroke"!=t||(g.regex.isImage.test(e)&&(e=this.doc().defs().image(e,0,0)),e instanceof g.Image&&(e=this.doc().defs().pattern(0,0,function(){this.add(e)}))),"number"==typeof e?e=new g.Number(e):g.Color.isColor(e)?e=new g.Color(e):Array.isArray(e)&&(e=new g.Array(e)),"leading"==t?this.leading&&this.leading(e):"string"==typeof i?this.node.setAttributeNS(i,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!=t&&"x"!=t||this.rebuild(t,e)}return this}}),g.extend(g.Element,{transform:function(t,e){var i,n=this;if("object"!=typeof t)return i=new g.Matrix(n).extract(),"string"==typeof t?i[t]:i;if(i=new g.Matrix(n),e=!!e||!!t.relative,null!=t.a)i=e?i.multiply(new g.Matrix(t)):new g.Matrix(t);else if(null!=t.rotation)p(t,n),i=e?i.rotate(t.rotation,t.cx,t.cy):i.rotate(t.rotation-i.extract().rotation,t.cx,t.cy);else if(null!=t.scale||null!=t.scaleX||null!=t.scaleY){if(p(t,n),t.scaleX=null!=t.scale?t.scale:null!=t.scaleX?t.scaleX:1,t.scaleY=null!=t.scale?t.scale:null!=t.scaleY?t.scaleY:1,!e){var r=i.extract();t.scaleX=1*t.scaleX/r.scaleX,t.scaleY=1*t.scaleY/r.scaleY}i=i.scale(t.scaleX,t.scaleY,t.cx,t.cy)}else if(null!=t.skew||null!=t.skewX||null!=t.skewY){if(p(t,n),t.skewX=null!=t.skew?t.skew:null!=t.skewX?t.skewX:0,t.skewY=null!=t.skew?t.skew:null!=t.skewY?t.skewY:0,!e){var r=i.extract();i=i.multiply((new g.Matrix).skew(r.skewX,r.skewY,t.cx,t.cy).inverse())}i=i.skew(t.skewX,t.skewY,t.cx,t.cy)}else t.flip?i=i.flip(t.flip,null==t.offset?n.bbox()["c"+t.flip]:t.offset):null==t.x&&null==t.y||(e?i=i.translate(t.x,t.y):(null!=t.x&&(i.e=t.x),null!=t.y&&(i.f=t.y)));return this.attr("transform",i)}}),g.extend(g.FX,{transform:function(t,e){var i,n=this.target();return"object"!=typeof t?(i=new g.Matrix(n).extract(),"string"==typeof t?i[t]:i):(e=!!e||!!t.relative,null!=t.a?i=new g.Matrix(t):null!=t.rotation?(p(t,n),i=new g.Rotate(t.rotation,t.cx,t.cy)):null!=t.scale||null!=t.scaleX||null!=t.scaleY?(p(t,n),t.scaleX=null!=t.scale?t.scale:null!=t.scaleX?t.scaleX:1,t.scaleY=null!=t.scale?t.scale:null!=t.scaleY?t.scaleY:1,i=new g.Scale(t.scaleX,t.scaleY,t.cx,t.cy)):null!=t.skewX||null!=t.skewY?(p(t,n),t.skewX=null!=t.skewX?t.skewX:0,t.skewY=null!=t.skewY?t.skewY:0,i=new g.Skew(t.skewX,t.skewY,t.cx,t.cy)):t.flip?i=(new g.Matrix).flip(t.flip,null==t.offset?n.bbox()["c"+t.flip]:t.offset):null==t.x&&null==t.y||(i=new g.Translate(t.x,t.y)),i?(i.relative=e,this.last().transforms.push(i),this._callStart()):this)}}),g.extend(g.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){var t=(this.attr("transform")||"").split(g.regex.transforms).slice(0,-1).map(function(t){var e=t.trim().split("(");return[e[0],e[1].split(g.regex.delimiter).map(function(t){return parseFloat(t)})]}).reduce(function(t,e){return"matrix"==e[0]?t.multiply(f(e[1])):t[e[0]].apply(t,e[1])},new g.Matrix);return t},toParent:function(t){if(this==t)return this;var e=this.screenCTM(),i=t.screenCTM().inverse();return this.addTo(t).untransform().transform(i.multiply(e)),this},toDoc:function(){return this.toParent(this.doc())}}),g.Transformation=g.invent({create:function(t,e){if(arguments.length>1&&"boolean"!=typeof e)return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(t))for(var i=0,n=this.arguments.length;i<n;++i)this[this.arguments[i]]=t[i];else if("object"==typeof t)for(var i=0,n=this.arguments.length;i<n;++i)this[this.arguments[i]]=t[this.arguments[i]];this.inversed=!1,e===!0&&(this.inversed=!0)},extend:{arguments:[],method:"",at:function(t){for(var e=[],i=0,n=this.arguments.length;i<n;++i)e.push(this[this.arguments[i]]);var r=this._undo||new g.Matrix;return r=(new g.Matrix).morph(g.Matrix.prototype[this.method].apply(r,e)).at(t),this.inversed?r.inverse():r},undo:function(t){for(var e=0,i=this.arguments.length;e<i;++e)t[this.arguments[e]]="undefined"==typeof this[this.arguments[e]]?0:t[this.arguments[e]];return t.cx=this.cx,t.cy=this.cy,this._undo=new(g[a(this.method)])(t,!0).at(1),this}}}),g.Translate=g.invent({parent:g.Matrix,inherit:g.Transformation,create:function(t,e){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["transformedX","transformedY"],method:"translate"}}),g.Rotate=g.invent({parent:g.Matrix,inherit:g.Transformation,create:function(t,e){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["rotation","cx","cy"],method:"rotate",at:function(t){var e=(new g.Matrix).rotate((new g.Number).morph(this.rotation-(this._undo?this._undo.rotation:0)).at(t),this.cx,this.cy);return this.inversed?e.inverse():e},undo:function(t){return this._undo=t,this}}}),g.Scale=g.invent({parent:g.Matrix,inherit:g.Transformation,create:function(t,e){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["scaleX","scaleY","cx","cy"],method:"scale"}}),g.Skew=g.invent({parent:g.Matrix,inherit:g.Transformation,create:function(t,e){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["skewX","skewY","cx","cy"],method:"skew"}}),g.extend(g.Element,{style:function(t,e){if(0==arguments.length)return this.node.style.cssText||"";if(arguments.length<2)if("object"==typeof t)for(e in t)this.style(e,t[e]);else{if(!g.regex.isCss.test(t))return this.node.style[o(t)];for(t=t.split(/\s*;\s*/).filter(function(t){return!!t}).map(function(t){return t.split(/\s*:\s*/)});e=t.pop();)this.style(e[0],e[1])}else this.node.style[o(t)]=null===e||g.regex.isBlank.test(e)?"":e;return this}}),g.Parent=g.invent({create:function(t){this.constructor.call(this,t)},inherit:g.Element,extend:{children:function(){return g.utils.map(g.utils.filterSVGElements(this.node.childNodes),function(t){return g.adopt(t)})},add:function(t,e){return null==e?this.node.appendChild(t.node):t.node!=this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this},put:function(t,e){return this.add(t,e),t},has:function(t){return this.index(t)>=0},index:function(t){return[].slice.call(this.node.childNodes).indexOf(t.node)},get:function(t){return g.adopt(this.node.childNodes[t])},first:function(){return this.get(0)},last:function(){return this.get(this.node.childNodes.length-1)},each:function(t,e){var i,n,r=this.children();for(i=0,n=r.length;i<n;i++)r[i]instanceof g.Element&&t.apply(r[i],[i,r]),e&&r[i]instanceof g.Container&&r[i].each(t,e);return this},removeElement:function(t){return this.node.removeChild(t.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this},defs:function(){return this.doc().defs()}}}),g.extend(g.Parent,{ungroup:function(t,e){return 0===e||this instanceof g.Defs?this:(t=t||(this instanceof g.Doc?this:this.parent(g.Parent)),e=e||1/0,this.each(function(){return this instanceof g.Defs?this:this instanceof g.Parent?this.ungroup(t,e-1):this.toParent(t)}),this.node.firstChild||this.remove(),this)},flatten:function(t,e){return this.ungroup(t,e)}}),g.Container=g.invent({create:function(t){this.constructor.call(this,t)},inherit:g.Parent}),g.ViewBox=g.invent({create:function(t){var e,i,n,r,s,o,a,h,u=[0,0,0,0],l=1,c=1,f=/[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/gi;if(t instanceof g.Element){for(a=t,h=t,o=(t.attr("viewBox")||"").match(f),s=t.bbox,n=new g.Number(t.width()),r=new g.Number(t.height());"%"==n.unit;)l*=n.value,n=new g.Number(a instanceof g.Doc?a.parent().offsetWidth:a.parent().width()),a=a.parent();for(;"%"==r.unit;)c*=r.value,r=new g.Number(h instanceof g.Doc?h.parent().offsetHeight:h.parent().height()),h=
vendor: 5,748 bytes, line 101
101h.parent();this.x=0,this.y=0,this.width=n*l,this.height=r*c,this.zoom=1,o&&(e=parseFloat(o[0]),i=parseFloat(o[1]),n=parseFloat(o[2]),r=parseFloat(o[3]),this.zoom=this.width/this.height>n/r?this.height/r:this.width/n,this.x=e,this.y=i,this.width=n,this.height=r)}else t="string"==typeof t?t.match(f).map(function(t){return parseFloat(t)}):Array.isArray(t)?t:"object"==typeof t?[t.x,t.y,t.width,t.height]:4==arguments.length?[].slice.call(arguments):u,this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]},extend:{toString:function(){return this.x+" "+this.y+" "+this.width+" "+this.height},morph:function(t,e,i,n){return this.destination=new g.ViewBox(t,e,i,n),this},at:function(t){return this.destination?new g.ViewBox([this.x+(this.destination.x-this.x)*t,this.y+(this.destination.y-this.y)*t,this.width+(this.destination.width-this.width)*t,this.height+(this.destination.height-this.height)*t]):this}},parent:g.Container,construct:{viewbox:function(t,e,i,n){return 0==arguments.length?new g.ViewBox(this):this.attr("viewBox",new g.ViewBox(t,e,i,n))}}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach(function(t){g.Element.prototype[t]=function(e){return g.on(this.node,t,e),this}}),g.listeners=[],g.handlerMap=[],g.listenerId=0,g.on=function(t,e,i,n){var r=i.bind(n||t.instance||t),s=(g.handlerMap.indexOf(t)+1||g.handlerMap.push(t))-1,o=e.split(".")[0],a=e.split(".")[1]||"*";g.listeners[s]=g.listeners[s]||{},g.listeners[s][o]=g.listeners[s][o]||{},g.listeners[s][o][a]=g.listeners[s][o][a]||{},i._svgjsListenerId||(i._svgjsListenerId=++g.listenerId),g.listeners[s][o][a][i._svgjsListenerId]=r,t.addEventListener(o,r,!1)},g.off=function(t,e,i){var n=g.handlerMap.indexOf(t),r=e&&e.split(".")[0],s=e&&e.split(".")[1];if(n!=-1)if(i){if("function"==typeof i&&(i=i._svgjsListenerId),!i)return;g.listeners[n][r]&&g.listeners[n][r][s||"*"]&&(t.removeEventListener(r,g.listeners[n][r][s||"*"][i],!1),delete g.listeners[n][r][s||"*"][i])}else if(s&&r){if(g.listeners[n][r]&&g.listeners[n][r][s]){for(i in g.listeners[n][r][s])g.off(t,[r,s].join("."),i);delete g.listeners[n][r][s]}}else if(s)for(e in g.listeners[n])for(namespace in g.listeners[n][e])s===namespace&&g.off(t,[e,s].join("."));else if(r){if(g.listeners[n][r]){for(namespace in g.listeners[n][r])g.off(t,[r,namespace].join("."));delete g.listeners[n][r]}}else{for(e in g.listeners[n])g.off(t,e);delete g.listeners[n],delete g.handlerMap[n]}},g.extend(g.Element,{on:function(t,e,i){return g.on(this.node,t,e,i),this},off:function(t,e){return g.off(this.node,t,e),this},fire:function(e,i){return e instanceof t.Event?this.node.dispatchEvent(e):this.node.dispatchEvent(e=new t.CustomEvent(e,{detail:i,cancelable:!0})),this._event=e,this},event:function(){return this._event}}),g.Defs=g.invent({create:"defs",inherit:g.Container}),g.G=g.invent({create:"g",inherit:g.Container,extend:{x:function(t){return null==t?this.transform("x"):this.transform({x:t-this.x()},!0)},y:function(t){return null==t?this.transform("y"):this.transform({y:t-this.y()},!0)},cx:function(t){return null==t?this.gbox().cx:this.x(t-this.gbox().width/2)},cy:function(t){return null==t?this.gbox().cy:this.y(t-this.gbox().height/2)},gbox:function(){var t=this.bbox(),e=this.transform();return t.x+=e.x,t.x2+=e.x,t.cx+=e.x,t.y+=e.y,t.y2+=e.y,t.cy+=e.y,t}},construct:{group:function(){return this.put(new g.G)}}}),g.extend(g.Element,{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},previous:function(){return this.siblings()[this.position()-1]},forward:function(){var t=this.position()+1,e=this.parent();return e.removeElement(this).add(this,t),e instanceof g.Doc&&e.node.appendChild(e.defs().node),this},backward:function(){var t=this.position();return t>0&&this.parent().removeElement(this).add(this,t-1),this},front:function(){var t=this.parent();return t.node.appendChild(this.node),t instanceof g.Doc&&t.node.appendChild(t.defs().node),this},back:function(){return this.position()>0&&this.parent().removeElement(this).add(this,0),this},before:function(t){t.remove();var e=this.position();return this.parent().add(t,e),this},after:function(t){t.remove();var e=this.position();return this.parent().add(t,e+1),this}}),g.Mask=g.invent({create:function(){this.constructor.call(this,g.create("mask")),this.targets=[]},inherit:g.Container,extend:{remove:function(){for(var t=this.targets.length-1;t>=0;t--)this.targets[t]&&this.targets[t].unmask();return this.targets=[],this.parent().removeElement(this),this}},construct:{mask:function(){return this.defs().put(new g.Mask)}}}),g.extend(g.Element,{maskWith:function(t){return this.masker=t instanceof g.Mask?t:this.parent().mask().add(t),this.masker.targets.push(this),this.attr("mask",'url("#'+this.masker.attr("id")+'")')},unmask:function(){return delete this.masker,this.attr("mask",null)}}),g.ClipPath=g.invent({create:function(){this.constructor.call(this,g.create("clipPath")),this.targets=[]},inherit:g.Container,extend:{remove:function(){for(var t=this.targets.length-1;t>=0;t--)this.targets[t]&&this.targets[t].unclip();return this.targets=[],this.parent().removeElement(this),this}},construct:{clip:function(){return this.defs().put(new g.ClipPath)}}}),g.extend(g.Element,{clipWith:function(t){return this.clipper=t instanceof g.ClipPath?t:this.parent().clip().add(t),this.clipper.targets.push(this),this.attr("clip-path",'url("#'+this.clipper.attr("id")+'")')},unclip:function(){return delete this.clipper,this.attr("clip-path",null)}}),g.Gradient=g.invent({create:function(t){this.constructor.call(this,g.create(t+"Gradient")),this.type=t}
vendor: 16,780 bytes, line 101
101,inherit:g.Container,extend:{at:function(t,e,i){return this.put(new g.Stop).update(t,e,i)},update:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(t,e,i){return"transform"==t&&(t="gradientTransform"),g.Container.prototype.attr.call(this,t,e,i)}},construct:{gradient:function(t,e){return this.defs().gradient(t,e)}}}),g.extend(g.Gradient,g.FX,{from:function(t,e){return"radial"==(this._target||this).type?this.attr({fx:new g.Number(t),fy:new g.Number(e)}):this.attr({x1:new g.Number(t),y1:new g.Number(e)})},to:function(t,e){return"radial"==(this._target||this).type?this.attr({cx:new g.Number(t),cy:new g.Number(e)}):this.attr({x2:new g.Number(t),y2:new g.Number(e)})}}),g.extend(g.Defs,{gradient:function(t,e){return this.put(new g.Gradient(t)).update(e)}}),g.Stop=g.invent({create:"stop",inherit:g.Element,extend:{update:function(t){return("number"==typeof t||t instanceof g.Number)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new g.Number(t.offset)),this}}}),g.Pattern=g.invent({create:"pattern",inherit:g.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this},toString:function(){return this.fill()},attr:function(t,e,i){return"transform"==t&&(t="patternTransform"),g.Container.prototype.attr.call(this,t,e,i)}},construct:{pattern:function(t,e,i){return this.defs().pattern(t,e,i)}}}),g.extend(g.Defs,{pattern:function(t,e,i){return this.put(new g.Pattern).update(i).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}}),g.Doc=g.invent({create:function(t){t&&(t="string"==typeof t?e.getElementById(t):t,"svg"==t.nodeName?this.constructor.call(this,t):(this.constructor.call(this,g.create("svg")),t.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:g.Container,extend:{namespace:function(){return this.attr({xmlns:g.ns,version:"1.1"}).attr("xmlns:xlink",g.xlink,g.xmlns).attr("xmlns:svgjs",g.svgjs,g.xmlns)},defs:function(){if(!this._defs){var t;(t=this.node.getElementsByTagName("defs")[0])?this._defs=g.adopt(t):this._defs=new g.Defs,this.node.appendChild(this._defs.node)}return this._defs},parent:function(){return"#document"==this.node.parentNode.nodeName?null:this.node.parentNode},spof:function(t){var e=this.node.getScreenCTM();return e&&this.style("left",-e.e%1+"px").style("top",-e.f%1+"px"),this},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this}}}),g.Shape=g.invent({create:function(t){this.constructor.call(this,t)},inherit:g.Element}),g.Bare=g.invent({create:function(t,e){if(this.constructor.call(this,g.create(t)),e)for(var i in e.prototype)"function"==typeof e.prototype[i]&&(this[i]=e.prototype[i])},inherit:g.Element,extend:{words:function(t){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this.node.appendChild(e.createTextNode(t)),this}}}),g.extend(g.Parent,{element:function(t,e){return this.put(new g.Bare(t,e))}}),g.Symbol=g.invent({create:"symbol",inherit:g.Container,construct:{symbol:function(){return this.put(new g.Symbol)}}}),g.Use=g.invent({create:"use",inherit:g.Shape,extend:{element:function(t,e){return this.attr("href",(e||"")+"#"+t,g.xlink)}},construct:{use:function(t,e){return this.put(new g.Use).element(t,e)}}}),g.Rect=g.invent({create:"rect",inherit:g.Shape,construct:{rect:function(t,e){return this.put(new g.Rect).size(t,e)}}}),g.Circle=g.invent({create:"circle",inherit:g.Shape,construct:{circle:function(t){return this.put(new g.Circle).rx(new g.Number(t).divide(2)).move(0,0)}}}),g.extend(g.Circle,g.FX,{rx:function(t){return this.attr("r",t)},ry:function(t){return this.rx(t)}}),g.Ellipse=g.invent({create:"ellipse",inherit:g.Shape,construct:{ellipse:function(t,e){return this.put(new g.Ellipse).size(t,e).move(0,0)}}}),g.extend(g.Ellipse,g.Rect,g.FX,{rx:function(t){return this.attr("rx",t)},ry:function(t){return this.attr("ry",t)}}),g.extend(g.Circle,g.Ellipse,{x:function(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())},y:function(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())},cx:function(t){return null==t?this.attr("cx"):this.attr("cx",t)},cy:function(t){return null==t?this.attr("cy"):this.attr("cy",t)},width:function(t){return null==t?2*this.rx():this.rx(new g.Number(t).divide(2))},height:function(t){return null==t?2*this.ry():this.ry(new g.Number(t).divide(2))},size:function(t,e){var i=l(this,t,e);return this.rx(new g.Number(i.width).divide(2)).ry(new g.Number(i.height).divide(2))}}),g.Line=g.invent({create:"line",inherit:g.Shape,extend:{array:function(){return new g.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(t,e,i,n){return null==t?this.array():(t="undefined"!=typeof e?{x1:t,y1:e,x2:i,y2:n}:new g.PointArray(t).toLine(),this.attr(t))},move:function(t,e){return this.attr(this.array().move(t,e).toLine())},size:function(t,e){var i=l(this,t,e);return this.attr(this.array().size(i.width,i.height).toLine())}},construct:{line:function(t,e,i,n){return g.Line.prototype.plot.apply(this.put(new g.Line),null!=t?[t,e,i,n]:[0,0,0,0])}}}),g.Polyline=g.invent({create:"polyline",inherit:g.Shape,construct:{polyline:function(t){return this.put(new g.Polyline).plot(t||new g.PointArray)}}}),g.Polygon=g.invent({create:"polygon",inherit:g.Shape,construct:{polygon:function(t){return this.put(new g.Polygon).plot(t||new g.PointArray)}}}),g.extend(g.Polyline,g.Polygon,{array:function(){return this._array||(this._array=new g.PointArray(this.attr("points")))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new g.PointArray(t))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},size:function(t,e){var i=l(this,t,e);return this.attr("points",this.array().size(i.width,i.height))}}),g.extend(g.Line,g.Polyline,g.Polygon,{morphArray:g.PointArray,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){var e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){var e=this.bbox();return null==t?e.height:this.size(e.width,t)}}),g.Path=g.invent({create:"path",inherit:g.Shape,extend:{morphArray:g.PathArray,array:function(){return this._array||(this._array=new g.PathArray(this.attr("d")))},plot:function(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new g.PathArray(t))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("d",this.array().move(t,e))},x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},size:function(t,e){var i=l(this,t,e);return this.attr("d",this.array().size(i.width,i.height))},width:function(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)},height:function(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}},construct:{path:function(t){return this.put(new g.Path).plot(t||new g.PathArray)}}}),g.Image=g.invent({create:"image",inherit:g.Shape,extend:{load:function(e){if(!e)return this;var i=this,n=new t.Image;return g.on(n,"load",function(){var t=i.parent(g.Pattern);null!==t&&(0==i.width()&&0==i.height()&&i.size(n.width,n.height),t&&0==t.width()&&0==t.height()&&t.size(i.width(),i.height()),"function"==typeof i._loaded&&i._loaded.call(i,{width:n.width,height:n.height,ratio:n.width/n.height,url:e}))}),g.on(n,"error",function(t){"function"==typeof i._error&&i._error.call(i,t)}),this.attr("href",n.src=this.src=e,g.xlink)},loaded:function(t){return this._loaded=t,this},error:function(t){return this._error=t,this}},construct:{image:function(t,e,i){return this.put(new g.Image).load(t).size(e||0,i||e||0)}}}),g.Text=g.invent({create:function(){this.constructor.call(this,g.create("text")),this.dom.leading=new g.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",g.defaults.attrs["font-family"])},inherit:g.Shape,extend:{x:function(t){return null==t?this.attr("x"):this.attr("x",t)},y:function(t){var e=this.attr("y"),i="number"==typeof e?e-this.bbox().y:0;return null==t?"number"==typeof e?e-i:e:this.attr("y","number"==typeof t?t+i:t)},cx:function(t){return null==t?this.bbox().cx:this.x(t-this.bbox().width/2)},cy:function(t){return null==t?this.bbox().cy:this.y(t-this.bbox().height/2)},text:function(t){if("undefined"==typeof t){for(var t="",e=this.node.childNodes,i=0,n=e.length;i<n;++i)0!=i&&3!=e[i].nodeType&&1==g.adopt(e[i]).dom.newLined&&(t+="\n"),t+=e[i].textContent;return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else{t=t.split("\n");for(var i=0,r=t.length;i<r;i++)this.tspan(t[i]).newLine()}return this.build(!1).rebuild()},size:function(t){return this.attr("font-size",t).rebuild()},leading:function(t){return null==t?this.dom.leading:(this.dom.leading=new g.Number(t),this.rebuild())},lines:function(){var t=(this.textPath&&this.textPath()||this).node,e=g.utils.map(g.utils.filterSVGElements(t.childNodes),function(t){return g.adopt(t)});return new g.Set(e)},rebuild:function(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){var e=this,i=0,n=this.dom.leading*new g.Number(this.attr("font-size"));this.lines().each(function(){this.dom.newLined&&(e.textPath()||this.attr("x",e.attr("x")),"\n"==this.text()?i+=n:(this.attr("dy",n+i),i=0))}),this.fire("rebuild")}return this},build:function(t){return this._build=!!t,this},setData:function(t){return this.dom=t,this.dom.leading=new g.Number(t.leading||1.3),this}},construct:{text:function(t){return this.put(new g.Text).text(t)},plain:function(t){return this.put(new g.Text).plain(t)}}}),g.Tspan=g.invent({create:"tspan",inherit:g.Shape,extend:{text:function(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?t.call(this,this):this.plain(t),this)},dx:function(t){return this.attr("dx",t)},dy:function(t){return this.attr("dy",t)},newLine:function(){var t=this.parent(g.Text);return this.dom.newLined=!0,this.dy(t.dom.leading*t.attr("font-size")).attr("x",t.x())}}}),g.extend(g.Text,g.Tspan,{plain:function(t){return this._build===!1&&this.clear(),this.node.appendChild(e.createTextNode(t)),this},tspan:function(t){var e=(this.textPath&&this.textPath()||this).node,i=new g.Tspan;return this._build===!1&&this.clear(),e.appendChild(i.node),i.text(t)},clear:function(){for(var t=(this.textPath&&this.textPath()||this).node;t.hasChildNodes();)t.removeChild(t.lastChild);return this},length:function(){return this.node.getComputedTextLength()}}),g.TextPath=g.invent({create:"textPath",inherit:g.Parent,parent:g.Text,construct:{path:function(t){for(var e=new g.TextPath,i=this.doc().defs().path(t);this.node.hasChildNodes();)e.node.appendChild(this.node.firstChild);return this.node.appendChild(e.node),e.attr("href","#"+i,g.xlink),this},array:function(){var t=this.track();return t?t.array():null},plot:function(t){var e=this.track(),i=null;return e&&(i=e.plot(t)),null==t?i:this},track:function(){var t=this.textPath();if(t)return t.reference("href")},textPath:function(){if(this.node.firstChild&&"textPath"==this.node.firstChild.nodeName)return g.adopt(this.node.firstChild)}}}),g.Nested=g.invent({create:function(){this.constructor.call(this,g.create("svg")),this.style("overflow","visible")},inherit:g.Container,construct:{nested:function(){return this.put(new g.Nested)}}}),g.A=g.invent({create:"a",inherit:g.Container,extend:{to:function(t){return this.attr("href",t,g.xlink)},show:function(t){return this.attr("show",t,g.xlink)},target:function(t){return this.attr("target",t)}},construct:{link:function(t){return this.put(new g.A).to(t)}}}),g.extend(g.Element,{linkTo:function(t){var e=new g.A;return"function"==typeof t?t.call(e,e):e.to(t),this.parent().put(e).put(this)}}),g.Marker=g.invent({create:"marker",inherit:g.Container,extend:{width:function(t){return this.attr("markerWidth",t)},height:function(t){return this.attr("markerHeight",t)},ref:function(t,e){return this.attr("refX",t).attr("refY",e)},update:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this},toString:function(){return"url(#"+this.id()+")"}},construct:{marker:function(t,e,i){return this.defs().marker(t,e,i)}}}),g.extend(g.Defs,{marker:function(t,e,i){return this.put(new g.Marker).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(i)}}),g.extend(g.Line,g.Polyline,g.Polygon,g.Path,{marker:function(t,e,i,n){var r=["marker"];return"all"!=t&&r.push(t),r=r.join("-"),t=arguments[1]instanceof g.Marker?arguments[1]:this.doc().marker(e,i,n),this.attr(r,t)}});var w={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"==e?t:t+"-"+e}};["fill","stroke"].forEach(function(t){var e,i={};i[t]=function(i){if("undefined"==typeof i)return this;if("string"==typeof i||g.Color.isRgb(i)||i&&"function"==typeof i.fill)this.attr(t,i);else for(e=w[t].length-1;e>=0;e--)null!=i[w[t][e]]&&this.attr(w.prefix(t,w[t][e]),i[w[t][e]]);return this},g.extend(g.Element,g.FX,i)}),g.extend(g.Element,g.FX,{rotate:function(t,e,i){return this.transform({rotation:t,cx:e,cy:i})},skew:function(t,e,i,n){return 1==arguments.length||3==arguments.length?this.transform({skew:t,cx:e,cy:i}):this.transform({skewX:t,skewY:e,cx:i,cy:n})},scale:function(t,e,i,n){return 1==arguments.length||3==arguments.length?this.transform({scale:t,cx:e,cy:i}):this.transform({scaleX:t,scaleY:e,cx:i,cy:n})},translate:function(t,e){return this.transform({x:t,y:e})},flip:function(t,e){return e="number"==typeof t?t:e,this.transform({flip:t||"both",offset:e})},matrix:function(t){return this.attr("transform",new g.Matrix(6==arguments.length?[].slice.call(arguments):t))},opacity:function(t){return this.attr("opacity",t)},dx:function(t){return this.x(new g.Number(t).plus(this instanceof g.FX?0:this.x()),!0)},dy:function(t){return this.y(new g.Number(t).plus(this instanceof g.FX?0:this.y()),!0)},dmove:function(t,e){return this.dx(t).dy(e)}}),g.extend(g.Rect,g.Ellipse,g.Circle,g.Gradient,g.FX,{radius:function(t,e){var i=(this._target||this).type;return"radial"==i||"circle"==i?this.attr("r",new g.Number(t)):this.rx(t).ry(null==e?t:e)}}),g.extend(g.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(t){return this.node.getPointAtLength(t)}}),g.extend(g.Parent,g.Text,g.Tspan,g.FX,{font:function(t,e){if("object"==typeof t)for(e in t)this.font(e,t[e]);return"leading"==t?this.leading(e):"anchor"==t?this.attr("text-anchor",e):"size"==t||"family"==t||"weight"==t||"stretch"==t||"variant"==t||"style"==t?this.attr("font-"+t,e):this.attr(t,e)}}),g.Set=g.invent({create:function(t){Array.isArray(t)?this.members=t:this.clear()},extend:{add:function(){var t,e,i=[].slice.call(arguments);for(t=0,e=i.length;t<e;t++)this.members.push(i[t]);return this},remove:function(t){var e=this.index(t);return e>-1&&this.members.splice(e,1),this},each:function(t){for(var e=0,i=this.members.length;e<i;e++)t.apply(this.members[e],[e,this.members]);return this},clear:function(){return this.members=[],this},length:function(){return this.members.length},has:function(t){return this.index(t)>=0},index:function(t){return this.members.indexOf(t)},get:function(t){return this.members[t]},first:function(){return this.get(0)},last:function(){return this.get(this.members.length-1)},valueOf:function(){return this.members},bbox:function(){if(0==this.members.length)return new g.RBox;var t=this.members[0].rbox(this.members[0].doc());return this.each(function(){t=t.merge(this.rbox(this.doc()))}),t}},construct:{set:function(t){return new g.Set(t)}}}),g.FX.Set=g.invent({create:function(t){this.set=t}}),g.Set.inherit=function(){var t,e=[];for(var t in g.Shape.prototype)"function"==typeof g.Shape.prototype[t]&&"function"!=typeof g.Set.prototype[t]&&e.push(t);e.forEach(function(t){g.Set.prototype[t]=function(){for(var e=0,i=this.members.length;e<i;e++)this.members[e]&&"function"==typeof this.members[e][t]&&this.members[e][t].apply(this.members[e],arguments);return"animate"==t?this.fx||(this.fx=new g.FX.Set(this)):this}}),e=[];for(var t in g.FX.prototype)"function"==typeof g.FX.prototype[t]&&"function"!=typeof g.FX.Set.prototype[t]&&e.push(t);e.forEach(function(t){g.FX.Set.prototype[t]=function(){for(var e=0,i=this.set.members.length;e<i;e++)this.set.members[e].fx[t].apply(this.set.members[e].fx,arguments);return this}})}
101,g.extend(g.Element,{data:function(t,e,i){if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:i===!0||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),g.extend(g.Element,{remember:function(t,e){if("object"==typeof arguments[0])for(var e in t)this.remember(e,t[e]);else{if(1==arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0==arguments.length)this._memory={};else for(var t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory||(this._memory={})}}),g.get=function(t){var i=e.getElementById(v(t)||t);return g.adopt(i)},g.select=function(t,i){return new g.Set(g.utils.map((i||e).querySelectorAll(t),function(t){return g.adopt(t)}))},g.extend(g.Parent,{select:function(t){return g.select(t,this.node)}});var b="abcdef".split("");if("function"!=typeof t.CustomEvent){
102var C=function(t,i){i=i||{bubbles:!1,cancelable:!1,detail:void 0};var n=e.createEvent("CustomEvent");return n.initCustomEvent(t,i.bubbles,i.cancelable,i.detail),n};C.prototype=t.Event.prototype,t.CustomEvent=C}return function(e){for(var i=0,n=["moz","webkit"],r=0;r<n.length&&!t.requestAnimationFrame;++r)e.requestAnimationFrame=e[n[r]+"RequestAnimationFrame"],e.cancelAnimationFrame=e[n[r]+"CancelAnimationFrame"]||e[n[r]+"CancelRequestAnimationFrame"];e.requestAnimationFrame=e.requestAnimationFrame||function(t){var n=(new Date).getTime(),r=Math.max(0,16-(n-i)),s=e.setTimeout(function(){t(n+r)},r);return i=n+r,s},e.cancelAnimationFrame=e.cancelAnimationFrame||e.clearTimeout}(t),g});
103function _zf_stdTrapError(message,url,line){try{zf_stdServerRequestEx("POST","/zf/core/core.asmx","ReportError",["jserror",message.toString(),location.href,url,line]);}catch(e){}return true;
104}window.onerror=_zf_stdTrapError;function zf_Debug(){this._debugWindow=null;this._startTime=new Date().getTime();}zf_Debug.prototype.activate=function(){if(this._debugWindow==null){var wnd=window.open("about:blank",
105"_blank","width=500,left=400,resizable,scrollbars");if(wnd!=null){this._debugWindow=wnd;zf_stdAttachEvent(window,"unload",function(){wnd.close();});}else{alert("Cannot open debug window (check popup blocker settings)");
106return;}}this._debugWindow.document.writeln('<html><head><style type="text/css">');this._debugWindow.document.writeln("BODY { font: 9pt 'Lucida Console', 'Courier New'; margin: 4px; }");
107this._debugWindow.document.writeln("P { background: #F0F0F0; margin: 0px 0px 1px 0px; }");this._debugWindow.document.writeln("</style></head><body></body></html>");
108this.log("logging started");};zf_Debug.prototype.log=function(format){for(var i=1;i<arguments.length;i++){var re=new RegExp("\\{"+(i-1)+"\\}","g");format=format.replace(re,
109arguments[i]);}var timestamp=new Date().getTime()-this._startTime;var ms=(timestamp%1000).toString();var s=Math.floor(timestamp/1000).toString();while(ms.length<3)ms="0"+ms;
110while(s.length<2)s=" "+s;if(window.console&&window.console.log)window.console.log(["[",s,".",ms,"] ",format].join(""));if(this._debugWindow==null||this._debugWindow.closed)return;
111var message=["<p>[",s,".",ms,"] ",format,"</p>"].join("");this._debugWindow.document.body.innerHTML+=message;this._debugWindow.scrollTo(0,10000000);};zf_debug=new zf_Debug();
112function zf_assert(expr,exprQuote,fileName,lineNumber){if(!expr){var context;var message;if(exprQuote==null){context=zf_assert.caller.toString();if(context.length>512)context=context.substr(0,
113512);message="Assertion failed in "+context;}else{message="Assertion ("+exprQuote+") failed.";}if(fileName==null)fileName="<unknown>";if(lineNumber==null)lineNumber=0;
114zf_stdServerRequestEx("POST","/zf/core/core.asmx","ReportError",["jserror",message,document.location.href,fileName,lineNumber]);}}function zf_log(format){zf_Debug.prototype.log.apply(zf_debug,
115arguments);}function zf_showDebugMessage(msg){if(zf_stdParseQueryString('debug')==2){alert(msg);}}window.addEventListener('error',function(event){zf_showDebugMessage(event.message);
116});;var zf=$.extend(zf||{},{$namespace:function(nsName,members){var labels=nsName.split('.'),ns=window;for(var i=0;i<labels.length;i++)ns=ns[labels[i]]=ns[labels[i]]||{};
117$.extend(ns,members);},$class:function(base,methods){var cls=function(){cls.prototype._ctor&&cls.prototype._ctor.apply(this,arguments);};if(base){if(!(base instanceof Array))base=[base];
118Function.prototype.inherits.apply(cls,base);}cls.extend(methods);return cls;}});function zf_stdNoArgs(args){return args.length==1&&args[0]==zf_stdNoArgs;}function zf_stdTrue(){return true;
119}function zf_stdFalse(){return false;}
119function zf_stdCopyFields(dest,src,fields){for(var i=0;i<fields.length;i++){var fieldName=fields[i];if(src[fieldName]!==undefined)dest[fieldName]=src[fieldName];
120}return dest;}Function.prototype.inherits=function(base1){this.prototype={};for(var i=0;i<arguments.length;i++){for(var method in arguments[i].prototype){if(arguments[i].prototype[method]instanceof Function){this.prototype[method]=arguments[i].prototype[method];
121}}}this.prototype.constructor=this;};Function.prototype.extend=function(methods){$.extend(this.prototype,methods);};function zf_stdSplitArray(list,getter,limit){;;;;limit=limit||0;
122var groups=[];var offset=0;var accum=0;var total=0;for(var i=0;i<list.length;i++){var item=list[i];var metric=getter(item,i);accum+=metric;total+=metric;if(i==list.length-1||accum+getter(list[i+1],
123i+1)>limit){var group=$.grep(list,function(e,k){return k>=offset&&k<=i;});group.total=accum;groups.push(group);offset=i+1;accum=0;}}groups.total=total;return groups;
124}function zf_stdRndInteger(min,max){return Math.floor(Math.random()*(max-min+1)+min);}function zf_stdRndBool(){return zf_stdRndInteger(0,1)==1;}function zf_stdBase64Decode(data){if(window.atob&&typeof window.atob==="function")return window.atob(data);
125function fallback(s){var e={},i,b=0,c,x,l=0,a,r='',w=String.fromCharCode,L=s.length;var A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(i=0;
126i<64;i++){e[A.charAt(i)]=i;}for(x=0;x<L;x++){c=e[s.charAt(x)];b=(b<<6)+c;l+=6;while(l>=8){((a=(b>>>(l-=8))&0xff)||(x<(L-2)))&&(r+=w(a));}}return r;}return fallback(data);
127}function zf_stdRoundNumber(value,decimalDigits){decimalDigits=decimalDigits||0;return+(value.toFixed(decimalDigits));};function zf_stdGetEvent(e){if(e instanceof jQuery.Event)return e;
128if(window.event)e=window.event;return e;}function zf_stdStopPropagation(e){if(window.event)window.event.cancelBubble=true;else if(e.stopPropagation)e.stopPropagation();}function zf_stdPreventDefault(e){if(window.event)window.event.returnValue=false;
129else if(e.preventDefault)e.preventDefault();}function zf_stdAttachEvent(dom,evt,handler){if(typeof(dom)=="string")dom=document.getElementById(dom);if(dom.addEventListener)dom.addEventListener(evt,
130handler,false);}function zf_stdDetachEvent(dom,evt,handler){if(typeof(dom)=="string")dom=document.getElementById(dom);if(dom.removeEventListener)dom.removeEventListener(evt,
131handler,false);}function zf_stdGetEventSource(e){e=zf_stdGetEvent(e);if(e.srcElement)return e.srcElement;else if(e.target)return e.target;else if(e.currentTarget)return e.currentTarget;
132return null;}function zf_stdIsLeftButton(e){if(!(e instanceof jQuery.Event)&&window.event)e=window.event;e=$.event.fix(e);return e.which==1||e.which==undefined;}function zf_stdDisableRightClick($element,
133exclude){$element.mousedown(function(e){if(!zf_stdIsLeftButton(e)&&(!exclude||!exclude($(e.target)))){e.preventDefault();e.stopPropagation();}}).bind('contextmenu',
134function(e){return!!(exclude&&exclude($(e.target)));});}function zf_Event(domEvent){if(window.event)this.domEvent=window.event;else this.domEvent=domEvent;}zf_Event.prototype.getSource=function(){if(window.event)return this.domEvent.srcElement;
135else return this.domEvent.target;};zf_Event.prototype.getSourceWithTag=function(tagName){var domSource=this.getSource();while(domSource!=null&&domSource.tagName!=tagName)domSource=domSource.parentNode;
136return domSource;};zf_Event.prototype.getSourceWithClass=function(tagClass){var domSource=this.getSource();while(domSource!=null&&domSource.className!=tagClass)domSource=domSource.parentNode;
137return domSource;};zf_Event.prototype.stopPropagation=function(){if(window.event)this.domEvent.cancelBubble=true;else if(this.domEvent.stopPropagation)this.domEvent.stopPropagation();
138};zf_Event.prototype.preventDefault=function(){if(window.event)this.domEvent.returnValue=false;else if(this.domEvent.preventDefault)this.domEvent.preventDefault();};;function zf_NumberFormat(){}zf_NumberFormat.prototype.formatNumber=function(num,
139decimalDigits){if(decimalDigits==null)decimalDigits=this.numberDecimalDigits;var numStr=zf_NumberFormat._formatNumber(Math.abs(num),decimalDigits,this.numberDecimalSeparator,
140this.numberGroupSizes,this.numberGroupSeparator);if(num<0){var pattern=zf_NumberFormat._negNumberPatterns[this.numberNegativePattern];if(!pattern)pattern=zf_NumberFormat._negNumberPatterns[0];
141return zf_stdFormatString(pattern,this.negativeSign,numStr);}return numStr;};zf_NumberFormat.prototype.formatMoney=function(amount,currency){var pattern;if(currency&&currency.code=="USD"){pattern=amount>=0?zf_NumberFormat._posCurrencyPatterns[0]:zf_NumberFormat._negCurrencyPatterns[0];
142}else if(amount>=0){pattern=zf_NumberFormat._posCurrencyPatterns[this.currencyPositivePattern];if(!pattern)pattern=zf_NumberFormat._posCurrencyPatterns[0];}else{amount=-amount;
143pattern=zf_NumberFormat._negCurrencyPatterns[this.currencyNegativePattern];if(!pattern)pattern=zf_NumberFormat._negCurrencyPatterns[0];}var numStr=zf_NumberFormat._formatNumber(amount,
144this.currencyDecimalDigits,this.currencyDecimalSeparator,this.currencyGroupSizes,this.currencyGroupSeparator);var symbol=currency?currency.symbol:'';return zf_stdFormatString(pattern,
145this.negativeSign,symbol,numStr).replace(/^\s+|\s+$/g,'');};zf_NumberFormat._formatNumber=function(num,decimalDigits,decimalSeparator,groupSizes,groupSeparator){groupSizes=groupSizes.concat();
146var result=[];var numStr=num.toFixed(decimalDigits);var pos=numStr.lastIndexOf('.');if(pos<0)pos=numStr.length;else result.unshift(decimalSeparator,numStr.substring(pos+1));
147var groupSize=groupSizes.length>0?groupSizes.shift():0;while(groupSize!=0&&pos>0){var from=pos-groupSize>=0?pos-groupSize:0;result.unshift(numStr.substring(from,
148pos));pos=from;if(pos>0)result.unshift(groupSeparator);if(groupSizes.length>0)groupSize=groupSizes.shift();}if(pos>0)result.unshift(numStr.substring(0,pos));return result.join('');
149};zf_NumberFormat._negNumberPatterns=['({1})','{0}{1}','{0} {1}','{1}{0}','{1} {0}'];zf_NumberFormat._negCurrencyPatterns=['({1}{2})','{0}{1}{2}','{1}{0}{2}','{1}{2}{0}','({2}{1})','{0}{2}{1}',
150'{2}{0}{1}','{2}{1}{0}','{0}{2} {1}','{0}{1} {2}','{2} {1}{0}','{1} {2}{0}','{1} {0}{2}','{2}{0} {1}','({1} {2})','({2} {1})'];zf_NumberFormat._posCurrencyPatterns=['{1}{2}','{2}{1}',
151'{1} {2}','{2} {1}'];function zf_stdFormatEditableDecimal(val,numDecimals){var format=zf_NumberFormat.current;
151if(numDecimals===undefined)numDecimals=6;var res=val.toFixed(numDecimals);
152if(res.indexOf(".")!=-1){res=res.replace(/0+$/,"");res=res.replace(/\.$/,"");}return res.replace(/\./i,format.numberDecimalSeparator);}function zf_stdParseEditableDecimal(val){if(val&&val.length>0)val=val.replace(/^\s+|\s+$/g,
153'');var format=zf_NumberFormat.current;var separator=format.numberDecimalSeparator;if(!new RegExp("^-?\\d*\\"+separator+"?\\d*$").test(val)){return NaN;}return parseFloat(val.replace(new RegExp("(\\"+separator+")"),
154"."));}function zf_stdCheckEditableDecimal(val){if(isNaN(zf_stdParseEditableDecimal(val))){return zf_stdFormatString("Please use the correct decimal format (e.g. {0})",zf_stdFormatEditableDecimal(12.3));
155}return undefined;}function zf_stdFormatEditableInteger(val){return parseInt(val,10).toFixed(0);}function zf_stdParseEditableInteger(val){if(!new RegExp("^-?\\d+$").test(val)){return NaN;
156}return parseInt(val);}function zf_stdCheckEditableInteger(val){if(isNaN(zf_stdParseEditableInteger(val))){return zf_stdFormatString("Please use the correct integer format (e.g. {0})",
157zf_stdFormatEditableInteger(42));}return undefined;};showlog=false;function zf_stdTrim(str){if(showlog){console.log("Value before go to zf_stdTrim",str);}var re=/^\s*(\S?[\s\S]*?)\s*$/;
158re.exec(str);var result=RegExp.$1;if(showlog){console.log("Value after processed by zf_stdTrim",result);}if(!result){result=str.trim();if(showlog){console.log("Value after ignore RegExp",
159result);}}return result;}function zf_stdTrimV2(str){var re=/^\s*(\S?[\s\S]*?)\s*$/;var matchResult=re.exec(str);var result=matchResult?matchResult[1]:null;return result;
160}function zf_stdEndsWith(str,suffix){return str.indexOf(suffix,str.length-suffix.length)!==-1;}function zf_stdStartsWith(str,prefix){return str.indexOf(prefix)===0;}function zf_stdFormatString(format){var args=arguments;
161for(var i=1;i<arguments.length;i++){var re=new RegExp("\\{"+(i-1)+"\\}","g");format=format.replace(re,function(){return args[i];});}return format;}var zf_stdCompareString=("".localeCompare)?function(a,
162b){return a.localeCompare(b);}:function(a,b){return(a<b)?-1:(a>b)?1:0;};function zf_stdFormatByteSize(value){if(value==null)return null;var sign=false;if(value<0){value=-value;
163sign=true;}var i=0;var sz=value;var scale=1;while(sz>=1024&&i<12){rem=value%1024;sz=Math.floor(sz/1024);scale*=1024;i+=3;}var format;switch(i){case 0:format="{0} bytes";
164break;case 3:format="{0} KB";break;case 6:format="{0} MB";break;case 9:format="{0} GB";break;case 12:format="{0} TB";break;default:zf_assert(false);break;}var decimalDigits=0;
165if(scale>1){value/=scale;decimalDigits=value<10?2:1;}if(sign)value=-value;return zf_stdFormatString(format,zf_NumberFormat.current.formatNumber(value,decimalDigits));
166}function zf_stdInsertBreakHints(text){if(typeof text!=='string'){return '';}var res='';for(var i=0;i<text.length;i++){var ch=text[i];res+=ch;if(ch=='/'||ch=='\\'||ch==','||ch==';'||ch=='#'||ch=='&'||ch=='.'||ch=='+'||ch=='-'||ch=='_'){var spaceIndex=text.lastIndexOf(' ',
167i);if(spaceIndex==-1||i-spaceIndex>=10){res+=String.fromCharCode(0x200B);}}}text=res;return text;}function zf_stdIsValidEmail(email){return(/^[-+=\w\.][-+=\w\x27\.]*@([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/.test(email))||(/^[-+=\w\.][-+=\w\x27\.]*@\[[^\]]+\]$/.test(email));
168}function zf_stdIsValidZipCode(zipCode){;return zipCode.match(/^\d{5}$/)||zipCode.match(/^\d{5}-\d{4}$/)||zipCode.match(/^\d{5}\+\d{4}$/);}function zf_stdFormatDuration(duration,
169hideLeadingZero){if(!duration)duration=0;var seconds=duration%60;if(seconds<10)seconds="0"+seconds;var minutes=Math.floor(duration/60);if(!hideLeadingZero&&minutes<10)minutes="0"+minutes;
170return[minutes,seconds].join(':');}function zf_stdPad(s,length,padChar){s=(s||'').toString();var pl=Math.abs(length)-s.length+1;if(pl>0){var pad=Array(pl).join(padChar||' ');
171return length>0?pad+s:s+pad;}return s;}function zf_stdJoinKeywords(keywords){;var res=[];for(var i=0;i<keywords.length;i++){var keyword=keywords[i];if(/[\x20,;\x27]/.test(keyword)&&!(/\x22/.test(keyword)))keyword='"'+keyword+'"';
172else if(/\x22/.test(keyword))keyword="'"+keyword+"'";res.push(keyword);}return res.join(", ");}function zf_stdParseKeywords(keywords,disableSorting){;keywords=keywords.replace(/[\u2018\u2019\u201A\u201B]/g,
173"'");keywords=keywords.replace(/[\u201C\u201D\u201E\u201F]/g,'"');var res=[];var len=keywords.length;var pos=0;var end;while(pos<len){while(keywords.charAt(pos)==' '||keywords.charAt(pos)==','||keywords.charAt(pos)==';'){++pos;
174if(pos==len)break;}if(pos==len)break;if(keywords.charAt(pos)=='"'||keywords.charAt(pos)=="'"){++pos;if(pos==len)break;end=pos;while(keywords.charAt(end)!=keywords.charAt(pos-1)){++end;
175if(end==len)break;}res.push(keywords.substring(pos,end));pos=end;if(pos<len)pos++;}else{end=pos;while(keywords.charAt(end)!=' '&&keywords.charAt(end)!=','&&keywords.charAt(end)!=';'){++end;
176if(end==len)break;}res.push(keywords.substring(pos,end));pos=end;}}if(!disableSorting)res.sort();return res;}function zf_stdParseQueryString(key,querystring){if(arguments.length==1)querystring=window.location.search.substring(1);
177var vars=querystring.split('&');for(var n=0;n<vars.length;n++){var pair=vars[n].split('=');if(decodeURIComponent(pair[0])==key){return decodeURIComponent(pair[1]);
178}}return "";}function zf_stdGenerateStringKey(length){length=length||16;;var possible='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';var text='';text+=possible.charAt(Math.floor(Math.random()*(possible.length-10)));
179for(var i=1;i<length;i++)text+=possible.charAt(Math.floor(Math.random()*possible.length));return text;}function zf_stdEscapeRegex(str){return str.replace(/[-\/\\^$*+?.()|[\]{}]/g,
180'\\$&');}function zf_stdEscapeRegexReplacement(str){var repl='$'+'$'+'$'+'$';return str.replace(/\$/g,repl);}function zf_stdGetFileExtension(name){if(showlog){console.log("upload file name",
181name);}if(!name){return '';}var indexOfDot=name.lastIndexOf('.');if(indexOfDot<0){return '';}return zf_stdTrim(name.substring(indexOfDot)).toLowerCase();}function zf_stdGetFileExtensionV2(name){if(!name){return '';
182}var indexOfDot=name.lastIndexOf('.');if(indexOfDot<0){return '';}return zf_stdTrimV2(name.substring(indexOfDot)).toLowerCase();}function zf_stdGetFileNameWithoutExtension(name){if(name){var indexOfDot=name.lastIndexOf('.');
183if(indexOfDot>=0){name=name.substring(0,indexOfDot);}}return name;}function zf_stdReplaceApostrophes(text){return text.replace(/’/g,'\'');};var _zf_stdMonthNames=["January",
184"February","March","April","May","June","July","August","September","October","November","December"];var _zf_stdDefaultMonthNames=["January]","February","March","April",
185"May","June","July","August","September","October","November","December"];function zf_stdFormatDate(date,useDefault){if(date==null)return null;var yr=date.getFullYear()%100;
186var mo=(useDefault?_zf_stdDefaultMonthNames:_zf_stdMonthNames)[date.getMonth()].substr(0,3);var dt=date.getDate();if(yr<10)yr="0"+yr;return dt+"-"+mo+"-"+yr;}function zf_stdFormatDateTime(date,
187seconds){if(date==null)return null;var yy=date.getFullYear(),yr=yy<1930?yy:(yy%100),mo=_zf_stdMonthNames[date.getMonth()].substr(0,3),dt=date.getDate(),hh=date.getHours(),
188mm=date.getMinutes();if(yr<10)yr="0"+yr;if(hh<10)hh="0"+hh;if(mm<10)mm="0"+mm;var s=dt+"-"+mo+"-"+yr+" "+hh+":"+mm;if(seconds){var ss=date.getSeconds();if(ss<10)ss="0"+ss;
189s+=":"+ss;}return s;}function zf_stdFormatTime(date,options){if(date==null)return null;var seconds=options;if(options!=null&&typeof(options)=='object'){if(zf_stdFormatDateTimeEx._localeOptionsSupported){options=$.extend({},
190options);delete options.year;delete options.month;delete options.day;return date.toLocaleTimeString(zf_locale,options);}seconds=options.seconds!=null;}var hh=date.getHours(),
191mm=date.getMinutes();if(hh<10)hh="0"+hh;if(mm<10)mm="0"+mm;var s=hh+":"+mm;if(seconds){var ss=date.getSeconds();if(ss<10)ss="0"+ss;s+=":"+ss;}return s;}function zf_stdFormatDateTimeEx(date,
192options){if(date==null)return null;var t=new Date(),y=new Date(t),format=null;y.setDate(t.getDate()-1);if(date.getFullYear()==t.getFullYear()&&date.getMonth()==t.getMonth()&&date.getDate()==t.getDate()){format='Today, {0}';
193}else if(date.getFullYear()==y.getFullYear()&&date.getMonth()==y.getMonth()&&date.getDate()==y.getDate()){format='Yesterday, {0}';}if(format)return zf_stdFormatString(format,
194zf_stdFormatTime(date,options));var seconds=options;if(options!=null&&typeof(options)=='object'){if(zf_stdFormatDateTimeEx._localeOptionsSupported)return date.toLocaleString(zf_locale,
195options);seconds=options.seconds!=null;}return zf_stdFormatDateTime(date,seconds);}zf_stdFormatDateTimeEx._localeOptionsSupported=(function(){try{new Date().toLocaleString('i');}catch(e){return e.name==='RangeError';
196}return false;})();function zf_stdParseDateTimeUTC(value){var regExp=/([0-9]{4})-([0-9]{2})-([0-9]{2})\s+([0-9]{2}):([0-9]{2}):([0-9]{2})Z?/;var matches=value.match(regExp);
197var yr=parseInt(matches[1],10);var mo=parseInt(matches[2],10)-1;var dt=parseInt(matches[3],10);var hh=parseInt(matches[4],10);var mm=parseInt(matches[5],10);var ss=parseInt(matches[6],
19810);var date=new Date();date.setUTCFullYear(yr,mo,dt);date.setUTCHours(hh,mm,ss);return date;}function zf_stdParseDateTime(value){var regExp=/([0-9]{4})-([0-9]{2})-([0-9]{2})\s+([0-9]{2}):([0-9]{2}):([0-9]{2})Z?/;
199var matches=value.match(regExp);var yr=parseInt(matches[1],10);var mo=parseInt(matches[2],10)-1;var dt=parseInt(matches[3],10);var hh=parseInt(matches[4],10);var mm=parseInt(matches[5],
20010);var ss=parseInt(matches[6],10);var date=new Date();date.setFullYear(yr,mo,dt);date.setHours(hh,mm,ss);return date;}function zf_stdFormatTimeInterval(value){if(value==null)return null;
201var nHours=Math.floor(value/3600);var nMin=Math.floor(value/60)%60;var nSec=Math.floor(value+0.5)%60;var strFormat;if(value<60)strFormat="{2} sec";else if(nHours==0&&nSec==0)strFormat="{1} min";
202else if(nHours==0)strFormat="{1} min {2} sec";else if(nMin==0)strFormat="{0} hr";else strFormat="{0} hr {1} min";return zf_stdFormatString(strFormat,nHours,nMin,
203nSec);};function zf_stdHtmlEncode(text){if(!text)return text;return text.replace(/\&/g,"&amp;").replace(/\x22/g,"&quot;").replace(/\</g,"&lt;").replace(/\>/g,"&gt;").replace(/\n/g,
204"<br/>").replace(/\r/g,"");}function zf_stdHtmlDecode(text){return text.replace(/\<\/?br\/?\>/g,"\n").replace(/\&amp;/g,"&").replace(/\&lt;/g,"<").replace(/\&gt;/g,">").replace(/\&quot;/g,
205"\"");}function zf_stdScriptEncode(text){return text.replace(/([\\\x22\x27])/g,'\\$1').replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/</g,"\\x3C");
206}function zf_stdSetText(dom,text){if(typeof(dom)=="string")dom=document.getElementById(dom);if(dom.innerText){if(dom.innerText!=text)dom.innerText=text;}else if(dom.textContent){if(dom.textContent!=text)dom.textContent=text;
207}else{while(dom.firstChild!=null)dom.removeChild(dom.firstChild);dom.appendChild(document.createTextNode(text));}}function zf_stdGetClientWidth(customMobileMode){var width=1024;
208if(document.documentElement)width=document.documentElement.clientWidth;else if(window.innerWidth)width=window.innerWidth;return width;}function zf_stdGetClientHeight(){if(document.documentElement)return document.documentElement.clientHeight;
209else if(window.innerHeight)return window.innerHeight;else return 768;}function zf_stdGetOffset(elem,parent){if(parent!=null){var elemOffset=zf_stdGetOffset(elem);var parentOffset=zf_stdGetOffset(parent);
210return{cx:elemOffset.cx-parentOffset.cx,cy:elemOffset.cy-parentOffset.cy};}
210if(typeof(elem)=="string")elem=document.getElementById(elem);var cx=0,cy=0;for(var obj=elem;
211obj!=null;obj=obj.offsetParent){cx+=obj.offsetLeft;cy+=obj.offsetTop;}return{cx:cx,cy:cy};}function zf_stdGetClientScroll(){var cx=0,cy=0;if(typeof(window.pageYOffset)=='number'){cy=window.pageYOffset;
212cx=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){cy=document.body.scrollTop;cx=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){cy=document.documentElement.scrollTop;
213cx=document.documentElement.scrollLeft;}return{cx:cx,cy:cy};}function zf_stdSetOpacity(dom,opacity){if(dom.filters&&dom.filters[0])dom.filters[0].opacity=parseFloat(opacity)*100;
214else if('opacity' in dom.style)dom.style.opacity=opacity;else if(opacity>0.01)dom.style.visibility='inherit';else dom.style.visibility='hidden';}function zf_stdAllowDefaultHost(){return zf_globalHttpsState!=0||location.protocol!="https:";
215}function zf_stdAllowCdnHost(){return zf_stdAllowDefaultHost();}function zf_stdAllowDownloadHost(){return zf_stdAllowDefaultHost();}function zf_stdGetCdnUrl(url){;if(url[0]=='/'&&zf_stdAllowCdnHost())url=zf_stdGetProtocol(zf_cdnHost)+zf_cdnHost+url;
216return url;}function zf_stdChangeDataCdnUrl(cdnUrl){;if(typeof zf_changeCdnUrls!=='undefined'&&zf_changeCdnUrls&&typeof zf_globalHttpsState!=='undefined'){cdnUrl=[zf_globalHttpsState!=0?'https:':'http:',
217'//',zf_defaultHost,cdnUrl].join('');}return cdnUrl;}function zf_stdChangeImageCdnUrl(cdnUrl,photo){;;var cdnPrefix='/cdn/';var useNewDelivery=(!photo.video&&zf_isAllowUseCloudDelivery)||(photo.video&&zf_isAllowUseCloudDeliveryVideo);
218const cdnHost=useNewDelivery?zf_cloudDeliveryHost:zf_cdnHost;if(typeof zf_changeCdnUrls!=='undefined'&&zf_changeCdnUrls&&zf_stdStartsWith(cdnUrl,cdnPrefix)){var visitorCookie=zf_stdGetCookie('zf_5y_visitor');
219if(visitorCookie){var pathComponents=cdnUrl.split('/');if(pathComponents.length>5){var queryParams=[{key:'v',value:'2'},{key:'visitor',value:visitorCookie},{key:'uid',
220value:null},{key:'keyringx',value:null}];if(typeof zf_cdnHostToken!=='undefined'&&zf_cdnHostToken){queryParams.push({key:'token',value:zf_cdnHostToken});}var prefix=pathComponents[2],
221userId=pathComponents[4],passwordHash=pathComponents[5];if(prefix=='ac'&&passwordHash!='null'&&(typeof zf_userId==='undefined'||zf_userId==0||userId!=zf_userId)&&photo.access&&zfl_PasswordManager.check(photo.access.ownerId,
222photo.access.realmId)){var keyRing=zf_stdGetCookie('zf_keyring');if(keyRing){queryParams.push({key:'keyring',value:keyRing});}}var pathV2='/cdn2/'+cdnUrl.substring(cdnPrefix.length);
223cdnUrl=[location.protocol,'//',cdnHost,pathV2].join('');for(var i=0,params={};i<queryParams.length;i++){var queryParam=queryParams[i];params[queryParam.key]=queryParam.value&&encodeURIComponent(queryParam.value);
224cdnUrl=$.updateQueryString(params,cdnUrl);delete params[queryParam.key];}if(typeof zf_edgeAuthTokens!=='undefined'&&zf_edgeAuthTokens&&zf_edgeAuthTokens.length>0){var edgeAuthToken=$.lookup(zf_edgeAuthTokens,
225function(token){return zf_stdStartsWith(pathV2,token.scope);});if(edgeAuthToken){cdnUrl=$.updateQueryString({'auth':edgeAuthToken.token},cdnUrl);}}}}}else if(useNewDelivery){cdnUrl=[location.protocol,
226'//',cdnHost,cdnUrl].join('');}return cdnUrl;}function zf_stdAddDynamicStyle(content){var style=document.createElement('style');style.type='text/css';style.innerHTML=content;
227document.getElementsByTagName('head')[0].appendChild(style);return style;}var Zenfolio;(function(Zenfolio){var Global;(function(Global){var DomHelpers=(function(){function DomHelpers(){}DomHelpers.saveDocumentStyles=function(){return{htmlStyle:$("HTML").attr("style"),
228bodyStyle:$("BODY").attr("style"),scrollTop:$(window).scrollTop()};};
228DomHelpers.restoreDocumentStyles=function(documentStyles){if(documentStyles){$("HTML").attr("style",
229documentStyles.htmlStyle||"");$("BODY").attr("style",documentStyles.bodyStyle||"");$(window).scrollTop(documentStyles.scrollTop||0);}};DomHelpers.isTextFieldFocused=function(){return $(document.activeElement).is("INPUT, TEXTAREA, SELECT");
230};DomHelpers.scrollTopVisitorView=function(duration,progress,complete){var $parent;var $cvRightPanel=$(".cv-right-panel");if($cvRightPanel.length>0){$parent=$cvRightPanel;
231}else{$parent=$("HTML, BODY");}$parent.stop(true,true).animate({scrollTop:0},{duration:duration,progress:progress,complete:complete});};DomHelpers.configureVisitorViewScroll=function($element){var top,
232$parent,getScrollHeight;var $cvRightPanel=$(".cv-right-panel");if($cvRightPanel.length>0){top=$element.position().top+this.getVisitorViewHeadersHeight();$parent=$cvRightPanel;
233getScrollHeight=function(){return $parent[0].scrollHeight;};}else{top=$element.offset().top;$parent=$(window);getScrollHeight=function(){return $(document).height();
234};}return{top:top,$parent:$parent,$cvRightPanel:$cvRightPanel,getScrollHeight:getScrollHeight};};DomHelpers.getVisitorViewHeadersHeight=function(){return this.getTotalOuterHeight($(".zenbar, .hdr-outer, .menubar-outer"));
235};DomHelpers.getVisitorViewFootersHeight=function(){var footersHeight=zf_stdExtractPixels($(".layout").css("padding-bottom"));var $ftrOuter=$(".ftr-outer");if($ftrOuter.length>0){footersHeight+=$ftrOuter.outerHeight();
236}else{var $bottomLinks=$(".bottom-links");if($bottomLinks.length>0){footersHeight+=$bottomLinks.outerHeight();}}return footersHeight;};DomHelpers.getTotalOuterHeight=function($elements){var totalHeight=0;
237$elements.filter(":visible").each(function(){totalHeight+=$(this).outerHeight()||0;});return totalHeight;};DomHelpers.toggleLoadingOverlay=function(showOrHide){$("BODY").toggleClass("zf-loading",
238showOrHide);};DomHelpers.openLinkOnClick=function(e,url){if(!e||e.ctrlKey||e.metaKey){window.open(url,"_blank");}else{window.location.href=url;}};DomHelpers.isElementInView=function($element,
239$view,fullyInView){var viewTop=$view.scrollTop(),viewBottom=viewTop+$view.height(),elementTop=($view.is($(window))?$element.offset():$element.position()).top,elementBottom=elementTop+$element.height();
240if(fullyInView){return(viewTop<elementTop)&&(viewBottom>elementBottom);}return(elementTop<=viewBottom)&&(elementBottom>=viewTop);};DomHelpers.onWindowResized=function(callback,
241suffix,resizeDelayMs){if(resizeDelayMs===void 0){resizeDelayMs=200;}$(window).on("resize"+suffix,$.throttle(callback,resizeDelayMs)).on("orientationchange"+suffix,
242$.throttle(callback,resizeDelayMs,{leading:false}));};DomHelpers.autoFontSize=function(options){var $el=options.$el;var width=Math.ceil(options.width||$el.parent().width());
243var height=Math.ceil(options.height||$el.parent().height());var minFontSize=options.minFontSize;var maxFontSize=options.maxFontSize||height;var maxLineHeight=options.maxLineHeight||1.2;
244var maxLinesAllowed=options.maxLinesAllowed||1;var showEllipsis=options.showEllipsis||false;var ellipsisOnWidthOverflow=options.ellipsisOnWidthOverflow||false;var ellipsisString=options.ellipsisString||"...";
245if(options.calculateHeight){height=Math.ceil(maxFontSize*maxLineHeight*maxLinesAllowed);}if(showEllipsis){var originalContent=$el.data("original-content");if(originalContent){$el.html(originalContent);
246}else{$el.data("original-content",$el.html());}}var fontSizeFound=false,widthOverflow=false,lineHeight=null;var verticalPadding=zf_stdExtractPixels($el.css("padding-top"))+zf_stdExtractPixels($el.css("padding-bottom"));
247function elementHasOverflow(){var elBoundingClientRect=$el[0].getBoundingClientRect(),elWidth=elBoundingClientRect.width,elHeight=elBoundingClientRect.height-verticalPadding,
248linesCount=Math.round(elHeight/lineHeight),heightOverflow=Math.round(elHeight-height)>0;widthOverflow=Math.round(elWidth-width)>0;return linesCount>maxLinesAllowed||heightOverflow||widthOverflow;
249}for(var fontSize=maxFontSize;fontSize>=minFontSize;fontSize--){lineHeight=Math.min(maxLineHeight*fontSize,height);$el.css({"font-size":fontSize+"px","line-height":lineHeight+"px"});
250if(!elementHasOverflow()){fontSizeFound=true;break;}}if(!fontSizeFound&&showEllipsis&&(!ellipsisOnWidthOverflow||widthOverflow)&&lineHeight!=null){var contents=$el.append(document.createTextNode(ellipsisString)).contents();
251for(var i=contents.length-2;i>=0;i--){var $node=contents.eq(i),originalText=$node.text();for(var j=originalText.length-1;j>=0;j--){if(/\s/.test(originalText[j])){continue;
252}zf_stdSetText($node[0],originalText.substring(0,j));if(!elementHasOverflow()){fontSizeFound=true;break;}}if(fontSizeFound){break;}$node.remove();}}return fontSizeFound;
253};return DomHelpers;}());Global.DomHelpers=DomHelpers;})(Global=Zenfolio.Global||(Zenfolio.Global={}));})(Zenfolio||(Zenfolio={}));;;function zf_stdReplaceClassName(elem,
254remove,add){if(remove==add)return;
254if(typeof(elem)=="string")elem=document.getElementById(elem);if(elem==null)return;var classNames=elem.className.split(" ");var removeAt=-1;
255var foundAt=-1;for(var i=0;i<classNames.length;i++){if(classNames[i]==remove)removeAt=i;else if(classNames[i]==add)foundAt=i;}var updated=false;if(removeAt!=-1){classNames.splice(removeAt,
2561);updated=true;}if(foundAt==-1&&add!=null){classNames.push(add);updated=true;}if(updated){classNames.sort();elem.className=classNames.join(" ");}}function zf_stdHasClassName(elem,
257className){if(typeof(elem)=="string")elem=document.getElementById(elem);if(elem==null)return false;if(elem.className==null||elem.className=="")return false;var classNames=elem.className.split(" ");
258for(var i=0;i<classNames.length;i++){if(classNames[i]==className)return true;}return false;}function zf_stdGetCurrentStyle(obj,styleCss,styleProperty){if(styleProperty==null)styleProperty=styleCss;
259var style="0px";if(obj.currentStyle)style=obj.currentStyle[styleProperty];else{style=document.defaultView.getComputedStyle(obj,null);if(style!=null)style=style.getPropertyValue(styleCss);
260}return style;}function zf_stdExtractPixels(value){if(value==null||value.indexOf("px")==-1)return 0;return+value.substr(0,value.length-2);}function zf_stdExtractPercents(value){var pos=-1;
261if(value==null||(pos=value.indexOf("%"))==-1)return 0;return+value.substr(0,value.indexOf("%"));}function zf_stdGetHeightAbove(obj){return zf_stdExtractPixels(zf_stdGetCurrentStyle(obj,
262'padding-top','paddingTop'))+zf_stdExtractPixels(zf_stdGetCurrentStyle(obj,'border-top-width','borderTopWidth'))+zf_stdExtractPixels(zf_stdGetCurrentStyle(obj,'margin-top',
263'marginTopWidth'));}function zf_stdGetHeightBelow(obj){return zf_stdExtractPixels(zf_stdGetCurrentStyle(obj,'padding-bottom','paddingBottom'))+zf_stdExtractPixels(zf_stdGetCurrentStyle(obj,
264'border-bottom-width','borderBottomWidth'))+zf_stdExtractPixels(zf_stdGetCurrentStyle(obj,'margin-bottom','marginBottomWidth'));}function zf_stdGetHeightOverall(obj){var cyHeight=obj.offsetHeight;
265if(typeof(cyHeight)!="number")cyHeight=0;return cyHeight+zf_stdExtractPixels(zf_stdGetCurrentStyle(obj,'margin-top','marginTop'))+zf_stdExtractPixels(zf_stdGetCurrentStyle(obj,
266'margin-bottom','marginBottom'));}function zf_stdGetTransformPrefix(){var t='transform';return t;};function toStandardCookieString(name,value,expire,specificHost){var cookie=name+"="+value+";path=/";
267if(expire!=null)cookie+=";expires="+expire.toGMTString();if(specificHost!=null)cookie+=";domain="+specificHost;return cookie;}var zf_CookieGroup={StrictlyNecessary:0x00000000,
268Functionality:0x00000001,Performance:0x00000002,Marketing:0x00000004,AllowAll:0x00000000|0x00000001|0x00000002|0x00000004};function zf_CookieConsentManager(enableCookieConsent,
269cookieConsentName,functionalityCookieNames,lstNonExecCookies){this._enableCookieConsent=enableCookieConsent;this._functionalityCookieNames=functionalityCookieNames;
270this._cookieConsentName=cookieConsentName;if(this.IsCookieConsentConfirmed()){this._lstNoneExecCookies=[];}else{this._lstNoneExecCookies=lstNonExecCookies.map(function(c){return toStandardCookieString(c.name,
271c.value,c.expires,c.domain);});}this.SetupCookieInterceptor();this.InitHotJarScript();}zf_CookieConsentManager.prototype.SetupCookieInterceptor=function(){const self=this;var cookieGetter=document.__lookupGetter__('cookie');
272var cookieSetter=document.__lookupSetter__('cookie');document.__defineGetter__('cookie',cookieGetter);document.__defineSetter__('cookie',function(cookie){const cookieName=cookie.split('=')[0].trim();
273if(!self.IsCookieValid(cookieName)){if(!self.IsCookieConsentConfirmed()){self._lstNoneExecCookies.push(cookie);}arguments[0]=cookieName+'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
274}return cookieSetter.apply(this,arguments);});};zf_CookieConsentManager.prototype.GetCookieConsent=function(){var cookieConsentMask=zf_stdGetCookie(this._cookieConsentName);if(cookieConsentMask!=null)return parseInt(cookieConsentMask);
275return 0;};zf_CookieConsentManager.prototype.SetCookieConsent=function(enableGroupMask){document.cookie=toStandardCookieString(this._cookieConsentName,enableGroupMask);};zf_CookieConsentManager.prototype.AllowAll=function(){this.SetCo
275okieConsent(zf_CookieGroup.AllowAll);
276this.Execute3rdPartyScripts();for(var i=0;i<this._lstNoneExecCookies.length;i++){document.cookie=this._lstNoneExecCookies[i];}};zf_CookieConsentManager.prototype.DeclineAll=function(){this.SetCookieConsent(zf_CookieGroup.StrictlyNecessary);
277var currentCookieNames=document.cookie.split(';').map(function(c){return c.split('=')[0].trim();});for(var i=0;i<currentCookieNames.length;i++){if(this.MatchFunctionalityCookie(currentCookieNames[i])){document.cookie=currentCookieNames[i]+'='+null;
278}}};zf_CookieConsentManager.prototype.SaveCustom=function(enableCookieMask){this.SetCookieConsent(enableCookieMask);this.Execute3rdPartyScripts();for(var i=0;i<this._lstNoneExecCookies.length;
279i++){var nonExecCookieName=this._lstNoneExecCookies[i].split('=')[0].trim();if(this.IsCookieValid(nonExecCookieName))document.cookie=this._lstNoneExecCookies[i];
280}var cookies=document.cookie.split(";");for(var j=0;j<cookies.length;j++){var currentCookieName=cookies[j].split('=')[0].trim();if(!this.IsCookieValid(currentCookieName))document.cookie=cookies[j]+'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
281}};zf_CookieConsentManager.prototype.MatchFunctionalityCookie=function(cookieName){return _.find(this._functionalityCookieNames,function(cookie){return cookieName.match(cookie.regex);});
282};zf_CookieConsentManager.prototype.IsCookieValid=function(cookieName){if(!this._enableCookieConsent)return true;if(cookieName==this._cookieConsentName)return true;var matchFunctionalityCookie=this.MatchFunctionalityCookie(cookieName);
283if(!matchFunctionalityCookie)return true;if(matchFunctionalityCookie.group==zf_CookieGroup.StrictlyNecessary)return true;var cookieConsentMask=this.GetCookieConsent();
284if(this.IsCookieConsentConfirmed()&&((matchFunctionalityCookie.group&cookieConsentMask)==matchFunctionalityCookie.group))return true;return false;};zf_CookieConsentManager.prototype.Execute3rdPartyScripts=function(){if(this.IsCookieGroupAgreed(zf_CookieGroup.Performance)){this.InitHotJarScript();
285head=document.getElementsByTagName('head')[0]||document.documentElement;for(var i=0;i<zf_lstNoneExec3rdPartyNodeUrlScripts.length;i++){var script=document.createElement('script');
286script.type='text/javascript';script.src=zf_lstNoneExec3rdPartyNodeUrlScripts[i];head.appendChild(script);}script=document.createElement('script');script.type='text/javascript';
287for(var j=0;j<zf_lstNoneExec3rdPartyScripts.length;j++){script.innerHTML+=zf_lstNoneExec3rdPartyScripts[j]+'\n';}head.appendChild(script);}};zf_CookieConsentManager.prototype.InitHotJarScript=function(){if(this.IsCookieGroupAgreed(zf_CookieGroup.Performance)&&typeof lazyLoadHotJar!='undefined'){lazyLoadHotJar();
288}};zf_CookieConsentManager.prototype.SetLazyNoneExec3rdPartyNodeUrlScripts=function(script){this._lstNoneExec3rdPartyNodeUrlScripts.push(script);};zf_CookieConsentManager.prototype.SetLazyNoneExec3rdPartyScripts=function(script){this._lstNoneExec3rdPartyScripts.push(script);
289};zf_CookieConsentManager.prototype.IsCookieGroupAgreed=function(group){if(!this._enableCookieConsent)return true;var cookieConsentMask=this.GetCookieConsent();if((cookieConsentMask&group)==group)return true;
290return false;};zf_CookieConsentManager.prototype.IsCookieConsentConfirmed=function(){var cookieConsent=zf_stdGetCookie(this._cookieConsentName);return cookieConsent!==null&&!isNaN(cookieConsent);
291};;function zf_stdSetCookie(name,value,expire,noescape,specificHost){if(!noescape)value=escape(value);var cookie=toStandardCookieString(name,value,expire,specificHost);document.cookie=cookie;
292}function zf_stdGetCookie(name){var cookie=document.cookie;var start;var end;if((start=cookie.indexOf(name+"="))==-1)return null;start+=name.length+1;if((end=cookie.indexOf(";",
293start))==-1)end=cookie.length;return unescape(cookie.substring(start,end));}function zf_stdRemoveCookie(name,specificHost){var expires=new Date();expires.setFullYear(expires.getFullYear()-1);
294zf_stdSetCookie(name,"",expires,true,specificHost);}var _zf_urlTransforms=[];function zf_stdGetTransferUrl(target,path){var scheme,host;function determineScheme(host,scheme){var isSecureHost=host==zf_secureHost;
295var isSecureScheme=scheme=="https:";var globalSecure=zf_globalHttpsState!=0;var secure=isSecureScheme&&(!globalSecure||isSecureHost);return secure?"https:":"http:";
296}
296if(target===true||target===false){scheme=target?"https:":"http:";host=target?zf_secureHost:zf_defaultHost;}else{var k=target.indexOf("://");;var n=target.indexOf("/",
297k+3);;scheme=target.substring(0,k+1).toLowerCase();host=target.substring(k+3,n).toLowerCase();path=target.substr(n);scheme=determineScheme(host,scheme);}if((k=host.indexOf(":"))!=-1)host=host.substring(0,
298k);var i=host.lastIndexOf(zf_defaultDomain);var defaultTarget=i!=-1&&i+zf_defaultDomain.length==host.length;if(location.host==host&&determineScheme(location.host,
299location.protocol)==scheme)return path;var hostCode=host;if(scheme=="https:")hostCode="s";else if(host==zf_defaultHost)hostCode="z";else if(host==location.host)hostCode="-";
300else if(defaultTarget)hostCode=host.substr(0,host.length-zf_defaultDomain.length);if(path=="/")path="";var url=["/zf/transfer/",hostCode,path].join("");for(i=0;i<_zf_urlTransforms.length;
301i++)url=_zf_urlTransforms[i](url,scheme,host);return url;}function zf_stdRegisterUrlTransform(transform){;_zf_urlTransforms.push(transform);}function zf_stdGetLogoutUrl(target){var url=['/zf/core/logout.ashx?token=',
302zf_stdGetCookie('zf_token')];if(target!=null)url.push('&uri=',encodeURIComponent(target));return url.join('');}function zf_stdMakeAbsoluteUrl(url){;if(/^https?:\/\//i.test(url)){return url;
303}return window.location.protocol+'//'+window.location.hostname+url;}function zf_stdGetProtocol(host,httpsWhenForcedOnly,appendExtra,protocol,isCertificateValid){httpsWhenForcedOnly===undefined&&(httpsWhenForcedOnly=false);
304appendExtra===undefined&&(appendExtra=true);protocol=protocol||location.protocol;
304isCertificateValid===undefined&&(isCertificateValid=zf_isCertificateValid);var useHttps,
305forceHttps,index;if(host==zf_secureHost){forceHttps=useHttps=true;}else if(zf_globalHttpsState==0||protocol=="http:"){forceHttps=useHttps=false;}else if(!host||host==zf_cdnHost||host==zf_helpHost||(index=host.lastIndexOf(zf_defaultDomain))>=0&&((index+zf_defaultDomain.length)==host.length)){useHttps=true;
306forceHttps=zf_forceHttpsState!=0;}else{var customDomain=typeof zf_ownerDomain!="undefined"?zf_ownerDomain:zf_userDomain;useHttps=zf_globalHttpsState==2&&isCertificateValid&&host==customDomain;
307forceHttps=useHttps&&zf_forceHttpsState==2;}return((httpsWhenForcedOnly?forceHttps:useHttps)?"https:":"http:")+(appendExtra?"//":"");}function _zf_stdSetTimezoneOffset(){var expires=new Date();
308expires.setFullYear(expires.getFullYear()+10);zf_stdSetCookie("zf_10y_tz",-(new Date().getTimezoneOffset()),expires);}var Zenfolio;(function(Zenfolio){var Global;(function(Global){var TransferHandler=(function(){function TransferHandler(){}TransferHandler.getUserDomainUrl=function(target){;
309var domain=typeof zf_ownerDomain!="undefined"?zf_ownerDomain:zf_userDomain;return zf_stdGetTransferUrl(""+zf_stdGetProtocol(domain)+domain+target);};return TransferHandler;
310}());Global.TransferHandler=TransferHandler;})(Global=Zenfolio.Global||(Zenfolio.Global={}));})(Zenfolio||(Zenfolio={}));;;function zf_stdCreateXMLHttpRequest(){if(window.XMLHttpRequest)return new XMLHttpRequest();
311else return new ActiveXObject("Microsoft.XMLHTTP");}function zf_stdServerRequest(method,url,api,params,callback){var headers;var sticky=false;if(typeof(method)!="string"){var args=method;
312method=args.method;headers=args.headers;sticky=args.sticky;url=args.url;api=args.api;params=args.params;callback=args.callback;};;;var request=zf_stdCreateXMLHttpRequest();
313var callbackExecuted=false;function executeCallback(isError){if(callbackExecuted){return;}if(callback!=null){var retVal=null;if(!isError&&request.status==200){retVal=request.responseText;
314if(window.JSON&&window.JSON.parse)retVal=_zf_stdTransformResponse(JSON.parse(retVal));else{retVal="return _zf_stdTransformResponse("+retVal+")";retVal=new Function(retVal)();
315}}callbackExecuted=true;callback(request.status,retVal);}}request.onreadystatechange=function(){if(request.readyState!=4)return;executeCallback(false);};request.onerror=function(){executeCallback(true);
316};var body={method:api,params:[],id:0};if(params!=null){for(var i=0;i<params.length;i++){if(params[i]instanceof Function)body.params.push(params[i]());else body.params.push(params[i]);
317}}body=_zf_stdJsonSerialize(body).join("");if(method=="GET"){url+="?request="+encodeURIComponent(body);if(typeof zf_cacheversion!=='undefined'&&zf_cacheversion>-1){url+="&__cv="+zf_cacheversion;
318}body=null;}request.open(method,url,true);if(method=="POST")request.setRequestHeader("Content-Type","application/json");if('zf_locale' in window){request.setRequestHeader("Accept-Language",
319zf_locale);request.setRequestHeader("X-Page-Language",zf_locale);}headers=headers||{};if(sticky)headers["X-LB-Sticky"]="zf_sticky";for(var h in headers)request.setRequestHeader(h,
320headers[h]);request.send(body);}function zf_stdServerRequestSync(method,url,api,params,callback){var headers;var sticky=false;if(typeof(method)!="string"){var args=method;
321method=args.method;headers=args.headers;sticky=args.sticky;url=args.url;api=args.api;params=args.params;callback=args.callback;};;;var request=zf_stdCreateXMLHttpRequest();
322var callbackExecuted=false;function executeCallback(isError){if(callbackExecuted){return;}if(callback!=null){var retVal=null;if(!isError&&request.status==200){retVal=request.responseText;
323if(window.JSON&&window.JSON.parse)retVal=_zf_stdTransformResponse(JSON.parse(retVal));else{retVal="return _zf_stdTransformResponse("+retVal+")";retVal=new Function(retVal)();
324}}callbackExecuted=true;callback(request.status,retVal);}}request.onreadystatechange=function(){if(request.readyState!=4)return;executeCallback(false);};request.onerror=function(){executeCallback(true);
325};var body={method:api,params:[],id:0};if(params!=null){for(var i=0;i<params.length;i++){if(params[i]instanceof Function)body.params.push(params[i]());else body.params.push(params[i]);
326}}body=_zf_stdJsonSerialize(body).join("");if(method=="GET"){url+="?request="+encodeURIComponent(body);if(typeof zf_cacheversion!=='undefined'&&zf_cacheversion>-1){url+="&__cv="+zf_cacheversion;
327}body=null;}request.open(method,url,false);
327if(method=="POST")request.setRequestHeader("Content-Type","application/json");if('zf_locale' in window){request.setRequestHeader("Accept-Language",
328zf_locale);request.setRequestHeader("X-Page-Language",zf_locale);}headers=headers||{};if(sticky)headers["X-LB-Sticky"]="zf_sticky";for(var h in headers)request.setRequestHeader(h,
329headers[h]);request.send(body);}function zf_stdServerRequestEx(method,url,api,params,callback){function callbackWrapper(status,retVal){var error;var result;if(status!=200){result=null;
330error={message:status==403?"Access Denied.":"An unexpected error has occurred. Please try again later. If this problem persists, contact Support."};}else{result=retVal.result;
331error=retVal.error;}if(callback)callback(result,error);}if(typeof(method)!="string"){var args=method;method={};for(p in args)method[p]=args[p];callback=args.callback;
332method.callback=callbackWrapper;}zf_stdServerRequest(method,url,api,params,callbackWrapper);}function zf_stdServerRequestExT(method,url,api,params,callback){function callbackWrapper(status,
333retVal){var error;var result;if(status!=200){result=null;error={message:status==403?"Access Denied.":"An unexpected error has occurred. Please try again later. If this problem persists, contact Support."};
334}else{result=retVal.result;error=retVal.error;}if(callback)callback(result,error);}if(typeof(method)!="string"){var args=method;method={};for(p in args)method[p]=args[p];
335callback=args.callback;method.callback=callbackWrapper;}zf_stdServerRequest(method,url,api,params,callbackWrapper);}function zf_stdServerRequestExSync(method,url,api,params,
336callback){function callbackWrapper(status,retVal){var error;var result;if(status!=200){result=null;error={message:status==403?"Access Denied.":"An unexpected error has occurred. Please try again later. If this problem persists, contact Support."};
337}else{result=retVal.result;error=retVal.error;}if(callback)callback(result,error);}if(typeof(method)!="string"){var args=method;method={};for(p in args)method[p]=args[p];
338callback=args.callback;method.callback=callbackWrapper;}zf_stdServerRequestSync(method,url,api,params,callbackWrapper);}function _zf_stdJsonSerialize(val){var json=[];var i;
339var v;switch(typeof(val)){case "boolean":json.push(val?"true":"false");break;case "number":json.push(val.toString());break;case "string":json.push('"',_zf_stdJsonEncode(val),
340'"');break;case "object":if(val==null){json.push("null");break;}if(val.constructor==Array){json.push("[");var last=val.length;for(i=0;i<last;i++){if(i>0)json.push(",");
341if(json.length>1000)json=[json.join('')];if((v=val[i])===null)json.push("null");else switch(typeof(v)){case "boolean":json.push(v?"true":"false");break;case "number":json.push(v.toString());
342break;case "string":json.push('"',_zf_stdJsonEncode(v),'"');break;case "object":json=json.concat(_zf_stdJsonSerialize(v));break;default:;json.push("null");break;
343}}json.push("]");break;}if(val.constructor==Date){var month=val.getUTCMonth()+1;if(month<10)month="0"+month;var date=val.getUTCDate();if(date<10)date="0"+date;var hours=val.getUTCHours();
344if(hours<10)hours="0"+hours;var minutes=val.getUTCMinutes();if(minutes<10)minutes="0"+minutes;var seconds=val.getUTCSeconds();if(seconds<10)seconds="0"+seconds;json.push('{"$type":"Date","Value":"',
345val.getUTCFullYear(),'-',month,'-',date,' ',hours,':',minutes,':',seconds,'"}');break;}json.push("{");i=0;for(var prop in val){v=val[prop];if(prop!="prototype"&&typeof(v)!="function"){if(i>0)json.push(",");
346json.push('"',_zf_stdJsonEncode(prop.toString()),'":');if(v===null)json.push("null");else switch(typeof(v)){case "boolean":json.push(v?"true":"false");break;case "number":json.push(v.toString());
347break;case "string":json.push('"',_zf_stdJsonEncode(v),'"');break;case "object":json=json.concat(_zf_stdJsonSerialize(v));break;default:;json.push("null");break;
348}i++;}}json.push("}");break;default:;json.push("null");break;}return json;}function zf_stdJsonSerialize(val){if(window.JSON&&window.JSON.stringify){return JSON.stringify(val,
349function(k,v){if(!v||v.constructor!=Date)return v;var month=val.getUTCMonth()+1;if(month<10)month="0"+month;var date=val.getUTCDate();if(date<10)date="0"+date;var hours=val.getUTCHours();
350if(hours<10)hours="0"+hours;var minutes=val.getUTCMinutes();if(minutes<10)minutes="0"+minutes;var seconds=val.getUTCSeconds();if(seconds<10)seconds="0"+seconds;return{"$type":'Date',
351Value:[val.getUTCFullYear(),'-',month,'-',date,' ',hours,':',minutes,':',seconds].join('')};});}else return _zf_stdJsonSerialze(val).join('');}function _zf_stdJsonEncode(text){text=text.replace(/([\\\x22])/g,
352"\\$1");text=text.replace(/\r/g,"\\r");text=text.replace(/\n/g,"\\n");text=text.replace(/\t/g,"\\t");return text;}function _zf_stdTransformResponse(val,objects,metas){if(typeof(val)!="object")return val;
353if(val==null)return null;if(val instanceof Array){for(var i=0;i<val.length;i++){if(typeof(val[i])=="object")val[i]=_zf_stdTransformResponse(val[i],objects,metas);
354}return val;}var metaDate=val["$date"];if(metaDate!=null)return zf_stdParseDateTimeUTC(metaDate);var metaRoot=val["$root"];if(metaRoot!=null){return _zf_stdTransformResponse(metaRoot,
355val["$objects"],val["$meta"]);}var metaRef=val["$ref"];if(metaRef!=null){return _zf_stdTransformCachedObject(metaRef,objects,metas);}var metaObj=val["$obj"];if(metaObj!=null){return _zf_stdTransformInlineObject(metaObj,
356objects,metas);}var metaType=val["$type"];if(metaType=="DateTime")return zf_stdParseDateTimeUTC(val["Value"]);var obj=val;if(metaType!=null){obj=_zf_stdCreateInstance(metaType);
357}var propName;var propVal;for(propName in val){if(propName.charAt(0)!="$"){propVal=val[propName];if(typeof(propVal)=="object")propVal=_zf_stdTransformResponse(propVal,
358objects,metas);obj[propName]=propVal;}}
358if(obj.postSerialize)obj.postSerialize();return obj;}var _$=_zf_stdTransformResponse;function _zf_stdCreateInstance(className){var type=className;
359if(className.indexOf("zf")!=0&&className.indexOf("Zenfolio.")!=0)type="zf_"+type;;var obj=new Function("return typeof("+type+") == 'function' ? new "+type+"() : {}")();
360obj["$type"]=className;return obj;}function _zf_stdTransformCachedObject(index,objects,metas){var cached=objects[index];if(!(cached instanceof Array))return cached;var obj=_zf_stdTransformInlineObject(cached,
361objects,metas);objects[index]=obj;return obj;}function _zf_stdTransformInlineObject(fields,objects,metas){var meta=metas[fields[0]];var type=meta[0];var obj=type!=null?_zf_stdCreateInstance(type):{};
362for(var i=1;i<fields.length;i++){var propName=meta[i];var propVal=fields[i];if(propVal==null&&type!=null)continue;if(propName.charAt(0)=="$")continue;if(typeof(propVal)=="object")propVal=_zf_stdTransformResponse(propVal,
363objects,metas);obj[propName]=propVal;}if(obj.postSerialize)obj.postSerialize();return obj;};var _zf_stdDelayLoad={};function _zf_stdRegisterDelayLoad(fileName,filePath){;;if(filePath.charAt(0)=='/'){var host=zf_stdAllowCdnHost()?zf_cdnHost:zf_secureHost;
364filePath=zf_stdGetProtocol(host)+host+filePath;}if(_zf_stdDelayLoad[fileName]===undefined)_zf_stdDelayLoad[fileName]=filePath;}function zf_stdOnScriptLoaded(fileName,callback){;
365if(callback==null)callback=zf_stdFalse;var entry=_zf_stdDelayLoad[fileName];switch(typeof(entry)){case "string":_zf_stdDelayLoad[fileName]=callback;break;case "function":_zf_stdDelayLoad[fileName]=[entry,
366callback];return null;case "object":if(entry==null)callback();else if(entry.constructor==Array)entry.push(callback);return null;default:;return null;}return entry;
367}function zf_stdLoadScript(fileName,callback,fragment){var entry=zf_stdOnScriptLoaded(fileName,callback);if(!entry)return;var url=entry;if(fragment)url+=fragment;var script=document.createElement("SCRIPT");
368script.type="text/javascript";script.src=url;document.body.appendChild(script);}function zf_stdLoadStyleSheet(fileName,callback){var entry=zf_stdOnScriptLoaded(fileName,
369callback);if(!entry)return;var link=document.createElement("LINK");link.rel="stylesheet";link.type="text/css";link.href=entry;var supportsEvent=false,onLoad=function(){zf_stdNotifyScriptLoad(fileName);
370};if("onload" in link){link.onload=onLoad;supportsEvent=true;}document.getElementsByTagName("head")[0].appendChild(link);if(!supportsEvent){onLoad();}}function zf_stdNotifyScriptLoad(fileName){switch(typeof(_zf_stdDelayLoad[fileName])){case "function":_zf_stdDelayLoad[fileName]();
371break;case "object":var list=_zf_stdDelayLoad[fileName];if(list!=null&&list.constructor==Array){for(var i=0;i<list.length;i++)list[i]();}break;default:break;}_zf_stdDelayLoad[fileName]=null;
372;}function zf_stdPrefetchScript(fileName){;var uid;if(zf_stdPrefetchScript.uid==null)uid=zf_stdPrefetchScript.uid=0;else uid=++zf_stdPrefetchScript.uid;var entry=_zf_stdDelayLoad[fileName];
373if(typeof(entry)=="string"){var frame=document.createElement("IFRAME");frame.style.cssText="position: absolute; visibility: hidden; left:0px; top: 0px;";document.body.appendChild(frame);
374setTimeout(function(){var doc=frame.contentWindow.document;var script=doc.createElement("SCRIPT");script.type="text/javascript";script.src=entry;doc.body.appendChild(script);
375frame=null;doc=null;},100);}}var Zenfolio;(function(Zenfolio){var Global;(function(Global){var ResourceService=(function(){function ResourceService(){}ResourceService.waitAll=function(operations,
376onComplete){;var count=operations.length;var callback=function(){if(--count==0){onComplete&&onComplete();}};for(var _i=0,operations_1=operations;_i<operations_1.length;
377_i++){var operation=operations_1[_i];operation(callback);}};ResourceService.loadScripts=function(fileNames,onComplete){this._loadFiles(fileNames,zf_stdLoadScript,
378onComplete);};ResourceService.loadStyleSheets=function(fileNames,onComplete){this._loadFiles(fileNames,zf_stdLoadStyleSheet,onComplete);};ResourceService.loadControl=function(webMethod,
379callback){var args=[zf_locale].concat(webMethod.args||[]);zf_stdServerRequestEx(webMethod.method,webMethod.url,webMethod.name,args,function(result,error){if(!error){var $result=$(result.html);
380$result.appendTo("BODY");if(result.script){$("<script></script>",{type:"text/javascript",text:result.script}).appendTo("HEAD");}callback($result);}else{callback(null);
381}});};ResourceService._loadFiles=function(fileNames,fileLoader,onComplete){;;this.waitAll($.map(fileNames,function(fileName){return(function(callback){return fileLoader(fileName,
382callback);});}),onComplete);};return ResourceService;}());Global.ResourceService=ResourceService;})(Global=Zenfolio.Global||(Zenfolio.Global={}));})(Zenfolio||(Zenfolio={}));
383;;function zf_Object(){}zf_Object.prototype.closure=function(method){;var self=this;if(arguments.length==1)return function(){return method.apply(self,arguments);};var args=[];for(var i=1;
384i<arguments.length;i++)args.push(arguments[i]);return function(){var a=[];for(var i=0;i<arguments.length;i++)a.push(arguments[i]);return method.apply(self,a.concat(args));
385};};zf_Object.prototype.closure2=function(method){;var self=this;if(arguments.length==1)return function(){return method.apply(self,arguments);};var args=[];for(var i=1;i<arguments.length;
386i++)args.push(arguments[i]);return function(){var a=[];for(var i=0;i<arguments.length;i++)a.push(arguments[i]);return method.apply(self,args.concat(a));};};;function zf_stdSetClientObject(dom,
387client){if(typeof(dom)=="string")dom=document.getElementById(dom);dom.zenfolioObject=client;}function zf_stdGetClientObject(dom){if(dom==null)return null;if(typeof(dom)=="string"){dom=document.getElementById(dom);
388if(dom==null)return null;}var client;client=dom.zenfolioObject;return client;}function zf_Control(id,clientObject){if(zf_stdNoArgs(arguments))return;;;if(clientObject==null)clientObject=zf_Control.getClientObjectName(id);
389this.id=id;this.clientObject=clientObject;}zf_Control.inherits(zf_Object);zf_Control.getClientObjectName=function(id){return(id.charAt(0)=='_'?"_zf":"_zf_")+id;};zf_Control.find=function(id){return window[zf_Control.getClientObjectName(id)];
390};zf_Control.prototype.dom=function(suffix){var id=[this.id];for(var i=0;i<arguments.length;i++)id.push(arguments[i]);return document.getElementById(id.join("-"));};zf_Control.prototype.$=function(selector){return selector==null?$(this.dom()):$(selector,
391this.dom());};zf_Control.prototype.$dom=function(suffix){var node=this.dom.apply(this,arguments);return $(node?node:[]);};zf_Control.prototype.eventHandler=function(method){;var self=this;
392if(arguments.length==1)return function(e){return method.apply(self,[zf_stdGetEvent(e)
392]);};var args=[];for(var i=1;i<arguments.length;i++)args.push(arguments[i]);
393return function(e){return method.apply(self,[zf_stdGetEvent(e)].concat(args));};};;var zf_stdDeferCallV=(function(){var queue=[];var yield=1;var slice=400;var batch=0;
394var tagged={};var onexecute=function(){++batch;;;var start=new Date().getTime();while(queue.length>0){var task=queue[0];var tag=task.tag;if(tag){;delete tagged[tag];
395task.tag=null;}var taskStart=new Date().getTime();try{task.method.apply(task.self,task.args);}catch(e){;}queue.shift();;if(new Date().getTime()-start>slice)break;
396}if(queue.length>0){;setTimeout(onexecute,yield);};};return function(tag,method,self,args){;;if(queue.length==0)setTimeout(onexecute,yield);if(tag){if(tagged[tag]){var found;
397for(var i=0;i<queue.length;i++){if(queue[i].tag==tag){;queue.splice(i,1);found=true;break;}};}else{tagged[tag]=true;}};queue.push({tag:tag,method:method,self:self,
398args:args});};})();function zf_stdDeferCall(tag,method,self){var args=[];for(var a=3;a<arguments.length;a++)args.push(arguments[a]);zf_stdDeferCallV(tag,method,self,args);
399}function zf_stdMakeDeferred(tag,method){return function(){zf_stdDeferCallV(tag,method,this,arguments);};}function zf_stdMakeMethodsDeferred(obj,id,names){var bake=function(tag,
400method,obj){return function(){zf_stdDeferCallV(tag,method,obj,arguments);};};for(var i=0;i<names.length;i++){var name=names[i];var method=obj[name];;obj[name]=bake(id+"."+name,
401method,obj);}};function zf_RequestQueue(interval,concurrent){this._interval=interval;this._concurrent=concurrent!=null?concurrent:1;this._queue=[];}zf_RequestQueue.prototype.enqueue=function(method,
402url,api,params,callback,tag){var request={method:method,url:url,api:api,params:params,callback:callback,executing:false,paused:false,tag:tag};this._queue.push(request);
403if(this._getAvailableCount()>0){this._execute(request);}};zf_RequestQueue.prototype.enqueueEx=function(method,url,api,params,callback,tag){this.enqueue(method,url,api,params,function(status,
404retVal){var error;var result;if(status!=200){result=null;error={message:status==403?"Access Denied.":"An unexpected error has occurred. Please try again later. If this problem persists, contact Support."};
405}else{result=retVal.result;error=retVal.error;}if(callback!=null)callback(result,error);},tag);};zf_RequestQueue.prototype.bump=function(tag){for(var i=0;i<this._queue.length;i++){var request=this._queue[i];
406if(request.tag==tag){if(i==0||request.executing)break;request.paused=false;this._queue=this._queue.splice(i,1).concat(this._queue);break;}}};zf_RequestQueue.prototype.pauseAll=function(){for(var i=0;
407i<this._queue.length;i++){var request=this._queue[i];if(!request.executing){request.paused=true;}}};zf_RequestQueue.prototype.resumeAll=function(){for(var i=0;i<this._queue.length;
408i++){this._queue[i].paused=false;}this._resumeExecution();};zf_RequestQueue.prototype._execute=function(request){;var self=this;var callback=function(status,retVal){for(var i=0;
409i<self._queue.length;i++){if(self._queue[i]==request)break;};self._queue.splice(i,1);request.callback(status,retVal);self._resumeExecution();};request.executing=true;
410zf_stdDeferCall(null,zf_stdServerRequest,null,request.method,request.url,request.api,request.params,callback);};zf_RequestQueue.prototype._getAvailableCount=function(){var executingCount=0;
411for(var i=0;i<this._queue.length;i++){if(this._queue[i].executing){executingCount++;}}return Math.max(0,this._concurrent-executingCount);};zf_RequestQueue.prototype._resumeExecution=function(){var self=this,
412availableCount=this._getAvailableCount();for(var i=0;(i<this._queue.length)&&(availableCount>0);i++){var request=this._queue[i];if(!request.executing&&!request.paused){availableCount--;
413request.executing=true;setTimeout(function(){self._execute(request);},this._interval);}}};;function zf_Loadable(){if(zf_stdNoArgs(arguments))return;this.loaded=this.requested=false;
414this._nextSinkId=0;this._uniqueId=zf_Loadable._counter++;this._callbacks={};}zf_Loadable._counter=0;zf_Loadable.inprogress={};zf_Loadable.watcher=setInterval(function(){var now=new Date();for(var key in zf_Loadable.inprogress){var loadable=zf_Loadable.inprogress[key];
415if(now.getTime()-loadable._requestTime.getTime()>1000)loadable.setDelayed();}},500);zf_Loadable.notifyLoaded=function(loadable,onload,ondelay){;if(loadable.loaded){onload(loadable);
416return true;}else{var sink={};loadable.advise(sink,function(){loadable.unadvise(sink);onload(loadable);},ondelay&&function(){loadable.unadvise(sink);ondelay(loadable);
417});return false;}};zf_Loadable.prototype.getPart=function(partType,extra){;;var partName=partType.name;var part;if((part=this[partName])==null){part=this[partName]=new partType(this);
418part.setRequested();var args=$.makeArray(arguments);args.shift();
418zf_Loadable.notifyLoaded(this,function(){part.load.apply(part,args);});};;return part;};zf_Loadable.prototype.advise=function(sink,
419onload,ondelay){if(this.loaded)return;var sinkId=null;if(sink.__loadables==null)sink.__loadables={};else sinkId=sink.__loadables[this._uniqueId];if(sinkId==null){sinkId=this._nextSinkId++;
420sink.__loadables[this._uniqueId]=sinkId;}this._callbacks[sinkId]=[onload,ondelay];if(this.delayed&&ondelay)ondelay.call(this);};zf_Loadable.prototype.unadvise=function(sink){var sinkId=null;
421var loadables=sink.__loadables;if(loadables!=null)sinkId=loadables[this._uniqueId];if(sinkId!=null){loadables[this._uniqueId]=null;delete loadables[this._uniqueId];
422this._callbacks[sinkId]=null;delete this._callbacks[sinkId];}};zf_Loadable.prototype.done=function(){if(this.loaded)return;this.requested=this.loaded=true;delete zf_Loadable.inprogress[this._uniqueId];
423for(var sinkId in this._callbacks)this._callbacks[sinkId][0].call(this);};zf_Loadable.prototype.postSerialize=function(){this.requested=this.loaded=true;};zf_Loadable.prototype.setRequested=function(){;
424;;this.requested=true;this._requestTime=new Date();zf_Loadable.inprogress[this._uniqueId]=this;};zf_Loadable.prototype.setDelayed=function(){;;;this.delayed=true;delete zf_Loadable.inprogress[this._uniqueId];
425for(var sinkId in this._callbacks){var callback=this._callbacks[sinkId][1];if(callback!=null)callback.call(this);}};;function zf_LoadableSet(){zf_Loadable.prototype.constructor.call(this);
426var items=[];for(var k=0;k<arguments.length;k++){var a=arguments[k];if(a instanceof Array)items=items.concat(a);else if(a!=null)items.push(a);}this.setRequested();
427var pending=0;var self=this;var callback=function(){if(--pending==0)self.done();};for(var i=0;i<items.length;i++){var item=items[i];if(item==null)continue;;if(!item.loaded){++pending;
428item.advise(this,callback);}}this._items=items;if(pending==0)this.done();this.length=items.length;}zf_LoadableSet.inherits(zf_Loadable);zf_LoadableSet.prototype.get=function(index){;return this._items[index];
429};zf_LoadableSet.prototype.getAll=function(){return[].concat(this._items);};zf_LoadableSet.prototype.getPart=function(part){;;var items=this._items;var count=items.length;var parts=[];for(var i=0;
430i<count;i++)parts.push(items[i].getPart(part));return new zf_LoadableSet(parts);};zf_LoadableSet.prototype.forEach=function(callback){;var items=this._items;var length=items.length;
431for(var i=0;i<length;i++){if(callback(items[i],i))break;}};;function zf_Animation(states,callback){;;this.inprogress=false;this._timer=null;this._variable=0;this._from=this._to=0;
432this._end=this._start=new Date().getTime();this._states=states;this._callback=callback;var self=this;this._clear=function(){self.inprogress=false;self._oncomplete=null;
433if(self._timer){clearInterval(self._timer);self._timer=null;}};}zf_Animation.prototype._run=function(){var oncomplete=this._oncomplete;this._clear();this.inprogress=true;var self=this;
434var callback=function(){var now=new Date().getTime();if(now>=self._end||self._from==self._to||self._end==self._start)self._variable=self._to;if(self._variable==self._to){self._clear();
435self._callback(self._to);if(oncomplete)oncomplete();return;}var total=self._end-self._start;var spent=now-self._start;var dtotal=Math.abs(self._from-self._to);var dspent=Math.ceil(spent*dtotal/total);
436if(self._from<self._to){self._variable=self._from+dspent;if(self._variable>self._to)self._variable=self._to;}else{self._variable=self._from-dspent;if(self._variable<self._to)self._variable=self._to;
437}if(self._variable==self._to){self._clear();if(oncomplete)oncomplete();}if(dspent==0)return;self._callback(self._variable);};this._timer=setInterval(callback,10);
438this._callback(this._variable);};zf_Animation.prototype.jump=function(state){;this._clear();this._from=this._to=this._states[state];this._variable=this._to;this._callback(this._variable);
439};zf_Animation.prototype.resync=function(){this._callback(this._variable);};zf_Animation.prototype.animate=function(state,speed,oncomplete){;this._from=this._variable;this._to=this._states[state];
440this._start=new Date().getTime();this._end=this._start;this._oncomplete=oncomplete;if(this._to==this._variable){if(oncomplete)oncomplete();this._clear();return;}var diff=Math.abs(this._variable-this._to);
441var time=Math.ceil(speed.t*diff/speed.s);this._end=this._start+time;this._run();};;function zf_DelayedInvoke(delay){this.delay=delay;}zf_DelayedInvoke.prototype.invoke=function(callback,
442delay){;this.clear();this.callback=callback;var self=this;var pending=setTimeout(function(){if(pending==self.pending){self.pending=null;callback();}},delay==null?this.delay:delay);
443this.pending=pending;};zf_DelayedInvoke.prototype.clear=function(){if(!this.pending)return;clearTimeout(this.pending);this.pending=null;};;function zf_SmartAnimation(delay,minDuration){this._delay=delay;
444this._minDuration=minDuration;this._state='init';}zf_SmartAnimation.prototype.start=function(callback){if(this._state!='init')throw zf_stdFormatString('Incorrect object state "{0}"',
445this._state);this._animationStart=callback;var self=this;this._state='animScheduled';this._animationStartTimeout=setTimeout(function(){delete self._animationStartTimeout;
446self._state='animRunning';self._animationStart();delete self._animationStart;self._animationDurationTimeout=setTimeout(function(){delete self._animationDurationTimeout;
447switch(self._state){case 'animRunningStopPending':self._state='init';self._animationStop();delete self._animationStop;break;case 'animRunning':self._state='animRunningLong';
448break;default:throw zf_stdFormatString('Incorrect object state "{0}"',self._state);}},self._minDuration);},this._delay);};zf_SmartAnimation.prototype.restart=function(callback){switch(this._state){case 'init':this.start(callback);
449break;case 'animScheduled':this._animationStart=callback;break;case 'animRunning':case 'animRunningLong':callback();break;case 'animRunningStopPending':delete this._animationStop;
450callback();this._state='animRunning';break;default:throw zf_stdFormatString('Unknown object state "{0}"',this._state);}};zf_SmartAnimation.prototype.stop=function(callback){switch(this._state){case 'init':case 'animRunningStopPending':throw zf_stdFormatString('Incorrect object state "{0}"',
451this._state);case 'animScheduled':clearTimeout(this._animationStartTimeout);delete this._animationStartTimeout;delete this._animationStart;this._state='init';callback();
452return true;case 'animRunningLong':this._state='init';callback();return true;case 'animRunning':this._state='animRunningStopPending';this._animationStop=callback;
453return false;default:throw zf_stdFormatString('Unknown object state "{0}"',this._state);}};;var _zf_stdBase32Digits="123456789ABCDEFGHJKMNPQRSTUVWXYZ";function zf_stdBase32Encode(number){var res="";
454while(number>0){res=_zf_stdBase32Digits.charAt(number&0x1F)+res;number>>>=5;}return res;}function zf_stdBase32Decode(encoded){encoded=encoded.toUpperCase();var res=0;for(var i=0;
455i<encoded.length;i++){res<<=5;res|=_zf_stdBase32Digits.indexOf(encoded.charAt(i));}return res;};function zf_VolumeMapper(code){;var iter={code:code,pos:0,length:code.length};
456this._default=zf_VolumeMapper._decodeInt(iter);this._mapping={};while(iter.pos<iter.length){var method=zf_VolumeMapper._decodeInt(iter);var volume=zf_VolumeMapper._decodeInt(iter);
457this._mapping["_"+method]=volume;}}zf_VolumeMapper.prototype.map=function(method){;var volume=this._mapping["_"+method.code];return volume!=null?volume:this._default;};zf_VolumeMapper.prototype.defaultMapping=function(){return this._default;
458};zf_VolumeMapper._decodeInt=function(iter){;;var val=0;var scale=1;var isNegative=false;while(iter.pos<iter.length){var c=iter.code.charCodeAt(iter.pos++);if(c===0x2D){if(!isNegative){isNegative=true;
459continue;};}val+=scale*((c&~0x20)-0x41);scale*=26;if((c&0x20)==0)return isNegative?-val-1:val;};return null;};;function zf_BasicImage(id,width,height,timestamp,volume,token,
460fileType){if(arguments.length>0){;;;;;;this.id=id;this.width=width;this.height=height;this.timestamp=timestamp;this.volume=volume;this.token=token;this.fileType=fileType==null?null:fileType;
461this._mapper=null;
461this.postSerialize();}else{this.timestamp="";this.fileType=".jpg";this._mapper=null;}this.isPlaceholder=false;}zf_BasicImage.Photo="p";zf_BasicImage.UserFile="f";zf_BasicImage.prototype.getUnsignedId=function(){if(this.id==null){return null;
462}return zf_toUint32(this.id);};zf_BasicImage.prototype.getVolume=function(method){return this._mapper.map(method);};zf_BasicImage.prototype.postSerialize=function(){if(this.volume!=null)this._mapper=new zf_VolumeMapper(this.volume);
463};zf_BasicImage.prototype.getScaledSize=function(method){var cx=this.width;var cy=this.height;var size=null;if(method.code==undefined){size=method;method=null;}if(cx!=0&&cy!=0){if(method!=null){if(method.code==zf_ProcessingMethod.WatermarkThumbnail.code||method.code==zf_ProcessingMethod.WatermarkSmallThumbnail.code||method.code==zf_ProcessingMethod.WatermarkLargeThumbnail.code||method.code==zf_ProcessingMethod.WatermarkVeryLargeThumbnail.code||method.code==zf_ProcessingMethod.LogoSmallThumbnail.code||method.code==zf_ProcessingMethod.LogoSmallThumbnail2.code||method.code==zf_ProcessingMethod.LogoCompactThumbnail.code||method.code==zf_ProcessingMethod.LogoLargeThumbnail.code){return{cx:method.cx,
464cy:method.cy};}if(zf_ProcessingMethod.isClipped(method)){var base=this.getScaledSize(zf_ProcessingMethod.fromCode(method.code));if(method.stretch)base={cx:base.cx*10,
465cy:base.cy*10};return{cx:Math.min(base.cx,method.cx),cy:Math.min(base.cy,method.cy)};}if(method===zf_ProcessingMethod.StandardSmallThumbnail||method===zf_ProcessingMethod.StandardMediumThumbnail){cx=cy=Math.min(this.width,
466this.height);}}var width=(method||size).cx;var height=(method||size).cy;if(method&&method.stretch&&cx<width&&cy<height){cx=cx*10;cy=cy*10;}if(width<cx||height<cy){var ratio=width/cx;
467if(cy*ratio>height)ratio=height/cy;var bankersRound=function(x){var r=Math.round(x);if(r%2==0||r==x)return r;var f=Math.floor(x);return x-f==0.5?f:r;};cx=Math.max(1,
468bankersRound(cx*ratio));cy=Math.max(1,bankersRound(cy*ratio));}}return{cx:cx,cy:cy};};zf_BasicImage.getPhotoScaledSize=function(photoWidth,photoHeight,method){var cx=photoWidth;
469var cy=photoHeight;var size=null;if(method.code==undefined){size=method;method=null;}if(cx!=0&&cy!=0){if(method!=null){if(method==zf_ProcessingMethod.WatermarkThumbnail||method==zf_ProcessingMethod.WatermarkSmallThumbnail||method==zf_ProcessingMethod.WatermarkLargeThumbnail||method==zf_ProcessingMethod.WatermarkVeryLargeThumbnail||method==zf_ProcessingMethod.LogoSmallThumbnail||method==zf_ProcessingMethod.LogoSmallThumbnail2||method==zf_ProcessingMethod.LogoLargeThumbnail){return{cx:method.cx,
470cy:method.cy};}if(zf_ProcessingMethod.isClipped(method)){var base=zf_BasicImage.getPhotoScaledSize(width,height,zf_ProcessingMethod.fromCode(method.code));return{cx:Math.min(base.cx,
471method.cx),cy:Math.min(base.cy,method.cy)};}if(method==zf_ProcessingMethod.StandardSmallThumbnail)cx=cy=Math.min(this.width,this.height);}var width=(method||size).cx;
472var height=(method||size).cy;if(width<cx||height<cy){var ratio=width/cx;if(cy*ratio>height)ratio=height/cy;var bankersRound=function(x){var r=Math.round(x);if(r%2==0||r==x)return r;
473var f=Math.floor(x);return x-f==0.5?f:r;};cx=Math.max(1,bankersRound(cx*ratio));cy=Math.max(1,bankersRound(cy*ratio));}}return{cx:cx,cy:cy};};;function zf_PlaceholderImage(id){if(!id)return;
474this.paceholder=true;this.placeholderId=id;zf_BasicImage.prototype.constructor.apply(this,[null,0,0,"",null,null]);this.prefix="p";this.video=false;this.isPlaceholder=true;
475}zf_PlaceholderImage.inherits(zf_BasicImage);zf_PlaceholderImage.prototype.getInternalUrl=function(){return null;};zf_PlaceholderImage.prototype.getExternalUrl=function(){return null;};zf_PlaceholderImage.prototype.pickMethod=function(){return null;
476};zf_PlaceholderImage.prototype.getScaledSize=function(){return null;};;function zf_PhotoImage(id,width,height,timestamp,volume,token,isCutout,background){if(zf_stdNoArgs(arguments))return;
477zf_BasicImage.prototype.constructor.apply(this,arguments);this.prefix="p";this.video=false;this.isCutout=isCutout;this.background=background;}zf_PhotoImage.inherits(zf_BasicImage);
478zf_PhotoImage._fields=["id","photoId","width","height","timestamp","volume","token","prefix","_mapper","video","isCutout","background"];zf_PhotoImage.clone=function(photo){if(photo==null)return null;
479return zf_stdCopyFields(new zf_PhotoImage(),photo,zf_PhotoImage._fields);};zf_PhotoImage.prototype.postSerialize=function(){zf_BasicImage.prototype.postSerialize.call(this);if(this.flags&zf_PhotoFlags.Video)this.video=true;
480if(this.cdnPath&&zf_stdStartsWith(this.cdnPath,'base64:')){var base64=this.cdnPath.substr(7);this.cdnPath=zf_stdBase64Decode(base64);}};zf_PhotoImage.prototype.getInternalUrl=function(method,
481options){;if(this&&this.image&&this.image.isPhotoFromVisitorView&&this.image.watermarkId!==0&&this.image.gridType>0&&this.image.gridType===zfl_NewGridPlugin.DynamicHorizontalGrid){method.code=method.code==zf_ProcessingMethod.StandardVeryLargeThumbnail.code?zf_ProcessingMethod.StandardSmallSize.code:method.code;
482}if(this.id==0)return null;options=options||{};var backgroundMethod=null,background=zf_PhotoImage.getBackground(this);if(background){backgroundMethod=zf_ProcessingMethod.backgroundMethodsMap[method.code];
483if(backgroundMethod){method=zf_ProcessingMethod.cutoutMethodsMap[method.code];}else{background=null;}}var volume=options.volume||this.getVolume(method),modifier=options.modifier!=null?options.modifier:'',
484block=!!options.block,url=[];var cdn=this.cdnPath!=null&&zf_stdGetCookie('zf_5y_visitor')!=null;if(cdn)url.push('/cdn',this.cdnPath);else url.push('/img');url.push('/s',
485zf_imageVS[volume],'/v',volume);if(!cdn&&method.type=='.mp4')url.push('/o',(this.owner||options.owner).id,'/c',zf_stdBase32Decode(this.timestamp));if(background){url.push('/b',
486background.image.id,'-v',background.image.getVolume(backgroundMethod),'-');}else{url.push('/');}url.push('p',this.getUnsignedId(),'-',method.code,modifier,method.type,
487(block?'?sn=':'?ts='),this.timestamp);if(this.token!=null)url.push("&tk=",this.token);if(this.timestamp!=null&&(zf_stdBase32Decode(this.timestamp)&1)!=0){if(zf_userId!=0)url.push("&uid=",
488zf_userId);var keyRing=zf_stdGetCookie("zf_keyring");if(keyRing!=null)url.push("&keyringx=",keyRing);}return zf_stdChangeImageCdnUrl(url.join(''),this);};zf_PhotoImage.prototype.getExternalUrl=function(method,
489ext){if(this.id==0)return null;var volume=this._mapper.defaultMapping();var url;if(method!=null){if(method==zf_ProcessingMethod.Video1080p||method==zf_ProcessingMethod.Video720p||method==zf_ProcessingMethod.Video480p||method==zf_ProcessingMethod.Video360p){url=['/img/s',
490zf_imageVS[volume],'/v',volume,'/o',this.owner.id,'/c',this.metacn,'/p',this.getUnsignedId(),'-',method.code,method.type];}else{url=['/img/s',zf_imageVS[volume],
491'/v',volume];var backgroundMethod=null,background=zf_PhotoImage.getBackground(this);if(background&&(backgroundMethod=zf_ProcessingMethod.backgroundMethodsMap[method.code])){method=zf_ProcessingMethod.cutoutMethodsMap[method.code];
492url.push('/b',background.image.id,'-v',background.image.getVolume(backgroundMethod),'-');}else{url.push('/');}url.push('p',this.getUnsignedId(),'-',method.code,method.type);
493}}else{url=['/img/s',zf_imageVS[volume],'/v',volume,'/p',this.getUnsignedId(),this.fileType];}return url.join('');};zf_PhotoImage.prototype.pickMethod=function(width,height,allowThumbs,
494accessMask,sizeUp){var options=[{method:zf_ProcessingMethod.StandardSmallSize,mask:0},{method:zf_ProcessingMethod.StandardMediumSize,mask:zf_AccessMask.ProtectMedium},
495{method:zf_ProcessingMethod.StandardLargeSize,mask:zf_AccessMask.ProtectLarge},{method:zf_ProcessingMethod.StandardExtraLargeSize,mask:zf_AccessMask.ProtectExtraLarge},
496{method:zf_ProcessingMethod.StandardXXLargeSize,mask:zf_AccessMask.ProtectXXLarge}];if(allowThumbs){options=[{method:zf_ProcessingMethod.StandardThumbnail,mask:0},
497{method:zf_ProcessingMethod.StandardLargeThumbnail,mask:0},{method:zf_ProcessingMethod.StandardVeryLargeThumbnail,mask:0}].concat(options);}var method=null;var previous=null;
498for(var i=0;i<options.length;i++){var option=options[i];if((option.mask&accessMask)!=0)continue;var size=this.getScaledSize(option.method);if(sizeUp===true&&(size.cx>width||size.cy>height)){method=option.method;
499break;}else if(size.cx>width||size.cy>height){break;}if(previous&&size.cx<=previous.cx&&size.cy<=previous.cy)break;previous=size;method=option.method;}return method;
500};
500zf_PhotoImage.getBackground=function(photo){return(photo.isCutout&&photo.background)||null;};;function zf_FileImage(id,width,height,timestamp,volume,token,fileType,ownerId){if(zf_stdNoArgs(arguments))return;
501zf_BasicImage.prototype.constructor.apply(this,arguments);this["$type"]="FileImage";this.prefix="u";}zf_FileImage.inherits(zf_BasicImage);zf_FileImage._fields=["id","width","height","timestamp",
502"volume","token","prefix","_mapper","fileType","ownerId"];zf_FileImage.clone=function(file){if(file==null)return null;return zf_stdCopyFields(new zf_FileImage(),file,zf_FileImage._fields);
503};zf_FileImage.prototype.getExternalUrl=function(method){if(this.id==0)return null;var volume=this._mapper.defaultMapping();var url=this.ownerId?['/img/s',zf_imageVS[volume],
504'/v',volume,'/u',this.id,'-o',this.ownerId]:['/img/s',zf_imageVS[volume],'/v',volume,'/u',this.id];if(method!=null)url.push('-',method.code,method.type,'?sn=');else url.push(this.fileType);
505return url.join('');};zf_FileImage.prototype.getInternalUrl=function(method,options){;if(this.id==0)return null;if(options==null)options={};var url=[];if(zf_stdAllowCdnHost()){url.push(zf_stdGetProtocol(zf_cdnHost));
506url.push(zf_cdnHost);}else{url.push(location.protocol+'//');url.push(location.host);}var volume=this.getVolume(method);if(this.ownerId)url.push('/img/s',zf_imageVS[volume],
507'/v',volume,'/u',this.id,'-','o',this.ownerId,'-',method.code,method.type,(options.block?'?sn=':'?ts='));else url.push('/img/s',zf_imageVS[volume],'/v',volume,'/u',
508this.id,'-',method.code,method.type,(options.block?'?sn=':'?ts='));return url.join('');};;var zf_AccessType={Public:"Public",Private:"Private",Password:"Password",Protected:"Protected",
509Derived:"Derived"};var zf_AccessMask={None:0x00000000,ProtectOriginals:0x00000001,ProtectExtraLarge:0x00000002,NoCollections:0x00000004,PasswordProtectOriginals:0x00000008,
510ProtectXXLarge:0x00000010,ProtectUserStats:0x00000020,ProtectVisits:0x00000040,NoRecentList:0x00000080,NoPrivateSearch:0x00000100,Expires:0x00000200,ApproveGuestbook:0x00000400,
511ApproveComments:0x00000800,Protect1080p:0x00001000,NoPublicSearch:0x00002000,ProtectDateCreated:0x00004000,ProtectDateModified:0x00008000,ProtectDateTaken:0x00010000,
512ProtectExif:0x00020000,ProtectLarge:0x00040000,ProtectMedium:0x00080000,ProtectMeta:0x00004000|0x00008000|0x00020000|0x00010000,NoPublicGuestbookPosts:0x00100000,
513NoPrivateGuestbookPosts:0x00200000,NoAnonymousGuestbookPosts:0x00400000,NoPublicComments:0x00800000,NoPrivateComments:0x01000000,NoAnonymousComments:0x02000000,ProtectGuestbook:0x04000000,
514ProtectComments:0x08000000,UnprotectCover:0x10000000,Protect720p:0x20000000,Protect480p:0x40000000,ImageSizeLimitXXLarge:0x00000000,ImageSizeLimitExtraLarge:0x00000010,
515ImageSizeLimitLarge:0x00000010|0x00000002,ImageSizeLimitMedium:0x00000010|0x00000002|0x00040000,ImageSizeLimitSmall:0x00000010|0x00000002|0x00040000|0x00080000,ImageSizeMask:0x00000010|0x00000002|0x00040000|0x00080000,
516VideoSizeLimit1080p:0x00000000,VideoSizeLimit720p:0x00001000,VideoSizeLimit480p:0x00001000|0x20000000,VideoSizeLimit360p:0x00001000|0x20000000|0x40000000,VideoSizeMask:0x00001000|0x20000000|0x40000000,
517SearchAny:0x00000000,SearchLocalOnly:0x00002000,SearchNone:0x00002000|0x00000100,SearchMask:0x00002000|0x00000100,IncludeGalleryFilesWithOriginals:0x100000000};zf_AccessMask.set=function(mask,
518bits){var maskLo=mask&0xFFFFFFFF,maskHi=Math.floor(mask/0x100000000),bitsLo=bits&0xFFFFFFFF,bitsHi=Math.floor(bits/0x100000000);return(maskLo|bitsLo)+((maskHi|bitsHi)*0x100000000);
519};zf_AccessMask.clear=function(mask,bits){var maskLo=mask&0xFFFFFFFF,maskHi=Math.floor(mask/0x100000000),bitsLo=bits&0xFFFFFFFF,bitsHi=Math.floor(bits/0x100000000);return(maskLo&~bitsLo)+((maskHi&~bitsHi)*0x100000000);
520};zf_AccessMask.test=function(mask,bits){var maskLo=mask&0xFFFFFFFF,maskHi=Math.floor(mask/0x100000000),bitsLo=bits&0xFFFFFFFF,bitsHi=Math.floor(bits/0x100000000);return(maskLo&bitsLo)+((maskHi&bitsHi)*0x100000000);
521};function zf_AccessRealm(type,mask){this.realmId=0;this.ownerId=0;this.type=type!=null?type:zf_AccessType.Public;this.mask=mask!=null?mask:zf_AccessMask.None;this.viewers=[];
522this.password=zf_AccessRealm.NotAvailable;this.passwordHint="";this.srcPassword="";this.srcPasswordHint="";}zf_AccessRealm.NotAvailable={};zf_AccessRealm._fields=["type","mask","realmId","ownerId",
523"viewers","password","passwordHint","srcPassword","srcPasswordHint","expiresOn"];zf_AccessRealm.prototype.set=function(bits){return(this.mask=zf_AccessMask.set(this.mask,bits));
524};zf_AccessRealm.prototype.set=function(bits){return(this.mask=zf_AccessMask.clear(this.mask,bits));};zf_AccessRealm.prototype.set=function(bits){return zf_AccessMask.test(this.mask,bits);};
525zf_AccessRealm.clone=function(realm){if(realm==null)return null;var clone=zf_stdCopyFields(new zf_AccessRealm(),realm,zf_AccessRealm._fields);clone.viewers=realm.viewers!=null?[].concat(realm.viewers):[];
526return clone;};;function zf_AccessInfo(parent,type,mask){this.parent=parent;if(arguments.length==0){this.isDerived=true;zf_AccessRealm.prototype.constructor.call(this);}else if(parent!=null&&type==null){this.isDerived=true;
527zf_AccessRealm.prototype.constructor.call(this,parent.type,parent.mask);}else{this.isDerived=false;zf_AccessRealm.prototype.constructor.call(this,type,mask);}}zf_AccessInfo._fields=["isCensored",
528"isDerived","parent"].concat(zf_AccessRealm._fields);zf_AccessInfo.clone=function(info){if(info==null)return null;var clone=zf_stdCopyFields(new zf_AccessInfo(),info,zf_AccessInfo._fields);
529clone.viewers=info.viewers!=null?[].concat(info.viewers):[];return clone;};zf_AccessInfo.prototype.getRealm=function(){var info=this;while(info.isDerived&&info.parent!=null)info=info.parent;
530return info;};;var zf_PhotoFlags={None:0,HasTitle:1,HasCaption:2,HasCategories:4,HasKeywords:8,HasExif:16,HasComments:32,HasImage0:1024,HasImage1:2048,HasImage10:4096,
531HasImage11:8192,Video:0x00008000,VideoReady:0x00010000,VideoFailed:0x00020000};;function _zf_stdCategoryCompare(a,b){if((a%1000)!=0)a=0;else if((a%100000)!=0)a=1;else a=2;
532if((b%1000)!=0)b=0;else if((b%100000)!=0)b=1;else b=2;return a-b;};function zf_ScrapbookModifier(){;}zf_ScrapbookModifier.Owner=0;zf_ScrapbookModifier.Photographer=1;zf_ScrapbookModifier.Other=2;function zf_ScrapbookInfo(){this.map={};this.pending={};
533}zf_ScrapbookInfo._fields=["token","name","changeNumber","photoCount","contact","sharerName","sharerEmail","sharerMessage","isOwned","isSharedWith","isReadOnly","isStored","isArchived",
534"isReviewed"];zf_ScrapbookInfo.prototype.update=function(update){;for(var key in update){var value=update[key];if(value==null)continue;this[key]=value;}};zf_ScrapbookInfo.prototype.getDisplayName=function(){if(this.isSharedWith&&this.sharerName)return zf_stdFormatString('{0}: {1}',
535this.sharerName,this.name);return this.name;};zf_ScrapbookInfo.prototype.postSerialize=function(){if(this.photos)this.remap();};zf_ScrapbookInfo.prototype.remap=function(){;var map={};$.each(this.photos,
536function(i,p){map[zf_PhotoKey.getString(p)]=p;});this.map=map;};;function zf_YearbookClient(){this.id=null;this.contact=null;this.user=null;};function zf_YearbookPose(){this.id=null;
537this.client=null;this.folder=null;this.photoSet=null;this.photo=null;this.createdOn=null;this.updatedOn=null;this.modifiedOn=null;this.photo=null;this.type=null;
538}zf_YearbookPose.prototype.postSerialize=function(){this.modifiedOn=this.updatedOn||this.createdOn;};zf_YearbookPose.prototype.resolveFolder=function(){return this.folder!=null?this.folder:this.photoSet!=null?this.photoSet.folder:null;
539};;var zf_stdFileTypes={".jpg":{type:"JPEG",mime:"image/jpeg",ext:".jpg"},".gif":{type:"GIF",mime:"image/gif",ext:".gif"},".png":{type:"PNG",mime:"image/png",ext:".png"},
540".tif":{type:"TIFF",mime:"image/tiff",ext:".tif"},".bmp":{type:"BMP",mime:"image/bmp",ext:".bmp"},".mp4":{type:"MP4",mime:"video/mp4",ext:".mp4"}};var zf_stdMimeTypes={"image/jpeg":{type:"JPEG",
541mime:"image/jpeg",ext:".jpg"},"image/gif":{type:"GIF",mime:"image/gif",ext:".gif"},"image/png":{type:"PNG",mime:"image/png",ext:".png"},"image/tiff":{type:"TIFF",
542mime:"image/tiff",ext:".tif"},"image/bmp":{type:"BMP",mime:"image/bmp",ext:".bmp"},"video/mp4":{type:"MP4",mime:"video/mp4",ext:".mp4"}};;var zf_ProcessingMethod={StandardSmallThumbnail:{code:1,
543output:10,isThumb:true,cx:60,cy:60,type:".jpg",format:"Square Thumbnail (60 x 60)"},StandardThumbnail:{code:0,output:10,isThumb:true,cx:80,cy:80,type:".jpg",format:"Small Thumbnail ({0} x {1})"},
544StandardSmallSize:{code:2,output:15,isThumb:false,cx:400,cy:400,type:".jpg",format:"Small ({0} x {1})"},StandardMediumSize:{code:3,output:15,isThumb:false,cx:580,
545cy:450,type:".jpg",format:"Medium ({0} x {1})"},StandardLargeSize:{code:4,output:15,isThumb:false,cx:800,cy:630,type:".jpg",format:"Large ({0} x {1})"},StandardExtraLargeSize:{code:5,
546output:15,isThumb:false,cx:1100,cy:850,type:".jpg",format:"X-Large ({0} x {1})"},StandardXXLargeSize:{code:6,output:15,isThumb:false,cx:1550,cy:960,type:".jpg",format:"XX-Large ({0} x {1})"},
547StandardLargeThumbnail:{code:10,output:10,isThumb:true,cx:120,cy:120,type:".jpg",format:"Medium Thumbnail ({0} x {1})"},StandardMediumThumbnail:{code:10,output:10,
548isThumb:true,cx:80,cy:80,type:".jpg",format:"Square Thumbnail (80 x 80)",clip:true},StandardVeryLargeThumbnail:{code:11,output:10,isThumb:true,cx:200,cy:200,type:".jpg",
549format:"Large Thumbnail ({0} x {1})"},StandardSmallThumbnailPng:{code:21,output:10,isThumb:true,cx:60,cy:60,type:".jpg",format:"Square Thumbnail (60 x 60)"},StandardThumbnailPng:{code:20,
550output:10,isThumb:true,cx:80,cy:80,type:".jpg",format:"Small Thumbnail ({0} x {1})"},StandardSmallSizePng:{code:22,output:15,isThumb:false,cx:400,cy:400,type:".jpg",
551format:"Small ({0} x {1})"},StandardMediumSizePng:{code:23,output:15,isThumb:false,cx:580,cy:450,type:".jpg",format:"Medium ({0} x {1})"},StandardLargeSizePng:{code:24,
552output:15,isThumb:false,cx:800,cy:630,type:".jpg",format:"Large ({0} x {1})"},StandardExtraLargeSizePng:{code:25,output:15,isThumb:false,cx:1100,cy:850,type:".jpg",
553format:"X-Large ({0} x {1})"},StandardXXLargeSizePng:{code:26,output:15,isThumb:false,cx:1550,cy:960,type:".jpg",format:"XX-Large ({0} x {1})"},StandardLargeThumbnailPng:{code:30,
554output:10,isThumb:true,cx:120,cy:120,type:".jpg",format:"Medium Thumbnail ({0} x {1})"},StandardVeryLargeThumbnailPng:{code:31,output:10,isThumb:true,cx:200,cy:200,
555type:".jpg",format:"Large Thumbnail ({0} x {1})"},StandardBioPhoto:{code:50,output:20,isThumb:true,cx:120,cy:120,type:".jpg"},StandardSmallBioPhoto:{code:51,output:20,
556isThumb:true,cx:80,cy:80,type:".jpg"},StandardMediumBioPhoto:{code:52,output:20,isThumb:true,cx:100,cy:100,type:".jpg"},WatermarkThumbnail:{code:60,output:30,isThumb:true,
557cx:80,cy:80,type:".png"},WatermarkSmallThumbnail:{code:61,output:30,isThumb:true,cx:60,cy:60,type:".png"},WatermarkNormalizedHorz:{code:62,output:30,isThumb:false,
558type:".jpg"},WatermarkNormalizedVert:{code:63,output:30,isThumb:false,type:".jpg"},WatermarkLargeThumbnail:{code:64,output:30,isThumb:true,cx:120,cy:120,type:".png"},
559WatermarkVeryLargeThumbnail:{code:65,output:30,isThumb:true,cx:200,cy:200,type:".png"},LogoSmallThumbnail:{code:70,output:70,isThumb:true,cx:200,cy:40,type:".png"},
560LogoSmallThumbnail2:{code:770,output:70,isThumb:true,cx:400,cy:80,type:".png"},LogoCompactThumbnail:{code:78,output:70,isThumb:true,cx:200,cy:63,type:".png"},LogoLargeThumbnail:{code:74,
561output:70,isThumb:true,cx:200,cy:100,type:".png"},FavIcon:{code:81,output:80,isThumb:true,cx:16,cy:16,type:".ico"},ProductIcon:{code:181,output:130,isThumb:false,
562cx:244,cy:214,type:".jpg"},ProductPreview:{code:182,output:131,isThumb:false,cx:900,cy:480,type:".jpg"},ProductPreviewThumb:{code:183,output:131,isThumb:false,cx:244,
563cy:130,type:".jpg"},DesignIcon:{code:184,output:132,isThumb:false,cx:244,cy:244,type:".jpg"},DesignPreview:{code:185,output:133,isThumb:false,cx:900,cy:480,type:".jpg"},
564DesignPreviewThumb:{code:186,output:133,isThumb:false,cx:244,cy:244,type:".jpg"},BackgroundSmallThumbnail:{code:190,output:190,isThumb:true,cx:60,cy:60,type:".jpg"},
565BackgroundThumbnail:{code:191,output:190,isThumb:true,cx:80,cy:80,type:".jpg"},BackgroundLargeThumbnail:{code:192,output:190,isThumb:true,cx:120,cy:120,type:".jpg"},
566BackgroundVeryLargeThumbnail:{code:193,output:190,isThumb:true,cx:200,cy:200,type:".jpg"},BackgroundSmallSize:{code:194,output:191,isThumb:false,cx:400,cy:400,type:".jpg"},
567BackgroundMediumSize:{code:195,output:191,isThumb:false,cx:580,cy:450,type:".jpg"},BackgroundLargeSize:{code:196,output:191,isThumb:false,cx:800,cy:630,type:".jpg"},
568BackgroundExtraLargeSize:{code:197,output:191,isThumb:false,cx:1100,cy:850,type:".jpg"},BackgroundXXLargeSize:{code:198,output:191,isThumb:false,cx:1550,cy:960,type:".jpg"},
569Video1080p:{code:200,output:150,isThumb:false,cx:1920,cy:1080,type:".mp4",format:"Full HD (1080p)"},Video720p:{code:210,output:150,isThumb:false,cx:1280,cy:720,type:".mp4",
570format:"Hi Def (720p)"},Video480p:{code:215,output:150,isThumb:false,cx:854,cy:480,type:".mp4",format:"Medium Def (Non-HD)"},Video360p:{code:220,output:150,isThumb:false,
571cx:640,cy:360,type:".mp4",format:"Web (Non-HD)"},VideoPosterFrame:{code:250,output:150,isThumb:false,cx:1920,cy:1080,type:".jpg"},VideoPosterFrameStrip:{code:260,
572output:150,isThumb:false,cx:200,cy:200,type:".jpg"},VideoXml:{code:271,output:0,isThumb:false,type:".xml"},CustomDesignCopyPng:{code:280,output:160,isThumb:false,
573type:".png"},PhotoMetadata:{code:1001,output:1,isThumb:false,type:".meta"}};zf_ProcessingMethod.fromCode=function(code){;var method=zf_ProcessingMethod[code];if(method!=null)return method;
574for(method in zf_ProcessingMethod){if(zf_ProcessingMethod[method].code==code){method=zf_ProcessingMethod[method];zf_ProcessingMethod[code]=method;return method;}};
575return null;};zf_ProcessingMethod.isScaled=function(method){var base=zf_ProcessingMethod.fromCode(method.code);return(base.cx!=method.cx||base.cy!=method.cy)&&!method.clip;};zf_ProcessingMethod.isClipped=function(method){var base=zf_ProcessingMethod.fromCode(method.code);
576return(base.cx!=method.cx||base.cy!=method.cy)&&method.clip;};(function(){var cutoutsMap={};
576cutoutsMap[zf_ProcessingMethod.StandardSmallThumbnail.code]=zf_ProcessingMethod.StandardSmallThumbnailPng;
577cutoutsMap[zf_ProcessingMethod.StandardThumbnail.code]=zf_ProcessingMethod.StandardThumbnailPng;cutoutsMap[zf_ProcessingMethod.StandardSmallSize.code]=zf_ProcessingMethod.StandardSmallSizePng;
578cutoutsMap[zf_ProcessingMethod.StandardMediumSize.code]=zf_ProcessingMethod.StandardMediumSizePng;cutoutsMap[zf_ProcessingMethod.StandardLargeSize.code]=zf_ProcessingMethod.StandardLargeSizePng;
579cutoutsMap[zf_ProcessingMethod.StandardExtraLargeSize.code]=zf_ProcessingMethod.StandardExtraLargeSizePng;cutoutsMap[zf_ProcessingMethod.StandardXXLargeSize.code]=zf_ProcessingMethod.StandardXXLargeSizePng;
580cutoutsMap[zf_ProcessingMethod.StandardLargeThumbnail.code]=zf_ProcessingMethod.StandardLargeThumbnailPng;cutoutsMap[zf_ProcessingMethod.StandardVeryLargeThumbnail.code]=zf_ProcessingMethod.StandardVeryLargeThumbnailPng;
581zf_ProcessingMethod.cutoutMethodsMap=cutoutsMap;var backgroundsMap={};backgroundsMap[zf_ProcessingMethod.StandardSmallThumbnail.code]=zf_ProcessingMethod.BackgroundSmallThumbnail;
582backgroundsMap[zf_ProcessingMethod.StandardThumbnail.code]=zf_ProcessingMethod.BackgroundThumbnail;backgroundsMap[zf_ProcessingMethod.StandardSmallSize.code]=zf_ProcessingMethod.BackgroundSmallSize;
583backgroundsMap[zf_ProcessingMethod.StandardMediumSize.code]=zf_ProcessingMethod.BackgroundMediumSize;backgroundsMap[zf_ProcessingMethod.StandardLargeSize.code]=zf_ProcessingMethod.BackgroundLargeSize;
584backgroundsMap[zf_ProcessingMethod.StandardExtraLargeSize.code]=zf_ProcessingMethod.BackgroundExtraLargeSize;backgroundsMap[zf_ProcessingMethod.StandardXXLargeSize.code]=zf_ProcessingMethod.BackgroundXXLargeSize;
585backgroundsMap[zf_ProcessingMethod.StandardLargeThumbnail.code]=zf_ProcessingMethod.BackgroundLargeThumbnail;backgroundsMap[zf_ProcessingMethod.StandardVeryLargeThumbnail.code]=zf_ProcessingMethod.BackgroundVeryLargeThumbnail;
586zf_ProcessingMethod.backgroundMethodsMap=backgroundsMap;})();;function zf_PhotoLoader(photo,method,modifier){this._uid=++zf_PhotoLoader._lastUid;this._photo=photo;this._method=method;
587this._retries=0;this._modifier=modifier;this._paused=false;this.state=!photo.isPlaceholder?zf_PhotoLoader.Initialized:zf_PhotoLoader.Complete;}zf_PhotoLoader.Initialized=0;zf_PhotoLoader.Loading=1;
588zf_PhotoLoader.Complete=2;zf_PhotoLoader.NotFound=-1;zf_PhotoLoader.AccessDenied=-2;zf_PhotoLoader.AuthRequired=-3;zf_PhotoLoader.PasswordRequired=-4;zf_PhotoLoader.Failed=-5;zf_PhotoLoader._lastUid=0;zf_PhotoLoader._active=0;zf_PhotoLoader._maxActive=60;zf_PhotoLoader._queue=[];
589zf_PhotoLoader._waitList={};zf_PhotoLoader._waitCount=0;zf_PhotoLoader._images=[];zf_PhotoLoader.pauseAll=function(){for(var i=0;i<zf_PhotoLoader._queue.length;i++){zf_PhotoLoader._queue[i]._paused=true;
590}};zf_PhotoLoader.resumeAll=function(){for(var i=0;i<zf_PhotoLoader._queue.length;i++){zf_PhotoLoader._queue[i]._paused=false;}zf_PhotoLoader._resumeLoading();};zf_PhotoLoader._resumeLoading=function(){var i,
591indices=[],loaders=[];for(i=0;(i<zf_PhotoLoader._queue.length)&&(zf_PhotoLoader._active<zf_PhotoLoader._maxActive);i++){var loader=zf_PhotoLoader._queue[i];if(!loader._paused){zf_PhotoLoader._active++;
592indices.push(i);loaders.push(loader);}}for(i=indices.length-1;i>=0;i--){zf_PhotoLoader._queue.splice(indices[i],1);}for(i=0;i<loaders.length;i++){loaders[i]._load();
593}};zf_PhotoLoader.prototype.start=function(){if(this.state==zf_PhotoLoader.Initialized){this.state=zf_PhotoLoader.Loading;this._image=new Image();this._push();}else if(this.state!=zf_PhotoLoader.Loading){;
594if(this.onload!=null)this.onload(this.state,this._src);}};zf_PhotoLoader.prototype.getPhoto=function(){return this._photo;};zf_PhotoLoader.prototype.getMethod=function(){return this._method;
595};zf_PhotoLoader.prototype.getModifier=function(){return this._modifier;};zf_PhotoLoader.prototype.getImageSize=function(){return this._size;};zf_PhotoLoader.prototype.setMethodSize=function(method){;;this._method=method;
596};zf_PhotoLoader.prototype._push=function(){if(zf_PhotoLoader._active<zf_PhotoLoader._maxActive){zf_PhotoLoader._active++;this._load();}else zf_PhotoLoader._queue.push(this);};
597zf_PhotoLoader.prototype._load=function(){var url=this._photo.getInternalUrl(this._method,{volume:this._volume,modifier:this._modifier});if(this._retries!=0){if(url.indexOf('?')!=-1)url+="&r="+this._retries;
598else url+="?r="+this._retries;}this._src=url;var self=this;;this._image.onload=function(){self._onLoad();};this._image.onerror=function(){self._onError();};setTimeout(function(){self._image.src=url;
599},1);};zf_PhotoLoader.prototype._done=function(){zf_PhotoLoader._active--;zf_PhotoLoader._resumeLoading();};zf_PhotoLoader.prototype._ready=function(response){if(response.state!=zf_PhotoLoader.Complete){this.state=response.state;
600if(this.onload!=null)this.onload(this.state,this._src);}else{this._volume=response.volume;this._push();}};zf_PhotoLoader.prototype._wait=function(){var photo=this._photo;var key=[photo.prefix,
601photo.id,photo.timestamp,photo.volume,this._method.code];if(photo.token!=null)key.push(photo.token);key=key.join('/');this._waitStart=$.now();var entry=zf_PhotoLoader._waitList[key];
602if(entry==null)zf_PhotoLoader._waitList[key]=this;else if(entry instanceof Array)entry.push(this);else zf_PhotoLoader._waitList[key]=[entry,this];if(zf_PhotoLoader._waitCount++==0)window.setTimeout(zf_PhotoLoader._check,
6033000);};zf_PhotoLoader._check=function(){var list=[],keys=[];for(var key in zf_PhotoLoader._waitList){var entry=zf_PhotoLoader._waitList[key],wait=(entry instanceof Array)?entry[0]._waitStart:entry._waitStart;
604keys.push(key);key=key.split('/');list.push({type:key[0],photoId:parseInt(key[1],10),timestamp:key[2],volume:key[3],method:p
604arseInt(key[4],10),token:key.length>5?key[5]:null,
605ownerId:typeof zf_ownerId!=="undefined"?zf_ownerId:zf_userId,wait:Math.floor(wait/1000)});}if(list.length==0)return;var self=this;zf_stdServerRequestEx("POST","/zf/core/core.asmx",
606"GetImageState",[list],function(result,error){if(error!=null)return;for(var i=0;i<result.length;i++){if(result[i].state==zf_PhotoLoader.Loading)continue;var key=keys[i],
607loader=zf_PhotoLoader._waitList[key];if(loader instanceof Array){for(var k=0;k<loader.length;k++)loader[k]._ready(result[i]);zf_PhotoLoader._waitCount-=loader.length;
608}else if(loader!=null){loader._ready(result[i]);--zf_PhotoLoader._waitCount;}delete zf_PhotoLoader._waitList[key];}if(zf_PhotoLoader._waitCount>0)window.setTimeout(zf_PhotoLoader._check,
6093000);});};zf_PhotoLoader.prototype._onLoad=function(){this._image.onload=null;this._image.onerror=null;this._done();this.state=zf_PhotoLoader.Complete;this._size={cx:this._image.width,
610cy:this._image.height};if(!this._method.isThumb){if(zf_PhotoLoader._images.length>50)zf_PhotoLoader._images.shift();zf_PhotoLoader._images.push(this._image);}this._image=null;
611if(this.onload!=null)this.onload(this.state,this._src);};zf_PhotoLoader.prototype._onError=function(){this._done();this._retries++;this._wait();zf_showDebugMessage("Error loading image: "+this._src);
612if(window.waitingNotice&&window.waitingNotice._failedImages[this._src]==undefined){window.waitingNotice._failedImages.push(this._src);}};;;;function zf_PhotoView(id,plugins,
613context,view){this.id=id;this.waitTimeout=3000;this.context=zf_PhotoView.EMPTY_CONTEXT;this._special=null;this._plugins=plugins!=null?[].concat(plugins):[];if(view==null)view=this.dom();
614zf_stdSetClientObject(view,this);this._completeInit(context,view);}zf_PhotoView.inherits(zf_Control);zf_PhotoView.EMPTY_CONTEXT={_i_d_:"zf_PhotoView.EMPTY_CONTEXT"};zf_PhotoView.createHtml=function(id,
615href,styles,plugins,context,photo,method,burnable,x,y){;styles=styles!=null?[].concat(styles):[];if(photo!=null&&photo.isPlaceholder)styles.push("pv-s-"+photo.placeholderId);
616styles=styles.concat(zf_PhotoView._getVideoStyles(photo));var smap={};for(var i=0;i<styles.length;i++)smap[styles[i]]=true;var markup=zf_PhotoView._createInnerHtml(id,
617href,plugins,smap,context,photo,method,burnable);var viewStyle="";if(x!=null&&y!=null){viewStyle=[' style="left:',x,'px;top:',y,'px;visibility:inherit;"'].join("");
618}styles=["pv"].concat(styles);styles.sort();styles=styles.join(" ");return['<div class="',styles,'" id="',id,'" ',viewStyle,'>',markup,'</div>'].join("");};zf_PhotoView.prototype.reinit=function(view,
619href,styles,context,photo,method,burnable,x,y){;if(this.context!==zf_PhotoView.EMPTY_CONTEXT)this.detachContext(this.context);styles=styles!=null?[].concat(styles):[];
620if(photo!=null&&photo.isPlaceholder)styles.push("pv-s-"+photo.placeholderId);styles=styles.concat(zf_PhotoView._getVideoStyles(photo));var smap={};for(var i=0;i<styles.length;
621i++)smap[styles[i]]=true;var markup=zf_PhotoView._createInnerHtml(this.id,href,this._plugins,smap,context,photo,method,burnable);var viewStyle="";if(x!=null&&y!=null){viewStyle=['left:',
622x,'px;top:',y,'px;visibility:inherit;'].join("");}styles=["pv"].concat(styles);styles.sort();styles=styles.join(" ");if(view==null)view=this.dom();if(view.className!=styles)view.className=styles;
623if(view.style.cssText!=viewStyle)view.style.cssText=viewStyle;if(this._loader!=null){this._loader.onload=null;this._loader=null;}if(this._waitTimer!=null){window.clearTimeout(this._waitTimer);
624this._waitTimer=null;}this._photo=photo;this._method=method;view.innerHTML=markup;this._completeInit(context,view);};zf_PhotoView.prototype.resize=function(context,photo,method){;
625;;this._method=method;if(!photo.isPlaceholder||photo.placeholderId==0)this._resize(photo,method);var image=this.dom("img");var inner=image.parentNode;var outer=inner.parentNode;
626var view=outer.parentNode;for(var i=0;i<this._plugins.length;i++){var plugin=this._plugins[i];if(plugin.onResizeDom!=null)plugin.onResizeDom(view,outer,inner,context,
627false);}};zf_PhotoView.prototype.load=function(photo,method,noresize){;var self=this;if(this._loader!=null)this._loader.onload=null;var loader;if(photo instanceof zf_PhotoLoader){loader=photo;
628photo=loader.getPhoto();method=loader.getMethod();}else loader=new zf_PhotoLoader(photo,method);this._loader=loader;this._photo=photo;this._method=method;loader.onload=this.closure(this._onLoad,
629photo,method);this.setSpecial(null,true);this.$dom().removeClass('pv-ready');this.$dom().toggleClass("pv-video",photo.video);if(photo.video){this.dom("img").style.cssText="";
630var special=zf_PhotoView._getSpecialVideoStyle(photo);if(special!=null)this.setSpecial(special,true);}if(!noresize){if(photo.isPlaceholder)this.setSpecial(photo.placeholderId.toString());
631else this._resize(photo,method);}loader.start();if(loader.state==zf_PhotoLoader.Loading){if(this._waitTimer!=null)window.clearTimeout(this._waitTimer);this._waitTimer=window.setTimeout(function(){if(self._waitTimer!=null){if(!photo.video||(photo.flags&zf_PhotoFlags.VideoReady))self.setSpecial("wait",
632true);if(self.onwait)self.onwait();}},this.waitTimeout);}};zf_PhotoView.prototype.clear=function(){;this.setSpecial(null);var image=this.dom("img");var inner=image.parentNode;
633image.style.cssText="";inner.style.cssText="";if(this._loader!=null){this._loader.onload=null;this._loader=null;}if(this._waitTimer!=null){window.clearTimeout(this._waitTimer);
634this._waitTimer=null;}this.$dom().find(".pv-p").empty();this._photo=null;this._method=null;};zf_PhotoView.prototype.attachContext=function(context){this._attachContext(context,
635false);};zf_PhotoView.prototype._attachContext=function(context,isNew){;;;this.context=context;var image=this.dom("img");var inner=image.parentNode;var outer=inner.parentNode;
636var view=outer.parentNode;for(var i=0;i<this._plugins.length;i++){var plugin=this._plugins[i];if(plugin.onCreateDom!=null)plugin.onCreateDom(view,outer,inner,context,
637isNew);}};zf_PhotoView.prototype.detachContext=function(context,view){;;var inner=null;var outer=null;for(var i=0;i<this._plugins.length;i++){var plugin=this._plugins[i];if(plugin.onDestroyDom!=null){if(view==null)view=this.dom();
638if(outer==null){var $outer=$(view).children(".pv-outer:first");;outer=$outer.get(0);if(outer==null)continue;var $inner=$outer.children(".pv-inner:first");;inner=$inner.get(0);
639}plugin.onDestroyDom(view,outer,inner,context);}}this.context=zf_PhotoView.EMPTY_CONTEXT;};zf_PhotoView.prototype.setStyle=function(styles,view){;styles=(styles!=null?["pv"].concat(styles):["pv"]);
640styles.sort();styles=styles.join(" ");if(view!=null)view=this.dom();if(view.className!=styles)view.className=styles;};zf_PhotoView.prototype.setLink=function(href){;var inner=this.dom("img").parentNode;
641if(href==null){inner.removeAttribute("href");inner.onclick=zf_stdFalse;}else{inner.href=href;inner.onclick=zf_stdTrue;}};zf_PhotoView.prototype.setSpecial=function(style,noclear){;
642var view=document.getElementById(this.id);var update=false;var styles=view.className.split(" ");for(var i=styles.length-1;i>=0;i--){if(styles[i].indexOf("pv-s-")==0)styles.splice(i,
6431);}var photo=this._photo;var method=this._method;if(style!=null){styles.push("pv-s-"+style);photo=null;method=null;}var className=styles.join(" ");if(view.className!=className)view.className=className;
644if(this._special==style)return;this._special=style;if(!noclear){var context=this.context;if(context!==zf_PhotoView.EMPTY_CONTEXT)this.detachContext(context);var inner=this.dom("img").parentNode;
645var smap={};for(i=0;i<styles.length;i++)smap[styles[i]]=true;var markup=zf_PhotoView._createInnerHtml(this.id,inner.href,this._plugins,smap,context,photo,method,
646false);view.innerHTML=markup;this._completeInit(context,view);}};zf_PhotoView.prototype.getInner=function(){return this.dom("img").parentNode;};zf_PhotoView.prototype.getPhoto=function(){if(this._loader!=null)return this._loader.getPhoto();
647return this._photo;};zf_PhotoView.prototype.addPlugin=function(plugin){;;this._plugins.push(plugin);var image=this.dom("img");var inner=image.parentNode;var outer=inner.parentNode;
648var view=outer.parentNode;var smap={};var styles=view.className.split(' ');$.each(styles,function(i,v){smap[v]=true;});var ihtml=null;var ohtml=null;if(plugin.getOuterContent)ohtml=plugin.getOuterContent(this.id,
649this.context,smap);if(plugin.getInnerContent)ihtml=plugin.getInnerContent(this.id,this.context,smap);if(ohtml)$(inner).before(ohtml);if(ihtml)$(inner).append(ihtml);
650if(plugin.onCreateDom)plugin.onCreateDom(view,outer,inner,this.context,true);};zf_PhotoView.prototype.removePlugin=function(plugin){;;var index=-1;for(var j=0;j<=this._plugins.length;
651j++){if(this._plugins[j]===plugin){index=j;break;}};this._plugins.splice(index,1);var image=this.dom("img");var inner=image.parentNode;var outer=inner.parentNode;
652var view=outer.parentNode;if(plugin.onDestroyDom)plugin.onDestroyDom(view,outer,inner,this.context);if(plugin.removeOuterContent)plugin.removeOuterContent(view,outer,
653inner,this.context);if(plugin.removeInnerContent)plugin.removeInnerContent(view,outer,inner,this.context);};zf_PhotoView.prototype.getMethod=function(){return this._method;};
654zf_PhotoView._createInnerHtml=function(id,href,plugins,smap,context,photo,method,burnable){;if(plugins==null)plugins=[];var inner=[];var outer=[];for(var i=0;i<plugins.length;
655i++){var plugin=plugins[i];if(plugin.getOuterContent!=null)outer.push(plugin.getOuterContent(id,context,smap));if(plugin.getInnerContent!=null)inner.push(plugin.getInnerContent(id,
656context,smap));}href=(href!=null&&href!="")?[' href="',href,'"'].join(""):"";var innerStyle="";var imgStyle="";var imgSrc='/zf/img/null.gif';
656if(zf_stdAllowCdnHost())imgSrc=zf_stdGetProtocol(zf_cdnHost)+zf_cdnHost+imgSrc;
657var canResizeBg=('backgroundSize' in document.body.style);var innerFlex='';if(photo!=null&&method!=null&&!photo.isPlaceholder){var size=photo.getScaledSize(method);
658var innerLeft=(method.cx-size.cx)/2;var innerTop=(method.cy-size.cy)/2;if(zf_ProcessingMethod.isClipped(method)&&method.cx===method.cy){innerStyle=[' style="left:0px;top:0px;width:',
659method.cx,'px;height:',method.cy,'px;"'].join("");}else{innerStyle=[' style="left:',innerLeft,'px;top:',innerTop,'px;width:',size.cx,'px;height:',size.cy,'px;"'].join("");
660}if(burnable){var src=photo.getInternalUrl(method,{block:true});if(zf_ProcessingMethod.isScaled(method)){if(method.positioning=='flex'){imgSrc=src;imgStyle=['width:',
661size.cx,'px; height:',size.cy,'px;'].join("");innerFlex=' pv-inner-flex';}else if(!canResizeBg){imgSrc=src;imgStyle=[' width="',size.cx,'" height="',size.cy,'"'].join("");
662}else{imgStyle=[' width="',size.cx,'" height="',size.cy,'" style="background-image:url(',src,'); ','background-size: ',size.cx,'px ',size.cy,'px"'].join("");}}else if(zf_ProcessingMethod.isClipped(method)){var pos=zf_PhotoView._getClippingPosition(photo,
663method);var sz=zf_PhotoView._getStretchedSize(photo,method);if(method.positioning=='flex'){imgSrc=src;imgStyle=['width:',sz.cx,'px; height:',sz.cy,'px;'].join("");
664innerFlex=' pv-inner-flex pv-inner-flex-'+(sz.cy>size.cy?'row':'column');}else if(!canResizeBg){imgSrc=src;imgStyle=[' width="',sz.cx,'" height="',sz.cy,'" style="left:',
665pos.left,'px;top:',pos.top,'px;"'].join("");}else{imgStyle=[' width="',size.cx,'" height="',size.cy,'" style="background-image:url(',src,'); ','background-position: ',
666pos.left,'px ',pos.top,'px; ','background-size: ',sz.cx,'px ',sz.cy,'px"'].join("");}}else{imgStyle=[' width="',size.cx,'" height="',size.cy,'" style="background-image:url(',
667src,');"'].join("");}}}var archiveInner='<div style="position: absolute;background-color: #f8f8f8;height:100%;width:100%;"></div><img class="pv-archive" src="/zf/img/archived.svg">';
668if(typeof context!="undefined"&&context!=null){if(typeof context.data!="undefined"){var self=this;var loadArchivedCover=function(){var handler=function(result,error){var pvImgElm=document.getElementById(id+'-img');
669if(error==null&&result){if(context.data.access.type=="Password"){this.prototype.id=id;this.prototype.setSpecial("password");}else{pvImgElm.src=result;pvImgElm.style.objectFit="cover";
670pvImgElm.style.backgroundImage="none";pvImgElm.onerror=function(e){errorHandler(pvImgElm);};}}else{errorHandler(pvImgElm);}};var errorHandler=function(imgElm){imgElm.style="background-color: #f8f8f8;";
671imgElm.insertAdjacentHTML('afterend',archiveInner);};zf_stdServerRequestEx("GET","/zf/layout/layout.asmx","GetArchivedCoverPhoto",[context.data.access.ownerId,context.data.id],
672handler.bind(self));};if(context.data.isArchive===true){loadArchivedCover();}else if(typeof context.data.isArchive=="undefined"){var retryCount=0;var maxRetries=10;
673var retryInterval=500;var timerId=0;var checkArchive=function(){if(!document.getElementById(id+'-img')){clearTimeout(timerId);return;}if(context.data.isArchive===true){loadArchivedCover();
674}else if(typeof context.data.isArchive=="undefined"&&retryCount<maxRetries){retryCount++;timerId=setTimeout(checkArchive,retryInterval);}};timerId=setTimeout(checkArchive,
675retryInterval);}}}return['<div class="pv-outer">',outer.join(""),'<a class="pv-inner',innerFlex,'"',href,innerStyle,'>','<img class="pv-img" id="',id,'-img"',imgStyle,
676' src="',imgSrc,'" />',inner.join(""),'</a>','</div>'].join("");};zf_PhotoView.prototype._completeInit=function(context,view){;var viewId=view.id;view=$(view);var outer=view.find('.pv-outer:first');
677var inner=outer.find('.pv-inner:first');var self=this;if(inner.is('A')&&inner.attr('href')==null)inner.click(function(e){e.preventDefault();});outer.hover(function(){$('#'+viewId).addClass('pv-ohover');
678},function(){$('#'+viewId).removeClass('pv-ohover');});inner.hover(function(){$('#'+viewId).addClass('pv-ihover');},function(){$('#'+viewId).removeClass('pv-ihover');
679});this._attachContext(context,true);outer=null;inner=null;view=null;};zf_PhotoView.prototype._onLoad=function(state,src,photo){;if(this._waitTimer!=null){window.clearTimeout(this._waitTimer);
680this._waitTimer=null;}var method=this._method;if(this.onload){if(this.onload(state))return;}switch(state){case zf_PhotoLoader.Complete:if(!photo.isPlaceholder){if(photo.video)photo.flags|=zf_PhotoFlags.VideoReady;
681this.setSpecial(null);var image=this._setImage(src,photo,method,this._loader.getImageSize());this.$dom().addClass('pv-ready');}else this.setSpecial(photo.placeholderId.toString());
682break;case zf_PhotoLoader.NotFound:this.setSpecial("notfound");break;case zf_PhotoLoader.AccessDenied:case zf_PhotoLoader.AuthRequired:this.setSpecial("noaccess");
683break;case zf_PhotoLoader.PasswordRequired:this.setSpecial("password");break;case zf_PhotoLoader.Failed:default:this.setSpecial(photo.video?"":"failed",true);break;
684}};zf_PhotoView.prototype._setImage=function(src,photo,method,imageSize){;var image=this.dom("img"),style=image.style;var size=photo.getScaledSize(method),canResizeBg=('backgroundSize' in document.body.style);
685if(zf_ProcessingMethod.isScaled(method)){if(method.positioning=='flex'){style.width=size.cx+'px';style.height=size.cy+'px';image.src=src;$(image).closest('.pv-inner').addClass('pv-inner-flex');
686}else if(canResizeBg){style.backgroundImage="url("+src+")";style.backgroundSize=[size.cx,'px ',size.cy,'px'].join("");}else{style.width=size.cx+'px';style.height=size.cy+'px';
687image.src=src;}image.width=size.cx;image.height=size.cy;}else if(zf_ProcessingMethod.isClipped(method)){var pos=zf_PhotoView._getClippingPosition(photo,method),sz=zf_PhotoView._getStretchedSize(photo,
688method);if(method.positioning=='flex'){style.width=sz.cx+'px';style.height=sz.cy+'px';image.src=src;$(image).closest('.pv-inner').addClass('pv-inner-flex').toggleClass('pv-inner-flex-row',
689sz.cy>size.cy).toggleClass('pv-inner-flex-column',sz.cy<=size.cy);}else if(canResizeBg){style.backgroundImage="url("+src+")";style.backgroundPosition=[pos.left,'px ',
690pos.top,'px'].join("");style.backgroundSize=[sz.cx,'px ',sz.cy,'px'].join("");image.width=size.cx;image.height=size.cy;}else{style.width=sz.cx+'px';style.height=sz.cy+'px';
691style.left=pos.left+'px';style.top=pos.top+'px';image.src=src;image.width=sz.cx;image.height=sz.cy;}}else if(size.cx!=imageSize.cx||size.cy!=imageSize.cy){if(canResizeBg){image.style.backgroundImage="url("+src+")";
692image.style.backgroundSize=[size.cx,'px ',size.cy,'px'].join("");}else{style.width=size.cx+'px';style.height=size.cy+'px';image.src=src;}image.width=size.cx;image.height=size.cy;
693}else style.backgroundImage="url("+src+")";return image;};zf_PhotoView.prototype._resize=function(photo,method){;var image=this.dom("img");var inner=image.parentNode;var canResizeBg=('backgroundSize' in document.body.style);
694var size=photo.getScaledSize(method);var x=(method.cx-size.cx)/2;var y=(method.cy-size.cy)/2;inner.style.left=x+"px";inner.style.top=y+"px";inner.style.width=size.cx+"px";
695inner.style.height=size.cy+"px";if(zf_ProcessingMethod.isScaled(method)){if(method.positioning=='flex'){image.style.width=size.cx+'px';image.style.height=size.cy+'px';
696$(image).closest('.pv-inner').addClass('pv-inner-flex');}else if(canResizeBg){image.style.backgroundSize=[size.cx,'px ',size.cy,'px'].join("");}else{image.style.width=size.cx+'px';
697image.style.height=size.cy+'px';}}else if(zf_ProcessingMethod.isClipped(method)){var pos=zf_PhotoView._getClippingPosition(photo,method);var sz=zf_PhotoView._getStretchedSize(photo,
698method);if(method.positioning=='flex'){image.style.width=sz.cx+'px';image.style.height=sz.cy+'px';$(image).closest('.pv-inner').addClass('pv-inner-flex').toggleClass('pv-inner-flex-row',
699sz.cy>size.cy).toggleClass('pv-inner-flex-column',sz.cy<=size.cy);}else if(canResizeBg){image.style.backgroundPosition=[pos.left,'px ',pos.top,'px'].join("");image.style.backgroundSize=[sz.cx,
700'px ',sz.cy,'px'].join("");}else{image.style.width=sz.cx+'px';image.style.height=sz.cy+'px';image.style.left=pos.left+'px';image.style.top=pos.top+'px';}}};zf_PhotoView._getSpecialVideoStyle=function(photo){;
701;;if(!(photo.flags&zf_PhotoFlags.VideoReady))return "vwait";return null;};zf_PhotoView._getVideoStyles=function(photo){;var styles=[];if(!photo||!photo.video)return styles;styles.push("pv-video");
702var special=zf_PhotoView._getSpecialVideoStyle(photo);if(special!=null)styles.push("pv-s-"+special);return styles;};zf_PhotoView._getClippingPosition=function(photo,method){;
703var csize=method,bsize=zf_PhotoView._getStretchedSize(photo,method),anchor=method.anchor;anchor=anchor||{x:0.5,y:(photo.width>=photo.height?0.5:0.2)};return{left:Math.min(Math.floor((csize.cx-bsize.cx)*anchor.x),
7040),top:Math.min(Math.floor((csize.cy-bsize.cy)*anchor.y),0)};};zf_PhotoView._getStretchedSize=function(photo,method){var size=photo.getScaledSize(zf_ProcessingMethod.fromCode(method.code));
705if(!method.stretch)return size;else if(size.cx/size.cy<method.cx/method.cy){var width=Math.min(method.cx,size.cx*10);return{cx:width,cy:Math.round(width/size.cx*size.cy)};
706}else{var height=Math.min(method.cy,size.cy*10);return{cx:Math.round(height/size.cy*size.cx),cy:height};}};;function zf_PhotoGrid(id,flags){zf_Control.prototype.constructor.call(this,
707id);this._selectionMode=flags&0x03;this._dragDropMode=flags&0x04;this._easyMultiSelect=this._selectionMode==zf_PhotoGrid.Multiple&&!!(flags&0x08);this._items=[];
708this._views=[];this._selected={};this._pendingSelect={};this._left=0;this._height=-1;this._pageIndex=0;this._anchorIndex=-1;this._firstVisible=0;this._lastVisible=0;
709this._lastUid=0;this._dragTrack={};this._dragDistance=5;this._layout=new zf_PhotoGrid.FixedCellLayout();this._layout.init(this);}zf_PhotoGrid.inherits(zf_Control);zf_PhotoGrid.None=0x00;
710zf_PhotoGrid.Single=0x01;zf_PhotoGrid.SingleForced=0x02;zf_PhotoGrid.Multiple=0x03;zf_PhotoGrid.KeepVisible=0x01;zf_PhotoGrid.EasyMultiSelect=0x08;zf_PhotoGrid.Drag={None:0,Left:1,Right:2,Top:3,Bottom:4,Horizontal:5,Vertical:6,All:7};
711zf_PhotoGrid._nullPhoto=new zf_PlaceholderImage(0);zf_PhotoGrid.prototype.init=function(plugins,layout){this._plugins=[].concat(plugins||[]);layout&&(this._layout=layout).init(this);var self=this,
712node=this.dom();if(this._selectionMode!=zf_PhotoGrid.None){node.onmousedown=function(e){self._onGridClick(e);return false;};}node.ondblclick=zf_stdFalse;node=null;
713};zf_PhotoGrid.prototype.setSelectionMode=function(mode){this._selectionMode=mode;};zf_PhotoGrid.prototype.setEasyMultiSelect=function(mode){this._easyMultiSelect=mode;};zf_PhotoGrid.prototype.getLayoutInfo=function(flags){if(flags==null)flags=zf_PhotoGrid.None;
714;;return this._layout.getLayoutInfo(flags);};zf_PhotoGrid.prototype.recalcLayout=function(info){this._info=info=$.extend({},info||this.getLayoutInfo());;this._pageIndex=info.currentPage;
715if(this._anchorIndex==-1)this._anchorIndex=info.firstVisible;var height=info.height;if(this._height==-1&&height==0)height="auto";else height+="px";var grid=this.dom();
716if(grid.style.height!=height)grid.style.height=height;var first=info.firstVisible;var last=info.lastVisible;if(this.onlayoutchange!=null&&(this._firstVisible!=first||this._lastVisible!=last)){zf_stdDeferCall(this.id+".onlayoutchange",
717this.onlayoutchange,this,info);}for(var i=first;i<last;i++){if(this._items[i]==null)this.onqueryitem(i);}for(i=this._firstVisible;i<this._lastVisible;i++){var item=this._items[i];
718if(item!=null&&item.visible&&(i<first||i>=last))this._destroyDom(item);}this._firstVisible=first;this._lastVisible=last;this._left=(info.width-info.usedWidth)/2;
719for(i=first;i<last;i++){item=this._items[i];if(item!=null){if(item._view==null)this._createDom(item);else this._showItem(i,item);}}var self=this;window.setTimeout(function(){self._trimPool();
720},5000);$(grid).toggleClass('pg-empty',this._items.length==0);grid=null;return info;};zf_PhotoGrid.prototype.clear=function(){for(var id in this._items){var item=this._items[id];
721if(item._view!=null)this._destroyDom(item);}this._items=[];this._selected={};this._anchor=null;this._pageIndex=0;this._firstVisible=0;this._lastVisible=0;this._layout.clear();
722var self=this;window.setTimeout(function(){self._trimPool();},5000);};zf_PhotoGrid.prototype.getCellSize=function(){return this._layout.getCellSize();};zf_PhotoGrid.prototype.setHeight=function(cy){if(cy==null)cy=-1;
723this._height=cy;};zf_PhotoGrid.prototype.setSize=function(count){;var length=this._items.length;if(count<length){this._deleteItems(count,length);}else if(count>length){this._items=this._items.concat(new Array(count-length));
724}};zf_PhotoGrid.prototype.getSize=function(){return this._items.length;};zf_PhotoGrid.prototype.setPage=function(page){;if(page!=this._pageIndex){;this._pageIndex=page;this._anchorIndex=-1;
725}};zf_PhotoGrid.prototype.getPage=function(){return this._pageIndex;};zf_PhotoGrid.prototype.setItem=function(index,id,href,photo,method,burnable,styles,context){;if(photo==null)photo=zf_PhotoGrid._nullPhoto;
726styles=styles!=null?[].concat(styles):[];var item=this._items[index];if(item!=null){if(item._view!=null)item._view.detachContext(item.context);delete this._items[item.id];
727this._items[id]=item;if(item.selected){delete this._selected[item.id];this._selected[id]=item;}item.id=id;item.href=href;item.photo=photo;item.method=method;item.burnable=burnable;
728item.styles=styles;item.context=context;styles=[].concat(styles);if(item.selected)styles.push("pg-selected");if(item._view!=null){item._view.reinit(null,href,styles,
729context,item.photo,item.method,item.burnable,item._rect.left,item._rect.top);if(!item.burnable)item._view.load(photo,method,true);item._method=method;}}
729else{item={id:id,
730index:index,href:href,photo:photo,method:method,burnable:burnable,styles:styles,context:context,_grid:this,_view:null};if(this._pendingSelect[index]){this._selectItem(item);
731delete this._pendingSelect[index];}this._items[index]=item;this._items[id]=item;}return item;};zf_PhotoGrid.prototype.getItem=function(index){return this._items[index];};zf_PhotoGrid.prototype.getItemRect=function(index){if(typeof(index)=="string")index=this._items[index];
732if(typeof(index)=="object")index=index.index;return this._layout.getItemRect(this._info,index);};zf_PhotoGrid.prototype.getPhotoView=function(item){if(typeof(item)!="object")item=this._items[item];
733return item!=null?item._view:null;};zf_PhotoGrid.prototype.getLastVisiblePhotoView=function(){return this.getPhotoView(this._lastVisible-1);};zf_PhotoGrid.prototype.getItemPage=function(index){if(typeof(index)=="string"){var item=this._items[index];
734if(item==null)return 0;index=item.index;}else if(typeof(index)=="object"){if(index==null)return 0;index=index.index;}return Math.floor(index/this.getLayoutInfo().itemsPerPage);
735};zf_PhotoGrid.prototype.getSelectedItem=function(){for(var id in this._selected)return this._selected[id];return null;};zf_PhotoGrid.prototype.getSelectedItems=function(){var items=[];
736for(var id in this._selected)items.push(this._selected[id]);return items;};zf_PhotoGrid.prototype.getItems=function(){return this._items;};zf_PhotoGrid.prototype.getSelectedIndices=function(){var indices=[];
737for(var id in this._selected)indices.push(this._selected[id].index);for(var idx in this._pendingSelect)indices.push(parseInt(idx,10));return indices;};zf_PhotoGrid.prototype.deleteItem=function(index){var item;
738if(typeof(index)=="string"){item=this._items[index];if(item==null)return;index=item.index;}else if(typeof(index)=="object"){item=index;index=item.index;}this._deleteItems(index,
739index+1);for(var i=index;i<this._items.length;i++){item=this._items[i];if(item!=null)item.index=i;}};zf_PhotoGrid.prototype.updateItem=function(item,context){;if(typeof(item)!="object")item=this.getItem(item);
740if(item!=null){if(item._view!=null){item._view.detachContext(item.context);item._view.attachContext(context);}item.context=context;}};zf_PhotoGrid.prototype.toggleDragDrop=function(condition){this._dragDropMode=condition==true;
741};zf_PhotoGrid.prototype.lockSelection=function(lock){this._selectionLocked=lock;};zf_PhotoGrid.prototype.addPlugin=function(plugin){;this._plugins.push(plugin);this._trimPool(0);for(var i=0;
742i<this._items.length;i++){var item=this._items[i];if(item&&item._view)item._view.addPlugin(plugin);}};zf_PhotoGrid.prototype.removePlugin=function(plugin){;var index=-1;for(var j=0;
743j<=this._plugins.length;j++){if(this._plugins[j]===plugin){index=j;break;}};this._plugins.splice(index,1);this._trimPool(0);for(var i=0;i<this._items.length;i++){var item=this._items[i];
744if(item&&item._view)item._view.removePlugin(plugin);}};zf_PhotoGrid.prototype.getViewPort=function(){function scrollParent(x){var position=x.css("position"),excludeStaticParent=position==="absolute",
745overflowRegex=/(auto|scroll)/,sp=x.parents().filter(function(){var parent=$(this);if(excludeStaticParent&&parent.css("position")==="static"){return false;}return overflowRegex.test(parent.css("overflow")+parent.css("overflow-y")+parent.css("overflow-x"));
746}).eq(0);
746return position==="fixed"||!sp.length?$(document):sp;}var grid=this.$(),parent=scrollParent(grid),offset=parent.offset()||{top:0,left:0},top=offset.top-grid.offset().top;
747if(parent.is('BODY'))parent=$(window);top+=parent.scrollTop();var bottom=top+parent.height();return{top:Math.max(0,top),bottom:bottom};};zf_PhotoGrid.prototype._createDom=function(item){var styles=[].concat(item.styles);
748if(item.selected)styles.push("pg-selected");var rect=this._layout.getItemRect(this._info,item.index),x=rect.left,y=rect.top;item._rect=rect;var self=this;var view;
749var viewNode;var onmousedown=function(e){self._item_onmousedown(e,this,item);};var onmouseup=function(e){self._item_onmouseup(e,this,item);};if(this._views.length>0){view=this._views.pop();
750viewNode=view.dom();if(this._selectionMode!=zf_PhotoGrid.None){viewNode.onmousedown=onmousedown;viewNode.onmouseup=onmouseup;}view.reinit(viewNode,item.href,styles,
751item.context,item.photo,item.method,item.burnable,x,y);item._view=view;item._method=item.method;}else{var viewId=[this.id,"_i",++this._lastUid].join("");var html=zf_PhotoView.createHtml(viewId,
752item.href,styles,this._plugins,item.context,item.photo,item.method,item.burnable,x,y);var grid=document.getElementById(this.id);var node=document.createElement("DIV");
753node.innerHTML=html;grid.appendChild(node.removeChild(node.firstChild));viewNode=grid.lastChild;grid=null;node=null;viewNode.ondblclick=zf_stdFalse;if(this._selectionMode!=zf_PhotoGrid.None){viewNode.onmousedown=onmousedown;
754viewNode.onmouseup=onmouseup;}if(item.context&&item.context.data){item.context.data.image=item.photo;}item._view=new zf_PhotoView(viewId,this._plugins,item.context,
755viewNode);item._method=item.method;}item.visible=true;viewNode=null;if(!item.burnable)item._view.load(item.photo,item.method,true);};zf_PhotoGrid.prototype._destroyDom=function(item){var view=item._view;
756item._view=null;item._rect=null;item.visible=false;var viewNode=view.dom();view.detachContext(item.context,viewNode);viewNode.style.cssText='';viewNode.onmousedown=null;
757viewNode.onmousemove=null;viewNode.onmouseup=null;if(this._views.length<256)this._views.push(view);else viewNode.parentNode.removeChild(viewNode);};zf_PhotoGrid.prototype._trimPool=function(capacity){if(capacity==undefined)capacity=64;
758if(this._views.length>capacity){var extra=this._views.splice(capacity,this._views.length-capacity);for(var i=0;i<extra.length;i++){var node=document.getElementById(extra[i].id);
759node.parentNode.removeChild(node);}}};zf_PhotoGrid.prototype._showItem=function(index,item){var rect=this._layout.getItemRect(this._info,index),method=item._method;if(method!=null&&(method.cx!=item.method.cx||method.cy!=item.method.cy)){item._view.resize(item.context,
760item.photo,item.method);item._method=item.method;if(!item.photo.isPlaceholder&&method.code!=item.method.code)item._view.load(item.photo,item.method,true);}if(item._rect.left!=rect.left||item._rect.top!=rect.top){var node=item._view.dom();
761node.style.left=rect.left+"px";node.style.top=rect.top+"px";node.style.visibility="inherit";}item._rect=rect;item.visible=true;};zf_PhotoGrid.prototype._hideItem=function(index,
762item){if(item._rect!=null){var node=item._view.dom();node.style.visibility="hidden";item._rect=null;item.visible=false;}};zf_PhotoGrid.prototype._item_onmousedown=function(e,
763node,item){;;e=zf_stdGetEvent(e);zf_stdStopPropagation(e);zf_stdPreventDefault(e);if(zf_stdIsLeftButton(e))this._clickSelect(e,node,item,true);if(this._dragInfo!=null){this._dragStop();
764}else if(zf_stdIsLeftButton(e)&&this._dragDropMode!=zf_PhotoGrid.None){var self=this;this._dragInfo={dropIndex:-1,anchorX:e.clientX,anchorY:e.clientY,baseX:item._rect.left,
765baseY:item._rect.top,lastScroll:new Date().getTime()};node.onmousemove=function(e){self._item_onmousemove(e,item);};node.ondragstart=function(e){return false;};node.onselectstart=function(e){return false;
766};if(node.setCapture)node.setCapture(false);else if(document.addEventListener){document.addEventListener("mousemove",node.onmousemove,true);document.addEventListener("mouseup",
767node.onmouseup,true);}}node=null;e=null;};zf_PhotoGrid.prototype.itemTouchHandler=function(e,direction){if(!direction||direction===zf_PhotoGrid.Drag.None){return;}var touches=e.originalEvent.changedTouches,
768first=touches[0],type='';switch(e.type){case 'touchstart':if(direction===zf_PhotoGrid.Drag.All){this._dragTrack={type:'drag'};
768type='mousemove';}else{this._dragTrack={type:'unknown',
769screenx:first.screenX,screeny:first.screenY,clientx:first.clientX,clienty:first.clientY};}break;case 'touchmove':if(this._dragTrack.type==='drag'){type='mousemove';
770}else if(this._dragTrack.type==='unknown'){var dragdelta=0,scrolldelta=0;switch(direction){case zf_PhotoGrid.Drag.Left:dragdelta=this._dragTrack.screenx-first.screenX;
771scrolldelta=Math.abs(this._dragTrack.screeny-first.screenY);break;case zf_PhotoGrid.Drag.Right:dragdelta=first.screenX-this._dragTrack.screenx;scrolldelta=Math.abs(this._dragTrack.screeny-first.screenY);
772break;case zf_PhotoGrid.Drag.Horizontal:dragdelta=Math.abs(this._dragTrack.screenx-first.screenX);scrolldelta=Math.abs(this._dragTrack.screeny-first.screenY);break;
773case zf_PhotoGrid.Drag.Top:dragdelta=first.screenY-this._dragTrack.screeny;scrolldelta=Math.abs(this._dragTrack.screenx-first.screenX);break;case zf_PhotoGrid.Drag.Bottom:dragdelta=this._dragTrack.screeny-first.screenY;
774scrolldelta=Math.abs(this._dragTrack.screenx-first.screenX);break;default:dragdelta=Math.abs(this._dragTrack.screeny-first.screenY);scrolldelta=Math.abs(this._dragTrack.screenx-first.screenX);
775break;}if(dragdelta>this._dragDistance){this._dragTrack.type='drag';type='mousedown';first.screenX=this._dragTrack.screenx;first.screenY=this._dragTrack.screeny;
776first.clientX=this._dragTrack.clientx;first.clientY=this._dragTrack.clientY;}else if(scrolldelta>this._dragDistance){this._dragTrack.type='scroll';}}break;case 'touchend':if(this._dragTrack.type==='drag'){type='mouseup';
777}else{this._dragTrack={};}break;default:break;}if(type.length>0){e.preventDefault();e.stopPropagation();var simulatedEvent=document.createEvent('MouseEvent');simulatedEvent.initMouseEvent(type,
778true,true,window,1,first.screenX,first.screenY,first.clientX,first.clientY,false,false,false,false,0,null);first.target.dispatchEvent(simulatedEvent);if(type==='mouseup'){this._dragTrack={};
779}}};zf_PhotoGrid.prototype._item_onmouseup=function(e,node,item){;;if(node==document)node=item._view.dom();e=zf_stdGetEvent(e);zf_stdPreventDefault(e);var dragDone=false;if(this._dragInfo!=null){dragDone=this._dragStop(true);
780if(node.releaseCapture)node.releaseCapture(false);else if(document.removeEventListener){document.removeEventListener("mousemove",node.onmousemove,true);document.removeEventListener("mouseup",
781node.onmouseup,true);}node.onmousemove=zf_stdFalse;}var isRight=e.button==2||e.which==2;if(!dragDone&&!isRight)this._clickSelect(e,node,item,false);node=null;e=null;
782};zf_PhotoGrid.prototype._clickSelect=function(e,node,item,down){;;;if(this._selectionLocked)return;var ctrl=false;var shift=false;if(this._selectionMode==zf_PhotoGrid.Multiple){ctrl=e.ctrlKey||e.metaKey;
783shift=e.shiftKey;}if((ctrl||shift||this._easyMultiSelect)&&!down)return;var change=false;var anchor=this._anchor;var selectedCount=$.keys(this._selected).length;
784if(ctrl||this._easyMultiSelect){if(item.selected)change=this._deselectItem(item,node);else if(!item.selected&&(!this.maxSelection||selectedCount<this.maxSelection))change=this._selectItem(item,
785node);this._anchor=item;}else if(shift&&anchor!=null&&anchor!=item&&!this.maxSelection){var deselect=[];var itemIndex=item.index;var anchorIndex=anchor.index;for(var id in this._selected){var sel=this._selected[id];
786var index=sel.index;if(index<anchorIndex&&index<itemIndex||index>anchorIndex&&index>itemIndex){deselect.push(index);}}for(var i=0;i<deselect.length;i++)change=this._deselectItem(deselect[i])||change;
787var start=Math.min(itemIndex,anchorIndex);var end=Math.max(itemIndex,anchorIndex);for(i=start;i<=end;i++)change=this._selectItem(i)||change;}else{if(item.selected&&!down||!item.selected&&down){change=this._deselectAll(item);
788change=this._selectItem(item,node)||change;this._anchor=item;}}if(change&&this.onselchange!=null)this.onselchange(item);};zf_PhotoGrid.prototype._onGridClick=function(e){if(this._selectionMode!=zf_PhotoGrid.SingleForced&&!this._easyMultiSelect){if(this._deselectAll()&&this.onselchange!=null)this.onselchange(null);
789}};zf_PhotoGrid.prototype._selectItem=function(item,node){if(typeof(item)=="number"){var index=item;if(index<0||index>=this._items.length)return false;item=this._items[index];
790if(item==null){if(!this._pendingSelect[index]){this._pendingSelect[index]=true;return true;}return false;}}else if(typeof(item)!="object")item=this._items[item];
791if(item==null||item.selected)return false;if(this._selectionMode==zf_PhotoGrid.Single||this._selectionMode==zf_PhotoGrid.SingleForced){var other=this.getSelectedItem();
792if(other!=null)this._deselectItem(other);}this._selected[item.id]=item;if(node==null&&item._view!=null)node=document.getElementById(item._view.id);if(node!=null){zf_stdReplaceClassName(node,
793null,"pg-selected");node=null;}item.selected=true;return true;};zf_PhotoGrid.prototype._delayedSelect=function(item){setTimeout(function(){if(item._view!=null)$('#'+item._view.id).toggleClass('pg-selected',
794item.selected);},10);};zf_PhotoGrid.prototype._deselectItem=function(item,node){if(typeof(item)=="number"){var index=item;if(index<0||index>=this._items.length)return false;
795item=this._items[index];if(item==null){if(!this._pendingSelect[index])return false;delete this._pendingSelect[index];return true;}}else if(typeof(item)!="object")item=this._items[item];
796if(item==null||!item.selected)return false;delete this._selected[item.id];if(node==null&&item._view!=null)node=document.getElementById(item._view.id);if(node!=null){zf_stdReplaceClassName(node,
797"pg-selected",null);node=null;}item.selected=false;return true;};zf_PhotoGrid.prototype._selectAll=function(item){var change=false;for(var i=0;i<this._items.length;i++){var sel=this._items[i];
798if(sel!=item){item=sel;sel.selected=true;this._selected[sel.id]=sel;var _selected=this._selected[sel.id];_selected.selected=true;if(_selected._view!=null){zf_stdReplaceClassName(_selected._view.id,
799null,"pg-selected");this._selected[sel.id]=_selected;this._items[i].selected=true;this._selected[sel.id].selected=true;sel.selected=true;}change=true;}}return change;
800};zf_PhotoGrid.prototype._deselectAll=function(item){var change=false;for(var id in this._selected){var sel=this._selected[id];if(sel!=item){sel.selected=false;if(sel._view!=null){zf_stdReplaceClassName(sel._view.id,
801"pg-selected",null);}change=true;}}this._selected={};if(item!=null&&item.selected)this._selected[item.id]=item;this._pendingSelect={};return change;};zf_PhotoGrid.prototype.selectItem=zf_PhotoGrid.prototype._selectItem;
802zf_PhotoGrid.prototype.deselectItem=zf_PhotoGrid.prototype._deselectItem;zf_PhotoGrid.prototype.deselectAll=zf_PhotoGrid.prototype._deselectAll;zf_PhotoGrid.prototype.selectAll=zf_PhotoGrid.prototype._selectAll;
803zf_PhotoGrid.prototype._deleteItems=function(first,last){for(var index=last-1;index>=first;index--){var item=this._items[index];if(item!=null){if(item._view!=null)this._destroyDom(item);
804delete this._items[item.id];delete this._selected[item.id];}else delete this._pendingSelect[index];}this._items.splice(first,last-first);};zf_PhotoGrid.FixedCellLayout=function(){};
805zf_PhotoGrid.FixedCellLayout.prototype.init=function(grid){this._grid=grid;};zf_PhotoGrid.FixedCellLayout.prototype.getLayoutInfo=function(flags){var grid=this._grid,grid$=grid.$(),info={};
806if(this._cellWidth==null)this._measureCell(grid$);info.cellWidth=this._cellWidth;info.cellHeight=this._cellHeight;info.width=grid$.width();info.itemsPerRow=Math.floor(info.width/this._cellWidth);
807if(info.itemsPerRow==0)info.itemsPerRow=1;info.usedWidth=info.itemsPerRow*this._cellWidth;if(grid._height==-1){info.rowsPerPage=Math.ceil(grid._items.length/info.itemsPerRow);
808if(grid.minRows!=null&&info.rowsPerPage<grid.minRows)info.rowsPerPage=grid.minRows;if(grid.maxRows!=null&&info.rowsPerPage>grid.maxRows)info.rowsPerPage=grid.maxRows;
809info.height=this._cellHeight*info.rowsPerPage;}else{info.height=grid._height;info.rowsPerPage=Math.floor(info.height/this._cellHeight);if(grid.minRows!=null&&info.rowsPerPage<grid.minRows){info.rowsPerPage=grid.minRows;
810info.height=this._cellHeight*info.rowsPerPage;}if(this.maxRows!=null&&info.rowsPerPage>grid.maxRows){info.rowsPerPage=grid.maxRows;info.height=this._cellHeight*info.rowsPerPage;
811}}if(info.rowsPerPage==0)info.rowsPerPage=1;if(grid.minHeight!=null&&info.height<grid.minHeight)info.height=grid.minHeight;info.itemsPerPage=info.itemsPerRow*info.rowsPerPage;
812if(grid._height==-1){info.currentPage=0;info.totalPages=1;}else{info.totalPages=Math.ceil(grid._items.length/info.itemsPerPage);var anchorIndex=grid._anchorIndex;
813if(anchorIndex==-1)anchorIndex=grid._firstVisible;if((flags&zf_PhotoGrid.KeepVisible)!=0)info.currentPage=Math.floor(anchorIndex/info.itemsPerPage);else info.currentPage=grid._pageIndex;
814if(info.currentPage>=info.totalPages)info.currentPage=Math.max(info.totalPages-1,0);}info.firstVisible=info.currentPage*info.itemsPerPage;info.lastVisible=Math.min(grid._items.length,
815info.firstVisible+info.itemsPerPage);return info;};zf_PhotoGrid.FixedCellLayout.prototype.getItemRect=function(info,index){index-=info.firstVisible;var row=Math.floor(index/info.itemsPerRow);
816var col=index%info.itemsPerRow;var x=this._grid._left+col*this._cellWidth;var y=row*this._cellHeight;return{left:x,top:y,right:x+this._cellWidth,bottom:y+this._cellHeight};
817};zf_PhotoGrid.FixedCellLayout.prototype.getCellSize=function(grid){if(this._cellWidth==null)this._measureCell(this._grid.$());return{cx:this._cellWidth,cy:this._cellHeight};
818};zf_PhotoGrid.FixedCellLayout.prototype.clear=function(grid){this._cellWidth=null;this._cellHeight=null;};zf_PhotoGrid.FixedCellLayout.prototype._measureCell=function(grid){;var node=document.createElement("DIV");
819node.className="pv";grid.append(node);var props,i;if(node.currentStyle){props=["width","paddingLeft","paddingRight","borderLeftWidth","borderRightWidth","marginLeft",
820"marginRight","height","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth","marginTop","marginBottom"];for(i=0;i<props.length;i++)props[i]=node.currentStyle[props[i]];
821}else{props=["width","padding-left","padding-right","border-left-width","border-right-width","margin-left","margin-right","height","padding-top","padding-bottom",
822"border-top-width","border-bottom-width","margin-top","margin-bottom"];var style=document.defaultView.getComputedStyle(node,null);for(i=0;i<props.length;i++)props[i]=style.getPropertyValue(props[i]);
823}var width=0;var height=0;for(i=0;i<7;i++)width+=(props[i]=parseInt(props[i],10));for(i=7;i<14;i++)height+=(props[i]=parseInt(props[i],10));;;;;$(node).remove();
824node=null;this._cellWidth=width;this._cellHeight=height;};;function zf_Pager(id,width,size,current,flags){;;;;zf_Control.prototype.constructor.call(this,id);this._width=width;
825this._size=size;this._current=current;this._infinite=(flags&1)!=0;this._showAll=(flags&2)!=0;this._selectAll=(flags&4)!=0;this._noUpdate=(flags&8)!=0;this._mode=zf_Pager.Paged;
826this.update=zf_stdMakeDeferred(this.id+".update",this._update);if(size>0&&!this._noUpdate)this.update(size,current);if(this._showAll){this._linkEvent("a","onall");
827this._linkEvent("p","onpaged");}if(this._selectAll)this._linkEvent("s","onselectall");}zf_Pager.inherits(zf_Control);zf_Pager.Paged=0;zf_Pager.All=1;zf_Pager.prototype.getMode=function(){return this._mode;
828};zf_Pager.prototype.setMode=function(mode){;if(this._mode==mode)return;var paged=(mode==zf_Pager.Paged)?"none":"block";var all=(mode==zf_Pager.Paged)?"block":"none";var backNode=this.dom("b");
829var nextNode=this.dom("n");var pageNode=this.dom("p");var allNode=this.dom("a");backNode.style.display=all;nextNode.style.display=all;allNode.style.display=all;pageNode.style.display=paged;
830if(mode==zf_Pager.All)this._update(0,0,false);this._mode=mode;};zf_Pager.prototype.getCurrent=function(){return this._current;};zf_Pager.prototype._update=function(size,current,
831fromEvent){if(this._mode==zf_Pager.All)return;;;;var maxSlots=this._width+(this._infinite?3:4);var oldSlots=Math.min(this._size,maxSlots);var newSlots=Math.min(size,
832maxSlots);var backNode=this.dom("b");var nextNode=this.dom("n");var parentNode=nextNode.parentNode;var i;for(i=oldSlots;i>newSlots;--i)parentNode.removeChild(nextNode.previousSibling);
833for(i=oldSlots;i<newSlots;++i)parentNode.insertBefore(document.createElement("A"),nextNode);this._size=size;this._current=current;if(this._size>0){++current;var node=backNode.nextSibling;
834var halfWidth=Math.floor(this._width/2);var remainder=this._size-this._width;var halfRemainder=this._size-halfWidth;if(this._size<this._width+4){this._updatePageButtons(node,
8351,this._size);}else if(current<=halfWidth+3){node=this._updatePageButtons(node,1,this._width+2);node=this._updateEllipsis(node,this._width+3);if(!this._infinite)this._updatePageButtons(node,
836this._size,this._size);}else if(!this._infinite&&current>=halfRemainder-2){node=this._updatePageButtons(node,1,1);node=this._updateEllipsis(node,remainder-2);this._updatePageButtons(node,
837remainder-1,this._size);}else if(this._infinite&&current>=halfRemainder-1){node=this._updatePageButtons(node,1,1);node=this._updateEllipsis(node,remainder-1);this._updatePageButtons(node,
838remainder,this._size);}else{node=this._updatePageButtons(node,1,1);node=this._updateEllipsis(node,current-halfWidth-1);node=this._updatePageButtons(node,current-halfWidth,
839current+halfWidth);node=this._updateEllipsis(node,current+halfWidth+1);if(!this._infinite)this._updatePageButtons(node,this._size,this._size);}--current;}backNode.onmousedown=this._getHandler(current-1);
840backNode.onclick=zf_stdFalse;nextNode.onmousedown=this._getHandler(current+1);nextNode.onclick=zf_stdFalse;this._setStyleHandlers(backNode);this._setStyleHandlers(nextNode);
841backNode.style.visibility=(current>0)?"inherit":"hidden";nextNode.style.visibility=(current<size-1)?"inherit":"hidden";backNode=null;nextNode=null;parentNode=null;
842if(fromEvent&&this.onchange!=null)this.onchange(this._current);};zf_Pager.prototype._updatePageButtons=function(node,from,to){for(var i=from;i<=to;++i){node.href="#";zf_stdSetText(node,
843i.toString());if((i-1)!=this._current){node.onmousedown=this._getHandler(i-1);node.className="pager-color1 pager-bgcolor1 pager-border1";}else{node.onmousedown=zf_stdFalse;
844node.className="pager-color3 pager-bgcolor3 pager-border3 pager-c";}this._setStyleHandlers(node);node.onclick=zf_stdFalse;node=node.nextSibling;}return node;};zf_Pager.prototype._updateEllipsis=function(node,
845page){node.href="#";zf_stdSetText(node,"...");node.className="pager-color1 pager-bgcolor1 pager-border1";node.onmousedown=this._getHandler(page-1);node.onclick=zf_stdFalse;
846this._setStyleHandlers(node);return node.nextSibling;};zf_Pager.prototype._getHandler=function(page){var size=this._size;var self=this;var handler=function(e){if(!zf_stdIsLeftButton(e))return true;
847this.blur();self._update(size,page,true);return false;};return handler;};zf_Pager.prototype._linkEvent=function(id,handler){var self=this;var node=this.dom(id);node.onmousedown=function(e){if(!zf_stdIsLeftButton(e))return true;
848this.blur();if(self[handler])self[handler].apply(self);return false;};this._setStyleHandlers(node);node.onclick=zf_stdFalse;node=null;};zf_Pager.prototype._setStyleHandlers=function(node){var addHoverStyles=function(){var className=this.className.split(' ');
849if(className[0]=="pager-color1")className[0]="pager-color2";if(className[1]=="pager-bgcolor1")className[1]="pager-bgcolor2";if(className[2]=="pager-border1")className[2]="pager-border2";
850this.className=className.join(' ');};var removeHoverStyles=function(){var className=this.className.split(' ');if(className[0]=="pager-color2")className[0]="pager-color1";
851if(className[1]=="pager-bgcolor2")className[1]="pager-bgcolor1";if(className[2]=="pager-border2")className[2]="pager-border1";this.className=className.join(' ');
852};node.onmouseover=addHoverStyles;node.onmouseout=removeHoverStyles;};;function zf_Prefetch(id,slots){zf_Control.prototype.constructor.call(this,id);var i=0;var self=this;
853var append=function(){var dom=self.dom();if(!dom)return;var item=document.createElement("DIV");item.className="prefetch-"+i;dom.appendChild(item);item=null;if(++i<slots)setTimeout(append,
854200);};setTimeout(append,1000);}zf_Prefetch.inherits(zf_Control);;function zf_utf8(str){var b=[];var len=str.length;for(var i=0;i<len;i++){var ch=str.charCodeAt(i);if(ch>=0xD800&&ch<0xDC00){var ch2=str.charCodeAt(++i);
855if(ch2<0xDC00||ch2>=0xE000)break;ch=(ch-0xD800)<<10|(ch2-0xDC00);}if(ch<0x80){b.push(ch);}else if(ch<0x800){b.push(0xC0|(ch>>6));b.push(0x80|(ch)&0x3F);}else if(ch<0x10000){b.push(0xE0|(ch>>12));
856b.push(0x80|(ch>>6)&0x3F);b.push(0x80|(ch)&0x3F);}else{b.push(0xF0|(ch>>18));b.push(0x80|(ch>>12)&0x3F);b.push(0x80|(ch>>6)&0x3F);b.push(0x80|(ch)&0x3F);}}return b;
857};var _zf_sha256Init=[0x6A09E667,-0x4498517B,0x3C6EF372,-0x5AB00AC6,0x510E527F,-0x64FA9774,0x1F83D9AB,0x5BE0CD19];var _zf_sha256Roots=[0x428A2F98,0x71374491,-0x4A3F0431,
858-0x164A245B,0x3956C25B,0x59F111F1,-0x6DC07D5C,-0x54E3A12B,-0x27F85568,0x12835B01,0x243185BE,0x550C7DC3,0x72BE5D74,-0x7F214E02,-0x6423F959,-0x3E640E8C,-0x1B64963F,
859-0x1041B87A,0x0FC19DC6,0x240CA1CC,0x2DE92C6F,0x4A7484AA,0x5CB0A9DC,0x76F988DA,-0x67C1AEAE,-0x57CE3993,-0x4FFCD838,-0x40A68039,-0x391FF40D,-0x2A586EB9,0x06CA6351,
8600x14292967,0x27B70A85,0x2E1B2138,0x4D2C6DFC,0x53380D13,0x650A7354,0x766A0ABB,-0x7E3D36D2,-0x6D8DD37B,-0x5D40175F,-0x57E599B5,-0x3DB47490,-0x3893AE5D,-0x2E6D17E7,
861-0x2966F9DC,-0x0BF1CA7B,0x106AA070,0x19A4C116,0x1E376C08,0x2748774C,0x34B0BCB5,0x391C0CB3,0x4ED8AA4A,0x5B9CCA4F,
8610x682E6FF3,0x748F82EE,0x78A5636F,-0x7B3787EC,-0x7338FDF8,
862-0x6F410006,-0x5BAF9315,-0x41065C09,-0x398E870E];var _zf_sha256Tail=[0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
8630x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
8640x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00];function _zf_sha256Pad(data){var blen=data.length*8;var len=((data.length+72)&~63)-8;data=data.concat(_zf_sha256Tail.slice(0,
865len-data.length));var out=[];var i=0;do{var w=data[i++]<<24;w|=data[i++]<<16;w|=data[i++]<<8;w|=data[i++];out.push(w);}while(i<len);out.push(0);out.push(blen);return out;
866}function _zf_sha256Round(res,data){for(var i=16;i<64;i++){var x=data[i-15];var y=data[i-2];var x7=(x>>>7)|(x<<25);var x18=(x>>>18)|(x<<14);var y17=(y>>>17)|(y<<15);var y19=(y>>>19)|(y<<13);
867var s0=x7^x18^(x>>>3);var s1=y17^y19^(y>>>10);data.push((data[i-16]+s0+data[i-7]+s1)&-1);}var a=res[0];var b=res[1];var c=res[2];var d=res[3];var e=res[4];var f=res[5];
868var g=res[6];var h=res[7];for(i=0;i<64;i++){var a2=(a>>>2)|(a<<30);var a13=(a>>>13)|(a<<19);var a22=(a>>>22)|(a<<10);var e6=(e>>>6)|(e<<26);var e11=(e>>>11)|(e<<21);
869var e25=(e>>>25)|(e<<7);var ss0=a2^a13^a22;var maj=(a&b)^(a&c)^(b&c);var t2=ss0+maj;var ss1=e6^e11^e25;var ch=(e&f)^(~e&g);var t1=h+ss1+ch+_zf_sha256Roots[i]+data[i];
870h=g;g=f;f=e;e=(d+t1)&-1;d=c;c=b;b=a;a=(t1+t2)&-1;}res[0]=(res[0]+a)&-1;res[1]=(res[1]+b)&-1;res[2]=(res[2]+c)&-1;res[3]=(res[3]+d)&-1;res[4]=(res[4]+e)&-1;res[5]=(res[5]+f)&-1;
871res[6]=(res[6]+g)&-1;res[7]=(res[7]+h)&-1;}function zf_sha256(data){data=_zf_sha256Pad(data);var res=_zf_sha256Init.slice(0);var s=data.length;var k=0;do{var k2=k+16;_zf_sha256Round(res,
872data.slice(k,k2));k=k2;}while(k<s);var out=[];s=res.length;for(var i=0;i<s;i++){var w=res[i];out.push((w>>>24)&0xFF);out.push((w>>>16)&0xFF);out.push((w>>>8)&0xFF);
873out.push(w&0xFF);}return out;};;function zf_Flash(){}zf_Flash.pluginPage="http://get.adobe.com/flashplayer/";zf_Flash._hideCount=0;zf_Flash.hide=function(){;if(++zf_Flash._hideCount==1){$('.flash-pause').each(function(){try{this.Pause();
874}catch(e){}});if($('.layout-frame, .fsf').addClass('no-flash').length==0){$('.frame:first').addClass('no-flash');}}};zf_Flash.show=function(){;if(--zf_Flash._hideCount==0){if($('.layout-frame, .fsf').removeClass('no-flash').length==0){$('.frame:first').removeClass('no-flash');
875}}};zf_Flash.installed=function(majorVersion,minorVersion,revision){var isIE=navigator.appVersion.indexOf("MSIE")!=-1||navigator.appVersion.indexOf("Trident/7.0")!=-1;var isWin=navigator.appVersion.toLowerCase().indexOf("win");
876var isOpera=navigator.userAgent.indexOf("Opera")!=-1;var version=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){var plugin=navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"];
877if(plugin){var desc=plugin.description.split(" ");;var temp=desc[2].split(".");var major=temp[0];var minor=temp[1];var rev=desc[3];if(rev=="")rev=desc[4];if(rev.charAt(0)=="d"){rev=rev.substring(1);
878}else if(rev.charAt(0)=="r"){rev=rev.substring(1);if(rev.indexOf("d")>0)rev=rev.substring(0,rev.indexOf("d"));}version=[major,minor,rev].join(".");}}else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1){version="4.0.0.0";
879;}else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1){version="3.0.0.0";;}else if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){version="2.0.0.0";
880;}else if(isIE&&isWin&&!isOpera){version=zf_Flash._getVersionActiveX();}if(version==-1){;return false;};var parsed=version.split(".");var parsedMajor=parseInt(parsed[0]);
881var parsedMinor=parseInt(parsed[1]);var parsedRevision=parseInt(parsed[2]);if(majorVersion){if(parsedMajor!=majorVersion)return(parsedMajor>majorVersion);if(minorVersion){if(parsedMinor!=minorVersion)return(parsedMinor>minorVersion);
882if(revision)return(parsedRevision>revision);return true;}return true;}return true;};zf_Flash.isSafeDomain=function(){return(!'zf_currentHost' in window)||zf_currentHost==location.hostname.toLowerCase();
883};
883zf_Flash.createHtml=function(id,classes,src,vars,transparent,width,height){if(vars.transition=='6')vars.transition='4';var fvars=[];$.each(vars,function(k,v){fvars.push(k+"="+escape(v!=null?v:""));
884});var html=null;var bgcolor="";if(vars.bgcolor)bgcolor=' bgcolor="'+vars.bgcolor+'"';html=['<embed',' id="',id,'"',' class="',classes,'"',' src="',src,'"',' quality="high"',
885' width="',width?width:1,'"',' height="',height?height:1,'"',bgcolor,' align=""',' type="application/x-shockwave-flash"',' pluginspage="',zf_Flash.pluginPage,'"',
886' allowFullScreen="true"',' wmode="',transparent?'transparent':'opaque','"',' allowScriptAccess="always"',' flashvars="',fvars.join("&"),'">','</embed>'];return html.join("");
887};zf_Flash._getVersionActiveX=function(){var version;var axo;var e;try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");version=axo.GetVariable("$version");;}catch(e){}if(!version){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
888version="WIN 6,0,21,0";axo.AllowScriptAccess="always";version=axo.GetVariable("$version");;}catch(e){}}if(!version){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
889version=axo.GetVariable("$version");;}catch(e){}}if(!version){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");version="WIN 2,0,0,11";;}catch(e){}}if(!version)return-1;
890version=version.substr(4).split(",").join(".");return version;};;function zf_Storage(storage){this._keys=[];this._data={};this._storage=storage;try{if(this._storage!=null)this.length=storage.length;
891else this.length=this._keys.length;}catch(e){;this.length=this._keys.length;}}zf_Storage.prototype.key=function(index){;;;;try{if(this._storage!=null)return this._storage.key(index);
892}catch(e){;}return this._keys[index];};zf_Storage.prototype.getItem=function(key){;;var item;try{if(this._storage!=null){item=this._storage.getItem(key);return item==null?null:item.toString();
893}}catch(e){;}item=this._data[key];return item==null?null:item.toString();};zf_Storage.prototype.setItem=function(key,data){;;;try{if(this._storage!=null){this._storage.setItem(key,
894data);return;}}catch(e){;}data=data.toString();if(this._data[key]==null){this._keys.push(key);this.length=this._keys.length;}this._data[key]=data;};zf_Storage.prototype.removeItem=function(key){;
895;try{if(this._storage!=null){this._storage.removeItem(key);return;}}catch(e){;}if(this._data[key]==null)return;for(var i=0;i<this.length;i++){if(this._keys[i]==key){this._keys.splice(i,
8961);this.length=this._keys.length;break;}}delete this._data[key];};zf_Storage.prototype.clear=function(){try{if(this._storage!=null){this._storage.clear();return;}}catch(e){;
897}this._keys=[];this._data={};};var zf_storage=null;if(typeof(jQuery)!="undefined"){$(function(){try{if(window.localStorage)zf_storage=new zf_Storage(window.localStorage);
898else if(window.globalStorage)zf_storage=new zf_Storage(window.globalStorage[location.host]);else zf_storage=new zf_Storage();}catch(e){;zf_storage=new zf_Storage();
899}});};function zf_Form(id,data,meta){zf_Control.prototype.constructor.call(this,id);data=data?data:{};this._initData=data;this._meta=meta;this._fieldValues={};this.queue=new zf_RequestQueue(1);
900this.onsubmit=this.closure(this.verifyForm);this.oninit=zf_stdTrue;this.onreply=zf_stdTrue;this.onrequestsend=zf_stdTrue;this.onrequestcomplete=zf_stdTrue;var self=this;
901$(function(){self.init(data);});$(this.dom()).bind('submit',function(e,handlers){if($(this).data("captcha")=="yes"){if(grecaptcha.enterprise.getResponse()!=""){return self._submitHandler(e,
902handlers);}if(self.verifyForm(self.getData(),handlers)){if(typeof grecaptcha!=='undefined'){grecaptcha.enterprise.execute();}}return false;}else{return self._submitHandler(e,
903handlers);}});}zf_Form.inherits(zf_Control);zf_Form.prototype._submitHandler=function(e,handlers){var self=this;var delegates={onsubmit:self.onsubmit,onreply:self.onreply,onrequestsend:self.onrequestsend,
904onrequestcomplete:self.onrequestcomplete};delegates=jQuery.extend(delegates,handlers);self._submit(delegates);return false;};zf_Form.prototype.init=function(data){var self=this;
905if(this.oninit(data)!==false){this.fill(data);var supportsAutoFocus='autofocus' in document.createElement('input');if(!supportsAutoFocus)this.$(':input[autofocus]:first').focus();
906}this.$('INPUT[placeholder],TEXTAREA[placeholder]').each(function(){zf_Form.placeholderify(this);});var inputs=this.$(':input:visible');if(inputs.length>1){inputs.filter(':last').filter(':not(textarea)').bind('keypress',
907function(e){if(e.which==13)self.$dom().submit();});}};zf_Form.prototype.resetDirty=function(field){var fields=field?this._getFields(field):this.$(':input[name]');var self=this;
908fields.each(function(){var $input=$(this);self._fieldValues[$input.attr("name")]=self._fieldVal($input);});return fields;};zf_Form.prototype.checkDirty=function(field){var fields=field?this._getFields(field):this.$(':input[name]');
909var res=false;var self=this;fields.each(function(){var $input=$(this);if(self._fieldValues[$input.attr("name")]!=self._fieldVal($input))res=true;});return res;};
910zf_Form.prototype.fill=function(data,context){context=context?context:this.dom();jQuery.each(data,function(name,value){var field=$(':input[name="'+name+'"]',context);if(typeof(value)=='boolean'&&field.is(':checkbox')){if(typeof $.fn.prop==='function'){field.prop('checked',
911value?'checked':false).trigger('fill');}else{field.attr('checked',value?'checked':false).trigger('fill');}return;}if(field.length<=1){field.val(value!=null?value:'').trigger('fill');
912return;}var values=jQuery.isArray(value)?value:[value];field.attr('checked',function(){var fieldVal=$(this).val();for(var i=0;i<values.length;i++){if(fieldVal!=null&&values[i]==fieldVal)return true;
913}return false;});field.trigger('fill');});};zf_Form.prototype.clear=function(field){var fields=field?this._getFields(field):this.$(':input');fields.each(function(){var input=$(this);
914if(input.is(':radio')||input.is(':checkbox'))input.attr('checked',fal
914se);else if(input.is('SELECT'))input[0].selectedIndex=0;else if(input.is(':text')||input.is('TEXTAREA')||input.is(':password'))input.val('');
915}).trigger('fill');return fields;};zf_Form.prototype.reset=function(){this.dom().reset();this.fill(this._initData);};zf_Form.prototype.getData=function(context){var self=this;
916var data={};context=context?context:this.dom();$(':input[name]',context).each(function(){data[this.name]=self.fieldVal(this.name);});return data;};zf_Form.prototype.field=function(name){return this._getFields(name);
917};zf_Form.prototype.fieldVal=function(field){field=this._getFields(field);if(field.length==0)return null;;var self=this;if(field.length>1&&!field.is(':radio')){var res=[];
918field.each(function(){var val=self._fieldVal($(this));if(val!=null)res.push(val);});return res;}return this._fieldVal(field);};zf_Form.prototype._fieldVal=function(field){;
919;if(field.is(':checkbox')&&field.length==1)return field.is(':checked');if(field.is(':checkbox')||field.is(':radio'))return field.filter(':checked').val();if(field.hasClass('input-placeholder'))return '';
920if(field.is(':text')||field.is('TEXTAREA'))return jQuery.trim(field.val());return field.val();};zf_Form.prototype._getFields=function(field){if(typeof(field)=='string')return this.$(':input[name="'+field+'"]');
921if(jQuery.isArray(field)){var res=new jQuery();jQuery.each(field,function(i,name){res.add(':input[name="'+name+'"]');});return res;}if(field.nodeType)field=$(field);
922return field;};zf_Form.prototype.submit=function(handlers){$(this.dom()).trigger('submit',[handlers]);};zf_Form.prototype._submit=function(handlers){if(this._isSubmitting)return false;
923var data=this.getData();this.clearStatus();this._isSubmitting=true;if(handlers.onsubmit(data,handlers)===false){this._isSubmitting=false;return false;}var self=this;
924this._isSubmitting=true;var method=$(this.dom()).attr('method');method=method?method.toUpperCase():'POST';handlers.onrequestsend();this.queue.enqueue(method,this.methodUrl,
925this.methodName,[data],function(status,retVal){self._isSubmitting=false;handlers.onrequestcomplete();if(status!=200){self.showError('An unexpected error has occurred. Please try again later. If this problem persists, contact Support.');
926return;}if(retVal.error&&retVal.error.$type=="RedirectException"){retVal.error.redirect();return;}if(handlers.onreply(retVal.result,retVal.error)!==false)self.handleError(retVal.result,
927retVal.error);});return true;};zf_Form.prototype.handleError=function(result,error){if(!error)return false;if(error.fieldErrors){for(var field in error.fieldErrors)this.setFieldError(field,
928error.fieldErrors[field]);}else{if(jQuery.isArray(error.fields)){for(var i=error.fields.length-1;i>=0;i--)this.setFieldError(error.fields[i]);}if(error.message)this.showError(error.message);
929}if(typeof grecaptcha!=='undefined'){var widgetId=$(this.dom("captcha-field")).attr('data-widget-id');var response=grecaptcha.enterprise.getResponse(widgetId);if(response.length!==0){grecaptcha.enterprise.reset(widgetId);
930}}return false;};zf_Form.prototype.verifyForm=function(data){data=data?data:this.getData();for(var name in data){var value=data[name];var field=this._getFields(name);if(field.is(':hidden')||field.is(':disabled'))continue;
931if(!this.verifyField(field,name,value))return false;}return true;};zf_Form.prototype.verifyField=function(field){field=this._getFields(field);var name=field.attr('name');
932var value=this._fieldVal(field);if(field.is('[required]')&&!value){var msg=this._meta?this._meta.requiredMessages[name]:null;this.setFieldError(field,msg?msg:'A required field value is missing. Please enter the field value and try again.');
933return false;}if(field.is('TEXTAREA[max-length]')){if(value!=null&&parseInt(field.attr("max-length"),10)<value.length){msg=this._meta?this._meta.requiredMessages[name]:null;
934this.setFieldError(field,zf_stdFormatString(msg?msg:'The field value is too long.',parseInt(field.attr("max-length"),10),value.length));return false;}}return true;
935};zf_Form.prototype.setFieldError=function(field,errorMsg){field=this._getFields(field);this.setFieldStatus(field,true,errorMsg);};zf_Form.prototype.clearStatus=function(){var self=this;
936this.$(':input[name]').each(function(i,input){self.clearFieldError(input);});this.showMessage(null);};zf_Form.prototype.clearFieldError=function(field){field=this._getFields(field);
937this.setFieldStatus(field,false);};zf_Form.prototype.showError=function(errorMsg){this.showMessage(errorMsg,true);};zf_Form.prototype.showMessage=function(msg,isError){};zf_Form.prototype.setFieldStatus=function(field,
938isError,msg){};zf_Form.placeholderify=function(input){if(typeof(input)=='string')input=document.getElementById(input);input=$(input);;if(zf_Form.__placeholder===undefined)zf_Form.__placeholder='placeholder' in document.createElement('input');
939if(zf_Form.__placeholder)return;input.bind('focus.placeholderify',function(e){var $this=$(this);if($this.hasClass('input-placeholder'))$this.removeClass('input-placeholder').val('');
940});input.bind('blur.placeholderify',function(){var $this=$(this);if(!$this.val())$this.addClass('input-placeholder').val($this.attr('placeholder'));});input.bind('fill.placeholderify',
941function(){var $this=$(this);$this.toggleClass('input-placeholder',!$this.val());if(!$this.val())$this.val($this.attr('placeholder'));});if(!input.val())input.addClass('input-placeholder').val(input.attr('placeholder'));
942input=null;};zf_Form.initDatePicker=function($scope){$(document).keydown(function(e){switch(e.keyCode){case 9:if($.datepicker._datepickerShowing){$.datepicker._hideDatepicker(null,
943'');}break;case 13:if($.datepicker._datepickerShowing){$.datepicker._hideDatepicker(null,'');e.preventDefault();e.stopPropagation();}break;case 27:if($.datepicker._datepickerShowing){$.datepicker._hideDatepicker(null,
944'');e.preventDefault();e.stopPropagation();}break;default:break;}});$scope.find('.datepicker').datepicker({showOn:'focus',duration:'fast',dateFormat:'d-M-y',showAnim
944:'fadeIn',
945beforeShow:function(input,inst){$(input).unbind("keydown",$.datepicker._doKeyDown);},showOptions:{direction:'down'}});$scope.find('.datepicker').datepicker('disable');
946$scope.find('.datepicker-label').click(function(e){if($.datepicker._datepickerShowing){var input=$("#"+e.target.htmlFor);if($.datepicker._curInst.input.get(0)===input.get(0)){input.datepicker('hide',
947'normal');e.preventDefault();e.stopPropagation();return false;}}return true;});$scope.find('.datepicker-label').mousedown(function(e){if($.datepicker._datepickerShowing){e.preventDefault();
948e.stopPropagation();return false;}return true;});};zf_Form.enableDatePicker=function($scope,enable){$scope.find('.datepicker').datepicker(enable?'enable':'disable');};;function zf_login(userName,
949password,oncomplete){zf_loginScoped(0,userName,password,oncomplete);}function zf_loginScoped(scope,userName,password,oncomplete){;zf_stdServerRequestEx("POST","/zf/core/core.asmx",
950"LoginGetChallenge",[userName,scope],function(result,error){if(error!=null){oncomplete(null,error.message);return;}var hash=zf_sha256(result.salt.concat(zf_utf8(password)));
951var response=zf_sha256(result.challenge.concat(hash));zf_stdServerRequestEx("POST","/zf/core/core.asmx","LoginAuthenticate",[result.challenge,response,scope],function(result,
952error){if(error!=null)oncomplete(null,error.message);else oncomplete(result,null);});});};function zf_CurrencyInfo(){this.name=null;this.code=null;this.numericCode=0;}zf_CurrencyInfo.prototype.toString=function(){return this.code;
953};zf_CurrencyInfo.all=_zf_stdTransformResponse([{"$type":"CurrencyInfo","name":"US Dollar","pluralName":"US Dollars","shortName":"USD","code":"USD","symbol":"$"},{"$type":"CurrencyInfo",
954"name":"Canadian Dollar","pluralName":"Canadian Dollars","shortName":"CAD","code":"CAD","symbol":"C$"},{"$type":"CurrencyInfo","name":"Pound Sterling","pluralName":"Pounds Sterling",
955"shortName":"GBP","code":"GBP","symbol":"\u00A3"},{"$type":"CurrencyInfo","name":"Euro","pluralName":"Euros","shortName":"EUR","code":"EUR","symbol":"\u20AC"},{"$type":"CurrencyInfo",
956"name":"Australian Dollar","pluralName":"Australian Dollars","shortName":"AUD","code":"AUD","symbol":"AU$"},{"$type":"CurrencyInfo","name":"Czech Koruna","pluralName":"Czech Koruny",
957"shortName":"CZK","code":"CZK","symbol":"K\u010D"},{"$type":"CurrencyInfo","name":"Danish Krone","pluralName":"Danish Kroner","shortName":"DKK","code":"DKK","symbol":"kr"},
958{"$type":"CurrencyInfo","name":"Hong Kong Dollar","pluralName":"Hong Kong Dollars","shortName":"HKD","code":"HKD","symbol":"HK$"},{"$type":"CurrencyInfo","name":"Hungarian Forint",
959"pluralName":"Hungarian Forint","shortName":"HUF","code":"HUF","symbol":"Ft"},{"$type":"CurrencyInfo","name":"Israeli New Shekel","pluralName":"Israeli New Shekels",
960"shortName":"ILS","code":"ILS","symbol":"\u20AA"},{"$type":"CurrencyInfo","name":"Japanese Yen","pluralName":"Japanese Yen","shortName":"JPY","code":"JPY","symbol":"\u00A5"},
961{"$type":"CurrencyInfo","name":"Mexican Peso","pluralName":"Mexican Pesos","shortName":"MXN","code":"MXN","symbol":"Mex$"},{"$type":"CurrencyInfo","name":"New Zealand Dollar",
962"pluralName":"New Zealand Dollars","shortName":"NZD","code":"NZD","symbol":"NZ$"},{"$type":"CurrencyInfo","name":"Norwegian Krone","pluralName":"Norwegian Kroner",
963"shortName":"NOK","code":"NOK","symbol":"kr"},{"$type":"CurrencyInfo","name":"Polish Zloty","pluralName":"Polish Zloty","shortName":"PLN","code":"PLN","symbol":"z\u0142"},
964{"$type":"CurrencyInfo","name":"Singapore Dollar","pluralName":"Singapore Dollars","shortName":"SGD","code":"SGD","symbol":"S$"},{"$type":"CurrencyInfo","name":"Swedish Krona",
965"pluralName":"Swedish Kronor","shortName":"SEK","code":"SEK","symbol":"kr"},{"$type":"CurrencyInfo","name":"Swiss Franc","pluralName":"Swiss Francs","shortName":"CHF",
966"code":"CHF","symbol":"Fr."}]);(function(){var cnt=zf_CurrencyInfo.all?zf_CurrencyInfo.all.length:0;for(var i=0;i<cnt;i++){zf_CurrencyInfo.all[zf_CurrencyInfo.all[i].code]=zf_CurrencyInfo.all[i];
967}})();;function zf_stdFormatMoney(val,currency){return zf_NumberFormat.current.formatMoney(val,currency);}function zf_stdRoundMoney(value){if(isNaN(value))return value;value*=100;
968var r=Math.round(value);;return r/100;}function zf_stdFormatEditableMoney(val){var format=zf_NumberFormat.current;return val.toFixed(format.currencyDecimalDigits).replace(/\./i,
969format.currencyDecimalSeparator);}function zf_stdFormatCurrencyMoney(val){var format=zf_NumberFormat.current;return+val.toFixed(format.currencyDecimalDigits).replace(/\./i,
970'');}function zf_stdParseEditableMoney(val){if(val&&val.length>0)val=val.replace(/^\s+|\s+$/g,'');var format=zf_NumberFormat.current;var separator=format.currencyDecimalSeparator;
971if(!new RegExp("^\\d*\\"+separator+"?\\d*$").test(val)){return NaN;}return zf_stdRoundMoney(parseFloat(val.replace(new RegExp("(\\"+separator+")"),".")));}function zf_stdCheckEditableMoney(val){if(isNaN(zf_stdParseEditableMoney(val))){return zf_stdFormatString("Please use the correct amount (e.g. {0})",
972zf_stdFormatEditableMoney(1234.56));}return undefined;};function zf_RedirectException(){}zf_RedirectException.prototype.redirect=function(){if(this.href)window.location.href=this.href;else window.location.reload();
973};;function zf_PriceKey(pricingKey,ownerId,defaultList){if(arguments.length==3){this.pricingKey=pricingKey;this.ownerId=ownerId;this.defaultList=defaultList;}else if(arguments.length==1&&arguments[0]!=null){var photo=pricingKey;
974this.pricingKey=photo.priceKey;this.ownerId=photo.owner!=null?photo.owner.id:0;this.defaultList=false;}else{this.pricingKey=null;this.ownerId=0;this.defaultList=false;
975}}zf_PriceKey.prototype.toString=function(){return this.pricingKey+"."+this.ownerId+"/"+this.defaultList;};zf_PriceKey.prototype.equals=function(other){if(!other)return false;return zf_PriceKey.compare(this,
976other)==0;};zf_PriceKey.prototype.isSimple=function(){return this.pricingKey.length<7||this.pricingKey.length==7&&this.pricingKey.charAt(0)<='4';};zf_PriceKey.prototype.getVendorId=function(){return 'user'+this.ownerId;
977};zf_PriceKey.compare=function(a,b){if(a.pricingKey<b.pricingKey)return-1;else if(a.pricingKey>b.pricingKey)return 1;else if(a.ownerId<b.ownerId)return-1;else if(a.ownerId>b.ownerId)return 1;
978else if(a.defaultList<b.defaultList)return-1;else if(a.defaultList>b.defaultList)return 1;else return 0;};;function zf_stdPost(url,data){if(zf_stdPost.counter==null)zf_stdPost.counter=0;
979else++zf_stdPost.counter;var domForm=document.createElement("FORM");domForm.id=domForm.name="__zf_form"+zf_stdPost.counter;domForm.method="post";domForm.action=url;
980domForm.style.display="none";for(var key in data){var domInput=document.createElement("INPUT");domInput.type="hidden";domInput.id=domInput.name=key;domInput.value=data[key];
981domForm.appendChild(domInput);}var domBody=document.getElementsByTagName("BODY")[0];domBody.appendChild(domForm);domForm.submit();}function zf_stdStartApp(url,appstore){;
982if($.trim(url).length>0){window.location.href=url;}if($.trim(appstore).length>0){var clickedAt=+new Date;setTimeout(function(){if(+new Date-clickedAt<2000){;window.location.href=appstore;
983}},500);}};function zfl_Control(id){if(zf_stdNoArgs(arguments))return;zf_Control.prototype.constructor.call(this,id);}zfl_Control.inherits(zf_Control);zfl_Control.prototype.visibility=function(style){;
984if(typeof(style)=="boolean")style=style?"inherit":"hidden";this.dom().style.visibility=style;};zfl_Control.prototype.display=function(style){;if(typeof(style)=="boolean")style=style?"block":"none";
985this.dom().style.display=style;};zfl_Control.prototype.notifyResize=function(deferred){if(this.onresize)this.onresize(deferred);};;function zf_Curtain(id){zf_Control.prototype.constructor.call(this,
986id);var self=this;this._animation=new zf_Animation({"darkest":90,"dark":70,"light":65,"hide":0},function(v){zf_stdSetOpacity(self.dom(),v/100);});}zf_Curtain.inherits(zf_Control);
987zf_Curtain.show=function(style,speed,callback,parentNode,onhide,hideOnClick){var current=zf_Curtain._current;if(!current){var dom=document.createElement("DIV");dom.id="dimmer";
988parentNode=parentNode?parentNode:document.body;parentNode.appendChild(dom);$('BODY').addClass("contains-dimmer");$("#page-frame").addClass("page-dimmed");zf_Flash.hide();
989zf_Curtain._current=current=new zf_Curtain(dom.id);current._resizeHandler=current.eventHandler(current._window_onresize);$(window).bind("resize",current._resizeHandler);
990current._onHideCallback=onhide;if(hideOnClick){zf_stdAttachEvent(current.id,"click",zf_Curtain.hide);}}zf_Curtain._current._show(style,speed,callback);if("zfl_Popup" in window){zfl_Popup.hideAny();
991}};zf_Curtain.hide=function(){var current=zf_Curtain._current;if(!current)return;current._hide();var dom=current.dom();$(window).unbind("resize",current._resizeHandler);dom.parentNode.removeChild(dom);
992zf_Curtain._current=null;$('BODY').removeClass("contains-dimmer");$("#page-frame").removeClass("page-dimmed");zf_Flash.show();};zf_Curtain.prototype._show=function(style,speed,
993callback){if(!style)style="light";if(speed)this._animation.animate(style,speed,callback);else{this._animation.jump(style);if(callback)callback();}};zf_Curtain.prototype._hide=function(){this._animation.jump("hide");
994if(typeof this._onHideCallback==='function'){this._onHideCallback();}};zf_Curtain.prototype._window_onresize=function(){};;;function zf_MulticastDelegate(owner){this._owner=owner;this._list=[];
995}zf_MulticastDelegate.prototype.attach=function(handler){this._list.push(handler);};zf_MulticastDelegate.prototype.detach=function(handler){for(var i=0;i<this._list.length;i++){if(this._list[i]==handler){this._list.splice(i,
9961);return;}}};zf_MulticastDelegate.prototype.invoke=function(){for(var i=0;i<this._list.length;i++)this._list[i].apply(this._owner,arguments);};;function zfl_PasswordManager(){}zfl_PasswordManager.unlocked={};
997zfl_PasswordManager.pending={};zfl_PasswordManager.hints={};zfl_PasswordManager.notify=new zf_MulticastDelegate(zfl_PasswordManager);zfl_PasswordManager.init=function(realms){;for(var i=0;i<realms.length;i++)this.unlocked[this.getKey(realms[i])]=true;
998};zfl_PasswordManager.getKey=function(realm){return[realm.owner,realm.realm].join('.');};zfl_PasswordManager.check=function(ownerId,realmId){var key=realm=this.getKey({owner:ownerId,realm:realmId});return!!this.unlocked[key];
999};zfl_PasswordManager.subscribe=function(ownerId,realmId,onunlock){var key=realm=this.getKey({owner:ownerId,realm:realmId});if(this.unlocked[key])zf_stdDeferCall(null,onunlock);else if(this.pending[key])this.pending[key].push(onunlock);
1000else this.pending[key]=[onunlock];};zfl_PasswordManager.retrieveHint=function(ownerId,realmId,onhint){var key=realm=this.getKey({owner:ownerId,realm:realmId});var existing=this.hints[key];
1001if(existing!==null&&existing!==undefined){zf_stdDeferCall(null,onhint,null,existing===false?null:existing);return;}var self=this;
1001zf_stdServerRequest("POST","/zf/layout/layout.asmx",
1002"GetPasswordHint",[ownerId,realmId],function(status,retVal){if(status!=200||retVal.error!=null){onhint(null);return;}var res=retVal.result;self.hints[realmId]=(res===null||res===undefined)?false:res;
1003onhint(res);});};zfl_PasswordManager.validate=function(ownerId,realmId,password,onpassword,photoId){var key=realm=this.getKey({owner:ownerId,realm:realmId});if(this.unlocked[key]){zf_stdDeferCall(null,
1004onpassword,null,true);return;}var self=this;zf_stdServerRequest("POST","/zf/app/manage.asmx","RegisterRealmPassword2",[ownerId,realmId,password,photoId||null],function(status,
1005retVal){if(status!=200||(retVal&&retVal.error!=null)){onpassword(false,retVal.error&&retVal.error.message);return;}if(retVal&&retVal.result&&typeof zf_edgeAuthTokens!=='undefined'){zf_edgeAuthTokens.push(retVal.result);
1006}self.unlocked[key]=true;var subscribers=self.pending[key];self.pending[key]=null;if(subscribers){for(var i=0;subscribers&&i<subscribers.length;i++)subscribers[i]();
1007}onpassword(true,null);self.notify.invoke();});};;function zfl_Form(id,data,meta){zf_Form.prototype.constructor.call(this,id,data,meta);var self=this;$(function(){self.bindSubmit();
1008});}zfl_Form.inherits(zf_Form);zfl_Form.prototype.setFieldStatus=function(field,isError,msg){if(!field.length)return;var fieldbox=field.closest('.form-field, .textfield, .selectfield');
1009fieldbox.toggleClass('field-error',!!isError);if(msg!=null)this.showMessage(msg,!!isError);if(isError){field.focus();}};zfl_Form.prototype.showMessage=function(msg,isError){this.$('.form-message').toggleClass('form-error form-color1',
1010!!isError).html(msg==null?'':msg).toggle(!!msg);};zfl_Form.prototype.bindSubmit=function(nodes){var self=this;nodes=nodes?nodes:this.$('.submit');nodes.filter('.button').each(function(){zfl_Button.attachToForm($(this),
1011self);});nodes.not('.button').bind('click',function(){self.submit();return false;});};;function zf_DropDown(){var self=this;self._state={id:0};$(document).ready(function(){self.init();
1012});}zf_DropDown.prototype.init=function(){var self=this;$(document).ready(function(){$(window).scroll(function(){$(".dropdown-menu-link").each(function(idx,el){var anchorEl=$(el).find(".dropdown-menu-anchor");
1013var menuEl=$("#"+$(el).data("for"));if(menuEl.is(":visible")&&menuEl.data("scrollPosition")==="fixed"){if(!menuEl.data("originalTop")){var currentTop=menuEl.offset().top;
1014var windowScroll=$(window).scrollTop();var newTop=currentTop-windowScroll;menuEl.data("originalTop",currentTop);menuEl.css("top",newTop);}if(!menuEl.data("originalPosition")){menuEl.data("originalPosition",
1015menuEl.css("position"));menuEl.css("position","fixed");}}});});});$("body").delegate(".dropdown-menu-link","mouseenter touchend",function(e){var el=$(this);var menuEl=$("#"+el.data("for"));
1016if(!menuEl.data("visible")){if(menuEl.data("dynamic-load-function")){self._showMenu(el,true);var cb=function(){self._showMenu(el,true,true);};eval(menuEl.data("dynamic-load-function"));
1017}else{self._showMenu(el,true);}}else if(e.type=="touchend"){self._hideMenu(menuEl,true);}clearTimeout(menuEl.data("hideTimeOut"));}).delegate(".dropdown-menu-link",
1018"mouseleave",function(){var el=$(this);var menuEl=$("#"+el.data("for"));menuEl.data("hideTimeOut",setTimeout(self._hideMenu,600,menuEl,true));}).delegate(".dropdown-menu",
1019"mouseenter",function(e){var menuEl=$(this);clearTimeout(menuEl.data("hideTimeOut"));}).delegate(".dropdown-menu","mouseleave",function(e){var menuEl=$(this);menuEl.data("hideTimeOut",
1020setTimeout(self._hideMenu,600,menuEl,true));});self.renderMenus();};zf_DropDown.prototype._getNewId=function(){this._state.id++;return this._state.id;};zf_DropDown.prototype.showMenu=function(menuId){$("#"+$("#"+menuId).data("for")).trigger("mouseenter");
1021};zf_DropDown.prototype.renderMenus=function(){var self=this;$(".dropdown-menu-link").filter(function(){return(!$(this).data("rendered"));}).each(function(){var linkEl=$(this);
1022var menuEl=linkEl.next(".dropdown-menu");var linkId="";var menuId="";if(typeof linkEl.attr("id")!="undefined"){linkId=linkEl.attr("id");}else{linkId="dropdown-menu-link"+self._getNewId();
1023linkEl.attr("id",linkId);}if(typeof menuEl.attr("id")!="undefined"){menuId=menuEl.attr("id");}else{menuId="dropdown-menu"+self._getNewId();menuEl.attr("id",menuId);
1024}menuEl.data("for",linkId);linkEl.data("for",menuId);linkEl.data("rendered",true);menuEl.data("rendered",true);menuEl.detach().appendTo("body");});};zf_DropDown.prototype._hideMenu=function(menuEl,
1025animate){if(!animate){menuEl.data("visible",false).css({"display":"none","opacity":"1"});}else{var position=menuEl.data("originalPosition")?"position: "+menuEl.data("originalPosition"):"";
1026menuEl.animate({opacity:0}
1026,150,"linear",function(){if(!menuEl.data("visible")){menuEl.css({"display":"none","opacity":"1"});}if(menuEl.data("originalPosition")){menuEl.css("position",
1027menuEl.data("originalPosition"));menuEl.removeData("originalPosition");}if(menuEl.data("originalTop")){menuEl.removeData("originalTop");}}).data("visible",false);
1028}};zf_DropDown.prototype._showMenu=function(el,animate,dontHideAll){var self=this;if(!dontHideAll){$(".dropdown-menu").each(function(){self._hideMenu($(this));});}var anchorEl=el.find(".dropdown-menu-anchor");
1029if(anchorEl.length==0){anchorEl=el;}var menuEl=$("#"+el.data("for"));var caretEl=menuEl.find(".dropdown-menu-caret");menuEl.css({"visibility":"hidden","display":"block",
1030"left":"0px","top":"0px","height":"auto","width":"auto"}).data("visible",true);var anchorOffset=anchorEl.offset();var menuX=0;var menuY=0;var caretPosition=menuEl.data("caret-position");
1031var caretAlign=menuEl.data("caret-align");var anchorHeight=anchorEl.outerHeight();var menuHeight=menuEl.height();var anchorWidth=anchorEl.outerWidth();var menuWidth=menuEl.width();
1032var paddingAmount=(menuEl.outerWidth()-menuEl.width()==0?menuEl.outerHeight()-menuEl.height():menuEl.outerWidth()-menuEl.width());var anchorTop=anchorOffset.top;
1033var anchorLeft=anchorOffset.left;var caretWidth=caretEl.outerWidth();var caretHeight=caretEl.outerHeight();var animInitialWidth=0;var animInitialHeight=0;var animInitialTop=0;
1034var animInitialLeft=0;var animFinalWidth=0;var animFinalHeight=0;var animFinalTop=0;var animFinalLeft=0;var doc=document.documentElement;var viewportWidth=doc.clientWidth;
1035var viewportHeight=doc.clientHeight;var scrollLeft=(window.pageXOffset||doc.scrollLeft)-(doc.clientLeft||0);var scrollTop=(window.pageYOffset||doc.scrollTop)-(doc.clientTop||0);
1036var caretOffset=10;var menuIsInViewPort=true;var count=0;var hideCaret=false;do{menuIsInViewPort=true;count++;if(caretPosition=="top"){menuX=anchorLeft;menuY=anchorTop+anchorHeight;
1037animInitialWidth=menuWidth;animInitialHeight=0;animInitialTop=menuY;animFinalWidth=menuWidth;animFinalHeight=menuHeight;}if(caretPosition=="bottom"){menuX=anchorLeft;
1038menuY=anchorTop-menuHeight-caretHeight;animInitialWidth=menuWidth;animInitialHeight=0;animInitialTop=anchorTop-paddingAmount;animFinalWidth=menuWidth;animFinalHeight=menuHeight;
1039}if(caretPosition=="left"){menuX=anchorLeft+anchorWidth;menuY=anchorTop;animInitialWidth=0;animInitialHeight=menuHeight;animInitialTop=menuY;animInitialLeft=menuX;
1040animFinalWidth=menuWidth;animFinalHeight=menuHeight;}if(caretPosition=="right"){menuX=anchorLeft-menuWidth-caretWidth;menuY=anchorTop;animInitialWidth=0;animInitialHeight=menuHeight;
1041animInitialLeft=anchorLeft-paddingAmount;animFinalWidth=menuWidth;animFinalHeight=menuHeight;}if(caretPosition=="top"||caretPosition=="bottom"){if(caretAlign=="middle"){menuX=menuX-(menuWidth/2)+(anchorWidth/2);
1042animInitialLeft=menuX;caretEl.css({"left":((menuWidth/2)-(caretWidth/2))+"px"});}else if(caretAlign=="left"){menuX=menuX+(anchorWidth/2)-(caretWidth/2)-caretOffset;
1043animInitialLeft=menuX;caretEl.css({"left":caretOffset+"px"});}else if(caretAlign=="right"){menuX=menuX-(menuWidth)+(anchorWidth/2)+(caretWidth/2)+caretOffset;animInitialLeft=menuX;
1044caretEl.css({"left":(menuWidth-caretWidth-caretOffset)+"px"});}}else if(caretPosition=="left"||caretPosition=="right"){if(caretAlign=="middle"){menuY=menuY-(menuHeight/2)+(anchorHeight/2);
1045caretEl.css({"top":((menuHeight/2)-(caretHeight/2))+"px"});}else if(caretAlign=="top"){menuY=menuY+(anchorHeight/2)-(caretHeight/2)-caretOffset;caretEl.css({"top":caretOffset+"px"});
1046}else if(caretAlign=="bottom"){menuY=menuY-(menuHeight)+(anchorHeight/2)+(caretHeight/2)+caretOffset;caretEl.css({"top":(menuHeight-caretHeight-caretOffset)+"px"});
1047}animInitialTop=menuY;}if(menuX+menuWidth>viewportWidth+scrollLeft){menuIsInViewPort=false;if(caretPosition=="left"){caretPosition="top";caretAlign="left";hideCaret=true;
1048}else if(caretPosition=="right"){menuX=viewportWidth-menuWidth+scrollLeft;menuIsInViewPort=true;hideCaret=true;}else if(caretPosition=="bottom"){if(caretAlign=="left"){caretAlign="middle";
1049}else if(caretAlign=="middle"){caretAlign="right";}else if(caretAlign=="right"){menuX=viewportWidth-menuWidth+scrollLeft;animInitialLeft=menuX;menuIsInViewPort=true;
1050hideCaret=true;}}else if(caretPosition=="top"){if(caretAlign=="left"){caretAlign="middle";}else if(caretAlign=="middle"){caretAlign="right";}else if(caretAlign=="right"){menuX=viewportWidth-menuWidth+scrollLeft;
1051animInitialLeft=menuX;menuIsInViewPort=true;hideCaret=true;}}}if(menuX<scrollLeft){if(caretPosition=="left"){menuX=scrollLeft;menuIsInViewPort=true;hideCaret=true;
1052}else if(caretPosition=="right"){caretPosition="top";caretAlign="right";hideCaret=true;}else if(caretPosition=="bottom"){if(caretAlign=="right"){caretAlign="middle";
1053}else if(caretAlign=="middle"){caretAlign="left";}else if(caretAlign=="left"){menuX=scrollLeft;menuIsInViewPort=true;hideCaret=true;}}else if(caretPosition=="top"){if(caretAlign=="right"){caretAlign="middle";
1054}else if(caretAlign=="middle"){caretAlign="left";}else if(caretAlign=="left"){menuX=scrollLeft;menuIsInViewPort=true;hideCaret=true;}}menuIsInViewPort=false;}animFinalLeft=menuX;
1055animFinalTop=menuY;}while(!menuIsInViewPort&&count<6);caretEl.css({"display":(hideCaret?"none":"block")});if(menuEl.data("visible")){menuEl.css({"opacity":"0","height":animInitialHeight+"px",
1056"width":animInitialWidth+"px","visibility":"visible","left":animInitialLeft+"px","top":animInitialTop+"px"});menuEl.stop(true).animate({"opacity":"1","height":animFinalHeight+"px",
1057"width":animFinalWidth+"px","left":animFinalLeft+"px","top":animFinalTop+"px"},350,"swing");}};var zf_DropDown_Instance=new zf_DropDown();;function zfl_stdTransformResponse(source,
1058name){var start=new Date();var obj=_zf_stdTransformResponse(source);var end=new Date();if(name==null)name="anonymous";;return obj;}function zfl_event(e,self,method){zf_stdStopPropagation(e);
1059zf_stdPreventDefault(e);var args=[];for(var i=3;i<arguments.length;i++)args.push(arguments[i]);method.apply(self,args);}function zfl_openLoginPage(comeback,verb){var href=comeback?comeback:location.href;
1060href=encodeURIComponent(href);var url=["https://",zf_secureHost,"/",zf_ownerName,"/login.html","?return=",href];location.href=zf_stdGetTransferUrl(url.join(""));
1061}
1061function zfl_getBackgroundPosition($element){var backgroundPosition=$element.data('background-position');if(backgroundPosition){return backgroundPosition;}if($element.css('background-image')=='none'){return null;
1062}backgroundPosition=$element.css('background-position');if(!backgroundPosition){return null;}backgroundPosition={'top':'top left','0%':'center left','50%':'center center',
1063'100%':'center right','bottom':'bottom center','0% 0%':'top left','50% 0%':'top center','100% 0%':'top right','0% 50%':'center left','50% 50%':'center center','100% 50%':'center right',
1064'0% 100%':'bottom left','50% 100%':'bottom center','100% 100%':'bottom right'}[backgroundPosition];if(!backgroundPosition){return null;}backgroundPosition=backgroundPosition.split(' ');
1065$element.data('background-position',backgroundPosition);return backgroundPosition;}zfl_Layout.Controls=function(layout){this.all=[];;this._layout=layout;};zfl_Layout.Controls.prototype.add=function(control){if(!control)return undefined;
1066this.all.push(control);this._init(control);if(arguments.length>1){var args=[];for(var a=1;a<arguments.length;a++)args.push(arguments[a]);control.init.apply(control,
1067args);}return control;};zfl_Layout.Controls.prototype.addUpdate=function(updateMethod){;var control={update:updateMethod};this.all.push(control);this._init(control);return control;
1068};zfl_Layout.Controls.prototype.addDeferredUpdate=function(tag,updateMethod){;;var control=this.addUpdate(updateMethod);control.update=zf_stdMakeDeferred(self.id+"."+tag,updateMethod);
1069return control;};zfl_Layout.Controls.prototype._init=function(control){;var layout=this._layout;control.layout=layout;control.command=layout._handlers.oncommand;control.commandtest=layout._handlers.oncommandtest;
1070control.zenbar=layout.zenbar;control.scrapbook=layout.scrapbook;control.onresize=function(){layout.recalc();};};;;;function zfl_Column(id,stretcherId,waterlines,decorated){zfl_Control.prototype.constructor.call(this,
1071id);if(stretcherId!=null&&document.getElementById(stretcherId)!=null)this.stretcherId=stretcherId;this._waterlines=[];for(var i=0;i<waterlines.length;i++){var w=waterlines[i];
1072if(document.getElementById(w.id))this._waterlines.push(w);}this.hasWaterline=this._waterlines.length>0;this._decorated=decorated;}zfl_Column.inherits(zfl_Control);zfl_Column.prototype.getMinHeight=function(){var domSelf=this.dom();
1073var cyTotal;if(this.hasWaterline){var above=zf_stdGetHeightAbove(domSelf);var offset=this._getWaterlineOffset(domSelf);cyTotal=above+offset;;}else{cyTotal=zf_stdGetHeightOverall(domSelf);
1074;}if(this.stretcherId!=null){var domStretcher=document.getElementById(this.stretcherId);var cyStretcher=zf_stdGetHeightOverall(domStretcher);cyTotal-=cyStretcher;
1075;};return cyTotal;};zfl_Column.prototype.getFixedHeight=function(){var domSelf=this.dom();var cyTotal=zf_stdGetHeightOverall(domSelf);var cyStretcher=0;if(this.stretcherId!=null){var domStretcher=document.getElementById(this.stretcherId);
1076cyStretcher=zf_stdGetHeightOverall(domStretcher);};return cyTotal-cyStretcher;};zfl_Column.prototype.stretch=function(height){var stretcher=document.getElementById(this.stretcherId);
1077if(this.onstretch&&this.onstretch(height,stretcher)){var actual=stretcher.offsetHeight;actual+=zf_stdExtractPixels(zf_stdGetCurrentStyle(stretcher,'margin-top','marginTopWidth'));
1078actual+=zf_stdExtractPixels(zf_stdGetCurrentStyle(stretcher,'margin-bottom','marginBottomWidth'));this.updateDecoration();return actual;}height-=zf_stdGetHeightAbove(stretcher);
1079height-=zf_stdGetHeightBelow(stretcher);stretcher.style.height=height+"px";this.updateDecoration();return height;};zfl_Column.prototype.updateDependencies=function(){if(this.dependencies){for(var i=0;
1080i<this.dependencies.length;i++){var control=this.dependencies[i];if(control&&control.oncolumnresize instanceof Function)control.oncolumnresize(this);}}};zfl_Column.prototype.updateDecoration=function(){};
1081zfl_Column.prototype._getWaterlineOffset=function(dom){var offset=null;for(var i=0;i<this._waterlines.length;i++){var w=this._waterlines[i];var wo=zf_stdGetOffset(w.id,dom).cy+w.offset;
1082if(offset==null)offset=wo;else offset=Math.min(offset,wo);}return offset;};;function zfl_Button(id,callback,type){zfl_Control.prototype.constructor.call(this,id);this._type=zfl_Button.CssDescriptor.GetDescriptor(type);
1083this._callback=callback;this.clickable=true;var self=this;this.$dom().hover(function(){zfl_Button.toggleHover(self.$dom("state"),self._type,true);},function(){zfl_Button.toggleHover(self.$dom("state"),
1084self._type,false);});this.$dom().bind('click',this.closure(this._button_onclick)).bind('selectstart',zf_stdFalse);$(window).bind('unload',this.closure(this._button_onunload));
1085}zfl_Button.inherits(zfl_Control);zfl_Button.prototype.toggleEnabled=function(toggle){zfl_Button.toggleEnabled(this.$dom("state"),this._type,toggle);return this;};zfl_Button.prototype.isEnabled=function(){return zfl_Button.isEnabled(this.$dom("state"));
1086};zfl_Button.prototype.togglePending=function(toggle){zfl_Button.togglePending(this.$dom("state"),this._type,toggle);return this;};zfl_Button.prototype.isPending=function(){return zfl_Button.isPending(this.$dom("state"));
1087};zfl_Button.prototype._button_onclick=function(e){if(!this.clickable||!this.isEnabled()||this.isPending())return false;var href=this.$().attr("href");var hasHref=!!href&&href!="#";
1088if(this._callback)this._callback();var event=jQuery.Event("zfl_click");this.$dom().trigger(event,[this]);if(event.isDefaultPrevented())return false;var isMozilla=($.browser)?$.browser.mozilla:/mozilla/.test(navigator.userAgent.toLowerCase());
1089var secureSpinner=isMozilla&&hasHref&&(href.indexOf('https')==0||href.indexOf('/zf/transfer/s')>-1);if(hasHref){if(secureSpinner)this.$().find('.label').css({"background":["url(https://",
1090zf_secureHost,"/zf/img/layout/spinner-16.gif) ","no-repeat 4px center"].join("")});else this.togglePending(true);}return hasHref;};zfl_Button.prototype._button_onunload=function(){this.togglePending(false);
1091};zfl_Button.attachToForm=function(btnNode,form){if(typeof(btnNode)=='string')btnNode=$(document.getElementById(btnNode));btnNode.bind('zfl_click',function(e,btn){form.submit({onrequestsend:function(){btn.togglePending(true);
1092},onreply:function(result,error){if(error!=null)btn.togglePending(false);form.onreply(result,error);}});});};zfl_Button.prototype.attachToForm=function(form){return zfl_Button.attachToForm(this.$dom(),
1093form);};zfl_Button.createHtml=function(id,label,classes,type){;var btnType=zfl_Button.CssDescriptor.GetDescriptor(type);
1093classes=classes==null?[]:classes;classes=["button",
1094btnType.FontNormalState].concat(classes);var labelClass=$.inArray("button-large",classes)>-1?"label "+btnType.FontHoverState:"label";classes=classes.join(" ");var stdclass="standard "+btnType.NormalState;
1095var typeString=type?"'"+type+"'":"null";var over="zfl_Button.toggleHover($(this), "+typeString+", true)";var out="zfl_Button.toggleHover($(this), "+typeString+", false)";
1096return['<div class="',classes,'"',(id==null?[]:[' id="',id,'"']),'>','<div',id?' id="'+id+'-state"':'',' class="',stdclass,'" onmouseover="',over,'" onmouseout="',
1097out,'">','<div class="left"></div>','<div class="right"></div>','<div class="middle">','<div class="',labelClass,'">',zf_stdHtmlEncode(label),'</div>','<div class="icon"></div>',
1098'</div>','</div>','</div>'].join("");};zfl_Button.getState=function($button){return $button.children().first();};zfl_Button.toggleHover=function($state,type,toggle){$state.toggleClass("s-hover",
1099toggle);zfl_Button._updateState($state,type);};zfl_Button.toggleEnabled=function($state,type,toggle){toggle=toggle==null?!zfl_Button.isEnabled($state):toggle;$state.toggleClass("s-disabled",
1100!toggle);zfl_Button._updateState($state,type);};zfl_Button.isEnabled=function($state){return!$state.hasClass("s-disabled");};zfl_Button.togglePending=function($state,type,toggle){toggle=toggle==null?!zfl_Button.isPending($state):toggle;
1101$state.toggleClass("s-pending",!!toggle);zfl_Button._updateState($state,type);};zfl_Button.isPending=function($state){return $state.hasClass("s-pending");};zfl_Button._updateState=function($state,
1102type){var btnType=type&&typeof type=="object"?type:zfl_Button.CssDescriptor.GetDescriptor(type);var enabled=!$state.hasClass("s-disabled");var pending=$state.hasClass("s-pending");
1103var hovered=$state.hasClass("s-hover");$state.toggleClass("standard "+btnType.NormalState,enabled&&!hovered&&!pending);$state.toggleClass("hover "+btnType.HoverState,
1104enabled&&hovered&&!pending);$state.toggleClass("disabled "+btnType.DisabledState,!enabled||pending);};zfl_Button.onmouseover=function(btn,type){var btnType=zfl_Button.CssDescriptor.GetDescriptor(type);
1105$(btn).removeClass("standard "+btnType.NormalState).addClass("hover "+btnType.HoverState);};zfl_Button.onmouseout=function(btn,type){var btnType=zfl_Button.CssDescriptor.GetDescriptor(type);
1106$(btn).removeClass("hover "+btnType.HoverState).addClass("standard "+btnType.NormalState);};zfl_Button.enableButton=function(btn,enable,type){var btnType=zfl_Button.CssDescriptor.GetDescriptor(type);
1107$(btn).toggleClass(btnType.DisabledState+" abutton-disabled",!enable).find(".icon").toggleClass("icon-disabled",!enable);};zfl_Button.Type={NavBtn:'navigation',Plain:'button'};
1108zfl_Button.CssDescriptor={GetDescriptor:function(type){var btnType=type||zfl_Button.Type.Plain;btnType=zfl_Button.CssDescriptor[btnType]||zfl_Button.CssDescriptor.button;return btnType;
1109},button:{NormalState:'button-bgcolor1 button-color1 button-border1',HoverState:'button-bgcolor2 button-color2 button-border2',DisabledState:'button-bgcolor3 button-color3 button-border3',
1110FontNormalState:'button-font1',FontHoverState:'button-font2'},navigation:{NormalState:'navigation-bgcolor1 navigation-color1 navigation-border1',HoverState:'navigation-bgcolor2 navigation-color2 navigation-border2',
1111DisabledState:'navigation-bgcolor3 navigation-color3 navigation-border3',FontNormalState:'navigation-font1',FontHoverState:'navigation-font2'}};;;function zfl_Bin(id){zfl_Control.prototype.constructor.call(this,
1112id);this.expanded=this.dom("state").className.indexOf("bin-expanded")!=-1;}zfl_Bin.inherits(zfl_Control);zfl_Bin.prototype.toggle=function(){this.expanded=!this.expanded;var cookieValue=0,
1113cookieMask=0,cookieBit=0;var cookieIndex=parseInt(this.dom().getAttribute("zf:cookie"));if(!isNaN(cookieIndex)){cookieValue=parseInt(zf_stdGetCookie("zf_10y_lbinv"));
1114if(isNaN(cookieValue))cookieValue=0;cookieMask=parseInt(zf_stdGetCookie("zf_10y_lbinm"));if(isNaN(cookieMask))cookieMask=0;cookieBit=1<<cookieIndex;}var domState=this.dom("state");
1115if(this.expanded){zf_stdReplaceClassName(domState,"bin-collapsed","bin-expanded");cookieValue=cookieValue|cookieBit;cookieMask=cookieMask|cookieBit;}else{zf_stdReplaceClassName(domState,
1116"bin-expanded","bin-collapsed");cookieValue=cookieValue&~cookieBit;cookieMask=cookieMask|cookieBit;}if(!isNaN(cookieIndex)){zf_stdSetCookie("zf_10y_lbinv",cookieValue,
1117new Date(2020,1,1));zf_stdSetCookie("zf_10y_lbinm",cookieMask,new Date(2020,1,1));}if(this.ontoggle!=null)this.ontoggle(this.expanded);if(this.expanded){var offset=zf_stdGetOffset(this.dom());
1118var scroll=zf_stdGetClientScroll();var binHeight=this.$dom().outerHeight(true)+40;var clientHeight=zf_stdGetClientHeight();if(scroll.cy+clientHeight-100<offset.cy){scroll=offset.cy+Math.min(clientHeight-10,
1119binHeight)-clientHeight;$('html,body').animate({scrollTop:scroll},300);}}};zfl_Bin.prototype._feeds_onclick=function(e){zf_stdStopPropagation(e);zf_stdPreventDefault(e);
1120if(this.onfeeds!=null)this.onfeeds(zf_stdGetEventSource(e));};zfl_Bin.prototype.setTitleSuffix=function(suffix){this.$dom("title-suffix").toggleClass('none',!suffix).html(suffix);
1121};;;function zfl_Pair(id,field,format){zfl_Control.prototype.constructor.call(this,id);this.field=field;this.format=format;this._formatter=zfl_Pair.formatters[field];}zfl_Pair.inherits(zfl_Control);
1122zfl_Pair.formatters={};zfl_Pair.formatters["PhotoPage.Uploaded"]=function(photo){if((photo.access.mask&zf_AccessMask.ProtectDateCreated)!=0){this.display(false);}else{this.set(zf_stdFormatDate(photo.uploaded));
1123this.display(true);}};zfl_Pair.formatters["PhotoPage.Viewed"]=function(photo){if((photo.access.mask&zf_AccessMask.ProtectVisits)!=0){this.display(false);}else{this.set(photo.views);
1124this.display(true);}};zfl_Pair.formatters["PhotoPage.Taken"]=function(photo){if(!photo.taken||(photo.access.mask&zf_AccessMask.ProtectDateTaken)!=0){this.display(false);
1125}else{this.set(zf_stdFormatDate(photo.taken));this.display(true);}};zfl_Pair.prototype.set=function(text,index,loading){if(!loading)this.visibility(true);var bees=this.dom().getElementsByTagName("B");
1126var className=index==null?"pair-0":("pair-"+index);for(var i=0;i<bees.length;i++){if(zf_stdHasClassName(bees[i],className)){if(loading){bees[i].innerHTML=['<span class="pair-loading pair-font1">',
1127text,'</span>'].join("");}else{bees[i].innerHTML="";zf_stdSetText(bees[i],text);}break;}}};zfl_Pair.prototype.showLoading=function(){this.set("loading...",0,true);};zfl_Pair.prototype.update=function(obj){;
1128;if(this._formatter==null||this.current==obj)return;if(this.current!=null)this.current.unadvise(this);if(obj.loaded){this._formatter(obj);}else{var self=this;obj.advise(this,
1129function(){self._formatter(obj);},function(){self.showLoading();});}this.current=obj;};;;function zfl_PhotoSelection(scope){this._scope=scope;this._selection={};}zfl_PhotoSelection._storage_prefix="layout.selection.";
1130zfl_PhotoSelection.prototype.none=function(){return $.isEmptyObject(this._selection);};zfl_PhotoSelection.prototype.selected=function(photoId){return this._selection["_"+photoId]==photoId;};zfl_PhotoSelection.prototype.select=function(photoIds){if(!$.isArray(photoIds))return this.select([photoIds]);
1131var changed=false;var selection=this._selection;var key;$.each(photoIds,function(k,v){key="_"+v;changed=changed||!selection[key];selection[key]=v;});if(changed&&this.onchange)this.onchange();
1132return changed;};zfl_PhotoSelection.prototype.unselect=function(photoIds){if(arguments.length==0){if(this.none())return false;this._selection={};if(this.onchange)this.onchange();return true;
1133}if(!$.isArray(photoIds))return this.unselect([photoIds]);var changed=false;var selection=this._selection;var key;$.each(photoIds,function(k,v){key="_"+v;changed=changed||selection[key];
1134delete selection[key];});if(changed&&this.onchange)this.onchange();return changed;};zfl_PhotoSelection.load=function(key,scope){var self=new zfl_PhotoSelection(scope);var data=zf_storage.getItem(zfl_PhotoSelection._storage_prefix+key);
1135if(!data)return self;var prefix=["v1",scope?scope:"",","].join("");if(data.indexOf(prefix)!=0||(data.length-prefix.length)%8!=0)return self;var selection={};for(var offset=prefix.length;
1136offset<data.length;offset+=8){var decoded=zf_toInt32(parseInt(data.substr(offset,8),16));;if(isNaN(decoded))return self;selection["_"+decoded]=decoded;};self._selection=selection;
1137return self;};zfl_PhotoSelection._paddings=["","0","00","000","0000","00000","000000","0000000"];zfl_PhotoSelection.prototype.save=function(key){;if(this.none()){zf_storage.removeItem(zfl_PhotoSelection._storage_prefix+key);
1138return;}var data=["v1",this._scope?this._scope:"",","];var count=0;$.each(this._selection,function(k,v){;var encoded=zf_toUint32(v).toString(16);;if(encoded.length<8)data.push(zfl_PhotoSelection._paddings[8-encoded.length]);
1139data.push(encoded);++count;});zf_storage.setItem(zfl_PhotoSelection._storage_prefix+key,data.join(""));;};zfl_PhotoSelection.prototype.get=function(){var ids=[];$.each(this._selection,
1140function(k,v){ids.push(v);});return ids;};zfl_PhotoSelection.prototype.getPhotos=function(list){var ids=[];$.each(this._selection,function(k,v){ids.push(v);});return $.map(ids,function(id){var index=list.find(id);
1141;if(index==-1)return null;var photo=list.get(index);;return photo;});};;;;function zfl_SearchInput(id,customize,path,query){zfl_Control.prototype.constructor.call(this,id);
1142this._customize=customize;this._path=path;this._query=query;this.$dom("menu").hover(function(){$(this).show();},function(){$(this).hide();});}zfl_SearchInput.inherits(zfl_Control);
1143zfl_SearchInput.prototype.search=function(verb){var uri=null;if(verb==="browse"){uri=[zf_stdGetProtocol(zf_defaultHost),zf_defaultHost,"/zf/search/"].join("");uri=zf_stdGetTransferUrl(uri);
1144}else{var search=this.dom("input");if(!search.edited){;return;}var query=encodeURIComponent(search.value);if(verb==="global"){uri=[zf_stdGetProtocol(zf_defaultHost),
1145zf_defaultHost,"/zf/search/#q=",query].join("");uri=zf_stdGetTransferUrl(uri);}else if(verb==="local"){zf_stdSetCookie("zfl_search","",null,true,true);if(location.hostname===zf_secureHost){uri=[zf_stdGetProtocol(zf_ownerDomain),
1146zf_ownerDomain,'/?q=',query].join('');}else{uri=[this._path,'?',this._query,'=',query].join('');}if(this._customize){uri+="&customize="+this._customize;}}}
1146if(uri){location.href=uri;
1147}};zfl_SearchInput.prototype._menuitem_onmouseover=function(item){zf_stdReplaceClassName(item,null,"hover");zf_stdReplaceClassName(item,null,"header-bgcolor4");var a=item.getElementsByTagName("A");
1148if(a.length>0)a[0].className="header-color2";};zfl_SearchInput.prototype._menuitem_onmouseout=function(item){zf_stdReplaceClassName(item,"hover",null);zf_stdReplaceClassName(item,
1149"header-bgcolor4",null);var a=item.getElementsByTagName("A");if(a.length>0)a[0].className="header-color1";};zfl_SearchInput.prototype._input_onfocus=function(item){if(!$(item).is('[placeholder]')&&item.value=="SEARCH")item.value="";
1150item.edited=true;$(item).addClass('searchi-input-focus');};zfl_SearchInput.prototype._input_onblur=function(item){if(zf_stdTrim(item.value)==""){if(!$(item).is('[placeholder]'))item.value="SEARCH";
1151item.edited=false;$(item).removeClass('searchi-input-focus');}};zfl_SearchInput.prototype._input_onkeydown=function(e){e=zf_stdGetEvent(e);if(e.keyCode==13){zf_stdPreventDefault(e);
1152zf_stdStopPropagation(e);this.dom("input").blur();this.search("local");}};zfl_SearchInput.prototype._showMenu=function(show){var $menu=this.$dom("menu");var offset=this.$('.searchi-icon').offset();
1153$menu.detach().appendTo('body').css({right:zf_stdGetClientWidth()-offset.left-32,top:offset.top+16});if(show)$menu.show();else $menu.hide();};zfl_SearchInput.prototype._onmouseout=function(e){e=zf_stdGetEvent(e);
1154var to=(e.relatedTarget||e.toElement);var inside=false;var dom=this.dom();try{for(var p=to;p!=null;p=p.parentNode){if(p==dom){inside=true;break;}}}catch(e){}if(!inside)this._showMenu(false);
1155};;;function zfl_AbstractMenu(id,vertical,subMenuHDir,subMenuVDir){this._subMenuVDir=subMenuVDir;this._subMenuHDir=subMenuHDir;this.vertical=vertical;this._suspendHover=null;
1156this._showed=undefined;this._extraHorzPadding=0;zfl_Control.prototype.constructor.call(this,id);this.root=function(){return $("BODY > .menu-submenu")[0];};}zfl_AbstractMenu.inherits(zfl_Control);
1157zfl_AbstractMenu.prototype.hoverItem=function($item,hoverOn){};zfl_AbstractMenu.prototype.hoverSubItem=function($item,hoverOn){if(hoverOn){$item.removeClass("homemenu-color4 homemenu-bgcolor6 homemenu-bgimage5").addClass("homemenu-color5 homemenu-bgcolor7 homemenu-bgimage6");
1158}else{$item.removeClass("homemenu-color5 homemenu-bgcolor7 homemenu-bgimage6").addClass("hhomemenu-color4 homemenu-bgcolor6 homemenu-bgimage5");}};zfl_AbstractMenu.prototype.getCurrentMenu=function(){return zfl_Layout.currentMenu;
1159};zfl_AbstractMenu.prototype.setCurrentMenu=function(menu){zfl_Layout.currentMenu=menu;};zfl_AbstractMenu.prototype.bind=function($items){var self=this;var showMenu=function(){var $this=$(this);
1160if($this.attr("data-zf-index")==null)$this=$this.find(".menu-top-item > [data-zf-index]:first");;self.hoverItem($(this),true);if(self._suspendHover!=null&&(new Date()).getTime()<self._suspendHover){;
1161return;}if(self.getCurrentMenu()!=self){;$(self.dom()).stop(true,true).delay(200).queue(function(){;self.showSubMenu($this);$(self.dom()).dequeue();});}else{;self.showSubMenu($this);
1162}};var hideMenu=function(){;var $this=$(this);if($this.attr("data-zf-index")==null)$this=$this.find(".menu-top-item > [data-zf-index]:first");self.hoverItem($(this),
1163false);if(self._suspendHover!=null&&(new Date()).getTime()<self._suspendHover){;return;}self.hideByIndex($this.attr("data-zf-index"));};var showMenuImmediate=function(event){;
1164var $this=$(this);if($this.attr("data-zf-index")==null)$this=$this.find(".menu-top-item > [data-zf-index]:first");self.showSubMenu($this);event.preventDefault();
1165};$items.hover(showMenu,hideMenu).click(showMenuImmediate);};zfl_AbstractMenu.prototype._calculateSubMenu=function($item,$added,width,height,smBorderWidth){if(this._subMenuVDir==null){var selfTopPos=$(this.dom()).offset().top;
1166var documentHeight=$(document).height();if(selfTopPos<documentHeight/2)this._subMenuVDir="d";else this._subMenuVDir="u";}var vOrientation=this._subMenuVDir;var hOrientation=this._subMenuHDir;
1167var fontSize=parseFloat($item.css("font-size"));var extraVertPadding=0;if(!this.vertical){if(fontSize<14)extraVertPadding=0;else if(fontSize<18)extraVertPadding=1;
1168else if(fontSize<22)extraVertPadding=2;else extraVertPadding=4;}var viewPortWidth=parseFloat($(window).width());var viewPortHeight=parseFloat($(window).height());
1169var viewPortLeft=$(window).scrollLeft();var viewPortTop=$(window).scrollTop();var paddingTop=parseFloat($item.css("padding-top"))||0;var paddingBottom=parseFloat($item.css("padding-bottom"))||0;
1170var itemHeightWithBorders=$item.outerHeight()-paddingTop-paddingBottom;var itemBorderWidth=(parseFloat($item.css("border-left-width"))||0);var menuItemHeight=((itemHeightWithBorders-25)%2==0)?25:24;
1171var marginTop=(parseFloat($item.css("margin-top"))||0);var marginBottom=(parseFloat($item.css("margin-bottom"))||0);var itemHeight=$item.outerHeight(true)-paddingTop-paddingBottom-marginTop-marginBottom;
1172;;var topItemHeight=Math.max(itemHeight,menuItemHeight)+2*extraVertPadding;var topItemHeightComplete=topItemHeight+paddingTop+paddingBottom+marginTop+marginBottom;
1173var topItemHeightOffset=(itemHeightWithBorders-topItemHeight)/2+marginTop;var paddingLeft=parseFloat($item.css("padding-left"))||0;var paddingRight=parseFloat($item.css("padding-right"))||0;
1174var tiWidth=$item.outerWidth()-paddingLeft-paddingRight;var originalWidth=width;width=Math.max(width,$item.innerWidth()-2*this._extraHorzPadding);;;;;var vShift=0;
1175if(vOrientation=="d"){if($item.offset().top-viewPortTop+menuItemHeight+height>viewPortHeight){if($item.offset().top>height)vOrientation="u";
1175else vShift=height-((viewPortHeight+viewPortTop)-$item.offset().top);
1176}}else if(vOrientation=="u"){if($item.offset().top+menuItemHeight-viewPortTop<height){if(viewPortHeight-($item.offset().top-viewPortTop)>height)vOrientation="d";
1177else vShift=height-($item.offset().top+menuItemHeight-viewPortTop);}};if(hOrientation=="r"){if($item.offset().left-viewPortLeft+$item.outerWidth(false)+width+10>viewPortWidth)hOrientation="l";
1178}else if(hOrientation=="l"){if($item.offset().left-viewPortLeft+width+10>viewPortWidth)hOrientation="r";}var $topItem=$added.find(".menu-submenu-top-item");this._setSubmenuRadius($added,
1179vOrientation,hOrientation);;var res={submenuStyles:{},topItemStyles:{borderWidth:smBorderWidth},topItemAStyles:{}};if(this.vertical){switch(hOrientation){case "r":$.extend(res.submenuStyles,
1180{left:$item.offset().left+$item.outerWidth(false)-2*smBorderWidth});$.extend(res.topItemStyles,{left:-$item.outerWidth(false)+smBorderWidth,borderRightStyle:"none",
1181paddingRight:smBorderWidth});break;case "l":$.extend(res.submenuStyles,{right:$("BODY").innerWidth()-$item.offset().left});$.extend(res.topItemStyles,{right:-($item.outerWidth(false)-smBorderWidth),
1182borderLeftStyle:"none",paddingLeft:smBorderWidth});break;default:break;}switch(vOrientation){case "d":$.extend(res.submenuStyles,{top:$item.offset().top-topItemHeightOffset-vShift-smBorderWidth});
1183;$.extend(res.topItemStyles,{paddingTop:extraVertPadding,paddingBottom:extraVertPadding,top:0+vShift});break;case "u":$.extend(res.submenuStyles,{bottom:Math.round($("BODY").innerHeight()-$item.offset().top-$item.outerHeight(true)-smBorderWidth-vShift-2*extraVertPadding+topItemHeightOffset)});
1184$.extend(res.topItemStyles,{paddingTop:extraVertPadding,paddingBottom:extraVertPadding,bottom:0+vShift});break;default:break;}}else{switch(hOrientation){case "r":$.extend(res.submenuStyles,
1185{left:$item.offset().left+this._extraHorzPadding-smBorderWidth});$.extend(res.topItemStyles,{left:itemBorderWidth,borderWidth:smBorderWidth});;break;case "l":$.extend(res.submenuStyles,
1186{right:$("BODY").innerWidth()+this._extraHorzPadding-$item.offset().left-$item.outerWidth()+smBorderWidth});$.extend(res.topItemStyles,{right:-0,borderWidth:smBorderWidth});
1187break;default:break;}switch(vOrientation){case "d":;;$.extend(res.submenuStyles,{top:$item.offset().top+topItemHeightComplete+topItemHeightOffset+extraVertPadding});
1188;$.extend(res.topItemStyles,{top:-topItemHeightComplete-2*extraVertPadding-smBorderWidth,borderBottomStyle:"none",paddingTop:extraVertPadding,paddingBottom:smBorderWidth+extraVertPadding});
1189break;case "u":$.extend(res.submenuStyles,{bottom:$("BODY").innerHeight()-topItemHeightOffset-$item.offset().top+extraVertPadding});;$.extend(res.topItemStyles,{bottom:-(topItemHeightComplete+smBorderWidth)-2*extraVertPadding,
1190borderTopStyle:"none",paddingBottom:extraVertPadding,paddingTop:smBorderWidth+extraVertPadding});break;default:break;}};if(originalWidth!=width){$.extend(res.submenuStyles,
1191{width:width});}$.extend(res.topItemStyles,{width:tiWidth-2*this._extraHorzPadding+paddingLeft+paddingRight-2*smBorderWidth});$.extend(res.topItemAStyles,{height:topItemHeight,
1192width:tiWidth-2*smBorderWidth,paddingLeft:paddingLeft-this._extraHorzPadding,paddingRight:paddingRight-this._extraHorzPadding,paddingTop:paddingTop,paddingBottom:paddingBottom,
1193lineHeight:(topItemHeight)+"px"});return res;};zfl_AbstractMenu.prototype.showSubMenu=function($item){var index;if(typeof($item)=="string"||typeof($item)=="number"){index=parseInt($item);
1194$item=$(this.dom()).find('A[data-zf-index="'+index+'"]');}else{index=parseInt($item.attr("data-zf-index"));};$(this.dom()).stop(true,true);;if(this._showed==index)return;
1195if(this.getCurrentMenu())this.getCurrentMenu().remove();this._showed=index;this.setCurrentMenu(this);var $added=$item.closest("LI").find(".menu-submenu").clone().appendTo("BODY");
1196var $submenu=$added.find(".menu-submenu-inner");$added.css("visibility","hidden").show();$submenu.css("visibility","hidden").show();var smWidth=$submenu.outerWidth();
1197var smHeight=$submenu.outerHeight();var smBorderWidth=parseFloat($submenu.find(".menu-submenu-middle").css("border-left-width"));$submenu.hide().css("visibility",
1198"visible");$added.hide().css("visibility","visible");;var sm=this._calculateSubMenu($item,$added,smWidth,smHeight,smBorderWidth);var self=this;$added.hover(function(){self.showSubMenu(index);
1199},function(){self.hideByIndex(index);});$added.find(".menu-submenu-inner A").hover(function(){self.hoverSubItem($(this),true);},function(){self.hoverSubItem($(this),
1200false);});$added.find(".menu-submenu-top-item A").click(function(event){self.remove();self._suspendHover=(new Date()).getTime()+100;event.preventDefault();event.stopPropagation();
1201});var $topItem=$added.find(".menu-submenu-top-item");$added.css(sm.submenuStyles);$added.show();$topItem.removeAttr("href");
1201$topItem.css(sm.topItemStyles).find("A").css($.extend({textAlign:$item.css("text-align"),
1202fontFamily:$item.css("font-family"),fontSize:$item.css("font-size"),textTransform:$item.css("text-transform"),letterSpacing:$item.css("letter-spacing"),fontWeight:$item.css("font-weight"),
1203fontStyle:$item.css("font-style")},sm.topItemAStyles));;$topItem.css("visibility","hidden").show();$topItem.css("visibility","visible");$added.find(".menu-submenu-inner").slideDown(200);
1204};zfl_AbstractMenu.prototype.hideByIndex=function(index){;;var self=this;var reset=function(){var $menu=$("BODY > .menu-submenu");if($menu.find(".menu-submenu-top-item [data-zf-index]").attr("data-zf-index")!=index)return;
1205$menu.remove();self._showed=null;if(self.getCurrentMenu()==self)self.setCurrentMenu(null);};var slideUp=function(){;$(self.dom()).dequeue();if(self._showed==null){;
1206return;}var $menu=$("BODY > .menu-submenu");if($menu.find(".menu-submenu-top-item [data-zf-index]").attr("data-zf-index")!=index){return;}$menu.stop(true,true).find(".menu-submenu-inner").slideUp(100,
1207reset);};$(this.dom()).stop(true,true).delay(400).queue(slideUp);};zfl_AbstractMenu.prototype.remove=function(){var $menu=$("BODY > .menu-submenu");;this._showed=null;$(this.dom()).stop(true,
1208true);$menu.stop(true,true).hide().remove();if(this.getCurrentMenu()==self)this.setCurrentMenu(null);};zfl_AbstractMenu.prototype._getMenuName=function(){return '';};zfl_AbstractMenu.prototype._setSubmenuRadius=function(elAt,
1209vOrientation,hOrientation){var $topItem=elAt.find(".menu-submenu-top-item");var $subMenuFrame=elAt.find(".menu-submenu-middle");var menumame=this._getMenuName();
1210$topItem.removeClass(menumame+'-tl');$topItem.removeClass(menumame+'-tr');$topItem.removeClass(menumame+'-bl');$topItem.removeClass(menumame+'-br');$subMenuFrame.removeClass(menumame+'-tl');
1211$subMenuFrame.removeClass(menumame+'-tr');$subMenuFrame.removeClass(menumame+'-bl');$subMenuFrame.removeClass(menumame+'-br');if(this.vertical){if(vOrientation=='d'){if(hOrientation=='l'){$topItem.addClass(menumame+'-tr');
1212$topItem.addClass(menumame+'-br');$subMenuFrame.addClass(menumame+'-tl');$subMenuFrame.addClass(menumame+'-bl');$subMenuFrame.addClass(menumame+'-br');}if(hOrientation=='r'){$topItem.addClass(menumame+'-tl');
1213$topItem.addClass(menumame+'-bl');$subMenuFrame.addClass(menumame+'-tr');$subMenuFrame.addClass(menumame+'-bl');$subMenuFrame.addClass(menumame+'-br');}}else if(vOrientation=='u'){if(hOrientation=='l'){$topItem.addClass(menumame+'-tr');
1214$topItem.addClass(menumame+'-br');$subMenuFrame.addClass(menumame+'-tl');$subMenuFrame.addClass(menumame+'-tr');$subMenuFrame.addClass(menumame+'-bl');}if(hOrientation=='r'){$topItem.addClass(menumame+'-tl');
1215$topItem.addClass(menumame+'-bl');$subMenuFrame.addClass(menumame+'-tr');$subMenuFrame.addClass(menumame+'-tl');$subMenuFrame.addClass(menumame+'-br');}}}else{if(vOrientation=='d'){if(hOrientation=='l'){$topItem.addClass(menumame+'-tl');
1216$topItem.addClass(menumame+'-tr');$subMenuFrame.addClass(menumame+'-tl');$subMenuFrame.addClass(menumame+'-bl');$subMenuFrame.addClass(menumame+'-br');}if(hOrientation=='r'){$topItem.addClass(menumame+'-tl');
1217$topItem.addClass(menumame+'-tr');$subMenuFrame.addClass(menumame+'-tr');$subMenuFrame.addClass(menumame+'-bl');$subMenuFrame.addClass(menumame+'-br');}}else if(vOrientation=='u'){if(hOrientation=='l'){$topItem.addClass(menumame+'-bl');
1218$topItem.addClass(menumame+'-br');$subMenuFrame.addClass(menumame+'-tl');$subMenuFrame.addClass(menumame+'-tr');$subMenuFrame.addClass(menumame+'-bl');}if(hOrientation=='r'){$topItem.addClass(menumame+'-bl');
1219$topItem.addClass(menumame+'-br');$subMenuFrame.addClass(menumame+'-tr');$subMenuFrame.addClass(menumame+'-tl');$subMenuFrame.addClass(menumame+'-br');}}}};;;function zfl_HeaderMenu(id){zfl_AbstractMenu.prototype.constructor.call(this,
1220id,false,"r","d");this._extraHorzPadding=-2;this.bind($(this.dom()).find("A[data-zf-subitems]"));var self=this;var onresize=function(){var hdr=self.$().closest('.hdr');
1221var totalWidth=hdr.width();var usedWidth=(hdr.find('.hdr-search').outerWidth()||0)+(hdr.find('.hdr-social').outerWidth()||0)+(hdr.find('.hdr-logo').outerWidth()||0);
1222var availWidth=totalWidth-usedWidth;self.setWidth(availWidth);};$(window).load(function(){onresize();});$(window).bind('resize',onresize);}zfl_HeaderMenu.inherits(zfl_AbstractMenu);
1223zfl_HeaderMenu.prototype.setWidth=function(maxWidth){if(maxWidth){;var items=this.$(".header-link");items.removeClass("hidden");var width=0,inc=0;for(var i=0;i<items.length;i++){var item=items.eq(i);
1224inc+=item.outerWidth(true);;if(width+inc>maxWidth){for(var j=i;j<items.length;j++){items.eq(j).addClass("hidden");}break;}else{width+=inc;inc=0;}};width+=2;this.$("UL").css('max-width',
1225width);}else{this.$("UL").css('max-width','none');}};zfl_HeaderMenu.prototype.hoverSubItem=function($item,hoverOn){if(hoverOn){$item.removeClass("header-color8").addClass("header-color9 header-bgcolor6");
1226}else{$item.removeClass("header-color9 header-bgcolor6").addClass("header-color8");}};zfl_HeaderMenu.prototype._getMenuName=function(){return 'headersubmenu';};;;function zfl_HeaderMenuBar(id){zfl_AbstractMenu.prototype.constructor.call(this,
1227id,false,"r","d");this.bind($(this.dom()).find("A[data-zf-subitems]"));this.$("a:not([data-zf-subitems])").hover(function(){$(this).removeClass("menubar-color1").addClass("menubar-color2 menubar-bgcolor2");
1228},function(){$(this).addClass("menubar-color1").removeClass("menubar-color2 menubar-bgcolor2");});}zfl_HeaderMenuBar.inherits(zfl_AbstractMenu);zfl_HeaderMenuBar.prototype.hoverItem=function($item,
1229hoverOn){};zfl_HeaderMenuBar.prototype.hoverSubItem=function($item,hoverOn){if(hoverOn){$item.removeClass("menubar-bgcolor3 menubar-color3 menubar-bgcolor5").addClass("menubar-bgcolor4 menubar-color4");
1230}else{$item.removeClass("menubar-bgcolor4 menubar-color4").addClass("menubar-bgcolor3 menubar-color3 menubar-bgcolor5");}};zfl_HeaderMenuBar.prototype._getMenuName=function(){return 'barsubmenu';
1231};;;function zfl_HeaderSearch(id){zfl_Control.prototype.constructor.call(this,id);this._search_slider_delay=new zf_DelayedInvoke(800);var self=this;this.$('.hdr-search-slider').mouseenter(this.closure(this._slider_search_onmouseenter)).mouseleave(this.closure(this._slider_search_onmouseleave));
1232}zfl_HeaderSearch.inherits(zfl_Control);zfl_HeaderSearch.prototype._slider_search_onmouseenter=function(e){var self=this;if(e.relatedTarget){for(var parent=e.relatedTarget;parent!=null;parent=parent.parentNode){if(zf_stdHasClassName(parent,
1233"lb"))return;}}this._search_slider_delay.clear();this.$('.hdr-search-slider,.hdr-search-bgc').removeClass('collapsed').animate({width:"204px"},{duration:"fast",easing:"swing",
1234queue:false,complete:function(){$(this).addClass('expanded');}});};zfl_HeaderSearch.prototype._slider_search_onmouseleave=function(){var self=this;this._search_slider_delay.invoke(function(){$(self.$('.hdr-search-slider,.hdr-search-bgc')).removeClass("expanded").animate({width:"22px"},
1235{duration:"slow",easing:"swing",queue:false,complete:function(){$(this).addClass("collapsed");}});});};;function zfl_Header(id){zfl_Control.prototype.constructor.call(this,
1236id);}zfl_Header.inherits(zfl_Control);zfl_Header.prototype.customize=function(){var search=location.search.replace(/(\?|&)customize=\d/g,"");if(search.charAt(0)=="&")search="?"+search.substring(1);
1237if(search.length>0)search+="&customize=1";else search="?customize=1";location.href=location.pathname+search+location.hash;};zfl_Header.login=function(comeback,verb){zfl_openLoginPage(comeback,
1238verb);};zfl_Header.prototype.login=function(verb){var href=null;if(this.current&&this.current.loaded)href=this.current.getHref("full");zfl_Header.login(href,verb);};zfl_Header.prototype.logout=function(){var href;
1239if(this.current&&this.current.loaded)href=this.current.getHref("full");else href=location.href;location.href=zf_stdGetLogoutUrl(href);};zfl_Header.prototype.update=function(photo){};
1240;function zf_ProtoItem(){this.photos=[];this.settings={};this.services={};this.extra={};this.isDeprecated=false;}zf_ProtoItem.prototype.clean=function(){var res=jQuery.extend(new zf_ProtoItem(),
1241this);delete res.extra;if(res.hasOwnProperty('oldPages')){delete res.oldPages;}if(res.hasOwnProperty('oldElements')){delete res.oldElements;}return res;};zf_ProtoItem.prototype.clone=function(){var copy=$.extend({},
1242this);copy.photos=this.photos&&$.extend(true,[],this.photos);copy.settings=this.settings&&$.extend({},this.settings);copy.services=this.services&&$.extend({},this.services);
1243copy.extra=this.extra&&$.extend({},this.extra);copy.oldPages=this.oldPages&&$.extend(true,{},this.oldPages);copy.oldElements=this.oldElements&&$.extend(true,{},this.oldElements);
1244return copy;};zf_ProtoItem.prototype.getPhoto=function(imageId,index){return $.lookup(this.photos,function(p){return p.imageId==imageId&&p.index==index;});};zf_ProtoItem.clean=function(items){items=[].concat(items);
1245for(var i=0;i<items.length;i++)items[i]=items[i].clean();return items;};;function zf_ProtoPackage(){this.extra={};}zf_ProtoPackage.prototype.clean=function(){var res=$.extend(new zf_ProtoPackage(),
1246this);if(res.items!=null)res.items=zf_ProtoItem.clean(res.items);delete res.extra;return res;};zf_ProtoPackage.clean=function(items){;return $.map(items,function(item){return item.clean();
1247});};;function zfl_DecorationInfo(){this.imagePad=false;this.borderSize=0;this.shadowSize=0;this.extraSize=0;}zfl_DecorationInfo.getShadowHtml=function(className,name,type,size,left,top,width,
1248height,forcePieceWise){var i;var sb=[];var sgprefix,sgsuffix;var elements;if(!type||type=="system"){if(!forcePieceWise&&width<=300&&height<=300){zfl_DecorationInfo._getSystemShadowHtml(sb,
1249className,name,size,left,top,width,height);}else{zfl_DecorationInfo._getSystemShadowHtml(sb,className,name,size,left,top,width,height,"left");zfl_DecorationInfo._getSystemShadowHtml(sb,
1250className,name,size,left,top,width,height,"right");zfl_DecorationInfo._getSystemShadowHtml(sb,className,name,size,left,top,width,height,"top");zfl_DecorationInfo._getSystemShadowHtml(sb,
1251className,name,size,left,top,width,height,"bottom");}}else if(type=="preset"){size=25;elements=[{part:"top-left",left:left,top:top,width:size,height:size},{part:"top",
1252left:left+size,top:top,width:width-size*2,height:size},{part:"top-right",left:left+width-size,top:top,width:size,height:size},{part:"left",left:left,top:top+size,
1253width:size,height:height-size*2},{part:"right",left:left+width-size,top:top+size,width:size,height:height-size*2},{part:"bottom-left",left:left,top:top+height-size,
1254width:size,height:size},{part:"bottom",left:left+size,top:top+height-size,width:width-size*2,height:size},{part:"bottom-right",left:left+width-size,top:top+height-size,
1255width:size,height:size}];sgprefix='background-image:url(/zf/img/layout/presets/';sgsuffix='.png)';
1255for(i=0;i<elements.length;i++){zfl_DecorationInfo._getCustomShadowHtml(sb,
1256className,name,elements[i],sgprefix,sgsuffix);}}else if(type=="custom"){size=25;elements=[{part:"120",left:left,top:top,width:size,height:size},{part:"121",left:left+size,
1257top:top,width:width-size*2,height:size},{part:"122",left:left+width-size,top:top,width:size,height:size},{part:"127",left:left,top:top+size,width:size,height:height-size*2},
1258{part:"123",left:left+width-size,top:top+size,width:size,height:height-size*2},{part:"126",left:left,top:top+height-size,width:size,height:size},{part:"125",left:left+size,
1259top:top+height-size,width:width-size*2,height:size},{part:"124",left:left+width-size,top:top+height-size,width:size,height:size}];sgprefix='background-image:url(/img/';
1260sgsuffix='.png)';for(i=0;i<elements.length;i++){zfl_DecorationInfo._getCustomShadowHtml(sb,className,name,elements[i],sgprefix,sgsuffix);}}return sb.join("");};zfl_DecorationInfo._getSystemShadowHtml=function(sb,
1261className,name,size,left,top,width,height,side){var inner=16;var sgprefix,sgsuffix;var hostname="";if(zf_stdAllowCdnHost()){hostname=[location.protocol,"//",zf_cdnHost].join("");
1262}else if(zf_imageHosts.length>0){var key=Math.abs((width*(9839851291^height))%12500419+(side?side.length:0));hostname=[location.protocol,"//",zf_imageHosts[key%zf_imageHosts.length]].join("");
1263}sgprefix='background-image:url('+hostname+'/zf/border/';sgsuffix='.png)';if(side==null){sb.push('<div class="',className,'" style="left:',left,'px;top:',top,'px;width:',
1264width,'px;height:',height,'px;',sgprefix,name,'.',size,'.',width-size*2,'.',height-size*2,sgsuffix,'"></div>');}else if(side=="left"){sb.push('<div class="',className,
1265'" style="left:',left,'px;top:',top,'px;width:',size+inner,'px;height:',height,'px;',sgprefix,name,'.',size,'.',inner,'.',height-size*2,'.left',sgsuffix,'"></div>');
1266}else if(side=="right"){sb.push('<div class="',className,'" style="right:',left,'px;top:',top,'px;width:',size+inner,'px;height:',height,'px;',sgprefix,name,'.',
1267size,'.',inner,'.',height-size*2,'.right',sgsuffix,'"></div>');}else if(side=="top"){sb.push('<div class="',className,'" style="left:',left+size+inner,'px;top:',
1268top,'px;width:',width-(inner+size)*2,'px;height:',size+inner,'px;',sgprefix,name,'.',size,'.',width-size*2,'.',inner,'.top',sgsuffix,'"></div>');}else if(side=="bottom"){var bottomTop=height+2*top-(top+inner+size);
1269sb.push('<div class="',className,'" style="left:',left+size+inner,'px;top:',bottomTop,'px;width:',width-(inner+size)*2,'px;height:',size+inner,'px;',sgprefix,name,
1270'.',size,'.',width-size*2,'.',inner,'.bottom',sgsuffix,'"></div>');}};zfl_DecorationInfo._getCustomShadowHtml=function(sb,className,name,info,sgprefix,sgsuffix){sb.push('<div class="',
1271className,'" style="left:',info.left,'px;top:',info.top,'px;width:',info.width,'px;height:',info.height,'px;',sgprefix,name,'-',info.part,sgsuffix,'"></div>');};
1272;function zfb_Api(){;}zfb_Api._queue=new zf_RequestQueue(1,1);zfb_Api.loadScrapbook=function(scrapbookInfo,oncomplete){;;var changerNumber=function(){return scrapbookInfo.changeNumber;
1273};zfb_Api._queue.enqueueEx('POST','/zf/core/scrapbook.asmx','LoadScrapbook',[scrapbookInfo.token,changerNumber],function(result,error){;if(error!=null)return;oncomplete(result);
1274});};zfb_Api.addToScrapbook=function(scrapbook,photogId,photoKeys,purchase,returnPages,oncomplete){;;;var token=scrapbook?scrapbook.token:null;var keys=$.map(photoKeys,
1275function(photoKey){return zf_PhotoKey.fromString(photoKey);});zfb_Api._queue.enqueueEx("POST","/zf/core/scrapbook.asmx","AddToScrapbook2",[token,photogId,keys,purchase,
1276returnPages||null],oncomplete);};zfb_Api.removeFromScrapbook=function(scrapbook,photoKeys,oncomplete){;;var changerNumber=function(){return scrapbook.changeNumber;};var keys=$.map(photoKeys,
1277function(photoKey){return zf_PhotoKey.fromString(photoKey);});zfb_Api._queue.enqueueEx('POST','/zf/core/scrapbook.asmx','RemoveFromScrapbook',[scrapbook.token,keys,
1278changerNumber],oncomplete);};zfb_Api.removeFromScrapbook2=function(scrapbook,photoKeys,oncomplete){;;var keys=$.map(photoKeys,function(photoKey){return zf_PhotoKey.fromString(photoKey);
1279});zfb_Api._queue.enqueueEx('POST','/zf/core/scrapbook.asmx','RemoveFromScrapbook2',[scrapbook.token,keys],oncomplete);};zfb_Api.reindexScrapbook=function(scrapbook,indices,
1280oncomplete){;;;var changerNumber=function(){return scrapbook.changeNumber;};zfb_Api._queue.enqueueEx('POST','/zf/core/scrapbook.asmx','ReindexScrapbook',[scrapbook.token,
1281indices,changerNumber],oncomplete);};zfb_Api.loadScrapbooks=function(photogId,oncomplete){zfb_Api._queue.enqueueEx('POST','/zf/core/scrapbook.asmx','LoadScrapbooks',[photogId],
1282oncomplete);};zfb_Api.searchScrapbooks=function(photogId,sharedMode,archivedMode,sortExpr,text,skip,take,countTotal,oncomplete){zfb_Api._queue.enqueueEx('POST','/zf/core/scrapbook.asmx',
1283'SearchScrapbooks',[photogId,sharedMode,archivedMode,sortExpr,text,skip,take,countTotal],oncomplete);};zfb_Api.createScrapbook=function(name,photogId,oncomplete){;;zfb_Api._queue.enqueueEx('POST',
1284'/zf/core/scrapbook.asmx','CreateScrapbook',[name,photogId],oncomplete);};zfb_Api.deleteScrapbook=function(scrapbook,oncomplete){;;var changerNumber=function(){return scrapbook.changeNumber;
1285};zfb_Api._queue.enqueueEx('POST','/zf/core/scrapbook.asmx','DeleteScrapbook',[scrapbook.token,changerNumber],oncomplete);};zfb_Api.renameScrapbook=function(scrapbook,name,
1286oncomplete){;;;var changerNumber=function(){return scrapbook.changeNumber;};zfb_Api._queue.enqueueEx('POST','/zf/core/scrapbook.asmx','RenameScrapbook',[scrapbook.token,
1287name,changerNumber],oncomplete);};zfb_Api.copyScrapbook=function(scrapbook,name,oncomplete){;;;var changerNumber=function(){return scrapbook.changeNumber;};zfb_Api._queue.enqueueEx('POST',
1288'/zf/core/scrapbook.asmx','CopyScrapbook',[scrapbook.token,name,changerNumber],oncomplete);};zfb_Api.shareScrapbook=function(scrapbook,name,sharerMessage,oncomplete){;;
1289;var changerNumber=function(){return scrapbook.changeNumber;};zfb_Api._queue.enqueueEx("POST","/zf/core/scrapbook.asmx","ShareScrapbook",[scrapbook.token,name,sharerMessage,
1290changerNumber],oncomplete);};
1290zfb_Api.getScrapbookToken=function(scrapbook,shared,readOnly,oncomplete){;;zf_stdServerRequestEx("GET","/zf/core/scrapbook.asmx","GetScrapbookToken",
1291[scrapbook.token,shared,readOnly],oncomplete);};zfb_Api.storeScrapbook=function(scrapbook,oncomplete){;;zfb_Api._queue.enqueueEx("POST","/zf/core/scrapbook.asmx","StoreScrapbook",
1292[scrapbook.token],oncomplete);};zfb_Api.toggleScrapbookArchiveBySelection=function(selection,archive,oncomplete){;;zfb_Api._queue.enqueueEx("POST","/zf/core/scrapbook.asmx",
1293"ToggleScrapbookArchiveBySelection",[selection,archive],oncomplete);};;var zf_SourceType={Image:1,Video:2};;function zf_stdLimitText(domItem,len){if(typeof(domItem)=="string")domItem=document.getElementById(domItem);
1294domItem.onkeypress=function(e){e=zf_stdGetEvent(e);if(this.value.length>=len&&e.charCode>=32&&e.charCode!=127)zf_stdPreventDefault(e);};domItem=null;}function zf_stdGetUiSortKey(s){if(s.length==0)return[];
1295var key=[];var index=0;var ch;var token;do{token="";do{ch=s.charAt(index);if(ch>='0'&&ch<='9')break;token+=ch;index++;}while(index<s.length);if(token.length>0)key.push(token);
1296if(index==s.length)break;token="";do{ch=s.charAt(index);if(ch<'0'||ch>'9')break;token+=ch;index++;}while(index<s.length);key.push(parseInt(token,10));}while(index<s.length);
1297return key;}function zf_stdCompareArrays(a,b){;;;;var len=Math.min(a.length,b.length);for(var i=0;i<len;i++){var ai=a[i];var bi=b[i];var ta=typeof(ai);var tb=typeof(bi);
1298var ret=0;if(ta!=tb)ret=zf_stdCompareString(ai.toString(),bi.toString());else if(ta=="string"&&tb=="string")ret=zf_stdCompareString(ai,bi);else if(ai<bi)return-1;
1299else if(ai>bi)return 1;if(ret!=0)return ret;}if(a.length>len)return 1;else if(b.length>len)return-1;return 0;}function zf_stdSortTable(domAnchor,sortDescByDefault,domTBody){if(sortDescByDefault==null)sortDescByDefault=false;
1300var domItem=domAnchor;while(domItem!=null&&domItem.tagName.toUpperCase()!="TH")domItem=domItem.parentNode;var domTH=domItem;;while(domItem!=null&&domItem.tagName.toUpperCase()!="TABLE")domItem=domItem.parentNode;
1301var domTable=domItem;;if(domTBody==undefined||domTBody==null){domTBody=domTable.tBodies[0];;}var colIndex=domTH.cellIndex;var pairs=[];for(var rowIndex=0;rowIndex<domTBody.rows.length;
1302rowIndex++){var domTr=domTBody.rows[rowIndex];var domTd=domTr.cells[colIndex];var key;key=domTd.getAttribute("zf:key");if(key==null||key=="")key=$(domTd).text();
1303pairs.push({element:domTr,key:key});}var sortAsc;if($(domTH).hasClass('asc'))sortAsc=false;else if($(domTH).hasClass('desc'))sortAsc=true;else sortAsc=!sortDescByDefault;
1304var domHeaders=domTable.tHead.rows[0].cells;for(var j=0;j<domHeaders.length;j++){$(domHeaders[j]).removeClass('asc desc');}var sortFunction;if(sortAsc){$(domTH).addClass('asc');
1305sortFunction=function(a,b){return zf_stdCompareString(a.key,b.key);};}else{$(domTH).addClass('desc');sortFunction=function(a,b){return zf_stdCompareString(b.key,
1306a.key);};}pairs.sort(sortFunction);for(var i=0;i<pairs.length;i++)domTBody.appendChild(domTBody.removeChild(pairs[i].element));if(domAnchor.blur)domAnchor.blur();
1307$(domTable).trigger("zf-sorted");}function zf_stdChangeDataViewForColumn(domSelect){;var selectedKey=domSelect.options[domSelect.selectedIndex].value;var domItem=domSelect;
1308while(domItem!=null&&domItem.tagName.toUpperCase()!="TH")domItem=domItem.parentNode;var domTh=domItem;;while(domItem!=null&&domItem.tagName.toUpperCase()!="TABLE")domItem=domItem.parentNode;
1309var domTable=domItem;;var domTBody=domTable.tBodies[0];;var colIndex=domTh.cellIndex;for(var rowIndex=0;rowIndex<domTBody.rows.length;rowIndex++){var domTr=domTBody.rows[rowIndex];
1310var domTd=domTr.cells[colIndex];var data=domTd.getAttribute("zf:data");;var values=$.parseJSON(data);for(var k=0;k<values.length;k++){if(values[k].key==selectedKey){var newValue=values[k].value;
1311var url=values[k].url;if(url){domTd.innerHTML=zf_stdFormatString("<a href=\"{0}\" title=\"{0}\" target=\"_blank\">{1}</a>",url,newValue);}else{domTd.innerHTML=newValue;
1312}break;}}}}function zf_isMobileLayout(){return $('BODY').hasClass("mobile-layout");};var Zenfolio;(function(Zenfolio){var Global;
1312(function(Global){var ConfiguratorService=(function(){function ConfiguratorService(){}ConfiguratorService.getPhotoKey=function(photo,
1313defaultList,adminView){;return defaultList&&(photo.owner.id==zf_userId||adminView)?new zf_PriceKey(this.defaultKey.pricingKey,photo.owner.id,true):new zf_PriceKey(photo);
1314};ConfiguratorService.getPriceKeys=function(photos,defaultList,adminView){;var map={},keys=[];for(var _a=0,photos_1=photos;_a<photos_1.length;_a++){var photo=photos_1[_a];
1315var key=this.getPhotoKey(photo,defaultList,adminView);map[key.toString()]=key;}for(var key in map){if(map.hasOwnProperty(key)){keys.push(map[key]);}}return keys;
1316};ConfiguratorService.getDefaultListCookie=function(){var value=zf_stdGetCookie("zf_pcpref");if(value==null){return null;}return value!="0";};ConfiguratorService.setDefaultListCookie=function(value){zf_stdSetCookie("zf_pcpref",
1317value?"1":"0",null,true);};ConfiguratorService.getShippingZone=function(pricing,szCode){szCode=szCode||zf_stdGetCookie("zf_shipzone");if(!szCode){szCode="US";}if(szCode.length>2&&szCode.charAt(0)=="!"){szCode=szCode.substring(1);
1318}else if(pricing!=null){var vendors=pricing.vendors;var hasUs=vendors["mpix"]!=null||vendors["mpixpro"]!=null||vendors["millers-wp"]!=null||vendors["millers-sse"]!=null;
1319var hasEu=vendors["photobox"]!=null||vendors["photobox-cobranded"]!=null||vendors["ovi"]!=null;if(hasUs&&!hasEu){szCode=szCode=="CA"?szCode:"US";}else if(!hasUs&&hasEu){szCode=(szCode=="CA")?"WW":szCode;
1320}}if(pricing!=null&&!pricing.root.isEmpty){var filtered=pricing.filter(this.createShippingZoneFilter(szCode));var emptyOrDigitalOnly_1=false;if(filtered.root.packages.length==0){emptyOrDigitalOnly_1=true;
1321$.each(filtered.root.products,function(_index,value){var vendorMeta=zf_VendorMeta.cached(value.vendorId);emptyOrDigitalOnly_1=vendorMeta.optionSets[value.optionSetId].isDigital;
1322return emptyOrDigitalOnly_1;});}if(emptyOrDigitalOnly_1){var found=false;for(var vendorId in pricing.vendors){if(pricing.vendors.hasOwnProperty(vendorId)){var vendor=pricing.vendors[vendorId];
1323if(!vendor.isCustom){szCode=vendor.meta().shippingZones[0];found=true;break;}}}if(!found&&pricing.root.products.length>0){for(var _a=0,_b=pricing.root.products;_a<_b.length;
1324_a++){var product=_b[_a];var vendorMeta=zf_VendorMeta.cached(product.vendorId);if(!vendorMeta.optionSets[product.optionSetId].isDigital){szCode=product.meta().shippingZones[0];
1325found=true;break;}}}if(!found&&pricing.root.packages.length>0){szCode=pricing.root.packages[0].meta().shippingZones[0];}}}var zone=zf_ShippingZone.all[szCode];;return zone;
1326};ConfiguratorService.setShippingZone=function(zone){;var code=zone instanceof zf_ShippingZone?zone.code:zone;var expires=new Date();expires.setFullYear(expires.getFullYear()+1);
1327zf_stdSetCookie("zf_shipzone","!"+code,expires,true);};ConfiguratorService.createShippingZoneFilter=function(zone){return new ShippingZoneFilter(zone);};ConfiguratorService.getCurrency=function(cart,
1328priceKeys,callback){var _this=this;;;var currency=cart&&cart.size>0?cart.currency:null;if(currency==null){zf_PriceList.loadPricingCurrencies(priceKeys,function(currencies){var code=ConfiguratorService.getCurrencyCode();
1329if(currencies.length>0){currencies=_this.getShippingZone().sortByPreference(currencies);currency=$.lookup(currencies,function(c){return c.code==code;})||currencies[0];
1330}else{currency=zf_CurrencyInfo.all[code!=null?code:"USD"];}callback(currency);});}else{callback(currency);}};ConfiguratorService.showVendorSelector=function(mode,
1331defaultList){return(mode===zfp_Configurator.Mode.AddToCart&&defaultList)||(mode===zfp_Configurator.Mode.PriceList);};ConfiguratorService.getCurrencyCode=function(){return zf_stdGetCookie("zf_cur");
1332};ConfiguratorService.setCurrencyCode=function(currencyCode){var expires=new Date();expires.setFullYear(expires.getFullYear()+1);zf_stdSetCookie("zf_cur",currencyCode,
1333expires,true);};ConfiguratorService.isDigital=function(productInfo){return productInfo.vendor.meta().optionSets[productInfo.optionSetId].isDigital;};ConfiguratorService.isQuickAddSupportedForProduct=function(productInfo,
1334force){if(force===void 0){force=false;}if(productInfo.meta().isTemplated||!productInfo.meta().isSingleImage){return false;}return false||productInfo.skipCustomization||force||this.isDigital(productInfo)||!productInfo.meta().sizeX&&!productInfo.meta().sizeY;
1335};ConfiguratorService.isQuickAddSupportedForPackage=function(packageInfo){return packageInfo.meta().isSingleImage;};ConfiguratorService.isQuickAddSupported=function(item,
1336force){if(force===void 0){force=false;}return this.isPackage(item)?this.isQuickAddSupportedForPackage(item):this.isQuickAddSupportedForProduct(item,force);};ConfiguratorService.checkResolution=function(product,
1337photo,template){if(this.isPackage(product)){if(product.meta().isSingleImage){for(var id in product.products){if(product.products.hasOwnProperty(id)&&!this.checkResolution(product.products[id],
1338photo)){return false;}}return true;}else{for(var id in product.products){if(product.products.hasOwnProperty(id)&&this.checkResolution(product.products[id],photo)){return true;
1339}}return false;}}var meta=this.isProduct(product)?product.meta():product;var images=meta.images;if(images!=null){for(var id in images){if(images.hasOwnProperty(id)&&this.checkResolution(images[id],
1340photo)){return true;}}return false;}if(template instanceof zf_DesignList.Template){var min=template.minimumResolution;return photo.width>=min.width&&photo.height>=min.height;
1341}switch(meta.sizeType){case zf_SizeType.WidthAndHeight:case zf_SizeType.None:var size={cx:meta.totalMinWidth,cy:meta.totalMinHeight};if(meta.canRotate&&(photo.width<photo.height)!=(size.cx<size.cy)){size={cx:size.cy,
1342cy:size.cx};}return photo.width>=size.cx&&photo.height>=size.cy;case zf_SizeType.Original:case zf_SizeType.Full:case zf_SizeType.LongestDimension:case zf_SizeType.OriginalWithRaws:return true;
1343case zf_SizeType.Area:return photo.width*photo.height>=meta.sizeArea;default:return false;}};ConfiguratorService.isPhotoPrintable=function(product,photo,defaultList,
1344template,skipResolutionCheck){;;if(!defaultList){var key=new zf_PriceKey(photo);if(product.pricings[key.pricingKey]===undefined){return false;}if(!template&&product.pricings[key.pricingKey]){return true;
1345}}return skipResolutionCheck||this.checkResolution(product,photo,template);};
1345ConfiguratorService.getBestFitProducts=function(category,photo,defaultList){;var list=[];
1346if(photo==null){return list;}if(category.data["best-fit"]==null&&(category.parent==null||category.parent.data["best-fit"]==null)){return list;}var ratio=photo.width/photo.height;
1347for(var _a=0,_b=category.products;_a<_b.length;_a++){var product=_b[_a];if(!this.isPhotoPrintable(product,photo,defaultList)){continue;}var meta=product.meta();var r=meta.sizeX/meta.sizeY;
1348if(Math.abs(1-r/ratio)<0.05||meta.canRotate&&Math.abs(1-r*ratio)<0.05){list.push(product);}}return list;};ConfiguratorService.isPackage=function(item){return(typeof item.meta=="function")&&(item.meta()instanceof zf_VendorMeta.Package);
1349};ConfiguratorService.isProduct=function(item){return(typeof item.meta=="function")&&(item.meta()instanceof zf_VendorMeta.Product);};ConfiguratorService.makeUiList=function(map,
1350comparer){var list=[];for(var key in map){if(map.hasOwnProperty(key)){list.push(map[key]);}}if(comparer){list.sort(comparer);}return list;};ConfiguratorService.getPrintableTemplate=function(product,
1351pricing,optionId,designId,photos,defaultList,mode){var _this=this;if(typeof optionId!=="string"){var index=-1;var defaultId=pricing.vendors[product.vendorId].meta().optionSets[product.optionSetId].defaultOptionId;
1352for(var option in product.options){if(product.options.hasOwnProperty(option)){if(option===defaultId){optionId=option;break;}var optionMeta=product.options[option].meta();
1353if(index===-1||optionMeta.index<index){index=optionMeta.index;optionId=option;}}}}var templateProductId=product.meta().getTemplateProductId(optionId),templates=pricing.findTemplates(templateProductId,
1354designId);var printablePhotos=null,printableTemplate=null;var _loop_1=function(template){if(mode==zfp_Configurator.Mode.AddToCart){printablePhotos=$.grep(photos,
1355function(p){return _this.isPhotoPrintable(product,p,defaultList,template,product.options[optionId].needsApproval);});if(printablePhotos.length>0){printableTemplate=template;
1356return "break";}}else{printableTemplate=template;printablePhotos=[];return "break";}};for(var _a=0,templates_1=templates;_a<templates_1.length;_a++){var template=templates_1[_a];
1357var state_1=_loop_1(template);if(state_1==="break")break;}return{optionId:optionId,photos:printablePhotos,template:printableTemplate};};ConfiguratorService.getTemplatedProductProtoItem=function(printableTemplate,
1358product,quantity,defaultList,adminView){var templatePhotos=printableTemplate.photos.slice(0,printableTemplate.template.getPhotoCount());var protoItem=new zf_ProtoItem();
1359protoItem.vendorId=product.vendorId;protoItem.productId=product.id;protoItem.optionId=printableTemplate.optionId;protoItem.quantity=quantity;protoItem.settings={"selected-template":printableTemplate.template.id};
1360protoItem.priceKey=templatePhotos.length>0?this.getPhotoKey(templatePhotos[0],defaultList,adminView):this.defaultAndCustomKey;protoItem.photos=$.map(templatePhotos,
1361function(p,idx){return{id:p.id,backgroundId:zf_PhotoKey.getBackgroundId(p),width:p.width,height:p.height,index:idx,video:p.video,returnPage:p.returnPage||null};});
1362return protoItem;};ConfiguratorService.completeCartItems=function(items,currencyCode,skipErrors,oncomplete){zf_stdServerRequestEx("POST","/zf/core/printing/printing.asmx",
1363"CompleteCartItems",[zf_ProtoItem.clean(items),currencyCode,skipErrors],oncomplete);};ConfiguratorService.formatIconUrl=function(url){;if(zf_stdAllowCdnHost()&&url.indexOf("/zf/")==0){url=""+zf_stdGetProtocol(zf_cdnHost)+zf_cdnHost+url;
1364}return url;};ConfiguratorService.getDesignIconUrl=function(design){return this.formatIconUrl(design.icon||"/zf/img/null.gif");};ConfiguratorService.useDefaultPriceList=function(firstPhoto){return firstPhoto.owner.id==zf_userId&&!!this.getDefaultListCookie();
1365};ConfiguratorService.getDownloadResolution=function(product,photo,defaultList,adminView){if(!this.isPhotoPrintable(product,photo,defaultList)){return null;}var meta=product.meta();
1366switch(meta.sizeType){case zf_SizeType.Original:case zf_SizeType.Full:if(this._isResolutionCheckWaived(product,photo,defaultList,adminView)){return null;}else{return{cx:photo.width,
1367cy:photo.height};}case zf_SizeType.WidthAndHeight:return{cx:meta.sizeX,cy:meta.sizeY};case zf_SizeType.LongestDimension:var longest=meta.sizeLongest;if(photo.height<=longest&&photo.width<=longest){return{cx:photo.width,
1368cy:photo.height};}if(photo.height>photo.width){return{cx:Math.floor(photo.width/photo.height*longest),cy:longest};}else{return{cx:longest,cy:Math.floor(photo.height/photo.width*longest)};
1369}case zf_SizeType.Area:var width=Math.sqrt(meta.sizeArea*photo.width/photo.height);var height=meta.sizeArea/width;return{cx:Math.floor(width),cy:Math.floor(height)};
1370default:return null;}};ConfiguratorService.getAddToCartMessage=function(productMeta,itemCount){var message;if(itemCount>1){message="{1} selected items have been added to the cart<br/> as {0}";
1371}else{message="{0} has been added to the cart";}return zf_stdFormatString(message,productMeta.longName,itemCount);};ConfiguratorService.showCartBalloon=function(message){if(zf_zenbar){zf_zenbar.showCartBalloon(message,
1372typeof zf_userId!=="number"||zf_userId<=0);}};ConfiguratorService.addToCartTooBig=function(cart,items){return cart.size==0&&items.length>this._cartThreshold?zf_stdFormatString("You are about to add {0} items to the cart. This may cause the cart to load too slow or in some cases     won\x27t load at all. To avoid this problem, choose cancel and select not more than {1}
1372 items, multiple checkouts     can be made to purchase all photos.",
1373items.length,this._cartThreshold):null;};ConfiguratorService.addToExistingCartTooBig=function(cart,items){return cart.size+items.length>this._cartThreshold?zf_stdFormatString("You are about to add {0} items to the cart which already has {1} items. This may cause the cart to     load too slow or in some cases won\x27t load at all. To avoid this problem, choose cancel or clear cart and     select not more than {2} items to checkout, multiple checkouts can be made to purchase all photos.",
1374items.length,cart.size,this._cartThreshold):null;};ConfiguratorService.prepareForBuying=function(vendorId,productId,optionId,designId,quantity,selectedPhotos,allPhotos,
1375pricing,mode,defaultList,adminView,forceAddToCart,quickAddProduct,productPageMode,callback){var _this=this;var doIt=function(all){_this._prepareForBuyingHelper(vendorId,
1376productId,optionId,designId,quantity,selectedPhotos,all||[],pricing,mode,defaultList,adminView,forceAddToCart,quickAddProduct,productPageMode,callback);};if(mode!=zfp_Configurator.Mode.AddToCart||allPhotos==null){doIt();
1377return;}var pkg,product;if((pkg=pricing.findPackage(vendorId,productId))!=null){if(pkg.meta().isSingleImage){doIt();return;}}else if((product=pricing.findProduct(vendorId,
1378productId))!=null){if(product.meta().isTemplated||product.meta().isSingleImage){doIt();return;}}allPhotos.loadAll(function(){return doIt(allPhotos.getAll());});};
1379ConfiguratorService.asArray=function(values){return values instanceof Array?values:[values];};ConfiguratorService.getPhotoCounts=function(photos){var imageCount=0,
1380videoCount=0;for(var i=0;i<photos.length;i++){if(photos[i].video){videoCount++;}else{imageCount++;}}return{imageCount:imageCount,videoCount:videoCount};};ConfiguratorService.showSelectionWarning=function(options){return options.fromSelection===false&&options.categoryId!=="photobooks-new";
1381};ConfiguratorService.showSourceTypeChoice=function(photoCounts){return photoCounts.imageCount>0&&photoCounts.videoCount>0;};ConfiguratorService.showPricingChoice=function(options,
1382photos){return options.defaultList==null&&photos[0].owner.id==zf_userId;};ConfiguratorService.isComplexPricing=function(priceKeys){return $.grep(priceKeys,function(k){return!k.isSimple();
1383}).length>0;};ConfiguratorService.needToLoadConfiguratorImpl=function(photos,options){return(photos.length<=0)||this.showSelectionWarning(options)||this.showSourceTypeChoice(this.getPhotoCounts(photos))||(this.showPricingChoice(options,
1384photos)&&this.isComplexPricing(this.getPriceKeys(photos,!!options.defaultList,!!options.adminView))&&this.getDefaultListCookie()==null);};ConfiguratorService.itemIsIncomplete=function(item,
1385pricing){if(item.photos.length<=0){return true;}var product=zf_VendorMeta.cached(item.vendorId).products[item.productId];if(product.isTemplated){var template=$.lookup(pricing.templates,
1386function(t){return t.id==item.settings["selected-template"];});if(!template||(item.photos.length<template.getPhotoCount(item.settings["selected-orientation"],item.settings["page-mapping"]))){return true;
1387}}else if(product.images==null){if(item.photos.length<product.minImageCount){return true;}}else{var _loop_2=function(imageId){if(product.images.hasOwnProperty(imageId)){var count_1=0;
1388$.each(item.photos,function(_i,p){count_1+=(p.imageId==imageId?1:0);});if(count_1<product.images[imageId].minImageCount){return{value:true};}}};for(var imageId in product.images){var state_2=_loop_2(imageId);
1389if(typeof state_2==="object")return state_2.value;}}return false;};ConfiguratorService.clearCartWithTracking=function(cartId,photographerId,onSuccess,onError){zf_stdServerRequestEx("POST",
1390"/zf/core/printing/printing.asmx","ClearCartWithTracking",[cartId,photographerId],function(result,error){if(error){onError&&onError(error);return;}zf_TagManager.pusEcommerceOrderEvent({name:'removeFromCart',
1391action:'all'},result);Global.EcommerceManager.instanse.shoppingCartRemoveBatch(result,onSuccess);});};ConfiguratorService._prepareForBuyingHelper=function(vendorId,
1392productId,optionId,designId,quantity,selectedPhotos,allPhotos,pricing,mode,defaultList,adminView,forceAddToCart,quickAddProduct,productPageMode,callback){var _this=this;
1393var items=[];var fillItemPhotos=function(proto,photos,minAutoFill){var meta=zf_VendorMeta.cached(proto.vendorId).products[proto.productId];var images=meta.images?$.objectToArray(meta.images).sort(function(a,
1394b){return a.index-b.index;}):[meta];var isVideo=(meta.sourceType===zf_SourceType.Video);var photoIndex=0;var usedPhotos=new Array(photos.length);var _loop_3=function(i){var img=images[i];
1395if(!img.autoFill&&!minAutoFill){return "continue";}var photosToFill=[],fillCount=img.autoFill?img.maxImageCount:img.minImageCount;while((photosToFill.length<fillCount)&&(photoIndex<photos.length)){var photo=photos[photoIndex];
1396if(photo.video===isVideo){photosToFill.push(photo);usedPhotos[photoIndex]=true;}++photoIndex;}proto.photos=proto.photos.concat($.map(photosToFill,function(photo,
1397index){return{id:photo.id,backgroundId:zf_PhotoKey.getBackgroundId(photo),imageId:img!=meta?img.id:null,index:index,width:photo.width,height:photo.height,video:photo.video,
1398returnPage:photo.returnPage||null};}));};for(var i=0;(i<images.length)&&(photoIndex<photos.length);i++){_loop_3(i);}return $.grep(photos,function(_photo,index){return!usedPhotos[index];
1399});};var pkg=pricing.findPackage(vendorId,productId);if(pkg!=null){var packageMeta_1=pkg.meta();if(this.isQuickAddSupportedForPackage(pkg)){var addSingleImagePackage=function(photos,
1400priceKey){for(var i=0;i<packageMeta_1.parts.length;i++){var part=packageMeta_1.parts[i];var proto=$.extend(new zf_ProtoPackage(),{packageId:productId,partId:part.partId,
1401quantity:quantity,items:[],priceKey:priceKey});for(var j=0;j<part.items.length;j++){var partItem=part.items[j];var item=$.extend(new zf_ProtoItem(),{vendorId:partItem.vendorId,
1402productId:partItem.productId,quantity:partItem.quantity,priceKey:proto.priceKey,photos:$.map(photos,function(photo){return{id:photo.id,backgroundId:zf_PhotoKey.getBackgroundId(photo),
1403width:photo.width,height:photo.height,video:photo.video,returnPage:photo.returnPage||null};}),packageId:proto.id,packagePackageId:proto.packageId,packagePartId:proto.partId,
1404packageItemId:partItem.id});proto.items.push(item);}items.push(proto);}};if(mode==zfp_Configurator.Mode.AddToCart){for(var i=0;i<selectedPhotos.length;i++){var photo=selectedPhotos[i];
1405if(this.isPhotoPrintable(pkg,photo,defaultList)){addSingleImagePackage([photo],this.getPhotoKey(photo,defaultList,adminView));}}}else if(mode==zfp_Configurator.Mode.AddToOrder){addSingleImagePackage([],
1406this.defaultAndCustomKey);}callback(BuyAction.AddPackages,items,packageMeta_1,pkg);}else{var photos=[];if(mode==zfp_Configurator.Mode.AddToCart){photos=this._mergePhotoArrays(true,
1407selectedPhotos,allPhotos);photos=$.grep(photos,function(photo){return _this.isPhotoPrintable(pkg,photo,defaultList);});;}var priceKey=photos[0]?this.getPhotoKey(photos[0],
1408defaultList,adminView):this.defaultAndCustomKey;for(var i=0;i<packageMeta_1.parts.length;i++){var part=packageMeta_1.parts[i];var proto=$.extend(new zf_ProtoPackage(),
1409{packageId:productId,partId:part.partId,quantity:quantity,priceKey:priceKey,items:[]});for(var j=0;j<part.items.length;j++){var partItem=part.items[j];for(var k=0;
1410k<partItem.quantity;k++){var item=$.extend(new zf_ProtoItem(),{vendorId:partItem.vendorId,productId:partItem.productId,quantity:1,priceKey:proto.priceKey,photos:[],
1411packageId:proto.id,packagePackageId:proto.packageId,packagePartId:proto.partId,packageItemId:partItem.id});proto.items.push(item);photos=fillItemPhotos(item,photos,
1412false);}}items.push(proto);}callback(BuyAction.Preconfigure,items,packageMeta_1,pkg);}}else{var product_1=pricing.findProduct(vendorId,productId);if(product_1.meta().isTemplated){;
1413var printableTemplate_1=this.getPrintableTemplate(product_1,pricing,optionId,designId,selectedPhotos,defaultList,mode);if(printableTemplate_1.template){printableTemplate_1.template.loadFully(function(){items.push(_this.getTemplatedProductProtoItem(printableTemplate_1,
1414product_1,quantity,defaultList,adminView));callback(BuyAction.Preconfigure,items,product_1.meta(),product_1);});}}else if(product_1.meta().isSingleImage){var addSingleImageProduct=function(photos,
1415priceKey){var proto=$.extend(new zf_ProtoItem(),{vendorId:vendorId,productId:productId,optionId:optionId,quantity:quantity,priceKey:priceKey,photos:$.map(photos,
1416function(photo){return{id:photo.id,backgroundId:zf_PhotoKey.getBackgroundId(photo),width:photo.width,height:photo.height,video:photo.video,returnPage:photo.returnPage||null};
1417})});items.push(proto);};if(mode===zfp_Configurator.Mode.AddToCart){for(var i=0;i<selectedPhotos.length;i++){var photo=selectedPhotos[i];if(this.isPhotoPrintable(product_1,
1418photo,defaultList)){addSingleImageProduct([photo],this.getPhotoKey(photo,defaultList,adminView));}}if(product_1.skipCustomization||forceAddToCart){$.each(items,function(_index,
1419item){item.settings["configuration"]="confirmed";});}}else if(mode===zfp_Configurator.Mode.AddToOrder){addSingleImageProduct([],this.defaultAndCustomKey);}if(mode===zfp_Configurator.Mode.AddToOrder||(quickAddProduct&&this.isQuickAddSupportedForProduct(product_1,
1420forceAddToCart))){callback(BuyAction.AddItems,items,product_1.meta(),product_1);}else{callback(BuyAction.Preconfigure,items,product_1.meta(),product_1);}}else{var photos=[];
1421if(mode==zfp_Configurator.Mode.AddToCart){photos=this._mergePhotoArrays(true,selectedPhotos,allPhotos);photos=$.grep(photos,function(photo){return _this.isPhotoPrintable(product_1,
1422photo,defaultList);});;}var proto=$.extend(new zf_ProtoItem(),{vendorId:vendorId,productId:productId,optionId:optionId,quantity:quantity,priceKey:photos[0]?this.getPhotoKey(photos[0],
1423defaultList,adminView):this.defaultAndCustomKey,photos:[]});items.push(proto);fillItemPhotos(proto,photos,productPageMode);callback(BuyAction.Preconfigure,items,
1424product_1.meta(),product_1);}}};ConfiguratorService._mergePhotoArrays=function(removeDuplicates,firstArray){var otherArrays=[];for(var _a=2;_a<arguments.length;_a++){otherArrays[_a-2]=arguments[_a];
1425};var returnArray=firstArray.concat();if(!otherArrays){return returnArray;}for(var _b=0,otherArrays_1=otherArrays;_b<otherArrays_1.length;_b++){var otherArray=otherArrays_1[_b];
1426if(!$.isArray(otherArray)){continue;}if(removeDuplicates){for(var _c=0,otherArray_1=otherArray;_c<otherArray_1.length;_c++){var otherPhoto=otherArray_1[_c];var duplicates=false;
1427for(var _d=0,returnArray_1=returnArray;_d<returnArray_1.length;_d++){var returnPhoto=returnArray_1[_d];if(zf_PhotoKey.getString(returnPhoto)===zf_PhotoKey.getString(otherPhoto)&&returnPhoto.owner.id===otherPhoto.owner.id){duplicates=true;
1428break;}}
1428if(!duplicates){returnArray.push(otherPhoto);}}}else{returnArray=returnArray.concat(otherArray);}}return returnArray;};ConfiguratorService._isResolutionCheckWaived=function(product,
1429photo,defaultList,adminView){;;var key=new zf_PriceKey(photo);if(defaultList&&(photo.owner.id==zf_userId||adminView)){key=this.defaultKey;}return product.pricings[key.pricingKey];
1430};ConfiguratorService._cartThreshold=2000;return ConfiguratorService;}());Global.ConfiguratorService=ConfiguratorService;var ShoppingPageType;(function(ShoppingPageType){ShoppingPageType[ShoppingPageType["Home"]=0]="Home";
1431ShoppingPageType[ShoppingPageType["Category"]=1]="Category";ShoppingPageType[ShoppingPageType["Product"]=2]="Product";ShoppingPageType[ShoppingPageType["Packages"]=3]="Packages";
1432ShoppingPageType[ShoppingPageType["Cart"]=4]="Cart";})(ShoppingPageType=Global.ShoppingPageType||(Global.ShoppingPageType={}));var BuyAction;(function(BuyAction){BuyAction[BuyAction["AddItems"]=0]="AddItems";
1433BuyAction[BuyAction["AddPackages"]=1]="AddPackages";BuyAction[BuyAction["Preconfigure"]=2]="Preconfigure";})(BuyAction=Global.BuyAction||(Global.BuyAction={}));var ShippingZoneFilter=(function(){function ShippingZoneFilter(zone){this._zone=zone instanceof zf_ShippingZone?zone.code:zone;
1434}ShippingZoneFilter.prototype.includeVendor=function(vendorInfo){return vendorInfo.isCustom||this._canShip(vendorInfo);};ShippingZoneFilter.prototype.includeProduct=function(productInfo){return this._canShip(productInfo);
1435};ShippingZoneFilter.prototype.includePackage=function(packageInfo){return this._canShip(packageInfo);};ShippingZoneFilter.prototype._canShip=function(item){var itemMeta=item.meta(),
1436zones=itemMeta&&itemMeta.shippingZones;if(!this._zone||!zones){return true;}return $.inArray(this._zone,zones)!=-1;};return ShippingZoneFilter;}());})(Global=Zenfolio.Global||(Zenfolio.Global={}));
1437})(Zenfolio||(Zenfolio={}));;function zfp_Configurator(id,mode,cacheToken,decorationInfo,canUseScrapbooks){;zf_Control.prototype.constructor.call(this,id);this.mode=mode;
1438this.canUseScrapbooks=canUseScrapbooks;this.cart=null;this.returnUrl=null;this.shoppingToken=null;this.returnData=null;this.photos=null;this.filter=null;this._cacheToken=cacheToken;
1439this._modalDialog=null;this._ticking=false;if(decorationInfo!=null)this.decorationInfo=decorationInfo;this._queue=new zf_RequestQueue(1);this._headerStack=[];this._slideinParentIds=[];
1440}zfp_Configurator.inherits(zf_Control);zfp_Configurator.Mode={AddToCart:0,PriceList:1,Customize:2,AddToOrder:3};zfp_Configurator.isMobileLayout=function(){return zf_isMobileLayout();};zfp_Configurator.setLocale=function(locale){;
1441var expires=new Date();expires.setFullYear(expires.getFullYear()+10);zf_stdSetCookie('zf_lang',locale,expires,true);zf_locale=locale;};zfp_Configurator.setUnit=function(unit){;var expires=new Date();
1442expires.setFullYear(expires.getFullYear()+10);zf_stdSetCookie('zf_unit',unit,expires,true);zf_unit=unit;};zfp_Configurator.prototype.setDecorationInfo=function(decorationInfo){this.decorationInfo=decorationInfo;
1443};zfp_Configurator.prototype.setReturnUrl=function(url){this.returnUrl=url;};zfp_Configurator.prototype.setShoppingToken=function(shoppingToken){this.shoppingToken=shoppingToken;};zfp_Configurator.prototype.setReturnData=function(returnData){this.returnData=returnData;
1444};zfp_Configurator.prototype.show=function(title,newShoppingEnabled){$(document).trigger('showing.atccfg');var self=this;var $body=$("body");$(window).bind('resize.pc',this.closure(this.recalcLayout));
1445$(document).bind('keydown.pc',function(e){if(e.keyCode==27){self.close();e.stopImmediatePropagation();}});$body.append($(this.dom()));if(zf_isMobileLayout()){this._cssBody=$body[0].style.cssText;
1446this._scrollTo=$body.scrollTop();if($('#favspage').length>0&&window.screen.height==568){this._scrollTo=0;}$body.css('display','block');}else{this._cssBody=$body[0].style.cssText;
1447this._scrollTo=$body.scrollTop();$body.css('overflow-x','hidden');$body.css('overflow-y','hidden');}$body.addClass("configurator-mode");this._resize();this.$('DIV.pc-hdr:first').text(title!=null?title:'Select Product');
1448this.showLoadingMessage();this._headerStack=[];this._slideinParentIds=[];this._closeHook=null;this._activePage=null;this._onhide=null;this.$().toggleClass("pc-new-shopping",
1449!!newShoppingEnabled).show();this._loadImplementation();$(document).trigger('shown.atccfg');};zfp_Configurator.prototype.close=function(){if(this._closeHook!=null){this._closeHook();
1450}else{this.hide();}};zfp_Configurator.prototype.hide=function(options){options=options||{};$(document).trigger('hiding.atccfg',options);$("body").removeClass("configurator-mode");
1451var $compactFrame=$('#page-frame');if($compactFrame.length>0)$compactFrame.trigger('Header.UnHideHeader');var $body=$("body");$body[0].style.cssText=this._cssBody;
1452$body.animate({scrollTop:this._scrollTo},0);this.$('DIV.pc-loading').remove();$(window).unbind('.pc');
1452$(document).unbind('.pc');if(this._activePage!=null){this._activePage.$().triggerHandler('hidePage');
1453this._activePage=null;}if(this._onhide!=null){this._onhide.apply(null,[options]);}zf_stdDeferCall(null,function(){this.$().hide();if(this._hidePanels!==undefined)this._hidePanels();
1454$(document).trigger('hidden.atccfg',options);},this);};zfp_Configurator.prototype.addToCart=function(options){if(this._addToCart!==undefined){this._addToCart(options);}else{var self=this;
1455this._deferredInit=function(){self._addToCart(options);};}};zfp_Configurator.prototype.selectProducts=function(options){if(this._selectProducts!==undefined){this._selectProducts(options);
1456}else{var self=this;this._deferredInit=function(){self._selectProducts(options);};}};zfp_Configurator.prototype.addToOrder=function(options){if(this._addToOrder!==undefined){this._addToOrder(options);
1457}else{var self=this;this._deferredInit=function(){self._addToOrder(options);};}};zfp_Configurator.prototype.customizePricing=function(options){if(this._customizePricing!==undefined){this._customizePricing(options);
1458}else{var self=this;this._deferredInit=function(){self._customizePricing(options);};}};zfp_Configurator.prototype.configureItems=function(options){if(this._configureItems!==undefined){this._configureItems(options);
1459}else{var self=this;this._deferredInit=function(){self._configureItems(options);};}};zfp_Configurator.prototype.confirmProduct=function(options){if(this._confirmProduct!==undefined){this._confirmProduct(options);
1460}else{var self=this;this._deferredInit=function(){self._confirmProduct(options);};}};zfp_Configurator.prototype.editProduct=function(options){if(this._editProduct!==undefined){this._editProduct(options);
1461}else{var self=this;this._deferredInit=function(){self._editProduct(options);};}};zfp_Configurator.prototype.displayLicense=function(license){if(this._displayLicense!==undefined){this._displayLicense(license);
1462}else{var self=this;this._deferredInit=function(){self._displayLicense(license);};}};zfp_Configurator.prototype.recalcLayout=function(){if(!this._ticking){var self=this;this._ticking=true;
1463requestAnimationFrame(function(){zf_stdDeferCall(self.id+'.recalcLayout',self._resize,self);self._ticking=false;});}};zfp_Configurator.prototype.showLoadingMessage=function(){this.$('DIV.pc-frame:first').addClass('pc-s-loading').append('<div class="js-pc-loading-container">'+'<div class="pc-loading pc-font2">Loading...</div>'+'<div class="hidden-desktop pc-text-spinner"><i class="fa fa-spinner fa-spin"></i></div>'+'</div>');
1464};zfp_Configurator.prototype.hideLoadingMessage=function(){this.$('DIV.js-pc-loading-container').remove();this.$('DIV.pc-frame:first').removeClass('pc-s-loading');};zfp_Configurator.prototype._resize=function(){if(zfp_Configurator.isMobileLayout()){if(this._resizeImpl!==undefined)this._resizeImpl();
1465return{};}var width=window.innerWidth;var height=window.innerHeight;var cx=Math.max(width-44,950);var cy=Math.max(height-44,590);var x=(width-cx)/2-2;var y=(height-cy)/2-2;
1466this.$().css('overflow-x',x<0?'scroll':'hidden');this.$().css('overflow-y',y<0?'scroll':'hidden');var isVScroll=y<0;if(x<0)x=0;if(y<0)y=0;cx-=20;cy-=20;this.$('DIV.pc-frame:first').css('left',
1467x+'px').css('top',y+'px').width(cx).height(cy);this.$('DIV.pc-body:first').width(cx).height(cy);if(this._resizeImpl!==undefined)this._resizeImpl(cx,cy);var $frame=this.$('DIV.pc-frame:first');
1468var extraHeight=$frame.outerHeight(true)-$frame.height();this.$('.pc-bg:first').height(isVScroll?(cy+extraHeight):height);return{cx:cx,cy:cy};};zfp_Configurator.prototype._close_onclick=function(e){e=$.event.fix(e);
1469if(!zf_stdIsLeftButton(e))return;e.preventDefault();e.stopPropagation();this.close();};zfp_Configurator.prototype._loadImplementation=function(){if(!this._scriptLoaded){var self=this,
1470fileNames=["configurator.js"];fileNames.push($.fn.jquery.indexOf("1.5")==0?"jqueryui.js":"jqueryui-1.11.js");Zenfolio.Global.ResourceService.loadScripts(fileNames,
1471function(){self._scriptLoaded=true;if(self._deferredInit!=null){self._deferredInit();}self._deferredInit=null;});}};;function zf_CartSummary(){this.id=0;this.size=0;this.photographerId=0;
1472this.total=0;this.incomplete=false;this.hasMultiImage=false;this.categories=[];this.incompleteProducts=[];this.multiImageProducts=[];}zf_CartSummary.CategoryInfo=function(){};
1473zf_CartSummary.ProductInfo=function(){};zf_CartSummary.ProductInfo.prototype.getPriceKey=function(){return this.item?this.item.priceKey:this.pkg[0].priceKey;};;var zf_ZookbindersUtils={filterZookPhotos:function(photos,
1474administrator,ownedOnly,checkPriceKey,photoSets,type,selectedPhotos){;var galleries={};var photoSetsMap={};var selectedPhotosMap={};var photoSetList=[];var hasSelectedPhotos=!!selectedPhotos;
1475if(photoSets){photoSets.forEach(function(ps){photoSetsMap[ps.id]=ps;});}if(selectedPhotos){selectedPhotos.forEach(function(p){selectedPhotosMap[zf_PhotoKey.getString(p)]=p;
1476});}var filteredPhotos=$.grep(photos,function(p){var canAdd=false;if(p.video){canAdd=false;}else if(checkPriceKey&&!p.priceKey){canAdd=false;}else if(administrator||p.owner.id==zf_userId){canAdd=true;
1477}else if(ownedOnly){canAdd=false;}else{canAdd=p.access.type!=zf_AccessType.Password||zfl_PasswordManager.check(p.access.ownerId,p.access.realmId);}if(canAdd&&type!==zf_PhotoSet.Gallery&&hasSelectedPhotos){canAdd=!!selectedPhotosMap[zf_PhotoKey.getString(p)];
1478}if(canAdd&&photoSetsMap&&p.gallery&&!galleries[p.gallery.id]){galleries[p.gallery.id]=photoSetsMap[p.gallery.id];photoSetList.push(photoSetsMap[p.gallery.id]);}return canAdd;
1479});return{filteredPhotos:filteredPhotos,filteredGalleries:photoSetList};},cartHasUsdCurrency:function(cart,showWarning){cart=cart||new zf_CartSummary();if(cart.currency&&cart.currency.code!='USD'){showWarning('Shopping cart contains 
1479non-USD products');
1480return null;}return cart;},checkPhotoCount:function(photos,zookMinPhotoCount){;if(photos.length<zookMinPhotoCount){return zf_stdFormatString('Not enough photos available: {0}/{1}',
1481photos.length,zookMinPhotoCount);}return null;},makeZookAlbum:function(photos,administrator,ownedOnly,checkPriceKey,cart,showWarning,zookMinPhotoCount,zookConfirmation){;
1482;if(!zf_ZookbindersUtils.cartHasUsdCurrency(cart,showWarning))return;var selectedPhotos=zf_ZookbindersUtils.filterZookPhotos(photos,administrator,ownedOnly,checkPriceKey).filteredPhotos;
1483var warning=zf_ZookbindersUtils.checkPhotoCount(selectedPhotos,zookMinPhotoCount);if(warning){showWarning(warning);return;}var showConfirm=true;if(typeof zf_edit==="undefined"&&typeof _zfl_init!=="undefined"&&_zfl_init.isGspAlbumFlow&&typeof zf_userId!=="undefined"&&zf_userId!==zf_ownerId){showConfirm=false;
1484}if(zookConfirmation&&showConfirm){zookConfirmation.init(selectedPhotos[0].photoSet?selectedPhotos[0].photoSet.type:null,selectedPhotos,location,administrator,ownedOnly,
1485checkPriceKey,showWarning);}else{zf_ZookbindersUtils.storeZookDesignFeeData(selectedPhotos,location,false,showWarning);}},storeZookDesignFeeData:function(selectedPhotos,
1486location,includeHierarchy,showWarning,folderId,folderTitle){if(includeHierarchy){;;}var ownerId=selectedPhotos[0].owner.id;var protoPhotos=[];var galleries={};var folder={};
1487for(var index=0;index<selectedPhotos.length;index++){var p=selectedPhotos[index];protoPhotos.push({id:p.id,backgroundId:zf_PhotoKey.getBackgroundId(p),width:p.width,
1488height:p.height,index:index,video:p.video,returnPage:p.returnPage||null});if(includeHierarchy){if(!galleries[p.gallery.id]){galleries[p.gallery.id]={id:p.gallery.id,
1489title:p.gallery.title,photoIds:[]};}galleries[p.gallery.id].photoIds.push(p.id);}}if(includeHierarchy){folder={folderId:folderId,folderTitle:folderTitle,galleries:$.map(galleries,
1490function(g){return g;})};}else folder=null;zf_stdServerRequestEx('POST','/zf/core/printing/printing.asmx','StoreZookbindersDesignFeeData',[protoPhotos,ownerId,location.href,
1491folder],function(result,error){if(error){showWarning(zf_stdHtmlEncode(error.message));return;}location.href=Zenfolio.Global.TransferHandler.getUserDomainUrl('/album/service');
1492});},makeZookAlbumFromPhotoList:function(zenbar,photoList,isGspAlbumFlow){if(zenbar){photoList.loadAll(function(){var photos=[];for(var i=0;i<photoList.length;i++){var photo=photoList.get(i);
1493;if(photo.priceKey!=""){photos.push(photo);}}zenbar.makeZookAlbum(photos,isGspAlbumFlow);});}}};;function zf_WaitAnimationPlugin(inner,src){this._inner=inner;this._src=src||"/zf/img/image-wait.gif";
1494if(zf_stdAllowCdnHost())this._src=zf_stdGetProtocol(zf_cdnHost)+zf_cdnHost+this._src;}zf_WaitAnimationPlugin.prototype.getOuterContent=function(id,context){return!this._inner?'<img class="pv-wait" src="'+this._src+'" />':'';
1495};zf_WaitAnimationPlugin.prototype.getInnerContent=function(id,context){return this._inner?'<img class="pv-wait" src="'+this._src+'" />':'';};;function zf_AscLabelPlugin(params){this.params=params;
1496}zf_AscLabelPlugin.prototype.getInnerContent=function(id,context){if(this.params.title){return['<div class="pv-ng-overlay pv-ng-ovn">','<div class="pv-ng-overlay-i pv-label pv-ng-label pv-ng-ta">',
1497this._content(context),'</div>','</div>'].join("");}return "";};zf_AscLabelPlugin.prototype.getOuterContent=function(id,context){if(this.params.title){return '<div class="pv-border"></div>';
1498}return "";};zf_AscLabelPlugin.prototype.onCreateDom=function(view,outer,inner,context,isNew){if(context==null)return;var data=context.data,label=$('.pv-ng-label:first',outer);if(!isNew){label.html(elements.join(''));
1499}};zf_AscLabelPlugin.prototype._content=function(context){var data=context.data;var elements=[];if(this.params.title){elements.push('<h4 class="title">',zf_stdHtmlEncode(data.title),
1500'</h4>');}return elements.join("");};;var zf_MailboxType={BlogPostComments:3,FolderGuestbook:2,PhotoSetGuestbook:1,PhotoComments:0};function zf_Mailbox(ownerIdOrMessage,type,
1501id){if(arguments.length==1){var message=ownerIdOrMessage;;;this.ownerId=message.owner.id;this.type=message.mailboxType;this.id=message.mailboxId;}else if(arguments.length==3){this.ownerId=ownerIdOrMessage;
1502this.type=type;this.id=id;}}zf_Mailbox.prototype.equals=function(obj){if(obj==null||!(obj instanceof zf_Mailbox))return false;return this.ownerId==obj.ownerId&&this.type==obj.type&&this.id==obj.id;
1503};function zf_MailboxAuthorization(mailbox){this._mailbox=mailbox;this._retrieveToken();var self=this;this._timer=setInterval(function(){self._retrieveToken();},3600*1000);
1504}zf_MailboxAuthorization.prototype.dispose=function(){clearInterval(this._timer);this._timer=null;};zf_MailboxAuthorization.prototype.delayPost=function(callback){var self=this;var count=0;var wait=function(){if(self._token==null){if(self._timestamp!=null||count>=60)callback(null);
1505else setTimeout(wait,500);++count;}else{;;var offset=new Date().getTime()-self._timestamp.getTime();if(offset<5000)setTimeout(function(){callback(self._token);},
15065000-offset);else callback(self._token);}};wait();};zf_MailboxAuthorization.prototype._retrieveToken=function(){var self=this;zf_Message.prePostMessage(this._mailbox,function(token,error){self._timestamp=new Date();
1507if(error!=null)return;self._token=token;});};var zf_AttachmentType={None:0,CroppingSuggestion:1,HighlightedArea:2};var zf_MessageFlags={None:0x00,CanEdit:0x01,CanDelete:0x02,
1508CanCensor:0x04,CanUndelete:0x08,CanUncensor:0x10,CanShowInfo:0x20,CanEmail:0x40,CanPurge:0x80,CanApprove:0x100,CanMakePrivate:0x200,CanMakePublic:0x400,ControlMask:0x7FF^0x20};
1509function zf_Message(){zf_Loadable.prototype.constructor.call(this);this.attachmentType=zf_AttachmentType.None;this.flags=zf_MessageFlags.None;}zf_Message.inherits(zf_Loadable);zf_Message._fields=["mailbox",
1510"index","poster","posterName","posterEmail","posterUrl","postedOn","body","attachment","attachmentType","isPrivate","madePrivate","isDeleted","isCensored","flags",
1511"postedFrom","isEdited","editedOn","editedFrom","editor","censoredOn","censoredFrom","censorer","deletedOn","deletedFrom","deletor","needsApproval","approver","approvedOn",
1512"approvedFrom"];zf_Message.prototype.postSerialize=function(){zf_Loadable.prototype.postSerialize.call(this);if(this.poster){this.posterName=this.poster.displayName;if(this.posterUrl==null)this.posterUrl=zf_stdGetProtocol(this.poster.domainName)+this.poster.domainName;
1513}};zf_Message.prePostMessage=function(mailbox,oncomplete){;;;;var params=[mailbox];zf_stdServerRequestEx("POST","/zf/layout/message.asmx","PrePostMessage",params,oncomplete);
1514};zf_Message.postMessage=function(auth,mailbox,updater,oncomplete){;;;;;;auth.delayPost(function(token){zf_stdServerRequestEx("POST","/zf/layout/message.asmx","PostMessage",
1515[token,mailbox,updater],oncomplete);auth.dispose();});};zf_Message.updateMessage=function(auth,mailbox,index,updater,oncomplete){;;;;;;auth.delayPost(function(token){zf_stdServerRequestEx("POST",
1516"/zf/layout/message.asmx","UpdateMessage",[token,mailbox,index,updater],oncomplete);auth.dispose();});};zf_Message.loadMessageRange=function(mailbox,mailboxToken,first,count,
1517oncomplete){;;;;;var params=[mailbox,mailboxToken,first,count];zf_stdServerRequestEx("GET","/zf/layout/message.asmx","LoadMessageRange",params,oncomplete);};zf_Message._bake=function(method){return function(mailbox,
1518index,oncomplete){;;;;var params=[mailbox,index];zf_stdServerRequestEx("POST","/zf/layout/message.asmx",method,params,oncomplete);};};zf_Message.deleteMessage=zf_Message._bake("DeleteMessage");
1519zf_Message.undeleteMessage=zf_Message._bake("UndeleteMessage");zf_Message.censorMessage=zf_Message._bake("CensorMessage");zf_Message.uncensorMessage=zf_Message._bake("UncensorMessage");zf_Message.purgeMessage=zf_Message._bake("PurgeMessage");
1520zf_Message.approveMessage=zf_Message._bake("ApproveMessage");zf_Message.makePrivate=zf_Message._bake("MakePrivate");zf_Message.makePublic=zf_Message._bake("MakePublic");;function zf_PhotoMeta(){zf_Loadable.prototype.constructor.call(this);
1521this.exif={};this.keywords=[];this.categories=[];this.caption="";this.comments=0;this.recentComments=[];}zf_PhotoMeta.inherits(zf_Loadable);zf_PhotoMeta._fields=["categories","category",
1522"keywords","caption","exif","comments","recentComments"];zf_PhotoMeta.requests=new zf_RequestQueue(200);zf_PhotoMeta.urgent=new zf_RequestQueue(1,8);
1522zf_PhotoMeta.prototype.postSerialize=function(){zf_Loadable.prototype.postSerialize.call(this);
1523this.keywords.sort();if(this.categories.length>0){this.categories.sort(_zf_stdCategoryCompare);this.category=this.categories[0];}else this.category=0;};zf_PhotoMeta.prototype.load=function(photo,
1524urgent){;;;;if(!this.requested)this.setRequested();this.photo=photo;var self=this;var oncomplete=function(result,error){if(error!=null)return;var meta=result;;zf_stdCopyFields(self,
1525meta,zf_PhotoMeta._fields);self._synthesize();self.done();};var params=[this.photo.id,this.photo.flags,this.photo.metacn,this.photo.token,zf_userId,zf_locale];var queue=urgent?zf_PhotoMeta.urgent:zf_PhotoMeta.requests;
1526var url=photo.getExternalUrl(zf_ProcessingMethod.PhotoMetadata,".meta");queue.enqueueEx("GET",url,"GetPhotoMeta",params,oncomplete,photo.id);};zf_PhotoMeta.prototype.bump=function(){if(this.requested&&!this.loaded&&this.photo!=null)zf_PhotoMeta.requests.bump(this.photo.id);
1527};zf_PhotoMeta.prototype._synthesize=function(){;var exif;var photo=this.photo;this.exif[-1]={tag:-1,title:"Dimensions",display:photo.width+" x "+photo.height};this.exif[-2]={tag:-2,
1528title:"Original file size",display:zf_stdFormatByteSize(photo.fileSize)};exif=this.exif[-3]={tag:-3,title:"Image type",display:"Unknown"};switch(photo.fileType){case ".gif":exif.display="GIF";
1529break;case ".jpg":exif.display="JPEG";break;case ".png":exif.display="PNG";break;case ".tif":exif.display="TIFF";break;case ".bmp":exif.display="BMP";break;default:break;
1530}if(this.exif[0x829A]!=null){var ap;if(this.exif[0x829D]!=null)ap=this.exif[0x829D].display;else ap="f/NA";this.exif[-4]={tag:-4,title:"Exposure",display:zf_stdFormatString("{0} at {1}",
1531this.exif[0x829A].display,ap)};}var accessType=photo.access.type;if(accessType!=zf_AccessType.Public){exif=this.exif[-5]={tag:-5,title:"Access Control",display:""};
1532if(accessType==zf_AccessType.Protected)exif.display="Members Only";else if(accessType==zf_AccessType.Password)exif.display="Password";else if(accessType==zf_AccessType.Private)exif.display="Private";
1533}var fileName=photo.fileName;if(fileName!=null){this.exif[-6]={tag:-6,title:"File name",display:fileName};}var uploaded=photo.uploaded;if(uploaded!=null){this.exif[-7]={tag:-7,
1534title:"Date uploaded",display:zf_stdFormatDateTime(uploaded)};}if(photo.video){var duration=photo.duration;if(duration!=null){this.exif[-8]={tag:-8,title:"Duration",
1535display:zf_stdFormatDuration(duration)};}}};zf_PhotoMeta.prototype.addComment=function(message){;;if(message instanceof Array){for(var k=0;k<message.length;k++)this.addComment(message[k]);
1536return;};;;if(this.comments==0||this.recentComments.length==0||this.recentComments[0].index<message.index){this.photo.flags|=zf_PhotoFlags.HasComments;++this.comments;
1537this.recentComments.unshift(message);}else{var last=this.recentComments[0];for(var i=0;i<this.recentComments.length;i++){if(this.recentComments[i].index==message.index){this.recentComments.splice(i,
15381,message);break;}if(i==this.recentComments.length-1){this.recentComments.push(message);break;}var previous=this.recentComments[i+1];if(previous.index<message.index){this.recentComments.splice(i+1,
15390,message);break;}}}};zf_PhotoMeta.prototype.removeComment=function(index){;;;if(this.recentComments.length>0&&this.recentComments[0].index>=index&&this.recentComments[this.recentComments.length-1].index<=index){for(var i=0;
1540i<this.recentComments.length;i++){if(this.recentComments[i].index==index)this.recentComments.splice(i,1);}}--this.comments;if(this.comments==0)this.photo.flags&=~zf_PhotoFlags.HasComments;
1541};;var zf_PricingProducts={None:0,PhotoBooks:1};;var INT32_MAX=0x7FFFFFFF;var INT32_MIN=-0x80000000;var UINT32_MAX=0xFFFFFFFF;function zf_toUint32(num){var n=Number(num);if(isNaN(n))throw new TypeError("NumberFormatException: "+num);
1542if(n<INT32_MIN||n>INT32_MAX)throw new RangeError("OverflowException: "+num);if(n>=0)return n;return UINT32_MAX+1+n;}function zf_toInt32(num){var n=Number(num);if(isNaN(n))throw new TypeError("NumberFormatException: "+num);
1543if(n<0||n>UINT32_MAX)throw new RangeError("OverflowException: "+num);if(n<=INT32_MAX)return n;return n-1-UINT32_MAX;};function zf_File(){zf_FileImage.prototype.constructor.call(this);
1544}zf_File.inherits(zf_FileImage);zf_File._fields=zf_FileImage._fields.concat(["mimeType","fileName"]);zf_File.clone=function(file){if(file==null)return null;
1544return zf_stdCopyFields(new zf_File(),
1545file,zf_File._fields);};;function zf_Background(){this.isDefault=false;this.price=0;this.photosAssigned=0;};function zf_PhotoKey(){}zf_PhotoKey.fromPhoto=function(photo){;var photoKey=new zf_PhotoKey();
1546photoKey.photoId=photo.id;photoKey.backgroundId=zf_PhotoKey.getBackgroundId(photo);return photoKey;};zf_PhotoKey.fromIds=function(photoId,backgroundId){;var photoKey=new zf_PhotoKey();
1547photoKey.photoId=photoId;photoKey.backgroundId=backgroundId!=null?backgroundId:null;return photoKey;};zf_PhotoKey.fromString=function(key){;var photoKey=new zf_PhotoKey();var keyParts=key.split(zf_PhotoKey._separator);
1548photoKey.photoId=keyParts[0]?zf_toInt32(keyParts[0]):null;if(keyParts.length>1&&keyParts[1]){photoKey.backgroundId=parseInt(keyParts[1]);if(isNaN(photoKey.backgroundId)){photoKey.backgroundId=null;
1549}}else{photoKey.backgroundId=null;}return photoKey;};zf_PhotoKey.getString=function(photo){return zf_PhotoKey.fromPhoto(photo).toString();};zf_PhotoKey.getBackgroundId=function(photo){;
1550var background=zf_PhotoImage.getBackground(photo);if(background!=null){return background.id;}if(photo.backgroundId!=null){return photo.backgroundId;}return null;
1551};zf_PhotoKey.prototype.toString=function(){var result=this.photoId!=null?zf_toUint32(this.photoId).toString():'';if(this.backgroundId!=null){result+=zf_PhotoKey._separator+this.backgroundId.toString();
1552}return result;};zf_PhotoKey.prototype.toFakePhoto=function(){var photo=new zf_Photo();photo.id=this.photoId;if(this.backgroundId!=null){photo.isCutout=true;photo.background=new zf_Background();
1553photo.background.id=this.backgroundId;}return photo;};zf_PhotoKey._separator='_';;function zf_Photo(){zf_Loadable.prototype.constructor.call(this);zf_PhotoImage.prototype.constructor.call(this);
1554this.pricingProducts=zf_PricingProducts.None;this.priceKey="";this.isPricingDerived=false;this.views=0;this.video=false;this.fileType=".jpg";this.fileSize=0;this.zipSize=0;
1555this.flags=zf_PhotoFlags.None;this.metacn=0;this.watermarkId=0;this.isWatermarkDerived=false;this.duration=0;this.originalDownloads=0;this.galleryFiles=0;this.fileBytes=0;
1556this.isPhotoFromVisitorView=false;this.gridType=0;}zf_Photo.inherits(zf_PhotoImage,zf_Loadable);zf_Photo._fields=["access","gallery","owner","pricingProducts","priceKey","photoSet",
1557"views","cdnPath","uploaded","taken","title","altText","fileType","fileSize","flags","metacn","fileName","copyright","isPricingDerived","pricing","watermarkId","isWatermarkDerived",
1558"backgroundSetup","duration","subOwner","zipSize","originalDownloads","galleryFiles","fileBytes","returnPage","isPhotoFromVisitorView","gridType"].concat(zf_PhotoImage._fields);
1559zf_Photo.prefix="p";zf_Photo.prototype.getUnsignedId=function(){if(this.id==null){return null;}return zf_toUint32(this.id);};zf_Photo.clone=function(photo){return zf_stdCopyFields(new zf_Photo(),
1560photo,zf_Photo._fields);};zf_Photo.prototype.getHref=function(style){var scope,owner;if(this.photoSet!=null&&style!="gallery"){scope=this.photoSet;owner=scope.owner;}else if(this.gallery!=null){scope=this.gallery;
1561owner=this.owner||scope.owner;}var href=[],m=location.search.match(/(customize=\d)/),query=m?"?"+m[0]:"";if(style!=null&&style!="analytics")href.push(zf_stdGetProtocol(owner.domainName),
1562owner.domainName);if(scope==null){href.push("/?photo=",this.getUnsignedId());}else if(style=="edit"){href=[zf_stdGetProtocol(zf_defaultHost),zf_defaultHost,"/",this.owner.loginName,
1563"/p",this.gallery.id,"/edit#h",this.getUnsignedId().toString(16)];}else if(style=="edit-new"){href=[zf_stdGetProtocol(zf_defaultHost),zf_defaultHost,"/",this.owner.loginName.toLowerCase(),
1564"/e/p",this.gallery.id,"#h",this.getUnsignedId().toString(16)];}else if(style=="external"||style=="analytics"){href.push(scope.getBaseHref(),"/e",this.getUnsignedId().toString(16));
1565}else{href.push(scope.getBaseHref(),"/h",this.getUnsignedId().toString(16),query);}return href.join("");};zf_Photo.prototype.postSerialize=function(){this.image=this;zf_Loadable.prototype.postSerialize.call(this);
1566zf_PhotoImage.prototype.postSerialize.call(this);if(this.title==null)this.title="";if(this.taken!=null)this.taken.setMinutes(this.taken.getMinutes()+this.taken.getTimezoneOffset());
1567if(this.fileSize)this.zipSize=this.fileSize+30+256+46+256;};zf_Photo.prototype.getMeta=function(urgent){;if(this._meta==null){this._meta=new zf_PhotoMeta();if(!this.loaded){this._meta.setRequested();
1568var self=this;this.advise(this._meta,function(){self._meta.load(self,urgent);});}else{this._meta.load(this,urgent);}}return this._meta;};zf_Photo.prototype.pickMethod=function(width,
1569height,allowThumbs,sizeUp){return zf_PhotoImage.prototype.pickMethod.call(this,width,height,allowThumbs,this.access.mask,sizeUp);};zf_Photo.prototype.pickScaledMethod=function(width,
1570height,upscale){var options=[{method:zf_ProcessingMethod.StandardSmallSize,mask:0},{method:zf_ProcessingMethod.StandardMediumSize,mask:zf_AccessMask.ProtectMedium},
1571{method:zf_ProcessingMethod.StandardLargeSize,mask:zf_AccessMask.ProtectLarge},{method:zf_ProcessingMethod.StandardExtraLargeSize,mask:zf_AccessMask.ProtectExtraLarge},
1572{method:zf_ProcessingMethod.StandardXXLargeSize,mask:zf_AccessMask.Protect
1572XXLarge}];var method=options[0].method,scaled=this.getScaledSize(method);upscate=upscale===undefined?1.0:upscale;
1573for(var i=1;i<options.length;i++){var option=options[i];if((option.mask&this.access.mask)!=0)continue;method=option.method;scaled=this.getScaledSize(method);if(scaled.cx>=width||scaled.cy>=height)break;
1574}var copy=$.extend({},method,{cx:width,cy:height});if(upscale>1.0&&method.code==zf_ProcessingMethod.StandardXXLargeSize.code)copy.stretch=true;var size=this.getScaledSize(copy);
1575if(upscale>1.0&&method.code==zf_ProcessingMethod.StandardXXLargeSize.code){method=$.extend({},method,{cx:Math.min(size.cx,scaled.cx*upscale),cy:Math.min(size.cy,
1576scaled.cy*upscale),stretch:true});}else{method=$.extend({},method,{cx:Math.min(size.cx,scaled.cx),cy:Math.min(size.cy,scaled.cy)});}return method;};zf_Photo.prototype.pickFillMethod=function(width,
1577height,allowThumbs){var options=[{method:zf_ProcessingMethod.StandardSmallSize,mask:0},{method:zf_ProcessingMethod.StandardMediumSize,mask:zf_AccessMask.ProtectMedium},
1578{method:zf_ProcessingMethod.StandardLargeSize,mask:zf_AccessMask.ProtectLarge},{method:zf_ProcessingMethod.StandardExtraLargeSize,mask:zf_AccessMask.ProtectExtraLarge},
1579{method:zf_ProcessingMethod.StandardXXLargeSize,mask:zf_AccessMask.ProtectXXLarge}];if(allowThumbs){options=[{method:zf_ProcessingMethod.StandardThumbnail,mask:0},
1580{method:zf_ProcessingMethod.StandardLargeThumbnail,mask:0},{method:zf_ProcessingMethod.StandardVeryLargeThumbnail,mask:0}].concat(options);}var method=options[0].method,
1581scaled=this.getScaledSize(method);for(var i=1;i<options.length;i++){var option=options[i];if((option.mask&this.access.mask)!=0)continue;method=option.method;scaled=this.getScaledSize(method);
1582if(scaled.cx>=width&&scaled.cy>=height)break;}return $.extend({},method,{cx:width,cy:height,clip:true,stretch:true});};zf_Photo.prototype.pickVideoMethod=function(width,
1583height){;if(width==null)width=this.width;if(height==null)height=this.height;if(height>640)height=640;var options=[{method:zf_ProcessingMethod.Video360p,mask:0},{method:zf_ProcessingMethod.Video480p,
1584mask:zf_AccessMask.Protect480p},{method:zf_ProcessingMethod.Video720p,mask:zf_AccessMask.Protect720p},{method:zf_ProcessingMethod.Video1080p,mask:zf_AccessMask.Protect1080p}];
1585var method=options[0].method;for(var i=1;i<options.length;i++){if((options[i].mask&this.access.mask)!=0)continue;if(method!=zf_ProcessingMethod.Video360p&&method.cx>=this.width&&method.cy>=this.height)break;
1586method=options[i].method;}var copy=$.extend({},method,{cx:width,cy:height});var size=this.getScaledSize(copy);method=$.extend({},method,{cx:Math.min(size.cx,method.cx),
1587cy:Math.min(size.cy,method.cy)});return method;};zf_Photo.isAssignableAsCutout=function(photo){return!photo.video&&photo.fileType=='.png';};zf_Photo.prototype.getCommentsCount=function(sink,
1588callback){if((this.flags&zf_PhotoFlags.HasComments)==0){callback(0);return null;}var meta=this.getMeta();if(meta.loaded){callback(meta.comments);}else{meta.bump();
1589meta.advise(sink,function(){return callback(meta.comments);});}return meta;};zf_Photo.prototype.getCopyright=function(){return this.copyright||this.owner.copyright||"\u00A9 "+this.owner.displayName;
1590};;;function zf_PricingInfo(parent,pricingKey){if(arguments.length==0)return;this.parent=parent;if(parent!=null&&pricingKey==null){this.isDerived=true;this.pricingKey=parent.pricingKey;
1591this.isSimple=parent.isSimple;this.vendorMask=parent.vendorMask;}else{this.isDerived=false;this.pricingKey=pricingKey!=null?pricingKey:"";this.postSerialize();}}zf_PricingInfo._fields=["pricingKey",
1592"isDerived","isSimple","vendorMask","parent"];zf_PricingInfo.prototype.postSerialize=function(){if(this.pricingKey.length>7||this.pricingKey.length==7&&this.pricingKey.charAt(0)>'4'){this.isSimple=false;
1593this.vendorMask=0;}else{this.isSimple=true;this.vendorMask=zf_stdBase32Decode(this.pricingKey);}};zf_PricingInfo.clone=function(info){if(info==null)return null;var clone=zf_stdCopyFields(new zf_PricingInfo(),
1594info,zf_PricingInfo._fields);if(info.isDerived&&info.parent!=null){clone.pricingKey=info.parent.pricingKey;clone.isSimple=info.parent.isSimple;clone.vendorMask=info.parent.vendorMask;
1595}return clone;};;function zf_PhotoSet(id,type,title,customReference){zf_Loadable.prototype.constructor.call(this);if(arguments.length==0){this.type=zf_PhotoSet.Gallery;}else{this.id=id;
1596this.type=type;this.title=title;this.customReference=customReference;this.folders=[];this.folder=null;this.done();}this.items=[];this.photos=0;this.images=0;this.videos=0;
1597this.printableImages=0;this.printableVideos=0;this.bytes=0;this.views=0;this.photoChangeNumber=0;this.files=0;this.fileBytes=0;this.caption="";this.keywords=[];this.category=0;
1598this.isRandomTitlePhoto=false;this.watermarkId=0;this.adminFlags=0;this.isArchive=undefined;}zf_PhotoSet.inherits(zf_Loadable);zf_PhotoSet.prefix="p";zf_PhotoSet.Gallery="Gallery";zf_PhotoSet.Collection="Collection";
1599zf_PhotoSet._fields=["id","type","title","caption","photos","images","videos","created","modified","sortOrder","isRandomTitlePhoto","views","customReference","pricing","watermarkId",
1600"photoChangeNumber","isFeatured","category","bytes","theme","isSignInDerived","signIn","adminFlags","subOwner","hideTitle","printableImages","printableVideos","eventFeatured",
1601"files","fileBytes","isYearbookEnabled","isArchive"];zf_PhotoSet.clone=function(photoSet){if(photoSet==null)return null;var cloned=zf_stdCopyFields(new zf_PhotoSet(),photoSet,
1602zf_PhotoSet._fields);cloned.keywords=photoSet.keywords!=null?[].concat(photoSet.keywords):null;cloned.categories=photoSet.categories!=null?[].concat(photoSet.categories):null;
1603cloned.image=zf_PhotoImage.clone(photoSet.image);cloned.access=zf_AccessInfo.clone(photoSet.access);cloned.owner=zf_User.clone(photoSet.owner);if(photoSet.pricing)cloned.pricing=zf_PricingInfo.clone(photoSet.pricing);
1604return cloned;};zf_PhotoSet.prototype.postSerialize=function(){zf_Loadable.prototype.postSerialize.call(this);for(var i=0;i<this.items.length;i++)this.items[i].gallery=this;
1605if(this.pricingKey!=null){this.pricing=new zf_PricingInfo(null,this.pricingKey);this.pricing.isDerived=!!this.isPricingDerived;}if(!this.category&&this.categories&&this.categories.length>0)this.category=this.categories[0];
1606};zf_PhotoSet.prototype.getHref=function(style,photo){var m=location.search.match(/(customize=\d)/),query=m?'?'+m[0]:'';if(style=="edit"){return[zf_stdGetProtocol(zf_defaultHost),
1607zf_defaultHost,"/",this.owner.loginName,"/p",this.id,"/edit"].join("");}else if(style=="edit-new"){return[zf_stdGetProtocol(zf_defaultHost),zf_defaultHost,"/",this.owner.loginName.toLowerCase(),
1608"/e/p",this.id].join("");}else if(style=="external"){if(photo)return zf_stdGetProtocol(photo.owner.domainName)+photo.owner.domainName+this.getBaseHref();else return zf_stdGetProtocol(this.owner.domainName)+this.owner.domainName+this.getBaseHref();
1609}else return this.getBaseHref()+query;};zf_PhotoSet.prototype.getBaseHref=function(){if(this.customReference!=null&&this.customReference.length>0)return "/"+this.customReference;
1610return "/p"+this.id;};zf_PhotoSet.prototype.isYearbookEnabledForItem=function(){if(this.isYearbookEnabled==null){return zf.edit.ToolboxYearbook.isYearbookEnabledForParent(this);
1611}return this.isYearbookEnabled;};;function zf_User(){zf_Loadable.prototype.constructor.call(this);this.photos=0;this.images=0;this.videos=0;this.galleries=0;this.collections=0;
1612this.views=0;}zf_User.inherits(zf_Loadable);zf_User._fields=["id","loginName","displayName","domainName","views","bio","copyright","email"];zf_User.clone=function(user){if(user==null)return null;
1613var cloned=zf_stdCopyFields(new zf_User(),user,zf_User._fields);cloned.image=zf_FileImage.clone(user.image);return cloned;};zf_User.prototype.postSerialize=function(){zf_Loadable.prototype.postSerialize.call(this);
1614if(this.domainName==null)this.domainName=this.loginName+zf_defaultDomain;};;function zf_PhotoList(offset,page,length,ids){;this._initArgs=arguments;this._offset=offset;this._page=page;
1615this._photos=[];this._photoIds=[];this._map={};if(typeof(ids)=="number"){this._photoSetId=ids;}else{;;for(var i=0;i<ids.length;i++){var item=ids[i];var photoId=0;
1616if(item instanceof zf_Photo){this._photos.push(item);photoId=item.id;}else if(typeof(item)=="number"){photoId=item;}else{continue;}this._photoIds.push(photoId);var indices=this._map[photoId];
1617if(!indices){this._map[photoId]=indices=[];}indices.push(i);}}this.length=length;this._fresh=true;}zf_PhotoList.prototype.get=function(index,touch){;if(index>=this.length)return null;
1618if(touch==null)touch=false;var i;if(this._photos[index]instanceof zf_Photo)return this._photos[index];if(this._photos[index]==null){var from,to;if(index<this._offset){from=0;
1619to=this._offset;}else{var n=Math.floor((index-this._offset)/this._page);from=this._page*n+this._offset;to=from+this._page;}if(to>this.length)to=this.length;for(i=from;
1620i<to;i++){if(this._photos[i]==null)this._photos[i]=false;}var first=this._fresh;this._fresh=false;var self=this;var oncomplete=function(photos){self._adopt(photos,
1621from);if(from+photos.length<to){self.length=from+photos.length;
1621if(self.onshrink!=null){if(!self.onshrink())return;}}if(self.onload!=null)self.onload(first);};if(this._photoSetId!=null){this.getPhotoRange(from,
1622to,false,oncomplete);}else{var ids=new Array(to-from);for(i=from;i<to;i++)ids[i-from]=this._photoIds[i];this.getPhotoBatch(ids,oncomplete);}}if(touch)return null;
1623if(index==from&&index>0)this.get(index-1,true);else if(index==to-1&&index<this.length-1)this.get(index+1,true);;var photo=new zf_Photo();photo.setRequested();this._photos[index]=photo;
1624return photo;};zf_PhotoList.prototype.find=function(id){var indices=this._map[id];return indices?indices[0]:-1;};zf_PhotoList.prototype.findByKey=function(key){var photoKey=zf_PhotoKey.fromString(key);
1625var indices=this._map[photoKey.photoId];if(indices){for(var i=0;i<indices.length;i++){var index=indices[i];var photo=this._photos[index];if(photo&&zf_PhotoKey.getString(photo)==key){return index;
1626}}}return-1;};zf_PhotoList.prototype.setDefaults=function(photoSet,owner){this._defaultPhotoSet=photoSet;this._defaultOwner=owner;};zf_PhotoList.prototype.loadAll=function(callback){;;var from=null;
1627var to=null;for(var i=0;i<this.length;i++){var photo=this._photos[i];if(photo&&photo.loaded)continue;if(from===null)from=i;if(from!==null)to=i+1;}if(from===null){callback();
1628return;}if(to===null)to=this.length;var self=this;this.getPhotoRange(from,to,true,function(photos){self._adopt(photos,from);if(from+photos.length<to){self.length=from+photos.length;
1629if(self.onshrink!=null)self.onshrink();}if(self.onload!=null)self.onload(false);callback();});};zf_PhotoList.prototype.getAll=function(){return this._photos;};zf_PhotoList.prototype.recreate=function(){var args=this._initArgs,
1630ctor=this.constructor;var pl=Object.create(ctor.prototype);ctor.apply(pl,args);pl.setDefaults(this._defaultPhotoSet,this._defaultOwner);return pl;};zf_PhotoList.prototype._adopt=function(photos,
1631offset){;;for(i=0;i<photos.length;i++){var src=photos[i];var dest=this._photos[i+offset];;var indices=this._map[src.id];if(!indices){this._map[src.id]=indices=[];
1632}indices.push(i+offset);if(this._defaultPhotoSet)src.photoSet=this._defaultPhotoSet;if(this._defaultOwner&&src.owner&&src.owner.id==this._defaultOwner.id)src.owner=this._defaultOwner;
1633if(!(dest instanceof zf_Photo)){this._photos[i+offset]=src;}else{;if(!dest.loaded){;zf_stdCopyFields(dest,src,zf_Photo._fields);dest.image=dest;dest.done();}}}};
1634zf_PhotoList.wrap=function(photos){return $.extend(photos||[],{find:function(id){for(var i=0;i<this.length;i++){if(this[i].id==id)return i;}return-1;},findByKey:function(key){for(var i=0;
1635i<this.length;i++){if(zf_PhotoKey.getString(this[i])==key)return i;}return-1;},get:function(index){return this[index];},loadAll:function(callback){callback();},getAll:function(){return this;
1636},recreate:function(){return this;}});};;function zf_buttonCreate(id,title,confirm,decline){;;;var style;var linkClass;var spanClass;if(confirm){style=zf_buttonCreate._confirm[title];
1637linkClass="btn btn-normal btn-h btn-normal-ir";spanClass="btn-confirm";}else if(decline){style=zf_buttonCreate._decline[title];linkClass="btn btn-normal btn-h btn-normal-il";
1638spanClass="btn-cancel";}else{style=zf_buttonCreate._neutral[title];linkClass="btn btn-normal btn-h";spanClass="btn-neutral";}return['<a class="',linkClass,'" href="#" id="',
1639id,'" style="',style,'">',zf_stdHtmlEncode(title),'<span class="',spanClass,'"></span>','</a>'].join('');}zf_buttonCreate._confirm={"Add":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.68.16.png); width:40px;",
1640"Assign":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.88.16.png); width:60px;","Close":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.80.16.png); width:52px;",
1641"Stop Export":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.132.16.png); width:104px;","Continue":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.108.16.png); width:80px;",
1642"Copy":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.76.16.png); width:48px;","Move":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.76.16.png); width:48px;",
1643"OK":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.60.16.png); width:32px;","Save":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.76.16.png); width:48px;",
1644"Select":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.84.16.png); width:56px;","Upgrade":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.104.16.png); width:76px;",
1645"Yes":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.64.16.png); width:36px;","Overwrite":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.116.16.png); width:88px;",
1646"Undo":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.76.16.png); width:48px;","Install Flash":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.136.16.png); width:108px;",
1647"Deactivate":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.124.16.png); width:96px;","Create":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.88.16.png); width:60px;",
1648"Delete":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.88.16.png); width:60px;","Publish Now":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.136.16.png); width:108px;",
1649"Keep Original":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.144.16.png); width:116px;","Schedule":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.108.16.png); width:80px;",
1650"Stay on the Page":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.176.16.png); width:148px;","Upload Duplicates":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.184.16.png); width:156px;",
1651"Create Shipping Method":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.232.16.png); width:204px;","Yes, edit as draft":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.176.16.png); width:148px;",
1652"Agree":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.84.16.png); width:56px;","Remove":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.100.16.png); width:72px;",
1653"View Participants":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.176.16.png); width:148px;","Next":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.72.16.png); width:44px;",
1654"Use Unique Names":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal.8.192.16.png); width:164px;","Yes, Generate New Codes":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal.8.248.16.png); width:220px;",
1655"Take a Look":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.136.16.png); width:108px;","Change Language":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.184.16.png); width:156px;"};
1656zf_buttonCreate._neutral={"Close":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal.8.52.16.png); width:52px;","Use Today\x27s Date":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal.8.152.16.png); width:152px;",
1657"Don\x27t Save":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal.8.96.16.png); width:96px;","Do not Upload Duplicates":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal.8.216.16.png); width:216px;",
1658"Create Duplicates":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal.8.152.16.png); width:152px;"};zf_buttonCreate._decline={"Back":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal.8.72.16.png); width:44px;",
1659"Cancel":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal.8.88.16.png); width:60px;","Close":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal.8.80.16.png); width:52px;",
1660"No":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal.8.56.16.png); width:28px;","Leave the Page":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal.8.160.16.png); width:132px;",
1661"Disagree":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.108.16.png); width:80px;","Do This Later":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.144.16.png); width:116px;",
1662"Remind Me Later":"background-image:url(https://cdn.zenfolio.com/zf/border/btn-normal-h.8.172.16.png); width:144px;"};function zf_buttonEnable(node,enable){;if(typeof(node)=="string")node=document.getElementById(node);
1663;if($(node).hasClass("btn-d")==enable){var background;background=node.style.backgroundImage;var k=-1;if((k=background.indexOf("http://"))!=-1)k=background.indexOf('/',
1664k+7);else if((k=background.indexOf("https://"))!=-1)k=background.indexOf('/',k+8);k=background.indexOf('.',k);if(enable){background=background.substr(0,k-2)+background.substr(k);
1665}else{background=background.substr(0,k)+"-d"+background.substr(k);}node.style.backgroundImage=background;$(node).toggleClass('btn-d',!enable);}}function zf_buttonIsEnabled(node){node=(typeof(node)==="string")?$('#'+node):$(node);
1666return!node.hasClass('btn-d');};function zf_AlbumServiceConfirm(id,grid,view){zf_Control.prototype.constructor.call(this,id);var self=this;this._btnClasses=["button-bgcolor1",
1667"button-color1","button-border1"];this._hoverClasses=["button-bgcolor2","button-color2","button-border2"];this._diabledClasses=["button-bgcolor3","button-color3",
1668"button-border3","disabled"];this.$dom().find('.pc-button').mouseover(function(){if($(this).hasClass(self._btnClasses[0])){$(this).removeClass(self._btnClasses.join(' ')).addClass(self._hoverClasses.join(' '));
1669}}).mouseout(function(){if($(this).hasClass(self._hoverClasses[0])){$(this).removeClass(self._hoverClasses.join(' ')).addClass(self._btnClasses.join(' '));}});this._thumbProcessingMethod=$.extend({},
1670zf_ProcessingMethod.StandardVeryLargeThumbnail,{cx:185,cy:150,clip:true,stretch:true});this._gridHeight=360;this._grid=grid;var plugins=[new zf_AscLabelPlugin({title:true}),
1671new zf_WaitAnimationPlugin(true)];this._grid.init(plugins);this._grid.$().addClass('pg pv-asc pvp-ng');this._view=view;this._grid.scrollView=view;this._grid.scrollView.onscrolling=this.closure2(this._sview_onscrolling);
1672this._grid.scrollView.onscroll=this.closure2(this._sview_onscroll);this._grid.onqueryitem=zf_stdFalse;this._enableNextButton(false);}zf_AlbumServiceConfirm.inherits(zf_Control);zf_AlbumServiceConfirm.prototype.init=function(type,
1673selectedPhotos,location,administrator,ownedOnly,checkPriceKey,showWarning){;;;;this._photos=[];this._galleries=[];this._galleryCovers=[];this._showWarning=showWarning;
1674this._location=location;this._administrator=administrator;this._ownedOnly=ownedOnly;this._checkPriceKey=checkPriceKey;this._setModalTitle(type);this._setConfirmContent(type,
1675selectedPhotos);this.show();};zf_AlbumServiceConfirm.prototype.cancel=function(){this.$dom().hide();this._hideCurtain();this._grid.clear();this._grid.$(".pg-empty-c").html("<p>Loading...</p>");
1676this._enableNextButton(false);};zf_AlbumServiceConfirm.prototype.next=function(){if(!this.$dom().find('.next').hasClass(this._diabledClasses[0]))zf_ZookbindersUtils.storeZookDesignFeeData(this._photos,
1677this._location,true,this._showWarning,this._folderId,this._folderTitle);};zf_AlbumServiceConfirm.prototype.show=function(){this.$('.modal-dialog-box').css({width:770,left:(zf_stdGetClientWidth()-770)/2,
1678top:(zf_stdGetClientHeight()-500)/2});$("body").append($(this.dom()));this._showCurtain();this.$dom().show();};zf_AlbumServiceConfirm.prototype._setGalleryGrid=function(selectedPhotos,
1679type){;var self=this;var photoId=selectedPhotos[0].id;var showWarning=function(message){if(message){self.$dom().hide();self._showWarning(zf_stdHtmlEncode(message));
1680return true;}return false;};zf_stdServerRequestEx('POST','/zf/core/printing/printing.asmx','GetSiblingGalleriesPhotos',[photoId],function(result,error){if(showWarning(error&&error.message)){return;
1681}filteredResult=zf_ZookbindersUtils.filterZookPhotos(result.photoList,self._administrator,self._ownedOnly,self._checkPriceKey,result.elements,type,selectedPhotos);
1682self._photos=filteredResult.filteredPhotos;self._galleries=filteredResult.filteredGalleries;if(showWarning(zf_ZookbindersUtils.checkPhotoCount(self._photos,zf_zenbar.zookMinPhotoCount))){return;
1683}self._folderId=result.id;self._folderTitle=result.title;if(type===zf_PhotoSet.Gallery){var galleryCovers=[];$.each(self._galleries,function(index){galleryCovers.push(self._galleries[index].image);
1684});self._galleryCovers=new zf_PhotoList(0,1,galleryCovers.length,galleryCovers);self._galleryCovers.setDefaults(null,new zf_User());self._grid.setSize(self._galleries.length);
1685self._grid.recalcLayout();self._grid.scrollView.update();self._sview_onscroll();}else{var msg=zf_stdFormatString('Selected Photos Contains {0} images. Use ONLY these images to make an album? You will not be able to change your selection beyond this point.',
1686self._photos.length);self._setMessage(msg);}self._enableNextButton(true);return;});};zf_AlbumServiceConfirm.prototype._showCurtain=function(){if(!zf_Curtain._current)zf_Curtain.show("light");
1687};zf_AlbumServiceConfirm.prototype._hideCurtain=function(){if(zf_Curtain._current)zf_Curtain.hide();};zf_AlbumServiceConfirm.prototype._sview_onscrolling=function(){var range=this._getRange();for(var index=range.start;
1688index<range.end;index++){if(this._grid.getItem(index)==null){this._grid.setItem(index,"_"+index,null,new zf_PlaceholderImage(1),self._thumbProcessingMethod,false,
1689null,{index:index,data:this._galleries[index],method:this._thumbProcessingMethod});}}this._grid.recalcLayout();};zf_AlbumServiceConfirm.prototype._sview_onscroll=function(){var range=this._getRange();
1690for(var index=range.start;index<range.end;index++){var item=this._grid.getItem(index);if(item==null||item.photo.placeholderId==1)this._loadPhoto(index);}this._grid.recalcLayout();
1691};zf_AlbumServiceConfirm.prototype._getRange=function(){var grid=this._grid;var size=grid.getCellSize();var info=grid.getLayoutInfo();var pos=this._view.getScrollPos();var hidden=Math.floor(pos/size.cy);
1692var start=hidden*info.itemsPerRow;var rows=Math.ceil((this._gridHeight+pos-hidden*size.cy)/size.cy);var end=Math.min(start+rows*info.itemsPerRow,this._galleries.length);
1693return{start:start,end:end};};zf_AlbumServiceConfirm.prototype._loadPhoto=function(index){;var self=this;var grid=this._grid;zf_Loadable.notifyLoaded(self._galleryCovers.get(index),function(photo){grid.setItem(index,
1694'p'+photo.getUnsignedId(),null,photo,self._thumbProcessingMethod,false,null,{index:index,data:self._galleries[index],method:self._thumbProcessingMethod});grid.recalcLayout();
1695});};zf_AlbumServiceConfirm.prototype._setModalTitle=function(type){var title="Use Selected Photos?";if(type==zf_PhotoSet.Gallery)title="Use Galleries?";else if(type==zf_PhotoSet.Collection)title="Use Collection?";
1696this.$(".title").text(title);};zf_AlbumServiceConfirm.prototype._setMessage=function(message){if(message==null||message==""){this.$(".text").text('');this.$('.text').css('display','none');
1697}else{this.$(".text").text(message);this.$('.text').css('display','block');}};zf_AlbumServiceConfirm.prototype._setConfirmContent=function(type,selectedPhotos){;;this._enableNextButton(false);
1698var loadingMessage="Loading...";if(type==zf_PhotoSet.Gallery){this._setMessage();this._grid.scrollView.setHeight(this._gridHeight);this._grid.clear();this._grid.$(".pg-empty-c").html(zf_stdFormatString("<p>{0}</p>",
1699loadingMessage));this.$('#'+this._grid.id).show();}else{this._grid.scrollView.setHeight(0);this.$('#'+this._grid.id).hide();this._setMessage(loadingMessage);}this._setGalleryGrid(selectedPhotos,
1700type);};zf_AlbumServiceConfirm.prototype._enableNextButton=function(enable){var self=this;var nextBtn=self.$dom().find('.next');
1700if(enable){nextBtn.removeClass(self._diabledClasses.join(' ')).addClass(self._btnClasses.join(' '));
1701}else{var removeClasses=nextBtn.hasClass(self._hoverClasses[0])?self._hoverClasses:self._btnClasses;nextBtn.removeClass(removeClasses.join(' ')).addClass(self._diabledClasses.join(' '));
1702}};;var zf_ReturnPageType={None:"None",Favorites:"Favorites",PhotoPage:"PhotoPage",PhotoSetPage:"PhotoSetPage",QuickShopPage:"QuickShopPage",HomePage:"HomePage",EventSearchPage:"EventSearchPage"};
1703;function zf_ReturnData(){this.pageType=null;this.scrapbookSingleView=null;this.scrapbookId=null;this.gridShowAll=null;this.fromQuickShop=null;this.quickShopPhotoId=null;
1704this.forceQuickShopSidebar=null;this.photoSetId=null;this.folderId=null;this.photoKey=null;this.addToCartPhotoKeys=null;}zf_ReturnData.wrapPhotoList=function(photoList,pageType,
1705data,owner){if(photoList){var get=photoList.get,getAll=photoList.getAll;photoList.get=function(index,touch){var photo=get.call(photoList,index,touch);zf_ReturnData.setReturnPage(photo,
1706pageType,data,owner);return photo;};photoList.getAll=function(){var photos=getAll.call(photoList);zf_ReturnData.setReturnPages(photos,pageType,data,owner);return photos;
1707};}return photoList;};zf_ReturnData.fromPhotoReturnPage=function(photo){var returnPage=photo&&photo.returnPage;if(!returnPage){return null;}var separatorIndex,eventSearchType='es;',
1708photoSetType='ps;';if((returnPage.indexOf(eventSearchType)==0)&&(returnPage.length>eventSearchType.length)){returnPage=returnPage.substring(eventSearchType.length);
1709separatorIndex=returnPage.indexOf(';');if((separatorIndex>=0)&&(separatorIndex<(returnPage.length-1))){var folderIdString=returnPage.substring(0,separatorIndex),
1710folderId=parseInt(folderIdString,10),searchQuery=returnPage.substring(separatorIndex+1);if(folderId>0&&searchQuery){return $.extend(new zf_ReturnData(),{pageType:zf_ReturnPageType.EventSearchPage,
1711gridShowAll:true,photoKey:zf_PhotoKey.getString(photo),folderId:folderId,searchQuery:searchQuery,returnUrl:zf_stdFormatString(zf_stdGetProtocol(zf_ownerDomain)+'{0}/f{1}?eq={2}',
1712zf_ownerDomain,folderId,encodeURIComponent(searchQuery))});}}}else if((returnPage.indexOf(photoSetType)==0)&&(returnPage.length>photoSetType.length)){returnPage=returnPage.substring(photoSetType.length);
1713separatorIndex=returnPage.indexOf(';');if((separatorIndex>=0)&&(separatorIndex<(returnPage.length-1))){var photoSetIdString=returnPage.substring(0,separatorIndex),
1714photoSetId=parseInt(photoSetIdString,10),gridShowAll=returnPage.substring(separatorIndex+1);if(photoSetId>0){return $.extend(new zf_ReturnData(),{pageType:zf_ReturnPageType.PhotoSetPage,
1715gridShowAll:gridShowAll=='1',photoKey:zf_PhotoKey.getString(photo),photoSetId:photoSetId,returnUrl:zf_stdFormatString(zf_stdGetProtocol(zf_ownerDomain)+'{0}/p{1}/e{2}',
1716zf_ownerDomain,photoSetId,photo.getUnsignedId().toString(16))});}}}return null;};zf_ReturnData.getReturnPage=function(key,pageType,data){if(pageType==zf_ReturnPageType.EventSearchPage){var eq=data.searchQuery||zf_stdParseQueryString('eq');
1717if(eq){return 'es;'+data.folderId+';'+eq;}}else if(pageType==zf_ReturnPageType.PhotoSetPage){return 'ps;'+data.photoSetId+';'+(data.gridShowAll?'1':'0');}return null;
1718};zf_ReturnData.getReturnPages=function(keys,pageType,data){if(!keys){return null;}var returnPages=[];for(var i=0;i<keys.length;i++){returnPages.push(zf_ReturnData.getReturnPage(keys[i],
1719pageType,data));}return returnPages;};zf_ReturnData.setReturnPages=function(photos,pageType,data,owner){if(!photos){return;}for(var i=0;i<photos.length;i++){zf_ReturnData.setReturnPage(photos[i],
1720pageType,data,owner);}};zf_ReturnData.setReturnPage=function(photo,pageType,data,owner){if(!photo){return;}photo.returnPage=zf_ReturnData.getReturnPage(zf_PhotoKey.getString(photo),
1721pageType,data);if(owner){photo.owner=owner;}};zf_ReturnData.prototype.hasAddToCartPhotoKeys=function(){return this.addToCartPhotoKeys&&this.addToCartPhotoKeys.length>0;};zf_ReturnData.prototype.hasPhotoKeys=function(){return this.returnToPhotoKey()!=null;
1722};zf_ReturnData.prototype.returnToPhotoKey=function(){if(this.hasAddToCartPhotoKeys()){return this.addToCartPhotoKeys[this.addToCartPhotoKeys.length-1];}if(this.photoKey){return this.photoKey;
1723}return null;};zf_ReturnData.prototype.showQuickShop=function(){return this.fromQuickShop&&this.quickShopPhotoId!=null;};zf_ReturnData.prototype.returnToQuickShopOnly=function(photoList){if(photoList.length>500&&this.gridShowAll!==false){if(this.showQuickShop()){return true;
1724}else{return null;}}return false;};;var Zenfolio;(function(Zenfolio){var Global;(function(Global){var AddToCartService=(function(){function AddToCartService(){}AddToCartService.addToCart=function(options){var _this=this;
1725if(options.newShoppingEnabled){var zenbarOptions_1=options.zenbarOptions;if(this.quickShopOnly(options.quickShopParameters)&&!zenbarOptions_1.fromQuickShop){return function(photos){var quickShopParameters=options.quickShopParameters;
1726if(zenbarOptions_1.fromScrapbook){quickShopParameters=$.extend({},quickShopParameters,{"qs_addtofav":"0","qs_addtoyp":"0","qs_comments":"0","qs_downloads":"0","qs_share":"0"});
1727}
1727var quickShopOptions={photoList:zf_PhotoList.wrap(Global.ConfiguratorService.asArray(photos)),startIndex:0,forceSidebar:true,fromScrapbook:zenbarOptions_1.fromScrapbook,
1728quickShopParameters:quickShopParameters,addToCartMode:true,returnData:zenbarOptions_1.returnData};if(zenbarOptions_1.fromScrapbook){quickShopOptions.backButtonText="Back to Favorites";
1729}Global.QuickShopManager.show(quickShopOptions);};}if((!zenbarOptions_1.fromQuickShop||!(zenbarOptions_1.vendorId&&zenbarOptions_1.productId))&&!this._isPackage(zenbarOptions_1.vendorId,
1730zenbarOptions_1.productId)){return function(photos){var photosArray=Global.ConfiguratorService.asArray(photos);if(Global.ConfiguratorService.needToLoadConfiguratorImpl(photosArray,
1731zenbarOptions_1)){_this._addToCartOld(options,true)(photos);}else{_this.addToCartNew(zenbarOptions_1,photosArray);}};}if(zenbarOptions_1.fromQuickShop&&!zenbarOptions_1.forceAddToCart&&zenbarOptions_1.usesItemEditor){return function(photos){_this.showProductPopup(zenbarOptions_1,
1732Global.ConfiguratorService.asArray(photos));};}}return this._addToCartOld(options,false);};AddToCartService.addToCartNew=function(zenbarOptions,photos){var _this=this;
1733Global.DomHelpers.toggleLoadingOverlay(true);this.loadAllPhotos(zenbarOptions.allPhotos,function(allPhotosArray){var returnPages={},handlePhoto=function(photo,keys){var key=zf_PhotoKey.getString(photo);
1734if(photo.returnPage){returnPages[key]=photo.returnPage;}keys.push(key);};var selectedPhotoKeys=[],availablePhotoKeys=[];$.each(photos,function(_index,photo){return handlePhoto(photo,
1735selectedPhotoKeys);});$.each(allPhotosArray,function(_index,photo){return handlePhoto(photo,availablePhotoKeys);});var data={selectedPhotoKeys:selectedPhotoKeys,
1736availablePhotoKeys:availablePhotoKeys,returnUrl:zenbarOptions.returnUrl||location.href,returnData:zenbarOptions.returnData||null,returnPages:$.isEmptyObject(returnPages)?null:returnPages};
1737zf_stdServerRequestEx("POST","/zf/layout/shopping/shopping.asmx","StartFlow",[data],function(result,error){if(error){Global.DomHelpers.toggleLoadingOverlay(false);
1738}else{var pageParams=_this._getNewShoppingPageParams(zenbarOptions);pageParams.token=result;location.href=Global.ShoppingUrlManager.pageUrl(pageParams,true);}});
1739});};AddToCartService.showProductPopup=function(zenbarOptions,photos){Global.ProductPopupLoader.showForAddToCart({allPhotos:zenbarOptions.allPhotos,selectedPhotos:photos,
1740returnUrl:zenbarOptions.returnUrl,returnData:zenbarOptions.returnData,vendorId:zenbarOptions.vendorId,productId:zenbarOptions.productId,ecommerceList:zenbarOptions.ecommerceList,
1741onClose:function(){return zenbarOptions.hide();}});};AddToCartService.quickShopOnly=function(quickShopParameters){return quickShopParameters&&quickShopParameters["qs_mode"]==Global.QuickShopMode.QuickShopOnly.toString();
1742};AddToCartService.loadAllPhotos=function(allPhotosList,callback){if(allPhotosList){allPhotosList.loadAll(function(){callback(allPhotosList.getAll());});}else{callback([]);
1743}};AddToCartService.goBackToGallery=function(e,returnUrl,returnData){this.updateReturnData(returnData);Global.DomHelpers.openLinkOnClick(e,this._redirectToReturnUrl(returnUrl));
1744};AddToCartService.configureBackToGallery=function($link,returnUrl,returnData){var _this=this;$link.attr("href",null).off("click").on("click",function(e){_this.goBackToGallery(e,
1745returnUrl,returnData);});};AddToCartService.configureContinueShopping=function($link,returnUrl,shoppingToken,returnData,lastItemPhotoKeys,newShoppingEnabled){var _this=this;
1746if(lastItemPhotoKeys&&lastItemPhotoKeys.length>0){this._saveToStorage(this._lastItemPhotoKeysStorageKey,lastItemPhotoKeys);}else{lastItemPhotoKeys=this._loadFromStorage(this._lastItemPhotoKeysStorageKey);
1747if(!$.isArray(lastItemPhotoKeys)||lastItemPhotoKeys.length<=0){lastItemPhotoKeys=null;}}$link.attr("href",null).off("click").on("click",function(e){if(newShoppingEnabled&&shoppingToken){Global.DomHelpers.openLinkOnClick(e,
1748Global.ShoppingUrlManager.pageUrl({pageType:Global.ShoppingPageType.Home,token:shoppingToken}));return;}if(zf_isMobileLayout()){returnData=null;}else if(returnData){if(returnData.fromQuickShop){returnData.forceQuickShopSidebar=true;
1749}else{returnData.addToCartPhotoKeys=lastItemPhotoKeys;}}_this.updateReturnData(returnData);Global.DomHelpers.openLinkOnClick(e,_this._redirectToReturnUrl(returnUrl));
1750});};AddToCartService.updateReturnData=function(returnData){this._saveToStorage(this._returnDataKey,returnData);};AddToCartService.getReturnData=function(){var returnData=this._loadFromStorage(this._returnDataKey);
1751return returnData?$.extend(new zf_ReturnData(),returnData):null;};AddToCartService._addToCartOld=function(options,redirectToNewShopping){var cart=options.cart,popup=options.configurator,
1752newShoppingEnabled=options.newShoppingEnabled,zenbarOptions=options.zenbarOptions;popup.setReturnUrl(zenbarOptions.returnUrl||location.href);zenbarOptions.shoppingToken&&popup.setShoppingToken(zenbarOptions.shoppingToken);
1753zenbarOptions.returnData&&popup.setReturnData(zenbarOptions.returnData);if(!zenbarOptions.forceAddToCart&&!zenbarOptions.usesItemEditor){popup.show(zenbarOptions.title,
1754newShoppingEnabled);}var onadd=options.onadd;
1754var onafterupdate=function(changeNumber){cart.changeNumber=changeNumber;};return function(photos){popup.addToCart($.extend(zenbarOptions,
1755{cart:cart,photos:photos,add:onadd,afterupdate:onafterupdate,redirectToNewShopping:redirectToNewShopping}));};};AddToCartService._getNewShoppingPageParams=function(zenbarOptions){if(zenbarOptions.vendorId&&zenbarOptions.productId){return{pageType:Global.ShoppingPageType.Product,
1756vendorId:zenbarOptions.vendorId,productId:zenbarOptions.productId,designId:zenbarOptions.designId,ecommerceList:zenbarOptions.ecommerceList};}if(zenbarOptions.categoryId=="photobooks-new"){return{pageType:Global.ShoppingPageType.Category,
1757categoryId:"albums-books",subcategoryId:"photobooks-new"};}return{pageType:Global.ShoppingPageType.Home};};AddToCartService._isPackage=function(vendorId,productId){return/^user/.test(vendorId)&&/^pack/.test(productId);
1758};AddToCartService._saveToStorage=function(key,obj){if(window.localStorage){try{if(!obj){localStorage.removeItem(key);return;}localStorage.setItem(key,JSON.stringify(obj));
1759}catch(e){}}};AddToCartService._loadFromStorage=function(key){if(window.localStorage){try{var storageData=localStorage.getItem(key);if(storageData){return JSON.parse(storageData);
1760}}catch(e){}}return null;};AddToCartService._redirectToReturnUrl=function(returnUrl){if(!returnUrl){return Global.TransferHandler.getUserDomainUrl("/");}return zf_stdGetTransferUrl(returnUrl);
1761};AddToCartService._returnDataKey="shopping.return-data";AddToCartService._lastItemPhotoKeysStorageKey="shopping.last-item-photo-keys";return AddToCartService;}());
1762Global.AddToCartService=AddToCartService;})(Global=Zenfolio.Global||(Zenfolio.Global={}));})(Zenfolio||(Zenfolio={}));;function zfl_ZenBar(options){;zfl_Control.prototype.constructor.call(this,
1763options.id);this.cart=options.cart;this._addToCart=options.addToCart;this._hidden=options.hidden;this.administrator=options.administrator;this.zookMinPhotoCount=options.zookMinPhotoCount;
1764this.newShoppingEnabled=options.newShoppingEnabled;this._cartQueue=new zf_RequestQueue(500);this._slideshows=[];this._albumServiceConfirm=options.albumServiceConfirm;
1765this.visible=false;if(options.addToCart)options.addToCart.setDecorationInfo(options.decorAddToCart);this._addtocart_onadd();var carti=true;this.$(".zenbar-sb-link,.zenbar-sb-menu").hover(this.closure(this._scrapbook_onmouseover),
1766this.closure(this._scrapbook_onmouseout));var self=this;this.$(".zenbar-sb-balloon").detach().appendTo("body").find(".close").click(function(){$(this).parent().fadeOut(200);
1767return false;});this.removerMenu={remove:function(){self.$dom("accmenu").stop(true,true).hide();},dom:function(){return self.dom("accmenu");}};this.removerCart={remove:function(){self.$dom("carti").stop(true,
1768true).hide();},dom:function(){return self.dom("carti");}};this.removerSbMenu={remove:function(){self.$dom("sbmenu").stop(true,true).hide();},dom:function(){return self.dom("sbmenu");
1769}};$(".zenbar-sb-link, .zenbar-menu-inner .list").click(function(){if($(this).is('.zenbar-sb-link'))self.showScrapbook();$(".zenbar-sb-balloon .close").trigger('click');
1770return false;});}zfl_ZenBar.inherits(zfl_Control);zfl_ZenBar.prototype.init=function(){if(this.returnData){return;}if(this._autoScrapbook()){zf_stdDeferCall(null,this.showScrapbook,
1771this);}if(this.cart&&this.cart.size>0){if(!zf_stdGetCookie('zf_cartreminder')&&this.$('.zenbar-cart-link').is(':visible')){this.showCartBalloon(zf_stdFormatString('You have {0} items in your cart.',
1772this.cart.size),typeof zf_userId!=='number'||zf_userId<=0,'cart');}else{this._setCookie('zf_cartreminder',1,6);}}};zfl_ZenBar.customize=function(){var search=location.search.replace(/(\?|&)customize=\d/g,
1773"");if(search.charAt(0)=="&")search="?"+search.substring(1);if(search.length>0)search+="&customize=1";else search="?customize=1";location.href=location.pathname+search+location.hash;
1774};zfl_ZenBar.prototype.customize=function(){zfl_ZenBar.customize();};zfl_ZenBar.prototype.logout=function(){var href;if(this.current&&this.current.loaded)href=this.current.getHref("full");
1775else href=location.href;location.href=zf_stdGetLogoutUrl(href);};
1775zfl_ZenBar.prototype.registerSlideshow=function(slideshow){;for(var i=0;i<this._slideshows.length;i++){if(this._slideshows[i]==slideshow){return;
1776}}this._slideshows.push(slideshow);};zfl_ZenBar.prototype._addtocart_onadd=function(cart){if(cart)this.cart=cart;else cart=this.cart;this.$dom().trigger("zfl_cartchange");
1777if(!cart)return;if(!this._updateVisibility())return;if(!cart.size){this.$().removeClass("zenbar-s-checkout");return;}var text=zf_stdFormatString("{0}",cart.size);
1778this.$().addClass("zenbar-s-checkout").find(".zenbar-cart-link .text").text(text);};zfl_ZenBar.prototype.updateCartSummary=function(cart){this._addtocart_onadd(cart);};zfl_ZenBar.prototype.setScrapbookInfo=function(scrapbook,
1779scrapbookEdit){if(this.scrapbookEdit&&!this.returnData){var addNewSet=!!zf_stdGetCookie('zf_zb_opensb_add_new_set');zf_stdRemoveCookie("zf_zb_opensb_add_new_set",
1780true);if(addNewSet){zf_stdDeferCall(null,this.scrapbookEdit.addNewSet,this.scrapbookEdit);}}var first=!this.scrapbook&&!!scrapbook&&!scrapbookEdit;var animate=!!this.scrapbook&&!!scrapbook&&this.scrapbook.id!=scrapbook.id||!!scrapbook&&scrapbook.addedCount!=undefined&&scrapbook.addedCount!=0&&!scrapbookEdit;
1781this.scrapbook=scrapbook;this._updateVisibility();this._scrapbookList=null;if(!this._updateVisibility())return;this.$().toggleClass("zenbar-s-scrapbook",!!scrapbook);
1782if(!scrapbook)return;this.$(".zenbar-sb").toggleClass("zenbar-s-scrapbook-edit",!!scrapbookEdit);if(scrapbookEdit){this.$(".zenbar-sb-close").get(0).onclick=this.closure(function(){scrapbookEdit.hide();
1783this._resumeSlideshows();return false;});return;}var text=zf_stdFormatString("{0} ({1})",scrapbook.name,scrapbook.photoCount);this.$(".zenbar-sb-link .text").text(text);
1784this.$(".zenbar-sb-sharer").toggleClass("none",!scrapbook.isSharedWith).text(scrapbook.sharerName?(scrapbook.sharerName+": "):"");this.$(".zenbar-sb-prefix").toggleClass("none",
1785scrapbook.isSharedWith);if(this.returnData){Zenfolio.Global.DomHelpers.toggleLoadingOverlay(true);zf_stdDeferCall(null,this._scrapbook_onmouseover,this);}else if(animate){var parent=this.$(".zenbar-sb");
1786if(first&&scrapbook.addedCount>0){if(scrapbook.name=="Selected For Purchase")text="Selected photos have been added to the Favorites Set. Click Favorites to view the set and purchase the photos.";
1787else text=zf_stdFormatString("Selected photos have been added to {0}. Photos are automatically shared with the photographer. Click Favorites to view the set.",scrapbook.name);
1788this.$dom("sb-balloon").fadeIn("fast").find(".text").text(text);}else{$(".zenbar-sb").css({"opacity":"0"}).animate({"opacity":"1"},1000);}parent=null;}};zfl_ZenBar.prototype.update=function(photo){this.current=photo;
1789};zfl_ZenBar.prototype._updateVisibility=function(){this.visible=!this._hidden&&(!!zf_userId||!!this.cart.size||!!this.scrapbook);this.$().toggleClass("none",!this.visible);
1790$("#page-frame").toggleClass("zenbar-visible",this.visible);if(!this._hidden){var backgroundPosition=zfl_getBackgroundPosition($('BODY'));if(backgroundPosition&&backgroundPosition[0]=='top'){$('BODY').css('background-position',
1791'top '+(this.visible?this.$().height()+'px ':'')+backgroundPosition[1]);}}this.$().trigger("updateVisibility");return this.visible;};zfl_ZenBar.prototype.addToCart=function(options){return Zenfolio.Global.AddToCartService.addToCart({cart:this.cart,
1792configurator:this._addToCart,newShoppingEnabled:this.newShoppingEnabled,quickShopParameters:this.quickShopParameters,onadd:this.closure(this._addtocart_onadd),zenbarOptions:options||{}});
1793};zfl_ZenBar.prototype.quickShopOnly=function(){return Zenfolio.Global.AddToCartService.quickShopOnly(this.quickShopParameters);};zfl_ZenBar.prototype.makeZookAlbum=function(photos,
1794isGspAlbumFlow){;zf_ZookbindersUtils.makeZookAlbum(photos,this.administrator,false,true,this.cart,this._showWarning,this.zookMinPhotoCount,isGspAlbumFlow?this._albumServiceConfirm:null);
1795};zfl_ZenBar.prototype.addOrUpdateZookbindersDesignFee=function(settings,apiMethod,callback){;;var self=this,cart=zf_ZookbindersUtils.cartHasUsdCurrency(this.cart,this._showWarning);
1796if(!cart){callback&&callback();return;}zf_stdServerRequestEx('POST','/zf/core/printing/printing.asmx',apiMethod,[cart.id,settings],function(result,error){if(error){self._showWarning(zf_stdHtmlEncode(error.message));
1797callback&&callback();return;}result.cart&&zf_cartSetId(result.cart);location.href=Zenfolio.Global.TransferHandler.getUserDomainUrl('/cart.html');});};
1797zfl_ZenBar.prototype.canMakeZookAlbum=function(photos){;
1798return this._filterZookPhotos(photos).length>=this.zookMinPhotoCount;};zfl_ZenBar.prototype.confirmProduct=function(){var popup=this._addToCart;var cart=this.cart;var onafterupdate=function(changeNumber,
1799items){cart.changeNumber=changeNumber;};popup.setReturnUrl(location.href);popup.show("Loading Product Confirmation");return function(info){popup.confirmProduct({cart:cart,
1800item:info.item,photos:info.photos,afterupdate:onafterupdate});};};zfl_ZenBar.prototype.editProduct=function(info,options){var popup=this._addToCart;var cart=this.cart;popup.show('');
1801options=options?options:{};var onafterupdate=function(changeNumber,items){cart.changeNumber=changeNumber;};if(info.item!=null){return function(photos){popup.editProduct($.extend(options,
1802{cart:cart,item:info.item,itemPhotos:info.photos,photos:(photos instanceof Array)?photos:[photos],afterupdate:onafterupdate}));};}else{return function(photos){popup.editProduct($.extend(options,
1803{cart:cart,pkg:info.pkg,itemPhotos:info.photos,photos:(photos instanceof Array)?photos:[photos],afterupdate:onafterupdate}));};}};zfl_ZenBar.prototype.showScrapbook=function(){this.removerSbMenu.remove();
1804this._scrapbookList=null;this._pauseSlideshows();if(this.onscrapbook)this.onscrapbook();zf_stdRemoveCookie("zf_zb_opensb");};zfl_ZenBar.prototype._cartDynamicLoadFunction=function(cb){var self=this;
1805this._cartQueue.enqueueEx("GET","/zf/core/printing/printing.asmx","GetCartSummary",[zf_locale,this.cart.id,this.cart.photographerId,this.cart.changeNumber,true],
1806function(result,error){if(error)return;var markup="<h4>Your Cart</h4>";markup+="<div class=\"items\">";for(var i=0;i<result.categories.length;i++){var category=result.categories[i];
1807markup+="<div class=\"cat\">"+"<div class=\"desc\">"+zf_stdHtmlEncode(category.name)+"</div>"+"<div class=\"count\">x"+category.count+"</div>"+"<div class=\"amount\">"+zf_stdFormatMoney(category.price,
1808self.cart.currency)+"</div>"+"</div>";}markup+="<div class=\"cat\">"+"<div class=\"desc sub-total-title\">Subtotal</div>"+"<div class=\"count\"></div>"+"<div class=\"amount sub-total\">"+zf_stdFormatMoney(self.cart.productPrice,
1809self.cart.currency)+"</div>"+"</div>";markup+="</div>";$("#cart-dropdown-inner .contents").html(markup);cb();});};zfl_ZenBar.prototype._cart_onmouseover=function(){zfl_Layout.currentMenu=this.removerCart;
1810this.$dom("carti").find(".total").text(zf_stdFormatMoney(this.cart.productPrice,this.cart.currency));this.$dom("carti").stop(true,true).slideDown(100);var self=this;
1811};zfl_ZenBar.prototype._save_onclick=function(){this.$dom("carti").stop(true,true).hide();var args={title:'Save Cart',text:'To store your shopping cart with your account you need to login or register.',
1812text2:'Once you are logged in, your shopping cart will be accessible from multiple computers.',curtain:true,buttons:['Cancel','Login or Register'],onbutton:function(btn){if(btn==1)zfl_Header.login();
1813}};zfl_MessageBox.show(args);return;};zfl_ZenBar.prototype._scrapbook_onmouseover=function(){if(zfl_Layout.currentMenu&&zfl_Layout.currentMenu!=this.removerSbMenu)zfl_Layout.currentMenu.remove();
1814zfl_Layout.currentMenu=this.removerSbMenu;var el=this.$(".zenbar-sb-link .drop-down");var pos=el.offset();var elHeight=el.height();var left=pos.left-13;var top=pos.top+elHeight+3;
1815if(!this.returnData){this.$dom("sbmenu").css({"left":left+"px","top":top+"px"}).stop(true,true).slideDown(100);}var self=this;if(self._scrapbookList)return;zfb_Api.loadScrapbooks(zf_ownerId,
1816function(result,error){if(error!=null){if(self.returnData){self.returnData=null;Zenfolio.Global.DomHelpers.toggleLoadingOverlay(false);}return;}self._buildScrapbookMenu(result);
1817self._scrapbookList=result;if(self.returnData){self.removerSbMenu.remove();if(self.scrapbook.id==self.returnData.scrapbookId){self.scrapbookEdit.returnData=self.returnData;
1818self.returnData=null;self.showScrapbook();}else{var targetScrapbook=null;for(var i=0;i<result.length;i++){if(result[i].id==self.returnData.scrapbookId){targetScrapbook=result[i];
1819break;}}if(!targetScrapbook){self.returnData=null;Zenfolio.Global.DomHelpers.toggleLoadingOverlay(false);}else{self.scrapbookEdit.returnData=self.returnData;self.returnData=null;
1820self.scrapbookEdit.switchTo(targetScrapbook);}}}});};
1820zfl_ZenBar.prototype._scrapbook_onmouseout=function(){var self=this;var reset=function(){if(zfl_Layout.currentMenu==self.removerSbMenu)zfl_Layout.currentMenu=null;
1821};this.$dom("sbmenu").delay(400).queue(function(){$(this).stop(true,true).slideUp(200,reset).dequeue();});};zfl_ZenBar.prototype._buildScrapbookMenu=function(list){var self=this;
1822var markup=[];for(var i=0;i<list.length;i++){markup.push('<a zf:index="',i,'">','<span class="sb-menu-title">',list[i].id==this.scrapbook.id?'Edit':'Switch to','</span> ',
1823'<span class="sb-menu-item">',zf_stdHtmlEncode(list[i].name),'</span>','</a>');}this.$dom("sbmenu").find(".list").html(markup.join(""));this.$dom("sbmenu").find(".list a").click(function(){var index=parseInt($(this).attr("zf:index"));
1824self.removerSbMenu.remove();if(list[index].id==self.scrapbook.id)self.showScrapbook();else self.scrapbookEdit.switchTo(list[index]);});this.$dom("sbmenu").find(".zenbar-sb-create").unbind().bind('click',
1825function(){self.removerSbMenu.remove();self.scrapbookEdit.addNewSet();return false;});};zfl_ZenBar.prototype._filterZookPhotos=function(photos){;photos=$.isArray(photos)?photos:[photos];
1826return zf_ZookbindersUtils.filterZookPhotos(photos,this.administrator,false,true).filteredPhotos;};zfl_ZenBar.prototype._autoScrapbook=function(){var openScrapbook=zf_stdGetCookie('zf_zb_opensb');
1827var openScrapbookShare=zf_stdGetCookie('zf_zb_opensb_share');var openScrapbookCreateNew=zf_stdGetCookie('zf_zb_opensb_create_new');return(!!openScrapbook||!!openScrapbookShare||!!openScrapbookCreateNew)&&!this.disableAutoScrapbook;
1828};zfl_ZenBar.prototype.showCartBalloon=function(message,showRegisterCTA,iconClass){this._cartBalloon=$("#zenbar-cartballoon");if(!this._cartBalloon){return;}var self=this;
1829this._cartBalloon.find('.cb-content .text').html(message);if(typeof iconClass==='string'){this._cartBalloon.find('.cb-content .icon').addClass(iconClass);}else{this._cartBalloon.find('.cb-content .icon').attr('class',
1830'icon');}this._cartBalloon.find('.cb-content').click(function(){window.location.href=Zenfolio.Global.TransferHandler.getUserDomainUrl('/cart.html');});if(showRegisterCTA){this._cartBalloon.find('.cb-register').show();
1831}else{this._cartBalloon.find('.cb-register').hide();}setTimeout(function(){zf_DropDown_Instance.showMenu("zenbar-cartballoon");},10);this._setCookie('zf_cartreminder',
18321,6);};zfl_ZenBar.prototype._setCookie=function(name,value,expire){var expHours=6;if(!isNaN(expire)){expHours=expire;}var exp=new Date();exp=new Date(exp.setHours(exp.getHours()+expHours));
1833zf_stdSetCookie(name,value,exp);};zfl_ZenBar.prototype._setCartBalloonFadeOut=function(delay){var self=this,timeoutDelay=delay||10000;if(this._cartBalloon){this._cartBalloonTimeout=setTimeout(function(){if(self._cartBalloon.is(':visible')){self._cartBalloon.fadeOut('slow');
1834}},timeoutDelay);}};zfl_ZenBar.prototype._showWarning=function(message){zfl_MessageBox.show({encode:false,text:message||'An unexpected error has occurred. Please try again later. If this problem persists, contact Support.',
1835title:'Warning',buttons:['Close']});};zfl_ZenBar.prototype._pauseSlideshows=function(){if(this._slideshows){for(var i=0;i<this._slideshows.length;i++){this._slideshows[i].togglePlay(false);
1836}}};zfl_ZenBar.prototype._resumeSlideshows=function(){if(this._slideshows){for(var i=0;i<this._slideshows.length;i++){this._slideshows[i].togglePlay(true);}}};zfl_ZenBar.prototype.getPrintingConfigurator=function(){return this._addToCart;
1837};;;;;;function zfl_FooterMenu(id,vertical){zfl_AbstractMenu.prototype.constructor.call(this,id,vertical,"r","u");this._extraHorzPadding=vertical?0:-2;this.bind($(this.dom()).find("A[data-zf-subitems]"));
1838}zfl_FooterMenu.inherits(zfl_AbstractMenu);zfl_FooterMenu.prototype.hoverSubItem=function($item,hoverOn){if(hoverOn){$item.removeClass("footer-color3 footer-bgcolor2 footer-bgcolor5").addClass("footer-color4 footer-bgcolor3");
1839}else{$item.removeClass("footer-color4 footer-bgcolor3").addClass("footer-color3 footer-bgcolor2 footer-bgcolor5");}};zfl_FooterMenu.prototype._getMenuName=function(){return 'footersubmenu';
1840};;;function zfl_FooterSearch(id){zfl_Control.prototype.constructor.call(this,id);this._search_slider_delay=new zf_DelayedInvoke(800);var self=this;this.$('.ftr-search-slider').mouseenter(this.closure(this._slider_search_onmouseenter)).mouseleave(this.closure(this._slider_search_onmouseleave));
1841}zfl_FooterSearch.inherits(zfl_Control);zfl_FooterSearch.prototype._slider_search_onmouseenter=function(e){var self=this;if(e.relatedTarget){for(var parent=e.relatedTarget;parent!=null;parent=parent.parentNode){if(zf_stdHasClassName(parent,
1842"lb"))return;}}this._search_slider_delay.clear();this.$('.ftr-search-slider,.ftr-search-bgc').removeClass('collapsed').animate({width:"204px"},{duration:"fast",easing:"swing",
1843queue:false,complete:function(){$(this).addClass('expanded');}});};zfl_FooterSearch.prototype._slider_search_onmouseleave=function(){var self=this;this._search_slider_delay.invoke(function(){$(self.$('.ftr-search-slider,.ftr-search-bgc')).removeClass("expanded").animate({width:"22px"},
1844{duration:"slow",easing:"swing",queue:false,complete:function(){$(this).addClass("collapsed");}});});};;;function zfl_FooterLogin(id){zfl_Control.prototype.constructor.call(this,
1845id);var self=this;this.$('.ftr-login-link').click(function(){self.login();return false;});this.$('.ftr-logout-link').click(function(){self.logout();return false;
1846});}zfl_FooterLogin.inherits(zfl_Control);zfl_FooterLogin.login=function(comeback,verb){zfl_openLoginPage(comeback,verb);};zfl_FooterLogin.prototype.login=function(verb){var href=null;if(this.current&&this.current.loaded)href=this.current.getHref("full");
1847zfl_FooterLogin.login(href,verb);};zfl_FooterLogin.prototype.logout=function(){var href;if(this.current&&this.current.loaded)href=this.current.getHref("full");else href=location.href;
1848location.href=zf_stdGetLogoutUrl(href);};zfl_FooterLogin.prototype.update=function(photo){};;function zfl_Footer(id){zfl_Control.prototype.constructor.call(this,id);var self=this;this.$('.ftr-login-link').click(function(){self.login();
1849return false;});this.$('.ftr-logout-link').click(function(){self.logout();return false;});}zfl_Footer.inherits(zfl_Control);zfl_Footer.login=function(comeback,verb){zfl_openLoginPage(comeback,
1850verb);};zfl_Footer.prototype.login=function(verb){var href=null;if(this.current&&this.current.loaded)href=this.current.getHref("full");zfl_Footer.login(href,verb);};zfl_Footer.prototype.logout=function(){var href;
1851if(this.current&&this.current.loaded)href=this.current.getHref("full");else href=location.href;location.href=zf_stdGetLogoutUrl(href);};zfl_Footer.prototype.update=function(photo){};
1852;;;function zfl_Popup(id,embedded){if(zf_stdNoArgs(arguments))return;this.embedded=embedded;zfl_Control.prototype.constructor.call(this,id);}zfl_Popup.inherits(zfl_Control);zfl_Popup.current=null;
1853zfl_Popup.prototype.show=function(domOrigin,constraint){var domPopup=this.dom();if(!this.embedded){if(zfl_Popup.current!=null)zfl_Popup.current.hide();if(!this.keepParent){document.body.appendChild(domPopup.parentNode.removeChild(domPopup));
1854}}this.updatePosition(domOrigin,constraint);if(!this.embedded){zfl_Popup.current=this;setTimeout(function(){zf_stdAttachEvent(document.body,"mousedown",zfl_Popup._any_onclick);
1855zf_stdAttachEvent(document.body,"keypress",zfl_Popup._any_onkeypress);},10);}domPopup=null;domOrigin=null;};zfl_Popup.prototype.hide=function(){this.display(false);
1855if(this.embedded)return;
1856if(zfl_Popup.current!=this)return;zf_stdDetachEvent(document.body,"mousedown",zfl_Popup._any_onclick);zf_stdDetachEvent(document.body,"keypress",zfl_Popup._any_onkeypress);
1857zfl_Popup.current=null;};zfl_Popup._any_onclick=function(e){if(zfl_Popup.current!=null){var domSource=zf_stdGetEventSource(e);var domPopup=zfl_Popup.current.dom();for(var obj=domSource;
1858obj!=null;obj=obj.parentNode){if(obj==domPopup)return;}zfl_Popup.current.hide();}};zfl_Popup._any_onkeypress=function(e){if(e.keyCode==27&&zfl_Popup.current)zfl_Popup.current.hide();
1859};zfl_Popup.hideAny=function(){if(zfl_Popup.current)zfl_Popup.current.hide();};zfl_Popup.prototype.updatePosition=function(domOrigin,constraint){var domPopup=this.dom();var cxBody=document.body.offsetWidth;
1860var cyBody=zf_stdGetClientHeight();var ptOrigin=zf_stdGetOffset(domOrigin);var xOrigin=ptOrigin.cx,yOrigin=ptOrigin.cy;var cxOrigin=domOrigin.offsetWidth;var cyOrigin=domOrigin.offsetHeight;
1861var cxPopup,cyPopup;var displayStyle=zf_stdGetCurrentStyle(domPopup,"display");if(!displayStyle||displayStyle=="none"){domPopup.style.top="0px";domPopup.style.left="0px";
1862domPopup.style.visibility="hidden";domPopup.style.display="block";}cxPopup=domPopup.offsetWidth;cyPopup=domPopup.offsetHeight;var left=(xOrigin<cxBody/2||constraint&&constraint=="shift-right")?xOrigin:(xOrigin-cxPopup+cxOrigin);
1863var top=(yOrigin<cyBody/2)?(yOrigin+cyOrigin+2):(yOrigin-cyPopup-2);if(left+cxPopup+16>cxBody)left=cxBody-cxPopup-16;domPopup.style.left=left+"px";domPopup.style.top=top+"px";
1864domPopup.style.display="block";domPopup.style.visibility="inherit";domPopup=null;domOrigin=null;};;function zfl_Feeds(id){if(zf_stdNoArgs(arguments))return;zfl_Popup.prototype.constructor.call(this,
1865id,false);}zfl_Feeds.inherits(zfl_Popup);;var zfl_PhotoViewStyle={FolderElement:"FolderElement",GalleryPhoto:"GalleryPhoto",PhotoNavList:"PhotoNavList",PhotoNavThumbnail:"PhotoNavThumbnail",
1866CurrentPhoto:"CurrentPhoto",DimLights:"DimLights",BioPhoto:"BioPhoto",ProductCategory:"ProductCategory",Slideshow:"Slideshow",CommentBrowser:"CommentBrowser",PhotoVList:"PhotoVList"};
1867;;function zf_Folder(){zf_Loadable.prototype.constructor.call(this);this.caption="";this.photos=0;this.images=0;this.videos=0;this.subfolders=0;this.galleries=0;this.collections=0;
1868this.elements=[];}zf_Folder.inherits(zf_Loadable);zf_Folder.prefix="f";zf_Folder._fields=["id","title","caption","customReference","created","modified","photos","images","videos","galleries",
1869"collections","subfolders","isEmpty","sortOrder","views","pricing","theme","isSignInDerived","signIn","subOwner","hideTitle","isEvent","eventFeatured","isYearbookEnabled"];
1870zf_Folder.clone=function(folder){if(folder==null)return null;var cloned=zf_stdCopyFields(new zf_Folder(),folder,zf_Folder._fields);cloned.image=zf_PhotoImage.clone(folder.image);
1871cloned.access=zf_AccessInfo.clone(folder.access);cloned.owner=zf_User.clone(folder.owner);if(folder.pricing)cloned.pricing=zf_PricingInfo.clone(folder.pricing);return cloned;
1872};zf_Folder.prototype.postSerialize=function(){zf_Loadable.prototype.postSerialize.call(this);if(this.pricingKey!=null){this.pricing=new zf_PricingInfo(null,this.pricingKey);
1873this.pricing.isDerived=!!this.isPricingDerived;}if(this.event!=null)this.isEvent=true;};zf_Folder.prototype.getHref=function(style){if(style=="edit"){return[zf_stdGetProtocol(zf_defaultHost),
1874zf_defaultHost,"/",this.owner.loginName,"/f",this.id,"/edit"].join("");}else if(style=="edit-new"){return[zf_stdGetProtocol(zf_defaultHost),zf_defaultHost,"/",this.owner.loginName.toLowerCase(),
1875"/e/f",this.id].join("");}else{var m=location.search.match(/(customize=\d)/),query=m?"?"+m[0]:"",href=[];if(style!=null&&style!="analytics")href.push(zf_stdGetProtocol(this.owner.domainName),
1876this.owner.domainName);href.push(this.getBaseHref());if(style!="external"&&style!="analytics")href.push(query);return href.join("");}};zf_Folder.prototype.getBaseHref=function(){if(this.customReference!=null&&this.customReference.length>0)return "/"+this.customReference;
1877return "/f"+this.id;};zf_Folder.prototype.mergeFolder=function(folder){if(folder.photos>this.photos)this.photos=folder.photos;if(!folder.event)return this;this.event=folder.event;
1878return this;};zf_Folder.prototype.isYearbookEnabledForItem=function(){if(this.isYearbookEnabled==null){return zf.edit.ToolboxYearbook.isYearbookEnabledForParent(this);}return this.isYearbookEnabled;
1879};;;;function zfl_LabelPlugin(params){this.params=params;}zfl_LabelPlugin.prototype.getOuterContent=function(id,context){if(this.params.title||this.params.created||this.params.modified||this.params.visitors||this.params.count){return['<div class="pv-label">',
1880this._content(context),'</div>'].join("");}return "";};zfl_LabelPlugin.prototype.onCreateDom=function(view,outer,inner,context,isNew){if(isNew)return;var domLabel;var child;for(child=outer.firstChild;
1881child!=null;
1881child=child.nextSibling){if(child.className=="pv-label"){domLabel=child;break;}}if(domLabel)domLabel.innerHTML=this._content(context);};zfl_LabelPlugin.prototype._content=function(context){var data=context.data;
1882var elements=[];if(this.params.title){elements.push('<h4 class="title">',zf_stdHtmlEncode(data.title),'</h4>');}var pad1=[],pad2=[];if(data instanceof zf_Folder){if(this.params.count){if(data.galleries>0)pad1.push(["Galleries {0}",
1883data.galleries]);if(data.collections>0)pad1.push(["Collections {0}",data.collections]);}if((data.access.mask&zf_AccessMask.ProtectDateModified)==0)pad2.push(["Modified {0}",
1884zf_stdFormatDate(data.modified)]);if(this.params.count)pad2.push(this._getCountPair(data));}else if(data instanceof zf_PhotoSet){if((data.access.mask&zf_AccessMask.ProtectVisits)==0)pad1.push(["Visitors {0}",
1885data.views]);if(this.params.count)pad1.push(this._getCountPair(data));if((data.access.mask&zf_AccessMask.ProtectDateCreated)==0)pad2.push(["Created {0}",zf_stdFormatDate(data.created)]);
1886if((data.access.mask&zf_AccessMask.ProtectDateModified)==0)pad2.push(["Modified {0}",zf_stdFormatDate(data.modified)]);}if(pad1.length==0){var tmp=pad2;pad2=pad1;
1887pad1=tmp;}var i;if(pad1.length>0){elements.push(pad2.length==0?'<div class="pad-0">':'<div class="pad-1">');for(i=0;i<pad1.length;i++){elements.push('<div class="pair pair-color1">',
1888zf_stdFormatString(pad1[i][0],['<b class="pair-0">',pad1[i][1],'</b>'].join("")),'</div>');}elements.push('</div>');}if(pad2.length>0){elements.push('<div class="pad-2">');
1889for(i=0;i<pad2.length;i++){elements.push('<div class="pair pair-color1">',zf_stdFormatString(pad2[i][0],['<b class="pair-0">',pad2[i][1],'</b>'].join("")),'</div>');
1890}elements.push('</div>');}return elements.join("");};zfl_LabelPlugin.prototype._getCountPair=function(data){;if(data.images&&data.videos){if(data instanceof zf_Folder){if(data.images>data.videos)return["{0} photos",
1891data.images];return["{0} videos",data.videos];}return["{0} items",data.photos];}if(data.videos)return["{0} videos",data.videos];return["{0} photos",data.images];
1892};;;;;function zfl_VLabelPlugin(params){this.params=params;}zfl_VLabelPlugin.prototype.getOuterContent=function(id,context){if(this.params.title||this.params.uploaded||this.params.visitors||this.params.comments){return['<div class="pv-vlabel">',
1893this._content(context),'</div>'].join("");}return "";};zfl_VLabelPlugin.prototype.onCreateDom=function(view,outer,inner,context,isNew){var photo=context.data;if(this.params.comments&&(photo.flags&zf_PhotoFlags.HasComments)!=0){var meta=photo.getMeta();
1894if(!meta.loaded){var self=this;meta.bump();meta.advise(this,function(){self._setMeta(meta,outer,context);},function(){});}}if(isNew)return;$(outer).find(".pv-vlabel").replaceWith(this.getOuterContent("",
1895context));};zfl_VLabelPlugin.prototype._content=function(context){var data=context.data;var elements=[];if(this.params.title){elements.push('<h4 class="title">',zf_stdHtmlEncode(data.title),
1896'</h4>');}var pad1=[],pad2=[];if((data.access.mask&zf_AccessMask.ProtectVisits)==0)pad1.push(["Visitors {0}",data.views]);var hideUploaded=this.params.title&&(data.title.length>0)&&this.params.comments&&(data.flags&zf_PhotoFlags.HasComments)!=0&&(data.access.mask&zf_AccessMask.ProtectVisits)==0;
1897if(this.params.uploaded&&!hideUploaded)pad1.push(["Uploaded {0}",zf_stdFormatDate(data.uploaded)]);var comments=null;if(this.params.comments&&(data.flags&zf_PhotoFlags.HasComments)!=0){var meta=data.getMeta();
1898if(meta.loaded){comments=meta.comments;}}if(comments!=null)pad1.push(["Comments {0}",comments]);pad2=pad1;var i;if(pad1.length>0){elements.push(pad2.length==0?'<div class="pad-0">':'<div class="pad-1">');
1899for(i=0;i<pad1.length;i++){elements.push('<div class="pair pair-color1">',zf_stdFormatString(pad1[i][0],['<b class="pair-0">',pad1[i][1],'</b>'].join("")),'</div>');
1900}elements.push('</div>');}if(pad2.length>0){elements.push('<div class="pad-2">');for(i=0;i<pad2.length;i++){elements.push('<div class="pair pair-color1">',zf_stdFormatString(pad2[i][0],
1901['<b class="pair-0">',pad2[i][1],'</b>'].join("")),'</div>');}elements.push('</div>');}return elements.join("");};zfl_VLabelPlugin.prototype._setMeta=function(meta,outer,context){;
1902var element=$(outer).find(".pv-vlabel");element.replaceWith(this.getOuterContent("",context));};zfl_VLabelPlugin.prototype.onDestroyDom=function(view,outer,inner,context){var data=context.data;
1903var meta=data.getMeta();if(!meta.loaded){meta.unadvise(this);}};;;;;;function zfl_InfoIconPlugin(params){this.params=params!=null?params:{};}zfl_InfoIconPlugin.prototype.getOuterContent=function(id,
1904context){if(context==null)return "";var data=context.data;var access=context.data.access;if(!this.params.fthumb&&data instanceof zf_Folder&&this.params.ac)return this._access(access.type);
1905return "";};zfl_InfoIconPlugin.prototype.getInnerContent=function(id,context){if(context==null)return "";var data=context.data;var access=context.data.access;var index=context.index;
1906var elements=[];if(this.params.ac&&(this.params.fthumb||!(data instanceof zf_Folder)))elements.push(this._access(access.type));if(this.params.type){if(data instanceof zf_PhotoSet&&data.type==zf_PhotoSet.Gallery)elements.push('<div class="pv-type gallery-icon"></div>');
1907else if(data instanceof zf_PhotoSet&&data.type==zf_PhotoSet.Collection)elements.push('<div class="pv-type collection-icon"></div>');else if(data instanceof zf_Folder&&this.params.fthumb)elements.push('<div class="pv-type folder-icon"></div>');
1908}
1908if(this.params.sn&&data instanceof zf_Photo&&context.index!=null)elements.push('<div class="pv-index">',context.index+1,'</div>');return elements.join("");};zfl_InfoIconPlugin.prototype.onCreateDom=function(view,
1909outer,inner,context,isNew){if(isNew||!context)return;var domAccess,domTypeIcon,domPhotoIndex;var child;if(!this.params.fthumb&&context.data instanceof zf_Folder){for(child=outer.firstChild;
1910child!=null;child=child.nextSibling){if(child.className!=null&&child.className.substr(0,6)=="pv-ac "){domAccess=child;break;}}}else{for(child=inner.firstChild;child!=null;
1911child=child.nextSibling){if(child.className==null)continue;if(child.className.substr(0,6)=="pv-ac ")domAccess=child;else if(child.className.substr(0,10)=="pv-type ")domtypeIcon=child;
1912else if(child.className=="pv-index")domPhotoIndex=child;}}if(domAccess){switch(context.data.access){case zf_AccessType.Public:domAccess.className="pv-ac ac-pub";
1913domAccess.title="";break;case zf_AccessType.Private:domAccess.className="pv-ac ac-pri";domAccess.title="Private";break;case zf_AccessType.Password:domAccess.className="pv-ac ac-pwd";
1914domAccess.title="Password Protected";break;case zf_AccessType.Protected:domAccess.className="pv-ac ac-pro";domAccess.title="Members Only";break;default:break;}}if(domTypeIcon){if(context.data instanceof zf_PhotoSet&&context.data.type=="Gallery")domTypeIcon.className="pv-type gallery-icon";
1915else if(context.data instanceof zf_PhotoSet&&context.data.type=="Collection")domTypeIcon.className="pv-type collection-icon";else if(context.data instanceof zf_Folder)domTypeIcon.className="pv-type folder-icon";
1916}if(domPhotoIndex){zf_stdSetText(domPhotoIndex,context.index+1);}};zfl_InfoIconPlugin.prototype._access=function(accessType){switch(accessType){case zf_AccessType.Public:return '';
1917case zf_AccessType.Private:return '<div class="pv-ac ac-pri" title="Private"></div>';case zf_AccessType.Password:return '<div class="pv-ac ac-pwd" title="Password Protected"></div>';
1918case zf_AccessType.Protected:return '<div class="pv-ac ac-pro" title="Members Only"></div>';default:return '';}};;;;;function zfl_DecorationPlugin(info,style,params){this.info=info;
1919this.style=style;this.params=params||{};}zfl_DecorationPlugin.prototype.getOuterContent=function(id,context){if(context==null)return "";var data=context.data;var content=[];if(this.info.imagePad)content.push('<div class="pv-pad"></div>');
1920if(data instanceof zf_Folder&&!this.params.fthumb)content.push('<a class="pv-folder" href="',data.getHref(),'"></a>');return content.join("");};zfl_DecorationPlugin.prototype.getInnerContent=function(id,
1921context,smap,regenerate){if(context==null)return "";var data=context.data;var image=context.image;var method=context.method;var folder=context.data instanceof zf_Folder;
1922var elements=[];if((!folder||this.params.fthumb)&&!this.params.hideShadow&&this.info.shadowSize>0){var extent=this.info.shadowSize+this.info.borderSize;var size=null;
1923if(!data||!image||smap["pv-s-1"]||smap["pv-s-2"]||smap["pv-s-3"]||smap["pv-s-password"]||smap["pv-s-noaccess"]){size=this._getPlaceholderSize(method,smap);}if(size==null&&image!=null)size=image.getScaledSize(context.method);
1924if(size==null)size={cx:method.cx,cy:method.cy};var left=-extent;var top=-extent;var width=size.cx+extent*2;var height=size.cy+extent*2;var shadow=this.info.shadowName;
1925if(shadow){elements.push(zfl_DecorationInfo.getShadowHtml("pv-shadow",shadow,this.info.shadowType,this.info.shadowSize,left,top,width,height));}}if(!regenerate){if(folder&&!this.params.fthumb||this.info.borderSize>0||this.info.hasShadowBox)elements.push('<div class="pv-border"></div>');
1926}return elements.join("");};zfl_DecorationPlugin.prototype._getPlaceholderSize=function(method,smap){if(method==zf_ProcessingMethod.StandardThumbnail)return{cx:80,cy:53};if(method==zf_ProcessingMethod.StandardSmallThumbnail)return{cx:60,
1927cy:60};if(method==zf_ProcessingMethod.StandardLargeThumbnail)return{cx:120,cy:80};if(method==zf_ProcessingMethod.StandardVeryLargeThumbnail)return{cx:200,cy:133};
1928if(method==zf_ProcessingMethod.StandardBioPhoto)return{cx:83,cy:111};return null;};zfl_DecorationPlugin.prototype.onCreateDom=function(view,outer,inner,context,isNew){if(context==null)return;
1929var folder=context.data instanceof zf_Folder&&!this.params.fthumb;$(outer).toggleClass('folder',folder);};zfl_DecorationPlugin.prototype.onResizeDom=function(view,outer,inner,context){if(context==null)return;
1930var markup=this.getInnerContent("",context,{},true);$(inner).find('.pv-shadow:gt(0)').remove();$(inner).find('.pv-shadow').replaceWith(markup);};;function zfl_WaitAnimationPlugin(inner){this._inner=inner;
1931}zfl_WaitAnimationPlugin.prototype.getInnerContent=function(id,context){if(context==null)return '';if(context.burnable)return '';if(!this._inner)return '';return '<img class="pv-wait" src="/zf/img/image-wait.gif" />';
1932};zfl_WaitAnimationPlugin.prototype.getOuterContent=function(id,context){if(context==null)return '';if(context.burnable)return '';if(this._inner)return '';return '<img class="pv-wait" src="/zf/img/image-wait.gif" />';
1933};;function zfl_ZoomPlugin(settings,events){this._settings=settings||{};this._events=events||{};if(typeof this._settings['id']!=='string'){this._settings['id']='__SelectionPlugin_Preview';
1934}}zfl_ZoomPlugin.inherits(zf_Object);zfl_ZoomPlugin.prototype.getSetting=function(settingId){return this._settings[settingId];};zfl_ZoomPlugin.prototype.setSetting=function(settingId,value){this._settings[settingId]=value;
1935};zfl_ZoomPlugin.prototype.getOuterContent=function(id,context){return '';};zfl_ZoomPlugin.prototype.getInnerContent=function(id,context){var html='<div class="pc-pv-zoom pc-bgcolor10" style="display:none;"><div></div></div>';
1936if(this._settings['hover']){html='';}return html;};zfl_ZoomPlugin.prototype.onCreateDom=function(view,outer,inner,context,isNew){;var photo=context.data,self=this,hoverTimeout;
1937$(inner).unbind('.pc').bind('mouseenter.pc',function(e){if(self._settings['hover']){hoverTimeout=setTimeout(function(){self._zoom_onclick(e.currentTarget,context);
1938},100);}else{$('.pc-pv-zoom',this).stop(true,true).fadeIn('fast');}}).bind('mouseleave.pc',function(){if(self._settings['hover']){clearTimeout(hoverTimeout);}else{$('.pc-pv-zoom',
1939this).stop(true,true).fadeOut('fast');}}).find('.pc-pv-zoom').click(function(){return self._zoom_onclick(this,context);}).mousedown(function(e){e.stopPropagation();
1940});view=null;outer=null;inner=null;};zfl_ZoomPlugin.prototype._zoom_onclick=function(element,context){var photo=context.data,method=this._settings['hover']?zf_ProcessingMethod.StandardVeryLargeThumbn
1940ail:zf_ProcessingMethod.StandardSmallSize,
1941size=photo.getScaledSize(method),self=this;if(photo.video){method=$.extend({},zf_ProcessingMethod.VideoPosterFrame,{cx:method.cx,cy:method.cy});}var href=photo.getInternalUrl(method,
1942{block:true});var id=this._settings['id'];var $img;if(this._settings['hover']){$img=$(element).find('.pv-img');}else{$img=$(element).closest('.pv-inner').find('.pv-img');
1943}var tsize=photo.getScaledSize(context.method),offset=$img.offset(),border=this._settings['hover']?0:15,top=offset.top-border,left=offset.left-border;var video='';
1944if(photo.video&&(this._duration||this._icon)){video=['<div class="pv-v">','<div class="pv-v-b"></div>'];if(this._icon)video.push('<div class="pv-v-i"></div>');if(this._duration)video.push('<div class="pv-v-d">',
1945zf_stdFormatDuration(photo.duration,true),'</div>');video.push('</div>');video=video.join('');}var markup=['<div id="',id,'" class="pvsp" ','style="width:',tsize.cx,
1946'px;height:',tsize.cy,'px;top:',top,'px;left:',left,'px">'];if(!this._settings['hover']){var extra=[];if(this._settings['showFileName']===true){extra.push('<div class="pvsp-extra-text">',
1947photo.fileName,'</div>');}markup.unshift('<div id="'+id+'-curtain" class="pvsp-curtain"></div>');markup.push('<div class="pvsp-bg simple"></div>','<div class="pvsp-img" style="background-image:url(',
1948href,');">',video,extra.join(''),'</div>','<div class="pvsp-close"></div>');}else{markup.push('<div class="pc-p',this._settings.usePhotoKey?zf_PhotoKey.getString(context.data):zf_toUint32(context.data.id),
1949' pvsp-img border" style="background-image:url(',href,');">');if(typeof this._settings['hoverText']==='string'&&this._settings['hoverText'].trim().length>0){markup.push('<div class="pvsp-hover-text">',
1950this._settings['hoverText'].trim(),'</div>');}markup.push(video,'</div>');}markup.push('</div>');var sidp='#'+id;var sidc=sidp+'-curtain';var sids=[sidp,sidc].join(',');
1951$(sids).remove();$(document.body).append(markup.join(''));top=parseInt(offset.top+tsize.cy/2-size.cy/2-border-size.cy/8);left=parseInt(offset.left+tsize.cx/2-size.cx/2-border);
1952var $window=$(window),scrollTop=$window.scrollTop(),scrollLeft=$window.scrollLeft(),windowWidth=$window.width(),windowHeight=$window.height();if(top<scrollTop+22){top=scrollTop+22;
1953}else if(top+size.cy+70>windowHeight+scrollTop){top=windowHeight+scrollTop-size.cy-70;}if(left<scrollLeft+22){left=scrollLeft+22;}else if(left+size.cx+30>windowWidth+scrollLeft){left=windowWidth+scrollLeft-size.cx-(border*2);
1954}$(sidp).animate({width:size.cx,height:size.cy,top:top,left:left},100);$(sidp).find('.pvsp-close').click(function(){$(sids).remove();return false;});$(sidp).find('.pvsp-img').mouseout(function(){if(self._settings['hover']){$(sids).hide();
1955}}).mouseup(function(){if(!self._settings['hover']){$(sids).remove();}});$(sidp).find('.pvsp-bg').click(function(){$(sids).remove();return false;});$(sidc).one('click',
1956function(e){if(!self._settings['hover']){$(sids).remove();}return false;});if(this._settings['hover']&&typeof this._events['initdrag']==='function'){this._events.initdrag(id,
1957this.closure(this._cleanUp));}return false;};zfl_ZoomPlugin.prototype._cleanUp=function(){$('#'+this._settings['id']+',#'+this._settings['id']+'-curtain').hide();};;function zf_Sociable(){zf_Object.prototype.constructor.call(this);
1958}zf_Sociable.inherits(zf_Object);zf_Sociable.prototype.shareOnFacebook=function(shareable){;var fbUrl=['https://www.facebook.com/sharer.php?u=',encodeURIComponent(shareable.url)];if(shareable.title)fbUrl.push('&t=',
1959encodeURIComponent(shareable.title));var name=Math.floor(Math.random()*1000);window.open(fbUrl.join(''),name.toString(),'toolbar=0,status=0,width=626,height=436');
1960return false;};zf_Sociable.prototype.shareOnTwitter=function(shareable){;var title=shareable.title?shareable.title:'';var url=['/zf/partners/twitter/tweet.aspx?u=',encodeURIComponent(shareable.url)];
1961url.push('&t=',encodeURIComponent(title));var name=Math.floor(Math.random()*1000);window.open(url.join(''),name.toString(),'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=360,width=600');
1962return false;};zf_Sociable.prototype.shareOnPinterest=function(shareable){if(shareable.cover){shareable=shareable.cover;};;;
1962var title=shareable.title?shareable.title:'';var url=['https://pinterest.com/pin/create/bookmarklet/',
1963'?media=',encodeURIComponent(shareable.largestImage),'&url=',encodeURIComponent(shareable.url),'&title=',encodeURIComponent(title),'&is_video=',shareable.video?"true":"false",
1964'&description=',encodeURIComponent(title)];var name=Math.floor(Math.random()*1000);window.open(url.join(''),name.toString(),'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=700');
1965return false;};zf_Sociable.prototype.shareViaEmail=function(params){var p=params;var subject=p.isBrandingRemoved?"Invitation to view photographs":"Invitation to view photographs on Zenfolio";
1966var urlPhoto=p.photo!=null?this.sharePhoto(p.photo).url:null;var urlGallery=this.shareGroupItem(p.groupItem).url;var urlSlideshow=this.shareSlideshow(p.groupItem).url;
1967var displayName=p.displayName;var isCollection=p.groupItem instanceof zf_PhotoSet&&p.groupItem.type==zf_PhotoSet.Collection;var body;if(p.isSlideshowVisible){if(p.photo==null){body=zf_stdFormatString(isCollection?"Collection:\r\n{0}  \r\n\r\nSlideshow:\r\n{1}":"Hi there,\r\nI saw these great photos by {2} and wanted to share them with you.\r\n\r\nCheck out this link to the full gallery:\r\n{0}\r\n\r\nOr watch the gallery slideshow:\r\n{1}\r\n\r\nFeel free to share with friends and family.\r\n\r\nEnjoy!",
1968urlGallery,urlSlideshow,displayName);}else{if(p.photo.video){body=zf_stdFormatString(isCollection?"Collection:\r\n{0}  \r\n\r\nSlideshow:\r\n{1}  \r\n\r\nVideo:\r\n{2}":"Gallery:\r\n{0}  \r\n\r\nSlideshow:\r\n{1}  \r\n\r\nVideo:\r\n{2}",
1969urlGallery,urlSlideshow,urlPhoto);}else{body=zf_stdFormatString(isCollection?"Collection:\r\n{0}  \r\n\r\nSlideshow:\r\n{1}  \r\n\r\nPhoto:\r\n{2}":"Hi there,\r\nI saw this great photo by {3} and wanted to share it with you.\r\n\r\nCheck out this link to photo:\r\n{2}\r\n\r\nAlso, here is the full gallery:\r\n{0}\r\n\r\nOr watch the gallery slideshow:\r\n{1}\r\n\r\nFeel free to share with friends and family.\r\n\r\nEnjoy!",
1970urlGallery,urlSlideshow,urlPhoto,displayName);}}}else{if(p.photo==null){body=zf_stdFormatString(isCollection?"Collection:\r\n{0}":"Gallery:\r\n{0}",urlGallery);}else{if(p.photo.video){body=zf_stdFormatString(isCollection?"Collection:\r\n{0}  \r\n\r\nVideo:\r\n{1}":"Gallery:\r\n{0}  \r\n\r\nVideo:\r\n{1}",
1971urlGallery,urlSlideshow,urlPhoto);}else{body=zf_stdFormatString(isCollection?"Collection:\r\n{0}  \r\n\r\nPhoto:\r\n{1}":"Gallery:\r\n{0}  \r\n\r\nPhoto:\r\n{1}",
1972urlGallery,urlPhoto);}}}var footer="";if(!p.isBrandingRemoved){var footerFormat;if(p.refCode&&p.refCode!=""&&p.refAmount&&p.refAmount!=""){footerFormat="\r\n\r\n-----------------------------------------------\r\Open a Zenfolio account with my referral code {0} and save {1}";
1973footer=zf_stdFormatString(footerFormat,p.refCode,p.refAmount);}else{footerFormat="\r\n\r\n-----------------------------------------------\r\nGet a Free Trial account on Zenfolio in less than 60 seconds\r\n{0}";
1974var urlZenfolio=zf_stdGetProtocol(zf_defaultHost)+zf_defaultHost;footer=zf_stdFormatString(footerFormat,urlZenfolio);}}var mailto="mailto:?subject="+encodeURI(subject)+"&body="+encodeURI(body+footer);
1975document.location.href=mailto;};zf_Sociable.prototype.bind=function(node,sharefunction,shareable){var args=[];for(var i=2;i<arguments.length;i++)args.push(arguments[i]);var self=this;
1976$(node).unbind('click.sociable').bind('click.sociable',function(e){e.preventDefault();e.stopPropagation();sharefunction.apply(self,args);});};zf_Sociable.prototype.sharePhoto=function(photo,
1977processingMethod,skipUrl){if(typeof(processingMethod)=="undefined")processingMethod=zf_ProcessingMethod.StandardThumbnail;var owner=null;if(photo.photoSet!=null)owner=photo.photoSet.owner;
1978else if(photo.gallery!=null)owner=photo.owner||photo.gallery.owner;var hostname=(!owner||!owner.domainName||owner.domainName=="")?document.location.hostname:owner.domainName;
1979var url=skipUrl?'':photo.getHref('external');var protocol=zf_stdGetProtocol(hostname);var icon=[protocol,hostname,photo.getExternalUrl(zf_ProcessingMethod.StandardThumbnail)].join('');
1980var processedImage=[protocol,hostname,photo.getExternalUrl(processingMethod)].join('');var largestImage=[protocol,hostname,photo.getExternalUrl(zf_PhotoImage.prototype.pickMethod.call(photo,
1981100000,100000,true,photo.access?photo.access.mask:0))].join('');var share={url:url,title:photo.title,photoId:photo.id,summary:'',icon:icon,video:photo.video,processedImage:processedImage,
1982largestImage:largestImage};return share;};zf_Sociable.prototype.shareRestrictedPhoto=function(photo,restrictGalleryAccess){var largestPhotoMethod=photo.pickMethod(99999,99999,
1983true,true);var largestMethod=photo.video?photo.pickVideoMethod():largestPhotoMethod;var largestImgUrl=photo.getInternalUrl(largestMethod);return{url:zf_stdMakeAbsoluteUrl(restrictGalleryAccess?largestImgUrl:photo.getHref()),
1984title:photo.title,video:photo.video,largestImage:zf_stdMakeAbsoluteUrl(photo.getExternalUrl(largestPhotoMethod))};};zf_Sociable.prototype.sharePhotoSet=function(photoSet){var share={url:photoSet.getHref('external'),
1985title:photoSet.title?photoSet.title:'',summary:'',icon:''};return share;};zf_Sociable.prototype.shareSlideshow=function(photoSet){var share={url:[photoSet.getHref('external'),
1986'/slideshow'].join(''),title:photoSet.title?photoSet.title:'',summary:'',icon:''};return share;};zf_Sociable.prototype.sharePhotoSlideshow=function(photo,text){var url=[photo.gallery.getHref('external'),
1987'/e',photo.getUnsignedId().toString(16),'/slideshow'].join('');var share={url:url,title:photo.title?photo.title:'',summary:'',icon:''};return share;};zf_Sociable.prototype.shareFolder=function(folder){var share={url:folder.getHref('external'),
1988title:folder.title?folder.title:'',summary:'',icon:''};return share;};zf_Sociable.prototype.shareGroupItem=function(groupItem){var share={url:groupItem.getHref('external'),
1989title:groupItem.title?groupItem.title:'',summary:'',icon:''};if(groupItem.image&&groupItem.image.id){share.cover=this.sharePhoto(groupItem.image,undefined,true);
1990share.cover.url=share.url;share.cover.title=share.title;}return share;};zf_Sociable.prototype.shareAppSecret=function(item){;;;var secret=0x7fffffff&((3*item.owner.id)^item.id);
1991return secret;};zf_Sociable.prototype.shareAppUrl=function(item){var secret=this.shareAppSecret(item);return item.getHref('external')+"/"+secret+"/appstart.html";};;function zfl_NewGridPlugin(style,
1992info,params){this._style=style;this._info=info;this._params=params||{};var textLayout=this._params.textLayout,gridType=this._params.gridType;this._overlay=textLayout==zfl_NewGridPlugin.Overlay||textLayout==zfl_NewGridPlugin.OverlayHover;
1993this._outside=textLayout==zfl_NewGridPlugin.OutsideBelow;this._inside=!this._outside&&!this._overlay;this._dynamic=gridType!=zfl_NewGridPlugin.FixedGrid;}zfl_NewGridPlugin.ClassicGrid=34;
1994zfl_NewGridPlugin.FixedGrid=35;zfl_NewGridPlugin.DynamicVerticalGrid=46;zfl_NewGridPlugin.DynamicHorizontalGrid=47;zfl_NewGridPlugin.InsideBelow='b';zfl_NewGridPlugin.InsideAbove='a';zfl_NewGridPlugin.OutsideBelow='o';zfl_NewGridPlugin.Overlay='y';zfl_NewGridPlugin.OverlayHover='h';zfl_NewGridPlugin.None=0;zfl_NewGridPlugin.Show=1;
1995zfl_NewGridPlugin.ShowOnHover=7;zfl_NewGridPlugin._MinimumPadding=8;zfl_NewGridPlugin.selectDynamicMethodForObject=function(object,params){if(object.image){object.image.gridType=params.gridType;}var image=object.image;
1996if(image==null){return $.extend({},zf_ProcessingMethod.StandardThumbnail,{cx:params.width,cy:params.height,clip:true});}var width=params.width,height=params.height;
1997if(params.gridType==zfl_NewGridPlugin.DynamicVerticalGrid)height=Math.round(width*image.height/image.width);else if(params.gridType==zfl_NewGridPlugin.DynamicHorizontalGrid){height=Math.ceil(params.height*1.15);
1998width=Math.round(height*image.width/image.height);}return zfl_NewGridPlugin._selectDynamicMethod(image,width,height);};zfl_NewGridPlugin.selectDynamicMethodForGridItem=function(item,
1999width,height){;var image=item.photo,method;if(!image||image.isPlaceholder||image.placeholderId==0){method=$.extend({},zf_ProcessingMethod.StandardThumbnail,{cx:width,
2000cy:height,clip:true});}else method=zfl_NewGridPlugin._selectDynamicMethod(image,width,height);return(item.context.method=method);};zfl_NewGridPlugin.updateIcons=function(grid){grid.$().find('.pv').trigger('updateIcons.NewGridPlugin');
2001};zfl_NewGridPlugin._selectDynamicMethod=function(image,width,height){;;;var options=[{method:zf_ProcessingMethod.StandardThumbnail,mask:0}
2001,{method:zf_ProcessingMethod.StandardLargeThumbnail,
2002mask:0},{method:zf_ProcessingMethod.StandardVeryLargeThumbnail,mask:0},{method:zf_ProcessingMethod.StandardSmallSize,mask:0},{method:zf_ProcessingMethod.StandardMediumSize,
2003mask:zf_AccessMask.ProtectMedium},{method:zf_ProcessingMethod.StandardLargeSize,mask:zf_AccessMask.ProtectLarge},{method:zf_ProcessingMethod.StandardExtraLargeSize,
2004mask:zf_AccessMask.ProtectExtraLarge},{method:zf_ProcessingMethod.StandardXXLargeSize,mask:zf_AccessMask.ProtectXXLarge}];var method=options[0].method,scaled=image.getScaledSize(method);
2005for(var i=1;i<options.length;i++){var option=options[i];if((option.mask&image.access.mask)!=0)continue;method=option.method;scaled=image.getScaledSize(method);if(scaled.cx>=width&&scaled.cy>=height)break;
2006}return $.extend({},method,{cx:width,cy:height,clip:true,stretch:true});};zfl_NewGridPlugin.prototype.getOuterContent=function(id,context){if(context==null)return '';var elements=[],
2007params=this._params,shadow=this._createShadow(context,params);if(params.outerBorder>0||params.padding>0||this._inside&&params.dataHeight>0)elements.push('<div class="pv-border"></div>');
2008shadow&&elements.push(shadow);if(!this._overlay){elements.push('<div class="pv-ng-data">','<div class="pv-ng-data-i pv-label pv-ng-label pv-ng-ta',params.textAlignment,
2009'">');this._addTextBlockElements(elements,params,context.data);elements.push('</div>','</div>');}return elements.join('');};zfl_NewGridPlugin.prototype.getInnerContent=function(id,
2010context){if(context==null)return '';var elements=[];if(this._overlay){var params=this._params;elements.push('<div class="pv-ng-overlay">','<div class="pv-ng-overlay-i pv-label pv-ng-label pv-ng-ta',
2011params.textAlignment,'">');this._addTextBlockElements(elements,params,context.data);elements.push('</div>','</div>');}if(this._params.addToYP)elements.push('<div class="pv-ng-yp"></div>');
2012if(this._params.addToFav)elements.push('<div class="pv-ng-fav"></div>');return elements.join('');};zfl_NewGridPlugin.prototype.onCreateDom=function(view,outer,inner,context,isNew){if(context==null)return;
2013var data=context.data,sociable=new zf_Sociable(),label=$('.pv-ng-label:first',outer),shareable=null,hidePinterest=false;if(!data.isPlaceholder){if(data instanceof zf_Photo){shareable=sociable.sharePhoto(data);
2014if(!shareable.url){shareable=sociable.shareRestrictedPhoto(data,true);}}else{shareable=sociable.shareGroupItem(data);hidePinterest=!shareable.cover;}}if(!isNew){var elements=[];
2015this._addTextBlockElements(elements,this._params,data);label.html(elements.join(''));}this.onResizeDom(view,outer,inner,context,isNew);label.find('.pv-ng-buy:first').toggle(data.priceKey!=""&&data.priceKey!=null).click(function(e){e.preventDefault();
2016e.stopPropagation();if(Zenfolio.Global.QuickShopManager.isEnabled(data)&&context.quickShopParameters&&context.quickShopParameters["qs_mode"]!=Zenfolio.Global.QuickShopMode.ShopOnly.toString()){$(outer).trigger(jQuery.Event("click",
2017{forceSidebar:true}));}else{var returnData=context.getReturnData&&context.getReturnData();if(returnData){returnData.photoKey=zf_PhotoKey.getString(data);}var options={allPhotos:{loadAll:function(c){c();
2018},getAll:function(){var allPhotos=[];var gridItems=context.grid.getItems();for(var i=0;i<gridItems.length;++i){var item=gridItems[i];if(item&&item.photo){allPhotos.push(item.photo);
2019}}return allPhotos;}},returnData:returnData};zf_zenbar.addToCart(options)([data]);}}).hover(function(){$(this).children('DIV').removeClass('button-color1 button-bgcolor1 button-border1').addClass('button-color2 button-bgcolor2 button-border2');
2020},function(){$(this).children('DIV').removeClass('button-color2 button-bgcolor2 button-border2').addClass('button-color1 button-bgcolor1 button-border1');});if(shareable){sociable.bind(label.find(".pv-ng-facebook"),
2021sociable.shareOnFacebook,shareable);sociable.bind(label.find(".pv-ng-twitter"),sociable.shareOnTwitter,shareable);sociable.bind(label.find(".pv-ng-pinterest"),sociable.shareOnPinterest,
2022shareable);}if(hidePinterest){label.find(".pv-ng-pinterest").hide();}zf_stdDisableRightClick($(inner).find('.pv-img:first'));var self=this;if(this._params.addToFav){this._setFavoritesIcon($(inner).find('.pv-ng-fav:first'),
2023data);$(view).bind('updateIcons.NewGridPlugin',function(e){self._setFavoritesIcon($(this).find('.pv-ng-fav:first'),data);});}if(this._params.addToYP){this._setYearbookPoseIcon($(inner).find('.pv-ng-yp:first'),
2024data);$(view).bind('updateIcons.NewGridPlugin',function(e){self._setYearbookPoseIcon($(this).find('.pv-ng-yp:first'),data);});}};zfl_NewGridPlugin.prototype.onResizeDom=function(view,
2025outer,inner,context,isNew){if(context==null)return;var params=this._params;if(!isNew){$('.pv-shadow',outer).remove();shadow=this._createShadow(context,params);shadow&&$(outer).append(shadow);
2026}if(this._dynamic){var method=context.method,innerBorder=2*params.innerBorder,outerBorder=2*(params.outerBorder+params.shadowPadding),padding=2*params.padding,innerWidth=method.cx+innerBorder,
2027innerHeight=method.cy+innerBorder,outerWidth=innerWidth+padding,outerHeight=innerHeight+padding,fullHeight=outerHeight;if(!this._overlay){fullHeight+=params.dataHeight;
2028if(!this._outside)outerHeight+=params.dataHeight;}if(this._outside)$('.pv-ng-data:first',outer).css('top',outerHeight+8+'px').width(outerWidth);else if(!this._overlay)$('.pv-ng-data:first',
2029outer).width(outerWidth-2*params.textPadding);$(view).width(outerWidth).height(fullHeight);
2029$(outer).width(outerWidth-padding).height(outerHeight-padding);$(inner).width(method.cx).height(method.cy);
2030$('.pv-border:first',outer).width(outerWidth-outerBorder).height(outerHeight-outerBorder);}var data=context.data,printable=data.priceKey!=null&&data.priceKey!="",
2031buyButton=params.buyButton!=zfl_NewGridPlugin.None&&printable,video=this._overlay&&data.video&&(params.vicon||params.vduration),social=(params.facebookIcon?1:0)+(params.twitterIcon?1:0)+(params.pinterestIcon?1:0);
2032if(context.__ng_social==null){context.__ng_social=social>0?(social*16+(social-1)*4):0;context.__ng_buy=buyButton?$('.pv-ng-buy:first',outer).width():0;context.__ng_video=video?$('.pv-ng-v:first',
2033outer).width():0;}var avail=this._overlay?context.method.cx-16:$('.pv-ng-data:first',outer).width();if(buyButton)avail-=context.__ng_buy+8;if(social){if(avail<context.__ng_social){social=0;
2034video=false;}avail-=context.__ng_social+8;}if(video&&(avail<context.__ng_video))video=false;$('.pv-ng-social',outer).toggle(social>0);$('.pv-ng-v:first',outer).toggle(video);
2035if(this._overlay){var anyPersistent=params.title&&data.title!=null&&data.title.length>0||params.buyButton==zfl_NewGridPlugin.Show&&printable||video,hover=!anyPersistent||params.textLayout==zfl_NewGridPlugin.OverlayHover,
2036anyItems=anyPersistent||buyButton||social>0;$('.pv-ng-overlay:first',inner).toggle(anyItems).toggleClass('pv-ng-ovh',hover).toggleClass('pv-ng-ovn',!hover);}var tags=[];
2037if(social&&params.buyButton!=zfl_NewGridPlugin.Show&&!video)tags.push('pv-ng-df-h');if(buyButton)tags.push('pv-ng-df-b');if(buyButton&&!social&&!video)tags.push('pv-ng-df-bo');
2038if(params.buyButton==zfl_NewGridPlugin.ShowOnHover&&!social&&!video)tags.push('pv-ng-df-h');if(buyButton&&video&&!social)tags.push('pv-ng-df-bl');if(buyButton&&video&&social)tags.push('pv-ng-df-bc');
2039$('.pv-ng-df:first',outer).removeClass('pv-ng-df-h pv-ng-df-b pv-ng-df-bo pv-ng-df-bl pv-ng-df-bc').addClass(tags.join(' '));};zfl_NewGridPlugin.prototype.onDestroyDom=function(view,
2040outer,inner,context){$(view).unbind('updateIcons.NewGridPlugin').find('.pv-ng-buy').unbind();};zfl_NewGridPlugin.prototype._createShadow=function(context,params){var info=this._info;
2041if(!info||!info.shadowName||info.shadowSize==0||!params.useDecorations)return null;var extent=info.shadowSize-params.shadowPadding,cx=context.method.cx+params.extraWidth-params.margins,
2042cy=context.method.cy+params.extraHeight-params.margins;if(params.textLayout==zfl_NewGridPlugin.OutsideBelow)cy-=params.dataHeight;var left=-extent,top=-extent,width=cx+extent*2,
2043height=cy+extent*2;return zfl_DecorationInfo.getShadowHtml("pv-shadow",info.shadowName,info.shadowType,info.shadowSize,left,top,width,height);};zfl_NewGridPlugin.prototype._addTextBlockElements=function(elements,
2044params,data){if(params.title&&data.title!=null&&data.title.length>0){elements.push('<h4 class="title">',zf_stdHtmlEncode(data.title),'</h4>');}var pad1=[],pad2=[];
2045if(data instanceof zf_Folder){if(params.count){if(data.galleries>0)pad1.push(['Galleries {0}',data.galleries]);if(data.collections>0)pad1.push(['Collections {0}',
2046data.collections]);}if(params.modified&&(data.access.mask&zf_AccessMask.ProtectDateModified)==0)pad2.push(['Modified {0}',zf_stdFormatDate(data.modified)]);if(params.count)pad2.push(this._getCountPair(data));
2047}else if(data instanceof zf_PhotoSet){if(params.visitors&&(data.access.mask&zf_AccessMask.ProtectVisits)==0)pad1.push(['Visitors {0}',data.views]);if(params.count)pad1.push(this._getCountPair(data));
2048if(params.created&&(data.access.mask&zf_AccessMask.ProtectDateCreated)==0)pad2.push(['Created {0}',zf_stdFormatDate(data.created)]);if(params.modified&&(data.access.mask&zf_AccessMask.ProtectDateModified)==0)pad2.push(['Modified {0}',
2049zf_stdFormatDate(data.modified)]);}if(pad1.length==0){var tmp=pad2;pad2=pad1;pad1=tmp;}if(params.textLayout==zfl_NewGridPlugin.OverlayHover)pad2=pad1;var i;if(pad1.length||pad2.length){elements.push('<div class="pads pv-ng-ta',
2050params.textAlignment,'">');if(pad1.length>0){elements.push(pad2.length==0?'<div class="pad-0">':'<div class="pad-1">');for(i=0;i<pad1.length;i++){elements.push('<div class="pair pair-color1">',
2051zf_stdFormatString(pad1[i][0],['<strong class="pair-0">',pad1[i][1],'</strong>'].join("")),'</div>');}elements.push('</div>');}if(pad2.length>0){elements.push('<div class="pad-2">');
2052for(i=0;i<pad2.length;i++){elements.push('<div class="pair pair-color1">',zf_stdFormatString(pad2[i][0],['<strong class="pair-0">',pad2[i][1],'</strong>'].join("")),
2053'</div>');}elements.push('</div>');}elements.push('</div>');}var socialIcons=params.facebookIcon||params.twitterIcon||params.pinterestIcon,printable=data.priceKey!=null&&data.priceKey!="",
2054buyButton=params.buyButton!=zfl_NewGridPlugin.None&&printable,video=this._overlay&&data.video&&(params.vicon||params.vduration);if(socialIcons||buyButton||video){elements.push('<div class="pv-ng-df">');
2055if(video){elements.push('<div class="pv-ng-v">');if(params.vicon)elements.push('<div class="pv-ng-vi"></div>');if(params.vduration){elements.push('<div class="pv-ng-vd">',
2056zf_stdFormatDuration(data.duration,true),'</div>');}elements.push('</div>');}if(socialIcons){if(params.facebookIcon)elements.push('<span class="pv-ng-social pv-ng-facebook"></span>');
2057if(params.twitterIcon)elements.push('<span href="#" class="pv-ng-social pv-ng-twitter"></span>');if(params.pinterestIcon)elements.push('<span href="#" class="pv-ng-social pv-ng-pinterest"></span>');
2058}if(params.buyButton!=zfl_NewGridPlugin.None){var cls='pv-ng-buy '+(params.buyButton==zfl_NewGridPlugin.ShowOnHover?'pv-ng-buy-h':'pv-ng-buy-n');elements.push('<div class="button button-gridBuy ',
2059cls,'">','<div class="standard button-color1 button-bgcolor1 button-border1">','<div class="left"></div>','<div class="right"></div>','<div class="middle">','<div class="label button-font1">',
2060'Buy','<div class="icon"></div>','</div>','</div>','</div>','</div>','<div class="clear"></div>');}elements.push('</div>');}};zfl_NewGridPlugin.prototype._getCountPair=function(data){;
2061if(data.images&&data.videos){if(data instanceof zf_Folder){if(data.images>data.videos)return['{0}
2061 photos',data.images];else return['{0} videos',data.videos];}return['{0} items',
2062data.photos];}if(data.videos)return['{0} videos',data.videos];return['{0} photos',data.images];};zfl_NewGridPlugin.prototype._setFavoritesIcon=function(icon,photo){var sbc=this._params.scrapbookCallbacks;
2063if(!sbc)return;var self=this;if(sbc.canAdd(photo)){icon.removeClass('pv-ng-fav-yes').addClass('pv-ng-fav-no').attr('title','Click to add to Favorites').unbind('click').click(function(e){e.stopPropagation();
2064e.preventDefault();sbc.add(photo);self._setFavoritesIcon(icon,photo);});}else if(sbc.canRemove(photo)){icon.removeClass('pv-ng-fav-no').addClass('pv-ng-fav-yes').attr('title',
2065'Added to Favorites - click to remove').unbind('click').click(function(e){e.stopPropagation();e.preventDefault();sbc.remove(photo);self._setFavoritesIcon(icon,photo);
2066});}icon.toggleClass('pv-ng-fav-ac',this._params.ac&&photo.access.type!=zf_AccessType.Public);};zfl_NewGridPlugin.prototype._setYearbookPoseIcon=function(icon,photo){var ybc=this._params.yearbookCallbacks;
2067if(!ybc){return;}var self=this;if(ybc.canAdd(photo)){icon.removeClass('pv-ng-yp-yes').addClass('pv-ng-yp-no').attr('title','Click to select this photo as Yearbook Pose').unbind('click').click(function(e){e.stopPropagation();
2068e.preventDefault();ybc.add(photo);self._setYearbookPoseIcon(icon,photo);});}else if(ybc.canRemove(photo)){icon.removeClass('pv-ng-yp-no').addClass('pv-ng-yp-yes').attr('title',
2069'Click to remove this photo from Yearbook Pose').unbind('click').click(function(e){e.stopPropagation();e.preventDefault();ybc.remove(photo);self._setYearbookPoseIcon(icon,
2070photo);});}var sbc=this._params.scrapbookCallbacks;var isFavIconShown=sbc&&(sbc.canAdd(photo)||sbc.canRemove(photo));icon.toggleClass('pv-ng-yp-ac',this._params.ac&&photo.access.type!=zf_AccessType.Public);
2071icon.toggleClass('pv-ng-yp-no-fav',!isFavIconShown);};;function zfl_AddToFavoritesPlugin(params){this._params=params;}zfl_AddToFavoritesPlugin.updateIcons=function(grid){grid.$().find('.pv').trigger('updateIcons.AddToFavoritesPlugin');
2072};zfl_AddToFavoritesPlugin.prototype.getInnerContent=function(id,context){if(context==null)return '';var elements=[];if(this._params.addToFav)elements.push('<div class="pv-fav"></div>');
2073return elements.join('');};zfl_AddToFavoritesPlugin.prototype.onCreateDom=function(view,outer,inner,context,isNew){if(this._params.addToFav){this._setFavoritesIcon($(inner).find('.pv-fav:first'),
2074context.data);var self=this;$(view).bind('updateIcons.AddToFavoritesPlugin',function(e){self._setFavoritesIcon($(this).find('.pv-fav:first'),context.data);});}};
2075zfl_AddToFavoritesPlugin.prototype.onDestroyDom=function(view,outer,inner,context){$(view).unbind('updateIcons.AddToFavoritesPlugin');};zfl_AddToFavoritesPlugin.prototype._setFavoritesIcon=function(icon,photo){var sbc=this._params.scrapbookCallbacks;
2076if(!sbc)return;var self=this;if(sbc.canAdd(photo)){icon.removeClass('pv-fav-yes').addClass('pv-fav-no').attr('title','Click to add to Favorites').unbind('click').click(function(e){e.stopPropagation();
2077e.preventDefault();sbc.add(photo);self._setFavoritesIcon(icon,photo);});}else if(sbc.canRemove(photo)){icon.removeClass('pv-fav-no').addClass('pv-fav-yes').attr('title',
2078'Added to Favorites - click to remove').unbind('click').click(function(e){e.stopPropagation();e.preventDefault();sbc.remove(photo);self._setFavoritesIcon(icon,photo);
2079});}icon.toggleClass('pv-fav-ac',this._params.ac&&photo.access.type!=zf_AccessType.Public);};;function zfl_AddToYearbookPlugin(params){this._params=params;}zfl_AddToYearbookPlugin.updateIcons=function(grid){grid.$().find('.pv').trigger('updateIcons.AddToYearbookPlugin');
2080};zfl_AddToYearbookPlugin.prototype.getInnerContent=function(id,context){if(context==null)return '';var elements=[];if(this._params.addToYP)elements.push('<div class="pv-yp"></div>');return elements.join('');
2081};zfl_AddToYearbookPlugin.prototype.onCreateDom=function(view,outer,inner,context,isNew){if(this._params.addToYP){this._setYearbookIcon($(inner).find('.pv-yp:first'),context.data);var self=this;
2082$(view).bind('updateIcons.AddToYearbookPlugin',function(e){self._setYearbookIcon($(this).find('.pv-yp:first'),context.data);});}};zfl_AddToYearbookPlugin.prototype.onDestroyDom=function(view,
2083outer,inner,context){$(view).unbind('updateIcons.AddToYearbookPlugin');};zfl_AddToYearbookPlugin.prototype._setYearbookIcon=function(icon,photo){var ybc=this._params.yearbookCallbacks;
2084if(!ybc){return;}var self=this;if(ybc.canAdd(photo)){icon.removeClass('pv-yp-yes').addClass('pv-yp-no').attr('title','Click to select this photo as Yearbook Pose').unbind('click').click(function(e){e.stopPropagation();
2085e.preventDefault();ybc.add(photo);self._setYearbookIcon(icon,photo);});}else if(ybc.canRemove(photo)){icon.removeClass('pv-yp-no').addClass('pv-yp-yes').attr('title',
2086'Click to remove this photo from Yearbook Pose').unbind('click').click(function(e){e.stopPropagation();e.preventDefault();ybc.remove(photo);self._setYearbookIcon(icon,
2087photo);});}var sbc=this._params.scrapbookCallbacks;var isFavIconShown=sbc&&(sbc.canAdd(photo)||sbc.canRemove(photo));icon.toggleClass('pv-yp-ac',this._params.ac&&photo.access.type!=zf_AccessType.Public);
2088icon.toggleClass('pv-yp-no-fav',!isFavIconShown);};;;;;;function zfl_PhotoInfoPlugin(params){this.params=params!=null?params:{};}zfl_PhotoInfoPlugin.prototype.getOuterContent=function(id,context){return '';
2089};zfl_PhotoInfoPlugin.prototype.getInnerContent=function(id,context){if(context==null)return '';return context.data instanceof zf_Photo&&zf_userId==zf_ownerId?'<div class="pv-type info-icon"></div>':'';
2090};zfl_PhotoInfoPlugin.prototype.onCreateDom=function(view,outer,inner,context,isNew){var self=this;var $inner=$(inner);$inner.hover(function(){$(this).addClass('hover').find('.pv-type.info-icon').stop(true,
2091true).fadeIn('fast');},function(){$(this).removeClass('hover').find('.pv-type.info-icon:not(.active)').stop(true,true).fadeOut('fast');});$inner.find('.pv-type.info-icon').unbind().hover(function(e){$(this).addClass('hover');
2092},function(e){$(this).removeClass('hover');}).bind('mouseenter',{photo:context.image},function(e){self._info_icon_mouseenter(e);});};zfl_PhotoInfoPlugin.prototype._info_icon_mouseenter=function(e){var self=this;
2093var anchor=$(e.currentTarget);var photo=e.data.photo;if(photo==null||anchor.hasClass('active'))return;anchor.addClass('active');var offset=anchor.offset();var popup=this._createPopup(photo);
2094var top=offset.top+anchor.height();popup.css({top:top,left:offset.left});var checkClose=function(){if(anchor.hasClass('hover')||popup.hasClass('hover')){setTimeout(function(){checkClose();
2095},1000);return;}anchor.removeClass('active');popup.fadeOut('fast',function(){$(this).remove();});if(!anchor.closest('.pv-inner').hasClass('hover'))anchor.stop(true,
2096true).fadeOut('fast');};popup.fadeIn('fast');setTimeout(checkClose,500);};zfl_PhotoInfoPlugin.prototype._createPopup=function(photo){var html=['<div class="oie-info-popup popup popup-bgcolor1 popup-border1 popup-color1 co-font5">',
2097'<table>','<tr class="oie-info-popup-row">','<td class="oie-info-popup-label">Gallery:</td>','<td class="oie-info-popup-value co-color3">',zf_stdFormatString('<a target="_blank" href="{0}">{1} &#0187;</a>',
2098zf_stdGetTransferUrl(photo.getHref('external')),photo.gallery.title),'</td>','</tr>','</table>','</div>'].join('');var popup=$(html);$('.oie-info-popup').hide();
2099popup.appendTo('BODY');popup.hover(function(){$(this).addClass('hover');},function(){$(this).removeClass('hover');});return popup;};;function zf_CensoredPlugin(photoExtractor,
2100methodExtractor){this._photoExtractor=photoExtractor;this._methodExtractor=methodExtractor;}zf_CensoredPlugin.prototype.getInnerContent=function(id,context){if(!context)return '';
2101var photo=this._photoExtractor(context);if(!photo||!(photo instanceof zf_BasicImage||photo instanceof zf_Photo))return '';if(!photo.access.isCensored)return '';var method=this._methodExtractor(context);
2102if(method==zf_ProcessingMethod.StandardSmallThumbnail)return '';return '<div class="pv-censored">CENSORED</div>';};;function zf_NoClickPlugin(){}zf_NoClickPlugin.prototype.onCreateDom=function(view,
2103outer,inner,context,isNew){inner.onclick=zf_stdFalse;};;function zf_ClickPlugin(onclick){this.onclick=onclick;}zf_ClickPlugin.prototype.onCreateDom=function(view,outer,inner,context,isNew){var self=this;
2104$(outer).bind('click.ClickPlugin',function(e){if(self.onclick!=null)return self.onclick(context,e);return false;});view=null;outer=null;inner=null;};zf_ClickPlugin.prototype.onDestroyDom=function(view,
2105outer,inner,context){$(outer).unbind('.ClickPlugin');};;function zf_VideoInfoPlugin(extractor,icon,duration){;this._extractor=extractor;this._icon=icon==undefined?true:icon;
2106this._duration=duration==undefined?true:duration;}zf_VideoInfoPlugin.prototype.getInnerContent=function(id,context){if(!this._icon&&!this._duration)return '';var data=this._extractor(context);
2107if(data!=null&&data.flags&zf_PhotoFlags.Video){var markup=['<div class="pv-v">','<div class="pv-v-b"></div>'];if(this._icon)markup.push('<div class="pv-v-i"></div>');
2108if(this._duration)markup.push('<div class="pv-v-d">',zf_stdFormatDuration(data.duration,true),'</div>');markup.push('</div>');return markup.join('');}return '';};
2109zf_VideoInfoPlugin.prototype.onCreateDom=function(view,outer,inner,context,isNew){if(isNew)return;if(!this._icon&&!this._duration)return;var data=this._extractor(context);var $inner=$(inner);
2110if(data!=null&&data.flags&zf_PhotoFlags.Video){var $v=$inner.find(".pv-v");if($v.length==0)$v=$inner.append('<div class="pv-v"></div>').find(".pv-v");var markup=['<div class="pv-v-b"></div>'];
2111if(this._icon)markup.push('<div class="pv-v-i"></div>');if(this._duration)markup.push('<div class="pv-v-d">',zf_stdFormatDuration(data.duration,true),'</div>');$v.html(markup.join(''));
2112}else{$inner.find(".pv-v").remove();}};;function zf_VideoJobStateResponse(){this.state=zf_VideoJobStateResponse.VideoJobState.SCHEDULED;this.secExecuting=0;this.secScheduled=0;
2113this.secEstimated=0;}zf_VideoJobStateResponse.VideoJobState={SCHEDULED:0,STARTING:1,EXECUTING:2,FAILED:3,NOT_SCHEDULED:4,UNKNOWN:5};function zf_VideoWaitPlugin(extractor){;this._extractor=extractor;
2114}zf_VideoWaitPlugin.prototype.getInnerContent=function(id,context){;var photo=this._extractor(context);if(!zf_VideoWaitPlugin._needRender(photo))return '';return zf_VideoWaitPlugin._generateMarkup(photo);
2115};zf_VideoWaitPlugin.prototype.onCreateDom=function(view,outer,inner,context,isNew){;var photo=this._extractor(context);var needRender=zf_VideoWaitPlugin._needRender(photo);var $inner=$(inner);
2116if(!isNew){$inner.removeClass("pv-vws-starting pv-vws-hours pv-vws-countdown pv-vws-finishing");$inner.find(".pv-vwait").removeData("zf-video-wait-helper");$inner.find(".pv-vwait").remove();
2117$inner.find(".pv-vcountdown").remove();if(!needRender)return;var markup=zf_VideoWaitPlugin._generateMarkup(photo);var $icons=$inner.children(".pve-icons-i:first");
2118if($icons.length>0)$icons.before(markup);else $inner.append(markup);}if(needRender){var helper=new zf_VideoWaitHelper(inner,photo);var $w=$inner.find(".pv-vwait");
2119;$w.data("zf-video-wait-helper",helper);helper._refreshVideoJobState();}};zf_VideoWaitPlugin.prototype.onDestroyDom=function(view,outer,inner,context){var $inner=$(inner);$inner.removeClass("pv-vws-starting pv-vws-hours pv-vws-countdown pv-vws-finishing");
2120$inner.find(".pv-vwait").removeData("zf-video-wait-helper");$inner.find(".pv-vwait").remove();$inner.find(".pv-vcountdown").remove();};zf_VideoWaitPlugin._needRender=function(photo){;
2121if(!(photo.flags&zf_PhotoFlags.Video))return false;if(!!(photo.flags&zf_PhotoFlags.VideoReady)||!!(photo.flags&zf_PhotoFlags.VideoFailed))return false;return true;
2122};zf_VideoWaitPlugin._generateMarkup=function(photo){;return['<div class="pv-vwait">','<div class="pv-vw-pb" style="width:0%;"></div>','<div class="pv-v-i"></div>','<div class="pv-v-d">',
2123zf_stdFormatDuration(photo.duration,true),'</div>','</div>','<div class="pv-vcountdown">','<div class="pv-vcd-1"></div>','<div class="pv-vcd-2"></div>','</div>'].join('');
2124};function zf_VideoWaitHelper(inner,photo){;;this._photo=photo;this._id=photo.id;this._$inner=$(inner);this._$pv=this._$inner.closest(".pv");this._$pb=this._$inner.find(".pv-vwait .pv-vw-pb");
2125this._currentState=null;this._countdownInProgress=false;this._nextServerCallTimeout=null;this._secEstimate=0;this._secEstimateReceived=0;this._secTotal=0;}zf_VideoWaitHelper.inherits(zf_Object);
2126zf_VideoWaitHelper.COUNTDOWN_MIN_SEC=1*60;zf_VideoWaitHelper.COUNTDOWN_HI_LO_SEC=15*60;zf_VideoWaitHelper.COUNTDOWN_MAX_SEC=2*60*60;zf_VideoWaitHelper.TIMEOUT_STARTING=1*60*1000;zf_VideoWaitHelper.TIMEOUT_HOURS=15*60*1000;
2127zf_VideoWaitHelper.TIMEOUT_COUNTDOWN_LO=5*60*1000;zf_VideoWaitHelper.TIMEOUT_COUNTDOWN_HI=2*60*1000;zf_VideoWaitHelper.TIMEOUT_FINISHING=2*60*1000;zf_VideoWaitHelper.prototype._refreshVideoJobState=function(){;
2128if(!this._needToHandle(false))return;zf_stdServerRequestEx("POST","/zf/core/core.asmx","GetVideoJobState",[this._photo.id,this._photo.token],this.closure(this._onGetVideoJobStateResponse));
2129};zf_VideoWaitHelper.prototype._onGetVideoJobStateResponse=function(result,error){;if(error!=null){if(this._needToHandle(false)){this._$inner.removeClass("pv-vws-starting pv-vws-hours pv-vws-countdown pv-vws-finishing");
2130}return;};this._updateState(result);};zf_VideoWaitHelper.prototype._updateState=function(r){;;;;if(!this._needToHandle(false)){;return;};var $inner=this._$inner;var $w=$inner.find(".pv-vwait");
2131var $cd=$inner.find(".pv-vcountdown");;;;$inner.removeClass("pv-vws-starting pv-vws-hours pv-vws-countdown pv-vws-finishing");var VJS=zf_VideoJobStateResponse.VideoJobState;
2132this._currentState=r.state;if(r.state==VJS.SCHEDULED&&r.secEstimated<=zf_VideoWaitHelper.COUNTDOWN_MIN_SEC){;this._currentState=VJS.STARTING;}var timeout=-1;switch(this._currentState){case VJS.STARTING:;
2133$inner.addClass("pv-vws-starting");$cd.find(".pv-vcd-1").html("Ready in…");$cd.find(".pv-vcd-2").text("");timeout=zf_VideoWaitHelper.TIMEOUT_STARTING;this._countdownInProgress=false;
2134break;
2134case VJS.SCHEDULED:case VJS.EXECUTING:this._updateProgressBar(r.secScheduled,r.secScheduled+r.secEstimated);if(r.secEstimated>zf_VideoWaitHelper.COUNTDOWN_MAX_SEC){;
2135$inner.addClass("pv-vws-hours");$cd.find(".pv-vcd-1").html("Ready in…");$cd.find(".pv-vcd-2").text("a few hours");timeout=zf_VideoWaitHelper.TIMEOUT_HOURS;this._countdownInProgress=false;
2136}else if(r.secEstimated<=zf_VideoWaitHelper.COUNTDOWN_MIN_SEC){;$inner.addClass("pv-vws-finishing");$cd.find(".pv-vcd-1").text("Finishing up");$cd.find(".pv-vcd-2").text("");
2137timeout=zf_VideoWaitHelper.TIMEOUT_FINISHING;this._countdownInProgress=false;}else{;$inner.addClass("pv-vws-countdown");$cd.find(".pv-vcd-1").html("Ready in…");$cd.find(".pv-vcd-2").text(zf_VideoWaitHelper._formatTime(r.secEstimated));
2138if(r.secEstimated<zf_VideoWaitHelper.COUNTDOWN_HI_LO_SEC)timeout=zf_VideoWaitHelper.TIMEOUT_COUNTDOWN_HI;else timeout=zf_VideoWaitHelper.TIMEOUT_COUNTDOWN_LO;this._secTotal=r.secScheduled+r.secEstimated;
2139this._secEstimate=r.secEstimated;this._secEstimateReceived=Math.floor(new Date().getTime()/1000);var startCountdown=!this._countdownInProgress;this._countdownInProgress=true;
2140if(startCountdown)this._updateCountdown();};break;case VJS.FAILED:case VJS.NOT_SCHEDULED:case VJS.UNKNOWN:default:;this._countdownInProgress=false;break;}if(this._nextServerCallTimeout!=null){;
2141window.clearTimeout(this._nextServerCallTimeout);this._nextServerCallTimeout=null;}if(timeout>0)this._nextServerCallTimeout=window.setTimeout(this.closure(this._refreshVideoJobState),
2142timeout);;};zf_VideoWaitHelper.prototype._updateProgressBar=function(done,total){;;var percentage=100*(parseFloat(done)/total);this._$pb.width(percentage+"%");;};zf_VideoWaitHelper.prototype._updateCountdown=function(){if(!this._countdownInProgress){;
2143return;}if(!this._needToHandle(true)){;this._countdownInProgress=false;return;}var secNow=Math.floor(new Date().getTime()/1000);var secRemaining=this._secEstimate-(secNow-this._secEstimateReceived);
2144var secDone=this._secTotal-secRemaining;if(secRemaining<=zf_VideoWaitHelper.COUNTDOWN_MIN_SEC){;this._countdownInProgress=false;this._updateState({state:this._currentState,
2145secEstimated:secRemaining,secScheduled:secDone,_fromCountdown:true});;return;};this._$inner.find(".pv-vcd-2").text(zf_VideoWaitHelper._formatTime(secRemaining));
2146this._updateProgressBar(secDone,this._secTotal);window.setTimeout(this.closure(this._updateCountdown),1000);this._countdownInProgress=true;;};zf_VideoWaitHelper.prototype._needToHandle=function(requireCountdown){var $w=this._$inner.find(".pv-vwait");
2147if($w.length!=1)return false;var currentHelper=$w.data("zf-video-wait-helper");if(currentHelper==null||currentHelper!=this)return false;if(!this._$pv.hasClass("pv-s-vwait"))return false;
2148if(requireCountdown&&!this._$inner.hasClass("pv-vws-countdown"))return false;return true;};zf_VideoWaitHelper._formatTime=function(seconds){if(seconds==null)return "";var hh=Math.floor(seconds/60/60);
2149var mm=Math.floor(seconds/60)%60;var ss=Math.floor(seconds%60);if(hh<10)hh="0"+hh;if(mm<10)mm="0"+mm;if(ss<10)ss="0"+ss;return hh+":"+mm+":"+ss;};;function zf_VideoPlayerHelper(){if(zf_Flash.installed(10)&&zf_Flash.isSafeDomain()){this._mode=zf_VideoPlayerHelper.Flash;
2150}else{this._mode=zf_VideoPlayerHelper.Video;}}zf_VideoPlayerHelper._id=0;zf_VideoPlayerHelper.None=0;zf_VideoPlayerHelper.Flash=1;zf_VideoPlayerHelper.Video=2;zf_VideoPlayerHelper.Wmp=3;zf_VideoPlayerHelper.QuickTime=4;
2151zf_VideoPlayerHelper._storageKey="video.player";zf_VideoPlayerHelper_Proxy={};zf_VideoPlayerHelper.prototype.getMode=function(){return this._mode;};zf_VideoPlayerHelper.prototype.setMode=function(mode){this._mode=mode;};zf_VideoPlayerHelper.prototype.createPlayerHtml=function(photo,
2152url,parameters){;;if(typeof(parameters)!="object")parameters={};if(typeof(parameters.autostart)!="boolean")parameters.autostart=true;if(typeof(parameters.logoUrl)!="string")parameters.logoUrl="";
2153if(typeof(parameters.standalone)!="boolean")parameters.standalone=false;var posterUrl=photo.getInternalUrl(zf_ProcessingMethod.VideoPosterFrame);var id='video-player-'+zf_VideoPlayerHelper._id++;
2154var markup='';if(this._mode==zf_VideoPlayerHelper.Video){markup=['<video class="pv-p-o"','id="',id,'" ','src="',url,'" ',parameters.hideControls?'':'controls="true" ',
2155'preload="auto" ',(parameters.autostart?'autoplay="autoplay" ':' '),'poster="',posterUrl,'"',(parameters.controlsList?('controlsList="'+parameters.controlsList+'"'):''),
2156'>','</video>'].join('');}else if(this._mode==zf_VideoPlayerHelper.Flash){var host=zf_stdAllowCdnHost()?zf_cdnHost:zf_secureHost;var playerUrl=zf_stdGetProtocol(host)+host+'/zf/code/video/6.5.1/player.swf';
2157zf_VideoPlayerHelper_Proxy.onReady=function(){setTimeout(function(){$('#'+id).removeClass('pv-p-loading');},250);};zf_VideoPlayerHelper_Proxy.onStreamChange=function(streamId){;
2158zf_storage.setItem(zf_VideoPlayerHelper._storageKey+".stream",streamId);};zf_VideoPlayerHelper_Proxy.onStateChange=function(state){;};url=photo.getInternalUrl(zf_ProcessingMethod.VideoXml);
2159;var stream=zf_storage.getItem(zf_VideoPlayerHelper._storageKey+".stream")||"auto";var options={server:zf_defaultHost,video:url,poster_frame:posterUrl,auto_start:parameters.autostart?'1':'0',
2160auto_controls:parameters.hideControls?'0':'1',hide_play:'0',logo:parameters.logoUrl,
2160stream:stream,token:zf_stdGetCookie('zf_token'),keyring:zf_stdGetCookie('zf_keyring'),
2161visitor:zf_stdGetCookie('zf_5y_visitor'),js_proxy:'zf_VideoPlayerHelper_Proxy',manual_controls:parameters.standalone&&!parameters.forceHideControls?'0':'1'};markup=zf_Flash.createHtml(id,
2162'pv-p-o pv-p-loading flash-pause',playerUrl,options);}else if(this._mode==zf_VideoPlayerHelper.Wmp){markup=['<object ','id="',id,'" ','class="pv-p-o" ','style="width:100%;height:100%" ',
2163'classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ','standby="Loading..." ','type="application/x-oleobject">','<param name="fileName" value="',url,'" />','<param name="autoStart" value="',
2164(parameters.autostart?'true':'false'),'" />','<param name="stretchToFit" value="true" />','<param name="showControls" value="true" />','<param name="showStatusBar" value="false" />',
2165'<param name="showDisplay" value="false" />','<param name="windowlessVideo" value="true" />','<embed ','type="application/x-mplayer2" ','src="',url,'" ','class="pv-p-o" ',
2166'style="width:100%;height:100%" ','showControls="1" ','showStatusBar="0" ','showDisplay="0" ','autoStart="',(parameters.autostart?'1':'0'),'">','</embed>','</object>'].join('');
2167}else if(this._mode==zf_VideoPlayerHelper.QuickTime){markup=['<embed ','type="image/x-macpaint" ','pluginspage="http://www.apple.com/quicktime/download" ','src="',
2168url,'" ','class="pv-p-o" ','style="width:100%;height:100%" ','type="video/quicktime" ','scale="tofit" ','autoplay="',(parameters.autostart?'true':'false'),'">','</embed>'].join('');
2169}return markup;};zf_VideoPlayerHelper.prototype.mobileBrowsersFixup=function($player,isOnClickStack,callbacks,leaveOffscreen,needPlay){};zf_VideoPlayerHelper.prototype.requestVideoUrl=function(photo,callback){;
2170if(this._mode==zf_VideoPlayerHelper.Flash){callback(zf_stdMakeAbsoluteUrl(photo.getInternalUrl(zf_ProcessingMethod.VideoXml,{block:true})));}else{callback(photo.getInternalUrl(photo.pickVideoMethod(),
2171{block:true}));}};function zf_VideoPlayerPlugin(extractor){;this._extractor=extractor;this.autoPlay=false;this.hideControls=false;this.forceHideControls=false;this.standalone=false;
2172this.allowSimplePlayToggle=false;this._helper=new zf_VideoPlayerHelper();}zf_VideoPlayerPlugin.prototype.forceHtml5=function(){this._helper.setMode(zf_VideoPlayerHelper.Video);};zf_VideoPlayerPlugin.prototype.getInnerContent=function(id,
2173context){return '<div class="pv-p"></div>';};zf_VideoPlayerPlugin.prototype.onCreateDom=function(view,outer,inner,context,isNew){var photo=this._extractor(context);if(photo==null)return;
2174var $inner=$(inner);var $player=$inner.find('.pv-p');if(!photo.video){if(!isNew)$player.empty();return;}var posterUrl=photo.getInternalUrl(zf_ProcessingMethod.VideoPosterFrame);
2175var markup=['<div class="pv-p-ei"></div>','<div class="pv-p-et">This video could not be processed.</div>','<div class="pv-p-wi"></div>','<div class="pv-p-wt">Preparing video to show on your site...</div>',
2176'<div class="pv-p-nai"></div>','<div class="pv-p-nat">This video is not available.</div>','<div class="pv-p-fi">','<div class="pv-p-dub"></div>','<div class="pv-p-du">',
2177zf_stdFormatDuration(photo.duration),'</div>','</div>'].join('');$player.empty().append(markup);var self=this;if(photo.flags&zf_PhotoFlags.VideoReady){this._helper.requestVideoUrl(photo,
2178$.noop);$inner.one('click.VideoPlayerPlugin',function(){self._onclick(this,photo,true);});if(this.autoPlay){function play(){self._onclick($inner[0],photo,false);
2179}if(!zf_storage)$(play);else zf_stdDeferCall(null,play);}}};zf_VideoPlayerPlugin.prototype.onDestroyDom=function(view,outer,inner,context){var $inner=$(inner);$inner.unbind('.VideoPlayerPlugin');
2180$inner.closest(".pv-video").removeClass("pv-playing");};zf_VideoPlayerPlugin.prototype._onclick=function(inner,photo,isOnClickStack){;;;;var $inner=$(inner);;if($inner.closest(".pv-video").hasClass("pv-playing"))return;
2181var self=this;this._helper.requestVideoUrl(photo,function(url){var $player=$inner.find('.pv-p');$player.find('div:not(.pv-p-f)').remove();$player.append(self._helper.createPlayerHtml(photo,
2182url,{hideControls:self.hideControls,standalone:self.standalone,forceHideControls:self.forceHideControls,controlsList:'nodownload'}));$inner.closest(".pv-video").addClass("pv-playing");
2183if(self._helper.getMode()==zf_VideoPlayerHelper.Flash)self._setupFlashPlayer($inner,$player);var callbacks={onClick:function(el){$(el).closest(".pv-inner").append('<div class="pv-ios-vwait"><img src="/zf/img/image-wait.gif" /></div>');
2184}};callbacks.onProgress=callbacks.onEnded=callbacks.onError=function(el){$(el).closest(".pv-inner").find(".pv-ios-vwait").remove();};self._helper.mobileBrowsersFixup($player,
2185isOnClickStack,callbacks);if(self.allowSimplePlayToggle&&self._helper.getMode()==zf_VideoPlayerHelper.Video){$player.append(['<div class="pv-p-ppi pv-p-ppi-playing">',
2186'<span class="fa-stack">','<i class="fa fa-circle fa-stack-2x"></i>','<i class="fa fa-pause fa-stack-1x"></i>','<i class="fa fa-play fa-stack-1x"></i>','</span>',
2187'</div>'].join(''));$player.find(".pv-p-ppi").hide();$inner.unbind("click.VideoPlayerPlugin").bind("click.VideoPlayerPlugin",function(){self._togglePlay(inner);});
2188}});isOnClickStack=false;};zf_VideoPlayerPlugin.prototype._setupFlashPlayer=function($inner,$player){;setTimeout(function(){$player.find('embed').removeClass('pv-p-loading');},1500);
2189var showControls=function(){try{$player.find('.pv-p-o')[0].showControls();}catch(e){}};var hideControls=function(){try{$player.find('.pv-p-o')[0].hideControls();
2190}catch(e){}};if(!this.hideControls){$inner.bind('overlay:activity.VideoPlayerPlugin',showControls).bind('overlay:leave.VideoPlayerPlugin',hideControls).bind('overlay:idle.VideoPlayerPlugin',
2191hideControls).bind('overlay:info:enter.VideoPlayerPlugin',hideControls).bind('overlay:menu:enter.VideoPlayerPlugin',hideControls).bind('overlay:video:enter.VideoPlayerPlugin',
2192showControls);}else{hideControls();}};zf_VideoPlayerPlugin.prototype._togglePlay=function(inner){var video=$(inner).find("VIDEO").get(0);if(!video)return;var $icon=$(inner).find(".pv-p-ppi");
2193if(video.paused){video.play();$icon.removeClass("pv-p-ppi-paused").addClass("pv-p-ppi-playing");}else{video.pause();$icon.removeClass("pv-p-ppi-playing").addClass("pv-p-ppi-paused");
2194}$icon.stop(true,true).show().css("opacity",1).animate({opacity:0}
2194,500,function(){$icon.hide();});};;function zf_TouchPlugin(){this._overlayDisplayed=false;}zf_TouchPlugin.prototype.onCreateDom=function(view,
2195outer,inner,context,isNew){this._touchStart={x:0,y:0,time:null};this._touchMove={x:0,y:0};var self=this;setTimeout(function(){self.initialize(view,outer,inner,context,
2196isNew);},200);};zf_TouchPlugin.prototype.onResizeDom=function(view,outer,inner,context,isNew){$(inner).find('#'+this._touchId).width($(inner).width()).height($(inner).height()).find('#'+this._imageId).width($(inner).find('img:first').width()).height($(inner).find('img:first').height()).css('background-size',
2197$(inner).find('img:first').css('background-size'));};zf_TouchPlugin.prototype.initialize=function(view,outer,inner,context,isNew){var $img=$(inner).find('img:first');var self=this;
2198if($(inner).find('.pv-password').length>0)return;if($img.css('background-image')=='none'||!$img.attr('style')){setTimeout(function(){self.initialize(view,outer,inner,
2199context,isNew);},200);return;}if($img.length<1)return;this._dimLights=$img.attr('id').toLowerCase().indexOf('dim')!=-1||$img.parents('.dimlights').length>0;this._isVideo=$(view).hasClass('pv-video');
2200this._imageId=$img.attr('id')+'-temp';this._touchId=$(view).attr('id')+'-touch';$(inner).append($("<div></div>").attr("id",this._touchId).addClass("pv-img-temp").attr("style",
2201$(inner).attr("style")).append($("<img />").attr("id",this._imageId).attr("src",$img.attr("src")).addClass("pv-img").attr("style",$img.attr("style"))));var touchElem=$('#'+this._touchId);
2202touchElem.width($(inner).width());touchElem.height($(inner).height());touchElem.css({left:0,top:0});touchElem.find('img').width($img.width());touchElem.find('img').height($img.height());
2203setTimeout(function(){self._attach(view,inner,context);$img.css('opacity','0.10');},300);};zf_TouchPlugin.prototype._translateView=function($view,argX,argY,argZ){argX=argX?argX:0;
2204argY=argY?argY:0;argZ=argZ?argZ:0;$view[0].style.left=argX+'px';};zf_TouchPlugin.prototype._goNext=function(view,context){if(this._dimLights)$(view).parent().parent().parent().find('.dimlights-right:first').trigger('touchstart');
2205else context.oncommand('next');};zf_TouchPlugin.prototype._goBack=function(view,context){if(this._dimLights)$(view).parent().parent().parent().find('.dimlights-left:first').trigger('touchstart');
2206else context.oncommand('back');};zf_TouchPlugin.prototype._attach=function(view,inner,context){var self=this;var $inner=$(inner);var $touch=$inner.find('#'+this._touchId);var $tempImg=$inner.find('#'+this._imageId);
2207var swipeForward=-100;var swipeBack=100;if(this._isVideo){$inner.find('.pv-p-f,.pv-p-fi').css('z-index','100');}$(inner).one('click.VideoPlayerPlugin',function(e){if(!self._isVideo)return;
2208$inner.trigger('overlay:info:leave.PhotoOverlay');$inner.trigger('overlay:video:leave.PhotoOverlay');$inner.trigger('overlay:leave.PhotoOverlay');$touch.remove();
2209$inner.find('img').css('opacity','1.0');});$touch.bind('touchstart',function touchStart(e){if(e.originalEvent.touches.length>1)return;e.preventDefault();e.stopImmediatePropagation();
2210if(self._showOverlayTimeout)clearTimeout(self._showOverlayTimeout);self._showOverlayTimeout=null;self._showOverlayTimeout=setTimeout(function(){$inner.trigger('overlay:activity.PhotoOverlay');
2211self._overlayShown=true;},400);self._touchStart.x=e.originalEvent.targetTouches[0].screenX;self._touchStart.y=e.originalEvent.targetTouches[0].screenY;self._touchStart.time=new Date().getTime();
2212});$touch.bind('touchmove',function touchMove(e){if(e.originalEvent.touches.length>1)return;if(self._touchStart.time==null){self._touchStart.x=e.originalEvent.targetTouches[0].screenX;
2213self._touchStart.y=e.originalEvent.targetTouches[0].screenY;self._touchStart.time=new Date().getTime();}var moveX=e.originalEvent.targetTouches[0].screenX-self._touchStart.x;
2214var moveY=e.originalEvent.targetTouches[0].screenY-self._touchStart.y;if(Math.abs(moveX)>5){if(self._showOverlayTimeout)clearTimeout(self._showOverlayTimeout);self._showOverlayTimeout=null;
2215$inner.trigger('overlay:info:leave.PhotoOverlay').trigger('overlay:leave.PhotoOverlay');self._overlayShown=false;}if(Math.abs(self._touchMove.x)<20&&Math.abs(self._touchMove.y)>5)window.scrollTo(window.pageXOffset,
2216window.pageYOffset-moveY);self._translateView($tempImg,moveX);self._touchMove.x=moveX;self._touchMove.y=moveY;});$touch.bind('touchend',function touchEnd(e){if(e.originalEvent.targetTouches.length!=0)return;
2217e.preventDefault();e.stopImmediatePropagation();var x=self._touchMove.x;if((new Date().getTime()-self._touchStart.time)<300&&Math.abs(x)<5){clearTimeout(self._showOverlayTimeout);
2218self._showOverlayTimeout=null;if(self._overlayShown){$inner.trigger('overlay:info:leave.PhotoOverlay').trigger('overlay:leave.PhotoOverlay');self._overlayShown=false;
2219}else{$inner.click();}}if(x<swipeForward&&context.oncommandtest('next')){$tempImg.animate({'left':'-'+$tempImg.width()+'px'},'400','linear',function(){self._goNext(view,
2220context);});}else if(x>swipeBack&&context.oncommandtest('back')){$tempImg.animate({'left':$tempImg.width()+'px'},'400','linear',function(){self._goBack(view,context);
2221});}else{$tempImg.animate({'left':'0px'},'400','linear',null);}self._touchStart.x=0;self._touchStart.y=0;self._touchMove.x=0;self._touchMove.y=0;self._touchStart.date=null;
2222});};;function zf_HoverPlugin(onhover){this.onhover=onhover;}zf_HoverPlugin.prototype.onCreateDom=function(view,outer,inner,context,isNew){var self=this;$(outer).bind('mouseenter.HoverPlugin',
2223function(){self.onhover($(this),context.data,true);}).bind('mouseleave.HoverPlugin',function(){self.onhover($(this),context.data,false);});};zf_HoverPlugin.prototype.onDestroyDom=function(view,
2224outer,inner,context){$(outer).unbind('.HoverPlugin');};;zf_PhotoGrid.VerticalDynamicLayout=function(imageWidth,extraWidth,extraHeight,selectMethod){this._cxExtra=extraWidth;this._cyExtra=extraHeight;
2225this._imageWidth=imageWidth;this._selectMethod=selectMethod;};zf_PhotoGrid.VerticalDynamicLayout.prototype.init=function(grid){this._grid=grid;};zf_PhotoGrid.VerticalDynamicLayout.prototype.getLayoutInfo=function(flags){;
2226var grid=this._grid,grid$=grid.$(),info={};var viewport=grid.getViewPort();info.width=grid$.width();info.itemsPerRow=Math.floor(info.width/(this._imageWidth+this._cxExtra));
2227if(info.itemsPerRow==0)info.itemsPerRow=1;info.cellWidth=Math.floor(info.width/info.itemsPerRow);info.cellHeight=null;info.usedWidth=info.itemsPerRow*info.cellWidth;
2228var imageWidth=info.cellWidth-this._cxExtra;var colHeight=new Array(info.itemsPerRow),colRows=new Array(info.itemsPerRow);for(var i=0;i<info.itemsPerRow;i++){colHeight[i]=0;
2229colRows[i]=0;}var index=0,lastRequested=0,items=grid._items,targetBottom=viewport.bottom+$(window).height(),maxRows=grid.maxRows||Number.MAX_VALUE,minRows=grid.minRows||0,
2230minHeight=0,maxHeight=0;;if(this._lastWidth!=null&&info.usedWidth!=this._lastWidth)$.each(items,function(){this._vdl_col=null;});do{var anyLoaded=false,colIndex=0,
2231colSeq=0,rowIndex=0,done=false;for(;index<items.length;index++){var item=items[index];if(!item)break;anyLoaded=true;if(item._vdl_col!=null){colIndex=item._vdl_col;
2232}else{var photo=item.photo;item._vdl_width=info.cellWidth;if(photo&&!photo.isPlaceholder){item._vdl_height=Math.round(photo.height/photo.width*imageWidth)+this._cyExtra;
2233}else item._vdl_height=info.cellWidth;item.method=this._getItemMethod(item);var k=colIndex,found=false;do{if(colHeight[k]==minHeight){found=true;break;}k=(k+1)%colHeight.length;
2234}while(k!=colIndex);if(found)colIndex=k;item._vdl_col=colIndex;item._vdl_top=colHeight[colIndex];item._vdl_left=colIndex*info.cellWidth;item._vdl_row=colRows[colIndex];
2235}if(item._vdl_row>rowIndex)rowIndex=item._vdl_row;colHeight[colIndex]+=item._vdl_height;colRows[colIndex]++;minHeight=colHeight[0];$.each(colHeight,function(i,val){minHeight=Math.min(minHeight,
2236val);});if(colHeight[colIndex]>maxHeight)maxHeight=colHeight[colIndex];if(rowIndex>=maxRows||grid._height>-1&&maxHeight>=grid._height&&rowIndex>=minRows){colHeight[colIndex]-=item._vdl_height;
2237colRows[colIndex]--;done=true;break;}colIndex=(colIndex+1)%colHeight.length;}minHeight=maxHeight=colHeight[0];$.each(colHeight,function(i,val){minHeight=Math.min(minHeight,
2238val);maxHeight=Math.max(maxHeight,val);});var avgItemHeight=index>0?Math.round(maxHeight/Math.ceil(index/info.itemsPerRow)):info.cellWidth;if(done)break;;var extraItems=Math.ceil((targetBottom-minHeight)/avgItemHeight)*info.itemsPerRow;
2239if(extraItems>0){var firstRequested=Math.max(lastRequested,index);lastRequested=Math.min(index+extraItems,items.length);;for(i=firstRequested;i<lastRequested;i++)grid.onqueryitem(i);
2240if((anyLoaded||index==0)&&firstRequested<lastRequested)continue;}break;}while(true);var count=done?index:items.length;info.rowsPerPage=Math.ceil(count/info.itemsPerRow);
2241info.cellHeight=avgItemHeight;if(done||index==items.length)info.height=maxHeight;else info.height=Math.round(avgItemHeight*info.rowsPerPage);if(info.rowsPerPage==0)info.rowsPerPage=1;
2242if(grid.minHeight!=null&&info.height<this.minHeight)info.height=grid.minHeight;info.itemsPerPage=count;info.currentPage=0;info.totalPages=1;info.firstVisible=0;info.lastVisible=index;
2243;this._lastWidth=info.usedWidth;return info;};zf_PhotoGrid.VerticalDynamicLayout.prototype.getItemRect=function(info,index){var grid=this._grid,item=grid._items[index];if(!item)return{left:0,
2244top:0,right:0,bottom:0};var x=grid._left+item._vdl_left,y=item._vdl_top;return{left:x,top:y,right:x+item._vdl_width,bottom:y+item._vdl_height};};zf_PhotoGrid.VerticalDynamicLayout.prototype.getCellSize=function(){return{cx:null,
2245cy:null};};zf_PhotoGrid.VerticalDynamicLayout.prototype.clear=function(grid){this._lastWidth=null;};zf_PhotoGrid.VerticalDynamicLayout.prototype._getItemMethod=function(item){var cx=item._vdl_width-this._cxExtra,
2246cy=item._vdl_height-this._cyExtra;if(cx==item.method.cx&&cy==item.method.cy)return item.method;return this._selectMethod(item,cx,cy);};;zf_PhotoGrid.HorizontalDynamicLayout=function(imageHeight,
2247extraWidth,extraHeight,selectMethod){this._cxExtra=extraWidth;this._cyExtra=extraHeight;this._imageHeight=imageHeight;this._selectMethod=selectMethod;this._minRowItems=Number.MAX_VALUE;
2248};zf_PhotoGrid.HorizontalDynamicLayout.prototype.init=function(grid){this._grid=grid;};zf_PhotoGrid.HorizontalDynamicLayout.prototype.getLayoutInfo=function(flags){;var grid=this._grid,
2249grid$=grid.$(),info={};var viewport=grid.getViewPort();info.cellWidth=null;info.cellHeight=null;info.width=grid$.width();info.usedWidth=info.width;var index=0,lastRequested=0,
2250items=grid._items,targetBottom=viewport.bottom+$(window).height(),maxRows=grid.maxRows||Number.MAX_VALUE,minRows=grid.minRows||0;;if(this._lastWidth!=null&&info.usedWidth!=this._lastWidth){$.each(items,
2251function(){this._hdl_top=null;});this._minRowItems=Number.MAX_VALUE;}var rowStart=0,rowTop=0,rowIndex=0;do{var anyLoaded=false,rowWidth=0,done=false;for(index=rowStart;
2252index<items.length;index++){var item=items[index];if(!item)break;
2252if(item._hdl_top!=null){rowStart=index+1;rowTop=item._hdl_top;rowIndex=item._hdl_row;if(item._hdl_last){rowTop+=item._hdl_height;
2253++rowIndex;}}if(rowIndex>=maxRows||grid._height>-1&&rowTop>=grid._height&&rowIndex>=minRows){done=true;break;}if(item._hdl_top!=null)continue;anyLoaded=true;item._hdl_height=this._imageHeight+this._cyExtra;
2254var photo=item.photo;if(photo&&!photo.isPlaceholder){item._hdl_width=Math.round(photo.width/photo.height*this._imageHeight)+this._cxExtra;}else item._hdl_width=item._hdl_height;
2255if(rowWidth+item._hdl_width<=info.width){rowWidth+=item._hdl_width;continue;};if(rowStart==index){item._hdl_left=0;item._hdl_top=rowTop;item._hdl_width=info.width;
2256item._hdl_row=rowIndex;item._hdl_last=true;if(photo&&!photo.isPlaceholder){var imageWidth=item._hdl_width-this._cxExtra;item._hdl_height=Math.round(photo.height/photo.width*imageWidth)+this._cyExtra;
2257}else item._hdl_height=item._hdl_width;item.method=this._getItemMethod(item);rowStart=index+1;rowWidth=0;rowTop+=item._hdl_height;this._minRowItems=1;}else{var count=index-rowStart,
2258combinedWidth=rowWidth-count*this._cxExtra,targetWidth=info.width-count*this._cxExtra,scaleFactor=targetWidth/combinedWidth,imageHeight=Math.round((items[rowStart]._hdl_height-this._cyExtra)*scaleFactor);
2259rowWidth=0;for(var i=rowStart;i<index;i++){item=items[i];photo=item.photo;item._hdl_top=rowTop;item._hdl_left=rowWidth;item._hdl_height=imageHeight+this._cyExtra;
2260item._hdl_row=rowIndex;item._hdl_last=i==index-1;item._hdl_first=i==rowStart;if(item._hdl_last)item._hdl_width=info.width-rowWidth;else if(photo&&!photo.isPlaceholder){item._hdl_width=Math.round(photo.width/photo.height*imageHeight)+this._cxExtra;
2261}else item._hdl_width=item._hdl_height;item.method=this._getItemMethod(item);rowWidth+=item._hdl_width;}rowStart=index;rowTop+=item._hdl_height;rowWidth=items[index]._hdl_width;
2262++rowIndex;this._minRowItems=Math.min(this._minRowItems,count);}}if(done)break;var itemsPerPixel=rowStart>0?(rowStart/rowTop):info.width/(this._imageHeight+this._cxExtra)/(this._imageHeight+this._cxExtra);
2263;var extraItems=Math.ceil((targetBottom-rowTop)*itemsPerPixel);if(extraItems>0){var firstRequested=Math.max(lastRequested,index);lastRequested=Math.min(index+extraItems,
2264items.length);;for(i=firstRequested;i<lastRequested;i++)grid.onqueryitem(i);if((anyLoaded||index==0)&&firstRequested<lastRequested)continue;}break;}while(true);if(index==grid._items.length&&rowStart<index){;
2265count=index-rowStart;combinedWidth=rowWidth-count*this._cxExtra;targetWidth=info.width-count*this._cxExtra;scaleFactor=targetWidth/combinedWidth;imageHeight=0;;if(scaleFactor<1.5||count>=this._minRowItems)imageHeight=Math.round((items[rowStart]._hdl_height-this._cyExtra)*scaleFactor);
2266else if(rowStart>0){imageHeight=items[rowStart-1]._hdl_height-this._cyExtra;if(imageHeight==0||imageHeight/this._imageHeight>1.5)imageHeight=items[rowStart]._hdl_height-this._cyExtra;
2267}else imageHeight=this._imageHeight;rowWidth=0;for(i=rowStart;i<index;i++){item=items[i];photo=item.photo;item._hdl_top=rowTop;item._hdl_left=rowWidth;item._hdl_height=imageHeight+this._cyExtra;
2268item._hdl_row=rowIndex;item._hdl_last=i==index-1;if(item._hdl_last&&scaleFactor<1.5)item._hdl_width=info.width-rowWidth;else if(photo&&!photo.isPlaceholder){item._hdl_width=Math.round(photo.width/photo.height*imageHeight)+this._cxExtra;
2269}else item._hdl_width=item._hdl_height;item.method=this._getItemMethod(item);rowWidth+=item._hdl_width;}rowStart=index;rowWidth=0;rowTop+=item._hdl_height;}else index=rowStart;
2270if(index==items.length||done)info.height=rowTop;else info.height=Math.round(items.length/itemsPerPixel);info.rowsPerPage=Math.ceil(info.height/(this._imageHeight+this._cyExtra));
2271if(info.rowsPerPage==0)info.rowsPerPage=1;info.itemsPerRow=Math.ceil(items.length/info.rowsPerPage);info.cellHeight=Math.round(this._imageHeight+this._cyExtra);info.cellWidth=Math.round(info.width/info.itemsPerRow);
2272if(grid.minHeight!=null&&info.height<this.minHeight)info.height=grid.minHeight;info.itemsPerPage=done?index:items.length;info.currentPage=0;info.totalPages=1;info.firstVisible=0;
2273info.lastVisible=index;;this._lastWidth=info.usedWidth;return info;};zf_PhotoGrid.HorizontalDynamicLayout.prototype.getItemRect=function(info,index){var grid=this._grid,item=grid._items[index];
2274if(!item)return{left:0,top:0,right:0,bottom:0};var x=grid._left+item._hdl_left,y=item._hdl_top;return{left:x,top:y,right:x+item._hdl_width,bottom:y+item._hdl_height};
2275};zf_PhotoGrid.HorizontalDynamicLayout.prototype.getCellSize=function(grid){return{cx:null,cy:null};};zf_PhotoGrid.HorizontalDynamicLayout.prototype.clear=function(grid){this._lastWidth=null;
2276};zf_PhotoGrid.HorizontalDynamicLayout.prototype._getItemMethod=function(item){var cx=item._hdl_width-this._cxExtra,cy=item._hdl_height-this._cyExtra;if(cx==item.method.cx&&cy==item.method.cy)return item.method;
2277return this._selectMethod(item,cx,cy);};;;function zfl_MailboxLink(id){zfl_Control.prototype.constructor.call(this,id);}zfl_MailboxLink.inherits(zfl_Control);zfl_MailboxLink.prototype.setCount=function(count){var dom=this.dom("count");
2278if(dom)zf_stdSetText(dom,count);};zfl_MailboxLink.prototype._view_onclick=function(){if(this.onshow)this.onshow();};zfl_MailboxLink.prototype._add_onclick=function(){if(this.onadd)this.onadd();
2279};zfl_MailboxLink.prototype.update=function(photo,context){;;if(this.current==photo)return;if(this.current!=null)this.current.unadvise(this);if(this.currentMeta!=null)this.currentMeta.unadvise(this);
2280this.current=photo;this.currentMeta=null;if(photo.loaded){this.set(photo,context);}else{var self=this;photo.advise(this,function(){self.set(photo,context);});}};
2281zfl_MailboxLink.prototype.set=function(photo,context){;var mask=zf_AccessMask.NoPublicComments|zf_AccessMask.NoPrivateComments;var canAdd=(photo.access.mask&mask)!=mask;if(zf_userId==0&&(photo.access.mask&zf_AccessMask.NoAnonymousComments)!=0)canAdd=false;
2282this.display((photo.access.mask&zf_AccessMask.ProtectComments)==0);this._showAddLink(canAdd);var self=this,meta=photo.getCommentsCount(this,function(count){self.setCount(count);
2283});if(meta){this.currentMeta=meta;}};zfl_MailboxLink.prototype._showAddLink=function(show){var link=this.dom("add");if(link){zf_stdReplaceClassName(link,show?"none":null,show?null:"none");
2284}};zfl_MailboxLink.prototype.refresh=function(){if(this.current&&this.current.loaded)this.set(this.current);};zfl_MailboxLink.prototype.scrollTo=function(target){if(!target)return;var offset=zf_stdGetOffset(target.dom());
2285$('html,body').animate({scrollTop:offset.cy-50},300);};;var _qevents=[];function zf_Quantcast(account,labels,async){this._account=account;this._labels=labels;this._async=async;
2286if(async){var self=this;$(function(){setTimeout(function(){self._install();},100);});}else this._install();}zf_Quantcast.prototype._install=function(){var elem=document.createElement('SCRIPT');
2287elem.src=(location.protocol=="https:"?"https://secure":"http://edge")+".quantserve.com/quant.js";elem.type="text/javascript";elem.async=this._async;elem.defer=true;
2288document.body.appendChild(elem);};zf_Quantcast.prototype.trackPageView=function(){_qevents.push({qacct:this._account,labels:this._labels});};;function zf_StatCounter(project,security,
2289async){;;;;;window.sc_project=parseInt(project,10);window.sc_invisible=1;window.sc_security=security;window.sc_click_stat=-100;this._async=async;if(async){var self=this;
2290$(function(){self._install();});}else this._install();}zf_StatCounter.prototype._install=function(){var elem=document.createElement('SCRIPT');elem.src=(location.protocol=="https:"?"https://secure":"http://www")+".statcounter.com/counter/counter.js";
2291elem.type="text/javascript";elem.async=this._async;document.body.appendChild(elem);};zf_StatCounter.prototype.trackPageView=function(){};;//    
2292"undefined" != typeof define && (window._zfDefineCopy = define, define = void 0), "undefined" != typeof exports && (window._zfExportsCopy = exports, exports = void 0), "undefined" != typeof module && (window._zfModuleCopy = module, module = void 0);
2293//    
2294//     Underscore.js 1.8.3
2295//     http://underscorejs.org
2296//     (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
2297//     Underscore may be freely distributed under the MIT license.
2298(function(){function n(n){function t(t,r,e,u,i,o){for(;i>=0&&o>i;i+=n){var a=u?u[i]:i;e=r(e,t[a],a,t)}return e}return function(r,e,u,i){e=b(e,i,4);var o=!k(r)&&m.keys(r),a=(o||r).length,c=n>0?0:a-1;return arguments.length<3&&(u=r[o?o[c]:c],c+=n),t(r,e,u,o,c,a)}}function t(n){return function(t,r,e){r=x(r,e);for(var u=O(t),i=n>0?0:u-1;i>=0&&u>i;i+=n)if(r(t[i],i,t))return i;return-1}}function r(n,t,r){return function(e,u,i){var o=0,a=O(e);if("number"==typeof i)n>0?o=i>=0?i:Math.max(i+a,o):a=i>=0?Math.min(i+1,a):i+a+1;else if(r&&i&&a)return i=r(e,u),e[i]===u?i:-1;if(u!==u)return i=t(l.call(e,o,a),m.isNaN),i>=0?i+o:-1;for(i=n>0?o:a-1;i>=0&&a>i;i+=n)if(e[i]===u)return i;return-1}}function e(n,t){var r=I.length,e=n.constructor,u=m.isFunction(e)&&e.prototype||a,i="constructor";for(m.has(n,i)&&!m.contains(t,i)&&t.push(i);r--;)i=I[r],i in n&&n[i]!==u[i]&&!m.contains(t,i)&&t.push(i)}var u=this,i=u._,o=Array.prototype,a=Object.prototype,c=Function.prototype,f=o.push,l=o.slice,s=a.toString,p=a.hasOwnProperty,h=Array.isArray,v=Object.keys,g=c.bind,y=Object.create,d=function(){},m=function(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=m),exports._=m):u._=m,m.VERSION="1.8.3";var b=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}},x=function(n,t,r){return null==n?m.identity:m.isFunction(n)?b(n,t,r):m.isObject(n)?m.matcher(n):m.property(n)};m.iteratee=function(n,t){return x(n,t,1/0)};var _=function(n,t){return function(r){var e=arguments.length;if(2>e||null==r)return r;for(var u=1;e>u;u++)for(var i=arguments[u],o=n(i),a=o.length,c=0;a>c;c++){var f=o[c];t&&r[f]!==void 0||(r[f]=i[f])}return r}},j=function(n){if(!m.isObject(n))return{};if(y)return y(n);d.prototype=n;var t=new d;return d.prototype=null,t},w=function(n){return function(t){return null==t?void 0:t[n]}},A=Math.pow(2,53)-1,O=w("length"),k=function(n){var t=O(n);return"number"==typeof t&&t>=0&&A>=t};m.each=m.forEach=function(n,t,r){t=b(t,r);var e,u;if(k(n))for(e=0,u=n.length;u>e;e++)t(n[e],e,n);else{var i=m.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},m.map=m.collect=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=Array(u),o=0;u>o;o++){var a=e?e[o]:o;i[o]=t(n[a],a,n)}return i},m.reduce=m.foldl=m.inject=n(1),m.reduceRight=m.foldr=n(-1),m.find=m.detect=function(n,t,r){var e;return e=k(n)?m.findIndex(n,t,r):m.findKey(n,t,r),e!==void 0&&e!==-1?n[e]:void 0},m.filter=m.select=function(n,t,r){var e=[];return t=x(t,r),m.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e},m.reject=function(n,t,r){return m.filter(n,m.negate(x(t)),r)},m.every=m.all=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(!t(n[o],o,n))return!1}return!0},m.some=m.any=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(t(n[o],o,n))return!0}return!1},m.contains=m.includes=m.include=function(n,t,r,e){return k(n)||(n=m.values(n)),("number"!=typeof r||e)&&(r=0),m.indexOf(n,t,r)>=0},m.invoke=function(n,t){var r=l.call(arguments,2),e=m.isFunction(t);return m.map(n,function(n){var u=e?t:n[t];return null==u?u:u.apply(n,r)})},m.pluck=function(n,t){return m.map(n,m.property(t))},m.where=function(n,t){return m.filter(n,m.matcher(t))},m.findWhere=function(n,t){return m.find(n,m.matcher(t))},m.max=function(n,t,r){var e,u,i=-1/0,o=-1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],e>i&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(u>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i},m.min=function(n,t,r){var e,u,i=1/0,o=1/0;
2298if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],i>e&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(o>u||1/0===u&&1/0===i)&&(i=n,o=u)});return i},m.shuffle=function(n){for(var t,r=k(n)?n:m.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=m.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},m.sample=function(n,t,r){return null==t||r?(k(n)||(n=m.values(n)),n[m.random(n.length-1)]):m.shuffle(n).slice(0,Math.max(0,t))},m.sortBy=function(n,t,r){return t=x(t,r),m.pluck(m.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=x(r,e),m.each(t,function(e,i){var o=r(e,i,t);n(u,e,o)}),u}};m.groupBy=F(function(n,t,r){m.has(n,r)?n[r].push(t):n[r]=[t]}),m.indexBy=F(function(n,t,r){n[r]=t}),m.countBy=F(function(n,t,r){m.has(n,r)?n[r]++:n[r]=1}),m.toArray=function(n){return n?m.isArray(n)?l.call(n):k(n)?m.map(n,m.identity):m.values(n):[]},m.size=function(n){return null==n?0:k(n)?n.length:m.keys(n).length},m.partition=function(n,t,r){t=x(t,r);var e=[],u=[];return m.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]},m.first=m.head=m.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:m.initial(n,n.length-t)},m.initial=function(n,t,r){return l.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},m.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:m.rest(n,Math.max(0,n.length-t))},m.rest=m.tail=m.drop=function(n,t,r){return l.call(n,null==t||r?1:t)},m.compact=function(n){return m.filter(n,m.identity)};var S=function(n,t,r,e){for(var u=[],i=0,o=e||0,a=O(n);a>o;o++){var c=n[o];if(k(c)&&(m.isArray(c)||m.isArguments(c))){t||(c=S(c,t,r));var f=0,l=c.length;for(u.length+=l;l>f;)u[i++]=c[f++]}else r||(u[i++]=c)}return u};m.flatten=function(n,t){return S(n,t,!1)},m.without=function(n){return m.difference(n,l.call(arguments,1))},m.uniq=m.unique=function(n,t,r,e){m.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=x(r,e));for(var u=[],i=[],o=0,a=O(n);a>o;o++){var c=n[o],f=r?r(c,o,n):c;t?(o&&i===f||u.push(c),i=f):r?m.contains(i,f)||(i.push(f),u.push(c)):m.contains(u,c)||u.push(c)}return u},m.union=function(){return m.uniq(S(arguments,!0,!0))},m.intersection=function(n){for(var t=[],r=arguments.length,e=0,u=O(n);u>e;e++){var i=n[e];if(!m.contains(t,i)){for(var o=1;r>o&&m.contains(arguments[o],i);o++);o===r&&t.push(i)}}return t},m.difference=function(n){var t=S(arguments,!0,!0,1);return m.filter(n,function(n){return!m.contains(t,n)})},m.zip=function(){return m.unzip(arguments)},m.unzip=function(n){for(var t=n&&m.max(n,O).length||0,r=Array(t),e=0;t>e;e++)r[e]=m.pluck(n,e);return r},m.object=function(n,t){for(var r={},e=0,u=O(n);u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},m.findIndex=t(1),m.findLastIndex=t(-1),m.sortedIndex=function(n,t,r,e){r=x(r,e,1);for(var u=r(t),i=0,o=O(n);o>i;){var a=Math.floor((i+o)/2);r(n[a])<u?i=a+1:o=a}return i},m.indexOf=r(1,m.findIndex,m.sortedIndex),m.lastIndexOf=r(-1,m.findLastIndex),m.range=function(n,t,r){null==t&&(t=n||0,n=0),r=r||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),i=0;e>i;i++,n+=r)u[i]=n;return u};var E=function(n,t,r,e,u){if(!(e instanceof t))return n.apply(r,u);var i=j(n.prototype),o=n.apply(i,u);return m.isObject(o)?o:i};m.bind=function(n,t){if(g&&n.bind===g)return g.apply(n,l.call(arguments,1));if(!m.isFunction(n))throw new TypeError("Bind must be called on a function");var r=l.call(arguments,2),e=function(){return E(n,e,t,this,r.concat(l.call(arguments)))};return e},m.partial=function(n){var t=l.call(arguments,1),r=function(){for(var e=0,u=t.length,i=Array(u),o=0;u>o;o++)i[o]=t[o]===m?arguments[e++]:t[o];for(;e<arguments.length;)i.push(arguments[e++]);return E(n,r,this,this,i)};return r},m.bindAll=function(n){var t,r,e=arguments.length;if(1>=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=m.bind(n[r],n);return n},m.memoize=function(n,t){var r=function(e){var u=r.cache,i=""+(t?t.apply(this,arguments):e);return m.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},m.delay=function(n,t){var r=l.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},m.defer=m.partial(m.delay,m,1),m.throttle=function(n,t,r){var e,u,i,o=null,a=0;r||(r={});var c=function(){a=r.leading===!1?0:m.now(),o=null,i=n.apply(e,u),o||(e=u=null)};return function(){var f=m.now();a||r.leading!==!1||(a=f);var l=t-(f-a);return e=this,u=arguments,0>=l||l>t?(o&&(clearTimeout(o),o=null),a=f,i=n.apply(e,u),o||(e=u=null)):o||r.trailing===!1||(o=setTimeout(c,l)),i}},m.debounce=function(n,t,r){var e,u,i,o,a,c=function(){var f=m.now()-o;t>f&&f>=0?e=setTimeout(c,t-f):(e=null,r||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,o=m.now();var f=r&&!e;return e||(e=setTimeout(c,t)),f&&(a=n.apply(i,u),i=u=null),a}},m.wrap=function(n,t){return m.partial(t,n)},m.negate=function(n){return function(){return!n.apply(this,arguments)}},m.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},m.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},m.before=function(n,t){var r;return function(){return--n>0&&(r=t.apply(this,arguments)),1>=n&&(t=null),r}},m.once=m.partial(m.before,2);var M=!{toString:null}.propertyIsEnumerable("toString"),I=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleStr
2298ing"];m.keys=function(n){if(!m.isObject(n))return[];if(v)return v(n);var t=[];for(var r in n)m.has(n,r)&&t.push(r);return M&&e(n,t),t},m.allKeys=function(n){if(!m.isObject(n))return[];var t=[];for(var r in n)t.push(r);return M&&e(n,t),t},m.values=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},m.mapObject=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=u.length,o={},a=0;i>a;a++)e=u[a],o[e]=t(n[e],e,n);return o},m.pairs=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},m.invert=function(n){for(var t={},r=m.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},m.functions=m.methods=function(n){var t=[];for(var r in n)m.isFunction(n[r])&&t.push(r);return t.sort()},m.extend=_(m.allKeys),m.extendOwn=m.assign=_(m.keys),m.findKey=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=0,o=u.length;o>i;i++)if(e=u[i],t(n[e],e,n))return e},m.pick=function(n,t,r){var e,u,i={},o=n;if(null==o)return i;m.isFunction(t)?(u=m.allKeys(o),e=b(t,r)):(u=S(arguments,!1,!1,1),e=function(n,t,r){return t in r},o=Object(o));for(var a=0,c=u.length;c>a;a++){var f=u[a],l=o[f];e(l,f,o)&&(i[f]=l)}return i},m.omit=function(n,t,r){if(m.isFunction(t))t=m.negate(t);else{var e=m.map(S(arguments,!1,!1,1),String);t=function(n,t){return!m.contains(e,t)}}return m.pick(n,t,r)},m.defaults=_(m.allKeys,!0),m.create=function(n,t){var r=j(n);return t&&m.extendOwn(r,t),r},m.clone=function(n){return m.isObject(n)?m.isArray(n)?n.slice():m.extend({},n):n},m.tap=function(n,t){return t(n),n},m.isMatch=function(n,t){var r=m.keys(t),e=r.length;if(null==n)return!e;for(var u=Object(n),i=0;e>i;i++){var o=r[i];if(t[o]!==u[o]||!(o in u))return!1}return!0};var N=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof m&&(n=n._wrapped),t instanceof m&&(t=t._wrapped);var u=s.call(n);if(u!==s.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}var i="[object Array]"===u;if(!i){if("object"!=typeof n||"object"!=typeof t)return!1;var o=n.constructor,a=t.constructor;if(o!==a&&!(m.isFunction(o)&&o instanceof o&&m.isFunction(a)&&a instanceof a)&&"constructor"in n&&"constructor"in t)return!1}r=r||[],e=e||[];for(var c=r.length;c--;)if(r[c]===n)return e[c]===t;if(r.push(n),e.push(t),i){if(c=n.length,c!==t.length)return!1;for(;c--;)if(!N(n[c],t[c],r,e))return!1}else{var f,l=m.keys(n);if(c=l.length,m.keys(t).length!==c)return!1;for(;c--;)if(f=l[c],!m.has(t,f)||!N(n[f],t[f],r,e))return!1}return r.pop(),e.pop(),!0};m.isEqual=function(n,t){return N(n,t)},m.isEmpty=function(n){return null==n?!0:k(n)&&(m.isArray(n)||m.isString(n)||m.isArguments(n))?0===n.length:0===m.keys(n).length},m.isElement=function(n){return!(!n||1!==n.nodeType)},m.isArray=h||function(n){return"[object Array]"===s.call(n)},m.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},m.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(n){m["is"+n]=function(t){return s.call(t)==="[object "+n+"]"}}),m.isArguments(arguments)||(m.isArguments=function(n){return m.has(n,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(m.isFunction=function(n){return"function"==typeof n||!1}),m.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},m.isNaN=function(n){return m.isNumber(n)&&n!==+n},m.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===s.call(n)},m.isNull=function(n){return null===n},m.isUndefined=function(n){return n===void 0},m.has=function(n,t){return null!=n&&p.call(n,t)},m.noConflict=function(){return u._=i,this},m.identity=function(n){return n},m.constant=function(n){return function(){return n}},m.noop=function(){},m.property=w,m.propertyOf=function(n){return null==n?function(){}:function(t){return n[t]}},m.matcher=m.matches=function(n){return n=m.extendOwn({},n),function(t){return m.isMatch(t,n)}},m.times=function(n,t,r){var e=Array(Math.max(0,n));t=b(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},m.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},m.now=Date.now||function(){return(new Date).getTime()};var B={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},T=m.invert(B),R=function(n){var t=function(t){return n[t]},r="(?:"+m.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};m.escape=R(B),m.unescape=R(T),m.result=function(n,t,r){var e=null==n?void 0:n[t];return e===void 0&&(e=r),m.isFunction(e)?e.call(n):e};var q=0;m.uniqueId=function(n){var t=++q+"";return n?n+t:t},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,L=function(n){return"\\"+z[n]};m.template=function(n,t,r){!t&&r&&(t=r),t=m.defaults({},t,m.templateSettings);var e=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,o,a){return i+=n.slice(u,a).replace(D,L),u=a+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(t.variable||"obj","_",i)}catch(a){throw a.source=i,a}var c=function(n){return o.call(this,n,m)},f=t.variable||"obj";return c.source="function("+f+"){\n"+i+"}",c},m.chain=function(n){var t=m(n);return t._chain=!0,t};var P=function(n,t){return n._chain?m(t).chain():t};m.mixin=function(n){m.each(m.functions(n),function(t){var r=m[t]=n[t];m.prototype[t]=function(){var n=[this._wrapped];return f.apply(n,arguments),P(this,r.apply(m,n))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=o[n];m.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],P(this,r)}}),m.each(["concat","join","slice"],function(n){var t=o[n];m.prototype[n]=function(){return P(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}).call(this);
2299//# sourceMappingURL=underscore-min.map
2300//    
2301"_zfDefineCopy"in window&&(define=window._zfDefineCopy,delete window._zfDefineCopy),"_zfExportsCopy"in window&&(exports=window._zfExportsCopy,delete window._zfExportsCopy),"_zfModuleCopy"in window&&(module=window._zfModuleCopy,delete window._zfModuleCopy);
2302_.templateSettings={escape:/\{\{[^#\{]([\s\S]+?)[^\}]\}\}/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,evaluate:/\{\{#([\s\S]+?)\}\}/g};;function zf_TagManager(newContainer,auth,
2303preview,cookiesWin,async){this._newContainer=newContainer;this._auth=auth;this._preview=preview;this._cookiesWin=cookiesWin;this._async=async;var attributes='';if(this._auth)attributes+=('&gtm_auth='+this._auth);
2304if(this._preview)attributes+=('&gtm_preview='+this._preview);if(this._cookiesWin)attributes+=('&gtm_cookies_win='+this._cookiesWin);if(async){var self=this;$(function(){setTimeout(function(){self._install(attributes);
2305self._installGTM();},1000);});}else{this._install(attributes);this._installGTM();}window.analytics_vars=window.analytics_vars||[];window.analytics_vars.context=window.analytics_vars.context||{};
2306l='dataLayer';window['dataLayer']=window['dataLayer']||[];window['dataLayer'].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=document.getElementsByTagName('script')[0],
2307j=document.createElement('script'),dl=l!='dataLayer'?'&l='+l:'';j.async=this._async;if(this._newContainer&&!zf_isRemoveGA){j=document.createElement('script');j.async=this._async;
2308j.defer=true;
2308j.src='https://www.googletagmanager.com/gtm.js?id='+this._newContainer+dl+attributes;f.parentNode.insertBefore(j,f);}}zf_TagManager.prototype._install=function(attributes){if(this._newContainer&&!zf_isRemoveGA){var elem_2=document.createElement('noscript');
2309elem_2.appendChild(document.createElement('iframe'));elem_2.getElementsByTagName('iframe')[0].setAttribute('src','https://www.googletagmanager.com/ns.html?id='+this._newContainer+attributes);
2310elem_2.getElementsByTagName('iframe')[0].setAttribute('height','0');elem_2.getElementsByTagName('iframe')[0].setAttribute('width','0');elem_2.getElementsByTagName('iframe')[0].setAttribute('style',
2311'display:none;visibility:hidden');document.body.appendChild(elem_2);}};zf_TagManager.prototype._installGTM=function(){$('[data-zf-gtm-event]').each(function(){var event=$(this).attr('data-zf-gtm-event').split(':'),
2312eventName=event[0],category=event[1],action=event[2],label=event[3]||$(this).text()||"",customData=event[4];console.log("register");var eventData={'event':eventName||null,
2313'eventCategory':category||null,'eventAction':action||null,'eventLabel':label.trim()||null};var data=Object.assign({},eventData,zf_gtm_userInfo,customData);const eventFn=function(e){dataLayer.push(data);
2314};if(this.nodeName&&this.nodeName.toLowerCase()==='select'){$(this).change(eventFn);}else{$(this).click(eventFn);}});window.analytics_vars={'email':typeof zf_gtm_userInfo=='undefined'?null:zf_gtm_userInfo.email};
2315};zf_TagManager.updateReferralLink=function(link,utmCampaign,utmContent){return encodeURI(link+'?utm_medium=photographer_referral_link&amp;utm_source=zenfolio_email_system&amp;utm_campaign='+utmCampaign+'&amp;utm_content='+utmContent);
2316};zf_TagManager.pushEvent=function(eventData){dataLayer.push(eventData);};zf_TagManager.pushPreorderCustomerEvent=function(eventData,currency,quantity,productModel,model){var event=eventData||{};
2317var ecommerce;var products=[];var productMapping=function(product,productType,originalProducts,shippingMethod,vendor){var productsOfPackage=product.products||[];
2318var productNames=[];for(var i=0;i<productsOfPackage.length;i++){productNames.push(productsOfPackage[i].name);}if((!product.name||!product.cid)&&originalProducts&&originalProducts.length){var item=_.find(originalProducts,
2319function(item){return item.index===product.index;});if(item){product.name=item.name;product.cid=item.cid;}}return{name:product.name||'none',id:product.index.toString()||null,
2320price:product.price.toString()||null,brand:vendor||'none',category:'none',coupon:'none',variant:productNames.length?productNames.join(','):'none',quantity:product.quantity||null,
2321coupon:product.coupon||'none',bundle:productType?productType:product.isPackage?'package':product.isCustomPackage?'custom':product.isAddOn?'add-on':'none',shipping_method:shippingMethod||'na'};
2322};var productsMapping=function(data,bundle){var productList=[];var vendorId=data.vendorId&&!data.vendorId.startsWith('user')?data.vendorId:'none';_.each(data.packages,
2323function(i){productList.push(productMapping(i,bundle||'package',model.packages,data.shippingMethod,vendorId));});_.each(data.customPackages,function(i){productList.push(productMapping(i,
2324bundle||'custom',model.customPackages,data.shippingMethod,vendorId));});_.each(data.addons,function(i){productList.push(productMapping(i,bundle||'add-on',model.addons,
2325data.shippingMethod,vendorId));});return productList;};if(event.name=='checkout'){products=[];if(event.step===2){_.each(model.preorders,function(preorder){products.push(productsMapping(preorder));
2326});products=_.flatten(products);}else{products=productsMapping(model.cart);}ecommerce={currencyCode:currency,checkout:{actionField:{step:event.step},products:products}};
2327}else if(event.name=='transaction'){var shipping=0;var bundle=_.reduce(model.preorders,function(memo,p,idx){var index=idx+1;return memo+'Order#'+index+(model.preorders.length===index?'':',');
2328},'');products=[];_.each(model.preorders,function(preorder){shipping+=preorder.shippingAmount;products.push(productsMapping(preorder,bundle));});products=_.flatten(products);
2329ecommerce={currencyCode:currency,purchase:{actionField:{id:event.orderId,revenue:model.grandTotal.toFixed(2),tax:model._tax,shipping:shipping,coupon:'none'},products:products}};
2330}else{var p=productMapping(productModel);var actionName='add';event.name='addToCart';event.action='addToCart';if(quantity<0){event.name='removeFromCart';event.action='removeFromCart';
2331actionName='remove';}p.quantity=Math.abs(quantity);p.shipping_method='na';delete p.coupon;ecommerce={currencyCode:currency};ecommerce[actionName]={products:[p]};
2332}var data={event:event.name||null,eventCategory:'ecom',eventAction:event.action||null,eventLabel:'pre order',accountId:zf_ownerId||null,account_name:zf_userName||null,
2333layout:zf_userLayout||null,plan:zf_userPlan||null,theme:zf_userTheme||null,type:'none',getting_started:'none',photo_organizer:'none',website_customize:returnWebsiteCustomize(zf_gtm_userInfo),
2334selling:'none',ecommerce:ecommerce||null};dataLayer.push(Object.assign({},data));};zf_TagManager.pusEcommerceOrderEvent=function(action,model){if(!model)return;try{var type;switch(action.name){case 'productDetails':type='detail';
2335break;case 'addToCart':type='add';break;case 'removeFromCart':type='remove';break;case 'checkout':type='checkout';break;case 'transaction':type='purchase';break;
2336default:break;}var zfOwnerId=(typeof zf_ownerId!=='undefined')?zf_ownerId:null;var zfUserId=(typeof zf_userId!=='undefined')?zf_userId:null;var zfOwnerName=(typeof zf_ownerName!=='undefined')?zf_ownerName:null;
2337var zfUserName=(typeof zf_userName!=='undefined')?zf_userName:null;var zfUserLayout=(typeof zf_userLayout!=='undefined')?zf_userLayout:null;var zfUserPlan=(typeof zf_userPlan!=='undefined')?zf_userPlan:null;
2338var zfUserTheme=(typeof zf_userTheme!=='undefined')?zf_userTheme:null;var data={event:action.name||null,eventCategory:'ecom',eventAction:action.eventAction||action.name,
2339eventLabel:'regular',accountId:zfOwnerId||zfUserId||null,account_name:zfOwnerName||zfUserName||null,layout:zfUserLayout||null,plan:zfUserPlan||null,theme:zfUserTheme||null,
2340type:'none',getting_started:'none',photo_organizer:'none',website_customize:returnWebsiteCustomize(zf_gtm_userInfo)||null,selling:'none',ecommerce:mappingEcommerceProduct(model,
2341type,action.actionField)};viewGallery={accountId:data.accountId||null,account_name:data.account_name||null,layout:data.layout||null,plan:data.plan||null,theme:data.theme||null,
2342type:data.type||null,getting_started:data.getting_started||null,photo_organizer:data.photo_organizer||null,website_customize:data.website_customize||null,selling:data.selling||null,
2343ecommerce:data.ecommerce||null};dataLayer.push(Object.assign({},data));}catch(err){console.log(err);}};zf_TagManager.adminPushGTM=function(event,eventCategory,eventAction,eventLabel){try{window.dataLayer=window.dataLayer||[];
2344dataLayer.push({'event':event?event:null,'eventCategory':eventCategory?eventCategory:null,'eventAction':eventAction?eventAction:null,'eventLabel':eventLabel?eventLabel:null,
2345'account_id':(zf_gtm_userInfo&&zf_gtm_userInfo.account_id)?zf_gtm_userInfo.account_id:null,'plan':zf_userPlanGroup?zf_userPlanGroup:null,'theme':(zf_gtm_userInfo&&zf_gtm_userInfo.theme)?zf_gtm_userInfo.theme:null,
2346'trial_or_paid':(zf_gtm_userInfo&&zf_gtm_userInfo.trial_or_paid)?zf_gtm_userInfo.trial_or_paid:null,'account_name':zf_userName||null,'getting_started_%':null,'layout':(zf_gtm_userInfo&&zf_gtm_userInfo.layout)?zf_gtm_userInfo.layout:null,
2347'test_version':null,'banner_enabled':zf_showFeaturedProductsBanner||0});}catch(err){console.log(err);}};zf_TagManager.adminCustomizePushGTM=function(eventAction){try{window.dataLayer=window.dataLayer||[];
2348dataLayer.push({'event':'website','eventCategory':'website customization','eventAction':eventAction?eventAction:null,'account_id':(zf_gtm_userInfo&&zf_gtm_userInfo.account_id)?zf_gtm_userInfo.account_id:null,
2349'plan':zf_userPlanGroup?zf_userPlanGroup:null,'theme':(zf_gtm_userInfo&&zf_gtm_userInfo.theme)?zf_gtm_userInfo.theme:null,'trial_or_paid':(zf_gtm_userInfo&&zf_gtm_userInfo.trial_or_paid)?zf_gtm_userInfo.trial_or_paid:null,
2350'account_name':zf_userName?zf_userName:null,'getting_started_%':null,'layout':(zf_gtm_userInfo&&zf_gtm_userInfo.layout)?zf_gtm_userInfo.layout:null,'test_version':null,
2351'banner_enabled':zf_showFeaturedProductsBanner?zf_showFeaturedProductsBanner:null});}catch(err){console.log(err);}};zf_TagManager.menuEditPushGTM=function(text){switch(text){case "Portfolio":this.adminCustomizePushGTM('added portfolio');
2352break;case "Client Galleries":this.adminCustomizePushGTM('added gallery');break;case "Blog":this.adminCustomizePushGTM('added blog');break;case "About":this.adminCustomizePushGTM('added about');
2353break;case "Contact":this.adminCustomizePushGTM('added contact');break;case "ClientAccessPage":this.adminCustomizePushGTM('added client access');break;case "FeaturedPage":this.adminCustomizePushGTM('added featured gallery or collections');
2354break;case "GuestbookPage":this.adminCustomizePushGTM('added guest book');break;case "LoginPage":this.adminCustomizePushGTM('added login register page');break;case "RecentPage":this.adminCustomizePushGTM('added recent');
2355break;case "SearchPage":this.adminCustomizePushGTM('added search');break;case "ShoppingPage":this.adminCustomizePushGTM('added shop');break;default:break;}};function mappingEcommerceProduct(model,
2356type,actionField){var products=[];var currency;
2356if($.isArray(model)){_.each(model,function(data){data.currencyCode=data.currencyCode||(model.currency&&model.currency.code)||'USD';
2357var eInfo=getEcommerceProductInfo(data,type);products.push(eInfo.product||null);if(!currency){currency=eInfo.currency;}});}else{var eInfo=getEcommerceProductInfo(model,
2358type);currency=eInfo.currency;products.push(eInfo.product||null);}var result={currencyCode:currency||null};result[type]={products:products||null};if(actionField){result[type].actionField=actionField||null;
2359}return result;}function getEcommerceProductInfo(model,type){var product=model;var item=product?product.item||product:product;var currentPackage=item.isPackage?item:product['package'];
2360var bundle='none',id,name,vendorId,quantity,price,currency;if(currentPackage){var items=product.items;var tmpProduct=product['package']||product['product']||{};currency=currentPackage.currencyCode?(_.isObject(currentPackage.currencyCode)?currentPackage.currencyCode.code:currentPackage.currencyCode):(product?(_.isObject(product.currency)?product.currency.code:product.currency):'USD');
2361name=currentPackage.name||null;price=currentPackage.price||null;id=(_.isString(currentPackage.id)?currentPackage.id:currentPackage.productId)||tmpProduct.id||tmpProduct.productId;
2362vendorId=currentPackage.vendorId||null;quantity=(product.packages?product.packages.length:product.packages)||product.GTMQuantity||currentPackage.quantity||1;bundle=items?_.map(items,
2363function(i){return i.id;}).join(','):getBundleRegularOrder(model);}else if(item){id=item.productId||item.id;currency=item.currencyCode?item.currencyCode:item.currency?item.currency.code:(model.currency&&model.currency.code)||'USD';
2364name=(product&&product.name)?product.name:item.name?item.name:item.productId||'none';vendorId=item.vendorId||null;quantity=item.quantity||1;price=(product&&product.customerPrice)?product.customerPrice:item.price||0;
2365if(item.product&&item.product.products){var products=[];for(var key in item.product.products){products.push(item.product.products[key].id||null);}bundle=products.join(',');
2366}}var productInfo={name:name.replace(/['"]/g,''),id:id||null,price:price||null,brand:vendorId||'none',category:'none',variant:'set of 4',bundle:bundle||null,shipping_method:'na',
2367gallery:'none',fullfilment_type:'none'};if(type!=='detail'){productInfo.quantity=quantity||1;}if(type==='checkout'||type==='purchase'){productInfo.coupon='none';
2368}return{currency:currency||'USD',product:productInfo||null};}function getBundleRegularOrder(model){var names=[],p;if(model.updatedPackages&&model.updatedPackages.length){for(var iPackage=0;
2369iPackage<model.updatedPackages.length;iPackage++){p=model.updatedPackages[iPackage];if(p&&p.items){_.each(p.items,function(item){names.push(item.productId||null);
2370});}}}else if(model._items&&model['package']&&model['package'].removed){for(var iId=0;iId<model['package'].ids.length;iId++){var id=model['package'].ids[iId];p=_.find(model._items,
2371function(d){return id===d.id;});if(p&&p.items){_.each(p.items,function(item){names.push(item.productId||null);});}}}else if(model['product']&&model['product']['products']){var prods=model['product']['products']||[];
2372_.each(prods,function(p){names.push(p.productId||p.id||null);});}return names.length?names.join(','):'none';}function zf_GTMUserInfo(object){if(!object)return;this.account_id=object.accountId||null;
2373this.account_name=object.accountName||null;this.email=object.email||null;this.plan=object.plan||null;this.theme=object.theme||null;this.trial_or_paid=object.trialOrPaid||null;
2374this.layout=object.layout||null;this.quickshop=object.quickshop||null;this.blog=object.blog||null;this.client_access=object.client_access||null;this.about=object.about||null;
2375this.contact=object.contact||null;this.header=object.header||null;this.featured=object.featured||null;this.guest_book=object.guest_book||null;this.login=object.login||null;
2376this.recent=object.recent||null;this.search=object.search||null;this.shop=object.shop||null;this.content=object.content||null;this.gallery=object.gallery||null;}function returnWebsiteCustomize(userInfo){if(!userInfo)return null;
2377return '[portfolio=none'+'|content='+userInfo.content||null+'|gallery='+userInfo.gallery||null+'|blog='+userInfo.blog||null+'|client_access='+userInfo.client_access||null+'|about='+userInfo.about||null+'|contact='+userInfo.contact||null+'|preset=none'+'|header='+userInfo.header||null+'|featured='+userInfo.featured||null+'|guest_book='+userInfo.guest_book||null+'|login='+userInfo.login||null+'|recent='+userInfo.recent||null+'|search='+userInfo.search||null+'|shop='+userInfo.shop||null+'|quickshop='+userInfo.quickshop||null+'|banner_enabled='+(zf_show
2377FeaturedProductsBanner?1:0)+']';
2378}var zf_gtm_userInfo;var zf_showFeaturedProductsBanner=false;var viewGallery;;var _gaq=_gaq||[],_gaqInit=false;function zf_Analytics(isGoogleAnalytics,propertyId,async,createParams){;
2379this._isUniversal=isGoogleAnalytics;if(isGoogleAnalytics)zf_Analytics.load(async);zf_Analytics.loadGA4(propertyId);if(propertyId!=null&&propertyId.length>0){this._propertyId=propertyId;
2380if(isGoogleAnalytics){createParams=$.extend({trackingId:propertyId,cookieDomain:'auto',allowLinker:true},createParams||{});__ga('create',$.extend({},createParams));
2381__ga('require','linker');__ga('linker:autoLink',[zf_cdnHost]);this._prefix=createParams.name?createParams.name+'.':'';}else{this._prefix=(createParams&&createParams.name)?createParams.name+'.':'';
2382_gaq.push([this._prefix+'_setAccount',propertyId]);_gaq.push([this._prefix+'_setAllowHash',false]);_gaq.push([this._prefix+'_setAllowLinker',true]);if(!_gaqInit){_gaqInit=true;
2383if(async)zf_stdDeferCall(null,zf_Analytics._load,null,true);else zf_Analytics._load(false);}}}}zf_Analytics.load=function(async){if('__ga' in window)return;if(async!==false)async=true;
2384var urlGA="//www.google-analytics.com/analytics.js";(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments);
2385};i[r].l=1*new Date();a=s.createElement(o);m=s.getElementsByTagName(o)[0];a.async=async;a.src=g;m.parentNode.insertBefore(a,m);})(window,document,'script',urlGA,
2386'__ga');};zf_Analytics.loadGA4=function(propertyId){if(!propertyId)return;var googleTag=propertyId;window.dataLayer=window.dataLayer||[];window.gtag=window.gtag||function(){window.dataLayer.push(arguments);
2387};window.gtag("js",new Date());window.gtag("config",googleTag);var script=document.createElement("script");script.type="text/javascript";script.async=true;script.src="//www.googletagmanager.com/gtag/js?id="+googleTag;
2388document.getElementsByTagName("head")[0].appendChild(script);};zf_Analytics.prototype.trackEvent=function(category,action,label,value,nonInteraction,sendDocumentPath,hitCallback){if(!this._isUniversal){return;
2389}if($.type(category)!=="string"){var object=category;category=object.category;action=object.action;label=object.label;value=object.value;nonInteraction=object.nonInteraction;
2390sendDocumentPath=object.sendDocumentPath;hitCallback=object.hitCallback;}var documentPath=sendDocumentPath?window.location.pathname+window.location.search+window.location.hash:null;
2391__ga(this._prefix+'send','event',{eventCategory:category,eventAction:action,eventLabel:label,eventValue:value,page:documentPath,nonInteraction:nonInteraction,hitCallback:hitCallback});
2392};zf_Analytics.prototype.trackPageView=function(path){if(this._propertyId!=null){;if(this._isUniversal){if(typeof path==='string')__ga(this._prefix+'send','pageview',path);else __ga(this._prefix+'send',
2393'pageview');}else{_gaq.push(typeof path==='string'?['_trackPageview',path]:['_trackPageview']);}}};zf_Analytics.prototype.setPage=function(path){if(this._propertyId!=null){;
2394if(this._isUniversal){__ga(this._prefix+'set','page',path);}}};zf_Analytics.prototype.getPropertyId=function(){return this._propertyId;};zf_Analytics.prototype.isUniversal=function(){return!!this._isUniversal;
2395};zf_Analytics._load=function(async){;var url=(("https:"==document.location.protocol)?"https://ssl.":"http://www.")+"google-analytics.com/ga.js";var ga=document.createElement('script');
2396ga.type='text/javascript';ga.async=async;ga.src=url;var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s);};var Zenfolio;(function(Zenfolio){var Global;
2397(function(Global){var AnalyticsTracker=(function(){function AnalyticsTracker(fieldsObject){if(fieldsObject&&fieldsObject.name){this._commandPrefix=fieldsObject.name+".";
2398}else{this._commandPrefix="";}if(!AnalyticsTracker._initializedAnalyticsTrackers){AnalyticsTracker._initializedAnalyticsTrackers={};}if(AnalyticsTracker._initializedAnalyticsTrackers[this._commandPrefix]){return;
2399}AnalyticsTracker._initializedAnalyticsTrackers[this._commandPrefix]=true;zf_Analytics.load(true);if(!fieldsObject){return;}__ga("create",AnalyticsTracker.loadClientId($.extend({cookieDomain:"auto",
2400allowLinker:true},fieldsObject)));AnalyticsTracker.saveClientId();this.require("linker");__ga(this._commandPrefix+"linker:autoLink",[zf_cdnHost]);}AnalyticsTracker.photographerHasAnalytics=function(){return typeof objGA!=="undefined"&&objGA.isUniversal();
2401};AnalyticsTracker.getFieldsObject=function(trackerCode){var trackerCodeString=AnalyticsTracker._getTrackerCodeString(trackerCode);
2401if(!trackerCodeString){return null;
2402}var fieldsObject=typeof zf_trackerObjects!=="undefined"&&zf_trackerObjects[trackerCodeString];if(!fieldsObject||!fieldsObject.trackingId){return null;}return fieldsObject;
2403};AnalyticsTracker.loadClientId=function(createParams){var gaClientId=zf_stdGetCookie("zf_ga_client_id");if(gaClientId){createParams.clientId=gaClientId;}return createParams;
2404};AnalyticsTracker.saveClientId=function(){var _this=this;if(typeof __ga==="undefined"||this._clientIdSaved){return;}__ga(function(tracker){if(tracker&&!_this._clientIdSaved){var clientId=tracker.get("clientId");
2405if(clientId&&typeof clientId==="string"){var expires=new Date();expires.setFullYear(expires.getFullYear()+2);zf_stdSetCookie("zf_ga_client_id",clientId,expires);
2406_this._clientIdSaved=true;}}});};AnalyticsTracker._getTrackerCodeString=function(trackerCode){switch(trackerCode){case TrackerCode.enhancedEcommerce:return "enhanced-ecommerce";
2407default:return null;}};AnalyticsTracker.prototype.require=function(pluginName){__ga(this._commandPrefix+"require",pluginName);};AnalyticsTracker.prototype.setPage=function(page){__ga(this._commandPrefix+"set",
2408"page",page);};AnalyticsTracker.prototype.setMetric=function(index,value){__ga(this._commandPrefix+"set","metric"+index,value);};AnalyticsTracker.prototype.send=function(fieldsObject,
2409onComplete){onComplete=this._wrapCallback(onComplete);if(onComplete){fieldsObject=$.extend({},fieldsObject,{hitCallback:onComplete});}__ga(this._commandPrefix+"send",
2410fieldsObject);if(onComplete){setTimeout(onComplete,2000);}};AnalyticsTracker.prototype.sendPageView=function(fieldsObject,onComplete){this.send($.extend({},fieldsObject,
2411{hitType:"pageview"}),onComplete);};AnalyticsTracker.prototype.sendEvent=function(fieldsObject,onComplete){this.send($.extend({},fieldsObject,{hitType:"event"}),
2412onComplete);};AnalyticsTracker.prototype._wrapCallback=function(callback){if(!callback){return null;}var alreadyCalled=false;return function(){if(!alreadyCalled){alreadyCalled=true;
2413callback();}};};return AnalyticsTracker;}());Global.AnalyticsTracker=AnalyticsTracker;var TrackerCode;(function(TrackerCode){TrackerCode[TrackerCode["enhancedEcommerce"]=0]="enhancedEcommerce";
2414})(TrackerCode=Global.TrackerCode||(Global.TrackerCode={}));})(Global=Zenfolio.Global||(Zenfolio.Global={}));})(Zenfolio||(Zenfolio={}));var Zenfolio;(function(Zenfolio){var Global;
2415(function(Global){var EcommerceCartProduct=(function(){function EcommerceCartProduct(){}return EcommerceCartProduct;}());Global.EcommerceCartProduct=EcommerceCartProduct;
2416})(Global=Zenfolio.Global||(Zenfolio.Global={}));})(Zenfolio||(Zenfolio={}));;var Zenfolio;(function(Zenfolio){var Global;(function(Global){var EcommercePurchaseData=(function(){function EcommercePurchaseData(){}return EcommercePurchaseData;
2417}());Global.EcommercePurchaseData=EcommercePurchaseData;})(Global=Zenfolio.Global||(Zenfolio.Global={}));})(Zenfolio||(Zenfolio={}));;var __extends=(this&&this.__extends)||(function(){var extendStatics=Object.setPrototypeOf||({__proto__:[]}instanceof Array&&function(d,
2418b){d.__proto__=b;})||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p];};return function(d,b){extendStatics(d,b);function __(){this.constructor=d;}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,
2419new __());};})();var Zenfolio;(function(Zenfolio){var Global;(function(Global){var EcommerceTracker=(function(_super){__extends(EcommerceTracker,_super);function EcommerceTracker(fieldsObject){var _this=_super.call(this,
2420fieldsObject)||this;if(!EcommerceTracker._initializedEcommerceTrackers){EcommerceTracker._initializedEcommerceTrackers={};}if(EcommerceTracker._initializedEcommerceTrackers[_this._commandPrefix]){return _this;
2421}EcommerceTracker._initializedEcommerceTrackers[_this._commandPrefix]=true;_this.require("ec");return _this;}EcommerceTracker.prototype.setCurrencyCode=function(currencyCode){__ga(this._commandPrefix+"set",
2422'currencyCode',currencyCode);};EcommerceTracker.prototype.addImpression=function(impressionData){__ga(this._commandPrefix+"ec:addImpression",impressionData);};EcommerceTracker.prototype.addProduct=function(productData){__ga(this._commandPrefix+"ec:addProduct",
2423productData);};EcommerceTracker.prototype.click=function(productList){__ga(this._commandPrefix+"ec:setAction","click",{list:this._getProductListName(productList)});
2424};EcommerceTracker.prototype.detail=function(productList){__ga(this._commandPrefix+"ec:setAction","detail",{list:this._getProductListName(productList)});};EcommerceTracker.prototype.add=function(productList){__ga(this._commandPrefix+"ec:setAction",
2425"add",{list:this._getProductListName(productList)});};EcommerceTracker.prototype.remove=function(){__ga(this._commandPrefix+"ec:setAction","remove");};EcommerceTracker.prototype.checkout=function(checkoutStep){__ga(this._commandPrefix+"ec:setAction",
2426"checkout",{step:checkoutStep});};EcommerceTracker.prototype.setCheckoutOption=function(checkoutStep,option){__ga(this._commandPrefix+"ec:setAction","checkout_option",
2427{step:checkoutStep,option:option});};EcommerceTracker.prototype.purchase=function(purchaseData){__ga(this._commandPrefix+"ec:setAction","purchase",purchaseData);
2428};EcommerceTracker.prototype.setCurrency=function(currency){this.setCurrencyCode(this._getCurrencyCode(currency));};EcommerceTracker.prototype.sendEcommercePageView=function(onComplete){this.sendPageView({page:this._getCurrentPage()},
2429onComplete);};EcommerceTracker.prototype.sendEcommerceEvent=function(ecommerceEventCategory,ecommerceEventAction,nonInteraction,onComplete){var eventData={page:this._getCurrentPage(),
2430eventCategory:this._getEcommerceEventCategoryName(ecommerceEventCategory),eventAction:this._getEcommerceEventActionName(ecommerceEventAction)};if(nonInteraction){eventData.nonInteraction=true;
2431}this.sendEvent(eventData,onComplete);};EcommerceTracker.prototype.addBuyButtonDropDownImpression=function(productInfo,currency,position){this.addImpression(this._getBuyButtonDropDownImpressionData(productInfo,
2432currency,position));};EcommerceTracker.prototype.addBuyButtonDropDownProduct=function(productInfo,currency,position){this.addProduct(this._getBuyButtonDropDownProductData(productInfo,
2433currency,position));};EcommerceTracker.prototype.addQuickShopProductsImpression=function(product,currency,position){this.addImpression(this._getQuickShopProductsImpressionData(product,
2434currency,position));};EcommerceTracker.prototype.addQuickShopProductsProduct=function(product,currency,position){this.addProduct(this._getQuickShopProductsProductData(product,
2435currency,position));};EcommerceTracker.prototype.addQuickShopSidebarImpression=function(product,currency,position){this.addImpression(this._getQuickShopSidebarImpressionData(product,
2436currency,position));};EcommerceTracker.prototype.addQuickShopSidebarProduct=function(product,currency,position){this.addProduct(this._getQuickShopSidebarProductData(product,
2437currency,position));};EcommerceTracker.prototype.addShopTopMenuImpression=function(product,currency,position){this.addImpression(this._getShopTopMenuImpressionData(product,
2438currency,position));};EcommerceTracker.prototype.addShopTopMenuProduct=function(product,currency,position){this.addProduct(this._getShopTopMenuProductData(product,
2439currency,position));};EcommerceTracker.prototype.addShopHomepagePackagesImpression=function(packageInfo,currency,position){this.addImpression(this._getShopHomepagePackagesImpressionData(packageInfo,
2440currency,position));};EcommerceTracker.prototype.addShopHomepagePackagesProduct=function(packageInfo,currency,position){this.addProduct(this._getShopHomepagePackagesProductData(packageInfo,
2441currency,position));};EcommerceTracker.prototype.addShopHomepageCategoriesImpression=function(productInfo,currency,position){this.addImpression(this._getShopHomepageCategoriesImpressionData(productInfo,
2442currency,position));};EcommerceTracker.prototype.addShopHomepageCategoriesProduct=function(productInfo,currency,position){this.addProduct(this._getShopHomepageCategoriesProductData(productInfo,
2443currency,position));};EcommerceTracker.prototype.addPackagesPageImpression=function(packageInfo,currency,position){this.addImpression(this._getPackagesPageImpressionData(packageInfo,
2444currency,position));};EcommerceTracker.prototype.addPackagesPageProduct=function(packageInfo,currency,position){this.addProduct(this._getPackagesPageProductData(packageInfo,
2445currency,position));};EcommerceTracker.prototype.addSubcategoryPageImpression=function(productInfo,currency,position){this.addImpression(this._getSubcategoryPageImpressionData(productInfo,
2446currency,position));};EcommerceTracker.prototype.addSubcategoryPageProduct=function(productInfo,currency,position){this.addProduct(this._getSubcategoryPageProductData(productInfo,
2447currency,position));};EcommerceTracker.prototype.addQuickProductProduct=function(protoItem,productInfo,currency,addQuantity){this.addProduct(this._getQuickProductProductData(protoItem,
2448productInfo,currency,addQuantity));};EcommerceTracker.prototype.addQuickPackageProduct=function(protoPackages,packageInfo,currency,addQuantity){this.addProduct(this._getQuickPackageProductData(protoPackages,
2449packageInfo,currency,addQuantity));};EcommerceTracker.prototype.addPackageEditorProduct=function(protoItem,productInfo,currency,addQuantity){this.addProduct(this._getPackageEditorProductData(protoItem,
2450productInfo,currency,addQuantity));};EcommerceTracker.prototype.addPackageEditorPackage=function(protoPackages,packageInfo,currency,addQuantity){this.addProduct(this._getPackageEditorPackageData(protoPackages,
2451packageInfo,currency,addQuantity));};EcommerceTracker.prototype.addChangeProductDropDownImpression=function(productInfo,currency,position){this.addImpression(this._getChangeProductDropDownImpressionData(productInfo,
2452currency,position));};EcommerceTracker.prototype.addChangeProductDropDownProduct=function(productInfo,currency,position){this.addProduct(this._getChangeProductDropDownProductData(productInfo,
2453currency,position));};EcommerceTracker.prototype.addProductSizesAndAttributesImpression=function(productInfo,currency,position){this.addImpression(this._getProductSizesAndAttributesImpressionData(productInfo,
2454currency,position));};EcommerceTracker.prototype.addProductSizesAndAttributesProduct=function(productInfo,currency,position){this.addProduct(this._getProductSizesAndAttributesProductData(productInfo,
2455currency,position));};EcommerceTracker.prototype.addProductEditorProduct=function(protoItem,productInfo,currency,addQuantity){this.addProduct(this._getProductEditorProductData(protoItem,
2456productInfo,currency,addQuantity));};EcommerceTracker.prototype.addShoppingCartProductImpression=function(cartProduct){this.addImpression(this._getShoppingCartProductImpressionData(cartProduct));
2457};EcommerceTracker.prototype.addShoppingCartProductProduct=function(cartProduct){this.addProduct(this._getShoppingCartProductProductData(cartProduct));};EcommerceTracker.prototype.buyButtonDropDownOpen=function(onComplete){this.sendEcommerceEvent(EcommerceEventCategory.BuyButtonDropDown,
2458EcommerceEventAction.BuyButtonDropDownOpen,false,onComplete);};EcommerceTracker.prototype.buyButtonDropDownClick=function(onComplete){this.click(ProductList.BuyButtonDropDown);
2459this.sendEcommerceEvent(EcommerceEventCategory.BuyButtonDropDown,EcommerceEventAction.BuyButtonDropDownClick,false,onComplete);};EcommerceTracker.prototype.quickShopProductsView=function(onComplete){this.sendEcommerceEvent(EcommerceEventCategory.Qu
2459ickShopProducts,
2460EcommerceEventAction.QuickShopProductsView,true,onComplete);};EcommerceTracker.prototype.quickShopProductsClick=function(onComplete){this.click(ProductList.QuickShopProducts);
2461this.sendEcommerceEvent(EcommerceEventCategory.QuickShopProducts,EcommerceEventAction.QuickShopProductsClick,false,onComplete);};EcommerceTracker.prototype.quickShopSidebarView=function(onComplete){this.sendEcommerceEvent(EcommerceEventCategory.QuickShopSidebar,
2462EcommerceEventAction.QuickShopSidebarView,true,onComplete);};EcommerceTracker.prototype.quickShopSidebarClick=function(onComplete){this.click(ProductList.QuickShopSidebar);
2463this.sendEcommerceEvent(EcommerceEventCategory.QuickShopSidebar,EcommerceEventAction.QuickShopSidebarClick,false,onComplete);};EcommerceTracker.prototype.shopTopMenuOpen=function(onComplete){this.sendEcommerceEvent(EcommerceEventCategory.ShopTopMenu,
2464EcommerceEventAction.ShopTopMenuOpen,false,onComplete);};EcommerceTracker.prototype.shopTopMenuClick=function(onComplete){this.click(ProductList.ShopTopMenu);this.sendEcommerceEvent(EcommerceEventCategory.ShopTopMenu,
2465EcommerceEventAction.ShopTopMenuClick,false,onComplete);};EcommerceTracker.prototype.shopHomepagePackagesView=function(onComplete){this.sendEcommerceEvent(EcommerceEventCategory.ShopHomepagePackages,
2466EcommerceEventAction.ShopHomepagePackagesView,true,onComplete);};EcommerceTracker.prototype.shopHomepagePackagesClick=function(onComplete){this.click(ProductList.ShopHomepagePackages);
2467this.sendEcommerceEvent(EcommerceEventCategory.ShopHomepagePackages,EcommerceEventAction.ShopHomepagePackagesClick,false,onComplete);};EcommerceTracker.prototype.shopHomepageCategoriesView=function(onComplete){this.sendEcommerceEvent(EcommerceEventCategory.ShopHomepageCategories,
2468EcommerceEventAction.ShopHomepageCategoriesView,true,onComplete);};EcommerceTracker.prototype.shopHomepageCategoriesClick=function(onComplete){this.click(ProductList.ShopHomepageCategories);
2469this.sendEcommerceEvent(EcommerceEventCategory.ShopHomepageCategories,EcommerceEventAction.ShopHomepageCategoriesClick,false,onComplete);};EcommerceTracker.prototype.packagesPageView=function(onComplete){this.sendEcommerceEvent(EcommerceEventCategory.PackagesPage,
2470EcommerceEventAction.PackagesPageView,true,onComplete);};EcommerceTracker.prototype.packagesPageClick=function(onComplete){this.click(ProductList.PackagesPage);this.sendEcommerceEvent(EcommerceEventCategory.PackagesPage,
2471EcommerceEventAction.PackagesPageClick,false,onComplete);};EcommerceTracker.prototype.subcategoryPageView=function(onComplete){this.sendEcommerceEvent(EcommerceEventCategory.SubcategoryPage,
2472EcommerceEventAction.SubcategoryPageView,true,onComplete);};EcommerceTracker.prototype.subcategoryPageClick=function(onComplete){this.click(ProductList.SubcategoryPage);
2473this.sendEcommerceEvent(EcommerceEventCategory.SubcategoryPage,EcommerceEventAction.SubcategoryPageClick,false,onComplete);};EcommerceTracker.prototype.quickProductOpen=function(productList,
2474onComplete){this.detail(productList);this.sendEcommerceEvent(EcommerceEventCategory.QuickProduct,EcommerceEventAction.QuickProductOpen,true,onComplete);};EcommerceTracker.prototype.quickProductAdd=function(productList,
2475onComplete){this.add(productList);this.sendEcommerceEvent(EcommerceEventCategory.QuickProduct,EcommerceEventAction.QuickProductAdd,true,onComplete);};EcommerceTracker.prototype.quickPackageOpen=function(productList,
2476onComplete){this.detail(productList);this.sendEcommerceEvent(EcommerceEventCategory.QuickPackage,EcommerceEventAction.QuickPackageOpen,true,onComplete);};EcommerceTracker.prototype.quickPackageAdd=function(productList,
2477onComplete){this.add(productList);this.sendEcommerceEvent(EcommerceEventCategory.QuickPackage,EcommerceEventAction.QuickPackageAdd,true,onComplete);};EcommerceTracker.prototype.packageEditorOpen=function(productList,
2478onComplete){this.detail(productList);this.sendEcommerceEvent(EcommerceEventCategory.PackageEditor,EcommerceEventAction.PackageEditorOpen,true,onComplete);};EcommerceTracker.prototype.packageEditorAdd=function(productList,
2479onComplete){this.add(productList);this.sendEcommerceEvent(EcommerceEventCategory.PackageEditor,EcommerceEventAction.PackageEditorAdd,false,onComplete);};EcommerceTracker.prototype.packageEditorRemoveOld=function(onComplete){this.remove();
2480this.sendEcommerceEvent(EcommerceEventCategory.PackageEditor,EcommerceEventAction.PackageEditorRemoveOld,true,onComplete);};EcommerceTracker.prototype.packageEditorSaveNew=function(productList,
2481onComplete){this.add(productList);this.sendEcommerceEvent(EcommerceEventCategory.PackageEditor,EcommerceEventAction.PackageEditorSaveNew,false,onComplete);};EcommerceTracker.prototype.changeProductDropDownOpen=function(eventCategory,
2482onComplete){this.sendEcommerceEvent(eventCategory,EcommerceEventAction.ChangeProductDropDownOpen,false,onComplete);};EcommerceTracker.prototype.changeProductDropDownClick=function(eventCategory,
2483onComplete){this.click(ProductList.ChangeProductDropDown);this.sendEcommerceEvent(eventCategory,EcommerceEventAction.ChangeProductDropDownClick,false,onComplete);
2484};EcommerceTracker.prototype.productSizesAndAttributesView=function(eventCategory,onComplete){this.sendEcommerceEvent(eventCategory,EcommerceEventAction.ProductSizesAndAttributesView,
2485true,onComplete);};EcommerceTracker.prototype.productSizesAndAttributesClick=function(eventCategory,onComplete){this.click(ProductList.ProductSizesAndAttributes);
2486this.sendEcommerceEvent(eventCategory,EcommerceEventAction.ProductSizesAndAttributesClick,false,onComplete);};EcommerceTracker.prototype.productEditorOpen=function(eventCategory,
2487productList,onComplete){this.detail(productList);this.sendEcommerceEvent(eventCategory,EcommerceEventAction.ProductEditorOpen,true,onComplete);};EcommerceTracker.prototype.productEditorAdd=function(eventCategory,
2488productList,onComplete){this.add(productList);this.sendEcommerceEvent(eventCategory,EcommerceEventAction.ProductEditorAdd,false,onComplete);};EcommerceTracker.prototype.productEditorRemoveOld=function(eventCategory,
2489onComplete){this.remove();this.sendEcommerceEvent(eventCategory,EcommerceEventAction.ProductEditorRemoveOld,true,onComplete);};EcommerceTracker.prototype.productEditorSaveNew=function(eventCategory,
2490productList,onComplete){this.add(productList);this.sendEcommerceEvent(eventCategory,EcommerceEventAction.ProductEditorSaveNew,false,onComplete);};EcommerceTracker.prototype.shoppingCartView=function(onComplete){this.sendEcommerceEvent(EcommerceEventCategory.ShoppingCart,
2491EcommerceEventAction.ShoppingCartView,true,onComplete);};EcommerceTracker.prototype.shoppingCartClick=function(onComplete){this.click(ProductList.ShoppingCart);this.sendEcommerceEvent(EcommerceEventCategory.ShoppingCart,
2492EcommerceEventAction.ShoppingCartClick,false,onComplete);};EcommerceTracker.prototype.shoppingCartRemove=function(onComplete){this.remove();this.sendEcommerceEvent(EcommerceEventCategory.ShoppingCart,
2493EcommerceEventAction.ShoppingCartRemove,false,onComplete);};EcommerceTracker.prototype.shoppingCartRemoveOldQuantity=function(onComplete){this.remove();this.sendEcommerceEvent(EcommerceEventCategory.ShoppingCart,
2494EcommerceEventAction.ShoppingCartRemoveOldQuantity,true,onComplete);};EcommerceTracker.prototype.shoppingCartSaveNewQuantity=function(onComplete){this.add(ProductList.ShoppingCart);
2495this.sendEcommerceEvent(EcommerceEventCategory.ShoppingCart,EcommerceEventAction.ShoppingCartSaveNewQuantity,false,onComplete);};EcommerceTracker.prototype.sendLoginType=function(loginType,
2496onComplete){this.setCheckoutOption(CheckoutStep.LoginPage,this._getLoginTypeName(loginType));this.sendEcommerceEvent(EcommerceEventCategory.Checkout,EcommerceEventAction.LoginPageLoginType,
2497true,onComplete);};EcommerceTracker.prototype.sendPaymentMethod=function(paymentMethod,onComplete){this.setCheckoutOption(CheckoutStep.PaymentsPage,this._getPaymentMethodName(paymentMethod));
2498this.sendEcommerceEvent(EcommerceEventCategory.Checkout,EcommerceEventAction.PaymentsPagePaymentMethod,true,onComplete);};EcommerceTracker.prototype.sendCheckoutPageOpen=function(checkoutStep,
2499onComplete){this.checkout(checkoutStep);this.sendEcommerceEvent(EcommerceEventCategory.Checkout,this._getCheckoutPageOpenAction(checkoutStep),true,onComplete);};
2500EcommerceTracker.prototype.sendPurchase=function(ecommercePurchaseData,idOnly,onComplete){var purchaseData={id:this._numberToString(ecommercePurchaseData.cartId)};
2501if(!idOnly){purchaseData.tax=this._numberToString(ecommercePurchaseData.taxAmount);purchaseData.shipping=this._numberToString(ecommercePurchaseData.shippingPrice);
2502if(ecommercePurchaseData.couponCode){purchaseData.coupon=ecommercePurchaseData.couponCode;}this.setMetric(1,ecommercePurchaseData.productDiscount);this.setMetric(2,
2503ecommercePurchaseData.shippingDiscount);}this.purchase(purchaseData);this.sendEcommerceEvent(EcommerceEventCategory.Checkout,EcommerceEventAction.Purchase,idOnly,
2504onComplete);if(!idOnly){this.setMetric(1,null);this.setMetric(2,null);}};EcommerceTracker.prototype._getCurrencyCode=function(currency){var currencyCode;if(currency instanceof zf_CurrencyInfo){currencyCode=currency&&currency.code;
2505}else{currencyCode=currency;}if(currencyCode){return currencyCode.toUpperCase();}return "USD";};EcommerceTracker.prototype._numberToString=function(value){return value!=null?value.toString():"";
2506};EcommerceTracker.prototype._getPathName=function(){var pathName=location.pathname;var categoryPagePrefix="/shop/category/";if(zf_stdStartsWith(pathName,categoryPagePrefix)){var separatorPosition=pathName.indexOf('/',
2507categoryPagePrefix.length);if(separatorPosition>=0){pathName=pathName.substring(0,separatorPosition);}}return pathName;};EcommerceTracker.prototype._getBuyButtonDropDownBaseData=function(productInfo,
2508_currency,position){return{price:this._numberToString(productInfo.customerPrice),position:position};};EcommerceTracker.prototype._getBuyButtonDropDownImpressionData=function(productInfo,
2509currency,position){var impressionData=this._getBuyButtonDropDownBaseData(productInfo,currency,position);impressionData.list=this._getProductListName(ProductList.BuyButtonDropDown);
2510return impressionData;};EcommerceTracker.prototype._getBuyButtonDropDownProductData=function(productInfo,currency,position){return this._getBuyButtonDropDownBaseData(productInfo,
2511currency,position);};EcommerceTracker.prototype._getQuickShopProductsBaseData=function(product,_currency,position){var baseData={price:this._numberToString(Global.ProductBrowserService.getDefaultProductPrice(product))};
2512if(position!=null){baseData.position=position;}return baseData;};EcommerceTracker.prototype._getQuickShopProductsImpressionData=function(product,currency,position){var impressionData=this._getQuickShopProductsBaseData(product,
2513currency,position);impressionData.list=this._getProductListName(ProductList.QuickShopProducts);return impressionData;};EcommerceTracker.prototype._getQuickShopProductsProductData=function(product,
2514currency,position){return this._getQuickShopProductsBaseData(product,currency,position);};EcommerceTracker.prototype._getQuickShopSidebarBaseData=function(product,
2515currency,position){return this._getQuickShopProductsBaseData(product,currency,position);};EcommerceTracker.prototype._getQuickShopSidebarImpressionData=function(product,
2516currency,position){var impressionData=this._getQuickShopSidebarBaseData(product,currency,position);impressionData.list=this._getProductListName(ProductList.QuickShopSidebar);
2517return impressionData;};EcommerceTracker.prototype._getQuickShopSidebarProductData=function(product,currency,position){return this._getQuickShopSidebarBaseData(product,
2518currency,position);};EcommerceTracker.prototype._getShopTopMenuBaseData=function(product,currency,position){return this._getQuickShopProductsBaseData(product,currency,
2519position);};EcommerceTracker.prototype._getShopTopMenuImpressionData=function(product,currency,position){var impressionData=this._getShopTopMenuBaseData(product,
2520currency,position);impressionData.list=this._getProductListName(ProductList.ShopTopMenu);return impressionData;};EcommerceTracker.prototype._getShopTopMenuProductData=function(product,
2521currency,position){return this._getShopTopMenuBaseData(product,currency,position);};EcommerceTracker.prototype._getShopHomepagePackagesBaseData=function(packageInfo,
2522currency,position){return this._getQuickShopProductsBaseData(packageInfo,currency,position);};EcommerceTracker.prototype._getShopHomepagePackagesImpressionData=function(packageInfo,
2523currency,position){var impressionData=this._getShopHomepagePackagesBaseData(packageInfo,currency,position);impressionData.list=this._getProductListName(ProductList.ShopHomepagePackages);
2524return impressionData;};EcommerceTracker.prototype._getShopHomepagePackagesProductData=function(packageInfo,currency,position){return this._getShopHomepagePackagesBaseData(packageInfo,
2525currency,position);};EcommerceTracker.prototype._getShopHomepageCategoriesBaseData=function(productInfo,currency,position){return this._getQuickShopProductsBaseData(productInfo,
2526currency,position);};EcommerceTracker.prototype._getShopHomepageCategoriesImpressionData=function(productInfo,currency,position){var impressionData=this._getShopHomepageCategoriesBaseData(productInfo,
2527currency,position);impressionData.list=this._getProductListName(ProductList.ShopHomepageCategories);return impressionData;};EcommerceTracker.prototype._getShopHomepageCategoriesProductData=function(productInfo,
2528currency,position){return this._getShopHomepageCategoriesBaseData(productInfo,currency,position);};EcommerceTracker.prototype._getPackagesPageBaseData=function(packageInfo,
2529currency,position){return this._getQuickShopProductsBaseData(packageInfo,currency,position);};EcommerceTracker.prototype._getPackagesPageImpressionData=function(packageInfo,
2530currency,position){var impressionData=this._getPackagesPageBaseData(packageInfo,currency,position);impressionData.list=this._getProductListName(ProductList.PackagesPage);
2531return impressionData;};EcommerceTracker.prototype._getPackagesPageProductData=function(packageInfo,currency,position){return this._getPackagesPageBaseData(packageInfo,
2532currency,position);};EcommerceTracker.prototype._getSubcategoryPageBaseData=function(productInfo,currency,position){return this._getQuickShopProductsBaseData(productInfo,
2533currency,position);};EcommerceTracker.prototype._getSubcategoryPageImpressionData=function(productInfo,currency,position){var impressionData=this._getSubcategoryPageBaseData(productInfo,
2534currency,position);impressionData.list=this._getProductListName(ProductList.SubcategoryPage);return impressionData;};EcommerceTracker.prototype._getSubcategoryPageProductData=function(productInfo,
2535currency,position){return this._getSubcategoryPageBaseData(productInfo,currency,position);};EcommerceTracker.prototype._getQuickProductProductData=function(protoItem,
2536productInfo,currency,addQuantity){var productData=this._getQuickShopProductsBaseData(productInfo,currency,null);if(addQuantity){productData.quantity=protoItem.quantity;
2537}return productData;};EcommerceTracker.prototype._getQuickPackageProductData=function(protoPackages,packageInfo,currency,addQuantity){var productData=this._getQuickShopProductsBaseData(packageInfo,
2538currency,null);if(addQuantity){productData.quantity=protoPackages[0].quantity;}return productData;};EcommerceTracker.prototype._getPackageEditorProductData=function(protoItem,
2539productInfo,_currency,addQuantity){var productData={price:this._numberToString(Global.ItemEditorService.getItemSubtotalNumbers(protoItem,productInfo).subtotal)};
2540if(addQuantity){productData.quantity=protoItem.quantity;}return productData;};EcommerceTracker.prototype._getPackageEditorPackageData=function(protoPackages,packageInfo,
2541_currency,addQuantity){var productData={price:this._numberToString(Global.ProductBrowserService.getProductPrice(packageInfo))};if(addQuantity){productData.quantity=protoPackages[0].quantity;
2542}return productData;};EcommerceTracker.prototype._getChangeProductDropDownBaseData=function(productInfo,currency,position){return this._getQuickShopProductsBaseData(productInfo,
2543currency,position);};EcommerceTracker.prototype._getChangeProductDropDownImpressionData=function(productInfo,currency,position){var impressionData=this._getChangeProductDropDownBaseData(productInfo,
2544currency,position);impressionData.list=this._getProductListName(ProductList.ChangeProductDropDown);return impressionData;};EcommerceTracker.prototype._getChangeProductDropDownProductData=function(productInfo,
2545currency,position){return this._getChangeProductDropDownBaseData(productInfo,currency,position);};EcommerceTracker.prototype._getProductSizesAndAttributesBaseData=function(productInfo,
2546currency,position){return this._getQuickShopProductsBaseData(productInfo,currency,position);};EcommerceTracker.prototype._getProductSizesAndAttributesImpressionData=function(productInfo,
2547currency,position){var impressionData=this._getProductSizesAndAttributesBaseData(productInfo,currency,position);impressionData.list=this._getProductListName(ProductList.ProductSizesAndAttributes);
2548return impressionData;};EcommerceTracker.prototype._getProductSizesAndAttributesProductData=function(productInfo,currency,position){return this._getProductSizesAndAttributesBaseData(productInfo,
2549currency,position);};EcommerceTracker.prototype._getProductEditorProductData=function(protoItem,productInfo,currency,addQuantity){return this._getPackageEditorProductData(protoItem,
2550productInfo,currency,addQuantity);};EcommerceTracker.prototype._getShoppingCartProductBaseData=function(cartProduct){return{price:this._numberToString(cartProduct.price),
2551position:cartProduct.position};};EcommerceTracker.prototype._getShoppingCartProductImpressionData=function(cartProduct){var impressionData=this._getShoppingCartProductBaseData(cartProduct);
2552impressionData.list=this._getProductListName(ProductList.ShoppingCart);return impressionData;};EcommerceTracker.prototype._getShoppingCartProductProductData=function(cartProduct){var productData=this._getShoppingCartProductBaseData(cartProduct);
2553productData.quantity=cartProduct.quantity;return productData;};EcommerceTracker.prototype._getCheckoutPageOpenAction=function(checkoutStep){switch(checkoutStep){case CheckoutStep.LoginPage:return EcommerceEventAction.LoginPageOpen;
2554case CheckoutStep.LicenseAgreement:return EcommerceEventAction.LicenseAgreementOpen;case CheckoutStep.ShippingAddressPage:return EcommerceEventAction.ShippingAddressPageOpen;
2555case CheckoutStep.DeliveryMethodsPage:return EcommerceEventAction.DeliveryMethodsPageOpen;case CheckoutStep.PaymentsPage:return EcommerceEventAction.PaymentsPageOpen;
2556case CheckoutStep.ReviewOrderPage:return EcommerceEventAction.ReviewOrderPageOpen;case CheckoutStep.ConfirmationPage:return EcommerceEventAction.ConfirmationPageOpen;
2557default:;return null;}};return EcommerceTracker;}(Global.AnalyticsTracker));Global.EcommerceTracker=EcommerceTracker;var ProductList;(function(ProductList){ProductList[ProductList["BuyButtonDropDown"]=1]="BuyButtonDropDown";
2558ProductList[ProductList["QuickShopProducts"]=2]="QuickShopProducts";ProductList[ProductList["QuickShopSidebar"]=3]="QuickShopSidebar";ProductList[ProductList["ShopTopMenu"]=4]="ShopTopMenu";
2559ProductList[ProductList["ShopHomepagePackages"]=5]="ShopHomepagePackages";ProductList[ProductList["ShopHomepageCategories"]=6]="ShopHomepageCategories";ProductList[ProductList["PackagesPage"]=7]="PackagesPage";
2560ProductList[ProductList["SubcategoryPage"]=8]="SubcategoryPage";ProductList[ProductList["ChangeProductDropDown"]=9]="ChangeProductDropDown";ProductList[ProductList["ProductSizesAndAttributes"]=10]="ProductSizesAndAttributes";
2561ProductList[ProductList["ShoppingCart"]=11]="ShoppingCart";})(ProductList=Global.ProductList||(Global.ProductList={}));var CheckoutStep;
2561(function(CheckoutStep){CheckoutStep[CheckoutStep["LoginPage"]=1]="LoginPage";
2562CheckoutStep[CheckoutStep["LicenseAgreement"]=2]="LicenseAgreement";CheckoutStep[CheckoutStep["ShippingAddressPage"]=3]="ShippingAddressPage";CheckoutStep[CheckoutStep["DeliveryMethodsPage"]=4]="DeliveryMethodsPage";
2563CheckoutStep[CheckoutStep["PaymentsPage"]=5]="PaymentsPage";CheckoutStep[CheckoutStep["ReviewOrderPage"]=6]="ReviewOrderPage";CheckoutStep[CheckoutStep["ConfirmationPage"]=7]="ConfirmationPage";
2564})(CheckoutStep=Global.CheckoutStep||(Global.CheckoutStep={}));var LoginType;(function(LoginType){LoginType[LoginType["ExistingAccountCheckout"]=1]="ExistingAccountCheckout";
2565LoginType[LoginType["NewAccountCheckout"]=2]="NewAccountCheckout";LoginType[LoginType["GuestCheckout"]=3]="GuestCheckout";})(LoginType=Global.LoginType||(Global.LoginType={}));
2566var PaymentMethod;(function(PaymentMethod){PaymentMethod[PaymentMethod["GiftCertificate"]=0]="GiftCertificate";PaymentMethod[PaymentMethod["ZenfolioCredit"]=1]="ZenfolioCredit";
2567PaymentMethod[PaymentMethod["PayPal"]=2]="PayPal";PaymentMethod[PaymentMethod["Visa"]=3]="Visa";PaymentMethod[PaymentMethod["MasterCard"]=4]="MasterCard";PaymentMethod[PaymentMethod["AmericanExpress"]=5]="AmericanExpress";
2568PaymentMethod[PaymentMethod["Discover"]=6]="Discover";})(PaymentMethod=Global.PaymentMethod||(Global.PaymentMethod={}));var EcommerceProductCategory;(function(EcommerceProductCategory){EcommerceProductCategory[EcommerceProductCategory["Packages"]=0]="Packages";
2569EcommerceProductCategory[EcommerceProductCategory["Downloads"]=1]="Downloads";EcommerceProductCategory[EcommerceProductCategory["SelfFulfilledProducts"]=2]="SelfFulfilledProducts";
2570EcommerceProductCategory[EcommerceProductCategory["VendorPrints"]=3]="VendorPrints";EcommerceProductCategory[EcommerceProductCategory["OtherVendorProducts"]=4]="OtherVendorProducts";
2571EcommerceProductCategory[EcommerceProductCategory["Backgrounds"]=5]="Backgroun
2571ds";})(EcommerceProductCategory=Global.EcommerceProductCategory||(Global.EcommerceProductCategory={}));
2572var EcommerceEventCategory;(function(EcommerceEventCategory){EcommerceEventCategory[EcommerceEventCategory["BuyButtonDropDown"]=0]="BuyButtonDropDown";EcommerceEventCategory[EcommerceEventCategory["QuickShopProducts"]=1]="QuickShopProducts";
2573EcommerceEventCategory[EcommerceEventCategory["QuickShopSidebar"]=2]="QuickShopSidebar";EcommerceEventCategory[EcommerceEventCategory["ShopTopMenu"]=3]="ShopTopMenu";
2574EcommerceEventCategory[EcommerceEventCategory["ShopHomepagePackages"]=4]="ShopHomepagePackages";EcommerceEventCategory[EcommerceEventCategory["ShopHomepageCategories"]=5]="ShopHomepageCategories";
2575EcommerceEventCategory[EcommerceEventCategory["PackagesPage"]=6]="PackagesPage";EcommerceEventCategory[EcommerceEventCategory["SubcategoryPage"]=7]="SubcategoryPage";
2576EcommerceEventCategory[EcommerceEventCategory["QuickProduct"]=8]="QuickProduct";EcommerceEventCategory[EcommerceEventCategory["QuickPackage"]=9]="QuickPackage";EcommerceEventCategory[EcommerceEventCategory["PackageEditor"]=10]="PackageEditor";
2577EcommerceEventCategory[EcommerceEventCategory["ProductPage"]=11]="ProductPage";EcommerceEventCategory[EcommerceEventCategory["QuickShopProductPopup"]=12]="QuickShopProductPopup";
2578EcommerceEventCategory[EcommerceEventCategory["ShoppingCartProductPopup"]=13]="ShoppingCartProductPopup";EcommerceEventCategory[EcommerceEventCategory["ShoppingCart"]=14]="ShoppingCart";
2579EcommerceEventCategory[EcommerceEventCategory["Checkout"]=15]="Checkout";})(EcommerceEventCategory=Global.EcommerceEventCategory||(Global.EcommerceEventCategory={}));
2580var EcommerceEventAction;(function(EcommerceEventAction){EcommerceEventAction[EcommerceEventAction["BuyButtonDropDownOpen"]=0]="BuyButtonDropDownOpen";EcommerceEventAction[EcommerceEventAction["BuyButtonDropDownClick"]=1]="BuyButtonDropDownClick";
2581EcommerceEventAction[EcommerceEventAction["QuickShopProductsView"]=2]="QuickShopProductsView";EcommerceEventAction[EcommerceEventAction["QuickShopProductsClick"]=3]="QuickShopProductsClick";
2582EcommerceEventAction[EcommerceEventAction["QuickShopSidebarView"]=4]="QuickShopSidebarView";EcommerceEventAction[EcommerceEventAction["QuickShopSidebarClick"]=5]="QuickShopSidebarClick";
2583EcommerceEventAction[EcommerceEventAction["ShopTopMenuOpen"]=6]="ShopTopMenuOpen";EcommerceEventAction[EcommerceEventAction["ShopTopMenuClick"]=7]="ShopTopMenuClick";
2584EcommerceEventAction[EcommerceEventAction["ShopHomepagePackagesView"]=8]="ShopHomepagePackagesView";EcommerceEventAction[EcommerceEventAction["ShopHomepagePackagesClick"]=9]="ShopHomepagePackagesClick";
2585EcommerceEventAction[EcommerceEventAction["ShopHomepageCategoriesView"]=10]="ShopHomepageCategoriesView";EcommerceEventAction[EcommerceEventAction["ShopHomepageCategoriesClick"]=11]="ShopHomepageCategoriesClick";
2586EcommerceEventAction[EcommerceEventAction["PackagesPageView"]=12]="PackagesPageView";EcommerceEventAction[EcommerceEventAction["PackagesPageClick"]=13]="PackagesPageClick";
2587EcommerceEventAction[EcommerceEventAction["SubcategoryPageView"]=14]="SubcategoryPageView";EcommerceEventAction[EcommerceEventAction["SubcategoryPageClick"]=15]="SubcategoryPageClick";
2588EcommerceEventAction[EcommerceEventAction["QuickProductOpen"]=16]="QuickProductOpen";EcommerceEventAction[EcommerceEventAction["QuickProductAdd"]=17]="QuickProductAdd";
2589EcommerceEventAction[EcommerceEventAction["QuickPackageOpen"]=18]="QuickPackageOpen";EcommerceEventAction[EcommerceEventAction["QuickPackageAdd"]=19]="QuickPackageAdd";
2590EcommerceEventAction[EcommerceEventAction["PackageEditorOpen"]=20]="PackageEditorOpen";EcommerceEventAction[EcommerceEventAction["PackageEditorAdd"]=21]="PackageEditorAdd";
2591EcommerceEventAction[EcommerceEventAction["PackageEditorRemoveOld"]=22]="PackageEditorRemoveOld";EcommerceEventAction[EcommerceEventAction["PackageEditorSaveNew"]=23]="PackageEditorSaveNew";
2592EcommerceEventAction[EcommerceEventAction["ChangeProductDropDownOpen"]=24]="ChangeProductDropDownOpen";EcommerceEventAction[EcommerceEventAction["ChangeProductDropDownClick"]=25]="ChangeProductDropDownClick";
2593EcommerceEventAction[EcommerceEventAction["ProductSizesAndAttributesView"]=26]="ProductSizesAndAttributesView";EcommerceEventAction[EcommerceEventAction["ProductSizesAndAttributesClick"]=27]="ProductSizesAndAttributesClick";
2594EcommerceEventAction[EcommerceEventAction["ProductEditorOpen"]=28]="ProductEditorOpen";EcommerceEventAction[EcommerceEventAction["ProductEditorAdd"]=29]="ProductEditorAdd";
2595EcommerceEventAction[EcommerceEventAction["ProductEditorRemoveOld"]=30]="ProductEditorRemoveOld";EcommerceEventAction[EcommerceEventAction["ProductEditorSaveNew"]=31]="ProductEditorSaveNew";
2596EcommerceEventAction[EcommerceEventAction["ShoppingCartView"]=32]="ShoppingCartView";EcommerceEventAction[EcommerceEventAction["ShoppingCartClick"]=33]="ShoppingCartClick";
2597EcommerceEventAction[EcommerceEventAction["ShoppingCartRemove"]=34]="ShoppingCartRemove";EcommerceEventAction[EcommerceEventAction["ShoppingCartRemoveOldQuantity"]=35]="ShoppingCartRemoveOldQuantity";
2598EcommerceEventAction[EcommerceEventAction["ShoppingCartSaveNewQuantity"]=36]="ShoppingCartSaveNewQuantity";EcommerceEventAction[EcommerceEventAction["LoginPageOpen"]=37]="LoginPageOpen";
2599EcommerceEventAction[EcommerceEventAction["LoginPageLoginType"]=38]="LoginPageLoginType";EcommerceEventAction[EcommerceEventAction["LicenseAgreementOpen"]=39]="LicenseAgreementOpen";
2600EcommerceEventAction[EcommerceEventAction["ShippingAddressPageOpen"]=40]="ShippingAddressPageOpen";EcommerceEventAction[EcommerceEventAction["DeliveryMethodsPageOpen"]=41]="DeliveryMethodsPageOpen";
2601EcommerceEventAction[EcommerceEventAction["PaymentsPageOpen"]=42]="PaymentsPageOpen";EcommerceEventAction[EcommerceEventAction["PaymentsPagePaymentMethod"]=43]="PaymentsPagePaymentMethod";
2602EcommerceEventAction[EcommerceEventAction["ReviewOrderPageOpen"]=44]="ReviewOrderPageOpen";EcommerceEventAction[EcommerceEventAction["ConfirmationPageOpen"]=45]="ConfirmationPageOpen";
2603EcommerceEventAction[EcommerceEventAction["Purchase"]=46]="Purchase";})(EcommerceEventAction=Global.EcommerceEventAction||(Global.EcommerceEventAction={}));})(Global=Zenfolio.Global||(Zenfolio.Global={}));
2604})(Zenfolio||(Zenfolio={}));;var __extends=(this&&this.__extends)||(function(){var extendStatics=Object.
2604setPrototypeOf||({__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b;
2605})||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p];};return function(d,b){extendStatics(d,b);function __(){this.constructor=d;}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,
2606new __());};})();var Zenfolio;(function(Zenfolio){var Global;(function(Global){var PhotographerEcommerceTracker=(function(_super){__extends(PhotographerEcommerceTracker,
2607_super);function PhotographerEcommerceTracker(){return _super.call(this)||this;}Object.defineProperty(PhotographerEcommerceTracker,"instance",{get:function(){if(typeof this._instance==="undefined"){this._instance=Global.AnalyticsTracker.photographerHasAnalytics()?new PhotographerEcommerceTracker():null;
2608}return this._instance;},enumerable:true,configurable:true});PhotographerEcommerceTracker.prototype._getProductListName=function(productList){switch(productList){case Global.ProductList.BuyButtonDropDown:return "Buy Button Drop-Down";
2609case Global.ProductList.QuickShopProducts:return "Quick Shop Products";case Global.ProductList.QuickShopSidebar:return "Quick Shop Sidebar";case Global.ProductList.ShopTopMenu:return "Shop Top Menu";
2610case Global.ProductList.ShopHomepagePackages:return "Shop Homepage Packages";case Global.ProductList.ShopHomepageCategories:return "Shop Homepage Categories";case Global.ProductList.PackagesPage:return "Packages Page";
2611case Global.ProductList.SubcategoryPage:return "Subcategory Page";case Global.ProductList.ChangeProductDropDown:return "Change Product Drop-Down";case Global.ProductList.ProductSizesAndAttributes:return "Product Sizes And Attributes";
2612case Global.ProductList.ShoppingCart:return "Shopping Cart";default:;return null;}};PhotographerEcommerceTracker.prototype._getPaymentMethodName=function(paymentMethod){switch(paymentMethod){case Global.PaymentMethod.GiftCertificate:return "Gift Certificate";
2613case Global.PaymentMethod.ZenfolioCredit:return "Zenfolio Credit";case Global.PaymentMethod.PayPal:return "PayPal";case Global.PaymentMethod.Visa:return "Visa";case Global.PaymentMethod.MasterCard:return "Master Card";
2614case Global.PaymentMethod.AmericanExpress:return "American Express";case Global.PaymentMethod.Discover:return "Discover";default:;return null;}};PhotographerEcommerceTracker.prototype._getLoginTypeName=function(loginType){switch(loginType){case Global.LoginType.ExistingAccountCheckout:return "Existing Account Checkout";
2615case Global.LoginType.NewAccountCheckout:return "New Account Checkout";case Global.LoginType.GuestCheckout:return "Guest Checkout";default:;return null;}};PhotographerEcommerceTracker.prototype._getEcommerceEventCategoryName=function(ecommerceEventCategory){switch(ecommerceEventCategory){case Global.EcommerceEventCategory.BuyButtonDropDown:return "Buy Button Drop-Down";
2616case Global.EcommerceEventCategory.QuickShopProducts:return "Quick Shop Products";case Global.EcommerceEventCategory.QuickShopSidebar:return "Quick Shop Sidebar";
2617case Global.EcommerceEventCategory.ShopTopMenu:return "Shop Top Menu";case Global.EcommerceEventCategory.ShopHomepagePackages:return "Shop Homepage Packages";case Global.EcommerceEventCategory.ShopHomepageCategories:return "Shop Homepage Categories";
2618case Global.EcommerceEventCategory.PackagesPage:return "Packages Page";case Global.EcommerceEventCategory.SubcategoryPage:return "Subcategory Page";case Global.EcommerceEventCategory.QuickProduct:return "Quick Product";
2619case Global.EcommerceEventCategory.QuickPackage:return "Quick Package";case Global.EcommerceEventCategory.PackageEditor:return "Package Editor";case Global.EcommerceEventCategory.ProductPage:return "Product Page";
2620case Global.EcommerceEventCategory.QuickShopProductPopup:return "Quick Shop Product Popup";case Global.EcommerceEventCategory.ShoppingCartProductPopup:return "Shopping Cart Product Popup";
2621case Global.EcommerceEventCategory.ShoppingCart:return "Shopping Cart";case Global.EcommerceEventCategory.Checkout:return "Checkout";default:;return null;}};PhotographerEcommerceTracker.prototype._getEcommerceEventActionName=function(ecommerceEventAction){switch(ecommerceEventAction){case Global.EcommerceEventAction.BuyButtonDropDownOpen:return "Buy Button Drop-Down - Open";
2622case Global.EcommerceEventAction.BuyButtonDropDownClick:return "Buy Button Drop-Down - Click";case Global.EcommerceEventAction.QuickShopProductsView:return "Quick Shop Products - View";
2623case Global.EcommerceEventAction.QuickShopProductsClick:return "Quick Shop Products - Click";case Global.EcommerceEventAction.QuickShopSidebarView:return "Quick Shop Sidebar - View";
2624case Global.EcommerceEventAction.QuickShopSidebarClick:return "Quick Shop Sidebar - Click";case Global.EcommerceEventAction.ShopTopMenuOpen:return "Shop Top Menu - Open";
2625case Global.EcommerceEventAction.ShopTopMenuClick:return "Shop Top Menu - Click";case Global.EcommerceEventAction.ShopHomepagePackagesView:return "Shop Homepage Packages - View";
2626case Global.EcommerceEventAction.ShopHomepagePackagesClick:return "Shop Homepage Packages - Click";case Global.EcommerceEventAction.ShopHomepageCategoriesView:return "Shop Homepage Categories - View";
2627case Global.EcommerceEventAction.ShopHomepageCategoriesClick:return "Shop Homepage Categories - Click";case Global.EcommerceEventAction.PackagesPageView:return "Packages Page - View";
2628case Global.EcommerceEventAction.PackagesPageClick:return "Packages Page - Click";case Global.EcommerceEventAction.SubcategoryPageView:return "Subcategory Page - View";
2629case Global.EcommerceEventAction.SubcategoryPageClick:return "Subcategory Page - Click";case Global.EcommerceEventAction.QuickProductOpen:return "Quick Product - Open";
2630case Global.EcommerceEventAction.QuickProductAdd:return "Quick Product - Add";case Global.EcommerceEventAction.QuickPackageOpen:return "Quick Package - Open";case Global.EcommerceEventAction.QuickPackageAdd:return "Quick Package - Add";
2631case Global.EcommerceEventAction.PackageEditorOpen:return "Package Editor - Open";case Global.EcommerceEventAction.PackageEditorAdd:return "Package Editor - Add";
2632case Global.EcommerceEventAction.PackageEditorRemoveOld:return "Package Editor - Remove Old";case Global.EcommerceEventAction.PackageEditorSaveNew:return "Package Editor - Save New";
2633case Global.EcommerceEventAction.ChangeProductDropDownOpen:return "Change Product Drop-Down - Open";case Global.EcommerceEventAction.ChangeProductDropDownClick:return "Change Product Drop-Down - Click";
2634case Global.EcommerceEventAction.ProductSizesAndAttributesView:return "Product Sizes And Attributes - View";case Global.EcommerceEventAction.ProductSizesAndAttributesClick:return "Product Sizes And Attributes - Click";
2635case Global.EcommerceEventAction.ProductEditorOpen:return "Product Editor - Open";case Global.EcommerceEventAction.ProductEditorAdd:return "Product Editor - Add";
2636case Global.EcommerceEventAction.ProductEditorRemoveOld:return "Product Editor - Remove Old";case Global.EcommerceEventAction.ProductEditorSaveNew:return "Product Editor - Save New";
2637case Global.EcommerceEventAction.ShoppingCartView:return "Shopping Cart - View";case Global.EcommerceEventAction.ShoppingCartClick:return "Shopping Cart - Click";
2638case Global.EcommerceEventAction.ShoppingCartRemove:return "Shopping Cart - Remove";case Global.EcommerceEventAction.ShoppingCartRemoveOldQuantity:return "Shopping Cart - Remove Old Quantity";
2639case Global.EcommerceEventAction.ShoppingCartSaveNewQuantity:return "Shopping Cart - Save New Quantity";case Global.EcommerceEventAction.LoginPageOpen:return "Login Page - Open";
2640case Global.EcommerceEventAction.LoginPageLoginType:return "Login Page - Login Type";case Global.EcommerceEventAction.LicenseAgreementOpen:return "License Agreement - Open";
2641case Global.EcommerceEventAction.ShippingAddressPageOpen:return "Shipping Address Page - Open";case Global.EcommerceEventAction.DeliveryMethodsPageOpen:return "Delivery Methods Page - Open";
2642case Global.EcommerceEventAction.PaymentsPageOpen:return "Payments Page - Open";case Global.EcommerceEventAction.PaymentsPagePaymentMethod:return "Payments Page - Select Payment Method";
2643case Global.EcommerceEventAction.ReviewOrderPageOpen:return "Review Order Page - Open";case Global.EcommerceEventAction.ConfirmationPageOpen:return "Confirmation Page - Open";
2644case Global.EcommerceEventAction.Purchase:return "Purchase";default:;return null;}};PhotographerEcommerceTracker.prototype._getEcommerceProductCategoryName=function(ecommerceProductCategory){switch(ecommerceProductCategory){case Global.EcommerceProductCategory.Packages:return "Packages";
2645case Global.EcommerceProductCategory.Downloads:return "Downloads";case Global.EcommerceProductCategory.SelfFulfilledProducts:return "Self-Fulfilled Products";case Global.EcommerceProductCategory.VendorPrints:return "Vendor Prints";
2646case Global.EcommerceProductCategory.OtherVendorProducts:return "Other Vendor Products";
2646case Global.EcommerceProductCategory.Backgrounds:return "Backgrounds";default:;
2647return null;}};PhotographerEcommerceTracker.prototype._getCurrentPage=function(){return this._getPathName();};PhotographerEcommerceTracker.prototype._getBuyButtonDropDownBaseData=function(productInfo,
2648currency,position){var vendorName=this._wrapVendorName(productInfo.vendorName),baseData=_super.prototype._getBuyButtonDropDownBaseData.call(this,productInfo,currency,
2649position);baseData.name=this._getProductName(vendorName,productInfo.name);baseData.brand=vendorName;baseData.category=this._getEcommerceProductCategoryName(productInfo.ecommerceProductCategory);
2650baseData.variant=this._wrapOptionName(productInfo.optionName);this._fillCustomData(baseData,currency);return baseData;};PhotographerEcommerceTracker.prototype._getQuickShopProductsBaseData=function(product,
2651currency,position){var vendorName=this._wrapVendorName(product.vendor.isCustom?null:product.vendor.meta().name),baseData=_super.prototype._getQuickShopProductsBaseData.call(this,
2652product,currency,position);baseData.name=this._getProductName(vendorName,product.meta().name);baseData.brand=vendorName;baseData.category=this._getEcommerceProductCategoryName(product.ecommerceProductCategory);
2653if(Global.ConfiguratorService.isPackage(product)){baseData.variant=this._getPriceListPackageVariant(product);}else{baseData.variant=this._wrapOptionName(this._getPriceListProductVariant(product,
2654product.defaultOptionId));}this._fillCustomData(baseData,currency);return baseData;};PhotographerEcommerceTracker.prototype._getPackageEditorProductData=function(protoItem,
2655productInfo,currency,addQuantity){var vendorName=this._wrapVendorName(productInfo.vendor.isCustom?null:productInfo.vendor.meta().name),productData=_super.prototype._getPackageEditorProductData.call(this,
2656protoItem,productInfo,currency,addQuantity);productData.name=this._getProductName(vendorName,productInfo.meta().name);productData.brand=vendorName;productData.category=this._getEcommerceProductCategoryName(productInfo.ecommerceProductCategory);
2657productData.variant=this._wrapOptionName(this._getPriceListProductVariant(productInfo,protoItem.optionId));this._fillCustomData(productData,currency);return productData;
2658};PhotographerEcommerceTracker.prototype._getPackageEditorPackageData=function(protoPackages,packageInfo,currency,addQuantity){var vendorName=this._wrapVendorName(null),
2659productData=_super.prototype._getPackageEditorPackageData.call(this,protoPackages,packageInfo,currency,addQuantity);productData.name=this._getProductName(vendorName,
2660packageInfo.meta().name);productData.brand=vendorName;productData.category=this._getEcommerceProductCategoryName(packageInfo.ecommerceProductCategory);productData.variant=this._getPriceListPackageVariant(packageInfo);
2661this._fillCustomData(productData,currency);return productData;};PhotographerEcommerceTracker.prototype._getShoppingCartProductBaseData=function(cartProduct){var vendorName=this._wrapVendorName(cartProduct.vendorName),
2662baseData=_super.prototype._getShoppingCartProductBaseData.call(this,cartProduct);baseData.name=this._getProductName(vendorName,cartProduct.name);baseData.brand=vendorName;
2663baseData.category=this._getEcommerceProductCategoryName(cartProduct.ecommerceProductCategory);if(cartProduct.isPackage){baseData.variant=this._getPackageImageCountString(cartProduct.isSingleImage);
2664}else{baseData.variant=this._wrapOptionName(cartProduct.optionName);}this._fillCustomData(baseData,cartProduct.currencyCode);return baseData;};PhotographerEcommerceTracker.prototype._fillCustomData=function(baseData,
2665currency){baseData.dimension1=zf_viewerEmail||"Guest";baseData.dimension2=this._getCurrencyCode(currency);};PhotographerEcommerceTracker.prototype._wrapOptionName=function(optionName){return optionName?optionName:"Default";
2666};PhotographerEcommerceTracker.prototype._wrapVendorName=function(vendorName){return vendorName?vendorName:"Custom";};PhotographerEcommerceTracker.prototype._getPriceListProductVariant=function(productInfo,
2667optionId){var productOption=optionId&&productInfo.options&&productInfo.options[optionId];return productOption&&productOption.meta().altName;};PhotographerEcommerceTracker.prototype._getPriceListPackageVariant=function(packageInfo){return this._getPackageImageCountStr
2667ing(packageInfo.meta().isSingleImage);
2668};PhotographerEcommerceTracker.prototype._getPackageImageCountString=function(isSingleImage){return isSingleImage?"Single-Image Package":"Multi-Image Package";};
2669PhotographerEcommerceTracker.prototype._getProductName=function(vendorName,productName){return vendorName+" - "+productName;};return PhotographerEcommerceTracker;
2670}(Global.EcommerceTracker));Global.PhotographerEcommerceTracker=PhotographerEcommerceTracker;})(Global=Zenfolio.Global||(Zenfolio.Global={}));})(Zenfolio||(Zenfolio={}));
2671;var __extends=(this&&this.__extends)||(function(){var extendStatics=Object.setPrototypeOf||({__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b;})||function(d,
2672b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p];};return function(d,b){extendStatics(d,b);function __(){this.constructor=d;}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,
2673new __());};})();var Zenfolio;(function(Zenfolio){var Global;(function(Global){var ZenfolioEcommerceTracker=(function(_super){__extends(ZenfolioEcommerceTracker,_super);
2674function ZenfolioEcommerceTracker(fieldsObject){return _super.call(this,fieldsObject)||this;}Object.defineProperty(ZenfolioEcommerceTracker,"instance",{get:function(){if(typeof this._instance==="undefined"){var fieldsObject=Global.AnalyticsTracker.getFieldsObject(Global.TrackerCode.enhancedEcommerce);
2675this._instance=fieldsObject?new ZenfolioEcommerceTracker(fieldsObject):null;}return this._instance;},enumerable:true,configurable:true});ZenfolioEcommerceTracker.prototype._getProductListName=function(productList){switch(productList){case Global.ProductList.BuyButtonDropDown:return "Buy Button Drop-Down";
2676case Global.ProductList.QuickShopProducts:return "Quick Shop Products";case Global.ProductList.QuickShopSidebar:return "Quick Shop Sidebar";case Global.ProductList.ShopTopMenu:return "Shop Top Menu";
2677case Global.ProductList.ShopHomepagePackages:return "Shop Homepage Packages";case Global.ProductList.ShopHomepageCategories:return "Shop Homepage Categories";case Global.ProductList.PackagesPage:return "Packages Page";
2678case Global.ProductList.SubcategoryPage:return "Subcategory Page";case Global.ProductList.ChangeProductDropDown:return "Change Product Drop-Down";case Global.ProductList.ProductSizesAndAttributes:return "Product Sizes And Attributes";
2679case Global.ProductList.ShoppingCart:return "Shopping Cart";default:;return null;}};ZenfolioEcommerceTracker.prototype._getPaymentMethodName=function(paymentMethod){switch(paymentMethod){case Global.PaymentMethod.GiftCertificate:return "Gift Certificate";
2680case Global.PaymentMethod.ZenfolioCredit:return "Zenfolio Credit";case Global.PaymentMethod.PayPal:return "PayPal";case Global.PaymentMethod.Visa:return "Visa";case Global.PaymentMethod.MasterCard:return "Master Card";
2681case Global.PaymentMethod.AmericanExpress:return "American Express";case Global.PaymentMethod.Discover:return "Discover";default:;return null;}};ZenfolioEcommerceTracker.prototype._getLoginTypeName=function(loginType){switch(loginType){case Global.LoginType.ExistingAccountCheckout:return "Existing Account Checkout";
2682case Global.LoginType.NewAccountCheckout:return "New Account Checkout";case Global.LoginType.GuestCheckout:return "Guest Checkout";default:;return null;}};ZenfolioEcommerceTracker.prototype._getEcommerceEventCategoryName=function(ecommerceEventCategory){switch(ecommerceEventCategory){case Global.EcommerceEventCategory.BuyButtonDropDown:return "Buy Button Drop-Down";
2683case Global.EcommerceEventCategory.QuickShopProducts:return "Quick Shop Products";case Global.EcommerceEventCategory.QuickShopSidebar:return "Quick Shop Sidebar";
2684case Global.EcommerceEventCategory.ShopTopMenu:return "Shop Top Menu";case Global.EcommerceEventCategory.ShopHomepagePackages:return "Shop Homepage Packages";case Global.EcommerceEventCategory.ShopHomepageCategories:return "Shop Homepage Categories";
2685case Global.EcommerceEventCategory.PackagesPage:return "Packages Page";case Global.EcommerceEventCategory.SubcategoryPage:return "Subcategory Page";
2685case Global.EcommerceEventCategory.QuickProduct:return "Quick Product";
2686case Global.EcommerceEventCategory.QuickPackage:return "Quick Package";case Global.EcommerceEventCategory.PackageEditor:return "Package Editor";case Global.EcommerceEventCategory.ProductPage:return "Product Page";
2687case Global.EcommerceEventCategory.QuickShopProductPopup:return "Quick Shop Product Popup";case Global.EcommerceEventCategory.ShoppingCartProductPopup:return "Shopping Cart Product Popup";
2688case Global.EcommerceEventCategory.ShoppingCart:return "Shopping Cart";case Global.EcommerceEventCategory.Checkout:return "Checkout";default:;return null;}};ZenfolioEcommerceTracker.prototype._getEcommerceEventActionName=function(ecommerceEventAction){switch(ecommerceEventAction){case Global.EcommerceEventAction.BuyButtonDropDownOpen:return "Buy Button Drop-Down - Open";
2689case Global.EcommerceEventAction.BuyButtonDropDownClick:return "Buy Button Drop-Down - Click";case Global.EcommerceEventAction.QuickShopProductsView:return "Quick Shop Products - View";
2690case Global.EcommerceEventAction.QuickShopProductsClick:return "Quick Shop Products - Click";case Global.EcommerceEventAction.QuickShopSidebarView:return "Quick Shop Sidebar - View";
2691case Global.EcommerceEventAction.QuickShopSidebarClick:return "Quick Shop Sidebar - Click";case Global.EcommerceEventAction.ShopTopMenuOpen:return "Shop Top Menu - Open";
2692case Global.EcommerceEventAction.ShopTopMenuClick:return "Shop Top Menu - Click";case Global.EcommerceEventAction.ShopHomepagePackagesView:return "Shop Homepage Packages - View";
2693case Global.EcommerceEventAction.ShopHomepagePackagesClick:return "Shop Homepage Packages - Click";case Global.EcommerceEventAction.ShopHomepageCategoriesView:return "Shop Homepage Categories - View";
2694case Global.EcommerceEventAction.ShopHomepageCategoriesClick:return "Shop Homepage Categories - Click";case Global.EcommerceEventAction.PackagesPageView:return "Packages Page - View";
2695case Global.EcommerceEventAction.PackagesPageClick:return "Packages Page - Click";case Global.EcommerceEventAction.SubcategoryPageView:return "Subcategory Page - View";
2696case Global.EcommerceEventAction.SubcategoryPageClick:return "Subcategory Page - Click";case Global.EcommerceEventAction.QuickProductOpen:return "Quick Product - Open";
2697case Global.EcommerceEventAction.QuickProductAdd:return "Quick Product - Add";case Global.EcommerceEventAction.QuickPackageOpen:return "Quick Package - Open";case Global.EcommerceEventAction.QuickPackageAdd:return "Quick Package - Add";
2698case Global.EcommerceEventAction.PackageEditorOpen:return "Package Editor - Open";case Global.EcommerceEventAction.PackageEditorAdd:return "Package Editor - Add";
2699case Global.EcommerceEventAction.PackageEditorRemoveOld:return "Package Editor - Remove Old";case Global.EcommerceEventAction.PackageEditorSaveNew:return "Package Editor - Save New";
2700case Global.EcommerceEventAction.ChangeProductDropDownOpen:return "Change Product Drop-Down - Open";case Global.EcommerceEventAction.ChangeProductDropDownClick:return "Change Product Drop-Down - Click";
2701case Global.EcommerceEventAction.ProductSizesAndAttributesView:return "Product Sizes And Attributes - View";case Global.EcommerceEventAction.ProductSizesAndAttributesClick:return "Product Sizes And Attributes - Click";
2702case Global.EcommerceEventAction.ProductEditorOpen:return "Product Editor - Open";case Global.EcommerceEventAction.ProductEditorAdd:return "Product Editor - Add";
2703case Global.EcommerceEventAction.ProductEditorRemoveOld:return "Product Editor - Remove Old";case Global.EcommerceEventAction.ProductEditorSaveNew:return "Product Editor - Save New";
2704case Global.EcommerceEventAction.ShoppingCartView:return "Shopping Cart - View";case Global.EcommerceEventAction.ShoppingCartClick:return "Shopping Cart - Click";
2705case Global.EcommerceEventAction.ShoppingCartRemove:return "Shopping Cart - Remove";case Global.EcommerceEventAction.ShoppingCartRemoveOldQuantity:return "Shopping Cart - Remove Old Quantity";
2706case Global.EcommerceEventAction.ShoppingCartSaveNewQuantity:return "Shopping Cart - Save New Quantity";case Global.EcommerceEventAction.LoginPageOpen:return "Login Page - Open";
2707case Global.EcommerceEventAction.LoginPageLoginType:return "Login Page - Login Type";case Global.EcommerceEventAction.LicenseAgreementOpen:return "License Agreement - Open";
2708case Global.EcommerceEventAction.ShippingAddressPageOpen:return "Shipping Address Page - Open";case Global.EcommerceEventAction.DeliveryMethodsPageOpen:return "Delivery Methods Page - Open";
2709case Global.EcommerceEventAction.PaymentsPageOpen:return "Payments Page - Open";case Global.EcommerceEventAction.PaymentsPagePaymentMethod:return "Payments Page - Select Payment Method";
2710case Global.EcommerceEventAction.ReviewOrderPageOpen:return "Review Order Page - Open";case Global.EcommerceEventAction.ConfirmationPageOpen:return "Confirmation Page - Open";
2711case Global.EcommerceEventAction.Purchase:return "Purchase";default:;return null;}};ZenfolioEcommerceTracker.prototype._getEcommerceProductCategoryName=function(ecommerceProductCategory){switch(ecommerceProductCategory){case Global.EcommerceProductCategory.Packages:return "Packages";
2712case Global.EcommerceProductCategory.Downloads:return "Downloads";case Global.EcommerceProductCategory.SelfFulfilledProducts:return "Self-Fulfilled Products";case Global.EcommerceProductCategory.VendorPrints:return "Vendor Prints";
2713case Global.EcommerceProductCategory.OtherVendorProducts:return "Other Vendor Products";
2713case Global.EcommerceProductCategory.Backgrounds:return "Backgrounds";default:;
2714return null;}};ZenfolioEcommerceTracker.prototype._getCurrentPage=function(){return location.protocol+"//"+location.host+this._getPathName();};ZenfolioEcommerceTracker.prototype._getBuyButtonDropDownBaseData=function(productInfo,
2715currency,position){var baseData=_super.prototype._getBuyButtonDropDownBaseData.call(this,productInfo,currency,position);baseData.id=this._getProductId(productInfo.item.vendorId,
2716productInfo.item.productId);baseData.brand=productInfo.item.vendorId;baseData.category=this._getEcommerceProductCategoryName(productInfo.ecommerceProductCategory);
2717baseData.variant=this._wrapOptionId(productInfo.item.optionId);this._fillCustomData(baseData,currency,null);return baseData;};ZenfolioEcommerceTracker.prototype._getQuickShopProductsBaseData=function(product,
2718currency,position){var baseData=_super.prototype._getQuickShopProductsBaseData.call(this,product,currency,position);baseData.id=this._getProductId(product.vendorId,
2719product.id);baseData.brand=product.vendorId;baseData.category=this._getEcommerceProductCategoryName(product.ecommerceProductCategory);if(Global.ConfiguratorService.isPackage(product)){baseData.variant=this._getPriceListPackageVariant(product);
2720}else{baseData.variant=this._wrapOptionId(product.defaultOptionId);}this._fillCustomData(baseData,currency,null);return baseData;};ZenfolioEcommerceTracker.prototype._getPackageEditorProductData=function(protoItem,
2721productInfo,currency,addQuantity){var productData=_super.prototype._getPackageEditorProductData.call(this,protoItem,productInfo,currency,addQuantity);productData.id=this._getProductId(productInfo.vendorId,
2722productInfo.id);productData.brand=productInfo.vendorId;productData.category=this._getEcommerceProductCategoryName(productInfo.ecommerceProductCategory);productData.variant=this._wrapOptionId(protoItem.optionId);
2723this._fillCustomData(productData,currency,this._getSelectedTemplate(protoItem));return productData;};ZenfolioEcommerceTracker.prototype._getPackageEditorPackageData=function(protoPackages,
2724packageInfo,currency,addQuantity){var productData=_super.prototype._getPackageEditorPackageData.call(this,protoPackages,packageInfo,currency,addQuantity);productData.id=this._getProductId(packageInfo.vendorId,
2725packageInfo.id);productData.brand=packageInfo.vendorId;productData.category=this._getEcommerceProductCategoryName(packageInfo.ecommerceProductCategory);productData.variant=this._getPriceListPackageVariant(packageInfo);
2726this._fillCustomData(productData,currency,null);return productData;};ZenfolioEcommerceTracker.prototype._getShoppingCartProductBaseData=function(cartProduct){var baseData=_super.prototype._getShoppingCartProductBaseData.call(this,
2727cartProduct);baseData.id=this._getProductId(cartProduct.vendorId,cartProduct.productId);baseData.brand=cartProduct.vendorId;baseData.category=this._getEcommerceProductCategoryName(cartProduct.ecommerceProductCategory);
2728if(cartProduct.isPackage){baseData.variant=this._getPackageImageCountString(cartProduct.isSingleImage);}else{baseData.variant=this._wrapOptionId(cartProduct.optionId);
2729}this._fillCustomData(baseData,cartProduct.currencyCode,cartProduct.selectedTemplate);return baseData;};ZenfolioEcommerceTracker.prototype._fillCustomData=function(baseData,
2730currency,selectedTemplate){baseData.dimension1=this._numberToString(zf_ownerId);baseData.dimension2=this._numberToString(zf_userId);baseData.dimension3=this._getCurrencyCode(currency);
2731if(selectedTemplate){baseData.dimension4=selectedTemplate;}};ZenfolioEcommerceTracker.prototype._wrapOptionId=function(optionId){return optionId?optionId:"default";
2732};ZenfolioEcommerceTracker.prototype._getPriceListPackageVariant=function(packageInfo){return this._getPackageImageCountString(packageInfo.meta().isSingleImage);
2733};ZenfolioEcommerceTracker.prototype._getPackageImageCountString=function(isSingleImage){return isSingleImage?"Single-Image Package":"Multi-Image Package";};ZenfolioEcommerceTracker.prototype._getSelectedTemplate=function(protoItem){return protoItem&&protoItem.settings&&protoItem.settings["selected-template"];
2734};ZenfolioEcommerceTracker.prototype._getProductId=function(vendorId,productId){return vendorId+"_"+productId;};return ZenfolioEcommerceTracker;}(Global.EcommerceTracker));
2735Global.ZenfolioEcommerceTracker=ZenfolioEcommerceTracker;})(Global=Zenfolio.Global||(Zenfolio.Global={}));})(Zenfolio||(Zenfolio={}));;var Zenfolio;(function(Zenfolio){var Global;
2736(function(Global){var EcommerceManager=(function(){function EcommerceManager(){this._ecommerceTrackers=[];if(typeof zf_zenbar!=="undefined"&&zf_zenbar.newShoppingEnabled&&!zf_isMobileLayout()){if(Global.PhotographerEcommerceTracker.instance){this._ecommerceTrackers.push(Global.PhotographerEcommerceTracker.instance);
2737}if(Global.ZenfolioEcommerceTracker.instance){this._ecommerceTrackers.push(Global.ZenfolioEcommerceTracker.instance);}}}Object.defineProperty(EcommerceManager,"instanse",
2738{get:function(){if(!this._instanse){this._instanse=new EcommerceManager();}return this._instanse;},enumerable:true,configurable:true});EcommerceManager.getCartProductsCurrency=function(cartProducts){return cartProducts&&cartProducts[0]&&cartProducts[0].currencyCode;
2739};EcommerceManager.createEcommerceCartProductsMap=function(cartProducts){var cartProductsMap={};if($.isArray(cartProducts)){$.each(cartProducts,function(_i,product){$.each(product.ids,
2740function(_j,itemId){cartProductsMap[itemId]=product;});});}return cartProductsMap;};EcommerceManager.prototype.setCurrency=function(currency){this._exec(function(ecommerceTracker){return ecommerceTracker.setCurrency(currency);
2741});};EcommerceManager.prototype.sendEcommercePageView=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.sendEcommercePageView(callback);
2742},onComplete);};EcommerceManager.prototype.sendEcommerceEvent=function(ecommerceEventCategory,ecommerceEventAction,nonInteraction,onComplete){this._execAsync(function(ecommerceTracker,
2743callback){return ecommerceTracker.sendEcommerceEvent(ecommerceEventCategory,ecommerceEventAction,nonInteraction,callback);},onComplete);};EcommerceManager.prototype.executeBatch=function(items,
2744prepare,add,send,onComplete){if(!items||items.length<=0){onComplete&&onComplete();return;}var operations=[];var _loop_1=function(){var batch=items.splice(0,EcommerceManager.maxBatchSize);
2745operations.push(function(callback){prepare();$.each(batch,function(_index,value){return add(value);});send(callback);});};while(items.length>0){_loop_1();}if(operations.length>0){Global.ResourceService.waitAll(operations,
2746onComplete);}else{onComplete&&onComplete();}};EcommerceManager.prototype.addBuyButtonDropDownImpression=function(productInfo,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addBuyButtonDropDownImpression(productInfo,
2747currency,position);});};EcommerceManager.prototype.addBuyButtonDropDownProduct=function(productInfo,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addBuyButtonDropDownProduct(productInfo,
2748currency,position);});};EcommerceManager.prototype.buyButtonDropDownOpen=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.buyButtonDropDownOpen(callback);
2749},onComplete);};EcommerceManager.prototype.buyButtonDropDownClick=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.buyButtonDropDownClick(callback);
2750},onComplete);};EcommerceManager.prototype.addQuickShopProductsImpression=function(product,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addQuickShopProductsImpression(product,
2751currency,position);});};EcommerceManager.prototype.addQuickShopProductsProduct=function(product,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addQuickShopProductsProduct(product,
2752currency,position);});};EcommerceManager.prototype.quickShopProductsView=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.quickShopProductsView(callback);
2753},onComplete);};EcommerceManager.prototype.quickShopProductsClick=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.quickShopProductsClick(callback);
2754},onComplete);};EcommerceManager.prototype.addQuickShopSidebarImpression=function(product,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addQuickShopSidebarImpression(product,
2755currency,position);});};EcommerceManager.prototype.addQuickShopSidebarProduct=function(product,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addQuickShopSidebarProduct(product,
2756currency,position);});};EcommerceManager.prototype.quickShopSidebarView=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.quickShopSidebarView(callback);
2757},onComplete);};EcommerceManager.prototype.quickShopSidebarClick=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.quickShopSidebarClick(callback);
2758},onComplete);};EcommerceManager.prototype.addShopTopMenuImpression=function(product,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addShopTopMenuImpression(product,
2759currency,position);});};EcommerceManager.prototype.addShopTopMenuProduct=function(product,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addShopTopMenuProduct(product,
2760currency,position);});};EcommerceManager.prototype.shopTopMenuOpen=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.shopTopMenuOpen(callback);
2761},onComplete);};EcommerceManager.prototype.shopTopMenuClick=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.shopTopMenuClick(callback);
2762},onComplete);};EcommerceManager.prototype.addShopHomepagePackagesImpression=function(packageInfo,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addShopHomepagePackagesImpression(packageInfo,
2763currency,position);});};EcommerceManager.prototype.addShopHomepagePackagesProduct=function(packageInfo,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addShopHomepagePackagesProduct(packageInfo,
2764currency,position);});};EcommerceManager.prototype.shopHomepagePackagesView=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.shopHomepagePackagesView(callback);
2765},onComplete);};EcommerceManager.prototype.shopHomepagePackagesClick=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.shopHomepagePackagesClick(callback);
2766},onComplete);};EcommerceManager.prototype.addShopHomepageCategoriesImpression=function(productInfo,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addShopHomepageCategoriesImpression(productInfo,
2767currency,position);});};EcommerceManager.prototype.addShopHomepageCategoriesProduct=function(productInfo,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addShopHomepageCategoriesProduct(productInfo,
2768currency,position);});};EcommerceManager.prototype.shopHomepageCategoriesView=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.shopHomepageCategoriesView(callback);
2769},onComplete);};EcommerceManager.prototype.shopHomepageCategoriesClick=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.shopHomepageCategoriesClick(callback);
2770},onComplete);};EcommerceManager.prototype.addPackagesPageImpression=function(packageInfo,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addPackagesPageImpression(packageInfo,
2771currency,position);});};EcommerceManager.prototype.addPackagesPageProduct=function(packageInfo,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addPackagesPageProduct(packageInfo,
2772currency,position);});};EcommerceManager.prototype.packagesPageView=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.packagesPageView(callback);
2773},onComplete);};EcommerceManager.prototype.packagesPageClick=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.packagesPageClick(callback);
2774},onComplete);};EcommerceManager.prototype.addSubcategoryPageImpression=function(productInfo,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addSubcategoryPageImpression(productInfo,
2775currency,position);});};EcommerceManager.prototype.addSubcategoryPageProduct=function(productInfo,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addSubcategoryPageProduct(productInfo,
2776currency,position);});};EcommerceManager.prototype.subcategoryPageView=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.subcategoryPageView(callback);
2777},onComplete);};EcommerceManager.prototype.subcategoryPageClick=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.subcategoryPageClick(callback);
2778},onComplete);};EcommerceManager.prototype.addQuickProductProduct=function(protoItem,productInfo,currency,addQuantity){this._exec(function(ecommerceTracker){return ecommerceTracker.addQuickProductProduct(protoItem,
2779productInfo,currency,addQuantity);});};EcommerceManager.prototype.addQuickPackageProduct=function(protoPackages,packageInfo,currency,addQuantity){this._exec(function(ecommerceTracker){return ecommerceTracker.addQuickPackageProduct(protoPackages,
2780packageInfo,currency,addQuantity);});};EcommerceManager.prototype.quickProductOpen=function(productList,onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.quickProductOpen(productList,
2781callback);},onComplete);};EcommerceManager.prototype.quickProductAdd=function(productList,onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.quickProductAdd(productList,
2782callback);},onComplete);};EcommerceManager.prototype.quickPackageOpen=function(productList,onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.quickPackageOpen(productList,
2783callback);},onComplete);};EcommerceManager.prototype.quickPackageAdd=function(productList,onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.quickPackageAdd(productList,
2784callback);},onComplete);};EcommerceManager.prototype.quickProductOpenBatch=function(protoItems,productInfo,currency,productList,onComplete){var _this=this;this.executeBatch(protoItems&&protoItems.slice(0),
2785function(){_this.setCurrency(currency);},function(item){_this.addQuickProductProduct(item,productInfo,currency,false);},function(callback){_this.quickProductOpen(productList,
2786callback);},onComplete);};
2786EcommerceManager.prototype.quickProductAddBatch=function(protoItems,productInfo,currency,productList,onComplete){var _this=this;this.executeBatch(protoItems&&protoItems.slice(0),
2787function(){_this.setCurrency(currency);},function(item){_this.addQuickProductProduct(item,productInfo,currency,true);},function(callback){_this.quickProductAdd(productList,
2788callback);},onComplete);};EcommerceManager.prototype.quickPackageOpenBatch=function(protoPackages,packageInfo,currency,productList,onComplete){var _this=this;this.executeBatch(this._splitProtoPackages(protoPackages,
2789packageInfo),function(){_this.setCurrency(currency);},function(packages){_this.addQuickPackageProduct(packages,packageInfo,currency,false);},function(callback){_this.quickPackageOpen(productList,
2790callback);},onComplete);};EcommerceManager.prototype.quickPackageAddBatch=function(protoPackages,packageInfo,currency,productList,onComplete){var _this=this;this.executeBatch(this._splitProtoPackages(protoPackages,
2791packageInfo),function(){_this.setCurrency(currency);},function(packages){_this.addQuickPackageProduct(packages,packageInfo,currency,true);},function(callback){_this.quickPackageAdd(productList,
2792callback);},onComplete);};EcommerceManager.prototype.addPackageEditorProduct=function(protoItem,productInfo,currency,addQuantity){this._exec(function(ecommerceTracker){return ecommerceTracker.addPackageEditorProduct(protoItem,
2793productInfo,currency,addQuantity);});};EcommerceManager.prototype.addPackageEditorPackage=function(protoPackages,packageInfo,currency,addQuantity){this._exec(function(ecommerceTracker){return ecommerceTracker.addPackageEditorPackage(protoPackages,
2794packageInfo,currency,addQuantity);});};EcommerceManager.prototype.packageEditorOpen=function(productList,onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.packageEditorOpen(productList,
2795callback);},onComplete);};EcommerceManager.prototype.packageEditorAdd=function(productList,onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.packageEditorAdd(productList,
2796callback);},onComplete);};EcommerceManager.prototype.packageEditorRemoveOld=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.packageEditorRemoveOld(callback);
2797},onComplete);};EcommerceManager.prototype.packageEditorSaveNew=function(productList,onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.packageEditorSaveNew(productList,
2798callback);},onComplete);};EcommerceManager.prototype.addChangeProductDropDownImpression=function(productInfo,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addChangeProductDropDownImpression(productInfo,
2799currency,position);});};EcommerceManager.prototype.addChangeProductDropDownProduct=function(productInfo,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addChangeProductDropDownProduct(productInfo,
2800currency,position);});};EcommerceManager.prototype.addProductSizesAndAttributesImpression=function(productInfo,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addProductSizesAndAttributesImpression(productInfo,
2801currency,position);});};EcommerceManager.prototype.addProductSizesAndAttributesProduct=function(productInfo,currency,position){this._exec(function(ecommerceTracker){return ecommerceTracker.addProductSizesAndAttributesProduct(productInfo,
2802currency,position);});};EcommerceManager.prototype.addProductEditorProduct=function(protoItem,productInfo,currency,addQuantity){this._exec(function(ecommerceTracker){return ecommerceTracker.addProductEditorProduct(protoItem,
2803productInfo,currency,addQuantity);});};EcommerceManager.prototype.changeProductDropDownOpen=function(eventCategory,onComplete){this._execAsync(function(ecommerceTracker,
2804callback){return ecommerceTracker.changeProductDropDownOpen(eventCategory,callback);},onComplete);};EcommerceManager.prototype.changeProductDropDownClick=function(eventCategory,
2805onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.changeProductDropDownClick(eventCategory,callback);},onComplete);};EcommerceManager.prototype.productSizesAndAttributesView=function(eventCategory,
2806onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.productSizesAndAttributesView(eventCategory,callback);},onComplete);};EcommerceManager.prototype.productSizesAndAttributesClick=function(eventCategory,
2807onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.productSizesAndAttributesClick(eventCategory,callback);},onComplete);};EcommerceManager.prototype.productEditorOpen=function(eventCategory,
2808productList,onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.productEditorOpen(eventCategory,productList,callback);},onComplete);
2809};EcommerceManager.prototype.productEditorAdd=function(eventCategory,productList,onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.productEditorAdd(eventCategory,
2810productList,callback);},onComplete);};EcommerceManager.prototype.productEditorRemoveOld=function(eventCategory,onComplete){this._execAsync(function(ecommerceTracker,
2811callback){return ecommerceTracker.productEditorRemoveOld(eventCategory,callback);},onComplete);};EcommerceManager.prototype.productEditorSaveNew=function(eventCategory,
2812productList,onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.productEditorSaveNew(eventCategory,productList,callback);},onComplete);
2813};EcommerceManager.prototype.addShoppingCartProductImpression=function(cartProduct){this._exec(function(ecommerceTracker){return ecommerceTracker.addShoppingCartProductImpression(cartProduct);
2814});};EcommerceManager.prototype.addShoppingCartProductProduct=function(cartProduct){this._exec(function(ecommerceTracker){return ecommerceTracker.addShoppingCartProductProduct(cartProduct);
2815});};EcommerceManager.prototype.shoppingCartView=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.shoppingCartView(callback);
2816},onComplete);};EcommerceManager.prototype.shoppingCartClick=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.shoppingCartClick(callback);
2817},onComplete);};EcommerceManager.prototype.shoppingCartRemove=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.shoppingCartRemove(callback);
2818},onComplete);};EcommerceManager.prototype.shoppingCartRemoveOldQuantity=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.shoppingCartRemoveOldQuantity(callback);
2819},onComplete);};EcommerceManager.prototype.shoppingCartSaveNewQuantity=function(onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.shoppingCartSaveNewQuantity(callback);
2820},onComplete);};EcommerceManager.prototype.sendLoginType=function(loginType,onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.sendLoginType(loginType,
2821callback);},onComplete);};EcommerceManager.prototype.sendPaymentMethod=function(paymentMethod,onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.sendPaymentMethod(paymentMethod,
2822callback);},onComplete);};EcommerceManager.prototype.sendCheckoutPageOpen=function(checkoutStep,onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.sendCheckoutPageOpen(checkoutStep,
2823callback);},onComplete);};EcommerceManager.prototype.sendPurchase=function(ecommercePurchaseData,idOnly,onComplete){this._execAsync(function(ecommerceTracker,callback){return ecommerceTracker.sendPurchase(ecommercePurchaseData,
2824idOnly,callback);},onComplete);};EcommerceManager.prototype.sendCheckoutPageOpenBatch=function(cartProducts,checkoutStep,onComplete){var _this=this;var currency=EcommerceManager.getCartProductsCurrency(cartProducts);
2825this.executeBatch(cartProducts&&cartProducts.slice(0),function(){_this.setCurrency(currency);},function(product){_this.addShoppingCartProductProduct(product);},function(callback){_this.sendCheckoutPageOpen(checkoutStep,
2826callback);},onComplete);};EcommerceManager.prototype.sendPurchaseBatch=function(cartProducts,ecommercePurchaseData,onComplete){var _this=this;if(!cartProducts||cartProducts.length<=0){onComplete&&onComplete();
2827return;}var currency=EcommerceManager.getCartProductsCurrency(cartProducts),singleRequest=cartProducts.length<=EcommerceManager.maxBatchSize;this.executeBatch(cartProducts&&cartProducts.slice(0),
2828function(){_this.setCurrency(currency);},function(product){_this.addShoppingCartProductProduct(product);},function(callback){_this.sendPurchase(ecommercePurchaseData,
2829!singleRequest,callback);},function(){if(singleRequest){onComplete&&onComplete();}else{_this.setCurrency(currency);_this.sendPurchase(ecommercePurchaseData,false,
2830onComplete);}});};EcommerceManager.prototype.processCheckoutData=function(currentStep,cartProducts,paymentMethod,onComplete){var _this=this;if(!cartProducts||cartProducts.length<=0){onComplete&&onComplete();
2831return;}var lastCheckoutStepString=zf_stdGetCookie("zf_last_checkout_step");var lastCheckoutStep=lastCheckoutStepString&&parseInt(lastCheckoutStepString);if(!lastCheckoutStep||!Global.CheckoutStep[lastCheckoutStep]){lastCheckoutStep=0;
2832}var loginTypeTrackingAdded=false,paymentMethodTrackingAdded=false;var operations=[];var _loop_2=function(step){if(step!=currentStep&&lastCheckoutStep>=step){return "continue";
2833}if(step==Global.CheckoutStep.LoginPage){zf_stdRemoveCookie("zf_login_type_tracked");}else if(step==Global.CheckoutStep.PaymentsPage){zf_stdRemoveCookie("zf_payment_method_tracked");
2834}if(!loginTypeTrackingAdded&&zf_stdGetCookie("zf_login_type_tracked")!="1"&&step>Global.CheckoutStep.LoginPage){var loginTypeString=zf_stdGetCookie("zf_login_type");
2835var loginType_1=loginTypeString&&parseInt(loginTypeString);if(!loginType_1||!Global.LoginType[loginType_1]){loginType_1=Global.LoginType.ExistingAccountCheckout;
2836}operations.push(function(callback){_this.sendLoginType(loginType_1,function(){zf_stdSetCookie("zf_login_type_tracked","1");callback();});});loginTypeTrackingAdded=true;
2837}if(!paymentMethodTrackingAdded&&zf_stdGetCookie("zf_payment_method_tracked")!="1"&&step>Global.CheckoutStep.PaymentsPage&&paymentMethod!=null){operations.push(function(callback){_this.sendPaymentMethod(paymentMethod,
2838function(){zf_stdSetCookie("zf_payment_method_tracked","1");callback();});});paymentMethodTrackingAdded=true;}if(step>lastCheckoutStep){operations.push(function(callback){_this.sendCheckoutPageOpenBatch(cartProducts,
2839step,callback);});}};for(var step=Global.CheckoutStep.LoginPage;step<=currentStep;step++){_loop_2(step);}if(operations.length>0){Global.ResourceService.waitAll(operations,
2840function(){if(currentStep>lastCheckoutStep){zf_stdSetCookie("zf_last_checkout_step",currentStep.toString());}onComplete&&onComplete();});}else{onComplete&&onComplete();
2841}if(currentStep===Global.CheckoutStep.LoginPage){zf_TagManager.pusEcommerceOrderEvent({name:'checkout',eventAction:'checkout - view registration',actionField:{step:1}},
2842cartProducts);}};EcommerceManager.prototype.shoppingCartRemoveBatch=function(cartProducts,onComplete){var _this=this;var currency=EcommerceManager.getCartProductsCurrency(cartProducts);
2843this.executeBatch(cartProducts,function(){return _this.setCurrency(currency);},function(product){return _this.addShoppingCartProductProduct(product);},function(callback){return _this.shoppingCartRemove(callback);
2844},onComplete);};EcommerceManager.prototype.removeMissingProductsBatch=function(oldProducts,newProducts){if(!$.isArray(newProducts)){return oldProducts;}var productsToRemove=[];
2845if($.isArray(oldProducts)){var newProductsMap=EcommerceManager.createEcommerceCartProductsMap(newProducts);for(var _a=0,oldProducts_1=oldProducts;_a<oldProducts_1.length;
2846_a++){var oldProduct=oldProducts_1[_a];for(var _b=0,_c=oldProduct.ids;_b<_c.length;_b++){var oldProductId=_c[_b];if(!newProductsMap[oldProductId]){productsToRemove.push(oldProduct);
2847break;}}}}if(productsToRemove.length>0){zf_stdSetCookie("zf_last_checkout_step","0");this.shoppingCartRemoveBatch(productsToRemove);}return newProducts;};EcommerceManager.prototype._exec=function(operation){$.each(this._ecommerceTrackers,
2848function(_index,value){return operation(value);});};EcommerceManager.prototype._execAsync=function(operation,onComplete){var operations=[];this._exec(function(ecommerceTracker){operations.push(function(callback){operation(ecommerceTracker,
2849callback);});});if(operations.length>0){Global.ResourceService.waitAll(operations,onComplete);}else{onComplete&&onComplete();}};EcommerceManager.prototype._splitProtoPackages=function(protoPackages,
2850packageInfo){var result=[],partsCount=packageInfo.meta().parts.length;for(var i=0;i<protoPackages.length;i+=partsCount){result.push(protoPackages.slice(i,i+partsCount));
2851}return result;};EcommerceManager.scrollTimeout=700;EcommerceManager.maxBatchSize=30;return EcommerceManager;}());Global.EcommerceManager=EcommerceManager;})(Global=Zenfolio.Global||(Zenfolio.Global={}));
2852})(Zenfolio||(Zenfolio={}));;;;;function zfl_Analytics(isPhotoPage,IsGoogleAnalytics,gaWebPropertyId,scProject,scSecurity,layoutStat,path){this._isPhotoPage=isPhotoPage;this._layoutStat=layoutStat;
2853this._path=path;zf_Analytics.prototype.constructor.call(this,IsGoogleAnalytics,gaWebPropertyId,true,Zenfolio.Global.AnalyticsTracker.loadClientId({}));Zenfolio.Global.AnalyticsTracker.saveClientId();
2854zf_stdMakeMethodsDeferred(this,"Analytics",["registerLayoutLoad","registerLightsDimmed"]);this._quantcast=new zf_Quantcast('p-2bs_Lh_GZF0zU','',true);if(scProject!=null&&scProject.length>0&&scSecurity!=null&&scSecurity.length>0)this._statcounter=new zf_StatCounter(scProject,
2855scSecurity,true);}zfl_Analytics.inherits(zf_Analytics);zfl_Analytics.prototype.trackPageView=function(path){zf_Analytics.prototype.trackPageView.call(this,path);if(this._statcounter){this._statcounter.trackPageView(path);
2856}};zfl_Analytics.prototype.registerNonPhotoVisit=function(){if(this._isPhotoPage)return;;if(this.getPropertyId()!=null)this.trackPageView(this._path);this._quantcast.trackPageView();
2857};zfl_Analytics.prototype.registerDownload=function(path){;;if(this.getPropertyId()!=null)this.trackPageView(path);this._quantcast.trackPageView();};zfl_Analytics.prototype.registerPhotoVisit=function(photo){var path=photo.getHref("analytics");
2858;if(this.getPropertyId()!=null)this.trackPageView(path);this._quantcast.trackPageView();};zfl_Analytics.prototype.update=function(photo){;if(this.current!=null)this.current.unadvise(photo);
2859this.current=photo;if(photo.loaded){this.registerPhotoVisit(photo);}else{var self=this;photo.advise(this,function(){self.registerPhotoVisit(photo);});}};zfl_Analytics.prototype.registerLayoutLoad=function(flipper){if(this._layoutStat&&flipper){var oldDim={cx:zf_stdGetClientWidth(),
2860cy:zf_stdGetClientHeight()};var invoker=new zf_DelayedInvoke(3000);$(window).on("resize",flipper.eventHandler(zfl_Analytics._resizeHandler,this,flipper,oldDim,invoker));
2861this._sendLayoutStats(flipper,false);}};zfl_Analytics.prototype.registerLightsDimmed=function(flipper){if(this._layoutStat)this._sendLayoutStats(flipper,false,"dimlights");};
2862zfl_Analytics._resizeHandler=function(eventArgs,analytics,flipper,oldDimensions,delay){if(oldDimensions.cx==zf_stdGetClientWidth()&&oldDimensions.cy==zf_stdGetClientHeight())return;
2863delay.invoke(function(){analytics._sendLayoutStats(flipper,true);});};zfl_Analytics.prototype._sendLayoutStats=function(flipper,isResample,layoutName){var size=flipper?flipper.getAvailSize():{cx:0,
2864cy:0};var stats={screenWidth:screen.width,screenHeight:screen.height,clientWidth:zf_stdGetClientWidth(),clientHeight:zf_stdGetClientHeight(),photoViewportWidth:size.cx,
2865photoViewportHeight:size.cy,theme:this._layoutStat.themeName,layout:layoutName?layoutName:this._layoutStat.layoutName,photoSetId:this._layoutStat.photoSetId,ownerId:this._layoutStat.ownerId,
2866isResample:isResample};zf_stdServerRequest("POST","/zf/layout/layout.asmx","ReportClientStatistics",[stats]);};;;function zfl_Mat(id,offsetTop,offsetBottom,extraWidth,layoutId){zfl_Control.prototype.constructor.call(this,
2867id);this._offsetTop=offsetTop;this._offsetBottom=offsetBottom;this._extraWidth=extraWidth;this._layoutId=layoutId;}zfl_Mat.inherits(zfl_Control);zfl_Mat.current=null;zfl_Mat.recalc=function(){var self=zfl_Mat.current;
2868if(!self)return;var domHeight=self.dom("height");var layout=$(document.getElementById(self._layoutId));var matWidth=layout.innerWidth()+self._extraWidth;$(domHeight).find(".mat-width").width(matWidth);
2869$(domHeight).css({display:"block"});};;function zfl_PhotoDownload(isAmdEnabled,isSmdEnabled,maxSmdZipSize){this._maxSmdZipSize=maxSmdZipSize;this._isAmdEnabled=isAmdEnabled;
2870this._isSmdEnabled=isSmdEnabled;enableFastFeature=zf_enableFastFeature;if('addEventListener' in window){window.addEventListener('message',this._iFrameListener,false);
2871}else{window.attachEvent('onmessage',this._iFrameListener);}}var displayName='';var enableFastFeature=false;var multiDownloadDialogRef=null;zfl_PhotoDownload._countRequestTime=0;zfl_PhotoDownload._maxCallRequest=300;
2872zfl_PhotoDownload._responsePendingDownload=null;zfl_PhotoDownload._isMultiDownload=false;zfl_PhotoDownload._draftPendingDownloadJobId=null;zfl_PhotoDownload.prototype._iFrameListener=function(event){var downloadHost=!zf_stdAllowDownloadHost()?"https://"+zf_secureHost:zf_stdGetProtocol(zf_downloadHost)+zf_downloadHost;
2873if(event.origin==null||event.origin.indexOf(downloadHost)==-1){return;}switch(event.data){case '200':zfl_MessageBox.show({width:480,title:'Processing your request',
2874text:zf_stdFormatString('We are currently processing your request and will send a link to {0} as soon as the download is ready.<br/>You should receive the email within 15 minutes.<br/><br/>Please note that if you are requesting a large number of files, it may take a bit longer.<br/><br/>Thanks for your understanding and enjoy your photos!',
2875zf_stdGetCookie('zf_1m_amd_email')),encode:false,buttons:['OK'],curtain:true});break;default:break;}if(event&&event.data&&typeof event.data=='string'){var response=JSON.parse(event.data);
2876if(response&&response.StatusCode==515){zfl_PhotoDownload._responsePendingDownload=response;zfl_PhotoDownload._check();}}};zfl_PhotoDownload._createDraftPendingDownloadJob=function(callback){zf_stdServerRequestEx("POST",
2877"/zf/layout/layout.asmx","CreateDraftPendingDownloadJob",[zf_ownerId],function(result,error){if(result!=null){zfl_PhotoDownload._draftPendingDownloadJobId=result;
2878callback();zfl_PhotoDownload._countRequestTime=0;window.setTimeout(zfl_PhotoDownload._checkMultipleDownload,3000);}});};zfl_PhotoDownload._checkMultipleDownload=function(){const draftId=zfl_PhotoDownload._draftPendingDownloadJobId;
2879var couterRequest=0;const runChecking=function(){if(zf_enableFastFeature&&couterRequest<zfl_PhotoDownload._maxCallRequest){zf_stdServerRequestEx("POST","/zf/layout/layout.asmx",
2880"IsExistDraftPendingDownloadJob",[draftId,zf_ownerId],function(result,error){if(result!=null&&result[0]){zfl_PhotoDownload._check({PendingDownloadJobId:draftId});
2881}else{couterRequest++;window.setTimeout(runChecking,3000);}});}};
2881runChecking();};zfl_PhotoDownload._check=function(pendingJobResp){var response=pendingJobResp?pendingJobResp:zfl_PhotoDownload._responsePendingDownload;
2882var updateEmailCall=function(pendingDownloadJobId,email){zf_stdServerRequestEx("POST","/zf/layout/layout.asmx","UpdatePendingArchiveDownloadJob",[pendingDownloadJobId,
2883zf_ownerId,email],function(){return;});};if(response&&response!=null){if(!enableFastFeature){const msg=zf_stdFormatString("This file you requested is in our archive storage. <br/>Please contact us to make this image available. <br/>Sorry for any inconvenience! <br/>"+displayName);
2884zfl_MessageBox.show({width:480,text:msg,encode:false,buttons:['OK'],curtain:true});}else{zfl_PhotoDownload._countRequestTime=0;if(zfl_PhotoDownload._isMultiDownload&&multiDownloadDialogRef){const closeBtn=document.querySelector("#"+multiDownloadDialogRef.id+" .buttons .mbox-btn-0");
2885if(closeBtn){closeBtn.click();}}var emailMarkup='<br/><div class="mbox-email">'+'Your email address'+'</div>'+'<div class="mbox-email form-field">'+'<input type="text" class="input input-font1 input-color1 input-bgcolor1 input-border1" />'+'</div>';
2886const emailMsg=zf_stdFormatString("Please provide an email address so we can notify you when the image is ready to download. Allow at least 12 hours for image delivery.");
2887zfl_MessageBox.show({width:480,title:'RETRIEVING IMAGE FOR DOWNLOAD',text:emailMsg,text2:emailMarkup,encode:false,buttons:['Close','OK'],curtain:true,onbutton:function(buttonIndex,
2888$mbox){if(buttonIndex==1){var address=$mbox.find('.mbox-email>INPUT[type=text]').val();var result=(/^[-+=\w\.][-+=\w\x27\.]*@([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/.test(address));
2889$mbox.find('.mbox-email').toggleClass('field-error',!result);if(!result){$mbox.find('.mbox-email>INPUT[type=text]').focus();return false;}var expires=new Date();
2890expires.setMonth(expires.getMonth()+1);zf_stdSetCookie('zf_1m_amd_email',address,expires);var email=zf_stdGetCookie('zf_1m_amd_email');updateEmailCall(response.PendingDownloadJobId,
2891email);}else if(buttonIndex==0){$.noop();}return true;}});}}};zfl_PhotoDownload.prototype._startBatchDownload=function(pairs,title,key,email,source){var counter;if(!zfl_PhotoDownload.__downloadCount)counter=zfl_PhotoDownload.__downloadCount=1;
2892else counter=++zfl_PhotoDownload.__downloadCount;var frameName="_zfl_PhotoDownload_download"+counter;var frameNode;frameNode=document.createElement("IFRAME");frameNode.name=frameName;
2893frameNode.style.cssText="position:absolute;visibility:hidden;left:0px;top:0px;";document.body.appendChild(frameNode);var formNode=document.createElement("FORM");
2894formNode.action=(!zf_stdAllowDownloadHost()?"https://"+zf_secureHost:zf_stdGetProtocol(zf_downloadHost)+zf_downloadHost)+"/zf/batchDownload";formNode.method="POST";
2895formNode.target=frameName;formNode.innerHTML='<input type="hidden" name="folderId" />'+'<input type="hidden" name="photoSetId" />'+'<input type="hidden" name="scrapbookId" />'+'<input type="hidden" name="ids" />'+'<input type="hidden" name="title" />'+'<input type="hidden" name="keyring" />'+'<input type="hidden" name="token" />'+'<input type="hidden" name="visitor" />'+'<input type="hidden" name="ref" />'+'<input type="hidden" name="key" />'+'<input type="hidden" name="contact" />'+'<input type="hidden" name="owner" />'+'<input type="hidden" name="email" />'+'<input type="hidden" name="draftPendingDownloadJobId" />';
2896var ids=[];for(var i=0;i<pairs.length;i++){ids.push(pairs[i].photoId);ids.push(pairs[i].ownerId);}var folderId=null,photoSetId=null,scrapbookId=null;if(source instanceof zf_Folder){folderId=source.id;
2897}else if(source instanceof zf_PhotoSet){photoSetId=source.id;}else if(source instanceof zf_ScrapbookInfo){scrapbookId=source.id;}document.body.appendChild(formNode);
2898formNode["folderId"].value=folderId;formNode["photoSetId"].value=photoSetId;formNode["scrapbookId"].value=scrapbookId;formNode["ids"].value=ids.join(",");formNode["keyring"].value=zf_stdGetCookie("zf_keyring");
2899formNode["token"].value=zf_stdGetCookie("zf_token");formNode["visitor"].value=zf_stdGetCookie("zf_5y_visitor");formNode["ref"].value=location.hostname==zf_secureHost?zf_ownerDomain:location.hostname;
2900formNode["title"].value=title;formNode["contact"].value=zf_stdGetCookie("zf_uci");formNode["owner"].value=zf_ownerId?zf_ownerId:null;formNode["email"].value=email;
2901if(key)formNode["key"].value=key;if(pairs.length>1)formNode["draftPendingDownloadJobId"].value=zfl_PhotoDownload._draftPendingDownloadJobId;formNode.submit();};zfl_PhotoDownload.prototype._getDownloadInput=function(pairs,
2902info,callback){;if(info.lockedCount==0){callback(null);return;}var renderPopup,removePopup;if(zf_isMobileLayout()){removePopup=function(){zflc_fodMgr.closeFod();
2903};renderPopup=function(retry,onpassword){var root;if(retry){root=zflc_fodMgr.getCurrentContent().root;root.find('*[data-tpl="pwd-irr-msg"]').css({display:''});root.find('*[data-tpl="pwd-inp"]').val('');
2904return;}root=zfl_PhotoDownload._mobilePwdDlgTpl.clone();function processCase(elementsToKeep){elementsToKeep.push('cancel-btn');root.find('*[data-tpl="msg-root"]>*, *[data-tpl="btn-root"]>*').each(function(){if($.intersect(elementsToKeep,
2905[$(this).attr('data-tpl')]).length==0)$(this).remove();});}if(info.lockedCount==info.photoCount&&info.passwordCount==1)processCase([info.photoCount==1?'one-pwd-one-photo-msg':'one-pwd-all-photo-msg',
2906'dwn-btn']);else if(info.lockedCount<info.photoCount&&info.passwordCount==1)processCase(['one-pwd-some-photo-msg','dwn-all-btn','skip-btn']);else if(info.lockedCount==info.photoCount&&info.passwordCount>1)processCase(['mult-pwd-no-photo-msg']);
2907else if(info.lockedCount<info.photoCount&&info.passwordCount>1)processCase(['mult-pwd-some-photo-msg','skip-btn']);if(info.passwordCount==1){root.find('*[data-tpl="pwd-irr-msg"]').css({display:'none'});
2908if(info.passwordHint){var $hint=root.find('*[data-tpl="hint"]');$hint.text($hint.text()+' '+zf_stdHtmlEncode(info.passwordHint));}else root.find('*[data-tpl="hint"]').remove();
2909}else root.find('*[data-tpl="pwd-root"]').remove();zflc_fodMgr.openFod('photoDownload',root);var goHandler=function(){onpassword(root.find('*[data-tpl="pwd-inp"]').val());
2910};var cancelHandler=function(){$(document).trigger('pwdFormHiding.zflpd');zflc_fodMgr.closeFod();$(document).trigger('pwdFormHidden.zflpd');$(document).trigger('done.zflpd');
2911};var skipHandler=function(){zflc_fodMgr.closeFod();callback(null);};root.find('*[data-tpl="dwn-btn"], *[data-tpl="dwn-all-btn"]').click(goHandler);root.find('*[data-tpl="cancel-btn"]').click(cancelHandler);
2912root.find('*[data-tpl="skip-btn"]').click(skipHandler);var input=root.find('*[data-tpl="pwd-inp"]')[0];if(input){$(input).keydown(function(e){if(e.keyCode==13)goHandler();
2913else if(e.keyCode==27)cancelHandler();});root.on('click',function(e){if($(e.target).closest('*[data-tpl="btn-root"]').length!=0)return true;input.focus();return false;
2914});}};}else{var id=this.id+'-dlinput';var classes=this.downloadPopupClasses?this.downloadPopupClasses:'';removePopup=function(){$('#'+id).remove();zf_Curtain.hide();
2915};renderPopup=function(retry,onpassword){var content=[];var buttons=[];if(info.lockedCount==info.photoCount&&info.passwordCount==1){if(info.photoCount==1)content.push('<div class="text">The original file is protected by owner. Please type the password to download it.</div>');
2916else content.push('<div class="text">Original files are protected by owner. Please type the password to download them.</div>');buttons.push(zfl_Button.createHtml(null,
2917"Download",["download"]));}else if(info.lockedCount<info.photoCount&&info.passwordCount==1){content.push('<div class="text">Some of the original files are protected by owner. Please type the password to download all files, or click the Skip button to download unprotected files only.</div>');
2918buttons.push(zfl_Button.createHtml(null,"Download All",["download"]));buttons.push(zfl_Button.createHtml(null,"Skip protected files",["skip"]));}else if(info.lockedCount==info.photoCount&&info.passwordCount>1){content.push('<div class="text">Original files are protected by owner. If you know the passwords for downloading originals, you can download them one at a time.</div>');
2919}else if(info.lockedCount<info.photoCount&&info.passwordCount>1){content.push('<div class="text">Some of the original files are protected by the owner. Only unprotected files will be downloaded. You can download the protected files individually.</div>');
2920buttons.push(zfl_Button.createHtml(null,"Download",["skip"]));}if(info.passwordCount==1){content.push('<div class="separator separator-border1"></div>');if(info.passwordHint)content.push('<div class="item">',
2921'<div class="prompt">Hint:</div>','<div class="password-hint-text">',zf_stdHtmlEncode(info.passwordHint),'</div>','</div>');content.push('<div class="form">','<div class="item">',
2922'<div class="prompt">Password:</div>','<input name="password" type="password" />','</div>','</div>');if(retry)content.push('<div class="incorrect">Incorrect password</div>');
2923}buttons.push(zfl_Button.createHtml(null,"Cancel",["cancel"]));content.push('<div class="item buttons">',buttons.join(""),'</div>');var top=Math.floor((zf_stdGetClientHeight()-300)/2);
2924var left=Math.floor((zf_stdGetClientWidth()-450)/2);content=[].concat('<div class="download-input ',classes,'" ','id="',id,'" ','style="left:',left,'px;top:',top,
2925'px">','<div class="password-box popup-border1 popup-color1 popup-bgcolor1">',content,'</div>','</div>');removePopup();zf_Curtain.show("light");var jPopup=$(content.join("")).appendTo("body");
2926var goHandler=function(){onpassword($('#'+id).find("input").val());};var cancelHandler=function(){$(document).trigger('pwdFormHiding.zflpd');removePopup();$(document).trigger('pwdFormHidden.zflpd');
2927$(document).trigger('done.zflpd');};var skipHandler=function(){removePopup();callback(null);};jPopup.find(".download").click(goHandler);jPopup.find(".cancel").click(cancelHandler);
2928jPopup.find(".skip").click(skipHandler);var input=jPopup.find("input")[0];if(input){$(input).keydown(function(e){if(e.keyCode==13)goHandler();else if(e.keyCode==27)cancelHandler();
2929});try{input.focus();}catch(e){}}};}var run=function(retry){renderPopup(retry,function(password){zf_stdServerRequestEx("POST","/zf/core/core.asmx","VerifySrcPassword",
2930[pairs,password],function(key,error){if(error!=null){$(document).trigger('pwdFormHiding.zflpd');removePopup();$(document).trigger('pwdFormHidden.zflpd');$(document).trigger('done.zflpd');
2931return;}if(key==null){run(true);return;}$(document).trigger('pwdFormHiding.zflpd');removePopup();$(document).trigger('pwdFormHidden.zflpd');callback(key);});});};
2932$(document).trigger('pwdFormShowing.zflpd');run(false);$(document).trigger('pwdFormShown.zflpd');};zfl_PhotoDownload.prototype._downloadOriginals=function(title,photos,source,noCallback){;
2933;var maxSize=this._maxSmdZipSize||3500*1000*1000;var self=this;var fname;if(photos instanceof Array){zfl_PhotoDownload._isMultiDownload=photos.length>1;if(title==null){title=photos[0].image.photoSet.title.replace(/[&\/\\#,+()$~%.'":;^`*?<>{}]/g,
2934'').replace(/ /g,"_").substring(0,25);fname=title;}else fname=title.replace(/[&\/\\#,+()$~%.'":;^`*?<>{}]/g,'').replace(/ /g,"_");var downloadCall=function(fname,
2935photos,email,source){if(!self._fakeVideoOriginals)photos=$.map(photos,function(p){return p.video?null:p;});else photos=$.map(photos,function(p){return p.video&&p.owner.id!=zf_ownerId?null:p;
2936});if(!self.administrator){photos=$.map(photos,function(p){return p.video||p.owner.id==zf_userId||(p.access.mask&zf_AccessMask.ProtectOriginals)==0?p:null;});}var ids=$.map(photos,
2937function(photo){return photo.id;});var photoOwnerPairs=$.map(photos,function(photo){return{photoId:photo.id,ownerId:photo.owner.id};});if(self._canShortCircuit(photos)){self._startBatchDownload(photoOwnerPairs,
2938fname,null,email,source);$(document).trigger('done.zflpd');return;}zf_stdServerRequestEx("POST","/zf/core/core.asmx","GetSrcPasswordInfo",[photoOwnerPairs],function(info,
2939error){if(error!=null){$(document).trigger('done.zflpd');return;};var start=function(key){self._startBatchDownload(photoOwnerPairs,fname,key,email,source);$(document).trigger('done.zflpd');
2940};self._getDownloadInput(photoOwnerPairs,info,start);});return;};if(photos.length==1){fname=title.replace(/[&\/\\#,+()$~%.'":;^`*?<>{}]/g,'').replace(/ /g,"_").substring(0,
294125)+"_web";downloadCall(fname,photos,null,null);displayName=photos[0].owner.displayName;return;}var files=zf_stdSplitArray(photos,function(p){return p.zipSize;},
2942maxSize);var markup;if(noCallback==null){var emailTitle='For larger downloads, request email when download is ready';var emailMarkup='<br/><div class="mbox-email">'+emailTitle+'</div>'+'<div class="mbox-email form-field">'+'<input type="text" class="input input-font1 input-color1 input-bgcolor1 input-border1" />'+'</div>';
2943var buttonsMarkup=['Close','Request'];if(files.length>=1){var text1=zf_stdFormatString('{0} photos selected\nClick on the zip link below to download now',photos.length);
2944if(!this._isAmdEnabled){emailMarkup='';buttonsMarkup=['Close'];}if(this._isAmdEnabled&&!this._isSmdEnabled){markup='';}else{markup=[zf_stdHtmlEncode(text1),'<br/></div><div class="text-download" style="max-height:80px;">'].concat($.map(files,
2945function(f,i){fname=title.replace(/[&\/\\#,+()$~%.'":;^`*?<>{}]/g,'').replace(/ /g,"_").substring(0,25)+"_web_"+("0"+(i+1)).slice(-2);var text=zf_stdFormatString('{0}.zip',
2946fname);return['<a href="#" class="pd-download-link" data-index="',i,'">',zf_stdHtmlEncode(text),'</a>','<br/>'].join('');})).join('');}multiDownloadDialogRef=zfl_MessageBox.show({width:480,
2947title:'Download your zipped photos',text:markup,text2:emailMarkup,encode:false,buttons:buttonsMarkup,curtain:true,postinit:function($mbox){var textBox=$mbox.find('.mbox-email>INPUT[type=text]');
2948textBox.val(zf_stdGetCookie('zf_1m_amd_email'));textBox.focus();},onbutton:function(buttonIndex,$mbox){if(buttonIndex==1){var address=$mbox.find('.mbox-email>INPUT[type=text]').val();
2949var result=(/^[-+=\w\.][-+=\w\x27\.]*@([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/.test(address));$mbox.find('.mbox-email').toggleClass('field-error',!result);if(!result){$mbox.find('.mbox-email>INPUT[type=text]').focus();
2950return false;}var expires=new Date();expires.setMonth(expires.getMonth()+1);zf_stdSetCookie('zf_1m_amd_email',address,expires);fname=title.replace(/[&\/\\#,+()$~%.'":;^`*?<>{}]/g,
2951'').replace(/ /g,"_").substring(0,25)+"_web";downloadCall(fname,photos,address,source);}else if(buttonIndex==0){$.noop();}return true;}});$('.pd-download-link').click(function(){const callback=function(){var li=parseInt($(this).attr('data-index'));
2952fname=title.replace(/[&\/\\#,+()$~%.'":;^`*?<>{}]/g,'').replace(/ /g,"_").substring(0,25)+"_web_"+("0"+(li+1)).slice(-2);self._downloadOriginals(fname,files[li],
2953maxSize,source,true);};zfl_PhotoDownload._createDraftPendingDownloadJob(callback.bind(this));return false;});return;}}if(!this._fakeVideoOriginals)photos=$.map(photos,
2954function(p){return p.video?null:p;});else photos=$.map(photos,function(p){return p.video&&p.owner.id!=zf_ownerId?null:p;});if(!this.administrator){photos=$.map(photos,
2955function(p){return p.video||p.owner.id==zf_userId||(p.access.mask&zf_AccessMask.ProtectOriginals)==0?p:null;});}var continueDownload=function(photos){var ids=$.map(photos,
2956function(photo){return photo.id;});var photoOwnerPairs=$.map(photos,function(photo){return{photoId:photo.id,ownerId:photo.owner.id};});if(self._canShortCircuit(photos)){self._startBatchDownload(photoOwnerPairs,
2957fname,null);$(document).trigger('done.zflpd');return;}zf_stdServerRequestEx("POST","/zf/core/core.asmx","GetSrcPasswordInfo",[photoOwnerPairs],function(info,error){if(error!=null){$(document).trigger('done.zflpd');
2958return;};var start=function(key){self._startBatchDownload(photoOwnerPairs,fname,key);$(document).trigger('done.zflpd');};self._getDownloadInput(photoOwnerPairs,info,
2959start);});return;};this._getDownloadSizes(photos,continueDownload);return;}var photoList=photos;photoList.loadAll(function(){var photoArray=[];for(var i=0;i<photoList.length;
2960i++){var photo=photoList.get(i);;photoArray.push(photo);}self._downloadOriginals(title,photoArray,source);});};zfl_PhotoDownload.prototype._canShortCircuit=function(photos){for(var i=0;
2961i<photos.length;i++){var photo=photos[i];if(typeof(photo)=='number'||!photo.loaded)return false;if(photo.owner&&photo.owner.id==zf_userId)continue;if(photo.video)continue;
2962if((photo.access.mask&zf_AccessMask.ProtectOriginals)!=0||(photo.access.mask&zf_AccessMask.PasswordProtectOriginals)!=0){return false;}}return true;};zfl_PhotoDownload.prototype._getDownloadSizes=function(photos,
2963callback){;;var photoOwnerPairs=$.map(photos,function(photo){return{photoId:photo.id,ownerId:photo.owner.id};});zf_stdServerRequestEx("POST","/zf/core/core.asmx",
2964"GetPhotoDownloadSizes",[photoOwnerPairs],function(sizes,error){if(error!=null){$(document).trigger('done.zflpd');return;}var mappedPhotos={};for(var i=0;i<photos.length;
2965i++)mappedPhotos[photos[i].id]=photos[i];for(i=0;i<sizes.length;i++){var sizeMeta=sizes[i],thisPhoto=mappedPhotos[sizeMeta.photoId];thisPhoto.zipSize=thisPhoto.zipSize+sizeMeta.galleryFilesSize+(sizeMeta.galleryFilesCount*(30+256+46+256));
2966}photos=[];for(var id in mappedPhotos)photos.push(mappedPhotos[id]);callback(photos);});};zfl_PhotoDownload.prototype._downloadOriginal=function(photo){;this._downloadOriginals(photo.image.gallery.title,
2967[photo],null,false);if(this._controls&&this._controls.analytics)this._controls.analytics.registerDownload(photo.getHref("analytics")+"?download");if(this)return;
2968var url=null;if(photo.video){var largest=zf_ProcessingMethod.Video360p;if(photo.height>=480&&(photo.access.mask&zf_AccessMask.Protect480p)==0)largest=zf_ProcessingMethod.Video480p;
2969if(photo.height>=720&&(photo.access.mask&zf_AccessMask.Protect720p)==0)largest=zf_ProcessingMethod.Video720p;if(photo.height>=1080&&(photo.access.mask&zf_AccessMask.Protect1080p)==0)largest=zf_ProcessingMethod.Video1080p;
2970url=photo.getExternalUrl(largest)+"?dl=1";}else if((photo.access.mask&zf_AccessMask.PasswordProtectOriginals)==0){url=photo.getExternalUrl()+"?dl=1";}if(url!=null){location.href=url;
2971if(this._controls&&this._controls.analytics)this._controls.analytics.registerDownload(photo.getHref("analytics")+"?download");$(document).trigger('done.zflpd');return;
2972};var self=this;var photoOwnerPair=[{photoId:photo.id,ownerId:photo.owner.id}];zf_stdServerRequestEx("POST","/zf/core/core.asmx","GetSrcPasswordInfo",[photoOwnerPair],
2973function(info,error){if(error!=null){$(document).trigger('done.zflpd');return;}var start=function(key){var uri=[photo.getExternalUrl(),"?dl=1"];if(key)uri.push("&key=",
2974key);location.href=uri.join("");if(self._controls&&self._controls.analytics)self._controls.analytics.registerDownload(photo.getHref("analytics")+"?download");$(document).trigger('done.zflpd');
2975};self._getDownloadInput(photoOwnerPair,info,start);});};zfl_PhotoDownload.createProxy=function(parentControlId,downloadPopupClasses,fakeVideoOriginals,administrator,analytics,isAmdEnabled,
2976isSmdEnabled,maxZipSize,source){var obj=new zfl_PhotoDownload(isAmdEnabled,isSmdEnabled,maxZipSize);obj.id=parentControlId;obj.downloadPopupClasses=downloadPopupClasses;
2977obj._fakeVideoOriginals=fakeVideoOriginals;obj.administrator=administrator;if(analytics){obj._controls={analytics:analytics};}var proxy={};proxy.downloadOriginal=function(photo){return obj._downloadOriginal(photo);
2978};proxy.downloadOriginals=function(title,photos){return obj._downloadOriginals(title,photos,source,false);};proxy.download=function(photos,title){if($.isArray(photos)&&photos.length==1)return obj._downloadOriginal(photos[0]);
2979if(!$.isArray(photos))return obj._downloadOriginal(photos);return obj._downloadOriginals(title,photos,null,false);};return proxy;};(function(){function loadTpl(){var tpl=$('#podppod-tpl').removeAttr('id');
2980zfl_PhotoDownload._mobilePwdDlgTpl=tpl.clone();tpl.remove();zfl_PhotoDownload._mobilePwdDlgTpl.css('display','');tpl=$('#podppod-continue-tpl').removeAttr('id');
2981zfl_PhotoDownload._mobilePwdDlgContTpl=tpl.clone();tpl.remove();zfl_PhotoDownload._mobilePwdDlgContTpl.css('display','');}setTimeout(loadTpl,100);})();function zfb_ScrapbookAddShared(id,
2982btnAdd){zfl_Control.prototype.constructor.call(this,id);var self=this;this.$(".btn-cancel").click(this.closure(this.hide));this.$('input[name="scrapbook"]').bind('click change',
2983function(){var same=self.$('input[name="scrapbook"]:checked').val()=="same";self.$('.newset').toggleClass('disabled',same).find('input[name="title"]').prop('disabled',
2984same).iff(!same).select().trigger('change').focus();if(same)btnAdd.toggleEnabled(true);});this.$('input[name="title"]').bind('change keydown',zf_stdMakeDeferred(null,
2985function(){btnAdd.toggleEnabled(zf_stdTrim($(this).val()).length>0);}));}zfb_ScrapbookAddShared.inherits(zfl_Control);zfb_ScrapbookAddShared._storageKey="layout.scrapbook.addshared";zfb_ScrapbookAddShared.prototype.show=function(onadd){if(!this._canShowAgain(this._edit.current.id)){onadd(this._edit.current);
2986return;}var self=this;var name=this._edit.current.name;this.$(".popup-title").text(zf_stdFormatString("The current set of favorite photos, {0}, has already been shared with the photographer.",
2987name));if(/ \d+$/.test(name))name=name.replace(/(\d+)$/,function(v){return parseInt(v)+1;});else name=name+' 2';this.$('input[name="title"]').val([name]);this.$(".btn-add").unbind().bind('click',
2988function(){var same=self.$('input[name="scrapbook"]:checked').val()=="same";var title=zf_stdTrim(self.$('input[name="title"]').val());if(self.$('.btn-add .state').is('.disabled'))return false;
2989if(!same){zfb_Api.createScrapbook(title,zf_ownerId,function(result,error){if(!error)onadd(result);});}else{if(!!self.$('input[name="notagain"]').prop("checked"))self._saveNotAgain(self._edit.current.id);
2990onadd(self._edit.current);}self.hide();return false;});var cx=zf_stdGetClientWidth();var cy=zf_stdGetClientHeight();zf_Curtain.show("light");this.$().detach().appendTo(document.body).show().css("left",
2991(cx-this.$().width())/2).css("top",(cy-this.$().height())/2);this.$('input[name="scrapbook"][value="same"]').prop('checked',true).trigger('change');this.$('input[name="notagain"]').prop("checked",
2992false);};zfb_ScrapbookAddShared.prototype.hide=function(){zf_Curtain.hide();this.$().hide();return false;};zfb_ScrapbookAddShared.prototype.init=function(edit){;this._edit=edit;};zfb_ScrapbookAddShared.prototype._saveNotAgain=function(scrapbookId
2992){var list=zf_storage.getItem(zfb_ScrapbookAddShared._storageKey);
2993list=!!list?list.split(','):[];list.push(scrapbookId);zf_storage.setItem(zfb_ScrapbookAddShared._storageKey,list.join(','));};zfb_ScrapbookAddShared.prototype._canShowAgain=function(scrapbookId){var list=zf_storage.getItem(zfb_ScrapbookAddShared._storageKey);
2994list=!!list?list.split(','):[];return $.inArray(""+scrapbookId,list)==-1;};function zfb_ScrapbookCreate(id,btnCreate){zfl_Control.prototype.constructor.call(this,id);var self=this;
2995this.$(".btn-cancel").click(this.closure(this.hide));this.$('input[name="title"]').bind('change keydown',zf_stdMakeDeferred(null,function(){btnCreate.toggleEnabled(zf_stdTrim($(this).val()).length>0);
2996}));}zfb_ScrapbookCreate.inherits(zfl_Control);zfb_ScrapbookCreate.prototype.show=function(onadd){var self=this;var name=this._edit.current.name;if(/ \d+$/.test(name))name=name.replace(/(\d+)$/,function(v){return parseInt(v)+1;
2997});else name=name+' 2';this.$('input[name="title"]').val([name]);this.$(".btn-create").unbind().bind('click',function(){var title=zf_stdTrim(self.$('input[name="title"]').val());
2998zfb_Api.createScrapbook(title,zf_ownerId,function(result,error){if(!error)onadd(result);});self.hide();return false;});var cx=zf_stdGetClientWidth();var cy=zf_stdGetClientHeight();
2999if(!this.isDtlOn())zf_Curtain.show("light");this.$().detach().appendTo(document.body).show().css("left",(cx-this.$().width())/2).css("top",(cy-this.$().height())/2).find('input[name="title"]').select().focus();
3000};zfb_ScrapbookCreate.prototype.hide=function(){if(!this.isDtlOn())zf_Curtain.hide();this.$().hide();return false;};zfb_ScrapbookCreate.prototype.init=function(edit){;this._edit=edit;};zfb_ScrapbookCreate.prototype.isDtlOn=function(){return $('.dimlights.lb').is(':visible');
3001};function zfb_GuestScrapbook(photographerId){;zf_Object.constructor.call(this);this._storageKey='zf_guest_favs_'+photographerId;}zfb_GuestScrapbook.inherits(zf_Object);zfb_GuestScrapbook.prototype.get=function(){;
3002var favoritesInfo={keys:[],purchase:false};var favorites=zf_storage.getItem(this._storageKey);if(!favorites){return favoritesInfo;}if(zf_stdStartsWith(favorites,
3003"{")){return $.extend(favoritesInfo,jQuery.parseJSON(favorites));}else{try{var keys=favorites.split(",");favoritesInfo.keys=keys;}catch(e){;this.clear();}return favoritesInfo;
3004}};zfb_GuestScrapbook.prototype.add=function(photoKeys,purchase,returnPages){;;if(photoKeys.length===0){return;}var favoritesInfo=this.get();for(var i=0;i<photoKeys.length;i++){if($.inArray(photoKeys[i],
3005favoritesInfo.keys)<0){favoritesInfo.keys.push(photoKeys[i]);}}if(!purchase){purchase=false;}favoritesInfo.purchase=purchase;if(returnPages){favoritesInfo.returnPages=returnPages;
3006}zf_storage.setItem(this._storageKey,JSON.stringify(favoritesInfo));};zfb_GuestScrapbook.prototype.clear=function(){;zf_storage.removeItem(this._storageKey);};function zfb_ScrapbookEdit(id,
3007currentInfo,openedInfo,photogId,photogDisplayName,canShareWithPhotog,canShareWithOthers,slideshowDuration,slideshowKenburns,cookieName,addShared,create,isAmdEnabled,
3008isSmdEnabled,maxSmdZipSize){zfl_Control.prototype.constructor.call(this,id);zfl_PhotoDownload.prototype.constructor.call(this,isAmdEnabled,isSmdEnabled,maxSmdZipSize);
3009;this.current=openedInfo?openedInfo:currentInfo;this._owned=currentInfo;this._photogId=photogId;this._photogDisplayName=photogDisplayName;this._cookieName=cookieName;
3010this._pending={};this._canShareWithPhotog=canShareWithPhotog;this._canShareWithOthers=canShareWithOthers;this._slideshowDuration=slideshowDuration;this._slideshowKenburns=slideshowKenburns;
3011this._guestScrapbook=new zfb_GuestScrapbook(photogId);if(zf_userId){this._saveGuestFavorites();}this.downloadPopupClasses="lb lb-font1";this._addShared=addShared;
3012this._addShared.init(this);this._create=create;this._create.init(this);}zfb_ScrapbookEdit.PhotoState={Added:0,Adding:1,Removing:2,NotAdded:3};zfb_ScrapbookEdit.inherits(zfl_Control,zfl_PhotoDownload);
3013zfb_ScrapbookEdit.prototype.isCreatingNew=function(){return!this.current&&!!$.keys(this._pending).length;};zfb_ScrapbookEdit.prototype.show=function(){if(this._isShown)return;this._isShown=true;var self=this;
3014var parent=document.getElementById('mat-frame');if(!parent)this._isShown=false;zf_Flash.hide();$(window).triggerHandler('dtl-close');this._documentStyles=Zenfolio.Global.DomHelpers.saveDocumentStyles();
3015$('BODY').css('overflow-y','hidden');$('HTML, BODY').scrollTop(0);$('BODY').addClass('scrapbook-visible');$(parent).append($(this.dom()).removeClass('none'));if(this._init===undefined){this.$('.sbe-btn-close').click(this.closure(this.hide));
3016zf_stdLoadScript('scrapbook.js',function(){self._init();});}else{this._init();}};zfb_ScrapbookEdit.prototype.hide=function(){$(this.dom()).addClass('none');
3016zf_Flash.show();this._isShown=false;
3017$(window).unbind('.sbe');if(this._select)this._select.hide();var scrapbook=this.current;if(scrapbook&&scrapbook.isReadOnly&&!scrapbook.isOwned)scrapbook=this._owned;
3018if(scrapbook)scrapbook.addedCount=undefined;this._makeCurrent(scrapbook);Zenfolio.Global.DomHelpers.restoreDocumentStyles(this._documentStyles);$('BODY').removeClass('scrapbook-visible');
3019this._resizeParent();$(window).trigger('resize');};zfb_ScrapbookEdit.prototype._resizeParent=function(){};zfb_ScrapbookEdit.prototype.keyDown=function(e){if(this._isShown&&!Zenfolio.Global.DomHelpers.isTextFieldFocused()){this._keyDown&&this._keyDown(e);
3020if(!(this._slideshow&&this._slideshow.$().is(':visible'))){e.stopImmediatePropagation();}}};zfb_ScrapbookEdit.prototype.addPhotosNoCheck=function(photoKeys,purchase,callback,returnPages){var self=this;
3021if(this.current){for(var i=0;i<photoKeys.length;i++){var photoKey=photoKeys[i];if(!this.current.map[photoKey])this.current.map[photoKey]=true;}}var currentId=this.current&&this.current.id;
3022$.each(photoKeys,function(idx,val){self._pending[val]=zfb_ScrapbookEdit.PhotoState.Adding;});zfb_Api.addToScrapbook(this.current,this._photogId,photoKeys,!!purchase,
3023returnPages,function(result,error){if(currentId==(result&&result.id))$.each(photoKeys,function(idx,val){delete self._pending[val];});if(error!=null){return;}self._makeCurrent(result);
3024if(callback)callback();});};zfb_ScrapbookEdit.prototype.addPhotos=function(photoKeys,purchase,callback,returnPages){var readWriteShared=this.current&&!this.current.isOwned&&!this.current.isReadOnly;
3025if(!zf_userId&&!readWriteShared){if(zf_loginDlg){zf_loginDlg.show(this.closure(this.addPhotosToTheGuestScrapbook,photoKeys,purchase,null,returnPages),false,"Save Favorites",
3026zf_stdFormatString("Please log in or create an account to save Favorites. {0} will also get a copy of your favorites.",this._photogDisplayName));}return;}this._doAddPhotos(photoKeys,
3027purchase,callback,readWriteShared,returnPages);};zfb_ScrapbookEdit.prototype._doAddPhotos=function(photoKeys,purchase,callback,readWriteShared,returnPages){if(!zf_userId&&!readWriteShared){this.addPhotosToTheGuestScrapbook(photoKeys,
3028purchase,function(){location.reload();},returnPages);return;}if(!this.current||!this.current.isShared||(!zf_userId&&readWriteShared)){this.addPhotosNoCheck(photoKeys,
3029purchase,callback,returnPages);return;}var self=this;this._addShared.show(function(scrapbook){if(scrapbook!==this.current)self._makeCurrent(scrapbook);self.addPhotosNoCheck(photoKeys,
3030purchase,callback,returnPages);});};zfb_ScrapbookEdit.prototype.addPhotosToTheGuestScrapbook=function(photoKeys,purchase,callback,returnPages){this._guestScrapbook.add(photoKeys,
3031purchase,returnPages);if(callback){callback();}};zfb_ScrapbookEdit.prototype.removePhotos=function(photoKeys,callback){var self=this;if(this.current){for(var i=0;i<photoKeys.length;
3032i++){var photoKey=photoKeys[i];if(this.current.map[photoKey])this.current.map[photoKey]=null;}}var currentId=this.current&&this.current.id;$.each(photoKeys,function(idx,
3033val){self._pending[val]=zfb_ScrapbookEdit.PhotoState.Removing;});zfb_Api.removeFromScrapbook2(this.current,photoKeys,function(result,error){if(currentId==(result&&result.id))$.each(photoKeys,
3034function(idx,val){delete self._pending[val];});if(error!=null){return;}self._makeCurrent(result);if(callback)callback();});};zfb_ScrapbookEdit.prototype.switchTo=function(scrapbook){;
3035if(this.current&&this.current.id==scrapbook.id)return;if(scrapbook.loaded){this._makeCurrent(scrapbook);this.returnData&&this.show();return;}var self=this;zfb_Api.loadScrapbook(scrapbook,
3036function(sb){self.switchTo(sb);});};zfb_ScrapbookEdit.prototype.loadCurrent=function(callback){if(!this.current||this.current.loaded){callback&&callback(this.current);return;}var self=this;
3037zfb_Api.loadScrapbook(this.current,function(sb){self._makeCurrent(sb);callback&&callback(sb);});};zfb_ScrapbookEdit.prototype.getPhotoState=function(photoKey){if(!photoKey)return zfb_ScrapbookEdit.PhotoState.NotAdded;
3038if(this._pending[photoKey])return this._pending[photoKey];return this.current&&this.current.map[photoKey]?zfb_ScrapbookEdit.PhotoState.Added:zfb_ScrapbookEdit.PhotoState.NotAdded;
3039};zfb_ScrapbookEdit.prototype.addNewSet=function(){var self=this;if(!zf_userId&&zf_loginDlg){zf_loginDlg.show(function(){var expires=new Date();expires.setMinutes(expires.getMinutes()+10);
3040zf_stdSetCookie('zf_zb_opensb_add_new_set',1,expires,true);},false,"Create New Favorites","Please log in or create an account to create new Favorites.");return;}this._create.show(function(scrapbook){self.switchTo(scrapbook);
3041});};zfb_ScrapbookEdit.prototype._makeCurrent=function(scrapbook){var isDifferent=(this.current&&this.current.id)!=(scrapbook&&scrapbook.id);
3041if(isDifferent)this._pending={};this.current=scrapbook;
3042if(this.onchange)this.onchange(scrapbook,this._isShown?this:null);this.$().trigger("currentChange",[scrapbook,isDifferent]);if(!scrapbook){zf_stdRemoveCookie(this._cookieName,
3043false);zf_stdRemoveCookie("zf_osb",true);}else if(scrapbook.isOwned){var expires=new Date();expires.setMonth(expires.getMonth()+3);zf_stdSetCookie(this._cookieName,
3044scrapbook.token,expires,true,false);zf_stdRemoveCookie("zf_osb",true);}else{zf_stdSetCookie("zf_osb",scrapbook.token,null,true,true);}};zfb_ScrapbookEdit.prototype._saveGuestFavorites=function(){;
3045var self=this;$(function(){var favoritesInfo=self._guestScrapbook.get();if(favoritesInfo.keys.length===0){return;}self.addPhotos(favoritesInfo.keys,favoritesInfo.purchase,
3046function(){self._guestScrapbook.clear();},favoritesInfo.returnPages);});};;function zfb_Api(){;}zfb_Api._queue=new zf_RequestQueue(1,1);zfb_Api.selectAsYearbookPose=function(yearbookPose,
3047photogId,photoId,backgroundId,oncomplete){;;zfb_Api._queue.enqueueEx("POST","/zf/core/yearbook.asmx","SelectAsYearbookPose",[yearbookPose.id,photogId,photoId,backgroundId],
3048oncomplete);};zfb_Api.removeFromYearbookPose=function(yearbookPose,photogId,photoId,oncomplete){;;zfb_Api._queue.enqueueEx('POST','/zf/core/yearbook.asmx','RemoveFromYearbookPose',
3049[yearbookPose.id,photogId,photoId],oncomplete);};function zfb_GuestYearbookPose(photographerId){;zf_Object.constructor.call(this);this._storageKey='zf_guest_yearbook_'+photographerId;
3050}zfb_GuestYearbookPose.inherits(zf_Object);zfb_GuestYearbookPose.prototype.get=function(){;var yearbookPoseInfo={key:null};var yearbookPose=zf_storage.getItem(this._storageKey);if(!yearbookPose){return yearbookPoseInfo;
3051}return jQuery.parseJSON(yearbookPose);};zfb_GuestYearbookPose.prototype.add=function(photoKey){;;var yearbookPoseInfo=this.get();if(yearbookPoseInfo.key!=photoKey){yearbookPoseInfo.key=photoKey;
3052}zf_storage.setItem(this._storageKey,JSON.stringify(yearbookPoseInfo));};zfb_GuestYearbookPose.prototype.clear=function(){;zf_storage.removeItem(this._storageKey);};function zfb_YearbookEdit(id,
3053yearbookPose,photogId,photogDisplayName){zfl_Control.prototype.constructor.call(this,id);this.current=yearbookPose;this._photogId=photogId;this._photogDisplayName=photogDisplayName;
3054this._defaults={imageSize:{cx:200,cy:200},dialogWidth:450};this._guestYearbookPose=new zfb_GuestYearbookPose(photogId);if(zf_userId){this._saveGuestYearbookPose();
3055}}zfb_YearbookEdit.PhotoState={Added:0,Adding:1,Removing:2,NotAdded:3};zfb_YearbookEdit.inherits(zfl_Control);zfb_YearbookEdit.prototype.addPhoto=function(photo,callback,refreshUICallback,doNotShowCurtain){;if(photo.video){zfl_MessageBox.show({encode:true,
3056curtain:!doNotShowCurtain,text:"Only photo can be selected as your Yearbook Pose.",buttons:["OK"]});return;}if(!zf_userId){if(zf_loginDlg){zf_loginDlg.show(this.closure(this._addPhotosToTheGuestYearbookPose,
3057photo),false,"Select Yearbook Pose","Thank you for selecting a Yearbook Pose for your student. Please log into your account, or create a new account using the email address used to invite you to select your Yearbook pose.");
3058}return;}if(!!zf_userId&&zf_userId==zf_ownerId){zfl_MessageBox.show({encode:true,curtain:!doNotShowCurtain,text:"Yearbook feature is available only to the clients who are invited to select Yearbook Pose.",
3059buttons:["OK"]});return;}this._selectPhotoAsYearbookPose(photo,callback,refreshUICallback,doNotShowCurtain);};zfb_YearbookEdit.prototype.removePhoto=function(photo,callback,refreshUICallback,
3060doNotShowCurtain){;;;var self=this;this.current.photo=null;this._photoState=zfb_YearbookEdit.PhotoState.Removing;if(refreshUICallback){refreshUICallback();}zfb_Api.removeFromYearbookPose(this.current,
3061this._photogId,photo.id,function(result,error){if(error!=null){return;}self._photoState=null;self._makeCurrent(result,doNotShowCurtain);if(callback){callback();}});
3062};zfb_YearbookEdit.prototype.getPhotoState=function(photoId){if(!photoId){return zfb_YearbookEdit.PhotoState.NotAdded;}if(this._photoState){return this._photoState;}return this.current&&this.current.photo&&this.current.photo.id==photoId?zfb_YearbookEdit.PhotoState.Added:zfb_YearbookEdit.PhotoState.NotAdded;
3063};zfb_YearbookEdit.prototype._addPhotosToTheGuestYearbookPose=function(photo,callback){;this._guestYearbookPose.add(zf_PhotoKey.getString(photo));if(callback){callback();}};zfb_YearbookEdit.prototype._selectPhotoAsYearbookPose=function(photo,
3064callback,refreshUICallback,doNotShowCurtain){;;var self=this;if(!zf_userId){this._addPhotosToTheGuestYearbookPose(photo,function(){location.reload();});return;}var currentPhoto=this.current.photo;
3065if(!!currentPhoto&&currentPhoto.id==photo.id){if(refreshUICallback){refreshUICallback();}if(callback){callback();}return;}var serverCall=function(){self.current.photo=photo;
3066self._photoState=zfb_YearbookEdit.PhotoState.Adding;if(refreshUICallback){refreshUICallback();}zfb_Api.selectAsYearbookPose(self.current,self._photogId,photo.id,
3067zf_PhotoKey.getBackgroundId(photo),function(result,error){if(error!=null){return;}self._photoState=null;self._makeCurrent(result,doNotShowCurtain);if(callback){callback();
3068}});};if(!!currentPhoto&&currentPhoto.id!==photo.id){var method=currentPhoto.pickMethod(this._defaults.imageSize.cx,this._defaults.imageSize.cy,true);var photoLoader=new zf_PhotoLoader(currentPhoto,
3069method);photoLoader.onload=this.closure2(this._onPhotoLoaded,photoLoader,"You are about to change your selected yearbook pose. Would you like to continue?",["Cancel",
3070"Change yearbook pose"],function(buttonIndex){if(buttonIndex==1){serverCall();}else if(buttonIndex==0){if(callback){callback();}}},doNotShowCurtain,500);photoLoader.start();
3071return;}serverCall();};zfb_YearbookEdit.prototype._makeCurrent=function(yearbookPose,doNotShowCurtain){var isShowDialog=!!yearbookPose&&!!yearbookPose.photo;this.current=yearbookPose;
3072if(isShowDialog){var method=this.current.photo.pickMethod(this._defaults.imageSize.cx,this._defaults.imageSize.cy,true);var photoLoader=new zf_PhotoLoader(this.current.photo,
3073method);photoLoader.onload=this.closure2(this._onPhotoLoaded,photoLoader,"Congrats, you have selected your yearbook pose!",["OK"],null,doNotShowCurtain,null);photoLoader.start();
3074}if(this.onchange){this.onchange(yearbookPose);}};zfb_YearbookEdit.prototype._onPhotoLoaded=function(photoLoader,text,buttons,onbutton,doNotShowCurtain,width,state,src){if(state!=zf_PhotoLoader.Complete){zfl_MessageBox.show({encode:false,
3075curtain:!doNotShowCurtain,text:text,buttons:buttons,onbutton:onbutton});}else{var size=photoLoader.getImageSize();var marginLeft=((width||this._defaults.dialogWidth)-size.cx-32)/2;
3076zfl_MessageBox.show({encode:false,curtain:!doNotShowCurtain,text:"<img style=\"margin-left:"+marginLeft+"px; width:"+size.cx+"px; height:"+size.cy+"px; background-image:url("+src+");\">",
3077text2:text,buttons:buttons,onbutton:onbutton,width:width});}};zfb_YearbookEdit.prototype._saveGuestYearbookPose=function(){;var self=this;$(function(){var yearbookPoseInfo=self._guestYearbookPose.get();
3078if(!yearbookPoseInfo.key){return;}if(!self.current){self._guestYearbookPose.clear();zfl_MessageBox.show({encode:true,curtain:true,text:zf_stdFormatString("Unfortunately the email address used for this account is not tied to any student. Please contact {0} to clarify which email address they used for your child/student.",
3079self._photogDisplayName),buttons:["OK"]});return;}var photoKey=zf_PhotoKey.fromString(yearbookPoseInfo.key);if(!!self.current.photo&&self.current.photo.id==photoKey.photoId){self._guestYearbookPose.clear();
3080return;}self.addPhoto(photoKey.toFakePhoto(),function(){self._guestYearbookPose.clear();});});};;function zfl_CookieWarning(id){zfl_Control.prototype.constructor.call(this,
3081id);var markup=$('<html><body>    <div class=\x22coowarn-policy coowarn-color3 coowarn-font3\x22>        <div class=\x22coowarn-policy-inner\x22>            <p>Zenfolio owns, licenses and/or operates this website. We use cookies and similar online technologies on this website to improve your website experience; enhance the website’s functionality; and monitor and record activities and communications to, from, and on the website. Any and all information (including personal data) derived from our website may be retained in the United States. You can read the full cookie policy <a class=\x22coowarn-policy-ref\x22 href=\x22#\x22 >here</a>.</p>            <div class=\x22coowarn-consent-btn\x22>				<a class=\x22coowarn-allow\x22>Allow all</a>				<a class=\x22coowarn-decline\x22>Decline all</a>			</div>            <p>We use cookies on our website for a variety of reasons which you can learn about below. Unless you have adjusted your browser settings (where possible) to refuse cookies, our systems will issue cookies as soon you visit our website. If you have switched off cookies then some of the functionality of our services may not be available to you.</p>            <p class=\x22coowarn-h1 coowarn-font4\x22>The cookies set by our website fall into the following categories:</p>            <div class=\x22coowarn-name-section\x22>				<p class=\x22coowarn-h2 coowarn-font4\x22>Strictly Necessary Cookies</p>				<p class=\x22coowarn-h2 coowarn-font4\x22>Always Active</p>			</div>            <p>These cookies are essential to ensure that you can navigate and use all features of the site. This includes browsing pages, remembering your preferences, saving favorite images, secure registration, placing orders, 3rd party functionality (including but not limited to YouTube, CloudFlare) other essential features. Zenfolio doesn’t gather any information about you from these cookies that could be used for marketing or remembering where you’ve been on the Internet.</p>            <div class=\x22coowarn-name-section\x22>			<p class=\x22coowarn-h2 coowarn-font4\x22>Functionality</p>			<label class=\x22evspce-customizefield__switch\x22>				<input type=\x22checkbox\x22 value=\x221\x22/>				<div class=\x22slider round\x22></div>			</label>			</div>            <p>Functionality cookies are used to provide services, or to remember settings to improve your visit. We use them for remembering settings you’ve applied, showing you when you’re logged in to the website, saving your favorite images, and so on.</p>			<div class=\x22coowarn-name-section\x22>			<p class=\x22coowarn-h2 coowarn-font4\x22>Performance</p>			<label class=\x22evspce-customizefield__switch\x22>				<input type=\x22checkbox\x22 value=\x222\x22 />				<div class=\x22slider round\x22></div>			</label>			</div>			<p>These cookies collect information about how you use a website, like which pages you visited and which links you clicked on. None of this information can be used to identify you. It is all aggregated and, therefore, anonymized. Their sole purpose is to improve website functions. This includes cookies from third-party analytics services as long as the cookies are for the exclusive use of the owner of the website visited.</p>			<div class=\x22coowarn-name-section\x22>			<p class=\x22coowarn-h2 coowarn-font4\x22>Marketing</p>			<label class=\x22evspce-customizefield__switch\x22>				<input type=\x22checkbox\x22 value=\x224\x22 />				<div class=\x22slider round\x22></div>			</label>			</div>			<p>
3081These cookies track your online activity to help advertisers deliver more relevant advertising or to limit how many times you see an ad. These cookies can share that information with other organizations or advertisers.</p>		</div>    </div></body></html>'.replace('<html>',
3082'').replace('</html>','').replace('<body>','').replace('</body>',''));markup.find('.coowarn-policy-inner').attr('id',id+'_cw');markup.find('.coowarn-policy-ref').attr('href',
3083zf_stdGetProtocol(zf_defaultHost)+zf_defaultHost.replace('www.','')+'/cookies/');$(function(){if(zf_cookieConsentManager.IsCookieConsentConfirmed())$('.coowarn:first').hide();
3084else $('.coowarn:first').show();});const hideCookieMbox=function(){if(!!coowarnMessageBox){coowarnMessageBox.hide();}};var coowarnMessageBox=null;$("#user-settings").removeClass("hidden");
3085$('.coowarn-text:first A, #user-settings').click(function(){if(zf_cookieConsentManager.IsCookieConsentConfirmed()){var cookieConsentMask=zf_cookieConsentManager.GetCookieConsent();
3086var cookieGroups=markup.find('.coowarn-policy-inner .evspce-customizefield__switch input');for(var i=0;i<cookieGroups.length;i++){if((cookieGroups[i].value&cookieConsentMask)==cookieGroups[i].value){$(cookieGroups[i]).attr('checked',
3087'checked');}else{$(cookieGroups[i]).removeAttr('checked');}}}coowarnMessageBox=zfl_MessageBox.show({encode:false,curtain:true,text:markup[0].outerHTML,title:'Cookie Policy',
3088buttons:['SAVE'],classes:'coowarn-mbox',onbutton:function(){var mask=zf_CookieGroup.StrictlyNecessary;var selectedGroups=$('.coowarn-mbox .evspce-customizefield__switch input');
3089for(var i=0;i<selectedGroups.length;i++){if(selectedGroups[i].checked){mask|=selectedGroups[i].value;}}zf_cookieConsentManager.SaveCustom(mask);$('.coowarn').remove();
3090}});new zf_ScrollBar(id+'_cw',22);$('.coowarn-mbox').append('<span class="coowarn-close-mbox"></span>');$('.coowarn-mbox .coowarn-close-mbox').click(hideCookieMbox);
3091return false;});$('body').on('click','.coowarn-consent-btn .coowarn-allow',function(){zf_cookieConsentManager.AllowAll();hideCookieMbox();$('.coowarn').remove();
3092});$('body').on('click','.coowarn-consent-btn .coowarn-decline',function(){zf_cookieConsentManager.DeclineAll();hideCookieMbox();$('.coowarn').remove();});}zfl_CookieWarning.inherits(zfl_Control);
3093;function zfl_UserAgreementPopup($button){var contentId=$button.attr("id")+"_content";$button.click(function(evt){evt.preventDefault();$.get($(this).attr("href"),function(data){var msgBox=zfl_MessageBox.show({encode:false,
3094curtain:true,text:$(data).html(),title:'',buttons:['Close'],classes:'coowarn-mbox'});msgBox.$(".text .coowarn-policy-inner").attr("id",contentId);new zf_ScrollBar(contentId,
309522);});return false;});};function zf_CollectionInfoCoreApi(){this._photoSetIds=null;this._isRestoring=false;this.getMissingPhotos=function(collectionId,ownerId,callback){;
3096;const handleResponse=function(result,error){if(result){this._photoSetIds=result.photoSetIds;this._isRestoring=result.isRestoring;}result.hasMissingPhotos=result.photoSetIds!=null&&result.photoSetIds!='';
3097callback&&callback(result,error);};zf_stdServerRequestEx("GET","/zf/layout/layout.asmx","GetCollectionPhotoInfoById",[collectionId,ownerId],handleResponse.bind(this));
3098};this.restoreCollection=function(ownerId,callback){;zf_stdServerRequestEx("POST","/zf/layout/layout.asmx","HandleRestoreGalleryByPhotoSetIds",[this._photoSetIds,
3099ownerId],callback);};};function zflc_CollectionInfo(controlId,collectionId){zfl_Control.prototype.constructor.call(this,controlId);this._coreApi=new zf_CollectionInfoCoreApi();
3100this._collectionInfoBlockElm=document.querySelector('#'+controlId);this._restoreBtnElm=this.$('#'+controlId+'_CollectionRestore-state');this._restoreBtnLabelElm=this.$('.collection-info-button .label');
3101this._restoreMessageElm=this.$('.collection-info-text');if(collectionId!=null&&zf_ownerId!=null){this.check(collectionId,zf_ownerId);}}zflc_CollectionInfo.inherits(zfl_Control);zflc_CollectionInfo.prototype.check=function(collectionId,
3102ownerId){var callback=function(result,error){if(result){if(result.hasMissingPhotos){if(result.isRestoring){this._restoreBtnLabelElm.text('Restoring...');this._restoreBtnElm.addClass('s-disabled');
3103this._restoreMessageElm.text('Allow at least 12 hours for image retrieval.');}else{this._restoreBtnLabelElm.text('Restore');this._restoreBtnElm.removeClass('s-disabled');
3104this._restoreMessageElm.text('Some images are archived and can be restored.');}this._restoreMessageElm.addClass("restore-message");this._collectionInfoBlockElm.classList.remove("hide");
3105}return;}if(error){throw error;}};this._coreApi.getMissingPhotos(collectionId,ownerId,callback.bind(this));};zflc_CollectionInfo.prototype.handleRestoreClicked=function(){this._restoreBtnElm.addClass('s-disabled');
3106var callback=function(result,error){if(this._coreApi._photoSetIds!=null&&result){this._restoreBtnLabelElm.text('Restoring...');this._restoreBtnElm.addClass('s-disabled');
3107this._restoreMessageElm.text('Allow at least 12 hours for image retrieval.');}else{this._restoreMessageElm.text('Sorry, an unexpected error has occurred. Please try again later.');
3108this._restoreBtnElm.css('display','none');}if(error){throw error;}};this._coreApi.restoreCollection(zf_ownerId,callback.bind(this));return;};;;zf.$namespace('zf.zentobox.framework',
3109{Component:zf.$class(zf_Control,{_ctor:function(id){zf_Control.prototype.constructor.call(this,id);},init:function(data){},getMinWidth:function(){return 0;},getMaxWidth:function(){return Number.MAX_VALUE;
3110},resize:function(cx,cy,constraints){return{cx:cx,cy:cy};},togglePlay:function(play){}})});;
3110zf.$namespace('zf.zentobox',{RichText:zf.$class(null,{_ctor:function(zentoboxes,
3111width){var constraints={minWidth:0,minHeight:0,cellWidth:null,cellRound:function(x){return x;}};$.each(zentoboxes,function(){this.resize(width,10000,constraints);
3112});}})});;function zf_ScrollBar(id,cyLine){zf_Control.prototype.constructor.call(this,id);this._cyLine=cyLine;this._extendScroll=$(this.dom().parentNode.parentNode).hasClass('js-sv-extend-scroll');
3113this.update=zf_stdMakeDeferred(id+".ScrollBar.update",this._update);var self=this;this.update();}zf_ScrollBar.inherits(zf_Control);zf_ScrollBar.prototype.close=function(){this._isClosed=true;
3114};zf_ScrollBar.prototype._update=function(){if(this._isClosed)return;this.$dom().css('padding-bottom','');var scrollNode=this.dom().parentNode;this._outerHeight=scrollNode.offsetHeight;
3115this._innerHeight=scrollNode.scrollHeight;if(this._outerHeight+scrollNode.scrollTop>this._innerHeight)scrollNode.scrollTop=Math.max(0,this._innerHeight-this._outerHeight);
3116var show=this._innerHeight>this._outerHeight;if(show&&this._extendScroll){this.$dom().css('padding-bottom',this._outerHeight/2);}this._show(show);this._outerHeight=scrollNode.offsetHeight;
3117this._innerHeight=scrollNode.scrollHeight;if(show&&this._nodesCreated)this._scrollTo();};zf_ScrollBar.prototype.getScrollPos=function(){return this.dom().parentNode.scrollTop;
3118};zf_ScrollBar.prototype.scrollTo=function(pos){if(this._isClosed)return;this.dom().parentNode.scrollTop=pos;this.update();};zf_ScrollBar.prototype._show=function(show){var barStyle=this._nodesCreated?this.dom("_bar").style:null;
3119if(show&&(barStyle==null||barStyle.visibility!="inherit")){if(barStyle==null){var node=this._createNodes();if(node==null)return;barStyle=node.style;}zf_stdReplaceClassName(this.dom().parentNode.parentNode,
3120"sv-noscroll","sv-scroll");barStyle.visibility="inherit";}if(!show&&barStyle!=null&&barStyle.visibility!="hidden"){zf_stdReplaceClassName(this.dom().parentNode.parentNode,
3121"sv-scroll","sv-noscroll");barStyle.visibility="hidden";}};zf_ScrollBar.prototype._scrollTo=function(pos){if(pos==null)pos=this.dom().parentNode.scrollTop;var barNode=this.dom("_bar");
3122var topNode=this.dom("_top");var thumbNode=this.dom("_thumb");var upperNode=this.dom("_upper");var lowerNode=this.dom("_lower");var cyActive;var cyThumb;var cyPos;
3123cyActive=barNode.offsetHeight-this._cyTop-this._cyBottom;cyActive=Math.max(cyActive,0);if(cyActive==0||this._innerHeight==this._outerHeight)return;cyThumb=Math.floor(this._outerHeight*cyActive/this._innerHeight);
3124cyThumb=Math.max(cyThumb,33);cyPos=Math.floor(pos*(cyActive-cyThumb)/(this._innerHeight-this._outerHeight));thumbNode.style.top=(this._cyTop+cyPos)+"px";thumbNode.style.height=(cyThumb-this._cyThumbExtra)+"px";
3125upperNode.style.height=cyPos+"px";lowerNode.style.height=(cyActive-cyPos)+"px";};zf_ScrollBar.prototype._createNodes=function(){var id=this.id;var barNode=document.createElement("DIV");
3126barNode.className="sb sb-color1 sb-bgcolor4";barNode.id=id+"-_bar";var html=['<div class="sb-upper sb-color1 sb-bgcolor1" id="',id,'-_upper">','<div class="sb-normal sb-color1 sb-bgcolor1"></div>',
3127'</div>','<div class="sb-lower sb-color1 sb-bgcolor1" id="',id,'-_lower">','<div class="sb-normal sb-color1 sb-bgcolor1"></div>','</div>','<div class="sb-top sb-color1 sb-bgcolor4" id="',
3128id,'-_top">','<div class="sb-normal sb-color1 sb-bgcolor4 sb-bgimage1"></div>','</div>','<div class="sb-bottom sb-color1 sb-bgcolor4" id="',id,'-_bottom">','<div class="sb-normal sb-color1 sb-bgcolor4 sb-bgimage2"></div>',
3129'</div>','<div class="sb-thumb sb-color4 sb-bgcolor4" id="',id,'-_thumb">','<div class="sb-normal sb-color4 sb-bgcolor4 sb-bgimage3"></div>','</div>'].join("");barNode.innerHTML=html;
3130this.dom().parentNode.parentNode.appendChild(barNode);var topNode=this.dom("_top");var bottomNode=this.dom("_bottom");var upperNode=this.dom("_upper");var lowerNode=this.dom("_lower");
3131var thumbNode=this.dom("_thumb");this._cyTop=topNode.offsetHeight;this._cyBottom=bottomNode.offsetHeight;var cyThumbOuter=thumbNode.offsetHeight;var cyThumbInner=zf_stdExtractPixels(zf_stdGetCurrentStyle(thumbNode,
3132"height","height"));this._cyThumbExtra=cyThumbOuter-cyThumbInner;upperNode.style.top=this._cyTop+"px";lowerNode.style.bottom=this._cyBottom+"px";var self=this;upperNode.onmouseover=lowerNode.onmouseover=function(){this.firstChild.className="sb-hover sb-color1 sb-bgcolor2";
3133};upperNode.onmouseout=lowerNode.onmouseout=function(){this.firstChild.className="sb-normal sb-color1 sb-bgcolor1";self._elem_onmouseup(this);};upperNode.onmousedown=lowerNode.onmousedown=function(e){this.firstChild.className="sb-active sb-color1 sb-bgcolor3";
3134self._elem_onclick(e,this);};upperNode.onmouseup=lowerNode.onmouseup=function(){this.firstChild.className="sb-hover sb-color1 sb-bgcolor1";self._elem_onmouseup(this);
3135};topNode.onmouseover=function(){this.firstChild.className="sb-hover sb-color2 sb-bgcolor5 sb-bgimage1";};topNode.onmouseout=function(){this.firstChild.className="sb-normal sb-color1 sb-bgcolor4 sb-bgimage1";
3136self._elem_onmouseup(this);};topNode.onmousedown=function(e){this.firstChild.className="sb-active sb-color3 sb-bgcolor6 sb-bgimage1";self._elem_onclick(e,this);};
3137topNode.onmouseup=function(){this.firstChild.className="sb-hover sb-color2 sb-bgcolor5 sb-bgimage1";self._elem_onmouseup(this);};bottomNode.onmouseover=function(){this.firstChild.className="sb-hover sb-color2 sb-bgcolor5 sb-bgimage2";
3138};bottomNode.onmouseout=function(){this.firstChild.className="sb-normal sb-color1 sb-bgcolor4 sb-bgimage2";self._elem_onmouseup(this);};bottomNode.onmousedown=function(e){this.firstChild.className="sb-active sb-color3 sb-bgcolor6 sb-bgimage2";
3139self._elem_onclick(e,this);};bottomNode.onmouseup=function(){this.firstChild.className="sb-hover sb-color2 sb-bgcolor5 sb-bgimage2";self._elem_onmouseup(this);};
3140upperNode.dblclick=lowerNode.ondblclick=topNode.ondblclick=bottomNode.ondblclick=zf_stdFalse;thumbNode.onmouseover=function(e){self._thumb_onmouseover(e,this);};
3141thumbNode.onmouseout=function(e){self._thumb_onmouseout(e,this);};thumbNode.onmousedown=function(e){self._thumb_onmousedown(e,this);};thumbNode.onmouseup=function(e){self._thumb_onmouseup(e,
3142this);};thumbNode.onmousemove=function(e){self._thumb_onmousemove(e,this);};thumbNode.onselectstart=zf_stdFalse;upperNode=null;lowerNode=null;topNode=null;bottomNode=null;
3143thumbNode=null;this.dom().addEventListener("DOMMouseScroll",this.eventHandler(this._parent_onmousewheel),false);this.dom().addEventListener("mousewheel",this.eventHandler(this._parent_onmousewheel),
3144false);this._nodesCreated=true;return barNode;};zf_ScrollBar.prototype._lineUp=function(){var scrollNode=this.dom().parentNode;if(scrollNode.scrollTop>0){scrollNode.scrollTop-=this._cyLine;
3145this._scrollTo();}};zf_ScrollBar.prototype._lineDown=function(){var scrollNode=this.dom().parentNode;if(scrollNode.scrollTop<scrollNode.scrollHeight){scrollNode.scrollTop+=this._cyLine;
3146this._scrollTo();}};zf_ScrollBar.prototype._pageUp=function(){var scrollNode=this.dom().parentNode;if(scrollNode.scrollTop>0){var cyPage=Math.max(this._outerHeight-this._cyLine,
3147this._cyLine);scrollNode.scrollTop-=cyPage;this._scrollTo();}};zf_ScrollBar.prototype._pageDown=function(){var scrollNode=this.dom().parentNode;if(scrollNode.scrollTop<scrollNode.scrollHeight){var cyPage=Math.max(this._outerHeight-this._cyLine,
3148this._cyLine);scrollNode.scrollTop+=cyPage;this._scrollTo();}};zf_ScrollBar.prototype._elem_onclick=function(e,node){zf_stdStopPropagation(e);this._action=null;var className=node.className.split(' ')[0];
3149switch(className){case "sb-top":this._action=this._lineUp;break;case "sb-bottom":this._action=this._lineDown;break;case "sb-upper":this._action=this._pageUp;break;
3150case "sb-lower":this._action=this._pageDown;break;default:;break;}if(this._action==null)return;this._action();if(this.onscroll!=null)this.onscroll();var self=this;
3151this._timeout=setTimeout(function(){if(self._action!=null){self._action();if(self.onscroll!=null)self.onscroll();self._interval=setInterval(function(){if(self._action!=null){self._action();
3152if(self.onscroll!=null)self.onscroll();}},80);}},400);};zf_ScrollBar.prototype._elem_onmouseup=function(){if(this._interval!=null){clearInterval(this._interval);delete this._interval;
3153}if(this._timeout!=null){clearTimeout(this._timeout);delete this._timeout;}};zf_ScrollBar.prototype._thumb_onmousedown=function(e,thumbNode){e=zf_stdGetEvent(e);thumbNode.firstChild.className="sb-active sb-color6 sb-bgcolor6 sb-bgimage3";
3154if(document.addEventListener){document.addEventListener("mouseover",zf_ScrollBar._noop,true);document.addEventListener("mouseout",zf_ScrollBar._noop,true);document.addEventListener("selectstart",
3155zf_ScrollBar._noop,true);
3155document.addEventListener("mousemove",thumbNode.onmousemove,true);document.addEventListener("mouseup",thumbNode.onmouseup,true);}else if(thumbNode.setCapture)thumbNode.setCapture();
3156this._anchorX=e.clientX;this._anchorY=e.clientY;this._anchorTop=zf_stdExtractPixels(zf_stdGetCurrentStyle(thumbNode,"top","top"));this._thumbTrack=true;if(this.onscrollstart!=null)this.onscrollstart();
3157zf_stdStopPropagation(e);zf_stdPreventDefault(e);};zf_ScrollBar.prototype._thumb_onmousemove=function(e){if(!this._thumbTrack)return;e=zf_stdGetEvent(e);zf_stdStopPropagation(e);
3158zf_stdPreventDefault(e);var top=this._anchorTop+e.clientY-this._anchorY;var cyActive;var cyThumb;cyActive=this.dom("_bar").offsetHeight-this._cyTop-this._cyBottom;
3159cyActive=Math.max(cyActive,0);cyThumb=Math.floor(this._outerHeight*cyActive/this._innerHeight);cyThumb=Math.max(cyThumb,33);var scrollTop=Math.floor((top-this._cyTop)*(this._innerHeight-this._outerHeight)/(cyActive-cyThumb));
3160this.dom().parentNode.scrollTop=scrollTop;this._scrollTo();if(this.onscrolling!=null)this.onscrolling();};zf_ScrollBar.prototype._thumb_onmouseup=function(e){this._thumbTrack=false;
3161e=zf_stdGetEvent(e);zf_stdStopPropagation(e);zf_stdPreventDefault(e);var thumbNode=this.dom("_thumb");if(e.srcElement==thumbNode||e.target==thumbNode||e.srcElement==thumbNode.firstChild||e.target==thumbNode.firstChild)thumbNode.firstChild.className="sb-hover sb-color5 sb-bgcolor5 sb-bgimage3";
3162else thumbNode.firstChild.className="sb-normal sb-color4 sb-bgcolor4 sb-bgimage3";if(document.removeEventListener){document.removeEventListener("mouseover",zf_ScrollBar._noop,
3163true);document.removeEventListener("mouseout",zf_ScrollBar._noop,true);document.removeEventListener("selectstart",zf_ScrollBar._noop,true);document.removeEventListener("mousemove",
3164thumbNode.onmousemove,true);document.removeEventListener("mouseup",thumbNode.onmouseup,true);}else if(thumbNode.releaseCapture)thumbNode.releaseCapture();if(this.onscroll!=null)this.onscroll();
3165};zf_ScrollBar.prototype._thumb_onmouseover=function(e,thumbNode){if(!this._thumbTrack)thumbNode.firstChild.className="sb-hover sb-color5 sb-bgcolor5 sb-bgimage3";};zf_ScrollBar.prototype._thumb_onmouseout=function(e,
3166thumbNode){if(!this._thumbTrack)thumbNode.firstChild.className="sb-normal sb-color4 sb-bgcolor4 sb-bgimage3";};zf_ScrollBar.prototype._parent_onmousewheel=function(e){if(!this.$dom().hasClass("sv-pause")){var delta=e.wheelDelta?e.wheelDelta:(e.detail>0?-120:120);
3167if(delta>0){while(delta>0){this._lineUp();delta-=120;}}else{while(delta<0){this._lineDown();delta+=120;}}if(this.onscroll)this.onscroll();}zf_stdPreventDefault(e);
3168zf_stdStopPropagation(e);};zf_ScrollBar._noop=function(e){e=$.event.fix(e);e.stopPropagation();e.preventDefault();return false;};zf_ScrollBar.prototype._ensureVisible=function(top,height,
3169speed,completed,needQueue){var dom=this.dom();var node=dom.parentNode;var pos=this.getScrollPos();var size=node.offsetHeight;if(top<pos)pos=top;else if(top-pos+height>size)pos=top+height-size;
3170var max=node.scrollHeight;pos=Math.min(pos+size,max)-size;dom=null;if(pos!=node.scrollTop){var self=this;if(speed){$(node).animate({scrollTop:pos},{duration:speed,
3171easing:"swing",complete:function(){self.scrollTo(pos);completed&&completed();},step:function(){self._update();},queue:!!needQueue});return;}else{node.scrollTop=pos;
3172this.scrollTo(pos);}}completed&&completed();};zf_ScrollBar.prototype._isVisible=function(top,height){var node=this.dom().parentNode;var pos=this.getScrollPos();var size=node.offsetHeight;
3173if(top<pos)pos=top;else if(top-pos+height>size)pos=top+height-size;if(pos!=node.scrollTop)return false;return true;};zf_ScrollBar.prototype.getLineHeight=function(){return this._cyLine;
3174};zf_ScrollBar.prototype.lineUp=function(){if(this._isClosed)return;if(this._nodesCreated)this._lineUp();};zf_ScrollBar.prototype.lineDown=function(){if(this._isClosed)return;if(this._nodesCreated)this._lineDown();
3175};;function zf_ScrollView(id,cyLine){zf_Control.prototype.constructor.call(this,id);zf_stdSetClientObject(id,this);if(cyLine!=null)this._init(cyLine);}zf_ScrollView.inherits(zf_Control);
3176zf_ScrollView.prototype.getContentNode=zf_Control.prototype.dom;zf_ScrollView.prototype.update=function(sync){if(sync)this._bar._update();
3176else this._bar.update();};zf_ScrollView.prototype.getScrollPos=function(){return this._bar.getScrollPos();
3177};zf_ScrollView.prototype.scrollTo=function(pos){this._bar.scrollTo(pos);};zf_ScrollView.prototype.getLineHeight=function(){return this._bar.getLineHeight();};zf_ScrollView.prototype.getBar=function(){return this._bar;
3178};zf_ScrollView.prototype.lineUp=function(){this._bar.lineUp();};zf_ScrollView.prototype.lineDown=function(){this._bar.lineDown();};zf_ScrollView.prototype.pageUp=function(){this._bar.pageUp();};zf_ScrollView.prototype.pageDown=function(){this._bar.pageDown();
3179};zf_ScrollView.prototype.getHeight=function(){return document.getElementById(this.id).parentNode.offsetHeight;};zf_ScrollView.prototype.setHeight=function(cy){if(cy<0)cy=0;this.dom().parentNode.parentNode.style.height=cy+"px";
3180};zf_ScrollView.prototype.disable=function(){this._bar.close();};zf_ScrollView.prototype.ensureVisible=function(top,height,speed,completed,needQueue){this._bar._ensureVisible(top,height,speed,
3181completed,needQueue);};zf_ScrollView.prototype.isVisible=function(top,height){return this._bar._isVisible(top,height);};zf_ScrollView.prototype._init=function(cyLine){;this._bar=new zf_ScrollBar(this.id,
3182cyLine);var self=this,timer=null;this.$().parent().bind('scroll',function(){self.onscrolling&&self.onscrolling();if(timer!=null)clearTimeout(timer);timer=setTimeout(function(){timer=null;
3183self.onscroll&&self.onscroll();},250);});};;function zf_Tree(id,storageKey){;zf_Control.prototype.constructor.call(this,id);this._storageKey=storageKey;this._expanded={};
3184$(this.closure(this._init));}zf_Tree.inherits(zf_Control);zf_Tree.None=0;zf_Tree.Select=1;zf_Tree.Expand=2;zf_Tree.Edit=3;zf_Tree.ToggleCheck=4;zf_Tree.Unchecked=0;zf_Tree.Checked=1;zf_Tree.PartialChecked=2;zf_Tree.prototype.clear=function(){this.emptyItem("");
3185};zf_Tree.prototype.setItem=function(id,item){;if(id==null)id="";var node=this._find(id);if(item.title!=null)node.find("A").html(item.title);if(item.action!=null){var self=this;
3186var action=typeof(item.action)=="function"?item.action:null;var href=typeof(item.action)=="string"?item.action:"#";node.find(".tree-item").unbind("mousedown").mousedown(function(e){self._item_onmousedown(this,
3187e,action);}).find("A").unbind("click").attr("href",href).iff(href=="#").bind("click",zf_stdFalse);}if(item.cssClass!=null){var cssClass="tree-node";if(node.hasClass("tree-root"))cssClass+=" tree-root";
3188if(node.hasClass("tree-selected"))cssClass+=" tree-selected";if(node.hasClass("tree-expanded"))cssClass+=" tree-expanded";if(node.hasClass("tree-collapsed"))cssClass+=" tree-collapsed";
3189if(item.cssClass!='')cssClass+=" "+item.cssClass;node.attr('class',cssClass);}if(item.checkState!=null||item.disabled!=null){if(item.checkState!=null)this._check(node,
3190item.checkState);if(item.disabled!=null)node.toggleClass('disabled',!!item.disabled);}if(item.extra!=null){var anchor=node.find("A");anchor.nextAll().remove();anchor.after(item.extra);
3191}};zf_Tree.prototype.getItemRect=function(id){;var node=this._find(id),position=node.position();return{left:position.left,top:position.top,right:position.left+node.outerWidth(),
3192bottom:position.top+node.outerHeight()};};zf_Tree.prototype.hasItem=function(id){;var node=this._find(id);return node.length==1;};zf_Tree.prototype.getSelectedItem=function(){var node=this.$("DIV.tree-selected");
3193return node.length==1?zf_Tree._getNodeId(node.attr("id")):null;};zf_Tree.prototype.getCheckedItems=function(){var res=[];var nodes=this.$('DIV.tree-checkbox.checked').closest('.tree-node');
3194nodes.each(function(i,node){res.push(zf_Tree._getNodeId(node.id));});return res;};zf_Tree.prototype.getUncheckedItems=function(){var res=[];var nodes=this.$('DIV.tree-checkbox:not(.checked)').closest('.tree-node:not(.tree-root)');
3195nodes.each(function(i,node){res.push(zf_Tree._getNodeId(node.id));});return res;};zf_Tree.prototype._getCheckedState=function(node){;var checkbox=node.find('.tree-checkbox');
3196if(checkbox.hasClass('checked'))return zf_Tree.Checked;else if(checkbox.hasClass('semichecked'))return zf_Tree.PartialChecked;return zf_Tree.Unchecked;};zf_Tree.prototype.getCheckedState=function(id){;
3197var node=this._find(id);var checkbox=node.find('.tree-checkbox');if(checkbox.hasClass('checked'))return zf_Tree.Checked;else if(checkbox.hasClass('semichecked'))return zf_Tree.PartialChecked;
3198return zf_Tree.Unchecked;};zf_Tree.prototype.insertItem=function(item,parent,before){;var cssClass="tree-node";if(item.cssClass!=null)cssClass+=" "+item.cssClass;if(parent==null)parent="";
3199var id=item.id;var action=typeof(item.action)=="function"?item.action:null;var href=typeof(item.action)=="string"?item.action:"#";var title=item.title!=null?item.title:"";
3200var children=item.children;var elem=document.createElement("DIV");elem.id=this.id+"-i-"+id;elem.className=cssClass;var iconClass=item.isDisableArchive?'blue-icon tree-icon':(item.isIntermediate?'red-icon tree-icon':'tree-icon');
3201elem.innerHTML=['<div class="tree-btn"></div>','<div class="tree-checkbox"></div>','<div class="tree-item">','<div class="',iconClass,'"></div>','<a href="',href,
3202'" onclick="return false;">',title,'</a>',item.extra!=null?item.extra:'','</div>'].join("");var expand=parent!=""&&this._expanded[parent];parent=this._find(parent);
3203;var branch;if(!(branch=parent.next()).hasClass("tree-branch")){parent.after('<div class="tree-branch"></div>');branch=parent.next();}if(before!=null){before=branch.children("DIV#"+this.id+"-i-"+before);
3204if(before.length!=1)before=null;}if(before!=null)before.before(elem);else branch.append(elem);if(expand)parent.removeClass("tree-collapsed").addClass("tree-expanded");
3205else if(!parent.hasClass("tree-expanded"))parent.addClass("tree-collapsed");if(item.checkState!=null||item.disabled!=null){var $item=this._find(item.id);;if(item.checkState!=null)this._check($item,
3206item.checkState);if(item.disabled!=null)$item.toggleClass('disabled',!!item.disabled);}var self=this;var btn=elem.firstChild;item=$(btn).nextAll('.tree-item');$(btn).mousedown(function(e){self._btn_onmousedown(this,
3207e);});item.mousedown(function(e){self._item_onmousedown(this,e,action);}).dblclick(function(e){self._item_ondblclick(this,e);});if(href=="#")item.find("A").bind("click",
3208zf_stdFalse);if(this.enableHover){item.hover(function(e){self._item_onmouseover(this,e);},function(e){self._item_onmouseout(this,e);});}if($(this.dom()).hasClass('tree-checkboxes'))$(elem).find('.tree-checkbox').mousedown(this.closure(this._checkbox_onmousedown));
3209if(this.lazy&&children!=null&&children>0){if(this._expanded[id])this.oniteminit(id);else $(elem).addClass("tree-collapsed");}elem=null;btn=null;item=null;parent=null;
3210before=null;branch=null;};zf_Tree.prototype.emptyItem=function(id){;var node=this._find(id);node.next("DIV.tree-branch").remove();if(id!="")node.removeClass("tree-expanded").removeClass("tree-collapsed");
3211if(this._hoverLocked!=null&&this._hoverLocked!=""&&this.dom("i-"+this._hoverLocked)==null){this._hoverLocked=null;}};zf_Tree.prototype.deleteItem=function(id){;;var node=this.$dom("i-"+id);
3212if(!node.length)return false;var parent=this._parent(node);node.next("DIV.tree-branch").remove().end().remove();if((node=parent.next("DIV.tree-branch")).find("DIV.tree-node").length==0){node.stop(true,
3213true).remove();parent.removeClass("tree-expanded").removeClass("tree-collapsed");}if(this._hoverLocked!=null&&this._hoverLocked!=""&&this.dom("i-"+this._hoverLocked)==null){this._hoverLocked=null;
3214}return true;};zf_Tree.prototype.clickItem=function(id){;this._find(id,".tree-item").mousedown();};zf_Tree.prototype.selectItem=function(id,noAnimation){if(id!=null){var node=this._find(id);
3215if(!node.length)return;this._select(node);if(id!=""){node=this._parent(node);while(!node.hasClass("tree-root")){this._expand(node,true,null,noAnimation);node=this._parent(node);
3216}}}else{this.$("DIV.tree-selected").removeClass("tree-selected");}};zf_Tree.prototype.checkItem=function(id,checked,noAnimation,disableExpanding){if(id!=null){var node=this._find(id);
3217this._check(node,checked);if(id!=""&&!disableExpanding){node=this._parent(node);while(!node.hasClass("tree-root")){this._expand(node,true,null,noAnimation);node=this._parent(node);
3218}}}else{if(checked)this.$('DIV.tree-checkbox').addClass('checked');else this.$('DIV.tree-checkbox').removeClass('checked semichecked');}};zf_Tree.prototype.disableAllItems=function(disabled){var node=this.$(".tree-node").toggleClass('disabled',
3219!!disabled);};zf_Tree.prototype.disableItem=function(id,disabled){;var node=this._find(id);node.toggleClass('disabled',!!disabled);};zf_Tree.prototype.isDisabled=function(id){;
3220var node=this._find(id);return node.hasClass('disabled');};zf_Tree.prototype.editItem=function(id,title,onedit){;var node=this._find(id);var self=this;if(title==null)title=node.find("DIV.tree-item A").text();
3221node.append("<textarea>"+title+"</textarea>");var item=node.find("DIV.tree-item"),edit=node.find("TEXTAREA"),left=item.position().left+parseInt(item.css('paddingLeft'),
322210)+parseInt(item.css('borderLeftWidth'),10)-parseInt(edit.css('paddingLeft'),10)-parseInt(edit.css('borderLeftWidth'),10),right=parseInt(item.css('paddingRight'),
322310);edit.css('left',left+'px').width(item.width()).height(item.height());function end(e){e=$.event.fix(e);if((e.type=="click"||e.type=="mousedown")&&e.target==edit.get(0))return;
3224var title=edit.val();if(onedit!=null){if(!onedit(title)){edit.get(0).focus();}}else{self.setItem(id,{title:title});}if(document.removeEventListener){document.removeEventListener("mousedown",
3225end,true);document.removeEventListener("click",end,true);}edit.remove();}edit.keydown(function(e){var j=$(this);if(e.keyCode==27){j.remove();return;}if(e.keyCode==13){end(e);
3226return;}var fixup=j.outerHeight()-j.height()-2;zf_stdDeferCall('treeedit.'+id,function(){if(this.scrollHeight-fixup>j.height())j.height(this.scrollHeight-fixup);
3227},this);});edit.blur(end);if(document.addEventListener){document.addEventListener("mousedown",end,true);document.addEventListener("click",end,true);}edit.get(0).select();
3228edit.get(0).focus();};zf_Tree.prototype.expandItem=function(id,noAnimation){;this._expand(id,true,this.onexpand!=null?this.closure(this.onexpand):null,noAnimation);};zf_Tree.prototype.collapseItem=function(id,
3229noAnimation){var self=this;var onexpand=this.onexpand!=null?this.closure(this.onexpand):null;if(id==null){var expanded=this.$('.tree-expanded').each(function(){self._expand($(this),
3230false,onexpand,noAnimation);});return;}this._expand(id,false,onexpand,noAnimation);};zf_Tree.prototype._init=function(){var self=this;this.$("DIV.tree-btn").mousedown(function(e){self._btn_onmousedown(this,
3231e);});this.$("DIV.tree-checkbox").mousedown(this.closure(this._checkbox_onmousedown));this.$("DIV.tree-item").mousedown(function(e){self._item_onmousedown(this,e);
3232}).dblclick(function(e){self._item_ondblclick(this,e);});if(this.enableHover){this.$("DIV.tree-item").hover(function(e){self._item_onmouseover(this,e);},function(e){self._item_onmouseout(this,
3233e);});}this.$("DIV.tree-expanded").each(function(){self._expanded[zf_Tree._getNodeId(this.id)]=true;});if(this._storageKey!=null){var state=zf_storage.getItem(this._storageKey);
3234if(state!=null){state=state.toString();state=state.split(',');for(var i=0;i<state.length;i++){var id=state[i];var j=this.$dom("i-"+id);this._expanded[id]=true;if(j.hasClass("tree-collapsed")){j.removeClass("tree-collapsed").addClass("tree-expanded");
3235}}}this._saveState();}if(this.onready!=null)this.onready();};zf_Tree.prototype.getItem=zf_Tree.prototype._find=function(id,expr){;var j=this.$dom(id==""?"root":"i-"+id);
3236if(expr!=null)j=j.find(expr);return j;};zf_Tree.prototype._parent=function(node){;;;return node.closest("DIV.tree-branch").prev();};zf_Tree.prototype._check=function(node,checkState){;
3237;;if(checkState==zf_Tree.PartialChecked){node.find('.tree-checkbox').removeClass('checked').addClass('semichecked');return zf_Tree.PartialChecked;}var checked=checkState==null?undefined:!!checkState;
3238var checkbox=node.find('.tree-checkbox').removeClass('semichecked').toggleClass('checked',checked);checked=checked!=null?checked:checkbox.hasClass('checked');return checked?zf_Tree.Checked:zf_Tree.Unchecked;
3239};zf_Tree.prototype._select=function(node){;;;if(!node.hasClass("tree-selected")){this.$("DIV.tree-selected").removeClass("tree-selected");node.addClass("tree-selected");
3240return true;}return false;};zf_Tree.prototype._expand=function(node,toggle,onexpand,noAnimation){;;;var expand=toggle===true;var collapse=toggle===false;var self=this;var id=node;
3241if(typeof(node)=="string")node=this._find(id);else id=zf_Tree._getNodeId(node.attr("id"));;if(expand)this._expanded[id]=true;else if(collapse)delete this._expanded[id];
3242if(node.length==1&&node.hasClass("tree-collapsed")&&!collapse){if(this.lazy&&node.next(".tree-branch").length==0)this.oniteminit(id);var expanded=function(){node.removeClass("tree-collapsed").addClass("tree-expanded");
3243onexpand&&onexpand(id,true);};if(node.next(".tree-branch").length>0){if(!noAnimation)node.next(".tree-branch").slideDown(75,expanded);else{node.next(".tree-branch").show();
3244expanded();}}this._expanded[id]=true;}else if(node.length==1&&node.hasClass("tree-expanded")&&!expand){var collapsed=function(){node.removeClass("tree-expanded").addClass("tree-collapsed");
3245onexpand&&onexpand(id,false);
3245if(node.next("DIV.tree-branch").find("DIV.tree-selected").length!=0){self._suppressExpand=true;node.find("DIV.tree-item").mousedown();
3246self._suppressExpand=false;var sel=node.next("DIV.tree-branch").find("DIV.tree-selected");if(sel.length!=0){sel.removeClass("tree-selected");if(self.onselchange)self.onselchange(null);
3247}}};var speed=!noAnimation?75:0;node.next(".tree-branch").slideUp(speed,collapsed);delete this._expanded[id];}if(this._storageKey!=null)zf_stdDeferCall(this.id+".save",
3248this._saveState,this);};zf_Tree.prototype._saveState=function(){;var state=[];for(var id in this._expanded)state.push(id);state=state.join(',');zf_storage.setItem(this._storageKey,
3249state);};zf_Tree.prototype.lockHover=function(id){if(this._hoverLocked==id)return;var node;if(this._hoverLocked!=null){node=this._find(this._hoverLocked);if(node.length>0){if(this.onitemmouseout==null||!this.onitemmouseout(this._hoverLocked))node.removeClass("tree-hover").find(".tree-action").remove();
3250}}if(id!=null){node=this._find(id);if(!node.hasClass("tree-hover")){node.addClass("tree-hover");if(this.onitemmouseover==null||!this.onitemmouseover(id)){var self=this;
3251node.find(".tree-item").append('<div class="tree-action"></div>').find(".tree-action").mousedown(function(e){e.stopPropagation();}).click(function(e){self._action_onclick(this,
3252e);});}}}this._hoverLocked=id;};zf_Tree._getNodeId=function(id){;var k;if((k=id.indexOf("-i-"))!=-1)return id.substr(k+3);return "";};zf_Tree.prototype._btn_onmousedown=function(node,
3253e){;;e.preventDefault();e.stopPropagation();this._expand($(node).closest(".tree-node"),null,this.onexpand!=null?this.closure(this.onexpand):null);};zf_Tree.prototype._checkbox_onmousedown=function(e){;
3254e.preventDefault();e.stopPropagation();var node=$(e.currentTarget).closest('.tree-node'),id=zf_Tree._getNodeId(node.attr('id'));if(!this.isDisabled(id)){var checkState=this._check(node);
3255this.onitemchecked&&this.onitemchecked(id,checkState==zf_Tree.Checked);}};zf_Tree.prototype._item_onmousedown=function(node,e,action){;;if(e.which!==1&&e.which!==undefined)return;
3256e.preventDefault();e.stopPropagation();node=$(node).closest(".tree-node");var href=node.find("A").attr("href");var id=zf_Tree._getNodeId(node.attr("id"));var ret=zf_Tree.Select;
3257if(this.onitemclick!=null)ret=this.onitemclick(id);switch(ret){case zf_Tree.Expand:if(!this._suppressExpand){this._expand(node,null,this.onexpand!=null?this.closure(this.onexpand):null);
3258}break;case zf_Tree.Select:if(this._select(node)){if(this.onselchange&&this.onselchange(id))return;if(action!=null)action();else if(href!=null&&href.indexOf("javascript:")==0){href=href.substr(11);
3259if(href!=""&&href!=";")eval();}else if(href!=null)location.href=href;}break;case zf_Tree.ToggleCheck:if(!this.isDisabled(id)){var checkState=this._check(node);this.onitemchecked&&this.onitemchecked(id,
3260checkState==zf_Tree.Checked);}break;default:break;}};zf_Tree.prototype._item_ondblclick=function(node,e){;;e.preventDefault();e.stopPropagation();node=$(node).closest(".tree-node");
3261var id=zf_Tree._getNodeId(node.attr("id"));var ret=zf_Tree.Edit;if(this.onitemdblclick!=null)ret=this.onitemdblclick(id);switch(ret){case zf_Tree.Edit:break;case zf_Tree.Expand:if(!this._suppressExpand){this._expand(node,
3262null,this.onexpand!=null?this.closure(this.onexpand):null);}break;default:break;}};zf_Tree.prototype._item_onmouseover=function(node,e,action){;;e.preventDefault();e.stopPropagation();
3263if(this._hoverLocked!=null)return;var self=this;node=$(node).closest(".tree-node").addClass("tree-hover");var id=zf_Tree._getNodeId(node.attr("id"));if(this.onitemmouseover==null||!this.onitemmouseover(id)){node.find(".tree-item").append('<div class="tree-action"></div>').find(".tree-action").mousedown(function(e){e.stopPropagation();
3264}).click(function(e){self._action_onclick(this,e);});}};zf_Tree.prototype._item_onmouseout=function(node,e,action){;;e.preventDefault();e.stopPropagation();node=$(node).closest(".tree-node");
3265var id=zf_Tree._getNodeId(node.attr("id"));if(id!=this._hoverLocked){if(node.hasClass("tree-hover")){node.removeClass("tree-hover");if(this.onitemmouseout==null||!this.onitemmouseout(id))node.find(".tree-action").remove();
3266}}};zf_Tree.prototype._action_onclick=function(node,e){;;e.preventDefault();e.stopPropagation();if(this.oncontextmenu!=null){node=$(node).closest("DIV.tree-node");var id=zf_Tree._getNodeId(node.attr("id"));
3267var popup=this.oncontextmenu(id);if(popup==null)return;this.lockHover(id);if(popup instanceof jQuery){popup.on('menupullup',this.closure2(this.lockHover,null)).menu('dropDown',
3268node.find('.tree-item'),'right');}else{popup.onhide=this.closure(this.lockHover,null);node=node.find(".tree-item");var offset=node.offset();var width=node.outerWidth();
3269var height=node.outerHeight();popup.show(offset.left+width,offset.top+height-1,true,20);}}};;zf.$namespace('zf.core',{EventSource:zf.$class(null,{_ctor:function(){this._handlers={};
3270},on:function(events,handler){if(!handler.guid)handler.guid=$.guid++;var self=this;$.each(events.split(' '),function(i,e){self._handlers[handler.guid+'#'+e]=handler;
3271});return this;},off:function(events,handler){var self=this,r={};$.each(events.split(' '),function(i,e){for(var k in self._handlers){if(self._match(k,e,handler))r[k]=true;
3272}});for(var k in r)delete this._handlers[k];return this;},trigger:function(events){var self=this;var r={};$.each(events.split(' '),function(i,e){for(var k in self._handlers){if(self._match(k,
3273e,null))r[k]=self._handlers[k];}});var args=[];for(var i=1;i<arguments.length;i++)args.push(arguments[i]);var ret;for(var k in r)ret=this._handlers[k].apply(this,
3274args);return ret;},_match:function(handlerId,eventName,handler){if(handler!=null){if(!handler.guid||handlerId.indexOf(handler.guid+'#')!=0)return false;}handlerId=handlerId.substr(handlerId.indexOf('#')+1);
3275if(eventName[0]=='.')return(handlerId.lastIndexOf(eventName)+eventName.length==handlerId.length);else if(eventName.indexOf('.')>0)return handlerId==eventName;else return handlerId==eventName||handlerId.indexOf(eventName+'.')==0;
3276}})});;function zf_SubAccount(){this.displayName=null;this.loginName=null;this.email=null;}zf_SubAccount.AccountOwner=$.extend(new zf_SubAccount(),{id:0,displayName:'Account Owner'});
3277zf_SubAccount.Everyone=$.extend(new zf_SubAccount(),{id:-1,displayName:'Everyone'});;zf.$namespace('zf.core',{TreeBrowser:zf.$class([zf_Control,zf.core.EventSource],{_ctor:function(id,
3278tree,sview,filter){zf_Control.prototype.constructor.call(this,id);zf.core.EventSource.prototype.constructor.call(this);this._sview=sview;this._tree=tree;this._tree.enableEdit=false;
3279this._tree.enableHover=false;this._tree.lazy=true;this._tree.oniteminit=this.closure2(this._tree_oniteminit);this._tree.onexpand=this._sview.closure2(this._sview.update);
3280this._filter=filter;},hasItem:function(itemId,callback){;if(callback){this._ensureItem(itemId,function(elem){callback(elem&&this._evalFilter(elem));});return undefined;
3281}else{var elem=this._items[itemId||this._rootId];return elem!=null&&this._evalFilter(elem);}},getItem:function(itemId,callback){;if(callback){this._ensureItem(itemId,
3282function(elem){callback(elem&&this._evalFilter(elem)?elem:null);});return undefined;}else{var elem=this._items[itemId||this._rootId];return(elem&&this._evalFilter(elem))?elem:null;
3283}},getChildren:function(itemId,callback){;var self=this;this.getItem(itemId,function(elem){if(elem&&elem instanceof zf_Folder){self._getFolder(elem,function(error){callback&&callback(elem);
3284});}else callback&&callback(elem);});},selectItem:function(itemId,callback){;if(itemId==this._rootId)itemId="";this._ensureItem(itemId,function(item){if(item!=null){this._expose(item);
3285this._tree.selectItem(itemId,true);this._sview.update(true);var rect=this._tree.getItemRect(itemId);this._sview.ensureVisible(rect.top,rect.bottom-rect.top+2);this._tree.onselchange&&this._tree.onselchange(itemId);
3286}callback&&callback();});},getTree:function(){return this._tree;},getRootId:function(){return this._rootId;},loadTree:function(onload){this._loadTree(onload);},_loadTree:function(onload){this._tree.clear();
3287this._tree.setItem(null,{title:"Loading...",cssClass:"",action:$.noop});this._tree.$dom().addClass('tree-loading');this._cacheId=typeof(zf_organizer)!="undefined"?zf_organizer._cacheId:null;
3288var self=this;this._items={};if(this._cacheId!=null)load();else{zf_stdServerRequestEx("POST","/zf/app/edit/edit.asmx","GetHierarchyCacheId",[zf_userId],function(result,
3289error){if(error!=null){onload&&onload();return;}self._cacheId=result;load();});}function load(){zf_stdServerRequestEx({method:"GET",sticky:true,url:"/zf/app/edit/edit.asmx",
3290api:"GetGroupHierarchy",params:[zf_userId,self._cacheId,true],callback:function(result,error){if(error==null){self._tree.$dom().removeClass('tree-loading');var root=result.root;
3291if(!!(self._partial=result.partial))root.elements=result.elements;var item={},access=root.access;item.title=zf_stdFormatString('<tt title="{0}"></tt><span>{1}</span>',
3292zf_AccessUtils[access.type].tooltip,zf_stdHtmlEncode(root.title));item.cssClass=root.isEvent?"org-evt":"org-fld";item.cssClass+=" org-"+zf_AccessUtils[access.type].cssClass;
3293if(!self._canEdit(root))item.cssClass+=" org-ro";self._oniteminit&&self._oniteminit(item,null,root);self._tree.setItem(null,item);self._rootId="fld"+root.id;self._items[self._rootId]=root;
3294self._load(root);self._tree_oniteminit(null);self._sview.update();self._loaded=true;}onload&&onload();}});}},_load:function(folder){;for(var i=0;i<folder.elements.length;
3295i++){var elem=folder.elements[i];elem.parent=folder;elem.access.parent=folder.access;elem.pricing.parent=folder.pricing;var id=this._getTreeId(elem);this._items[id]=elem;
3296if(elem instanceof zf_Folder)this._load(elem);}},_expose:function(elem){;if((elem=elem.parent)!=null&&elem.parent!=null){this._expose(elem);this._tree.expandItem(this._getTreeId(elem),
3297true);}},_getTreeNodeId:function(elem){return elem.parent!=null?this._getTreeId(elem):'';},_getTreeId:function(elem){if(elem instanceof zf_Folder)return "fld"+elem.id;
3298else if(elem.type==zf_PhotoSet.Gallery)return "gal"+elem.id;else if(elem.type==zf_PhotoSet.Collection)return "col"+elem.id;;return null;},_tree_oniteminit:function(itemId){var folder=this._items[itemId||this._rootId],
3299self=this,tree=this._tree;itemId&&tree.insertItem({id:itemId+'-loading',title:'Loading...'},itemId);function initTree(){itemId&&tree.deleteItem(itemId+'-loading');
3300for(var i=0;i<folder.elements.length;i++){var elem=folder.elements[i],include=false,access=elem.access,item={cssClass:"org-"+zf_AccessUtils[access.type].cssClass};
3301if(elem instanceof zf_Folder){item.id="fld"+elem.id;item.cssClass+=elem.isEvent?" org-evt":" org-fld";if(elem.elements.length==0){item.children=elem.subfolders+elem.galleries+elem.collections;
3302}else{item.children=0;for(var j=0;j<elem.elements.length;j++){var e=elem.elements[j];if(e instanceof zf_Folder)item.children++;else if(self._evalFilter(e))item.children++;
3303}}include=true;}else if(elem.type==zf_PhotoSet.Gallery){item.id="gal"+elem.id;item.cssClass+=" org-gal";include=self._evalFilter(elem);}else if(elem.type==zf_PhotoSet.Collection){item.id="col"+elem.id;
3304item.cssClass+=" org-col";include=self._evalFilter(elem);}if(include){if((access.mask&zf_AccessMask.Expires)!=0){item.cssClass+=" org-"+(access.type==zf_AccessType.Private?"expired":"expires");
3305}if(!self._canEdit(elem))item.cssClass+=" org-ro";item.title=zf_stdFormatString('<tt title="{0}"></tt><span>{1}</span>',zf_AccessUtils[access.type].tooltip,zf_stdHtmlEncode(elem.title));
3306item.action=$.noop;self._oniteminit&&self._oniteminit(item,itemId,elem);tree.insertItem(item,itemId);}}self._sview.update();}this._getFolder(folder,initTree);},_evalFilter:function(elem){var filter=this._filter;
3307if(!filter)return true;if($.isFunction(filter))return filter(elem);if(elem instanceof zf_Folder)return true;if(elem.type==zf_PhotoSet.Gallery)return filter.indexOf("gal")!=-1||filter==elem.id;
3308if(elem.type==zf_PhotoSet.Collection)return filter.indexOf("col")!=-1||filter==elem.id;;return false;},_canEdit:function(elem){;if(typeof(zf_organizer)!="undefined")return zf_organizer.canEdit(elem);
3309return true;},_ensureItem:function(itemId,callback){var item=this._items[itemId||this._rootId];if(item!=null){callback&&callback.call(this,item);return;}var self=this;
3310zf_stdServerRequestEx({method:"GET",sticky:true,url:"/zf/app/edit/edit.asmx",api:"GetElementPath",params:[zf_userId,this._cacheId,itemId],callback:function(result,
3311error){if(error)callback&&callback.call(self,null);else load(result);}});function load(path){if(path.length==0){callback&&callback.call(self,null);return;}var folder=self._items["fld"+path.shift()];
3312;self._getFolder(folder,function(error){if(error)callback&&callback.call(self,null);else if(path.length>0)load(path);else callback&&callback.call(self,self._items[itemId]);
3313});}},_getFolder:function(folder,callback){;;var self=this;if(folder.elements.length)callback(null);else if(folder.subfolders||folder.galleries||folder.collections){var list=folder.__tbList;
3314if(list){list.push(callback);return;}list=folder.__tbList=[callback];var notify=function(error){$.each(list,function(){this.call(null,error);});delete folder.__tbList;
3315};zf_stdServerRequestEx({method:"GET",sticky:true,url:"/zf/app/edit/edit.asmx",api:"GetFolderElements",params:[zf_userId,this._cacheId,folder.id],callback:function(result,
3316error){if(error)notify(error);else if(!folder.elements.length){folder.elements=result;self._load(folder);notify(null);}}});}else callback(null);}})});var zf_TreeBrowser=zf.core.TreeBrowser;
3317;zf.$namespace('zf.zentobox',{Editor:zf.$class([zf_Control,zf.core.EventSource],{_ctor:function(id,profile,cacheToken,types){zf_Control.prototype.constructor.call(this,
3318id);zf.core.EventSource.prototype.constructor.call(this);this._cacheToken=cacheToken;this._types=types;this._profile=profile;},show:function(zentoboxData,options){;
3319var data=$.extend({},zentoboxData);delete data.type;this._isNew=$.isEmptyObject(data);options=options||{};this._isBatchAllowed=!!options.allowBatch;var self=this;
3320$(window).bind('resize.zbe',this.closure(this.recalcLayout));$(document).bind('keydown.zbe',function(e){if(e.keyCode==27&&(!('zf_Dialog' in window)||zf_Dialog.top()==self))self.hide();
3321});$('BODY').append($(this.dom()));if('zf_Dialog' in window)zf_Dialog.push(this);else if('zf_Curtain' in window)zf_Curtain.show();
3321else if('zf_Flash' in window)zf_Flash.hide();
3322this._cssBody=$('BODY')[0].style.cssText;$('BODY').css('overflow-x','hidden');$('BODY').css('overflow-y','hidden');this._resize();this.$('DIV.zbe-frame:first').addClass('zbe-s-loading').append('<div class="zbe-loading">Loading...</div>');
3323this.$().show().removeClass('hide');if(!this._scriptLoaded){;Zenfolio.Global.ResourceService.loadScripts(["zentobox-edit.js","jqueryui.js"],function(){self._scriptLoaded=true;
3324self._load(zentoboxData);});}else{this._load(zentoboxData);}},hide:function(){;var self=this;$('BODY')[0].style.cssText=this._cssBody;this.$('DIV.zbe-loading').remove();
3325$(window).unbind('.zbe');$(document).unbind('.zbe');this.$().addClass('hide');this.trigger('hide');this._editor&&this._editor.destroy&&this._editor.destroy();this._editor=null;
3326this.$('DIV.zbe-main:first').remove();$('DIV.zbe-dialog').remove();setTimeout(function(){self.$().hide();if('zf_Dialog' in window)zf_Dialog.pop(self);else if('zf_Curtain' in window)zf_Curtain.hide();
3327else if('zf_Flash' in window)zf_Flash.show();;},200);zf.zentobox.Editor.current=null;},recalcLayout:function(){zf_stdDeferCall(this.id+'.recalcLayout',this._resize,
3328this);},_resize:function(){;var win=$(window);var width=win.width();var height=win.height();var cx=Math.max(Math.min(width-44,1425),950);var cy=Math.max(Math.min(height-44,
3329990),830);var x=(width-cx)/2-2;var y=(height-cy)/2-2;this.$().css('overflow-x',x<0?'scroll':'hidden');this.$().css('overflow-y',y<0?'scroll':'hidden');if(x<0)x=0;
3330if(y<0)y=0;this.$('DIV.zbe-frame:first').css('left',x+'px').css('top',y+'px').width(cx).height(cy);this.$('DIV.zbe-body:first').width(cx).height(cy);if(this._resizeImpl!==undefined)this._resizeImpl(cx,
3331cy);return{cx:cx,cy:cy};}})});$.extend(zf.zentobox.Editor,{current:null});;zf.$namespace('zf.zentobox',{Embed:zf.$class(zf.zentobox.framework.Component,{_ctor:function(id){zf.zentobox.framework.Component.prototype.constructor.call(this,
3332id);},resize:function(width,height,constraints){return{cx:this.$().width(),cy:this.$().height()};}})});;zf.$namespace('zf.zentobox',{PhotoVideo:zf.$class(zf.zentobox.framework.Component,
3333{_ctor:function(id,viewId,photo,method,width,height){zf.zentobox.framework.Component.prototype.constructor.call(this,id);this._viewId=viewId;this._photo=photo;this._method=zf_ProcessingMethod.fromCode(method);
3334this._size={cx:width,cy:height};},init:function(data,profile){;this._options=data;var options=data.options,content=data.content,layout=data.layout,click=options.click=options.click||{};
3335if(click.action==undefined)click.action=options.clickAction;if(click.url==undefined)click.url=options.clickUrl;if(profile=='fullscreen')options.hoverAction=zf.zentobox.PhotoVideo.HoverAction.None;
3336if(content.src!=null){this._photo=new zf.zentobox.PhotoVideo.ExternalPhoto(content.src,content.width,content.height);}if(this._photo==null)return;if(click.action==zf.zentobox.PhotoVideo.ClickAction.DimTheLights){var scope=this.$().closest('.zb-scope,BODY');
3337var list=scope.data('zf.zentobox.PhotoVideo.dimTheLights')||[];list.push(this._photo);scope.data('zf.zentobox.PhotoVideo.dimTheLights',list);}var photo=this._photo,
3338method=this._method,imageSize=layout.imageSize;var plugins=[new zfl_WaitAnimationPlugin(true),new zf_VideoPlayerPlugin(function(c){return c;}),new zf.zentobox.PhotoVideo.PhotoViewPlugin(data)];
3339plugins[1].standalone=true;if(options.autoPlay)plugins[1].autoPlay=true;if(profile=='fullscreen'){plugins[1].hideControls=true;plugins[1].forceHideControls=true;
3340plugins[1].forceHtml5();plugins[1].allowSimplePlayToggle=true;}plugins[2].onDimLights=this.closure(this._dimLights);this._view=new zf_PhotoView(this._viewId,plugins,
3341photo);if(this._view.$().hasClass('pv-ready'))return;if(imageSize==-2){method=$.extend({},method,{cx:Math.min(photo.width,layout.customWidth),cy:Math.min(photo.height,
3342layout.customHeight)});}else if(imageSize>=0){if((photo.flags&zf_PhotoFlags.Video)!=0)method=zf.zentobox.PhotoVideo.videoSizes[imageSize-2];method=$.extend({},method,
3343photo.getScaledSize(method));}else{method={code:-1};}if(method.code!=-1){this._view.resize(photo,photo,method);this._view.load(photo,method,true);}this._method=method;
3344},resize:function(width,height,constraints){;if(this._photo==null)return{cx:width,cy:height};var imageSize=this._options.layout.imageSize,photo=this._photo,method=this._method,
3345size;if(constraints.fill){method=this._pickFillMethod(photo,width,height);size={cx:width,cy:height};}else if(imageSize==-1){var minWidth=Math.max(photo.getScaledSize(zf_ProcessingMethod.StandardThumbnail).cx,
3346constraints.minWidth);width=constraints.cellRound(Math.max(Math.min(Math.round(height*photo.width/photo.height),width),minWidth));height=Math.round(width*photo.height/photo.width);
3347if(this._options.layout.browserScaling){method=photo.pickScaledMethod(width,height);size={cx:method.cx,cy:method.cy};}else{method=this._photo.pickMethod(width,height,
3348true)||zf_ProcessingMethod.StandardSmallSize;size=photo.getScaledSize(method);method=$.extend({},method,size);}}else{size=photo.getScaledSize(method);method=$.extend({},
3349this._method,size);}if(method!=this._method)this._view.resize(photo,photo,method);if(this._method.code!=method.code)this._view.load(photo,method,true);this._method=method;
3350return size;},_dimLights:function(){var list=this.$().closest('.zb-scope,BODY').data('zf.zentobox.PhotoVideo.dimTheLights');for(var index=0;list[index]!=this._photo&&index<list.length;
3351)index++;zf_DimLightsStandalone(list,index);},_pickFillMethod:function(photo,width,height){var options=[{method:zf_ProcessingMethod.StandardSmallSize,mask:0},{method:zf_ProcessingMethod.StandardMediumSize,
3352mask:zf_AccessMask.ProtectMedium},{method:zf_ProcessingMethod.StandardLargeSize,mask:zf_AccessMask.ProtectLarge},{method:zf_ProcessingMethod.StandardExtraLargeSize,
3353mask:zf_AccessMask.ProtectExtraLarge},{method:zf_ProcessingMethod.StandardXXLargeSize,mask:zf_AccessMask.Protect
3353XXLarge}];var anchors=[{x:0,y:0},{x:0.5,y:0},{x:1,
3354y:0},{x:0,y:0.5},{x:0.5,y:0.5},{x:1,y:0.5},{x:0,y:1},{x:0.5,y:1},{x:1,y:1}];var method=options[0].method,scaled=photo.getScaledSize(method),anchor=this._options.options.anchorPoint;
3355for(var i=1;i<options.length;i++){var option=options[i];if((option.mask&photo.access.mask)!=0)continue;method=option.method;scaled=photo.getScaledSize(method);if(scaled.cx>=width&&scaled.cy>=height)break;
3356}return $.extend({},method,{cx:width,cy:height,clip:true,stretch:true,anchor:anchors[anchor!=null?anchor:4]});}})});$.extend(zf.zentobox.PhotoVideo,{videoSizes:[$.extend({},
3357zf_ProcessingMethod.VideoPosterFrame,{cx:360,cy:270,format:'{0} x {1}'}),$.extend({},zf_ProcessingMethod.VideoPosterFrame,{cx:480,cy:360,format:'{0} x {1}'}),$.extend({},
3358zf_ProcessingMethod.VideoPosterFrame,{cx:560,cy:420,format:'{0} x {1}'}),$.extend({},zf_ProcessingMethod.VideoPosterFrame,{cx:720,cy:540,format:'{0} x {1}'})],ClickAction:{None:0,
3359DimTheLights:1,OpenGallery:2,GoToUrl:3},HoverAction:{None:0,OverlayText:1,DimUntilHovered:2}});$.extend(zf.zentobox.PhotoVideo,{PhotoViewPlugin:zf.$class(null,{_ctor:function(data){this._data=data;
3360var HoverAction=zf.zentobox.PhotoVideo.HoverAction,hoverAction=data.options.hoverAction,ClickAction=zf.zentobox.PhotoVideo.ClickAction,clickAction=data.options.click.action;
3361this._undim=hoverAction==HoverAction.DimUntilHovered;this._overlay=hoverAction==HoverAction.OverlayText;this._dimLights=clickAction==ClickAction.DimTheLights;this._openGallery=clickAction==ClickAction.OpenGallery;
3362this._noclick=clickAction==ClickAction.None;},getInnerContent:function(id,context){var photo=context,hoverAction=this._data.options.hoverAction;if(this._undim)return '<span class="pv-zb-dim"></span>';
3363else if(this._overlay){var title=this._data.content.title||context.title;var caption=this._data.content.caption!=null?zf_stdHtmlEncode(this._data.content.caption):context.caption;
3364if((title&&title.length)||(caption&&caption.length)){var html=['<span class="pv-zb-text">','<span class="pv-zb-text-bg"></span>'];if(title&&title.length)html.push('<h5>',
3365zf_stdHtmlEncode(title),'</h5>');if(caption&&caption.length)html.push('<p>',caption,'</p>');html.push('</span>');return html.join('');}}return '';},onCreateDom:function(view,
3366outer,inner,context,isNew){if(!isNew)$(inner).append(this.getInnerContent(view.id,context));zf_stdDisableRightClick($(inner).toggleClass('pv-zb-noclick',this._noclick));
3367if(context&&context.video&&(this._dimLights||this._openGallery)){var self=this;$(inner).unbind('click').click(function(e){e.stopPropagation();e.stopImmediatePropagation();
3368if(self._dimLights){self.onDimLights&&self.onDimLights();e.preventDefault();}});}if(this._noclick&&(context==null||!context.video))$(inner).unbind('click');},onDestroyDom:function(view,
3369outer,inner,context){}})});$.extend(zf.zentobox.PhotoVideo,{ExternalPhoto:zf.$class(zf_Photo,{_ctor:function(url,width,height){zf_Photo.prototype.constructor.call(this);
3370this.requested=this.loaded=true;this.id=Number.MAX_VALUE;this.width=width;this.height=height;this.src=url;this.gallery=null;this.photoSet=null;this.owner=null;this.access=new zf_AccessInfo(null,
3371zf_AccessType.Public,zf_AccessMask.None);this.cdnPath="";},getHref:function(){return this.src;},getInternalUrl:function(){return this.src;},getExternalUrl:function(){return this.src;
3372}})});;;zf.$namespace('zf.zentobox',{HomepageSlideshow:zf.$class(zf.zentobox.framework.Component,{_ctor:function(id,init){zf.zentobox.framework.Component.prototype.constructor.call(this,
3373id);this._viewId=init.viewId;this._parameters=init.parameters;this._slideshowvars=init.slideshowvars;this._clickTarget=init.clickTarget;this._photoSet=init.photoSet;
3374this._firstPhoto=init.photo;this._maxWidth=init.maxWidth;this._maxHeight=init.maxHeight;this._renderContext=init.renderContext;this._isPreview=init.renderContext.isPreview;
3375this._slideshowvars.keyring=zf_stdGetCookie("zf_keyring");this._presentationMode=this._getPresentationMode();this._needGenerateMarkup=null;var PM=zf.zentobox.HomepageSlideshow.PresentationMode;
3376switch(this._presentationMode){case PM.Flash:delete this._slideshowvars.photoSetToken;delete this._slideshowvars.ownerId;this._needGenerateMarkup=true;break;case PM.Html5:this._photoSet=zfl_stdTransformResponse(this._photoSet);
3377this._psToken=this._slideshowvars.photoSetToken;this._ownerId=parseInt(this._slideshowvars.ownerId);this._needGenerateMarkup=true;break;case PM.PhotoView:var photo=this._firstPhoto;
3378var plugins=[new zfl_WaitAnimationPlugin(true)];if(photo&&photo.video)plugins.push(new zf_VideoPlayerPlugin(function(c){return c;}));this._view=new zf_PhotoView(this._viewId,
3379plugins,photo);this._needGenerateMarkup=false;break;default:;break;};zf_stdMakeMethodsDeferred(this,this.id,["_generateFlash","_generateHtml5"]);},init:function(options){;
3380if(this._renderContext.isFixedWidth)this.resize(this._renderContext.width,this._maxHeight,{maxWidth:this._maxWidth,maxHeight:this._maxHeight});},resize:function(availWidth,
3381availHeight,constraints){;;;var size=this._calculateLayout(availWidth,availHeight,constraints);var PM=zf.zentobox.HomepageSlideshow.PresentationMode;switch(this._presentationMode){case PM.Flash:this.$().width(size.cx).height(size.cy);
3382if(this._needGenerateMarkup){this._needGenerateMarkup=false;this._generateFlash(size.cx,size.cy);}break;case PM.Html5:this._slideshow&&this._slideshow.resize(size.cx,
3383size.cy);this.$().width(size.cx).height(size.cy);if(this._needGenerateMarkup){this._needGenerateMarkup=false;this._generateHtml5(size.cx,size.cy);}break;case PM.PhotoView:var photo=this._firstPhoto;
3384var method;if(photo){method=photo.video?$.extend({},zf_ProcessingMethod.VideoPosterFrame,size):photo.pickScaledMethod(size.cx,size.cx);size=photo.getScaledSize(method);
3385}else{method=zf_ProcessingMethod.StandardSmallSize;size=method;}this.$().width(size.cx).height(size.cy);if(photo){this._view.resize(photo,photo,method);if(this._view.__zfl_method==null||this._view.__zfl_method!=method){this._view.__zfl_method=method;
3386this._view.load(photo,method);}}else{this.$(".pv-inner").width(size.cx).height(size.cy);}break;default:;break;}return size;},toggleEditorShadow:function(enable){if(enable&&this.$(".zbe-border").length==0)this.$().append("<div class='zbe-border'></div>");
3387this.$().toggleClass('zbe-shadow',enable);},_calculateLayout:function(availWidth,availHeight,constraints){var sizingMode=this._parameters.layout.sizingMode;if(sizingMode==zf.zentobox.HomepageSlideshow.SizingMode.Custom){var customWidth=this._parameters.layout.customWidth;
3388var customHeight=this._parameters.layout.customHeight;if(!this._isPreview)return{cx:customWidth,cy:customHeight};var customRatio=Math.max(1,customWidth*1.0/availWidth,
3389customHeight*1.0/availHeight);return{cx:customWidth/customRatio,cy:customHeight/customRatio};}var photo=this._firstPhoto;constraints=constraints||{};var cellWidth=constraints.cellWidth?constraints.cellWidth:1;
3390var cellRoundDown=function(w){return w-w%cellWidth;};var cellRoundUp=function(w){return(w/cellWidth)*cellWidth+((w%cellWidth==0)?0:cellWidth);};;var bankersRound=function(x){var r=Math.round(x);
3391if(r%2==0||r==x)return r;var f=Math.floor(x);return x-f==0.5?f:r;};var cMin={cx:constraints.minWidth||0,cy:constraints.minHeight||0};var cMax={cx:availWidth,cy:availHeight};
3392;var iMin={cx:cellRoundUp(320),cy:240};var iMax={cx:cellRoundDown(this._maxWidth),cy:this._maxHeight};;var min={};min.cx=cellRoundUp(Math.max(cMin.cx,iMin.cx));min.cy=Math.max(cMin.cy,
3393iMin.cy);;var max={};max.cx=cellRoundDown(Math.min(cMax.cx,iMax.cx));max.cy=Math.min(cMax.cy,iMax.cy);;max.cx=Math.max(max.cx,min.cx);max.cy=Math.max(max.cy,min.cy);
3394;var cx=photo?photo.width:zf_ProcessingMethod.StandardSmallSize.cx;var cy=photo?photo.height:zf_ProcessingMethod.StandardSmallSize.cy;var h2w=cy*1.0/cx;var ratio=max.cx/cx;
3395if(cy*ratio>max.cy)ratio=max.cy/cy;cx=Math.max(1,bankersRound(cx*ratio));cy=Math.max(1,bankersRound(cy*ratio));;cx=Math.max(iMin.cx,cellRoundDown(cx));cy=Math.max(iMin.cy,
3396bankersRound(cx*h2w));;return{cx:cx,cy:cy};},_getPresentationMode:function(){var PM=zf.zentobox.HomepageSlideshow.PresentationMode;if(!this._firstPhoto)return PM.PhotoView;
3397if(!zf_Flash.installed(9))return PM.Html5;if(!zf_Flash.isSafeDomain())return PM.Html5;return PM.Html5;},_generateFlash:function(width,height){var isTransparent=this._parameters.options.isBackgroundTransparent;
3398var markup=zf_Flash.createHtml(this.id+"-flash","pv-img pv-flash flash-restart",zf_stdGetProtocol(zf_cdnHost)+zf_cdnHost+"/zf/code/slideshow/6.5.1/homepage.swf",
3399this._slideshowvars,isTransparent||this._slideshowvars.bgcolor=='transparent',width,height);$(document.getElementById(this._viewId)).replaceWith(markup);;},_generateHtml5:function(width,
3400height){var markup=zfl_Slideshow.createHtml(this.id+"-html5","pv-img pv-html5",this._slideshowvars.bgcolor,width,height,false);$(document.getElementById(this._viewId)).replaceWith(markup);
3401this._slideshow=new zfl_Slideshow(this.id+'-html5',this.minWidth,this.minHeight,width,height,this._slideshowvars,this._photoSet,this._psToken,$.extend({},new zf_User(),
3402{id:this._ownerId}),false,null);this._slideshow.onclick=this._clickTarget?this.closure(this.onClick):undefined;this._slideshow.init();zf_stdDisableRightClick(this._slideshow.$(".zfl-ss-view").bind('dragstart',
3403zf_stdFalse));;},onClick:function(id){;if(!this._clickTarget)return;id=this._toHex(id.toString()).slice(-8);var url=zf_stdFormatString(this._clickTarget,id);;if(!this._isPreview)location.href=url;
3404else window.open(url);},_toHex:function(num){var dec=[];for(var i=0;i<num.length;i++)dec.unshift(num.charCodeAt(i)-48);var bin=[];while(dec.length>0){var x=dec[0],
3405b=x%2;bin.push(b);dec[0]=(x-b)/2;for(i=1;i<dec.length;i++){x=dec[i];b=x%2;if(b==1)dec[i-1]+=5;dec[i]=(x-b)/2;}if(dec[i-1]==0)dec.pop();}while((bin.length%4)!=0)bin.push(0);
3406var hex="";var map={"0000":"0","1000":"1","0100":"2","1100":"3","0010":"4","1010":"5","0110":"6","1110":"7","0001":"8","1001":"9","0101":"a","1101":"b","0011":"c",
3407"1011":"d","0111":"e","1111":"f"};while(bin.length>0)hex=map[bin.splice(0,4).join("")]+hex;return hex;},destroy:function(){this._slideshow&&this._slideshow.dispose();
3408},togglePlay:function(play){zf.zentobox.framework.Component.prototype.togglePlay.call(this,play);if(this._slideshow)play?this._slideshow.resume(true,true):this._slideshow.pause(false,
3409true);}})});$.extend(zf.zentobox.HomepageSlideshow,{SizingMode:{Auto:0,Custom:1},PresentationMode:{PhotoView:0,Html5:1,Flash:2}});;;zf.$namespace('zf.zentobox',{EmbeddableSlideshow:zf.$class(zf.zentobox.framework.Component,
3410{_ctor:function(id,init){zf.zentobox.framework.Component.prototype.constructor.call(this,id);this._viewId=init.viewId;this._parameters=init.parameters;this._slideshowvars=init.slideshowvarsFlash;
3411this._slideshowvarsHtml5=init.slideshowvarsHtml5;this._photoSet=init.photoSet;this._firstPhoto=init.photo;this._maxWidth=init.maxWidth;this._maxHeight=init.maxHeight;
3412this._renderContext=init.renderContext;
3412this._isPreview=init.renderContext.isPreview;this._slideshowvars.keyring=zf_stdGetCookie("zf_keyring");this._presentationMode=this._getPresentationMode();
3413this._needGenerateMarkup=null;var PM=zf.zentobox.EmbeddableSlideshow.PresentationMode;switch(this._presentationMode){case PM.Flash:this._needGenerateMarkup=true;
3414break;case PM.Html5:this._psToken=this._slideshowvarsHtml5.psToken;delete this._slideshowvarsHtml5.psToken;this._needGenerateMarkup=true;break;case PM.PhotoView:var photo=this._firstPhoto;
3415var plugins=[new zfl_WaitAnimationPlugin(true)];if(photo&&photo.video)plugins.push(new zf_VideoPlayerPlugin(function(c){return c;}));this._view=new zf_PhotoView(this._viewId,
3416plugins,photo);this._needGenerateMarkup=false;break;default:;break;};zf_stdMakeMethodsDeferred(this,this.id,["_generateFlash","_generateHtml5"]);},init:function(options){;
3417if(this._renderContext.isFixedWidth)this.resize(this._renderContext.width,this._maxHeight,{maxWidth:this._maxWidth,maxHeight:this._maxHeight});},resize:function(availWidth,
3418availHeight,constraints){;;;var size=this._calculateLayout(availWidth,availHeight,constraints);var PM=zf.zentobox.EmbeddableSlideshow.PresentationMode;switch(this._presentationMode){case PM.Flash:this.$().width(size.cx).height(size.cy);
3419if(this._needGenerateMarkup){this._needGenerateMarkup=false;this._generateFlash(size.cx,size.cy);}break;case PM.Html5:this._slideshow&&this._slideshow.resize(size.cx,
3420size.cy);this.$().width(size.cx).height(size.cy);if(this._needGenerateMarkup){this._needGenerateMarkup=false;this._generateHtml5(size.cx,size.cy);}break;case PM.PhotoView:var photo=this._firstPhoto;
3421var method;if(photo){method=photo.video?$.extend({},zf_ProcessingMethod.VideoPosterFrame,size):photo.pickScaledMethod(size.cx,size.cx);size=photo.getScaledSize(method);
3422}else{method=zf_ProcessingMethod.StandardSmallSize;size=method;}this.$().width(size.cx).height(size.cy);if(photo){this._view.resize(photo,photo,method);if(this._view.__zfl_method==null||this._view.__zfl_method!=method){this._view.__zfl_method=method;
3423this._view.load(photo,method);}}else{this.$(".pv-inner").width(size.cx).height(size.cy);}break;default:;break;}return size;},toggleEditorShadow:function(enable){if(enable&&this.$(".zbe-border").length==0)this.$().append("<div class='zbe-border'></div>");
3424this.$().toggleClass('zbe-shadow',enable);},_calculateLayout:function(availWidth,availHeight,constraints,ignorePreview){var sizingMode=this._parameters.layout.sizingMode;
3425if(sizingMode==zf.zentobox.EmbeddableSlideshow.SizingMode.Custom){var customWidth=this._parameters.layout.customWidth;var customHeight=this._parameters.layout.customHeight;
3426if(ignorePreview||!this._isPreview)return{cx:customWidth,cy:customHeight};var customRatio=Math.max(1,customWidth*1.0/availWidth,customHeight*1.0/availHeight);return{cx:customWidth/customRatio,
3427cy:customHeight/customRatio};}var photo=this._firstPhoto;constraints=constraints||{};var cellWidth=constraints.cellWidth?constraints.cellWidth:1;var cellRoundDown=function(w){return w-w%cellWidth;
3428};var cellRoundUp=function(w){return(w/cellWidth)*cellWidth+((w%cellWidth==0)?0:cellWidth);};;var bankersRound=function(x){var r=Math.round(x);if(r%2==0||r==x)return r;
3429var f=Math.floor(x);return x-f==0.5?f:r;};var cMin={cx:constraints.minWidth||0,cy:constraints.minHeight||0};var cMax={cx:availWidth,cy:availHeight};;var iMin={cx:cellRoundUp(320),
3430cy:240};var iMax={cx:cellRoundDown(this._maxWidth),cy:this._maxHeight};;var min={};min.cx=cellRoundUp(Math.max(cMin.cx,iMin.cx));min.cy=Math.max(cMin.cy,iMin.cy);
3431;var max={};max.cx=cellRoundDown(Math.min(cMax.cx,iMax.cx));max.cy=Math.min(cMax.cy,iMax.cy);;max.cx=Math.max(max.cx,min.cx);max.cy=Math.max(max.cy,min.cy);;var cx=photo?photo.width:zf_ProcessingMethod.StandardSmallSize.cx;
3432var cy=photo?photo.height:zf_ProcessingMethod.StandardSmallSize.cy;var h2w=cy*1.0/cx;var ratio=max.cx/cx;if(cy*ratio>max.cy)ratio=max.cy/cy;cx=Math.max(1,bankersRound(cx*ratio));
3433cy=Math.max(1,bankersRound(cy*ratio));;cx=Math.max(iMin.cx,cellRoundDown(cx));cy=Math.max(iMin.cy,bankersRound(cx*h2w));;return{cx:cx,cy:cy};},_getPresentationMode:function(){var PM=zf.zentobox.EmbeddableSlideshow.PresentationMode;
3434if(!this._firstPhoto)return PM.PhotoView;var isFlashAvailable=zf_Flash.installed(9);if(!isFlashAvailable){if(this._isPreview)return PM.PhotoView;var result;result=PM.Html5;
3435return result;}if(!zf_Flash.isSafeDomain())return PM.PhotoView;return PM.Flash;},_generateFlash:function(width,height){var isTransparent=this._parameters.options.isBackgroun
3435dTransparent;
3436var markup=zf_Flash.createHtml(this.id+"-flash","pv-img pv-flash flash-restart",zf_stdGetProtocol(zf_cdnHost)+zf_cdnHost+"/zf/code/slideshow/6.5.1/embedded.swf",
3437this._slideshowvars,isTransparent,width,height);$(document.getElementById(this._viewId)).replaceWith(markup);;},_generateHtml5:function(width,height){var bgColor=this._parameters.options.isBackgroundTransparent?"transparent":this._parameters.options.bgColor;
3438var markup=zfl_Slideshow.createHtml(this.id+"-html5","pv-img pv-html5",bgColor,width,height,false);$(document.getElementById(this._viewId)).replaceWith(markup);var flashvars=$.extend(true,
3439{},this._slideshowvarsHtml5,{thumbnails_mode:1,scaleimages:1});this._slideshow=new zfl_Slideshow(this.id+'-html5',this.minWidth,this.minHeight,width,height,flashvars,
3440this._photoSet,this._psToken,null,false,null);this._slideshow.init();;}})});$.extend(zf.zentobox.EmbeddableSlideshow,{SizingMode:{Auto:0,Custom:1},PresentationMode:{PhotoView:0,
3441Html5:1,Flash:2}});;function zf_MouseTracker(node){if(!(node instanceof jQuery))node=$(node);var self=this;var tracking=false;this._mousedown=function(e){e.stopPropagation();
3442e.preventDefault();if(!zf_stdIsLeftButton(e))return;if(self.onbegintrack!=null&&!self.onbegintrack(e))return;if(document.addEventListener){document.addEventListener('mousemove',
3443self._mousemove,true);document.addEventListener('mouseup',self._mouseup,true);}else if(node[0].setCapture){node.mousemove(self._mousemove).mouseup(self._mouseup);
3444node[0].setCapture();}self.anchorX=e.pageX;self.anchorY=e.pageY;tracking=true;};this._touchstart=function(e){e.stopPropagation();e.preventDefault();if(e.originalEvent.touches.length>1)return;
3445e.pageX=e.originalEvent.targetTouches[0].pageX;e.pageY=e.originalEvent.targetTouches[0].pageY;if(self.onbegintrack!=null&&!self.onbegintrack(e))return;node.bind('touchmove',
3446self._touchmove).bind('touchend',self._touchend);self.anchorX=e.pageX;self.anchorY=e.pageY;tracking=true;};this._mousemove=function(e){e=jQuery.event.fix(e);e.stopPropagation();
3447if(tracking&&self.ontrack!=null)self.ontrack(e);};this._touchmove=function(e){e.stopPropagation();e.preventDefault();if(e.originalEvent.touches.length>1)return;e.pageX=e.originalEvent.targetTouches[0].pageX;
3448e.pageY=e.originalEvent.targetTouches[0].pageY;if(tracking&&self.ontrack!=null)self.ontrack(e);};this._mouseup=function(e){e=jQuery.event.fix(e);e.stopPropagation();
3449if(!tracking)return;if(self.ontrack!=null)self.ontrack(e);if(document.removeEventListener){document.removeEventListener('mousemove',self._mousemove,true);document.removeEventListener('mouseup',
3450self._mouseup,true);}else if(node[0].releaseCapture){node[0].releaseCapture();node.unbind('mousemove mouseup');}if(self.onendtrack!=null)self.onendtrack(e);tracking=false;
3451};this._touchend=function(e){e.stopPropagation();e.preventDefault();if(!tracking)return;if(e.originalEvent.touches.length>1)return;e.pageX=e.originalEvent.changedTouches[0].pageX;
3452e.pageY=e.originalEvent.changedTouches[0].pageY;if(self.ontrack!=null)self.ontrack(e);node.unbind('touchmove touchend');if(self.onendtrack!=null)self.onendtrack(e);
3453tracking=false;};node.mousedown(this._mousedown).bind('touchstart',this._touchstart);};;function zfl_KenBurns(id,settings){zfl_Control.prototype.constructor.call(this,id);
3454this._settings=$.extend({},settings,zfl_KenBurns.DefaultSettings);}zfl_KenBurns.inherits(zf_Control);zfl_KenBurns.DefaultSettings={mode:'speed',value:15,fitprefmove:false,fillprefmove:false,
3455zoomx2:true,forcemove:true};zfl_KenBurns.prototype.createTransform=function(photo,containerSize,settings){var stgs=$.extend({},this._settings,settings),fillType=stgs.fillType;
3456if(fillType!='fit'&&fillType!='fill')throw 'Unknown fill type \''+fillType+'\'';var tfData=this['_createTransform'+(fillType=='fit'?'Fit':'Fill')](photo,containerSize,
3457stgs);return{photo:photo,containerSize:containerSize,settings:stgs,totalSize:{width:tfData.width,height:tfData.height},transform:tfData.transform};};zfl_KenBurns.prototype.startTransform=function(transform,
3458$img){var data=transform,tf=data.transform,cs=data.containerSize,dur=data.settings.duration,tft=tf.type,tfo=tf.orientation,tfd=tf.direction,tfzd=tf.zoomDirection,
3459tfmd=tf.moveDirection,tfs=tf.scale,tfdis=tf.distance,csw=cs.width,csh=cs.height;data.$img=$img;
3459var csstfi='',csstfa='',tsval,v0,v1;if(tft=='move'){v0=tfd*Math.floor(tfdis/2/(1+tfs));
3460v1=(1+tfs).toFixed(2);csstfi='scale('+v1+')';csstfi+=' translate'+(tfo=='h'?'X':'Y')+'('+v0+'px)';csstfa='scale('+v1+')';csstfa+=' translate'+(tfo=='h'?'X':'Y')+'('+-v0+'px)';
3461}else if(tft=='zoom'){csstfi='scale('+(tfd==1?1:1+tfs).toFixed(2)+')';csstfa='scale('+(tfd==1?1+tfs:1).toFixed(2)+')';}else if(tft=='moom'){v0=tfmd*Math.floor((tfo=='h'?csw:csh)*tfs/2/(1+tfs));
3462csstfi='scale('+(tfzd==1?1:(1+tfs)).toFixed(2)+')';csstfi+=' translate'+(tfo=='h'?'X':'Y')+'('+(tfzd==1?0:v0)+'px)';csstfa='scale('+(tfzd==1?(1+tfs):1).toFixed(2)+')';
3463csstfa+=' translate'+(tfo=='h'?'X':'Y')+'('+(tfzd==1?v0:0)+'px)';}else throw 'Unknown KenBurns transform type \''+tft+'\'';csstfi+=' rotate(0.01deg)';csstfa+=' rotate(0.01deg)';
3464;$img.css({transition:'','-webkit-transition':''});$img.css({transform:csstfi,'-webkit-transform':csstfi});var t0=$img.css('width'),t1=$img.css('height');$img.css({transition:'transform '+dur+'ms linear',
3465'-webkit-transition':'-webkit-transform '+dur+'ms linear'});$img.css({transform:csstfa,'-webkit-transform':csstfa});};zfl_KenBurns.prototype._createTransformFit=function(photo,
3466containerSize,settings){var stgs=settings;var cs=containerSize,cw=cs.width,ch=cs.height;var pw=photo.width,ph=photo.height;var or,pv,sv;or='h';pv=cw;sv=cw/pw*ph;
3467if(sv>ch){pv=ch;sv=ch/ph*pw;or='v';}var rd=this._getRelativeDistance(pv,stgs);pv=pv*(1+rd);sv=sv*(1+rd);var tf=null;if((stgs.forcemove&&zf_stdRndBool())||!stgs.forcemove&&(stgs.fitprefmove||zf_stdRndBool())&&sv<=(or=='h'?ch:cw)){var scale=+(rd.toFixed(2));
3468tf={type:'move',orientation:or,direction:zf_stdRndBool()?1:-1,scale:scale,distance:Math.floor(pv/(1+scale)*scale)};}else{rd=this._getRelativeDistance(Math.max(pv/(1+rd),
3469sv/(1+rd)),stgs);if(stgs.zoomx2){rd=rd*2;pv=pv/(1+rd/2)*(1+rd);sv=sv/(1+rd/2)*(1+rd);}if(zf_stdRndBool())tf={type:'zoom',direction:zf_stdRndBool()?1:-1,scale:+(rd.toFixed(2))};
3470else tf={type:'moom',orientation:or,moveDirection:zf_stdRndBool()?1:-1,zoomDirection:zf_stdRndBool()?1:-1,scale:+(rd.toFixed(2))};}return{width:Math.ceil((or=='h'?pv:sv)),
3471height:Math.ceil((or=='h'?sv:pv)),transform:tf};};zfl_KenBurns.prototype._createTransformFill=function(photo,containerSize,settings){var stgs=settings;var cs=containerSize,cw=cs.width,
3472ch=cs.height;var pw=photo.width,ph=photo.height;var or,pv,sv;or='v';sv=cw;pv=cw/pw*ph;if(pv<ch){sv=ch;pv=ch/ph*pw;or='h';}var ad=this._getAbsoluteDistance(or=='v'?ch:cw,
3473stgs);var reqpv=(or=='v'?ch:cw)+ad;var tf=null;if(pv>=reqpv&&(stgs.fillprefmove||zf_stdRndBool())){tf={type:'move',orientation:or,direction:zf_stdRndBool()?1:-1,
3474scale:0,distance:Math.round(ad)};}else if(pv<reqpv&&stgs.forcemove&&zf_stdRndBool()){tf={type:'move',orientation:or,direction:zf_stdRndBool()?1:-1,scale:+((reqpv/pv-1).toFixed(2)),
3475distance:Math.round(ad)};pv=reqpv;sv=sv*reqpv/pv;}else{var rd=this._getRelativeDistance(Math.max(ch,cw),stgs);pv=pv*(1+rd);sv=sv*(1+rd);if(stgs.zoomx2){rd*=2;pv=pv/(1+rd/2)*(1+rd);
3476sv=sv/(1+rd/2)*(1+rd);}if(zf_stdRndBool())tf={type:'zoom',direction:zf_stdRndBool()?1:-1,scale:+(rd.toFixed(2))};else tf={type:'moom',orientation:or,moveDirection:zf_stdRndBool()?1:-1,
3477zoomDirection:zf_stdRndBool()?1:-1,scale:+(rd.toFixed(2))};}return{width:Math.round((or=='h'?pv:sv)),height:Math.round((or=='h'?sv:pv)),transform:tf};};zfl_KenBurns.prototype._getRelativeDistance=function(baseValue,
3478settings){return this._getAbsoluteDistance(baseValue,settings)/baseValue;};zfl_KenBurns.prototype._getAbsoluteDistance=function(baseValue,settings){var m=settings.mode,v=settings.value,
3479d=settings.duration;if(m=='speed')return d/1000*v;else if(m=='absodis')return v;else if(m=='reladis')return v*baseValue;else throw 'Unknown mode \''+m+'\'';};;var __extends=(this&&this.__extends)||(function(){var extendStatics=Object.setPrototypeOf||({__proto__:[]}instanceof Array&&function(d,
3480b){d.__proto__=b;})||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p];};return function(d,b){extendStatics(d,b);function __(){this.constructor=d;}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,
3481new __());};})();
3481var Zenfolio;(function(Zenfolio){var Global;(function(Global){var Vars=(function(){function Vars(){}Object.defineProperty(Vars,"isIPad",{get:function(){var retVal;
3482retVal=false;return retVal;},enumerable:true,configurable:true});Object.defineProperty(Vars,"isIPhone",{get:function(){var retVal;retVal=false;return retVal;},enumerable:true,
3483configurable:true});Object.defineProperty(Vars,"isTouch",{get:function(){var retVal;retVal=false;return retVal;},enumerable:true,configurable:true});Object.defineProperty(Vars,
3484"isTablet",{get:function(){var retVal;retVal=false;return retVal;},enumerable:true,configurable:true});Object.defineProperty(Vars,"isIE11",{get:function(){var retVal;
3485retVal=false;return retVal;},enumerable:true,configurable:true});return Vars;}());Global.Vars=Vars;})(Global=Zenfolio.Global||(Zenfolio.Global={}));})(Zenfolio||(Zenfolio={}));
3486;;var Zenfolio;(function(Zenfolio){var Global;(function(Global){var AudioPlayerState;(function(AudioPlayerState){AudioPlayerState[AudioPlayerState["Empty"]=0]="Empty";
3487AudioPlayerState[AudioPlayerState["Stopped"]=1]="Stopped";AudioPlayerState[AudioPlayerState["Playing"]=2]="Playing";AudioPlayerState[AudioPlayerState["Paused"]=3]="Paused";
3488AudioPlayerState[AudioPlayerState["Ended"]=4]="Ended";AudioPlayerState[AudioPlayerState["Disposed"]=5]="Disposed";})(AudioPlayerState||(AudioPlayerState={}));var AudioPlayer=(function(_super){__extends(AudioPlayer,
3489_super);function AudioPlayer(parent,id){var _this=this;var mainDiv=document.createElement("div");parent.appendChild(mainDiv);mainDiv.id=id;_this=_super.call(this,
3490id)||this;_this._state=AudioPlayerState.Empty;_this._engines=[];Html5PlaybackEngine.isSupported()&&_this._engines.push(new Html5PlaybackEngine(_this.dom()));FlashPlaybackEngine.isSupported()&&_this._engines.push(new FlashPlaybackEngine(_this.dom()));
3491_this._activeEngine=null;_this.setVolume(1);;return _this;}AudioPlayer._normalizeBooleanParameter=function(value){var normalizedValue;if(typeof value==="string"){normalizedValue=parseInt(value,
349210)!=0;}else if(typeof value==="number"){normalizedValue=value!=0;}else{normalizedValue=value;}return normalizedValue;};AudioPlayer._getEngineName=function(engine){if(engine instanceof Html5PlaybackEngine){return "HTML5";
3493}else if(engine instanceof FlashPlaybackEngine){return "Flash";}return "";};AudioPlayer.prototype.isSoundtrackNonEmpty=function(){return!!this._soundtrackId;};AudioPlayer.prototype.canPlay=function(){return this._engines.length>0;
3494};AudioPlayer.prototype.initTrack=function(galleryId,soundtrackId,soundtrackLooped){var _this=this;if(!this.canPlay()||this._state==AudioPlayerState.Disposed){return;
3495}this._galleryId=galleryId;this._soundtrackId=soundtrackId;this._soundtrackLooped=AudioPlayer._normalizeBooleanParameter(soundtrackLooped);;this._isTrackLoaded=false;
3496this.stopTrack();if(!soundtrackId){this._state=AudioPlayerState.Empty;return;}this.$().unbind("trackEnded.audioPlayer").bind("trackEnded.audioPlayer",function(){var state=_this._state;
3497if(state==AudioPlayerState.Playing||state==AudioPlayerState.Paused){;_this._state=AudioPlayerState.Ended;state==AudioPlayerState.Playing&&_this._soundtrackLooped&&_this.playTrack();
3498}}).unbind("trackLoaded.audioPlayer").bind("trackLoaded.audioPlayer",function(){return _this._isTrackLoaded=true;}).unbind("trackFailed.audioPlayer").bind("trackFailed.audioPlayer",
3499function(){var nextEngineIdx=$.inArray(_this._activeEngine,_this._engines)+1;if(nextEngineIdx<_this._engines.length){_this._activeEngine=_this._engines[nextEngineIdx];
3500if(_this._state==AudioPlayerState.Playing||_this._state==AudioPlayerState.Paused){_this._activeEngine.play();}if(_this._state==AudioPlayerState.Paused){_this._activeEngine.pause();
3501}}});$.each(this._engines,function(_i,e){return e.init(galleryId,soundtrackId);});this._activeEngine=this._engines[0];this._state=AudioPlayerState.Stopped;};AudioPlayer.prototype.playTrack=function(){if(!this._canPerformPlayAction){return;
3502};if(this._state!=AudioPlayerState.Stopped){this.stopTrack();}this._activeEngine.play();this._state=AudioPlayerState.Playing;};AudioPlayer.prototype.pauseTrack=function(){if(!this._canPerformPlayAction){return;
3503}if(this._state!=AudioPlayerState.Playing){return;};this._activeEngine.pause();this._state=AudioPlayerState.Paused;};AudioPlayer.prototype.resumeTrack=function(){if(!this._canPerformPlayAction){return;
3504}if(this._state==AudioPlayerState.Playing){return;};if(this._state==AudioPlayerState.Stopped||(this._state==AudioPlayerState.Ended&&this._soundtrackLooped)){this.playTrack();
3505return;}this._activeEngine.resume();this._state=AudioPlayerState.Playing;};AudioPlayer.prototype.stopTrack=function(){if(!this._canPerformPlayAction){return;}if(this._state==AudioPlayerState.Stopped){return;
3506};this._activeEngine.stop();this._state=AudioPlayerState.Stopped;};AudioPlayer.prototype.setVolume=function(volumeLevel){;if(!this.canPlay()||this._state==AudioPlayerState.Disposed){return;
3507};this._volumeLevel=volumeLevel;$.each(this._engines,function(_i,e){return e.setVolume(volumeLevel);});};AudioPlayer.prototype.dispose=function(){if(!this.canPlay()||this._state==AudioPlayerState.Disposed){return;
3508};this.$().unbind(".audioPlayer");$.each(this._engines,function(_i,e){return e.dispose();});this._state=AudioPlayerState.Disposed;};Object.defineProperty(AudioPlayer.prototype,
3509"_canPerformPlayAction",{get:function(){return this.canPlay()&&this._state!=AudioPlayerState.Disposed&&this._state!=AudioPlayerState.Empty;},enumerable:true,configurable:true});
3510return AudioPlayer;}(zf_Control));Global.AudioPlayer=AudioPlayer;var Html5PlaybackEngine=(function(){function Html5PlaybackEngine(parent){var audioDiv=document.createElement("div");
3511parent.appendChild(audioDiv);
3511audioDiv.innerHTML="\n                <audio id=\""+parent.id+"-player\">\n                    <source id=\""+parent.id+"-player-mp3Source\" type=\"audio/mpeg\" />\n                </audio>";
3512this._audioElement=$(audioDiv).find("audio").get(0);this._sourceElement=$(audioDiv).find("source").get(0);}Html5PlaybackEngine.isSupported=function(){var result=false;
3513var audio=document.createElement("audio");if(audio){result=!!(audio.canPlayType&&audio.canPlayType("audio/mpeg").replace(/no/,""));}return result;};Html5PlaybackEngine.prototype.init=function(galleryId,
3514soundtrackId){var _this=this;this._galleryId=galleryId;this._soundtrackId=soundtrackId;this._isTrackLoaded=false;var $audio=$(this._audioElement);$audio.unbind("ended.html5PlaybackEngine").bind("ended.html5PlaybackEngine",
3515function(){if(_this._state==AudioPlayerState.Playing||_this._state==AudioPlayerState.Paused){_this._state=AudioPlayerState.Ended;}$audio.trigger("trackEnded.audioPlayer");
3516});};Html5PlaybackEngine.prototype.play=function(){var self=this;var sid=this._soundtrackId;var serverRequestFunc=Global.Vars.isIPad||Global.Vars.isIPhone?zf_stdServerRequestExSync:zf_stdServerRequestEx;
3517this._state=AudioPlayerState.Playing;var isChrome=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor);if(this._isTrackLoaded&&!isChrome){this._restoreVolume();
3518this._audioElement.play();;}else{this._isTrackLoaded=false;serverRequestFunc("POST","/zf/core/slideshow.asmx","GetSoundtrack",[this._galleryId,this._soundtrackId],
3519function(result,error){if(self._state==AudioPlayerState.Disposed||self._state==AudioPlayerState.Empty){return;}if(self._soundtrackId!=sid){return;}if(error!=null){self._state=AudioPlayerState.Stopped;
3520return;};var mediaType=result.mediaType;if(mediaType=="audio/mp3"){var token=result.token+"3E94QLQShiQjUSQXLqjKC5XGiW5V9Xa5dPSXmYVeg34ckGjiO4zHXECJzlmH6AY";var num=5381;
3521var uint=0;while(uint<token.length){num=num+num*Math.pow(2,5);num=num+token.charCodeAt(uint);num=num%4.294967296E9;uint++;}var hash=String(num);var source=self._sourceElement;
3522source.src="/zf/core/soundtrack.ashx?auth="+encodeURIComponent(hash)+"&token="+encodeURIComponent(result.token);var audio=self._audioElement;audio.load();if(self._state==AudioPlayerState.Playing){self._restoreVolume();
3523audio.play();;}self._isTrackLoaded=true;$(audio).trigger("trackLoaded.audioPlayer");}else{;self._state=AudioPlayerState.Stopped;$(self._audioElement).trigger("trackFailed.audioPlayer");
3524}});}};Html5PlaybackEngine.prototype.pause=function(){this._state=AudioPlayerState.Paused;if(this._isTrackLoaded){var audio=this._audioElement;var self=this;if(Global.Vars.isIPad||Global.Vars.isIPhone){audio.pause();
3525}else{var duration=(audio.volume*1000/this._volumeLevel)||0;$(audio).stop(true,true).animate({volume:0},duration,function(){if(self._state==AudioPlayerState.Paused){this.pause();
3526}});}}};Html5PlaybackEngine.prototype.resume=function(){if(this._isTrackLoaded){var audio=this._audioElement;if(!(Global.Vars.isIPad||Global.Vars.isIPhone)){this._restoreVolume();
3527}!audio.ended&&audio.play();}this._state=AudioPlayerState.Playing;};Html5PlaybackEngine.prototype.stop=function(){if(this._isTrackLoaded){this._audioElement.pause();
3528this._audioElement.currentTime=null;}this._state=AudioPlayerState.Stopped;};Html5PlaybackEngine.prototype.setVolume=function(volumeLevel){this._volumeLevel=volumeLevel;
3529var audio=this._audioElement;$(audio).stop(true,true);audio.volume=volumeLevel;};Html5PlaybackEngine.prototype.dispose=function(){$(this._audioElement).unbind("ended.html5PlaybackEngine");
3530this._state=AudioPlayerState.Disposed;};Html5PlaybackEngine.prototype._restoreVolume=function(){$(this._audioElement).stop(true,true);this._audioElement.volume=0;
3531$(this._audioElement).delay(500).animate({volume:this._volumeLevel},1000);};return Html5PlaybackEngine;}());var FlashPlaybackEngine=(function(){function FlashPlaybackEngine(parent){this._proxyName=zf_stdGenerateStringKey(16);
3532this._parent=parent;}FlashPlaybackEngine.isSupported=function(){return zf_Flash.installed(9,0,115)&&zf_Flash.isSafeDomain();};FlashPlaybackEngine.prototype.init=function(galleryId,
3533soundtrackId){var _this=this;this._galleryId=galleryId;this._soundtrackId=soundtrackId;this._isTrackLoaded=false;window[this._proxyName]={OnEndTrack:function(){if(_this._state==AudioPlayerState.Playing||_this._state==AudioPlayerState.Paused){_this._state=AudioPlayerState.Ended;
3534}
3534$(_this._getElement()).trigger("trackEnded.audioPlayer");}};};FlashPlaybackEngine.prototype.play=function(){var self=this;function tryPlay(){delete self._tryPlayTimeout;
3535if(self._state==AudioPlayerState.Disposed||self._state==AudioPlayerState.Empty){return;}if(!self._invokeFlashMethod("PlayTrack",self._galleryId,self._soundtrackId)){self._tryPlayTimeout=setTimeout(tryPlay,
3536500);}else{self.setVolume(self._volumeLevel);if(self._state==AudioPlayerState.Paused){self._invokeFlashMethod("PauseTrack");}else if(self._state==AudioPlayerState.Stopped){self._invokeFlashMethod("StopTrack");
3537}else{self._state=AudioPlayerState.Playing;}self._isTrackLoaded=true;$(self._getElement()).trigger("trackLoaded.audioPlayer");}}this._state=AudioPlayerState.Playing;
3538tryPlay();};FlashPlaybackEngine.prototype.pause=function(){if(this._isTrackLoaded){this._invokeFlashMethod("PauseTrack");}this._state=AudioPlayerState.Paused;};FlashPlaybackEngine.prototype.resume=function(){if(this._isTrackLoaded){this._invokeFlashMethod("ResumeTrack");
3539}this._state=AudioPlayerState.Playing;};FlashPlaybackEngine.prototype.stop=function(){if(this._isTrackLoaded){this._invokeFlashMethod("StopTrack");}this._tryPlayTimeout&&clearTimeout(this._tryPlayTimeout);
3540this._state=AudioPlayerState.Stopped;};FlashPlaybackEngine.prototype.setVolume=function(volumeLevel){this._volumeLevel=volumeLevel;this._element&&this._invokeFlashMethod("SetVolume",
3541volumeLevel*100);};FlashPlaybackEngine.prototype.dispose=function(){this._element&&$(this._element).remove();delete window[this._proxyName];this._tryPlayTimeout&&clearTimeout(this._tryPlayTimeout);
3542delete this._tryPlayTimeout;this._state=AudioPlayerState.Disposed;};FlashPlaybackEngine.prototype._getElement=function(){if(this._element){return this._element;}var playerUrl="/zf/code/slideshow/6.5.0/music.swf";
3543if(zf_stdAllowCdnHost()){playerUrl=""+zf_stdGetProtocol(zf_cdnHost)+zf_cdnHost+playerUrl;}var flashDiv=document.createElement("div");flashDiv.className="sst-flash-c";
3544this._parent.appendChild(flashDiv);flashDiv.innerHTML=zf_Flash.createHtml(this._parent.id+"-music","",playerUrl,{serverurl:location.hostname,js_proxy:this._proxyName},
3545true,1,1);return this._element=document.getElementById(this._parent.id+"-music");};FlashPlaybackEngine.prototype._invokeFlashMethod=function(method){var params=[];
3546for(var _a=1;_a<arguments.length;_a++){params[_a-1]=arguments[_a];}try{var flashMusic=this._getElement();;flashMusic[method].apply(flashMusic,params);return true;
3547}catch(e){;return false;}};return FlashPlaybackEngine;}());})(Global=Zenfolio.Global||(Zenfolio.Global={}));})(Zenfolio||(Zenfolio={}));;;zf.$namespace('zf.zentobox.slideshow',
3548{SlideshowCore:zf.$class([zf_Control,zf.core.EventSource],{_ctor:function(id,photoList,options){;zf_Control.prototype.constructor.call(this,id);zf.core.EventSource.prototype.constructor.call(this);
3549this._=zf.zentobox.slideshow.SlideshowCore;this._photoList=photoList;this._lengthKnown=options.lengthKnown;this._firstImage=options.firstImage;this._duration=(options.slideDuration||5)*1000;
3550this._transition=options.transition!=null?options.transition:4;if(this._transition==6){this._transition=4;this._kenburns=new zfl_KenBurns(id);}this._fill=!!options.fill;
3551this._loop=!!options.loop;this._random=!!options.random;this._anchorPoint=options.anchorPoint||null;this._pageSize=photoList._page;this._idx=[];this._commands=[];
3552this._loaders=[];this._volume=100;this._audioPlayer=new Zenfolio.Global.AudioPlayer(this.dom(),id+'-audioPlayer');this._audioPlayer.initTrack(options.soundtrackPhotoSetId,
3553options.soundtrack,options.soundtrackLooped);var self=this;photoList.onshrink=function(){;self._lengthKnown=true;self._initIndexMap(this.length);};photoList.get(0);
3554var noImage=new zf_PlaceholderImage(1),noMethod=$.extend({},zf_ProcessingMethod.StandardSmallSize,this._kenburns?{positioning:'flex'}:{});var plugins=[];this.$().prepend(['<div class="ssc-bg"></div>',
3555'<div class="ssc-plane ssc-hide">',zf_PhotoView.createHtml(id+'-pva',null,null,plugins,zf_PhotoView.EMPTY_CONTEXT,noImage,noMethod,false,0,0),'</div>','<div class="ssc-plane ssc-hide">',
3556zf_PhotoView.createHtml(id+'-pvb',null,null,plugins,zf_PhotoView.EMPTY_CONTEXT,noImage,noMethod,false,0,0),'</div>'].join(''));this.$().addClass('ssc');var pva=this._pva=new zf_PhotoView(id+'-pva',
3557plugins,zf_PhotoView.EMPTY_CONTEXT),pvb=this._pvb=new zf_PhotoView(id+'-pvb',plugins,zf_PhotoView.EMPTY_CONTEXT);pva.$().unbind('click').click(function(e){e.preventDefault();
3558e.stopPropagation();self.trigger('click',pva.getPhoto());});pvb.$().unbind('click').click(function(e){e.preventDefault();e.stopPropagation();self.trigger('click',
3559pvb.getPhoto());});zf_stdDisableRightClick(this.$());this._transitions={};if('animation' in document.body.style||'webkitAnimation' in document.body.style||'mozAnimation' in document.body.style){this._transitions[this._.FadeIn]=this._transitionFadeIn;
3560this._transitions[this._.None]=this._transitionSwap;this._transitions[this._.FadeBlack]=this._transitionFadeThroughBlack;this._transitions[this._.FadeWhite]=this._transitionFadeThroughWhite;
3561this._transitions[this._.CrossFade]=this._transitionCrossFade;this._transitions[this._.Slide]=this._transitionSlide;}else{this._transitions[this._.FadeIn]=this._transitionFadeInDownlevel;
3562this._transitions[this._.None]=this._transitionSwap;this._transitions[this._.FadeBlack]=this._transitionFadeThroughBlackDownlevel;this._transitions[this._.FadeWhite]=this._transitionFadeThroughWhiteDownlevel;
3563this._transitions[this._.CrossFade]=this._transitionCrossFadeDownlevel;this._transitions[this._.Slide]=this._transitionSlideDownlevel;}this._animationEndEvent=('webkitAnimation' in document.body.style)?'webkitAnimationEnd':'animationend';
3564this.state=this._.Initialized;},resize:function(cx,cy){;this.$().width(cx).height(cy);this._cx=cx;this._cy=cy;var self=this;this._command(function(){;var pva=self._pva,
3565photo=pva.getPhoto();if(!photo||photo.isPlaceholder)return;var kenburns=self._getKenburns(photo),method=self._getMethod(photo,kenburns),loader=self._getLoader(photo,
3566method),rect=self._getViewRect(pva,method);pva.$().css({left:rect.left+'px',top:rect.top+'px'}).width(rect.width).height(rect.height);pva.load(loader);self._resting(self._slideTimeout!=null);
3567});return{cx:cx,cy:cy};},start:function(){;;this.state=this._.Loading;this._paused=false;this.trigger('statechange',this.state,this._paused);var photoList=this._photoList,
3568self=this;zf_Loadable.notifyLoaded(photoList.get(0),function(){zf_stdDeferCall(null,function(){!self._lengthKnown&&self._initIndexMap(self._pageSize);self._currentIndex=-1;
3569self._seek(0,self._.FadeIn);self._audioPlayer.playTrack();},null);});},hasMusic:function(){return this._audioPlayer.canPlay()&&this._audioPlayer.isSoundtrackNonEmpty();
3570},next:function(autoNext){;if(this.state==this._.Resting||this.state==this._.Pending||this.state==this._.Animating){var self=this;this._command(function(){self._slideTimeout&&clearTimeout(self._slideTimeout);
3571self._slideTimeout=null;self._seek(self._currentIndex+1,null,autoNext);});}},prev:function(){;if(this.state==this._.Resting||this.state==this._.Pending||this.state==this._.Animating){var self=this;
3572this._command(function(){self._slideTimeout&&clearTimeout(self._slideTimeout);self._slideTimeout=null;self._seek(self._currentIndex-1);});}},canNext:function(){return this._loop||!this._lengthKnown||this._currentIndex<this._idx.length-1;
3573},canPrev:function(){return this._loop&&this._lengthKnown||this._currentIndex>0;},pause:function(keepMusic,outerCall){;if(this._paused)return;this._slideTimeout&&clearTimeout(this._slideTimeout);
3574this._slideTimeout=null;this._paused=true;this._commands=[];if(!keepMusic){this._pauseTrack(outerCall);}},resume:function(outerCall){;if(!this._paused)return;this._paused=false;
3575this._resumeTrack(outerCall);if(this.state==this._.Resting)this.next();},volume:function(vol){;this._volume=vol;this._audioPlayer.setVolume(vol/100);},_seek:function(index,
3576transition,autoNext){;transition=transition||this._transition;if(transition==this._.Random)transition=2+Math.floor(Math.random()*4);var currentIndex=this._currentIndex,
3577increment=index>currentIndex?1:-1,photoList=this._photoList,self=this;this._getPhoto(index,increment,function(index,photo){if(self.state!=self._.Loading&&self.state!=self._.Pending)return;
3578if(!photo){;self._resting();return;}if(autoNext&&!self._loop&&index<self._currentIndex){self.pause(false,false);self._resting();return;}self._currentIndex=index;
3579self._resting(true);;var kenburns=self._getKenburns(photo),method=self._getMethod(photo,kenburns),loader=self._getLoader(photo,method);loader.onload=function(){if(index!=self._currentIndex)return;
3580if(document.getElementById(self.id)==null)return;self._animate(loader,increment,transition,kenburns);self._prefetch(index,increment,self._.Lookahead);};loader.start();
3581});},_prefetch:function(index,increment,count){;var self=this;this._getPhoto(index+increment,increment,function(index,photo){if(photo==null)return;;var kenburns=self._getKenburns(photo),
3582method=self._getMethod(photo,kenburns),loader=self._getLoader(photo,method);if(loader.state==zf_PhotoLoader.Initialized)loader.start();if(--count>0)self._prefetch(index,
3583increment,count);});},_getPhoto:function(index,increment,done,start){;start=start||index;var photoList=this._photoList,length=this._idx.length,self=this;do{if(index>=length){if(this._lengthKnown)index=index%length;
3584else{zf_Loadable.notifyLoaded(photoList.get(length),function(){zf_stdDeferCall(null,function(){!self._lengthKnown&&self._initIndexMap(length+self._pageSize);self._getPhoto(index,
3585increment,done,start);},null);});return;}}else if(index<0){if(!this._lengthKnown){done(start,null);return;}index+=length;};;var mapped=this._idx[index];if(mapped<0){index+=increment;
3586if(index==start){done(start,null);return;}}}while(mapped<0);zf_Loadable.notifyLoaded(photoList.get(mapped),function(photo){if(self._isUsable(photo)){done(index,photo);
3587return;}self._idx[index]=-1;index+=increment;if(index==start){done(start,null);return;}self._getPhoto(index,increment,done,start);});},_command:function(command){;
3588if(this.state==this._.Resting&&this._commands.length==0){this._pending();command.call(this);return;}this._commands.push(command);},_resting:function(keepTimeout){;
3589var command=this._commands.shift();if(command){this._pending();command.call(this);return;}if(!keepTimeout){this._slideTimeout&&clearTimeout(this._slideTimeout);this._slideTimeout=null;
3590this._waitTimeout&&clearTimeout(this._waitTimeout);this._waitTimeout=null;}this.state=this._.Resting;this.trigger('statechange',this.state,this._paused);if(this._paused)return;
3591if(!keepTimeout)this._slideTimeout=setTimeout(this.closure(this.next,true),this._duration);}
3591,_pending:function(){;var self=this;this._waitTimeout=setTimeout(function(){self.trigger('wait',
3592true);},3000);this.state=this._.Pending;this.trigger('statechange',this.state,this._paused);},_animate:function(loader,increment,transition,kenburns){;this.state=this._.Animating;
3593this.trigger('statechange',this.state,this._paused);this._waitTimeout&&clearTimeout(this._waitTimeout);this._waitTimeout=null;this.trigger('wait',false);var self=this;
3594;this._pvb.load(loader);setTimeout(function(){self._transitions[transition].call(self,increment,function(){var pv=self._pva;self._pva=self._pvb;self._pvb=pv;self._resting();
3595},kenburns);},90);},_initIndexMap:function(length){;var idx=this._idx,start=idx.length;for(var i=start;i<length;i++)idx[i]=i;if(this._random){for(i=length-1;i>start;
3596i--){var k=start+Math.floor(Math.random()*(i-start+1)),x=idx[k];idx[k]=idx[i];idx[i]=x;}}},_getKenburns:function(photo){if(!this._kenburns)return null;return this._kenburns.createTransform(photo,
3597{width:this._cx,height:this._cy},{fillType:this._fill?'fill':'fit',duration:this._duration+2500});},_getMethod:function(photo,kenburns){var cx=this._cx,cy=this._cy;
3598if(kenburns){cx=kenburns.totalSize.width;cy=kenburns.totalSize.height;}var mth=this._fill?this._pickFillMethod(photo,cx,cy):photo.pickScaledMethod(cx,cy);if(kenburns)$.extend(mth,
3599{cx:this._cx,cy:this._cy,positioning:'flex'});return mth;},_getLoader:function(photo,method){var loaders=this._loaders;for(var i=0;i<loaders.length;i++){var loader=loaders[i],
3600lp=loader.getPhoto(),lm=loader.getMethod();if(lp.id==photo.id&&lm.code==method.code&&lm.cx==method.cx&&lm.cy==method.cy){loaders.splice(i,1);break;}loader=null;}loaders.push(loader=loader||new zf_PhotoLoader(photo,
3601method));if(loaders.length>this._.Lookahead*5)loaders.shift();return loader;},_isUsable:function(photo){return photo.access.type==zf_AccessType.Public&&!photo.video;
3602},_pickFillMethod:function(photo,width,height){var options=[{method:zf_ProcessingMethod.StandardSmallSize,mask:0},{method:zf_ProcessingMethod.StandardMediumSize,
3603mask:zf_AccessMask.ProtectMedium},{method:zf_ProcessingMethod.StandardLargeSize,mask:zf_AccessMask.ProtectLarge},{method:zf_ProcessingMethod.StandardExtraLargeSize,
3604mask:zf_AccessMask.ProtectExtraLarge},{method:zf_ProcessingMethod.StandardXXLargeSize,mask:zf_AccessMask.ProtectXXLarge}];var method=options[0].method,scaled=photo.getScaledSize(method);
3605for(var i=1;i<options.length;i++){var option=options[i];if((option.mask&photo.access.mask)!=0)continue;method=option.method;scaled=photo.getScaledSize(method);if(scaled.cx>=width&&scaled.cy>=height)break;
3606}return $.extend({},method,{cx:width,cy:height,clip:true,stretch:true,anchor:this._anchorPoint});},_getViewRect:function(view,method){if(this._kenburns)return{left:0,
3607top:0,width:this._cx,height:this._cy};method=method||view.getMethod();return{left:Math.round((this._cx-method.cx)/2),top:Math.round((this._cy-method.cy)/2),width:method.cx,
3608height:method.cy};},_animationEnd:function(node,timeout,callback){var event=this._animationEndEvent;function done(){if(timer){clearTimeout(timer);timer=null;node.unbind(event);
3609callback&&callback();}}var timer=setTimeout(done,timeout);node.bind(event,done);},_transitionSwap:function(increment,done){;var pva=this._pva,pvb=this._pvb,pla=pva.$().closest('.ssc-plane'),
3610plb=pvb.$().closest('.ssc-plane'),rect=this._getViewRect(pvb);pvb.$().css({left:rect.left+'px',top:rect.top+'px'}).width(rect.width).height(rect.height);pla.css('z-index',
36110);plb.css('z-index',1).removeClass('ssc-hide');setTimeout(function(){pla.addClass('ssc-hide');},50);done&&zf_stdDeferCall(null,done,null);},_transitionFadeIn:function(increment,
3612done,kenburns){;var pva=this._pva,pvb=this._pvb,pla=pva.$().closest('.ssc-plane'),plb=pvb.$().closest('.ssc-plane'),rect=this._getViewRect(pvb);pvb.$().css({left:rect.left+'px',
3613top:rect.top+'px'}).width(rect.width).height(rect.height);pla.css('z-index',0);plb.css('z-index',1).addClass('ssc-fade-in').removeClass('ssc-hide');this._kenburns&&this._kenburns.startTransform(kenburns,
3614pvb.$().find("IMG.pv-img"));setTimeout(function(){plb.removeClass('ssc-fade-in');done&&done();},1000);},_transitionFadeInDownlevel:function(increment,done){;var pva=this._pva,
3615pvb=this._pvb,pla=pva.$().closest('.ssc-plane'),plb=pvb.$().closest('.ssc-plane'),rect=this._getViewRect(pvb);pvb.$().css({left:rect.left+'px',top:rect.top+'px'}).width(rect.width).height(rect.height);
3616pla.css('z-index',0);plb.css('z-index',1).hide().removeClass('ssc-hide');plb.fadeIn(1000,function(){done&&done();});},_transitionCrossFade:function(increment,done,
3617kenburns){;var pva=this._pva,pvb=this._pvb,pla=pva.$().closest('.ssc-plane'),plb=pvb.$().closest('.ssc-plane'),rect=this._getViewRect(pvb);pvb.$().css({left:rect.left+'px',
3618top:rect.top+'px'}).width(rect.width).height(rect.height);pla.css('z-index',0).addClass('ssc-fade-out');plb.css('z-index',1).addClass('ssc-fade-in').removeClass('ssc-hide');
3619this._kenburns&&this._kenburns.startTransform(kenburns,pvb.$().find("IMG.pv-img"));var count=2;function complete(){if(--count>0)return;pla.addClass('ssc-hide').removeClass('ssc-fade-out');
3620plb.removeClass('ssc-fade-in');done&&done();}
3620this._animationEnd(pla,1500,complete);this._animationEnd(plb,1500,complete);},_transitionCrossFadeDownlevel:function(increment,
3621done){;var pva=this._pva,pvb=this._pvb,pla=pva.$().closest('.ssc-plane'),plb=pvb.$().closest('.ssc-plane'),rect=this._getViewRect(pvb);pvb.$().css({left:rect.left+'px',
3622top:rect.top+'px'}).width(rect.width).height(rect.height);pla.css('z-index',0);plb.css('z-index',1).hide().removeClass('ssc-hide');var count=2;function complete(){if(--count>0)return;
3623pla.addClass('ssc-hide').css('display','');done&&done();}pla.fadeOut(1000,complete);plb.fadeIn(1000,complete);},_transitionFadeThroughWhite:function(increment,done){;
3624this._transitionFadeThroughColor('#FFF',done);},_transitionFadeThroughWhiteDownlevel:function(increment,done){;this._transitionFadeThroughColorDownlevel('#FFF',done);
3625},_transitionFadeThroughBlack:function(increment,done){;this._transitionFadeThroughColor('#000',done);},_transitionFadeThroughBlackDownlevel:function(increment,done){;
3626this._transitionFadeThroughColorDownlevel('#000',done);},_transitionFadeThroughColor:function(color,done){var pva=this._pva,pvb=this._pvb,pla=pva.$().closest('.ssc-plane'),
3627plb=pvb.$().closest('.ssc-plane'),rect=this._getViewRect(pvb),self=this;pvb.$().css({left:rect.left+'px',top:rect.top+'px'}).width(rect.width).height(rect.height);
3628this.$('DIV.ssc-bg').css('background',color);pla.css('z-index',0).addClass('ssc-fade-out-fast');this._animationEnd(pla,600,function(){pla.addClass('ssc-hide').removeClass('ssc-fade-out-fast');
3629});setTimeout(function(){plb.css('z-index',1).addClass('ssc-fade-in-fast').removeClass('ssc-hide');self._animationEnd(plb,600,function(){plb.removeClass('ssc-fade-in-fast');
3630done&&done();});},500);},_transitionFadeThroughColorDownlevel:function(color,done){var pva=this._pva,pvb=this._pvb,pla=pva.$().closest('.ssc-plane'),plb=pvb.$().closest('.ssc-plane'),
3631rect=this._getViewRect(pvb);pvb.$().css({left:rect.left+'px',top:rect.top+'px'}).width(rect.width).height(rect.height);this.$('DIV.ssc-bg').css('background',color);
3632pla.css('z-index',0);pla.fadeOut(750);setTimeout(function(){pla.addClass('ssc-hide').css('display','');plb.css('z-index',1).hide().removeClass('ssc-hide');plb.fadeIn(750,
3633function(){done&&done();});},650);},_transitionSlide:function(increment,done){;var pva=this._pva,pvb=this._pvb,pla=pva.$().closest('.ssc-plane'),plb=pvb.$().closest('.ssc-plane'),
3634rect=this._getViewRect(pvb);pvb.$().css({left:rect.left+'px',top:rect.top+'px'}).width(rect.width).height(rect.height);var dir=increment>0?'left':'right',cls='ssc-slide-'+dir;
3635pla.addClass(cls);plb.css('z-index',1).css(dir,'100%').addClass(cls);plb.removeClass('ssc-hide');var count=2;function complete(){if(--count>0)return;pla.addClass('ssc-hide').removeClass(cls).css('z-index',
36360);plb.removeClass(cls).css(dir,'');done&&done();}this._animationEnd(pla,900,complete);this._animationEnd(plb,900,complete);},_transitionSimpleSlide:function(increment,
3637done){;var pva=this._pva,pvb=this._pvb,pla=pva.$().closest('.ssc-plane'),plb=pvb.$().closest('.ssc-plane'),rect=this._getViewRect(pvb);pvb.$().css({left:rect.left+'px',
3638top:rect.top+'px'}).width(rect.width).height(rect.height);pla.css('z-index',0);plb.css('z-index',1).css('translateX',increment*this._cx).removeClass('ssc-hide');
3639pla.animate({'translateX':-increment*this._cx},800);plb.animate({'translateX':0},800,null,function(){pla.addClass('ssc-hide').css('translateX','');plb.css('translateX',
3640'');done&&done();});},_transitionSlideDownlevel:function(increment,done){;var pva=this._pva,pvb=this._pvb,pla=pva.$().closest('.ssc-plane'),plb=pvb.$().closest('.ssc-plane'),
3641rect=this._getViewRect(pvb);pvb.$().css({left:rect.left+'px',top:rect.top+'px'}).width(rect.width).height(rect.height);var dir=increment>0?'left':'right';pla.css('z-index',
36420).css(dir,'0%');plb.css('z-index',1).css(dir,'100%').removeClass('ssc-hide');var aa={},ba={};aa[dir]='-100%';ba[dir]='0%';pla.animate(aa,800);plb.animate(ba,800,
3643null,function(){pla.addClass('ssc-hide').css(dir,'');plb.css(dir,'');done&&done();});},_resumeTrack:function(useForce){this._audioPlayer.resumeTrack();},_pauseTrack:function(useForce){this._audioPlayer.pauseTrack();
3644}})});$.extend(zf.zentobox.slideshow.SlideshowCore,{Initialized:0,Loading:1,Resting:2,Touching:3,Pending:4,Animating:5,FadeIn:-1,None:0,Random:1,FadeBlack:2,FadeWhite:3,
3645CrossFade:4,Slide:5,Kenburns:6,Lookahead:3});;
3645zf.$namespace('zf.zentobox',{BackgroundSlideshow:zf.$class(zf.zentobox.framework.Component,{_ctor:function(id,init){zf.zentobox.framework.Component.prototype.constructor.call(this,
3646id);var photoSet=this._photoSet=init.photoSet;if(photoSet!=null){var owner=zf_User.clone({id:photoSet.access.ownerId,loginName:zf_ownerName||zf_userName,domainName:zf_ownerDomain||zf_userDomain});
3647this._photoList=new zfl_PhotoList(0,init.pageSize,10000,photoSet.id,init.photoSetToken,photoSet.photoChangeNumber);this._photoList.setDefaults(photoSet,owner);}this._preview=init.preview;
3648this._browserScaling=init.browserScaling;},init:function(data){if(this._photoList==null)return;var anchors=[{x:0,y:0},{x:0.5,y:0},{x:1,y:0},{x:0,y:0.5},{x:0.5,y:0.5},
3649{x:1,y:0.5},{x:0,y:1},{x:0.5,y:1},{x:1,y:1}];var SlideshowCore=zf.zentobox.slideshow.SlideshowCore;this._slideshow=new SlideshowCore(this.id,this._photoList,{lengthKnown:false,
3650fill:true,soundtrack:data.content.soundtrack||null,soundtrackLooped:data.options.isSoundtrackLooped,soundtrackPhotoSetId:this._photoSet.id,slideDuration:parseInt((data.options.duration||5).toString(),
365110),transition:parseInt((data.options.transition||104).toString(),10)-100,random:data.options.isRandom,loop:data.options.needLoopImages,anchorPoint:anchors[data.options.anchorPoint!=null?data.options.anchorPoint:4]});
3652var paused=false,self=this,slideshow=this._slideshow,inactive=false,inactivityTimeout=null,options=data.options||{},click=options.click||{}
3652,ClickAction=zf.zentobox.BackgroundSlideshow.ClickAction;
3653if(!this._preview&&click.action!=ClickAction.None)this.$().addClass('zb-clickable');function trackInactivity(){self.$('.zb-bsp-ctl').addClass('inactive');var slider=self.$('.zb-bsp-slider:first').addClass('zb-hidden');
3654setTimeout(function(){slider.hasClass('zb-hidden')&&slider.hide();},200);inactive=true;inactivityTimeout=null;}function resetInactivity(){inactive=false;inactivityTimeout&&clearTimeout(inactivityTimeout);
3655inactivityTimeout=setTimeout(trackInactivity,5000);}$(document).bind('mousemove mousedown mouseup touchstart',function(e){if(inactive){self.$('.zb-bsp-ctl').removeClass('inactive');
3656resetInactivity();}});this.$('.zb-bsp-prev:first').click(function(){var c=$(this).addClass('active');setTimeout(function(){c.removeClass('active');},400);resetInactivity();
3657slideshow.prev();return false;});this.$('.zb-bsp-next:first').click(function(){var c=$(this).addClass('active');setTimeout(function(){c.removeClass('active');},400);
3658resetInactivity();slideshow.next();return false;});this.$('.zb-bsp-pause:first').click(function(){var c=$(this).addClass('active'),d=self.$('.zb-bsp-play:first').addClass('active');
3659setTimeout(function(){c.hide();d.show();c.removeClass('active');d.removeClass('active');},400);resetInactivity();slideshow.pause(false,false);return false;});this.$('.zb-bsp-play:first').click(function(){var c=$(this).addClass('active'),
3660d=self.$('.zb-bsp-pause:first').addClass('active');setTimeout(function(){c.hide();d.show();c.removeClass('active');d.removeClass('active');slideshow.resume(false);
3661},400);resetInactivity();return false;});this.$('.zb-bsp-volume:first').click(function(){self.$('.zb-bsp-slider:first').show().removeClass('zb-hidden');resetInactivity();
3662return false;});var loaded=false;slideshow.on('statechange',function(state,paused){if(!loaded&&state==SlideshowCore.Resting){loaded=true;self.$('DIV.zb-bsp-controls').removeClass('zb-hidden');
3663inactivityTimeout=setTimeout(trackInactivity,5000);}if(state==SlideshowCore.Resting){self.$('.zb-bsp-prev:first').toggleClass('zb-hidden',!slideshow.canPrev());self.$('.zb-bsp-next:first').toggleClass('zb-hidden',
3664!slideshow.canNext());}if(paused&&self.$('.zb-bsp-pause:first').is(':visible'))self.$('.zb-bsp-pause:first').click();else if(!paused&&self.$('.zb-bsp-play:first').is(':visible'))self.$('.zb-bsp-play:first').click();
3665});if(!this._preview){slideshow.on('click',function(photo){if(click.action==ClickAction.OpenPhoto)location.href=photo.getHref();else if(click.action==ClickAction.OpenPhotoInGallery)location.href=photo.getHref('gallery');
3666else if(click.action==ClickAction.DimTheLights){slideshow.pause(true,false);zf_DimLightsStandalone([photo],0,{onclose:function(){slideshow.resume(false);},browserScaling:self._browserScaling});
3667}else if(click.action==ClickAction.GoToUrl){if(click.newWindow)window.open(click.url);else location.href=click.url;}});}function setVolume(val){zf_storage.setItem('zf.zentobox.Backgroun
3667dSlideshow.volume',
3668val.toString());val=100-Math.min(Math.max(Math.round((val-3)/122*100),0),100);slideshow.volume(val);self.$('.zb-bsp-volume:first').attr('data-volume',Math.ceil(val/34));
3669}this.$('.zb-bsp-slider:first > DIV').mousedown(function(e){if(e.button!=0)return;var val=e.pageY-$(this).offset().top;$('SPAN',this).css('top',val-6+'px');setVolume(val);
3670});$.extend(new zf_MouseTracker(this.$('.zb-bsp-slider:first SPAN')),{onbegintrack:function(){this._btn=self.$('.zb-bsp-slider:first SPAN');this._anchorPos=this._btn.position().top+6;
3671inactivityTimeout&&clearTimeout(inactivityTimeout);inactivityTimeout=null;return true;},ontrack:function(e){var val=Math.min(Math.max(this._anchorPos+e.pageY-this.anchorY,
36723),125);this._btn.css('top',val-6+'px');setVolume(val);},onendtrack:function(){resetInactivity();}});$(document).bind('mousedown',function(e){if($(e.target).closest('.zb-bsp-slider').length==0){var slider=self.$('.zb-bsp-slider:first').addClass('zb-hidden');
3673setTimeout(function(){slider.hasClass('zb-hidden')&&slider.hide();},200);}});
3673$(function(){var val=zf_storage.getItem('zf.zentobox.BackgroundSlideshow.volume')||'3';
3674val=parseInt(val,10);val=isNaN(val)?3:val;self.$('.zb-bsp-slider:first SPAN').css('top',val-6+'px');setVolume(val);});},resize:function(availWidth,availHeight,constraints){;
3675if(this._photoList==null)return{cx:availWidth,cy:availHeight};constraints=constraints||{};this.$('A.zb-bsp-volume:first').toggle(this._slideshow.hasMusic());var size=this._slideshow.resize(availWidth,
3676availHeight);if(this._slideshow.state==zf.zentobox.slideshow.SlideshowCore.Initialized)this._slideshow.start();var controls=constraints.controls;align=constraints.alignControls;
3677controls=controls||{left:0,top:0,width:availWidth,height:availHeight};align=align||'middle';this.$('DIV.zb-bsp-controls:first').css('left',controls.left+'px').css('top',
3678controls.top+'px').width(controls.width).height(controls.height).removeClass('zb-bsp-top zb-bsp-middle zb-bsp-bottom').addClass('zb-bsp-'+align);return size;},togglePlay:function(play){zf.zentobox.framework.Component.prototype.togglePlay.call(this,
3679play);if(this._slideshow)play?this._slideshow.resume(true):this._slideshow.pause(false,true);}})});
3679$.extend(zf.zentobox.BackgroundSlideshow,{ClickAction:{None:0,DimTheLights:1,
3680OpenPhoto:2,GoToUrl:3,OpenPhotoInGallery:4}});;(function(window){'use strict';var lastTime=0,vendors=['moz','webkit','o','ms'],x;for(x=0;x<vendors.length&&!window.requestAnimationFrame;
3681x+=1){window.requestAnimationFrame=window[vendors[x]+'RequestAnimationFrame'];window.cancelAnimationFrame=window[vendors[x]+'CancelAnimationFrame']||window[vendors[x]+'CancelRequestAnimationFrame'];
3682}if(!window.cancelAnimationFrame){if(!window.requestAnimationFrame){window.requestAnimationFrame=function(callback){var now=new Date().getTime(),nextTime=Math.max(lastTime+16,
3683now);return window.setTimeout(function(){callback(lastTime=nextTime);},nextTime-now);};window.cancelAnimationFrame=window.clearTimeout;}else{vendors=window.requestAnimationFrame;
3684lastTime={};window.requestAnimationFrame=function(callback){var id=x;x+=1;lastTime[id]=callback;vendors(function(timestamp){if(lastTime.hasOwnProperty(id)){var error;
3685try{lastTime[id](timestamp);}catch(e){error=e;}finally{delete lastTime[id];if(error){throw error;}}}});return id;};window.cancelAnimationFrame=function(id){delete lastTime[id];
3686};}}}(window));;zf.$namespace('zf.zentobox.photostrip',{PhotoStripCore:zf.$class([zf_Control,zf.core.EventSource],{_ctor:function(id,photoList,options){;zf_Control.prototype.constructor.call(this,
3687id);zf.core.EventSource.prototype.constructor.call(this);this._=zf.zentobox.photostrip.PhotoStripCore;this._photoList=photoList;this._lengthKnown=options.lengthKnown;
3688this._firstImage=options.firstImage;this._random=!!options.random;this._gap=options.gap!=null?options.gap:5;this._pageSize=photoList._page;this._idx=[];this._loaders=[];
3689this._items=[];this._views={};if('transform' in document.body.style)this._transformProp='transform';else if('webkitTransform' in document.body.style)this._transformProp='webkitTransform';
3690else if('mozTransform' in document.body.style)this._transformProp='mozTransform';this._animationId=0;this._pagingQueue=[];var self=this;photoList.onshrink=function(){;
3691self._lengthKnown=true;self._initIndexMap(this.length);self._cx&&self._cy&&self.resize(self._cx,self._cy);};photoList.get(0);var noImage=new zf_PlaceholderImage(1),
3692noMethod=zf_ProcessingMethod.StandardSmallSize;this.$().prepend(['<div class="psc-plane"></div>'].join(''));this.$().addClass('psc');zf_stdDisableRightClick(this.$());
3693},resize:function(cx,cy){;this.$().width(cx).height(cy);this._cx=cx;this._cy=cy;var self=this;this._move(this._position||0,function(){self.trigger('update',self._position,
3694self._total);});return{cx:cx,cy:cy};},position:function(){return this._position;},length:function(){return this._total;},stopScroll:function(){this._busy=false;this._paging=false;
3695},scrollTo:function(position){;;if(position==this._position){this.trigger('update',this._position,this._total);return;}this._scroll(Math.min(Math.max(position,0),
3696this._total));},pageNext:function(callback){;var self=this;this._pageScroll(function(scroll){self._find(0,self._position+self._cx,function(index,item){if(item==null)return;
3697if(item.left<=self._position){self._find(index,item.right+1,function(index,item){scroll(Math.min(Math.max(item.left-80,item.right-self._cx),self._total));});}else scroll(Math.min(Math.max(item.left-80,
3698item.right-self._cx),self._total));});},callback);},pageBack:function(callback){;var self=this;this._pageScroll(function(scroll){self._find(0,self._position,function(index,
3699item){if((item.left==self._position||item.right>=self._position+self._cx)&&index>0)item=self._items[index-1];scroll(Math.max(Math.min(item.left,item.right-self._cx+80),
37000));});},callback);},_pageScroll:function(getPos,callback){if(this._paging){this._pagingQueue.push(getPos);return;}var self=this;this._paging=true;getPos(function(pos){self._scroll(pos,
3701750,function(){self._paging=false;var getPos=self._pagingQueue.shift();getPos&&self._pageScroll(getPos);callback&&callback();});});},_scroll:function(position,duration,
3702complete){;if(this._busy){this._pendingPosition=position;return;}var animationId=++this._animationId,start=$.now(),delta=position-this._position,self=this;function done(){self.trigger('update',
3703self._position,self._total);complete&&complete();}function step(val){if(animationId!=self._animationId)return;self.trigger('update',self._position,self._total);self._busy=false;
3704var pos=self._pendingPosition;self._pendingPosition=null;if(pos!=null){self._scroll(pos);return;}if(val>=1){done();return;}val=(duration!=null)?Math.min(($.now()-start)/duration,
37051):1;val=Math.log(val*(Math.E-1)+1);pos=Math.round(position-delta*(1-val));self._busy=true;self._move(pos,function(){step(val);});}step(0);},_move:function(position,
3706complete){;var self=this,width=this._cx,index=0,dir=position<this._position?-1:1,first=null;this._prefetchTimeout&&clearTimeout(this._prefetchTimeout);this._prefetchTimeout=null;
3707for(var id in this._views)this._views[id].stale=true;function show(index,pos){self._find(index,pos,function(i,item){if(first==null)first=i;if(item==null){finalize(index);
3708return;}var photo=item.photo,method=self._getMethod(photo);if(self._views['p'+photo.id])item.view=self._views['p'+photo.id].view;else if(item.view==null){self.$('.psc-plane:first').append(zf_PhotoView.createHtml(self.id+'p'+photo.id,
3709null,null,[],zf_PhotoView.EMPTY_CONTEXT,photo,method,false,0,0));item.view=new zf_PhotoView(self.id+'p'+photo.id,[],zf_PhotoView.EMPTY_CONTEXT);item.view.$().find('.pv-inner:first').unbind('click').click(function(e){e.preventDefault();
3710e.stopPropagation();self.trigger('click',photo);});}if(self._transformProp!=null)item.view.$().css(self._transformProp,'translateX('+(item.left-position)+'px)');
3711else item.view.$().css('left',(item.left-position)+'px');item.stale=false;self._views['p'+photo.id]=item;var vp=item.view.getPhoto(),vm=item.view.getMethod();if(vm==null||vm.cx!=method.cx||vm.cy!=method.cy)item.view.resize(zf_PhotoView.EMPTY_CONTEXT,
3712photo,method);if(vp==null||vp.id!=photo.id||vm.code!=method.code)item.view.load(self._getLoader(photo,method),null,true);var right=item.right-position;if(right>=2.4*width)finalize(i+1);
3713else show(i+1,item.right);});}function finalize(index){for(var id in self._views){var item=self._views[id];if(item.stale){item.view.$().remove();item.view=null;delete self._views[id];
3714}}self._find(index,position+100000,function(){for(var i=self._items.length-1;i>=0;i--){var item=self._items[i];if(item.photo!=null){self._total=Math.max(0,item.right-self._cx);
3715break;}}complete&&zf_stdDeferCall(null,complete,null);});self._prefetchTimeout=setTimeout(function(){if(dir>0)self._prefetch(index-1,1,self._.Lookahead);else self._prefetch(first,
3716-1,self._.Lookahead);},500);}show(0,position-width);this._position=position;},_find:function(start,pos,callback){;while(start>0&&this._items[start-1].right==null){start--;
3717}var x=start>0?this._items[start-1].right+this._gap:0,self=this;for(var i=start;true;i++){var item=this._items[i];if(item==null){this._getPhoto(i,1,function(index,
3718item){if(item==null){callback(index,null);return;}var photo=item.photo,size=photo.getScaledSize({cx:Number.MAX_VALUE,cy:self._cy});if(size.cy<self._cy){size.cx=Math.round(size.cx*self._cy/size.cy);
3719size.cy=self._cy;}item.width=size.cx;item.height=size.cy;item.left=x;item.right=x+size.cx;if(x+item.width>pos){callback(index,item);return;}self._find(index+1,pos,
3720callback);});return;}if(item.photo==null)continue;if(item.height!=this._cy){var photo=item.photo,size=photo.getScaledSize({cx:Number.MAX_VALUE,cy:self._cy});if(size.cy<self._cy){size.cx=Math.round(size.cx*self._cy/size.cy);
3721size.cy=self._cy;}item.width=size.cx;item.height=size.cy;item.left=x;item.right=x+size.cx;}if(x+item.width>pos){callback(i,item);return;}x+=item.width+this._gap;
3722}},_prefetch:function(index,increment,count){;var self=this;this._getPhoto(index+increment,increment,function(index,item){if(item==null)return;;var photo=item.photo,
3723method=self._getMethod(photo),loader=self._getLoader(photo,method);if(loader.state==zf_PhotoLoader.Initialized)loader.start();if(--count>0)self._prefetch(index,increment,
3724count);});},_getPhoto:function(index,increment,done,start){;start=start||index;var photoList=this._photoList,length=this._idx.length,self=this;do{if(index>=length){if(this._lengthKnown){done(index,
3725null);return;}else{zf_Loadable.notifyLoaded(photoList.get(length),function(){zf_stdDeferCall(null,function(){!self._lengthKnown&&self._initIndexMap(length+self._pageSize);
3726self._getPhoto(index,increment,done,start);},null);});return;}}else if(index<0){done(start,null);return;};;var mapped=this._idx[index];if(mapped<0)index+=increment;
3727}while(mapped<0);zf_Loadable.notifyLoaded(photoList.get(mapped),function(photo){if(self._isUsable(photo)){var item=self._items[index]={photo:photo,index:index};done(index,
3728item);return;}self._idx[index]=-1;self._items[index]={photo:null};index+=increment;self._getPhoto(index,increment,done,start);});},_initIndexMap:function(length){;
3729var idx=this._idx,start=idx.length;for(var i=start;i<length;i++)idx[i]=i;if(this._random){for(i=length-1;i>start;i--){var k=start+Math.floor(Math.random()*(i-start+1)),
3730x=idx[k];idx[k]=idx[i];idx[i]=x;}}},_getMethod:function(photo){var size=photo.getScaledSize({cx:Number.MAX_VALUE,cy:this._cy});if(size.cy<this._cy){size.cx=Math.round(size.cx*this._cy/size.cy);
3731size.cy=this._cy;}var options=[{method:zf_ProcessingMethod.StandardSmallSize,mask:0},{method:zf_ProcessingMethod.StandardMediumSize,mask:zf_AccessMask.ProtectMedium},
3732{method:zf_ProcessingMethod.StandardLargeSize,mask:zf_AccessMask.ProtectLarge},{method:zf_ProcessingMethod.StandardExtraLargeSize,mask:zf_AccessMask.ProtectExtraLarge},
3733{method:zf_ProcessingMethod.StandardXXLargeSize,mask:zf_AccessMask.Protect
3733XXLarge}];var method=options[0].method,scaled=photo.getScaledSize(method);for(var i=1;i<options.length;
3734i++){var option=options[i];if((option.mask&photo.access.mask)!=0)continue;method=option.method;scaled=photo.getScaledSize(method);if(scaled.cy>=size.cy)break;}return $.extend({},
3735method,size,{clip:true,stretch:true});},_getLoader:function(photo,method){var loaders=this._loaders;for(var i=0;i<loaders.length;i++){var loader=loaders[i],lp=loader.getPhoto(),
3736lm=loader.getMethod();if(lp.id==photo.id&&lm.code==method.code&&lm.cx==method.cx&&lm.cy==method.cy){loaders.splice(i,1);break;}loader=null;}loaders.push(loader=loader||new zf_PhotoLoader(photo,
3737method));if(loaders.length>this._.Lookahead*3)loaders.shift();return loader;},_isUsable:function(photo){return photo.access.type==zf_AccessType.Public&&!photo.video;
3738}})});$.extend(zf.zentobox.photostrip.PhotoStripCore,{Lookahead:5});;zf.$namespace('zf.zentobox',{PhotoStrip:zf.$class(zf.zentobox.framework.Component,{_ctor:function(id,
3739init){zf.zentobox.framework.Component.prototype.constructor.call(this,id);var photoSet=this._photoSet=init.photoSet;if(photoSet!=null){var owner=zf_User.clone({id:photoSet.access.ownerId,
3740loginName:zf_ownerName||zf_userName,domainName:zf_ownerDomain||zf_userDomain});this._photoList=new zfl_PhotoList(0,init.pageSize,10000,photoSet.id,init.photoSetToken,
3741photoSet.photoChangeNumber);this._photoList.setDefaults(photoSet,owner);}this._preview=init.preview;this._hasScrollbar=init.hasScrollbar;this._browserScaling=init.browserScaling;
3742},init:function(data){if(this._photoList==null)return;var PhotoStripCore=zf.zentobox.photostrip.PhotoStripCore;this._strip=new PhotoStripCore(this.id,this._photoList,
3743{lengthKnown:false,gap:data.options.spacing});var options=data.options||{},click=options.click||{},ClickAction=zf.zentobox.PhotoStrip.ClickAction;if(!this._preview&&click.action!=ClickAction.None)this.$().addClass('zb-clickable');
3744var self=this,strip=this._strip,inactive=false,inactivityTimeout=null,$arrows=this.$('.zb-psp-arrow'),$scrollbar=this.$('.zb-psp-ctl'),isPaused=false,hasWindowFocus=true;
3745function trackInactivity(){$scrollbar.addClass('inactive');$arrows.addClass('inactive');self.$dom().addClass('inactive');inactivityTimeout=null;}function resetInactivity(){inactivityTimeout&&clearTimeout(inactivityTimeout);
3746inactivityTimeout=setTimeout(trackInactivity,5000);}var aminScrollId,animSpeed=0;function updateArrows(){var pos=strip.position()+animSpeed;this.$('.zb-psp-prev').toggleClass('hidden',
3747pos<=0);this.$('.zb-psp-next').toggleClass('hidden',pos>=strip.length());}function startScroll(){if(!isPaused){var pos=strip.position()+animSpeed;strip.scrollTo(pos);
3748if(pos<=0||pos>=strip.length()){stopScroll();return;}}aminScrollId=requestAnimationFrame(startScroll);}function stopScroll(){cancelAnimationFrame(aminScrollId);aminScrollId=undefined;
3749strip.stopScroll();}var psScrollArea=this.$('.zb-psp-scroll'),speedDelta=9,maxSpeed=30,perc;psScrollArea.bind('mousemove mouseenter',function(e){var $el=$(e.currentTarget),
3750left=e.pageX-$el.offset().left,width=$el.width(),isRight=$el.hasClass('zb-psp-right'),$faster=$el.find('.zb-faster');if(isRight){perc=(left/width)*100;perc/=speedDelta;
3751animSpeed=e.pageX<$faster.offset().left?perc:maxSpeed;}else{perc=100-(left/width)*100;perc/=speedDelta;animSpeed=e.pageX>$faster.offset().left+$faster.width()?-perc:-maxSpeed;
3752}if(!aminScrollId&&hasWindowFocus)aminScrollId=requestAnimationFrame(startScroll);});psScrollArea.bind('mouseleave',function(e){if(!self._hasScrollbar&&$(e.toElement||e.relatedTarget).hasClass('zb-psp-arrow'))return;
3753stopScroll();resetInactivity();});psScrollArea.click(function(e){if($(e.target).hasClass('zb-psp-arrow'))return;$(this).css('z-index','0');var $el=$(document.elementFromPoint(e.clientX,
3754e.clientY));$el.hasClass('pv-img')&&$el.click();$(this).css('z-index','1');});this.$dom().bind('mouseover mousemove mousedown mouseup touchstart',function(e){if(self._hasScrollbar&&$(e.toElement||e.relatedTarget).hasClass('zb-psp-scroll-area'))$scrollbar.removeClass('inactive');
3755else $arrows.removeClass('inactive');self.$dom().removeClass('inactive');resetInactivity();});$(window).blur(function(){stopScroll();hasWindowFocus=false;});$(window).focus(function(){hasWindowFocus=true;
3756});$(document).keydown(function(e){stopScroll();if(e.keyCode==37){strip.pageBack();}else if(e.keyCode==39){strip.pageNext();}});var loaded=false,tracking=false;strip.on('update',
3757function(current,total){;if(!tracking){var bar=self.$('.zb-psp-bar:first'),handle=self.$('.zb-psp-handle:first'),width=self.$().width(),barWidth=bar.width(),handleWidth=Math.max(Math.round(width/(total+width)*barWidth),
375860),range=barWidth-handleWidth,pos=Math.round(current/total*range);handle.width(handleWidth).css('left',pos);}if(!loaded){self.$().removeClass('zb-hidden');self.$('DIV.zb-psp-controls:first').removeClass('zb-hidden');
3759loaded=true;}self._current=current;self._total=total;updateArrows();});if(!this._preview){strip.on('click',function(photo){if(click.action==ClickAction.OpenPhoto)location.href=photo.getHref();
3760else if(click.action==ClickAction.OpenPhotoInGallery)location.href=photo.getHref('gallery');else if(click.action==ClickAction.DimTheLights)zf_DimLightsStandalone([photo],
37610,{browserScaling:self._browserScaling});else if(click.action==ClickAction.GoToUrl){var url=click.url;if(url.indexOf('http:')!=0&&url.indexOf('https:')!=0&&url.indexOf('/')!=0)url='http://'+url;
3762if(click.newWindow)window.open(url);else location.href=url;}});}this.$('.zb-psp-bar:first').mousedown(function(e){if(zf_stdIsLeftButton(e)){var handle=$(this).find('.zb-psp-handle:first'),
3763forward=e.pageX>handle.offset().left;if(forward)strip.pageNext();else strip.pageBack();}}).bind('touchstart',function(e){e.stopPropagation();e.stopImmediatePropagation();
3764});this.$().bind('mousewheel DOMMouseScroll',function(e){if(aminScrollId){isPaused=true;
3764setTimeout(function(){isPaused=false;},1000);}e.preventDefault();e.stopPropagation();
3765var delta=e.originalEvent.wheelDelta?-e.originalEvent.wheelDelta:(e.originalEvent.detail<0?-120:120);strip.scrollTo(strip.position()+delta);});this._attachSwipe();
3766$.extend(new zf_MouseTracker(this.$('.zb-psp-handle:first')),{onbegintrack:function(){;tracking=true;this._bar=self.$('.zb-psp-bar:first');this._handle=self.$('.zb-psp-handle:first');
3767this._anchorPos=this._handle.position().left;this._range=this._bar.width()-this._handle.width();inactivityTimeout&&clearTimeout(inactivityTimeout);inactivityTimeout=null;
3768$scrollbar.removeClass('inactive');inactive=false;this._bar.addClass('active');return true;},ontrack:function(e){var val=Math.min(Math.max(this._anchorPos+e.pageX-this.anchorX,
37690),this._range);this._handle.css('left',val+'px');strip.scrollTo(this._range==0?0:Math.round(val/this._range*self._total));},onendtrack:function(){;this._bar.removeClass('active');
3770resetInactivity();tracking=false;strip.trigger('update',self._current,self._total);}});},resize:function(availWidth,availHeight,constraints){;if(this._photoList==null)return{cx:availWidth,
3771cy:availHeight};constraints=constraints||{};var size=this._strip.resize(availWidth,availHeight);var controls=constraints.controls;align=constraints.alignControls;
3772controls=controls||{left:0,top:0,width:availWidth,height:availHeight};this.$('.zb-psp-arrow').toggleClass('bottom',align=='bottom');this.$('.zb-psp-area').css({left:controls.left+'px',
3773top:controls.top+'px',width:controls.width+'px',height:controls.height+'px'});this.$('DIV.zb-psp-bar:first').width(controls.width-120);return size;},_attachSwipe:function(){$.noop;
3774}})});$.extend(zf.zentobox.PhotoStrip,{ClickAction:{None:0,DimTheLights:1,OpenPhoto:2,GoToUrl:3,OpenPhotoInGallery:4}});;;zf_CaptchaResponseCallback=function(token,id){var captchaField=$("#"+id+"-captcha-field");
3775var formElm=captchaField.closest("form");if(window[id]&&window[id]._captchaCallback){window[id]._captchaCallback(token);}else if(formElm.data("captcha")=="yes"){formElm.find("[name='g-recaptcha-response']").val(token);
3776if(zf_isMobileLayout()){window['registerForm']._button_ontap();}else{var formId=formElm.attr("id")||"";var form=window["_zf_"+(formId.indexOf('_')==0?formId.replace('_',
3777''):formId)];var state=formElm.next("div.button").find("[id$='-state']");var btnType=zfl_Button.CssDescriptor.GetDescriptor("");formElm.trigger('submit',{onrequestsend:function(){zfl_Button.togglePending(state,
3778btnType,true);},onreply:function(result,error){if(error!=null)zfl_Button.togglePending(state,btnType,false);form.onreply(result,error);}});}}};zf_CaptchaCallback=function(){$('.g-recaptcha').each(function(index,
3779el){if($(this).attr('data-widget-id'))return;var id=$(this).attr("id").replace("-captcha-field","");var widgetId=grecaptcha.enterprise.render(el,{'sitekey':$(this).data('sitekey'),
3780'callback':function(token){zf_CaptchaResponseCallback(token,id);}});$(this).attr('data-widget-id',widgetId);});};zf_resetCaptcha=function(widgetId){if(typeof grecaptcha!=='undefined'&&typeof grecaptcha.enterprise!=='undefined'){widgetId=widgetId||0;
3781grecaptcha.enterprise.reset(widgetId);}};;;function zfl_Layout(id,global,local){zfl_Control.prototype.constructor.call(this,id);this.zenbar=global.zenbar;this.header=global.header;
3782this.menubar=global.menubar;this.footer=global.footer;this.customizer=global.customizer;this.administrator=global.administrator;this.scrapbook=global.scrapbook;this.topBanner=global.topBanner;
3783this.topBannerHeight=global.topBannerHeight;this.topBannerVisible=global.topBannerVisible;this.siteFadeInMode=global.siteFadeInMode;this.canMakeZookbindersAlbum=global.canMakeZookbindersAlbum;
3784this.isGspAlbumFlow=global.isGspAlbumFlow;this.quickShopParameters=global.quickShopParameters;this.yearbook=global.yearbook;this._decorations=zfl_stdTransformResponse(global.decorations,
3785"decorations");this._pageType=global.pageType;this._columns=local.columns;this._fixedWidth=local.fixedWidth;this._fillers=local.fillers;this._player=local.player;
3786if(this.customizer&&this._player)this.customizer.setZentoboxPlayer(this._player);if(this.customizer&&this.topBanner)this.customizer.setTopBanner(this.topBanner);
3787this._keyHandlers=[];this._handlers=zfl_Layout.createHandlers(this,this.getCommands());var self=this;zf_stdAttachEvent(window,"DOMContentLoaded",this.eventHandler(this._window_onload,
3788"DOMContentLoaded"));zf_stdAttachEvent(window,"load",this.eventHandler(this._window_onload,"window.onload"));$(window).on("resize",this.eventHandler(this._window_onresize));
3789this._windowScrollHandlerTimeoutId=null;$(window).scroll(this.eventHandler(this._window_onscroll));this._feeds=local.feeds;var ontoggle=function(expanded){self._bin_ontoggle(this,
3790expanded);};var onfeeds=function(origin){self._bin_onfeeds(this,origin);};this._bins={};for(var key in local.bins){var bin=local.bins[key];if(bin==null)continue;
3791this._bins[key]=bin;bin.ontoggle=ontoggle;bin.onfeeds=onfeeds;}this._grids=local.grids;this._pairs=local.pairs;
3791if(local.analytics&&(!local.isEcommercePage||zf_isMobileLayout())){this.analytics=local.analytics;
3792this.analytics.registerNonPhotoVisit();}this._controls=new zfl_Layout.Controls(this);this._returnData=Zenfolio.Global.AddToCartService.getReturnData();Zenfolio.Global.AddToCartService.updateReturnData(null);
3793if(this._returnData&&this._returnData.pageType==zf_ReturnPageType.Favorites){if(this.zenbar&&this.scrapbook&&this._returnData.scrapbookId!=null&&this._returnData.hasPhotoKeys()){this.zenbar.returnData=this._returnData;
3794}this._returnData=null;}if(this.zenbar){this.zenbar.init();if(this.scrapbook){this.zenbar.scrapbookEdit=this.scrapbook;this.zenbar.setScrapbookInfo(this.scrapbook.current);
3795this.zenbar.onscrapbook=this.closure(this._handlers.oncommand,"openFavorites");this.scrapbook.administrator=this.administrator;this.scrapbook.onchange=this.zenbar.closure(this.zenbar.setScrapbookInfo);
3796this.scrapbook.addtocart=this.zenbar.closure(this.zenbar.addToCart);this.scrapbook.editproduct=this.zenbar.closure(this.zenbar.editProduct);this.scrapbook.makezookalbum=this.zenbar.closure(this.zenbar.makeZookAlbum);
3797this.scrapbook.canmakezookalbum=this.zenbar.closure(this.zenbar.canMakeZookAlbum);this._keyHandlers.push(this.scrapbook.closure(this.scrapbook.keyDown));}else{this.zenbar.setScrapbookInfo(null);
3798}if(this.yearbook){this.zenbar.yearbookEdit=this.yearbook;}this.zenbar.quickShopParameters=this.quickShopParameters;}}zfl_Layout.inherits(zfl_Control);zfl_Layout.prototype.recalc=function(deferred){if(!this.__loaded){;
3799return;}if(deferred){zf_stdDeferCall(this.id+".recalc",this.recalc,this);return;}if(this.__recalc_running){;return;}this.__recalc_running=true;var start=new Date();
3800if(this.topBanner){if(this.topBannerVisible){this.topBanner.resize(this.$dom('frame').innerWidth(),this.topBannerHeight);}else{this.topBanner.$().css('display','none');
3801}}this.onrecalc();zfl_Mat.recalc();if(this.footer&&!this.footer.__zfl_shown){this.footer.$().parent().css({visibility:'visible'});this.footer.__zfl_shown=true;};
3802this.__recalc_running=false;zfl_Layout.fadeIn(this.siteFadeInMode);};zfl_Layout.fadeIn=function(fadeMode){var $pageFrame=$('#page-frame'),PageFadeinMode={'50':0.3,'51':0.6,
3803'52':1.3},s=document.createElement('p').style,supportsTransitions='WebkitTransition' in s||'MozTransition' in s||'msTransition' in s||'OTransition' in s||'transition' in s;
3804if(!supportsTransitions||!fadeMode||!PageFadeinMode[fadeMode])$pageFrame.css('opacity',1);else{var anim='opacity '+PageFadeinMode[fadeMode]+'s ease-in';$pageFrame.css({'-webkit-transition':anim,
3805'-moz-transition':anim,'-ms-transition':anim,'-o-transition':anim,'transition':anim,'opacity':1});}__zfl_fallback&&clearTimeout(__zfl_fallback);};zfl_Layout.prototype._window_onresize=function(){;
3806this.recalc(true);};zfl_Layout.prototype._window_onload=function(e,source){if(this.__loaded){;return;}this.__loaded=true;;var start;$(document).keydown(this.closure(this._document_onkeydown));
3807start=new Date().getTime();this.onload();;this.recalc();};zfl_Layout.prototype._window_onscroll=function(evt){if(!this._grid)return;clearTimeout(this._windowScrollHandlerTimeoutId);
3808var self=this;this._windowScrollHandlerTimeoutId=setTimeout(function(){var lastVisible=self._grid.getLastVisiblePhotoView();;var lastVisibleTop=lastVisible.$().offset().top;
3809var scrollTop=$(window).scrollTop();if(scrollTop>lastVisibleTop){self.recalc(true);}},500);};zfl_Layout.prototype.onload=function(){if(this.footer)this.footer.visibility(true);
3810var self=this;$('BODY').bind('recalc.Layout',function(e,deferred){self.recalc(deferred);});var player=this._player,customizer=this.customizer,topBanner=this.topBanner;
3811player&&customizer&&player.on('save',function(zentoboxId,data,callback){customizer.updateZentobox(zentoboxId,data,callback);});topBanner&&customizer&&topBanner.on('save',
3812function(zentoboxId,data,callback){customizer.updateTopBanner(zentoboxId,data,callback);});};zfl_Layout.prototype.onrecalc=function(){var domSelf=this.dom();var i;var cyWindow=zf_stdGetClientHeight();
3813cyWindow=Math.max(300,cyWindow);var cyCustomizer=this.__cyCustomizer;if(cyCustomizer==null){cyCustomizer=this.__cyCustomizer=!this.customizer?0:(zf_stdGetHeightOverall(this.customizer.dom())+5);
3814}var cyZenBar=this.__cyZenBar;if(cyZenBar==null){cyZenBar=this.__cyZenBar=!this.zenbar?0:zf_stdGetHeightOverall(this.zenbar.dom());}var cyHeader=this.__cyHeader;
3815if(cyHeader==null){cyHeader=this.__cyHeader=!this.header?0:zf_stdGetHeightOverall(this.header.dom());}var cyMenuBar=this.__cyMenuBar;if(cyMenuBar==null){cyMenuBar=this.__cyMenuBar=!this.menubar?0:zf_stdGetHeightOverall(this.menubar.dom());
3816}var cyTopBanner=0;if(this.topBanner){cyTopBanner=zf_stdGetHeightOverall(this.topBanner.dom());}var cyFooter=this.__cyFooter;if(cyFooter==null){cyFooter=this.__cyFooter=(this.footer==null)?0:zf_stdGetHeightOverall(this.footer.dom());
3817}var cyPaddingTop=this.__cyPaddingTop;var cyPaddingBottom=this.__cyPaddingBottom;if(cyPaddingTop==null){cyPaddingTop=this.__cyPaddingTop=zf_stdGetHeightAbove(domSelf);
3818cyPaddingBottom=this.__cyPaddingBottom=zf_stdGetHeightBelow(domSelf);}
3818var cyTaken=cyCustomizer+cyZenBar+cyHeader+cyMenuBar+cyTopBanner+cyPaddingBottom+cyFooter;var cyLeft=cyWindow-cyTaken;
3819var cyColumns=0;var columns=[],column;for(var key in this._columns){column=this._columns[key];column.updateDependencies();var cyFixed=column.getFixedHeight();var cyMin=column.hasWaterline!=null?column.getMinHeight():cyFixed;
3820var cyOffset=zf_stdGetOffset(column.dom(),domSelf).cy;cyFixed+=cyOffset;cyMin+=cyOffset;if(cyFixed>cyColumns)cyColumns=cyFixed;if(column.stretcherId){columns.push(column);
3821column.__minHeight=cyMin;column.__fixedHeight=cyFixed;};}if(this.cyMinFooter!=null&&cyFooter!=0){cyLeft+=cyFooter-this.cyMinFooter;cyFooter=this.cyMinFooter;}var maxColumn=cyLeft;
3822if(!this.keepFooter&&cyColumns>cyLeft){if(cyColumns<cyLeft+cyFooter)maxColumn=cyColumns;else maxColumn=cyLeft+cyFooter;};var overStretch=0;for(i=0;i<columns.length;
3823i++){column=columns[i];var actualStretch;var desiredStretch;if(column.__minHeight<maxColumn)desiredStretch=maxColumn-column.__minHeight;else desiredStretch=0;actualStretch=column.stretch(desiredStretch);
3824;column.__actualStretch=actualStretch;if(actualStretch+column.__fixedHeight>maxColumn){var maxColumn2=actualStretch+column.__fixedHeight;if(maxColumn2<cyLeft+cyFooter)maxColumn2=actualStretch+column.__fixedHeight;
3825else maxColumn2=cyLeft+cyFooter;if(maxColumn2!=maxColumn){maxColumn=maxColumn2;for(var j=0;j<i;j++){if(columns[j].__actualStretch+columns[j].__fixedHeight<maxColumn){var updatedStretch=maxColumn-columns[j].__fixedHeight;
3826columns[j].stretch(updatedStretch);;}}}}}var cyOldFillers=0;var nFillers=this._fillers.length;for(i=0;i<nFillers;i++){var filler=document.getElementById(this._fillers[i]);
3827if(!filler)continue;cyOldFillers+=filler.clientHeight;}var cyLayout=cyCustomizer+cyHeader+cyTopBanner+cyZenBar+cyMenuBar+cyFooter+zf_stdGetHeightOverall(domSelf)-cyOldFillers;
3828var cyNewFillers=0;if(cyLayout<cyWindow)cyNewFillers=cyWindow-cyLayout;if(cyOldFillers!=cyNewFillers&&nFillers>0){var cyFiller1=Math.floor(cyNewFillers/nFillers);
3829var cyFiller0=cyNewFillers-cyFiller1*(nFillers-1);for(i=0;i<nFillers;i++){var domFiller=document.getElementById(this._fillers[i]);domFiller.style.height=(i==0?cyFiller0:cyFiller1)+"px";
3830}};};zfl_Layout.prototype.initGrid=function(grid,style,params,objects,size,selection){if(!grid)return;if(!params)params={};var methodAuto=false;if(params.method=="auto1"||params.method==null){params.method=(screen.width<=1024)?zf_ProcessingMethod.StandardThumbnail:zf_ProcessingMethod.StandardLargeThumbnail;
3831methodAuto=true;}else if(params.method=="auto2"){params.method=(screen.width<1600)?zf_ProcessingMethod.StandardLargeThumbnail:zf_ProcessingMethod.StandardVeryLargeThumbnail;
3832methodAuto=true;}else if(params.method=="auto3"){params.method=(screen.width<=1024)?zf_ProcessingMethod.StandardThumbnail:((screen.width<1600)?zf_ProcessingMethod.StandardLargeThumbnail:zf_ProcessingMethod.StandardVeryLargeThumbnail);
3833methodAuto=true;}for(var name in zf_ProcessingMethod){if(zf_ProcessingMethod[name].code==params.method){params.method=zf_ProcessingMethod[name];break;}};var method=params.method;
3834var newGrid=params.gridType!=undefined&&params.gridType!=zfl_NewGridPlugin.ClassicGrid;if(params.thumbs16x9){params.method=method=$.extend({},method,{clip:true,cy:Math.floor((method.cx*9)/16)});
3835}else if(newGrid){params.selectDynamicMethod=function(o){return zfl_NewGridPlugin.selectDynamicMethodForObject(o,this);};}grid.__zfl_params=params;grid.__zfl_selection=selection;
3836var decor=this._getDecorationInfo(style,newGrid?"new-grid":method);if(methodAuto){var dom=document.getElementById(grid.id);var classNames=dom.className.split(" ");
3837if(decor!=null&&decor.className!=null)classNames=classNames.concat(decor.className.split(" "));if(params.gridType==zfl_NewGridPlugin.ClassicGrid){var suffixedNames=[];
3838for(var c=0;c<classNames.length;c++){if(classNames[c]=="pg-empty")continue;suffixedNames.push(classNames[c]+"-method-"+method.code);}classNames=classNames.concat(suffixedNames);
3839}dom.className=classNames.join(" ");dom=null;}if(params.lynx)return;var engine=null;if(params.gridType==zfl_NewGridPlugin.DynamicVerticalGrid){engine=new zf_PhotoGrid.VerticalDynamicLayout(params.width,
3840params.extraWidth,params.extraHeight,zfl_NewGridPlugin.selectDynamicMethodForGridItem);}else if(params.gridType==zfl_NewGridPlugin.DynamicHorizontalGrid){engine=new zf_PhotoGrid.HorizontalDynamicLayout(params.height,
3841params.extraWidth,params.extraHeight,zfl_NewGridPlugin.selectDynamicMethodForGridItem);}grid.init(this._createPlugins(style,decor,params),engine);if(objects){var self=this;
3842if(objects instanceof Array){var owner=$.extend(new zf_User(),{id:p
3842arseInt(zf_ownerId,0),loginName:zf_ownerName,domainName:zf_ownerDomain});grid.setSize(objects.length);
3843grid.onqueryitem=function(index){var o=objects[index];o.owner=o.owner||owner;self.setGridItem(grid,index,o);};}else if(objects instanceof Function){;grid.setSize(size);
3844grid.onqueryitem=function(index){self.setGridItem(grid,index,objects(index));};}}};zfl_Layout.prototype.setGridItem=function(grid,index,object){;;;if(grid.__zfl_params.lynx)return;
3845var self=this;if(!object.loaded){object.advise(grid,function(){self.setGridItem(grid,index,object);});return;}var image=object.image;var unprotect=(object instanceof zf_Folder||object instanceof zf_PhotoSet)&&(object.access.mask&zf_AccessMask.UnprotectCover)!=0&&!!image&&image.access.type==zf_AccessType.Public;
3846if(!image)image=new zf_PlaceholderImage((object instanceof zf_Folder)?2:1);if(object.access.type==zf_AccessType.Private&&!unprotect){if(object instanceof zf_Folder||object instanceof zf_PhotoSet)image=new zf_PlaceholderImage(3);
3847}var id=this._demo?object.id:zf_toUint32(object.id);if(object.constructor.prefix)id=object.constructor.prefix+id;var styles=[];var method=('selectDynamicMethod' in grid.__zfl_params)?grid.__zfl_params.selectDynamicMethod(object):grid.__zfl_params.method;
3848if(object instanceof zf_Folder&&!grid.__zfl_params.fthumb){if(method==zf_ProcessingMethod.StandardLargeThumbnail)method=zf_ProcessingMethod.StandardThumbnail;else if(method==zf_ProcessingMethod.StandardVeryLargeThumbnail)method=zf_ProcessingMethod.StandardLargeThumbnail;
3849}var href=null;if(object.getHref)href=object.getHref();var burnable=false;var access=image.access;if(access){var nocheck=this.administrator||access.ownerId==zf_userId;
3850var locked=!nocheck&&access.type==zf_AccessType.Password&&!zfl_PasswordManager.check(image.access.ownerId,image.access.realmId);var noaccess=!nocheck&&(access.type==zf_AccessType.Private||access.isCensored);
3851var accessible=nocheck||access.type==zf_AccessType.Public||access.type==zf_AccessType.Password&&!locked;var generated=image.flags!=null&&(method.code==zf_ProcessingMethod.StandardThumbnail.code&&(image.flags&zf_PhotoFlags.HasImage0)!=0||method.code==zf_ProcessingMethod.StandardSmallThumbnail.code&&(image.flags&zf_PhotoFlags.HasImage1)!=0||method.code==zf_ProcessingMethod.StandardLargeThumbnail.code&&(image.flags&zf_PhotoFlags.HasImage10)!=0||method.code==zf_ProcessingMethod.StandardVeryLargeThumbnail.code&&(image.flags&zf_PhotoFlags.HasImage11)!=0);
3852burnable=generated&&accessible||locked||noaccess;if(locked){zfl_PasswordManager.subscribe(image.access.ownerId,image.access.realmId,function(){var gridType=grid.__zfl_params.gridType;
3853if(gridType!=zfl_NewGridPlugin.DynamicVerticalGrid&&gridType!=zfl_NewGridPlugin.DynamicHorizontalGrid&&object instanceof zf_Photo){var copy=zf_Photo.clone(object);
3854copy.image=copy;copy.done();self.setGridItem(grid,index,copy);}});if(!unprotect)image=new zf_PlaceholderImage(4);styles.push("pv-s-password");}if(noaccess){image=new zf_PlaceholderImage(5);
3855styles.push("pv-s-noaccess");}}var selection=grid.__zfl_selection;if(selection&&selection.selected(object.id))grid.selectItem(index);;var context={data:object,method:method,
3856index:index,image:image,burnable:burnable,grid:grid,selection:selection,quickShopParameters:this.quickShopParameters,getReturnData:this._getReturnData&&this.closure(this._getReturnData)};
3857grid.setItem(index,id,href,image,method,burnable,styles,context);};zfl_Layout.prototype.getCommentsOptions=function(overlayDownload){var decoration=this._getDecorationInfo(zfl_PhotoViewStyle.CommentBrowser),
3858plugins=this._createPlugins(zfl_PhotoViewStyle.CommentBrowser,decoration),overlayFlags={download:overlayDownload,contextMenu:false};return{decoration:decoration,
3859plugins:plugins,overlayFlags:overlayFlags};};zfl_Layout.prototype.getReturnData=function(){return this._returnData;};zfl_Layout.prototype.setReturnData=function(returnData){this._returnData=returnData;
3860};zfl_Layout.prototype._getDecorationInfo=function(style,method){if(this._decorations==null)return null;var info;if(method!=null&&typeof(method)!='string')method=method.code;
3861if(method!=null){info=this._decorations[style+"."+this._pageType+"."+method];if(info!=null)return info;}info=this._decorations[style+"."+this._pageType];if(info!=null)return info;
3862if(method!=null){info=this._decorations[style+"."+method];if(info!=null)return info;}info=this._decorations[style];if(info!=null)return info;info=this._decorations["default"];
3863if(info!=null)return info;return null;};zfl_Layout.prototype._createPlugins=function(style,decor,params){var plugins=[];params=params||{};var self=this;if(params.addToFav){params.scrapbookCallbacks={add:function(photo){if(self.scrapbook){var keys=[zf_PhotoKey.getString(photo)];
3864self.scrapbook.addPhotos(keys,false,null,self._getReturnPages?self._getReturnPages(keys):null);}},remove:function(photo){self.scrapbook&&self.scrapbook.removePhotos([zf_PhotoKey.getString(photo)]);
3865},canAdd:function(photo){return!!self.scrapbook&&photo.owner.id==zf_ownerId&&(!self.scrapbook.current||!self.scrapbook.current.map[zf_PhotoKey.getString(photo)]);
3866},canRemove:function(photo){return!!self.scrapbook&&!!self.scrapbook.current&&!!self.scrapbook.current.map[zf_PhotoKey.getString(photo)];}};}if(params.addToYP){params.yearbookCallbacks={add:function(photo){self.yearbook&&self.yearbook.addPhoto(photo);
3867},remove:function(photo){self.yearbook&&self.yearbook.removePhoto(photo);},canAdd:function(photo){return!!self.yearbook&&!photo.video&&(!zf_userId&&!self.yearbook.current||!!zf_userId&&zf_userId==zf_ownerId||!!self.yearbook.current&&(!self.yearbook.current.photo||self.yearbook.current.photo.id!=photo.id));
3868},canRemove:function(photo){return!!self.yearbook&&!!self.yearbook.current&&!!self.yearbook.current.photo&&self.yearbook.current.photo.id==photo.id;}};}if(params.gridType!=undefined&&params.gridType!=zfl_NewGridPlugin.ClassicGrid){plugins.push(new zfl_NewGridPlugin(style,
3869decor,params));}else{if(decor!=null)plugins.push(new zfl_DecorationPlugin(decor,style,params));if(style==zfl_PhotoViewStyle.FolderElement||style==zfl_PhotoViewStyle.GalleryPhoto){plugins.push(new zfl_LabelPlugin(params));
3870}if(style==zfl_PhotoViewStyle.PhotoVList){plugins.push(new zfl_VLabelPlugin(params));}if(style==zfl_PhotoViewStyle.GalleryPhoto){plugins.push(new zfl_AddToF
3870avoritesPlugin(params));
3871plugins.push(new zfl_AddToYearbookPlugin(params));}}if(style==zfl_PhotoViewStyle.GalleryPhoto||style==zfl_PhotoViewStyle.PhotoVList||style==zfl_PhotoViewStyle.PhotoNavList){if(!(params.gridType!=zfl_NewGridPlugin.ClassicGrid&&(params.textLayout==zfl_NewGridPlugin.Overlay||params.textLayout==zfl_NewGridPlugin.OverlayHover))){plugins.push(new zf_VideoInfoPlugin(function(c){return c.data;
3872},params.vicon,params.vduration));}}if(zf_userId==zf_ownerId&&style==zfl_PhotoViewStyle.GalleryPhoto)plugins.push(new zf_VideoWaitPlugin(function(c){return c.data;
3873}));if(params.isEvent&&zf_userId==zf_ownerId&&style==zfl_PhotoViewStyle.GalleryPhoto)plugins.push(new zfl_PhotoInfoPlugin(params));plugins.push(new zfl_InfoIconPlugin(params));
3874plugins.push(new zf_CensoredPlugin(function(c){return c.data;},function(c){return c.method;}));plugins.push(new zfl_WaitAnimationPlugin(true));if(params.onclick)plugins.push(new zf_ClickPlugin(params.onclick));
3875if(params.onhover)plugins.push(new zf_HoverPlugin(params.onhover));if(style==zfl_PhotoViewStyle.PhotoNavList||style==zfl_PhotoViewStyle.PhotoVList)plugins.push(new zf_NoClickPlugin());
3876if(style==zfl_PhotoViewStyle.CurrentPhoto||style==zfl_PhotoViewStyle.DimLights||style==zfl_PhotoViewStyle.Slideshow||style==zfl_PhotoViewStyle.CommentBrowser){plugins.push(new zf_VideoPlayerPlugin(function(c){return c.data;
3877}));}return plugins;};zfl_Layout.formatDecorationClasses=function(baseClass,decoration,method){var classes=[];if(baseClass)classes.push(baseClass,' ',baseClass,'-method-',
3878method.code);if(decoration&&decoration.className){var decorClasses=decoration.className.split(' ');for(var i=0;i<decorClasses.length;i++){if(classes.length>0)classes.push(' ');
3879classes.push(decorClasses[i],' ',decorClasses[i],'-method-',method.code);}}return classes.join("");};zfl_Layout.prototype._bin_ontoggle=function(bin,expanded){;this.recalc();
3880};zfl_Layout.prototype._bin_onfeeds=function(bin,origin){if(this._feeds!=null)this._feeds.show(origin);};zfl_Layout.prototype.setupGuestbook=function(global,local){var guestbook=local.guestbook;
3881if(!guestbook)return;guestbook.onresize=this.closure(this.recalc);guestbook.onlogin=zfl_Header.login;var onadd=function(){if(!bin.expanded)bin.toggle();var offset=zf_stdGetOffset(guestbook.dom());
3882$('html').stop(true,true).animate({scrollTop:offset.cy-50},300);guestbook.add();return false;};var bin=local.bins.guestbook;if(bin){var link=local.mailboxLink;if(link){link.onshow=function(){if(!bin.expanded)bin.toggle();
3883else link.scrollTo(guestbook);};link.onadd=onadd;}var countFormat=zf_stdHtmlEncode("{0} entries");guestbook.oncountchange=function(count){if(link)link.setCount(count);
3884var suffix=[];if(guestbook.canAdd()){suffix.push('<a class="guestbook-suffix-add" href="/">',zf_stdHtmlEncode("Add entry"),'</a>');}suffix.push(zf_stdFormatString(countFormat,
3885count));bin.setTitleSuffix(suffix.join(""));bin.$(".guestbook-suffix-add").click(onadd);};guestbook.oncountchange(guestbook.getCount());}};zfl_Layout.prototype.resolveEmail=function(id,
3886userId,token){var oncomplete=function(status,retVal){if(status!=200)return;var email=retVal.result;var dom=document.getElementById(id);dom.onmousedown=function(e){zfl_event(e,
3887null,function(){document.location.href="mailto:"+email;});};zf_stdSetText(dom,email);dom=null;};zf_stdServerRequest("GET","/zf/layout/layout.asmx","ResolveEmail",
3888[userId,token,zfl_SessionCookie.current.sessionKey],oncomplete);return false;};zfl_Layout.prototype._document_onkeydown=function(e){for(var i=0;i<this._keyHandlers.length;
3889i++){this._keyHandlers[i](e);if(e.isImmediatePropagationStopped())break;}};zfl_Layout.createHandlers=function(self,desc){return{oncommandtest:function(id){var result=false;
3890if(desc.common&&desc.common.test&&!desc.common.test.apply(self,arguments))result=false;else if(desc[id]&&typeof(desc[id].test)=="function")result=desc[id].test.apply(self,
3891arguments);else if(desc[id]&&typeof(desc[id].test)=="string")result=desc[desc[id].test].test.apply(self,arguments);;return result;},oncommand:function(){;var id=arguments[0];
3892;;
3892if(desc[id]&&typeof(desc[id].exec)=="function")return desc[id].exec.apply(self,arguments);if(desc[id]&&typeof(desc[id].exec)=="string")return desc[desc[id].exec].exec.apply(self,
3893arguments);}};};zfl_Layout.prototype.getCommands=function(){return{admin:{test:function(){return this.administrator;}},openFavorites:{test:function(){return!!this.scrapbook;
3894},exec:function(){this.scrapbook.show();}}};};zfl_Layout.prototype._scrollCheck=function(e){this._scrolled=true;};zfl_Layout.prototype._hideMenu=function(e){e=$.event.fix(e);if(!zfl_Layout.currentMenu)return;
3895var target=e.originalEvent.changedTouches?e.originalEvent.changedTouches[0].target:e.target;var root=zfl_Layout.currentMenu.root?zfl_Layout.currentMenu.root():zfl_Layout.currentMenu.dom();
3896;if($(target).parents().filter(function(){return this==root;}).length!=0)return;zfl_Layout.currentMenu.remove();};zfl_Layout.suppressClick=function(){setTimeout(function(){zf_stdDisableRightClick($('.noclick img'));
3897},500);};;;;;;;function zfl_MessageView(id,message){zfl_Control.prototype.constructor.call(this,id);if(message!=null){this._message=message;this._mailbox=message.mailbox;this._index=message.index;
3898if(message.posterUrl){var posterLink=this.dom("poster-link");if(posterLink)posterLink.href=message.posterUrl||"";}}else{var postedOn=this.dom().getAttribute("zf:posted",
38992);if(postedOn){postedOn=zf_stdParseDateTimeUTC(postedOn);zf_stdSetText(this.dom("posted"),zf_stdFormatDateTimeEx(postedOn));}}var self=this;var subscribe=function(name,
3900ask,askTitle,askText){var dom=self.dom(name);if(dom!=null){var handler="on"+name;dom.onclick=function(){var doAction=function(){if(self[handler])self[handler](self.getMessage());
3901};if(!!ask){askTitle=askTitle==null?'Confirm':askTitle;askText=askText?askText:'Do you really want to perform this action?';var args={title:askTitle,text:askText,
3902curtain:true,buttons:['No','Yes'],onbutton:function(btn){if(btn==1)doAction();}};zfl_MessageBox.show(args);}else doAction();};}};subscribe("approve");subscribe("edit");
3903subscribe("email");subscribe("delete",true,'Delete Message','Are you sure want to delete this message?');subscribe("undelete");subscribe("censor");subscribe("uncensor");
3904subscribe("purge",true);subscribe("public");subscribe("private");this._attachmentVisible=false;var link=this.dom("attachment-link");if(link){link.onclick=function(){if(self.onattachment)self.onattachment(self._message,
3905!self._attachmentVisible);};}}zfl_MessageView.inherits(zfl_Control);zfl_MessageView.prototype.getMessage=function(){if(this._message)return this._message;var message=new zf_Message();message.mailbox=this.getMailbox();
3906message.index=this.getIndex();message.posterName=this.$dom("poster-name").text();var posterId=this.dom().getAttribute("zf:poster",2);if(posterId){message.poster=new zf_User();
3907message.poster.id=parseInt(posterId);message.poster.displayName=message.posterName;;}var posterEmail=this.dom().getAttribute("zf:email");if(posterEmail&&posterEmail.length>0)message.posterEmail=posterEmail;
3908var posterLink=this.dom("poster-link");if(posterLink&&posterLink.tagName=="A"){message.posterUrl=posterLink.href;}else{message.posterUrl="";}var postedOn=this.dom().getAttribute("zf:posted",
39092);message.postedOn=zf_stdParseDateTimeUTC(postedOn);var bodyNode=this.dom("body");message.body="";if(bodyNode!=null){message.body=bodyNode.innerHTML;message.body=message.body.replace(/(^\s*)|(\s*$)/g,
3910"");}this._message=message;return message;};zfl_MessageView.prototype.getMailbox=function(){if(this._mailbox)return this._mailbox;var raw=this.dom().getAttribute("zf:mailbox",2);
3911;var parts=raw.split(':');;var mailbox=new zf_Mailbox();mailbox.ownerId=parseInt(parts[0]);;mailbox.type=parseInt(parts[1]);;mailbox.id=parseInt(parts[2]);;this._mailbox=mailbox;
3912return mailbox;};zfl_MessageView.prototype.getIndex=function(){if(this._index!=null)return this._index;var raw=this.dom().getAttribute("zf:index",2);;var index=parseInt(raw);;this._index=index;
3913return index;};zfl_MessageView.createHeaderHtml=function(id,message){var self=message.poster&&message.poster.id==zf_userId;var poster=['<span class="mv-poster-name ',self?"mv-color3":"mv-color2",
3914'">',zf_stdHtmlEncode(message.posterName),'</span>'];if(message.posterUrl)poster.push('<a id="',id,'-poster-link" class="mv-poster-link" target="_blank" title="Visit Web site">',
3915'</a>');if(message.poster==null)poster.push('<span class="mv-unregistered mv-color4">(non-registered)</span>');if(message.isPrivate)poster.push('<span class="mv-private mv-color4"><span class="mv-private-icon"></span>',
3916'private','</span>');
3916poster=poster.join("");return['<div class="mv-header mv-font2">','<div class="mv-date mv-color4">',zf_stdFormatDateTimeEx(message.postedOn),
3917'</div>','<div class="mv-title">','<span class="mv-poster">',poster,'</span>','</div>','</div>'].join("");};zfl_MessageView._createInfoHtml=function(id,message){if((message.flags&zf_MessageFlags.CanShowInfo)==0)return "";
3918var formatValue=function(v){return '<span class="mv-color3">'+v+'</span>';};var formatUser=function(u){return u?u.loginName:"anonymous";};var content=[];content.push('<div class="mv-info mv-font3 mv-color4">');
3919content.push('<div>',zf_stdFormatString("Posted by {0} on {1} from {2}",formatValue(formatUser(message.poster)),formatValue(zf_stdFormatDateTime(message.postedOn,
3920true)),formatValue(message.postedFrom)),'</div>');if(message.isEdited){content.push('<div>',zf_stdFormatString("Edited by {0} on {1} from {2}",formatValue(formatUser(message.editor)),
3921formatValue(zf_stdFormatDateTime(message.editedOn,true)),formatValue(message.editedFrom)),'</div>');}if(message.isCensored){content.push('<div>',zf_stdFormatString("Censored by {0} on {1} from {2}",
3922formatValue(formatUser(message.censorer)),formatValue(zf_stdFormatDateTime(message.censoredOn,true)),formatValue(message.censoredFrom)),'</div>');}if(message.isDeleted){content.push('<div>',
3923zf_stdFormatString("Deleted by {0} on {1} from {2}",formatValue(formatUser(message.deletor)),formatValue(zf_stdFormatDateTime(message.deletedOn,true)),formatValue(message.deletedFrom)),
3924'</div>');}content.push('</div>');return content.join("");};zfl_MessageView.createHtml=function(id,message){var censored="";if(message.isCensored&&!message.isDeleted)censored='<div class="mv-censored">Censored by Administrator</div>';
3925var content=[];if(message.needsApproval){var txt=(message.flags&zf_MessageFlags.CanApprove)!=0?'This post needs your approval to be publicly visible.':'Your message is awaiting moderation.';
3926content.push('<div class="mv-content mv-approval mv-font2 mv-color1">',txt,'</div>');}if(message.body)content.push('<div class="mv-content mv-body mv-font1 mv-color1">',
3927message.body,'</div>');if(message.isDeleted)content.push('<div class="mv-content mv-deleted mv-font3 mv-color4">','Deleted.','</div>');content=content.join("");var controls="";
3928if(message.flags&zf_MessageFlags.ControlMask){controls=['<div class="mv-controls mv-font3">'];var first=true;var addLink=function(flag,linkId,label){if((message.flags&flag)==0)return;
3929if(!first)controls.push('<span class="mv-control-separator">|</span>');controls.push('<a class="mv-control" href="javascript:;" id="',id,linkId,'">',label,'</a>');
3930first=false;};addLink(zf_MessageFlags.CanApprove,"-approve","Approve");addLink(zf_MessageFlags.CanEdit,"-edit","Edit");addLink(zf_MessageFlags.CanEmail,"-email",
3931"Reply via Email");addLink(zf_MessageFlags.CanDelete,"-delete","Delete");addLink(zf_MessageFlags.CanUndelete,"-undelete","Undelete");addLink(zf_MessageFlags.CanCensor,
3932"-censor","Censor");addLink(zf_MessageFlags.CanUncensor,"-uncensor","Uncensor");addLink(zf_MessageFlags.CanPurge,"-purge","Purge");addLink(zf_MessageFlags.CanMakePublic,
3933"-public","Make Public");addLink(zf_MessageFlags.CanMakePrivate,"-private","Make Private");controls.push('</div>');controls=controls.join("");}var attachment="";
3934if(message.attachmentType==zf_AttachmentType.CroppingSuggestion){attachment=['<div class="mv-attachment mv-attachment-crop mv-font3">','<div class="icon"></div>',
3935'<a id="',id,'-attachment-link" href="javascript:;">','View Suggested Cropping','</a>','</div>'].join("");}else if(message.attachmentType==zf_AttachmentType.HighlightedArea){attachment=['<div class="mv-attachment mv-attachment-area mv-font3">',
3936'<div class="icon"></div>','<a id="',id,'-attachment-link" href="javascript:;">','View Highlighted Area','</a>','</div>'].join("");}var footer="";if(controls.length>0||attachment.length>0){footer=['<div class="mv-footer">',
3937controls,attachment,'</div>'];footer=footer.join("");}return['<div class="mv',message.isDeleted?' mv-s-deleted':'',' mv-bgcolor1" id="',id,'">',zfl_MessageView.createHeaderHtml(id,
3938message),censored,zfl_MessageView._createInfoHtml(id,message),content,footer,'</div>'].join("");};zfl_MessageView.prototype.setAttachmentVisible=function(visible){if(this._attachmentVisible==visible)return;
3939this._attachmentVisible=visible;if(this._message.attachmentType==zf_AttachmentType.CroppingSuggestion){zf_stdSetText(this.dom("attachment-link"),visible?"Hide Suggested Cropping":"View Suggested Cropping");
3940}else if(this._message.attachmentType==zf_AttachmentType.HighlightedArea){zf_stdSetText(this.dom("attachment-link"),visible?"Hide Highlighted Area":"View Highlighted Area");
3941}};;;;function zfl_MessageList(id,totalCount,selectable){zfl_Control.prototype.constructor.call(this,id);var self=this;var handlers={_bake:function(name){this[name]=function(){if(self[name]!=null)self[name].apply(self,
3942arguments);};}};handlers._bake("onapprove");handlers._bake("onedit");handlers._bake("onemail");handlers._bake("ondelete");handlers._bake("onundelete");handlers._bake("oncensor");
3943handlers._bake("onuncensor");handlers._bake("onpurge");handlers._bake("onpublic");handlers._bake("onprivate");handlers._bake("onattachment");this.onemail=function(message){if(message.posterEmail&&message.posterEmail.length>0){window.location="mailto:"+message.posterEmail;
3944}};this._handlers=handlers;this._views=[];this._first=0x7FFFFFFF;this._last=-1;this._count=0;this._totalCount=totalCount;var last=null;var items=this.dom("items").getElementsByTagName("DIV");
3945for(var i=0;i<items.length;i++){for(var ve=items[i].firstChild;ve!=null;ve=ve.nextSibling){if(!zf_stdHasClassName(ve,"mv"))continue;
3945var view=new zfl_MessageView(ve.id);
3946var index=view.getIndex();this._addView(view);this._first=Math.min(index,this._first);this._last=Math.max(index,this._last);this._count=this._count+1;;last=view;
3947break;}}this._updateCount();this._height=-1;if(selectable)this._sb=new zf_ScrollBar(this.id+"-items",20);this._selectable=selectable;this._selectedItem=-1;zf_stdMakeMethodsDeferred(this,
3948this.id,["setEditing","setLoading","setAccess"]);}zfl_MessageList.inherits(zfl_Control);zfl_MessageList.prototype.reinit=function(totalCount,messages){var dom=this.dom("items");var item=dom.firstChild;
3949while(item!=null){var next=item.nextSibling;if(zf_stdHasClassName(item,"ml-item"))dom.removeChild(item);item=next;}this._views=[];this._first=0x7FFFFFFF;this._last=-1;
3950this._count=0;this._totalCount=totalCount;this._selectedItem=-1;if(messages&&messages.length>0){this._last=messages[0].index;this.add(messages);}this.setHeight();
3951this._updateCount();if(this._sb)this._sb.scrollTo(0);};zfl_MessageList.prototype.add=function(message){if(message instanceof Array){for(var i=0;i<message.length;i++)this._update(message[i]);
3952}else{this._update(message);}this._totalCount=Math.min(this._count+this._first,this._totalCount);this._updateCount();this.setHeight();if(this._pendingSelection!=null){this._pendingSelection();
3953this._pendingSelection=null;}this._updateLinks();};zfl_MessageList.prototype._update=function(message){;var index=message.index;var view=this._views[index];var id=this.id+"-"+index;
3954if(view!=null){;;this._remove(index);}else{if(index>this._last)++this._totalCount;this._first=Math.min(index,this._first);this._last=Math.max(index,this._last);this._count=this._count+1;
3955}var item=document.createElement("DIV");item.className=(index==this._last)?"ml-item":"ml-item ml-border2";if(index==this._selectedItem)item.className+=" ml-s-selected";
3956item.innerHTML=zfl_MessageView.createHtml(id,message);var previous=null;if(this._count>0){;;for(var i=this._first;i<=this._last;i++){if(i==index)break;if(this._views[i]!=null)previous=this._views[i];
3957}}if(previous!=null){previous=previous.dom().parentNode;zf_stdReplaceClassName(previous,null,"ml-border2");}else previous=this.dom("more");this.dom("items").insertBefore(item,
3958previous);view=new zfl_MessageView(id,message);this._addView(view);};zfl_MessageList.prototype._remove=function(index){;var view=this._views[index];var dom=this.dom(index).parentNode;
3959dom.parentNode.removeChild(dom);this._views[index]=null;};zfl_MessageList.prototype.getFirstView=function(){return this._first<this._views.length?this._views[this._first]:null;
3960};zfl_MessageList.prototype.getSelectedView=function(){return this._selectedItem!=-1?this._views[this._selectedItem]:null;};zfl_MessageList.prototype.getView=function(index){return this._views[index];
3961};zfl_MessageList.prototype.getCount=function(){return this._totalCount;};zfl_MessageList.prototype._updateCount=function(){;var count=this._totalCount-this._count;count=Math.min(count,20);zf_stdReplaceClassName(this.dom(),
3962count>0?null:"ml-s-has-more",count>0?"ml-s-has-more":null);if(count>0)this.$dom("morecount").text(count);zf_stdReplaceClassName(this.dom(),this._totalCount>0?"ml-s-empty":null,
3963this._totalCount>0?null:"ml-s-empty");this._moreCount=count;this._updateLinks();};zfl_MessageList.prototype._more_onclick=function(){;if(this._moreCount<=0)return;if(this.onrequest)this.onrequest(this._first-1,
3964this._moreCount);};zfl_MessageList.prototype._addView=function(view){var index=view.getIndex();;this._views[index]=view;for(var key in this._handlers){if(key=="_bake")continue;
3965view[key]=this._handlers[key];}view.dom().onclick=this.eventHandler(this._item_onclick,index);};zfl_MessageList.prototype.prepareContainer=function(index){if(index<0){zf_stdReplaceClassName(this.dom(),
3966null,"ml-s-adding");if(this._last>=0){var view=this._views[this._last];zf_stdReplaceClassName(view.dom().parentNode,null,"ml-border2");}return this.dom("editnew");
3967};var dom=this._views[index].dom();zf_stdReplaceClassName(dom,null,"none");return dom.parentNode;};
3967zfl_MessageList.prototype.restoreContainer=function(index){if(index<0){zf_stdReplaceClassName(this.dom(),
3968"ml-s-adding",null);if(this._last>=0){var view=this._views[this._last];zf_stdReplaceClassName(view.dom().parentNode,"ml-border2",null);}return;};var dom=this._views[index].dom();
3969zf_stdReplaceClassName(dom,"none",null);};zfl_MessageList.prototype.remove=function(index){;if(index==this._selectedItem){this._selectedItem=-1;if(this.ondeselect)this.ondeselect(index);
3970}this._remove(index);--this._totalCount;--this._count;if(index==this._last){while(this._views[this._last]==null&&this._last>=0)this._last--;}else if(index==this._first){while(this._views[this._first]==null&&this._first<this._views.length)this._first++;
3971}this._updateCount();this.setHeight();};zfl_MessageList.prototype.setEditing=function(editing){zf_stdReplaceClassName(this.dom(),editing?null:"mv-s-editing",editing?"mv-s-editing":null);
3972this.setHeight();};zfl_MessageList.prototype.setLoading=function(loading){zf_stdReplaceClassName(this.dom(),loading?null:"ml-s-loading",loading?"ml-s-loading":null);this.setHeight();
3973};zfl_MessageList.prototype.setAccess=function(mask,mailboxType){var check=(mailboxType!=zf_MailboxType.PhotoComments&&mailboxType!=zf_MailboxType.BlogPostComments)?{add:zf_AccessMask.NoPublicGuestbookPosts|zf_AccessMask.NoPrivateGuestbookPosts,
3974registeredOnly:zf_AccessMask.NoAnonymousGuestbookPosts}:{add:zf_AccessMask.NoPublicComments|zf_AccessMask.NoPrivateComments,registeredOnly:zf_AccessMask.NoAnonymousComments};
3975var allowAdd=(mask&check.add)!=check.add;var registeredOnly=(mask&check.registeredOnly)!=0;var dom=this.dom();zf_stdReplaceClassName(dom,"ml-s-not-allowed",null);
3976zf_stdReplaceClassName(dom,"ml-s-login-required",null);if(!allowAdd)zf_stdReplaceClassName(dom,null,"ml-s-not-allowed");else if(zf_userId==0&&registeredOnly)zf_stdReplaceClassName(dom,
3977null,"ml-s-login-required");this.setHeight();};zfl_MessageList.prototype._add_onclick=function(){if(this.onadd)this.onadd();};zfl_MessageList.prototype._login_onclick=function(){if(this.onlogin)this.onlogin();
3978};zfl_MessageList.prototype.setHeight=function(height){if(height==null)height=this._height;else this._height=height;if(height>0){height-=zf_stdGetHeightOverall(this.dom("header"));
3979height=Math.max(height,0);this.dom("outer").style.height=height+"px";this.dom("outer").style.overflow="hidden";this.dom("inner").style.height="100%";this.dom("inner").style.overflow="hidden";
3980}else{this.dom("outer").style.cssText="";this.dom("inner").style.cssText="";}if(this._sb)this._sb.update();};zfl_MessageList.prototype._item_onclick=function(event,index){;if(!this._selectable)return;
3981this.select(index);};zfl_MessageList.prototype.select=function(index){;if(!this._selectable)return;if(this._selectedItem==index)return;if(this._selectedItem!=-1)this.deselect(this._selectedItem);
3982var view=this._views[index];if(view!=null){zf_stdReplaceClassName(view.dom().parentNode,null,"ml-s-selected");this._selectedItem=index;var item=view.dom().parentNode;
3983var itemOffset=zf_stdGetOffset(item,this.dom("items")).cy;var itemHeight=zf_stdGetHeightOverall(item);var scrollHeight=this.dom("inner").offsetHeight;var totalHeight=this.dom("items").offsetHeight;
3984var scrollOffset=this._sb.getScrollPos();;if(itemOffset<scrollOffset){this._sb.scrollTo(itemOffset);}else if(itemOffset+itemHeight>scrollOffset+scrollHeight){if(itemHeight>scrollHeight)this._sb.scrollTo(itemOffset);
3985else if(index==this._first)this._sb.scrollTo(totalHeight-scrollHeight);else this._sb.scrollTo(itemOffset+itemHeight-scrollHeight);}if(this.onselect)this.onselect(index);
3986}
3986this._pendingSelection=null;};zfl_MessageList.prototype.deselect=function(index){;if(this._selectedItem==index){var view=this._views[this._selectedItem];if(view!=null){zf_stdReplaceClassName(view.dom().parentNode,
3987"ml-s-selected",null);this._selectedItem=-1;;if(this.ondeselect)this.ondeselect(index);}}};zfl_MessageList.prototype.selectNext=function(){if(this._selectedItem==-1)return;for(var i=this._selectedItem+1;
3988i<=this._last;i++){var next=this._views[i];if(next){this.select(i);return;}}};zfl_MessageList.prototype.selectPrevious=function(){if(this._selectedItem==-1)return;for(var i=this._selectedItem-1;
3989i>=this._first;i--){var previous=this._views[i];if(previous){this.select(i);if(i<this._first+5&&this._moreCount>0)this._more_onclick();return;}}this._pendingSelection=null;
3990if(this._moreCount>0){var self=this;var first=this._first;this._pendingSelection=function(){for(var j=first-1;j>=0;j--){if(self._views[j]){self.select(j);return;
3991}}};this._more_onclick();}};zfl_MessageList.prototype._top_onclick=function(){if(document.location.hash=="#guestbook")document.location.hash="#";window.scrollTo(0,0);};zfl_MessageList.prototype._updateLinks=function(){var comments='Leave a Comment';
3992if(this._totalCount==1)comments='1 Comment';else if(this._totalCount>1)comments='{0} Comments';comments=zf_stdFormatString(comments,this._totalCount);$('.ml-add-comments-link').text(comments);
3993};;;function zf_MessageUpdater(){};;;function zfl_MessageEdit(id,comments){zfl_Control.prototype.constructor.call(this,id);this._comments=comments;this._private=false;var self=this;var onchange=function(){var radio=self.dom("form").elements["me-access"];
3994self._private=radio[1].checked;zf_stdReplaceClassName(self.dom("access-info"),!self._private?"me-private-info":"me-public-info",!self._private?"me-public-info":"me-private-info");
3995};var radio2=this.dom("form").elements["me-access"];radio2[0].onclick=radio2[1].onclick=onchange;var radio3=this.dom("form").elements["me-attachment"];if(radio3){radio3[0].onclick=radio3[1].onclick=radio3[2].onclick=this.closure(this._attachment_onchange);
3996}this.dom("body").onkeydown=function(){zf_stdReplaceClassName(self.dom("body-field"),"me-missing",null);self.showMessage();};this.dom("name").onkeydown=function(){zf_stdReplaceClassName(self.dom("name-field"),
3997"me-missing",null);self.showMessage();};this.dom("url").onkeydown=function(){self.showMessage();};this.dom("email").onkeydown=function(){zf_stdReplaceClassName(self.dom("email-field"),
3998"me-missing",null);self.showMessage();};zf_stdMakeMethodsDeferred(this,this.id,["setFocus","showMessage"]);}zfl_MessageEdit.inherits(zfl_Control);zfl_MessageEdit.prototype._getUpdater=function(){var updater=new zf_MessageUpdater();
3999if(this._original==null){updater.posterName=zf_userId==0?this.dom("name").value:null;updater.isPrivate=this._private;}updater.posterUrl=zf_stdTrim(this.dom("url").value);
4000updater.posterEmail=zf_stdTrim(this.dom("email").value);updater.body=this.dom("body").value;updater.gRecaptchaResponse=this._captchaToken;return updater;};zfl_MessageEdit.prototype._save_onclick=function(){if(!this._validate())return;
4001this.setSaving(true);zfl_Button.onmouseout(this.dom("save"));zfl_Button.onmouseout(this.dom("add"));var widgetId=$(this.dom("captcha-field")).attr('data-widget-id');
4002this._resetCaptcha();grecaptcha.enterprise.execute(widgetId);};zfl_MessageEdit.prototype._cancel_onclick=function(){zfl_Button.onmouseout(this.dom("cancel"));if(this.oncancel)this.oncancel();
4003};zfl_MessageEdit.prototype.setOriginal=function(message){this._original=message;zf_stdReplaceClassName(this.dom(),"me-s-saving",null);zf_stdReplaceClassName(this.dom(),"me-s-continue",
4004null);if(!message){zf_stdReplaceClassName(this.dom(),"me-s-editing",null);this.dom("body").value="";this._attachmentType=zf_AttachmentType.None;this._attachment=null;
4005}else{zf_stdReplaceClassName(this.dom(),null,"me-s-editing");this.dom("header").innerHTML=zfl_MessageView.createHeaderHtml(this.id+"-view",message);var body=message.body;
4006body=body.replace(/(\<a[^\>]+\>)|(\<\/a\>)/g,"");this.dom("body").value=zf_stdHtmlDecode(body);this.dom("url").value=message.posterUrl;if(message.posterEmail)this.dom("email").value=message.posterEmail;
4007zf_stdReplaceClassName(this.dom("access-info"),null,"none");this._attachmentType=message.attachmentType;this._attachment=message.attachment;}zf_stdReplaceClassName(this.dom("name-field"),
4008"me-missing",null);zf_stdReplaceClassName(this.dom("body-field"),"me-missing",null);var attachmentRadio=this.dom("form").elements["me-attachment"];if(attachmentRadio)attachmentRadio[this._attachmentType].checked=true;
4009if(this.onattachment)this.onattachment(this._attachmentType,this._attachment);this.setSaving(false);this.showMessage();};zfl_MessageEdit.prototype.getOriginal=function(){return this._original;
4010};zfl_MessageEdit.prototype._validate=function(){var missingName=false,missingText=false;var self=this;var check=function(name){var value=self.dom(name).value;if(zf_stdTrim(value).length==0){zf_stdReplaceClassName(self.dom(name+"-field"),
4011null,"me-missing");return true;}return false;};if(zf_userId==0&&this._original==null)missingName=check("name");missingText=check("body");if(missingText&&missingName)this.showMessage(this._comments?"Please enter your name and the comment":"Please enter your name and the guestbook entry",
4012true);else if(missingName)this.showMessage("Please enter your name",true);else if(missingText)this.showMessage(this._comments?"Please type the comment":"Please type the guestbook entry",
4013true);this.setFocus();if(missingText||missingName)return false;var email=zf_stdTrim(this.dom("email").value);if(email&&email.length>0&&!zf_stdIsValidEmail(email)){$(this.dom("email-field")).addClass("me-missing");
4014this.showMessage("This is not a valid email address.",true);return false;}return true;};zfl_MessageEdit.prototype.showMessage=function(message,error){if(error)this.setSaving(false);
4015if(this.onerror){this.onerror(message,error);return;}var html="";if(message)html=['<span class="',error?"me-error me-font3 me-color3":"me-info",'">',message,'</span>'].join("");
4016this.dom("message").innerHTML=html;};zfl_MessageEdit.prototype.setAccess=function(mask,mailboxType,video){;;var check=(mailboxType!=zf_MailboxType.PhotoComments&&mailboxType!=zf_MailboxType.BlogPostComments)?{nopublic:zf_AccessMask.NoPublicGuestbookPosts,
4017noprivate:zf_AccessMask.NoPrivateGuestbookPosts,noanonymous:zf_AccessMask.NoAnonymousGuestbookPosts}:{nopublic:zf_AccessMask.NoPublicComments,noprivate:zf_AccessMask.NoPrivateComments,
4018noanonymous:zf_AccessMask.NoAnonymousComments};var radio=this.dom("form").elements["me-access"];var domInfo=this.dom("access-info");zf_stdReplaceClassName(domInfo,
4019"me-private-info",null);zf_stdReplaceClassName(domInfo,"me-public-info",null);if(mask&(check.nopublic|check.noprivate)){zf_stdReplaceClassName(this.dom("access-info"),
4020"none",null);zf_stdReplaceClassName(this.dom("access-field"),null,"none");zf_stdReplaceClassName(domInfo,null,(mask&check.nopublic)?"me-private-info":"me-public-info");
4021radio[(mask&check.nopublic)?1:0].checked=true;this._private=(mask&check.noprivate)==0;}else{zf_stdReplaceClassName(this.dom("access-field"),"none",null);zf_stdReplaceClassName(this.dom("access-info"),
4022zf_userId==0?"none":null,zf_userId==0?null:"none");zf_stdReplaceClassName(domInfo,null,"me-public-info");radio[0].checked=true;this._private=false;}this.$('.me-attachment').toggle(!video);
4023};zfl_MessageEdit.prototype._login_onclick=function(){if(this.onlogin)this.onlogin();};zfl_MessageEdit.prototype._attachment_onchange=function(){var radio=this.dom("form").elements["me-attachment"];
4024if(radio[0].checked){this._attachmentType=zf_AttachmentType.None;this._attachment=null;}else if(radio[1].checked){this._attachmentType=zf_AttachmentType.CroppingSuggestion;
4025this._attachment=null;}else if(radio[2].checked){this._attachmentType=zf_AttachmentType.HighlightedArea;this._attachment=null;}if(this.onattachment)this.onattachment(this._attachmentType,
4026this._attachment);};zfl_MessageEdit.prototype.setFocus=function(){try{if(this.dom("name").tagName!="INPUT"||this.dom("name").value)this.dom("body").focus();else this.dom("name").focus();
4027}catch(e){}};zfl_MessageEdit.prototype.setSaving=function(saving){zf_stdReplaceClassName(this.dom(),saving?null:"me-s-saving",saving?"me-s-saving":null);};zfl_MessageEdit.prototype.setContinue=function(error,
4028message,oncontinue){if(error==null){zf_stdReplaceClassName(this.dom(),"me-s-continue",null);return;}zf_stdReplaceClassName(this.dom("continue-message"),error?null:"me-color3",
4029error?"me-color3":null);zf_stdSetText(this.dom("continue-message"),message);zf_stdReplaceClassName(this.dom(),"me-s-saving","me-s-continue");this.dom("continue").onclick=oncontinue;
4030};zfl_MessageEdit.prototype._resetCaptcha=function(){if(typeof grecaptcha!=='undefined'){var widgetId=$(this.dom("captcha-field")).attr('data-widget-id');var response=grecaptcha.enterprise.getResponse(widgetId);
4031if(response.length!==0){grecaptcha.enterprise.reset(widgetId);}}};zfl_MessageEdit.prototype._captchaCallback=function(token){this._captchaToken=token;if(this.onsave){this.onsave(this._getUpdater());
4032}};;;function zfl_Guestbook(id,mailbox,list,edit,mask,home,mailboxToken){zfl_Control.prototype.constructor.call(this,id);var self=this;this._list=list;this._edit=edit;this._mailbox=mailbox;
4033this._mailboxToken=mailboxToken;this._editable=true;this._mask=mask;if(edit){edit.onsave=this.closure(this._edit_onsave);edit.oncancel=this.closure(this._edit_oncancel);
4034edit.onlogin=function(){if(self.onlogin)self.onlogin();};}list.onrequest=this.closure(this._list_onrequest);list.onedit=this.closure(this._list_onedit);list.onadd=this.closure(this.add,
4035true);list.onlogin=function(){if(self.onlogin)self.onlogin();};list.ondelete=this.closure(this._list_onaction,"deleteMessage");list.onundelete=this.closure(this._list_onaction,
4036"undeleteMessage");list.oncensor=this.closure(this._list_onaction,"censorMessage");list.onuncensor=this.closure(this._list_onaction,"uncensorMessage");
4036list.onpurge=this.closure(this._list_onaction,
4037"purgeMessage");list.onapprove=this.closure(this._list_onaction,"approveMessage");list.onpublic=this.closure(this._list_onaction,"makePublic");list.onprivate=this.closure(this._list_onaction,
4038"makePrivate");$('a.guestbook-add-link').click(function(){var offset=zf_stdGetOffset(self.dom());$('html,body').animate({scrollTop:offset.cy-50},300);self.add();
4039return false;});$('a.guestbook-add-link-so').click(function(){var offset=zf_stdGetOffset(self.dom());$('html,body').animate({scrollTop:offset.cy-50},300);return false;
4040});if(location.hash=='#addcomment'){setTimeout(function(){var offset=zf_stdGetOffset(self.dom());$('html,body').animate({scrollTop:offset.cy-50},300);self.add();
4041},500);}}zfl_Guestbook.inherits(zfl_Control);zfl_Guestbook.prototype.add=function(withScroll){if(!this._editable)return;var type=this._mailbox.type;var check=(type!=zf_MailboxType.PhotoComments&&type!=zf_MailboxType.BlogPostComments)?{nopublic:zf_AccessMask.NoPublicGuestbookPosts,
4042noprivate:zf_AccessMask.NoPrivateGuestbookPosts,noanonymous:zf_AccessMask.NoAnonymousGuestbookPosts}:{nopublic:zf_AccessMask.NoPublicComments,noprivate:zf_AccessMask.NoPrivateComments,
4043noanonymous:zf_AccessMask.NoAnonymousComments};if((this._mask&(check.nopublic|check.noprivate))==(check.nopublic|check.noprivate)||(this._mask&check.noanonymous)!=0&&zf_userId==0)return;
4044this._edit.setOriginal(null);this._edit.setAccess(this._mask,this._mailbox.type);this._enableEditing(false);var container=this._list.prepareContainer(-1);var edit=this._edit.dom();
4045container.appendChild(edit.parentNode.removeChild(edit));this._edit.setFocus();this.notifyResize();if(withScroll){var offset=zf_stdGetOffset(edit);var scroll=zf_stdGetClientScroll();
4046var editHeight=$(edit).outerHeight(true)+40;var clientHeight=zf_stdGetClientHeight();if(scroll.cy+clientHeight<offset.cy+editHeight){scroll=offset.cy+Math.min(clientHeight-10,
4047editHeight)-clientHeight;$('html,body').animate({scrollTop:scroll},300);}}this._auth=new zf_MailboxAuthorization(this._mailbox);};zfl_Guestbook.prototype.canAdd=function(){var canAdd=!(this._mask&zf_AccessMask.NoPublicGuestbookPosts)||!(this._mask&zf_AccessMask.NoPrivateGuestbookPosts);
4048if(canAdd&&zf_userId==0&&!!(this._mask&zf_AccessMask.NoAnonymousGuestbookPosts))canAdd=false;return canAdd;};zfl_Guestbook.prototype._edit_onsave=function(updater){var self=this;
4049var original=this._edit.getOriginal();var onpost=function(message,error){if(!error){if(message!=null){self._enableEditing(true);self._list.add(message);zf_TagManager.adminCustomizePushGTM('added guest book');
4050}else if(original!=null){self._enableEditing(true);self._list.remove(original.index);}else{if(zf_userId==0){var msg=updater.isPrivate?(self._mailbox.type==zf_MailboxType.BlogPostComments?"Your comment has been sent directly to the owner of the blog. It will not appear in the list.":"Your entry has been sent directly to the owner of the guestbook. It will not appear in the list."):(self._mailbox.type==zf_MailboxType.BlogPostComments?"Your entry will appear in this list once it is approved by the owner.":"Your entry will appear in this list once it is approved by the guestbook owner.");
4051self._edit.setContinue(false,msg,function(){self._enableEditing(true);self._updateCount();self.notifyResize();});self.notifyResize();return;}}self._enableEditing(true);
4052self._updateCount();self.notifyResize();return;}self._edit.setContinue(true,error.message,function(){self._edit.setContinue();});};if(original==null)zf_Message.postMessage(this._auth,
4053this._mailbox,updater,onpost);else zf_Message.updateMessage(this._auth,this._mailbox,original.index,updater,onpost);};zfl_Guestbook.prototype._edit_oncancel=function(){this._enableEditing(true);
4054this.notifyResize();};zfl_Guestbook.prototype._enableEditing=function(enable){this._editable=enable;this._list.setEditing(!enable);if(enable){var editbox=this.dom("edit");var edit=this._edit.dom();
4055if(edit.parentNode!=editbox)editbox.appendChild(edit.parentNode.removeChild(edit));var original=this._edit.getOriginal();this._list.restoreContainer(original?original.index:-1);
4056}};zfl_Guestbook.prototype._list_onrequest=function(first,count){var self=this;var onload=function(messages,error){if(!error){self._list.add(messages);self.notifyResize();return;
4057}};zf_Message.loadMessageRange(this._mailbox,this._mailboxToken,first,count,onload);};zfl_Guestbook.prototype._list_onedit=function(message){this._edit.setOriginal(message);this._enableEditing(false);
4058var container=this._list.prepareContainer(message.index);var edit=this._edit.dom();container.appendChild(edit.parentNode.removeChild(edit));this._edit.setFocus();
4059this._auth=new zf_MailboxAuthorization(this._mailbox);this.notifyResize();};zfl_Guestbook.prototype._list_onaction=function(message,action){var self=this;var oncomplete=function(updated,
4060error){if(!error){if(updated)self._list.add(updated);else self._list.remove(message.index);}self._updateCount();self._enableEditing(true);self.notifyResize();};this._enableEditing(false);
4061this.notifyResize();zf_Message[action](message.mailbox,message.index,oncomplete);};zfl_Guestbook.prototype._updateCount=function(){var count=this._list.getCount();zf_stdReplaceClassName(this.dom("empty"),
4062count==0?"none":null,count==0?null:"none");if(this.oncountchange)this.oncountchange(count);};zfl_Guestbook.prototype._login_onclick=function(){if(this.onlogin)this.onlogin();
4063};zfl_Guestbook.prototype.getCount=function(){return this._list.getCount();};;;function zfl_RootLink(id){zfl_Control.prototype.constructor.call(this,id);}zfl_RootLink.inherits(zfl_Control);zfl_RootLink.prototype.more=function(more){this.$().toggleClass("rootlink-more",
4064more).toggleClass("rootlink-open",!more);};;function zfl_UserLayout(id,global,local){if(zf_stdNoArgs(arguments))return;zfl_Layout.prototype.constructor.call(this,id,global,
4065local);this._data=zfl_stdTransformResponse(local.data,"data");this.setupGuestbook(global,local);this._rootLink=local.rootLink;}zfl_UserLayout.inherits(zfl_Layout);zfl_UserLayout.prototype.onrecalc=function(){this.recalcBins();
4066zfl_Layout.prototype.onrecalc.call(this);};zfl_UserLayout.prototype.recalcBins=function(){if(this._bins.featured&&this._bins.featured.expanded)this._grids.featured.recalcLayout();
4067if(this._bins.recent&&this._bins.recent.expanded)this._grids.recent.re
4067calcLayout();if(this._bins.root&&this._bins.root.expanded){var info=this._grids.root.recalcLayout();
4068if(this._rootLink)this._rootLink.more(info.itemsPerPage<this._data.root.length);}};zfl_UserLayout.prototype.onload=function(){if(this._grids.recent){this.initGrid(this._grids.recent,
4069zfl_PhotoViewStyle.FolderElement,this._grids.recentParams,this._data.recent);this._grids.recent.minRows=1;this._grids.recent.setHeight(0);}this.initGrid(this._grids.featured,
4070zfl_PhotoViewStyle.FolderElement,this._grids.featuredParams,this._data.featured);if(this._grids.root){this.initGrid(this._grids.root,zfl_PhotoViewStyle.FolderElement,
4071this._grids.rootParams,this._data.root);if(this._rootLink)this._grids.root.maxRows=2;}var self=this;$(window).bind('scroll',function(){self.recalcBins();});zfl_Layout.prototype.onload.call(this);
4072};;;;function zfl_FolderLayout(id,global,local){if(zf_stdNoArgs(arguments))return;zfl_Layout.prototype.constructor.call(this,id,global,local);this._data={folder:zfl_stdTransformResponse(local.data.folder,
4073"folder")};var self=this;var userId=0;if(Array.isArray(this._data.folder)){var ids=[];var dicFolder={};for(var i=0;i<this._data.folder.length;i++){if(this._data.folder[i]instanceof zf_PhotoSet){userId=this._data.folder[i].access.ownerId;
4074ids.push(this._data.folder[i].id);dicFolder[this._data.folder[i].id]=this._data.folder[i];}}var chunkSize=1000;while(ids.length>0){var subIds=ids.splice(0,chunkSize);
4075zf_stdServerRequest("GET","/zf/layout/layout.asmx","CheckArchivedPhotoSetByIds",[userId,subIds],function(status,retVal){if(status==200||retVal.error==null){if(retVal.result!=""){var arrayKey=Object.keys(retVal.result);
4076for(var i=0;i<arrayKey.length;i++){var photoSetId=arrayKey[i];var isArchived=retVal.result[arrayKey[i]];dicFolder[photoSetId].isArchive=isArchived;}}}var allIds=Object.keys(dicFolder);
4077for(var j=0;j<allIds.length;j++){if(typeof dicFolder[allIds[j]].isArchive=="undefined"){dicFolder[allIds[j]].isArchive=false;}}});}}this.setupGuestbook(global,local);
4078}zfl_FolderLayout.inherits(zfl_Layout);zfl_FolderLayout.prototype.onload=function(){this.initGrid(this._grids.folder,zfl_PhotoViewStyle.FolderElement,this._grids.folderParams,this._data.folder);
4079var grid=this._grids.folder;if(grid!=null)$(window).bind('scroll',function(){grid.recalcLayout();});zfl_Layout.prototype.onload.call(this);};zfl_FolderLayout.prototype.onrecalc=function(){if(this._grids.folder!=null)this._grids.folder.recalcLayout();
4080zfl_Layout.prototype.onrecalc.call(this);};;;;zf.$namespace('zf.core.share',{ShareUtils:zf.$class(zf_Object,{})});$.extend(zf.core.share.ShareUtils,{SECTION_MODE:{PHOTO:1,
4081GROUP_ITEM:2,SLIDESHOW:3,MOBILE_APP:4},chooseTextForGroupItem:function(groupItem,txtGroup,txtGallery,txtCollection,txtEvent){if(groupItem instanceof zf_Folder){if(groupItem.isEvent)return txtEvent;
4082else return txtGroup;}else{;;if(groupItem.type==zf_PhotoSet.Gallery)return txtGallery;else return txtCollection;}}});;function zf_ShareFrame(id,init){zf_Control.prototype.constructor.call(this,
4083id);this._tabs=init.tabs;this._links=init.links;this._share=init.share;this._directLinks=init.directLinks;this._embedImage=init.embedImage;this._embedVideo=init.embedVideo;
4084this._parent=null;this._params={isSlideshowVisible:init.isSlideshowVisible,isBrandingRemoved:init.isBrandingRemoved,refCode:init.refCode,refAmount:init.refAmount,
4085displayName:init.displayName,groupItem:null,photo:null};this._tabs.setShareFrame(this);$(document).ready(this.closure(this._init));}zf_ShareFrame.inherits(zf_Control);zf_ShareFrame.SECTION_NORMAL_CLASSES="share-bgcolor5 share-color5";
4086zf_ShareFrame.SECTION_EXPANDED_CLASSES="share-bgcolor6 share-color6";zf_ShareFrame.prototype.setParentObject=function(parent){;this._parent=parent;this._share.setParentObject(parent);};zf_ShareFrame.prototype.show=function(groupItem,
4087photo){;this.$(".sf-section").removeClass("sf-section-e").find(".sf-body").hide();this._params.groupItem=groupItem;this._params.photo=photo;this._tabs.setData(this._params);
4088this._links.setData(this._params);this._share.setData(this._params);if(this._directLinks!=null)this._directLinks.setData(this._params);if(this._embedImage!=null)this._embedImage.setData(this._params);
4089if(this._embedVideo!=null)this._embedVideo.setData(this._params);this.setMode(photo!=null?zf.core.share.ShareUtils.SECTION_MODE.PHOTO:zf.core.share.ShareUtils.SECTION_MODE.GROUP_ITEM);
4090this._update();this._expandSection(this.$(".sf-section").first());};zf_ShareFrame.prototype.setMode=function(mode){;var linksH4Text="";var copyrightText="";var directLinksTitle="";
4091switch(mode){case zf.core.share.ShareUtils.SECTION_MODE.PHOTO:linksH4Text=this._params.photo.video?"Link to Video":"Link to Photo";copyrightText=(this._params.photo.copyright)?this._params.photo.copyright:this._params.photo.owner.copyright;
4092directLinksTitle=this._params.photo.video?"Direct links to videos":"Direct links to images";break;case zf.core.share.ShareUtils.SECTION_MODE.GROUP_ITEM:linksH4Text=zf.core.share.ShareUtils.cho
4092oseTextForGroupItem(this._params.groupItem,
4093"Link to Group","Link to Gallery","Link to Collection","Link to Event");copyrightText=this._params.groupItem.owner.copyright;break;case zf.core.share.ShareUtils.SECTION_MODE.SLIDESHOW:linksH4Text="Link to Slide Show";
4094copyrightText=this._params.groupItem.owner.copyright;break;default:;break;}this.$dom("share").toggleClass("sf-section",mode==zf.core.share.ShareUtils.SECTION_MODE.PHOTO).toggleClass("sf-section-perm",
4095mode!=zf.core.share.ShareUtils.SECTION_MODE.PHOTO);this.$dom("links").find(".sf-head H4").text(linksH4Text);var showDirectLinksSection=mode==zf.core.share.ShareUtils.SECTION_MODE.PHOTO;
4096this.$dom("direct-links").toggle(showDirectLinksSection);this.$dom("direct-links").find(".sf-head H4").text(directLinksTitle);var showEmbedSection=mode==zf.core.share.ShareUtils.SECTION_MODE.PHOTO&&(!this._params.photo.video&&this._embedImage!=null||this._params.photo.video&&this._embedVideo!=null);
4097this.$dom("embed").toggle(showEmbedSection);if(this.$dom("embed").hasClass("sf-section-e")&&mode!=zf.core.share.ShareUtils.SECTION_MODE.PHOTO){this._expandSection(this.$(".sf-section").first());
4098}this._tabs.setMode(mode);this._links.setMode(mode);this._share.setMode(mode);if(this._directLinks!=null)this._directLinks.setMode(mode);if(this._embedImage!=null)this._embedImage.setMode(mode);
4099if(this._embedVideo!=null)this._embedVideo.setMode(mode);this._update();if(this._parent!=null)this._parent.updateCopyright(copyrightText);};zf_ShareFrame.prototype._init=function(){var self=this;
4100this.$(".sf-head").click(function(){if($(this).closest(".sf-section-perm").length>0)return;self._expandSection($(this).closest(".sf-section"));});};zf_ShareFrame.prototype._expandSection=function(newSection){;
4101if(newSection.hasClass("sf-section-e")){this._update();return;}var oldSection=this.$(".sf-section-e");;this.$(".sf-section").removeClass("sf-section-e").find(".sf-head").removeClass(zf_ShareFrame.SECTION_EXPANDED_CLASSES).addClass(zf_ShareFrame.SECTION_NORMAL_CLASSES);
4102newSection.addClass("sf-section-e").find(".sf-head").removeClass(zf_ShareFrame.SECTION_NORMAL_CLASSES).addClass(zf_ShareFrame.SECTION_EXPANDED_CLASSES);this._update();
4103var self=this;newSection.find(".sf-body").stop(false,true).animate({"height":"show","marginTop":"show","marginBottom":"show","paddingTop":"show","paddingBottom":"show"},
4104{duration:"fast",step:function(){self._update();},complete:function(){$(this).show();}});oldSection.find(".sf-body").stop(false,true).animate({"height":"hide","marginTop":"hide",
4105"marginBottom":"hide","paddingTop":"hide","paddingBottom":"hide"},{duration:"fast",complete:function(){$(this).hide();}});};zf_ShareFrame.prototype._update=function(){if(this.$().is(":hidden"))return;
4106this._tabs.update();this._links.update();this._share.update();if(this._directLinks!=null)this._directLinks.update();if(this._embedImage!=null)this._embedImage.update();
4107if(this._embedVideo!=null)this._embedVideo.update();};;;function zfs_Tabs(id){zf_Control.prototype.constructor.call(this,id);this._$photo=this.$dom("photo");this._$groupItem=this.$dom("group-item");
4108this._$slideshow=this.$dom("slideshow");this._$tabs=this._$photo.add(this._$groupItem.add(this._$slideshow));this._photo=null;$(document).ready(this.closure(this._init));
4109}zfs_Tabs.inherits(zf_Control);zfs_Tabs.TAB_NORMAL_CLASSES="share-bgcolor1 share-color1 share-font1";zfs_Tabs.TAB_HOVER_CLASSES="share-bgcolor2 share-color2 share-font2";zfs_Tabs.TAB_ACTIVE_CLASSES="share-bgcolor4 share-color4 share-font4 share-border4";
4110zfs_Tabs.prototype.setShareFrame=function(share){this._share=share;};zfs_Tabs.prototype._init=function(){var SM=zf.core.share.ShareUtils.SECTION_MODE;this._$photo.bind("click",this.closure(this._onTabClick,
4111SM.PHOTO));this._$groupItem.bind("click",this.closure(this._onTabClick,SM.GROUP_ITEM));this._$slideshow.bind("click",this.closure(this._onTabClick,SM.SLIDESHOW));
4112this._$tabs.hover(this.closure(this._onTabMouseOver),this.closure(this._onTabMouseOut));};zfs_Tabs.prototype.setData=function(params){;this._$photo.toggle(params.photo!=null);
4113var isSlideshowVisible=!(params.groupItem instanceof zf_Folder)&&this._$slideshow.length>0;this._$slideshow.toggle(isSlideshowVisible);this._$groupItem.toggleClass("sf-tab-last",
4114!isSlideshowVisible);this._$slideshow.toggleClass("sf-tab-last",isSlideshowVisible);this._photo=params.photo;if(this._photo!=null&&this._photo.video)this._$photo.text("Share Video");
4115else this._$photo.text("Share Photo");
4115var giTabName=zf.core.share.ShareUtils.chooseTextForGroupItem(params.groupItem,"Share Group","Share Gallery","Share Collection",
4116"Share Event");this._$groupItem.text(giTabName);};zfs_Tabs.prototype.setMode=function(mode){;this._resetTabs();var $tab=null;switch(mode){case zf.core.share.ShareUtils.SECTION_MODE.PHOTO:$tab=this._$photo;
4117break;case zf.core.share.ShareUtils.SECTION_MODE.GROUP_ITEM:$tab=this._$groupItem;break;case zf.core.share.ShareUtils.SECTION_MODE.SLIDESHOW:$tab=this._$slideshow;
4118break;default:;break;};this._activateTab($tab);};zfs_Tabs.prototype.update=function(){if(this.$().is(":hidden"))return;};zfs_Tabs.prototype._onTabClick=function(e,mode){e.stopPropagation();
4119e.preventDefault();var $el=$(e.target);$el.blur();if($el.hasClass("disabled")||$el.hasClass("active"))return;this._share.setMode(mode);};zfs_Tabs.prototype._onTabMouseOver=function(e){var $el=$(e.target);
4120if($el.hasClass("disabled")||$el.hasClass("active"))return;$el.addClass(zfs_Tabs.TAB_HOVER_CLASSES);};zfs_Tabs.prototype._onTabMouseOut=function(e){var $el=$(e.target);$el.removeClass(zfs_Tabs.TAB_HOVER_CLASSES);
4121};zfs_Tabs.prototype._resetTabs=function(){this._$tabs.removeClass("disabled active").removeClass(zfs_Tabs.TAB_ACTIVE_CLASSES).addClass(zfs_Tabs.TAB_NORMAL_CLASSES);};zfs_Tabs.prototype._activateTab=function($tab){$tab.removeClass(zfs_Tabs.TAB_HOVER_CLASSES).removeClass(zfs_Tabs.TAB_NORMAL_CLASSES).addClass("active").addClass(zfs_Tabs.TAB_ACTIVE_CLASSES);
4122};;;function zfs_ShareSection(id,blogPostEdit){zf_Control.prototype.constructor.call(this,id);this._params=null;this._parent=null;this._blogPostEdit=blogPostEdit;$(document).ready(this.closure(this._init));
4123}zfs_ShareSection.inherits(zf_Control);zfs_ShareSection.prototype.setParentObject=function(parent){;this._parent=parent;};zfs_ShareSection.prototype.setData=function(params){;this._params=params;};zfs_ShareSection.prototype.setMode=function(mode){;
4124if(mode==zf.core.share.ShareUtils.SECTION_MODE.MOBILE_APP)return;this.$(".sfs-pinterest").toggle(mode==zf.core.share.ShareUtils.SECTION_MODE.PHOTO);$(this.dom()).find(".sfs-blog").toggle(mode==zf.core.share.ShareUtils.SECTION_MODE.PHOTO);
4125var sociable=new zf_Sociable();var self=this;var bindLinks=function(shareable,params){sociable.bind(self.$(".sfs-facebook"),sociable.shareOnFacebook,shareable);sociable.bind(self.$(".sfs-twitter"),
4126sociable.shareOnTwitter,shareable);sociable.bind(self.$(".sfs-pinterest"),sociable.shareOnPinterest,shareable);sociable.bind(self.$(".sfs-email"),sociable.shareViaEmail,
4127params);$(self.dom()).find(".sfs-blog").unbind('click.sociable').bind('click.sociable',function(){self.shareOnBlog(shareable,params);});};switch(mode){case zf.core.share.ShareUtils.SECTION_MODE.PHOTO:bindLinks(sociable.sharePhoto(this._params.photo),
4128this._params);break;case zf.core.share.ShareUtils.SECTION_MODE.GROUP_ITEM:bindLinks(sociable.shareGroupItem(this._params.groupItem),this._params);break;case zf.core.share.ShareUtils.SECTION_MODE.SLIDESHOW:bindLinks(sociable.shareSlideshow(this._params.groupItem),
4129this._params);break;default:;break;}};zfs_ShareSection.prototype.update=function(){if(this.$().is(":hidden"))return;var className="sfsc-"+this.$(".sfs-container A:visible").length;
4130this.$(".sfs-container").attr("class","sfs-container "+className);};zfs_ShareSection.prototype._init=function(){this.$(".sfs-container A").hover(function(e){$(e.currentTarget).addClass("sfs-hover");
4131},function(e){$(e.currentTarget).removeClass("sfs-hover");});};zfs_ShareSection.prototype.shareOnBlog=function(shareable){;var self=this;if(this._parent.setButtons){zf_Dialog.disableAnimation();
4132this._parent.hide(function(){self._blogPostEdit.show(shareable.photoId,self._parent._x,self._parent._y);zf_Dialog.enableAnimation();});}};;;function zfs_LinksSection(id){zf_Control.prototype.constructor.call(this,
4133id);this._groupItem=null;this._photo=null;this._shorteningUrl=null;this._needShortUrlRefresh=false;$(document).ready(this.closure(this._init));}zfs_LinksSection.inherits(zf_Control);
4134zfs_LinksSection.SHORTENER_TRY_COUNT=2;zfs_LinksSection.prototype.setData=function(params){;this._groupItem=params.groupItem;this._photo=params.photo;this._needShortUrlRefresh=true;};zfs_LinksSection.prototype.setMode=function(mode){;
4135var itemName=null;var itemUrl=null;switch(mode){case zf.core.share.ShareUtils.SECTION_MODE.PHOTO:itemName=this._photo.video?"video":"photo";itemUrl=new zf_Sociable().sharePhoto(this._photo).url;
4136break;case zf.core.share.ShareUtils.SECTION_MODE.GROUP_ITEM:itemName=zf.core.share.ShareUtils.cho
4136oseTextForGroupItem(this._groupItem,"group","gallery","collection",
4137"event");itemUrl=new zf_Sociable().shareGroupItem(this._groupItem).url;break;case zf.core.share.ShareUtils.SECTION_MODE.SLIDESHOW:itemName="slide show";itemUrl=new zf_Sociable().shareSlideshow(this._groupItem).url;
4138break;case zf.core.share.ShareUtils.SECTION_MODE.MOBILE_APP:itemName=zf.core.share.ShareUtils.chooseTextForGroupItem(this._groupItem,"group","gallery","collection",
4139"event");;;;itemUrl=new zf_Sociable().shareAppUrl(this._groupItem);break;default:;break;}this.$dom("url-item").find("LABEL").html(zf_stdFormatString("Copy and paste the link to this <span>{0}</span>:",
4140itemName));this.$dom("url").val(itemUrl);this.$dom("short-url").addClass("sfl-short-url-link").val("Get short link");var self=this;this.$dom("short-url").bind("click.shortener",
4141function(e){e.stopPropagation();e.preventDefault();self.$dom("short-url").removeClass("sfl-short-url-link").unbind("click.shortener").blur();self._shorten();});this._needShortUrlRefresh=true;
4142};zfs_LinksSection.prototype.update=function(){if(this.$().is(":hidden"))return;};zfs_LinksSection.prototype._shorten=function(){this.$dom("short-url").val("Loading...").closest(".sfl-box").removeClass("sfl-error").addClass("sfl-loading");
4143var url=this.$dom("url").val();if(this._shorteningUrl==null||this._shorteningUrl!=url){this._shorteningUrl=url;zf_stdServerRequestEx("GET","/zf/core/shortener.asmx",
4144"ShortenUrl",[url],this.closure(this._onShortenerResponse,url,zfs_LinksSection.SHORTENER_TRY_COUNT));}};zfs_LinksSection.prototype._init=function(){this.$(".sfl-url INPUT").add(this.$(".sfl-short-url INPUT")).focus(function(eo){$(eo.currentTarget).bind("mouseup keyup",
4145function(e){e.preventDefault();$(e.currentTarget).select().unbind(e.type);});});};zfs_LinksSection.prototype._onShortenerResponse=function(result,error,urlOnStart,repeatCount){var url=this.$dom("url").val();
4146if(url!=urlOnStart)return;;if(error!=null){if(repeatCount>1){;var self=this;setTimeout(function(){zf_stdServerRequestEx("GET","/zf/core/shortener.asmx","ShortenUrl",
4147[url],self.closure(self._onShortenerResponse,url,repeatCount-1));},Math.ceil(Math.random()*5000)+1000);}else{this.$dom("short-url").val("Not available at this time").closest(".sfl-box").removeClass("sfl-loading").addClass("sfl-error");
4148this._shorteningUrl=null;this._needShortUrlRefresh=false;}return;}this.$dom("short-url").val(result).closest(".sfl-box").removeClass("sfl-loading").removeClass("sfl-error");
4149this._shorteningUrl=null;this._needShortUrlRefresh=false;};;;function zfs_DirectLinksSection(id){zf_Control.prototype.constructor.call(this,id);this._groupItem=null;this._photo=null;
4150$(document).ready(this.closure(this._init));}zfs_DirectLinksSection.inherits(zf_Control);zfs_DirectLinksSection.SHORTENER_TRY_COUNT=2;zfs_DirectLinksSection.prototype.setData=function(params){;this._groupItem=params.groupItem;this._photo=params.photo;
4151if(this._photo!=null)this._updateDirectLinks();};zfs_DirectLinksSection.prototype.setMode=function(mode){if(mode==zf.core.share.ShareUtils.SECTION_MODE.GROUP_ITEM||mode==zf.core.share.ShareUtils.SECTION_MODE.SLIDESHOW||mode==zf.core.share.ShareUtils.SECTION_MODE.MOBILE_APP)return;
4152;this.$dom("direct").toggle(mode==zf.core.share.ShareUtils.SECTION_MODE.PHOTO);};zfs_DirectLinksSection.prototype.update=function(){if(this.$().is(":hidden"))return;if(this.$dom("direct").is(":visible"))this._updateWarningPlacement();
4153};zfs_DirectLinksSection.prototype.onExpand=function(){};zfs_DirectLinksSection.prototype._init=function(){var self=this;this.$(".sfld-item LABEL").click(function(){self._toggleItem($(this).closest(".sfld-item"));
4154});this.$(".sfld-item INPUT").focus(function(eo){$(eo.currentTarget).bind("mouseup keyup",function(e){e.preventDefault();$(e.currentTarget).select().unbind(e.type);
4155});});};zfs_DirectLinksSection.prototype._toggleItem=function($item){;var self=this;if($item.hasClass("sfld-item-e")){this.$dom("direct").find(".sfld-item-box").stop(false,true).animate({"height":"hide",
4156"marginTop":"hide","marginBottom":"hide","paddingTop":"hide","paddingBottom":"hide"},{duration:"fast",step:function(){self._updateWarningPlacement();},complete:function(){$(this).parent().removeClass("sfld-item-e");
4157self._updateWarningPlacement();}});}else{this.$dom("direct").find(".sfld-item-box").stop(false,true).animate({"height":"hide","marginTop":"hide","marginBottom":"hide",
4158"paddingTop":"hide","paddingBottom":"hide"},{duration:"fast",step:function(){self._updateWarningPlacement();},complete:function(){$(this).parent().removeClass("sfld-item-e");
4159self._updateWarningPlacement();}});$item.find(".sfld-item-box").stop(false,true).animate({"height":"show","marginTop":"show","marginBottom":"show","paddingTop":"show",
4160"paddingBottom":"show"},{duration:"fast",step:function(){self._updateWarningPlacement();},complete:function(){$(this).parent().addClass("sfld-item-e");self._updateWarningPlacement();
4161}});}};zfs_DirectLinksSection.prototype._updateDirectLinks=function(){if(this.$dom("direct").length<1)return;this.$(".sfl-direct .sfld-item").removeClass("sfld-item-e").removeClass("sfld-top-gap").removeClass("sfld-bottom-gap").hide().find(".sfld-item-box").hide();
4162this.$(".sfl-direct .sfld-item LABEL");var photo=this._photo;var width=photo.width;var height=photo.height;var realm=photo.access.getRealm();var imageList=[{method:zf_ProcessingMethod.StandardThumbnail,
4163mask:0,label:"Small Thumbnail"}
4163,{method:zf_ProcessingMethod.StandardSmallThumbnail,mask:0,label:"Square Thumbnail"},{method:zf_ProcessingMethod.StandardLargeThumbnail,
4164mask:0,label:"Medium Thumbnail"},{method:zf_ProcessingMethod.StandardVeryLargeThumbnail,mask:0,label:"Large Thumbnail"},{method:zf_ProcessingMethod.StandardSmallSize,
4165mask:0,label:"Small"},{method:zf_ProcessingMethod.StandardMediumSize,mask:zf_AccessMask.ProtectMedium,label:"Medium"},{method:zf_ProcessingMethod.StandardLargeSize,
4166mask:zf_AccessMask.ProtectLarge,label:"Large"},{method:zf_ProcessingMethod.StandardExtraLargeSize,mask:zf_AccessMask.ProtectExtraLarge,label:"X-Large"},{method:zf_ProcessingMethod.StandardXXLargeSize,
4167mask:zf_AccessMask.ProtectXXLarge,label:"XX-Large"}];var videoList=[{method:zf_ProcessingMethod.StandardThumbnail,mask:0,label:"Small Thumbnail"},{method:zf_ProcessingMethod.StandardSmallThumbnail,
4168mask:0,label:"Square Thumbnail"},{method:zf_ProcessingMethod.StandardLargeThumbnail,mask:0,label:"Medium Thumbnail"},{method:zf_ProcessingMethod.StandardVeryLargeThumbnail,
4169mask:0,label:"Large Thumbnail"},{method:zf_ProcessingMethod.Video360p,mask:0,label:"Web (Non-HD)"},{method:zf_ProcessingMethod.Video480p,mask:zf_AccessMask.Protect480p,
4170label:"Medium Def (Non-HD)"},{method:zf_ProcessingMethod.Video720p,mask:zf_AccessMask.Protect720p,label:"Hi Def (720p)"},{method:zf_ProcessingMethod.Video1080p,mask:zf_AccessMask.Protect1080p,
4171label:"Full HD (1080p)"}];var list=photo.video?videoList:imageList;var labelHtmlFormat="{0} <span class=\"share-color9 share-font9\">({1} x {2})</span>";var topNode=null;
4172var bottomNode=null;var lastVisibleNode=null;var sizeReached=false;for(var i=0;i<list.length+1;i++){var id,$node,$item,title,url,protect,protocol;if(i<list.length){var method=list[i].method;
4173var mask=list[i].mask;var label=list[i].label;id=method.code;$node=this.$dom("direct-"+method.code);$item=$node.closest(".sfld-item");if(sizeReached)continue;sizeReached=method.cx>=width&&method.cy>=height&&method!=zf_ProcessingMethod.Video360p;
4174var size=photo.getScaledSize(method);var format=photo.video&&!method.isThumb?"{0}":labelHtmlFormat;title=zf_stdFormatString(format,label,size.cx,size.cy);url=[zf_stdGetProtocol(zf_userDomain),
4175zf_userDomain,photo.getExternalUrl(method)].join("");protect=realm.type!=zf_AccessType.Public||(realm.mask&mask)!=0;}else if(i==list.length){id="original";$node=this.$dom("direct-original");
4176$item=$node.closest(".sfld-item");if(photo.video)continue;title=zf_stdFormatString(labelHtmlFormat,"Original Photo",width,height);url=[zf_stdGetProtocol(zf_userDomain),
4177zf_userDomain,photo.getExternalUrl()].join("");protect=realm.type!=zf_AccessType.Public||(realm.mask&zf_AccessMask.ProtectOriginals)!=0||(realm.mask&zf_AccessMask.PasswordProtectOriginals)!=0;
4178}$item.show();$node.val(url);this.$dom("direct-title-"+id).html(title);var itemNode=$item.get(0);if(topNode==null&&protect)topNode=itemNode;else if(topNode!=null&&!protect)bottomNode=itemNode;
4179lastVisibleNode=itemNode;}if(topNode!=null){if(bottomNode==null)bottomNode=lastVisibleNode;$(topNode).addClass("sfld-top-gap");$(bottomNode).addClass("sfld-bottom-gap");
4180}this._updateWarningPlacement();};zfs_DirectLinksSection.prototype._updateWarningPlacement=function(){var $top=this.$(".sfld-top-gap");var $bottom=this.$(".sfld-bottom-gap");var $warning=this.$dom("warning");
4181$warning.toggle($top.length+$bottom.length==2);if($top.length==0&&$bottom.length==0)return;;var tn=$top.get(0);var bn=$bottom.get(0);var top=tn.offsetTop-10;var bottom=bn.offsetTop+bn.offsetHeight+5;
4182$warning.css("top",top).height(bottom-top);};;function zf_EmbedImageHelpers(){}zf_EmbedImageHelpers.CODE_TYPE={HTML:1,BBCode:2};zf_EmbedImageHelpers.CODE_TEMPLATES={};zf_EmbedImageHelpers.CODE_TEMPLATES[zf_EmbedImageHelpers.CODE_TYPE.HTML]="<a href=\"{0}\"{1}><img src=\"{2}\" width=\"{3}\" height=\"{4}\" alt=\"{5}\" /></a>";
4183zf_EmbedImageHelpers.CODE_TEMPLATES[zf_EmbedImageHelpers.CODE_TYPE.BBCode]="[url={0}][img]{2}[/img][/url]";zf_EmbedImageHelpers.getSizeOptions=function(photo){var ar=photo.height/photo.width;var arLimit=parseFloat(zf_EmbedImageHelpers.MAX_HEIGHT)/zf_EmbedImageHelpers.MAX_WIDTH;
4184var sizes=[{size:360,isWidth:false},{size:480,isWidth:false},{size:720,isWidth:false},{size:560,isWidth:true},{size:800,isWidth:true}];var options=[];for(var i=0;
4185i<sizes.length;i++){var s=sizes[i];var o={width:s.isWidth?s.size:Math.ceil(s.size/ar),height:s.isWidth?Math.ceil(s.size*ar):s.size};o.width=Math.max(o.width,zf_EmbedImageHelpers.MIN_WIDTH);
4186o.height=Math.max(o.height,zf_EmbedImageHelpers.MIN_HEIGHT);if(o.width>zf_EmbedImageHelpers.MAX_WIDTH||o.height>zf_EmbedImageHelpers.MAX_HEIGHT){if(ar>arLimit){o.height=zf_EmbedImageHelpers.MAX_HEIGHT;
4187o.width=Math.ceil(o.height/ar);}else{o.width=zf_EmbedImageHelpers.MAX_WIDTH;o.height=Math.ceil(o.width*ar);}}o.width=Math.max(o.width,zf_EmbedImageHelpers.MIN_WIDTH);
4188o.height=Math.max(o.height,zf_EmbedImageHelpers.MIN_HEIGHT);var hasDuplicate=false;for(var j=0;j<options.length;j++){var option=options[j];if(option.width==o.width&&option.height==o.height){hasDuplicate=true;
4189break;}}if(!hasDuplicate)options.push(o);}options.sort(function(a,b){return a.height-b.height!=0?a.height-b.height:a.width-b.width;});return options;};zf_EmbedImageHelpers.getSizeOptionsString=function(photo){var options=zf_EmbedImageHelpers.getSizeOptions(photo);
4190var html=[];for(var k=0;k<options.length;k++){var so=[options[k].width,"x",options[k].height].join("");html.push('<option value="',so,'">',so,'</option>');}html.push('<option value="custom">Custom</option>');
4191return html;};zf_EmbedImageHelpers.getEmbedCode=function(photo,ps){;;;;;var template=zf_EmbedImageHelpers.CODE_TEMPLATES[ps.codeType];var method=ps.method=="original"?null:ps.method;
4192var size=ps.method=="original"?{cx:photo.width,cy:photo.height}:photo.getScaledSize(ps.method);var share=new zf_Sociable().sharePhoto(photo,method);var pageUrl=share.url;
4193var imageUrl=share.processedImage;var title="";if(photo.title!=null&&photo.title.length!=0){title=[" title=\"",zf_EmbedImageHelpers.htmlAttributeEncode(photo.title),
4194"\""].join("");}var alt=[zf_EmbedImageHelpers.htmlAttributeEncode(photo.owner.dis
4194playName),": ",zf_EmbedImageHelpers.htmlAttributeEncode(ps.photoSet.title)," &emdash; ",
4195zf_EmbedImageHelpers.htmlAttributeEncode(photo.title)].join("");return zf_stdFormatString(template,pageUrl,title,imageUrl,size.cx,size.cy,alt);};zf_EmbedImageHelpers.htmlAttributeEncode=function(s){if(s==null||s=="")return "";
4196return String(s).replace(/&/g,'&amp;').replace(/"/g,'&quot;').replace(/'/g,'&#39;').replace(/</g,'&lt;').replace(/>/g,'&gt;');};;;function zfs_EmbedImageSection(id){zf_Control.prototype.constructor.call(this,
4197id);this._groupItem=null;this._photo=null;$(document).ready(this.closure(this._init));}zfs_EmbedImageSection.inherits(zf_Control);zfs_EmbedImageSection.METHOD_LIST=[{method:zf_ProcessingMethod.StandardSmallSize,
4198mask:0,label:"Small"},{method:zf_ProcessingMethod.StandardMediumSize,mask:zf_AccessMask.ProtectMedium,label:"Medium"},{method:zf_ProcessingMethod.StandardLargeSize,
4199mask:zf_AccessMask.ProtectLarge,label:"Large"},{method:zf_ProcessingMethod.StandardExtraLargeSize,mask:zf_AccessMask.ProtectExtraLarge,label:"X-Large"},{method:zf_ProcessingMethod.StandardXXLargeSize,
4200mask:zf_AccessMask.ProtectXXLarge,label:"XX-Large"}];zfs_EmbedImageSection.prototype.setData=function(params){;this._groupItem=params.groupItem;this._photo=params.photo;this.$().toggle(this._photo!=null&&!this._photo.video);
4201if(this._photo!=null&&!this._photo.video)this._updateEmbedImageForm();};zfs_EmbedImageSection.prototype.setMode=function(mode){if(mode==zf.core.share.ShareUtils.SECTION_MODE.GROUP_ITEM||mode==zf.core.share.ShareUtils.SECTION_MODE.SLIDESHOW||mode==zf.core.share.ShareUtils.SECTION_MODE.MOBILE_APP)return;
4202;};zfs_EmbedImageSection.prototype.update=function(){if(this.$().is(":hidden"))return;};zfs_EmbedImageSection.prototype._init=function(){this.$dom("size").change(this.closure(this._updateImageCode));this.$(".sfe-code-switch INPUT").change(this.closure(this._updateImageCode));
4203this.$dom("code").focus(function(eo){$(eo.currentTarget).bind("mouseup keyup",function(e){e.preventDefault();$(e.currentTarget).select().unbind(e.type);});});};zfs_EmbedImageSection.prototype._updateEmbedImageForm=function(){var photo=this._photo;
4204;var showControls=photo.access.getRealm().type==zf_AccessType.Public;this.$(".sfe-non-public").toggle(!showControls);this.$(".sfe-public").toggle(showControls);if(!showControls)return;
4205var list=zfs_EmbedImageSection.METHOD_LIST;var width=photo.width;var height=photo.height;var realm=photo.access.getRealm();var labelFormat='<option value="{0}">{1} ({2} x {3})</option>';
4206var options=[];for(var i=0;i<list.length+1;i++){var option;if(i<list.length){var method=list[i].method;var mask=list[i].mask;var label=list[i].label;if(method.cx>width&&method.cy>height&&method!=zf_ProcessingMethod.StandardSmallSize)continue;
4207if(realm.type!=zf_AccessType.Public||(realm.mask&mask)!=0)continue;var size=photo.getScaledSize(method);option=zf_stdFormatString(labelFormat,method.code,label,size.cx,
4208size.cy);}else{;if(realm.type!=zf_AccessType.Public||(realm.mask&zf_AccessMask.ProtectOriginals)!=0||(realm.mask&zf_AccessMask.PasswordProtectOriginals)!=0)continue;
4209option=zf_stdFormatString(labelFormat,"original","Original Photo",width,height);}options.push(option);}this.$dom("size").html(options.join("")).find("OPTION:first").attr("selected",
4210"selected");this.$dom("code-html").attr("checked","checked");this._updateImageCode();};zfs_EmbedImageSection.prototype._updateImageCode=function(){var list=zfs_EmbedImageSection.METHOD_LIST;
4211var method=null;var option=this.$dom("size").val();if(option=="original")method="original";else{for(var i=0;i<list.length;i++){if(list[i].method.code!=option)continue;
4212method=list[i].method;break;}}if(method==null){this.$dom("code").val("");return;}var codeType=zf_EmbedImageHelpers.CODE_TYPE.HTML;var $bbCode=this.$dom("code-bbcode");
4213if($bbCode.length>0&&$bbCode.is(":checked"))codeType=zf_EmbedImageHelpers.CODE_TYPE.BBCode;var params={codeType:codeType,method:method,photoSet:this._groupItem};
4214this.$dom("code").val(zf_EmbedImageHelpers.getEmbedCode(this._photo,params));};;function zf_EmbedVideoHelpers(){}zf_EmbedVideoHelpers.MIN_WIDTH=160;zf_EmbedVideoHelpers.MIN_HEIGHT=160;zf_EmbedVideoHelpers.MAX_WIDTH=1920;zf_EmbedVideoHelpers.MAX_HEIGHT=1080;
4215zf_EmbedVideoHelpers.CODE_TEMPLATE='<iframe width="{0}" height="{1}" src="//{2}/zf/core/embedvideo.aspx?p={3}" frameborder="0"></iframe>';zf_EmbedVideoHelpers.getSize=function(photo,width,height){var ar=photo.height/photo.width;
4216if(width!=null){var newHeight=Math.ceil(width*ar);if(newHeight-1==zf_EmbedVideoHelpers.MAX_HEIGHT)newHeight=zf_EmbedVideoHelpers.MAX_HEIGHT;if(newHeight+1==zf_EmbedVideoHelpers.MIN_HEIGHT)newHeight=zf_EmbedVideoHelpers.MIN_HEIGHT;
4217return{width:width,height:newHeight};}height=height||0;var newWidth=Math.ceil(height/ar);
4217if(newWidth-1==zf_EmbedVideoHelpers.MAX_WIDTH)newWidth=zf_EmbedVideoHelpers.MAX_WIDTH;
4218if(newWidth+1==zf_EmbedVideoHelpers.MIN_WIDTH)newWidth=zf_EmbedVideoHelpers.MIN_WIDTH;return{height:height,width:newWidth};};zf_EmbedVideoHelpers.validateSize=function(photo,width,height){var verifyIntegerRange=function(valS,
4219MIN,MAX,MISSING_MSG,MIN_MSG,MAX_MSG){var m=null;var val=parseInt(valS,10);if(!isFinite(val))m=MISSING_MSG;else if(val<MIN)m=zf_stdFormatString(MIN_MSG,MIN);else if(val>MAX)m=zf_stdFormatString(MAX_MSG,
4220MAX);return m;};var m1=verifyIntegerRange(width,zf_EmbedVideoHelpers.MIN_WIDTH,zf_EmbedVideoHelpers.MAX_WIDTH,"Please specify the width","The width cannot be less than {0} pixels",
4221"The width cannot exceed {0} pixels");var m2=verifyIntegerRange(height,zf_EmbedVideoHelpers.MIN_HEIGHT,zf_EmbedVideoHelpers.MAX_HEIGHT,"Please specify the height",
4222"The height cannot be less than {0} pixels","The height cannot exceed {0} pixels");return{widthError:m1,heightError:m2};};zf_EmbedVideoHelpers.getSizeOptions=function(photo){var ar=photo.height/photo.width;
4223var arLimit=parseFloat(zf_EmbedVideoHelpers.MAX_HEIGHT)/zf_EmbedVideoHelpers.MAX_WIDTH;var sizes=[{size:360,isWidth:false},{size:480,isWidth:false},{size:720,isWidth:false},
4224{size:560,isWidth:true},{size:800,isWidth:true}];var options=[];for(var i=0;i<sizes.length;i++){var s=sizes[i];var o={width:s.isWidth?s.size:Math.ceil(s.size/ar),
4225height:s.isWidth?Math.ceil(s.size*ar):s.size};o.width=Math.max(o.width,zf_EmbedVideoHelpers.MIN_WIDTH);o.height=Math.max(o.height,zf_EmbedVideoHelpers.MIN_HEIGHT);
4226if(o.width>zf_EmbedVideoHelpers.MAX_WIDTH||o.height>zf_EmbedVideoHelpers.MAX_HEIGHT){if(ar>arLimit){o.height=zf_EmbedVideoHelpers.MAX_HEIGHT;o.width=Math.ceil(o.height/ar);
4227}else{o.width=zf_EmbedVideoHelpers.MAX_WIDTH;o.height=Math.ceil(o.width*ar);}}o.width=Math.max(o.width,zf_EmbedVideoHelpers.MIN_WIDTH);o.height=Math.max(o.height,
4228zf_EmbedVideoHelpers.MIN_HEIGHT);var hasDuplicate=false;for(var j=0;j<options.length;j++){var option=options[j];if(option.width==o.width&&option.height==o.height){hasDuplicate=true;
4229break;}}if(!hasDuplicate)options.push(o);}options.sort(function(a,b){return a.height-b.height!=0?a.height-b.height:a.width-b.width;});return options;};zf_EmbedVideoHelpers.getSizeOptionsString=function(photo){var options=zf_EmbedVideoHelpers.getSizeOptions(photo);
4230var html=[];for(var k=0;k<options.length;k++){var so=[options[k].width,"x",options[k].height].join("");html.push('<option value="',so,'">',so,'</option>');}html.push('<option value="custom">Custom</option>');
4231return html;};zf_EmbedVideoHelpers.getEmbedCode=function(photo,ps){;;;;;ps.w=Math.max(ps.w,zf_EmbedVideoHelpers.MIN_WIDTH);ps.h=Math.max(ps.h,zf_EmbedVideoHelpers.MIN_HEIGHT);ps.w=Math.min(ps.w,
4232zf_EmbedVideoHelpers.MAX_WIDTH);ps.h=Math.min(ps.h,zf_EmbedVideoHelpers.MAX_HEIGHT);var eps=[zf_EmbedVideoHelpers._normalizeNumber(photo.getUnsignedId().toString(16),
42338),".1",ps.logo?"1":"0",!!ps.auto?"&auto=1":""].join("");return zf_stdFormatString(zf_EmbedVideoHelpers.CODE_TEMPLATE,ps.w,ps.h,zf_stdAllowDefaultHost()?zf_defaultHost:zf_secureHost,
4234eps);};zf_EmbedVideoHelpers._normalizeNumber=function(s,len){var slen=s.length;if(slen>len)return s.substring(slen-len);while(slen<len){s="0"+s;slen=s.length;}return s;};;;function zfs_EmbedVideoSection(id){zf_Control.prototype.constructor.call(this,
4235id);this._groupItem=null;this._photo=null;$(document).ready(this.closure(this._init));}zfs_EmbedVideoSection.inherits(zf_Control);zfs_EmbedVideoSection.prototype.setData=function(params){;this._groupItem=params.groupItem;
4236this._photo=params.photo;this.$().toggle(this._photo!=null&&this._photo.video);if(this._photo!=null&&this._photo.video)this._updateEmbedVideoForm();};zfs_EmbedVideoSection.prototype.setMode=function(mode){if(mode==zf.core.share.ShareUtils.SECTION_MODE.GROUP_ITEM||mode==zf.core.share.ShareUtils.SECTION_MODE.SLIDESHOW||mode==zf.core.share.ShareUtils.SECTION_MODE.MOBILE_APP)return;
4237;};zfs_EmbedVideoSection.prototype.update=function(){if(this.$().is(":hidden"))return;this.$dom("msg").hide().text("");this.$dom("size").find("OPTION:first").attr("selected","selected");
4238this.$dom("custom-size").toggle(this.$dom("size").find("OPTION").length==1);};zfs_EmbedVideoSection.prototype._init=function(){this.$dom("code").focus(function(eo){$(eo.currentTarget).bind("mouseup keyup",
4239function(e){e.preventDefault();$(e.currentTarget).select().unbind(e.type);});});$([]).add(this.$dom("h")).add(this.$dom("w")).blur(this.closure(this._integerInputVerifier)).focus(function(e){$(e.currentTarget).select();
4240});};zfs_EmbedVideoSection.prototype._updateEmbedVideoForm=function(){var photo=this._photo;;var showControls=photo.access.getRealm().type==zf_AccessType.Public;this.$(".sfe-non-public").toggle(!showControls);
4241this.$(".sfe-public").toggle(showControls);if(!showControls)return;var ar=photo.height/photo.width;this._fillSizesSelect(photo);this.$(".sfv-custom-size INPUT").unbind(".video");
4242this.$dom("code").unbind(".video");this.$dom("size").unbind(".video");this.$dom("logo").unbind(".video");var isPublic=photo.access.getRealm().type==zf_AccessType.Public;
4243var $sev=this.$dom();if(isPublic){$sev.removeClass("sfv-s-disabled");$sev.find("H4").text("").hide();$sev.find("INPUT, SELECT").removeAttr("disabled");this._updateVideoCode(photo);
4244}else{$sev.addClass("sfv-s-disabled");$sev.find("H4").show().text("Get the video embed code (Public videos only):");$sev.find("INPUT, SELECT").attr("disabled","disabled");
4245this.$dom("code").val("");}if(isPublic){var self=this;this.$dom("logo").bind("change.video",function(e){;self._updateVideoCode(photo);});this.$dom("size").bind("change.video keyup.video",
4246function(e){var value=$(this).val();if(value!=null&&value!="custom"){self.$dom("custom-size").hide();var parts=value.split("x");;if(parts.length>1){self.$dom("w").val(parts[0]);
4247self.$dom("h").val(parts[1]);}}else if(value=="custom"){self.$dom("custom-size").show();if(e.type!="keyup")self.$dom("w").focus();}self._integerInputVerifier();self._updateVideoCode(photo);
4248});this.$dom("h").bind("keyup.video paste.video cut.video input.video",function(e){if(e.which==9)return;var height=self._safeParseDimension(self.$dom("h").val(),
4249null);self.$dom("w").val(height==null?"":Math.ceil(height/ar));self._updateVideoCode(photo);});this.$dom("w").bind("keyup.video paste.video cut.video input.video",
4250function(e){if(e.which==9)return;var width=self._safeParseDimension(self.$dom("w").val(),null);self.$dom("h").val(width==null?"":Math.ceil(width*ar));self._updateVideoCode(photo);
4251});}this.$dom("size").change();if(!this.$dom("logo").closest(".item").hasClass("disabled"))this.$dom("logo").attr("checked","checked").removeAttr("disabled");else this.$dom("logo").attr("disabled",
4252"disabled");};zfs_EmbedVideoSection.prototype._updateVideoCode=function(photo){var params={w:this._safeParseDimension(this.$dom("w").val(),-1),h:this._safeParseDimension(this.$dom("h").val(),
4253-1),logo:zf_userId==this._photo.owner.id?this.$dom("logo").is(":checked"):true};this.$dom("code").val(zf_EmbedVideoHelpers.getEmbedCode(photo,params));};zfs_EmbedVideoSection.prototype._fillSizesSelect=function(photo){var html=zf_EmbedVideoHelpers.getSizeOptionsString(photo);
4254this.$dom("size").html(html.join("")).find("OPTION:first").attr("selected","selected");this.$dom("custom-size").toggle(this.$dom("size").find("OPTION").length==1);
4255};zfs_EmbedVideoSection.prototype._integerInputVerifier=function(e){;var self=this;var verifyIntegerRange=function($f,MIN,MAX,MISSING_MSG,MIN_MSG,MAX_MSG){var m=null;var val=parseInt($f.val(),
425610);if(!isFinite(val))m=MISSING_MSG;else if(val<MIN)m=zf_stdFormatString(MIN_MSG,MIN);else if(val>MAX)m=zf_stdFormatString(MAX_MSG,MAX);
4256if(m==null)$f.unbind("keyup.verify");
4257else if(!$f.hasClass("sfv-error-field"))$f.bind("keyup.verify",self.closure(self._integerInputVerifier));$f.toggleClass("sfv-error-field",m!=null);return m;};var m1=verifyIntegerRange(this.$dom("w"),
4258zf_EmbedVideoHelpers.MIN_WIDTH,zf_EmbedVideoHelpers.MAX_WIDTH,"Please specify the width","The width cannot be less than {0} pixels","The width cannot exceed {0} pixels");
4259var m2=verifyIntegerRange(this.$dom("h"),zf_EmbedVideoHelpers.MIN_HEIGHT,zf_EmbedVideoHelpers.MAX_HEIGHT,"Please specify the height","The height cannot be less than {0} pixels",
4260"The height cannot exceed {0} pixels");var message=m1;if(message==null)message=m2;var $msg=this.$dom("msg");if(message==null){if($msg.is(":visible")){$msg.stop(true,
4261true);$msg.text("").hide().css("backgroundColor","#EEE").css("borderColor","#EEE");}}else{if(!$msg.is(":visible"))$msg.slideDown("slow");if($msg.text()!=message){$msg.text(message);
4262$msg.css("borderColor","red").animate({backgroundColor:"pink"},500).delay(5000).animate({backgroundColor:"#EEE"},3000);}}};zfs_EmbedVideoSection.prototype._safeParseDimension=function(s,
4263defaultValue){var n=parseInt(zf_stdTrim(s),10);if(!isFinite(n)||n<=0)return defaultValue;return n;};;;function zfl_SharePopup(id,share){zfl_Popup.prototype.constructor.call(this,
4264id,false);this._share=share;this._share.setParentObject(this);}zfl_SharePopup.inherits(zfl_Popup);zfl_SharePopup.prototype.show=function(domOrigin,photoSet,photo,showCurtain){this._showCurtain=showCurtain;
4265if(this._showCurtain){zf_Curtain.show("dark");}zfl_Popup.prototype.show.call(this,domOrigin);this._share.show(photoSet,photo);var self=this;$(window).bind("resize.sharePopup",
4266function(e){self.updatePosition(domOrigin,null);});};zfl_SharePopup.prototype.hide=function(){zfl_Popup.prototype.hide.call(this);$(window).unbind("resize.sharePopup");if(this._showCurtain){zf_Curtain.hide();
4267}if(this.onhide){this.onhide();}};zfl_SharePopup.prototype.updateCopyright=function(copyrightText){this.$dom("copy").text(copyrightText);};;;function zfl_FullSlideshow(id,flashbutton,flashvars){zfl_Control.prototype.constructor.call(this,
4268id);this.html5=false;this.installed=false;if(!zf_Flash.isSafeDomain())this.installed=false;this._flashbutton=flashbutton;this._flashvars=flashvars;this._currentIndex=0;
4269this._selectIndex=null;zfl_PasswordManager.notify.attach(this.closure(this.refresh));zf_stdMakeMethodsDeferred(this,this.id,["_update"]);this._delayedRefresh(1000);
4270}zfl_FullSlideshow.inherits(zfl_Control);zfl_FullSlideshow.prototype.refresh=function(){this.cleanup();if(!this.installed)return;var src=this._flashbutton?"/zf/code/slideshow/button.swf":"/zf/code/slideshow/6.5.1/fullsize.swf";
4271src=zf_stdGetProtocol(zf_cdnHost)+zf_cdnHost+src;this._flashvars.keyring=zf_stdGetCookie("zf_keyring");this._flashvars.start_index=this._currentIndex;var element=document.createElement("DIV");
4272element.id=this.id+"-container";element.className="slideshow-container";this.dom().appendChild(element);element.innerHTML=zf_Flash.createHtml(this.id+"-flash","pv-img pv-flash flash-restart",
4273src,this._flashvars,this._flashbutton);this._initialized=true;this._selectIndex=null;;};zfl_FullSlideshow.prototype._delayedRefresh=function(delay){this._initialized=false;var self=this;
4274setTimeout(function(){if(!self._initialized)self.refresh();},delay);;};zfl_FullSlideshow.prototype.cleanup=function(){var container=this.dom("container");if(container){container.parentNode.removeChild(container);
4275container.innerHTML="";container=null;};};zfl_FullSlideshow.prototype.onPhoto=function(id,index){this._selectIndex=index;if(this.onslide)this.onslide(id,index);;};zfl_FullSlideshow.prototype.onExitFullScreen=function(){;
4276if(this._flashbutton){this.cleanup();if(this._selectIndex!=null&&this.onselect)this.onselect(this._selectIndex);this._delayedRefresh(500);}};zfl_FullSlideshow.prototype.onPassword=function(password){;
4277};zfl_FullSlideshow.prototype.onMouseIn=function(){;};zfl_FullSlideshow.prototype.onMouseOut=function(){;};zfl_FullSlideshow.prototype.updateOptions=function(duration,background,showCaptions,showTransitions,volume){;
4278};zfl_FullSlideshow.prototype.backToGallery=function(){;var k=location.href.indexOf('/slideshow');if(k!=-1){url=location.href.substring(0,k);location.href=url;}};zfl_FullSlideshow.prototype.update=function(photo,
4279context){this._currentIndex=context.currentIndex;if(this.installed)this._update();};zfl_FullSlideshow.prototype._update=function(){;var flash=this.dom("flash");if(flash){try{flash.updateStartIndex(this._currentIndex);
4280;}catch(e){;}}flash=null;};;;function zfl_ControlBox(id,photoPage,init){this._photoPage=photoPage;this._popups=init.popups;this._buttons=init.buttons;this._buymenu=init.buymenu;
4281this._useNewSlideshow=init.useNewSlideshow;zfl_Control.prototype.constructor.call(this,id);zf_stdMakeMethodsDeferred(this,this.id,["_showButtons"]);var self=this;
4282if(this._buttons.slideshow){var installed=this._popups.flash.installed;if(installed){this._buttons.slideshow.clickable=false;this._popups.flash.onselect=function(index){self.command("seek",
4283index);};this._popups.flash.onslide=function(id,index){if(self.onslide)self.onslide(id,index);};}else{this.$().addClass("controlbox-no-flash");}}if(this._buttons.addToCart&&this._buymenu){var ids=["#",
4284this._buttons.addToCart.id,",#",this._buymenu.id].join("");$(ids).hover(this.closure(this._buy_onmouseover),this.closure(this._buy_onmouseout));this._buymenu.onaddtocart=this.closure(this.addToCart);
4285this._buymenu.oneditproduct=this.closure(this.editProduct);this._buymenu.onconfirmproduct=this.closure(this.addToCart);this._buymenu.onaddtofav=this.closure(this.addToFavorites);
4286this._buymenu.onselect=function(){self.command("selectPhotos",true,'buy');};}}zfl_ControlBox.inherits(zfl_Control);zfl_ControlBox.prototype.init=function(photoSet,selection,zenbar){this._photoSet=photoSet;
4287this._selection=selection;this._zenbar=zenbar;var $this=this.$dom();var buttons=[];if(this._buttons.selectPhotos)buttons.push(this._buttons.selectPhotos.$dom());
4288if(this._buttons.addToCart)buttons.push(this._buttons.addToCart.$dom());if(this._buttons.createBook)buttons.push(this._buttons.createBook.$dom());if(this._buttons.share)buttons.push(this._buttons.share.$dom());
4289if(this._buttons.slideshow)buttons.push(this._buttons.slideshow.$dom());if(this._buttons.download)buttons.push(this._buttons.download.$dom());if($this.hasClass('controlbox-aligned')&&buttons.length<=3){if(buttons.length>1){buttons[0].css('float',
4290'left');if(buttons.length==3){buttons[1].css('float','left');var left=buttons[0].outerWidth();var center=buttons[1].outerWidth();var right=buttons[2].outerWidth();
4291var whole=$this.width();var shift=Math.ceil((whole-(left+right+center))/2);buttons[1].css('left',shift);}}}else{$this.removeClass('controlbox-aligned').find('.button:first').css('margin-left',
42920);}if(!this._photoPage)this._showButtons(true);};zfl_ControlBox.prototype._showButtons=function(show){var printable=this.commandtest("addToCart");var $button;if(this._buttons.addToCart){$button=this._buttons.addToCart.$dom();
4293$button.clearQueue();if(printable){$button.css({visibility:'inherit'});}else{$button.delay(500).queue(function(next){$(this).css({visibility:'hidden'});next();});
4294}}if(this._buttons.slideshow)this._buttons.slideshow.visibility(show);if(this._buttons.share)this._buttons.share.visibility(show);if(this._buttons.download)this._buttons.download.visibility(show);
4295this._toggleButton(this._buttons.createBook,this.commandtest("createBook"));this._toggleButton(this._buttons.makeZookAlbum,this.commandtest("makeZookAlbum"));if(printable&&this.current)this.setCounts(this.current.video?0:1,
4296this.current.video?1:0);};zfl_ControlBox.prototype.share=function(){this._popups.share.show(this._buttons.share.dom(),this._photoSet,this.current);};zfl_ControlBox.prototype.download=function(){this.command("downloadOriginal");
4297};zfl_ControlBox.prototype.addToCart=function(options){this.command("addToCart",options);};zfl_ControlBox.prototype.createBook=function(options){this.command("createBook",options);};zfl_ControlBox.prototype.makeZookAlbum=function(isGspAlbumFlow){this.command('makeZookAlbum',
4298isGspAlbumFlow);};zfl_ControlBox.prototype.confirmProduct=function(info){this.command("confirmProduct",info);};zfl_ControlBox.prototype.editProduct=function(info){this.command("editProduct",
4299info);};zfl_ControlBox.prototype.selectPhotos=function(){this.command("selectPhotos",true);};zfl_ControlBox.prototype.selectDone=function(){this.command("selectPhotos",false);};zfl_ControlBox.prototype.addToFavorites=function(purchase){this.command("addToFavorites",
4300purchase);};zfl_ControlBox.prototype.update=function(photo,context){;;;if(this.current==photo)return;if(this._popups.share)this._popups.share.hide();if(this._popups.addToCart)this._popups.addToCart.hide();
4301if(this.current!=null)this.current.unadvise(this);this.current=photo;this._showButtons(photo.loaded);if(!photo.loaded){var self=this;photo.advise(this,function(){self._showButtons(true);
4302});}if(this._popups.flash)this._popups.flash.update(photo,context);this._currentIndex=context.currentIndex;};zfl_ControlBox.prototype.canShare=function(){return this._popups.share;
4303};zfl_ControlBox.prototype.canSlideshow=function(){return this._buttons.slideshow;};zfl_ControlBox.prototype.photoDisplayed=function(){this._showButtons(true);};zfl_ControlBox.prototype.selectionEnabled=function(enabled){this.$dom().toggleClass('controlbox-selection');
4304};zfl_ControlBox.prototype.slideshow=function(){var uri=location.pathname+"/slideshow"+location.hash;if(this._useNewSlideshow){uri=this.current?zf_stdFormatString('{0}/e{1}/slideshow',
4305this._photoSet.getBaseHref(),zf_toUint32(this.current.id).toString(16)):zf_stdFormatString('{0}/slideshow',this._photoSet.getBaseHref());location.href=uri;return;
4306}var formatFeatures="left=0,top=0,width={0},height={1}
4306,resizable=yes,fullscreen=yes,"+"scrollbars=no,menubar=no,toolbar=no,location=no,"+"status=no";var width=screen.availWidth?screen.availWidth:screen.width;
4307var height=screen.availHeight?screen.availHeight:screen.height;var features=zf_stdFormatString(formatFeatures,width,height);var w=window.open(uri,"zf_Slideshow",
4308features);if(w!=null){setTimeout(function(){try{w.resizeTo(width,height);}catch(e){}try{w.focus();}catch(e){}},100);}else alert("It appears you have a pop-up blocker active for this Web page, which prevents you from seeing new windows open. Please disable the pop-up blocker for this page or, for better overall experience, disable the pop-up blocker for the entire site.");
4309};zfl_ControlBox.prototype._buy_onmouseover=function(){var button=this._buttons.addToCart.$dom();var height=button.outerHeight();var pos=button.offset();if(pos.left>zf_stdGetClientWidth()-300)this._buymenu.show(pos.left+button.outerWidth(),
4310pos.top+height+2,true);else this._buymenu.show(pos.left,pos.top+height+2);return false;};zfl_ControlBox.prototype._buy_onmouseout=function(){this._buymenu.hide();};zfl_ControlBox.prototype.setCounts=function(photos,
4311videos){if(this._buymenu)this._buymenu.setCounts(photos,videos);};zfl_ControlBox.prototype._toggleButton=function(button,show){if(button){var $button=button.$dom();$button.clearQueue();
4312if(show){$button.show();}else{$button.delay(500).queue(function(next){$(this).hide();next();});}}};;;function zfl_SessionCookie(cookie){;this.sessionKey=cookie;var storedCookie=zf_stdGetCookie("zf_lsc");
4313if(storedCookie!=null){var parts=storedCookie.split(".");this.recentPhotoSetId=parts[1].length>0?parseInt(parts[1]):0;this.recentPhotoIndex=parts[2].length>0?parseInt(parts[2]):-1;
4314this.showAll=parts[3]=="1";}else{this.recentPhotoSetId=0;this.recentPhotoIndex=-1;this.showAll=false;}}zfl_SessionCookie.prototype.setRecent=function(photoSetId,photoIndex){;;this.recentPhotoSetId=photoSetId;
4315this.recentPhotoIndex=photoIndex;this._save();};zfl_SessionCookie.prototype.setShowAll=function(showAll){this.showAll=showAll;this._save();};zfl_SessionCookie.prototype._save=function(){if(!this.sessionKey)return;
4316zf_stdSetCookie("zf_lsc",[this.sessionKey,this.recentPhotoSetId,this.recentPhotoIndex,this.showAll?1:0].join("."));};;;;;;function zfl_PhotoList(offset,page,length,ids,token,
4317photoSetPcn,tokenId){zf_PhotoList.prototype.constructor.call(this,offset,page,length,ids);this._initArgs=arguments;this._token=token;this._photoSetPcn=photoSetPcn;
4318this._tokenId=tokenId;}zfl_PhotoList.inherits(zf_PhotoList);zfl_PhotoList.requests=new zf_RequestQueue(200);zfl_PhotoList.prototype.getPhotoRange=function(from,to,urgent,oncomplete){;;var params=[this._defaultOwner.id,
4319this._photoSetId,from,to,this._token,zfl_SessionCookie.current.sessionKey,this._photoSetPcn];var callback=function(status,retVal){if(status!=200||retVal.error!=null)return;
4320oncomplete(retVal.result);};if(urgent){zf_stdServerRequest("GET","/zf/layout/layout.asmx","GetPhotoRange",params,callback);}else{zfl_PhotoList.requests.enqueue("GET",
4321"/zf/layout/layout.asmx","GetPhotoRange",params,callback);}};zfl_PhotoList.prototype.getPhotoBatch=function(ids,oncomplete){var params=[this._defaultOwner.id,this._tokenId,ids,
4322this._token,zfl_SessionCookie.current.sessionKey,this._photoSetPcn];zfl_PhotoList.requests.enqueue("GET","/zf/layout/layout.asmx","GetPhotoBatch",params,function(status,
4323retVal){if(status!=200||retVal.error!=null)return;oncomplete(retVal.result);});};;function zfl_BuyMenu(id,zenbar,mode,pricingKey){;zfl_Control.prototype.constructor.call(this,
4324id);this._photos=1;this._videos=0;this._cartQueue=new zf_RequestQueue(500);this._zenbar=zenbar;this._pricingKey=pricingKey;this._loadedRecentProducts={};this.$dom().detach().appendTo("body");
4325this.$(".buymenu-buy").click(this.closure(this._buy_onclick));this.$(".buymenu-save").click(this.closure(this._save_onclick));this.$(".buymenu-select").click(this.closure(this._select_onclick));
4326this._hoverover=function(){$(this).removeClass("buymenu-color1 buymenu-bgcolor1").addClass("buymenu-color2 buymenu-bgcolor2");};this._hoverout=function(){$(this).addClass("buymenu-color1 buymenu-bgcolor1").removeClass("buymenu-color2 buymenu-bgcolor2");
4327};this.$("a").hover(this._hoverover,this._hoverout);this._mode=mode;}zfl_BuyMenu.inherits(zfl_Control);zfl_BuyMenu.prototype.show=function(x,y,origin){if(this._photos==0&&this._videos==0)return;
4328if(this._showed)return;this._showed=true;if(zfl_Layout.currentMenu&&zfl_Layout.currentMenu!=this)zfl_Layout.currentMenu.remove();zfl_Layout.currentMenu=this;var photos=this._photos;
4329var videos=this._videos;var count=photos+videos;var gallery=this._mode=="gallery"&&count>1;this.$('.buymenu-gallery-y').toggle(gallery);this.$('.buymenu-gallery-n').toggle(!gallery);
4330if(gallery){if(photos>=0&&videos==0)this.$(".buymenu-select").text("Select photos to buy");else if(photos>0&&videos>0)this.$(".buymenu-select").text("Select items to buy");
4331else this.$(".buymenu-select").text("Select videos to buy");if(photos>=0&&videos==0)this.$(".buymenu-buy").text(count==1?"Buy photo":zf_stdFormatString("Buy all {0} photos",
4332count));else if(photos==0&&videos>=0)this.$(".buymenu-buy").text(count==1?"Buy video":zf_stdFormatString("Buy all {0} videos",count));else this.$(".buymenu-buy").text(count==1?"Buy item":zf_stdFormatString("Buy all {0} items",
4333count));}else{if(photos>=0&&videos==0)this.$(".buymenu-buy").text(count==1?"Select product":zf_stdFormatString("Select product for {0} photos",count));else if(photos>0&&videos>0)this.$(".buymenu-buy").text(count==1?"Select product":zf_stdFormatString("Select product for {0} items",
4334count));else this.$(".buymenu-buy").text(count==1?"Select product":zf_stdFormatString("Select product for {0} videos",count));if(photos>=0&&videos==0)this.$(".buymenu-save").text(count==1?"Save for purchasing later":zf_stdFormatString("Save {0} photos for purchasing later",
4335count));else if(photos>0&&videos>0)this.$(".buymenu-save").text(count==1?"Save for purchasing later":zf_stdFormatString("Save {0} items for purchasing later",count));
4336else this.$(".buymenu-save").text(count==1?"Save for purchasing later":zf_stdFormatString("Save {0} videos for purchasing later",count));}var css={};if(origin===true)origin={h:"right",
4337v:"top"};else if(origin===false||origin===undefined)origin={h:"left",v:"top"};if(origin.h=="left")css.left=x;else if(origin.h=="right")css.right=this.$dom().parent().width()-x;
4338if(origin.v=="top")css.top=y;else if(origin.v=="bottom")css.bottom=this.$dom().parent().height()-y;this.$dom().css(css).stop(true,true).slideDown(100);var self=this;
4339if(this._zenbar.cart.size<=0||this._zenbar.quickShopOnly()){this.$dom().find(".buymenu-products").hide();return;}this._cartQueue.enqueueEx("GET","/zf/core/printing/printing.asmx",
4340"GetCartSummary",[zf_locale,this._zenbar.cart.id,this._zenbar.cart.photographerId,this._zenbar.cart.changeNumber,true],function(result,error){self.$dom().find(".buymenu-products").toggle(error==null);
4341if(error)return;self._zenbar.cart=result;var markupRecent=[],added=0;var markupIncomplete=[];var recentProducts=[];var incompleteProducts=[];if(videos==0){if(self._pricingKey){var hasRecentProducts=false;
4342for(var j=0;j<result.recentProducts.length&&added<3;j++){var recentProduct=result.recentProducts[j];if(recentProduct.getPriceKey().pricingKey==self._pricingKey){recentProducts.push(recentProduct);
4343added++;markupRecent.push('<a href="#" class="buymenu-color1 buymenu-bgcolor1 recent">',zf_stdHtmlEncode(recentProduct.name),'</a>');var recentProductUniqueId=recentProduct.item.vendorId+'_'+recentProduct.item.productId;
4344if(!self._loadedRecentProducts[recentProductUniqueId]){self._loadedRecentProducts[recentProductUniqueId]=true;if(!hasRecentProducts){hasRecentProducts=true;Zenfolio.Global.EcommerceManager.instanse.setCurrency(result.currency);
4345}Zenfolio.Global.EcommerceManager.instanse.addBuyButtonDropDownImpression(recentProduct,result.currency,added);}}}if(hasRecentProducts){Zenfolio.Global.EcommerceManager.instanse.buyButtonDropDownOpen();
4346}}var label;for(var i=0;(i<result.incompleteProducts.length)&&!self._zenbar.newShoppingEnabled;i++){var incompleteProduct=result.incompleteProducts[i];if(incompleteProduct.getPriceKey().pricingKey===self._pricingKey){if(markupIncomplete.length===0){incompleteProducts.push(incompleteProduct);
4347label=count==1?zf_stdFormatString("Add 1 photo to {0}",incompleteProduct.name):zf_stdFormatString("Add {0}
4347 photos to {1}",count,incompleteProduct.name);markupIncomplete.push('<a href="#" class="buymenu-color1 buymenu-bgcolor1 product wrap">',
4348zf_stdHtmlEncode(label),'</a>');}else{label=count==1?"Add 1 photo to existing product in your cart":zf_stdFormatString("Add {0} photos to existing product in your cart",
4349count);markupIncomplete=['<a href="#" class="buymenu-color1 buymenu-bgcolor1 existing wrap">',zf_stdHtmlEncode(label),'</a>'];break;}}}}self.$dom().find(".buymenu-products .loading").hide();
4350self.$dom().find(".buymenu-products").find(".list-recent").toggle(markupRecent.length>0).html(markupRecent.join(""));self.$dom().find(".buymenu-products").find(".list-incomplete").toggle(markupIncomplete.length>0).html(markupIncomplete.join(""));
4351self.$dom().find(".menu-separator:first").toggle(markupRecent.length>0||markupIncomplete.length>0);self.$dom().find(".buymenu-products A.recent").each(function(index){$(this).click(function(){return self._product_recent_click(recentProducts[index],
4352result.currency,index);});});self.$dom().find(".buymenu-products A.product").each(function(index){$(this).click(function(){return self._product_incomplete_click(incompleteProducts[index]);
4353});});self.$dom().find(".buymenu-products:first A.existing").click(self.closure(self._existing_onclick));self.$("a.product,a.existing,a.recent").hover(self._hoverover,
4354self._hoverout);});};zfl_BuyMenu.prototype.hide=function(){if(!this._showed)return;this._showed=false;var self=this;var reset=function(){if(zfl_Layout.currentMenu==self)zfl_Layout.currentMenu=null;
4355};var slideUp=function(){$(this).stop(true,true).slideUp(200,reset).dequeue();};this.$dom().delay(400).queue(slideUp);};zfl_BuyMenu.prototype.remove=function(){this.$dom().stop(true,
4356true).hide();this._showed=false;};zfl_BuyMenu.prototype.setCounts=function(photos,videos){this._photos=photos;this._videos=videos;};zfl_BuyMenu.prototype._buy_onclick=function(){this.remove();
4357if(this.onaddtocart)this.onaddtocart({newProduct:true});return false;};zfl_BuyMenu.prototype._select_onclick=function(){this.remove();if(this.onselect)this.onselect();return false;
4358};zfl_BuyMenu.prototype._existing_onclick=function(){this.remove();if(this.onaddtocart)this.onaddtocart({addToExisting:true});return false;};zfl_BuyMenu.prototype._recent_onclick=function(info){this.remove();
4359if(this.onaddtocart)this.onaddtocart({immediate:true,product:info});return false;};zfl_BuyMenu.prototype._save_onclick=function(){this.remove();if(this.onaddtofav)this.onaddtofav(true);
4360return false;};zfl_BuyMenu.prototype._product_incomplete_click=function(info){this.remove();if(this.oneditproduct)this.oneditproduct(info);return false;};zfl_BuyMenu.prototype._product_recent_click=function(info,
4361currency,index){this.remove();if(this.onconfirmproduct){var self=this;Zenfolio.Global.EcommerceManager.instanse.setCurrency(currency);Zenfolio.Global.EcommerceManager.instanse.addBuyButtonDropDownProduct(info,
4362currency,index+1);Zenfolio.Global.EcommerceManager.instanse.buyButtonDropDownClick(function(){self.onconfirmproduct({vendorId:info.item.vendorId,productId:info.item.productId,
4363ecommerceList:Zenfolio.Global.ProductList.BuyButtonDropDown});});}return false;};;function zfl_PhotoMenu(items,classes){;this.id="__photo_menu_"+zfl_PhotoMenu.counter++;this.dom=zfl_Control.prototype.dom;
4364this.$dom=zfl_Control.prototype.$dom;this.display=zfl_Control.prototype.display;this.visibility=zfl_Control.prototype.visibility;this._delayedSubMenu=new zf_DelayedInvoke(500);
4365this._delayedActive=new zf_DelayedInvoke(300);if(classes&&classes.length>0)this._classes=classes;else this._classes="pvo-menu photoMenu";this._map={};for(var i=0;
4366i<items.length;i++){var item=items[i];;if(!item.onselect)item.onselect=zf_stdFalse;if(!item.onclick)item.onclick=zf_stdFalse;;this._map[item.id]=item;}this.items=items;
4367}zfl_PhotoMenu.counter=0;zfl_PhotoMenu.prototype.create=function(parent){;;var root=document.createElement("DIV");root.className=this._classes+" none";root.id=this.id;root.innerHTML=this._build();
4368parent.appendChild(root);this._subscribe();parent=null;root=null;};zfl_PhotoMenu.prototype._build=function(){var content=[];var items=this.items;var self=this;var buildContent=function(face){content.push('<div>');
4369for(i=0;i<items.length;i++){if(items[i].separator){content.push('<tr><td><div class="sep"></div></td></tr>');continue;}content.push('<div class="item item-',items[i].id,
4370'"');if(face)content.push(' id="',self.id,'-',items[i].id,'"');content.push('><div class="icon"></div>');if(items[i].text)content.push('<div class="text">',items[i].text,
4371'</div>');content.push('</div>');}content.push('</div>');};content.push('<div class="overlay-background">');content.push('</div>');buildContent(true);return content.join("");
4372};zfl_PhotoMenu.prototype._subscribe=function(item){var self=this;if(!item){for(i=0;i<this.items.length;i++)this._subscribe(this.items[i]);if(this.onactive){var dom=this.dom();
4373dom.onmouseover=function(){self._delayedActive.invoke(function(){self.onactive();});};dom.onmouseout=function(){self._delayedActive.clear();};dom=null;}return;}if(item.separator)return;
4374var domItem=this.dom(item.id);;domItem.onclick=function(){self.click(item.id);};domItem.onmouseover=function(){self.select(item.id,true);};domItem.onmouseout=function(){if(self.selected==item){if(item!=self._activeSubMenu){self.select(item.id,
4375false);self._pendingSubMenu=null;self._delayedSubMenu.clear();}}};domItem=null;};zfl_PhotoMenu.prototype.select=function(id,selected){var item=this._map[id];;if(selected&&item==this.selected)return;
4376if(!selected&&item!=this.selected)return;var self=this;var switchSubMenu=function(){var oldMenu=self._activeSubMenu;var newMenu=self._pendingSubMenu;self._activeSubMenu=newMenu;
4377self._pendingSubMenu=null;if(oldMenu)oldMenu.onsubmenu(false);
4377if(newMenu){var dom=self.dom(item.id);var pos=zf_stdGetOffset(dom);pos.cx+=dom.clientWidth;dom=null;
4378newMenu.onsubmenu(true,pos.cx+6,pos.cy-4,self);}};if(selected){if(this.selected)this.select(this.selected.id,false);zf_stdReplaceClassName(this.dom(item.id),"item-standard",
4379"item-hover");this.selected=item;if(item!=this._activeSubMenu){var pending=item.onsubmenu?item:null;if(pending!=this._pendingSubMenu||!this._delayedSubMenu.pending){this._pendingSubMenu=pending;
4380this._delayedSubMenu.invoke(switchSubMenu);}}else{this._pendingSubMenu=null;this._delayedSubMenu.clear();}}else if(!selected){zf_stdReplaceClassName(this.dom(item.id),
4381"item-hover","item-standard");if(item==this._pendingSubMenu){this._pendingSubMenu=null;this._delayedSubMenu.invoke(switchSubMenu);}this.selected=null;item.onselect(false);
4382}item.onselect(selected);};zfl_PhotoMenu.prototype.click=function(id,selected){var item=this._map[id];;if(this.selected!=item)this.select(item.id,true);if(this._delayedSubMenu.pending){this._delayedSubMenu.callback();
4383this._delayedSubMenu.clear();}item.onclick();};zfl_PhotoMenu.prototype.show=function(toshow,x,y,parent,origin){this.parent=parent;if(!toshow){if(this._activeSubMenu)this._activeSubMenu.onsubmenu(false);
4384this._activeSubMenu=this._pendingSubMenu=null;this._delayedSubMenu.clear();if(this.selected)this.select(this.selected.id,false);}else if(x&&y){origin=origin||{h:'left',
4385v:'top'};var css={};css[origin.h]=x;css[origin.v]=y;this.$dom().css(css);}this.display(toshow);if(toshow&&parent){var $this=this.$dom();var bottom=$this.offset().top+$this.outerHeight();
4386var max=$(window).height()+$(window).scrollTop()-50;if(bottom>max)$this.css({top:$this.position().top-$this.outerHeight()+26});}};zfl_PhotoMenu.prototype.destroy=function(){this.show(false);
4387var dom=this.dom();if(dom!=null)dom.parentNode.removeChild(dom);};zfl_PhotoMenu.prototype.get=function(id){return this._map[id];};;function zfl_DownloadMenu(photo,saveImages){;zfl_PhotoMenu.prototype.constructor.call(this,
4388[],"pvo-menu photoMenu downloadMenu");this.current=photo;this._saveImages=saveImages;this.oncommand=zf_stdFalse;}zfl_DownloadMenu.inherits(zfl_PhotoMenu);zfl_DownloadMenu.prototype.create=function(parent){;
4389;var self=this;var root=document.createElement("DIV");root.className=this._classes+" none";root.id=this.id;if(this.current.loaded){root.innerHTML=this._build();}else{root.innerHTML=['<div class="downloadMenu-loading">',
4390'<div class="overlay-background"></div>','Loading...','</div>'].join("");this.current.advise(this,function(){self.dom().innerHTML=self._build();self._subscribe();
4391});}parent.appendChild(root);if(this.current.loaded)this._subscribe();parent=null;root=null;};zfl_DownloadMenu.buildItems=function(photo,saveImages,oncommand,oncommandtest){;;var items=[];
4392var i;var imageList=[{method:{original:true},mask:zf_AccessMask.ProtectOriginals},{method:{original:true,all:true},mask:zf_AccessMask.ProtectOriginals},{method:zf_ProcessingMethod.StandardXXLargeSize,
4393mask:zf_AccessMask.ProtectXXLarge},{method:zf_ProcessingMethod.StandardExtraLargeSize,mask:zf_AccessMask.ProtectExtraLarge},{method:zf_ProcessingMethod.StandardLargeSize,
4394mask:zf_AccessMask.ProtectLarge},{method:zf_ProcessingMethod.StandardMediumSize,mask:zf_AccessMask.ProtectMedium},{method:zf_ProcessingMethod.StandardSmallSize,mask:-1}];
4395var videoList=[{method:{video:true},mask:0},{method:zf_ProcessingMethod.Video1080p,mask:zf_AccessMask.Protect1080p},{method:zf_ProcessingMethod.Video720p,mask:zf_AccessMask.Protect720p},
4396{method:zf_ProcessingMethod.Video480p,mask:zf_AccessMask.Protect480p},{method:zf_ProcessingMethod.Video360p,mask:-1}];var width=photo.width;var height=photo.height;
4397var downloadHandler=function(uri){return function(){oncommand("download-"+uri);document.location.href=uri;};};var wasOriginal=false;var list=photo.video?videoList:imageList;
4398for(i=0;i<list.length;i++){var method=list[i].method;if(method.original&&!oncommandtest("downloadOriginal"))continue;var mask=list[i].mask;if(!method.original&&mask>0&&(photo.access.mask&mask)==mask)continue;
4399if(!method.original&&method.cx>width&&method.cy>height&&(!photo.video||method.code<zf_ProcessingMethod.Video480p.c
4399ode))continue;var text=null;var uri;var onclick;
4400if(method.original&&method.all){if(oncommandtest("downloadGallery")){text="All available originals";onclick=function(){oncommand("downloadGallery");};wasOriginal=true;
4401}else if(oncommandtest("downloadCollection")){text="All available originals";onclick=function(){oncommand("downloadCollection");};wasOriginal=true;}}else if(method.original){if(oncommandtest("downloadPhoto")){text=zf_stdFormatString("Original ({0} x {1})",
4402width,height);onclick=function(){oncommand("downloadPhoto");};wasOriginal=true;}}else if(method.video&&oncommandtest("downloadVideo")&&!saveImages&&photo.owner.id==zf_ownerId){var largest=zf_ProcessingMethod.Video360p;
4403if((photo.access.mask&zf_AccessMask.Protect480p)==0)largest=zf_ProcessingMethod.Video480p;if(zf_ProcessingMethod.Video720p.cx<=width&&zf_ProcessingMethod.Video720p.cy<=height&&(photo.access.mask&zf_AccessMask.Protect720p)==0)largest=zf_ProcessingMethod.Video720p;
4404if(zf_ProcessingMethod.Video1080p.cx<=width&&zf_ProcessingMethod.Video1080p.cy<=height&&(photo.access.mask&zf_AccessMask.Protect1080p)==0)largest=zf_ProcessingMethod.Video1080p;
4405var size2=photo.getScaledSize(largest);text=zf_stdFormatString(largest.format,size2.cx,size2.cy);if(photo.sizes&&photo.sizes[largest.code])text=text+", "+zf_stdFormatByteSize(photo.sizes[largest.code]);
4406uri=photo.getExternalUrl(largest)+"?dl=1";onclick=downloadHandler(uri);}else if(method.video&&oncommandtest("downloadVideo")&&!saveImages&&photo.owner.id!=zf_ownerId){text="Cannot download videos from another User";
4407onclick=function(){return false;};}else{if(saveImages&&method.format){var size=photo.getScaledSize(method);text=zf_stdFormatString(method.format,size.cx,size.cy);
4408if(photo.sizes&&photo.sizes[method.code])text=text+", "+zf_stdFormatByteSize(photo.sizes[method.code]);uri=photo.getExternalUrl(method)+"?dl=1";onclick=downloadHandler(uri);
4409}}if(!text)continue;if(wasOriginal&&!method.original){items.push({id:"separator",separator:true});wasOriginal=false;}items.push({id:"download_"+i,text:text,onclick:onclick});
4410}return items;};zfl_DownloadMenu.prototype._build=function(){;this.items=zfl_DownloadMenu.buildItems(this.current,this._saveImages,this.oncommand,this.oncommandtest);this._map={};
4411for(var i=0;i<this.items.length;i++){var item=this.items[i];this._map[item.id]=item;item.onselect=zf_stdFalse;}return zfl_PhotoMenu.prototype._build.call(this);};
4412;function zfl_DownloadMenu2(id,saveImages){zfl_Control.prototype.constructor.call(this,id);this._saveImages=saveImages==null||saveImages;this.$dom().detach().appendTo("body");
4413this._hoverover=function(){$(this).removeClass("buymenu-color1 buymenu-bgcolor1").addClass("buymenu-color2 buymenu-bgcolor2");};this._hoverout=function(){$(this).addClass("buymenu-color1 buymenu-bgcolor1").removeClass("buymenu-color2 buymenu-bgcolor2");
4414};}zfl_DownloadMenu2.inherits(zfl_Control);zfl_DownloadMenu2.prototype.show=function(x,y,origin,photo,oncommand,oncommandtest){if(this._showed)return;this._showed=true;if(zfl_Layout.currentMenu&&zfl_Layout.currentMenu!=this)zfl_Layout.currentMenu.remove();
4415zfl_Layout.currentMenu=this;var items=zfl_DownloadMenu.buildItems(photo,oncommandtest("saveImages",{download:this._saveImages}),oncommand,oncommandtest);var markup=[];
4416var i;for(i=0;i<items.length;i++){var item=items[i];if(item.id=="separator"){markup.push('<div class="menu-separator buymenu-border1"></div>');}else{markup.push('<a id="',
4417this.id,'-',item.id,'" href="#" ','   class="buymenu-color1 buymenu-color1 buymenu-bgcolor1">',zf_stdHtmlEncode(item.text),'</a>');}}this.$(".dlmenu-list").html(markup.join(""));
4418var self=this;var createHandler=function(item){return function(){self.remove();item.onclick();return false;};};for(i=0;i<items.length;i++){if(items[i].id=="separator")continue;
4419this.$dom(items[i].id).click(createHandler(items[i]));}this.$("a").hover(this._hoverover,this._hoverout);var css={};if(origin===true)origin={h:"right",v:"top"};else if(origin===false||origin===undefined)origin={h:"left",
4420v:"top"};if(origin.h=="left")css.left=x;else if(origin.h=="right")css.right=this.$dom().parent().width()-x;if(origin.v=="top")css.top=y;else if(origin.v=="bottom")css.bottom=this.$dom().parent().height()-y;
4421this.$dom().css(css).stop(true,true).slideDown(100);};zfl_DownloadMenu2.prototype.hide=function(){if(!this._showed)return;this._showed=false;var self=this;var reset=function(){if(zfl_Layout.currentMenu==self)zfl_Layout.currentMenu=null;
4422};
4422var slideUp=function(){$(this).stop(true,true).slideUp(200,reset).dequeue();};this.$dom().delay(400).queue(slideUp);};zfl_DownloadMenu2.prototype.remove=function(){if(zfl_Layout.currentMenu==this)zfl_Layout.currentMenu=null;
4423this.$dom().stop(true,true).hide();this._showed=false;};zfl_DownloadMenu2.prototype.getShowed=function(){return this._showed;};function zfl_ActionLinks(id,pinned,buymenu,dmenu,buttons,bottom){zfl_Control.prototype.constructor.call(this,
4424id);this._pinned=pinned;this._buymenu=buymenu;this._dmenu=dmenu;this._buttons=buttons;this._bottom=bottom;zf_stdMakeMethodsDeferred(this,this.id,["_showPhotoLinks"]);
4425var self=this;var ids;if(this._buymenu){ids=['#',this.id,' .action-addtocart,#',this._buymenu.id];if(this._buttons.buy)ids.push(',#',this._buttons.buy.id);ids=ids.join('');
4426$(ids).hover(this.closure(this._buy_onmouseover),this.closure(this._buy_onmouseout));this._buymenu.onaddtocart=function(options){self.command("addToCart",options);
4427};this._buymenu.oneditproduct=function(info){self.command("editProduct",info);};this._buymenu.onconfirmproduct=function(options){self.command("addToCart",options);
4428};this._buymenu.onaddtofav=function(purchase){self.command("addToFavorites",purchase);};}if(this._dmenu){var downloadExpanded=false;ids=["#",this.id," .action-download,#",
4429this._dmenu.id].join("");$(ids).hover(this.closure(this._download_onmouseover),this.closure(this._download_onmouseout));}this.$('.actions-all').click(function(){self.command("selectAll");
4430return false;});this.$('.actions-none').click(function(){self.command("selectNone");return false;});this.$('.actions-photos').click(function(){self.command("selectAllPhotos");
4431return false;});this.$('.actions-videos').click(function(){self.command("selectAllVideos");return false;});this.$dom('external').detach().appendTo('.actions-ehost');
4432}zfl_ActionLinks.inherits(zfl_Control);zfl_ActionLinks.prototype.show=function(animate,mode){if(this._pinned)return;var btns=this._buttons;var defButtons=[btns.buy,btns.download,btns.addToFavorites,
4433btns.createBook,btns.makeZookAlbum];var buyButtons=[btns.buySelected,btns.save,btns.createBook,btns.makeZookAlbum];var downloadButtons=[btns.downloadSelected];$.each(defButtons,
4434function(i,v){if(v)v.$dom().toggle(mode==null);});$.each(buyButtons,function(i,v){if(v)v.$dom().toggle(mode=='buy');});$.each(downloadButtons,function(i,v){if(v)v.$dom().toggle(mode=='download');
4435});if(animate){var self=this;this.$().clearQueue().queue(function(next){zf_stdDeferCall(null,self.recalc,self);next();}).slideDown(400,function(){self.$dom('external').show();
4436});}else{this.$().clearQueue().css({display:"block",height:"auto"});this.$dom('external').show();this.recalc();}};zfl_ActionLinks.prototype.hide=function(animate){if(this._pinned)return;
4437this.$dom('external').hide();if(animate){this.$().clearQueue().slideUp(400);}else{this.$().clearQueue().css({display:"none",height:"auto"});}};zfl_ActionLinks.prototype.update=function(photo,
4438context){;;if(this.current==photo)return;if(this.current!=null)this.current.unadvise(this);this.current=photo;this._showPhotoLinks(true);if(!photo.loaded){var self=this;
4439photo.advise(this,function(){self._showPhotoLinks();});}};zfl_ActionLinks.prototype.photoDisplayed=function(){this._showPhotoLinks();};zfl_ActionLinks.prototype._showPhotoLinks=function(delayed){var photo=this.current;
4440if(!photo)return;this.$().clearQueue('photo-links');if(delayed){var self=this;this.$().delay(500,'photo-links').queue('photo-links',function(next){self._showPhotoLinks(false);
4441next();});return;}var actions={addToFavorites:this.commandtest("addToFavorites"),removeFromFavorites:this.commandtest("removeFromFavorites"),selectAsYearbookPose:this.commandtest("selectAsYearbookPose"),
4442removeFromYearbookPose:this.commandtest("removeFromYearbookPose"),addToCart:this.commandtest("addToCart"),makeZookAlbum:this.commandtest("makeZookAlbum"),createBook:this.commandtest("createBook"),
4443download:this.commandtest("downloadOriginal")};this.enableActions(actions);};zfl_ActionLinks.prototype.recalc=function(){var width=this.$().width();var centered=this.$(".actions-center").length>0;
4444var hasSelect=this.$(".actions-select").length>0;if(centered&&hasSelect)this.$(".actions-inner").toggleClass("actions-squeezed",width<
4444580);};zfl_ActionLinks.prototype.enableActions=function(actions,
4445selectedTextRenderer){this.$dom("addtocart").toggleClass("none",!actions.addToCart);this.$dom("makezookalbum").toggleClass("none",!actions.makeZookAlbum);this.$dom("createbook").toggleClass("none",
4446!actions.createBook);this.$dom("addtofav").toggleClass("none",!actions.addToFavorites);this.$dom("removefromfav").toggleClass("none",!actions.removeFromFavorites);
4447var showSelectAsYearbookPose=actions.showSelectAsYearbookPose!==undefined?actions.showSelectAsYearbookPose:actions.selectAsYearbookPose;this.$dom("selectasyp").toggleClass("none",
4448!showSelectAsYearbookPose);this.$dom("removefromyp").toggleClass("none",!actions.removeFromYearbookPose);this.$dom('external').find('.button-selectAsYP').toggleClass("none",
4449!showSelectAsYearbookPose);this.$dom("download").toggleClass("none",!actions.download);var hasFavorites=!!actions.addToFavorites||!!actions.removeFromFavorites;var hasYearbook=!!showSelectAsYearbookPose||!!actions.removeFromYearbookPose;
4450this.$dom("sep-addtocart").toggle(!!actions.addToCart&&(!!actions.makeZookAlbum||!!actions.createBook||hasFavorites||hasYearbook||!!actions.download));this.$dom("sep-makezookalbum").toggle(!!actions.makeZookAlbum&&(hasFavorites||hasYearbook||!!actions.download));
4451this.$dom("sep-createbook").toggle(!!actions.createBook&&(hasFavorites||hasYearbook||!!actions.download));this.$dom("sep-addtofav").toggle(hasFavorites&&(hasYearbook||!!actions.download));
4452this.$dom("sep-selectasyp").toggle(hasYearbook&&!!actions.download);if(actions.selected===undefined)actions.selected=1;if(actions.printable===undefined){actions.printable=1;
4453actions.printableVideos=actions.printableImages=0;if(this.current&&this.current.video)actions.printableVideos=1;else actions.printableImages=1;}if(!selectedTextRenderer){var text=zf_stdFormatString("{0} of {1} selected",
4454actions.selected,actions.all);this.$dom("selected").text(text);}else{selectedTextRenderer(actions.selected,actions.all,this.$dom("selected"));}if(this._buymenu)this._buymenu.setCounts(actions.printableImages,
4455actions.printableVideos);var btns=this._buttons;if(btns.buy)btns.buy.toggleEnabled(actions.addToCart);if(btns.buySelected)btns.buySelected.toggleEnabled(actions.addToCart);
4456if(btns.save)btns.save.toggleEnabled(actions.addToCart);if(btns.download)btns.download.toggleEnabled(actions.download);if(btns.downloadSelected)btns.downloadSelected.toggleEnabled(actions.download);
4457if(btns.createBook)btns.createBook.toggleEnabled(actions.createBook);if(btns.makeZookAlbum)btns.makeZookAlbum.toggleEnabled(actions.makeZookAlbum);if(btns.selectAsYearbookPose){btns.selectAsYearbookPose.toggleEnabled(actions.selectAsYearbookPose);
4458}if(btns.removeFromYearbookPose){btns.selectAsYearbookPose.toggleEnabled(actions.removeFromYearbookPose);}if(btns.preorderImgSelect){btns.preorderImgSelect.toggleEnabled(actions.selected>0);
4459if(btns.done){btns.done.toggleEnabled(actions.selected>0);}}};zfl_ActionLinks.prototype._buy_onmouseover=function(){var $base=this.$(".action-addtocart");var align='left';if($base.length==0&&this._buttons.buy){$base=this._buttons.buy.$dom();
4460align='right';}var height=$base.outerHeight();var pos=$base.offset();var right=pos.left>zf_stdGetClientWidth()-300;var bottom=this._bottom;var x=right?pos.left+$base.outerWidth():pos.left;
4461var y=bottom?pos.top-2:pos.top+height+2;var origin={h:right?'right':'left',v:bottom?'bottom':'top'};this._buymenu.show(x,y,origin);return false;};zfl_ActionLinks.prototype._buy_onmouseout=function(){this._buymenu.hide();
4462};zfl_ActionLinks.prototype._download_onmouseover=function(){if(!this.current)return false;var pos=this.$(".action-download").offset();var offset=2;if(this._bottom){this._dmenu.show(pos.left,
4463pos.top-5,{h:'left',v:'bottom'},this.current,this.command,this.commandtest);}else{this._dmenu.show(pos.left,pos.top+this.$(".action-download").outerHeight()+offset,
4464{h:'left',v:'top'},this.current,this.command,this.commandtest);}this._dmenu.isExpanded=true;return false;};zfl_ActionLinks.prototype._download_onmouseout=function(){this._dmenu.hide();
4465this._dmenu.isExpanded=false;};;function zfl_MessageBox(id,args){zfl_Control.prototype.constructor.call(this,id);this._onbutton=args.onbutton;this._curtain=args.curtain;var self=this;
4466this.$(".mbox-btn").click(function(){self._button_onclick(this);return false;});if(args.postinit){args.postinit(this.$());}}zfl_MessageBox.inherits(zfl_Control);zfl_MessageBox._counter=0;zfl_MessageBox.show=function(args){;
4467var id="_zfl_MessageBox_"+zfl_MessageBox._counter++;var buttonLarge=args.smallButtons?'':'button-large';var buttons=$.map(args.buttons,function(label,index){return zfl_Button.createHtml(null,
4468label,[buttonLarge,"mbox-btn","mbox-btn-"+index]);});var classes="";if(args.classes)classes=args.classes;var styles="";if(args.width)styles=[' style="width:',args.width,
4469'px;"'].join('');var text1=args.text,text2=args.text2;if(args.encode!=false){text1=zf_stdHtmlEncode(text1);if(!!text2)text2=zf_stdHtmlEncode(text2);}var title='';
4470if(!!args.title)title=['<div class="title">',zf_stdHtmlEncode(args.title),'</div>'].join("");var html2='';if(!!args.text2)html2=['<div class="text">',text2,'</div>'].join("");
4471var markup=['<div class="mbox-outer ',classes,'"',styles,' id="',id,'">','<div class="mbox popup-border1 popup-color1 popup-bgcolor1">',title,'<div class="text">',
4472text1,'</div>',html2,'<div class="buttons">',buttons.join(""),'</div>','</div>','</div>'];if(args.curtain==undefined||args.curtain){zf_Curtain.show("light");args.curtain=true;
4473}var mbox=$(markup.join("")).appendTo("body");var customMobileMode=false;var top=Math.floor((zf_stdGetClientHeight()-mbox.outerHeight())/2)+$(document).scrollTop();
4474var left=Math.floor((zf_stdGetClientWidth(customMobileMode)-mbox.outerWidth())/2);mbox.css({top:top+"px",left:left+"px"});return new zfl_MessageBox(id,args);};zfl_MessageBox.prototype.hide=function(showCurtain){this.$().remove();
4475if(!showCurtain)zf_Curtain.hide();};zfl_MessageBox.prototype._button_onclick=function(button){;var matches=/mbox-btn-(\d+)/.exec(button.className);;
4475var index=parseInt(matches[1]);
4476if(!this._onbutton||this._onbutton(index,this.$())!=false)this.hide(!this._curtain);};zfl_MessageBox.showDownload=function(args){;var id="_zfl_MessageBox_"+zfl_MessageBox._counter++;
4477var buttonLarge=args.smallButtons?'':'button-large';var buttons=$.map(args.buttons,function(label,index){return zfl_Button.createHtml(null,label,[buttonLarge,"mbox-btn",
4478"mbox-btn-"+index]);});var classes="";if(args.classes)classes=args.classes;var styles="";if(args.width)styles=[' style="width:',args.width,'px;"'].join('');var text1=args.text,
4479text2=args.text2;if(args.encode!=false){text1=zf_stdHtmlEncode(text1);if(!!text2)text2=zf_stdHtmlEncode(text2);}var title='';if(!!args.title)title=['<div class="title">',
4480zf_stdHtmlEncode(args.title),'</div>'].join("");var html2='';if(!!args.text2)html2=['<div class="text">',text2,'</div>'].join("");var markup=['<div class="mbox-outer ',
4481classes,'"',styles,' id="',id,'">','<div class="mbox popup-border1 popup-color1 popup-bgcolor1">',title,'<div class="text">',text1,'</div>',html2,'<div class="buttons">',
4482buttons.join(""),'</div>','</div>','</div>'];if(args.curtain==undefined||args.curtain){zf_Curtain.show("light");args.curtain=true;}var mbox=$(markup.join("")).appendTo("body");
4483var customMobileMode=false;var top=Math.floor((zf_stdGetClientHeight()-mbox.outerHeight())/2)+$(document).scrollTop();var left=Math.floor((zf_stdGetClientWidth(customMobileMode)-mbox.outerWidth())/2);
4484mbox.css({top:top+"px",left:left+"px"});return new zfl_MessageBox(id,args);};;function zfl_SelectionPlugin(icon,duration,onClickHandler){this._callback=function(now,fx){var pos=-(4-Math.floor(now))*40;
4485$(this).css({backgroundPosition:pos+"px 0px"});};this._icon=icon==undefined?true:icon;this._duration=duration==undefined?true:duration;this._onClickHandler=onClickHandler;
4486}zfl_SelectionPlugin.prototype.getInnerContent=function(id,context){;;;return['<span class="pv-sl">','<span class="pv-sl-bg"></span>','<span class="pv-sl-cl"></span>','<span class="pv-sl-cb"></span>',
4487'<span class="pv-sl-zm"></span>','</span>'].join('');};zfl_SelectionPlugin.prototype.onCreateDom=function(view,outer,inner,context,isNew){;;;;if(!context.selection)return;$(view).addClass('pv-s-sl');
4488var $inner=$(inner);var $sel=$inner.find('.pv-sl:first');var aparams={duration:150,easing:"linear",step:this._callback,queue:false};$sel.find('.pv-sl-cb:first,.pv-sl-cl:first').hover(function(){$(this).parent().find('.pv-sl-cb:first').animate({animation:4},
4489aparams);},function(){$(this).parent().find('.pv-sl-cb:first').animate({animation:0},aparams);});var self=this;$sel.find('.pv-sl-cl:first,.pv-sl-cb:first').click(function(){return zfl_SelectionPlugin._onclick(context,
4490self._onClickHandler);});$sel.find('.pv-sl-zm:first').click(function(){return self._zoom_onclick(this,context);});};zfl_SelectionPlugin.prototype.onDestroyDom=function(view,outer,inner,
4491context){$(inner).find('.pv-sl SPAN').unbind();};zfl_SelectionPlugin.prototype.removeInnerContent=function(view,outer,inner,context){$(inner).find('.pv-sl').remove();$(view).removeClass('pv-s-sl');
4492};zfl_SelectionPlugin._onclick=function(context,clickHandler){var id=context.data.id;var selection=context.selection;var selected=!selection.selected(id);if(clickHandler&&!clickHandler(selection,
4493selected)){console.log('cancelled click');return false;}if(selected){context.grid.selectItem(context.index);selection.select(id);}else{context.grid.deselectItem(context.index);
4494selection.unselect(id);}$('#__SelectionPlugin_Preview[data-id="'+id+'"]').toggleClass('pvsp-selected',selected).delay(250).fadeOut(300,function(){$(this).remove();
4495$('#__SelectionPlugin_Preview-curtain').remove();});return false;};zfl_SelectionPlugin.prototype._zoom_onclick=function(element,context){var photo=context.data;var method=zf_ProcessingMethod.StandardSmallSize;
4496var size=photo.getScaledSize(method);if(photo.video)method=$.extend({},zf_ProcessingMethod.VideoPosterFrame,{cx:method.cx,cy:method.cy});var href=photo.getInternalUrl(method,
4497{block:true});var id="__SelectionPlugin_Preview";var $img=$(element).closest('.pv-inner').find('.pv-img');var tsize=photo.getScaledSize(context.method);var offset=$img.offset();
4498var top=offset.top-15;var left=offset.left-15;var selected=context.selection.selected(context.data.id);var selectionClickHandler=this._onClickHandler;var video='';
4499if(photo.video&&(this._duration||this._icon)){video=['<div class="pv-v">','<div class="pv-v-b"></div>'];if(this._icon)video.push('<div class="pv-v-i"></div>');if(this._duration)video.push('<div class="pv-v-d">',
4500zf_stdFormatDuration(photo.duration,true),'</div>');video.push('</div>');video=video.join('');}var markup=['<div id="',id,'-curtain" class="pvsp-curtain"></div>',
4501'<div id="',id,'" class="pvsp',selected?' pvsp-selected':'','" data-id="',context.data.id,'" ','style="width:',tsize.cx,'px;height:',tsize.cy,'px;top:',top,'px;left:',
4502left,'px">','<div class="pvsp-bg"></div>','<div class="pvsp-img pv-ready" style="background-image:url(',href,');">',video,'</div>','<div class="pvsp-cb">','<span class="pvsp-cb-text pvsp-cb-text-s">Select</span>',
4503'<span class="pvsp-cb-text pvsp-cb-text-u">Deselect</span>','</div>','<div class="pvsp-close"></div>','</div>'].join('');var sidp='#'+id;var sidc=sidp+'-curtain';
4504var sids=[sidp,sidc].join(',');$(sids).remove();$(document.body).append(markup);if(photo.video){var vplayer=new zf_VideoPlayerHelper();vplayer.requestVideoUrl(photo,
4505function(url){var $player=$('.pvsp-img.pv-ready');var parameters={autostart:true,hideControls:true};var videoPlayer=vplayer.createPlayerHtml(photo,url,parameters);
4506$player.append(videoPlayer);
4506vplayer.mobileBrowsersFixup($player,false,null,false,false);});}top=parseInt(offset.top+tsize.cy/2-size.cy/2-15-size.cy/8);left=parseInt(offset.left+tsize.cx/2-size.cx/2-15);
4507var $window=$(window);var scrollTop=$window.scrollTop(),scrollLeft=$window.scrollLeft();var windowWidth=$window.width(),windowHeight=$window.height();if(top<scrollTop)top=scrollTop;
4508else if(top+size.cy+70>windowHeight+scrollTop)top=windowHeight+scrollTop-size.cy-70;if(left<scrollLeft)left=scrollLeft;else if(left+size.cx+30>windowWidth+scrollLeft)left=windowWidth+scrollLeft-size.cx-30;
4509$(sidp).animate({width:size.cx,height:size.cy,top:top,left:left},100);$(sidp).find('.pvsp-close').click(function(){$(sids).remove();return false;});$(sidp).find('.pvsp-img').click(function(){$(sids).remove();
4510return false;});$(sidp).find('.pvsp-bg').click(function(){$(sids).remove();return false;});$(sidp).find('.pvsp-cb').click(function(){return zfl_SelectionPlugin._onclick(context,
4511selectionClickHandler);});$(sidc).one('click',function(e){$(sids).remove();return false;});zf_stdDisableRightClick($(sids));return false;};;function zf_MessageBoxPreview(id){zf_Control.prototype.constructor.call(this,
4512id);this._keydownHandler=this.closure(this._onKeyPress);$(document).bind('keydown',this._keydownHandler);var self=this;this.$(".fa.fa-times").click(function(){self.hide();
4513return false;});}zf_MessageBoxPreview.inherits(zf_Control);zf_MessageBoxPreview._counter=0;zf_MessageBoxPreview.show=function(args){;var id="_zf_MessageBoxPreview_"+zf_MessageBoxPreview._counter++;var classes="";if(args.classes)classes=args.classes;
4514var styles="";if(args.width)styles=[' style="width:',args.width,'px;"'].join('');var html='';if(!!args.html)html=args.html;var markup=['<div class="pc-pb2-mbox-preview-outer ',
4515classes,'"',styles,' id="',id,'">','<div class="pc-pb2-mbox-preview popup-border1 popup-color1 popup-bgcolor1">','<i class="fa fa-times" aria-hidden="true"></i>',
4516html,'</div>','</div>'];var mbox=$(markup.join("")).appendTo("body");if(args.curtain==undefined||args.curtain){zf_Curtain.show("light");var index=mbox.css("z-index");
4517if(index&&index>0){$("#dimmer").css("z-index",index-1);}}var customMobileMode=false;var top=Math.floor((zf_stdGetClientHeight()-mbox.outerHeight())/2)+$(document).scrollTop();
4518var left=Math.floor((zf_stdGetClientWidth(customMobileMode)-mbox.outerWidth())/2);mbox.css({top:top+"px",left:left+"px"});return new zf_MessageBoxPreview(id,args);
4519};zf_MessageBoxPreview.prototype._onKeyPress=function(e){e=zf_stdGetEvent(e);if(e.keyCode==27){this.hide();zf_stdStopPropagation(e);zf_stdPreventDefault(e);}};zf_MessageBoxPreview.prototype.hide=function(){if(this._keydownHandler){$(document).unbind('keydown',
4520this._keydownHandler);}this.$().remove();zf_Curtain.hide();};;var zf_PricingProducts={None:0,PhotoBooks:1};;function zf_cartGetId(){var cookie=zf_stdGetCookie("zf_7d_cart");if(cookie==null)return 0;
4521var index=cookie.indexOf('_');var id;if(index<0)id=cookie;else id=cookie.substring(index+1);id=id!=null?parseInt(id,10):0;return isNaN(id)?0:id;}function zf_cartSetId(cart){;
4522var expires=new Date();expires.setDate(expires.getDate()+7);zf_stdSetCookie("zf_7d_cart",cart.photographerId.toString()+'_'+cart.id.toString(),expires,true);}function zf_CartUtils(){}zf_CartUtils.popupLicense=function(vendorId,
4523licenseId,changeNumber){;;var url='/zf/cart/licenseViewPopup.aspx?vId='+vendorId+'&lId='+licenseId;if(changeNumber!=null)url+='&lcn='+changeNumber;window.open(url,
4524'zf_license','height=600,width=630',true);return false;};;function zfl_PhotoSetLayout(id,global,local){zfl_Layout.prototype.constructor.call(this,id,global,local);zfl_PhotoDownload.prototype.constructor.call(this,
4525global.isAmdEnabled,global.isSmdEnabled,global.maxSmdZipSize);var self=this;this._photoSet=zfl_stdTransformResponse(local.photoSet,"photoSet");this._printableImages=this._photoSet.printableImages;
4526this._printableVideos=this._photoSet.printableVideos;this._photoList=local.photoList;this._photoList.setDefaults(this._photoSet,this._photoSet.owner);this._photoList.onload=this.closure(this._photoList_onload);
4527this._wrapPhotoList(this._photoList);var callback=function(status,retVal){if(status==200||retVal.error==null){if(retVal.result!=""){window.location.href=retVal.result;
4528}}};
4528if(this._photoSet.images==0){zf_stdServerRequest("GET","/zf/layout/layout.asmx","IsArchiveGallery",[this._photoSet.id],callback);}this._controlBox=this._controls.add(local.controlBox);
4529var pager=local.pager;var grid=this._grids.photos;this.showAll=local.pager==null;this._grids.photosParams.onclick=function(context,e){if(Zenfolio.Global.QuickShopManager.isEnabled(context.data)){if(self.customizer){var photoPageUrl=$(e.currentTarget).find(".pv-inner").attr("href");
4530if(photoPageUrl){location.href=photoPageUrl;return false;}return true;}var returnData=self._getReturnData();returnData.photoKey=zf_PhotoKey.getString(context.data);
4531Zenfolio.Global.QuickShopManager.show({photoList:self._wrapPhotoList(self._photoList.recreate()),startIndex:context.index,photoSet:self._photoSet,forceSidebar:e&&e.forceSidebar,
4532quickShopParameters:self.quickShopParameters,analytics:local.analytics,returnData:returnData,getReturnPagesCallback:self.closure(self._getReturnPages)});}else if(local.isOpenDtl){zf_DimLightsStandalone(self._photoList,
4533context.index,{toolbar:local.showToolbar,scrapbook:self.scrapbook,yearbook:self.yearbook,ondownload:function(photo){self._downloadOriginal(photo);},onaddtofavorites:function(photo){var keys=[zf_PhotoKey.getString(photo)];
4534self.scrapbook.addPhotos(keys,false,null,self._getReturnPages(keys));},onremovefromfavorites:function(photo){self.scrapbook.removePhotos([zf_PhotoKey.getString(photo)]);
4535},onselectasyearbookpose:function(photo,refreshUICallback,doNotShowCurtain){self.yearbook.addPhoto(photo,null,refreshUICallback,doNotShowCurtain);},onremovefromyearbookpose:function(photo,
4536refreshUICallback,doNotShowCurtain){self.yearbook.removePhoto(photo,null,refreshUICallback,doNotShowCurtain);},onaddtocart:function(photo){var returnData=self._getReturnData();
4537returnData.photoKey=photo&&zf_PhotoKey.getString(photo);self.zenbar.addToCart({allPhotos:self._photoList,returnData:returnData})([photo]);},onmakezookalbum:!global.canMakeZookbindersAlbum?null:function(){zf_ZookbindersUtils.makeZookAlbumFromPhotoList(self.zenbar,
4538self._photoList,global.isGspAlbumFlow);},oncreatebook:!local.actions._buttons.createBook?null:function(photo){var returnData=self._getReturnData();returnData.photoKey=photo&&zf_PhotoKey.getString(photo);
4539self.zenbar.addToCart({allPhotos:self._photoList,categoryId:'photobooks-new',returnData:returnData})([photo]);},isToolbarLinks:local.isToolbarLinks,browserScaling:local.browserScaling,
4540photoSet:self._photoSet});}else{return true;}return false;};if(this._returnData&&(!grid||this._returnData.pageType!=zf_ReturnPageType.PhotoSetPage||this._returnData.photoSetId!=this._photoSet.id||!this._returnData.hasPhotoKeys())){this._returnData=null;
4541}if(grid&&pager){this._pager=pager;if(this._returnData){this.showAll=!!this._returnData.gridShowAll;}else{this.showAll=false;var cookie=zfl_SessionCookie.current;
4542if(cookie&&cookie.recentPhotoSetId==this._photoSet.id){this.showAll=cookie.showAll;}}this._setPagerMode(this.showAll?zf_Pager.All:zf_Pager.Paged);grid.onlayoutchange=function(info){pager.update(info.totalPages,
4543info.currentPage);};pager.onall=function(){self._setPagerMode(zf_Pager.All);self.recalc();};pager.onpaged=function(){self._setPagerMode(zf_Pager.Paged);self.recalc();
4544};pager.onchange=function(page){grid.setPage(page);grid.recalcLayout();};}if(grid){this._photoList.onshrink=function(){grid.setSize(self._photoList.length);return true;
4545};}if(local.controlBox){local.controlBox.onslide=function(id,index){self._registerSlideVisit(index);};local.controlBox.oneditproduct=this.closure(this._editProduct);
4546local.controlBox.setCounts(this._photoSet.printableImages,this._photoSet.printableVideos);}this.setupGuestbook(global,local);this._actions=this._controls.add(local.actions);
4547this._selectPlugin=null;if(local.quickPriceList){local.quickPriceList.init(this.zenbar);local.quickPriceList.addtocart=this.closure(this._addToCart);local.quickPriceList.onresize=this.closure(this.recalc);
4548}if(local.likeButton)local.likeButton.update(this._photoSet);if(local.tweetButton)local.tweetButton.update(this._photoSet);if(this.scrapbook)this.scrapbook.onchange=this.closure(this._scrapbook_onchange);
4549if(this.yearbook)this.yearbook.onchange=this.closure(this._yearbook_onchange);this.cyMinFooter=15;this._fakeVideoOriginals=local.fakeVideoOriginals;this.selecting=false;
4550}zfl_PhotoSetLayout.inherits(zfl_Layout,zfl_PhotoDownload);zfl_PhotoSetLayout.prototype.onrecalc=function(){if(Zenfolio.Global.QuickShopManager.isVisible())return;zfl_Layout.prototype.onrecalc.call(this);
4551if(this._pager&&this._grids.photos){var info=this._grids.photos.getLayoutInfo();this._pager.update(info.totalPages,info.currentPage);}if(this._actions)this._actions.recalc();
4552};zfl_PhotoSetLayout.prototype.loadSelection=function(){this._selection=zfl_PhotoSelection.load("photos",this._photoSet.id);this._selection.onchange=this.closure(this._selection_onchange);
4553};zfl_PhotoSetLayout.prototype.saveSelection=function(){zf_stdDeferCall(this.id+".selection",this._selection.save,this._selection,"photos");};zfl_PhotoSetLayout.prototype.onload=function(){this.loadSelection();
4554var photoList=this._photoList,grid=this._grids.photos;this.initGrid(grid,zfl_PhotoViewStyle.GalleryPhoto,this._grids.photosParams,function(index){return photoList.get(index);
4555},photoList.length,this._selection);
4555if(grid)$(window).bind('scroll',function(){Zenfolio.Global.QuickShopManager.isVisible()||grid.recalcLayout();});if(this._controlBox)this._controlBox.init(this._photoSet,
4556this._selection,this.zenbar);zfl_Layout.prototype.onload.call(this);};zfl_PhotoSetLayout.prototype._grid_onstretch=function(height,stretcher){var grid=this._grids.photos;if(this.showAll){grid.minRows=null;
4557grid.setHeight(-1);}else{grid.minRows=2;grid.setHeight(height);}stretcher.style.height="auto";stretcher.style.minHeight=height+"px";var info;var scrollY=-1;if(!this.__inited){var cookie=zfl_SessionCookie.current;
4558if(!this._returnData&&cookie&&cookie.recentPhotoSetId==this._photoSet.id&&cookie.recentPhotoIndex>=0&&cookie.recentPhotoIndex<this._photoList.length){info=grid.getLayoutInfo();
4559if(this.showAll){var rowHeight=info.height/info.rowsPerPage;var currentRow=cookie.recentPhotoIndex/info.itemsPerRow;var offset=rowHeight*currentRow;if(offset>zf_stdGetClientHeight()-100)scrollY=offset;
4560}else{info.currentPage=Math.floor(cookie.recentPhotoIndex/info.itemsPerPage);grid.setPage(info.currentPage);}info=null;}else{if(cookie)cookie.setRecent(this._photoSet.id,
45610);}this.__inited=true;}else{info=grid.getLayoutInfo(zf_PhotoGrid.KeepVisible);}grid.recalcLayout(info);if(scrollY>0)window.scrollTo(0,scrollY);return true;};zfl_PhotoSetLayout.prototype._setPagerMode=function(mode){if(!this._pager)return;
4562this.showAll=mode==zf_Pager.All;zfl_SessionCookie.current.setShowAll(this.showAll);this._pager.setMode(mode);};zfl_PhotoSetLayout.prototype._registerSlideVisit=function(photoIndex){var photo=this._photoList.get(photoIndex);
4563;if(photo.loaded){Zenfolio.Global.LayoutService.registerVisit(photo,this._photoSet);}else{var self=this;photo.advise({},function(){self._registerSlideVisit(photoIndex);
4564});}};zfl_PhotoSetLayout.prototype._selection_onchange=function(){this.saveSelection();var actions=this._updateActions();if(this._controlBox){if(!this._selection||this._selection.none())this._controlBox.setCounts(this._printableImages,
4565this._printableVideos);else this._controlBox.setCounts(actions.printableImages,actions.printableVideos);}};zfl_PhotoSetLayout.prototype._selectAll=function(photoType){if(!this._selection)return;
4566var self=this;var photoList=this._photoList;var grid=this._grids.photos;photoList.loadAll(function(){if(photoType!=undefined)self._selectNone();var ids=[];for(var i=0;
4567i<photoList.length;i++){var photo=photoList.get(i);if(photoType==undefined||(photoType==0&&!photo.video)||(photoType==1&&photo.video)){ids.push(photo.id);if(grid)grid.selectItem(i);
4568}}self._selection.select(ids);});};zfl_PhotoSetLayout.prototype._selectNone=function(){if(!this._selection)return;this._selection.unselect();if(this._grids.photos)this._grids.photos.deselectAll();
4569};zfl_PhotoSetLayout.prototype._addToFavorites=function(purchase,noconfirm){if(!this.scrapbook)return;var self=this;if(!noconfirm&&!purchase&&this._selection&&this._selection.none()){var text=this._isGallery()?"You are about to add all photos from the gallery to Favorites":"You are about to add all photos from the collection to Favorites";
4570var button=this._isGallery()?"Add the entire gallery":"Add the entire collection";zfl_MessageBox.show({text:text,buttons:["Cancel",button],onbutton:function(i){if(i==1)self._addToFavorites(purchase,
4571true);}});return;}var photoList=this._photoList;if(!this._selection||this._selection.none()){photoList.loadAll(function(){var keys=[];for(var i=0;i<photoList.length;
4572i++){var photo=photoList.get(i);keys.push(zf_PhotoKey.getString(photo));}self.scrapbook.addPhotos(keys,purchase,null,self._getReturnPages(keys));});}else{var selectedPhotos=this._selection.getPhotos(photoList);
4573var selectedKeys=$.map(selectedPhotos,function(p){return zf_PhotoKey.getString(p);});this.scrapbook.addPhotos(selectedKeys,purchase,function(){self._leaveSelection(true);
4574},this._getReturnPages(selectedKeys));}};zfl_PhotoSetLayout.prototype._getReturnPages=function(keys){if(this._isGallery()){return null;}return zf_ReturnData.getReturnPages(keys,zf_ReturnPageType.PhotoSetPage,
4575{photoSetId:this._photoSet.id,gridShowAll:!!this.showAll});};zfl_PhotoSetLayout.prototype._selectAsYearbookPose=function(){if(!this.yearbook){return;}var self=this;if(!!this._selection&&!this._selection.none()){var photoList=this._photoList;
4576var selectedId=this._selection.get()[0];var selectedPhoto=null;for(var i=0;i<photoList.length;i++){var photo=photoList.get(i);if(photo.id==selectedId){selectedPhoto=photo;
4577break;}}if(selectedPhoto){this.yearbook.addPhoto(selectedPhoto,null,function(){self._leaveSelection(true);});}}};zfl_PhotoSetLayout.prototype._getReturnData=function(){return $.extend(new zf_ReturnData(),
4578{pageType:zf_ReturnPageType.PhotoSetPage,gridShowAll:!!this.showAll,photoSetId:this._photoSet.id});};zfl_PhotoSetLayout.prototype._addToCart=function(options){if(!this.zenbar)return;
4579var self=this;options=options?options:{};if(!options.newProduct||this instanceof zfl_EventSearchLayout)options.allPhotos=this._photoList;if(!options.newProduct){options.fromSelection=this._selection!=null&&!this._selection.none();
4580options.startSelection=function(){self._enterSelection(true,'buy');};}options.returnData=this._getReturnData();var setPhotos=this.zenbar.addToCart(options);this._setCartPhotos(setPhotos,
4581false,false,options);};zfl_PhotoSetLayout.prototype._makeZookAlbum=function(isGspAlbumFlow){if(this.zenbar){var self=this;this._setCartPhotos(function(photos){self.zenbar.makeZookAlbum(photos,
4582isGspAlbumFlow);},!this._actions||!this._actions.$dom().is(':visible'),isGspAlbumFlow);}};zfl_PhotoSetLayout.prototype._createBook=function(options){if(!this.zenbar)return;var self=this;
4583options=options?options:{};options.categoryId="photobooks-new";this._addToCart(options);};zfl_PhotoSetLayout.prototype._confirmProduct=function(info){if(!this.zenbar)return;var confirmationScreen=this.zenbar.confirmProduct();
4584confirmationScreen(info);};zfl_PhotoSetLayout.prototype._editProduct=function(info){if(!this.zenbar)return;var setPhotos=this.zenbar.editProduct(info,{allPhotos:this._photoList});
4585this._setCartPhotos(setPhotos,false);};zfl_PhotoSetLayout.prototype._setCartPhotos=function(setPhotos,ignoreSelection,includeSibPhotoSets,options){var photoList=this._photoList;var photos=[];
4586var dereference=function(id){var index=photoList.find(id);return index==-1?null:photoList.get(index);};var printable=function(photo){return photo.priceKey!=""?photo:null;
4587};var addToCart=function(selectedPhotos){if(options&&options.returnData&&selectedPhotos&&selectedPhotos.length>0){options.returnData.photoKey=zf_PhotoKey.getString(selectedPhotos[selectedPhotos.length-1]);
4588}setPhotos(selectedPhotos);};if(!includeSibPhotoSets&&!ignoreSelection&&this._selection&&!this._selection.none()){var ids=this._selection.get();photos=$.map(ids,
4589dereference);if(photos.length<ids.length){photoList.loadAll(function(){photos=$.map(ids,dereference);addToCart($.map(photos,printable));});return;}addToCart($.map(photos,
4590printable));return;}photoList.loadAll(function(){for(var i=0;i<photoList.length;i++){var photo=photoList.get(i);;if(photo.priceKey!="")photos.push(photo);}addToCart(photos);
4591});};zfl_PhotoSetLayout.prototype._download=function(){if(!this._selection||this._selection.none()){var text=this._isGallery()?"You are about to download all photos from the gallery":"You are about to download all photos from the collection";
4592var button=this._isGallery()?"Download entire gallery":"Download entire collection";var self=this;zfl_MessageBox.show({text:text,buttons:["Cancel",button],onbutton:function(i){if(i==1)self._downloadOriginals(self._photoSet.title,
4593self._photoList,self._photoSet);}});return;}this._downloadOriginals(this._photoSet.title,this._selection.getPhotos(this._photoList),this._photoSet);};zfl_PhotoSetLayout.prototype._scrapbook_onchange=function(info,
4594edit){if(this.zenbar)this.zenbar.setScrapbookInfo(info,edit);if(!edit&&info&&info.addedCount!=undefined){var message=null;if(info.failedCount>0)message="An error has occurred while trying to add some photos to favorites.";
4595else if(info.notOwnedCount>0)message="Some photos could not be added to favorites because they are not owned by the photographer.";if(message)zfl_MessageBox.show({text:message,
4596buttons:["OK"]});}if(this._grids.photos){zfl_NewGridPlugin.updateIcons(this._grids.photos);zfl_AddToFavoritesPlugin.updateIcons(this._grids.photos);}};zfl_PhotoSetLayout.prototype._yearbook_onchange=function(yearbookPose){if(!yearbookPose){zfl_MessageBox.show({text:"Can\x27t update your yearbook pose.",
4597buttons:["OK"]});}if(this._grids.photos){zfl_NewGridPlugin.updateIcons(this._grids.photos);zfl_AddToYearbookPlugin.updateIcons(this._grids.photos);}};zfl_PhotoSetLayout.prototype._restoreReturnData=function(quickShopOptions,
4598photoList,returnToQuickShopOnly){;;;var self=this,returnToPhotoKey=this._returnData.returnToPhotoKey();var showQuickShop=function(){var quickShopPhotoIndex=photoList.find(self._returnData.quickShopPhotoId);
4599if(quickShopPhotoIndex>=0){var quickShopPhoto=photoList.get(quickShopPhotoIndex);if(Zenfolio.Global.QuickShopManager.isEnabled(quickShopPhoto)){var newReturnData=self._getReturnData();
4600newReturnData.photoKey=returnToPhotoKey;Zenfolio.Global.QuickShopManager.show($.extend({photoList:returnToQuickShopOnly?photoList:self._wrapPhotoList(photoList.recreate()),
4601startIndex:quickShopPhotoIndex,forceSidebar:self._returnData.forceQuickShopSidebar,quickShopParameters:self.quickShopParameters,returnData:newReturnData,getReturnPagesCallback:self.closure(self._getReturnPages)},
4602quickShopOptions));}}};if(returnToQuickShopOnly){showQuickShop();this._returnData=null;return;}var grid=this._grids.photos,selection=this._selection,returnToPhotoIndex=photoList.find(zf_PhotoKey.fromString(returnToPhotoKey).photoId);
4603if(returnToPhotoIndex<0){this._returnData=null;return;}if(!this._returnData.gridShowAll){var itemPage=grid.getItemPage(returnToPhotoIndex);if(itemPage!=grid.getPage()){grid.setPage(itemPage);
4604grid.recalcLayout();}}var photoView=grid.getPhotoView(returnToPhotoIndex);if(!photoView){this._returnData=null;return;}setTimeout(function(){$('HTML, BODY').scrollTop(photoView.$().offset().top);
4605if(self._returnData.hasAddToCartPhotoKeys()&&selection){self._enterSelection(false,'buy');self._selectNone();var idsToSelect=[];for(var i=0;i<self._returnData.addToCartPhotoKeys.length;
4606i++){var idToSelect=zf_PhotoKey.fromString(self._returnData.addToCartPhotoKeys[i]).p
4606hotoId,indexToSelect=photoList.find(idToSelect);if(indexToSelect>=0&&grid.selectItem(indexToSelect)){idsToSelect.push(idToSelect);
4607}}if(idsToSelect.length>0){selection.select(idsToSelect);self._addToCart();}}else if(self._returnData.showQuickShop()){showQuickShop();}self._returnData=null;},100);
4608};zfl_PhotoSetLayout.prototype._photoList_onload=function(first){;if(this._loadingForReturn){return;}this.recalc();var selection=this._selection;if(first){var self=this;if(this._returnData){var returnToQuickShopOnly=this._returnData.returnToQuickShopOnly(this._photoList);
4609if(returnToQuickShopOnly==null){this._returnData=null;return;}var photoList=returnToQuickShopOnly?this._wrapPhotoList(this._photoList.recreate()):this._photoList;
4610Zenfolio.Global.DomHelpers.toggleLoadingOverlay(true);this._loadingForReturn=true;photoList.loadAll(function(){self._loadingForReturn=false;if(!returnToQuickShopOnly){self.recalc();
4611}Zenfolio.Global.DomHelpers.toggleLoadingOverlay(false);self._restoreReturnData({photoSet:self._photoSet,analytics:self.analytics},photoList,returnToQuickShopOnly);
4612});}else if(selection){if(selection.none()){selection.__zfl_verified=true;this._updateActions(true);return;}this._photoList.loadAll(function(){selection.__zfl_verified=true;
4613var selected=selection.get();var missing=[];for(var i=0;i<selected.length;i++){if(self._photoList.find(selected[i])==-1)missing.push(selected[i]);}if(missing.length>0)selection.unselect(missing);
4614else self._selection_onchange();});}}};zfl_PhotoSetLayout.prototype._updateActions=function(first){if(!this._actions||!this._selection)return{};if(!this._selection.__zfl_verified)return{};
4615var actions;var photoList=this._photoList;var self=this;var showSelectAsYearbookPose=!!this.yearbook&&(!zf_userId&&!this.yearbook.current||!!zf_userId&&(zf_userId==zf_ownerId||!!this.yearbook.current));
4616if(this._selection.none()){actions={addToFavorites:true,selectAsYearbookPose:true,showSelectAsYearbookPose:showSelectAsYearbookPose,addToCart:true,download:true,
4617selected:0,all:this._photoList.length,printable:this._photoList.length,printableImages:this._printableImages,printableVideos:this._printableVideos,createBook:true,
4618makeZookAlbum:true};this._actions.enableActions(actions);return actions;}actions={addToFavorites:false,selectAsYearbookPose:false,showSelectAsYearbookPose:false,
4619addToCart:false,download:false,selected:0,all:this._photoList.length,printable:0,printableImages:0,printableVideos:0,createBook:false,makeZookAlbum:true};var selected=this._selection.get();
4620for(var i=0;i<selected.length;i++){var index=this._photoList.find(selected[i]);;if(index==-1)continue;var photo=this._photoList.get(index);;if(!photo.loaded)continue;
4621++actions.selected;actions.addToFavorites=actions.addToFavorites||!this._photoSet||photo.owner.id==this._photoSet.owner.id;actions.showSelectAsYearbookPose=actions.selectAsYearbookPose||showSelectAsYearbookPose;
4622actions.selectAsYearbookPose=actions.showSelectAsYearbookPose&&selected.length==1;if(photo.priceKey!=""){actions.addToCart=true;++actions.printable;if(photo.video)++actions.printableVideos;
4623else++actions.printableImages;}actions.createBook=actions.createBook||((photo.pricingProducts&zf_PricingProducts.PhotoBooks)==zf_PricingProducts.PhotoBooks);actions.download=actions.download||!photo.video&&(photo.access.mask&zf_AccessMask.ProtectOriginals)==0||photo.video&&this._fakeVideoOriginals;
4624}this._actions.enableActions(actions);if(first)this._enterSelection(false);return actions;};zfl_PhotoSetLayout.prototype._enterSelection=function(animate,mode){if(!this._actions)return;
4625this._actions.show(animate,mode);if(this._controlBox){if(animate)this.$('.selection-dimmable').clearQueue().animate({opacity:0}
4625,400);else this.$('.selection-dimmable').clearQueue().css({opacity:0});
4626this._controlBox.selectionEnabled(true);}if(!this._selectPlugin){var gridParams=this._grids.photosParams;this._selectPlugin=new zfl_SelectionPlugin(gridParams.vicon,
4627gridParams.vduration);this._grids.photos.addPlugin(this._selectPlugin);}};zfl_PhotoSetLayout.prototype._leaveSelection=function(animate){if(!this._actions)return;this._actions.hide(animate);
4628this._selectNone();if(this._controlBox){if(animate)this.$('.selection-dimmable').clearQueue().animate({opacity:1.0},400);else this.$('.selection-dimmable').clearQueue().css({opacity:1.0});
4629this._controlBox.selectionEnabled(false);}if(this._selectPlugin){this._grids.photos.removePlugin(this._selectPlugin);this._selectPlugin=null;}};zfl_PhotoSetLayout.prototype._checkSelection=function(command){var self=this;
4630var desc={};var gallery=this._isGallery();var mode=null;var images=this._photoSet.images>=0&&this._photoSet.videos==0;var videos=this._photoSet.images==0&&this._photoSet.videos>0;
4631if(command=="downloadOriginal"){if(this._selection&&!this._selection.none()){this._downloadOriginals(this._photoSet.title,this._selection.getPhotos(this._photoList),
4632this._photoSet);return;}desc.title="Download";desc.text=gallery?"You are about to download everything from the gallery":"You are about to download everything from the collection";
4633desc.button1=gallery?"Download entire gallery":"Download entire collection";desc.button2=images?"Select photos to download":videos?"Select videos to download":"Select items to download";
4634desc.callback=function(){self._downloadOriginals(self._photoSet.title,self._photoList,self._photoSet);};mode='download';}else if(command=="addToFavorites"){if(this._selection&&!this._selection.none()){this._addToFavorites(false,
4635true);return;}desc.title="Add to Favorites";desc.text=gallery?"You are about to add everything in the gallery to Favorites":"You are about to add everything in the collection to Favorites";
4636desc.button1=gallery?"Add the entire gallery":"Add the entire collection";desc.button2="Select photos to add";desc.callback=function(){self._addToFavorites(false,
4637true);};}else{;}var markup=['<div class="pc" id="',this.id,'-selection">','<div class="pc-bg"></div>','<div class="pc-frame pc-bgcolor1 pc-border1 pc-font1 pc-color1">',
4638'<div class="pc-hdr pc-bgcolor2 pc-font3 pc-color1 pc-border2">',zf_stdHtmlEncode(desc.title),'</div>','<a class="pc-hdr-close pc-font2" href="#">',zf_stdHtmlEncode('Close'),
4639'<span></span>','</a>','<div class="pc-body" style="height:400px">','<div class="pc-slidein pc-color1 pc-border2 pc-bgcolor1 pc-slidein-s" style="width:100%;height:100%;right:0px">',
4640'<div class="pc-selection-c" style="margin-top:-150px">','<h6 class="pc-font2">',zf_stdHtmlEncode(desc.text),'</h6>','<div class="pc-selection-l">','<a class="pc-button pc-font2 pc-selection-y button-color1 button-bgcolor1 button-border1" href="#">',
4641zf_stdHtmlEncode(desc.button1),'</a>','<a class="pc-button pc-font2 pc-selection-n button-color1 button-bgcolor1 button-border1" href="#">',zf_stdHtmlEncode(desc.button2),
4642'</a>','</div>','</div>','</div>','</div>','</div>'];var $popup=$(markup.join('')).appendTo(document.body);var $window=$(window);$popup.find('.pc-bg').height($window.height());
4643$popup.find('.pc-frame').css({width:600,height:400,left:($window.width()-600)/2,top:($window.height()-400)/2});var close=function(){$popup.remove();};$popup.find('.pc-hdr-close').click(function(){close();
4644return false;});$popup.find('.pc-selection-n').click(function(){close();self._enterSelection(true,mode);return false;});$popup.find('.pc-selection-y').click(function(){close();
4645desc.callback();return false;});$popup.find('A.pc-button').hover(function(){zfl_Button.onmouseover(this);},function(){zfl_Button.onmouseout(this);});$popup.show();
4646};zfl_PhotoSetLayout.prototype._isGallery=function(){return this._photoSet.type==zf_PhotoSet.Gallery;};zfl_PhotoSetLayout.prototype._wrapPhotoList=function(photoList){if(this._isGallery()){return photoList;
4647}return zf_ReturnData.wrapPhotoList(photoList,zf_ReturnPageType.PhotoSetPage,{photoSetId:this._photoSet.id,gridShowAll:!!this.showAll});};zfl_PhotoSetLayout.prototype.getCommands=function(){var desc={addToCart:{test:zf_stdTrue,
4648exec:function(id,options){this._addToCart(options);}},makeZookAlbum:{test:"addToCart",exec:function(id,isGspAlbumFlow){this._makeZookAlbum(isGspAlbumFlow);}},createBook:{test:"addToCart",
4649exec:function(id,options){this._createBook(options);}},editProduct:{test:zf_stdTrue,exec:function(id,info){this._editProduct(info);}},confirmProduct:{test:zf_stdTrue,
4650exec:function(id,info){this._confirmProduct(info);}},downloadOriginal:{exec:function(){this._checkSelection("downloadOriginal");}},downloadPhoto:{test:"downloadOriginal",
4651exec:"downloadOriginal"},downloadPhoto2:{test:"downloadOriginal",exec:"downloadOriginal"},downloadGallery:{test:function(){return this._isGallery();},exec:"downloadOriginal"},
4652downloadCollection:{test:function(){return this._photoSet.type==zf_PhotoSet.Collection;},exec:"downloadGallery"},addToFavorites:{exec:function(id,purchase){if(purchase)this._addToFavorites(true);
4653else this._checkSelection("addToFavorites");}},selectAsYearbookPose:{exec:function(){this._selectAsYearbookPose();}}
4653,selectAll:{exec:function(){this._selectAll();
4654}},selectAllPhotos:{exec:function(){this._selectAll(0);}},selectAllVideos:{exec:function(){this._selectAll(1);}},selectNone:{exec:function(){this._selectNone();}},
4655selectPhotos:{exec:function(id,enable,mode){if(enable)this._enterSelection(true,mode);else this._leaveSelection(true);}}};var parent=zfl_Layout.prototype.getCommands.call(this);
4656$.each(parent,function(k,v){if(!desc[k])desc[k]=v;});return desc;};;function zfl_PreorderPhotoSetLayout(id,global,local){this._preorderRequiredPhotos=global.preorderRequiredPhotos;
4657this._preorderId=global.preorderId;this._localStorageKey='preorder_'+this._preorderId+'.photos.selection';zfl_PhotoSetLayout.prototype.constructor.call(this,id,global,
4658local);this._grids.photosParams.onclick=function(context,e){return false;};}zfl_PreorderPhotoSetLayout.inherits(zfl_PhotoSetLayout);zfl_PreorderPhotoSetLayout.prototype.loadSelection=function(){this._selection=zfl_PhotoSelection.load(this._localStorageKey,
4659this._photoSet.id);this._selection.onchange=this.closure(this._selection_onchange);};zfl_PreorderPhotoSetLayout.prototype.saveSelection=function(){zf_stdDeferCall(this.id+".selection",this._selection.save,
4660this._selection,this._localStorageKey);};zfl_PreorderPhotoSetLayout.prototype.onload=function(){zfl_PhotoSetLayout.prototype.onload.call(this);var $actionsHeader=$('#actions-header');var actionsWidth=$actionsHeader.parent().width();
4661var bodyBgColor=$('body').css('backgroundColor');$(window).bind('scroll',function(){$actionsHeader.toggleClass('fixed-header',$(this).scrollTop()>200);if($(this).scrollTop()>200){$actionsHeader.css({width:actionsWidth+'px',
4662backgroundColor:bodyBgColor});}});this._enterSelection(false,'preorder');};zfl_PreorderPhotoSetLayout.prototype._addToPreorder=function(options){if(!this.zenbar)return;var self=this;options=options?options:{newProduct:true};
4663if(!options.newProduct||this instanceof zfl_EventSearchLayout)options.allPhotos=this._photoList;if(!options.newProduct){options.fromSelection=this._selection!=null&&!this._selection.none();
4664options.startSelection=function(){self._enterSelection(true,'buy');};}options.returnData=this._getReturnData();this._setPreorderPhotos(options);};zfl_PreorderPhotoSetLayout.prototype._setPreorderPhotos=function(options){var self=this;
4665var photoList=this._photoList;var photos=[];var dereference=function(id){var index=photoList.find(id);return index==-1?null:photoList.get(index);};if(this._selection&&!this._selection.none()){var ids=this._selection.get();
4666photos=$.map(ids,dereference);if(photos.length<ids.length){photoList.loadAll(function(){photos=$.map(ids,dereference);self._saveSelection(options,photos);});return;
4667}self._saveSelection(options,photos);return;}photoList.loadAll(function(){for(var i=0;i<photoList.length;i++){var photo=photoList.get(i);;photos.push(photo);}self._saveSelection(options,
4668photos);});};zfl_PreorderPhotoSetLayout.prototype._loadAllPhotos=function(photoList,callback){if(photoList){photoList.loadAll(function(){callback(photoList.getAll());});}else{callback([]);
4669}};zfl_PreorderPhotoSetLayout.prototype._saveSelection=function(zenbarOptions,photos){var self=this;Zenfolio.Global.DomHelpers.toggleLoadingOverlay(true);var callback=function(allPhotosArray){const returnPages={},
4670handlePhoto=function(photo,keys){const key=zf_PhotoKey.getString(photo);if(photo.returnPage){returnPages[key]=photo.returnPage;}keys.push(key);};const selectedPhotoKeys=[],
4671availablePhotoKeys=[];$.each(photos,function(_index,photo){return handlePhoto(photo,selectedPhotoKeys);});$.each(allPhotosArray,function(_index,photo){return handlePhoto(photo,
4672availablePhotoKeys);});const data={selectedPhotoKeys:selectedPhotoKeys,availablePhotoKeys:availablePhotoKeys,assignmentsReturnUrl:zenbarOptions.returnUrl||location.href,
4673returnData:zenbarOptions.returnData||null};zf_stdServerRequestEx("POST","/zf/core/preorderShopService.asmx","StartFlow",[data],function(result,error){if(error){Zenfolio.Global.DomHelpers.toggleLoadingOverlay(false);
4674}else{var token=result;var nextUrl='/shop/preorder'+self._preorderId+'/assignment?token='+token;location.href=nextUrl;}});};this._loadAllPhotos(this._photoList,callback);
4675};zfl_PreorderPhotoSetLayout.prototype._updateActions=function(first){if(!this._actions||!this._selection)return{};if(!this._selection.__zfl_verified)return{};var actions;var photoList=this._photoList;
4676var self=this;var selectionTextRenderer=function(selection,all,$dom){var text1="Choose up to "+self._preorderRequiredPhotos+" photos";var text2=selection+" of "+self._preorderRequiredPhotos+" selected";
4677$dom.html(zf_stdHtmlEncode(text1)+"&nbsp;&nbsp;|&nbsp;&nbsp;"+zf_stdHtmlEncode(text2));};if(this._selection.none()){actions={addToFavorites:false,selectAsYearbookPose:false,
4678showSelectAsYearbookPose:false,addToCart:false,download:false,selected:0,all:this._preorderRequiredPhotos,printable:this._photoList.length,printableImages:this._printableImages,
4679printableVideos:this._printableVideos,createBook:false,makeZookAlbum:false};this._actions.enableActions(actions,selectionTextRenderer);return actions;}actions={addToFavorites:false,
4680selectAsYearbookPose:false,showSelectAsYearbookPose:false,addToCart:false,download:false,selected:0,all:this._preorderRequiredPhotos,printable:0,printableImages:0,
4681printableVideos:0,createBook:false,makeZookAlbum:false};var selected=this._selection.get();for(var i=0;i<selected.length;i++){var index=this._photoList.find(selected[i]);
4682;if(index==-1)continue;var photo=this._photoList.get(index);;if(!photo.loaded)continue;++actions.selected;actions.addToFavorites=false;actions.showSelectAsYearbookPose=false;
4683actions.selectAsYearbookPose=false;}this._actions.enableActions(actions,selectionTextRenderer);if(first)this._enterSelection(false);return actions;};zfl_PreorderPhotoSetLayout.prototype._enterSelection=function(animate,
4684mode){var self=this;if(!mode){mode='preorder';}if(!this._actions)return;this._actions.show(animate,mode);if(this._controlBox){if(animate)this.$('.selection-dimmable').clearQueue().animate({opacity:0}
4684,
4685400);else this.$('.selection-dimmable').clearQueue().css({opacity:0});this._controlBox.selectionEnabled(true);}if(!this._selectPlugin){var clickHandler=function(selection,
4686selected){var selectionCount=0;if(typeof Object.keys==='function'){selectionCount=Object.keys(selection._selection).length;}else{for(i in selection._selection){selectionCount++;
4687}}if(!selected||selectionCount<self._preorderRequiredPhotos){return true;}var desc={};desc.title="Photo Selection";desc.text="You can't select more than "+self._preorderRequiredPhotos+" photos.";
4688desc.button1="Ok";var markup=['<div class="pc pos-dialog" id="',this.id,'-selection">','<div class="pc-bg"></div>','<div class="pc-frame pc-bgcolor1 pc-border1 pc-font1 pc-color1">',
4689'<div class="pc-hdr pc-bgcolor2 pc-font3 pc-color1 pc-border2">',zf_stdHtmlEncode(desc.title),'</div>','<div class="pc-body">','<div class="pc-selection-c">','<h6 class="pc-font2">',
4690zf_stdHtmlEncode(desc.text),'</h6>','<div class="pc-selection-l">','<a class="pc-button pc-font2 pc-selection-y button-color1 button-bgcolor1 button-border1" href="#">',
4691zf_stdHtmlEncode(desc.button1),'</a>','</div>','</div>','</div>','</div>'];var $popup=$(markup.join('')).appendTo(document.body);var $window=$(window);$popup.find('.pc-bg').height($window.height());
4692$popup.find('.pc-frame').css({width:350,height:220,left:($window.width()-350)/2,top:($window.height()-220)/2});var close=function(){$popup.remove();};$popup.find('.pc-hdr-close').click(function(){close();
4693return false;});$popup.find('.pc-selection-y').click(function(){close();return false;});$popup.find('A.pc-button').hover(function(){zfl_Button.onmouseover(this);
4694},function(){zfl_Button.onmouseout(this);});$popup.show();return false;};var gridParams=this._grids.photosParams;this._selectPlugin=new zfl_SelectionPlugin(gridParams.vicon,
4695gridParams.vduration,clickHandler);this._grids.photos.addPlugin(this._selectPlugin);}};zfl_PreorderPhotoSetLayout.prototype._checkSelection=function(command){var self=this;var desc={};var gallery=this._isGallery();
4696var mode=null;var images=this._photoSet.images>=0&&this._photoSet.videos==0;var videos=this._photoSet.images==0&&this._photoSet.videos>0;if(command=="preorderImgSelect"){if(this._selection&&!this._selection.none()){this._addToPreorder();
4697return;}}else{;}};zfl_PreorderPhotoSetLayout.prototype.getCommands=function(){var desc={preorderImgSelect:{test:zf_stdTrue,exec:function(id,options){this._checkSelection("preorderImgSelect");
4698}},selectAll:{exec:function(){this._selectAll();}},selectAllPhotos:{exec:function(){this._selectAll(0);}},selectAllVideos:{exec:function(){this._selectAll(1);}},
4699selectNone:{exec:function(){this._selectNone();}},selectPhotos:{exec:function(id,enable,mode){if(enable)this._enterSelection(true,mode);else{this._selectNone();}}}};
4700var parent=zfl_Layout.prototype.getCommands.call(this);$.each(parent,function(k,v){if(!desc[k])desc[k]=v;});return desc;};;function zfl_QuickPriceList(id,isPhoto,priceKey,
4701images,videos){zfl_Control.prototype.constructor.call(this,id);this._popup=new Zenfolio.Global.QuickPriceListPopup(this.dom('popup').id);this.$('.qpl-template').hover(function(){$(this).addClass('qpl-product-hover qpl-bgcolor2');
4702},function(){$(this).removeClass('qpl-product-hover qpl-bgcolor2');}).click(this.closure(this._product_onclick)).find('.qpl-product-name').hover(function(){$(this).addClass('qpl-color2').removeClass('qpl-color1');
4703},function(){$(this).addClass('qpl-color1').removeClass('qpl-color2');});this._priceKey=priceKey;this._isPhoto=isPhoto;this._images=images;this._videos=videos;this._impressionsToSend=[];
4704this._sentImpressions={};}zfl_QuickPriceList.inherits(zfl_Control);zfl_QuickPriceList.prototype.init=function(zenbar){var self=this;zenbar.$dom().bind("zfl_cartchange",function(){var cart=zenbar.cart;
4705if(self._rawPriceList&&cart.currency&&self._rawPriceList.currency.code!=cart.currency.code){self._loadAndRender(self._priceKey,cart.currency);}});var bin=zf_Control.find(this.$('.bin:first')[0].id);
4706bin.setTitleSuffix(['<span class="qpl-header-right">','<a id="',this.id,'-currencies" class="qpl-color4"><span class="qpl-currency"></span><span class="ddown-font1">&#9660;</span></a> ',
4707'</span>'].join(''));this.$('.qpl-addtocart').click(function(){self._addToCart();});$(this.dom('currencies')).click(this.closure(this._currencies_onclick));if(!this._isPhoto&&this._priceKey)this._loadAndRender(this._priceKey);
4708};zfl_QuickPriceList.prototype.update=function(photo){if(this.current)this.current.unadvise(this);this.current=photo;var self=this;var onPhotoLoaded=function(){self._loadAndRender(new zf_PriceKey(photo),
4709zf_zenbar.cart.currency);};if(photo.loaded)onPhotoLoaded();else photo.advise(this,onPhotoLoaded);};zfl_QuickPriceList.prototype._canIncludeImagesOrVideos=function(){var includeImages=false,
4710includeVideos=false;if(!this._isPhoto){includeImages=this._images>0;includeVideos=this._videos>0;}else if(this.current&&this.current.loaded){includeImages=!this.current.video;
4711includeVideos=this.current.video;}return{images:includeImages,videos:includeVideos};};zfl_QuickPriceList.prototype._loadAndRender=function(priceKey,currency){;this._priceKey=priceKey;
4712var self=this,canInclude=this._canIncludeImagesOrVideos();if(priceKey.pricingKey==''||(!canInclude.images&&!canInclude.videos)){$(this.dom()).removeClass('qpl-loading').addClass('qpl-nopricing');
4713this.notifyResize(true);return;}$(this.dom()).removeClass('qpl-nopricing').addClass('qpl-loading');zfl_QuickPriceList.loadFeatured(currency,function(){return self._priceKey;
4714},function(pricing){self._renderPricing(pricing,canInclude);});};zfl_QuickPriceList.prototype._renderPricing=function(pricelist,canInclude){this._rawPriceList=pricelist;$(this.dom()).removeClass('qpl-loading');
4715var self=this,anyPrintable=false,$template=this.$('.qpl-template'),$container=this.$('.qpl-products').empty(),index=0;pricelist=zfl_QuickPriceList.enumerateItems(zfl_QuickPriceList.getFeaturedProductsList(pricelist),
4716this.current,canInclude.images,canInclude.videos,function(item){if(item.showSeparator){$container.append('<div class="qpl-separator">&nbsp;</div>');}var $row=$template.clone(true).removeClass('qpl-template');
4717$row.find('.qpl-product-price').text(zf_stdFormatMoney(Zenfolio.Global.ProductBrowserService.getDefaultProductPrice(item.product)));$row.find('.qpl-product-name').text(item.product.meta().name);
4718$row.data('zf-product',item.product);$row.data('zf-index',index++);$container.append($row);anyPrintable=true;});this._currency=pricelist.currency;this.$('.qpl-currency').text(pricelist.currency.shortName);
4719$(this.dom()).toggleClass('qpl-empty',!anyPrintable);this.notifyResize(false);this._refreshImpressions(false);$(window).unbind('scroll.quickPriceList').bind('scroll.quickPriceList',
4720function(){self._refreshImpressions(true);});};zfl_QuickPriceList.prototype._product_onclick=function(e){var self=this,$row=$(e.currentTarget).closest('.qpl-product'),product=$row.data('zf-product'),
4721index=$row.data('zf-index');Zenfolio.Global.EcommerceManager.instanse.setCurrency(this._currency);Zenfolio.Global.EcommerceManager.instanse.addQuickShopProductsProduct(product,
4722this._currency,index+1);Zenfolio.Global.EcommerceManager.instanse.quickShopProductsClick(function(){self._addToCart({vendorId:product.vendor.id,productId:product.id,
4723ecommerceList:Zenfolio.Global.ProductList.QuickShopProducts});});};zfl_QuickPriceList.prototype._currencies_onclick=function(e){var self=this;this._popup.show(e.currentTarget,this._rawPriceList,
4724this._currency,function(loadAndRender,currency){if(loadAndRender){self._loadAndRender(self._priceKey,currency);}else{self._renderPricing(self._rawPriceList,self._canIncludeImagesOrVideos());
4725}});};zfl_QuickPriceList.prototype._addToCart=function(product){zfl_QuickPriceList.updateGlobalSettings(this._rawPriceList,this._currency);this.addtocart(product);};zfl_QuickPriceList.prototype._refreshImpressions=function(async){var self=this;
4726this.$('.qpl-product').each(function(){var $row=$(this),product=$row.data('zf-product');if(!product){return;}var index=$row.data('zf-index'),uniqueId=product.vendor.id+'_'+product.id;
4727if(self._sentImpressions[uniqueId]){return;}if(!Zenfolio.Global.DomHelpers.isElementInView($row,$(window),false)){return;}self._sentImpressions[uniqueId]=true;self._impressionsToSend.push({product:product,
4728index:index});});if(this._impressionsTimeout){clearTimeout(this._impressionsTimeout);this._impressionsTimeout=null;}if(this._impressionsToSend.length<=0){return;
4729}var sendImpressions=function(){self._impressionsTimeout=null;Zenfolio.Global.EcommerceManager.instanse.executeBatch(self._impressionsToSend,function(){Zenfolio.Global.EcommerceManager.instanse.setCurrency(self._currency);
4730},function(impression){Zenfolio.Global.EcommerceManager.instanse.addQuickShopProductsImpression(impression.product,self._currency,impression.index+1);},function(callback){Zenfolio.Global.EcommerceManager.instanse.quickShopProductsView(callback);
4731});};if(async){this._impressionsTimeout=setTimeout(sendImpressions,Zenfolio.Global.EcommerceManager.scrollTimeout);}else{sendImpressions();}};zfl_QuickPriceList.getDefaultCurrency=function(currency){if(zf_zenbar.cart.size==0){if(currency==null){var currencyCode=Zenfolio.Global.ConfiguratorService.getCurrencyCode();
4732if(currencyCode!=null){currency=zf_CurrencyInfo.all[currencyCode];}}if(currency!=null){zf_zenbar.cart.currency=currency;}}else{currency=zf_zenbar.cart.currency;}return currency;
4733};zfl_QuickPriceList.loadFeatured=function(currency,getPriceKey,onComplete,onError){currency=zfl_QuickPriceList.getDefaultCurrency(currency);var requestedPriceKey=getPriceKey(),requestIsRelevant=function(){var currentPriceKey=getPriceKey();
4734if(currentPriceKey&&currentPriceKey.equals(requestedPriceKey)){if(!zf_zenbar.cart.currency||(currency&&zf_zenbar.cart.currency.code==currency.code)){return true;
4735}}return false;};zf_PriceList.loadFeatured(requestedPriceKey,currency,function(cacheKey,pricing){requestIsRelevant()&&onComplete(pricing,cacheKey);},function(error){requestIsRelevant()&&onError&&onError(error);
4736});};zfl_QuickPriceList.getFeaturedProductsList=function(priceList){var shippingZone=Zenfolio.Global.ConfiguratorService.getShippingZone(priceList);var currencyCode=Zenfolio.Global.ConfiguratorService.getCurrencyCode();
4737priceList=priceList.filter(Zenfolio.Global.ConfiguratorService.createShippingZoneFilter(shippingZone));var products=[];if(currencyCode=="CAD"||(currencyCode=="USD"&&shippingZone.code!="US")){var filteredProducts=priceList.root.products;
4738var filteredPackages=priceList.root.packages;var vendors_1=["mpix","mpixpro","millers-sse","millers-wp"];filteredProducts=filteredProducts.filter(function(p){if(vendors_1.indexOf(p.vendorId)==-1){return p;
4739}else return null;});filteredPackages=filteredPackages.filter(function(pkg){var products=Object.keys(pkg.products).map(function(key){return pkg.products[key];});
4740var isValidaPackage=true;for(var _i=0,products_1=products;_i<products_1.length;_i++){var prod=products_1[_i];if(vendors_1.indexOf(prod.vendorId)!=-1){isValidaPackage=false;
4741break;}}return isValidaPackage==true?pkg:null;});products=products.concat(filteredProducts).concat(filteredPackages);}else{products=products.concat(priceList.root.products).concat(priceList.root.packages);
4742}var sortWeights=priceList.getWeights(zf_PricingSortWeight.Type.FeaturedProduct);if($.isEmptyObject(sortWeights)){sortWeights=priceList.getWeights(zf_PricingSortWeight.Type.Product);
4743}products.sort(priceList.getProductComparer(null,sortWeights));return{priceList:priceList,sortWeights:sortWeights,products:products};};zfl_QuickPriceList.enumerateItems=function(featuredProductsList,
4744photo,canIncludeImages,canIncludeVideos,callback){var lastWeight=0;for(var i=0;i<featuredProductsList.products.length;i++){var product=featuredProductsList.products[i];
4745if((canIncludeImages&&(product.sourceTypes==undefined||product.sourceTypes&zf_SourceType.Image))||(canIncludeVideos&&(product.sourceTypes&zf_SourceType.Video))){if(photo&&!Zenfolio.Global.ConfiguratorService.isPhotoPrintable(product,
4746photo,false)){continue;}var weight=featuredProductsList.sortWeights[zf_PricingSortWeight.getProductKey(null,product)];if(weight==null){weight=lastWeight;}callback({showSeparator:weight-lastWeight>100,
4747product:product,index:i});lastWeight=weight;}}return featuredProductsList.priceList;};zfl_QuickPriceList.updateGlobalSettings=function(priceList,currency){;;var shippingZone=Zenfolio.Global.ConfiguratorService.getShippingZone(priceList);
4748Zenfolio.Global.ConfiguratorService.setShippingZone(shippingZone);Zenfolio.Global.ConfiguratorService.setCurrencyCode(currency.code);};;var __extends=(this&&this.__extends)||(function(){var extendStatics=Object.setPrototypeOf||({__proto__:[]}instanceof Array&&function(d,
4749b){d.__proto__=b;})||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p];};return function(d,b){extendStatics(d,b);function __(){this.constructor=d;}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,
4750new __());};})();var Zenfolio;(function(Zenfolio){var Global;(function(Global){var QuickPriceListPopup=(function(_super){__extends(QuickPriceListPopup,_super);function QuickPriceListPopup(id){return _super.call(this,
4751id)||this;}QuickPriceListPopup.prototype.show=function(domOrigin,priceList,currentCurrency,callback){var _this=this;;;;;if(this.$().is(":visible")){return;}var currencies=[priceList.currency].concat(priceList.alternateCurrencies);
4752var shippingZone=Global.ConfiguratorService.getShippingZone(priceList);shippingZone.sortByPreference(currencies);var $container=this.$(".qpl-popup-currencies").empty();
4753for(var _i=0,currencies_1=currencies;_i<currencies_1.length;_i++){var currency=currencies_1[_i];$container.append(this._setItemClass($("<a data-code=\""+currency.code+"\" class=\"qpl-popup-currency\">"+currency.shortName+"</a>"),
4754currency.code==currentCurrency.code));}var isCartEmpty=zf_zenbar.cart.size==0;this.$(".qpl-popup-section-currency").toggle(isCartEmpty&&priceList.alternateCurrencies.length>0);
4755this.$(".qpl-popup-shipzone").each(function(_index,element){var $element=$(element),zone=zf_ShippingZone.all[$element.attr("data-shipzone")];_this._setItemClass($element,
4756zone===shippingZone).toggle(Global.ProductBrowserService.isShippingZoneVisible(priceList,zone));});this.$(".qpl-popup-section-units").toggle(priceList.categories["root"]!=null);
4757this.$(".qpl-popup-unit").each(function(_index,element){var $element=$(element);_this._setItemClass($element,$element.attr("data-unit")==zf_unit);});this.$(".qpl-popup-shipzone, .qpl-popup-currency, .qpl-popup-unit").unbind("click").bind("click",
4758function(e){_this._setItemClass(_this._setItemClass($(e.currentTarget),true).siblings(),false);return false;});this.$(".qpl-popup-btn-ok").unbind("click").bind("click",
4759function(){_this.hide();var szCode=_this.$(".qpl-popup-shipzone.selected").attr("data-shipzone");var currencyCode=_this.$(".qpl-popup-currency.selected").attr("data-code");
4760var newUnits=_this.$(".qpl-popup-unit.selected").attr("data-unit");if(szCode!=shippingZone.code){Global.ConfiguratorService.setShippingZone(szCode);}var differentUnits=false;
4761if(newUnits&&newUnits!=zf_unit){zfp_Configurator.setUnit(newUnits);differentUnits=true;}var currency=zf_CurrencyInfo.all[currencyCode];if(isCartEmpty){Global.ConfiguratorService.setCurrencyCode(currency.code);
4762}if(isCartEmpty&&currencyCode!=priceList.currency.code||differentUnits){callback(true,currency);}else{callback(false,currency);}return false;});this._setupArrow(domOrigin);
4763this._unbindEvents();this.$().detach().appendTo(domOrigin).show();$(document).bind("mousedown.qplPopup touchstart.qplPopup",function(e){var $target=$(e.target);if($target.closest(".qpl-popup").length<=0&&$target.closest(domOrigin).length<=0){_this.hide();
4764}});};QuickPriceListPopup.prototype.hide=function(){this._unbindEvents();this.$().detach().appendTo($("BODY")).hide();};QuickPriceListPopup.prototype._setItemClass=function($item,
4765isSelected){var $link=$item.toggleClass("selected",isSelected).add($item.children()).filter("A").toggleClass("buymenu-color1 buymenu-bgcolor1",!isSelected).toggleClass("buymenu-color2 buymenu-bgcolor2",
4766isSelected);if($link.find(".qpl-popup-icon").length<=0){$link.prepend('<span class="qpl-popup-icon"></span>');}return $item;};QuickPriceListPopup.prototype._setupArrow=function(domOrigin){var $popup=this.$(),
4767borderWidth=zf_stdExtractPixels($popup.css("border-top-width")),borderTopRightRadius=zf_stdExtractPixels($popup.css("border-top-right-radius")),showArrow=$popup.css("border-top-style")=="solid"&&borderWidth>0&&borderTopRightRadius<=24;
4768$popup.toggleClass("qpl-popup-with-arrow",showArrow);if(!showArrow){return;}var $linkChildren=$(domOrigin).children();;var $linkCurrency=$linkChildren.eq(0),$linkArrow=$linkChildren.eq(1),
4769$innerArrow=$popup.find(".qpl-popup-arrow-inner"),$outerArrow=$popup.find(".qpl-popup-arrow-outer"),arrowSize=zf_stdExtractPixels($innerArrow.css("border-top-width")),
4770arrowOffset=Math.floor($linkArrow.width()-zf_stdExtractPixels($popup.css("right"))+zf_stdExtractPixels($linkCurrency.css("margin-right"))+($linkCurrency.width()/2))+arrowSize;
4771$innerArrow.css({"margin-left":(-arrowOffset)+"px","border-bottom-color":$popup.css("background-color")});$outerArrow.css({"border-width":(arrowSize+borderWidth)+"px",
4772"margin-left":(-arrowOffset-borderWidth)+"px","border-bottom-color":$popup.css("border-top-color")});};QuickPriceListPopup.prototype._unbindEvents=function(){$(document).unbind(".qplPopup");
4773};return QuickPriceListPopup;}(zfl_Control));Global.QuickPriceListPopup=QuickPriceListPopup;})(Global=Zenfolio.Global||(Zenfolio.Global={}));})(Zenfolio||(Zenfolio={}));
4774;;;function zfl_Copyright(id,field,format){zfl_Control.prototype.constructor.call(this,id);zf_stdMakeMethodsDeferred(this,this.id,["set"]);}zfl_Copyright.inherits(zfl_Control);zfl_Copyright.prototype.set=function(text,
4775loading){if(!loading)this.visibility(text!="");var label=this.dom("label");zf_stdReplaceClassName(label,loading?null:"copyright-loading",loading?"copyright-loading":null);
4776zf_stdSetText(label,text);};zfl_Copyright.prototype.showLoading=function(){this.set("Loading...",true);};zfl_Copyright.prototype.update=function(photo){;;if(this.current==photo)return;if(this.current!=null)this.current.unadvise(this);
4777if(photo.loaded){this.set(photo.getCopyright());}else{var self=this;photo.advise(this,function(){self.set(photo.getCopyright());self.notifyResize(true);},function(){self.showLoading();
4778self.notifyResize(true);});}this.current=photo;};zfl_Copyright.prototype.login=function(verb){var href=null;if(this.current&&this.current.loaded)href=this.current.getHref("full");
4779zfl_Header.login(href,verb);};zfl_Copyright.prototype.logout=function(){var href;if(this.current&&this.current.loaded)href=this.current.getHref("full");else href=location.href;
4780location.href=zf_stdGetLogoutUrl(href);};;;function zfl_Caption(id,showTitle,showCaption){zfl_Control.prototype.constructor.call(this,id);this._showGallery=this.dom("gallery")!=null;
4781this._showTitle=showTitle;this._showCaption=showCaption;zf_stdMakeMethodsDeferred(this,this.id,["setTitle","setCaption","setGallery","setDisplay","_updateClasses"]);
4782}zfl_Caption.inherits(zfl_Control);zfl_Caption.prototype.setTitle=function(text,loading){var label=this.dom("title");if(!loading)label.style.display=text.length>0?"block":"none";zf_stdReplaceClassName(label,
4783loading?null:"title-loading",loading?"title-loading":null);zf_stdSetText(label,text);};zfl_Caption.prototype.setCaption=function(html,loading){var label=this.dom("caption");
4784if(loading)html="Loading...";label.style.display=html.length>0?"block":"none";if(html.length>0){zf_stdReplaceClassName(label,loading?null:"caption-loading",loading?"caption-loading":null);
4785}label.innerHTML=html;};zfl_Caption.prototype.setGallery=function(gallery,loading){var label=this.dom("gallery");if(label==null)return;label.style.visibility=!loading?"inherit":"hidden";
4786if(gallery==null||loading)return;label=label.getElementsByTagName("A")[0];label.href=zf_stdGetTransferUrl(this.current.getHref("gallery"));zf_stdSetText(label,this.current.gallery.title);
4787};zfl_Caption.prototype.showLoading=function(){this.setTitle("Loading...",true);this.setCaption(null,true);this.setGallery(null,true);};zfl_Caption.prototype.update=function(photo){;;
4788if(this.current==photo)return;if(this.current!=null)this.current.unadvise(this);if(this.currentMeta!=null)this.currentMeta.unadvise(this);this.current=photo;this.currentMeta=null;
4789if(photo.loaded){this.set(photo);}else{var self=this;photo.advise(this,function(){self.set(photo);self.notifyResize(true);},function(){self.showLoading();self.notifyResize(true);
4790});}};zfl_Caption.prototype.set=function(photo){;var hasTitle=this._showTitle&&photo.title.length>0;var hasCaption=this._showCaption&&(photo.flags&zf_PhotoFlags.HasCaption)!=0;
4791if(!hasTitle&&!hasCaption&&!this._showGallery){this.setDisplay(false);this.setTitle("");this.setCaption("");return;}this.setTitle(this._showTitle?photo.title:"");
4792if(this._showGallery)this.setGallery(photo.gallery);if(hasCaption){var meta=photo.getMeta();this.currentMeta=meta;if(meta.loaded){this.setCaption(meta.caption);}else{this.setCaption(null,
4793true);var self=this;meta.bump();meta.advise(this,function(){self.setCaption(meta.caption);self.notifyResize(true);},function(){self.setCaption(null,true);self.notifyResize(true);
4794});}}else{this.setCaption("");}this._updateClasses(hasTitle,hasCaption);this.setDisplay(true);};zfl_Caption.prototype.setDisplay=function(show){this.display(show);};zfl_Caption.prototype._updateClasses=function(hasTitle,
4795hasCaption){var prefixes=["captionbox-wide","captionbox-regular"];var suffix;if(hasTitle&&hasCaption)suffix={add:"-tc",remove:["-t","-c","-g"]};else if(hasTitle)suffix={add:"-t",
4796remove:["-tc","-c","-g"]};else if(hasCaption)suffix={add:"-c",remove:["-tc","-t","-g"]};else suffix={add:"-g",remove:["-tc","-c","-t"]};var dom=this.dom();for(var i=0;
4797i<prefixes.length;i++){if(!zf_stdHasClassName(dom,prefixes[i]))continue;zf_stdReplaceClassName(dom,prefixes[i]+suffix.remove[0],prefixes[i]+suffix.add);for(var j=1;
4798j<suffix.remove.length;j++)zf_stdReplaceClassName(dom,prefixes[i]+suffix.remove[j],null);break;}};;;function zfl_ShortExif(id,compact){zfl_Control.prototype.constructor.call(this,
4799id);this._compact=compact;zf_stdMakeMethodsDeferred(this,this.id,["set","showLoading"]);}zfl_ShortExif.inherits(zfl_Control);zfl_ShortExif.prototype.set=function(meta){this.$dom("loading").addClass("none");
4800var html=this._generateHTML(meta);if(html.length==0){this.$dom("content").addClass("none");this.$dom("notavailable").removeClass("none");return;}this.$dom("text").html(html);
4801this.$dom("content").removeClass("none");this.$dom("notavailable").addClass("none");};zfl_ShortExif.prototype.showLoading=function(){this.$dom("loading").removeClass("none");
4802this.$dom("content").addClass("none");this.$dom("notavailable").addClass("none");};zfl_ShortExif.prototype.update=function(photo){;;var meta=photo.getMeta();if(this.current==meta)return;
4803if(this.current!=null)this.current.unadvise(this);this.current=meta;if(meta.loaded){this.set(meta);}else{var self=this;meta.bump();meta.advise(this,function(){self.set(meta);
4804self.notifyResize(true);},function(){self.showLoading();self.notifyResize(true);});}};zfl_ShortExif.prototype._compose=function(exif){var sb=[];var val;var make=exif[0x010F];
4805var model=exif[0x0110];if(make!=null&&model!=null){if(model.data.indexOf(make.data)!=0)sb.push(zf_stdHtmlEncode(make.display)," ",zf_stdHtmlEncode(model.display));
4806else sb.push(zf_stdHtmlEncode(model.display));}else if(model!=null)sb.push(zf_stdHtmlEncode(model.display));else if(make!=null)sb.push(zf_stdHtmlEncode(make.display));
4807var fNumberAdded=false;val=exif[0x829D];if(val!=null){if(sb.length>0)sb.push(", ");sb.push('<span class="nowrap">',zf_stdHtmlEncode(val.display),'</span>');fNumberAdded=true;
4808}else if(exif[0x829A]!=null){if(sb.length>0)sb.push(", ");sb.push('<span class="nowrap">f/NA</span>');fNumberAdded=true;}val=exif[0x920A];if(val!=null){if(fNumberAdded)sb.push(" @ ");
4809else if(sb.length>0)sb.push(", ");sb.push('<span class="nowrap">',zf_stdHtmlEncode(val.display),'</span>');}val=exif[0x829A];if(val!=null){if(sb.length>0)sb.push(", ");
4810sb.push('<span class="nowrap">',zf_stdHtmlEncode(val.display),'</span>');}val=exif[0x8827];if(val!=null){if(sb.length>0)sb.push(", ");sb.push('<span class="nowrap">',
4811zf_stdHtmlEncode(val.display),'</span>');}val=exif[0x9209];if(val!=null){if(sb.length>0)sb.push(", ");val=(parseInt(val.data)&1)!=0?"Flash":"No Flash";sb.push('<span class="nowrap">',
4812val,'</span>');}return sb.join("");};zfl_ShortExif.prototype._generateHTML=function(meta){var content="";if((meta.photo.access.mask&zf_AccessMask.ProtectExif)==0)content=this._compose(meta.exif);
4813if(content.length==0)return "";var format=this._compact?"{0}":"Photo taken with {0} ";return zf_stdFormatString(format,content);};zfl_ShortExif.prototype._ellipses_onmouseover=function(event){this._ellipses_onmouseout();
4814var domSrc=zf_stdGetEventSource(event);var offset=zf_stdGetOffset(domSrc);var domTip=document.createElement("DIV");domTip.id="exifTip";domTip.className="shortexif-tip popup-bgcolor1 popup-border1 shortexif-color1";
4815domTip.innerHTML="            For more EXIF and photo information, move your mouse over the image.        ";document.body.appendChild(domTip);domTip.style.left=offset.cx-domTip.clientWidth+"px";
4816domTip.style.top=offset.cy-domTip.clientHeight-5+"px";};zfl_ShortExif.prototype._ellipses_onmouseout=function(event){var domTip=document.getElementById("exifTip");if(domTip!=null)domTip.parentNode.removeChild(domTip);
4817};;;function zf_CategoryInfo(map){;for(var code in map)map[code]={code:parseInt(code,10),title:map[code]};this._map=map;}zf_CategoryInfo.load=function(oncomplete){;if(zf_CategoryInfo._info!=null){oncomplete(zf_CategoryInfo._info);
4818return;}zf_stdServerRequestEx("GET","/zf/core/core.asmx","GetCategoryInfo",[zf_locale],function(result,error){if(error!=null){oncomplete(new zf_CategoryInfo({}));
4819return;}zf_CategoryInfo._info=new zf_CategoryInfo(result);oncomplete(zf_CategoryInfo._info);});};zf_CategoryInfo.prototype.getSubject=function(cat){;cat-=cat%1000000;return(cat=this._map[cat])!=null?cat.title:"";
4820};zf_CategoryInfo.prototype.getSubjectMatter=function(cat){;cat-=cat%1000;return((cat%1000000)!=0&&(cat=this._map[cat])!=null)?cat.title:"";};zf_CategoryInfo.prototype.getSubjectDetail=function(cat){;
4821return((cat%1000)!=0&&(cat=this._map[cat])!=null)?cat.title:"";};zf_CategoryInfo.prototype.getSubjects=function(){var res={};var map=this._map;for(var code in map){var r=map[code];
4822code=r.code;if((code%1000000)==0)res[code]=r.title;}return res;};zf_CategoryInfo.prototype.getSubjectMatters=function(subject){;;;var res={};var map=this._map;for(var code in map){var r=map[code];
4823code=r.code;if(code!=subject&&(code-(code%1000000))==subject&&(code%1000)==0)res[code]=r.title;}return res;};zf_CategoryInfo.prototype.getSubjectDetails=function(matter){;;;;var res={};
4824var map=this._map;for(var code in map){var r=map[code];code=r.code;if(code!=matter&&(code-(code%1000))==matter)res[code]=r.title;}return res;};;function zfl_Categories(id){zfl_Control.prototype.constructor.call(this,
4825id);zf_stdMakeMethodsDeferred(this,this.id,["setCategory","setKeywords"]);}zfl_Categories.inherits(zfl_Control);zfl_Categories.prototype.setCategory=function(category,loading){var ct1="",ct2="",
4826ct3="";var c1=this.dom("category").getElementsByTagName("B")[0];var c2=this.dom("subcategory").getElementsByTagName("B")[0];var c3=this.dom("subcategoryDetail").getElementsByTagName("B")[0];
4827zf_stdReplaceClassName(c1,loading?null:"pair-loading",loading?"pair-loading":null);if(loading){ct1="loading...";}else if(category!=0){;ct1=this.categoryList.getSubject(category);
4828ct2=this.categoryList.getSubjectMatter(category);ct3=this.categoryList.getSubjectDetail(category);}zf_stdSetText(c1,ct1);zf_stdSetText(c2,ct2);zf_stdSetText(c3,ct3);
4829};zfl_Categories.prototype.setKeywords=function(keywords,loading){var label=this.dom("keywords").getElementsByTagName("B")[0];if(loading){zf_stdReplaceClassName(label,null,"pair-loading");
4830zf_stdSetText(label,"loading...");return;}zf_stdReplaceClassName(label,"pair-loading",null);var text=[];for(var i=0;i<keywords.length;i++){var keyword=keywords[i];
4831var quoted=keyword;if(quoted.indexOf(' ')!=-1)quoted='"'+quoted+'"';quoted=encodeURI(quoted);text.push(['<a href="/?q=',quoted,'">
4831',zf_stdHtmlEncode(keyword),'</a>'].join(""));
4832}label.innerHTML=text.join(", ");};zfl_Categories.prototype.showLoading=function(){this.setCategory(0,true);this.setKeywords([],true);};zfl_Categories.prototype.update=function(photo){;;if(this.current==photo)return;
4833if(this.current!=null)this.current.unadvise(this);if(this.currentMeta!=null)this.currentMeta.unadvise(this);this.current=photo;this.currentMeta=null;if(photo.loaded){this.set(photo);
4834}else{var self=this;photo.advise(this,function(){self.set(photo);self.notifyResize(true);},function(){self.showLoading();self.notifyResize(true);});}};zfl_Categories.prototype.set=function(photo){if(photo==null)photo=this.current;
4835;var hasCategories=(photo.flags&zf_PhotoFlags.HasCategories)!=0;var hasKeywords=(photo.flags&zf_PhotoFlags.HasKeywords)!=0;if(!hasCategories)this.setCategory(0,false);
4836if(!hasKeywords)this.setKeywords([],false);if(!hasCategories&&!hasKeywords){this.notifyResize(true);return;}var self;if(hasCategories&&!this.categoryList){self=this;
4837zf_CategoryInfo.load(function(catInfo){self.categoryList=catInfo;self.set();self.notifyResize(true);});self.notifyResize(true);return;}var meta=photo.getMeta();this.currentMeta=meta;
4838if(meta.loaded){if(hasCategories)this.setCategory(meta.category,false);if(hasKeywords)this.setKeywords(meta.keywords,false);}else{self=this;meta.bump();meta.advise(this,
4839function(){self.setCategory(meta.category);self.setKeywords(meta.keywords);self.notifyResize(true);},function(){if(hasCategories)self.setCategory(0,true);if(hasKeywords)self.setKeywords([],
4840true);self.notifyResize(true);});}};;;;var zfl_ExifViewStyle={Overlay:0,Inline:1};function zfl_ExifView(id,style){this.style=style;zfl_Control.prototype.constructor.call(this,
4841id);zf_stdMakeMethodsDeferred(this,this.id,["set","showLoading"]);}zfl_ExifView.inherits(zfl_Control);zfl_ExifView.prototype.set=function(meta){var html=this._generateHTML(meta);this.dom().innerHTML=html;
4842this._populated=true;};zfl_ExifView.prototype.showLoading=function(){var html=['<div class="listheader listheader-font1 listheader-color2">','Photo Info','</div>','<div class="separator separator-border2"><hr/></div>',
4843'<div class="listitem">','<span class="exif-loading">Loading...</span>','</div>'];html=html.join("");this.dom().innerHTML=html;};zfl_ExifView.prototype.update=function(photo){;
4844;var meta=photo.getMeta();if(this.current==meta)return;if(this.current!=null)this.current.unadvise(this);this.current=meta;this._populated=false;if(meta.loaded){this.set(meta);
4845}else{var self=this;meta.bump();meta.advise(this,function(){self.set(meta);self.notifyResize(true);},function(){self.showLoading();self.notifyResize(true);});}};
4846zfl_ExifView.prototype._generateHTML=function(meta){if(meta.photo.video)return "";var content=[];var items1,items2;if((meta.photo.access.mask&zf_AccessMask.ProtectExif)!=0){items1=[-5,
4847-1,-2,-3];items2=[];}else{items1=[-5,-1,-2,-3,0xA001,0x9003,0x0132];items2=[0x010F,0x0110,0x920A,0xA405,0x9205,-4,0x9209,0x9204,0xA402,0x8822,0x8827,0x9207,0xA404];
4848}this._addExifSection(content,"Photo Info",meta,items1);this._addExifSection(content,"Shooting Conditions",meta,items2);return content.join("");};zfl_ExifView.prototype._addExifSection=function(builder,
4849title,meta,items){var exif=meta.exif;var empty=exif!=null;for(var i=0;i<items.length&&empty;i++)empty=(exif[items[i]]==null);if(empty)return;var tag;builder.push('<div class="listheader listheader-font1 ',
4850this.style==zfl_ExifViewStyle.Overlay?'listheader-color1':'listheader-color1','">',title,'</div>','<div class="separator separator-border2"><hr/></div>','<div class="listitem">');
4851if(this.style==zfl_ExifViewStyle.Inline){for(i=0;i<items.length;i++){tag=exif[items[i]];if(!tag)continue;builder.push('<div class="pair-box">','<span class="pair pair-color1 pair-font1">',
4852'<span>',zf_stdHtmlEncode(tag.title),':</span>','<b class="pair-0 pair-color2 pair-font2">',zf_stdHtmlEncode(tag.display),'</b>','</span>','</div>');}}else if(this.style==zfl_ExifViewStyle.Overlay){for(i=0;
4853i<items.length;i++){tag=exif[items[i]];if(!tag)continue;builder.push('<div class="exif-name pair-color1 pair-font1">',zf_stdHtmlEncode(tag.title),'</div>','<div class="exif-value pair-color2 pair-font1">',
4854zf_stdHtmlEncode(tag.display),'</div><div class="clear"></div>');}}builder.push('</div>');};;function zfl_ExifPopup(id,style){zfl_Popup.prototype.constructor.call(this,id,
4855true);this._displayed=false;this._view=new zfl_ExifView(id+"-content",style);this._view.onresize=zf_stdMakeDeferred(this.id+".updateBackgroun
4855d",this.closure(this._updateBackground),
4856this);}zfl_ExifPopup.inherits(zfl_Popup);zfl_ExifPopup.createHtml=function(id,styles){var markup=[];markup.push('<div class="popup exif-popup popup-border1 popup-color1 popup-font1 none" id="',
4857id,'">','<div class="exif-popup-content" id="',id,'-content"></div>','<div class="exif-popup-background popup-bgcolor1" id="',id,'-background"></div>','</div>');
4858return markup.join('');};zfl_ExifPopup.prototype.update=function(photo){;;if(this.current==photo)return;this.current=photo;if(this._displayed){this._view.update(photo);this._view.onresize();
4859}};zfl_ExifPopup.prototype.show=function(domOrigin,constraint){this._displayed=true;if(this.current){this._view.update(this.current);this._view.onresize();}zfl_Popup.prototype.show.call(this,
4860domOrigin,constraint);this._updateBackground();};zfl_ExifPopup.prototype.hide=function(){zfl_Popup.prototype.hide.call(this);this._displayed=false;};zfl_ExifPopup.prototype._updateBackground=function(){};
4861;;;function zfl_CollectionList(){this.list=[];}zfl_CollectionList.current=new zfl_CollectionList();zfl_CollectionList.prototype.load=function(callback){var self=this;if(!this.loaded){zf_stdServerRequest("POST",
4862"/zf/layout/layout.asmx","GetCollections",[],function(status,retVal){self.list=status==200?retVal.result:[];self.loaded=true;callback();});}else{callback();}};zfl_CollectionList.prototype.addPhoto=function(collectionId,
4863photoId,ownerId){var self=this;var formatSuccess="Photo added to {0} collection.";var formatError="An error occurred while adding photo to the \x27{0}\x27 collection.";
4864var formatDuplicated="Duplicate action. This photo was already added to collection \x27{0}\x27.";var formatNotFound="Collection \x27{0}\x27 does not exist.";for(index=0;
4865index<this.list.length;index++){if(this.list[index].id==collectionId)break;};if(index==this.list.length)return;var collection=this.list[index];zf_stdServerRequest("POST",
4866"/zf/app/manage.asmx","AddSingleToCollection",[photoId,collectionId,ownerId],function(status,retVal){if(status==200&&index>0){self.list.splice(index,1);self.list.unshift(collection);
4867}var url=zf_stdGetTransferUrl([zf_stdGetProtocol(zf_userDomain),zf_userDomain,collection.getBaseHref(),"/h",zf_toUint32(photoId).toString(16)].join(""));var markup=[' <a href="',
4868url,'" onclick="location.href=\x27',url,'\x27','">View &raquo;</a>'].join("");var format;switch(status){case 200:format=(retVal.result?formatSuccess:formatDuplicated)+markup;
4869break;case 404:format=formatNotFound;break;default:format=formatError;break;}var message=zf_stdFormatString(format,['<a href="',url,'" onclick="location.href=\x27',
4870url,'\x27">',zf_stdHtmlEncode(collection.title),'</a>'].join(""));if(self.onmessage)self.onmessage(photoId,message,status!=200);});};zfl_CollectionList.prototype.addPhotoToNew=function(title,
4871photoId,ownerId){var self=this;zf_stdServerRequestEx("POST","/zf/app/edit/edit.asmx","CreatePhotoSet",[0,-1,"col",{title:title}],function(result,error){if(error==null){self.list.unshift(new zf_PhotoSet(result,
4872"Collection",title));self.addPhoto(result,photoId,ownerId);}else{var message=zf_stdFormatString("An error occurred while adding photo to the \x27{0}\x27 collection.",
4873title);if(self.onmessage)self.onmessage(photoId,message,true);}});};;function zfl_CollectionMenu(){zfl_PhotoMenu.prototype.constructor.call(this,[],"pvo-menu photoMenu collectionMenu");
4874this.authenticated=zf_userId!=0;this.list=null;this.oncommand=zf_stdFalse;var self=this;this._rebuild=function(){if(self.dom()!=null){self.dom().innerHTML=self._build();
4875self._subscribe();}};}zfl_CollectionMenu.inherits(zfl_PhotoMenu);zfl_CollectionMenu.prototype.create=function(parent){;;var self=this;var root=document.createElement("DIV");root.className=this._classes+" none";
4876root.id=this.id;var content=[];if(!this.authenticated){root.innerHTML=['<div class="collectionMenu-box">','<div class="collectionMenu-header">','<div class="collectionMenu-icon"></div>',
4877'<span>About Collections</span>','</div>','<div class="collectionMenu-para">','        Collections hold links to photos uploaded by you or other        people. You can put together collections of favorite        photographs or collect photos from several people.        ',
4878'<div class="collectionMenu-para" id="',this.id,'-para2">','        You need to <a>login</a> in order to        save to collection. If you are not a user yet, you can open a        Visitor account that\x27s always free and only takes a minute.        ',
4879'</div>','<div class="collectionMenu-footer">','<div class="collectionMenu-button" id="',this.id,'-login">','Continue »','</div>','<div class="collectionMenu-button" id="',
4880this.id,'-hide">','Cancel','</div>','</div>','<div class="overlay-background">','<div class="collectionMenu-header">','<div class="collectionMenu-icon"></div>','<span>About Collections</span>',
4881'</div>','<div class="collectionMenu-para">','        Collections hold links to photos uploaded by you or other        people. You can put together collections of favorite        photographs or collect photos from several people.        ',
4882'<div class="collectionMenu-para">','        You need to <a>login</a> in order to        save to collection. If you are not a user yet, you can open a        Visitor account that\x27s always free and only takes a minute.        ',
4883'</div>','<div class="collectionMenu-footer">','<div class="collectionMenu-button">','Continue »','</div>','<div class="collectionMenu-button">','Cancel','</div>',
4884'</div>','</div>','</div>'].join("");}else{if(!this.list){root.innerHTML=['<div class="collectionMenu-loading">','<div class="overlay-background"></div>','Loading...',
4885'</div>'].join("");if(this.list==null){this.list=false;var collectionList=zfl_CollectionList.current;if(!collectionList.loaded){collectionList.load(function(){self.list=true;
4886self._rebuild();});}else{this.list=true;root.innerHTML=this._build();}}}else{root.innerHTML=this._build();}}parent.appendChild(root);if(!this.authenticated){var onlogin=function(){self.oncommand("collectLogin");
4887};this.dom("login").onclick=onlogin;var a=this.dom("para2").getElementsByTagName("A")[0];a.onclick=onlogin;a=null;this.dom("hide").onclick=function(){self.show(false);
4888};}else{this._subscribe();}parent=null;root=null;};zfl_CollectionMenu.prototype._build=function(){this.items=[];this._map={};var i;var self=this;if(this.list){var createHandler=function(id){return function(){self.oncommand("collectPhoto",
4889id);};};var collections=zfl_CollectionList.current.list;for(i=0;i<collections.length;i++){var content=[];var ps=collections[i];for(var j=1;j<ps.folders.length;j++){content.push('<span class="folder">',
4890zf_stdHtmlEncode(ps.folders[j].title),'</span> &raquo; ');}content.push(zf_stdHtmlEncode(ps.title));this.items.push({id:"collect"+ps.id,text:content.join(""),onclick:createHandler(ps.id)});
4891}if(this.items.length>0)this.items.push({id:"sep1",separator:true});this.items.push({id:"collectNew",text:"Add to a new collection",onclick:function(){self.oncommand("collectNew");
4892}});this.items.push({id:"sep2",separator:true});this.items.push({id:"collectEdit",text:"Open my collections in Edit View",onclick:function(){self.oncommand("collectEdit");
4893}});for(i=0;i<this.items.length;i++){var item=this.items[i];this._map[item.id]=item;item.onselect=zf_stdFalse;}}return zfl_PhotoMenu.prototype._build.call(this);
4894};;zfl_PhotoOverlay._mainMenu=[{id:"addToCart",text:"Buy"},{id:"makeZookAlbum",text:"Make an Album"},{id:"createBook",text:"Create a Book"},{id:"addToFavorites",text:"Add To Favorites",
4895enableByOption:"addToFav"},{id:"removeFromFavorites",text:"Remove From Favorites"},{id:"selectAsYearbookPose",text:"Select as Yearbook Pose",enableByOption:"selectAsYP"},
4896{id:"removeFromYearbookPose",text:"Remove From Yearbook Pose"},{id:"share",text:"Share"},{id:"dimLights",text:"Dim The Lights"},{id:"download",text:"Download"},{id:"collect",
4897text:"Add to Collection"},{id:"admin",text:"Administrator"}];zfl_PhotoOverlay._adhocMenu=[{id:"addToCart",text:"Buy"},{id:"makeZookAlbum",text:"Make an Album"},{id:"createBook",
4898text:"Create a Book"},{id:"addToFavorites",text:"Add To Favorites",enableByOption:"addToFav"},{id:"removeFromFavorites",text:"Remove From Favorites"},{id:"selectAsYearbookPose",
4899text:"Select as Yearbook Pose",enableByOption:"selectAsYP"},{id:"removeFromYearbookPose",text:"Remove From Yearbook Pose"},{id:"share",text:"Share"},{id:"dimLights",
4900text:"Dim The Lights"},{id:"download",text:"Download"},{id:"admin",text:"Administrator"}];zfl_PhotoOverlay._adminMenu=[{id:"censorPhoto",text:"Censor"},{id:"uncensorPhoto",text:"Uncensor"},
4901{id:"censorGallery",text:"Censor Gallery"},{id:"purgePhoto",text:"Purge"},{id:"purgeGallery",text:"Purge Gallery"},{id:"makeNotSearchable",text:"Make Not Searchable"},
4902{id:"makeSearchable",text:"Make Searchable"}];zfl_PhotoOverlay._contextMenu=[{id:"addToCart",text:"Buy"},{id:"addToFavorites",text:"Add To Favorites",enableByOption:"addToFav"},
4903{id:"removeFromFavorites",text:"Remove From Favorites"},{id:"selectAsYearbookPose",text:"Select as Yearbook Pose",enableByOption:"selectAsYP"},{id:"removeFromYearbookPose",
4904text:"Remove From Yearbook Pose"},{id:"dimLights",text:"Dim The Lights (single-click)"},{id:"undimLights",text:"Close (single-click)"},{id:"download",text:"Download"},
4905{id:"share",text:"Share This Photo"}];zfl_PhotoOverlay.prototype._prepareMenu=function(template){var self=this;var photo=this.current;var items=[];items.map={};var makeOnClick=function(item){item.onclick=function(){self._hide("now");
4906self.command(item.id);};};for(var i=0;i<template.length;i++){var source=template[i];if(!this.commandtest(source.id,this.options))continue;if(typeof(source.enableByOption)=="string"&&!this.options[source.enableByOption])continue;
4907var item={id:source.id,text:source.text,onsubmenu:$.noop};makeOnClick(item);items.push(item);items.map[item.id]=item;}items.addSubMenu=function(name,factory){var item=this.map[name];
4908if(!item)return;item.onclick=$.noop;item.text+=' &raquo;';item.onsubmenu=function(show,x,y,parent){if(!item.submenu&&show){item.submenu=factory();item.submenu.onactive=function(){this.parent&&this.parent.select(name,
4909true);};item.submenu.create(self.dom("oroot"));}if(item.submenu)item.submenu.show(show,x,y,parent);};};items.addSubMenu("admin",function(){return new zfl_PhotoMenu(self._prepareMenu(zfl_PhotoOverlay._adminMenu));
4910});
4910items.addSubMenu("collect",function(){var cm=new zfl_CollectionMenu();cm.oncommand=function(){self._hide("now");self.command.apply(self,arguments);};return cm;
4911});items.addSubMenu("download",function(){var cm=new zfl_DownloadMenu(self.current,self.commandtest("saveImages",self.options));cm.oncommand=function(){self._hide("now");
4912self.command.apply(self,arguments);};cm.oncommandtest=function(){return self.commandtest.apply(self,arguments);};return cm;});return items;};zfl_PhotoOverlay.prototype._createMenus=function(always){var photo=this.current;
4913if(!photo||!photo.loaded)return;if(!this.attached)return;if(!always&&!this._menuActive)return;if(this._menuCreated)return;this._menuCreated=true;var items;var self=this;
4914if(this.options.mainMenu){items=this._prepareMenu(zfl_PhotoOverlay._mainMenu);if(items.length>0){this.menus.mainMenu=new zfl_PhotoMenu(items,"pvo-menu pvo-mmenu photoMenu");
4915this.menus.mainMenu.create(this.dom("oroot"));this.menus.mainMenu.display=function(toshow){var animated=true;if(animated){toshow?this.$dom().slideDown(100):this.$dom().slideUp(100);
4916}else{this.$dom().toggle(toshow);}};}}if(this.options.contextMenu){items=this._prepareMenu(zfl_PhotoOverlay._contextMenu);if(items.length>0){this.menus.contextMenu=new zfl_PhotoMenu(items,
4917"pvo-menu pvo-cmenu photoMenu");this.menus.contextMenu.create(this.dom("oroot"));}}};zfl_PhotoOverlay.prototype._destroyMenus=function(){for(var key in this.menus){var obj=this.menus[key];
4918if(obj&&obj.destroy instanceof Function)obj.destroy();}this.menus={};this._menuCreated=false;};zfl_PhotoOverlay.prototype.showMenu=function(x,y,origin){if(!this.current||!this.current.loaded)return;
4919if(!zfl_PhotoOverlay._listener&&document.addEventListener){var self=this;zfl_PhotoOverlay._listener=true;document.addEventListener("mousedown",function(e){e=$.event.fix(e);
4920if(self.menus.adhocMenu&&$(e.target).closest('.pvo-orootb').length==0&&$(e.target).closest('.downloadMenu').length==0){self.menus.adhocMenu.show(false);}},true);
4921}if(!this.menus.adhocMenu){items=this._prepareMenu(zfl_PhotoOverlay._adhocMenu);if(items.length>0){this.menus.adhocMenu=new zfl_PhotoMenu(items,"pvo-menu pvo-mmenu adhocMenu");
4922this.menus.adhocMenu.create(this.dom('orootb'));this.menus.adhocMenu.display=function(toshow){toshow?this.$dom().slideDown(200):this.$dom().slideUp(200);};}}this.menus.adhocMenu.show(true,
4923x,y,null,origin);this._hide("slow","not adhoc");};;;function zfl_PhotoOverlay(){this.id="_overlay_"+zfl_PhotoOverlay.counter++;this.attached=false;this.options={};this.idle={};
4924this.dom=zf_Control.prototype.dom;this.$dom=zf_Control.prototype.$dom;this.closure=zf_Control.prototype.closure;this.eventHandler=zf_Control.prototype.eventHandler;
4925}zfl_PhotoOverlay.counter=0;zfl_PhotoOverlay.prototype.init=function(options,command,commandtest){options=options?options:{};;;this.options=options;this.command=command;this.commandtest=commandtest;
4926if(options.infoIcon==undefined)options.infoIcon=options.exifIcon;if(options.mainMenu==undefined)options.mainMenu=options.menuBar;var self=this;if(this.options.message){zfl_CollectionList.current.onmessage=function(photoId,
4927message,error){if(self.attached&&self.current.id==photoId)self.showMessage(message,error);};}};zfl_PhotoOverlay.prototype.attach=function(inner){var start=new Date().getTime();;
4928;var id=this.id;var self=this;var $inner=$(inner);var ihtml=[];ihtml.push('<div class="pvo-iroot" id="',id,'-iroot">');if(this.options.selectAsYP){ihtml.push('<div class="yp-ico"></div>');
4929}if(this.options.addToFav)ihtml.push('<div class="fa-ico"></div>');if(this.options.mainMenu)ihtml.push('<div class="pvo-mm-hot" id="',id,'-mm-hot">','<div class="pvo-mm" id="',
4930id,'-mm">','<div class="pvo-mm-c"></div>','</div>','</div>');if(this.options.infoIcon||this.options.selectAsYP||this.options.addToFav){ihtml.push('<div class="pvo-ii-hot" id="',
4931id,'-ii-hot">','<div class="pvo-ii" id="',id,'-ii">');if(this.options.selectAsYP)ihtml.push('<div class="pvo-ii-y" id="',id,'-ii-y"></div>');if(this.options.addToFav)ihtml.push('<div class="pvo-ii-f" id="',
4932id,'-ii-f"></div>');if(this.options.infoIcon)ihtml.push('<div class="pvo-ii-e" id="',id,'-ii-e"></div>');ihtml.push('</div>','</div>');}ihtml.push('<div class="pvo-vv-hot" id="',
4933id,'-vv-hot">','</div>');if(this.options.message)ihtml.push('<div class="pvo-msg" id="',id,'-msg">','<span></span>','</div>');ihtml.push('</div>');var ohtml=[];ohtml.push('<div class="pvo-oroot" id="',
4934id,'-oroot">');if(this.options.exifIcon)ohtml.push(zfl_ExifPopup.createHtml(this.id+"-exif"));ohtml.push('</div>');var obhtml=[];obhtml.push('<div class="pvo-orootb" id="',
4935id,'-orootb">');obhtml.push('</div>');$(ihtml.join('')).appendTo(inner);$(ohtml.join('')).appendTo(document.body);$(obhtml.join('')).appendTo(document.body);this._prepareOverlayEvents();
4936this.$dom('ii-e').bind('mouseenter.PhotoOverlay touchstart',this.closure(this._infoicon_onmouseover)).bind('mouseleave.PhotoOverlay',this.closure(this._infoicon_onmouseout));
4937this.$dom('mm').bind('mouseenter.PhotoOverlay touchstart',this.closure(this._mainmenu_onmouseover)).bind('mouseleave.PhotoOverlay',this.closure(this._mainmenu_onmouseout));
4938this.$dom('ii-f').bind('click.PhotoOverlay touchstart',function(){if(self.commandtest('addToFavorites'))self.command('addToFavorites');else if(self.commandtest('removeFromFavorites'))self.command('removeFromFavorites');
4939self._updateAddToFavIcon();self._destroyMenus();self._createMenus(true);});this.$dom('ii-y').bind('click.PhotoOverlay touchstart',function(){var updateUICallback=function(){self._updateSelectAsYPIcon();
4940self._destroyMenus();self._createMenus(true);};if(self.commandtest('selectAsYearbookPose'))self.command('selectAsYearbookPose',updateUICallback);else if(self.commandtest('removeFromYearbookPose'))self.command('removeFromYearbookPose',
4941updateUICallback);});var defaultCommand=this.options.defaultCommand;if(defaultCommand){$inner.css({cursor:"pointer"}).bind('click.PhotoOverlay',this.closure(this._parent_onclick));
4942}this.exifPopup=null;$inner.bind('overlay:activity.PhotoOverlay',function(e){self.$dom('mm').fadeIn(400);self.$dom('ii').fadeIn(400);self.$dom('iroot').clearQueue('firstshow');
4943self._updateAddToFavIcon();self._updateSelectAsYPIcon();}).bind('overlay:first:show.PhotoOverlay',function(e){self.$dom('mm').fadeIn(400);self.$dom('ii').fadeIn(400);
4944self._updateAddToFavIcon();self._updateSelectAsYPIcon();}).bind('overlay:leave.PhotoOverlay overlay:idle.PhotoOverlay',function(e){self._hide('fast');}).bind('overlay:first:hide.PhotoOverlay',
4945function(e){self._hide('fast','not adhoc');}).bind('overlay:info:enter.PhotoOverlay',function(e){self._hide("slow","not info");self.$dom('ii').stop(true,true).show();
4946self._updateAddToFavIcon();self._updateSelectAsYPIcon();}).bind('overlay:info:leave.PhotoOverlay',function(e){self._infoicon_onmouseout(e);}).bind('overlay:menu:enter.PhotoOverlay',
4947function(e){self._hide("slow","not menu");self.$dom('mm').stop(true,true).show();}).bind('overlay:menu:leave.PhotoOverlay',function(e){self._mainmenu_onmouseout(e);
4948}).bind('overlay:contextmenu.PhotoOverlay',this.closure(this._oncontextmenu)).bind('overlay:video:enter.PhotoOverlay',function(e){self._hide("slow");});var logEvent=function(e){;
4949};$inner.bind('overlay:idle.PhotoOverlay',logEvent).bind('overlay:activity.PhotoOverlay',logEvent).bind('overlay:enter.PhotoOverlay',logEvent).bind('overlay:leave.PhotoOverlay',
4950logEvent).bind('overlay:first:show.PhotoOverlay',logEvent).bind('overlay:first:hide.PhotoOverlay',logEvent).bind('overlay:menu:enter.PhotoOverlay',logEvent).bind('overlay:menu:leave.PhotoOverlay',
4951logEvent).bind('overlay:info:enter.PhotoOverlay',logEvent).bind('overlay:info:leave.PhotoOverlay',logEvent).bind('overlay:video:enter.PhotoOverlay',logEvent).bind('overlay:video:leave.PhotoOverlay',
4952logEvent).bind('overlay:contextmenu.PhotoOverlay',logEvent);this.attached=true;;};zfl_PhotoOverlay.prototype._prepareOverlayEvents=function(){var self=this;var delayed={enter:new zf_DelayedInvoke(400),
4953exit:new zf_DelayedInvoke(400),exitUI:new zf_DelayedInvoke(400)};var enter=function(){return delayed.enter.invoke(function(){self._trackIdle(true);self.$dom('iroot').parent().trigger('overlay:enter');
4954});};var exit=function(){return delayed.exit.invoke(function(){delayed.exitUI.clear();self._trackIdle(false);self.$dom('iroot').parent().trigger('overlay:leave');
4955});};var exitUI=function(){return delayed.exitUI.invoke(function(){self._trackIdle(true);});};this.$dom('iroot').parent().bind('mouseover.PhotoOverlay',function(e){if(delayed.exit.pending)delayed.exit.clear();
4956else enter();}).bind('mouseout.PhotoOverlay',function(e){if(delayed.enter.pending)delayed.enter.clear();else exit();}).bind('contextmenu.PhotoOverlay',function(e){self.$dom('iroot').clearQueue('firstshow');
4957e.type='overlay:contextmenu';self.$dom('iroot').parent().trigger(e);return false;});$([this.dom('iroot'),this.dom('oroot'),this.dom('orootb')]).mouseover(function(e){e.stopPropagation();
4958if(!delayed.exitUI.pending)self._trackIdle(false);delayed.exitUI.clear();delayed.exit.clear();}).mouseout(function(e){e.stopPropagation();exitUI();exit();});this.$dom('mm-hot').bind('mouseenter.PhotoOverlay',
4959function(e){self.$dom('iroot').clearQueue('firstshow');self.$dom('iroot').parent().trigger('overlay:menu:enter');}).bind('mouseleave.PhotoOverlay',function(e){self.$dom('iroot').parent().trigger('overlay:menu:leave');
4960});this.$dom('ii-hot').bind('mouseenter.PhotoOverlay',function(e){self.$dom('iroot').clearQueue('firstshow');self.$dom('iroot').parent().trigger('overlay:info:enter');
4961}).bind('mouseleave.PhotoOverlay',function(e){self.$dom('iroot').parent().trigger('overlay:leave');});this.$dom('iroot').iff(!zfl_PhotoOverlay._reused).delay(1000,
4962'firstshow').queue('firstshow',function(next){self.$dom('iroot').parent().trigger('overlay:first:show');next();}).delay(1000,'firstshow').queue('firstshow',function(next){self.$dom('iroot').parent().trigger('overlay:first:hide');
4963next();}).dequeue('firstshow');var vvhot=function($elem,e){var width=$elem.width(),height=$elem.height(),pos=$elem.offset();var x=e.pageX-pos.left,y=e.pageY-pos.top;
4964return x>=0&&x<width&&y>=height-60&&y<height;};var vventer=function(condition){if(condition){self._trackIdle(false);self.$dom('iroot').parent().trigger('overlay:video:enter');
4965}};var vvleave=function(condition){if(condition){self._trackIdle(true);self.$dom('iroot').parent().trigger('overlay:video:leave');}};this.$dom('iroot').parent().bind('mouseenter.PhotoOverlay',
4966function(e){var $elem=$(this),hot=vvhot($elem,e);$elem.data('vvhot.PhotoOverlay',hot);vventer(hot);}).bind('mouseleave.PhotoOverlay',function(e){var $elem=$(this),
4967hot=$elem.data('vvhot.PhotoOverlay');$elem.data('vvhot.PhotoOverlay',false);vvleave(hot);}).bind('mousemove.PhotoOverlay',function(e){var $elem=$(this),hot0=$elem.data('vvhot.PhotoOverlay'),
4968hot1=vvhot($elem,e);$elem.data('vvhot.PhotoOverlay',hot1);vventer(!hot0&&hot1);vvleave(hot0&&!hot1);});zfl_PhotoOverlay._reused=true;this.$dom('iroot').click(false);
4969zf_stdDisableRightClick(this.$dom('iroot'));zf_stdDisableRightClick(this.$dom('oroot'));};zfl_PhotoOverlay.prototype.detach=function(inner){;if(!this.attached)return;if(this.exifPopup)this.exifPopup.hide();
4970this._trackIdle(false);this._destroyMenus();this._menuActive=false;this.$dom('iroot').remove();this.$dom('oroot').remove();this.$dom('orootb').remove();$(inner).unbind('.PhotoOverlay').css({cursor:"auto"});
4971this.attached=false;};zfl_PhotoOverlay.prototype.update=function(photo){;;if(this.current==photo)return;if(this.current!=null)this.current.unadvise(this);this.current=photo;this._destroyMenus();
4972if(photo.loaded){this._createMenus();var c=1;}else{var self=this;photo.advise(this,function(){self._createMenus();});}if(this.exifPopup)this.exifPopup.update(photo);
4973};zfl_PhotoOverlay.prototype._trackIdle=function(enable){if(!enable){if(!this.idle.timer)return;clearInterval(this.idle.timer);this.idle.timer=null;this.$dom('iroot').parent().unbind('mousemove.PhotoOverlay',
4974this.idle.mousemove);return;}if(this.idle.timer)return;this.idle.counter=0;this.idle.interrupt=0;this.idle.timer=null;var self=this;this.idle.timer=setInterval(function(){++self.idle.counter;
4975if(self.idle.counter==16&&!self.idle.suspended)self.$dom('iroot').parent().trigger('overlay:idle');++self.idle.interrupt;if(self.idle.interrupt==2){if(!self.idle.suspended)self.$dom('iroot').parent().trigger('overlay:activity');
4976self.idle.counter=0;}},200);this.idle.mousemove=this.idle.mousemove||function(e){if(!self.idle.timer)return;var x=e.pageX;var y=e.pageY;if(self.idle.x&&Math.abs(self.idle.x-x)>5||self.idle.y&&Math.abs(self.idle.y-y)>5){if(self.idle.counter>16){if(!self.idle.suspended)self.$dom('iroot').parent().trigger('overlay:activity');
4977self.idle.counter=0;}if(self.idle.interrupt<2)self.idle.interrupt=0;}self.idle.x=x;self.idle.y=y;};this.$dom('iroot').parent().bind('mousemove.PhotoOverlay',this.idle.mousemove);
4978};zfl_PhotoOverlay.prototype._oncontextmenu=function(e){if(!this.current||!this.current.loaded)return;this._destroyMenus();this._createMenus(true);if(!this.menus.contextMenu)return;
4979var x,y;x=e.pageX;y=e.pageY;this._hide("fast","not context");this.menus.contextMenu.show(true,x-5,y-5);};zfl_PhotoOverlay.prototype._parent_onclick=function(e){if(!this.current||!this.current.loaded)return;
4980if(this.current.video)return;var defaultCommand=this.options.defaultCommand;if(!defaultCommand||!this.commandtest(defaultCommand,this.options))return;this._hide("now");
4981this.command(defaultCommand);};zfl_PhotoOverlay.prototype._infoicon_onmouseover=function(e){this.$dom('ii').show();if(!this.exifPopup){var id=this.id+"-exif";this.exifPopup=new zfl_ExifPopup(id,
4982zfl_ExifViewStyle.Overlay);if(this.current)this.exifPopup.update(this.current);}this.exifPopup.show(this.dom('ii-e'),"shift-right");};zfl_PhotoOverlay.prototype._infoicon_onmouseout=function(e){if(this.exifPopup)this.exifPopup.hide();
4983};zfl_PhotoOverlay.prototype._mainmenu_onmouseover=function(e){if(!this.current||!this.current.loaded)return;this._createMenus(true);if(!this.menus.mainMenu)return;var pos=this.$dom('mm').offset();
4984this.menus.mainMenu.show(true,pos.left+3,pos.top+32);this.$dom('mm').addClass('pvo-mm-a');this._hide("slow","not menu");};zfl_PhotoOverlay.prototype._mainmenu_onmouseout=function(e){};
4985zfl_PhotoOverlay.prototype._hide=function(speed,except){if(except!="not menu"){if(this.menus.mainMenu)this.menus.mainMenu.show(false);}if(except!="not adhoc"){if(this.menus.adhocMenu)this.menus.adhocMenu.show(false);
4986}if(except!="not context"){if(this.menus.contextMenu)this.menus.contextMenu.show(false);}if(except!="not menu")this.$dom('mm').removeClass('pvo-mm-a');if(speed=="now"){if(except!="not message")this.$dom('msg').hide();
4987if(except!="not info")this.$dom('ii').hide();if(except!="not menu")this.$dom('mm').hide();this._destroyMenus();}else{if(except!="not message")this.$dom('msg').fadeOut(speed);
4988if(except!="not info")this.$dom('ii').fadeOut(speed);if(except!="not menu")this.$dom('mm').fadeOut(speed);}};zfl_PhotoOverlay.prototype.showMessage=function(message,error){if(!this.options.message)return;
4989var self=this;var span;this.$dom("msg").html(message+'<span></span>').toggleClass('pvo-msg-error',error).unbind('.PhotoOverlay').bind('mouseenter.PhotoOverlay',function(e){self._hide("fast",
4990"not message");$(this).clearQueue().show();}).bind('mouseleave.PhotoOverlay',function(e){$(this).clearQueue().delay(8000).fadeOut("slow");}).fadeIn('fast');};
4990zfl_PhotoOverlay.prototype._updateAddToFavIcon=function(message,
4991error){this.$dom('ii-f').toggleClass('pvo-ii-fr',this.commandtest('removeFromFavorites')).toggleClass('pvo-ii-fa',this.commandtest('addToFavorites'));};zfl_PhotoOverlay.prototype._updateSelectAsYPIcon=function(message,
4992error){this.$dom('ii-y').toggleClass('none',!(this.commandtest('selectAsYearbookPose')||this.commandtest('removeFromYearbookPose')));this.$dom('ii-y').toggleClass('pvo-ii-yr',
4993this.commandtest('removeFromYearbookPose')).toggleClass('pvo-ii-ys',this.commandtest('selectAsYearbookPose'));};zfl_PhotoOverlay.prototype.photoDisplayed=function(){this.$dom('iroot').toggleClass('pco-ii-fi',
4994this.commandtest('removeFromFavorites'));this.$dom('iroot').toggleClass('pco-ii-yi',this.commandtest('removeFromYearbookPose'));};;;;function zfl_Photographer(id){zfl_Control.prototype.constructor.call(this,
4995id);zf_stdMakeMethodsDeferred(this,this.id,["setLink"]);}zfl_Photographer.inherits(zfl_Control);zfl_Photographer.prototype.init=function(owner){this._owner=owner;};zfl_Photographer.prototype.setLink=function(user,
4996loading){;var label=this.$dom("label");if(loading){label.addClass("photographer-loading").text('Loading...');}else{if(user.id==this._owner.id){this.display(false);
4997}else{this.display(true);label.removeClass("photographer-loading").html(zf_stdFormatString("Photo by: {0}",['<a href="',zf_stdGetTransferUrl(zf_stdGetProtocol(user.domainName)+user.domainName+"/"),
4998'">',zf_stdHtmlEncode(user.displayName),'</a>'].join("")));}}};zfl_Photographer.prototype.showLoading=function(){this.setLink(null,true);};zfl_Photographer.prototype.update=function(photo){;;if(this.current==photo)return;
4999if(this.current!=null)this.current.unadvise(this);this.current=photo;if(photo.loaded){this.setLink(photo.owner);}else{var self=this;photo.advise(this,function(){self.setLink(photo.owner);
5000self.notifyResize(true);},function(){self.showLoading();self.notifyResize(true);});}};;;;;;function zfl_PhotoFlipper(id,style,lynx){zfl_Control.prototype.constructor.call(this,
5001id);this.style=style;this._static=lynx;this._views=[];this._pool={};this.set=zf_stdMakeDeferred(this.id+".set",this._set);this._prefetch=zf_stdMakeDeferred(this.id+"._prefetch",
5002this._prefetch);if(this._static)this.$dom().html("").removeClass("pf-static");this.relaxedHeight=false;this.allowClipping=false;this.extraVideoPadding={cx:0,cy:0};
5003}zfl_PhotoFlipper.inherits(zfl_Control);zfl_PhotoFlipper.Front=0;zfl_PhotoFlipper.Back=1;zfl_PhotoFlipper._counter=0;zfl_PhotoFlipper.prototype.init=function(decoration,plugins,overlayFlags,oncommand,oncommandtest,fullHeight,transition,browserScaling){this._decoration=decoration;
5004this._plugins=plugins;this._oncommand=oncommand;this._oncommandtest=oncommandtest;this.browserScaling=!!browserScaling;this._delayPrefetching=true;var extent=0;if(decoration)extent=decoration.shadowSize+decoration.borderSize+decoration.extraSize;
5005this._extent=extent;if(overlayFlags){;this._overlay=new zfl_PhotoOverlay();this._overlay.init(overlayFlags,oncommand,oncommandtest);}this._transition=transition;
5006this.transitionEnabled=true;var self=this;this._animTransition=new zf_Animation({"start":0,"end":100},function(v){zf_stdSetOpacity(self._views[zfl_PhotoFlipper.Front].getInner(),
5007v/100);zf_stdSetOpacity(self._views[zfl_PhotoFlipper.Back].getInner(),(100-v)/100);});this._animSpeed={s:100,t:1000};this.fullHeight=fullHeight;};zfl_PhotoFlipper.prototype.setUpscaleLimit=function(upscaleLimit){;
5008this._upscaleLimit=upscaleLimit;};zfl_PhotoFlipper.prototype.clear=function(){if(this._views[zfl_PhotoFlipper.Back])this._views[zfl_PhotoFlipper.Back].clear();if(this._views[zfl_PhotoFlipper.Front])this._views[zfl_PhotoFlipper.Front].clear();
5009this._attachOverlay(false);if(this.current)this.current.unadvise(this);this.current=null;this.dom().innerHTML="";this._views=[];};zfl_PhotoFlipper.prototype.update=function(photo,
5010context){;;if(this.current==photo)return;if(this.current)this.current.unadvise(this);;var forward=context.previousIndex<=context.currentIndex;
5010if(photo.loaded){if(this._availWidth!=null){;
5011this.set(photo);}if(context.photoList)this._prefetch(context.photoList,context.currentIndex,forward);}else{var self=this;photo.advise(this,function(){;self._set(photo);
5012self._prefetch(context.photoList,context.currentIndex,forward);});}this.current=photo;;this._forward=(context.previousIndex<context.currentIndex);if(this._overlay)this._overlay.update(photo,
5013context);};zfl_PhotoFlipper.prototype._centerInner=function(view,photo,method){photo=photo?photo:view.getPhoto();method=method?method:view.getMethod();var extent2=this._extent*2;
5014var size=photo.getScaledSize(method);var x=Math.floor((this._availWidth-(size.cx+extent2))/2);var y=this.fullHeight?Math.floor((this._availHeight-(size.cy+extent2))/2):0;
5015var inner=view.getInner();inner.style.top=y+'px';inner.style.left=x+'px';};zfl_PhotoFlipper.prototype._set=function(photo){;;if(this._availWidth==null){;return;};this._load(zfl_PhotoFlipper.Back,
5016photo);var front=this._views[zfl_PhotoFlipper.Front];;if(front&&front.getPhoto().id!=this.current.id)this._attachOverlay(false);};zfl_PhotoFlipper.prototype.getAvailSize=function(){return{cx:this._availWi
5016dth,
5017cy:this._availHeight};};zfl_PhotoFlipper.prototype.getPhotoSize=function(){var view=this._views[zfl_PhotoFlipper.Front];if(view&&view.getPhoto()){var extent2=this._extent*2;return{cx:view.__zfl_width-extent2,
5018cy:view.__zfl_height-extent2};}return{cx:0,cy:0};};zfl_PhotoFlipper.prototype.resize=function(width,height){;;var first=this._availWidth==null;if(!first&&this._availWidth==width&&this._availHeight==height){;
5019this._recalc(true);return true;}this._availWidth=width;this._availHeight=Math.max(height,zf_ProcessingMethod.StandardSmallSize.cy+this._extent*2);;if(first&&this.current&&this.current.loaded){;
5020;this._set(this.current);return true;}var view;var canresize=false;view=this._views[zfl_PhotoFlipper.Front];if(view&&view.getPhoto()){this._load(zfl_PhotoFlipper.Front,
5021view.getPhoto(),true);canresize=true;}view=this._views[zfl_PhotoFlipper.Back];if(view&&view.getPhoto())this._load(zfl_PhotoFlipper.Back,view.getPhoto(),true);if(this.fullHeight){this._recalc(true);
5022}return canresize;};zfl_PhotoFlipper.prototype.flip=function(){;this._stopTransition();var back=this._views[zfl_PhotoFlipper.Back];var front=this._views[zfl_PhotoFlipper.Front];
5023if(!back)return;back.onwait=null;this._attachOverlay(false);this._views[zfl_PhotoFlipper.Front]=back;this._views[zfl_PhotoFlipper.Back]=front;back=this._views[zfl_PhotoFlipper.Back];
5024front=this._views[zfl_PhotoFlipper.Front];if(back&&back.getPhoto()&&back.getPhoto().video)back.$('.pv-p').empty();zf_stdReplaceClassName(front.dom().parentNode,"none",
5025null);var now=new Date();var since=this._lastFlip?(now.getTime()-this._lastFlip.getTime()):0;this._lastFlip=now;var transition=this._transition&&this.transitionEnabled;
5026if(!back){this._flipDone(true,"first flip",false);return;}if(!transition){zf_stdDeferCall(this.id+".flipDone",this._flipDone,this,false,"skipping animation",false);
5027return;}this._recalc(true);;this._animTransition.jump("start");zf_stdReplaceClassName(front.dom().parentNode,"none",null);zf_stdReplaceClassName(front.dom().parentNode,
5028"invisible",null);this._animTransition.animate("end",this._animSpeed,this.closure(this._flipDone,false,"animation end",false));};zfl_PhotoFlipper._getPoolKey=function(photo,method){var bgid=photo.background&&photo.background.image&&photo.background.image.id;
5029return['-',photo.id,bgid?'-':'',bgid?bgid:'','-',method.code].join("");};zfl_PhotoFlipper.prototype._pickMethod=function(photo){var extent2=this._extent*2;
5029var width=this._availWidth-extent2;
5030var height=this._availHeight-extent2;if(this.relaxedHeight&&(photo.height>photo.width||this.browserScaling))height+=30;var method,methodWidth,methodHeight;if(!photo.video){methodWidth=width;
5031methodHeight=height;if(this.allowClipping){var aspectPhoto=photo.width/photo.height;var aspectView=width/height;if(aspectView<aspectPhoto)methodWidth=methodHeight*aspectPhoto;
5032else methodHeight=methodWidth/aspectPhoto;}var upscale=this._upscaleLimit||1.5;method=this.browserScaling?photo.pickScaledMethod(methodWidth,methodHeight,upscale):photo.pickMethod(methodWidth,
5033methodHeight);if(method){var clipSize=photo.getScaledSize(method);if(clipSize.cx>width||clipSize.cy>height)method=$.extend({},method,{cx:Math.min(width,clipSize.cx),
5034cy:Math.min(height,clipSize.cy),clip:true});}}else{methodWidth=width;methodHeight=height;if(this.extraVideoPadding){methodWidth-=(this.extraVideoPadding.cx||0)*2;
5035methodHeight-=(this.extraVideoPadding.cy||0)*2;}method=photo.pickVideoMethod(methodWidth,methodHeight);if(method)method=$.extend({},zf_ProcessingMethod.VideoPosterFrame,
5036{cx:method.cx,cy:method.cy});}return method;};zfl_PhotoFlipper.prototype._load=function(code,photo,resize,reload){;;this._stopTransition();var extent2=this._extent*2;var method=this._pickMethod(photo);
5037method=method||zf_ProcessingMethod.StandardSmallSize;;var context={method:method,data:photo,image:photo,oncommand:this._oncommand,oncommandtest:this._oncommandtest};
5038var size=photo.getScaledSize(method);var view=this._views[code];if(!reload&&view&&view.getPhoto()&&view.getPhoto().id==photo.id&&view.getMethod().code==method.code){;
5039if(view.getMethod().cx!=method.cx||view.getMethod().cy!=method.cy){;view.resize(context,photo,method);view.dom().style.padding=this._extent+"px";view.__zfl_height=size.cy+extent2;
5040view.__zfl_width=size.cx+extent2;if(code==zfl_PhotoFlipper.Front)this._recalc(true);}this._centerInner(view,photo,method);if(resize)return;if(!view.__zfl_state||view.__zfl_state==zf_PhotoLoader.Loading)return;
5041if(code==zfl_PhotoFlipper.Back&&this.onload){;this.onload(view.__zfl_state,true);}return;}this._queue=null;var styles="pf-plane "+zfl_Layout.formatDecorationClasses("pf",
5042this._decoration,method);if(code==zfl_PhotoFlipper.Back)styles+=" none invisible";if(view==null){;var plane=document.createElement("DIV");plane.id=this.id+"-plane"+zfl_PhotoFlipper._counter++;
5043plane.className=styles;var viewId=this.id+"-view"+zfl_PhotoFlipper._counter++;plane.innerHTML=zf_PhotoView.createHtml(viewId,null,null,this._plugins,context,photo,
5044method);this.dom().appendChild(plane);view=this._views[code]=new zf_PhotoView(viewId,this._plugins,context,plane.firstChild);view.waitTimeout=800;plane=null;}else{if(code==zfl_PhotoFlipper.Front)this._attachOverlay(false);
5045;view.reinit(null,null,null,context,photo,method);view.dom().parentNode.cssText=styles;}view.dom().style.padding=this._extent+"px";view.__zfl_height=size.cy+extent2;
5046view.__zfl_width=size.cx+extent2;this._centerInner(view,photo,method);inner=null;var key=zfl_PhotoFlipper._getPoolKey(photo,method);var loader=this._pool[key];if(loader==null||loader.onload!=null)loader=this._pool[key]=new zf_PhotoLoader(photo,
5047method);loader.setMethodSize(method);var immediate=(loader.state!=zf_PhotoLoader.Loading&&loader.state!=zf_PhotoLoader.Initialized);view.onload=this.closure(this._view_onload,
5048view,immediate,resize);if(code==zfl_PhotoFlipper.Back&&!resize)view.onwait=this.closure(this._view_onwait);view.load(loader,null,true);if(code==zfl_PhotoFlipper.Front)this._recalc(true);
5049var frontView=this._views[zfl_PhotoFlipper.Front];if(code==zfl_PhotoFlipper.Back&&frontView==null&&loader.state==zf_PhotoLoader.Loading){;this._view_onload(loader.state,
5050view,true,false);}else if(code==zfl_PhotoFlipper.Back&&photo.video&&loader.state==zf_PhotoLoader.Loading){;this._view_onload(loader.state,view,true,false);}else if(code==zfl_PhotoFlipper.Back&&frontView&&frontView.getPhoto()&&frontView.getPhoto().video&&loader.state==zf_PhotoLoader.Loading){;
5051this._view_onload(loader.state,view,true,false);}};zfl_PhotoFlipper.prototype._view_onload=function(state,view,immediate,resize){;view.__zfl_state=state;var back=this._views[zfl_PhotoFlipper.Back]==view;
5052var password=state==zf_PhotoLoader.PasswordRequired;this._showPassword(view,password,false);
5052if(!back&&state==zf_PhotoLoader.Complete){view.setSpecial(null);this._centerInner(view);
5053if(view.getPhoto().id==this.current.id)this._attachOverlay(true);if(this.ondisplay){;this.ondisplay(view.getPhoto(),false);}if(this.fullHeight&&this._availHeight){view.$('.pv-outer').height(this._availHeight-this._extent*2);
5054;}}else if(!back&&password&&this.onpassword){;this.onpassword();}if(back&&this.onload&&!resize){;this.onload(state,immediate);}if(!back&&state!=zf_PhotoLoader.Loading){zf_stdReplaceClassName(this.dom(),
5055null,"pf-loaded");this._delayPrefetching=false;if(this._postponedPrefetch){this._postponedPrefetch();this._postponedPrefetch=null;}}return state!=zf_PhotoLoader.Complete;
5056};zfl_PhotoFlipper.prototype._view_onwait=function(){var view=this._views[zfl_PhotoFlipper.Front];if(view)view.setSpecial("wait",true);};zfl_PhotoFlipper.prototype._attachOverlay=function(attach){var view=this._views[zfl_PhotoFlipper.Front];
5057if(!view||!this._overlay)return;var $overlay=$(view.getInner());if(!$overlay.length)return;if(attach){;this._overlay.attach($overlay.get(0));}else{;this._overlay.detach($overlay.get(0));
5058}};zfl_PhotoFlipper.prototype._showPassword=function(view,show,retry,message){;;;var id=view.id+"-password";;var dom=view.dom("password");if(!show){if(dom)dom.parentNode.removeChild(dom);
5059dom=null;zf_stdReplaceClassName(view.dom(),"pv-s-password",null);this.passwordEditing=false;return;}dom=document.createElement("DIV");dom.id=id;dom.className="pv-password";
5060view.setSpecial(null);zf_stdReplaceClassName(view.dom(),null,"pv-s-password");var content=[];content.push('<div class="password-box popup-border1 popup-color1 popup-bgcolor1">',
5061'<div class="text">Content protected with password.</div>','<div class="separator separator-border1"></div>','<div class="item none" id="',id,'-hint">','<div class="prompt">Hint:</div>',
5062'<div class="password-hint-text" id="',id,'-hint-text"></div>','</div>','<div class="form" id="',id,'-form">','<div class="item">','<div class="prompt">Password:</div>',
5063'<input id="',id,'-input" name="password" type="password" />','<a id="',id,'-go">Go</a>','</div>','</div>');if(retry){content.push('<div class="incorrect" id="',
5064id,'-incorrect">',zf_stdHtmlEncode(message)||'Incorrect password','</div>');}content.push('</div>');dom.innerHTML=content.join("");var inner=view.getInner();inner.appendChild(dom);
5065inner=null;dom=null;var self=this;var photo=view.getPhoto();var realmId=photo.access.realmId;var ownerId=photo.access.ownerId;;zfl_PasswordManager.retrieveHint(ownerId,
5066realmId,function(hint){if(hint!=null&&hint.length!=0){if(self.current!=null&&self.current.access!=null&&self.current.access.realmId==realmId){var divPHint=view.dom("password-hint");
5067var divPHText=view.dom("password-hint-text");if(divPHint!=null&&divPHText!=null){zf_stdReplaceClassName(divPHint,"none",null);zf_stdSetText(divPHText,hint);;}else{;
5068}}else{;}}});var key=zfl_PhotoFlipper._getPoolKey(photo,view.getMethod());var loader=this._pool[key];;if(!loader.__zfl_onunlock){loader.__zfl_onunlock=this.closure(this._password_onunlock,
5069loader);zfl_PasswordManager.subscribe(ownerId,realmId,loader.__zfl_onunlock);;}var handler=function(){var password=view.dom("password-input").value;;self._showPassword(view,
5070false);zfl_PasswordManager.validate(ownerId,realmId,password,self.closure(self._password_onpassword,photo),photo.id);};if(!retry)this.passwordEditing=false;view.dom("password-go").onclick=handler;
5071view.dom("password-input").onkeydown=function(e){self.passwordEditing=true;if(zf_stdGetEvent(e).keyCode==13)handler();};view.dom("password-input").onfocus=function(e){self.passwordEditing=true;
5072};if(retry){try{view.dom("password-input").focus();}catch(e){}}};zfl_PhotoFlipper.prototype._flipDone=function(immediate,source,forced){var back=this._views[zfl_PhotoFlipper.Back];
5073var front=this._views[zfl_PhotoFlipper.Front];;zf_stdSetOpacity(front.getInner(),1.0);zf_stdReplaceClassName(front.dom().parentNode,"invisible",null);if(back){var domBack=back.dom().parentNode;
5074zf_stdReplaceClassName(domBack,null,"none");zf_stdReplaceClassName(domBack,null,"invisible");back.clear();back.__zfl_height=null;back.__zfl_state=null;;}this._recalc(immediate);
5075if(front.__zfl_state!=zf_PhotoLoader.Loading){zf_stdReplaceClassName(this.dom(),null,"pf-loaded");}if(front.__zfl_state==zf_PhotoLoader.Complete){front.setSpecial(null);
5076this._centerInner(front);if(front.getPhoto().id==this.current.id)this._attachOverlay(true);;if(this.ondisplay)this.ondisplay(front.getPhoto(),forced);}else if(front.__zfl_state==zf_PhotoLoader.PasswordRequired){;
5077if(this.onpassword)this.onpassword();}};zfl_PhotoFlipper.prototype._recalc=function(immediate){;var height;if(this.fullHeight){height=this._availHeight;}else{var back=this._views[zfl_PhotoFlipper.Back];
5078var front=this._views[zfl_PhotoFlipper.Front];var inited=false;height=0;if(back&&!zf_stdHasClassName(back.dom().parentNode,"none")&&back.__zfl_height){height=Math.max(back.__zfl_height,
5079height);inited=true;}if(front&&!zf_stdHasClassName(front.dom().parentNode,"none")&&front.__zfl_height){height=Math.max(front.__zfl_height,height);inited=true;}if(!inited)height=this._availHeight;
5080}this.dom().style.height=height+"px";if(this._views[zfl_PhotoFlipper.Front]&&this.fullHeight)this._views[zfl_PhotoFlipper.Front].$('.pv-outer').height(height-this._extent*2);
5081;if(!immediate)this.notifyResize(false);};zfl_PhotoFlipper.prototype._stopTransition=function(){if(this._animTransition.inprogress){this._animTransition.jump("end");this._flipDone(true,
5082"transition interrupted",true);}};zfl_PhotoFlipper.prototype._prefetch=function(photoList,index,forward){if(this._delayPrefetching){;var self=this;this._postponedPrefetch=function(){;
5083self._prefetch(photoList,index,forward);};return;};;this._postponedPrefetch=null;var prefetch=8;var increment=forward?1:-1;this._queue=[];var loader;for(var i=0;
5084i<prefetch;i++){if(index<0||index>=photoList.length)break;var photo=photoList.get(index);index+=increment;
5084if(!photo.loaded)continue;if(photo.video)continue;var method=this._pickMethod(photo)||zf_ProcessingMethod.StandardSmallSize;
5085var key=zfl_PhotoFlipper._getPoolKey(photo,method);if(this._pool[key])continue;loader=new zf_PhotoLoader(photo,method);loader.__pool_key=key;this._queue.push(loader);
5086}if(this._queue.length==0)return;loader=this._queue[0];loader.onload=this.closure(this._prefetch_onload,loader);zf_stdDeferCall(this.id+loader.__pool_key,loader.start,
5087loader);};zfl_PhotoFlipper.prototype._prefetch_onload=function(state,src,loader){;if(!loader.onload)return;loader.onload=null;var key=loader.__pool_key;this._pool[key]=loader;if(!this._queue||loader!=this._queue[0])return;
5088if(this._queue.length<=1){this._queue=null;return;}this._queue.shift();loader=this._queue[0];loader.onload=this.closure(this._prefetch_onload,loader);zf_stdDeferCall(this.id+loader.__pool_key,
5089loader.start,loader);var self=this;setTimeout(function(){self._prefetch_onload(zf_PhotoLoader.Loading,null,loader);},1000);};zfl_PhotoFlipper.prototype._password_onunlock=function(loader){;
5090var front=this._views[zfl_PhotoFlipper.Front];var back=this._views[zfl_PhotoFlipper.Back];if(front&&(loader.photo==front.getPhoto()))this._showPassword(view,false);
5091var key=zfl_PhotoFlipper._getPoolKey(loader.getPhoto(),loader.getMethod());this._pool[key]=null;loader.__zfl_onunlock=null;if(front&&front.getPhoto()==loader.getPhoto()&&front.getMethod()==loader.getMethod())this._load(zfl_PhotoFlipper.Front,
5092front.getPhoto(),false,true);if(back&&back.getPhoto()==back.getPhoto()&&back.getMethod()==loader.getMethod())this._load(zfl_PhotoFlipper.Back,back.getPhoto(),false,
5093true);};zfl_PhotoFlipper.prototype._password_onpassword=function(unlocked,message,photo){;if(unlocked)return;var view=this._views[zfl_PhotoFlipper.Front];if(view&&view.getPhoto()==photo)this._showPassword(view,
5094true,true,message);};;function zfl_DimLights(id,flipper,actions){zfl_Control.prototype.constructor.call(this,id);this._flipper=flipper;this._actions=actions;this.visible=false;
5095var self=this;var createAnimation=function(pad){return new zf_Animation({"hidden":20,"semi":60,"pressed":80,"visible":100},function(v){zf_stdSetOpacity(self.dom(pad),
5096v/100);});};this._leftAnim=createAnimation("left");this._rightAnim=createAnimation("right");this._closeAnim=createAnimation("closebox");this._speed1={s:100,t:500};
5097this._speed2={s:100,t:250};this._speed3={s:100,t:400};this.dom().onmousemove=this.eventHandler(this._dimlights_onmousemove);this.dom().oncontextmenu=zf_stdFalse;
5098this.$dom().disableTextSelect();this._flipper.onload=this.closure(this._flipper_onload);this._flipper.ondisplay=this.closure(this._flipper_ondisplay);}zfl_DimLights.inherits(zfl_Control);
5099zfl_DimLights.prototype.init=function(decoration,plugins,overlayFlags,analytics,browserScaling){this._analytics=analytics;var self=this;oncommand=function(id){if(id!="addToFavorites"&&id!="removeFromFavorites")self.command("undimLights");
5100self.command.apply(self,arguments);};this.dom("close").onclick=function(){self.command("undimLights");};this.$dom("left").bind('mousedown touchstart',this.eventHandler(this._back));
5101this.$dom("right").bind('mousedown touchstart',this.eventHandler(this._next));this._flipper.init(decoration,plugins,overlayFlags,oncommand,this.commandtest,true,
5102null,browserScaling);if(this._actions){this._actions.commandtest=this.commandtest;this._actions.command=oncommand;}};zfl_DimLights.prototype.show=function(){if(this.visible)return;
5103this.visible=true;if(zfl_Popup.current)zfl_Popup.current.hide();zf_Curtain.show("darkest",null,null,$("#page-frame")[0]);this.layout.setCurrentFlipper(this._flipper);
5104if(this._analytics)this._analytics.registerLightsDimmed(this._flipper);this._show();};zfl_DimLights.prototype._show=function(){this.$dom().detach().appendTo("#page-frame");this._resizeHandler=this.eventHandler(this._window_onresize);
5105$(window).on("resize",this._resizeHandler);var cx=zf_stdGetClientWidth()-(16+120);var cy=zf_stdGetClientHeight();this.dom("center").style.top=Math.floor(cy/2)+"px";
5106if(this.current){if(this._actions)cy-=28;if(this.layout.zenbar.visible)cy-=35;this._flipper.resize(cx,cy);this._flipper.update(this.current,this.currentContext);
5107this._updateNavigation();if(this._actions)this._actions.update(this.current,this.currentContext);}this.display(true);var speed4={s:100,t:3000};this._leftAnim.jump("visible");
5108this._leftAnim.animate("hidden",speed4);this._rightAnim.jump("visible");this._rightAnim.animate("hidden",speed4);this._closeAnim.jump("visible");this._closeAnim.animate("hidden",
5109speed4);};zfl_DimLights.prototype.hide=function(){if(!this.visible)return;this.visible=false;if(this._resizeHandler){$(window).off("resize",this._resizeHandler);this._resizeHandler=null;
5110}this._flipper.clear();this.display(false);zf_Curtain.hide();};zfl_DimLights.prototype.update=function(photo,context){;;if(this.current==photo)return;this.current=photo;this.currentContext=context;
5111if(this.visible){this._flipper.update(photo,context);this._updateNavigation();if(this._actions)this._actions.update(photo,context);}};zfl_DimLights.prototype._window_onresize=function(){;
5112zf_stdDeferCall(this.id+".onresize",function(){var cx=zf_stdGetClientWidth()-(4+100);var cy=zf_stdGetClientHeight();if(this._actions)cy-=28;if(this.layout.zenbar.visible)cy-=35;
5113this.dom("center").style.top=Math.floor(cy/2)+"px";this._flipper.resize(cx,cy);},this);};zfl_DimLights.prototype._flipper_onload=function(state,immediate){this._flipper.flip();
5114};zfl_DimLights.prototype._flipper_ondisplay=function(photo){;if(this._actions)this._actions.photoDisplayed(true);};zfl_DimLights.prototype._updateNavigation=function(){this.dom("left").style.display=this.commandtest("back")?"block":"none";
5115this.dom("right").style.display=this.commandtest("next")?"block":"none";};zfl_DimLights.prototype._dimlights_onmousemove=function(e){var cxClient=zf_stdGetClientWidth();var cyClient=zf_stdGetClientHeight();
5116var hot=Math.abs(e.clientY-cyClient/2)<150;var hotLeft=hot&&e.clientX<220;var hotRight=hot&&e.clientX>cxClient-220;var warmClose=e.clientX>cxClient-250&&e.clientY<250;
5117var hotClose=e.clientX>cxClient-50&&e.clientY<50;hot=hot&&(!hotLeft&&!hotRight);if(!this._hotLeft&&hotLeft)this._leftAnim.animate("visible",this._speed2);else if(this._hotLeft&&!hotLeft)this._leftAnim.animate("hidden",
5118this._speed1);if(!this._hotRight&&hotRight)this._rightAnim.animate("visible",this._speed2);else if(this._hotRight&&!hotRight)this._rightAnim.animate("hidden",this._speed1);
5119if(!this._hot&&hot){this._leftAnim.animate("semi",this._speed1);this._rightAnim.animate("semi",this._speed1);}else if(this._hot&&!hot){if(!hotLeft)this._leftAnim.animate("hidden",
5120this._speed1);if(!hotRight)this._rightAnim.animate("hidden",this._speed1);}if(!this._hotClose&&hotClose)this._closeAnim.animate("visible",this._speed2);else if(!this._warmClose&&warmClose)this._closeAnim.animate("semi",
5121this._speed1);else if(this._warmClose&&!warmClose)this._closeAnim.animate("hidden",this._speed1);else if(this._hotClose&&!hotClose)this._closeAnim.animate("semi",
5122this._speed1);this._hot=hot;this._hotLeft=hotLeft;this._hotRight=hotRight;this._hotClose=hotClose;this._warmClose=warmClose;};zfl_DimLights.prototype._next=function(e){this.command("next");
5123this._rightAnim.jump("pressed");this._rightAnim.animate("visible",this._speed3);return false;};zfl_DimLights.prototype._back=function(e){this._leftAnim.jump("pressed");this._leftAnim.animate("visible",
5124this._speed3);this.command("back");return false;};zf_DimLightsStandalone=function(photos,startIndex,options){options=options||{};if(photos instanceof Array){photos.get=function(i){return this[i];
5125};}var noImage=new zf_PlaceholderImage(1),method=zf_ProcessingMethod.StandardSmallSize;var topOffset=options.toolbar?options.isToolbarLinks?30:40:10;if(options.showFileName){topOffset+=40;
5126}var decorations=options.decorations||$.extend(zfl_DecorationInfo(),{borderSize:2});var $domElement=$("#page-frame");if($domElement.length<=0){$domElement=$("body");
5127}var plugins=[new zfl_DecorationPlugin(decorations,zfl_PhotoViewStyle.DimLights),new zfl_WaitAnimationPlugin(true),new zf_VideoPlayerPlugin(function(c){return c;
5128})];function createToolbarItem(id,text,dropdown,separator){return['<span class="actions-item actions-',id,' none">','<a class="actions-link" href="#">','<span class="text">',
5129zf_stdHtmlEncode(text),'</span>',dropdown?'<span class="ddown ddown-font1">&nbsp;&#9660;</span>':'','</a>','</span>'].concat(separator?['<span class="actions-sep actions-',
5130id,'-sep none">|</span>']:[]).join('');}function createToolbar(){if(!options.toolbar)return '';return['<div class="actions">','<div class="actions-inner actions-font1 actions-color1 actions-left">',
5131createToolbarItem('addtocart','Buy',false,true),createToolbarItem('makezookalbum','Make an Album',false,true),createToolbarItem('createbook','Create a Book',false,
5132true),createToolbarItem('addtofav','Add To Favorites',false,true),createToolbarItem('removefromfav','Remove From Favorites',false,true),createToolbarItem('selectasyp',
5133'Select as Yearbook Pose',false,true),createToolbarItem('removefromyp','Remove From Yearbook Pose',false,true),createToolbarItem('download','Download',false,false),
5134'</div>','</div>'].join('');}var actionLinkStyle=options.isToolbarLinks?'dimlights-standalone-links':'dimlights-standalone-button';var html=['<div id="dimLights" class="dimlights dimlights-standalone ',
5135actionLinkStyle,' dimlights-decoration user-select-none lb">',createToolbar(),zf_PhotoView.createHtml('dimLights-pva',null,null,plugins,zf_PhotoView.EMPTY_CONTEXT,
5136noImage,method,false,0,0),'<div class="dimlights-center" id="dimLights-center" style="top: 567px;">','<div class="dimlights-pad dimlights-left" id="dimLights-left">',
5137'<div title="Previous - type Left Arrow" class="dimlights-button',options.useFa?' fa fa-angle-left':'','"></div>','</div>','<div class="dimlights-pad dimlights-right" id="dimLights-right">',
5138'<div title="Next - type Right Arrow" class="dimlights-button',options.useFa?' fa fa-angle-right':'','"></div>','</div>','</div>','<div id="dimLights-closebox" class="dimlights-closebox">',
5139'<div title="Close" class="dimlights-close',options.useFa?' fa fa-close':'','" id="dimLights-close"></div>','</div>','</div>'];function $dom(id){return $('#dimLights-'+id);
5140}function close(){options.onclose&&options.onclose();$(document).unbind('.dimLights');$(window).unbind('.dimLights');$('#dimLights').remove();zf_Curtain.hide();$('.chat').css('z-index',
514190);}function getUsableSize(){return{cx:window.innerWidth-(4+100),cy:window.innerHeight-($domElement.hasClass('zenbar-visible')?40:10)-topOffset};}function pickMethod(photo,
5142size){size=size||getUsableSize();var method;if(photo.video){method=photo.pickVideoMethod(size.cx,size.cy);method=$.extend({},zf_ProcessingMethod.VideoPosterFrame,
5143{cx:method.cx,cy:method.cy});}else{method=options.browserScaling?photo.pickScaledMethod(size.cx,size.cy,1.5):photo.pickMethod(size.cx,size.cy);}return method||zf_ProcessingMethod.StandardSmallSize;
5144}function resize(photo){var size=getUsableSize();photo=photo||pva.getPhoto();$('#dimLights').height(size.cy);if(photo){var method=pickMethod(photo,size);if(method.code!=pva.getMethod().code){jump(currentIndex);
5145return;}else pva.resize(photo,photo,method);$dom('pva').css({left:Math.round(52+(size.cx-method.cx)/2)+'px',top:Math.round((size.cy-method.cy)/2+topOffset)+'px'});
5146}$dom('center').css('top',Math.floor(size.cy/2+topOffset)+'px');position();}var loaders=[];function getLoader(photo,method){var loader=null;for(var i=0;i<loaders.length;
5147i++){loader=loaders[i];if(loader.getPhoto().id==photo.id&&loader.getMethod().code==method.code){loaders.splice(i,1);break;}loader=null;}if(loader&&loader.state==zf_PhotoLoader.PasswordRequired)loader=null;
5148loaders.push(loader=loader||new zf_PhotoLoader(photo,method));if(loaders.length>10)loaders.shift();return loader;}function fetch(index){zf_Loadable.notifyLoaded(photos.get(index),
5149function(photo){getLoader(photo,pickMethod(photo)).start();});}var currentIndex,currentPhoto,firstShow=true;function jump(index){currentIndex=index;$dom('left').toggle(index>0);
5150$dom('right').toggle(index<photos.length-1);currentPhoto&&pva.detachContext(currentPhoto);currentPhoto=null;pva.$().hide();var hideTime=$.now();pva.clear();onpassword(pva,
5151false);zf_Loadable.notifyLoaded(photos.get(index),function(photo){if(index!=currentIndex)return;plugins[2].autoPlay=firstShow&&index==startIndex;firstShow=false;
5152var method=pickMethod(photo);var loader=getLoader(photo,method);loader.start();function show(){pva.attachContext(currentPhoto=photo);pva.resize(photo,photo,method);
5153resize(photo);pva.onload=function(state){if(options.showFileName){var $fileName=pva.$(".pv-inner .dimlights-file-name");if($fileName.length<=0){$fileName=$('<div class="dimlights-file-name"></div>');
5154pva.$(".pv-inner").prepend($fileName);}$fileName.text(photo.fileName);}updateToolbar(state==zf_PhotoLoader.Complete?photo:null);if(state==zf_PhotoLoader.PasswordRequired)onpassword(pva,
5155true);return state==zf_PhotoLoader.PasswordRequired;};pva.load(loader,null,true);pva.$().show();$('.chat').css('z-index',10);Zenfolio.Global.LayoutService.registerVisit(photo,
5156options.photoSet);}show();position();});zf_stdDeferCall("dimLights.back",function(i){i>0&&fetch(i-1);},null,index);zf_stdDeferCall("dimLights.next",function(i){i<photos.length-1&&fetch(i+1);
5157},null,index);}function createAnimation(id){return new zf_Animation(options.animationStates||{hidden:20,semi:60,visible:100},function(v){var e=$dom(id)[0];e&&zf_stdSetOpacity(e,
5158v/100);});}if("zfl_Popup" in window&&zfl_Popup.current)zfl_Popup.current.hide();options.curtainAnimation=options.curtainAnimation||"darkest";zf_Curtain.show(options.curtainAnimation,
5159null,null,$domElement[0]);$domElement.append(html.join(''));var pva=new zf_PhotoView('dimLights-pva',plugins,zf_PhotoView.EMPTY_CONTEXT);var leftAnim=createAnimation("left"),
5160rightAnim=createAnimation("right"),closeAnim=createAnimation("closebox"),speed1={s:100,t:500},speed2={s:100,t:250}
5160,speed3={s:100,t:400},speed4={s:100,t:3000};$(window).bind('dtl-close.dimLights',
5161close);$(window).bind('resize.dimLights',function(){currentPhoto&&resize(currentPhoto);});$(document).bind('keydown.dimLights',function(e){if(suspended)return;if(e.altKey||e.ctrlKey||e.metaKey)return;
5162var sourceTag=e.target.tagName;if(sourceTag=="INPUT"||sourceTag=="TEXTAREA")return;switch(e.keyCode){case 13:case 32:if(currentPhoto&&(currentPhoto.flags&zf_PhotoFlags.Video)!=0)$(pva.getInner()).click();
5163break;case 27:close();break;case 37:$dom('left').filter(':visible').mousedown();break;case 39:$dom('right').filter(':visible').mousedown();break;case 70:if(!!options.onaddtofavorites&&!!options.scrapbook&&(!options.scrapbook.current||!options.scrapbook.current.map[zf_PhotoKey.getString(currentPhoto)]))options.onaddtofavorites(currentPhoto);
5164else options.onremovefromfavorites(currentPhoto);updateToolbar(currentPhoto);break;case 89:if(!!options.onselectasyearbookpose&&!!options.yearbook&&!currentPhoto.video&&(!zf_userId&&!options.yearbook.current||!!zf_userId&&zf_userId==zf_ownerId||!!options.yearbook.current&&(!options.yearbook.current.photo||options.yearbook.current.photo.id!=currentPhoto.id))){options.onselectasyearbookpose(currentPhoto,
5165function(){updateToolbar(currentPhoto);},true);}else if(!!options.onremovefromyearbookpose&&!!options.yearbook&&!!options.yearbook.current&&!!options.yearbook.current.photo&&options.yearbook.current.photo.id==currentPhoto.id){options.onremovefromyearbookpose(currentPhoto,
5166function(){updateToolbar(currentPhoto);},true);}break;default:return;}e.stopPropagation();e.preventDefault();});var status={hot:false,hotLeft:false,hotRight:false,
5167hotClose:false,warmClose:false};$('#dimLights').mousemove(function(e){var cxClient=window.innerWidth,cyClient=window.innerHeight,hot=Math.abs(e.clientY-cyClient/2)<150,
5168hotLeft=hot&&e.clientX<220,hotRight=hot&&e.clientX>cxClient-220,warmClose=e.clientX>cxClient-250&&e.clientY<250,hotClose=e.clientX>cxClient-100&&e.clientY<100;hot=hot&&(!hotLeft&&!hotRight);
5169!status.hotLeft&&hotLeft&&leftAnim.animate('visible',speed2);status.hotLeft&&!hotLeft&&leftAnim.animate('hidden',speed1);!status.hotRight&&hotRight&&rightAnim.animate('visible',
5170speed2);status.hotRight&&!hotRight&&rightAnim.animate('hidden',speed1);if(!status.hot&&hot){leftAnim.animate('semi',speed1);rightAnim.animate('semi',speed1);}else if(status.hot&&!hot){!hotLeft&&leftAnim.animate('hidden',
5171speed1);!hotRight&&rightAnim.animate('hidden',speed1);}if(!status.hotClose&&hotClose)closeAnim.animate('visible',speed2);else if(!status.warmClose&&warmClose)closeAnim.animate('semi',
5172speed1);else if(status.warmClose&&!warmClose)closeAnim.animate('hidden',speed1);else if(status.hotClose&&!hotClose)closeAnim.animate('semi',speed1);status={hot:hot,
5173hotLeft:hotLeft,hotRight:hotRight,hotClose:hotClose,warmClose:warmClose};}).disableTextSelect();zf_stdDisableRightClick($('#dimLights'));$dom('close').bind('mousedown touchstart',
5174function(e){e.preventDefault();e.stopPropagation();close();});$dom('left').bind('mousedown touchstart',function(e){e.preventDefault();e.stopPropagation();currentIndex>0&&jump(currentIndex-1);
5175});$dom('right').bind('mousedown touchstart',function(e){e.preventDefault();e.stopPropagation();currentIndex<photos.length-1&&jump(currentIndex+1);});$(pva.getInner()).click(function(e){if(currentPhoto&&(currentPhoto.flags&zf_PhotoFlags.Video)!=0)e.stopPropagation();
5176else if($(e.target).hasClass('pv-img'))close();});leftAnim.jump("visible");leftAnim.animate("hidden",speed4);rightAnim.jump("visible");rightAnim.animate("hidden",
5177speed4);closeAnim.jump("visible");closeAnim.animate("hidden",speed4);var $actions=$('#dimLights .actions:first');var suspended=false;$actions.find('.actions-addtocart a').iff(!!options.onaddtocart).click(function(){options.onaddtocart(currentPhoto);
5178return false;});$actions.find('.actions-makezookalbum a').iff(!!options.onmakezookalbum).click(function(){options.onmakezookalbum(currentPhoto);return false;});$actions.find('.actions-createbook a').iff(!options.onmakezookalbum&&!!options.oncreatebook).click(function(){options.oncreatebook(currentPhoto);
5179return false;});$actions.find('.actions-addtofav a').iff(!!options.onaddtofavorites).click(function(){options.onaddtofavorites(currentPhoto);updateToolbar(currentPhoto);
5180return false;});$actions.find('.actions-removefromfav a').iff(!!options.onremovefromfavorites).click(function(){options.onremovefromfavorites(currentPhoto);updateToolbar(currentPhoto);
5181return false;});$actions.find('.actions-selectasyp a').iff(!!options.onselectasyearbookpose).click(function(){options.onselectasyearbookpose(currentPhoto,function(){updateToolbar(currentPhoto);
5182},true);return false;});$actions.find('.actions-removefromyp a').iff(!!options.onremovefromyearbookpose).click(function(){options.onremovefromyearbookpose(currentPhoto,
5183function(){updateToolbar(currentPhoto);},true);return false;});$actions.find('.actions-download a').iff(!!options.ondownload).click(function(){$(document).on('pwdFormShowing.zflpd.zfldlsl',
5184function(){suspended=true;});$(document).on('pwdFormHidden.zflpd.zfldlsl',function(){suspended=false;
5184zf_Curtain.show(options.curtainAnimation,null,null,$domElement[0]);
5185});$(document).on('done.zflpd.zfldlsl',function(){$(document).off('.zfldlsl');});options.ondownload(currentPhoto);return false;});function updateToolbar(photo){var links=photo?{addtocart:!!options.onaddtocart&&photo.priceKey!='',
5186makezookalbum:!!options.onmakezookalbum&&photo.priceKey!='',createbook:!options.onmakezookalbum&&!!options.oncreatebook&&photo.priceKey!=''&&(photo.pricingProducts&zf_PricingProducts.PhotoBooks)==zf_PricingProducts.PhotoBooks,
5187addtofav:!!options.onaddtofavorites&&!!options.scrapbook&&(!options.scrapbook.current||!options.scrapbook.current.map[zf_PhotoKey.getString(photo)]),removefromfav:!!options.onremovefromfavorites&&!!options.scrapbook&&(!!options.scrapbook.current&&!!options.scrapbook.current.map[zf_PhotoKey.getString(photo)]),
5188selectasyp:!!options.onselectasyearbookpose&&!!options.yearbook&&!photo.video&&(!zf_userId&&!options.yearbook.current||!!zf_userId&&zf_userId==zf_ownerId||!!options.yearbook.current&&(!options.yearbook.current.photo||options.yearbook.current.photo.id!=photo.id)),
5189removefromyp:!!options.onremovefromyearbookpose&&!!options.yearbook&&!!options.yearbook.current&&!!options.yearbook.current.photo&&options.yearbook.current.photo.id==photo.id,
5190download:!!options.ondownload&&!photo.video&&(photo.access.mask&zf_AccessMask.ProtectOriginals)==0}:{addtocart:false,makezookalbum:false,createbook:false,addtofav:false,
5191removefromfav:false,selectasyp:false,removefromyp:false,download:false};var seps={addtocart:links.makezookalbum||links.createbook||links.addtofav||links.removefromfav||links.selectasyp||links.removefromyp||links.download,
5192makezookalbum:links.addtofav||links.removefromfav||links.selectasyp||links.removefromyp||links.download,createbook:links.addtofav||links.removefromfav||links.selectasyp||links.removefromyp||links.download,
5193addtofav:links.selectasyp||links.removefromyp||links.download,removefromfav:links.selectasyp||links.removefromyp||links.download,selectasyp:links.download,removefromyp:links.download,
5194download:false};for(var link in links)$actions.find('.actions-'+link).toggleClass('none',!links[link]);for(var sep in seps)$actions.find('.actions-'+sep+'-sep').toggleClass('none',
5195!(links[sep]&&seps[sep]));}function onpassword(view,show,retry,message){var $view=view.$dom();;if(!show){$view.removeClass('pv-s-password').find('.pv-password').remove();
5196return;}var id=view.id+'-password';var content=['<div class="pv-password">','<div class="password-box popup-border1 popup-color1 popup-bgcolor1">','<div class="text">Content protected with password.</div>',
5197'<div class="separator separator-border1"></div>','<div class="item none" id="',id,'-hint">','<div class="prompt">Hint:</div>','<div class="password-hint-text" id="',
5198id,'-hint-text"></div>','</div>','<div class="form" id="',id,'-form">','<div class="item">','<div class="prompt">Password:</div>','<input id="',id,'-input" name="password" type="password" />',
5199'<a id="',id,'-go">Go</a>','</div>','</div>',retry?['<div class="incorrect" id="',id,'-incorrect">',zf_stdHtmlEncode(message)||'Incorrect password','</div>'].join(''):'',
5200'</div>','</div>'].join('');$(content).appendTo(view.getInner());view.setSpecial(null,true);$view.addClass('pv-s-password');var photo=view.getPhoto();var realmId=photo.access.realmId;
5201var ownerId=photo.access.ownerId;;zfl_PasswordManager.retrieveHint(ownerId,realmId,function(hint){var current=view.getPhoto();if(hint&&hint.length&&current&&current.access&&current.access.realmId==realmId){view.$dom('password-hint').show();
5202view.$dom('password-hint-text').text(hint);}});var loader=getLoader(photo,method);if(!loader.__zfl_onunlock){loader.__zfl_onunlock=true;zfl_PasswordManager.subscribe(ownerId,
5203realmId,function(){if(view.getPhoto()===photo)jump(currentIndex);});}var handler=function(){var password=view.$dom('password-input').val();onpassword(view,false);
5204zfl_PasswordManager.validate(ownerId,realmId,password,function(unlocked,message){if(!unlocked&&view.getPhoto()===photo)onpassword(view,true,true,message);},photo.id);
5205return false;};view.$dom('password-go').click(handler);view.$dom('password-input').keydown(function(e){if(zf_stdGetEvent(e).keyCode==13)handler();});if(retry){try{view.$dom('password-input').focus();
5206}catch(e){}}}function position(){var marginTop=$domElement.hasClass('zenbar-visible')?32:0;$('#dimLights').css({'top':($(this).scrollTop()+marginTop)+'px','left':$(this).scrollLeft()+'px'});
5207}$(window).scroll(function(){position();});jump(startIndex);};;;;function zfl_AddressBar(updateable){this._updateable=updateable;if(!updateable){this.update=zf_stdFalse;return;
5208}this.set=zf_stdMakeDeferred("AddressBar",this.set);this.closure=zf_Control.prototype.closure;this._replaceInvoke=new zf_DelayedInvoke(600);this._hash=location.hash;
5209var self=this;this._track=function(){if(!self.current.loaded||self._replaceInvoke.pending)return;if(self._hash==location.hash)return;var id=zfl_AddressBar.parseHash(self.current.id,
5210false);
5210if(id!=self.current.id){;self._layout.navigate(id,true);}};}zfl_AddressBar.prototype.init=function(layout){;this._layout=layout;};zfl_AddressBar.prototype.update=function(photo,context){;
5211;if(this.current==photo)return;if(this.current!=null)this.current.unadvise(this);if(this.current==null)setInterval(this._track,500);this.current=photo;if(photo.loaded){this.set(photo,
5212context);}else{var self=this;photo.advise(this,function(){self.set(photo,context);});}};zfl_AddressBar.prototype.set=function(photo,context){;;var hash='#h'+photo.getUnsignedId().toString(16);
5213if(hash!=location.hash){var uri=[location.protocol,"//",location.host,location.pathname,location.search,hash].join("");this._locationReplace(uri,hash);}};zfl_AddressBar.prototype._locationReplace=function(uri,
5214hash){;this._hash=hash;location.replace(uri);;};zfl_AddressBar.parseHash=function(defaultValue,legacy){var hash=location.hash;var id=null;if(!hash||hash.length<2)return defaultValue;
5215if(hash.indexOf("#h")==0){id=zf_toInt32(parseInt(hash.substr(2),16));}else if(legacy){id=parseInt(hash.substr(1),10);}if(!id||isNaN(id))return defaultValue;return id;
5216};;function zf_Rect(left,top,width,height){if(arguments.length==0){this.left=0;this.top=0;this.width=0;this.height=0;}else{this.left=left;this.top=top;this.width=width;this.height=height;
5217}}zf_Rect.prototype.toString=function(precision){return "{"+[this.left.toPrecision(precision),this.top.toPrecision(precision),this.width.toPrecision(precision),this.height.toPrecision(precision)].join(",")+"}";
5218};zf_Rect.parse=function(rect){if(rect==null)return null;var re=/\{\s*(\d+(?:\.\d*)?(?:E[+-]\d+)?)\s*,\s*(\d+(?:\.\d*)?(?:E[+-]\d+)?)\s*,\s*(\d+(?:\.\d*)?(?:E[+-]\d+)?)\s*,\s*(\d+(?:\.\d*)?(?:E[+-]\d+)?)\s*}/;
5219var res=re.exec(rect);if(res==null)return null;return new zf_Rect(parseFloat(res[1]),parseFloat(res[2]),parseFloat(res[3]),parseFloat(res[4]));};zf_Rect.prototype.equalsTo=function(rect){if(!rect){return false;
5220}if(rect.left!=this.left||rect.top!=this.top||rect.width!=this.width||rect.height!=this.height){return false;}return true;};zf_Rect.prototype.round=function(){var intRect=new zf_Rect(Math.round(this.left),
5221Math.round(this.top),Math.round(this.width),Math.round(this.height));return intRect;};zf_Rect.prototype.clone=function(){return new zf_Rect(this.left,this.top,this.width,
5222this.height);};zf_Rect.prototype.toPlainObject=function(){return{left:this.left,top:this.top,width:this.width,height:this.height};};zf_Rect.create=function(arg1,top,width,height){if(arg1 instanceof zf_Rect){return arg1.clone();
5223}else if(typeof arg1=="number"&&typeof top=="number"&&typeof width=="number"&&typeof height=="number"){return new zf_Rect(arg1,top,width,height);}else{return new zf_Rect(arg1.left,
5224arg1.top,arg1.width,arg1.height);}};;;;function zfl_CommentAreaPlugin(){this._active=false;this._readOnly=false;this._onclose=null;this._areaRect=null;}zfl_CommentAreaPlugin.prototype.activate=function(attachment,
5225readOnly,onclose){;this._areaRect=(attachment!=null)?zf_Rect.parse(attachment):null;var dom=this._dom();this._cxArena=dom.parentNode.offsetWidth;this._cyArena=dom.parentNode.offsetHeight;
5226zf_stdReplaceClassName(dom,readOnly?"cap-active":"cap-active-ro",readOnly?"cap-active-ro":"cap-active");this._active=true;this._readOnly=readOnly;this._onclose=onclose;
5227if(this._areaRect!=null){this._workRect=this._toWorkRect(this._areaRect);this._moveRect(this._workRect);}else this._dom("oframe").style.visibility="hidden";var self=this;
5228if(!readOnly){dom.onmousedown=function(e){self._area_onmousedown(e);return false;};dom.onmouseup=function(e){self._area_onmouseup(e);};dom.onmousemove=function(e){self._area_onmousemove(e);
5229};dom.onselectstart=zf_stdFalse;}else{this._dom("close").onclick=function(){if(onclose!=null)onclose();self.deactivate();};}dom=null;};zfl_CommentAreaPlugin.prototype.deactivate=function(){;
5230zf_stdReplaceClassName(this._dom(),"cap-active",null);zf_stdReplaceClassName(this._dom(),"cap-active-ro",null);this._active=false;this._readOnly=false;this._onclose=null;
5231};zfl_CommentAreaPlugin.prototype.getAttachment=function(){return this._areaRect!=null?this._areaRect.toString(3):null;};zfl_CommentAreaPlugin.prototype.getInnerContent=function(id,context){return['<div class="cap-arena" oncontextmenu="return false;" id="',
5232id,'-cap">','<div class="cap-oframe" id="',id,'-cap-oframe">','<div class="cap-iframe" id="',id,'-cap-iframe"></div>','<div class="cap-close" id="',id,'-cap-close"></div>',
5233'</div>','</div>'].join("");};zfl_CommentAreaPlugin.prototype.onCreateDom=function(view,outer,inner,context,isNew){;this._id=view.id+"-cap";if(this._active)this.activate(this.getAttachment(),
5234this._readOnly,this._onclose);};zfl_CommentAreaPlugin.prototype._dom=function(id){return document.getElementById(id!=null?this._id+"-"+id:this._id);};zfl_CommentAreaPlugin.prototype._toWorkRect=function(rect){return new zf_Rect(rect.left*this._cxArena,
5235rect.top*this._cyArena,rect.width*this._cxArena,rect.height*this._cyArena);};zfl_CommentAreaPlugin.prototype._fromWorkRect=function(rect){return new zf_Rect(rect.left/this._cxArena,rect.top/this._cyArena,
5236rect.width/this._cxArena,rect.height/this._cyArena);};zfl_CommentAreaPlugin.prototype._moveRect=function(rect){var workLeft=rect.left;var workTop=rect.top;var workWidth=rect.width;var workHeight=rect.height;
5237var workRight=this._cxArena-workLeft-workWidth;var workBottom=this._cyArena-workTop-workHeight;var style;style=this._dom("oframe").style;style.visibility="inherit";
5238style.left=(workLeft-1)+"px";style.top=(workTop-1)+"px";style.width=workWidth+"px";style.height=workHeight+"px";style=this._dom("iframe").style;style.width=workWidth+"px";
5239style.height=workHeight+"px";};zfl_CommentAreaPlugin.prototype._area_onmousedown=function(e){if(this._readOnly)return;var dom=this._dom();e=zf_stdGetEvent(e);
5239if(document.addEventListener){document.addEventListener("mousemove",
5240dom.onmousemove,true);document.addEventListener("mouseup",dom.onmouseup,true);document.addEventListener("selectstart",dom.onselectstart,true);}else if(dom.setCapture)dom.setCapture();
5241this._dom("oframe").style.visibility="hidden";var pos=this._getEventPos(e);this._anchorX=pos.x;this._anchorY=pos.y;this._tracking=true;zf_stdStopPropagation(e);};
5242zfl_CommentAreaPlugin.prototype._area_onmouseup=function(e){if(!this._tracking)return;var dom=this._dom();e=zf_stdGetEvent(e);if(document.removeEventListener){document.removeEventListener("mousemove",
5243dom.onmousemove,true);document.removeEventListener("mouseup",dom.onmouseup,true);document.removeEventListener("selectstart",dom.onselectstart,true);}else if(dom.releaseCapture)dom.releaseCapture();
5244this._workRect=this._getTrackingRect(e);if(this._workRect.width<5||this._workRect.height<5){this._areaReact=null;this._dom("oframe").style.visibility="hidden";}else this._areaRect=this._fromWorkRect(this._workRect);
5245this._tracking=false;zf_stdStopPropagation(e);};zfl_CommentAreaPlugin.prototype._area_onmousemove=function(e){if(this._tracking)this._moveRect(this._getTrackingRect(zf_stdGetEvent(e)));
5246zf_stdStopPropagation(e);};zfl_CommentAreaPlugin.prototype._getTrackingRect=function(e){;var pos=this._getEventPos(e);var x=Math.min(Math.max(pos.x,0),this._cxArena);var y=Math.min(Math.max(pos.y,
52470),this._cyArena);if(x<this._anchorX)++x;if(y<this._anchorY)++y;return new zf_Rect(Math.min(x,this._anchorX),Math.min(y,this._anchorY),Math.abs(x-this._anchorX),
5248Math.abs(y-this._anchorY));};zfl_CommentAreaPlugin.prototype._getEventPos=function(e){var x=e.clientX-2;var y=e.clientY-2;y+=document.documentElement.scrollTop;var node=this._dom().offsetParent;
5249while(node!=null){x-=node.offsetLeft;y-=node.offsetTop;node=node.offsetParent;}return{x:x,y:y};};;;;function zfl_CommentCropPlugin(){this._active=false;this._readOnly=false;
5250this._onclose=null;this._cropRect=null;}zfl_CommentCropPlugin.prototype.activate=function(attachment,readOnly,onclose){;this._cropRect=attachment!=null?zf_Rect.parse(attachment):null;
5251if(this._cropRect==null)this._cropRect=new zf_Rect(0.1,0.1,0.8,0.8);var dom=this._dom();this._cxArena=dom.parentNode.offsetWidth;this._cyArena=dom.parentNode.offsetHeight;
5252this._workRect=this._toWorkRect(this._cropRect);this._moveRect(this._workRect);zf_stdReplaceClassName(dom,readOnly?"ccp-active":"ccp-active-ro",readOnly?"ccp-active-ro":"ccp-active");
5253this._active=true;this._readOnly=readOnly;this._onclose=onclose;var self=this;if(!readOnly){var onmousedown=function(e){self._handle_onmousedown(e);return false;
5254};var onmouseup=function(e){self._handle_onmouseup(e);};var onmousemove=function(e){self._handle_onmousemove(e);};var ids=["ne","nw","se","sw","frame"];for(var i=0;
5255i<ids.length;i++){handle=this._dom(ids[i]);handle.onmousedown=onmousedown;handle.onmouseup=onmouseup;handle.onmousemove=onmousemove;handle.onselectstart=zf_stdFalse;
5256}handle=null;dom=null;}else{this._dom("close").onclick=function(){if(onclose!=null)onclose();self.deactivate();};}};zfl_CommentCropPlugin.prototype.deactivate=function(){;zf_stdReplaceClassName(this._dom(),
5257"ccp-active",null);zf_stdReplaceClassName(this._dom(),"ccp-active-ro",null);this._active=false;this._readOnly=false;this._onclose=null;};zfl_CommentCropPlugin.prototype.getAttachment=function(){return this._cropRect.toString(3);
5258};zfl_CommentCropPlugin.prototype.getInnerContent=function(id,context){return['<div class="ccp-arena" oncontextmenu="return false;" id="',id,'-ccp">','<div class="ccp-shadow ccp-shadow-n" id="',
5259id,'-ccp-shadow-n"></div>','<div class="ccp-shadow ccp-shadow-w" id="',id,'-ccp-shadow-w"></div>','<div class="ccp-shadow ccp-shadow-e" id="',id,'-ccp-shadow-e"></div>',
5260'<div class="ccp-shadow ccp-shadow-s" id="',id,'-ccp-shadow-s"></div>','<div class="ccp-frame" id="',id,'-ccp-frame">','<div class="ccp-handle ccp-handle-nw" id="',
5261id,'-ccp-nw"></div>','<div class="ccp-handle ccp-handle-ne" id="',id,'-ccp-ne"></div>','<div class="ccp-handle ccp-handle-sw" id="',id,'-ccp-sw"></div>','<div class="ccp-handle ccp-handle-se" id="',
5262id,'-ccp-se"></div>','<div class="ccp-close" id="',id,'-ccp-close"></div>','</div>','</div>'].join("");};zfl_CommentCropPlugin.prototype.onCreateDom=function(view,outer,inner,context,
5263isNew){;this._id=view.id+"-ccp";if(this._active)this.activate(this.getAttachment(),this._readOnly,this._onclose);};zfl_CommentCropPlugin.prototype._dom=function(id){return document.getElementById(id!=null?this._id+"-"+id:this._id);
5264};zfl_CommentCropPlugin.prototype._toWorkRect=function(rect){return new zf_Rect(Math.round(rect.left*this._cxArena),Math.round(rect.top*this._cyArena),Math.round(rect.width*this._cxArena),
5265Math.round(rect.height*this._cyArena));};zfl_CommentCropPlugin.prototype._fromWorkRect=function(rect){return new zf_Rect(rect.left/this._cxArena,rect.top/this._cyArena,rect.width/this._cxArena,
5266rect.height/this._cyArena);};zfl_CommentCropPlugin.prototype._moveRect=function(rect){var workLeft=rect.left;var workTop=rect.top;var workWidth=rect.width;var workHeight=rect.height;
5267var workRight=this._cxArena-workLeft-workWidth;var workBottom=this._cyArena-workTop-workHeight;var style;style=this._dom("frame").style;style.left=(workLeft-2)+"px";
5268style.top=(workTop-2)+"px";style.width=workWidth+"px";style.height=workHeight+"px";this._dom("shadow-n").style.height=workTop+"px";this._dom("shadow-s").style.height=workBottom+"px";
5269style=this._dom("shadow-w").style;style.top=workTop+"px";style.height=workHeight+"px";style.width=workLeft+"px";style=this._dom("shadow-e").style;style.top=workTop+"px";
5270style.height=workHeight+"px";style.width=workRight+"px";};zfl_CommentCropPlugin.prototype._handle_onmousedown=function(e){if(this._readOnly)return;e=zf_stdGetEvent(e);var handle=e.target;
5271if(document.addEventListener){document.addEventListener("mousemove",handle.onmousemove,true);document.addEventListener("mouseup",handle.onmouseup,true);document.addEventListener("selectstart",
5272handle.onselectstart,true);}else if(handle.setCapture)handle.setCapture();this._anchorX=e.clientX;this._anchorY=e.clientY;this._track=handle.className.split(' ')[1];
5273if(this._track==null)this._track="frame";zf_stdStopPropagation(e);};zfl_CommentCropPlugin.prototype._handle_onmouseup=function(e){if(this._track==null)return;e=zf_stdGetEvent(e);var handle=e.target;
5274if(document.removeEventListener){document.removeEventListener("mousemove",handle.onmousemove,true);document.removeEventListener("mouseup",handle.onmouseup,true);
5275document.removeEventListener("selectstart",handle.onselectstart,true);}else if(handle.releaseCapture)handle.releaseCapture();this._workRect=this._getTrackingRect(e);
5276this._cropRect=this._fromWorkRect(this._workRect);this._track=null;zf_stdStopPropagation(e);};zfl_CommentCropPlugin.prototype._handle_onmousemove=function(e){if(this._track!=null)this._moveRect(this._getTrackingRect(zf_stdGetEvent(e)));
5277zf_stdStopPropagation(e);};zfl_CommentCropPlugin.prototype._getTrackingRect=function(e){;var left=this._workRect.left;var top=this._workRect.top;var right=left+this._workRect.width;var bottom=top+this._workRect.height;
5278;;;;var dx=e.clientX-this._anchorX;var dy=e.clientY-this._anchorY;var snapDelta=(e.ctrlKey||e.metaKey)?0:6;
5278switch(this._track){case "ccp-handle-nw":left=Math.min(Math.max(0,
5279left+dx),right-20);top=Math.min(Math.max(0,top+dy),bottom-20);if(left<snapDelta)left=0;if(top<snapDelta)top=0;break;case "ccp-handle-ne":right=Math.max(Math.min(this._cxArena,
5280right+dx),left+20);top=Math.min(Math.max(0,top+dy),bottom-20);if(right>this._cxArena-snapDelta)right=this._cxArena;if(top<snapDelta)top=0;break;case "ccp-handle-sw":left=Math.min(Math.max(0,
5281left+dx),right-20);bottom=Math.max(Math.min(this._cyArena,bottom+dy),top+20);if(left<snapDelta)left=0;if(bottom>this._cyArena-snapDelta)bottom=this._cyArena;break;
5282case "ccp-handle-se":right=Math.max(Math.min(this._cxArena,right+dx),left+20);bottom=Math.max(Math.min(this._cyArena,bottom+dy),top+20);if(right>this._cxArena-snapDelta)right=this._cxArena;
5283if(bottom>this._cyArena-snapDelta)bottom=this._cyArena;break;default:left=Math.max(0,left+dx);top=Math.max(0,top+dy);if(left<snapDelta)left=0;if(top<snapDelta)top=0;
5284right=Math.min(this._cxArena,left+this._workRect.width);bottom=Math.min(this._cyArena,top+this._workRect.height);if(right>this._cxArena-snapDelta)right=this._cxArena;
5285if(bottom>this._cyArena-snapDelta)bottom=this._cyArena;left=right-this._workRect.width;top=bottom-this._workRect.height;break;};;;;return new zf_Rect(left,top,right-left,
5286bottom-top);};;function zfl_CommentFinder(photoList,origin,forward,ondone){;;;this._cancelled=false;this._photoList=photoList;this._step=forward?1:-1;this._ondone=ondone;
5287this.found=null;this.index=null;this._checkPhoto(origin+this._step);}zfl_CommentFinder.inherits(zf_Object);zfl_CommentFinder.prototype._checkPhoto=function(index){if(this._cancelled)return;if(index<0||index>=this._photoList.length){this._done(false);
5288return;}var photo=this._photoList.get(index);if(!photo.loaded){photo.advise(this,this.closure(this._checkPhoto,index));return;}if((photo.flags&zf_PhotoFlags.HasComments)==0){this._checkNext(index);
5289return;}var meta=photo.getMeta();if(!meta.loaded){meta.advise(this,this.closure(this._checkPhoto,index));return;}if(meta.comments==0){this._checkNext(index);return;
5290}this._done(true,index);};zfl_CommentFinder.prototype._done=function(found,index){this.found=found;this.index=index;if(this._ondone&&!this._cancelled)this._ondone(found,index);};
5291zfl_CommentFinder.prototype._checkNext=function(index){index+=this._step;var self=this;if((index%20)==0)setTimeout(function(){self._checkPhoto(index);},5);else this._checkPhoto(index);
5292};zfl_CommentFinder.prototype.cancel=function(index){this._cancelled=true;};;function zfl_CommentBrowser(id,controls){zfl_Control.prototype.constructor.call(this,id);this._visible=false;this._editable=true;
5293this._aggregatedMask=0;this._controls=controls;var edit=controls.edit;this._edit=edit;this._flipper=controls.flipper;this._flipper.onload=this.closure(this._flipper_onload);
5294this._flipper.ondisplay=this.closure(this._flipper_ondisplay);var self=this;edit.onsave=this.closure(this._edit_onsave);edit.oncancel=this.closure(this._edit_oncancel);
5295edit.onlogin=function(){if(self.onlogin)self.onlogin();};edit.onattachment=this.closure(this._displayAttachment,false);edit.onerror=this.closure(this._edit_onerror);
5296var list=controls.list;this._list=list;list.onadd=this.closure(this.add);list.onlogin=edit.onlogin;list.onrequest=this.closure(this._list_onrequest);list.onedit=this.closure(this._list_onedit);
5297list.onselect=this.closure(this._list_onselect);list.ondeselect=this.closure(this._list_ondeselect);list.onattachment=this.closure(this._list_onattachment);list.ondelete=this.closure(this._list_onaction,
5298"deleteMessage");list.onundelete=this.closure(this._list_onaction,"undeleteMessage");list.oncensor=this.closure(this._list_onaction,"censorMessage");list.onuncensor=this.closure(this._list_onaction,
5299"uncensorMessage");list.onpurge=this.closure(this._list_onaction,"purgeMessage");list.onpublic=this.closure(this._list_onaction,"makePublic");
5299list.onprivate=this.closure(this._list_onaction,
5300"makePrivate");list.onapprove=this.closure(this._list_onaction,"approveMessage");var photoIndex=this._controls.photoIndex;if(photoIndex){photoIndex.update=function(photo,
5301context){this.set(context.currentIndex+1);};}this._setupAttachment=zf_stdFalse;this._compact=screen.width<=1200;if(this._compact)zf_stdReplaceClassName(this.dom(),
5302null,"cb-s-compact");zf_stdMakeMethodsDeferred(this,this.id,["_setupCommentFinders"]);}zfl_CommentBrowser.inherits(zfl_Control);zfl_CommentBrowser.prototype.init=function(decoration,plugins,overlayFlags){var self=this;
5303this.dom("close").onclick=function(){self.command("closeComments");};var command=function(id){self.command("closeComments");self.command(id);};this._cropPlugin=new zfl_CommentCropPlugin();
5304this._areaPlugin=new zfl_CommentAreaPlugin();plugins=[].concat(plugins,this._cropPlugin,this._areaPlugin);this._flipper.init(decoration,plugins,overlayFlags,command,
5305this.commandtest,true,null);this._extent=decoration!=null?(decoration.shadowSize+decoration.borderSize+decoration.extraSize):0;this.initialized=true;};zfl_CommentBrowser.prototype.show=function(add,
5306keepParent){if(this._visible)return;this._visible=true;this._editOnOpen=add;if(zfl_Popup.current)zfl_Popup.current.hide();zf_Curtain.show("dark");if(!keepParent){var dom=this.dom();
5307if(dom.parentNode!=document.body)document.body.appendChild(dom.parentNode.removeChild(dom));}this._resizeHandler=this.eventHandler(this._window_onresize);$(window).on("resize quickShopRecalc",
5308this._resizeHandler);this._keydownHandler=this.eventHandler(this._document_onkeydown);zf_stdAttachEvent(document,"keydown",this._keydownHandler);this.setMode("viewing");
5309this.display(true);this._recalcLayout();this.layout&&this.layout.setCurrentFlipper(this._flipper);if(this.current)this._update();};zfl_CommentBrowser.prototype.hide=function(){if(!this._visible)return;
5310this._visible=false;if(this._resizeHandler){$(window).off("resize quickShopRecalc",this._resizeHandler);this._resizeHandler=null;}if(this._keydownHandler){zf_stdDetachEvent(document,
5311"keydown",this._keydownHandler);this._keydownHandler=null;}this._flipper.clear();this.display(false);zf_Curtain.hide();};zfl_CommentBrowser.prototype.update=function(photo,context){;
5312;if(this.current==photo)return;if(this.current!=null){this.current.unadvise(this);this.current.getMeta().unadvise(this);}this.current=photo;this.currentContext=context;
5313this._mailbox=null;this._editOnOpen=false;if(this._visible)this._update();};zfl_CommentBrowser.prototype._update=function(){;;;var photo=this.current;var context=this.currentContext;
5314this.dom("back").style.visibility=this.commandtest("back")?"inherit":"hidden";this.dom("next").style.visibility=this.commandtest("next")?"inherit":"hidden";this._displayed=false;
5315this._prepared=false;for(var key in this._controls){var control=this._controls[key];if(control==null||typeof(control.update)!="function")continue;control.update(photo,
5316context);}this._list.setEditing(true);if(photo.loaded){this._setPhoto(photo);}else{var self=this;photo.advise(this,function(){self._setPhoto(photo);});}this._setupCommentFinders();
5317};zfl_CommentBrowser.prototype._window_onresize=function(){if(!this._visible)return;zf_stdDeferCall(this.id+".onresize",this._recalcLayout,this);};zfl_CommentBrowser.prototype._flipper_onload=function(state,
5318immediate){this._flipper.flip();};zfl_CommentBrowser.prototype._flipper_ondisplay=function(photo){;this._displayed=true;this._onload();this.onregistervisit&&this.onregistervisit(photo);
5319};zfl_CommentBrowser.prototype.next=function(e){this.command("next");};zfl_CommentBrowser.prototype.back=function(e){this.command("back");};zfl_CommentBrowser.prototype._recalcLayout=function(){var dom=this.dom();var getPixels=function(node,
5320a,b){return zf_stdExtractPixels(zf_stdGetCurrentStyle(node,a,b));};var clientWidth,clientHeight,isQuickShop=$(".qs-overlay").length>0;if(isQuickShop){clientWidth=$(window).width();
5321clientHeight=$(window).height();}else{clientWidth=zf_stdGetClientWidth();clientHeight=zf_stdGetClientHeight();}var x=34;var y=34;var cx=clientWidth-x*2;var cy=clientHeight-y*2;
5322var cxPadding=getPixels(dom,"border-left-width","borderLeftWidth")+getPixels(dom,"padding-left","paddingLeft")+getPixels(dom,"padding-right","paddingRight")+getPixels(dom,
5323"border-right-width","borderRightWidth");var cyPadding=getPixels(dom,"border-top-width","borderTopWidth")+getPixels(dom,"padding-top","paddingTop")+getPixels(dom,
5324"padding-bottom","paddingBottom")+getPixels(dom,"border-bottom-width","borderBottomWidth");cx-=cxPadding;cy-=cyPadding;cx=Math.max(cx,isQuickShop?678:900);cy=Math.max(cy,
5325(this._compact?550:720));var cxImage=cx-(this._compact?400:450)-2*this._extent;var cyImage=cy-(this._compact?30:150)-2*this._extent;var options=[{method:zf_ProcessingMethod.StandardSmallSize,
5326mask:0},{method:zf_ProcessingMethod.StandardMediumSize,mask:zf_AccessMask.ProtectMedium},{method:zf_ProcessingMethod.StandardLargeSize,mask:zf_AccessMask.ProtectLarge},
5327{method:zf_ProcessingMethod.StandardExtraLargeSize,mask:zf_AccessMask.ProtectExtraLarge},{method:zf_ProcessingMethod.StandardXXLargeSize,mask:zf_AccessMask.Protect
5327XXLarge}];
5328var method=zf_ProcessingMethod.StandardSmallSize;for(var i=1;i<options.length;i++){var option=options[i];if((option.mask&this._aggregatedMask)!=0)continue;if(option.method.cx>cxImage||option.method.cy>cyImage)break;
5329method=option.method;}cxImage=method.cx+2*this._extent+2;cyImage=method.cy+2*this._extent;y+=document.documentElement.scrollTop;dom.style.left=x+"px";dom.style.top=y+"px";
5330dom.style.width=cx+"px";dom.style.height=cy+"px";cy-=32;var left=this.dom("left");var right=this.dom("right");right.style.width=cx-cxImage-10-2+"px";right.style.height=cy-2+"px";
5331left.style.width=cxImage+"px";left.style.height=cy+"px";right.style.marginLeft=cxImage+10+"px";this._list.setHeight(cy-2);this._flipper.resize(cxImage,cyImage);};
5332zfl_CommentBrowser.prototype._setPhoto=function(photo){;zf_stdSetText(this.dom("title"),photo.title);this._mailbox=new zf_Mailbox(photo.owner.id,zf_MailboxType.PhotoComments,photo.id);
5333this._list.setAccess(photo.access.mask,zf_MailboxType.PhotoComments);this._edit.setAccess(photo.access.mask,zf_MailboxType.PhotoComments,photo.video);this.setMode("viewing");
5334this._displayAttachment(zf_AttachmentType.None,null,true);if((photo.flags&zf_PhotoFlags.HasComments)==0)this._list.reinit(0);var meta=photo.getMeta();if(meta.loaded){this._setMeta(meta);
5335}else{var self=this;meta.bump();meta.advise(this,function(){self._setMeta(meta);},function(){self._list.setLoading(true);});}};zfl_CommentBrowser.prototype._setMeta=function(meta){;
5336var list=this._list;list.reinit(meta.comments,meta.recentComments);if(meta.recentComments.length>0)list.select(meta.recentComments[0].index);this._prepared=true;
5337this._onload();};zfl_CommentBrowser.prototype.add=function(){if(!this._editable)return;this._edit.setOriginal(null);this.setMode("editing");};zfl_CommentBrowser.prototype._edit_onsave=function(updater){;
5338var self=this;var original=this._edit.getOriginal();this._setupAttachment(updater);this._editOnOpen=false;var photo=this.current;;var meta=photo.getMeta();;var list=this._list;
5339var onpost=function(message,error){if(!error){if(message!=null){if(self.current===photo){if(original!=null)list.deselect(original.index);list.add(message);list.select(message.index);
5340}meta.addComment(message);}else if(original!=null){if(self.current===photo)list.remove(original.index);meta.removeComment(original.index);}else{if(zf_userId==0){var msg=updater.isPrivate?"Your comment has been sent directly to the photographer. It will not appear in the list.":"Your comment will appear in this list once it is approved by the photographer.";
5341self._edit.setContinue(false,msg,function(){self.setMode("viewing");});return;}}self.setMode("viewing");return;}if(self.current===photo)self._edit.setContinue(true,
5342error.message,function(){self._edit.setContinue();});};if(original==null)zf_Message.postMessage(this._auth,this._mailbox,updater,onpost);else zf_Message.updateMessage(this._auth,
5343this._mailbox,original.index,updater,onpost);};zfl_CommentBrowser.prototype._edit_oncancel=function(){this.setMode("viewing");this._editOnOpen=false;var list=this._list;var selected=list.getSelectedView();
5344if(selected!=null){list.deselect(selected.getIndex());list.select(selected.getIndex());}else{this._displayAttachment(zf_AttachmentType.None,null,true);}};zfl_CommentBrowser.prototype.setMode=function(mode){;
5345this._mode=mode;if(mode=="editing"){this._auth=new zf_MailboxAuthorization(this._mailbox);zf_stdReplaceClassName(this.dom(),"cb-s-viewing","cb-s-editing");this.command("enableKeyNavigation",
5346false);this._edit.setFocus();}else{zf_stdReplaceClassName(this.dom(),"cb-s-editing","cb-s-viewing");this.command("enableKeyNavigation",true);this._list.setHeight();
5347}};zfl_CommentBrowser.prototype._list_onrequest=function(first,count){var self=this;var photo=this.current;;var meta=photo.getMeta();;var onload=function(messages,error){if(!error){meta.addComment(messages);
5348if(self.current===photo){self._list.add(messages);self._list.setHeight();}return;}};zf_Message.loadMessageRange(this._mailbox,photo.token,first,count,onload);};zfl_CommentBrowser.prototype._list_onedit=function(message){this._edit.setOriginal(message);
5349this.setMode("editing");};zfl_CommentBrowser.prototype._list_onaction=function(message,action){var self=this;var photo=this.current;;var meta=photo.getMeta();;var list=this._list;
5350var oncomplete=function(updated,error){if(!error){if(updated){meta.addComment(updated);if(self.current===photo){list.deselect(message.index);list.add(updated);list.select(updated.index);
5351}}else{meta.removeComment(message.index);if(self.current===photo)list.remove(message.index);}}self._list.setEditing(false);self._list.setHeight();};self._list.setEditing(true);
5352zf_Message[action](message.mailbox,message.index,oncomplete);};zfl_CommentBrowser.prototype._displayAttachment=function(attachmentType,attachment,readOnly){if(!this._displayed)return;
5353this._setupAttachment=zf_stdFalse;var help="";var icon="";if(attachmentType==zf_AttachmentType.None){this._areaPlugin.deactivate();this._cropPlugin.deactivate();
5354if(!readOnly)help="";}else if(attachmentType==zf_AttachmentType.CroppingSuggestion){this._areaPlugin.deactivate();this._cropPlugin.activate(attachment,readOnly,this.closure(this._plugin_onclose));
5355if(!readOnly){this._setupAttachment=function(updater){updater.attachmentType=zf_AttachmentType.CroppingSuggestion;updater.attachment=this._cropPlugin.getAttachment();
5356};help="Move or resize the cropping rectangle on the photo to suggest a different cropping";icon='<div class="cb-help-icon cb-help-icon-crop"></div>';}}else if(attachmentType==zf_AttachmentType.HighlightedArea){this._cropPlugin.deactivate();
5357this._areaPlugin.activate(attachment,readOnly,this.closure(this._plugin_onclose));if(!readOnly){this._setupAttachment=function(updater){updater.attachmentType=zf_AttachmentType.HighlightedArea;
5358updater.attachment=this._areaPlugin.getAttachment();};help="Draw a rectangle on the photo to highlight an area";icon='<div class="cb-help-icon cb-help-icon-area"></div>';
5359}}this.dom("help").innerHTML=['<div class="cb-help-text">','<span>',icon,zf_stdHtmlEncode(help),'</span>','</div>'].join("");};zfl_CommentBrowser.prototype._list_onselect=function(index){var view=this._list.getView(index);
5360var message=view.getMessage();this._displayAttachment(message.attachmentType,message.attachment,true);view.setAttachmentVisible(true);};zfl_CommentBrowser.prototype._list_ondeselect=function(index){var view=this._list.getView(index);
5361var message=view.getMessage();this._displayAttachment(zf_AttachmentType.None,null,true);view.setAttachmentVisible(false);};zfl_CommentBrowser.prototype._list_onattachment=function(message,
5362show){var selected=this._list.getSelectedView();if(!selected||selected.getIndex()!=message.index){this._list.select(message.index);}else{selected.setAttachmentVisible(show);
5363this._displayAttachment(show?message.attachmentType:zf_AttachmentType.None,message.attachment,true);}};zfl_CommentBrowser.prototype._onload=function(){if(!this._prepared||!this._displayed)return;
5364var photo=this.current;var meta=photo.getMeta();var list=this._list;;;list.setEditing(false);list.setLoading(false);
5364if(this._editOnOpen){this._editOnOpen=true;this.add();
5365}else{var selected=list.getSelectedView();if(selected!=null){var message=selected.getMessage();this._displayAttachment(message.attachmentType,message.attachment,
5366true);}else{this._displayAttachment(zf_AttachmentType.None,null,true);}}};zfl_CommentBrowser.prototype._list_onattachment=function(message,show){var selected=this._list.getSelectedView();
5367if(!selected||selected.getIndex()!=message.index){this._list.select(message.index);}else{selected.setAttachmentVisible(show);this._displayAttachment(show?message.attachmentType:zf_AttachmentType.None,
5368message.attachment,true);}};zfl_CommentBrowser.prototype._plugin_onclose=function(){var view=this._list.getSelectedView();if(view)view.setAttachmentVisible(false);};zfl_CommentBrowser.prototype._document_onkeydown=function(e){if(e.altKey||e.ctrlKey||e.metaKey)return true;
5369var sourceTag=zf_stdGetEventSource(e).tagName;if(sourceTag=="INPUT"||sourceTag=="TEXTAREA")return true;if(this._mode=="editing"){return false;}else{if(this._list.getSelectedView()==null)return true;
5370switch(e.keyCode){case 38:this._list.selectNext();break;case 40:this._list.selectPrevious();break;default:return false;}}zf_stdStopPropagation(e);zf_stdPreventDefault(e);
5371return true;};zfl_CommentBrowser.prototype._edit_onerror=function(message,error){if(!message){message=['<div class="cb-edit-new ml-new-prompt ml-font3">','Leave your comment below and click the Add Comment button',
5372'</div>'].join("");}else if(error){message=['<div class="ml-new-prompt ml-font3 me-color3">',message,'</div>'].join("");}else{message=['<div class="ml-new-prompt ml-font3">',
5373message,'</div>'].join("");}this.dom("error").innerHTML=message;};zfl_CommentBrowser.prototype._finder_ondone=function(found,index,forward){var button=this.dom(forward?"seekNext":"seekBack");
5374zfl_Button.enableButton(button,found,zfl_Button.Type.NavBtn);if(found){button.title=forward?"Next photo with comments":"Previous photo with comments";}else{button.title="No more photos with comments";
5375}};zfl_CommentBrowser.prototype._setupCommentFinders=function(){;if(this._finderBack)this._finderBack.cancel();if(this._finderNext)this._finderNext.cancel();var button;button=this.dom("seekBack");
5376zfl_Button.enableButton(button,false,zfl_Button.Type.NavBtn);button.title="Searching for photos with comments";this._finderBack=new zfl_CommentFinder(this.currentContext.photoList,
5377this.currentContext.currentIndex,false,this.closure(this._finder_ondone,false));button=this.dom("seekNext");zfl_Button.enableButton(button,false,zfl_Button.Type.NavBtn);
5378button.title="Searching for photos with comments";this._finderNext=new zfl_CommentFinder(this.currentContext.photoList,this.currentContext.currentIndex,true,this.closure(this._finder_ondone,
5379true));};zfl_CommentBrowser.prototype.seekBack=function(){if(this._finderBack&&this._finderBack.found)this.command("seek",this._finderBack.index);};zfl_CommentBrowser.prototype.seekNext=function(){if(this._finderNext&&this._finderNext.found)this.command("seek",
5380this._finderNext.index);};;;;;function zfl_RecentComments(id){zfl_Control.prototype.constructor.call(this,id);zf_stdMakeMethodsDeferred(this,this.id,["_setPhoto"]);}zfl_RecentComments.inherits(zfl_Control);
5381zfl_RecentComments.prototype.update=function(photo,context){;;if(this.current==photo)return;if(this.current!=null)this.current.unadvise(this);if(this.currentMeta!=null)this.currentMeta.unadvise(this);
5382this.current=photo;this.currentMeta=null;if(photo.loaded){this._setPhoto(photo);}else{var self=this;photo.advise(this,function(){self._setPhoto(photo);self.notifyResize(true);
5383},function(){self._showLoading();self.notifyResize(false);});}};zfl_RecentComments.prototype._setPhoto=function(photo){;if((photo.flags&zf_PhotoFlags.HasComments)==0){this._showComments(photo,
5384null);return;}var meta=photo.getMeta();if(meta.loaded){this._setMeta(meta);}else{this.currentMeta=meta;var self=this;meta.bump();meta.advise(this,function(){self._setMeta(meta);
5385self.notifyResize(false);},function(){self._showLoading();self.notifyResize(false);});}};zfl_RecentComments.prototype._setMeta=function(meta){;this._showComments(meta.photo,meta.recentComments);
5386};zfl_RecentComments.prototype._showLoading=function(){zf_stdReplaceClassName(this.dom(),"recentcomments-s-empty","recentcomments-s-loading");};zfl_RecentComments.prototype._showComments=function(photo,
5387comments){zf_stdReplaceClassName(this.dom(),"recentcomments-s-loading",null);var mask=zf_AccessMask.NoPublicComments|zf_AccessMask.NoPrivateComments;var canAdd=(photo.access.mask&mask)!=mask;
5388if(canAdd&&zf_userId==0)canAdd=(photo.access.mask&zf_AccessMask.NoAnonymousComments)==0;this.display((photo.access.mask&zf_AccessMask.ProtectComments)==0);zf_stdReplaceClassName(this.dom(),
5389canAdd?"recentcomments-s-no-add":null,canAdd?null:"recentcomments-s-no-add");var comment=null;if(comments){for(var i=0;i<comments.length;i++){if(!comments[i].isDeleted){comment=comments[i];
5390break;}}}if(!comment){zf_stdReplaceClassName(this.dom(),null,"recentcomments-s-empty");}else{var posterName;if(comment.posterUrl){posterName=['<a href="" id="',this.id,
5391'-poster-link" class="recentcomments-poster">',zf_stdHtmlEncode(comment.posterName),'</a>'];}else{posterName=['<span class="recentcomments-poster">',zf_stdHtmlEncode(comment.posterName),
5392'</span>'];}var content=['<div class="recentcomments-header">',zf_stdFormatString('Last comment by {0} on {1}:',posterName.join(""),['<span class="recentcomments-date recentcomments-font1 recentcomments-color1">',
5393zf_stdFormatDateTime(comment.postedOn),'</span>'].join("")),'</div>','<div class="recentcomments-text">',comment.body,'</div>'];this.dom("content").innerHTML=content.join("");
5394var posterLink=this.dom("poster-link");if(posterLink&&comment.posterUrl)posterLink.href=comment.posterUrl;var domCount=this.dom("count");if(domCount)zf_stdSetText(domCount,
5395photo.getMeta().comments);zf_stdReplaceClassName(this.dom(),"recentcomments-s-empty",null);}};zfl_RecentComments.prototype._view_onclick=function(){if(this.onshow)this.onshow();};
5396zfl_RecentComments.prototype._add_onclick=function(){if(this.onadd)this.onadd();};zfl_RecentComments.prototype.refresh=function(){if(this.current&&this.current.loaded&&this.current.getMeta().loaded)this._setPhoto(this.current);
5397};;function zf_DelayLoadScript(){}zf_DelayLoadScript.MAX_RETRIES=30;zf_DelayLoadScript.RETRY_TIMEOUT=500;zf_DelayLoadScript._scriptDescByUrl={};zf_DelayLoadScript._timerIsStarted=false;zf_DelayLoadScript._windowLoadFired=null;zf_DelayLoadScript.load=function(url,data){;if(typeof(data)=="function"){data={onLoad:data,
5398onInit:zf_stdTrue,isLoaded:zf_stdTrue,forceLoad:false};}else{if(typeof(data)=="undefined"||data==null)data={};if(typeof(data.onLoad)!="function")data.onLoad=zf_stdTrue;
5399if(typeof(data.onInit)!="function")data.onInit=zf_stdTrue;if(typeof(data.isLoaded)!="function")data.isLoaded=zf_stdTrue;if(typeof(data.forceLoad)!="function")data.forceLoad=false;
5400}var scriptDesc=zf_DelayLoadScript._scriptDescByUrl[url];var isRegistered=!!scriptDesc;if(!isRegistered){scriptDesc={onInit:data.onInit,isLoaded:data.isLoaded,isInitQueued:false,
5401isInitialized:false,tryCount:0,queue:[]};zf_DelayLoadScript._scriptDescByUrl[url]=scriptDesc;;}else{;}if(!scriptDesc.isInitialized){if(zf_DelayLoadScript._windowLoadFired===true){zf_DelayLoadScript._initScript(url);
5402}else{if(window.navigator.userAgent.indexOf("Chrome")!=-1){if(!scriptDesc.isInitQueued){$(window).load(function(){zf_DelayLoadScript._initScript(url);zf_DelayLoadScript._windowLoadFired=true;
5403if(!zf_DelayLoadScript._timerIsStarted)zf_DelayLoadScript._processLoaded();});scriptDesc.isInitQueued=true;;}}else if(data.forceLoad){zf_DelayLoadScript._initScript(url);
5404}else if(!scriptDesc.isInitQueued){$(window).load(function(){zf_DelayLoadScript._initScript(url);zf_DelayLoadScript._windowLoadFired=true;if(!zf_DelayLoadScript._timerIsStarted)zf_DelayLoadScript._processLoaded();
5405});scriptDesc.isInitQueued=true;;}}}scriptDesc.queue.push(data.onLoad);scriptDesc.tryCount=Math.max(scriptDesc.tryCount-zf_DelayLoadScript.MAX_RETRIES/2,0);if(scriptDesc.isInitialized&&!zf_DelayLoadScript._timerIsStarted)zf_DelayLoadScript._processLoaded();
5406};zf_DelayLoadScript._initScript=function(url){var scriptDesc=zf_DelayLoadScript._scriptDescByUrl[url];;if(scriptDesc.isInitialized){;return;};scriptDesc.onInit();var po=document.createElement('script');
5407po.type='text/javascript';po.async=true;po.src=url;var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(po,s);scriptDesc.isInitialized=true;
5408;};zf_DelayLoadScript._processLoaded=function(){;var minTryCount=123456789;for(var url in zf_DelayLoadScript._scriptDescByUrl){var scriptDesc=zf_DelayLoadScript._scriptDescByUrl[url];
5409;if(!scriptDesc.isInitialized){;continue;}if(scriptDesc.tryCount>=zf_DelayLoadScript.MAX_RETRIES){;continue;}if(!scriptDesc.isLoaded()){;minTryCount=Math.min(scriptDesc.tryCount,
5410minTryCount);scriptDesc.tryCount++;continue;}if(scriptDesc.queue.length==0)continue;while(scriptDesc.queue.length>0)(scriptDesc.queue.shift())();;}zf_DelayLoadScript._timerIsStarted=minTryCount<zf_DelayLoadScript.MAX_RETRIES;
5411if(zf_DelayLoadScript._timerIsStarted){var timeout=zf_DelayLoadScript.RETRY_TIMEOUT;if(minTryCount>=10)timeout*=2;setTimeout(function(){zf_DelayLoadScript._processLoaded();
5412},timeout);};};zf_DelayLoadScript.registerWindowLoad=function(){zf_DelayLoadScript._windowLoadFired=true;};function zfl_ApiDependentButton(id,renderImmediately,scriptUrl,tracePrefix){zfl_Control.prototype.constructor.call(this,
5413id);;;;;this._scriptUrl=scriptUrl;this._TP=tracePrefix;this._startApiRender(renderImmediately);}zfl_ApiDependentButton.inherits(zfl_Control);zfl_ApiDependentButton.prototype._onInit=zf_stdTrue;zfl_ApiDependentButton.prototype._onGetHtml=zf_stdTrue;
5414zfl_ApiDependentButton.prototype._onApiRender=zf_stdTrue;zfl_ApiDependentButton.prototype._isApiReady=zf_stdTrue;zfl_ApiDependentButton.prototype.update=function(photo){if(this.current)this.current.unadvise(this);this.current=photo;
5415var self=this;var renderPhoto=function(){self._render(photo.getHref('external'),photo.title?photo.title:"");};if(photo.loaded)renderPhoto();else photo.advise(this,
5416renderPhoto);};zfl_ApiDependentButton.prototype._render=function(href,text){this.$dom().html(this._onGetHtml(href,text));;this._startApiRender(false);};zfl_ApiDependentButton.prototype._startApiRender=function(renderImmediately){var key=new Date().getTime();
5417this._currentKey=key;zf_DelayLoadScript.load(this._scriptUrl,{onLoad:this.closure(this._apiRender,key),onInit:this.closure(this._onInit),isLoaded:this.closure(this._isApiReady),
5418forceLoad:renderImmediately});};zfl_ApiDependentButton.prototype._apiRender=function(key){if(key!=this._currentKey)return;try{this._onApiRender();;}catch(e){;}};function zfl_LikeButton(id,renderImmediately){renderImmediately=!!renderImmediately;
5419;if($("#fb-root").length==0)$("BODY").append('<div id="fb-root"></div>');zfl_ApiDependentButton.prototype.constructor.call(this,id,renderImmediately,"//connect.facebook.net/en_US/sdk.js",
5420"FB Like: ");}zfl_LikeButton.inherits(zfl_ApiDependentButton);zfl_LikeButton.prototype._onInit=function(){var channelUrl='//'+window.location.hostname+'/zf/core/static/fb
5420-channel.html',$el=$('.social-btns-fb');
5421window.fbAsyncInit=function(){window.FB.init({version:'v2.3',channelUrl:channelUrl,status:true,cookie:true,xfbml:false});window.FB.Event.subscribe('edge.create',
5422function(url,html_element){$el.height('250px');$(document).scrollTop(+350);var fbPollClosed=setInterval(function(){if($el.find('.fb-like IFRAME').height()<100){clearInterval(fbPollClosed);
5423$el.height('20px');}},1000);});};};zfl_LikeButton.prototype._onGetHtml=function(href){var likeWidth;var lang=window.navigator.language;if(lang==null||lang==undefined)lang=window.navigator.userLanguage;
5424if(lang==null||lang==undefined)likeWidth='120';else likeWidth=lang.indexOf('en')==-1?'120':'90';return['<div class="fb-like" ','data-href="',href,'" ','data-send="false" ',
5425'data-layout="button_count" ','data-width="',likeWidth,'" ','data-show-faces="false"></div>'].join('');};zfl_LikeButton.prototype._onApiRender=function(){window.FB.XFBML.parse(this.dom());
5426};zfl_LikeButton.prototype._isApiReady=function(){return typeof(window.FB)!="undefined"&&window.FB!=null&&window.FB.XFBML!=null&&typeof(window.FB.XFBML.parse)=="function";};;function zfl_TweetButton(id,
5427renderImmediately){renderImmediately=!!renderImmediately;;zfl_ApiDependentButton.prototype.constructor.call(this,id,renderImmediately,"https://platform.twitter.com/widgets.js",
5428"Twitter: ");}zfl_TweetButton.inherits(zfl_ApiDependentButton);zfl_TweetButton.prototype._onInit=function(){};zfl_TweetButton.prototype._onGetHtml=function(href,text){return['<a href="https://twitter.com/share" class="twitter-share-button"',
5429' data-url="',href,'" data-count="none" data-text="',zf_stdHtmlEncode(text),'">Tweet</a>'].join('');};zfl_TweetButton.prototype._onApiRender=function(){window.twttr.widgets.load();
5430};zfl_TweetButton.prototype._isApiReady=function(){return typeof(window.twttr)!="undefined"&&window.twttr!=null&&window.twttr.widgets!=null&&typeof(window.twttr.widgets.load)=="function";
5431};;function zfl_PinItButton(id){zfl_Control.prototype.constructor.call(this,id);}zfl_PinItButton.inherits(zfl_Control);zfl_PinItButton.prototype.update=function(photo){if(this.current)this.current.unadvise(this);
5432this.current=photo;var self=this;if(photo.loaded)this._render(photo);else photo.advise(this,function(){self._render(photo);});};zfl_PinItButton.prototype._render=function(photo){;
5433var owner=null;if(photo.photoSet!=null)owner=photo.photoSet.owner;else if(photo.gallery!=null)owner=photo.owner||photo.gallery.owner;var hostname=(!owner||!owner.domainName||owner.domainName=="")?document.location.hostname:owner.domainName;
5434var options={url:photo.getHref('external'),media:[zf_stdGetProtocol(hostname),hostname,photo.getExternalUrl(photo.pickMethod(10000,10000,true))].join(''),description:photo.title,
5435layout:'none',ref:location.href};var src=['https://www.pinterest.com/pin/create/button/?'];var i=0;for(var option in options){if(i++>0)src.push('&');src.push([option,
5436'=',encodeURIComponent(options[option])].join(''));}var html=['<a ','href="',src.join(''),'" target="_blank">','<img src="https://assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png" />',
5437'</a>'].join('');this.$dom().html(html);};;;function zfl_PhotoStrip(id,grid,pp,navigation){zfl_Control.prototype.constructor.call(this,id);this._pp=pp;this._grid=grid;this._navigation=navigation;
5438this._photoList=null;this._layout=null;grid.minRows=grid.maxRows=1;grid.setHeight(0);var self=this;grid.onselchange=function(item){if(self.onchange)self.onchange(item.index);
5439};grid.onlayoutchange=function(info){self.$('.pprev').toggle(info.firstVisible>0);self.$('.pnext').toggle(info.lastVisible<self._photoList.length);};this.$('.pbtn,.ibtn').hover(function(){$(this).removeClass('navigation-color1').removeClass('navigation-bgcolor1').removeClass('navigation-border1').addClass('navigation-color2').addClass('navigation-bgcolor2').addClass('navigation-border2');
5440},function(){$(this).removeClass('navigation-color2').removeClass('navigation-bgcolor2').removeClass('navigation-border2').addClass('navigation-color1').addClass('navigation-bgcolor1').addClass('navigation-border1');
5441});this.$('.inext').click(function(){self._layout.next();});this.$('.iprev').click(function(){self._layout.back();});this.$('.pnext').click(function(){self.nextPage();
5442});this.$('.pprev').click(function(){self.backPage();});this.$().disableTextSelect();zf_stdMakeMethodsDeferred(this,this.id,["select"]);}zfl_PhotoStrip.inherits(zfl_Control);zfl_PhotoStrip.prototype.select=function(index){this._grid.deselectAll();
5443this._grid.selectItem(index);this.$('.iprev').toggle(index>0);this.$('.inext').toggle(index<this._photoList.length);};zfl_PhotoStrip.prototype.setPhotos=function(layout,photoList){layout.initGrid(this._grid,
5444zfl_PhotoViewStyle.PhotoNavList,this._pp,function(index){return photoList.get(index);},photoList.length);this._photoList=photoList;this._layout=layout;};zfl_PhotoStrip.prototype.update=function(photo,
5445context){this.select(context.currentIndex);};zfl_PhotoStrip.prototype.nextPage=function(){var layoutInfo=this._grid.getLayoutInfo();if(this.onchange)this.onchange(layoutInfo.lastVisible);
5446};zfl_PhotoStrip.prototype.backPage=function(){var layoutInfo=this._grid.getLayoutInfo();if(layoutInfo.firstVisible>0&&this.onchange)this.onchange(layoutInfo.firstVisible-1);};
5447zfl_PhotoStrip.prototype.ensureVisible=function(index){var grid=this._grid;var pageIndex=grid.getItemPage(index);if(pageIndex!=grid.getPage()){grid.setPage(pageIndex);grid.recalcLayout();
5448}};zfl_PhotoStrip.prototype.recalcLayout=function(index){var grid=this._grid;var info=null;var recalc=false;if(grid.getSelectedItem()==null&&index>=0){info=grid.getLayoutInfo();
5449grid.setPage(Math.floor(index/info.itemsPerPage));recalc=true;}else{info=grid.getLayoutInfo(zf_PhotoGrid.KeepVisible);}var wasMultiPage=this.$().hasClass(this._navigation?'photostrip-mpn':'photostrip-mp');
5450var isMultiPage=info.totalPages>1;if(wasMultiPage!=isMultiPage){this.$().toggleClass(this._navigation?'photostrip-mpn':'photostrip-mp',isMultiPage);recalc=true;}info=grid.recalcLayout(recalc?null:info);
5451if(info.totalPages==1)this.$('.pg').css({width:info.usedWidth});else this.$('.pg').css({width:'auto'});};;var zf_PricingProducts={None:0,PhotoBooks:1};;;function zfl_PhotoLayout(id,
5452global,local,viewStyle){zfl_Layout.prototype.constructor.call(this,id,global,local);zfl_PhotoDownload.prototype.constructor.call(this,global.isAmdEnabled,global.isSmdEnabled,
5453global.maxSmdZipSize);var key;var self=this;this._photoSet=zfl_stdTransformResponse(local.photoSet,"photoSet");this._photoList=local.photoList;this._photoList.setDefaults(this._photoSet,
5454this._photoSet.owner);this._photoList.onload=this.closure(this._photoList_onload);this._photoList.onshrink=this.closure(this._photoList_onshrink);this._wrapPhotoList(this._photoList);
5455var callback=function(status,retVal){if(status==200||retVal.error==null){if(retVal.result!=""){window.location.href=retVal.result;}}};
5455if(this._photoSet.images==0){zf_stdServerRequest("GET",
5456"/zf/layout/layout.asmx","IsArchiveGallery",[this._photoSet.id],callback);}this._initial=local.initial;this.current={index:-1,photo:null,previousIndex:-2};this.slideshow=local.slideshow;
5457if(viewStyle==null)this._photoViewStyle=zfl_PhotoViewStyle.PhotoNavList;else this._photoViewStyle=viewStyle;var controls=this._controls;controls.list=controls.all;
5458controls.add(local.copyright);controls.add(local.caption);controls.add(local.shortExif);controls.add(local.categories);controls.add(local.photographer,this._photoSet.owner);
5459controls.add(local.addressBar,this);controls.add(this.header);controls.add(this.footer);controls.add(local.analytics);controls.add(local.mailboxLink);controls.add(local.recentComments);
5460controls.add(global.customizer);controls.add(local.likeButton);controls.add(local.tweetButton);controls.add(local.pinItButton);controls.analytics=local.analytics;
5461var controlBox=local.controlBox;if(controlBox){controls.controlBox=controls.add(local.controlBox,this._photoSet,null,this.zenbar);controlBox.onslide=function(id,
5462index){self._registerSlideVisit(index);};controlBox.oneditproduct=this.closure(this._editProduct);}controls.actions=controls.add(local.actions);var decoration,plugins,
5463overlayFlags;if(local.flipper){local.flipper.relaxedHeight=true;decoration=this._getDecorationInfo(local.flipper.style);plugins=this._createPlugins(local.flipper.style,
5464decoration);overlayFlags={exifIcon:local.overlayExif,addToFav:local.overlayAddToFav&&!!this.scrapbook,selectAsYP:local.overlaySelectAsYP&&!!this.yearbook,menuBar:local.overlayMenu||this.administrator,
5465message:local.overlayMenu||this.administrator,download:local.overlayDownload,collect:local.overlayCollect,contextMenu:true,dimLights:!this.slideshow,defaultCommand:!this.slideshow?"dimLights":null};
5466controls.flipper=controls.add(local.flipper,decoration,plugins,overlayFlags,this._handlers.oncommand,this._handlers.oncommandtest,this.slideshow,this.slideshow?"slow-fade":null,
5467local.browserScaling);controls.flipper.onload=this.closure(this._flipper_onload);this.setCurrentFlipper(controls.flipper);}var cookieControl=controls.addDeferredUpdate("setRecentCookie",
5468function(photo,context){zfl_SessionCookie.current.setRecent(self._photoSet.id,context.currentIndex);});if(local.dimlights){decoration=this._getDecorationInfo(zfl_PhotoViewStyle.DimLights);
5469plugins=this._createPlugins(zfl_PhotoViewStyle.DimLights,decoration);overlayFlags={download:local.overlayDownload,contextMenu:true,undimLights:true,defaultCommand:"undimLights"};
5470controls.dimlights=controls.add(local.dimlights,decoration,plugins,overlayFlags,local.analytics,local.browserScaling);controls.dimlights.ondisplay=this.closure(this._registerVisit);
5471controls.listDimLights=[local.dimlights,cookieControl,local.addressBar,local.analytics];}if(local.comments){var commentsOptions=this.getCommentsOptions(local.overlayDownload);
5472controls.comments=controls.add(local.comments,commentsOptions.decoration,commentsOptions.plugins,commentsOptions.overlayFlags);controls.comments.ondisplay=this.closure(this._registerVisit);
5473controls.listComments=[local.comments,cookieControl,local.addressBar,local.analytics];if(local.mailboxLink){local.mailboxLink.onshow=this.closure(this._showComments,
5474false);local.mailboxLink.onadd=this.closure(this._showComments,true);controls.mailboxLink=local.mailboxLink;}if(local.recentComments){local.recentComments.onshow=this.closure(this._showComments,
5475false);local.recentComments.onadd=this.closure(this._showComments,true);controls.recentComments=local.recentComments;}controls.comments.onlogin=zfl_Header.login;
5476}if(local.quickPriceList){controls.add(local.quickPriceList,this.zenbar);local.quickPriceList.addtocart=this.closure(this._addToCart);}for(key in this._pairs){var pair=this._pairs[key];
5477if(!pair)continue;if(pair.field=="PhotoPage.PhotoIndexOf"){pair.update=function(photo,context){this.set(context.currentIndex+1);};if(this._initial.shrunk)pair.set(this._photoList.length,
54781);}if(pair.field=="PhotoPage.Viewed")controls.pairViewed=pair;controls.add(pair);}
5478this._navigation=local.navigation;var navNext=this._navigation.next;var navBack=this._navigation.back;
5479if(navNext&&navBack){;controls.addDeferredUpdate("updateNavigation",function(photo,context){navBack.visibility(context.currentIndex>0);navNext.visibility(context.currentIndex<context.photoList.length-1);
5480});}this._pager=local.pager;var pager=this._pager;var grid=this._grids.photos;if(grid){controls.addDeferredUpdate("selectGridItem",function(photo,context){grid.deselectAll();
5481grid.selectItem(context.currentIndex);});}if(grid&&pager){grid.onlayoutchange=function(info){pager.update(info.totalPages,info.currentPage);};pager.onchange=function(page){grid.setPage(page);
5482grid.recalcLayout();};}controls.strip=controls.add(local.strip);if(this.scrapbook)this.scrapbook.onchange=this.closure(this._scrapbook_onchange);if(this.yearbook)this.yearbook.onchange=this.closure(this._yearbook_onchange);
5483zf_stdMakeMethodsDeferred(this,this.id,["_ensureThumbnailVisible","_registerVisit"]);this._delayedViewsUpdate=new zf_DelayedInvoke(500);this.cyMinFooter=15;this._keyNavigation=true;
5484this._allowSaveImages=local.overlayDownload;this._fakeVideoOriginals=local.fakeVideoOriginals;}zfl_PhotoLayout.inherits(zfl_Layout,zfl_PhotoDownload);zfl_PhotoLayout.prototype.onrecalc=function(){zfl_Layout.prototype.onrecalc.call(this);
5485if(this._controls.strip)this._controls.strip.recalcLayout(this.current.index);};zfl_PhotoLayout.prototype.onload=function(){zfl_Layout.prototype.onload.call(this);var self=this;
5486if(this._grids.photos){var photoList=this._photoList;this.initGrid(this._grids.photos,this._photoViewStyle,this._grids.photosParams,function(index){return photoList.get(index);
5487},photoList.length);this._grids.photos.onselchange=function(item){self.seek(item.index);};}if(this._controls.strip){this._controls.strip.setPhotos(this,this._photoList);
5488this._controls.strip.onchange=function(index){self.seek(index);};};;var legacy=location.search.indexOf("photo=")!=-1;if(this._returnData){var returnToPhotoKey=this._returnData.returnToPhotoKey();
5489if(returnToPhotoKey&&this._returnData.pageType==zf_ReturnPageType.PhotoPage&&this._returnData.photoSetId==this._photoSet.id){window.location.hash='#h'+zf_toUint32(zf_PhotoKey.fromString(returnToPhotoKey).photoId).toString(16);
5490if(this._returnData.hasAddToCartPhotoKeys()){Zenfolio.Global.AddToCartService.updateReturnData(this._returnData);}else{this._returnData=null;}}else{this._returnData=null;
5491}}var id=zfl_AddressBar.parseHash(this._initial.id,legacy);if(legacy){;this.navigate(id);return;}if(this._initial.index<0){;this.navigate(id);return;}if(this._initial.index==0&&id==0&&(/\/h0(\/slideshow)?\/?$/).test(location.pathname)){var cookie=zfl_SessionCookie.current;
5492if(this._photoSet.id==cookie.recentPhotoSetId&&cookie.recentPhotoIndex>=0){;this._initial.index=cookie.recentPhotoIndex;}else{;}}if(id!=this._initial.id){;this._photoList.get(this._initial.index);
5493this._initial.index=-1;this._initial.id=id;}else if(this._photoList.length==0){location.href=this._photoSet.getHref();}else{;this.seek(this._initial.index);}if(this._controls.analytics)this._controls.analytics.registerLayoutLoad(this._controls.flipper);
5494};zfl_PhotoLayout.prototype._photoList_onload=function(first){;if(first){if(this._initial.shrunk){var photo=this._photoList.get(0);;if(photo.access.type==zf_AccessType.Password&&photo.access.realmId==this._photoSet.access.realmId){var self=this;
5495zfl_PasswordManager.subscribe(photo.access.ownerId,photo.access.realmId,function(){self.navigate(photo.id,true);});}}if(this._initial.index<0){;;this.navigate(this._initial.id);
5496}}this.recalc();};zfl_PhotoLayout.prototype._photoList_onshrink=function(){;if(this.current.photo!=null&&this.current.photo.loaded)this.navigate(this.current.photo.id,true);else if(this._initial.id)this.navigate(this._initial.id,
5497true);return false;};zfl_PhotoLayout.prototype._redirect=function(photoId){;var dest=[];dest.push(this._photoSet.getBaseHref());if(photoId!=null)dest.push("/e",zf_toUint32(photoId).toString(16));
5498if(this.slideshow)dest.push("/slideshow");var query=location.search.replace("photo=h","legacy=x");dest.push(query);dest=dest.join("");location.replace(dest);};zfl_PhotoLayout.prototype.navigate=function(photoId,
5499reload){if(!photoId){;this._redirect(photoId);return;}if(reload){;this._redirect(photoId);return;}var index=this._photoList.find(photoId);if(index<0){;this._redirect(photoId);
5500return;};this.seek(index);};zfl_PhotoLayout.prototype.seek=function(index){;;var start=new Date().getTime();var photo=this._photoList.get(index);if(index!=this.current.index){this.current.previousIndex=this.current.index;
5501this.current.displayed=false;}if(this.current.photo)this.current.photo.unadvise(this);this.current.index=index;this.current.photo=photo;var context={currentIndex:index,
5502previousIndex:this.current.previousIndex,photoList:this._photoList};var list=this._controls.list;for(var i=0;i<list.length;i++){if(list[i])list[i].update(photo,context);
5503}this._prefetchMeta(this.current.index>=this.current.previousIndex);this.recalc(true);if(!this._dimmed)this._ensureThumbnailVisible();zfl_Popup.hideAny();if(this._returnData&&this._returnData.hasAddToCartPhotoKeys()&&zf_PhotoKey.getString(photo)==this._returnData.returnToPhotoKey()){this._returnData=null;
5504Zenfolio.Global.AddToCartService.updateReturnData(null);zf_Loadable.notifyLoaded(photo,this.closure(function(){if(photo.id==this.current.photo.id){this._addToCart();
5505}}));};};zfl_PhotoLayout.prototype.next=function(){if(this.current.index>=0&&this.current.index<this._photoList.length-1){this.seek(this.current.index+1);}};zfl_PhotoLayout.prototype.back=function(){if(this.current.index>0){this.seek(this.current.index-1);
5506}};zfl_PhotoLayout.prototype.nextPage=function(){;var layoutInfo=this._grids.photos.getLayoutInfo();this.seek(layoutInfo.lastVisible);};zfl_PhotoLayout.prototype.backPage=function(){;var layoutInfo=this._grids.photos.getLayoutInfo();
5507if(layoutInfo.firstVisible>0)this.seek(layoutInfo.firstVisible-1);};zfl_PhotoLayout.prototype.getCommands=function(){var self=this;var photo=function(){return self.current.photo;
5508};var desc={common:{test:function(id){return this.current.photo&&this.current.photo.loaded&&this.current.displayed||id=="next"||id=="back";}},addToCart:{test:function(){return photo().priceKey!=""&&photo().owner.id==this._photoSet.owner.id;
5509},exec:function(id,options){this._addToCart(options);}},makeZookAlbum:{test:function(){return self.canMakeZookbindersAlbum&&self._handlers.oncommandtest("addToCart");
5510},exec:function(id){this._makeZookAlbum(self.isGspAlbumFlow);}},createBook:{test:function(){return!self.canMakeZookbindersAlbum&&self._handlers.oncommandtest("addToCart")&&(photo().pricingProducts&zf_PricingProducts.PhotoBooks)==zf_PricingProducts.PhotoBooks;
5511},exec:function(id,options){this._createBook(options);}},editProduct:{test:zf_stdTrue,exec:function(id,info){this._editProduct(info);}},confirmProduct:{test:zf_stdTrue,
5512exec:function(id,info){this._confirmProduct(info);}},share:{test:function(){return this._controls.controlBox&&this._controls.controlBox.canShare();},exec:function(){this._controls.controlBox.share();
5513}},dimLights:{test:function(id,params){return this._controls.dimlights&&params.dimLights;},exec:function(){this._dimmed=true;this._controls.list=this._controls.listDimLights;
5514this._controls.dimlights.show();}},undimLights:{test:function(){return this._controls.dimlights&&this._controls.dimlights.visible;},exec:function(){this._dimmed=false;
5515this._controls.list=this._controls.all;this.setCurrentFlipper(this._controls.flipper);this.seek(this.current.index);this._controls.dimlights.hide();}},censorPhoto:{test:function(){return this.administrator&&!photo().access.isCensored;
5516},exec:function(){if(!confirm(photo().video?"Are you sure that you want to censor this video?":"Are you sure that you want to censor this photograph?"))return;zf_stdServerRequest("POST",
5517"/zf/layout/layout.asmx","CensorPhoto",[photo().id,true],function(){self._redirect(photo().id);});}},uncensorPhoto:{test:function(){return this.administrator&&photo().access.isCensored;
5518},exec:function(){zf_stdServerRequest("POST","/zf/layout/layout.asmx","CensorPhoto",[photo().id,false],function(){self._redirect(photo().id);});}},censorGallery:{test:function(){return this.administrator&&photo().photoSet.type==zf_PhotoSet.Gallery;
5519},exec:function(){if(!confirm("Are you sure that you want to censor this entire gallery?"))return;
5519zf_stdServerRequest("POST","/zf/layout/layout.asmx","CensorGallery",
5520[this._photoSet.id],function(){self._redirect();});}},purgeGallery:{test:"censorGallery",exec:function(){if(!confirm("Are you sure that you want to immediately and permanently detele all photographs from this gallery?"))return;
5521zf_stdServerRequest("POST","/zf/layout/layout.asmx","PurgeGallery",[this._photoSet.id],function(){location.href="/p"+photo().photoSet.id;});}},makeSearchable:{test:function(){return this.administrator&&(this._photoSet.adminFlags&1)==1;
5522},exec:function(){zf_stdServerRequest("POST","/zf/layout/layout.asmx","SetSearchable",[this._photoSet.id,this._photoSet.owner.id,true],function(){self._redirect();
5523});}},makeNotSearchable:{test:function(){return this.administrator&&(this._photoSet.adminFlags&1)==0;},exec:function(){if(!confirm("Are you sure that you want to make this entire set unsearchable?"))return;
5524zf_stdServerRequest("POST","/zf/layout/layout.asmx","SetSearchable",[this._photoSet.id,this._photoSet.owner.id,false],function(){self._redirect();});}},purgePhoto:{test:"admin",
5525exec:function(){if(!confirm("Are you sure that you want to immediately and permanently detele this photograph?"))return;zf_stdServerRequest("POST","/zf/layout/layout.asmx",
5526"PurgePhoto",[photo().id],function(){self._redirect();});}},collect:{test:function(id,params){return params.collect&&(photo().access.mask&zf_AccessMask.NoCollections)==0;
5527}},collectNew:{test:"collect",exec:function(){zfl_CollectionList.current.addPhotoToNew("Quick Collection",photo().id,photo().owner.id);}},collectEdit:{test:"collect",
5528exec:function(){var url=[zf_stdGetProtocol(zf_defaultHost),zf_defaultHost,"/",zf_userName,"/edit"];location.href=zf_stdGetTransferUrl(url.join(""));}},collectPhoto:{test:"collect",
5529exec:function(id,collectionId){zfl_CollectionList.current.addPhoto(collectionId,photo().id,photo().owner.id);}},collectLogin:{test:"collect",exec:function(){zfl_Header.login(photo().getHref("full"),
5530"collect."+photo().id);}},back:{test:function(){return this.current.index>0;},exec:function(){this.back();}},next:{test:function(){return this.current.index<this._photoList.length-1;
5531},exec:function(){this.next();}},seek:{exec:function(id,index){this.seek(index);}},enableKeyNavigation:{test:function(){return this._keyNavigation;},exec:function(id,
5532enable){this._keyNavigation=enable;}},addToFavorites:{test:function(){return!!this.scrapbook&&photo().owner.id==this._photoSet.owner.id&&(!this.scrapbook.current||!this.scrapbook.current.map[zf_PhotoKey.getString(photo())]);
5533},exec:function(id,purchase){this._addToFavorites(purchase);}},removeFromFavorites:{test:function(){return!!this.scrapbook&&!!this.scrapbook.current&&!!this.scrapbook.current.map[zf_PhotoKey.getString(photo())];
5534},exec:function(){this.scrapbook.removePhotos([zf_PhotoKey.getString(photo())]);if(this._currentFlipper)this._currentFlipper.ondisplay(photo());}},openFavorites:{test:function(){return!!this.scrapbook;
5535},exec:function(){if(!!this._controls.dimlights&&this._controls.dimlights.visible)this._handlers.oncommand("undimLights");this.scrapbook.show();}},selectAsYearbookPose:{test:function(){return!!this.yearbook&&!photo().video&&(!zf_userId&&!this.yearbook.current||!!zf_userId&&zf_userId==zf_ownerId||!!this.yearbook.current&&(!this.yearbook.current.photo||this.yearbook.current.photo.id!=photo().id));
5536},exec:function(id,updateUICallback){this._selectAsYearbookPose(updateUICallback);}},removeFromYearbookPose:{test:function(){return!!this.yearbook&&!!this.yearbook.current&&!!this.yearbook.current.photo&&this.yearbook.current.photo.id==photo().id;
5537},exec:function(id,updateUICallback){var self=this;this.yearbook.removePhoto(photo(),function(){if(self._currentFlipper){self._currentFlipper.ondisplay(photo());
5538}},updateUICallback);}},openComments:{exec:function(){this._showComments(false);}},closeComments:{exec:function(){this._dimmed=false;this._controls.list=this._controls.all;
5539this.setCurrentFlipper(this._controls.flipper);this.seek(this.current.index);if(this._controls.mailboxLink)this._controls.mailboxLink.refresh();if(this._controls.recentComments)this._controls.recentComments.refresh();
5540if(this._controls.comments)this._controls.comments.hide();}}};$.extend(desc,Zenfolio.Global.LayoutService.createDownloadCommands(function(){return{administrator:self.administrator,
5541fakeVideoOriginals:self._fakeVideoOriginals,photo:photo(),photoSet:self._photoSet,photoList:self._photoList};},{downloadOriginal:this.closure(this._downloadOriginal),
5542downloadOriginals:this.closure(this._downloadOriginals)},function(){return self._handlers.oncommandtest;}));var parent=zfl_Layout.prototype.getCommands.call(this);
5543$.each(parent,function(k,v){if(!desc[k])desc[k]=v;});return desc;};zfl_PhotoLayout.prototype._photo_onstretch=function(height,stretcher){var flipper=this._controls.flipper;if(flipper){var width=stretcher.offsetWidth;
5544if(!flipper.resize(width,height)){stretcher.style.height=height+"px";}else{stretcher.style.height=flipper.dom().style.height;}this._updateFlipperDependencies();return true;
5545}return false;};zfl_PhotoLayout.prototype._flipper_onload=function(state,immediate){var flipper=this._controls.flipper;;flipper.flip();this._updateFlipperDependencies();if(!immediate)this.recalc(false);
5546};zfl_PhotoLayout.prototype._flipper_ondisplay=function(photo){;if(this.current.photo==photo)this.current.displayed=true;var controlBox=this._controls.controlBox;if(controlBox&&controlBox.current==photo)controlBox.photoDisplayed(true);
5547var actions=this._controls.actions;if(actions&&actions.current==photo)actions.photoDisplayed(true);var flipper=this._controls.flipper,overlay;if(flipper&&(overlay=flipper._overlay)&&overlay.current==photo)overlay.photoDisplayed(true);
5548if(photo.loaded)this._registerVisit(photo);if(photo.loaded&&photo.video&&photo.sizes==undefined){photo.sizes={};zf_stdServerRequestEx("GET","/zf/layout/layout.asmx",
5549"GetMethodSizes",[zf_ownerId,photo.id,photo.token],function(result,error){if(error==null)photo.sizes=result;});}};zfl_PhotoLayout.prototype._ensureThumbnailVisible=function(){;
5550var grid=this._grids.photos;if(grid){var pageIndex=grid.getItemPage(this.current.index);if(pageIndex!=grid.getPage()){grid.setPage(pageIndex);grid.recalcLayout();
5551}}if(this._controls.strip)this._controls.strip.ensureVisible(this.current.index);};zfl_PhotoLayout.prototype._prefetchMeta=function(forward){var increment=forward?1:-1;var prefetch=5;
5552var index=this.current.index+(prefetch-1)*increment;for(var i=0;i<prefetch;i++){if(index<0||index>=this._photoList.length)continue;var photo=this._photoList.get(index);
5553var meta=photo.getMeta();meta.bump();index-=increment;}};zfl_PhotoLayout.prototype._document_onkeydown=function(e){zfl_Layout.prototype._document_onkeydown.apply(this,arguments);
5554if(e.isPropagationStopped())return true;if(e.altKey||e.ctrlKey||e.metaKey)return true;var sourceTag=e.target.tagName;if(sourceTag=="INPUT"||sourceTag=="TEXTAREA")return true;
5555switch(e.which){case 39:if(this._keyNavigation)this.next();return false;case 37:if(this._keyNavigation)this.back();return false;case 70:if(this._handlers.oncommandtest("addToFavorites"))this._handlers.oncommand("addToFavorites");
5556else if(this._handlers.oncommandtest("removeFromFavorites"))this._handlers.oncommand("removeFromFavorites");return false;case 89:if(this._handlers.oncommandtest("selectAsYearbookPose"))this._handlers.oncommand("selectAsYearbookPose");
5557else if(this._handlers.oncommandtest("removeFromYearbookPose"))this._handlers.oncommand("removeFromYearbookPose");return false;case 27:if(this._dimmed){this._handlers.oncommand("undimLights");
5558this._handlers.oncommand("closeComments");return false;}break;default:break;}return true;};zfl_PhotoLayout.prototype._registerVisit=function(photo){;var self=this;var pair=this._controls.pairViewed;
5559var oncomplete=function(status,retVal){;if(status==200&&retVal.result==true){if(!photo.views)photo.views=1;else++photo.views;if(pair){self._delayedViewsUpdate.invoke(function(){if(pair.current==photo)pair.set(photo.views);
5560});}}};Zenfolio.Global.LayoutService.registerVisit(photo,this._photoSet,oncomplete);};zfl_PhotoLayout.prototype._registerSlideVisit=function(photoIndex){var photo=this._photoList.get(photoIndex);
5561;if(photo.loaded){if(photo.access.type==zf_AccessType.Password&&!zfl_PasswordManager.check(photo.access.ownerId,photo.access.realmId))return;this._registerVisit(photo);
5562}else{var self=this;photo.advise({},function(){self._registerSlideVisit(photoIndex);});}};zfl_PhotoLayout.prototype._showComments=function(add){this._dimmed=true;this._controls.list=this._controls.listComments;
5563this._controls.comments.show(add);};zfl_PhotoLayout.prototype.adjustWidthOnFlipperResize=function(){var flipper=this._controls.flipper;if(!flipper)return;if(flipper.__zfl_widthdeps==null)flipper.__zfl_widthdeps=[];
5564for(var i=1;i<arguments.length;i++){var control=arguments[i];if(control==null)continue;flipper.__zfl_widthdeps.push(control);}};zfl_PhotoLayout.prototype._updateFlipperDependencies=function(){var flipper=this._controls.flipper;
5565if(!flipper)return;if(flipper.__zfl_widthdeps){var width=flipper.getPhotoSize().cx;width=Math.max(Math.min(width,600),300);for(var i=0;i<flipper.__zfl_widthdeps.length;
5566i++){var control=flipper.__zfl_widthdeps[i];control.dom().style.width=width+"px";}}};zfl_PhotoLayout.prototype._addToCart=function(options){;;if(!this.zenbar)return;options=options?options:{};
5567options.allPhotos=this._photoList;options.returnData=this._getReturnData();this.zenbar.addToCart(options)([this.current.photo]);};zfl_PhotoLayout.prototype._createBook=function(options){;
5568;if(!this.zenbar)return;options=options?options:{};options.allPhotos=this._photoList;options.categoryId="photobooks-new";options.returnData=this._getReturnData();
5569this.zenbar.addToCart(options)([this.current.photo]);};zfl_PhotoLayout.prototype._getReturnData=function(){return $.extend(new zf_ReturnData(),{pageType:zf_ReturnPageType.PhotoPage,
5570photoKey:zf_PhotoKey.getString(this.current.photo),photoSetId:this._photoSet.id});};zfl_PhotoLayout.prototype._getReturnPages=function(keys){if(this._photoSet.type==zf_PhotoSet.Gallery){return null;
5571}return zf_ReturnData.getReturnPages(keys,zf_ReturnPageType.PhotoSetPage,{photoSetId:this._photoSet.id,gridShowAll:false});};zfl_PhotoLayout.prototype._wrapPhotoList=function(photoList){if(this._photoSet.type==zf_PhotoSet.Gallery){return photoList;
5572}return zf_ReturnData.wrapPhotoList(photoList,zf_ReturnPageType.PhotoSetPage,{photoSetId:this._photoSet.id,gridShowAll:false});};zfl_PhotoLayout.prototype._makeZookAlbum=function(isGspAlbumFlow){zf_ZookbindersUtils.makeZookAlbumFromPhotoList(this.zenbar,
5573this._photoList,isGspAlbumFlow);};zfl_PhotoLayout.prototype._editProduct=function(info){;;if(!this.zenbar)return;var setPhotos=this.zenbar.editProduct(info,{allPhotos:this._photoList});
5574setPhotos(this.current.photo);};zfl_PhotoLayout.prototype._confirmProduct=function(info){if(!this.zenbar)return;var confirmationScreen=this.zenbar.confirmProduct();confirmationScreen(info);
5575};zfl_PhotoLayout.prototype._addToFavorites=function(purchase){if(!this.scrapbook)return;;var keys=[zf_PhotoKey.getString(this.current.photo)];this.scrapbook.addPhotos(keys,purchase,
5576null,this._getReturnPages(keys));if(this._currentFlipper)this._currentFlipper.ondisplay(this.current.photo);};zfl_PhotoLayout.prototype._selectAsYearbookPose=function(updateUICallback){if(!this.yearbook){return;
5577};var self=this;this.yearbook.addPhoto(this.current.photo,function(){if(self._currentFlipper){self._currentFlipper.ondisplay(self.current.photo);}},updateUICallback);
5578};zfl_PhotoLayout.prototype._download=function(){this._downloadOriginal(this.current.photo);};zfl_PhotoLayout.prototype._scrapbook_onchange=function(info,edit){if(this.zenbar)this.zenbar.setScrapbookInfo(info,
5579edit);if(info&&info.addedCount!=undefined){var message=null;if(info.failedCount>0)message="An error has occurred while trying to add these photos to favorites.";
5580if(message)zfl_MessageBox.show({text:message,buttons:["OK"]});}if(this._currentFlipper)this._currentFlipper.ondisplay(this.current.photo);};zfl_PhotoLayout.prototype._yearbook_onchange=function(yearbookPose){if(!yearbookPose){zfl_MessageBox.show({text:"Can\x27t update your yearbook pose.",
5581buttons:["OK"]});}if(this._currentFlipper){this._currentFlipper.ondisplay(this.current.photo);}};zfl_PhotoLayout.prototype.setCurrentFlipper=function(flipper){var oldflipper=this._currentFlipper;
5582if(flipper===oldflipper)return;if(oldflipper){oldflipper.ondisplay=oldflipper.__chained_ondisplay;oldflipper.__chained_ondisplay=null;}if(flipper){flipper.__chained_ondisplay=flipper.ondisplay;
5583var self=this;flipper.ondisplay=function(photo,forced){if(flipper.__chained_ondisplay)flipper.__chained_ondisplay(photo,forced);self._flipper_ondisplay(photo,forced);
5584};}this._currentFlipper=flipper;};;;;function zfl_TabGroup(id,tabs){if(zf_stdNoArgs(arguments))return;zfl_Control.prototype.constructor.call(this,id);this._tabs={};for(var i=0;
5585i<tabs.length;i++){this._tabs[tabs[i].key]=tabs[i];var dom=document.getElementById(tabs[i].id);dom.onmouseover=zfl_TabGroup._switch_onmouseover;dom.onmouseout=zfl_TabGroup._switch_onmouseout;
5586}}zfl_TabGroup.inherits(zfl_Control);zfl_TabGroup._switch_onmouseover=function(event){var dom=zf_stdGetEventSource(event);
5586if(zf_stdHasClassName(dom,"tab-label"))dom=dom.parentNode;if(zf_stdHasClassName(dom,
5587"tab-standard")){zf_stdReplaceClassName(dom,"tab-standard","tab-hover");zf_stdReplaceClassName(dom,"tab-bgcolor2","tab-bgcolor3");zf_stdReplaceClassName(dom,"tab-bgimage2",
5588"tab-bgimage3");zf_stdReplaceClassName(dom,"tab-color2","tab-color3");}};zfl_TabGroup._switch_onmouseout=function(event){var dom=zf_stdGetEventSource(event);if(zf_stdHasClassName(dom,
5589"tab-label"))dom=dom.parentNode;if(zf_stdHasClassName(dom,"tab-hover")){zf_stdReplaceClassName(dom,"tab-hover","tab-standard");zf_stdReplaceClassName(dom,"tab-bgcolor3",
5590"tab-bgcolor2");zf_stdReplaceClassName(dom,"tab-bgimage3","tab-bgimage2");zf_stdReplaceClassName(dom,"tab-color3","tab-color2");}};zfl_TabGroup._restyle=function(id,selected){var dom=document.getElementById(id);
5591if(selected){zf_stdReplaceClassName(dom,"tab-standard",null);zf_stdReplaceClassName(dom,"tab-hover","tab-selected");zf_stdReplaceClassName(dom,"tab-bgcolor3",null);
5592zf_stdReplaceClassName(dom,"tab-bgcolor2","tab-bgcolor1");zf_stdReplaceClassName(dom,"tab-bgimage3",null);zf_stdReplaceClassName(dom,"tab-bgimage2","tab-bgimage1");
5593zf_stdReplaceClassName(dom,"tab-color3",null);zf_stdReplaceClassName(dom,"tab-color2","tab-color1");}else{zf_stdReplaceClassName(dom,"tab-selected","tab-standard");
5594zf_stdReplaceClassName(dom,"tab-bgcolor1","tab-bgcolor2");zf_stdReplaceClassName(dom,"tab-bgimage1","tab-bgimage2");zf_stdReplaceClassName(dom,"tab-color1","tab-color2");
5595}};zfl_TabGroup.prototype.init=function(key0){if(key0){var tab0=this._tabs[key0];if(tab0&&!tab0.selected){for(var key1 in this._tabs){var tab1=this._tabs[key1];if(tab1.selected){zfl_TabGroup._restyle(tab1.id,
5596false);tab1.selected=false;}else if(tab1.key==key0){zfl_TabGroup._restyle(tab1.id,true);tab1.selected=true;}}}}for(var key in this._tabs){var tab=this._tabs[key];
5597if(tab.selected){this._select(tab,true,true);break;}}};zfl_TabGroup.prototype.get=function(key){return this._tabs[key];};zfl_TabGroup.prototype.select=function(key){var dom;var tab=this._tabs[key];
5598if(!tab||tab.selected)return;for(var key1 in this._tabs){var tab1=this._tabs[key1];if(tab1.selected){zfl_TabGroup._restyle(tab1.id,false);this._select(tab1,false,
5599false);break;}}zfl_TabGroup._restyle(tab.id,true);this._select(tab,true,false);};zfl_TabGroup.prototype._select=function(tab,select,init){tab.selected=select;if(select)this.selected=tab;
5600if(tab.view){var display=select?"block":"none";for(var i=0;i<tab.view.length;i++){var obj=tab.view[i];if(!obj)continue;if(obj.dom instanceof Function){obj.dom().style.display=display;
5601}else if(typeof(obj)=="string"&&obj.length>0){document.getElementById(obj).style.display=display;}}}if(this.onselect)this.onselect(tab,select,init);};;function zfl_SearchLayout(id,
5602global,local){zfl_Layout.prototype.constructor.call(this,id,global,local);this._data={galleries:zfl_stdTransformResponse(local.data.galleries,"galleries"),collections:zfl_stdTransformResponse(local.data.collections,
5603"collections"),photos:zfl_stdTransformResponse(local.data.photos,"photos"),videos:zfl_stdTransformResponse(local.data.videos,"videos")};var self=this;this._customize=local.customize;
5604if(local.tabs){this._tabs=local.tabs;this._tabs.onselect=function(tab,selected,init){self._tabs_onselect(tab,selected,init);};this._columns.Center.onstretch=function(height,
5605stretcher){return self._tabs_onstretch(height,stretcher);};}this._paged=!!local.pagers.galleries||!!local.pagers.collections||!!local.pagers.photos||!!local.pagers.videos;
5606var setupPage=function(name,minRows){var grid=local.grids[name];var pager=local.pagers[name];if(!grid||!pager)return;grid.minRows=minRows;grid.onlayoutchange=function(info){pager.update(info.totalPages,
5607info.currentPage);};pager.onchange=function(page){grid.setPage(page);self.recalc(true);};};setupPage("galleries",2);setupPage("collections",2);setupPage("photos",
56082);setupPage("videos",2);}zfl_SearchLayout.inherits(zfl_Layout);zfl_SearchLayout.prototype.onrecalc=function(){zfl_Layout.prototype.onrecalc.call(this);};zfl_SearchLayout.prototype.onload=function(){this.initGrid(this._grids.galleries,
5609zfl_PhotoViewStyle.FolderElement,this._grids.galleriesParams,this._data.galleries);this.initGrid(this._grids.collections,zfl_PhotoViewStyle.FolderElement,this._grids.collectionsParams,
5610this._data.collections);this.initGrid(this._grids.photos,zfl_PhotoViewStyle.GalleryPhoto,this._grids.photosParams,this._data.photos);this.initGrid(this._grids.videos,
5611zfl_PhotoViewStyle.GalleryPhoto,this._grids.videosParams,this._data.videos);if(this._tabs)this._tabs.init(zf_stdGetCookie("zfl_search"));var grids=this._grids;$(window).bind('scroll',
5612function(){grids.galleries&&grids.galleries.recalcLayout();grids.collections&&grids.collections.recalcLayout();grids.photos&&grids.photos.recalcLayout();grids.videos&&grids.videos.recalcLayout();
5613});zfl_Layout.prototype.onload.call(this);};zfl_SearchLayout.prototype._tabs_onselect=function(tab,selected,init){if(!selected)return;zf_stdSetCookie("zfl_search",tab.key,null,true,
5614true);if(!init)this.recalc();};zfl_SearchLayout.prototype._tabs_onstretch=function(height,stretcher){var tab=this._tabs.selected;var grid;
5614if(tab)grid=this._grids[tab.key];if(!grid)return false;
5615if(this._paged){grid.setHeight(height);}else{grid.minRows=null;grid.setHeight(-1);}stretcher.style.height="auto";stretcher.style.minHeight=height+"px";grid.recalcLayout();
5616return true;};zfl_SearchLayout.prototype._onsearch=function(){var search=this.dom("query")["q"];var query=encodeURIComponent(zf_stdReplaceApostrophes(search.value));uri="/?q="+query;
5617if(this._customize)uri+="&customize="+this._customize;location.href=uri;};;;;;function zfl_PhotoCtrThLayout(id,global,local){zfl_PhotoLayout.prototype.constructor.call(this,
5618id,global,local);}zfl_PhotoCtrThLayout.inherits(zfl_PhotoLayout);zfl_PhotoCtrThLayout.prototype.onrecalc=function(){zfl_PhotoLayout.prototype.onrecalc.call(this);};zfl_PhotoCtrThLayout.prototype.onload=function(){zfl_PhotoLayout.prototype.onload.call(this);
5619};;;function zfl_PhotoLtRtLayout(id,global,local){zfl_PhotoLayout.prototype.constructor.call(this,id,global,local);var self=this;var style=zfl_PhotoViewStyle.PhotoNavThumbnail;
5620var method=zf_ProcessingMethod.StandardSmallThumbnail;var plugins=this._createPlugins(style,this._getDecorationInfo(style,method));this._pool={};if(this._navigation.backThumbId&&this._navigation.nextThumbId){var view;
5621view=new zf_PhotoView(this._navigation.backThumbId,plugins);view.waitTimeout=800;this._navigation.backThumb=view;view=new zf_PhotoView(this._navigation.nextThumbId,
5622plugins);view.waitTimeout=800;this._navigation.nextThumb=view;this._controls.addDeferredUpdate("updateNavigation2",this.closure(this._updateNavigation));var domBack=this._navigation.back.dom();
5623domBack.onmouseup=function(){self.back();};var domNext=this._navigation.next.dom();domNext.onmouseup=function(){self.next();};}}zfl_PhotoLtRtLayout.inherits(zfl_PhotoLayout);zfl_PhotoLtRtLayout.prototype.onrecalc=function(){zfl_PhotoLayout.prototype.onrecalc.call(this);
5624};zfl_PhotoLtRtLayout.prototype.onload=function(){zfl_PhotoLayout.prototype.onload.call(this);};zfl_PhotoLtRtLayout.prototype._updateNavigation=function(){var index=this.current.index;var method=zf_ProcessingMethod.StandardSmallThumbnail;
5625var photoList=this._photoList;var backThumb=this._navigation.backThumb;var nextThumb=this._navigation.nextThumb;if(this._backPhoto){this._backPhoto.unadvise(backThumb);
5626this._backPhoto=null;}if(this._nextPhoto){this._nextPhoto.unadvise(nextThumb);this._nextPhoto=null;}var self=this;if(index>0){var backPhoto=photoList.get(index-1);
5627if(backPhoto.loaded){this._loadThumb(backThumb,backPhoto);}else{this._backPhoto=backPhoto;backPhoto.advise(backThumb,function(){self._loadThumb(backThumb,backPhoto);
5628});}}if(index<photoList.length-1){var nextPhoto=photoList.get(index+1);if(nextPhoto.loaded){this._loadThumb(nextThumb,nextPhoto);}else{this._nextPhoto=nextPhoto;
5629nextPhoto.advise(nextThumb,function(){self._loadThumb(nextThumb,nextPhoto);});}}var loader;if(index<photoList.length-2){var photoAhead=photoList.get(index+2);if(photoAhead.loaded&&this._pool[photoAhead.id]==null){loader=new zf_PhotoLoader(photoAhead,
5630method);this._pool[photoAhead.id]=loader;loader.start();}}if(index>1){var photoBack=photoList.get(index-2);if(photoBack.loaded&&this._pool[photoBack.id]==null){loader=new zf_PhotoLoader(photoBack,
5631method);this._pool[photoBack.id]=loader;loader.start();}}};zfl_PhotoLtRtLayout.prototype._loadThumb=function(view,photo){;var method=zf_ProcessingMethod.StandardSmallThumbnail;var loader=this._pool[photo.id];
5632if(loader==null){loader=new zf_PhotoLoader(photo,method);this._pool[photo.id]=loader;}var context={method:method,data:photo,image:photo};view.reinit(null,"javascript:;",
5633null,context,photo,method);var self=this;var onload=function(state){if(state==zf_PhotoLoader.PasswordRequired){if(!loader.__zfl_onpassword){;;loader.__zfl_onpassword=function(){self._pool[photo.id]=null;
5634if(view.getPhoto()==photo)self._loadThumb(view,photo);};zfl_PasswordManager.subscribe(photo.access.ownerId,photo.access.realmId,loader.__zfl_onpassword);}}return false;
5635};view.onload=onload;view.load(loader);};;;;;function zfl_PhotoThumbsLayout(id,global,local,viewStyle){zfl_PhotoLayout.prototype.constructor.call(this,id,global,local,viewStyle);
5636var self=this;if(viewStyle!=zfl_PhotoViewStyle.PhotoVList){this._tabs=local.tabs;this._tabs.onselect=function(tab,selected,init){self._tabs_onselect(tab,selected,
5637init);};}var exifView=local.exifView;if(exifView){this._controls.list.push(exifView);exifView.onresize=this.closure(this.recalc);}this._hasQpl=local.quickPriceList!=null&&viewStyle!=zfl_PhotoViewStyle.PhotoVList;
5638}zfl_PhotoThumbsLayout.inherits(zfl_PhotoLayout);zfl_PhotoThumbsLayout.prototype.onrecalc=function(){zfl_PhotoLayout.prototype.onrecalc.call(this);};zfl_PhotoThumbsLayout.prototype.onload=function(){if(this._photoViewStyle!=zfl_PhotoViewStyle.PhotoVList)this._tabs.init();
5639zfl_PhotoLayout.prototype.onload.call(this);};zfl_PhotoThumbsLayout.prototype._tabs_onselect=function(tab,selected,init){if(selected&&!init)this.recalc();};zfl_PhotoThumbsLayout.prototype._tabs_onstretch=function(height,
5640stretcher){if(this._photoViewStyle==zfl_PhotoViewStyle.PhotoVList||this._tabs.get("thumbnails").selected){var grid=this._grids.photos,cy=grid.getCellSize().cy||60;
5641if(this._hasQpl)height=cy*4;else{height=zf_stdGetClientHeight()-320;height=height*3/4;height=Math.max(height,cy*5);height=Math.ceil(height/cy)*cy;}grid.setHeight(height);
5642stretcher.style.height=height+"px";var info=null;if(grid.getSelectedItem()==null&&this.current.index>=0){info=grid.getLayoutInfo();grid.setPage(Math.floor(this.current.index/info.itemsPerPage));
5643info=null;}else{info=grid.getLayoutInfo(zf_PhotoGrid.KeepVisible);}grid.recalcLayout(info);return true;}else if(this._tabs.get("info").selected){stretcher.style.height="0px";
5644return true;}return false;};;;;;function zfl_PhotoPortfolioLayout(id,global,local){zfl_PhotoLayout.prototype.constructor.call(this,id,global,local);var self=this;this._controls.flipper.fullHeight=true;
5645this._controls.flipper.relaxedHeight=false;this._fields=local.fields;this._controls.addUpdate(function(){self.$('.ppc-next').toggle(self._handlers.oncommandtest('next'));
5646self.$('.ppc-prev').toggle(self._handlers.oncommandtest('back'));});this.$('.ppc-next').click(function(){self._handlers.oncommand('next');return false;}).bind('selectstart',
5647zf_stdFalse);this.$('.ppc-prev').click(function(){self._handlers.oncommand('back');return false;}).bind('selectstart',zf_stdFalse);zf_CategoryInfo.load(function(catInfo){self.categoryList=catInfo;
5648});}zfl_PhotoPortfolioLayout.inherits(zfl_PhotoLayout);zfl_PhotoPortfolioLayout.prototype.onrecalc=function(){zfl_PhotoLayout.prototype.onrecalc.call(this);};zfl_PhotoPortfolioLayout.prototype.onload=function(){zfl_PhotoLayout.prototype.onload.call(this);
5649};zfl_PhotoPortfolioLayout.prototype._createPlugins=function(style,decor,params){var plugins=zfl_Layout.prototype._createPlugins.call(this,style,decor,params);if(style==zfl_PhotoViewStyle.CurrentPhoto){plugins.push(new zfl_PhotoPortfolioLayout.TextPlugin(this,
5650true));}return plugins;};zfl_PhotoPortfolioLayout.TextPlugin=function(layout,inner){this.getOuterContent=function(id,context){return inner?'':'<span class="pv-text pv-text-out"></span>';
5651};this.getInnerContent=function(id,context){return inner?'<span class="pv-text pv-text-in"></span>':'';};var createInnerMarkup=function(photo,markup){var flags=photo.flags;
5652if(!layout._fields.title)flags=flags&~zf_PhotoFlags.HasTitle;if(!layout._fields.caption)flags=flags&~zf_PhotoFlags.HasCaption;if(!layout._fields.keywords)flags=flags&~zf_PhotoFlags.HasKeywords;
5653if(!layout._fields.categories)flags=flags&~zf_PhotoFlags.HasCategories;if((flags&(zf_PhotoFlags.HasTitle|zf_PhotoFlags.HasCaption|zf_PhotoFlags.HasKeywords|zf_PhotoFlags.HasCategories))==0)return;
5654if(photo.loaded&&photo.title&&layout._fields.title)markup.push('<span class="title pvo-font1 pvo-color1 ',layout._fields.titleAlignClass,'">',zf_stdHtmlEncode(photo.title),
5655'</span>');var meta=photo.getMeta();if(!meta.loaded){markup.push('<span class="loading pvo-font2 pvo-color2">','Loading...','</span>');return;}if(meta.caption&&layout._fields.caption)markup.push('<span class="caption pvo-font2 pvo-color2 ',
5656layout._fields.captionAlignClass,'">',meta.caption,'</span>');if(meta.keywords&&meta.keywords.length&&layout._fields.keywords){markup.push('<span class="keywords pvo-font2 pvo-color2">',
5657'Keywords: ');for(var i=0;i<meta.keywords.length;i++){var keyword=meta.keywords[i];if(i>0)markup.push(', ');markup.push(zf_stdHtmlEncode(keyword));}markup.push('</span>');
5658}if(meta.categories&&meta.categories.length&&layout.categoryList&&layout._fields.categories){markup.push('<span class="categories pvo-font2 pvo-color2">','Categories: ');
5659var ct1=layout.categoryList.getSubject(meta.category);var ct2=layout.categoryList.getSubjectMatter(meta.category);var ct3=layout.categoryList.getSubjectDetail(meta.category);
5660markup.push(zf_stdHtmlEncode(ct1));if(ct2)markup.push(', ',zf_stdHtmlEncode(ct2));if(ct3)markup.push(', ',zf_stdHtmlEncode(ct3));markup.push('</span>');}};var createElement=function($node,
5661photo){var markup=[];createInnerMarkup(photo,markup);if(!markup.length){$node.empty();return;}if(markup.length){markup=['<span class="pv-text-bg pvo-bgcolor1"></span><span class="pv-text-oo"><span class="pv-text-o">'].concat(markup);
5662markup.push('</span></span>');markup.push('<span class="pv-text-plus pvo-color3">&#9650;</span>');markup.push('<span class="pv-text-minus pvo-color3">&#9660;</span>');
5663}markup=markup.join('');var sampleWidth=inner?Math.min($node.innerWidth(),660):660;var $markup=$('<div></div>').html(markup).css({position:'absolute',top:-10000,
5664left:-10000,visibility:'hidden',width:sampleWidth}).appendTo('.layout:first');var firstHeight=zf_stdExtractPixels($markup.find('.pv-text-o span:first').css('line-height'));
5665var totalHeight=$markup.find('.pv-text-o').height();$markup.remove();$node.html(markup).find('.pv-text-oo').click(false).height(firstHeight).show();if(!photo.getMeta().loaded)return;
5666$node.find('.caption a').click(function(){window.open(this.href);});if(totalHeight>firstHeight){var maxHeight=inner?$node.closest('.pv-inner').innerHeight()/5*4:$node.closest('.pv-outer').innerHeight()/5*4;
5667totalHeight=Math.min(maxHeight,totalHeight);$node.hover(function(){$node.find('.pv-text-oo').stop(true).animate({height:totalHeight},300);},function(){$node.find('.pv-text-oo').delay(500).animate({height:firstHeight},
5668600);});$node.find('.pv-text-plus').click(function(){zfl_PhotoPortfolioLayout.TextPlugin.collapsed=false;$node.removeClass('pv-text-collapsed').addClass('pv-text-expanded').find('.pv-text-oo').stop(true,
5669true).css({minHeight:totalHeight,height:totalHeight});return false;});$node.find('.pv-text-minus').click(function(){zfl_PhotoPortfolioLayout.TextPlugin.collapsed=true;
5670$node.removeClass('pv-text-expanded').addClass('pv-text-collapsed').find('.pv-text-oo').stop(true,true).css({minHeight:0,height:firstHeight});return false;});if(zfl_PhotoPortfolioLayout.TextPlugin.collapsed){$node.removeClass('pv-text-expanded').addClass('pv-text-collapsed').find('.pv-text-oo').css({minHeight:0});
5671}else{$node.removeClass('pv-text-collapsed').addClass('pv-text-expanded').find('.pv-text-oo').css({minHeight:totalHeight});}}};this.onCreateDom=function(view,outer,
5672inner,context,isNew){var $text=$(view).find('.pv-text');var photo=context.data;var markup=createElement($text,photo);var meta=photo.getMeta();if(!meta.loaded){context.__meta_loading=view;
5673photo.getMeta().advise(context,function(){if(context.__meta_loading!==view)return;createElement($text,photo);delete context.__meta_loading;});}};this.onDestroyDom=function(view,
5674outer,inner,context){if(context.__meta_loading===view)delete context.__meta_loading;};};;;;;function zfl_PhotoFullscreenLayout(id,global,local){local.overlayExif=false;local.overlayAddToFav=false;
5675local.overlayMenu=false;zfl_PhotoLayout.prototype.constructor.call(this,id,global,local);this.$dom('fullscreen').detach().prependTo(this.dom('frame'));this._controls.flipper.fullHeight=true;
5676this._controls.flipper.relaxedHeight=false;this._controls.flipper.allowClipping=true;this._controls.flipper.browserScaling=true;this._controls.flipper.extraVideoPadding={cy:50};
5677this._fields=local.fields;var self=this;this._controls.addUpdate(function(){self.$('.pfs-next').toggle(self._handlers.oncommandtest('next'));self.$('.pfs-prev').toggle(self._handlers.oncommandtest('back'));
5678});this.$('.pfs-next').click(function(){self._handlers.oncommand('next');return false;});this.$('.pfs-prev').click(function(){self._handlers.oncommand('back');return false;
5679});zf_CategoryInfo.load(function(catInfo){self.categoryList=catInfo;});var show=false;this.$('.pfs-btn-thumbs').click(function(){self._showThumbs(show=!show);return false;
5680});this.$('.pfs-btn-menu').click(function(){if(!self._controls.flipper._overlay)return false;var pos=$(this).offset();self._controls.flipper._overlay.showMenu(pos.left-4,
5681$(document.body).outerHeight()-pos.top+4,{h:'left',v:'bottom'});return false;});this.cyMinFooter=0;
5681this._bottomFlipperOffset=0;}zfl_PhotoFullscreenLayout.inherits(zfl_PhotoLayout);zfl_PhotoFullscreenLayout.prototype.onrecalc=function(){zfl_PhotoLayout.prototype.onrecalc.call(this);
5682this._recalcFlipper();};zfl_PhotoFullscreenLayout.prototype._recalcFlipper=function(){var $frame=this.$dom('frame');var width=$frame.innerWidth();var height=$frame.outerHeight()-this._bottomFlipperOffset;
5683this._controls.flipper.resize(width,height);this.$dom('fullscreen').height(height);};zfl_PhotoFullscreenLayout.prototype.onload=function(){zfl_PhotoLayout.prototype.onload.call(this);};zfl_PhotoFullscreenLayout.prototype._createPlugins=function(style,
5684decor,params){var plugins=[];if(style==zfl_PhotoViewStyle.CurrentPhoto){plugins.push(new zf_CensoredPlugin(function(c){return c.data;},function(c){return c.method;
5685}));plugins.push(new zfl_WaitAnimationPlugin(true));plugins.push(new zfl_PhotoPortfolioLayout.TextPlugin(this,false));if(this.customizer!=null)plugins.push(new zfl_PhotoFullscreenLayout.XxlWarningPlugin(this));
5686plugins.push(new zf_VideoPlayerPlugin(function(c){return c.data;}));}else{plugins=zfl_Layout.prototype._createPlugins.call(this,style,decor,params);}return plugins;
5687};zfl_PhotoFullscreenLayout.prototype._getDecorationInfo=function(style,method){if(style==zfl_PhotoViewStyle.CurrentPhoto)return null;return zfl_Layout.prototype._getDecorationInfo.call(this,
5688style,method);};zfl_PhotoFullscreenLayout.prototype._showThumbs=function(show){var $strip=this._controls.strip.$();var height=$strip.height()+10;show=show==undefined?true:show;var self=this;
5689if(show){this.$('.pfs-thumbs').animate({height:height},{duration:500,step:function(n){self._bottomFlipperOffset=n;self._recalcFlipper();}});}else{this.$('.pfs-thumbs').animate({height:0},
5690{duration:500,step:function(n){self._bottomFlipperOffset=n;self._recalcFlipper();}});}};zfl_PhotoFullscreenLayout.XxlWarningPlugin=function(layout){this.getOuterContent=function(id,context){return['<span class="pv-blog-aw none">',
5691'<span class="bg"></span>','<span class="fg">','<span class="warning">XX-Large image size is not enabled. For best image quality, allow displaying the XX-Large size via Access Control.</span>',
5692'<span class="edit"></span>','</span>','</span>'].join('');};this.onCreateDom=function(view,outer,inner,context,isNew){var $warning=$(view).find('.pv-blog-aw');var photo=context.data;
5693if((photo.access.mask&zf_AccessMask.ProtectXXLarge)!=0&&!photo.video){$warning.show().find('.edit').html(zf_stdFormatString('<a href=\x22{0}\x22>Click here</a> to edit the gallery',
5694'/?epg='+photo.id));}else{$warning.hide();}};};;;function zfl_FolderCtrLayout(id,global,local){if(zf_stdNoArgs(arguments))return;zfl_FolderLayout.prototype.constructor.call(this,
5695id,global,local);}zfl_FolderCtrLayout.inherits(zfl_FolderLayout);zfl_FolderCtrLayout.prototype.onload=function(){zfl_FolderLayout.prototype.onload.call(this);};zfl_FolderCtrLayout.prototype.onrecalc=function(){if(this._grids.folder&&!this._fixedWidth){var grid=this._grids.folder;
5696var cxCell=grid.getCellSize().cx;if(cxCell!=null){var padding=parseInt(this.$dom().css('paddingLeft')),cxWindow=zf_stdGetClientWidth()-padding*2,row=Math.floor(cxWindow/cxCell),
5697width=Math.min(this._data.folder.length,row)*cxCell;this.dom("gridbox").style.width=Math.max(width,660)+"px";}}zfl_FolderLayout.prototype.onrecalc.call(this);};;function zfl_ZentoboxPlayer(id,
5698init){zf_Control.prototype.constructor.call(this,id);zf.core.EventSource.prototype.constructor.call(this);this._zentoboxId=init.zentoboxId;this._isEmpty=init.isEmpty;
5699this._isFullScreen=init.isFullScreen;this._editor=init.editor;this._minWidth=init.minWidth;this._minHeight=init.minHeight;this._data=init.data;this._decoration=init.decoration;
5700this._editorData=this._data;if(!this._data){if(init.photoSetItemId){this._editorData={content:{ownerId:zf_userId,photoSetId:init.photoSetItemId}};}else{this._editorData={};
5701}}if(init.data&&init.data.layout&&init.data.layout.themeBorder===false)this._decoration=null;if((this._player=init.player)!=null)this._player.init(this._data,init.profile);
5702if(init.isEmpty)$(this.closure(this._initEmpty));else $(this.closure(this._initNormal));}zfl_ZentoboxPlayer.inherits(zf_Control,zf.core.EventSource);zfl_ZentoboxPlayer.Top='top';zfl_ZentoboxPlayer.Bottom='bottom';zfl_ZentoboxPlayer.Middle='middle';
5703zfl_ZentoboxPlayer.prototype.resize=function(availWidth,availHeight,constraints){var size,holderSize,shadowSize=this._decoration!=null?this._decoration.shadowSize:0,borderSize=this._decoration!=null?this._decoration.borderSize:0,
5704extent=shadowSize+borderSize;availWidth=Math.max(Math.max(availWidth,this._minWidth)-2*extent,0);availHeight=Math.max(Math.max(availHeight,this._minHeight)-2*extent,
57050);if(this._player==null){availHeight=Math.max(availHeight,360);holderSize={cx:Math.min(availWidth,1100),cy:Math.min(availHeight,850)};}else{constraints=$.extend({},
5706constraints,{fill:this._isFullScreen,minWidth:Math.max(this._minWidth-2*extent,0),minHeight:Math.max(this._minHeight-2*extent,0),cellRound:function(w){return w-w%(this.cellWidth||1);
5707}});holderSize=this._player.resize(availWidth,availHeight,constraints);holderSize={cx:Math.max(holderSize.cx,0),cy:Math.max(holderSize.cy,0)};}if(!this._isFullScreen){size={cx:Math.max(holderSize.cx+2*extent,
5708this._minWidth),cy:holderSize.cy+2*extent};}else{size={cx:availWidth,cy:availHeight};}this.$().width(size.cx).height(size.cy).css('left',(-shadowSize)+'px').css('top',
5709(-shadowSize)+'px');this.$('.zbp-holder:first').width(holderSize.cx).height(holderSize.cy).css('left',Math.round((size.cx-holderSize.cx)/2)+'px').css('top',Math.round((size.cy-holderSize.cy)/2)+'px').find('.pv-border:first').toggle(this._decoration!=null);
5710size.cxShadow=shadowSize*2;if(this._decoration!=null)this._applyDecoration(this._decoration,holderSize);if(size.cx&&size.cy)this.$().addClass('zbp-ready');return size;
5711};zfl_ZentoboxPlayer.prototype.getMinWidth=function(){return Math.max(this._minWidth,this._player?this._player.getMinWidth():0);};zfl_ZentoboxPlayer.prototype.getMaxWidth=function(){return this._player?Math.min(3200,
5712this._player.getMaxWidth()):0;};zfl_ZentoboxPlayer.prototype.edit=function(){this._editor.show(this._editorData);};zfl_ZentoboxPlayer.prototype._applyDecoration=function(decorationInfo,size){var borderSize=decorationInfo.borderSize;
5713var shadowSize=decorationInfo.shadowSize;if(shadowSize>0){this.$('.pv-shadow').remove();var extent=shadowSize+borderSize;var left=-extent;var top=-extent;var width=size.cx+extent*2;
5714var height=size.cy+extent*2;var shadow=decorationInfo.shadowName;var shadowType=decorationInfo.shadowType;if(shadow!=null){this.$('.zbp-holder:first').append(zfl_DecorationInfo.getShadowHtml("pv-shadow",
5715shadow,shadowType,shadowSize,left,top,width,height,true));}}};zfl_ZentoboxPlayer.prototype._initNormal=function(){var self=this;if(this._editor){this._editor.on('save',function(data,
5716callback){self.trigger('save',self._zentoboxId,data,function(error){if(error==null)location.reload();else callback&&callback(error);});});this._editor.on('hide',
5717function(){self._player&&self._player.togglePlay(true);});var overlay=this.$('DIV.zbp-overlay:first'),entered=false,timer=null;function enter(){timer=null;if(!entered){entered=true;
5718overlay.stop(true,true).find('.zbp-topbar:first').stop(true,true);overlay.fadeIn(100,function(){$('.zbp-topbar:first',this).animate({top:-34,height:32},250);});}}function leave(){if(entered){entered=false;
5719overlay.find('.zbp-topbar:first').stop(true,true);overlay.stop(true,true);overlay.find('.zbp-topbar:first').animate({top:-2,height:0},200,function(){overlay.fadeOut(100);
5720});}}this.$().mouseenter(function(){if(timer!=null)clearTimeout(timer);timer=setTimeout(enter,10);}).mouseleave(function(){if(timer==null)timer=setTimeout(leave,
5721200);});this.$('A.zbp-edit:first').click(function(){self._player&&self._player.togglePlay(false);self._editor.show(self._editorData);return false;});this.$('A.zbp-remove:first').click(function(e){e.preventDefault();
5722e.stopPropagation();self.trigger('save',self._zentoboxId,null,function(){location.reload();});});}};zfl_ZentoboxPlayer.prototype._initEmpty=function(){var self=this;if(this._editor){this._editor.on('save',
5723function(data,callback){self.trigger('save',self._zentoboxId,data,function(error){if(error==null)location.reload();else callback&&callback(error);});});this._editor.on('hide',
5724function(){self._player&&self._player.togglePlay(true);});var type=zf_storage.getItem('zf.layout.zentobox.delayEdit');if(type){zf_storage.removeItem('zf.layout.zentobox.delayEdit');
5725var data=self._editorData;data.type=type;zf_stdDeferCall(null,function(){self._editor.show(data);});}}this.$('A.zbp-button').click(function(e){e.preventDefault();
5726e.stopPropagation();var type=$(this).attr('data-type');if(!self._editor){zf_storage.setItem('zf.layout.zentobox.delayEdit',type);
5726zfl_ZenBar.customize();}else{var data=self._editorData;
5727data.type=type;self._editor.show(data);}});};;;function zfl_FolderPortfolioLayout(id,global,local){zfl_FolderLayout.prototype.constructor.call(this,id,global,local);this._customizer=global.customizer;
5728this._player=local.player;this._column=local.column;this._padding=parseInt(this.$().css("paddingLeft"));;this._slideshowOffset=local.slideshowOffset?local.slideshowOffset:0;
5729;this.cyMinFooter=0;}zfl_FolderPortfolioLayout.inherits(zfl_FolderLayout);zfl_FolderPortfolioLayout.prototype.onrecalc=function(){zfl_FolderLayout.prototype.onrecalc.call(this);};zfl_FolderPortfolioLayout.prototype.onload=function(){zfl_FolderLayout.prototype.onload.call(this);
5730var player=this._player,customizer=this._customizer;};zfl_FolderPortfolioLayout.prototype._onstretch=function(height,stretcher){var availWidth=this.$dom("frame").width()-(this._slideshowOffset+this._padding*2);
5731var availHeight=height;if(this._fixedWidth){availWidth=Math.min(availWidth,944-this._slideshowOffset);availHeight=10000;}var cellWidth=1;if(this._grids.folder)cellWidth=this._grids.folder.getCellSize().cx||1;
5732var size=this._player.resize(availWidth,availHeight,{cellWidth:cellWidth});this.$dom().width(size.cx-size.cxShadow+this._slideshowOffset);stretcher.style.minHeight=size.cy+"px";
5733if(this._grids.folder!=null)this._grids.folder.recalcLayout();return true;};;function zfl_PagePhotoGrid(id,init){zfl_Control.prototype.constructor.call(this,id);zf.core.EventSource.prototype.constructor.call(this);
5734this.internal={folder:init.folder,photoSet:init.photoSet,photoList:init.photoList,pluginParams:init.pluginParams,grid:init.grid,data:init.data,photoGridIndex:0,isOpenDtl:init.isOpenDtl||false,
5735isOpenNoop:init.isOpenNoop||false,isOpenUrl:init.isOpenUrl||false,isOpenInGallery:init.isOpenInGallery||false,showDtlToolbar:init.showDtlToolBar||false,showToolbarLinks:init.showToolbarLinks||false,
5736showDtlPhotobooks:init.showDtlPhotobooks||false,openTargetUrl:init.openTargetUrl||null,browserScaling:init.browserScaling||false};if(this.internal.photoSet&&this.internal.photoList){this.internal.photoList.setDefaults(this.internal.photoSet,
5737this.internal.photoSet.owner);}this._wrapPhotoList(this.internal.photoList);this.internal.grid&&this.internal.grid.setHeight(-1);this.isEmpty=!(this.internal.photoSet||this.internal.folder);
5738}zfl_PagePhotoGrid.inherits(zfl_Control,zfl_PhotoDownload);zfl_PagePhotoGrid.Limit=256;zfl_PagePhotoGrid.prototype.init=function(layout){this.internal.layout=layout;if(this.isEmpty)this._initEmpty();else this._initNormal();
5739};zfl_PagePhotoGrid.prototype.resize=function(width,height){if(this.isEmpty){this.$().height($(window).height());return;}if(Zenfolio.Global.QuickShopManager.isVisible())return;var grid=this.internal.grid;
5740grid.setHeight(height);grid.recalcLayout();};zfl_PagePhotoGrid.prototype._initEmpty=function(){if(zf_userId!=zf_ownerId)return;this.$('.ppg-empty').addClass('ready');this.$('.ppg-empty-bg').addClass('ready');
5741this.$('.ppg-button').click(this.closure(function(e){e.preventDefault();e.stopPropagation();if(!this.internal.layout.customizer){zf_stdSetCookie("zf_cv_options",
5742"Grid",null,true,true);zf_stdSetCookie("zf_cv_open","options",null,true,true);zfl_ZenBar.customize();}else{zf_stdSetCookie("zf_cv_options","Grid",null,true,true);
5743this.internal.layout.customizer.customize('options');}}));};zfl_PagePhotoGrid.prototype._initNormal=function(){this._initGrid();};zfl_PagePhotoGrid.prototype._initGrid=function(){var self=this;var fol=this.internal.folder;
5744var photoSet=this.internal.photoSet;var grid=this.internal.grid;var pl=this.internal.photoList;var layout=this.internal.layout;var pp=this.internal.pluginParams;
5745var returnData=layout.getReturnData();if(returnData&&(!pl||!photoSet||returnData.photoSetId!=photoSet.id||returnData.pageType!=zf_ReturnPageType.HomePage||!returnData.hasPhotoKeys())){returnData=null;
5746}layout.setReturnData(null);var getReturnPagesCallback=layout._getReturnPages?layout.closure(layout._getReturnPages):null;var recalc=function(first){if(!self._loadingForReturn&&!Zenfolio.Global.QuickShopManager.isVisible()){layout.recalc();
5747}if(first&&returnData){var returnToQuickShopOnly=returnData.returnToQuickShopOnly(pl);
5747if(returnToQuickShopOnly==null){returnData=null;return;}var photoList=returnToQuickShopOnly?self._wrapPhotoList(pl.recreate()):pl;
5748Zenfolio.Global.DomHelpers.toggleLoadingOverlay(true);self._loadingForReturn=true;photoList.loadAll(function(){self._loadingForReturn=false;var returnToPhotoKey=returnData.returnToPhotoKey();
5749var showQuickShop=function(){var quickShopPhotoIndex=photoList.find(returnData.quickShopPhotoId);if(quickShopPhotoIndex>=0){var quickShopPhoto=photoList.get(quickShopPhotoIndex);
5750if(Zenfolio.Global.QuickShopManager.isEnabled(quickShopPhoto)){var rd=self.getReturnData();rd.photoKey=returnToPhotoKey;Zenfolio.Global.QuickShopManager.show({photoList:returnToQuickShopOnly?photoList:self._wrapPhotoList(photoList.recreate()),
5751startIndex:quickShopPhotoIndex,photoSet:photoSet,forceSidebar:returnData.forceQuickShopSidebar,quickShopParameters:layout.quickShopParameters,analytics:layout.analytics,
5752returnData:rd,getReturnPagesCallback:getReturnPagesCallback});}}};if(returnToQuickShopOnly){Zenfolio.Global.DomHelpers.toggleLoadingOverlay(false);showQuickShop();
5753returnData=null;return;}layout.recalc();var returnToPhotoIndex=photoList.find(zf_PhotoKey.fromString(returnToPhotoKey).photoId);Zenfolio.Global.DomHelpers.toggleLoadingOverlay(false);
5754if(returnToPhotoIndex<0){returnData=null;return;}var photoView=grid.getPhotoView(returnToPhotoIndex);if(!photoView){returnData=null;return;}setTimeout(function(){$('HTML, BODY').scrollTop(photoView.$().offset().top);
5755if(returnData.hasAddToCartPhotoKeys()){photoView.$('.pv-ng-buy:visible:first').click();}else if(returnData.showQuickShop()){showQuickShop();}returnData=null;},100);
5756});}};if(pl){pl.onload=recalc;pl.onshrink=function(){grid.setSize(pl.length);};}else{grid.setSize(fol.length);}pp.onclick=this.closure(function(context,e){var layout=this.internal.layout;
5757if(Zenfolio.Global.QuickShopManager.isEnabled(context.data)&&!this.internal.isOpenUrl&&!this.internal.isOpenInGallery){var rd=this.getReturnData();rd.photoKey=zf_PhotoKey.getString(context.data);
5758Zenfolio.Global.QuickShopManager.show({photoList:self._wrapPhotoList(pl.recreate()),startIndex:context.index,photoSet:photoSet,forceSidebar:e&&e.forceSidebar,quickShopParameters:layout.quickShopParameters,
5759analytics:layout.analytics,returnData:rd,getReturnPagesCallback:getReturnPagesCallback});}else if(this.internal.isOpenDtl){zf_DimLightsStandalone(pl,context.index,
5760{toolbar:this.internal.showDtlToolbar,scrapbook:layout.scrapbook,yearbook:layout.yearbook,ondownload:function(photo){this._downloadOriginal(photo);},onaddtofavorites:function(photo){var keys=[zf_PhotoKey.getString(photo)];
5761layout.scrapbook.addPhotos(keys,false,null,getReturnPagesCallback&&getReturnPagesCallback(keys));},onremovefromfavorites:function(photo){layout.scrapbook.removePhotos([zf_PhotoKey.getString(photo)]);
5762},onselectasyearbookpose:function(photo,refreshUICallback,doNotShowCurtain){layout.yearbook.addPhoto(photo,null,refreshUICallback,doNotShowCurtain);},onremovefromyearbookpose:function(photo,
5763refreshUICallback,doNotShowCurtain){layout.yearbook.removePhoto(photo,null,refreshUICallback,doNotShowCurtain);},onaddtocart:function(photo){var rd=self.getReturnData();
5764rd.photoKey=photo&&zf_PhotoKey.getString(photo);layout.zenbar.addToCart({allPhotos:pl,returnData:rd})([photo]);},oncreatebook:!this.internal.showDtlPhotobooks?null:function(photo){var rd=self.getReturnData();
5765rd.photoKey=photo&&zf_PhotoKey.getString(photo);layout.zenbar.addToCart({allPhotos:pl,categoryId:'photobooks-new',returnData:rd})([photo]);},isToolbarLinks:this.internal.isToolbarLinks,
5766browserScaling:this.internal.browserScaling});}else if(this.internal.isOpenUrl){var targetUrl=this.internal.openTargetUrl;;if(targetUrl.indexOf('.')!=-1||targetUrl.indexOf('/')!=0){if(!(/http(s)?:\/\//i).test(targetUrl)){targetUrl='http://'+targetUrl;
5767}}window.open(targetUrl,'_self');}else if(this.internal.isOpenInGallery){var photo=context.data;location.href=photo.getHref('gallery');}else if(!this.internal.isOpenNoop){return true;
5768}return false;});if(this.internal.isOpenNoop){pp.onhover=function($elem,photo,hovered){if(Zenfolio.Global.QuickShopManager.isEnabled(photo)){$elem.removeClass("no-cursor");
5769}else{$elem.toggleClass("no-cursor",hovered);}};}$(window).bind('scroll',recalc);var onQueryItem=function(index){return pl.get(index);};this.internal.layout.initGrid(grid,
5770pl?zfl_PhotoViewStyle.GalleryPhoto:zfl_PhotoViewStyle.FolderElement,this.internal.pluginParams,pl?onQueryItem:fol,pl?pl.length:null);};zfl_PagePhotoGrid.prototype._wrapPhotoList=function(photoList){var photoSet=this.internal.photoSet;
5771if(!photoSet||photoSet.type==zf_PhotoSet.Gallery){return photoList;}return zf_ReturnData.wrapPhotoList(photoList,zf_ReturnPageType.PhotoSetPage,{photoSetId:photoSet.id,
5772gridShowAll:false});};;;function zfl_PhotoSetCtrLayout(id,global,local){if(zf_stdNoArgs(arguments))return;zfl_PhotoSetLayout.prototype.constructor.call(this,id,global,local);
5773}zfl_PhotoSetCtrLayout.inherits(zfl_PhotoSetLayout);zfl_PhotoSetCtrLayout.prototype.onrecalc=function(){zfl_PhotoSetLayout.prototype.onrecalc.call(this);};zfl_PhotoSetCtrLayout.prototype.onload=function(){zfl_PhotoSetLayout.prototype.onload.call(this);
5774};;;function zfl_PhotoSetPortfolioLayout(id,global,local){zfl_PhotoSetLayout.prototype.constructor.call(this,id,global,local);this._customizer=global.customizer;this._player=local.player;
5775this._column=local.column;this._padding=parseInt(this.$().css("paddingLeft"));;this._slideshowOffset=local.slideshowOffset?local.slideshowOffset:0;;this.cyMinFooter=0;
5776}zfl_PhotoSetPortfolioLayout.inherits(zfl_PhotoSetLayout);zfl_PhotoSetPortfolioLayout.prototype.onrecalc=function(){zfl_PhotoSetLayout.prototype.onrecalc.call(this);};zfl_PhotoSetPortfolioLayout.prototype.onload=function(){zfl_PhotoSetLayout.prototype.onload.call(this);
5777var player=this._player,customizer=this._customizer;};zfl_PhotoSetPortfolioLayout.prototype._onstretch=function(height,stretcher){var availWi
5777dth=this.$dom("frame").width()-(this._slideshowOffset+this._padding*2);
5778var availHeight=height;if(this._fixedWidth){availWidth=Math.min(availWidth,944-this._slideshowOffset);availHeight=10000;}var cellSize,cellWidth=1;if(this._grids.photos){cellSize=this._grids.photos.getCellSize();
5779cellWidth=cellSize.cx||1;}var size;if(this.selecting){size={cx:availWidth,cx:0};}else{size=this._player.resize(availWidth,availHeight,{cellWidth:cellWidth});}this.$dom().width(size.cx-size.cxShadow+this._slideshowOffset);
5780stretcher.style.height="auto";var grid=this._grids.photos;if(grid){if(this.showAll){grid.setHeight(-1);grid.minRows=null;grid.maxRows=null;}else{grid.setHeight(0);
5781grid.minRows=Math.max(Math.floor(availHeight/(cellSize.cy||80)),1);grid.maxRows=null;}var info=this._grids.photos.recalcLayout();if(this._pager)this._pager.update(info.totalPages,
5782info.currentPage);}return true;};zfl_PhotoSetPortfolioLayout.prototype._enterSelection=function(animate,mode){zfl_PhotoSetLayout.prototype._enterSelection.call(this,animate,mode);var self=this;
5783this._player.$().slideUp(400,function(){self.selecting=true;self.recalc(true);});};zfl_PhotoSetPortfolioLayout.prototype._leaveSelection=function(animate){zfl_PhotoSetLayout.prototype._leaveSelection.call(this,
5784animate);var self=this;this._player.$().slideDown(200,function(){self.selecting=false;self.recalc(true);});};;function zf_Slider(id,vertical,step,precision,immediateInit){zf_Control.prototype.constructor.call(this,
5785id);zf_stdSetClientObject(id,this);var self=this;this._initSize=function(){if(self.manualSize!=null){self._size=self.manualSize;}else if(isNaN(self._size)){self._size=zf_stdExtractPixels(self.$().css(self._vertical?'height':'width'));
5786if(self._vertical)self._size-=self.verticalOffset/2;}};this._vertical=vertical;this._step=step;this._precision=precision;this._pos=-1;this.verticalOffset=40;this.horizontalOffset=0;
5787if(immediateInit===true){this._init();return;}zf_stdDeferCall(null,this._init,this);}zf_Slider.inherits(zf_Control);zf_Slider.prototype.setPos=function(pos){;;this._initSize();pos=Math.round(pos/this._precision)*this._precision;
5788if(pos<0){pos=0;}if(pos>100){pos=100;}if(pos==this._pos){return false;}this._pos=pos;pos=pos/100*this._size;if(this._vertical){this.$('.slider-h').css('margin-top',
5789this._size-pos+'px');}else{this.$('.slider-h').css('margin-left',pos+'px');}return true;};zf_Slider.prototype.getPos=function(){return this._pos;};zf_Slider.prototype._init=function(){if(this._vertical){this._attachButton('A:first',
5790this._step);this._attachButton('A:last',-this._step);}else{this._attachButton('A:first',-this._step);this._attachButton('A:last',this._step);}this._mouseup=this.closure(this._handle_onmouseup);
5791this._mousemove=this.closure(this._handle_onmousemove);this.$('.slider-h').mousedown(this.closure(this._handle_onmousedown)).bind('touchstart',this.closure(this._handle_onmousedown)).bind('selectstart',
5792zf_stdFalse);this.$().mousedown(this.closure(this._slider_onmousedown)).bind('touchstart',this.closure(this._slider_onmousedown));};zf_Slider.prototype._attachButton=function(selector,
5793delta){this.$(selector).mousedown(this.closure(this._button_onmousedown,delta,false)).dblclick(zf_stdFalse).click(zf_stdFalse).mouseup(this.closure(this._button_onmouseup)).mouseout(this.closure(this._button_onmouseup));
5794};zf_Slider.prototype._slider_onmousedown=function(e){this._initSize();var offset=this.$().offset();var pageX=e.pageX;var pageY=e.pageY;if(this._vertical){offset=offset.top+zf_stdExtractPixels(this.$().css('border-top-width'))+this.verticalOffset;
5795offset=this._size-(pageY-offset);}else{offset=offset.left+zf_stdExtractPixels(this.$().css('border-left-width'))+this.horizontalOffset;offset=pageX-offset;}if(this.setPos(100*offset/this._size)){if(this.onchange!=null)this.onchange(this._pos);
5796}};zf_Slider.prototype._button_onmousedown=function(e,delta,dbl){if(e!=null){e.stopPropagation();$(e.currentTarget).parent().addClass('selected');}if(this.setPos(this._pos+delta)){if(this.onchange!=null)this.onchange(this._pos);
5797}var self=this;var repeat=function(){self._button_onmousedown(null,delta);};if(this._delayTimer==null){this._delayTimer=setTimeout(repeat,400);}else if(this._repeatTimer==null){this._repeatTimer=setInterval(repeat,
579880);}return false;};zf_Slider.prototype._button_onmouseup=function(e){if(this._repeatTimer!=null){clearInterval(this._repeatTimer);this._repeatTimer=null;}if(this._delayTimer!=null){clearTimeout(this._delayTimer);
5799this._delayTimer=null;}if(e!=null){$(e.currentTarget).parent().removeClass('selected');}};zf_Slider.prototype._handle_onmousedown=function(e){e.stopPropagation();e.preventDefault();
5800if(!zf_stdIsLeftButton(e))return;var node=e.currentTarget,pageX=e.pageX,pageY=e.pageY;if(this._vertical)this._anchorY=pageY;else this._anchorX=pageX;this._anchorPos=this._pos;
5801if(document.addEventListener){document.addEventListener("mousemove",this._mousemove,true);document.addEventListener("mouseup",this._mouseup,true);document.addEventListener("selectstart",
5802zf_stdFalse,true);}
5802else if(node&&node.setCapture){$(node).mousemove(this._mousemove).mouseup(this._mouseup);node.setCapture();}node&&$(node).addClass('selected');
5803};zf_Slider.prototype._handle_onmouseup=function(e){e=jQuery.event.fix(e);e.stopPropagation();e.preventDefault();this._handle_onmousemove(e);var node=this.$('.slider-h')[0];
5804if(document.removeEventListener){document.removeEventListener("mousemove",this._mousemove,true);document.removeEventListener("mouseup",this._mouseup,true);document.removeEventListener("selectstart",
5805zf_stdFalse,true);}else if(node.releaseCapture){node.releaseCapture();$(node).unbind('mousemove mouseup');}if(node){$(node).removeClass('selected');}};zf_Slider.prototype._handle_onmousemove=function(e){e=jQuery.event.fix(e);
5806var pos,pageX=e.pageX,pageY=e.pageY;this._initSize();if(this._vertical){;;pos=this._anchorPos+100*(this._anchorY-pageY)/this._size;}else{;;pos=this._anchorPos+100*(pageX-this._anchorX)/this._size;
5807}if(!isNaN(pos)&&this.setPos(pos)){if(this.onchange!=null)this.onchange(this._pos);}};;var Sylvester={version:'0.1.3',precision:1e-6};function Matrix(){}Matrix.prototype={e:function(i,
5808j){if(i<1||i>this.elements.length||j<1||j>this.elements[0].length){return null;}return this.elements[i-1][j-1];},map:function(fn){var els=[],ni=this.elements.length,
5809ki=ni,i,nj,kj=this.elements[0].length,j;do{i=ki-ni;nj=kj;els[i]=[];do{j=kj-nj;els[i][j]=fn(this.elements[i][j],i+1,j+1);}while(--nj);}while(--ni);return Matrix.create(els);
5810},multiply:function(matrix){if(!matrix.elements){return this.map(function(x){return x*matrix;});}var returnVector=matrix.modulus?true:false;var M=matrix.elements||matrix;
5811if(typeof(M[0][0])=='undefined'){M=Matrix.create(M).elements;}if(!this.canMultiplyFromLeft(M)){return null;}var ni=this.elements.length,ki=ni,i,nj,kj=M[0].length,
5812j;var cols=this.elements[0].length,elements=[],sum,nc,c;do{i=ki-ni;elements[i]=[];nj=kj;do{j=kj-nj;sum=0;nc=cols;do{c=cols-nc;sum+=this.elements[i][c]*M[c][j];}while(--nc);
5813elements[i][j]=sum;}while(--nj);}while(--ni);M=Matrix.create(elements);return returnVector?M.col(1):M;},x:function(matrix){return this.multiply(matrix);},canMultiplyFromLeft:function(matrix){var M=matrix.elements||matrix;
5814if(typeof(M[0][0])=='undefined'){M=Matrix.create(M).elements;}return(this.elements[0].length==M.length);},setElements:function(els){var i,elements=els.elements||els;
5815if(typeof(elements[0][0])!='undefined'){var ni=elements.length,ki=ni,nj,kj,j;this.elements=[];do{i=ki-ni;nj=elements[i].length;kj=nj;this.elements[i]=[];do{j=kj-nj;
5816this.elements[i][j]=elements[i][j];}while(--nj);}while(--ni);return this;}var n=elements.length,k=n;this.elements=[];do{i=k-n;this.elements.push([elements[i]]);}while(--n);
5817return this;}};Matrix.create=function(elements){var M=new Matrix();return M.setElements(elements);};$M=Matrix.create;(function($){if(!$.cssHooks){throw("jQuery 1.4.3+ is needed for this plugin to work");
5818return;}var prop="transform",vendorProp,supportedProp,supports3d,supports2d,supportsFilter,capProp=prop.charAt(0).toUpperCase()+prop.slice(1),prefixes=["Moz","Webkit",
5819"O","MS"],div=document.createElement("div");if(prop in div.style){supportedProp=prop;supports3d=div.style.perspective!==undefined;}else{for(var i=0;i<prefixes.length;
5820i++){vendorProp=prefixes[i]+capProp;if(vendorProp in div.style){supportedProp=vendorProp;if((prefixes[i]+'Perspective')in div.style){supports3d=true;}else{supports2d=true;
5821}break;}}}if(!supportedProp){supportsFilter=('filter' in div.style);supportedProp='filter';}div=null;$.support[prop]=supportedProp;var transformProperty=supportedProp;
5822var properties={rotateX:{defaultValue:0,matrix:function(a){if(supports3d){return $M([[1,0,0,0],[0,Math.cos(a),Math.sin(-a),0],[0,Math.sin(a),Math.cos(a),0],[0,0,
58230,1]]);}else{return $M([[1,0,0],[0,1,0],[0,0,1]]);}}},rotateY:{defaultValue:0,matrix:function(b){if(supports3d){return $M([[Math.cos(b),0,Math.sin(b),0],[0,1,0,0],
5824[Math.sin(-b),0,Math.cos(b),0],[0,0,0,1]]);}else{return $M([[1,0,0],[0,1,0],[0,0,1]]);}}},rotateZ:{defaultValue:0,matrix:function(c){if(supports3d){return $M([[Math.cos(c),
5825Math.sin(-c),0,0],[Math.sin(c),Math.cos(c),0,0],[0,0,1,0],[0,0,0,1]]);}else{return $M([[Math.cos(c),Math.sin(-c),0],[Math.sin(c),Math.cos(c),0],[0,0,1]]);}}
5825},scale:{defaultValue:1,
5826matrix:function(s){if(supports3d){return $M([[s,0,0,0],[0,s,0,0],[0,0,s,0],[0,0,0,1]]);}else{return $M([[s,0,0],[0,s,0],[0,0,1]]);}}},translateX:{defaultValue:0,
5827matrix:function(tx){if(supports3d){return $M([[1,0,0,0],[0,1,0,0],[0,0,1,0],[tx,0,0,1]]);}else{return $M([[1,0,0],[0,1,0],[tx,0,1]]);}}},translateY:{defaultValue:0,
5828matrix:function(ty){if(supports3d){return $M([[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,ty,0,1]]);}else{return $M([[1,0,0],[0,1,0],[0,ty,1]]);}}},translateZ:{defaultValue:0,
5829matrix:function(tz){if(supports3d){return $M([[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,tz,1]]);}else{return $M([[1,0,0],[0,1,0],[0,0,1]]);}}}};var applyMatrix=function(elem){var transforms=$(elem).data('transforms');
5830var tM;if(supports3d){tM=$M([[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]);}else{tM=$M([[1,0,0],[0,1,0],[0,0,1]]);}for(var name in properties){tM=tM.x(properties[name].matrix(transforms[name]||properties[name].defaultValue))}if(supports3d){s="matrix3d(";
5831s+=tM.e(1,1).toFixed(10)+","+tM.e(1,2).toFixed(10)+","+tM.e(1,3).toFixed(10)+","+tM.e(1,4).toFixed(10)+",";s+=tM.e(2,1).toFixed(10)+","+tM.e(2,2).toFixed(10)+","+tM.e(2,
58323).toFixed(10)+","+tM.e(2,4).toFixed(10)+",";s+=tM.e(3,1).toFixed(10)+","+tM.e(3,2).toFixed(10)+","+tM.e(3,3).toFixed(10)+","+tM.e(3,4).toFixed(10)+",";s+=tM.e(4,
58331).toFixed(10)+","+tM.e(4,2).toFixed(10)+","+tM.e(4,3).toFixed(10)+","+tM.e(4,4).toFixed(10);s+=")";}else if(supports2d){s="matrix(";s+=tM.e(1,1).toFixed(10)+","+tM.e(1,
58342).toFixed(10)+",";s+=tM.e(2,1).toFixed(10)+","+tM.e(2,2).toFixed(10)+",";s+=tM.e(3,1).toFixed(10)+"px,"+tM.e(3,2).toFixed(10)+'px';s+=")";}else if(supportsFilter){s="progid:DXImageTransform.Microsoft.";
5835s+="Matrix(";s+="M11="+tM.e(1,1).toFixed(10)+",";s+="M12="+tM.e(1,2).toFixed(10)+",";s+="M21="+tM.e(2,1).toFixed(10)+",";s+="M22="+tM.e(2,2).toFixed(10)+",";s+="SizingMethod='auto expand'";
5836s+=")";elem.style.top=tM.e(3,1);elem.style.left=tM.e(3,2);}elem.style[transformProperty]=s;};var transformValue=function(elem,value,unit){if(!unit)return typeof(value)=='string'?parseFloat(value):value;
5837if(unit=='px')return value;if(unit=='%')return jQuery(elem).offsetParent().width()*value/100;};var hookFor=function(name){$.fx.step[name]=function(fx){$.cssHooks[name].set(fx.elem,
5838transformValue(fx.elem,fx.now,fx.unit));};return{get:function(elem,computed,extra){var transforms=$(elem).data('transforms');if(transforms===undefined){transforms={};
5839$(elem).data('transforms',transforms);}return transforms[name]||properties[name].defaultValue;},set:function(elem,value){var transforms=$(elem).data('transforms');
5840if(transforms===undefined)transforms={};var propInfo=properties[name];if(typeof propInfo.apply==='function'){transforms[name]=propInfo.apply(transforms[name]||propInfo.defaultValue,
5841value);}else{transforms[name]=value}$(elem).data('transforms',transforms);
5841applyMatrix(elem);}}};if(transformProperty){for(var name in properties){$.cssHooks[name]=hookFor(name);
5842$.cssNumber[name]=true;}}})(jQuery);;;function zfl_Slideshow(id,minWidth,minHeight,maxWidth,maxHeight,slideshowvars,photoSet,psToken,defaultOwner,fullscreen,photoList,embedded,
5843autoResize,options){zfl_Control.prototype.constructor.call(this,id);this.id=id;var self=this;options=$.extend({},options);this.minWidth=minWidth;this.minHeight=minHeight;
5844this.maxWidth=maxWidth;this.maxHeight=maxHeight;this._isQuickShop=!!options.isQuickShop;if(this._isQuickShop){this.$qs=$('#'+id+'-qs');this._shopOnly=slideshowvars.qs_mode==Zenfolio.Global.QuickShopMode.ShopOnly.toString();
5845}this._embedded=!!embedded;this._openQuickShopPanel=!!options.openQuickShopPanel;this._$commentsBrowser=options.$commentsBrowser;this._$sharePopup=options.$sharePopup;
5846this._analytics=options.analytics;this._returnData=options.returnData;this._addToCartMode=!!options.addToCartMode;this._getReturnPagesCallback=options.getReturnPagesCallback;
5847this._fillType=slideshowvars.scalemode=='fill'?'fill':'fit';this._upscaleLimit=slideshowvars.scaleimages?(slideshowvars.scaleimages=='1'?1.6:1):(parseFloat(slideshowvars.maxscale,
584810)||1);var ec=slideshowvars.enable_controls=='1';var tm=ec&&parseInt(slideshowvars.thumbnails_mode,10)||0;this._controlsMode=slideshowvars.full_overlay?'full':tm==1?'bottom':tm==2?'right':tm==3?'top':tm==4?'left':ec?'lite':'hide';
5849this._overlayFlags=0;this._overlayFlags=this._controlsMode=='full'?this._overlayFlags|(slideshowvars.captions_enabled=='1'?9:0)|(slideshowvars.exif_enabled=='1'?2:0)|(slideshowvars.titles_enabled_sep=='1'?1:0)|(slideshowvars.captions_enabled_sep=='1'?8:0)|(slideshowvars.sequence_numbers=='0'?0:16)|(slideshowvars.qs_keywords=='0'?0:32):this._overlayFlags;
5850this._overlayFlags=this._controlsMode!='hide'?this._overlayFlags|(slideshowvars.music||photoSet&&photoSet.videos||photoList&&$.any(photoList.getAll(),function(p){return p&&p.video;
5851})?4:0):this._overlayFlags;this._isQuickShop&&(this._overlayFlags&=~2);this._isQuickShop&&zf_CategoryInfo.load(function(info){self._categoryInfo=info;});this._alwaysShowControls=false;
5852this._loop=slideshowvars.loop=='1';this._random=slideshowvars.random=='1';this._makeFullScreen=fullscreen;this._skin='dark';this._photoSet=photoSet;this._audioPlayer=new Zenfolio.Global.AudioPlayer(this.dom(),
5853id+'-audioPlayer');this._audioPlayer.initTrack(slideshowvars.id,slideshowvars.music,slideshowvars.loop_music);if(slideshowvars.skin)this._skin=slideshowvars.skin.toLowerCase()=='black'?'dark':'light';
5854this._transition=parseInt(slideshowvars.transition);this._kenburns=this._transition==zfl_Slideshow.Kenburns?new zfl_KenBurns(id):null;if(this._kenburns)this._transition=zfl_Slideshow.CrossFade;
5855this._delay=parseInt(slideshowvars.delay)*1000;this._autostart=!this._isQuickShop&&(slideshowvars.autostart=='1');this._skipProtectedPhotos=this._embedded;this._showFavorites=slideshowvars.qs_addtofav=='1';
5856this._showYearbook=slideshowvars.qs_addtoyp=='1';this._showComments=slideshowvars.qs_comments=='1';this._showDownloads=slideshowvars.qs_downloads=='1';this._showShare=slideshowvars.qs_share=='1';
5857this._isAmdEnabled=slideshowvars.qs_is_amd_enabled=='1';this._isSmdEnabled=slideshowvars.qs_is_smd_enabled=='1';this._maxSmdZipSize=slideshowvars.qs_maxsmdzipsize;
5858this._isQuickShop&&(this._qsControlsVisibilityState=1);this._hasShrunk=!!photoList||!!photoSet.photos;var newPhotoList=photoList||new zfl_PhotoList(0,zfl_Slideshow.PageLength,
5859photoSet.photos||1000,photoSet.id,psToken,photoSet.photoChangeNumber);newPhotoList.setDefaults&&newPhotoList.setDefaults(photoSet,defaultOwner?defaultOwner:photoSet.owner);
5860this._videoSupported=true;this._videoAutostartSupported=true;this._videoVolumeControllable=true;this.setPhotoList(newPhotoList);this._photoCount=function(){return this._photoList.length;
5861};this._loaderPool={};this._currentPhoto=null;this._currentIndex=-1;this._positionState=0;this._swipeBack=50;this._swipeForward=-this._swipeBack;this._current={photoLoader:null,
5862$view:this.$dom().find('.viewholder-1')};this._hidden={photoLoader:null,$view:this.$dom().find('.viewholder-2')};this._currentAnim={photoLoader:null,direction:0,
5863animOverride:null,exec:function(){self._animate(this);}};this._queuedAnim={photoLoader:null,direction:0,animOverride:null,exec:function(){self._animate(this);}};
5864this._randomOrder=[];this._randomOrderRev={};this._randomPos=-1;this._compatibility=true;this.currentDirection=zfl_Slideshow.Forward;this._controls=null;this._autoresize=!!autoResize;
5865this._sizingContainer=this.$dom().parent();this._isQuickShop&&(this._sizingContainer=this._sizingContainer.parent());if(this._sizingContainer.width()<=0&&!options.forceSizingContainer){this._sizingContainer=$("body");
5866}this._setupControls();var $touchDisabled=this._getOverlay([1,21,3,25,26,241,221,223,224,'22a',271,'2a','2b','qsi','bgs']);var createTouchWrapper=function(func){return function(e){if($(e.target).closest($touchDisabled).length>0)return true;
5867return func.call(this,e);};};this.$dom().bind('touchstart',this.closure(createTouchWrapper(this._ontouchstart)));this.$dom().bind('touchmove',this.closure(createTouchWrapper(this._ontouchmove)));
5868this.$dom().bind('touchend',this.closure(createTouchWrapper(this._ontouchend)));this._browserFullscreenState='exited';this._browserFullscreenMode='none';this.$('.zfl-ss-view').click(function(){if(self.onclick&&self._currentPhoto.id)self.onclick.call(self,
5869zf_toUint32(self._currentPhoto.id));});this.$().attr('tabindex','0').css({outline:'0'});var keyHandlersMap={27:function(){var isFullscreen=self._browserFullscreenMode!='none';
5870if(!isFullscreen&&self._backButton&&self._backButton.callback&&!$("BODY").hasClass("configurator-mode")){self._backButton.callback();}},32:function(){self._browserFullscreenMode!='video'&&self._explicitTogglePlayPause();
5871},37:function(){self._browserFullscreenMode!='video'&&self.back();},39:function(){self._browserFullscreenMode!='video'&&self.next();},70:function(){self._processFavorites({action:'toggleState'});
5872},89:function(){self._processYearbook({action:'toggleState'});}};var keyHandler=$.throttle(function(key){if(self.$().is(':visible')){var handler=keyHandlersMap[key];
5873handler&&handler();}},300);$(document).on(this._fixEvents('keydown'),function(e){var key=e.which;if(!keyHandlersMap[key]||!self.$().is(':visible')||Zenfolio.Global.DomHelpers.isTextFieldFocused()){return true;
5874}keyHandler(key);return false;});this.$().click(function(e){var $target=$(e.target),clickOnPlay=$target.closest('.zfl-ss-overlay-4').length>0,clickOnVideo=$target.closest('.zfl-ss-video .zfl-ss-view').length>0;
5875if(!clickOnPlay&&!clickOnVideo){return;}if(self.$().hasClass('zfl-ss-video-playing')&&!self.$().hasClass('zfl-ss-video-wosc')){if(self.$().hasClass('zfl-ss-playing')){self._explicitTogglePlayPause();
5876}else{self._processVideo({action:'pause'});}}else if(self._getOverlay([4]).is(':visible')){self._processVideo({action:'resume'});}});}zfl_Slideshow.inherits(zfl_Control);zfl_Slideshow.PageLength=80;
5877zfl_Slideshow.Forward=1;zfl_Slideshow.Backward=-1;zfl_Slideshow.ControlsHeight=60;zfl_Slideshow.ControlsWidth=280;zfl_Slideshow.QuickShopPanelWidth=400;zfl_Slideshow.NoTransition=0;zfl_Slideshow.Random=1;zfl_Slideshow.FadeToBlack=2;zfl_Slideshow.FadeToWhite=3;zfl_Slideshow.CrossFade=4;zfl_Slideshow.Slide=5;
5878zfl_Slideshow.Kenburns=6;zfl_Slideshow.AnimationEndEvent='animationend';zfl_Slideshow.TransitionEndEvent='transitionend';zfl_Slideshow.prototype.init=function(options){;options=$.extend(true,{},options);this._loadingTimeout=setTimeout(function(){self._showLoading(true);
5879},500);var self=this;var compactHeight=this._getCompactHeight();if(compactHeight!=null){this.$dom().height(compactHeight);}if(this._embedded){this.maxWidth=$('body:first').width();
5880this.maxHeight=$('body:first').height();;if(this.maxWidth==0||this.maxHeight==0){;this.maxHeight=this.maxWidth=-1;setTimeout(this.closure(this.init),1000);return;
5881}this.resize(this.maxWidth,this.maxHeight);}else if(this.maxWidth==-1||this.maxHeight==-1){this.maxWidth=this.$dom().width();this.maxHeight=this.$dom().height();
5882this._skipProtectedPhotos=true;}if(this._makeFullScreen){var height=window.innerHeight;var width=window.innerWidth;$('html').css('overflow','hidden');$('body:first').css({'background-color':'#000',
5883'overflow-x':'hidden','height':height,'width':width,'min-width':0});this.$dom().css('overflow','hidden');this.maxHeight=height;this.maxWidth=width;this.resize(width,
5884height);$('body:first').on(this._fixEvents('resize'),function(e){height=window.innerHeight;width=window.innerWidth;self.maxHeight=height;self.maxWidth=width;$('body:first').width(width).height(height);
5885self.resize(width,height);});}if(this._autoresize){$(window).on(this._fixEvents("orientationchange resize zfResizeSlideshow"),this.closure(this._onResize));}if(this._autostart)this._playing=true;
5886this._renderPlayState();this._resizeView();
5886this._startIndex=options.startIndex||0;if(this._autostart&&!this._random){;if(this._startIndex)this.seek(this._startIndex,
58871);else this.play();}else if(this._random){;var photo=this._photoList.get(0);if(!zf_Loadable.notifyLoaded(photo,function(){;self._initRandom();if(self._autostart){self.play();
5888}else{self.next();}})){;}}else{;this.seek(this._startIndex);}this._toggleControls({action:'show',duration:2000,source:'init'});$(document).on(this._fixEvents('click'),
5889function(e){if(self._downloadMenu&&$(e.target).closest('.zfl-ss-overlay-qs-dwn').length<=0){self._hideDownloadMenu();}});this._width=this.$dom().width();this._height=this.$dom().height();
5890this._setViewRect();if(this._autostart)this._resumeTrack(false);this.$dom().find('.loading').remove();zf_stdDisableRightClick(this.$(),function($target){return $target.closest('.zfl-ss-view, .zfl-ss-controls-thumbs-item').length<=0;
5891});this._openQuickShopPanel&&!this._shopOnly&&this._toggleQuickShopPanel();delete this._openQuickShopPanel;};zfl_Slideshow.prototype.setMaxSize=function(width,height){if(this._browserFullscreenState=='entered')return;
5892this.maxWidth=width;this.maxHeight=height;};zfl_Slideshow.prototype.setPhotoList=function(photoList){;this._photoList=photoList;this._photoList.onshrink=this.closure(function(){this._hasShrunk=true;
5893this._initRandom(true);return this._hasShrunk;});if(this._controlsMode!='hide'){this._overlayFlags=this._overlayFlags&(~4)|(!this._isQuickShop&&(this._audioPlayer.isSoundtrackNonEmpty()||(this._videoVolumeControllable&&(this._photoSet&&this._photoSet.videos||photoList&&$.any(photoList.getAll(),
5894function(p){return p&&p.video;}))))?4:0);var showVolume=(this._overlayFlags&4)==4;var $vol=this._controlsMode=='full'?this._getOverlay([266]):this.$dom('controls').find('[data-key="volume"]');
5895$vol.css({display:showVolume?'':'none'});}};zfl_Slideshow.prototype.setupBackButton=function(text,callback){if(this._controlsMode!='full')return;var $btn=this._getOverlay([221]),
5896$text=this._getOverlay(['backtext']);$btn.off('click').css({visibility:'hidden'});$text.text('');this._backButton=!text?null:{text:text,callback:callback};if(!text)return;
5897var self=this;var callback2=function(){if(self._browserFullscreenState=='entered')self._toggleFullscreen();callback();};$btn.on('click',callback2).css({visibility:''});
5898$text.text(text);};zfl_Slideshow.prototype.dispose=function(){if(this._disposed)return;var eventsNamespace=this._fixEvents('');this.pause();$(window).off(eventsNamespace);$(document).off(eventsNamespace);
5899$("body:first").off(eventsNamespace);zf_zenbar&&zf_zenbar.scrapbookEdit&&zf_zenbar.scrapbookEdit.$().off(eventsNamespace);this._processVideo({action:'destroy'});
5900this._audioPlayer.dispose();this._hideDownloadMenu();if(this._$commentsBrowser){var comments=zf_Control.find(this._$commentsBrowser.attr("id"));comments&&comments.command&&comments.command("closeComments");
5901}if(this._$sharePopup){var share=zf_Control.find(this._$sharePopup.attr("id"));share&&share.hide();}this._disposed=true;};zfl_Slideshow.prototype.hideQuickShopPanel=function(){if(!this._quickShopPanelOpened)return;
5902this._toggleQuickShopPanel();};zfl_Slideshow.prototype.play=function(){;if(this._playing){this._renderPlayState();if(this._showingVideo&&this._videoAutostartSupported)this._processVideo({action:'resume'});
5903else{this._resumeTrack(false);this.next();}this._resizeView();}};zfl_Slideshow.prototype.resume=function(immediately,outerCall){if(!this._playing){this._playing=true;this._clearPlayTimeout();
5904if(immediately)this.play();else this._playTimeout=setTimeout(this.closure(this.play),this._delay);this._renderPlayState();if(!this._showingVideo)this._resumeTrack(outerCall);
5905this._resizeView();}};zfl_Slideshow.prototype.pause=function(keepMusic,outerCall){this._playing=false;this._showLoading(false);this._queuedAnim.photoLoader=null;this._queuedAnim.animOverride=null;
5906this._currentAnim.photoLoader=null;this._clearPlayTimeout();this._clearAnimationTimeout();clearTimeout(this._loadingTimeout);this._renderPlayState();if(this._showingVideo)this._processVideo({action:'pause'});
5907if(!keepMusic)this._pauseTrack(outerCall);this._resizeView();};zfl_Slideshow.prototype._explicitTogglePlayPause=function(){this._playing=!this._playing;if(this._isQuickShop){if(this._playing){this._getOverlay([223,
5908'22a','bgs']).css({display:'none'});this._getOverlay([224]).css({display:''});
5908this._quickShopPanelOpened&&this._toggleQuickShopPanel();}else{this._getOverlay([223,
5909'22a','bgs']).css({display:''});this._getOverlay([224]).css({display:'none'});}}this._playing?this.play():this.pause();this._resizeView();if(this._isQuickShop){if(!this._playing&&this._browserFullscreenState=="entered")this._toggleFullscreen();
5910this._playing&&this._toggleControls({action:'hide',delay:2000,source:'qs play'});this._playing||this._toggleControls({action:'show',source:'qs pause'});}};zfl_Slideshow.prototype._pauseForVideo=function(){this._showLoading(false);
5911this._queuedAnim.photoLoader=null;this._queuedAnim.animOverride=null;this._currentAnim.photoLoader=null;this._clearPlayTimeout();this._clearAnimationTimeout();clearTimeout(this._loadingTimeout);
5912this._pauseTrack(true);};zfl_Slideshow.prototype._renderPlayState=function(stateOverride){if(this._controls){this._controls.$play.css({'display':this._playing?'none':''});this._controls.$pause.css({'display':this._playing?'':'none'});
5913}var state=stateOverride===undefined||stateOverride===null?this._playing:stateOverride;this._getOverlay([261]).toggleClass('fa-play',!state).toggleClass('fa-pause',
5914!!state);this._getOverlay(['qs-playback']).toggleClass('zfl-ss-controls-qs-play',!state).toggleClass('zfl-ss-controls-qs-pause',!!state).attr('data-ss-title',state?'Pause':'Play');
5915this.$().toggleClass('zfl-ss-playing',!!state);this._refreshQsiBackground();};zfl_Slideshow.prototype.next=function(animOverride){this._stopAnimation();var nextIndex=this._getNextIndex();
5916if(nextIndex==this._currentIndex){this._startPlayAnimationTimeout();return;}var self=this;setTimeout(function(){self.seek(nextIndex,zfl_Slideshow.Forward,animOverride);
5917},1);};zfl_Slideshow.prototype.back=function(animOverride){this._stopAnimation();var prevIndex=this._getPrevIndex();if(this._currentIndex==prevIndex){this._startPlayAnimationTimeout();
5918return;}var self=this;setTimeout(function(){self.seek(prevIndex,zfl_Slideshow.Backward,animOverride);},1);};zfl_Slideshow.prototype.goTo=function(index,animOverride){this._stopAnimation();
5919if(this._currentIndex==index){this._startPlayAnimationTimeout();return;}var self=this;var curSeqIdx=this._currentIndex,seqIdx=index;if(this._random){curSeqIdx=this._randomOrderRev[this._currentIndex];
5920seqIdx=this._randomOrderRev[index];this._randomPos=seqIdx;}var direction=curSeqIdx<seqIdx?zfl_Slideshow.Forward:zfl_Slideshow.Backward;setTimeout(function(){self.seek(index,
5921direction,animOverride);},1);};zfl_Slideshow.prototype.clearCurrentIndex=function(){this._currentIndex=-1;this._positionState++;};zfl_Slideshow.prototype.seek=function(index,direction,animOverride){this._clearAnimationTimeout();
5922clearTimeout(this._loadingTimeout);this._clearPlayTimeout();var self=this;this._isLoading=true;this._loadingTimeout=setTimeout(function(){self._showLoading(true);
5923},500);this._queuedAnim.photoLoader=null;if(!direction){if(this._previousIndex<this._currentIndex)direction=zfl_Slideshow.Forward;else direction=zfl_Slideshow.Backward;
5924}var photo=this._photoList.get(index);if(!photo){var pos=this._randomPos;var reinit=function(){self._initRandom(true,function(){if(pos<self._randomOrder.length)self.seek(self._randomOrder[pos]);
5925else{pos=self._randomOrder.length-1;self.seek(self._randomOrder[pos]);}});};setTimeout(reinit,500);return;}this._previousIndex=this._currentIndex;this._currentIndex=index;
5926this._positionState++;this._currentPhoto=photo;var of=this._overlayFlags;if(photo.loaded){(of&1)&&self._getOverlay([self._isQuickShop?'qsi-title':263]).text(photo.title);
5927self._isQuickShop&&self._getOverlay(['qsi-title']).css('display',(of&1)&&$.trim(photo.title)?'':'none');self._getOverlay(["copyright-txt"]).text(photo.getCopyright());
5928self._photo_onseek(photo,direction,animOverride);}else{photo.advise(this,function(){photo.unadvise(self);if(photo!==self._currentPhoto){return;}(of&1)&&self._getOverlay([self._isQuickShop?'qsi-title':263]).text(photo.title);
5929self._isQuickShop&&self._getOverlay(['qsi-title']).css('display',(of&1)&&$.trim(photo.title)?'':'none');self._getOverlay(["copyright-txt"]).text(photo.getCopyright());
5930self._photo_onseek(photo,direction,animOverride);},function(){if(photo!==self._currentPhoto){photo.unadvise(self);return;}if(self._random){photo.unadvise(self);setTimeout(function(){self.seek(self._randomOrder[self._randomPos],
5931direction,animOverride);},1);}else{self._getOverlay(["copyright-txt"]).text("loading...");}});}if(this._photoCount()>1)self._prefetch(index+1,zfl_Slideshow.Forward,
59328);var move=direction==zfl_Slideshow.Forward?'forward':direction==zfl_Slideshow.Backward?'back':null;this._processThumbnails({currentItem:this._currentIndex,move:move});
5933if(of&16){this._getOverlay([this._isQuickShop?'qsi-seqnum':262]).text(zf_stdFormatString('{0} of {1}',index+1,this._hasShrunk?this._photoCount():'???'));}if(this._controlsMode=='full'&&(of&42)){var meta=photo.getMeta();
5934if(!zf_Loadable.notifyLoaded(meta,function(){if(photo!==self._currentPhoto){return;}if(of&2){self._getOverlay(['exiftxt']).text(self._formatExif(meta.exif));}if(of&8){self._getOverlay([self._isQuickShop?'qsi-caption':'241']).toggleClass('empty',
5935!meta.caption);self._getOverlay([self._isQuickShop?'qsi-caption-text':'241-text']).trigger('destroy.dot').html(meta.caption);self._refreshCaption(false);}if(of&32){self._refreshKnc();
5936self._refreshKncCollapsible(false);}if(of&40||self._isQuickShop){self._resizeView();
5936self._refreshQsiBackground();}})){this._getOverlay(["exiftxt"]).text("loading...");
5937}}this._processBackgrounds({action:'onSeek'});this._processComments({action:'renderState'});this._hideDownloadMenu();if(this._analytics){this._analytics.update(photo);
5938}};zfl_Slideshow.prototype.resize=function(width,height){;;if(this._browserFullscreenState=='entered')return;this._isQuickShop&&this._quickShopPanelOpened&&(width-=zfl_Slideshow.QuickShopPanelWidth);
5939if(this._width==width&&this._height==height)return;this.$dom().width(width).height(height);this._isQuickShop&&this.$qs.find('.zfl-qs-panel').height(height);this._width=width;
5940this._height=height;if(this._makeFullScreen){var marginT;if(this._browserFullscreenState=='entering')marginT=0;else marginT=Math.floor((window.innerHeight-height)/2);
5941this.$dom().css('margin-top',marginT);}if(this.$dom('controls').length)this._processThumbnails({redraw:true});var smallWidth=!!(this._width<600&&this._quickShopPanelOpened);
5942this._getOverlay(['22a']).toggleClass('zfl-ss-overlay-22a-sw',smallWidth);this._addToCartMode&&this._getOverlay(['qs-area']).toggleClass('zfl-ss-controls-qs-area-sw',
5943smallWidth);var of=this._overlayFlags;(of&8)&&this._refreshCaption(false);(of&32)&&this._refreshKncCollapsible(false);this._resizeView();this._refreshQsiBackground();
5944};zfl_Slideshow.prototype._resizeView=function(){var changed=this._setViewRect();if(!changed)return;var self=this;var updateView=function(view){if(view.photoLoader){self._updateView(view.photoLoader,
5945view.$view.find('.zfl-ss-view'),{resize:true});}};updateView(this._current);updateView(this._hidden);};zfl_Slideshow.prototype._setViewRect=function(){var o=$.extend({},this._viewRect);
5946var r=this._viewRect={left:0,top:0,width:this._width,height:this._height};var playing=this._playing||(this._afterTouchStart&&this._touchStart.playing);if(this._isQuickShop&&!playing){r.left+=47;
5947r.top+=54;r.width-=94;r.height-=105;this._qsControlsVisibilityState&&(r.height-=80);var $qsiCaption=this._getOverlay(["qsi-caption"]),$qsiKnc=this._getOverlay(["qsi-knc"]),
5948$bgs=this._getOverlay(["bgs"]);r.height-=40+($qsiCaption.is(":visible")?Math.min(70,$qsiCaption.outerHeight(true)):0)+($qsiKnc.is(":visible")?Math.min(65,$qsiKnc.outerHeight(true)):0)+($bgs.is(":visible")?$bgs.outerHeight(true):0);
5949this._getOverlay([4,"2a","2b"]).css({top:r.top+Math.round(r.height/2)});}else{this._getOverlay([4,"2a","2b"]).css({top:""});}var changed=o.left!=r.left||o.top!=r.top||o.width!=r.width||o.height!=r.height;
5950return changed;};zfl_Slideshow.prototype._onResize=function(){if(this._browserFullscreenState=='entered')return;var newWidth=this._sizingContainer.width();var newHeight=this._getCompactHeight()||this._sizingContainer.height();
5951var ssid=this._sizingContainer.attr('id');if(newWidth>0&&newHeight>0){;this.maxWidth=newWidth;this.maxHeight=newHeight;this.resize(newWidth,newHeight);}else;};zfl_Slideshow.createHtml=function(id,
5952classes,bgcolor,width,height,isFullScreen,isQuickShop){var isTransparent=bgcolor=='transparent';bgcolor=bgcolor=='0'?'#000':bgcolor;if(isFullScreen){width=document.documentElement.clientWidth;
5953height=document.documentElement.clientHeight;}var styles=['width:',width,'px; ','height:',height,'px; ','overflow: hidden;'];if(!isTransparent)styles.push('background-color:',
5954bgcolor,';');var passwordPopup=['<div class="pv-password none" name="password-popup" style="height: 100%; width: 100%;">','<div class="password-box popup-border1 popup-color1 popup-bgcolor1">',
5955'<div class="text">Content protected with password.</div>','<div class="separator separator-border1"></div>','<div class="item none" name="hint">','<div class="prompt">Hint:</div>',
5956'<div class="password-hint-text"></div>','</div>','<div class="form" name="password-form">','<div class="item">','<div class="prompt">Password:</div>','<input name="password-input" type="password" />',
5957'<a name="password-go">Go</a>','</div>','</div>','<div class="incorrect none" name="password-incorrect">',' Incorrect password','</div>','</div>','</div>'].join('');
5958var html=["<div id='",id,"'"," class='",classes,isQuickShop?" zfl-qs-slideshow":"","'"," style='",styles.join(''),"'>","<div id='",id,"-viewholder-1'"," class='zfl-ss zfl-ss-viewholder viewholder-1'>",
5959"<div class='zfl-ss zfl-ss-view'><img/></div>",passwordPopup,"</div>","<div id='",id,"-viewholder-2'"," class='zfl-ss zfl-ss-viewholder none viewholder-2'>","<div class='zfl-ss zfl-ss-view'><img/></div>",
5960passwordPopup,"</div>","<div id='",id,"-message'"," class='zfl-ss zfl-ss-message' style='display: none;'>","<div id='",id,"-message-text'"," class='zfl-ss zfl-ss-message-text'></div>",
5961"</div>","</div>"];if(isQuickShop){html=["<div id='",id,"-qs' class='zfl-qs'>",html.join(''),"<div id='",id,"-qs-panel'"," class='zfl-qs-panel'></div>","</div>"];
5962}return html.join('');};zfl_Slideshow.prototype._updateView=function(photoLoader,$view,options){;;;options=$.extend({resize:false},options);var isCurrent=$view.closest(this._current.$view).length>0;
5963if(isCurrent&&!options.resize)this._processVideo({action:'cleanup',target:'current'});if(photoLoader.state==zf_PhotoLoader.PasswordRequired){$view.css({'margin-top':this._viewRect.top,
5964'margin-left':this._viewRect.left,'width':this._viewRect.width,'height':this._viewRect.height,'background-image':'none'});$view.find('img:first').attr('src','/zf/img/null.gif');
5965this._showPassword($view.parent(),photoLoader,true,false);return;}
5965this._showPassword($view.parent(),null,false,false);var photo=photoLoader.getPhoto();var method=this._getMethod(photoLoader.getPhoto());
5966var viewHeight=Math.min(this.maxHeight,method.cy);var viewWidth=Math.min(this.maxWidth,method.cx);if(this._fillType=='fill'&&!photo.video){var ph=photoLoader.getPhoto().height,
5967pw=photoLoader.getPhoto().width;var prh=viewHeight,prw=Math.round(viewHeight*pw/ph);if(prw<viewWidth){prw=viewWidth;prh=Math.round(viewWidth*ph/pw);}var l=Math.round((prw-viewWidth)/2),
5968t=Math.round((prh-viewHeight)/2);$view.css({'margin-top':0,'margin-left':0,'width':viewWidth,'height':viewHeight});$view.find('img:first').attr('src',photoLoader.src).css({'width':prw,
5969'height':prh,position:'relative',top:-t,left:-l});return;}var imgHeight,imgWidth;imgHeight=Math.min(viewHeight,method.cy);imgWidth=Math.ceil(imgHeight*(photoLoader.getPhoto().width/photoLoader.getPhoto().height));
5970if(imgWidth>Math.min(viewWidth,method.cx)){imgWidth=Math.min(viewWidth,method.cx);imgHeight=Math.ceil(imgWidth*(photoLoader.getPhoto().height/photoLoader.getPhoto().width));
5971}var marginLeft=Math.floor((this._viewRect.width-imgWidth)/2);var marginTop=Math.floor((this._viewRect.height-imgHeight)/2);if(this._kenburns&&(!photo.video||!this._videoSupported)){$view.css({'margin-top':'',
5972'margin-left':'','width':'','height':''});$view.addClass('zfl-ss-kenburns');var $img=$view.find('img:first');$img.attr('src',photoLoader.src);var rect=this._viewRect;
5973var imgWidthS=rect.width;var imgHeightS=Math.round(rect.width/imgWidth*imgHeight);$img.css({width:imgHeightS>rect.height?Math.round(rect.height/imgHeight*imgWidth):imgWidthS,
5974height:imgHeightS>rect.height?rect.height:imgHeightS,position:'',top:'',left:'','background-size':'','background-repeat':''});this._kenburns.startTransform(method.kbTransform,
5975$img);}else{$view.css({'margin-top':this._viewRect.top,'margin-left':this._viewRect.left,'width':this._viewRect.width,'height':this._viewRect.height});$view.removeClass('zfl-ss-kenburns');
5976$view.find('img:first').attr('src',photoLoader.src||'/zf/img/null.gif').css({'width':imgWidth,'height':imgHeight,'background-size':[imgWidth,'px ',imgHeight,'px'].join(''),
5977'background-repeat':'no-repeat',position:'relative',top:marginTop+'px',left:marginLeft+'px'});if(photo.video&&isCurrent&&!options.resize)this._processVideo({action:'show'});
5978}};zfl_Slideshow.prototype._showLoading=function(show){;var $el;$el=this._getOverlay(['22b']);if(show)$el.fadeIn(500);else $el.fadeOut(500);};zfl_Slideshow.prototype._getNextIndex=function(loopOverride){if(this._random){return this._getNextRandom(loopOverride);
5979}if(this._currentIndex<this._photoCount()-1)return this._currentIndex+1;else if(this._loop||loopOverride)return 0;return this._currentIndex;};zfl_Slideshow.prototype._getNextRandom=function(loopOverride){var initRand=this._photoCount()>this._randomOrder.length;
5980if(this._randomPos<this._randomOrder.length){if(this._randomOrder[this._randomPos]!=this._currentIndex)return this._randomOrder[this._randomPos];if(this._randomPos+1<this._randomOrder.length)return this._randomOrder[++this._randomPos];
5981else if(this._loop&&!initRand){this._randomPos=0;return this._randomOrder[this._randomPos];}else if(!initRand)return this._currentIndex;}
5981if(initRand){if(!this._hasShrunk){var photo=this._photoList.get(this._randomOrder.length+1);
5982if(!photo.loaded){var self=this,sink={};photo.advise(sink,function(){photo.unadvise(sink);self._initRandom(true);self.next();});return this._currentIndex;}else{this._initRandom(true);
5983}}else{this._initRandom(true);}if(this._randomPos<this._randomOrder.length){return this._randomOrder[++this._randomPos];}}if(this._loop||loopOverride){return this._randomPos=0;
5984}return this._randomPos=0;};zfl_Slideshow.prototype._getPrevIndex=function(loopOverride){if(this._random)return this._getPrevRandom(loopOverride);if(this._currentIndex>0)return this._currentIndex-1;
5985else if(this._hasShrunk&&(this._loop||loopOverride))return this._photoCount()-1;return 0;};zfl_Slideshow.prototype._getPrevRandom=function(loopOverride){var previous;if(this._randomPos>0){previous=this._randomOrder[--this._randomPos];
5986if(previous==this._currentIndex)return this._getPrevRandom(loopOverride);return previous;}else if(this._hasShrunk&&this._loop){this._randomPos=this._randomOrder.length-1;
5987previous=this._randomOrder[this._randomPos];if(previous==this._currentIndex)return this._prevRandom(loopOverride);return previous;}return this._currentIndex;};zfl_Slideshow.prototype._getPhotolistIndex=function(sequenceIndex){if(sequenceIndex<0)return null;
5988if(sequenceIndex>=this._photoCount())return null;if(!this._random)return sequenceIndex;if(sequenceIndex<this._randomOrder.length)return this._randomOrder[sequenceIndex];
5989this._initRandom(true);if(sequenceIndex<this._randomOrder.length)return this._randomOrder[sequenceIndex];return null;};zfl_Slideshow.prototype._initRandom=function(reinit,callback){;
5990if(this._hasShrunk&&this._randomOrder.length==this._photoCount()){if(this._randomPos==-1)this._randomPos=0;return;}if(!reinit){this._randomOrder=[];this._randomOrderRev={};
5991this._randomPos=0;}var start=this._randomOrder.length;var end;if(this._hasShrunk){end=this._photoCount();}else{end=start+zfl_Slideshow.PageLength;}var temp;var rand;
5992var tempArr=[];var i,j;if(!reinit||!this._hasShrunk||(this._hasShrunk&&end>start)){for(i=start;i<end;i++){tempArr[i]=i;}var initial=end-start;for(i=start,j=0;i<end;
5993i++,j++){if(this._isQuickShop&&!this._quickShopRandomInitialized){rand=this._startIndex;this._quickShopRandomInitialized=true;}else{rand=start+Math.floor(Math.random()*(initial-j));
5994}rand=Math.max(rand,start);temp=tempArr.splice(rand,1)[0];this._randomOrder[i]=temp;this._randomOrderRev[temp]=i;}if(callback)callback();}else{var len=this._randomOrder.length;
5995var currentIndex=this._currentIndex;tempArr=this._randomOrder;this._randomOrder=[];this._randomOrderRev={};for(i=0;i<len;i++){temp=tempArr.splice(0,1)[0];if(temp<end){this._randomOrder.push(temp);
5996this._randomOrderRev[temp]=i;}}if(!currentIndex)this._randomPos=0;else{this._randomPos=this._randomOrder.indexOf(currentIndex);if(this._randomOrder.length>0)this._randomPos++;
5997}if(callback)callback();}};zfl_Slideshow.prototype._photo_onseek=function(photo,direction,animOverride){var self=this;this._processBackgrounds({action:'renderState'});var loader=this._getLoader(photo);
5998this._currentAnim.photoLoader=loader;this._currentAnim.direction=direction;this._currentAnim.animOverride=animOverride;loader.start();this._processDownload({action:'renderState'});
5999if(this._isQuickShop&&this._showFavorites&&zf_zenbar&&zf_zenbar.scrapbookEdit&&!this._scrapbookInitialized){this._scrapbookInitialized=true;function setScrapbook(){self._processFavorites({action:'setScrapbook'});
6000}setScrapbook();zf_zenbar.scrapbookEdit.$().on(this._fixEvents('currentChange'),function(e,sb,dif){dif&&setScrapbook();});}this._processFavorites({action:'renderState',
6001photoChanged:true});this._processYearbook({action:'renderState',photoChanged:true});if(this._shopOnly){this._getOverlay(['qs-buy']).toggleClass('zfl-ss-overlay-qs-buy-close',
6002photo.priceKey=='');}};zfl_Slideshow.prototype._photoloader_onload=function(loader){var self=this;if(!this._currentAnim.photoLoader)return;this._processBackgrounds({action:'renderState',
6003unlock:loader.state==zf_PhotoLoader.Complete});
6003if(zf_PhotoKey.getString(this._currentAnim.photoLoader.getPhoto())==zf_PhotoKey.getString(loader.getPhoto())&&this._currentAnim.photoLoader.getMethod().code==loader.getMethod().code){if(this._skipProtectedPhotos){if(loader.state!=zf_PhotoLoader.Complete){if(this._currentIndex==0&&this._photoCount()==1){clearTimeout(this._loadingTimeout);
6004this._showLoading(false);return;}if(this._currentAnim.direction==zfl_Slideshow.Forward&&(this._currentIndex<this._photoCount()-1||this._loop)||(!this._loop&&this._currentIndex==0)){setTimeout(function(){self.next(self._currentAnim.animOverride);
6005},1);}else{setTimeout(function(){self.back(self._currentAnim.animOverride);},1);}return;}}clearTimeout(this._loadingTimeout);this._showLoading(false);if(!this._animating)this._currentAnim.exec();
6006else{this._queuedAnim.photoLoader=this._currentAnim.photoLoader;this._queuedAnim.direction=this._currentAnim.direction;}this._currentAnim.photoLoader=null;this._currentAnim.direction=0;
6007}else if(zf_PhotoKey.getString(this._currentAnim.photoLoader.getPhoto())==zf_PhotoKey.getString(loader.getPhoto())){clearTimeout(this._loadingTimeout);this._showLoading(false);
6008}};zfl_Slideshow.prototype._animate=function(animObject){if(animObject.photoLoader!=null){var loader=animObject.photoLoader;animObject.photoLoader=null;this._show(loader,animObject.direction,
6009animObject.animOverride);animObject.animOverride=null;}};zfl_Slideshow.prototype._ontouchstart=function(e){;if(e.originalEvent.touches.length!=1)return;var self=this;this._touchended=false;
6010if(this._ctrLongTapTimeout)clearTimeout(this._ctrLongTapTimeout);this._ctrLongTapTimeout=setTimeout(function(){self._ctrLongTapTimeout=null;if(self._touchended)return;
6011self._toggleControls({action:'show',source:'long tap'});},1500);this._touchStart={x:e.originalEvent.targetTouches[0].clientX,y:e.originalEvent.targetTouches[0].clientY,
6012playing:false,time:new Date().getTime()};;this._touchStart.playing=this._playing;this._touchMove={x:0,y:0,dx:0,dy:0};this._afterTouchStart=true;};zfl_Slideshow.prototype._ontouchmove=function(e){if(!this._afterTouchStart){return;
6013}if(e.originalEvent.touches.length!=1)return;this.pause(true);var moveX=e.originalEvent.targetTouches[0].clientX-this._touchStart.x;var moveY=e.originalEvent.targetTouches[0].clientY-this._touchStart.y;
6014this._touchMove.x=moveX;this._touchMove.y=moveY;if(Math.abs(moveX)>10&&Math.abs(moveY)<10){e.preventDefault();if(this._ctrLongTapTimeout){clearTimeout(this._ctrLongTapTimeout);
6015this._ctrLongTapTimeout=null;}this._toggleControls({action:'hide',source:'swipe'});}this._current.$view.css('translateX',this._touchMove.x);this._touchStart.playing&&this._renderPlayState(true);
6016};zfl_Slideshow.prototype._ontouchend=function(e){;if(!this._afterTouchStart){;return;}this._afterTouchStart=false;this._touchended=true;if(e.originalEvent.touches.length!=0)return;
6017this._stopAnimation();var x=this._touchMove.x;var toIndex;var self=this;var $mView=this._current.$view;if(x>this._swipeBack){toIndex=this._getPrevIndex();}else if(x<this._swipeForward){toIndex=this._getNextIndex();
6018}else{toIndex=this._currentIndex;};var playing=this._touchStart.playing;if(this._touchMove&&Math.abs(this._touchMove.x)<3&&Math.abs(this._touchMove.y)<3){var diff=new Date().getTime()-this._touchStart.time;
6019if(diff<500){if(this.onclick&&this._currentPhoto.id)this.onclick.call(this,zf_toUint32(this._currentPhoto.id));else{this._toggleControls({action:'show',source:'tap'});
6020var $el=document.elementFromPoint?$(document.elementFromPoint(this._touchStart.x,this._touchStart.y)):$();if($el.closest(this._getOverlay([221])).length>0)e.preventDefault();
6021}}}this._touchMove={x:0,y:0};this._touchStart={x:0,y:0,playing:false};if(x<this._swipeForward&&toIndex!=this._currentIndex){this._playing=playing;setTimeout(function(){self.seek(toIndex,
60221,zfl_Slideshow.Slide);},1);if(this._compatibility){$mView.animate({'translateX':-this._width},500);return;}$mView.bind(zfl_Slideshow.TransitionEndEvent,function(){$mView.unbind(zfl_Slideshow.TransitionEndEvent);
6023$mView.addClass('none').removeAttr('data-istouchslide');self._setTransformTransition($mView,'','');return false;});$mView.attr('data-istouchslide','1');this._setTransformTransition($mView,
6024'translateX(-100%)','transform 0.2s ease-out');}else if(x>this._swipeBack&&toIndex!=this._currentIndex){this._playing=playing;setTimeout(function(){self.seek(toIndex,
6025-1,zfl_Slideshow.Slide);},1);if(this._compatibility){$mView.animate({'translateX':this._width},500);return;}$mView.bind(zfl_Slideshow.TransitionEndEvent,function(){$mView.unbind(zfl_Slideshow.TransitionEndEvent);
6026$mView.addClass('none').removeAttr('data-istouchslide');
6026self._setTransformTransition($mView,'','');return false;});$mView.attr('data-istouchslide','1');this._setTransformTransition($mView,
6027'translateX(100%)','transform 0.2s ease-out');}else{this._playing=playing;setTimeout(function(){self._startPlayAnimationTimeout();},1);this._setTransformTransition($mView,
6028'','');}this._toggleControls({action:'hide',delay:10000,source:'touch end'});this._renderPlayState();};zfl_Slideshow.prototype._prefetch=function(index,increment,range){var self=this;
6029if(!range)range=0;if(index<0)index=this._photoCount()-1;else if(index==this._photoCount())index=0;if(index==this._currentIndex){setTimeout(function(){self._prefetch(index+increment,
6030increment,range-1);},1);return;}var photo=this._photoList.get(index);zf_Loadable.notifyLoaded(photo,function(){self._getLoader(photo,null).start();self._controlsMode=="full"&&photo.getMeta();
6031if(range>0){setTimeout(function(){self._prefetch(index+increment,increment,range-1);},1);}});};zfl_Slideshow.prototype._getMethod=function(photo){;var width=Math.min(this.maxWidth,
6032this._viewRect.width);var height=Math.min(this.maxHeight,this._viewRect.height);var kbTransform;if(this._kenburns){kbTransform=this._kenburns.createTransform(photo,
6033{width:width,height:height},{fillType:'fit',duration:this._delay+2000});width=kbTransform.totalSize.width;height=kbTransform.totalSize.height;}var method=this._fillType=='fill'&&!photo.video?photo.pickFillMethod(width,
6034height):photo.pickScaledMethod(width,height,this._upscaleLimit);method.kbTransform=kbTransform;if(this._isQuickShop&&!this._playing){var fullSizeMethod=this._fillType=='fill'&&!photo.video?photo.pickFillMethod(this._width,
6035this._height):photo.pickScaledMethod(this._width,this._height,this._upscaleLimit);method=$.extend({},fullSizeMethod,{cx:method.cx,cy:method.cy,kbTransform:method.kbTransform});
6036}return method;};zfl_Slideshow.prototype._getLoader=function(photo){;var self=this;var method=this._getMethod(photo);var key=zfl_Slideshow.__getPoolKey(photo,method);var loader=this._loaderPool[key];
6037if(loader)return loader;loader=new zf_PhotoLoader(photo,method);loader.onload=function(state,src){if(state==zf_PhotoLoader.Complete){loader.src=src;}if(self._videoSupported&&state==zf_PhotoLoader.Complete&&photo.video&&(photo.flags&zf_PhotoFlags.VideoReady)){var videoHelper=new zf_VideoPlayerHelper();
6038videoHelper.setMode(zf_VideoPlayerHelper.Video);videoHelper.requestVideoUrl(photo,$.noop);loader.videoHelper=videoHelper;}self._photoloader_onload(loader);};self._loaderPool[key]=loader;
6039return loader;};zfl_Slideshow.__getPoolKey=function(image,method,thumbnail){if(image instanceof zf_Photo){var photo=image;var bgid=photo.background&&photo.background.image&&photo.background.image.id;
6040var mc=method&&method.code;return zf_stdFormatString('p{0}{2}{1}{3}',photo.id,mc?'m'+mc:'',bgid?'b'+bgid:'',thumbnail?'t':'');}else{return zf_stdFormatString('b{0}',
6041image.id);}};zfl_Slideshow.prototype._renderControls=function(){var playStyles='';var pauseStyles='';var isTablet=false;if(this._playing){playStyles='display: none;';}else{pauseStyles='display: none;';
6042}var overlayHtml=['<div id="{0}-overlay" class="zfl-ss-overlay">','<div id="{0}-overlay-1" class="zfl-ss-overlay-1"></div>','<div id="{0}-overlay-2" class="zfl-ss-overlay-2">',
6043'<div id="{0}-overlay-21" class="zfl-ss-overlay-21"></div>','<div id="{0}-overlay-22" class="zfl-ss-overlay-22">','<div id="{0}-overlay-221" class="zfl-ss-overlay-221">',
6044'<div id="{0}-overlay-back" class="zfl-ss-overlay-back">','<i class="fa fa-angle-double-left"></i>&nbsp;','<span id="{0}-overlay-backtext"></span>','</div>','<i id="{0}-overlay-back-qs" class="zfl-ss-overlay-back-qs fa fa-arrow-left" data-ss-title="Back"></i>',
6045'</div>','<div id="{0}-overlay-222" class="zfl-ss-overlay-222"></div>','<div id="{0}-overlay-223" class="zfl-ss-overlay-224">','<div id="{0}-overlay-qs-buy" class="zfl-ss-overlay-qs-buy">',
6046'Buy','&nbsp;<i class="fa fa-angle-double-right"></i>','</div>','</div>','<div id="{0}-overlay-224" class="zfl-ss-overlay-224">','<i id="{0}-overlay-fs" class="zfl-ss-overlay-fs fa fa-arrows-alt"></i>',
6047'</div>','<div id="{0}-overlay-22a" class="zfl-ss-overlay-22a">','<div id="{0}-overlay-qs-fav" class="zfl-ss-overlay-qs-fav" data-ss-title="Favorite">','<i id="{0}-overlay-qs-fav-fixed" class="zfl-ss-overlay-qs-fav-fixed fa fa-heart-o"></i>',
6048'<i id="{0}-overlay-qs-fav-pending" class="zfl-ss-overlay-qs-fav-pending fa fa-refresh fa-spin"></i>','</div>','<div id="{0}-overlay-qs-yp" class="zfl-ss-overlay-qs-yp" data-ss-title="Yearbook Pose">',
6049'<i id="{0}-overlay-qs-yp-fixed" class="zfl-ss-overlay-qs-yp-fixed fa fa-graduation-cap"></i>
6049','<i id="{0}-overlay-qs-yp-pending" class="zfl-ss-overlay-qs-yp-pending fa fa-refresh fa-spin"></i>',
6050'</div>','<i id="{0}-overlay-qs-share" class="zfl-ss-overlay-qs-share fa fa-share-alt" data-ss-title="Share"></i>','<i id="{0}-overlay-qs-dwn" class="zfl-ss-overlay-qs-dwn zfl-ss-title-parent-only zfl-ss-title-close-onclick fa fa-download" data-ss-title="Download"></i>',
6051'<i id="{0}-overlay-qs-comment" class="zfl-ss-overlay-qs-comment fa fa-commenting-o" data-ss-title="Comments"></i>','</div>','<div id="{0}-overlay-22b" class="zfl-ss-overlay-22b">',
6052'<i class="fa fa-refresh fa-spin"></i>&nbsp;&nbsp;loading','</div>','</div>','<div id="{0}-overlay-23" class="zfl-ss-overlay-23"></div>','<div id="{0}-overlay-24" class="zfl-ss-overlay-24">',
6053'<div id="{0}-overlay-241" class="zfl-ss-overlay-241 empty">','<div id="{0}-overlay-241-text" class="zfl-ss-overlay-241-text"></div>','<div id="{0}-overlay-241-more" class="zfl-ss-overlay-241-more">See more</div>',
6054'<div id="{0}-overlay-241-less" class="zfl-ss-overlay-241-less">See less</div>','</div>','</div>','<div id="{0}-overlay-bgs" class="zfl-ss-overlay-bgs zfl-ss-overlay-bgs-na">',
6055'<div id="{0}-overlay-bgs-container" class="zfl-ss-overlay-bgs-container">','<div id="{0}-overlay-bgs-button" class="zfl-ss-overlay-bgs-button">Change Background</div>',
6056'<div id="{0}-overlay-bgs-popup" class="zfl-ss-overlay-bgs-popup">','<div id="{0}-overlay-bgs-title" class="zfl-ss-overlay-bgs-title">Backgrounds</div>','<div id="{0}-overlay-bgs-desc" class="zfl-ss-overlay-bgs-desc">Premium backgrounds are charged per pose</div>',
6057'<div id="{0}-overlay-bgs-grid" class="zfl-ss-overlay-bgs-grid"></div>','</div>','</div>','</div>','<div id="{0}-overlay-qsi" class="zfl-ss-overlay-qsi zfl-ss-overlay-qsi-nobg">',
6058'<div id="{0}-overlay-qsi-top" class="zfl-ss-overlay-qsi-top">','<div id="{0}-overlay-qsi-title-area" class="zfl-ss-overlay-qsi-title-area">','<div id="{0}-overlay-qsi-title" class="zfl-ss-overlay-qsi-title"></div>',
6059'<div id="{0}-overlay-qsi-copyright" class="zfl-ss-overlay-qsi-copyright">','<div id="{0}-overlay-copyright-tt" class="zfl-ss-overlay-copyright-tt">','<div id="{0}-overlay-copyright-txt" class="zfl-ss-overlay-copyright-txt"></div>',
6060'</div>','<i class="fa fa-copyright" data-ss-title="Copyright"></i>','</div>','</div>','<div id="{0}-overlay-qsi-seqnum" class="zfl-ss-overlay-qsi-seqnum"></div>',
6061'</div>','<div id="{0}-overlay-qsi-caption" class="zfl-ss-overlay-qsi-caption">','<div id="{0}-overlay-qsi-caption-text" class="zfl-ss-overlay-qsi-caption-text"></div>',
6062'<span id="{0}-overlay-qsi-caption-more" class="zfl-ss-overlay-qsi-caption-more">See more</span>','<div id="{0}-overlay-qsi-caption-less" class="zfl-ss-overlay-qsi-caption-less">See less</div>',
6063'</div>','<div id="{0}-overlay-qsi-knc" class="zfl-ss-overlay-qsi-knc">','<div id="{0}-overlay-qsi-knc-content" class="zfl-ss-overlay-qsi-knc-content"></div>','<span id="{0}-overlay-qsi-knc-more" class="zfl-ss-overlay-qsi-knc-more">See more</span>',
6064'<div id="{0}-overlay-qsi-knc-less" class="zfl-ss-overlay-qsi-knc-less">See less</div>','</div>','</div>','<div id="{0}-overlay-25" class="zfl-ss-overlay-25"></div>',
6065'<div id="{0}-overlay-26" class="zfl-ss-overlay-26">','<div id="{0}-overlay-261" class="zfl-ss-overlay-261 fa fa-play"></div>','<div id="{0}-overlay-262" class="zfl-ss-overlay-262"></div>',
6066'<div id="{0}-overlay-263" class="zfl-ss-overlay-263"></div>','<div id="{0}-overlay-26a" class="zfl-ss-overlay-26a">','<div id="{0}-overlay-copyright-tt" class="zfl-ss-overlay-copyright-tt">',
6067'<div id="{0}-overlay-copyright-txt" class="zfl-ss-overlay-copyright-txt"></div>','</div>','<i class="fa fa-copyright"></i>','</div>','<div id="{0}-overlay-264" class="zfl-ss-overlay-264">',
6068'<div id="{0}-overlay-exiftt" class="zfl-ss-overlay-exiftt">','<div id="{0}-overlay-exiftxt" class="zfl-ss-overlay-exiftxt"></div>','</div>','EXIF','</div>','<div id="{0}-overlay-265" class="zfl-ss-overlay-265 fa fa-comment" data-state="1"></div>',
6069'<div id="{0}-overlay-266" class="zfl-ss-overlay-266 fa"></div>','</div>','<div id="{0}-overlay-27" class="zfl-ss-overlay-27">','<div id="{0}-overlay-271" class="zfl-ss-overlay-271"></div>',
6070'</div>','<div id="{0}-overlay-2a" class="zfl-ss-overlay-2a fa fa-chevron-left"></div>','<div id="{0}-overlay-2b" class="zfl-ss-overlay-2b fa fa-chevron-right"></div>',
6071'</div>','<div id="{0}-overlay-3" class="zfl-ss-overlay-3"></div>','<div id="{0}-overlay-4" class="zfl-ss-overlay-4">','<i class="fa fa-play-circle"></i>','</div>',
6072'<div>'].join('');overlayHtml=zf_stdFormatString(overlayHtml,this.id);this.$dom().append(overlayHtml);var ctrlPos=this._controlsMode=='full'?'bottom':this._controlsMode;
6073var ctrlOrnt=ctrlPos=='bottom'||ctrlPos=='top'||ctrlPos=='lite'?'hrz':'vrt';var ctrlMod=this._isQuickShop?'qs':null;
6073var html=['<div id="',this.id,'-controls" class="zfl-ss-controls zfl-ss-controls-',
6074this._skin,' zfl-ss-controls-',ctrlPos,' zfl-ss-controls-',ctrlOrnt,ctrlMod?' zfl-ss-controls-'+ctrlMod:'','" data-ornt="',ctrlOrnt,'"','>','<div id="{0}-overlay-qs-area" class="zfl-ss-controls-qs-area" data-key="qs">',
6075'<div class="zfl-ss-controls-qs-area-left">','<div id="{0}-overlay-qs-playback" class="zfl-ss-controls-qs-button zfl-ss-controls-qs-playback zfl-ss-controls-qs-play" data-ss-title="Play">',
6076'<i class="zfl-ss-controls-qs-playback-icon fa"></i>&nbsp;&nbsp;Slideshow','</div>','<div id="{0}-overlay-qs-selected" class="zfl-ss-controls-qs-selected"></div>',
6077'</div>','<div class="zfl-ss-controls-qs-area-right">','<div id="{0}-overlay-qs-visibility" class="zfl-ss-controls-qs-button zfl-ss-controls-qs-visibility zfl-ss-controls-qs-hide" data-ss-title="Hide">',
6078'<i class="zfl-ss-controls-qs-visibility-icon fa"></i>','</div>','</div>','</div>','<div id="{0}-overlay-thumbs" class="zfl-ss-controls-thumbs" data-key="thumbs">'+'<div class="zfl-ss-controls-thumbs-button zfl-ss-controls-thumbs-back" data-key="back">',
6079'<div class="fa" data-key="back-inner"></div>','</div>','<div class="zfl-ss-controls-thumbs-items" data-key="items">','<div class="zfl-ss-controls-thumbs-item" style="display:none" data-key="item-tpl">',
6080'<img src="/zf/img/null.gif"/>','<div class="zfl-ss-controls-thumbs-item-dur"></div>','<div class="zfl-ss-controls-thumbs-item-loading fa fa-refresh fa-spin"></div>',
6081'</div>','<div class="zfl-ss-controls-thumbs-items-inner" data-key="items-inner"></div>','</div>','<div class="zfl-ss-controls-thumbs-button zfl-ss-controls-thumbs-forward" data-key="forward">',
6082'<div class="fa" data-key="forward-inner"></div>','</div>','</div>','<div class="zfl-ss-controls-volume" data-key="volume">','<div class="zfl-ss-volume-icon fa"></div>',
6083'</div>','<div class="zfl-ss-controls-buttons" data-key="buttons">','<div class="zfl-ss-back zfl-ss-button"></div>','<div class="zfl-ss-play zfl-ss-button" style="',
6084playStyles,'"></div>','<div class="zfl-ss-pause zfl-ss-button" style="',pauseStyles,'"></div>','<div class="zfl-ss-next zfl-ss-button"></div>','</div>','</div>'].join('');
6085html=zf_stdFormatString(html,this.id);var areaNmb=ctrlPos=='lite'?271:ctrlPos=='bottom'?25:ctrlPos=='top'?21:ctrlPos=='left'?1:ctrlPos=='right'?3:0;if(areaNmb)this.$dom('overlay-'+areaNmb).append(html);
6086if(this._controlsMode=='full')this.$dom('controls').find('[data-key="buttons"], [data-key="volume"]').css({display:'none'});if(this._controlsMode=='lite')this.$dom('controls').find('[data-key="thumbs"]').remove();
6087if(!this._isQuickShop)this.$dom('controls').find('[data-key="qs"]').remove();this._createVolumeControl();this._getOverlay(this._controlsMode=='full'?[1,3,21,27]:[221,
6088222,223,224,'22a',24,26]).css({display:'none'});this._isQuickShop&&this._getOverlay([26]).css({display:'none'});this._getOverlay([this._isQuickShop?'back':'back-qs']).css({display:'none'});
6089if(this._controlsMode=='lite')this._getOverlay([25,21,1,3]).css({display:'none'});else if(this._controlsMode!='full')this._getOverlay($.grep([25,21,1,3,27],function(i){return i!=areaNmb;
6090})).css({display:'none'});var of=this._overlayFlags;this._getOverlay([].concat.apply([],[(of&8)?[]:[265,this._isQuickShop?'qsi-caption':241],(of&2)?[]:[264],(of&32)?[]:['qsi-knc']])).css({display:'none'});
6091this._isQuickShop&&!(of&8)&&this._getOverlay(['qsi-caption']).addClass('empty');this._isQuickShop||this._getOverlay(['qsi']).css({display:'none'});this._isQuickShop||this._getOverlay(['bgs']).css({display:'none'});
6092this._isQuickShop&&this._getOverlay([241]).css({display:'none'});this._getOverlay([this._isQuickShop?'26a':'qsi-copyright']).remove();if(this._controlsMode!='hide'&&(of&4)==0){var $vol=this._controlsMode=='full'?this._getOverlay([266]):this.$dom('controls').find('[data-key="volume"]');
6093$vol.css({display:'none'});}this._getOverlay(this._isQuickShop?[224]:[223,'22a']).css({display:'none'});this._getOverlay(['22b']).toggleClass('zfl-ss-overlay-22b-mod1',
6094!!this._isQuickShop);this._getOverlay(['22b']).toggleClass('zfl-ss-overlay-22b-mod2',this._controlsMode!='full');(!this._isQuickShop||isTablet)&&this._getOverlay(['2a',
6095'2b']).css({display:'none'});this._getOverlay(['qs-fav']).css({display:'none'});this._getOverlay(['qs-yp']).css({display:'none'});if(!this._$sharePopup||!this._showShare){this._getOverlay(['qs-share']).css({display:'none'});
6096}this._getOverlay(['qs-dwn']).css({display:'none'});if(!this._showComments){this._getOverlay(['qs-comment']).css({display:'none'});}if(this._isQuickShop){var bgcolor=this.$().css('background-color');
6097this._getOverlay([26]).css('background-color',bgcolor);this.$dom('volume-slider').css('background-color',zf_Color.toRgbaCss(bgcolor,0.75));}this._configureQuickShopSelectedText();
6098};zfl_Slideshow.prototype._setupControls=function(){var self=this;this._renderControls();if(this._backButton)this.setupBackButton(this._backButton.text,this._backButton.callback);
6099else this.setupBackButton(null);if(this._controlsMode=='hide')return;var $controls=this.$dom('controls');var $overlay=this._getOverlay([1,21,3,25,26,241,221,223,
6100224,'22a',271,'2a','2b','qsi','bgs']);var mmhandler=$.throttle(function(e){if(e.type=='mousemove'){var duration=$(e.target).closest($overlay).length>0?null:2000;
6101self._toggleControls({action:'show',duration:duration,source:'mou
6101semove'});}else self._toggleControls({action:'hide',source:'mouseleave',delay:2000});},250);this.$dom().mousemove($.mousemovethr(3,
6102mmhandler));this.$dom().mouseleave(mmhandler);var onPlay=function(e){this._playing=true;this.play();return false;};var onPause=function(e){this.pause();return false;
6103};var onPlayPause=function(e){this._explicitTogglePlayPause();return false;};var onForward=function(e){this.next();return false;};var onBack=function(e){this.back();
6104return false;};var onQsControlsVisibilityToggle=function(e){this._qsControlsVisibilityState=(this._qsControlsVisibilityState+1)%2;var state=this._qsControlsVisibilityState;
6105var $el=$(e.currentTarget);$el.toggleClass('zfl-ss-controls-qs-hide',state).toggleClass('zfl-ss-controls-qs-show',!state);$el.attr('data-ss-title',state?'Hide':'Show');
6106var $25=this._getOverlay([25]);var val;if(state){val=$25.data('height-orig');}else{$25.data('height-orig',$25.height());val=this._getOverlay(['qs-area']).height();
6107}$el.css('display','none').forceRedraw().css('display','');var onComplete=state?undefined:function(){self._resizeView();};state&&this._resizeView();$25.stop(true,
6108true).animate({'height':val},500,'easeOutCubic',onComplete);return false;};var onCaptionToggle=function(e){var $el=$(e.target);var state=!($el.attr('data-state')=='1');
6109$el.toggleClass('fa-comment',state).toggleClass('fa-comment-o',!state);$el.attr('data-state',state?'1':'0');this._getOverlay([241]).stop(true,true).animate({'opacity':state?'1':'0'},
6110500);return false;};var onCaptionMoreOrLess=function(e){this._captionExpanded=!this._captionExpanded;this._refreshCaption(true);this._refreshQsiBackground();};var onKncMoreOrLess=function(e){this._kncExpanded=!this._kncExpanded;
6111this._refreshKncCollapsible(true);this._refreshQsiBackground();};var onFavorites=function(e){this._processFavorites({action:'toggleState'});};var onYearbook=function(e){this._processYearbook({action:'toggleState'});
6112};var onShare=function(e){this._processShare({action:'showShare'});};var onDownload=function(e){this._processDownload({action:'showDownload'});};var onComment=function(e){this._processComments({action:'showComments'});
6113};this._controls={$play:$controls.find('.zfl-ss-play').click(this.closure(onPlay)),$pause:$controls.find('.zfl-ss-pause').click(this.closure(onPause)),$forward:$controls.find('.zfl-ss-next').click(this.closure(onForward)),
6114$back:$controls.find('.zfl-ss-back').click(this.closure(onBack))};this._getOverlay(['qs-playback']).click(this.closure(onPlayPause));this._getOverlay(['qs-visibility']).click(this.closure(onQsControlsVisibilityToggle));
6115this._getOverlay([261]).click(this.closure(onPlayPause));this._getOverlay([265]).click(this.closure(onCaptionToggle));this._getOverlay(this._isQuickShop?['qsi-caption-more',
6116'qsi-caption-less']:['241-more','241-less']).click(this.closure(onCaptionMoreOrLess));this._getOverlay(['qsi-knc-more','qsi-knc-less']).click(this.closure(onKncMoreOrLess));
6117var onCopyrightHover=function(showTooltip){var $overlay=this._getOverlay([this._isQuickShop?'qsi-copyright':'26a']);if(showTooltip==null){showTooltip=$overlay.is(':hover');
6118}$overlay.toggleClass('tooltip-visible',showTooltip);};this._getOverlay([this._isQuickShop?'qsi-copyright':'26a']).hover(this.closure2(onCopyrightHover,true),this.closure2(onCopyrightHover,
6119false));this._getOverlay(['copyright-txt']).hover(this.closure2(onCopyrightHover,false),this.closure2(onCopyrightHover,null));var onExifHover=function(showTooltip){var $overlay=this._getOverlay([264]);
6120if(showTooltip==null){showTooltip=$overlay.is(':hover');}$overlay.toggleClass('tooltip-visible',showTooltip);};this._getOverlay([264]).hover(this.closure2(onExifHover,
6121true),this.closure2(onExifHover,false));this._getOverlay(['exiftxt']).hover(this.closure2(onExifHover,false),this.closure2(onExifHover,null));this._getOverlay(['qs-fav-fixed']).click(this.closure(onFavorites));
6122this._getOverlay(['qs-yp-fixed']).click(this.closure(onYearbook));this._getOverlay(['qs-share']).click(this.closure(onShare));this._getOverlay(['qs-comment']).click(this.closure(onComment));
6123this._getOverlay(['qs-buy']).click(this.closure(this._onBuy));this._getOverlay(['qs-dwn']).click(this.closure(onDownload)).hover(this.closure(this._clearHideDownloadMenuTimeout),
6124function(){self._clearHideDownloadMenuTimeout();if(self._downloadMenu){self._hideDownloadMenuTimeout=setTimeout(function(){self._hideDownloadMenuTimeout=null;self._hideDownloadMenu();
6125},1000);}});var onFullscreenChange=this.closure2(this._onFullscreenChange,this.dom(),'slideshow');this._getOverlay(['fs']).click(this.closure(this._toggleFullscreen));
6126$(document).on(this._fixEvents('webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange'),onFullscreenChange);this._getOverlay(['2a']).click(this.closure(onBack));
6127this._getOverlay(['2b']).click(this.closure(onForward));this._toggleControls({action:'show',duration:2000,source:'setup controls'});this._processThumbnails({init:true});
6128this._processBackgrounds({action:'init'});if(this._isQuickShop){var $overlayRoot=this.$dom('overlay');$overlayRoot.find('*[data-ss-title]').each(function(){var $el=$(this);
6129$el.data('sstt-state','hidden');$el.mousemove(function(e){$el.data('sstt-x',e.pageX).data('sstt-y',e.pageY);});var $tt=$('<div class="zfl-ss-title-tooltip"></div>');
6130var hideCallback=function(){$el.data('sstt-state','hiding');$tt.stop(true,true);$tt.fadeOut({duration:400,complete:function(){$el.data('sstt-state','hidden');$tt.detach();
6131}});};$el.hover(function(e){if($el.hasClass('zfl-ss-title-parent-only')&&!$el.is(e.target)){return;}$el.data('sstt-state','preshowing');$tt.delay(200).fadeIn({duration:400,
6132start:function(){$el.data('sstt-state','showing');$overlayRoot.append($tt);$tt.text($el.attr('data-ss-title'));var oo=$overlayRoot.offset(),x=$el.data('sstt-x')-oo.left,
6133y=$el.data('sstt-y')-oo.top+30;x=Math.min($overlayRoot.width()-$tt.outerWidth(true)-5,Math.max(0,x));y=Math.min($overlayRoot.height()-$tt.outerHeight(true)-5,Math.max(0,
6134y));$tt.css({left:x+'px',top:y+'px'});},complete:function(){$el.data('sstt-state','shown');}});},hideCallback);$el.filter('.zfl-ss-title-close-onclick').click(hideCallback);
6135});}};zfl_Slideshow.prototype._setupPhoneControls=function(){var self=this;var html=['<div id="',this.id,'-phone-controls" class="zflc-controls none">','<div class="zflc-play none zflc-play-',
6136this._skin,'"></div>','<div class="zflc-pause none zflc-pause-',this._skin,'"></div>','</div>'].join('');this.$dom().append(html);var $controls=this.$dom('phone-controls');
6137var anim=function(play,callback){$controls.find('.zflc-pause').toggleClass('none',play);$controls.find('.zflc-play').toggleClass('none',!play);$controls.removeClass('none').css('opacity',
6138'0.80');setTimeout(function(){$controls.stop(true,true).animate({'opacity':'0.00'},200,'linear',function(){$(this).addClass('none').css({'opacity':'0.80'});setTimeout(function(){callback.call(self);
6139},1);});},800);};var isAndroid=false,isEmbedded=this._embedded;function setupOneTimeVclick($el,callback){$el.one('touchstart',function(e){var c=e.originalEvent.targetTouches[0];
6140$el.data('zf-temp-vclick-start',{x:c.clientX,y:c.clientY,t:new Date().getTime()});});$el.one('touchend',function(e){var data0=$el.data('zf-temp-vclick-start');$el.removeData('zf-temp-vclick-start');
6141if(!data0){setupOneTimeVclick($el,callback);return;}var c=e.originalEvent.changedTouches[0];if(Math.abs(c.clientX-data0.x)>3||Math.abs(c.clientY-data0.y)>3||(new Date().getTime()-data0.t)>500){setupOneTimeVclick($el,
6142callback);return;}callback(e);});}var tap=function(e){e.preventDefault();e.stopImmediatePropagation();if(self._playing){self.pause();anim(false,zf_stdTrue);}else{self._playing=true;
6143anim(true,self.play);}if(isAndroid&&isEmbedded)setupOneTimeVclick($(this),tap);else $(this).one('click',tap);};if(isAndroid&&isEmbedded)setupOneTimeVclick(this.$dom(),
6144tap);else this.$dom().one('click',tap);};zfl_Slideshow.prototype._toggleControls=function(options){options=$.extend(true,{},options);var data=this._controlsState=this._controlsState||{state:'hidden'};
6145var animDuration=500;var self=this;var $opacityControls=this._getOverlay([221,223,224,'22a','2a','2b']);var $slideControls,slideProp,slideVal=0;switch(this._controlsMode){case 'left':$slideControls=this._getOverlay([1]);
6146slideProp='left';$slideControls.each(function(){slideVal+=$(this).width();});break;case 'right':$slideControls=this._getOverlay([3]);slideProp='right';$slideControls.each(function(){slideVal+=$(this).width();
6147});break;case 'top':$slideControls=this._getOverlay([21]);slideProp='top';$slideControls.each(function(){slideVal+=$(this).height();});break;case 'bottom':$slideControls=this._getOverlay([25]);
6148slideProp='bottom';$slideControls.each(function(){slideVal+=$(this).height();});break;case 'full':$slideControls=this._getOverlay(this._isQuickShop?[25]:[25,26]);
6149slideProp='bottom';$slideControls.each(function(){slideVal+=$(this).height();});$slideControls=$slideControls.add(this._getOverlay(this._isQuickShop?['qsi','bgs']:[24]));
6150break;case 'lite':$slideControls=this._getOverlay([27]);slideProp='bottom';$slideControls.each(function(){slideVal+=$(this).height();});break;default:break;};if(this._controlsMode=='hide')return;
6151if(this._alwaysShowControls)options={action:'show'};var playing=this._playing||(this._afterTouchStart&&this._touchStart.playing);if(this._isQuickShop&&!playing)options={action:'show'};
6152if(options.delay||options.delay===0){if(data.delayedActionTimeout)clearTimeout(data.delayedActionTimeout);data.delayedActionTimeout=setTimeout(function(){data.delayedActionTimeout=null;
6153delete options.delay;self._toggleControls(options);},options.delay);return;}if(data.delayedActionTimeout){clearTimeout(data.delayedActionTimeout);data.delayedActionTimeout=null;
6154}if(options.action=='hide'){if(data.state=='hidden')return;var onOpacityEnd=function(){$(this).addClass('none');};
6154$opacityControls.stop(true,true).animate({'opacity':'0.00'},
6155animDuration,'swing',onOpacityEnd);$slideControls.stop(true,true).animate($.initObject(slideProp,zf_stdFormatString('-{0}px',slideVal)),animDuration,'easeInCubic');
6156data.state='hidden';if(this._volumeSlider){this._hideVolumeSlider(false);}this.$dom().addClass('zfl-ss-mouse-hidden');$(document).off('mousemove.zflssmh mousedown.zflssmh').one('mousedown.zflssmh',
6157function(){self.$dom().removeClass('zfl-ss-mouse-hidden');}).on('mousemove.zflssmh',$.mousemovethr(3,$.throttle(function(){self.$dom().removeClass('zfl-ss-mouse-hidden');
6158$(document).off('mousemove.zflssmh');},250)));}if(options.action=='show'){if(data.state=='hidden'){$opacityControls.stop(true,true).animate({'opacity':'1.00'},animDuration,
6159'swing');$opacityControls.removeClass('none');$slideControls.stop(true,true).animate($.initObject(slideProp,0),animDuration,'easeOutCubic');data.state='visible';
6160this.$dom().removeClass('zfl-ss-mouse-hidden');}if(options.duration)self._toggleControls({action:'hide',delay:options.duration});}};zfl_Slideshow.prototype._getOverlay=function(areas){var $ret=$();
6161for(var i=0;i<areas.length;i++)$ret=$ret.add(this.$dom('overlay-'+areas[i]));return $ret;};zfl_Slideshow.prototype._onBuy=function(){if(this._shopOnly){var photo=this._currentPhoto;
6162if(photo&&photo.loaded){var returnData=null;if(this._returnData){returnData=$.extend(new zf_ReturnData(),this._returnData);returnData.fromQuickShop=true;returnData.quickShopPhotoId=photo.id;
6163}zf_zenbar.addToCart({fromQuickShop:true,allPhotos:this._photoList,returnData:returnData})([photo]);}}else{this._toggleQuickShopPanel();}};
6163zfl_Slideshow.prototype._toggleQuickShopPanel=function(){this._quickShopPanelOpened=!this._quickShopPanelOpened;
6164if(this._quickShopPanelOpened){this.resize(this._width,this._height);this.$qs.find('.zfl-qs-panel').css({display:'block'}).width(400);this._getOverlay(['qs-buy']).addClass('zfl-ss-overlay-qs-buy-close');
6165this.onShowQuickShopPanel&&this.onShowQuickShopPanel();}else{this.$qs.find('.zfl-qs-panel').css({display:'',width:'',height:''});this.resize(this._width+zfl_Slideshow.QuickShopPanelWidth,
6166this._height);this._getOverlay(['qs-buy']).removeClass('zfl-ss-overlay-qs-buy-close');this.onHideQuickShopPanel&&this.onHideQuickShopPanel();}};zfl_Slideshow.prototype._show=function(photoLoader,
6167direction,animOverride){this._clearAnimationTimeout();this._clearPlayTimeout();this._animating=true;var transition=animOverride!=null?animOverride:this._transition;
6168if(transition==zfl_Slideshow.Random){transition=2+Math.floor(4*Math.random());transition=transition<=zfl_Slideshow.Slide?transition:zfl_Slideshow.CrossFade;}this._processVideo({action:'hide'});
6169if(this._compatibility){this.__compatibilityAnimation(photoLoader,direction,transition);}else{switch(transition){case zfl_Slideshow.FadeToBlack:this.__fadeToColorAnimation(photoLoader,
6170direction,'black');break;case zfl_Slideshow.FadeToWhite:this.__fadeToColorAnimation(photoLoader,direction,'white');break;case zfl_Slideshow.CrossFade:this.__crossFadeAnimation(photoLoader,
6171direction);break;case zfl_Slideshow.Slide:this.__slideAnimation(photoLoader,direction);break;default:this.__noAnimation(photoLoader,direction);break;}}if(this.onslide){var photo=photoLoader.getPhoto();
6172this.onslide(photo.id,this._currentIndex,photo);}};zfl_Slideshow.prototype.__compatibilityAnimation=function(photoLoader,direction,transition){if(transition==zfl_Slideshow.NoTransition){this.__noAnimation(photoLoader,
6173direction);return;}this.__compatibilitySlide(photoLoader,direction);};zfl_Slideshow.prototype._clearPlayTimeout=function(){if(this._playTimeout){clearTimeout(this._playTimeout);
6174this._playTimeout=null;}};zfl_Slideshow.prototype._clearAnimationTimeout=function(){if(this._animTimeout){clearTimeout(this._animTimeout);this._animTimeout=null;}};zfl_Slideshow.prototype._startPlayAnimationTimeout=function(){var self=this;
6175if(this._playing){this._clearAnimationTimeout();this._animTimeout=setTimeout(function(){self.play();},this._delay);}};zfl_Slideshow.prototype._clearEnsureAnimationCleanupTimeout=function(){if(this._ensureAnimationCleanupTimeout){clearTimeout(this._ensureAnimationCleanupTimeout);
6176this._ensureAnimationCleanupTimeout=null;}};zfl_Slideshow.prototype._startEnsureAnimationCleanupTimeout=function(timeout){this._clearEnsureAnimationCleanupTimeout();var self=this;
6177this._ensureAnimationCleanupTimeout=setTimeout(function(){self._animCleanup();self._ensureAnimationCleanupTimeout=null;},timeout);};zfl_Slideshow.prototype.__slideAnimation=function(photoLoader,
6178direction){var self=this;this._hidden.photoLoader=photoLoader;var toDirection=direction==zfl_Slideshow.Forward?'left':'right';var fromDirection=direction==zfl_Slideshow.Forward?'right':'left';
6179var $from=this._current.$view;var $to=this._hidden.$view;var temp=this._current;this._current=this._hidden;this._hidden=temp;this._updateView(photoLoader,$to.find('.zfl-ss-view'));
6180$to.addClass('zfl-ss-viewholder-'+fromDirection);this._startEnsureAnimationCleanupTimeout(1250);$to.bind(zfl_Slideshow.TransitionEndEvent,function(e){e.preventDefault();
6181e.stopPropagation();self._clearEnsureAnimationCleanupTimeout();self._animCleanup();$to.unbind(zfl_Slideshow.TransitionEndEvent);},false);if(!$from.is('.none')&&!$from.attr('data-istouchslide'))$from.addClass('zfl-ss-anim-slide-to-'+toDirection);
6182$to.removeClass('none').forceRedraw().addClass('zfl-ss-anim-slide-to-center');};zfl_Slideshow.prototype.__compatibilitySlide=function(photoLoader,direction,duration){duration=duration?duration:500;
6183this._hidden.photoLoader=photoLoader;var $from=this._current.$view;var $to=this._hidden.$view;var temp=this._current;this._current=this._hidden;this._hidden=temp;
6184this._updateView(photoLoader,$to.find('.zfl-ss-view'));var width=this._width;$to.css('translateX',direction*width).removeClass('none');var self=this;var complete=function(){$from.addClass('none');
6185self._animCleanup();};$to.stop(true,true).animate({'translateX':0},duration,null,complete);$from.stop(true,true).animate({'translateX':-direction*width},duration,
6186null,complete);};zfl_Slideshow.prototype.__fadeToColorAnimation=function(photoLoader,direction,color){var self=this;this._hidden.photoLoader=photoLoader;var $from=this._current.$view;
6187var $to=this._hidden.$view;var temp=this._current;this._current=this._hidden;this._hidden=temp;
6187var $fromSlide=$from.find('.zfl-ss-view');var $toSlide=$to.find('.zfl-ss-view');
6188$to.addClass('zfl-ss-bg-'+color).addClass('zfl-ss-hidden').removeClass('none');$toSlide.addClass('zfl-ss-hidden').removeClass('none');this._updateView(photoLoader,
6189$toSlide);$from.bind(zfl_Slideshow.AnimationEndEvent,function(e){e.preventDefault();e.stopPropagation();$from.unbind(zfl_Slideshow.AnimationEndEvent).addClass('none');
6190$to.removeClass('zfl-ss-hidden').removeClass('zfl-ss-bg-'+color).addClass('zfl-ss-anim-from-'+color);$toSlide.addClass('zfl-ss-anim-fade-in');});this._startEnsureAnimationCleanupTimeout(2000);
6191$fromSlide.bind(zfl_Slideshow.AnimationEndEvent,function(e){e.stopPropagation();});$toSlide.bind(zfl_Slideshow.AnimationEndEvent,function(e){e.stopPropagation();
6192});$to.bind(zfl_Slideshow.AnimationEndEvent,function(e){e.preventDefault();e.stopPropagation();$to.unbind(zfl_Slideshow.AnimationEndEvent);self._clearEnsureAnimationCleanupTimeout();
6193self._animCleanup();});$from.addClass('zfl-ss-anim-to-'+color);$fromSlide.addClass('zfl-ss-anim-fade-out');};zfl_Slideshow.prototype.__crossFadeAnimation=function(photoLoader,
6194direction){var self=this;this._hidden.photoLoader=photoLoader;var $from=this._current.$view;var $to=this._hidden.$view;var temp=this._current;this._current=this._hidden;
6195this._hidden=temp;$to.addClass('zfl-ss-hidden').removeClass('none');this._updateView(photoLoader,$to.find('.zfl-ss-view'));var animFinished=0;this._startEnsureAnimationCleanupTimeout(2000);
6196$from.bind(zfl_Slideshow.AnimationEndEvent,function(e){e.preventDefault();e.stopPropagation();$from.unbind(zfl_Slideshow.AnimationEndEvent);animFinished|=1;if(animFinished==3){self._clearEnsureAnimationCleanupTimeout();
6197self._animCleanup();}});$to.bind(zfl_Slideshow.AnimationEndEvent,function(e){e.preventDefault();e.stopPropagation();$to.unbind(zfl_Slideshow.AnimationEndEvent);animFinished|=2;
6198if(animFinished==3){self._clearEnsureAnimationCleanupTimeout();self._animCleanup();}});$from.addClass('zfl-ss-anim-fade-out-slow');$to.addClass('zfl-ss-anim-fade-in-slow');
6199};zfl_Slideshow.prototype.__noAnimation=function(photoLoader,direction){var self=this;this._hidden.photoLoader=photoLoader;var $from=this._current.$view;var $to=this._hidden.$view;
6200var temp=self._current;self._current=self._hidden;self._hidden=temp;this._updateView(photoLoader,$to.find('.zfl-ss-view'));$from.addClass('none');$to.removeClass('none');
6201this._animCleanup();};zfl_Slideshow.prototype._stopAnimation=function(){if(!this._animating){return;}this._clearPlayTimeout();this._clearAnimationTimeout();this._clearEnsureAnimationCleanupTimeout();
6202this._animCleanup(true);};zfl_Slideshow.prototype._animCleanup=function(stopAnimation){if(!this._animating){return;}this._processVideo({action:'cleanup',target:'hidden'});var viewClasses='zfl-ss zfl-ss-view';
6203var viewClassesKb=this._kenburns?' zfl-ss-kenburns':'';var hiddenIsVideo=this._videoSupported&&this._hidden.photoLoader&&this._hidden.photoLoader.getPhoto()&&this._hidden.photoLoader.getPhoto().video;
6204var currentIsVideo=this._videoSupported&&this._current.photoLoader&&this._current.photoLoader.getPhoto()&&this._current.photoLoader.getPhoto().video;this._hidden.$view.unbind(zfl_Slideshow.AnimationEndEvent).unbind(zfl_Slideshow.TransitionEndEvent).attr('class',
6205'zfl-ss zfl-ss-viewholder none');this._hidden.$view.find('.zfl-ss-view:first').unbind(zfl_Slideshow.AnimationEndEvent).unbind(zfl_Slideshow.TransitionEndEvent).attr('class',
6206viewClasses+(hiddenIsVideo?'':viewClassesKb));this._current.$view.unbind(zfl_Slideshow.AnimationEndEvent).unbind(zfl_Slideshow.TransitionEndEvent).attr('class','zfl-ss zfl-ss-viewholder');
6207this._current.$view.find('.zfl-ss-view:first').unbind(zfl_Slideshow.AnimationEndEvent).unbind(zfl_Slideshow.TransitionEndEvent).attr('class',viewClasses+(currentIsVideo?'':viewClassesKb));
6208this._animating=false;this._current.$view.removeAttr('data-istouchslide');this._hidden.$view.removeAttr('data-istouchslide');this._setTransformTransition(this._current.$view,
6209'','');this._setTransformTransition(this._hidden.$view,'','');if(!stopAnimation){var self=this;var queued=false;if(this._queuedAnim.photoLoader){var loaderKey=zf_PhotoKey.getString(this._queuedAnim.photoLoader.getPhoto());
6210var currentKey=zf_PhotoKey.getString(this._currentPhoto);queued=loaderKey!=currentKey;}if(queued){if(self._playing){self._animTimeout=setTimeout(function(){self._queuedAnim.exec();
6211},self._delay);}else{setTimeout(function(){self._queuedAnim.exec();},1);}}else{self._startPlayAnimationTimeout();}}};zfl_Slideshow.prototype._showPassword=function($view,loader,
6212show,retry,errorMessage){;var $passwordPopup=$view.find('[name="password-popup"]:first');$view.find('[name="hint"]:first').addClass('none').find('.password-hint-text:first').text('');
6213if(!show){$passwordPopup.addClass('none');$view.find('img:first').removeClass('none');return;}$passwordPopup.find('.incorrect:first').toggleClass('none',!retry);
6214if(show&&retry&&errorMessage)$passwordPopup.find('.incorrect:first').text(errorMessage);;;;$passwordPopup.removeClass('none');$view.find('img').addClass('none');
6215var $passbox=$view.find('.password-box:first');$passbox.css({'margin-left':Math.floor((this._width-$passbox.width())/2),'position':'absolute'});var self=this;var photo=loader.getPhoto();
6216var realmId=photo.access.realmId;var ownerId=photo.access.ownerId;;zfl_PasswordManager.retrieveHint(ownerId,realmId,function(hint){if(hint!=null&&hint.length!=0){var setHint=false;
6217if(self._current.photoLoader&&self._current.photoLoader.getPhoto()&&self._current.photoLoader.getPhoto().access&&self._current.photoLoader.getPhoto().access.realmId&&self._current.photoLoader.getPhoto().access.realmId==realmId){$view=self._current.$view;
6218setHint=true;}else{;}if(setHint){var $hint=$view.find('[name="hint"]:first');var $hintText=$hint.find('.password-hint-text:first');if($hint.length>0&&$hintText.length>0){$hint.removeClass('none');
6219$hintText.text(hint);;}else{;}}}});if(!loader.__zfl_onunlock){loader.__zfl_onunlock=this.closure(this._password_onunlock,loader);zfl_PasswordManager.subscribe(ownerId,
6220realmId,loader.__zfl_onunlock);;}var playing=this._playing;var $input=$passwordPopup.find('[name="password-input"]:first');var $go=$passwordPopup.find('[name="password-go"]:first');
6221$input.val('');var handler=function(){var password=$input.val();;self.$dom('controls').blur();$go.blur();$input.click();self._showPassword($view,loader,false);self._playing=playing;
6222self._renderPlayState();self._resizeView();zfl_PasswordManager.validate(ownerId,realmId,password,function(unlocked,errorMessage){var isStillCurrent=self._current.photoLoader&&self._current.photoLoader.getPhoto()==loader.getPhoto();
6223if(unlocked){return;}if(isStillCurrent)self._showPassword(self._current.$view,loader,true,true,errorMessage);});};$passwordPopup.off('touchstart').bind('touchstart',
6224function(e){$input.focus();$passwordPopup.unbind('touchstart');self.pause(true);
6224e.stopImmediatePropagation();return false;});$go.off('click').click(handler);$input.off('keydown').keydown(function(e){if(zf_stdGetEvent(e).keyCode==13)handler();
6225});$input.off('click').click(function(e){if(self._transition==zfl_Slideshow.FadeToWhite)self._transition=zfl_Slideshow.CrossFade;self.pause(true);e.stopImmediatePropagation();
6226return false;});$input.off('blur').blur(function(){if(playing)self.resume();});if(retry){$input.focus();this._playing=false;self._renderPlayState();this._resizeView();
6227}};zfl_Slideshow.prototype._password_onunlock=function(loader){;if(this._current.photoLoader&&(loader.getPhoto()==this._current.photoLoader.getPhoto()))this._showPassword(this._current.$view,
6228loader,false);this._showLoading(true);var poolKey=zfl_Slideshow.__getPoolKey(loader.getPhoto());for(var key in $.ownProperties(this._loaderPool)){if(zf_stdStartsWith(key,
6229poolKey)){delete this._loaderPool[key];}}loader=this._getLoader(loader.getPhoto());if(this._current.photoLoader&&this._current.photoLoader.getPhoto()==loader.getPhoto()){this._currentAnim.photoLoader=loader;
6230this._currentAnim.direction=1;this._currentAnim.animOverride=zfl_Slideshow.CrossFade;}loader.start();var photoKey=zf_PhotoKey.getString(loader.getPhoto());var photoIndex=this._photoList.findByKey(photoKey);
6231if(photoIndex!=-1)this._processThumbnails({refreshItem:photoIndex});};zfl_Slideshow.prototype._processThumbnails=function(options){if(this._controlsMode=='lite'||this._controlsMode=='hide')return;
6232options=$.extend(true,{},options);var $controls=this.$dom('controls');var $thumbs=$controls.find('[data-key="thumbs"]');var $items=$thumbs.find('[data-key="items"]');
6233var $itemsInner=$items.find('[data-key="items-inner"]');var $backForward=$thumbs.find('[data-key="back"], [data-key="forward"]');var $backForwardInner=$thumbs.find('[data-key="back-inner"], [data-key="forward-inner"]');
6234var $itemTpl=$items.find('[data-key="item-tpl"]');var self=this;var hasCurrentItem=options.currentItem||options.currentItem===0,hasRefreshItem=options.refreshItem||options.refreshItem===0,
6235hasPageIdx=options.pageIdx||options.pageIdx===0;if(options.init){this._thumbnailAnimations={};$itemsInner.off('click','.zfl-ss-controls-thumbs-item').on('click',
6236'.zfl-ss-controls-thumbs-item',function(){if(self._controlsState.state=='hidden')return false;if($(this).hasClass('wait'))return false;var $item0=$(this).closest('[data-idx]');
6237var itemIdx=parseInt($item0.attr('data-idx'),10);var move=null;if($item0.index()==parseInt($items.attr('data-ipp'),10))move='forward';if(self._random)itemIdx=self._randomOrder[itemIdx];
6238self._processThumbnails({currentItem:itemIdx,force:true,move:move});self.goTo(itemIdx);return false;});$backForwardInner.off('click').click(function(){if(self._controlsState.state=='hidden')return false;
6239if($itemsInner.attr('data-isanim')=='1')return false;var pageIdx=parseInt($items.attr('data-pidx'),10);var move=$(this).attr('data-key')=='back-inner'?'back':'forward';
6240var shift=move=='back'?-1:1;self._processThumbnails({pageIdx:pageIdx+shift,move:move,browsing:true});return false;});return;}if(this._random&&hasCurrentItem)options.currentItem=this._randomOrderRev[options.currentItem];
6241if(this._random&&hasRefreshItem)options.refreshItem=this._randomOrderRev[options.refreshItem];if(hasRefreshItem){this._renderThumbnail({index:options.refreshItem,
6242refresh:true});return;}if(!hasPageIdx&&!hasCurrentItem&&!options.redraw)return;var isEmptyOrCountUnknown=this._photoCount()==0||!this._hasShrunk;var isNotDisplayed=$items.width()==0||$items.height()==0;
6243if(isEmptyOrCountUnknown||isNotDisplayed){$itemsInner.children().remove();$backForward.css({display:'none'});return;}var isHrz=$controls.attr('data-ornt')=='hrz';
6244var itemSize=68,margin=4;var itemsPerPage=Math.floor(((isHrz?$items.width():$items.height())+margin)/(itemSize+margin));var numOfPages=Math.ceil(this._photoCount()/itemsPerPage);
6245$items.attr('data-ipp',itemsPerPage).attr('data-nop',numOfPages);var cur={};cur.pageIdx=$items.attr('data-pidx')?parseInt($items.attr('data-pidx'),10):null;cur.browsing=$items.attr('data-brw')=='1';
6246cur.itemIdx=$items.attr('data-iidx')?parseInt($items.attr('data-iidx'),10):null;if(hasCurrentItem&&cur.itemIdx===options.currentItem)return;if(options.redraw&&cur.pageIdx===null)return;
6247var pageIdx,move;if(options.redraw){pageIdx=Math.floor(cur.itemIdx/itemsPerPage);$items.attr('data-pidx',pageIdx).attr('data-brw','0');}else if(hasCurrentItem){pageIdx=Math.floor(options.currentItem/itemsPerPage);
6248var isCycle=pageIdx==0&&cur.pageIdx==numOfPages-1||pageIdx==numOfPages-1&&cur.pageIdx==0;move=cur.pageIdx===null||cur.pageIdx===pageIdx?null:(options.move||(cur.pageIdx<pageIdx==!isCycle?'forward':'back'));
6249$items.attr('data-iidx',options.currentItem);if(!cur.browsing||options.force)$items.attr('data-pidx',pageIdx);if(cur.browsing&&options.force)$items.attr('data-brw',
6250'0');if(cur.browsing&&!options.force){move=null;if(cur.pageIdx===pageIdx)$items.attr('data-brw','0');}}else{pageIdx=(options.pageIdx+numOfPages)%numOfPages;move=options.move;
6251var browsing=options.browsing;if(browsing&&pageIdx==Math.floor(cur.itemIdx/itemsPerPage))browsing=false;$items.attr('data-pidx',pageIdx).attr('data-brw',browsing?'1':'0');
6252};$backForward.css({display:itemsPerPage>=this._photoCount()?'none':''});var highlightCurrentItem=function(){$itemsInner.children().removeClass('current');
6252$itemsInner.children(zf_stdFormatString('[data-idx="{0}"]',
6253options.currentItem)).addClass('current');};if(hasCurrentItem&&!move&&cur.pageIdx!==null){highlightCurrentItem();return;}var stopAnimation=function(){$itemsInner.children('[data-old="1"],[data-filler="1"]').remove();
6254self._setTransformTransition($itemsInner,'','');$itemsInner.removeAttr('data-isanim');};if($itemsInner.attr('data-isanim')=='1'&&move)stopAnimation();var renderFiller=function(length){var size=(isHrz?$items.width():$items.height())-(length*itemSize+(length-1)*margin);
6255var $filler=$('<div data-filler="1" class="zfl-ss-controls-thumbs-itemfiller"><\div>').css(isHrz?'width':'height',size+'px');return $filler;};var isBack=move=='back',
6256isAnim=move&&$items.attr('data-pidx');var isSpecialMove=isBack&&pageIdx==numOfPages-1||!isBack&&pageIdx==0;if(isAnim&&hasCurrentItem)highlightCurrentItem();if(!isAnim)$itemsInner.children().remove();
6257else{$itemsInner.children().attr('data-old','1');if(!isSpecialMove)(isBack?$itemsInner.children().first():$itemsInner.children().last()).remove();else if(!isBack)$itemsInner.append(renderFiller($itemsInner.children().length));
6258}var start=pageIdx*itemsPerPage,end=Math.min(this._photoCount()-1,(pageIdx+1)*itemsPerPage),idx;if(!(isBack&&isAnim)){for(idx=start;idx<=end;idx++)this._renderThumbnail({index:idx});
6259}else{$itemsInner.prepend(renderFiller(end-start+1));for(idx=end;idx>=start;idx--)this._renderThumbnail({index:idx,prepend:true});}if(isAnim){var prop=isHrz?'translateX':'translateY';
6260var val=(itemSize+margin)*itemsPerPage;if(isSpecialMove)val=isHrz?$items.width():$items.height();this._setTransformTransition($itemsInner,zf_stdFormatString('{0}({1}px)',
6261prop,isBack?-val:0),'');$itemsInner.forceRedraw();$itemsInner.attr('data-isanim','1');this._setTransformTransition($itemsInner,zf_stdFormatString('{0}({1}px)',prop,
6262isBack?0:-val),'transform 500ms ease-out');setTimeout(stopAnimation,550);}};zfl_Slideshow.prototype._renderThumbnail=function(options){options=$.extend({},options);var $controls=this.$dom('controls');
6263var $thumbs=$controls.find('[data-key="thumbs"]');var $itemsInner=$thumbs.find('[data-key="items-inner"]');var $itemTpl=$thumbs.find('[data-key="item-tpl"]');var curIdx=parseInt($thumbs.find('[data-key="items"]').attr('data-iidx'),
626410)||0;var self=this;var photolistIdx=this._getPhotolistIndex(options.index);if(photolistIdx===null)return null;var photo=this._photoList.get(photolistIdx);if(!photo)return null;
6265var $item=$itemTpl.clone().css({display:''}).removeAttr('data-key');var $oldItem=null;if(options.refresh){$oldItem=$itemsInner.children(zf_stdFormatString('[data-idx="{0}"]',
6266options.index));if($oldItem.length==0)return null;}else options.prepend?$itemsInner.prepend($item):$itemsInner.append($item);$item.attr('data-idx',options.index);
6267$item.toggleClass('current',options.index==curIdx);var $img=$item.find('IMG');var $dur=$item.find('.zfl-ss-controls-thumbs-item-dur').css({display:'none'});var animStart=function(){if($oldItem){$oldItem.replaceWith($item);
6268$oldItem=null;}$item.addClass('wait');};var anim=this._thumbnailAnimations[options.index];anim||(this._thumbnailAnimations[options.index]=anim=new zf_SmartAnimation(500,
62691000));var onloaderload=function(state,src){var animStop=function(){$oldItem&&$oldItem.replaceWith($item);$item.removeClass('wait');photo.video&&$dur.css({display:''});
6270if(state==zf_PhotoLoader.PasswordRequired)$item.addClass('pwdprot');else if(state==zf_PhotoLoader.Complete)$img.css('background-image','url('+src+')');};anim.stop(animStop);
6271};var onphotoloaded=function(){if(photo.video){var totalSeconds=photo.duration;var m=Math.floor(totalSeconds/60);var s=totalSeconds-m*60;var durationStr=zf_stdFormatString('{0}{1}:{2}{3}',
6272(m<10?'0':''),m,(s<10?'0':''),s);$dur.text(durationStr);}else $dur.remove();var method=zf_ProcessingMethod.StandardSmallThumbnail;var key=zfl_Slideshow.__getPoolKey(photo,
6273method,true);var loader=self._loaderPool[key];if(!loader){loader=new zf_PhotoLoader(photo,method);self._loaderPool[key]=loader;}loader.onload=onloaderload;loader.start();
6274};anim.restart(animStart);zf_Loadable.notifyLoaded(photo,onphotoloaded);return $item;};zfl_Slideshow.prototype._processVideo=function(options){if(!this._videoSupported||this._disposed)return;
6275options=$.extend(true,{},options);var $view=this._current.$view.find('.zfl-ss-view');var loader=this._current.photoLoader;var photo=loader&&loader.getPhoto();var videoHelper=loader&&loader.videoHelper;
6276var $hiddenView=this._hidden.$view.find('.zfl-ss-view');var self=this;;if(options.action=='destroy'){this.$().removeClass('zfl-ss-video zfl-ss-video-wosc zfl-ss-video-playing');
6277$(document).off(this._fixEvents('','video'));this.$('VIDEO').prepareRemove().remove();}if(options.action=='cleanup'){var $targetView;if(options.target=='current'){this.$().removeClass('zfl-ss-video zfl-ss-video-wosc zfl-ss-video-playing');
6278$targetView=$view;}else{$targetView=$hiddenView;}$targetView.find('VIDEO').prepareRemove().remove();$targetView.parent().find('.video-message').remove();$targetView.find('IMG:first').removeClass('img-undervideo');
6279}if(options.action=='hide'&&photo){this.$().removeClass('zfl-ss-video zfl-ss-video-wosc zfl-ss-video-playing');$(document).off(this._fixEvents('','video'));$view.find('VIDEO').each(function(){this.pause();
6280});this._showingVideo=false;if(this._playing)this._resumeTrack(true);}if(options.action=='pause'&&photo){this.$().removeClass('zfl-ss-video-playing');$view.find('VIDEO').each(function(){this.pause();
6281});}if(options.action=='resume'&&photo){this.$().addClass('zfl-ss-video-playing');$view.find('VIDEO').each(function(){this.play();});this._pauseForVideo();}if(options.action=='setVolume'&&photo)$view.find('VIDEO').prop('volume',
6282options.volume);if(options.action=='show'&&photo){if(!(photo.flags&zf_PhotoFlags.VideoReady)||!videoHelper){$view.parent().append($('<div class="video-message"><\div>').text('This video is not available'));
6283return;}if(this._playing)this._pauseForVideo();this._showingVideo=true;this._pauseTrack(true);$view.parent().append($('<div class="video-message"><\div>').text('Loading video...'));
6284var positionState=this._positionState;videoHelper.requestVideoUrl(photo,function(url){if(positionState!=self._positionState)return;$view.find('IMG:first').addClass('img-undervideo');
6285$view.parent().find('.video-message').remove();$view.find('VIDEO').prepareRemove().remove();var autostart=!!self._playing&&self._videoAutostartSupported,playing=self._playing||(self._afterTouchStart&&self._touchStart.playing),
6286hideControls=self._isQuickShop&&!playing?false:true,html=videoHelper.createPlayerHtml(photo,url,{hideControls:hideControls,autostart:autostart,controlsList:'nodownload'});
6287$view.append(html);var $video=$view.find('VIDEO');$video.prop('volume',self._getVolume());$video.css({display:'block'});$video.on('ended',function(){self.$().removeClass('zfl-ss-video-playing');
6288self._showingVideo=false;if(self._playing)self.play();});!hideControls&&$video.on('play pause',function(){self.$().addClass('zfl-ss-video-wosc');self._processVideo({action:$video.prop('paused')?'pause':'resume'});
6289});if(!hideControls){var onFullscreenChange=self.closure2(self._onFullscreenChange,$video.get(0),'video');$(document).off(self._fixEvents('','video')).on(self._fixEvents('webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange',
6290'video'),onFullscreenChange);}self.$().addClass('zfl-ss-video');if(autostart){self.$().addClass('zfl-ss-video-playing');}});}};zfl_Slideshow.prototype._formatExif=function(exif){var str=exif?$.map(exif,
6291function(v,k){return[0x829D,0x829A,0x920A,0x829A,0x8827,0x9209].indexOf(parseInt(k,10)||'')==-1?null:v.display;}).join(', '):'';str=str||'no data';return str;};zfl_Slideshow.prototype._toggleFullscreen=function(){var root=this.dom();
6292if((document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement)==root){if(document.exitFullscreen)document.exitFullscreen();
6293else if(document.msExitFullscreen)document.msExitFullscreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.webkitExitFullscreen)document.webkitExitFullscreen();
6294}else{if(root.requestFullscreen)root.requestFullscreen();else if(root.msRequestFullscreen)root.msRequestFullscreen();else if(root.mozRequestFullScreen)root.mozRequestFullScreen();
6295else if(root.webkitRequestFullscreen)root.webkitRequestFullscreen();}};zfl_Slideshow.prototype._setTransformTransition=function($el,transform,transition){$el.css('-webkit-transform',
6296transform);$el.css('-webkit-transition',transition.replace('transform','-webkit-transform'));$el.css('-moz-transform',transform);$el.css('-moz-transition',transition.replace('transform',
6297'-moz-transform'));$el.css('transform',transform);$el.css('transition',transition);return $el;};zfl_Slideshow.prototype._createVolumeControl=function(){var isVertical,sliderLayout;
6298switch(this._controlsMode){case 'full':isVertical=true;sliderLayout='volume-slider-full';break;case 'bottom':isVertical=true;sliderLayout='volume-slider-bottom';
6299break;case 'lite':isVertical=true;sliderLayout='volume-slider-lite';break;case 'right':isVertical=false;sliderLayout='volume-slider-right';break;case 'top':isVertical=true;
6300sliderLayout='volume-slider-top';break;case 'left':isVertical=false;sliderLayout='volume-slider-left';break;default:return;}var volumeSliderId=this.id+'-volume-slider';
6301var html=['<div id="',volumeSliderId,'" class="slider ',sliderLayout,isVertical?' slider-vert':' slider-horz','">','<div class="slider-s"></div>','<div class="slider-h"></div>',
6302'</div>'].join('');this._$volumeIcon=this._controlsMode=='full'?this._getOverlay([266]):this.$dom('controls').find('.zfl-ss-volume-icon');this._$volumeIcon.addClass('volume-control-trigger');
6303this._$volumeIcon.append(html);this._$volumeIcon.click(this.closure(this._onVolumeIconClick));this._volumeSlider=new zf_Slider(volumeSliderId,isVertical,0,0.1,true);
6304var $slider=this._volumeSlider.$();if(isVertical){this._volumeSlider.verticalOffset=Math.floor(zf_stdExtractPixels($slider.css('padding-top'))+$slider.find('.slider-h').height()/2);
6305this._volumeSlider.manualSize=Math.floor($slider.height()-$slider.find('.slider-h').height());}else{this._volumeSlider.horizontalOffset=Math.floor(zf_stdExtractPixels($slider.css('padding-left'))+$slider.find('.slider-h').width()/2);
6306this._volumeSlider.manualSize=Math.floor($slider.width()-$slider.find('.slider-h').width());}this._volumeSlider.onchange=this.closure(this._updateVolumeIcon);var volume=this._reversedVolumeControl()?0:100;
6307this._volumeSlider.setPos(volume);this._hideVolumeSlider(false);this._updateVolumeIcon();};zfl_Slideshow.prototype._onVolumeIconClick=function(e){if($(e.target).closest('.slider').length>0){return;
6308}var self=this,$slider=this._volumeSlider.$();if($slider.is(':visible')){this._hideVolumeSlider(true);}else{this._$volumeIcon.addClass('volume-slider-visible');$slider.fadeIn({complete:function(){$('HTML').unbind(self._volumeOutsideClickEvent).bind(self._volumeOutsideClickEvent,
6309function(event){if($(event.target).closest('.volume-control-trigger').length<=0){self._hideVolumeSlider(true);}});}});}};zfl_Slideshow.prototype._hideVolumeSlider=function(animate){var self=this,
6310$slider=this._volumeSlider.$();$('HTML').unbind(this._volumeOutsideClickEvent);if(animate){$slider.fadeOut({complete:function(){self._$volumeIcon.removeClass('volume-slider-visible');
6311}});}else{$slider.stop(true,true).hide();this._$volumeIcon.removeClass('volume-slider-visible');}};zfl_Slideshow.prototype._updateVolumeIcon=function(){var iconIndex,volume=this._getVolume(),
6312icons=['fa-volume-off','fa-volume-down','fa-volume-up'];if(volume<=0){iconIndex=0;}else if(volume<=0.5){iconIndex=1;}else{iconIndex=2;};this._$volumeIcon.removeClass(icons.join(' '));
6313this._$volumeIcon.addClass(icons[iconIndex]);var fromColor,toColor;if(this._skin=='dark'){fromColor='#fff';toColor='#6f6f6f';}else{fromColor='#000';toColor='#909090';
6314}var gradientTo;switch(this._controlsMode){case 'right':gradientTo='left';break;case 'top':gradientTo='bottom';break;case 'left':gradientTo='right';break;default:gradientTo='top';
6315break;}this._volumeSlider.$().find('.slider-s').css('background',zf_stdFormatString('linear-gradient(to {0}, {1} {2}%, {3} {2}%)',gradientTo,fromColor,volume*100,
6316toColor));if(this._current&&this._current.$view){this._processVideo({action:'setVolume',volume:volume});this._audioPlayer.setVolume(volume);}};zfl_Slideshow.prototype._reversedVolumeControl=function(){return this._controlsMode=='top'||this._controlsMode=='right';
6317};zfl_Slideshow.prototype._getVolume=function(){if(!this._volumeSlider){return 1;}var volume=Math.max(Math.min(this._volumeSlider.getPos(),100),0)
6317/100;if(this._reversedVolumeControl()){volume=1-volume;
6318}return volume;};zfl_Slideshow.prototype._volumeOutsideClickEvent='mousedown.volume touchstart.volume';zfl_Slideshow.prototype._resumeTrack=function(useForce){this._audioPlayer.resumeTrack();
6319};zfl_Slideshow.prototype._pauseTrack=function(useForce){this._audioPlayer.pauseTrack();};zfl_Slideshow.prototype._fixEvents=function(events,extraNamespace){var eventsNamespace='.slideshow-'+this.id;
6320extraNamespace&&(eventsNamespace+=eventsNamespace+'-'+extraNamespace);return $.map(events.split(' '),function(event){return event+eventsNamespace;}).join(' ');};
6321zfl_Slideshow.prototype._processFavorites=function(options){if(!this._isQuickShop||!this._showFavorites)return;var self=this,sbedit=zf_zenbar.scrapbookEdit,sb=sbedit&&sbedit.current,
6322isReadOnly=sb&&sb.isReadOnly&&!sb.isOwned,photo=this._currentPhoto,photoKey=photo&&zf_PhotoKey.getString(photo),isUnknownOwner=photo&&!photo.owner,isExternalPhoto=!isUnknownOwner&&((photo&&photo.owner&&photo.owner.id)!=zf_ownerId),
6323state=photo&&sbedit&&sbedit.getPhotoState(photoKey),$fav=this._getOverlay(['qs-fav']),$favFixed=this._getOverlay(['qs-fav-fixed']),$favPending=this._getOverlay(['qs-fav-pending']);
6324if(!sbedit||!photo)return;if(options.action=="setScrapbook"){if(sb&&!sb.loaded){sbedit.loadCurrent(function(){self._processFavorites({action:"setScrapbook"});});
6325return;}$fav.show();delete this._favoritesSmartAnimation;this._processFavorites({action:"renderState"});return;}if(options.action=="toggleState"){if(state==zfb_ScrapbookEdit.PhotoState.Adding||state==zfb_ScrapbookEdit.PhotoState.Removing)return;
6326if(isReadOnly||sbedit.isCreatingNew()||isExternalPhoto||isUnknownOwner)return;
6326function renderState(){self._processFavorites({action:"renderState"});}function addRemoveCallback(){if(photoKey!=zf_PhotoKey.getString(self._currentPhoto))return;
6327if(self._favoritesSmartAnimation)self._favoritesSmartAnimation.stop(renderState);else renderState();}if(state==zfb_ScrapbookEdit.PhotoState.Added)sbedit.removePhotos([photoKey],
6328addRemoveCallback);else sbedit.addPhotos([photoKey],false,addRemoveCallback,this._getReturnPagesCallback?this._getReturnPagesCallback([photoKey]):null);this._favoritesSmartAnimation=new zf_SmartAnimation(500,
63291000);this._favoritesSmartAnimation.start(renderState);return;}if(options.action=="renderState"){var isPending=state==zfb_ScrapbookEdit.PhotoState.Adding||state==zfb_ScrapbookEdit.PhotoState.Removing;
6330var isAdded=state==zfb_ScrapbookEdit.PhotoState.Added||state==zfb_ScrapbookEdit.PhotoState.Removing;$favPending.toggle(isPending);$favFixed.toggle(!isPending).toggleClass('fa-heart',
6331isAdded).toggleClass('fa-heart-o',!isAdded);if(options.photoChanged&&this._favoritesSmartAnimation)delete this._favoritesSmartAnimation;$fav.toggleClass('zfl-ss-overlay-qs-fav-ro',
6332isReadOnly||sbedit.isCreatingNew()||isExternalPhoto||isUnknownOwner);}};zfl_Slideshow.prototype._processYearbook=function(options){if(!this._isQuickShop||!this._showYearbook){return;
6333}var self=this,ypedit=zf_zenbar.yearbookEdit,yp=ypedit&&ypedit.current,photo=this._currentPhoto,photoId=photo&&photo.id,isUnknownOwner=photo&&!photo.owner,isExternalPhoto=!isUnknownOwner&&((photo&&photo.owner&&photo.owner.id)!=zf_ownerId),
6334state=photo&&ypedit&&ypedit.getPhotoState(photoId);if(!ypedit||!photo){return;}if(options.action=="toggleState"){if(state==zfb_YearbookEdit.PhotoState.Adding||state==zfb_YearbookEdit.PhotoState.Removing){return;
6335}if(isExternalPhoto||isUnknownOwner){return;}
6335function renderState(){self._processYearbook({action:"renderState"});}function addRemoveCallback(){if(photoId!=self._currentPhoto.id){return;
6336}if(self._yearbookSmartAnimation)self._yearbookSmartAnimation.stop(renderState);else renderState();}if(state==zfb_YearbookEdit.PhotoState.Added){ypedit.removePhoto(photo,
6337addRemoveCallback);}else{ypedit.addPhoto(photo,addRemoveCallback,renderState);}this._yearbookSmartAnimation=new zf_SmartAnimation(500,1000);this._yearbookSmartAnimation.start(renderState);
6338return;}if(options.action=="renderState"){var $yp=this._getOverlay(['qs-yp']),$ypFixed=this._getOverlay(['qs-yp-fixed']),$ypPending=this._getOverlay(['qs-yp-pending']);
6339if(!photo.video&&(!zf_userId&&!yp||!!zf_userId&&zf_userId==zf_ownerId||!!zf_userId&&!!yp)){var isPending=state==zfb_YearbookEdit.PhotoState.Adding||state==zfb_YearbookEdit.PhotoState.Removing;
6340var isAdded=state==zfb_YearbookEdit.PhotoState.Added||state==zfb_YearbookEdit.PhotoState.Removing;$yp.show();$ypPending.toggle(isPending);$ypFixed.toggle(!isPending).toggleClass('zfl-ss-overlay-qs-yp-selected',
6341isAdded);if(options.photoChanged&&this._yearbookSmartAnimation)delete this._yearbookSmartAnimation;$yp.toggleClass('zfl-ss-overlay-qs-yp-ro',isExternalPhoto||isUnknownOwner);
6342}else{$yp.hide();}}};zfl_Slideshow.prototype._processComments=function(options){if(!this._isQuickShop||!this._showComments)return;var self=this,photo=this._currentPhoto,$icon=this._getOverlay(['qs-comment']);
6343if(options.action=="showComments"){if(!photo){return;};var comments=zf_Control.find(this._$commentsBrowser.attr("id"));comments.quickShopSlideshow=this;if(!comments.initialized){var $layout=$(".layout");
6344;var layout=zf_Control.find($layout.attr("id")),commentsOptions=layout.getCommentsOptions(false);comments.commandtest=function(command,argument){var context=comments.currentContext;
6345if(command=="back"){return comments.commandtest("seek",context.currentIndex-1);}if(command=="next"){return comments.commandtest("seek",context.currentIndex+1);}if(command=="seek"){var index=argument;
6346return index>=0&&index<context.photoList.length;}if(command=="closeComments"){return true;}return false;};comments.command=function(command,argument){if(!comments.commandtest(command,
6347argument)){return;}var context=comments.currentContext;if(command=="back"){comments.command("seek",context.currentIndex-1);}else if(command=="next"){comments.command("seek",
6348context.currentIndex+1);}else if(command=="seek"){var index=argument,newPhoto=context.photoList.get(index);comments.update(newPhoto,{currentIndex:index,previousIndex:context.currentIndex,
6349photoList:context.photoList});if(self._analytics){self._analytics.update(newPhoto);}}else if(command=="closeComments"){$(".qs-comments-wrapper").hide();comments.hide();
6350comments.quickShopSlideshow._processComments({action:"renderState"});}};comments.onlogin=zfl_openLoginPage;comments.onregistervisit=function(p){Zenfolio.Global.LayoutService.registerVisit(p,
6351comments.quickShopSlideshow._photoSet);};comments.init(commentsOptions.decoration,commentsOptions.plugins,commentsOptions.overlayFlags);}comments.update(photo,{currentIndex:this._currentIndex,
6352previousIndex:this._previousIndex,photoList:this._photoList});$(".qs-comments-wrapper").show();comments.show(false,true);return;}if(options.action=="renderState"){function updateIcon(hasComments){$icon.toggleClass('fa-commenting',
6353hasComments).toggleClass('fa-commenting-o',!hasComments);}if(photo){var sink={},commentsMeta=null;commentsMeta=photo.getCommentsCount(sink,function(count){commentsMeta&&commentsMeta.unadvise(sink);
6354if(photo!==self._currentPhoto){return;}updateIcon(count>0);});}else{updateIcon(false);}}};zfl_Slideshow.prototype._processShare=function(options){if(!this._isQuickShop)return;
6355var photo=this._currentPhoto;if(options.action!="showShare"||!photo||!this._photoSet||!this._$sharePopup||!this._showShare)return;;var share=zf_Control.find(this._$sharePopup.attr("id"));
6356share.keepParent=true;share.onhide=function(){$(".qs-share-wrapper").hide();};$(".qs-share-wrapper").show();share.show(this._getOverlay(['qs-share'])[0],this._photoSet,
6357photo,true);};zfl_Slideshow.prototype._onFullscreenChange=function(target,mode){var fsEl=
6357document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement;
6358if(fsEl&&fsEl!=target)return;this._fullscreenExit&&clearTimeout(this._fullscreenExit);delete this._fullscreenExit;var $video=mode=='video'?$(target):null;var isFs=!!fsEl;
6359$('html').toggleClass('zfl-ss-fullscreen',isFs);if(isFs){this._browserFullscreenMode=mode;this._browserFullscreenState='entering';var width=window.screen.width,height=window.screen.height;
6360this.setMaxSize(width,height);this.resize(width,height);if($video){$video.data('zfl_Slideshow._onFullscreenChange.video-class',$video.attr('class'));$video.attr('class',
6361'');}this._browserFullscreenState='entered';}else{this._browserFullscreenState='exiting';this._onResize();if($video){$video.attr('class',$video.data('zfl_Slideshow._onFullscreenChange.video-class'));
6362$video.removeData('zfl_Slideshow._onFullscreenChange.video-class');}var self=this;this._fullscreenExit=setTimeout(function(){self._browserFullscreenState='exited';
6363self._browserFullscreenMode='none';delete self._fullscreenExit;},1000);}};zfl_Slideshow.prototype._clearHideDownloadMenuTimeout=function(){if(this._hideDownloadMenuTimeout){clearTimeout(this._hideDownloadMenuTimeout);
6364this._hideDownloadMenuTimeout=null;}};zfl_Slideshow.prototype._hideDownloadMenu=function(){this._clearHideDownloadMenuTimeout();if(this._downloadMenu){this._downloadMenu.destroy();
6365this._downloadMenu=null;}};zfl_Slideshow.prototype._processDownload=function(options){if(!this._isQuickShop)return;var self=this,photo=this._currentPhoto,$icon=this._getOverlay(['qs-dwn']);
6366if(!photo||!photo.loaded){return;}var fakeVideoOriginals=this._showDownloads,overlayFlags={download:this._showDownloads};if(!this._downloadHandlers){var downloadCommands=Zenfolio.Global.LayoutService.createDownloadCommands(function(){return{administrator:zf_zenbar.administrator,
6367fakeVideoOriginals:fakeVideoOriginals,photo:self._currentPhoto,photoSet:self._photoSet,photoList:self._photoList};},zfl_PhotoDownload.createProxy(this.id,null,fakeVideoOriginals,
6368zf_zenbar.administrator,this._analytics,this._isAmdEnabled,this._isSmdEnabled,this._maxSmdZipSize,this._photoSet),function(){return self._downloadHandlers.oncommandtest;
6369});this._downloadHandlers=zfl_Layout.createHandlers(this,downloadCommands);}var showDownload=this._downloadHandlers.oncommandtest("download",overlayFlags);if(options.action=="showDownload"){if(!showDownload||this._downloadMenu){this._hideDownloadMenu();
6370return;}this._downloadMenu=new zfl_DownloadMenu(photo,this._downloadHandlers.oncommandtest("saveImages",overlayFlags));this._downloadMenu.oncommandtest=this._downloadHandlers.oncommandtest;
6371this._downloadMenu.oncommand=function(){self._hideDownloadMenu();self._downloadHandlers.oncommand.apply(self,arguments);};this._downloadMenu.create($icon[0]);this._downloadMenu.show(true);
6372return;}if(options.action=="renderState"){this._hideDownloadMenu();$icon.toggle(showDownload);}};zfl_Slideshow.prototype._processCollapsible=function(config){var $container=config.$container,
6373$content=config.$content,useDotdotdot=config.useDotdotdot,moreTriggerSelector=config.moreTriggerSelector;$container.removeClass([config.moreClass,config.lessClass,
6374config.scrollClass].join(' '));if(!$container.is(':visible')){return;}if(useDotdotdot){$content.trigger('destroy.dot');$content.find(moreTriggerSelector).remove();
6375}$content.stop(true,true).css({'max-height':'','overflow':''});var maxHeight=config.maxHeight,height=$content.height(),maxHeightExpanded=config.maxHeightExpanded||height,
6376expanded=config.expanded;function dotdotdotCallback(isTruncated,orgContent){if(isTruncated){var last=$content.find(moreTriggerSelector)[0].previousSibling;if(last&&((last.tagName||'').toUpperCase()=='BR')){last.previousSibling&&last.previousSibling.remove();
6377last.remove();}}}if(Math.round(height)>Math.round(maxHeight)){if(expanded){$container.addClass(config.lessClass);}else{$container.addClass(config.moreClass);}if(config.animation){$content.css({'max-height':(expanded?maxHeight:Math.min(height,
6378maxHeightExpanded))+'px','overflow':'hidden'}).animate({'max-height':(expanded?Math.min(height,maxHeightExpanded):maxHeight)+'px'},{duration:300,complete:function(){if(expanded){height>maxHeightExpanded?$container.addClass(config.scrollClass):$content.css({'max-height':''});
6379$content.css({'overflow':''});}else if(useDotdotdot){$content.append(config.$moreOriginal.clone(true));$content.dotdotdot($.extend({after:moreTriggerSelector,callback:dotdotdotCallback},
6380config.dotdotdotConfig));$content.find(moreTriggerSelector).css('float','right');}}});}else if(!expanded){$content.css({'max-height':maxHeight+'px','overflow':'hidden'});
6381if(useDotdotdot){$content.append(config.$moreOriginal.clone(true));$content.dotdotdot($.extend({after:moreTriggerSelector,callback:dotdotdotCallback},config.dotdotdotConfig));
6382$content.find(moreTriggerSelector).css('float','right');}}else if(height>maxHeightExpanded){$content.css({'max-height':maxHeightExpanded+'px'});$container.addClass(config.scrollClass);
6383}}};zfl_Slideshow.prototype._refreshCaption=function(animation){var isqs=this._isQuickShop,lineHeight=isqs?20:1.3,maxLinesCount=2,maxLinesCountExpanded=isqs?10:null,$text=this._getOverlay([isqs?'qsi-caption-text':'241-text']);
6384if(isqs&&!this._$captionMoreOriginal){this._$captionMoreOriginal=this._getOverlay(['qsi-caption-more']);this._$captionMoreOriginal.detach();}var config={$container:this._getOverlay([isqs?'qsi-caption':'241']),
6385$content:$text,$moreOriginal:this._$captionMoreOriginal,moreTriggerSelector:isqs?'.zfl-ss-overlay-qsi-caption-more':'.zfl-ss-overlay-241-more',moreClass:isqs?'zfl-ss-overlay-qsi-caption-overflow-more':'zfl-ss-overlay-241-overflow-more',
6386lessClass:isqs?'zfl-ss-overlay-qsi-caption-overflow-less':'zfl-ss-overlay-241-overflow-less',scrollClass:isqs?'zfl-ss-overlay-qsi-caption-scroll':null,maxHeight:isqs?lineHeight*maxLinesCount:lineHeight*zf_stdExtractPixels($text.css('font-size'))*maxLinesCount,
6387maxHeightExpanded:isqs?lineHeight*maxLinesCountExpanded:null,expanded:this._captionExpanded,animation:animation,useDotdotdot:isqs,dotdotdotConfig:{wrap:'letter'}};
6388this._processCollapsible(config);};zfl_Slideshow.prototype._refreshKnc=function(){if(!this._isQuickShop)return;var self=this,photo=this._currentPhoto,categoryInfo=this._categoryInfo,
6389$container=this._getOverlay(['qsi-knc']),$content=this._getOverlay(['qsi-knc-content']),meta=photo.getMeta(),kws=meta.keywords||[],category=meta.category;if(!categoryInfo){zf_CategoryInfo.load(function(info){self._categoryInfo=info;
6390self._refreshKnc();});return;}$content.trigger('destroy.dot');$content.empty();if(kws.length==0&&category==0){$container.hide();return;}$container.show();if(kws.length!=0){$content.append("<span class='zfl-ss-overlay-qsi-knc-keyword-label'>Keywords:</span>");
6391var i,kw,kwq,kwhtml;for(i=0;i<kws.length;i++){kw=kws[i];kwq=kw.indexOf(" ")!=-1?('"'+kw+'"'):kw;kwhtml=zf_stdFormatString("<a href='/?q={1}' class='zfl-ss-overlay-qsi-knc-keyword'>{0}</a>",
6392zf_stdHtmlEncode(kw),encodeURIComponent(kwq));$content.append(kwhtml);}}if(category!=0){var sj=categoryInfo.getSubject(category),sjm=categoryInfo.getSubjectMatter(category),
6393sjd=categoryInfo.getSubjectDetail(category);var chtml=[];chtml.push("<span class='zfl-ss-overlay-qsi-knc-categories'>");sj&&chtml.push(zf_stdFormatString("<span class='zfl-ss-overlay-qsi-knc-category'>Category: {0}</span>",
6394sj));sjm&&chtml.push(zf_stdFormatString("<span class='zfl-ss-overlay-qsi-knc-category'>Subcategory: {0}</span>",sjm));sjd&&chtml.push(zf_stdFormatString("<span class='zfl-ss-overlay-qsi-knc-category'>Subcategory Detail: {0}</span>",
6395sjd));chtml.push("</span>");$content.append(chtml.join(""));}};zfl_Slideshow.prototype._refreshKncCollapsible=function(animation){var lineHeight=30;if(!this._$kncMoreOriginal){this._$kncMoreOriginal=this._getOverlay(['qsi-knc-more']);
6396this._$kncMoreOriginal.detach();}var config={$container:this._getOverlay(['qsi-knc']),$content:this._getOverlay(['qsi-knc-content']),$moreOriginal:this._$kncMoreOriginal,
6397moreTriggerSelector:'.zfl-ss-overlay-qsi-knc-more',moreClass:'zfl-ss-overlay-qsi-knc-overflow-more',lessClass:'zfl-ss-overlay-qsi-knc-overflow-less',maxHeight:lineHeight,
6398expanded:this._kncExpanded,animation:animation,useDotdotdot:true,dotdotdotConfig:{wrap:'word',ellipsis:''}};this._processCollapsible(config);};zfl_Slideshow.prototype._refreshQsiBackground=function(){var captionExpanded=this._captionExpanded&&this._getOverlay(['qsi-caption']).hasClass('zfl-ss-overlay-qsi-caption-overflow-less'),
6399kncExpanded=this._kncExpanded&&this._getOverlay(['qsi-knc']).hasClass('zfl-ss-overlay-qsi-knc-overflow-less'),playing=this._playing||(this._afterTouchStart&&this._touchStart.playing);
6400this._getOverlay(['qsi']).toggleClass('zfl-ss-overlay-qsi-nobg',!captionExpanded&&!kncExpanded&&!playing);};zfl_Slideshow.prototype._configureQuickShopSelectedText=function(){var $qsSelected=this._getOverlay(['qs-selected']);
6401if(this._addToCartMode){var photos=this._photoList.getAll();if(photos.length>1){var selectedText,photoCounts=Zenfolio.Global.ConfiguratorService.getPhotoCounts(photos);
6402if(photoCounts.imageCount>0){if(photoCounts.videoCount>0){selectedText='{0} files selected';}else{selectedText='{0} photos selected';}}else{selectedText='{0} videos selected';
6403}$qsSelected.text(zf_stdFormatString(selectedText,photoCounts.imageCount+photoCounts.videoCount));return;}}$qsSelected.remove();};
6403zfl_Slideshow.prototype._processBackgrounds=function(options){if(!this._isQuickShop)return;
6404var self=this,photo=this._currentPhoto,passwordProtection=photo&&photo.access&&photo.access.type===zf_AccessType.Password&&zf_userId!=photo.access.ownerId,setupId=photo&&photo.backgroundSetup&&(photo.backgroundSetup.id||null),
6405bgsCache=this._backgroundSetupCache,$root=this._getOverlay(['bgs']),$button=this._getOverlay(['bgs-button']),$popup=this._getOverlay(['bgs-popup']),$grid=this._getOverlay(['bgs-grid']);
6406function renderButton(state){if(!$button.get(0).style.width&&$button.width()>0)$button.width(Math.floor($button.width())+1);$button.text(state?'Close':'Change Background');
6407}if(options.action=='init'){$button.click(function(){self._processBackgrounds({action:'togglePopup'});});$(window).on(this._fixEvents('mousedown touchstart'),function(e){if($(e.target).closest($popup.add($button)).length==0&&$popup.is(':visible')){renderButton(false);
6408$popup.hide();}});renderButton(false);$popup.hide();this._backgroundSetupCache={};var theme=this._skin=='dark'?'minimal':'minimal-dark';$popup.mCustomScrollbar({scrollInertia:500,
6409theme:theme});}if(options.action=='renderState'){$root.toggleClass('zfl-ss-overlay-bgs-na',!photo.isCutout);$root.toggleClass('zfl-ss-overlay-bgs-disabled',passwordProtection&&!options.unlock);
6410this._resizeView();}if(options.action=='onSeek'&&$popup.is(':visible')){renderButton(false);$popup.hide();}function renderBackgrounds(){if(self._currentPhoto.id!=photo.id)return;
6411var bgs=bgsCache[setupId],currency=self._getCurrency();for(var i=0;i<bgs.length;i++){var bg=bgs[i],img=bg.image;var $tile=$(['<div class="zfl-ss-overlay-bg-tile">',
6412'<div class="zfl-ss-overlay-bg-image">','<div class="zfl-ss-overlay-bg-image-inner"></div>','</div>','<div class="zfl-ss-overlay-bg-price"></div>','</div>'].join(''));
6413var $image=$tile.find('.zfl-ss-overlay-bg-image'),$imageInner=$tile.find('.zfl-ss-overlay-bg-image-inner'),$price=$tile.find('.zfl-ss-overlay-bg-price');$grid.append($tile);
6414$tile.attr('data-idx',i);$image.toggleClass('zfl-ss-overlay-bg-image-selected',photo.background.id==bg.id);$price.text(bg.price?zf_stdFormatMoney(bg.price,currency):' ');
6415var key=zfl_Slideshow.__getPoolKey(img);var loader=self._loaderPool[key];if(!loader)self._loaderPool[key]=loader=new zf_PhotoLoader(img,zf_ProcessingMethod.BackgroundVeryLargeThumbnail);
6416if(!loader.onload){(function(loader){var onloaderload=function(state,src){if(src&&onloaderload.$images){onloaderload.$images.css('background-image','url('+src+')');
6417onloaderload.$images=$([]);}};onloaderload.$images=$([]);loader.onload=onloaderload;})(loader);}loader.onload.$images=loader.onload.$images.add($imageInner);loader.start();
6418}var clickCallback=function(e){var idx=parseInt($(e.currentTarget).closest('.zfl-ss-overlay-bg-tile').attr('data-idx'),10);changeBackground(bgs[idx]);renderButton(false);
6419$popup.hide();};$grid.off('click').on('click','.zfl-ss-overlay-bg-image-inner',clickCallback);$popup.mCustomScrollbar('update');}function changeBackground(background){if(self._currentPhoto.id!=photo.id)return;
6420photo.background=background;var loader=self._getLoader(photo),$view=self._current.$view.find('.zfl-ss-view');if(loader.state==zf_PhotoLoader.Initialized){self._loadingTimeout=setTimeout(function(){self._showLoading(true);
6421},500);self._currentAnim.photoLoader=loader;self._currentAnim.direction=0;self._currentAnim.animOverride=zfl_Slideshow.NoTransition;loader.start();}else self._updateView(loader,
6422$view);var photoIndex=self._photoList.find(photo.id);photoIndex!=-1&&self._processThumbnails({refreshItem:photoIndex});self._processFavorites({action:'renderState',
6423photoChanged:true});self._processYearbook({action:'renderState',photoChanged:true});}if(options.action=='togglePopup'){$popup.mCustomScrollbar('disable',true);$popup.toggle();
6424$grid.empty();if($popup.is(':visible')){$popup.css('left','').removeClass('zfl-ss-overlay-bgs-popup-c');var compact=$popup.outerWidth(true)+20>this._width;$popup.toggleClass('zfl-ss-overlay-bgs-popup-c',
6425compact);var totalWidth=this._width,popupWidth=$popup.outerWidth(true),$parent=$popup.offsetParent(),popupLeft=$popup.position().left,parentLeft=$parent.offset().left;
6426$popup.css('left',Math.round(Math.min(popupLeft,totalWidth-popupWidth-parentLeft-10)));renderButton(true);
6426if(!bgsCache[setupId]){var params=[setupId,photo.owner.id];
6427var callback=function(status,retVal){if(status!=200||retVal.error!=null)return;bgsCache[setupId]=retVal.result;renderBackgrounds();};zf_stdServerRequest('GET','/zf/layout/layout.asmx',
6428'GetBackgroundsForSetup',params,callback);}else renderBackgrounds();}else renderButton(false);}};zfl_Slideshow.prototype._getCurrency=function(){return(this.onGetCurrency&&this.onGetCurrency())||zfl_QuickPriceList.getDefaultCurrency()||zf_CurrencyInfo.all['USD'];
6429};zfl_Slideshow.prototype._getCompactHeight=function(){var $body=$('BODY');if(this.$().closest('.compact-slideshow').length>0&&!this._sizingContainer.is($body)){var height,windowHeight=$(window).height(),
6430$pageContent=$('.compact-page-content');if($body.hasClass('body-layout-userpage')&&$pageContent.children('*:visible:not(.separator)').length==1){$pageContent.children('.separator').hide();
6431$pageContent.css('padding-bottom','0');height=windowHeight-$('.com-header-inner').outerHeight(true)-$('.com-footer').outerHeight(true);}else{height=windowHeight/2;
6432}return Math.max(240,height);}return null;};;;function zfl_PageSlideshow(id,minWidth,minHeight,maxWidth,maxHeight,staticWidth,staticHeight,decoration,mode,slideshowvars,photoSet,
6433target,photoViewId,photo){;;this._html5=false;zfl_Control.prototype.constructor.call(this,id);this.minWidth=minWidth;this.minHeight=minHeight;this.maxWidth=maxWidth;
6434this.maxHeight=maxHeight;this.staticWidth=staticWidth;this.staticHeight=staticHeight;this._fullPage=slideshowvars.fullpage=="1"?true:false;this._decoration=decoration;
6435this._mode=mode;this._slideshowvars=slideshowvars;this._target=target;if(this._html5){this._photoSet=zfl_stdTransformResponse(photoSet);this._psToken=slideshowvars.photoSetToken;
6436this._ownerId=parseInt(slideshowvars.ownerId);}delete this._slideshowvars.photoSetToken;delete this._slideshowvars.ownerId;this._slideshowvars.keyring=zf_stdGetCookie("zf_keyring");
6437this._extent=this._decoration.borderSize+this._decoration.shadowSize+this._decoration.extraSize;this._flash=zf_Flash.installed(9)&&mode==zfl_PageSlideshow.Flash;
6438if(!zf_Flash.isSafeDomain())this._flash=false;if(this._flash&&!this._html5){this._createFlash=true;}else if(this._html5){this._createHtml5=true;}else if(mode==zfl_PageSlideshow.EmptyOwner){this._renderPlaceholder();
6439}else if(mode!=zfl_PageSlideshow.Empty){this._static=photo==null;if(photo){this._photoView=new zf_PhotoView(photoViewId);this._photo=photo;}}if(!this._createFlash&&!this._createHtml5)this.$(".pv").removeClass("pv-s-init");
6440this.$(".pv").css("padding",[decoration.borderSize+decoration.shadowSize+"px",decoration.borderSize+"px"].join(" "));zf_stdMakeMethodsDeferred(this,this.id,["_generateFlash",
6441"_generateHtml5"]);}zfl_PageSlideshow.inherits(zfl_Control);zfl_PageSlideshow.Empty=0;zfl_PageSlideshow.Static=1;zfl_PageSlideshow.Flash=2;zfl_PageSlideshow.EmptyOwner=3;zfl_PageSlideshow.Html5=4;
6442zfl_PageSlideshow.prototype.resize=function(width,height,cellWidth){;;var extent=this._decoration.borderSize+this._decoration.shadowSize;var cellRound=function(w){if(!cellWidth)return w;
6443return w-w%cellWidth;};;if(this._static&&this._mode!=zfl_PageSlideshow.Empty&&this._mode!=zfl_PageSlideshow.EmptyOwner){width=this.staticWidth+extent*2;height=this.staticHeight+extent*2;
6444if(this.minWidth)width=Math.min(width,this.minWidth);;return{cx:width,cy:height,cxShadow:this._decoration.shadowSize*2};}var minWidth=zf_ProcessingMethod.StandardSmallSize.cx;
6445var minHeight=this.minHeight?this.minHeight:zf_ProcessingMethod.StandardSmallSize.cy;width-=extent*2;height-=extent*2;;;width=Math.max(width,minWidth);height=Math.max(height,
6446minHeight);;if(!this._fullPage){width=Math.min(width,this.maxWidth);height=Math.min(height,this.maxHeight);};width=cellRound(width);if(this._fullPage){height=width*(height/width);
6447}else{var v=Math.floor(height*this.maxWidth/this.maxHeight);if(v<=width){width=v;if(cellWidth){width=cellRound(width);height=Math.floor(width*this.maxHeight/this.maxWidth);
6448}}else{height=Math.floor(width*this.maxHeight/this.maxWidth);}};if(this._photoView){;var method=this._photo.pickMethod(width,height);if(this._photoView.__zfl_method==null||this._photoView.__zfl_method!=method
6448){this._photoView.__zfl_method=method;
6449this._photoView.load(this._photo,method);}var size=this._photo.getScaledSize(method);width=size.cx;height=size.cy;this._photoView.$(".pv-img").width(width);}if(this.minWidth)width=Math.max(width,
6450this.minWidth);height=Math.max(height,240);;this.$(".pv-inner").width(width).height(height);if(this._html5&&this._slideshow)this._slideshow.resize(width,height);
6451width+=extent*2;height+=extent*2;if(this._decoration.shadowName!=null){this.$(".pv-shadow").remove();var shadows=zfl_DecorationInfo.getShadowHtml("pv-shadow",this._decoration.shadowName,
6452this._decoration.shadowType,this._decoration.shadowSize,-extent,-extent,width,height);this.$(".pv-inner").append(shadows);}if(this._createFlash){this._createFlash=false;
6453this._generateFlash();}else if(this._createHtml5){this._createHtml5=false;this._generateHtml5();}return{cx:width,cy:height,cxShadow:this._decoration.shadowSize*2};
6454};zfl_PageSlideshow.prototype.onClick=function(id){;if(this._target)location.href=zf_stdFormatString(this._target,zf_toUint32(parseInt(id)).toString(16));};zfl_PageSlideshow.prototype._generateFlash=function(){this.$(".pv").removeClass("pv-s-init");
6455var inner=this.$(".pv-inner");var isTransparent=this._slideshowvars["bgcolor"]=="transparent";var markup=zf_Flash.createHtml(this.id+"-flash","pv-img pv-flash flash-restart",
6456zf_stdGetProtocol(zf_cdnHost)+zf_cdnHost+"/zf/code/slideshow/6.5.1/homepage.swf",this._slideshowvars,isTransparent,inner.width(),inner.height());this.$(".pv-img").replaceWith(markup);
6457;};zfl_PageSlideshow.prototype._generateHtml5=function(){this.$(".pv").removeClass("pv-s-init");var inner=this.$(".pv-inner");var markup=zfl_Slideshow.createHtml(this.id+"-html5",
6458"pv-img pv-html5",this._slideshowvars.bgcolor,inner.width(),inner.height(),false);this.$(".pv-img").replaceWith(markup);var owner=new zf_User();owner.id=this._ownerId;
6459this._slideshow=new zfl_Slideshow(this.id+'-html5',this.minWidth,this.minHeight,this.maxWidth,this.maxHeight,this._slideshowvars,this._photoSet,this._psToken,owner,
6460false,null);this._slideshow.onclick=this.closure(this.onClick);this._slideshow.init();;};zfl_PageSlideshow.prototype._renderPlaceholder=function(){var markup=['<div class="pv-ph">',
6461'<div class="pv-ph-inner">','<div class="title">','Slideshow gallery is not selected','</div>','<div class="action">','<a href=\\x22#\\x22>Click here</a> to configure the slideshow',
6462'</div>','</div>','</div>'];this.$(".pv-inner").append(markup.join(""));this.$(".pv-ph a").click(function(){zf_stdSetCookie("zf_cv_options","slideshow",null,true,
6463true);zf_stdSetCookie("zf_cv_open","options",null,true,true);zfl_ZenBar.customize();});};zfl_PageSlideshow.prototype.getMinWidth=function(){var width;if(this._static&&this._mode!=zfl_PageSlideshow.Empty&&this._mode!=zfl_PageSlideshow.EmptyOwner){width=this.staticWidth;
6464}else{width=Math.floor(this.minHeight*this.maxWidth/this.maxHeight);}if(this.minWidth)width=Math.max(width,this.minWidth);return width+this._extent*2;};zfl_PageSlideshow.prototype.getMaxWidth=function(){var width;
6465if(this._static&&this._mode!=zfl_PageSlideshow.Empty&&this._mode!=zfl_PageSlideshow.EmptyOwner){width=this.staticWidth;}else{width=this.maxWidth;}if(this.minWidth)width=Math.max(width,
6466this.minWidth);return width+this._extent*2;};;;;function zfl_HomeMenu(id,vertical,maxWidth,subMenuHDir,subMenuVDir){zfl_AbstractMenu.prototype.constructor.call(this,id,vertical,
6467subMenuHDir,subMenuVDir);this.bind($(this.dom()).find("A[data-zf-subitems]").closest("LI"));this.$("a:not([data-zf-subitems])").hover(function(){$(this).removeClass("homemenu-color2 homemenu-bgcolor2 homemenu-bgimage2").addClass("homemenu-color3 homemenu-bgcolor3 homemenu-bgimage3");
6468},function(){$(this).removeClass("homemenu-color3 homemenu-bgcolor3 homemenu-bgimage3").addClass("homemenu-color2 homemenu-bgcolor2 homemenu-bgimage2");});this._extraHorzPadding=this.vertical?0:-2;
6469if(maxWidth)this.setWidth(maxWidth);}zfl_HomeMenu.inherits(zfl_AbstractMenu);zfl_HomeMenu.prototype.hoverItem=function($item,hoverOn){};zfl_HomeMenu.prototype.hoverSubItem=function($item,hoverOn){if(hoverOn
6469){$item.removeClass("homemenu-color4 homemenu-bgcolor6 homemenu-bgimage5").addClass("homemenu-color5 homemenu-bgcolor7 homemenu-bgimage6");
6470}else{$item.removeClass("homemenu-color5 homemenu-bgcolor7 homemenu-bgimage6").addClass("homemenu-color4 homemenu-bgcolor6 homemenu-bgimage5");}};zfl_HomeMenu.prototype.setWidth=function(maxWidth){if(maxWidth){;
6471var items=this.$(".sep:visible,a:visible");var width=0,inc=0;for(var i=0;i<items.length;i++){var item=items.eq(i);inc+=item.outerWidth(true);;if(item[0].tagName=="A"){if(width+inc>maxWidth){break;
6472}else{width+=inc;inc=0;}}};this.$(".homemenu-inner").width(width);this._lastMaxWidth=maxWidth;if(!this._menuItemWidthMonitoringStarted){var $menuItem=this.$('a:visible').eq(0);
6473if($menuItem.length>0){var self=this;this._lastMenuItemWidth=$menuItem.width();setInterval(function(){var currentMenuItemWidth=$menuItem.width();if(self._lastMenuItemWidth!=currentMenuItemWidth){self._lastMenuItemWidth=currentMenuItemWidth;
6474self.setWidth(self._lastMaxWidth);}},250);this._menuItemWidthMonitoringStarted=true;}}}else{this.$(".homemenu-inner").width("auto");}};zfl_HomeMenu.prototype._getMenuName=function(){return 'homesubmenu';
6475};;function zfl_ContentBlockContainer(id){zfl_Control.prototype.constructor.call(this,id);}zfl_ContentBlockContainer.inherits(zfl_Control);zfl_ContentBlockContainer.prototype.onrecalc=function(){var $this=this.$dom();var $blocks=$this.find('.content-block');
6476if($blocks.length===0){$this.height(10).css({'margin':0,'padding':0});return;}var isOdd=$blocks.length%3===0;var blockMargin=($blocks.first().outerWidth()-$blocks.first().innerWidth())*2;
6477var length=Math.min(3,$blocks.length);var blockWidth=Math.floor($this.width()/length);var totalMargin=16*(length-1);blockWidth=Math.floor(blockWidth)-(totalMargin/length);
6478$blocks.width(blockWidth);var blockHeight=$.max($blocks,function(){return $(this).outerHeight();}).value;$blocks.height(blockHeight);$blocks.find('.bin-content').each(function(index,
6479elem){var $elem=$(elem);$elem.height(blockHeight-$elem.siblings('.bin-header').outerHeight());});if($blocks.length>1){$blocks.each(function(index){var $this=$(this);
6480var $inner=$this.find('.content-block-inner:first');var verticalOffset=($this.height()-$inner.height())/2;if(isOdd){if(index===0||(index+1)%3!==0){$this.css('margin-right',
6481'16px');}}else{if(index===0||(index+1)%2!==0){$this.css('margin-right','16px');}}});}}
6481;;function zfl_UserBlocksLayout(id,global,local){zfl_UserLayout.prototype.constructor.call(this,
6482id,global,local);this._player=local.player;this._column=local.column;this._blockContainer=local.blockContainer;this._footer=global.footer;this._zenbar=global.zenbar;
6483this._menu=local.menu;this._zentoboxAlign=false;this._padding=parseInt(this.$().css('paddingLeft'));this._paddingTop=parseInt(this.$().css('paddingTop'));this._paddingBottom=parseInt(this.$().css('paddingBottom'));
6484this._slideshowHeight=local.slideshowHeight;this._padHeights=local.padHeights;;var menuOffset=0;if(local.menuOffset!=null){menuOffset=local.menuOffset;}if(local.menulogo){var crumbs=local.menulogo.$('.breadcrumbs');
6485if(crumbs.length>0){var nameWidth=crumbs.width();if(nameWidth>400){crumbs.width(400).css('white-space','normal');nameWidth=crumbs.find('span').width();crumbs.width(nameWidth);
6486}menuOffset+=nameWidth;}else{menuOffset+=local.menulogo.$('.homelogo-logo').width();}menuOffset+=40;};if(local.menu&&!local.menu.vertical&&local.slideshow){var minWidth;
6487minWidth=this._fixedWidth?944:(1069-this._padding*2);minWidth-=menuOffset;minWidth=Math.max(0,minWidth);;local.menu.setWidth(minWidth);}var $topPad=this.$('.ub-pad-top');
6488var $bottomPad=this.$('.ub-pad-bottom');var logoMax=$('.homelogo-logo',$topPad).outerHeight();var adjustPadSize=function(pad,height){var $logo=$('.homelogo-logo',
6489pad);var ls={exists:$logo.length>0,width:$logo.width(),height:$logo.height()};pad.height(height);if($('.socialSearch',pad).length){height=height-$('.socialSearch',
6490pad).outerHeight(true);}$('TR',pad).height(height);if(ls.exists){$logo.height(height).parent().height();$logo.width(Math.min(360,ls.width*(height/ls.height)));}$('.homelogo,.homelogo-logo,.home',
6491pad).css('padding-top',0);$('.breadcrumbs-text H1').css('height','');};if(typeof this._padHeights.topPad==='number'){adjustPadSize($topPad,this._padHeights.topPad);
6492}else{adjustPadSize($topPad,Math.min(300,$topPad.height()));}if($bottomPad.length){var ubws=$bottomPad.find('.ub-welcome-socialsearch');if(typeof this._padHeights.bottomPad==='number'){adjustPadSize($bottomPad,
6493this._padHeights.bottomPad);}else{adjustPadSize($bottomPad,ubws.outerHeight(true));}var ss=ubws.find('.socialSearch');if(ss.length){ubws.find('.welcomeBin').height(ubws.height()-ss.outerHeight(true));
6494}}this.cyMinFooter=0;this.$dom().closest('.layout-content').removeClass('fixed-width');}zfl_UserBlocksLayout.inherits(zfl_UserLayout);zfl_UserBlocksLayout.prototype.onrecalc=function(){this._blockContainer.onrecalc();
6495this._player.$().css('left',this.$dom('frame').offset().left-this.$().offset().left+'px');if(this._menu){this._menu.setWidth(this.$('.homemenu:first').width());}zfl_UserLayout.prototype.onrecalc.call(this);
6496};zfl_UserBlocksLayout.prototype.onload=function(){zfl_UserLayout.prototype.onload.call(this);};zfl_UserBlocksLayout.prototype._onstretch=function(height,stretcher){height=this._slideshowHeight||height;
6497var fullWidth=this.$dom().innerWidth();var availWidth=fullWidth-(this._padding*2);var slidesWidth=this.$dom('frame').width();var controls={left:0,top:this.$('.ub-pad-top:first').innerHeight(),
6498width:slidesWidth,height:height};controls.height-=controls.top+this.$('.ub-pad-bottom:first').innerHeight();this._player.resize(slidesWidth,height,{controls:controls});
6499this._player.$().css('left',this.$dom('frame').offset().left-this.$().offset().left+'px');return true;};;;function zfl_UserFullScreenLayout(id,global,local){zfl_UserLayout.prototype.constructor.call(this,
6500id,global,local);this._player=local.player;this._playerAlign=local.playerAlign;this._column=local.column;this._fsframe=local.fsframe;this._header=global.header;this._footer=global.footer;
6501this._zenbar=global.zenbar;this._padHeights=local.padHeights;this._menu=local.menu;this._padding=parseInt(this.$().css('paddingLeft'));;var menuOffset=0;if(local.menuOffset!=null){menuOffset=local.menuOffset;
6502}if(local.menulogo){var crumbs=local.menulogo.$('.breadcrumbs');if(crumbs.length>0){var nameWidth=crumbs.width();menuOffset+=nameWidth;}else{menuOffset+=local.menulogo.$('.homelogo-logo').width();
6503}menuOffset+=40;};if(local.menu&&!local.menu.vertical){var minWidth;minWidth=this._fixedWidth?944:(1069-this._padding*2);minWidth-=menuOffset;minWidth=Math.max(0,
6504minWidth);;local.menu.setWidth(minWidth);}var $topPad=this.$('.ufs-pad-top');var $bottomPad=this.$('.ufs-pad-bottom');var logoMax=$('.homelogo-logo',$topPad).outerHeight();
6505var adjustPadSize=function(pad,height){var $logo=$('.homelogo-logo',pad);var ls={exists:$logo.length>0,width:$logo.width(),height:$logo.height()};pad.height(height);
6506if($('.socialSearch',pad).length){height=height-$('.socialSearch',pad).outerHeight(true);}$('TR',pad).height(height);if(ls.exists){$logo.height(height);$logo.width(Math.min(360,
6507ls.width*(height/ls.height)));}$('.homelogo,.homelogo-logo,.home',pad).css('padding-top',0);$('.breadcrumbs-text H1').css('height','');};$(this.closure(function(){if(typeof this._padHeights.topPad==='number'){adjustPadSize($topPad,
6508this._padHeights.topPad);}else{adjustPadSize($topPad,Math.min(400,$topPad.height()));}if(typeof this._padHeights.bottomPad==='number'){adjustPadSize($bottomPad,this._padHeights.bottomPad+this.$(".bottom-links").height());
6509}else{adjustPadSize($bottomPad,Math.min($bottomPad.height(),400));}}));this.cyMinFooter=0;}zfl_UserFullScreenLayout.inherits(zfl_UserLayout);zfl_UserFullScreenLayout.prototype.onrecalc=function(){zfl_UserLayout.prototype.onrecalc.call(this);
6510this._onrecalc();};zfl_UserFullScreenLayout.prototype.onload=function(){zfl_UserLayout.prototype.onload.call(this);};zfl_UserFullScreenLayout.prototype._onrecalc=function(){this._fsframe.$dom().width(this.$dom('frame').width());
6511var fullWidth=this._fsframe.$dom().width();var availWidth=fullWidth-(this._padding*2);var availHeight=$(window).height()-this._fsframe.$dom().offset().top;if(this._fixedWidth){availWidth=Math.min(availWidth,
6512870);}if(this._footer){availHeight-=this._footer.$dom().outerHeight();}availHeight-=this.$dom().outerHeight()-this.$dom().innerHeight();availHeight=Math.max(720,
6513availHeight);this._fsframe.$dom().height(availHeight);this.$dom().width(availWidth);this.$dom().height(availHeight);this.$('.column').width(availWidth).height(availHeight);
6514this._repositionPads();this._updateVerticallyCentered();if(this._menu){this._menu.setWidth(this.$('.homemenu:first').width());}var controls,alignControls=this._playerAlign;
6515var middle=this.$('DIV.ufs-middle:first');if(middle.length){controls={left:0,top:middle.offset().top-this._fsframe.$dom().offset().top,width:fullWidth,height:middle.height()};
6516if(this._fixedWidth&&this.$dom('frame').innerWidth()-availWidth>
6516=280)alignControls=zfl_ZentoboxPlayer.Middle;}var size=this._player.resize(fullWidth,availHeight,
6517{controls:controls,alignControls:alignControls});return true;};zfl_UserFullScreenLayout.prototype._repositionPads=function(){var vbpad=this._fsframe.$dom().find('.ufs-pad-bottom-v');var ibpad=this.$dom().find('.ufs-pad-bottom-i');
6518vbpad.height(ibpad.outerHeight());ibpad.css('bottom',0);var vtpad=this._fsframe.$dom().find('.ufs-pad-top-v');var itpad=this.$dom().find('.ufs-pad-top-i');var height=itpad.height();
6519vtpad.height(height);var getOffset=function(offset){return offset?offset.top:0;};var vtoffset=getOffset(vtpad.offset());var vboffset=getOffset(vbpad.offset());this._repositionPadDependents(vtpad.outerHeight(),
6520vbpad.outerHeight(),vtoffset,vboffset);};zfl_UserFullScreenLayout.prototype._repositionPadDependents=function(topHeight,bottomHeight,topPos,bottomPos){var middle=this.$('.ufs-middle');if(middle.length){middle.height(bottomPos-middle.offset().top);
6521}this.$dom().find('.ufs-pad-dependent').each(function(){var $this=$(this);var padData=$this.attr('data-zf-pad');var extra=$this.attr('data-zf-extrapad');extra=extra?parseInt(extra):0;
6522var data=(/(\w+):(\w+)/).exec(padData);var above=$.trim(data[1])==='above';var top=$.trim(data[2])==='top';if(!above&&top){$this.css('top',topHeight+extra);}else{$this.css('bottom',
6523bottomHeight+extra);}});};zfl_UserFullScreenLayout.prototype._updateVerticallyCentered=function(){var elements=this.$dom().find('.ufs-vcentered');var self=this;elements.each(function(index){var $this=$(this);
6524var centerSelector=$this.attr('data-center-in');var parentHeight=(centerSelector?self.$(centerSelector):$this.parent()).outerHeight();var height=$this.outerHeight();
6525var y=(parentHeight-height)/2;$this.css({'position':'absolute','top':y});});};;function zfl_UserPhotoGridLayout(id,global,local){zfl_UserLayout.prototype.constructor.call(this,
6526id,global,local);this._pageGrid=local.pageGrid;this._pageGrid.getReturnData=this.closure(this._getReturnData);this._sidebarWidth=local.sidebarWidth;this._menu=local.menu;
6527this._overlay=local.overlay;this._overlayFloating=local.overlayFloating;this._padding=parseInt(this.$().css('paddingLeft'));;var menuOffset=0;if(local.menuOffset!=null){menuOffset=local.menuOffset;
6528}if(local.menulogo){var crumbs=local.menulogo.$('.breadcrumbs');if(crumbs.length>0){var nameWidth=crumbs.width();if(nameWidth>400){crumbs.width(400).css('white-space',
6529'normal');nameWidth=crumbs.find('span').width();crumbs.width(nameWidth);}menuOffset+=nameWidth;}else{menuOffset+=local.menulogo.$('.homelogo-logo').width();}menuOffset+=40;
6530};if(local.menu&&!local.menu.vertical){var minWidth;minWidth=this._fixedWidth?944:(1069-this._padding*2);minWidth-=menuOffset;minWidth=Math.max(0,minWidth);;local.menu.setWidth(minWidth);
6531}if(this._columns.Sidebar){this._columns.Sidebar.onstretch=this.closure(this._sidebar_onstretch);var sb=this._columns.Sidebar;var split=sb.$().closest('.splitter-left-fixed,.splitter-right-fixed');
6532if(typeof this._sidebarWidth=='number'){sb.$().width(this._sidebarWidth);split.width(this._sidebarWidth);}var margin=split.width();this.$('.splitter-left-wide').css('margin-right',
6533margin);this.$('.splitter-right-wide').css('margin-left',margin);}if(this._columns.Content)this._columns.Content.onstretch=this.closure(this._content_onstretch);
6534if(this._columns.FullScreen){this._columns.FullScreen.onstretch=this.closure(this._fullscreen_onstretch);}$(window).load(this.closure(function(){var topPadHeight=local.padHeights?local.padHeights.topPad:null;
6535var bottomPadHeight=local.padHeights?local.padHeights.bottomPad:null;var $topPad=$('.upg-pad-top');var $bottomPad=this.$('.upg-pad-bottom');var adjustPadSize=function(pad,
6536height){var $logo=$('.homelogo-logo',pad);var ls={exists:$logo.length>0,width:$logo.width(),height:$logo.height()};pad.height(height);if($('.socialSearch',pad).length){height=height-$('.socialSearch',
6537pad).outerHeight(true);}$('TR',pad).height(height);if(ls.exists){$logo.height(height);$logo.width(Math.min(360,ls.width*(height/ls.height)));}$('.homelogo,.homelogo-logo,.home',
6538pad).css('padding-top',0);$('.breadcrumbs-text H1').css('height','');};if(typeof topPadHeight=='number'){adjustPadSize($topPad,topPadHeight);}else{adjustPadSize($topPad,
6539Math.min(400,$topPad.height()));}if(typeof bottomPadHeight=='number'){adjustPadSize($bottomPad,bottomPadHeight);}else{adjustPadSize($bottomPad,$bottomPad.height()+48);
6540}var topPadOffset;if(this.customizer){topPadOffset=$('.cv-body-wrapper').height()-this.$dom().height();}else{topPadOffset=this.$().offset().top;}$('.upg-pad-top-bg').css('top',
6541topPadOffset);if(this._columns.FullScreen&&this._overlay){var $overlay=this._overlay.$('.upg-pad-bottom').add(this._overlayFloating.$('.upg-pad-bottom'));if(this.footer)$overlay.height($bottomPad.outerHeight(true)+this.footer.$().outerHeight(true)+40);
6542else $overlay.height($bottomPad.outerHeight(true));}}));}zfl_UserPhotoGridLayout.inherits(zfl_UserLayout);zfl_UserPhotoGridLayout.minSidebarHeight=640;zfl_UserPhotoGridLayout.prototype.init=function(){if(this._columns.FullScreen)this._initializeBottomPad();
6543this._pageGrid.init(this);};zfl_UserPhotoGridLayout.prototype.onrecalc=function(){zfl_Layout.prototype.onrecalc.call(this);var sb=this._columns.Sidebar;if(sb){var split=sb.$().closest('.splitter-left-fixed,.splitter-right-fixed');
6544var height=Math.max(sb.$('.stretcher').height(),this._columns.Content.$().parent().height());split.height(height);var $btns=sb.$('.home-btns');
6544if($btns.length){if(sb.$('.sidebar-search').length){var $search=sb.$('.searchBin');
6545var searchOffset=$search.offset();$btns.css('margin-left',($search.offset().left)-sb.$().offset().left-5);}else{$btns.css('margin-left',(sb.$().width()-$btns.width())/2);
6546}}}else{if(this._menu){var $homeMenu=this.$('.homemenu-horz');this._menu.setWidth($homeMenu.innerWidth());}var $bottom=this.$('.upg-layout-bottom');if($bottom.length){if(this.customizer&&$bottom.css('position')==='fixed'){$bottom.width($('.cv-right-panel').width()-$.getScrollbarWidth());
6547}else{$bottom.width(this.$().width());}if(this._bpstates.floating){$bottom.css('left',(this.$().offset().left-$(window).scrollLeft())+'px');}else{$bottom.css('left',
6548'0px');}}}};zfl_UserPhotoGridLayout.prototype._getReturnData=function(){var photoSet=this._pageGrid&&this._pageGrid.internal.photoSet;return $.extend(new zf_ReturnData(),{pageType:zf_ReturnPageType.HomePage,
6549photoSetId:photoSet&&photoSet.id});};zfl_UserPhotoGridLayout.prototype._sidebar_onstretch=function(height,stretcher){var h=zf_stdGetClientHeight();var $stretcher=$(stretcher);if(this.customizer){h-=$('.cv-body-wrapper').height()-this.$dom().height()+$('.cv-bar').outerHeight()+10;
6550}else{h-=this.$dom().offset().top;}var contentHeight=$stretcher.find('.sidebar-top-section').outerHeight(true)+$stretcher.find('.sidebar-middle-section').outerHeight(true)+$stretcher.find('.sidebar-bottom-section').outerHeight(true);
6551$stretcher.height(Math.max(h,contentHeight,zfl_UserPhotoGridLayout.minSidebarHeight));$stretcher.width(this._sidebarWidth);var $spacer=$stretcher.find('.sidebar-spacer');
6552var spacerHeight=0.5*($stretcher.height()-contentHeight);$spacer.height(Math.max(0,spacerHeight));return true;};zfl_UserPhotoGridLayout.prototype._content_onstretch=function(height,stretcher){var gc=this.$('.grid-content');
6553this._pageGrid.resize(gc.width(),-1);var pgHeight=this._pageGrid.$('.pg:first').outerHeight(true);$(stretcher).height(Math.max(pgHeight,height));gc.height($(stretcher).height());
6554return true;};zfl_UserPhotoGridLayout.prototype._fullscreen_onstretch=function(height,stretcher){var gc=this.$('.grid-content');var windowHeight=zf_stdGetClientHeight();this._pageGrid.resize(gc.width(),
6555-1);var pgHeight=this._pageGrid.$('.pg:first').outerHeight(true);var $layoutBottom=this._getFloatingBottom();var stretcherHeight=Math.max(pgHeight,height)+$layoutBottom.height();
6556$(stretcher).height(stretcherHeight);if($layoutBottom.length==0)return true;var gridBottom=gc.offset().top+gc.height();var windowBottom=$(window).scrollTop()+windowHeight;
6557var fromBottom=windowBottom-gridBottom;if(fromBottom>=this._layoutBottomVisiblePx){if(this._overlay){this._overlayFloating.$().addClass('none');this._overlay.$().removeClass('none');
6558}this.$('.upg-layout-bottom').stop(true,true).css({'bottom':'0px','position':'absolute'});this._bpstates.floating=false;}else{if(this._overlay){this._overlayFloating.$().removeClass('none');
6559this._overlay.$().addClass('none');}$layoutBottom.css({'position':'fixed'});if(!this._bpstates.open){$layoutBottom.stop(true,true).css({'bottom':this._layoutBottomVisiblePx-$layoutBottom.height()+'px'});
6560}else{$layoutBottom.css('bottom',$layoutBottom.css('bottom'));}this._bpstates.floating=true;}return true;};zfl_UserPhotoGridLayout.prototype.onload=function(){zfl_Layout.prototype.onload.call(this);
6561this.init();};zfl_UserPhotoGridLayout.prototype._getReturnPages=function(keys){var photoSet=this._pageGrid&&this._pageGrid.internal.photoSet;if(!photoSet||photoSet.type==zf_PhotoSet.Gallery){return null;
6562}return zf_ReturnData.getReturnPages(keys,zf_ReturnPageType.PhotoSetPage,{photoSetId:photoSet.id,gridShowAll:false});};zfl_UserPhotoGridLayout.prototype._initializeBottomPad=function(){var self=this;
6563var $ftr=this.footer?this.footer.$():$();if($ftr.length){$ftr.closest('.ftr-outer').appendTo(this.$('.footer-floater'));}var $layoutBottom=this._getFloatingBottom();
6564if($layoutBottom.length==0)return;var states={hovered:false,open:false,floating:true};this._bpstates=states;var targetVisibility=42;if(this.customizer){targetVisibility+=5;
6565}
6565var dist=Math.max($layoutBottom.outerHeight(true)-targetVisibility,0);$layoutBottom.css('bottom',-dist);var onMouseOver=function(e){states.hovered=true;states.open=true&&states.floating;
6566if(states.floating){var position;if(self.customizer){position=5;if(self.customizer.rightPanelScrollVisible()){position+=$.getScrollbarWidth();}}else{position=0;}$layoutBottom.stop(true,
6567true).animate({'bottom':position+'px'},500);}};var onMouseOut=function(e){if($(e.toElement||e.relatedElement).closest('.menu-submenu').length)return;if(self.customizer&&self.customizer.rightPanelScrollVisible()&&e.pageX>=($('.cv-left-panel').outerWidth()+5)&&e.pageY>=($layoutBottom.offset().top+$layoutBottom.outerHeight()-1)){return;
6568}states.hovered=false;setTimeout(function(){if(!states.hovered){if(states.floating)$layoutBottom.stop(true,true).animate({'bottom':-dist+'px'},1000);states.open=false;
6569}},1000);};$layoutBottom.hover(onMouseOver,onMouseOut);this._layoutBottomVisiblePx=zf_stdGetClientHeight()-$layoutBottom.offset().top;};zfl_UserPhotoGridLayout.prototype._getFloatingBottom=function(){var $layoutBottom=this.$('.upg-layout-bottom');
6570if(this._overlayFloating)$layoutBottom=$layoutBottom.add(this._overlayFloating.$('.upg-pad-bottom'));return $layoutBottom;};;;function zfl_UserPortfolioLayout(id,global,local){zfl_UserLayout.prototype.constructor.call(this,
6571id,global,local);this._customizer=global.customizer;this._player=local.player;this._column=local.column;this._menulogo=local.menulogo;this._menu=local.menu;this._slideshowOffset=local.slideshowOffset;
6572this._padding=parseInt(this.$().css("paddingLeft"));;this._slideshowOffset=local.slideshowOffset||0;var menuOffset=local.menuOffset||0;if(this._menulogo){var crumbs=this._menulogo.$(".breadcrumbs");
6573if(crumbs.length>0){var nameWidth=crumbs.width();if(nameWidth>400){crumbs.width(400).css("white-space","normal");nameWidth=crumbs.find("span").width();crumbs.width(nameWidth);
6574}menuOffset+=nameWidth;}else{menuOffset+=local.menulogo.$(".homelogo-logo").width();}menuOffset+=40;}this._menuOffset=menuOffset;;this.cyMinFooter=0;}zfl_UserPortfolioLayout.inherits(zfl_UserLayout);
6575zfl_UserPortfolioLayout.prototype.onrecalc=function(){zfl_UserLayout.prototype.onrecalc.call(this);var $homeButtons=this.$('.home-btns');var $searchBin=$homeButtons.siblings('.searchBin');
6576if($homeButtons.length&&$searchBin.length){var $parent=$searchBin.parent();var totalWidth=$searchBin.outerWidth(true)+$homeButtons.outerWidth(true);var parentWidth=$parent.outerWidth(true);
6577if(parentWidth<totalWidth){$searchBin.width($searchBin.width()-(totalWidth-parentWidth));}}};zfl_UserPortfolioLayout.prototype.onload=function(){zfl_UserLayout.prototype.onload.call(this);
6578};zfl_UserPortfolioLayout.prototype._onstretch=function(height,stretcher){var availWidth=this.$dom("frame").width()-(this._slideshowOffset+this._padding*2);var availHeight=height;if(this._fixedWidth){availWidth=Math.min(availWidth,
6579870-this._slideshowOffset);availHeight=10000;}var size=this._player.resize(availWidth,availHeight);this.$dom().width(size.cx-size.cxShadow+this._slideshowOffset);
6580stretcher.style.minHeight=size.cy+"px";this.recalcBins();this._recalcMenu(size);return true;};zfl_UserPortfolioLayout.prototype._recalcMenu=function(size){if(this._menu&&!this._menu.vertical&&this._player){var minWidth;
6581minWidth=this._fixedWidth?944:(1069-this._padding*2);var slidesOffset=this._slideshowOffset||0;var slidesWidth;var maxPlayerWidth=this._player.getMaxWidth();var minPlayerWidth=this._player.getMinWidth();
6582if(this._fixedWidth){slidesWidth=Math.min(884-slidesOffset,maxPlayerWidth);}else slidesWidth=size.cx;slidesWidth=Math.max(slidesWidth,minPlayerWidth);minWidth=Math.min(slidesWidth+slidesOffset,
6583minWidth);minWidth-=this._menuOffset;minWidth=Math.max(0,minWidth);;this._menu&&this._menu.setWidth(this._menu.$().width());}};;;function zfl_UserSidebarLayout(id,global,
6584local){zfl_UserLayout.prototype.constructor.call(this,id,global,local);this._player=local.player;this._playerAlign=local.playerAlign;this._column=local.column;this._fsframe=local.fsframe;
6585this._footer=global.footer;this._zenbar=global.zenbar;this._sidebar=local.sidebar;this._subtractMenuHeight=local.subtractMenuHeight;this._menu=local.menu;this._zentoboxAlign=false;
6586this._padding=parseInt(this.$().css('paddingLeft'));this._paddingTop=parseInt(this.$().css('paddingTop'));this._paddingBottom=parseInt(this.$().css('paddingBottom'));
6587this._sidebarWidth=local.sidebarWidth;;;if(this._menu&&!this._menu.vertical){this._menu.setWidth(this._menu.$().parent().width());}if(typeof this._sidebarWidth==='number'){this._sidebarWidth=Math.max(this._sidebarWidth,
6588200);var ratio=(this._sidebarWidth/this._sidebar.$().width()-0.1)*100;this._sidebar.$('.container').width(this._sidebarWidth);this._sidebar.$().width(this._sidebarWidth);
6589this._sidebar.$().closest('TD').width(this._sidebarWidth);}(function($middle){$middle.css('max-height',$middle.height());})(this._sidebar.$('.sidebar-middle-section'));
6590var $logo=this._sidebar.$('.homelogo-logo');if($logo.length){var w=$logo.width();$logo.width($logo.parent().width()+40);$logo.height($logo.height()*($logo.width()/w));
6591if($logo.height()>300){var h=$logo.height();$logo.height(300);$logo.width($logo.width()*($logo.height()/h));}}}zfl_UserSidebarLayout.inherits(zfl_UserLayout);zfl_UserSidebarLayout.MinimumHeight=640;zfl_UserSidebarLayout.prototype.onrecalc=function(){zfl_UserLayout.prototype.onrecalc.call(this);
6592this._onrecalc();};zfl_UserSidebarLayout.prototype.onload=function(){zfl_UserLayout.prototype.onload.call(this);};zfl_UserSidebarLayout.prototype._onrecalc=function(){var fullWidth=this.$dom().parent().innerWidth();
6593var availWidth=fullWidth-(this._padding*2);var columnPadding=parseInt(this._column.$().css('paddingLeft'))+parseInt(this._column.$().css('paddingRight'));availWidth-=columnPadding;
6594var availHeight=$(window).height()-this.$().offset().top-this._paddingTop-this._paddingBottom-1;availHeight=Math.max(zfl_UserSidebarLayout.MinimumHeight,availHeight);
6595var columnHeight=availHeight;if(this._subtractMenuHeight){columnHeight-=this.$('.homemenu-middle:first').outerHeight();}var slideshowWidth=this.$dom('frame').width();
6596if(this._zentoboxAlign||!this._fsframe){var sbWidth=this._sidebar.$dom().outerWidth();if(this._fsframe)slideshowWidth=slideshowWidth-sbWidth-columnPadding;else slideshowWidth=availWidth-sbWidth-columnPadding;
6597if(this._fsframe)this._fsframe.$dom().css('left',sbWidth);}if(this._fixedWidth){availWidth=Math.min(availWidth,870);}this.$dom().width(this._fixedWidth?fullWidth:availWidth);
6598var topSection=this._sidebar.$('.sidebar-top-section').outerHeight(true);var bottomSection=this._sidebar.$('.sidebar-bottom-section').outerHeight(true);var actualHeight=availHeight;
6599if(this._footer){actualHeight-=this._footer.$dom().outerHeight();columnHeight-=this._footer.$dom().outerHeight();}var diff=actualHeight-columnHeight;columnHeight=Math.max(columnHeight,
6600topSection+bottomSection);actualHeight=columnHeight+diff;var controls,alignControls;if(this._zentoboxAlign||!this._fsframe){controls=null;alignControls=null;}else if(this._fixedWidth&&this.$dom('frame').innerWidth()-fullWidth>=280){controls={top:0,
6601left:0,width:slideshowWidth,height:columnHeight};alignControls=null;}else{var $box=this.$('.splitter-left-wide:first,.splitter-right-wide:first');controls={left:$box.offset().left-this._fsframe.$().offset().left,
6602top:0,width:$box.innerWidth(),height:columnHeight};alignControls=this._playerAlign;}var size=this._player.resize(slideshowWidth,columnHeight,{controls:controls,alignControls:alignControl
6602s});
6603var spacing=this.$dom().outerHeight(true)-this.$dom().innerHeight();var sidebarHeight=Math.max(columnHeight,size.cy);this.$dom().height(actualHeight);this._sidebar.$dom().height(sidebarHeight);
6604this._column.$dom().height(Math.max(actualHeight,size.cy));this._fsframe&&this._fsframe.$dom().height(this._column.$dom().height());this._sidebar.$('.sidebar-middle-section').height(Math.max(0,
6605sidebarHeight-(topSection+bottomSection)));(function(spacer,sizer){spacer.height(Math.max(0,(sidebarHeight-sizer.height()-bottomSection)/2));})(this._sidebar.$('.sidebar-spacer'),
6606this._sidebar.$('.sidebar-sizer'));var $btns=this._sidebar.$('.home-btns');if($btns.length){if(this._sidebar.$('.sidebar-search').length){var $search=this._sidebar.$('.searchBin');
6607$btns.css('margin-left',($search.offset().left)-this._sidebar.$().offset().left-5);}else{$btns.css('margin-left',(this._sidebar.$().width()-$btns.width())/2);}}if(this._menu&&!this._menu.vertical){this._menu.setWidth(this._menu.$().parent().width());
6608}return true;};;;function zfl_RecentFeaturedLayout(id,global,local){zfl_Layout.prototype.constructor.call(this,id,global,local);this._photoSets=zfl_stdTransformResponse(local.photoSets,
6609"photoSets");this._grid=local.grid;this._gridParams=local.gridParams;}zfl_RecentFeaturedLayout.inherits(zfl_Layout);zfl_RecentFeaturedLayout.prototype.onload=function(){this.initGrid(this._grid,zfl_PhotoViewStyle.FolderElement,
6610this._gridParams,this._photoSets);zfl_Layout.prototype.onload.call(this);};zfl_RecentFeaturedLayout.prototype.onrecalc=function(){if(this._grid)this._grid.recalcLayout();zfl_Layout.prototype.onrecalc.call(this);
6611};;;function zfl_SignInData(){this.email=null;this.name=null;this.phone=null;}zfl_SignInData._storageKey="layout.signin.recent";zfl_SignInData.load=function(){var data=new zfl_SignInData();data.email=zf_storage.getItem(zfl_SignInData._storageKey+".email");
6612data.name=zf_storage.getItem(zfl_SignInData._storageKey+".name");data.phone=zf_storage.getItem(zfl_SignInData._storageKey+".phone");return data;};zfl_SignInData.save=function(email,
6613name,phone){if(email)zf_storage.setItem(zfl_SignInData._storageKey+".email",email);else zf_storage.removeItem(zfl_SignInData._storageKey+".email");if(name)zf_storage.setItem(zfl_SignInData._storageKey+".name",
6614name);else zf_storage.removeItem(zfl_SignInData._storageKey+".name");if(phone)zf_storage.setItem(zfl_SignInData._storageKey+".phone",phone);else zf_storage.removeItem(zfl_SignInData._storageKey+".phone");
6615};zfl_SignInData.prototype.encode=function(prepend){var p=[];if(this.email)p.push('email='+encodeURIComponent(this.email));if(this.name)p.push('name='+encodeURIComponent(this.name));
6616if(this.phone)p.push('phone='+encodeURIComponent(this.phone));if(p.length==0)return '';return(!prepend?'':prepend)+p.join('&');};;function zfl_SignInLayout(id,global,local){if(global.zenbar)global.zenbar.disableAutoScrapbook=true;
6617zfl_Layout.prototype.constructor.call(this,id,global,local);var callback=function(result,error){if(error){local.form.handleError(result,error);return;}if(location.search.indexOf("preview=signin")!=-1){var list=location.search.substr(1).split('&');
6618list=$.map(list,function(l){return l=="preview=signin"?null:l;});location.search=list.length==0?"":("?"+list.join('&'));return;}var data=local.form.getData();zfl_SignInData.save(data.email,
6619data.username,data.phone,result);location.reload();};local.form.onreply=callback;this.$(".signin-skip").click(function(){zf_stdServerRequestEx("POST","/zf/layout/signin.asmx",
6620"SkipSignIn",[local.siId,local.siCn],callback);return false;});}zfl_SignInLayout.inherits(zfl_Layout);;;;;;function zfl_EventSearchForm(id,form,button,customize){zfl_Control.prototype.constructor.call(this,
6621id);form.onreply=function(result,error){button.togglePending(false);if(error){form.handleError(result,error);return;}result=zf_stdReplaceApostrophes(result);var uri=[location.path,
6622'?eq=',encodeURIComponent(result)];if(customize)uri.push('&customize=',customize);location.href=uri.join('');};}zfl_EventSearchForm.inherits(zfl_Control);;function zfl_EventLayout(id,global,
6623local){zfl_FolderLayout.prototype.constructor.call(this,id,global,local);this._fullScreen=local.fullScreen;this._customizer=global.customizer;this._player=local.player;
6624this._column=local.column;this._data.photos=zfl_stdTransformResponse(local.data.photos,"photos");if(true&&this._grids.photos){this._data.photos=[];for(var i=0;i<50;
6625i++){this._data.photos.push({id:'_'+i,requested:true,loaded:true,title:'Sample Photo',access:{type:zf_Acce
6625ssType.Public,mask:0},priceKey:"1"});}}this._padding=parseInt(this.$().css("paddingLeft"));
6626;this._slideshowOffset=local.slideshowOffset?local.slideshowOffset:0;;this.cyMinFooter=0;}zfl_EventLayout.inherits(zfl_FolderLayout);zfl_EventLayout.prototype.onload=function(){zfl_FolderLayout.prototype.onload.call(this);
6627this.initGrid(this._grids.folder,zfl_PhotoViewStyle.FolderElement,this._grids.folderParams,this._data.folder);this.initGrid(this._grids.photos,zfl_PhotoViewStyle.GalleryPhoto,
6628this._grids.photosParams,this._data.photos);};zfl_EventLayout.prototype.onrecalc=function(){zfl_FolderLayout.prototype.onrecalc.call(this);if(this._grids.folder)this._grids.folder.recalcLayout();
6629if(this._grids.photos)this._grids.photos.recalcLayout();this._recalcFullScreen();};zfl_EventLayout.prototype._recalcFullScreen=function(){if(!this._fullScreen)return;var $frame=this.$dom('frame');
6630var availWidth=$frame.innerWidth();var availHeight=$frame.outerHeight();if(this._player)this._player.resize(availWidth,availHeight);};zfl_EventLayout.prototype._centered_onstretch=function(height,
6631stretcher){var availWidth=this.$dom("frame").width()-(this._slideshowOffset+this._padding*2);var availHeight=height;if(this._fixedWidth){availWidth=Math.min(availWidth,
6632944-this._slideshowOffset);availHeight=10000;}var cellWidth=1;if(this._grids.folder)cellWidth=this._grids.folder.getCellSize().cx||1;if(this._player){var size=this._player.resize(availWidth,
6633availHeight,{cellWidth:cellWidth});this.$dom().width(size.cx-size.cxShadow+this._slideshowOffset);stretcher.style.minHeight=size.cy+"px";if(this._grids.folder!=null)this._grids.folder.recalcLayout();
6634}return true;};zfl_EventLayout.prototype._leftright_onstretch=function(height,stretcher){var availWidth=this.$dom("frame").width()-(this._slideshowOffset+this._padding*2);var availHeight=height;
6635if(this._fixedWidth){availWidth=Math.min(availWidth,870-this._slideshowOffset);availHeight=10000;}var size=this._player.resize(availWidth,availHeight);this.$dom().width(size.cx-size.cxShadow+this._slideshowOffset);
6636stretcher.style.minHeight=size.cy+"px";if(this._grids.folder!=null)this._grids.folder.recalcLayout();return true;};zfl_EventLayout.prototype._photos_onstretch=function(height,stretcher){var grid=this._grids.photos;
6637if(!grid)return false;grid.minRows=null;grid.setHeight(-1);stretcher.style.height="auto";stretcher.style.minHeight=height+"px";grid.recalcLayout();return true;};
6638;;;;function zfl_EventSearchLayout(id,global,local){zfl_Layout.prototype.constructor.call(this,id,global,local);zfl_PhotoDownload.prototype.constructor.call(this,global.isAmdEnabled,
6639global.isSmdEnabled,global.maxSmdZipSize);this._folder=zfl_stdTransformResponse(local.folder,"folder");this._data={photos:zfl_stdTransformResponse(local.data.photos,
6640"photos")};var i;var self=this;this._demo=local.demo;if(local.demo){this._data.photos=[];for(i=0;i<20;i++){this._data.photos.push({id:'_'+i,requested:true,loaded:true,
6641title:'Sample Photo',access:{type:zf_AccessType.Public,mask:0},priceKey:"1"});}}var photos=this._data.photos;if(photos){if(zf_userId!=zf_ownerId){var fnull=function(){return null;
6642};for(i=0;i<photos.length;i++)photos[i].getHref=fnull;}if(!this._demo){zf_ReturnData.setReturnPages(photos,zf_ReturnPageType.EventSearchPage,{folderId:this._folder.id});
6643this._grids.photosParams.onclick=function(context,e){if(Zenfolio.Global.QuickShopManager.isEnabled(context.data)){var returnData=self._getReturnData();returnData.photoKey=zf_PhotoKey.getString(context.data);
6644Zenfolio.Global.QuickShopManager.show({photoList:self._photoList.recreate(),startIndex:context.index,hideShare:true,forceSidebar:e&&e.forceSidebar,quickShopParameters:self.quickShopParameters,
6645returnData:returnData,getReturnPagesCallback:self.closure(self._getReturnPages)});}else{zf_DimLightsStandalone(photos,context.index,{toolbar:true,scrapbook:self.scrapbook,
6646yearbook:self.yearbook,ondownload:function(photo){self._downloadOriginal(photo);},onaddtofavorites:function(photo){var keys=[zf_PhotoKey.getString(photo)];self.scrapbook.addPhotos(keys,
6647false,null,self._getReturnPages(keys));},onremovefromfavorites:function(photo){self.scrapbook.removePhotos([zf_PhotoKey.getString(photo)]);},onselectasyearbookpose:function(photo,
6648refreshUICallback){self.yearbook.addPhoto(photo,null,refreshUICallback,true);},onremovefromyearbookpose:function(photo,refreshUICallback){self.yearbook.removePhoto(photo,
6649null,refreshUICallback,true);},onaddtocart:function(photo){var returnData=self._getReturnData();returnData.photoKey=photo&&zf_PhotoKey.getString(photo);self.zenbar.addToCart({allPhotos:photos,
6650returnData:returnData})([photo]);},onmakezookalbum:!global.canMakeZookbindersAlbum?null:function(){zf_ZookbindersUtils.makeZookAlbumFromPhotoList(self.zenbar,photos,
6651global.isGspAlbumFlow);},oncreatebook:!local.createBook?null:function(photo){var returnData=self._getReturnData();returnData.photoKey=photo&&zf_PhotoKey.getString(photo);
6652self.zenbar.addToCart({allPhotos:photos,categoryId:'photobooks-new',returnData:returnData})([photo]);},browserScaling:local.browserScaling});}return false;};}}if(this._grids.photosParams){this._grids.photosParams.isEvent=true;
6653}this._photoList=zf_PhotoList.wrap(photos);this._printableImages=local.printableImages;this._printableVideos=local.printableVideos;if(local.controlBox){local.controlBox.oneditproduct=this.closure(this._editProduct);
6654local.controlBox.setCounts(this._printableImages,this._printableVideos);this._controlBox=this._controls.add(local.controlBox);}this._actions=this._controls.add(local.actions);
6655this._selectPlugin=null;if(local.quickPriceList){local.quickPriceList.init(this.zenbar);local.quickPriceList.addtocart=this.closure(this._addToCart);local.quickPriceList.onresize=this.closure(this.recalc);
6656}if(this.scrapbook)this.scrapbook.onchange=this.closure(this._scrapbook_onchange);this._fakeVideoOriginals=local.fakeVideoOriginals;this.cyMinFooter=0;this.showAll=true;
6657if(this._returnData&&(!this._grids.photos||this._returnData.pageType!=zf_ReturnPageType.EventSearchPage||!this._folder||this._returnData.folderId!=this._folder.id||!this._returnData.hasPhotoKeys()||!this._returnData.gridShowAll)){this._returnData=null;
6658}}zfl_EventSearchLayout.inherits(zfl_PhotoSetLayout);zfl_EventSearchLayout.prototype.onload=function(){zfl_PhotoSetLayout.prototype.onload.call(this);};zfl_EventSearchLayout.prototype.onrecalc=function(){zfl_PhotoSetLayout.prototype.onrecalc.call(this);
6659var grid=this._grids.photos;if(grid&&this._returnData&&!this._returnDataRestored){this._returnDataRestored=true;var returnToQuickShopOnly=this._returnData.returnToQuickShopOnly(this._photoList);
6660if(returnToQuickShopOnly==null){this._returnData=null;return;}if(!returnToQuickShopOnly){var layoutInfo=grid.getLayoutInfo();layoutInfo.firstVisible=0;layoutInfo.lastVisible=this._photoList.length;
6661grid.recalcLayout(layoutInfo);}zf_stdDeferCall(null,function(){if(!returnToQuickShopOnly){this.recalc();}this._restoreReturnData({hideShare:true},this._photoList,
6662returnToQuickShopOnly);},this);}};zfl_EventSearchLayout.prototype.loadSelection=function(){this._selection=zfl_PhotoSelection.load("event",this._folder.id);var selection=this._selection;
6663selection.onchange=this.closure(this._selection_onchange);selection.__zfl_verified=true;if(selection.none()){this._updateActions(true);return;}var selected=selection.get();
6664var missing=[];for(var i=0;i<selected.length;i++){if(this._photoList.find(selected[i])==-1)missing.push(selected[i]);}if(missing.length>0)selection.unselect(missing);
6665else this._selection_onchange();};zfl_EventSearchLayout.prototype.saveSelection=function(){zf_stdDeferCall(this.id+".selection",this._selection.save,this._selection,"event");};zfl_EventSearchLayout.prototype._photos_onstretch=function(height,
6666stretcher){var grid=this._grids.photos;if(!grid)return false;grid.minRows=null;grid.setHeight(-1);stretcher.style.height="auto";stretcher.style.minHeight=height+"px";
6667grid.recalcLayout();return true;};zfl_EventSearchLayout.prototype._getReturnData=function(){return $.extend(new zf_ReturnData(),{pageType:zf_ReturnPageType.EventSearchPage,gridShowAll:true,
6668folderId:this._folder&&this._folder.id});};zfl_EventSearchLayout.prototype._addToFavorites=function(purchase,noconfirm){zfl_PhotoSetLayout.prototype._addToFavorites.call(this,purchase,
6669true);};zfl_EventSearchLayout.prototype._download=function(){var photoList=this._data.photos;var title=this._folder.title;var selection=this._selection;if(!selection||selection.none()){this._downloadOriginals(title,
6670photoList,this._folder);}else{this._downloadOriginals(title,selection.getPhotos(photoList),this._folder);}};zfl_EventSearchLayout.prototype._updateActions=function(first){if(this._demo){var none={};
6671this._actions.enableActions(none);return none;}return zfl_PhotoSetLayout.prototype._updateActions.call(this,first);};zfl_EventSearchLayout.prototype._checkSelection=function(command){if(command=="downloadOriginal"){if(this._selection&&!this._selection.none())this._downloadOriginals(this._folder.title,
6672this._selection.getPhotos(this._photoList),this._folder);else this._downloadOriginals(this._folder.title,this._photoList,this._folder);}else if(command=="addToFavorites"){this._addToFavorites(false,
6673true);}else{;}};zfl_EventSearchLayout.prototype._getReturnPages=function(keys){return zf_ReturnData.getReturnPages(keys,zf_ReturnPageType.EventSearchPage,{folderId:this._folder.id});
6674};;;;;function zfl_PreorderEventSearchLayout(id,global,local){this._preorderRequiredPhotos=global.preorderRequiredPhotos;this._preorderId=global.preorderId;zfl_Layout.prototype.constructor.call(this,
6675id,global,local);zfl_PhotoDownload.prototype.constructor.call(this,global.isAmdEnabled,global.isSmdEnabled,global.maxSmdZipSize);this._folder=zfl_stdTransformResponse(local.folder,
6676"folder");this._data={photos:zfl_stdTransformResponse(local.data.photos,"photos")};var i;var self=this;this._demo=local.demo;if(local.demo){this._data.photos=[];
6677for(i=0;i<20;i++){this._data.photos.push({id:'_'+i,requested:true,loaded:true,title:'Sample Photo',access:{type:zf_AccessType.Public,mask:0},priceKey:"1"});}}var photos=this._data.photos;
6678if(photos){if(zf_userId!=zf_ownerId){var fnull=function(){return null;};for(i=0;i<photos.length;i++)photos[i].getHref=fnull;}if(!this._demo){zf_ReturnData.setReturnPages(photos,
6679zf_ReturnPageType.EventSearchPage,{folderId:this._folder.id});this._grids.photosParams.onclick=function(context,e){return false;};}}if(this._grids.photosParams){this._grids.photosParams.isEvent=true;
6680}this._photoList=zf_PhotoList.wrap(photos);this._printableImages=local.printableImages;this._printableVideos=local.printableVideos;if(local.controlBox){local.controlBox.oneditproduct=this.closure(this._editProduct);
6681local.controlBox.setCounts(this._printableImages,this._printableVideos);this._controlBox=this._controls.add(local.controlBox);}this._actions=this._controls.add(local.actions);
6682this._selectPlugin=null;if(local.quickPriceList){local.quickPriceList.init(this.zenbar);local.quickPriceList.addtocart=this.closure(this._addToCart);local.quickPriceList.onresize=this.closure(this.recalc);
6683}if(this.scrapbook)this.scrapbook.onchange=this.closure(this._scrapbook_onchange);this._fakeVideoOriginals=local.fakeVideoOriginals;this.cyMinFooter=0;this.showAll=true;
6684if(this._returnData&&(!this._grids.photos||this._returnData.pageType!=zf_ReturnPageType.EventSearchPage||!this._folder||this._returnData.folderId!=this._folder.id||!this._returnData.hasPhotoKeys()||!this._returnData.gridShowAll)){this._returnData=null;
6685}this._grids.photosParams.onclick=function(context,e){return false;};}zfl_PreorderEventSearchLayout.inherits(zfl_PreorderPhotoSetLayout);zfl_PreorderEventSearchLayout.prototype.onload=function(){zfl_PreorderPhotoSetLayout.prototype.onload.call(this);
6686};zfl_PreorderEventSearchLayout.prototype.loadSelection=function(){this._selection=zfl_PhotoSelection.load("preorder.event",this._folder.id);var selection=this._selection;selection.onchange=this.closure(this._selection_onchange);
6687selection.__zfl_verified=true;if(selection.none()){this._updateActions(true);return;}var selected=selection.get();var missing=[];for(var i=0;i<selected.length;i++){if(this._photoList.find(selected[i])==-1)missing.push(selected[i]);
6688}if(missing.length>0)selection.unselect(missing);else this._selection_onchange();};zfl_PreorderEventSearchLayout.prototype.saveSelection=function(){zf_stdDeferCall(this.id+".selection",this._selection.save,
6689this._selection,"preorder.event");};zfl_PreorderEventSearchLayout.prototype._photos_onstretch=function(height,stretcher){var grid=this._grids.photos;if(!grid)return false;grid.minRows=null;grid.setHeight(-1);
6690stretcher.style.height="auto";stretcher.style.minHeight=height+"px";grid.recalcLayout();return true;};zfl_PreorderEventSearchLayout.prototype._getReturnData=function(){return $.extend(new zf_ReturnData(),
6691{pageType:zf_ReturnPageType.EventSearchPage,gridShowAll:true,folderId:this._folder&&this._folder.id});};zfl_PreorderEventSearchLayout.prototype._checkSelection=function(command){var self=this;
6692var desc={};var mode=null;if(command=="preorderImgSelect"){if(this._selection&&!this._selection.none()){this._addToPreorder();return;}}else{;}var markup=['<div class="pc" id="',
6693this.id,'-selection">','<div class="pc-bg"></div>','<div class="pc-frame pc-bgcolor1 pc-border1 pc-font1 pc-color1">','<div class="pc-hdr pc-bgcolor2 pc-font3 pc-color1 pc-border2">',
6694zf_stdHtmlEncode(desc.title),'</div>','<a class="pc-hdr-close pc-font2" href="#">',zf_stdHtmlEncode('Close'),'<span></span>','</a>','<div class="pc-body" style="height:400px">',
6695'<div class="pc-slidein pc-color1 pc-border2 pc-bgcolor1 pc-slidein-s" style="width:100%;height:100%;right:0px">','<div class="pc-selection-c" style="margin-top:-150px">',
6696'<h6 class="pc-font2">',zf_stdHtmlEncode(desc.text),'</h6>','<div class="pc-selection-l">','<a class="pc-button pc-font2 pc-selection-y button-color1 button-bgcolor1 button-border1" href="#">',
6697zf_stdHtmlEncode(desc.button1),'</a>','<a class="pc-button pc-font2 pc-selection-n button-color1 button-bgcolor1 button-border1" href="#">',zf_stdHtmlEncode(desc.button2),
6698'</a>','</div>','</div>','</div>','</div>','</div>'];var $popup=$(markup.join('')).appendTo(document.body);var $window=$(window);$popup.find('.pc-bg').height($window.height());
6699$popup.find('.pc-frame').css({width:600,height:400,left:($window.width()-600)/2,top:($window.height()-400)/2});var close=function(){$popup.remove();};$popup.find('.pc-hdr-close').click(function(){close();
6700return false;});$popup.find('.pc-selection-n').click(function(){close();self._enterSelection(true,mode);return false;});$popup.find('.pc-selection-y').click(function(){close();
6701desc.callback();return false;});$popup.find('A.pc-button').hover(function(){zfl_Button.onmouseover(this);},function(){zfl_Button.onmouseout(this);});$popup.show();
6702};;function zfl_AppStartLayout(id,global,local){zfl_Layout.prototype.constructor.call(this,id,global,local);this._url=local.url;this._appstore=local.appstore;this._noAutostart=local.noAutostart;
6703this._titlePhotoUrl=local.titlePhotoUrl;}zfl_AppStartLayout.inherits(zfl_Layout);zfl_AppStartLayout.prototype.onload=function(){zfl_Layout.prototype.onload.call(this);if(this._titlePhotoUrl!=null){var background="url('"+this._titlePhotoUrl+"') no-repeat center center / cover";
6704;$(this.dom()).css({boxShadow:"inset 0 0 0 1000px rgba(0,0,0,.6)",background:background});}var self=this;if(!this._noAutostart){$(setTimeout(function(){self.start();
6705},500));}};zfl_AppStartLayout.prototype.start=function(){zf_stdStartApp(this._url,this._appstore);};;;function zfl_Checkbox(id,checked){zfl_Control.prototype.constructor.call(this,id);this.checked=checked;
6706}zfl_Checkbox.inherits(zfl_Control);zfl_Checkbox.prototype._onclick=function(e){e=zf_stdGetEvent(e);zf_stdPreventDefault(e);this.check(!this.checked);if(this.oncheck)this.oncheck(this.checked);
6707return false;};zfl_Checkbox.prototype.check=function(checked){checked=checked?true:false;if(this.checked==checked)return;this.checked=checked;zf_stdReplaceClassName(this.dom(),
6708checked?"checkbox-off":"checkbox-on",checked?"checkbox-on":"checkbox-off");};;;function zfl_SlidesLayout(id,global,local){this._isPhoto=!!local.isPhoto;this._isCvv=!!local.isCvv;
6709this._customizerEntryPoint=local.customizerEntryPoint;this._backButtonText=local.backButtonText;this._backButtonUrl=local.backButtonUrl;this._isTablet=false;zfl_Layout.prototype.constructor.call(this,
6710id,global,local);var fullscreen=this._isTablet&&!this._isCvv;var bgcolor=local.flashvars.background.replace('0x','#');var html2=zfl_Slideshow.createHtml(id+'-html5',
6711'pv-img pv-html5',bgcolor,0,0,fullscreen);if(this._isTablet&&!this._isCvv)$('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">').appendTo($('head'));
6712this.$dom('slideshow').empty().html(html2);this._photoSet=zfl_stdTransformResponse(local.photoSet);var svdefs={thumbnails_mode:'1',enable_controls:'1',full_overlay:true};
6713var slideshowvars=$.extend(true,{},local.flashvars,svdefs);var options={forceSizingContainer:true,analytics:local.analytics};this._slideshow=new zfl_Slideshow(id+'-html5',
67140,0,9999,9999,slideshowvars,this._photoSet,null,this._photoSet.owner,fullscreen,local.photoList,false,fullscreen,options);this._slideshow.onslide=this.closure(function(photoId,
6715photoIndex,photo){history.replaceState(null,null,'#h'+zf_toUint32(photoId).toString(16));this._currentPhotoId=photoId;Zenfolio.Global.LayoutService.registerVisit(photo,
6716this._photoSet);});this._initial=local.initial;this._photoList=local.photoList;this._random=slideshowvars.random=='1';this._slideshow.setupBackButton(this._backButtonText,
6717this.closure(function(){if(this._backButtonUrl){location.href=this._backButtonUrl;return;}var uri=this._isPhoto&&this._currentPhotoId?zf_stdFormatString('{0}/e{1}',
6718this._photoSet.getBaseHref(),zf_toUint32(this._currentPhotoId).toString(16)):zf_stdFormatString('{0}',this._photoSet.getBaseHref());if(this._customizerEntryPoint){uri+='?customize='+this._customizerEntryPoint;
6719}location.href=uri;}));}zfl_SlidesLayout.inherits(zfl_PhotoLayout);zfl_SlidesLayout.prototype.onrecalc=function(){if(this._isTablet&&!this._isCvv)return;zfl_Layout.prototype.onrecalc.call(this);
6720var $root=this.$dom('slideshow');var width=$root.width(),height=$root.height();this._slideshow.setMaxSize(width,height);this._slideshow.resize(width,height);};zfl_SlidesLayout.prototype.onload=function(){var self=this;
6721if(this._random){setTimeout(function(){self._slideshow.init();},0);return;}this._photoList.onload=function(first){if(!first)return;var legacy=location.search.indexOf("photo=")!=-1;
6722var id=zfl_AddressBar.parseHash(self._initial&&self._initial.id,legacy);var index=id?self._photoList.find(id):0;if(index!=-1)self._slideshow.init({startIndex:index});
6723else{var url=zf_stdFormatString('{0}/e{1}/slideshow{2}',self._photoSet.getBaseHref(),zf_toUint32(id).toString(16),location.search.replace("photo=h","legacy=x"));
6724location.replace(url);}};this._photoList.get(this._initial&&this._initial.index||0,true);return;};;;;function zf_EmailAddress(address,name){if(arguments.length>0){;;this.address=address;
6725this.name=(name!=null&&name.length==0)?null:name;}}zf_EmailAddress.isValid=function(address){;return(/^[-+=\w\.][-+=\w\x27\.]*@([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/.test(address))||(/^[-+=\w\.][-+=\w\x27\.]*@\[\S+\]$/.test(address));
6726};zf_EmailAddress.parse=function(address){;var re0=/^(\s*)([-+=\w\.][-+=\w\x27\.]*@(?:(?:\[[^\]]+\])|(?:[-\w\.]+)))/;var re1=/^([^<]*)<([-+=\w\.][-+=\w\x27\.]*@(?:(?:\[[^\]]+\])|(?:[-\w\.]+)))>/;
6727var re2=/^([^\[]*)\[([-+=\w\.][-+=\w\x27\.]*@(?:(?:\[[^\]]+\])|(?:[-\w\.]+)))\]/;var re3=/^\s*\x22([^\x22]*)\x22\s*<?([-+=\w\.][-+=\w\x27\.]*@(?:(?:\[[^\]]+\])|(?:[-\w\.]+)))>?/;
6728var re4=/^\s*\x27([^\x27]*)\x27\s*<?([-+=\w\.][-+=\w\x27\.]*@(?:(?:\[[^\]]+\])|(?:[-\w\.]+)))>?/;var match=re0.exec(address);if(match==null)match=re1.exec(address);
6729if(match==null)match=re2.exec(address);if(match==null)match=re3.exec(address);if(match==null)match=re4.exec(address);if(match==null)return null;var name=zf_stdTrim(match[1]);
6730var email=match[2];
6730if(!zf_EmailAddress.isValid(email))return null;if(name.length>1){if(name[0]=='\x22'&&name[name.length-1]=='\x22')name=name.substr(1,name.length-2);
6731if(name[0]=='\x27'&&name[name.length-1]=='\x27')name=name.substr(1,name.length-2);}var tail=address.substr(match[0].length);return{address:new zf_EmailAddress(email,
6732name),tail:tail};};zf_EmailAddress.prototype.toString=function(){if(this.name==null)return this.address;var name=this.name;if(/[,;<>\x27]/.test(name))name='"'+name+'"';else if(name.indexOf('"')!=-1)name="'"+name+"'";
6733return zf_stdFormatString("{0} <{1}>",name,this.address);};;function zfl_ContactForm(id,contactForm,contactButton){this.id=id;this._form=contactForm;this._button=contactButton;
6734this.onreply=null;zf_stdDeferCall(null,this.init,this);}zfl_ContactForm.prototype.init=function(){var self=this;this._form.onsubmit=zf_stdFalse;this._button.onclick=function(){if(typeof grecaptcha!=='undefined'&&self._validateForm()){grecaptcha.enterprise.execute();
6735}};};zfl_ContactForm.prototype._validateForm=function(){var name=this._form.fieldVal('username');var email=this._form.fieldVal('email');var message=this._form.fieldVal('message');
6736var subject=this._form.fieldVal('subject');if(email&&email.trim()&&!zf_EmailAddress.isValid(email)){this._form.setFieldError('email','This is not a valid email address.');
6737this._resetCaptcha();return false;}return true;};zfl_ContactForm.prototype._submitMessage=function(username,email,subject,message,phone,answer1,answer2,answer3,question1,question2,
6738question3,challenge){var data=new zf_MessageUpdater();data.username=username;data.email=(email)?zf_stdTrim(email):email;data.subject=zf_stdTrim(subject);data.message=message;
6739data.phone=phone;data.answer1=answer1;data.answer2=answer2;data.answer3=answer3;data.question1=question1;data.question2=question2;data.question3=question3;data.gRecaptchaResponse=this._captchaToken;
6740data.challenge=challenge;var challenge2=zf_utf8(data.challenge.substr(0,8));data.response=zf_sha256((email)?challenge2.concat(zf_utf8(data.email)):challenge2);var self=this;
6741var oncomplete=function(message,error){zf_stdDeferCall(null,self._form_onreply,self,message,error);};zf_stdServerRequestEx("POST","/zf/layout/layout.asmx","SendContactMessage",
6742[data],oncomplete);};zfl_ContactForm.prototype._button_onclick=function(){if(!$(".error-box").hasClass('none'))$(".error-box").addClass("none");if(this._validateForm()){this._submitMessage(this._form.fieldVal('username'),
6743this._form.fieldVal('email'),this._form.fieldVal('subject'),this._form.fieldVal('message'),this._form.fieldVal('phone'),this._form.fieldVal('answer1'),this._form.fieldVal('answer2'),
6744this._form.fieldVal('answer3'),this._form.fieldVal('question1'),this._form.fieldVal('question2'),this._form.fieldVal('question3'),this._form.fieldVal('challenge'));
6745}};zfl_ContactForm.prototype._captchaCallback=function(token){this._captchaToken=token;this._button_onclick();};zfl_ContactForm.prototype._resetCaptcha=function(){zf_resetCaptcha($("[id$=captcha-field]").attr('data-widget-id'));
6746};zfl_ContactForm.prototype._form_onreply=function(result,error){if(error!==null){$(".error-box").removeClass("none");this._resetCaptcha();return;}this._resetCaptcha();this._showResult("Your message has been sent.");
6747if(this.onreply)zf_stdDeferCall(null,this.onreply,this,message,error);};zfl_ContactForm.prototype._showResult=function(message,error){$("[id$=result]").toggleClass("form-color1",
6748!!error).removeClass("none").text(message);$("form").addClass("invisible");};;function zfl_LoginForm(id,loginForm,resetForm,resetButton,skipCurtainManagement,insideLoginDlg){zfl_Control.prototype.constructor.call(this,
6749id);var self=this;this.onsuccess=zf_stdTrue;this._loginForm=loginForm;this._resetForm=resetForm;this._resetButton=resetButton;this._skipCurtainManagement=skipCurtainManagement;
6750this._insideLoginDlg=insideLoginDlg;this._loginForm.onsubmit=this.closure(this._login_onsubmit);this._loginForm.oninit=this.closure(this._login_oninit);this.submit=this._loginForm.closure(this._loginForm.submit);
6751if(this._resetForm){this._resetForm.oninit=this.closure(this._reset_oninit);this._resetForm.onreply=this.closure(this._reset_onreply);}this._loginForm.field('password').bind('keydown',
6752function(e){if(e.which==13)self._loginForm.submit();});if(this._resetForm){this._resetForm.field('user').bind('keydown',function(e){if(e.which==13)self._resetForm.submit();
6753else if(e.which==27)self._reset_hide();});}this.$('.cr-login-tip a').click(this.closure(this._reset_show));}zfl_LoginForm.inherits(zfl_Control);zfl_LoginForm.prototype.hide=function(){this._reset_hide();
6754};zfl_LoginForm.prototype._login_oninit=function(data){if(data.user){this._loginForm.field('password').focus();}else{this._loginForm.field('user').focus();}return true;};zfl_LoginForm.prototype._reset_oninit=function(data){return true;
6755};zfl_LoginForm.prototype._login_onsubmit=function(data,handlers){if(this._loginPending)return false;this._loginForm.clearStatus();if(!this._loginForm.verifyForm(data))return false;
6756this._loginPending=true;handlers.onrequestsend();var self=this;zf_loginScoped(data.scopeId,data.user,data.password,function(userName,errorMsg){handlers.onrequestcomplete();
6757handlers.onreply(userName,errorMsg);self._loginPending=false;if(errorMsg){self._loginForm.showError(errorMsg);self._loginForm.clear('password').focus();}else self.onsuccess(userName);
6758});return false;};zfl_LoginForm.prototype._reset_show=function(){if(this._insideLoginDlg){if(this.showResetPasswordDlg){this.showResetPasswordDlg();}}else{if(!this._skipCurtainManagement){zf_Curtain.show();
6759}var height=this.$dom('reset').detach().appendTo(document.body).show().outerHeight(true);var customMobileCheckout=this.$dom('reset').hasClass("co-reset-popup");var top=(zf_stdGetClientHeight()-height)/2+(!customMobileCheckout?0:$(window).scrollTop());
6760var left=(zf_stdGetClientWidth(customMobileCheckout)-(customMobileCheckout?this.$dom('reset').outerWidth(false):324))/2;this.$dom('reset').css({top:top+"px",left:left+"px"});
6761var email=this._loginForm.field('user').val();this._resetForm.field('user').val(email);this._resetForm.field('user').focus();this._resetForm.clearStatus();this.$dom('reset').find('.cr-reset-form').removeClass('invisible');
6762this.$dom('reset').find('.cr-reset-confirm').addClass('none');}return false;};zfl_LoginForm.prototype._reset_hide=function(){if(!this._skipCurtainManagement){zf_Curtain.hide();
6763}this.$dom('reset').hide();return true;};zfl_LoginForm.prototype._reset_onreply=function(result,error){this._resetButton.togglePending(false);
6763if(error)return true;this.$dom('reset').find('.cr-reset-form').addClass('invisible');
6764this.$dom('reset').find('.cr-reset-confirm').removeClass('none');return null;};;function zfl_LoginDialog(id){zfl_Control.prototype.constructor.call(this,id);this.$(".js-scrapbook-popup-close").click(this.closure2(this.hide,
6765false));this.$(".login-dlg-footer-continue").click(this.closure(function(){this._onSuccessCallback&&this._onSuccessCallback();zfl_openLoginPage(null,null);return false;
6766}));}zfl_LoginDialog.inherits(zfl_Control);zfl_LoginDialog.prototype.show=function(onSuccessCallback,showUnchanged,title,message){this._curtainWasVisible=$('#dimmer').is(':visible');if(!this._curtainWasVisible){zf_Curtain.show("light",
6767null,null,null,this.closure(this._onCurtainHide),true);}this._onSuccessCallback=onSuccessCallback;if(!showUnchanged){this._title=title;this._message=message;if(!this._title){this._title="Log In";
6768}$(this.dom('title')).text(this._title);if(!message){$(this.dom('message')).hide();}else{$(this.dom('message')).show();$(this.dom('message')).text(message);}}var $mbox=this.$();
6769var customMobileMode=false;var top=Math.floor((zf_stdGetClientHeight()-$mbox.outerHeight())/2)+$(document).scrollTop();var left=Math.floor((zf_stdGetClientWidth(customMobileMode)-$mbox.outerWidth())/2);
6770$mbox.css({top:top+"px",left:left+"px"});$mbox.show();};zfl_LoginDialog.prototype.hide=function(curtainIsHidden){this.$().hide();if(!this._curtainWasVisible&&!curtainIsHidden){zf_Curtain.hide();
6771}};zfl_LoginDialog.prototype._onCurtainHide=function(){this.hide(true);};;function zfl_ClientAccessForm(id,form,error){zfl_Control.prototype.constructor.call(this,id);this._form=form;form.onsubmit=this.closure(this._form_onsubmit);
6772form.onreply=this.closure(this._form_onreply);if(error)form.setFieldError('code','Sorry, this code was not recognized');}zfl_ClientAccessForm.inherits(zfl_Control);zfl_ClientAccessForm.prototype._form_onsubmit=function(data){if(this._form.verifyForm(data)==false)return false;
6773this.$('.form-message').addClass('form-pending').text('Checking code...').show();return true;};zfl_ClientAccessForm.prototype._form_onreply=function(result,error){if(!error){setTimeout(function(){location.href=result;
6774},1000);}else{this.$('.form-message').removeClass('form-pending');}return true;};;function zfl_ClientPage(id,layout){zfl_Control.prototype.constructor.call(this,id);;this.layout=layout;
6775}zfl_ClientPage.inherits(zfl_Control);function zfl_AccountPage(id,layout){zfl_ClientPage.prototype.constructor.call(this,id,layout);this.$('.cl-account-link a[href="favorites.html"]').click(function(){layout.zenbar.showScrapbook();
6776return false;});}zfl_AccountPage.inherits(zfl_ClientPage);;function zfl_OrderPage(id,layout){zfl_ClientPage.prototype.constructor.call(this,id,layout);}zfl_OrderPage.inherits(zfl_ClientPage);zfl_OrderPage.prototype.print=function(){var features="menubar=no,toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes"+",width=980,left="+(screen.width-1000)+",top=0,height="+screen.height;
6777try{var w=window.open(location.href+"&print=1","_blank",features);if(w==null)return;}catch(e){;}};zfl_OrderPage.prototype.reorder=function(refId,token,cartUrl){;zf_stdServerRequest("POST",
6778"/zf/core/printing/printing.asmx","RepeatOrder",[zf_cartGetId(),refId,token],function(status,retVal){if(status!=200||retVal.error!=null)return;zf_cartSetId(retVal.result);
6779location.href=cartUrl;});};;function zfl_PaymentPage(id,layout,form,buttons){zfl_ClientPage.prototype.constructor.call(this,id,layout);this._form=form;this._buttons=buttons;
6780form.onrequestsend=function(){buttons.save.toggleEnabled(false).togglePending(true);buttons.clear.toggleEnabled(false);};form.onreply=function(reply,error){if(error){buttons.save.toggleEnabled(true).togglePending(false);
6781buttons.clear.toggleEnabled(true);}else{location.href='account.html';}};}zfl_PaymentPage.inherits(zfl_ClientPage);zfl_PaymentPage.prototype.clear=function(){var form=this._form;var buttons=this._buttons;
6782buttons.save.toggleEnabled(false);buttons.clear.toggleEnabled(false).togglePending(true);zf_stdServerRequestEx("POST","/zf/layout/client.asmx","ClearPaymentInfo",
6783[],function(reply,error){buttons.save.toggleEnabled(true);buttons.clear.toggleEnabled(true).togglePending(false);
6783if(error){form.showMessage(error.message,true);return;
6784}form.clearStatus();form.clear();location.href='account.html';});};zfl_PaymentPage.prototype.save=function(){this._form.submit();};;function zfl_AlbumDesignPage(options){;zfl_Control.prototype.constructor.call(this,
6785options.id);if(options.serviceHomepage){$(this.closure(this._initServiceHomepage));}else{this._refreshPage();this._zenbar=options.zenbar;this._nextSelectDesignButton=options.nextSelectDesignButton;
6786this._nextPhotoSelectionButton=options.nextPhotoSelectionButton;this._updateButton=options.updateButton;this._editMode=options.editMode;this._imagePathTemplate=options.imagePathTemplate;
6787this._confirmationMessage=options.confirmationMessage;this._isGspAlbumFlow=this.$().hasClass('ad-gsp-flow');$(this.closure(this._initPageDesignAndCoverType));}}zfl_AlbumDesignPage.inherits(zfl_Control);
6788zfl_AlbumDesignPage.prototype._initServiceHomepage=function(){var self=this,photos=[],plugins=[{getInnerContent:function(){return '<div class="pv-border"></div>';}}];this.$('.ad-image-placeholder').each(function(){var $this=$(this),
6789$parent=$this.parent(),index=parseInt($this.data('index')),imgClass=$this.attr('class'),method=$.extend({},zf_ProcessingMethod.StandardMediumSize,{cx:parseInt($this.data('pv-width')),
6790cy:parseInt($this.data('pv-height'))});var photo=$.extend({},new zf_Photo(),{id:index+1,access:{mask:0},loaded:true,requested:true,width:parseInt($this.attr('width')),
6791height:parseInt($this.attr('height')),getInternalUrl:function(){return $this.attr('src');}});photos[index]=photo;var $pv=$(zf_PhotoView.createHtml(self.id+'-pv-'+index,
6792null,[imgClass],plugins,null,photo,method,true));$pv.click(function(){zf_DimLightsStandalone(photos,index,{browserScaling:true});});$this.remove();$parent.append($pv);
6793var $border=$pv.find('.pv-border');$pv.width($border.outerWidth()).height($border.outerHeight());var $albumImages=$pv.closest('.ad-photo-album-images');if($albumImages.length>0){if($pv.hasClass('ad-photo-album-max-dimensions')){self.$('.ad-photo-album-images').height($pv.height());
6794}else{$albumImages.width($pv.width());}}var $albumTypeImages=$pv.closest('.ad-album-type-images');if($albumTypeImages.length>0){var padding=$pv.width()-$pv.find('.pv-inner').width(),
6795margin=-padding/2;if(padding>0){$albumTypeImages.closest('.defdec').css('padding-left',padding+'px');$albumTypeImages.find('P').css({'margin-left':margin+'px','margin-top':margin+'px',
6796'margin-right':(-margin)+'px'});}}});};zfl_AlbumDesignPage.prototype._initPageDesignAndCoverType=function(){var self=this;$('.ad-next-button .label.button-font1').append('<i class="fa fa-angle-double-right" aria-hidden="true"></i>');
6797this._displayStep(1,false);this.$('.ad-cover-type-step .ad-large-preview').click(function(){self.$('.ad-cover-type-step .ad-large-preview').removeClass('selected');
6798$(this).addClass('selected');var code=$(this).attr('data-setting-code');var value=$(this).attr('data-setting-value');self.$('.ad-cover-type-step li.ad-small-preview[data-setting-code="'+code+'"][data-setting-value="'+value+'"]').addClass('selected');
6799self._displayStep(1,true);self._updateCoverTypeContent($(this));});this.$('.ad-cover-type-step .ad-small-preview').click(function(){self.$('.ad-cover-type-step .ad-small-preview').removeClass('selected');
6800$(this).addClass('selected');self._updateCoverTypeContent($(this));});this.$('.ad-color-type').hover(function(){var $this=$(this);self._clearHoverTimeout();self._hoverTimeout=setTimeout(function(){self._updateCoverTypeImage(null,
6801$this);},200);},function(){var $this=$(this);self._clearHoverTimeout();self._hoverTimeout=setTimeout(function(){self._updateCoverTypeImage(null,null);},200);});this.$('.ad-color-type').click(function(){self.$('.ad-color-type.selected').removeClass('selected');
6802$(this).addClass('selected');self._updateLeatherColor($(this));});this._nextSelectDesignButton.$dom().bind('zfl_click',function(){var hasSelectedDesign=self.$('.ad-design-style-step .ad-large-preview.selected').length>0;
6803self._displayStep(2,hasSelectedDesign);});this._nextPhotoSelectionButton.$dom().bind('zfl_click',function(){self._displayStep(3,null);self._updateButton.toggleEnabled(true);
6804});this.$('.ad-step-text .back').click(function(){self._displayStep(parseInt($(this).attr('data-step')),true);});this.$('.ad-design-style-step .ad-large-preview').click(function(){self.$('.ad-design-style-step .ad-large-preview').removeClass('selected');
6805$(this).addClass('selected');var code=$(this).attr('data-setting-code');var value=$(this).attr('data-setting-value');self.$('.ad-design-style-step li.ad-small-preview[data-setting-code="'+code+'"][data-setting-value="'+value+'"]').addClass('selected');
6806self._displayStep(2,true);self._updateDesignContent($(this));});this.$('.ad-design-style-step .ad-small-preview').click(function(){self.$('.ad-design-style-step .ad-small-preview').removeClass('selected');
6807$(this).addClass('selected');self._updateDesignContent($(this));});this.$('.ad-cover-text INPUT').on('input',function(){self._updateTextLines();});this.$('.ad-skip-selection-list LI').click(function(){var $radio=$(this).find('INPUT[type="radio"]');
6808$radio.prop('checked',true);$radio.closest('[data-setting-code]').attr('data-setting-value',$radio.attr('data-item-value'));});this._updateButton.$dom().bind('zfl_click',
6809function(){if(self._editMode){self._addOrUpdateDesignFee();}else{zfl_MessageBox.show({classes:'ad-congratulations-message',title:'Congratulations',text:self._confirmationMessage,
6810encode:false,buttons:['Cancel','OK'],onbutton:function(btn){if(btn==1){zf_stdDeferCall(null,self._addOrUpdateDesignFee,self);}}});}});};zfl_AlbumDesignPage.prototype._displayStep=function(step,
6811selected){if(this._editMode){selected=true;this.$('.ad-large-preview-outer, .ad-large-preview-outer-header').hide();}var stepSelector={1:{step:'.ad-cover-type-step',
6812content:'.ad-cover-content'},2:{step:'.ad-design-style-step',content:'.ad-design-content'},3:{step:'.ad-photo-selection-step',content:'.ad-selection-content'}};for(var ctn=1;
6813ctn<=3;ctn++){if(ctn==step){this.$(stepSelector[ctn].content).hide();this.$(stepSelector[ctn].step).show();this.$(stepSelector[ctn].content).fadeIn(1000);continue;
6814}this.$(stepSelector[ctn].step).hide();}var currentStepSelector=stepSelector[step];if(step==1||step==2){var $largePreview=this.$(currentStepSelector.step+' .ad-large-preview-outer').add(this.$(currentStepSelector.step+' .ad-large-preview-outer-header'));
6815var smallPreviewOuter=step==1?' .ad-small-preview-outer-wrapper':' .ad-small-preview-outer';if(selected){$largePreview.fadeOut(150);this.$(currentStepSelector.step+' .ad-large-preview-footer').hide();
6816this.$(currentStepSelector.step+' .ad-preview-header').animate({height:((step==1&&!this._isGspAlbumFlow)?"140px":"110px")},250);this.$(currentStepSelector.step+smallPreviewOuter).fadeIn(350);
6817this.$(currentStepSelector.content).fadeIn(1000);}else{$largePreview.show();this.$(currentStepSelector.step+' .ad-large-preview-footer').show();this.$(currentStepSelector.step+smallPreviewOuter).hide();
6818this.$(currentStepSelector.content).hide();}}else if(step==3){this.$(currentStepSelector.content).fadeIn(1000);}$('HTML, BODY, .cv-right-panel').scrollTop(0);};zfl_AlbumDesignPage.prototype._refreshPage=function(){var $indicator=this.$('#ad-reload-required');
6819if($indicator.val()!='0'){$indicator.val('0');$('HTML, BODY').hide();window.location.reload();}else{$indicator.val('1');}};zfl_AlbumDesignPage.prototype._updateCoverTypeContent=function(selectedCoverType){var code=selectedCoverType.attr('data-setting-code');
6820var value=selectedCoverType.attr('data-setting-value');var displayCoverContent=function(selector){this.$(selector).removeClass('selected');this.$(selector+'[data-setting-code="'+code+'"][data-setting-value="'+value+'"]').addClass('selected');
6821};displayCoverContent('.ad-cover-detail');displayCoverContent('.ad-cover-setting');if(this.$('.ad-cover-type-step .ad-small-preview.selected[data-has-leather-color=true]').length>0){if(this.$('.ad-color-type.selected').length==0){$(".ad-color-type[data-setting-value='brown']").addClass('selected');
6822}this.$('.ad-cover-no-color').hide();this.$('.ad-cover-color').show();}else{this.$('.ad-cover-no-color').show();this.$('.ad-cover-color').hide();}this._nextSelectDesignButton.toggleEnabled(true);
6823};zfl_AlbumDesignPage.prototype._updateCoverTypeImage=function(selectedCoverType,selectedColor){this._clearHoverTimeout();var preview=this.$('.ad-small-preview.selected');var hasColor=preview.attr('data-has-leather-color')=="true";
6824var setting=selectedCoverType==null?preview.attr('data-setting-value'):$(selectedCoverType).attr('data-setting-value');var color=selectedColor==null?preview.attr('data-leather-color-value'):$(selectedColor).attr('data-setting-value');
6825if(hasColor)this.$('.ad-cover-detail.selected IMG').attr('src',zf_stdFormatString(this._imagePathTemplate,color,setting));};zfl_AlbumDesignPage.prototype._updateLeatherColor=function(selectedColor){var self=this;
6826var preview=self.$('.ad-small-preview.selected');var hasColor=preview.attr('data-has-leather-color')=="true";var color=selectedColor.attr('data-setting-value');if(hasColor){this.$('.ad-cover-detail').each(function(){var setting=$(this).attr('data-setting-value');
6827var settingHasColor=$(this).attr('data-has-leather-color')=="true";if(hasColor&&settingHasColor)$(this).find('img').attr('src',zf_stdFormatString(self._imagePathTemplate,
6828color,setting));});this.$('.ad-small-preview').each(function(){var setting=$(this).attr('data-setting-value');var settingHasColor=$(this).attr('data-has-leather-color')=="true";
6829if(hasColor&&settingHasColor){$(this).attr('data-leather-color-value',color);$(this).find('img').attr('src',zf_stdFormatString(self._imagePathTemplate,color,setting));
6830}});}};zfl_AlbumDesignPage.prototype._updateDesignContent=function(selectedDesignStyle){var code=selectedDesignStyle.attr('data-setting-code');var value=selectedDesignStyle.attr('data-setting-value');
6831this.$('.ad-design-detail').removeClass('selected');this.$('.ad-design-detail[data-setting-code="'+code+'"][data-setting-value="'+value+'"]').addClass('selected');
6832this._nextPhotoSelectionButton.toggleEnabled(true);};zfl_AlbumDesignPage.prototype._clearHoverTimeout=function(){if(this._hoverTimeout){clearTimeout(this._hoverTimeout);this._hoverTimeout=null;
6833}};zfl_AlbumDesignPage.prototype._updateTextLines=function(){var isEmpty=true;this.$('.ad-cover-text INPUT').each(function(){var $this=$(this),value=$.trim($this.val());if(value){isEmpty=false;
6834}$this.attr('data-setting-value',value);});};zfl_AlbumDesignPage.prototype._addOrUpdateDesignFee=function(){if(this._updatingDesignFee){return;}var self=this,settings={};var settingElementSelectors=['.ad-cover-type-step .ad-small-preview.selected:first',
6835'.ad-cover-type-step .ad-color-type.selected:first','.ad-cover-type-step .ad-cover-text INPUT','.ad-design-style-step .ad-small-preview.selected:first','.ad-skip-selection-list:first'].join(',');
6836this.$(settingElementSelectors).each(function(){var $this=$(this);settings[$this.attr('data-setting-code')]=$this.attr('data-setting-value');});this._updatingDesignFee=true;
6837this._updateButton.togglePending(true);this._zenbar.addOrUpdateZookbindersDesignFee(settings,this._editMode?'UpdateZookbindersDesignFee':'AddZookbindersDesignFeeToCart',
6838function(){self._updatingDesignFee=false;self._updateButton.togglePending(false);});};;function zfl_AlbumSelectionPage(id,global,local){zfl_Layout.prototype.constructor.call(this,
6839id,global,local);var self=this;$(window).resize(function(){self._update_controls();});if(local.iframeMode){$('BODY').css('overflow','auto');}else{$('BODY, .cv-right-panel').css('overflow-y',
6840'hidden');}if(local.iframeTestUrl){;}$(function(){if(local.iframeMode){$('.zenbar, .hdr-outer, .menubar-outer').hide();$('HTML, BODY').css('background','#bfbfbf');
6841}self._update_controls();});}zfl_AlbumSelectionPage.inherits(zfl_Layout);zfl_AlbumSelectionPage.prototype._update_controls=function(){var $layout=this.$().closest('.layout'),occupiedHeight=zf_stdExtractPixels($layout.css('padding-top'))+zf_stdExtractPixels($layout.css('padding-bottom'))+Zenfolio.Global.DomHelpers.getVisitorViewHeadersHeight();
6842var hasHorizontalScrollBar;if(this.customizer){hasHorizontalScrollBar=this.customizer.rightPanelScrollVisible();}else{hasHorizontalScrollBar=$('BODY').width()>$(window).width();
6843}if(hasHorizontalScrollBar){occupiedHeight+=$.getScrollbarWidth();}this.$('IFRAME').height(($('.cv-right-panel').height()||window.innerHeight)-occupiedHeight);};
6844zfl_AlbumSelectionPage.prototype._addToCart=function(){var $content=this.$('.as-iframe-content'),$status=$content.children('P:first'),$textArea=$content.children('TEXTAREA:first'),vendorOrderId=$content.children('INPUT:first').val(),
6845itemsXml=$.trim($textArea.val()),isReorder=$.trim($content.find('#is-reorder').val()),zfDesignRefId=$.trim($content.find('#zf-design-ref-id').val());if($status.data('executing')){return;
6846}if(!itemsXml){$textArea.val('REQUIRED!');return;}$status.text('EXECUTING...').data('executing',true);zf_stdServerRequestEx('POST','/zf/layout/albumselection/zookbinders.asmx',
6847'CallPartnerAddItemsToCart',[vendorOrderId,zfDesignRefId,isReorder,itemsXml],function(result,error){if(error){$status.data('executing',false);$status.text(error.message||'UNKNOWN ERROR');
6848return;}$status.text('REDIRECTING TO CART...');window.top.location.href=result;});};;function zfl_Expiration(id,pageId,animate){zfl_Control.prototype.constructor.call(this,
6849id);this._pageId=pageId;this._animate=animate;this._session=zfl_SessionCookie.current.sessionKey;zf_stdAttachEvent(window,"load",this.closure(this._window_onload));
6850this.$(".expires-close").click(this.closure(this._close_onclick));}zfl_Expiration._globalKey="layout.expiration.suppress";zfl_Expiration._sessionKey="layout.expiration.suppress.session";zfl_Expiration.inherits(zfl_Control);
6851zfl_Expiration.prototype._show=function(){if(this._animate){this.$dom().delay(500).animate({bottom:0},{duration:1500});}else{this.$dom().css({bottom:0});}};zfl_Expiration.prototype._window_onload=function(){var glist=zf_storage.getItem(zfl_Expiration._globalKey);
6852glist=!!glist?glist.split(','):[];var slist=zf_storage.getItem(zfl_Expiration._sessionKey);slist=!!slist?slist.split(':'):[];slist=(slist.length==2&&slist[0]==this._session)?slist[1].split(','):[];
6853var list=glist.concat(slist);if($.inArray(this._pageId,list)==-1)this._show();};zfl_Expiration.prototype._close_onclick=function(){var list;var again=!!this.$(".expires-check input").prop("checked");
6854if(!again){list=zf_storage.getItem(zfl_Expiration._globalKey);list=!!list?list.split(','):[];list.push(this._pageId);zf_storage.setItem(zfl_Expiration._globalKey,
6855list.join(','));}else{list=zf_storage.getItem(zfl_Expiration._sessionKey);list=!!list?list.split(':'):[];list=(list.length==2&&list[0]==this._session)?list[1].split(','):[];
6856list.push(this._pageId);zf_storage.setItem(zfl_Expiration._sessionKey,this._session+':'+list.join(','));}zf_stdRemoveCookie("zf_ren");this.$dom().hide();};;function zfl_WaitingNotice(id,
6857maxLoadingCount){var self=this;self._closedByUser=false;self._failedImages=[];zfl_Control.prototype.constructor.call(this,id);$(".waiting-close-btn").click(function(){$(".waiting-wrapper").hide();
6858self._closedByUser=true;});function showNoticeMessageIfNeed(){var loadingImages=self._failedImages.length;if(!self._isCustomizePage()&&!self._closedByUser&&loadingImages>maxLoadingCount){$(".waiting-wrapper").show();
6859}}$(window).load(function(){var checkInterval=setInterval(function(){showNoticeMessageIfNeed();if(self._closedByUser){clearInterval(checkInterval);}},3000);});}zfl_WaitingNotice.inherits(zfl_Control);
6860zfl_WaitingNotice.prototype._isCustomizePage=function(){return $("#cv-frame").length>0;};;function zflb_Calendar(id){zfl_Control.prototype.constructor.call(this,id);$(this.closure(this._init));
6861}zflb_Calendar.inherits(zfl_Control);zflb_Calendar.prototype._init=function(){var $currentYear=this.$dom().find(".view .year").last();;this._resizeInvisibleYear($currentYear);var self=this;
6862this.$('a.previous').click(function(){var $currentYearArchive=$(this).closest('.year');self._selectYear($currentYearArchive.prev());return false;});this.$('a.next').click(function(){var $currentYearArchive=$(this).closest('.year');
6863self._selectYear($currentYearArchive.next());return false;});};zflb_Calendar.prototype._resizeInvisibleYear=function($selectedYear){;var selectedArchiveHeight=0;$selectedYear.children().each(function(){selectedArchiveHeight+=$(this).outerHeight();
6864});
6864this.$dom("invisible-year").height(selectedArchiveHeight);};zflb_Calendar.prototype._selectYear=function($selectedYear){$selectedYear.closest('.view').animate({'left':-$selectedYear.position().left},
6865'fast');this._resizeInvisibleYear($selectedYear);};;function zf_ArchiveRestoreInfo(){const elmId='.order-restore-container';this._ownerId=typeof zf_ownerId!=="undefined"?zf_ownerId:zf_userId;
6866this._containerElm=document.querySelector(elmId);this._restoreBtnElm=document.querySelector(elmId+' .restore-button');this._restoreMessageElm=document.querySelector(elmId+' .title-restore');
6867this._strPhotoSetIds=document.querySelector(elmId+' #photoSetIds')?document.querySelector(elmId+' #photoSetIds').value:null;if(this._strPhotoSetIds!=null&&this._ownerId!=null){this.check(this._strPhotoSetIds);
6868this._restoreBtnElm.addEventListener('click',this.handleRestoreClicked.bind(this));}}zf_ArchiveRestoreInfo.prototype.getRestoreStatus=function(strPhotoSetIds,ownerId,callback){;;zf_stdServerRequestEx("GET",
6869"/zf/layout/layout.asmx","IsGalleryRestoring",[strPhotoSetIds,ownerId],callback);};zf_ArchiveRestoreInfo.prototype.restoreGalleries=function(strPhotoSetIds,ownerId,callback){;;zf_stdServerRequestEx("POST",
6870"/zf/layout/layout.asmx","HandleRestoreGalleryByPhotoSetIds",[strPhotoSetIds,ownerId],callback);};zf_ArchiveRestoreInfo.prototype.check=function(strPhotoSetIds){var callback=function(result,
6871error){if(result){if(result.isRestoring){this._restoreBtnElm.textContent='Restoring...';this._restoreBtnElm.classList.add('disabled');this._restoreMessageElm.textContent='Allow at least 12 hours for image retrieval.';
6872}else{this._restoreBtnElm.textContent='Restore';this._restoreBtnElm.classList.remove('disabled');this._restoreMessageElm.textContent='Some images are archived and can be restored.';
6873}this._containerElm.classList.remove("hide");}if(error){throw error;}};this.getRestoreStatus(strPhotoSetIds,this._ownerId,callback.bind(this));};zf_ArchiveRestoreInfo.prototype.handleRestoreClicked=function(){if(this._restoreBtnElm.classList.contains('disabled')){return;
6874}this._restoreBtnElm.classList.add('disabled');var callback=function(result,error){if(result){this._restoreBtnElm.textContent='Restoring...';this._restoreBtnElm.classList.add('disabled');
6875this._restoreMessageElm.textContent='Allow at least 12 hours for image retrieval.';}else{this._restoreMessageElm.textContent='Sorry, an unexpected error has occurred. Please try again later.';
6876this._restoreBtnElm.style.display='none';}if(error){throw error;}};this.restoreGalleries(this._strPhotoSetIds,this._ownerId,callback.bind(this));return;};;var Zenfolio;
6877(function(Zenfolio){var Global;(function(Global){var LayoutService=(function(){function LayoutService(){}LayoutService.registerVisit=function(photo,photoSet,callback){if(!photo||!photoSet){return;
6878}if(zf_zenbar.administrator){return;}var sessionKey=zfl_SessionCookie.current.sessionKey;if(!sessionKey){return;}if(photo.__visit_registered){return;}photo.__visit_registered=true;
6879if(photo.owner&&(photo.owner.id==zf_userId)){return;}if(photo.access&&photo.access.type==zf_AccessType.Password&&!zfl_PasswordManager.check(photo.access.ownerId,
6880photo.access.realmId)){return;}zf_stdServerRequest("GET","/zf/layout/layout.asmx","RegisterVisit",[photoSet.owner.id,photoSet.id,photo.id,photoSet.owner.id,photoSet.id,
6881sessionKey],callback||zf_stdTrue);};LayoutService.createDownloadCommands=function(getOptions,photoDownload,getCommandTest){return{download:{test:function(_id,params){var options=getOptions(),
6882canDownload=!!options.administrator||(!options.photo.video&&(options.photo.access.mask&zf_AccessMask.ProtectOriginals)==0||options.photo.video&&options.fakeVideoOriginals&&options.photo.owner.id==zf_ownerId)||params.download&&options.photo.owner.id==zf_ownerId;
6883if(!canDownload){return false;}var commandTest=getCommandTest();return zfl_DownloadMenu.buildItems(options.photo,commandTest("saveImages",params),$.noop,commandTest).length>0;
6884}},saveImages:{test:function(_id,params){var options=getOptions();return!!options.administrator||params.download&&options.photo.owner.id==zf_ownerId;}},downloadOriginal:{test:function(){var options=getOptions();
6885return!!options.administrator||!options.photo.video&&((options.photo.access.mask&zf_AccessMask.ProtectOriginals)==0)||options.photo.video&&options.fakeVideoOriginals&&options.photo.owner.id==zf_ownerId;
6886},exec:function(){photoDownload.downloadOriginal(getOptions().photo);}},downloadPhoto:{test:"downloadOriginal",exec:"downloadOriginal"},downloadPhoto2:{test:"downloadOriginal",
6887exec:"downloadOriginal"},downloadVideo:{test:function(){return getOptions().fakeVideoOriginals;},exec:"downloadOriginal"},downloadGallery:{test:function(){var options=getOptions();
6888return options.photoSet&&options.photoSet.type==zf_PhotoSet.Gallery;},exec:function(){var options=getOptions();photoDownload.downloadOriginals(options.photoSet.title,
6889options.photoList,options.photoSet);}},downloadCollection:{test:function(){var options=getOptions();return options.photoSet&&options.photoSet.type==zf_PhotoSet.Collection;
6890},exec:"downloadGallery"}};};return LayoutService;}());Global.LayoutService=LayoutService;})(Global=Zenfolio.Global||(Zenfolio.Global={}));})(Zenfolio||(Zenfolio={}));
6891var Zenfolio;(function(Zenfolio){var Global;(function(Global){var QuickShopManager=(function(){function QuickShopManager(){}QuickShopManager.isEnabled=function(photo){return zf_zenbar.newShoppingEnabled&&photo.priceKey;
6892};QuickShopManager.isVisible=function(){return $("BODY").hasClass("qs-visible");};QuickShopManager.show=function(options){var _this=this;;if(QuickShopManager.isVisible()){return;
6893}var $overlay=this._init(options);$(window).trigger("refreshCvv");
6893if(this._resourcesLoaded){this._displaySlideshow($overlay,options);return;}var pendingTimeout=setTimeout(function(){$overlay.append($('<div class="qs-spinner"><div class="qs-spinner__icon"></div></div>'));
6894},100);Global.ResourceService.waitAll([function(callback){return _this._loadScripts(callback);},function(callback){return _this._loadPanel(options,callback);},function(callback){return _this._loadComments(options,
6895callback);},function(callback){return _this._loadShare(options,callback);}],function(){clearTimeout(pendingTimeout);_this._resourcesLoaded=true;_this._displaySlideshow($overlay,
6896options);});};QuickShopManager.dispose=function(){$(".qs-overlay").remove();$('meta[name="viewport"]').attr("content",this._viewportContent);var $body=$("BODY").removeClass("qs-visible qs-over-scrapbook");
6897Global.DomHelpers.restoreDocumentStyles(this._documentStyles);zfl_PhotoList.requests.resumeAll();zf_PhotoLoader.resumeAll();$body.trigger("recalc.Layout",[false]);
6898};QuickShopManager.getBackgroundColor=function(options){return options.quickShopParameters["background"].replace("0x","#");};QuickShopManager.hasDarkBackgroundColor=function(options){var parameters=options.quickShopParameters,
6899background=parameters["background"];return eval(parameters["qs_background_colors"]).indexOf(background)<=4;};QuickShopManager._init=function(options){this._documentStyles=Global.DomHelpers.saveDocumentStyles();
6900var $viewport=$('meta[name="viewport"]');this._viewportContent=$viewport.attr("content");$viewport.attr("content","width=device-width, initial-scale=1.0, maximum-scale=1.0");
6901var $body=$("BODY").addClass("qs-visible").css("background",this.getBackgroundColor(options));zfl_PhotoList.requests.pauseAll();zf_PhotoLoader.pauseAll();if(options.fromScrapbook){$body.addClass("qs-over-scrapbook");
6902}$(window).scrollTop(0);return $('<div class="qs-overlay"></div>').addClass(this.hasDarkBackgroundColor(options)?"qs-overlay-dark":"qs-overlay-light").appendTo($body);
6903};QuickShopManager._displaySlideshow=function($overlay,options){options.$commentsBrowser=this._$commentsBrowser;options.$sharePopup=this._$sharePopup;this.qsSlideshow.display($overlay,
6904options);};QuickShopManager._loadScripts=function(onComplete){Global.ResourceService.waitAll([function(callback){return Global.ResourceService.loadScripts(["configurator.js"],
6905callback);},function(callback){return Global.ResourceService.loadScripts(["common.js"],function(){return Global.ResourceService.loadScripts(["quickshop.js"],callback);
6906});}],onComplete);};QuickShopManager._loadPanel=function(options,callback){if(options.quickShopParameters["qs_mode"]==QuickShopMode.ShopOnly.toString()){callback();
6907return;}Global.ResourceService.loadControl({name:"GetPanelMarkup",args:[zf_ownerId,!!zf_stdParseQueryString("customize")],url:"/zf/layout/quickshop/quickshop.asmx",
6908method:"POST"},function($element){return $element&&callback();});};QuickShopManager._loadComments=function(options,callback){var _this=this;if(options.quickShopParameters["qs_comments"]!="1"){callback();
6909return;}Global.ResourceService.loadControl({name:"GetCommentsMarkup2",args:[zf_ownerId,zf_isCertificateValid,options.photoList.length],url:"/zf/layout/quickshop/quickshop.asmx",
6910method:"POST"},function($element){if($element){_this._wrapDialog($element,"qs-comments-wrapper");_this._$commentsBrowser=$element;var recaptchaUrl_1="https://www.google.com/recaptcha/enterprise.js?onload=zf_CaptchaCallback&render=explicit";
6911if($("HEAD SCRIPT[src=\""+recaptchaUrl_1+"\"]").length==0){$(document).ready(function(){$.getScript(recaptchaUrl_1);});}else{zf_CaptchaCallback();}callback();}});
6912};QuickShopManager._loadShare=function(options,callback){var _this=this;var parameters=options.quickShopParameters;if(options.hideShare||parameters["qs_share"]!="1"){callback();
6913return;}Global.ResourceService.loadControl({name:"GetShareMarkup2",args:[zf_ownerId,zf_isCertificateValid,{"share-facebook":parameters["qs_share_facebook"],"share-twitter":parameters["qs_share_twitter"],
6914"share-pinterest":parameters["qs_share_pinterest"],"share-embed-photos":parameters["qs_share_embed_photos"],"share-embed-vi
6914deos":parameters["qs_share_embed_videos"],
6915"share-embed-bbcode":parameters["qs_share_embed_bbcode"]}],url:"/zf/layout/quickshop/quickshop.asmx",method:"POST"},function($element){if($element){_this._wrapDialog($element,
6916"qs-share-wrapper");_this._$sharePopup=$element;callback();}});};QuickShopManager._wrapDialog=function($dialog,dialogClass){$("<div class=\"qs-dialog-wrapper "+dialogClass+"\"></div>").append($dialog.detach()).appendTo($("BODY"));
6917};return QuickShopManager;}());Global.QuickShopManager=QuickShopManager;var QuickShopMode;(function(QuickShopMode){QuickShopMode[QuickShopMode["QuickShopOnly"]=56]="QuickShopOnly";
6918QuickShopMode[QuickShopMode["ShopOnly"]=57]="ShopOnly";QuickShopMode[QuickShopMode["QuickShopAndShop"]=58]="QuickShopAndShop";})(QuickShopMode=Global.QuickShopMode||(Global.QuickShopMode={}));
6919})(Global=Zenfolio.Global||(Zenfolio.Global={}));})(Zenfolio||(Zenfolio={}));var Zenfolio;(function(Zenfolio){var Global;(function(Global){var StyleExtractor=(function(){function StyleExtractor(){this._properties=[];
6920}StyleExtractor.prototype.addProperty=function(name,selector,cssPropertyName){this._properties.push({name:name,selector:selector,cssPropertyName:cssPropertyName});
6921};StyleExtractor.prototype.extract=function($element){var values={};$("BODY").append($element);for(var _i=0,_a=this._properties;_i<_a.length;_i++){var prop=_a[_i];
6922var $propEl=prop.selector?$element.find(prop.selector):$element;values[prop.name]=$propEl.css(prop.cssPropertyName);}$element.remove();return values;};return StyleExtractor;
6923}());Global.StyleExtractor=StyleExtractor;})(Global=Zenfolio.Global||(Zenfolio.Global={}));})(Zenfolio||(Zenfolio={}));var Zenfolio;(function(Zenfolio){var Global;(function(Global){var ProductPopupLoader=(function(){function ProductPopupLoader(){}ProductPopupLoader.showForAddToCart=function(options){this._load(function(){Zenfolio.Shopping.ProductPopupManager.showForAddToCart(options);
6924});};ProductPopupLoader.showForEditFromCart=function(options){this._load(function(){Zenfolio.Shopping.ProductPopupManager.showForEditFromCart(options);});};ProductPopupLoader._load=function(show){var _this=this;
6925var onload=function(){Global.DomHelpers.toggleLoadingOverlay(false);show();};if(this._productPopupLoaded){onload();}else{Global.DomHelpers.toggleLoadingOverlay(true);
6926Global.ResourceService.waitAll([function(callback){return Global.ResourceService.loadScripts(["configurator.js"],callback);},function(callback){return Global.ResourceService.loadScripts(["common.js"],
6927function(){return Global.ResourceService.loadScripts(["shopping.js"],callback);});},function(callback){return Global.ResourceService.loadControl({name:"GetProductPopupMarkup",
6928url:"/zf/layout/shopping/shopping.asmx",method:"POST"},callback);},function(callback){return Global.ResourceService.loadStyleSheets(["core/common.css","layout/shopping.css"],
6929callback);}],function(){_this._productPopupLoaded=true;onload();});}};return ProductPopupLoader;}());Global.ProductPopupLoader=ProductPopupLoader;})(Global=Zenfolio.Global||(Zenfolio.Global={}));
6930})(Zenfolio||(Zenfolio={}));var Zenfolio;(function(Zenfolio){var Global;(function(Global){var ShoppingUrlManager=(function(){function ShoppingUrlManager(){}ShoppingUrlManager.pageUrl=function(pageParams,
6931full){if(full===void 0){full=true;}switch(pageParams.pageType){case Global.ShoppingPageType.Home:return this._home(pageParams,full);case Global.ShoppingPageType.Category:return this._category(pageParams,
6932full);case Global.ShoppingPageType.Product:return this._product(pageParams,full);case Global.ShoppingPageType.Packages:return this._packages(pageParams,full);case Global.ShoppingPageType.Cart:return this._cart(pageParams,
6933full);default:;return null;}};ShoppingUrlManager._addParamsToUrl=function(url,keys,pageParams){for(var _i=0,keys_1=keys;_i<keys_1.length;_i++){var key=keys_1[_i];
6934var params={};params[key]=(pageParams?pageParams[key]:zf_stdParseQueryString(key))||null;url=$.updateQueryString(params,url);}return url;};ShoppingUrlManager._finishUrl=function(url,
6935pageParams,full){url=this._addParamsToUrl(url,["token"],pageParams);url=this._addParamsToUrl(url,["customize","debug"]);if(full){url=Global.TransferHandler.getUserDomainUrl(url);
6936}return url;};ShoppingUrlManager._home=function(pageParams,full){return this._finishUrl("/shop/home",pageParams,full);};ShoppingUrlManager._category=function(pageParams,
6937full){var url="/shop/category/"+encodeURIComponent(pageParams.categoryId);if(pageParams.subcategoryId){url+="/"+encodeURIComponent(pageParams.subcategoryId);}url=this._addParamsToUrl(url,
6938["dg","ts"],pageParams);return this._finishUrl(url,pageParams,full);};ShoppingUrlManager._product=function(pageParams,full){return this._finishUrl(this._addParamsToUrl("/shop/product",
6939["categoryId","vendorId","productId","designId","ecommerceList"],pageParams),pageParams,full);};ShoppingUrlManager._packages=function(pageParams,full){return this._finishUrl("/shop/packages",
6940pageParams,full);};ShoppingUrlManager._cart=function(pageParams,full){return this._finishUrl("/cart.html",pageParams,full);};return ShoppingUrlManager;}());Global.ShoppingUrlManager=ShoppingUrlManager;
6941})(Global=Zenfolio.Global||(Zenfolio.Global={}));})(Zenfolio||(Zenfolio={}));var __zfl_end_parsing=new Date().getTime();;var __zfl_fallback=setTimeout(function(){var $pageFrame=document.getElementById('page-frame');
6942$pageFrame&&($pageFrame.className+=' show');__zfl_fallback=undefined;},7000);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.