﻿
/* Copyright (C) 2004-2008 Zenfolio, Inc. All rights reserved. */
; var __zfl_start = new Date().getTime();           
/*jsl:ignoreall*/
/*!
 * jQuery JavaScript Library v1.4.2
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Sat Feb 13 22:33:48 2010 -0500
 */
(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.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".split(" "),
function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);


       
/*jsl:ignoreall*/
/*
 * jQuery Color Animations
 * Copyright 2007 John Resig
 * Released under the MIT and GPL licenses.
 */

/*(function(jQuery){

	// We override the animation for all of these color styles
	jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
		jQuery.fx.step[attr] = function(fx){
			if ( fx.state == 0 ) {
				fx.start = getColor( fx.elem, attr );
				fx.end = getRGB( fx.end );
			}

			fx.elem.style[attr] = "rgb(" + [
				Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
				Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
				Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
			].join(",") + ")";
		}
	});

	// Color Conversion functions from highlightFade
	// By Blair Mitchelmore
	// http://jquery.offput.ca/highlightFade/

	// Parse strings looking for color tuples [255,255,255]
	function getRGB(color) {
		var result;

		// Check if we're already dealing with an array of colors
		if ( color && color.constructor == Array && color.length == 3 )
			return color;

		// Look for rgb(num,num,num)
		if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
			return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];

		// Look for rgb(num%,num%,num%)
		if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
			return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];

		// Look for #a0b1c2
		if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
			return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];

		// Look for #fff
		if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
			return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];

		// Otherwise, we're most likely dealing with a named color
		return colors[jQuery.trim(color).toLowerCase()];
	}
	
	function getColor(elem, attr) {
		var color;

		do {
			color = jQuery.curCSS(elem, attr);

			// Keep going until we find an element that has color, or we hit the body
			if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") )
				break; 

			attr = "backgroundColor";
		} while ( elem = elem.parentNode );

		return getRGB(color);
	};
	
	// Some named colors to work with
	// From Interface by Stefan Petre
	// http://interface.eyecon.ro/

	var colors = {
		aqua:[0,255,255],
		azure:[240,255,255],
		beige:[245,245,220],
		black:[0,0,0],
		blue:[0,0,255],
		brown:[165,42,42],
		cyan:[0,255,255],
		darkblue:[0,0,139],
		darkcyan:[0,139,139],
		darkgrey:[169,169,169],
		darkgreen:[0,100,0],
		darkkhaki:[189,183,107],
		darkmagenta:[139,0,139],
		darkolivegreen:[85,107,47],
		darkorange:[255,140,0],
		darkorchid:[153,50,204],
		darkred:[139,0,0],
		darksalmon:[233,150,122],
		darkviolet:[148,0,211],
		fuchsia:[255,0,255],
		gold:[255,215,0],
		green:[0,128,0],
		indigo:[75,0,130],
		khaki:[240,230,140],
		lightblue:[173,216,230],
		lightcyan:[224,255,255],
		lightgreen:[144,238,144],
		lightgrey:[211,211,211],
		lightpink:[255,182,193],
		lightyellow:[255,255,224],
		lime:[0,255,0],
		magenta:[255,0,255],
		maroon:[128,0,0],
		navy:[0,0,128],
		olive:[128,128,0],
		orange:[255,165,0],
		pink:[255,192,203],
		purple:[128,0,128],
		violet:[128,0,128],
		red:[255,0,0],
		silver:[192,192,192],
		white:[255,255,255],
		yellow:[255,255,0]
	};
	
})(jQuery);
*/

; function _zf_stdTrapError(message, url, line) { try { zf_stdServerRequest("POST", "/zf/core/core.asmx",
"ReportError", [ message.toString(), location.href, url, line ]); } catch (e) { } return true; }
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", "_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)"); return; } } this._debugWindow.document.writeln('<html><head><style type="text/css">');
this._debugWindow.document.writeln("BODY { font: 9pt 'Lucida Console', 'Courier New'; margin: 4px; }");
this._debugWindow.document.writeln("P { background: #F0F0F0; margin: 0px 0px 1px 0px; }"); this._debugWindow.document.writeln("</style></head><body></body></html>");
this.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, arguments[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; while (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; var message
= [ "<p>[", s, ".", ms, "] ", format, "</p>" ].join(""); this._debugWindow.document.body.innerHTML
+= message; this._debugWindow.scrollTo(0, 10000000); }; zf_debug = new zf_Debug(); function 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, 512);
message = "Assertion failed in " + context; } else { message = "Assertion (" + exprQuote + ") failed.";
} if (fileName == null) fileName = "<unknown>"; if (lineNumber == null) lineNumber = 0; zf_stdServerRequest("POST",
"/zf/core/core.asmx", "ReportError", [ message, document.location.href, fileName, lineNumber ]);
} } function zf_log(format) { zf_Debug.prototype.log.apply(zf_debug, arguments); }
; function zf_stdNoArgs(args) { return args.length == 1 && args[0] == zf_stdNoArgs; } function zf_stdTrue()
{ return true; } function zf_stdFalse() { return false; } function 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]; } return dest; } function zf_stdShallowCopy(dest, src) { for (var
field in src) { dest[field] = src[field]; } 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];
} } } this.prototype.constructor = this; };
; function zf_stdGetEvent(e) { if (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; else if (e.preventDefault)
e.preventDefault(); } function zf_stdAttachEvent(dom, evt, handler) { if (typeof(dom) == "string")
dom = document.getElementById(dom); if (dom.attachEvent) dom.attachEvent("on" + evt, handler);
else if (dom.addEventListener) dom.addEventListener(evt, handler, false); } function zf_stdDetachEvent(dom,
evt, handler) { if (typeof(dom) == "string") dom = document.getElementById(dom); if (dom.detachEvent)
dom.detachEvent("on" + evt, handler); else if (dom.removeEventListener) dom.removeEventListener(evt,
handler, 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;
return null; } function zf_stdIsLeftButton(e) { e = zf_stdGetEvent(e); var left; left = 0; return (e.button
== null || e.button == left); } 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; else return this.domEvent.target; }; zf_Event.prototype.getSourceWithTag
= function(tagName) { var domSource = this.getSource(); while (domSource != null && domSource.tagName
!= tagName) domSource = domSource.parentNode; return domSource; }; zf_Event.prototype.getSourceWithClass
= function(tagClass) { var domSource = this.getSource(); while (domSource != null && domSource.className
!= tagClass) domSource = domSource.parentNode; return domSource; }; zf_Event.prototype.stopPropagation
= function() { if (window.event) this.domEvent.cancelBubble = true; else if (this.domEvent.stopPropagation)
this.domEvent.stopPropagation(); }; 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, decimalDigits)
{ if (decimalDigits == null) decimalDigits = this.numberDecimalDigits; var numStr = zf_NumberFormat._formatNumber(Math.abs(num),
decimalDigits, this.numberDecimalSeparator, this.numberGroupSizes, this.numberGroupSeparator);
if (num < 0) { var pattern = zf_NumberFormat._negNumberPatterns[this.numberNegativePattern]; if (!pattern)
pattern = zf_NumberFormat._negNumberPatterns[0]; return 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]; } else if (amount >= 0) { pattern = zf_NumberFormat._posCurrencyPatterns[this.currencyPositivePattern];
if (!pattern) pattern = zf_NumberFormat._posCurrencyPatterns[0]; } else { amount = -amount; pattern
= zf_NumberFormat._negCurrencyPatterns[this.currencyNegativePattern]; if (!pattern) pattern = zf_NumberFormat._negCurrencyPatterns[0];
} var numStr = zf_NumberFormat._formatNumber(amount, this.currencyDecimalDigits, this.currencyDecimalSeparator,
this.currencyGroupSizes, this.currencyGroupSeparator); var symbol = currency ? currency.symbol : '';
return zf_stdFormatString(pattern, this.negativeSign, symbol, numStr).replace(/^\s+|\s+$/g, '');
}; zf_NumberFormat._formatNumber = function(num, decimalDigits, decimalSeparator, groupSizes, groupSeparator)
{ groupSizes = groupSizes.concat(); var result = []; var numStr = num.toFixed(decimalDigits); var
pos = numStr.lastIndexOf('.'); if (pos < 0) pos = numStr.length; else result.unshift(decimalSeparator,
numStr.substring(pos + 1)); var 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,
pos)); 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('');
}; 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}', '{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}', '{1} {2}', '{2} {1}' ]; function zf_stdFormatEditableDecimal(val, numDecimals)
{ var format = zf_NumberFormat.current; if (numDecimals === undefined) numDecimals = 6; var res
= val.toFixed(numDecimals); if(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, ''); 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 + ")"), ".")); } 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)); } return undefined; } function zf_stdFormatEditableInteger(val)
{ return parseInt(val, 10).toFixed(0); } function zf_stdParseEditableInteger(val) { if (!new RegExp("^-?\\d+$").test(val))
{ return NaN; } return parseInt(val); } function zf_stdCheckEditableInteger(val) { if (isNaN(zf_stdParseEditableInteger(val)))
{ return zf_stdFormatString("Please use the correct integer format (e.g. {0})", zf_stdFormatEditableInteger(42));
} return undefined; }
; function zf_stdTrim(str) { var re = /^\s*(\S?[\s\S]*?)\s*$/; re.exec(str); return RegExp.$1; }
function zf_stdFormatString(format) { var args = arguments; for (var i = 1; i < arguments.length;
i++) { var re = new RegExp("\\{" + (i - 1) + "\\}", "g"); format = format.replace(re, args[i]);
} return format; } var zf_stdCompareString = ("".localeCompare) ? function(a, b) { 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; sign = 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";
break; 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; if (scale > 1) { value /= scale; decimalDigits = value < 10 ? 2 : 1; } if (sign) value = -value;
return zf_stdFormatString(format, zf_NumberFormat.current.formatNumber(value, decimalDigits)); }
function zf_stdInsertBreakHints(text) { 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 == '-') { var spaceIndex = text.lastIndexOf(' ', i);
if (spaceIndex == -1 || i - spaceIndex >= 10) { res += String.fromCharCode(0x200B); } } } text = res;
return text; } function zf_stdIsValidEmail(email) { return (/^[\w-\.]+@([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,6}$/.test(email))
|| (/^[\w-\.]+@\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\]$/.test(email)); }
; var _zf_stdMonthNames = [ "January", "February", "March", "April", "May", "June", "July", "August",
"September", "October", "November", "December" ]; function zf_stdFormatDate(date) { if (date == null)
return null; var yr = date.getFullYear() % 100; var mo = _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, seconds) { if (date == null) return null; var yr = date.getFullYear() %
100; var mo = _zf_stdMonthNames[date.getMonth()].substr(0, 3); var dt = date.getDate(); var hh = date.getHours();
var mm = 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; s += ":" + ss; } return s; } function zf_stdFormatTime(date, seconds)
{ if (date == null) return null; var hh = date.getHours(); var mm = 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, seconds)
{ if (date == null) return null; var t = new Date(); var y = new Date(t); y.setDate(t.getDate()
- 1); var format = null; if (date.getFullYear() == t.getFullYear() && date.getMonth() == t.getMonth()
&& date.getDate() == t.getDate()) { format = "Today, {0}"; } else if (date.getFullYear() == y.getFullYear()
&& date.getMonth() == y.getMonth() && date.getDate() == y.getDate()) { format = "Yesterday, {0}";
} if (!format) return zf_stdFormatDateTime(date, seconds); var hh = date.getHours(); var mm = 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 zf_stdFormatString(format,
s); } 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?/;
regExp.exec(value); var yr = parseInt(RegExp.$1, 10); var mo = parseInt(RegExp.$2, 10) - 1; var
dt = parseInt(RegExp.$3, 10); var hh = parseInt(RegExp.$4, 10); var mm = parseInt(RegExp.$5, 10);
var ss = parseInt(RegExp.$6, 10); 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?/;
regExp.exec(value); var yr = parseInt(RegExp.$1, 10); var mo = parseInt(RegExp.$2, 10) - 1; var
dt = parseInt(RegExp.$3, 10); var hh = parseInt(RegExp.$4, 10); var mm = parseInt(RegExp.$5, 10);
var ss = parseInt(RegExp.$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;
var 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"; else 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, nSec); }
; function zf_stdHtmlEncode(text) { return text.replace(/\&/g, "&amp;") .replace(/\</g, "&lt;")
.replace(/\>/g, "&gt;") .replace(/\n/g, "<br/>") .replace(/\r/g, ""); } function zf_stdHtmlDecode(text)
{ return text.replace(/\<\/?br\/?\>/g, "\n") .replace(/\&amp;/g, "&") .replace(/\&lt;/g, "<") .replace(/\&gt;/g,
">"); } 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"); } 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; } else { while (dom.firstChild != null) dom.removeChild(dom.firstChild);
dom.appendChild(document.createTextNode(text)); } } function zf_stdGetText(dom) { if (typeof(dom)
== "string") dom = document.getElementById(dom); if (dom.innerText) return dom.innerText; else if
(dom.textContent) return dom.textContent; else if (dom.firstChild != null) return dom.firstChild.nodeValue;
else return ""; } function zf_stdSetValue(element, value) { if (typeof(element) == "string") element
= document.getElementById(element); if (element != null) element.value = value; } function zf_stdGetValue(element)
{ if (typeof(element) == "string") element = document.getElementById(element); return (element !=
null) ? element.value : ""; } function zf_stdGetClientWidth() { if (document.documentElement) return document.documentElement.clientWidth;
else if (window.innerWidth) return window.innerWidth; else return 1024; } function zf_stdGetClientHeight()
{ if (document.documentElement) return document.documentElement.clientHeight; else 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);
return { cx : elemOffset.cx - parentOffset.cx, cy: elemOffset.cy - parentOffset.cy }; } if (typeof(elem)
== "string") elem = document.getElementById(elem); var cx = 0, cy = 0; for (var obj = elem; obj !=
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; cx = 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; cx = document.documentElement.scrollLeft; } return {
cx : cx, cy : cy }; }
; function zf_stdReplaceClassName(elem, remove, add) { if (remove == add) return; if (typeof(elem)
== "string") elem = document.getElementById(elem); if (elem == null) return; var classNames = elem.className.split(" ");
var removeAt = -1; var 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, 1); updated = true; } if (foundAt == -1 && add != null) {
classNames.push(add); updated = true; } if (updated) { classNames.sort(); elem.className = classNames.join(" ");
} } function zf_stdHasClassName(elem, className) { 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(" "); for (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; var style = "0px"; if (obj.currentStyle)
style = obj.currentStyle[styleProperty]; else { style = document.defaultView.getComputedStyle(obj,
null); if (style != null) style = style.getPropertyValue(styleCss); } return style; } function zf_stdExtractPixels(value)
{ if (value == null || value.indexOf("px") == -1) return 0; return parseInt(value.substr(0, value.length
- 2), 10); } function zf_stdGetHeightAbove(obj) { return zf_stdExtractPixels( zf_stdGetCurrentStyle(obj,
'padding-top', 'paddingTop')) + zf_stdExtractPixels( zf_stdGetCurrentStyle(obj, 'border-top-width',
'borderTopWidth')) + zf_stdExtractPixels( zf_stdGetCurrentStyle(obj, 'margin-top', 'marginTopWidth'));
} function zf_stdGetHeightBelow(obj) { return zf_stdExtractPixels( zf_stdGetCurrentStyle(obj, 'padding-bottom',
'paddingBottom')) + zf_stdExtractPixels( zf_stdGetCurrentStyle(obj, 'border-bottom-width', 'borderBottomWidth'))
+ zf_stdExtractPixels( zf_stdGetCurrentStyle(obj, 'margin-bottom', 'marginBottomWidth')); } function
zf_stdGetHeightOverall(obj) { var cyHeight = obj.offsetHeight; if (typeof(cyHeight) != "number")
cyHeight = 0; return cyHeight + zf_stdExtractPixels( zf_stdGetCurrentStyle(obj, 'margin-top', 'marginTop'))
+ zf_stdExtractPixels( zf_stdGetCurrentStyle(obj, 'margin-bottom', 'marginBottom')); }
; function zf_stdSetCookie(name, value, expire, noescape, specificHost) { if (!noescape) value = escape(value);
var cookie = name + "=" + value + ";path=/"; var hostname = document.location.hostname; if (!specificHost
&& hostname.length > zf_defaultDomain.length && hostname.lastIndexOf(zf_defaultDomain) == hostname.length
- zf_defaultDomain.length) cookie += ";domain=" + zf_defaultDomain.substr(1); if (expire != null)
cookie += ";expires=" + expire.toGMTString(); document.cookie = cookie; } 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(";", start)) == -1) end = cookie.length;
return unescape(cookie.substring(start, end)); } function zf_stdRemoveCookie(name, specificHost)
{ var expires = new Date(); expires.setFullYear(expires.getFullYear() - 1); zf_stdSetCookie(name,
"", expires, true, specificHost); } function zf_stdGetTransferUrl(target) { var k = target.indexOf("://");
; var n = target.indexOf("/", k + 3); ; var schema = target.substring(0, k + 1); var host = target.substring(k
+ 3, n); var path = target.substr(n); if ((k = host.indexOf(":")) != -1) host = host.substring(0,
k); var i = host.lastIndexOf(zf_defaultDomain); var j = location.host.lastIndexOf(zf_defaultDomain);
var defaultTarget = i != -1 && i + zf_defaultDomain.length == host.length; var defaultOrigin = j !=
-1 && j + zf_defaultDomain.length == location.host.length; if (location.protocol == schema) { if
(host == location.host) return path; if ((defaultOrigin && defaultTarget)) return target; } if (schema
== "https") host = "s"; else if (host == zf_defaultHost) host = "z"; else if (host == location.host)
host = "-"; else if (defaultTarget) host = host.substr(0, host.length - zf_defaultDomain.length);
if (path == "/") path = ""; return [ "/zf/transfer/", host, path ].join(""); } function _zf_stdSetTimezoneOffset()
{ var expires = new Date(); expires.setFullYear(expires.getFullYear() + 10); zf_stdSetCookie("zf_10y_tz",
-(new Date().getTimezoneOffset()), expires); }
; function zf_stdCreateXMLHttpRequest() { if (window.XMLHttpRequest) return new XMLHttpRequest();
else return new ActiveXObject("Microsoft.XMLHTTP"); } function zf_stdServerRequest(method, url,
api, params, callback) { ; ; ; var request = zf_stdCreateXMLHttpRequest(); request.onreadystatechange
= function() { if (request.readyState != 4) return; if (callback != null) { var retVal = null;
if (request.status == 200) { retVal = request.responseText; retVal = "return _zf_stdTransformResponse("
+ retVal + ")"; retVal = new Function(retVal)(); } else if (request.status == 0) { return; } callback(request.status,
retVal); } }; 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]); } } body = _zf_stdJsonSerialize(body).join(""); if (method == "GET")
{ url += "?request=" + encodeURIComponent(body); body = null; } request.open(method, url, true);
if (method == "POST") request.setRequestHeader("Content-Type", "application/json"); request.send(body);
} function zf_stdServerRequestEx(method, url, api, params, callback) { zf_stdServerRequest(method,
url, api, params, function(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."
}; } else { result = retVal.result; error = retVal.error; } if (callback) callback(result, error);
}); } function _zf_stdJsonSerialize(val) { var json = []; var i; var 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), '"'); 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(","); 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()); break; case "string": json.push('"', _zf_stdJsonEncode(v),
'"'); break; case "object": json = json.concat(_zf_stdJsonSerialize(v)); break; default: ; json.push("null");
break; } } json.push("]"); break; } if (val.constructor == Date) { json.push('{"$type":"Date","value":"',
val.toUTCString(), '"}'); break; } json.push("{"); i = 0; for (var prop in val) { v = val[prop];
if (prop != "prototype" && typeof(v) != "function") { if (i > 0) json.push(","); json.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());
break; case "string": json.push('"', _zf_stdJsonEncode(v), '"'); break; case "object": json = json.concat(_zf_stdJsonSerialize(v));
break; default: ; json.push("null"); break; } i++; } } json.push("}"); break; default: ; json.push("null");
break; } return json; } function _zf_stdJsonEncode(text) { text = text.replace(/([\\\x22])/g, "\\$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; if (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); } return val; } var metaDate = val["$date"]; if (metaDate != null) return zf_stdParseDateTimeUTC(metaDate);
var metaRoot = val["$root"]; if (metaRoot != null) { return _zf_stdTransformResponse(metaRoot, val["$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,
objects, metas); } var metaType = val["$type"]; if (metaType == "DateTime") return zf_stdParseDateTimeUTC(val["Value"]);
var obj = val; if (metaType != null) { obj = _zf_stdCreateInstance(metaType); } var propName; var
propVal; for (propName in val) { if (propName.charAt(0) != "$") { propVal = val[propName]; if (typeof(propVal)
== "object") propVal = _zf_stdTransformResponse(propVal, objects, metas); obj[propName] = propVal;
} } if (obj.postSerialize) obj.postSerialize(); return obj; } var _$ = _zf_stdTransformResponse;
function _zf_stdCreateInstance(className) { var type = className; if (className.indexOf("zf") != 0)
type = "zf_" + type; ; var obj = new Function("return typeof(" + type + ") == 'function' ? new " +
type + "() : {}")(); obj["$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, objects, 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) : {}; for (var i = 1; i < fields.length;
i++) { var propName = meta[i]; var propVal = fields[i]; if (propVal == null) continue; if (propName.charAt(0)
== "$") continue; if (typeof(propVal) == "object") propVal = _zf_stdTransformResponse(propVal, objects,
metas); obj[propName] = propVal; } if (obj.postSerialize) obj.postSerialize(); return obj; }
; function zf_stdLoadScript(fileName, callback, fragment) { ; if (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, callback ]; return; case
"object": if (entry == null) callback(); else if (entry.constructor == Array) entry.push(callback);
return; default: ; return; } var url = entry; if (fragment) url += fragment; var script = document.createElement("SCRIPT");
script.type = "text/javascript"; script.src = url; document.body.appendChild(script); } function
zf_stdNotifyScriptLoad(fileName) { if (typeof(_zf_stdDelayLoad) == "undefined") return; switch (typeof(_zf_stdDelayLoad[fileName]))
{ case "function": _zf_stdDelayLoad[fileName](); _zf_stdDelayLoad[fileName] = null; break; case
"object": var list = _zf_stdDelayLoad[fileName]; if (list != null && list.constructor == Array)
{ for (var i = 0; i < list.length; i++) list[i](); } _zf_stdDelayLoad[fileName] = null; break;
default: break; } } 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];
if (typeof(entry) == "string") { var frame = document.createElement("IFRAME"); frame.style.cssText
= "position: absolute; visibility: hidden; left:0px; top: 0px;"; document.body.appendChild(frame);
setTimeout( function() { var doc = frame.contentWindow.document; var script = doc.createElement("SCRIPT");
script.type = "text/javascript"; script.src = entry; doc.body.appendChild(script); frame = null;
doc = null; }, 100); } }
; 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; i < 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)); }; };
; function zf_stdSetClientObject(dom, client) { 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); if (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);
this.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)]; }; 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,
this.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; if (arguments.length == 1) return function(e) { return method.apply(self, [zf_stdGetEvent(e)]);
}; var args = []; for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); return 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; var 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];
task.tag = null; } var taskStart = new Date().getTime(); task.method.apply(task.self, task.args);
queue.shift(); ; if (new Date().getTime() - start > slice) break; } 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; for (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, args : 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); } function zf_stdMakeDeferred(tag, method) { return function()
{ zf_stdDeferCallV(tag, method, this, arguments); }; } function zf_stdMakeMethodsDeferred(obj, id,
names) { var bake = function(tag, method, 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, method, obj); } }
; function zf_RequestQueue(interval, concurrent) { this._interval = interval; this._concurrent = concurrent
!= null ? concurrent : 1; this._queue = []; } zf_RequestQueue.prototype.enqueue = function(method,
url, api, params, callback, tag) { var request = { method: method, url: url, api: api, params: params,
callback : callback, executing : false, tag: tag }; this._queue.push(request); if (this._queue.length
<= this._concurrent) this._execute(request); }; zf_RequestQueue.prototype.enqueueEx = function(method,
url, api, params, callback, tag) { this.enqueue(method, url, api, params, function(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."
}; } else { result = retVal.result; error = retVal.error; } callback(result, error); }, tag ); };
zf_RequestQueue.prototype.bump = function(tag) { var highest = -1; for (var i = 0; i < this._queue.length;
i++) { var request = this._queue[i]; if (request.tag == tag) { if (i == 0 || request.executing)
break; this._queue = this._queue.splice(i, 1).concat(this._queue); break; } if (highest == -1 && !request.executing)
highest = i; } }; zf_RequestQueue.prototype._execute = function(request) { ; var self = this; var
callback = function(status, retVal) { for (var i = 0; i < self._queue.length; i++) { if (self._queue[i]
== request) break; } ; self._queue.splice(i, 1); request.callback(status, retVal); for (var j = 0;
j < self._concurrent; j++) { if (j == self._queue.length) break; var r = self._queue[j]; if (!r.executing)
{ r.executing = true; setTimeout(function() { self._execute(r); }, self._interval); break; } }
}; request.executing = true; zf_stdDeferCall(null, zf_stdServerRequest, null, request.method, request.url,
request.api, request.params, callback); };
; function zf_Loadable() { if (zf_stdNoArgs(arguments)) return; this.loaded = this.requested = false;
this._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]; if (now.getTime()
- loadable._requestTime.getTime() > 1000) loadable.setDelayed(); } }, 500); zf_Loadable.notifyLoaded
= function(loadable, callback) { ; if (loadable.loaded) { callback(loadable); return true; } else
{ var sink = {}; loadable.advise(sink, function() { loadable.unadvise(sink); callback(loadable); });
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);
part.setRequested(); var args = $.makeArray(arguments); args.shift(); zf_Loadable.notifyLoaded(this,
function() { part.load.apply(part, args); }); } ; ; return part; }; zf_Loadable.prototype.advise
= function(sink, onload, 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++; sink.__loadables[this._uniqueId] = sinkId; } this._callbacks[sinkId]
= [ onload, ondelay ]; if (this.delayed && ondelay != null) ondelay.call(this); }; zf_Loadable.prototype.unadvise
= function(sink) { var sinkId = null; var loadables = sink.__loadables; if (loadables != null)
sinkId = loadables[this._uniqueId]; if (sinkId != null) { loadables[this._uniqueId] = null; delete
loadables[this._uniqueId]; this._callbacks[sinkId] = null; delete this._callbacks[sinkId]; } };
zf_Loadable.prototype.done = function() { if (this.loaded) return; this.requested = this.loaded =
true; for (var sinkId in this._callbacks) this._callbacks[sinkId][0].call(this); delete zf_Loadable.inprogress[this._uniqueId];
}; zf_Loadable.prototype.postSerialize = function() { this.requested = this.loaded = true; }; zf_Loadable.prototype.setRequested
= function() { ; ; ; 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];
for (var sinkId in this._callbacks) { var callback = this._callbacks[sinkId][1]; if (callback != null)
callback.call(this); } };
; function zf_Animation(states, callback) { ; ; this.inprogress = false; this._timer = null; this._variable
= 0; this._from = this._to = 0; this._end = this._start = new Date().getTime(); this._states = states;
this._callback = callback; var self = this; this._clear = function() { self.inprogress = false;
self._oncomplete = null; if (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; var 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(); self._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); if (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; } if (self._variable
== self._to) { self._clear(); if (oncomplete) oncomplete(); } if (dspent == 0) return; self._callback(self._variable);
}; this._timer = setInterval(callback, 10); this._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); }; 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]; this._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); var 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)
{ ; this.clear(); this.callback = callback; var self = this; var pending = setTimeout( function()
{ if (pending == self.pending) { self.pending = null; callback(); } }, this.delay); this.pending
= pending; }; zf_DelayedInvoke.prototype.clear = function() { if (!this.pending) return; clearTimeout(this.pending);
};
; var _zf_stdBase32Digits = "123456789ABCDEFGHJKMNPQRSTUVWXYZ"; function zf_stdBase32Encode(number)
{ var res = ""; while (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; i < 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 }; this._default
= zf_VolumeMapper._decodeInt(iter); this._mapping = {}; while (iter.pos < iter.length) { var method
= zf_VolumeMapper._decodeInt(iter); var volume = zf_VolumeMapper._decodeInt(iter); this._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; }; zf_VolumeMapper._decodeInt = function(iter) { ; ; var val
= 0; while (iter.pos < iter.length) { var c = iter.code.charCodeAt(iter.pos++); val = val * 26 + ((c
& ~0x20) - 0x41); if ((c & 0x20) == 0) return val; } ; return null; };
; function zf_BasicImage(id, width, height, timestamp, volume, token, fileType) { if (arguments.length
> 0) { ; if (id <= 0) { width = 0; height = 0; timestamp = ""; volume = null; token = null; } ;
; ; ; ; this.id = id; this.width = width; this.height = height; this.timestamp = timestamp; this.volume
= volume; this.token = token; this.fileType = fileType == null ? null : fileType; this._mapper =
null; this.postSerialize(); } else { this.timestamp = ""; this.fileType = ".jpg"; this._mapper =
null; } } zf_BasicImage.Photo = "p"; zf_BasicImage.UserFile = "f"; zf_BasicImage.prototype.postSerialize
= function() { if (this.volume != null) this._mapper = new zf_VolumeMapper(this.volume); }; zf_BasicImage.prototype.getScaledSize
= function(method) { var cx = this.width; var cy = this.height; if (cx != 0 && cy != 0) { if (method
== zf_ProcessingMethod.WatermarkThumbnail || method == zf_ProcessingMethod.WatermarkSmallThumbnail
|| method == zf_ProcessingMethod.LogoSmallThumbnail || method == zf_ProcessingMethod.LogoLargeThumbnail)
{ return { cx: method.cx, cy: method.cy }; } if (method == zf_ProcessingMethod.StandardSmallThumbnail)
cx = cy = Math.min(this.width, this.height); var width = method.cx; var height = method.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; var 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 }; }; zf_BasicImage.prototype.getUrlCore = function(method)
{ ; return null; }; zf_BasicImage.prototype.getOriginalUrl = function(ext) { ; return null; };
zf_BasicImage.prototype.getExternalUrl = function(method) { ; var core = this.getUrlCore(method);
return core != null ? [ core, "-", method.code, method.type ].join("") : null; };
; function zf_PhotoImage(id, width, height, timestamp, volume, token) { if (zf_stdNoArgs(arguments))
return; zf_BasicImage.prototype.constructor.apply(this, arguments); this.prefix = "p"; } zf_PhotoImage.inherits(zf_BasicImage);
zf_PhotoImage._fields = [ "id", "photoId", "width", "height", "timestamp", "volume", "token", "prefix",
"_mapper" ]; zf_PhotoImage.clone = function(photo) { if (photo == null) return null; return zf_stdCopyFields(new
zf_PhotoImage(), photo, zf_PhotoImage._fields); }; zf_PhotoImage.prototype.getUrlCore = function(method,
volume) { ; if (this.id <= 0) return null; if (volume == null) volume = this._mapper.map(method);
return [ "/img/s", zf_imageVS[volume], "/v", volume, "/p", this.id ].join(""); }; zf_PhotoImage.prototype.getOriginalUrl
= function(ext) { ; ; if (this.id <= 0) return null; var volume = this._mapper.defaultMapping();
return [ "/img/s", zf_imageVS[volume], "/v", volume, "/p", this.id, ext ].join(""); }; zf_PhotoImage.prototype.getGeneratedUrl
= function(method, forBrowser, volume) { ; var core = this.getUrlCore(method, volume); if (core
!= null) { var url = [ core, "-", method.code, method.type, forBrowser ? "?sn=" : "?ts=", this.timestamp
]; if (this.token != null) url.push("&tk=", this.token); var keyRing; var host = []; var inlined
= false; if (zf_imageHosts.length > 0 && location.protocol != "https:") { var imageHost = zf_imageHosts[this.id
% zf_imageHosts.length]; host = [ location.protocol, "//", imageHost ]; var hostname = location.hostname;
var k = hostname.indexOf(zf_defaultDomain); if (imageHost.indexOf(zf_defaultDomain) == -1 || k ==
-1 || k != hostname.length - zf_defaultDomain.length) { inlined = true; if (zf_BasicImage._token ==
undefined) zf_BasicImage._token = zf_stdGetCookie("zf_token"); if (zf_BasicImage._visitor == undefined)
zf_BasicImage._visitor = zf_stdGetCookie("zf_5y_visitor"); if (zf_BasicImage._token != null) url.push("&token=",
zf_BasicImage._token); keyRing = zf_stdGetCookie("zf_keyring"); if (keyRing != null) url.push("&keyring=",
keyRing); if (zf_BasicImage._visitor != null) url.push("&visitor=", zf_BasicImage._visitor); }
} var secured = this.timestamp != null && zf_stdBase32Decode(this.timestamp) & 1; if (secured == 1)
{ if (zf_userId != 0) url.push("&uid=", zf_userId); if (!inlined) { keyRing = zf_stdGetCookie("zf_keyring");
if (keyRing != null) url.push("&keyringx=", keyRing); } } return host.concat(url).join(""); } return null;
};
; function zf_FileImage(id, width, height, timestamp, volume, token, fileType) { if (zf_stdNoArgs(arguments))
return; zf_BasicImage.prototype.constructor.apply(this, arguments); this["$type"] = "FileImage";
this.prefix = "u"; } zf_FileImage.inherits(zf_BasicImage); zf_FileImage._fields = [ "id", "width",
"height", "timestamp", "volume", "token", "prefix", "_mapper", "fileType" ]; zf_FileImage.clone
= function(file) { if (file == null) return null; return zf_stdCopyFields(new zf_FileImage(), file,
zf_FileImage._fields); }; zf_FileImage.prototype.getUrlCore = function(method) { ; if (this.id <=
0) return null; var volume = this._mapper.map(method); return [ "/img/s", zf_imageVS[volume], "/v",
volume, "/u", this.id ].join(""); }; zf_FileImage.prototype.getOriginalUrl = function(ext) { ;
; if (this.id <= 0) return null; var volume = this._mapper.defaultMapping(); return [ "/img/s",
zf_imageVS[volume], "/v", volume, "/u", this.id, ext ].join(""); }; zf_FileImage.prototype.getGeneratedUrl
= function(method, forBrowser) { ; var url = [ this.getUrlCore(method), "-", method.code, method.type,
forBrowser ? "?sn=" : "?ts=", this.timestamp ]; if (zf_imageHosts.length > 0 && location.protocol
!= "https:") { var imageHost = zf_imageHosts[this.id % zf_imageHosts.length]; url = [ location.protocol,
"//", imageHost ].concat(url); } return url.join(""); };
; var zf_AccessType = { Public: "Public", Private: "Private", Password: "Password", Protected: "Protected",
Derived: "Derived" };
var zf_AccessMask = { None: 0x00000000, ProtectOriginals: 0x00000001, ProtectExtraLarge: 0x00000002,
NoCollections: 0x00000004, PasswordProtectOriginals: 0x00000008, ProtectXXLarge: 0x00000010, ProtectUserStats:
0x00000020, ProtectVisits: 0x00000040, NoRecentList: 0x00000080, NoPrivateSearch: 0x00000100, Reserved512:
0x00000200, Reserved1024: 0x00000400, Reserved2048: 0x00000800, Reserved4096: 0x00001000, NoPublicSearch:
0x00002000, ProtectDateCreated: 0x00004000, ProtectDateModified: 0x00008000, ProtectDateTaken:
0x00010000, ProtectExif: 0x00020000, ProtectLarge: 0x00040000, ProtectMedium: 0x00080000, ProtectMeta:
0x00004000 | 0x00008000 | 0x00020000 | 0x00010000, NoPublicGuestbookPosts: 0x00100000, NoPrivateGuestbookPosts:
0x00200000, NoAnonymousGuestbookPosts: 0x00400000, NoPublicComments: 0x00800000, NoPrivateComments:
0x01000000, NoAnonymousComments: 0x02000000, ProtectGuestbook: 0x04000000, ProtectComments: 0x08000000,
ImageSizeLimitXXLarge: 0x00000000, ImageSizeLimitExtraLarge: 0x00000010, ImageSizeLimitLarge: 0x00000010
| 0x00000002, ImageSizeLimitMedium: 0x00000010 | 0x00000002 | 0x00040000, ImageSizeLimitSmall:
0x00000010 | 0x00000002 | 0x00040000 | 0x00080000, ImageSizeMask: 0x00000010 | 0x00000002 | 0x00040000
| 0x00080000, SearchAny: 0x00000000, SearchLocalOnly: 0x00002000, SearchNone: 0x00002000 | 0x00000100,
SearchMask: 0x00002000 | 0x00000100 };
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
= []; this.password = zf_AccessRealm.NotAvailable; this.passwordHint = ""; this.srcPassword = "";
this.srcPasswordHint = ""; } zf_AccessRealm.NotAvailable = {}; zf_AccessRealm._fields = [ "type",
"mask", "realmId", "ownerId", "viewers", "password", "passwordHint", "srcPassword", "srcPasswordHint"
]; zf_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)
: []; return 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; zf_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", "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); clone.viewers = info.viewers != null ? [].concat(info.viewers)
: []; return clone; }; zf_AccessInfo.prototype.getRealm = function() { var info = this; while (info.isDerived)
info = info.parent; return info; };
; var zf_PhotoFlags = { None: 0, HasTitle: 1, HasCaption: 2, HasCategories: 4, HasKeywords: 8,
HasExif: 16, HasComments: 32, HasImage0: 1024, HasImage1: 2048, HasImage10: 4096, HasImage11: 8192
};
; function _zf_stdCategoryCompare(a, b) { if ((a % 1000) != 0) a = 0; else if ((a % 100000) != 0)
a = 1; else a = 2; if ((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() { } zf_ScrapbookInfo._fields = [ "token", "name", "changeNumber", "photoCount",
"sharerName", "isOwned", "isSharedWith", "isReadOnly" ]; 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.getExpiresOn = function() { ; var expiresOn = new Date(this.modifiedOn.getTime());
expiresOn.setDate(expiresOn.getDate() + 30); return expiresOn; }; zf_ScrapbookInfo.prototype.getDisplayName
= function() { if (this.isSharedWith && this.sharerName) return zf_stdFormatString('{0}: {1}', this.sharerName,
this.name); return this.name; };
; 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" },
".tif" : { type: "TIFF", mime: "image/tiff", ext: ".tif" }, ".bmp" : { type: "BMP", mime: "image/bmp",
ext: ".bmp" } }; var zf_stdMimeTypes = { "image/jpeg" : { type: "JPEG", mime: "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", mime: "image/tiff", ext: ".tif" }, "image/bmp"
: { type: "BMP", mime: "image/bmp", ext: ".bmp" } };
; var zf_ProcessingMethod = { StandardThumbnail: { code: 0, output: 10, isThumb: true, cx: 80,
cy: 80, type: ".jpg", format: "Small Thumbnail ({0} x {1})" }, StandardSmallThumbnail: { code: 1,
output: 10, isThumb: true, cx: 60, cy: 60, type: ".jpg", format: "Square Thumbnail (60 x 60)" },
StandardSmallSize: { 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, cy: 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, output: 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})" }, StandardLargeThumbnail: { code: 10, output: 10, isThumb: true, cx: 120,
cy: 120, type: ".jpg", format: "Medium Thumbnail ({0} x {1})" }, StandardVeryLargeThumbnail: { code:
11, output: 10, isThumb: true, cx: 200, cy: 200, type: ".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, isThumb: 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, cx: 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, type: ".jpg" }, WatermarkNormalizedVert: { code: 63, output: 30,
isThumb: false, type: ".jpg" }, LogoSmallThumbnail: { code: 70, output: 70, isThumb: true, cx: 200,
cy: 40, type: ".png" }, LogoLargeThumbnail: { code: 74, output: 70, isThumb: true, cx: 200, cy:
100, type: ".png" }, FavIcon: { code: 81, output: 80, isThumb: true, cx: 16, cy: 16, type: ".ico"
} }; zf_ProcessingMethod.fromCode = function(code) { ; var method = zf_ProcessingMethod[code];
if (method != null) return method; for (method in zf_ProcessingMethod) { if (zf_ProcessingMethod[method].code
== code) { method = zf_ProcessingMethod[method]; zf_ProcessingMethod[code] = method; return method;
} } ; return null; };
; function zf_PhotoLoader(photo, method) { this._uid = ++zf_PhotoLoader._lastUid; this._photo =
photo; this._method = method; this._retries = 0; this.state = photo.id > 0 ? zf_PhotoLoader.Initialized
: zf_PhotoLoader.Complete; } zf_PhotoLoader.Initialized = 0; zf_PhotoLoader.Loading = 1; zf_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._queue = []; zf_PhotoLoader._waitList = {}; zf_PhotoLoader._waitCount
= 0; zf_PhotoLoader._images = []; 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) { ; if (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; }; zf_PhotoLoader.prototype._push = function() { if (zf_PhotoLoader._active
< 60) { zf_PhotoLoader._active++; this._load(); } else zf_PhotoLoader._queue.push(this); }; zf_PhotoLoader.prototype._load
= function() { var url = this._photo.getGeneratedUrl(this._method, false, this._volume); if (this._retries
!= 0) { if (url.indexOf('?') != -1) url += "&r=" + this._retries; else 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; }, 1); }; zf_PhotoLoader.prototype._done
= function() { if (zf_PhotoLoader._queue.length > 0) zf_PhotoLoader._queue.shift()._load(); else
--zf_PhotoLoader._active; }; zf_PhotoLoader.prototype._ready = function(response) { if (response.state
!= zf_PhotoLoader.Complete) { this.state = response.state; if (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, photo.id, photo.timestamp, photo.volume,
this._method.code ]; if (photo.token != null) key.push(photo.token); key = key.join('/'); var entry
= zf_PhotoLoader._waitList[key]; if (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, 1000); }; zf_PhotoLoader._check
= function() { var list = []; var keys = []; for (key in zf_PhotoLoader._waitList) { keys.push(key);
key = key.split('/'); list.push({ type: key[0], photoId: parseInt(key[1], 10), timestamp: key[2],
volume: key[3], method: parseInt(key[4], 10), token: key.length > 5 ? key[5] : null }); } if (list.length
== 0) return; var self = this; zf_stdServerRequestEx("POST", "/zf/core/core.asmx", "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]; var loader =
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; } 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, 1000); }); }; zf_PhotoLoader.prototype._onLoad
= function() { this._image.onload = null; this._image.onerror = null; this._done(); this.state =
zf_PhotoLoader.Complete; if (!this._method.isThumb) { if (zf_PhotoLoader._images.length > 50) zf_PhotoLoader._images.shift();
zf_PhotoLoader._images.push(this._image); } this._image = null; if (this.onload != null) this.onload(this.state,
this._src); }; zf_PhotoLoader.prototype._onError = function() { this._done(); this._retries++;
this._wait(); };
; function zf_PhotoView(id, plugins, context, view) { this.id = id; this.waitTimeout = 3000; this.context
= context; this._plugins = plugins != null ? plugins : []; if (view == null) view = this.dom();
zf_stdSetClientObject(view, this); this._completeInit(view); } zf_PhotoView.inherits(zf_Control);
zf_PhotoView.createHtml = function(id, href, styles, plugins, context, photo, method, burnable, x,
y) { styles = styles != null ? [].concat(styles) : []; if (photo != null && photo.id < 0) styles.push("pv-s-"
+ (-photo.id)); var smap = {}; for (var i = 0; i < styles.length; i++) smap[styles[i]] = true;
var markup = zf_PhotoView._createInnerHtml(id, href, plugins, smap, context, photo, method, burnable);
var viewStyle = ""; if (x != null && y != null) { viewStyle = [' style="left:', x, 'px;top:', y,
'px;visibility:inherit;"'].join(""); } 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, href, styles, context, photo, method, burnable, x,
y) { this.detachContext(this.context); this.context = context; styles = styles != null ? [].concat(styles)
: []; if (photo != null && photo.id < 0) styles.push("pv-s-" + (-photo.id)); var smap = {}; for
(var i = 0; i < styles.length; i++) 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:', x, '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; if (view.style.cssText != viewStyle) view.style.cssText
= viewStyle; if (this._loader != null) { this._loader.onload = null; this._loader = null; } view.innerHTML
= markup; this._completeInit(view); }; 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; photo = loader.getPhoto(); method = loader.getMethod(); } else
loader = new zf_PhotoLoader(photo, method); this._loader = loader; loader.onload = this.closure(this._onLoad,
photo, method); if (!noresize) { if (photo.id < 0) this.setSpecial((-photo.id).toString()); else
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) { self.setSpecial("wait", true); if (self.onwait) self.onwait();
} }, this.waitTimeout); } }; zf_PhotoView.prototype.clear = function() { this.setSpecial(null);
var image = this.dom("img"); var inner = image.parentNode; image.style.cssText = ""; inner.style.cssText
= ""; if (this._loader != null) { this._loader.onload = null; this._loader = null; } if (this._waitTimer
!= null) { window.clearTimeout(this._waitTimer); this._waitTimer = null; } this._photo = null;
this._method = null; }; zf_PhotoView.prototype.attachContext = function(context) { this.context
= context; var image = this.dom("img"); var inner = image.parentNode; var outer = inner.parentNode;
var 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, false); } }; 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(); if (outer == null) { outer = view.firstChild; while (outer.className != "pv-outer")
outer = outer.nextSibling; inner = outer.firstChild; while (inner.className != "pv-inner") inner
= inner.nextSibling; } plugin.onDestroyDom(view, outer, inner, context); } } }; zf_PhotoView.prototype.setStyle
= function(styles, view) { styles = (styles != null ? ["pv"].concat(styles) : ["pv"]); styles.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;
if (href == null) { inner.removeAttribute("href"); inner.onclick = zf_stdFalse; } else { inner.href
= href; inner.onclick = zf_stdTrue; } }; zf_PhotoView.prototype.setSpecial = function(style, noclear)
{ var 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,
1); } 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; if (!noclear) { if (this._special == style) return; this._special = style;
this.detachContext(this.context); var inner = this.dom("img").parentNode; var smap = {}; for (i =
0; i < styles.length; i++) smap[styles[i]] = true; var markup = zf_PhotoView._createInnerHtml(this.id,
inner.href, this._plugins, smap, this.context, photo, method, false); view.innerHTML = markup;
this._completeInit(view); } }; zf_PhotoView.prototype.getInner = function() { return this.dom("img").parentNode;
}; zf_PhotoView.prototype.getPhoto = function() { if (this._loader != null) return this._loader.getPhoto();
return this._photo; }; zf_PhotoView.prototype.getMethod = function() { if (this._loader != null)
return this._loader.getMethod(); return this._method; }; zf_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; i++) { var plugin = plugins[i];
if (plugin.getOuterContent != null) outer.push(plugin.getOuterContent(id, context, smap)); if (plugin.getInnerContent
!= null) inner.push(plugin.getInnerContent(id, context, smap)); } href = (href != null && href !=
"") ? [' href="', href, '"'].join("") : ""; var innerStyle = ""; var imgStyle = ""; if (photo != null
&& method != null && photo.id > 0) { var size = photo.getScaledSize(method); var innerLeft = (method.cx
- size.cx) / 2; var innerTop = (method.cy - size.cy) / 2; innerStyle = [' style="left:', innerLeft,
'px;top:', innerTop, 'px;width:', size.cx, 'px;height:', size.cy, 'px;"' ].join(""); if (burnable)
{ imgStyle = [' width="', size.cx, '" height="', size.cy, '" style="background-image:url(', photo.getGeneratedUrl(method,
true), ');"'].join(""); } } return [ '<div class="pv-outer">', outer.join(""), '<a class="pv-inner"',
href, innerStyle, '>', '<img class="pv-img" id="', id, '-img"', imgStyle, ' src="/zf/img/null.gif" />',
inner.join(""), '</a>', '</div>' ].join(""); }; zf_PhotoView.prototype._completeInit = function(view)
{ var outer = view.firstChild; while (outer.className != "pv-outer") outer = outer.nextSibling;
var inner = outer.firstChild; while (inner.className != "pv-inner") inner = inner.nextSibling;
var self = this; if (inner.getAttribute("href") == null) inner.onclick = zf_stdFalse; outer.onmouseover
= function(e) { self._onOuterMouseEnter(this, e); }; outer.onmouseout = function(e) { self._onOuterMouseLeave(this,
e); }; inner.onmouseover = function(e) { self._onInnerMouseEnter(this, e); }; inner.onmouseout =
function(e) { self._onInnerMouseLeave(this, e); }; for (var i = 0; i < this._plugins.length; i++)
{ var plugin = this._plugins[i]; if (plugin.onCreateDom != null) plugin.onCreateDom(view, outer,
inner, this.context, true); } outer = null; inner = null; view = null; }; zf_PhotoView.prototype._onLoad
= function(state, src, photo, method) { if (this._waitTimer != null) { window.clearTimeout(this._waitTimer);
this._waitTimer = null; } this._photo = photo; this._method = method; if (this.onload) { if (this.onload(state))
return; } switch (state) { case zf_PhotoLoader.Complete: if (photo.id > 0) { this.setSpecial(null);
var image = this._setImage(src, method); } break; case zf_PhotoLoader.NotFound: this.setSpecial("notfound");
break; case zf_PhotoLoader.AccessDenied: case zf_PhotoLoader.AuthRequired: this.setSpecial("noaccess");
break; case zf_PhotoLoader.PasswordRequired: this.setSpecial("password"); break; case zf_PhotoLoader.Failed:
default: this.setSpecial("failed"); break; } }; zf_PhotoView.prototype._setImage = function(src,
method) { var image = this.dom("img"); image.style.backgroundImage = "url(" + src + ")"; return image;
}; zf_PhotoView.prototype._resize = function(photo, method) { var inner = this.dom("img").parentNode;
var 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";
inner.style.height = size.cy + "px"; }; zf_PhotoView.prototype._onOuterMouseEnter = function(outer,
e) { zf_stdReplaceClassName(this.id, null, "pv-ohover"); }; zf_PhotoView.prototype._onOuterMouseLeave
= function(outer, e) { zf_stdReplaceClassName(this.id, "pv-ohover", null); }; zf_PhotoView.prototype._onInnerMouseEnter
= function(inner, e) { zf_stdReplaceClassName(this.id, null, "pv-ihover"); }; zf_PhotoView.prototype._onInnerMouseLeave
= function(inner, e) { zf_stdReplaceClassName(this.id, "pv-ihover", null); };
; function zf_PhotoGrid(id, flags) { zf_Control.prototype.constructor.call(this, id); this._selectionMode
= flags & 0x03; this._dragDropMode = flags & 0x04; this._items = []; this._views = []; this._selected
= {}; this._pendingSelect = {}; this._left = 0; this._height = -1; this._pageIndex = 0; this._anchorIndex
= -1; this._firstVisible = 0; this._lastVisible = 0; this._lastUid = 0; } zf_PhotoGrid.inherits(zf_Control);
zf_PhotoGrid.None = 0x00; zf_PhotoGrid.Single = 0x01; zf_PhotoGrid.SingleForced = 0x02; zf_PhotoGrid.Multiple
= 0x03; zf_PhotoGrid.KeepVisible = 0x01; zf_PhotoGrid._nullPhoto = new zf_BasicImage(0); zf_PhotoGrid.prototype.init
= function(plugins) { this._plugins = plugins != null ? [].concat(plugins) : []; var self = this;
var node = this.dom(); if (this._selectionMode != zf_PhotoGrid.None) { node.onmousedown = function(e)
{ self._onGridClick(e); return false; }; } node.ondblclick = zf_stdFalse; node = null; }; zf_PhotoGrid.prototype.getLayoutInfo
= function(flags) { if (flags == null) flags = zf_PhotoGrid.None; ; ; var grid = this.dom(); var
info = {}; if (this._cellWidth == null) this._measureCell(grid); info.width = grid.offsetWidth;
info.itemsPerRow = Math.floor(info.width / this._cellWidth); if (info.itemsPerRow == 0) info.itemsPerRow
= 1; var rowsPerGrid; var actualHeight; if (this._height == -1) { info.rowsPerPage = Math.ceil(this._items.length
/ info.itemsPerRow); if (this.minRows != null && info.rowsPerPage < this.minRows) info.rowsPerPage
= this.minRows; if (this.maxRows != null && info.rowsPerPage > this.maxRows) info.rowsPerPage =
this.maxRows; info.height = this._cellHeight * info.rowsPerPage; } else { info.height = this._height;
info.rowsPerPage = Math.floor(info.height / this._cellHeight); if (this.minRows != null && info.rowsPerPage
< this.minRows) { info.rowsPerPage = this.minRows; info.height = this._cellHeight * info.rowsPerPage;
} if (this.maxRows != null && info.rowsPerPage > this.maxRows) { info.rowsPerPage = this.maxRows;
info.height = this._cellHeight * info.rowsPerPage; } } if (info.rowsPerPage == 0) info.rowsPerPage
= 1; if (this.minHeight != null && info.height < this.minHeight) info.height = this.minHeight;
info.itemsPerPage = info.itemsPerRow * info.rowsPerPage; if (this._height == -1) { info.currentPage
= 0; info.totalPages = 1; } else { info.totalPages = Math.ceil(this._items.length / info.itemsPerPage);
var anchorIndex = this._anchorIndex; if (anchorIndex == -1) anchorIndex = this._firstVisible; if
((flags & zf_PhotoGrid.KeepVisible) != 0) info.currentPage = Math.floor(anchorIndex / info.itemsPerPage);
else info.currentPage = this._pageIndex; if (info.currentPage >= info.totalPages) info.currentPage
= Math.max(info.totalPages - 1, 0); } info.firstVisible = info.currentPage * info.itemsPerPage;
info.lastVisible = Math.min(this._items.length, info.firstVisible + info.itemsPerPage); grid = null;
return info; }; zf_PhotoGrid.prototype.recalcLayout = function(info) { if (info == null) info = this.getLayoutInfo();
; this._pageIndex = info.currentPage; if (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(); if (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", this.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]; if (item != null && item.visible && (i <
first || i >= last)) this._destroyDom(item); } this._firstVisible = first; this._lastVisible = last;
this._cellsPerRow = info.itemsPerRow; this._left = (info.width - info.itemsPerRow * this._cellWidth)
/ 2; for (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(); }, 5000); zf_stdReplaceClassName(grid, this._items.length > 0 ? "pg-empty" : null,
this._items.length > 0 ? null : "pg-empty"); grid = null; extra = null; return info; }; zf_PhotoGrid.prototype.clear
= function() { for (var id in this._items) { var item = this._items[id]; if (item._view != null)
this._destroyDom(item); } this._items = []; this._selected = {}; this._anchor = null; this._pageIndex
= 0; this._firstVisible = 0; this._lastVisible = 0; var self = this; window.setTimeout(function()
{ self._trimPool(); }, 5000); }; zf_PhotoGrid.prototype.getCellSize = function(forceRemeasure) {
if (forceRemeasure || this._cellWidth == null) this._measureCell(this.dom()); return { cx: this._cellWidth,
cy: this._cellHeight }; }; zf_PhotoGrid.prototype.setHeight = function(cy) { if (cy == null) cy =
-1; this._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)); } }; 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; } }; 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; styles = 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]; this._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; item.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, context, item.photo, item.method,
item.burnable, item._x, item._y); if (!item.burnable) item._view.load(photo, method, true); } }
else { item = { id: id, index: index, href: href, photo: photo, method: method, burnable: burnable,
styles: styles, context: context, _grid: this, _view: null }; if (this._pendingSelect[index]) {
this._selectItem(item); delete 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]; if (typeof(index) == "object") index = index.index; index -= this._firstVisible;
var row = Math.floor(index / this._cellsPerRow); var col = index % this._cellsPerRow; var x = this._left
+ col * this._cellWidth + this._cellLeft; var y = row * this._cellHeight + this._cellTop; return {
left: x, top: y, right: x + this._cellWidth, bottom: y + this._cellHeight }; }; zf_PhotoGrid.prototype.getPhotoView
= function(item) { if (typeof(item) != "object") item = this._items[item]; return item != null ?
item._view : null; }; zf_PhotoGrid.prototype.getItemPage = function(index) { if (typeof(index) ==
"string") { var item = this._items[index]; if (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); }; zf_PhotoGrid.prototype.getSelectedItem = function() {
for (var id in this._selected) return this._selected[id]; return null; }; zf_PhotoGrid.prototype.getSelectedItems
= function() { var items = []; for (var id in this._selected) items.push(this._selected[id]); return items;
}; zf_PhotoGrid.prototype.getSelectedIndices = function() { var indices = []; for (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; if (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, index +
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); if (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; }; zf_PhotoGrid.prototype._createDom
= function(item) { var styles = [].concat(item.styles); if (item.selected) styles.push("pg-selected");
var index = item.index - this._firstVisible; var row = Math.floor(index / this._cellsPerRow); var
col = index % this._cellsPerRow; var x = this._left + col * this._cellWidth + this._cellLeft; var
y = row * this._cellHeight + this._cellTop; item._x = x; item._y = y; var self = this; var view;
var 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();
viewNode = view.dom(); if (this._selectionMode != zf_PhotoGrid.None) { viewNode.onmousedown = onmousedown;
viewNode.onmouseup = onmouseup; } view.reinit(viewNode, item.href, styles, item.context, item.photo,
item.method, item.burnable, item._x, item._y); item._view = view; } else { var viewId = [this.id,
"_i", ++this._lastUid].join(""); var html = zf_PhotoView.createHtml(viewId, item.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"); node.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; viewNode.onmouseup = onmouseup; } item._view
= new zf_PhotoView(viewId, this._plugins, item.context, viewNode); } 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; item._view = null; item._x = null; item._y = null; item.visible
= false; var viewNode = view.dom(); view.detachContext(item.context, viewNode); viewNode.style.cssText
= ""; viewNode.onmousedown = null; if (this._views.length < 256) this._views.push(view); else viewNode.parentNode.removeChild(viewNode);
}; zf_PhotoGrid.prototype._trimPool = function() { if (this._views.length > 64) { var extra = this._views.splice(64,
this._views.length - 64); for (var i = 0; i < extra.length; i++) { var node = document.getElementById(extra[i].id);
node.parentNode.removeChild(node); } } }; zf_PhotoGrid.prototype._showItem = function(index, item)
{ index -= this._firstVisible; var row = Math.floor(index / this._cellsPerRow); var col = index
% this._cellsPerRow; var x = this._left + col * this._cellWidth + this._cellLeft; var y = row * this._cellHeight
+ this._cellTop; if (item._x == x && item._y == y) return; item._x = x; item._y = y; item.visible
= true; var node = item._view.dom(); node.style.left = x + "px"; node.style.top = y + "px"; node.style.visibility
= "inherit"; }; zf_PhotoGrid.prototype._hideItem = function(index, item) { if (item._x != null ||
item._y != null) { var node = item._view.dom(); node.style.visibility = "hidden"; item._x = null;
item._y = null; item.visible = false; } }; zf_PhotoGrid.prototype._measureCell = function(grid)
{ ; var node = document.createElement("DIV"); node.className = "pv"; grid.appendChild(node); var
props; var i; if (node.currentStyle) { props = [ "width", "paddingLeft", "paddingRight", "borderLeftWidth",
"borderRightWidth", "marginLeft", "marginRight", "height", "paddingTop", "paddingBottom", "borderTopWidth",
"borderBottomWidth", "marginTop", "marginBottom" ]; for (i = 0; i < props.length; i++) props[i]
= node.currentStyle[props[i]]; } else { props = [ "width", "padding-left", "padding-right", "border-left-width",
"border-right-width", "margin-left", "margin-right", "height", "padding-top", "padding-bottom",
"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]); } grid.removeChild(node);
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)); ; ; ; ; this._cellWidth
= width; this._cellHeight = height; this._cellLeft = 0; this._cellTop = 0; }; zf_PhotoGrid.prototype._item_onmousedown
= function(e, node, item) { ; ; e = zf_stdGetEvent(e); zf_stdStopPropagation(e); zf_stdPreventDefault(e);
if (node.setActive) node.setActive(); if (zf_stdIsLeftButton(e)) this._clickSelect(e, node, item,
true); if (this._dragInfo != null) { this._dragStop(); } 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._x, baseY: item._y, lastScroll: new Date().getTime() }; node.onmousemove
= function(e) { self._item_onmousemove(e, item); }; if (document.addEventListener) { document.addEventListener("mousemove",
node.onmousemove, true); document.addEventListener("mouseup", node.onmouseup, true); } else node.setCapture(false);
} node = null; e = null; }; zf_PhotoGrid.prototype._item_onmouseup = function(e, node, item) {
; ; if (node == document) node = item._view.dom(); e = zf_stdGetEvent(e); zf_stdStopPropagation(e);
zf_stdPreventDefault(e); var dragDone = false; if (this._dragInfo != null) { dragDone = this._dragStop(true);
if (document.removeEventListener) { document.removeEventListener("mousemove", node.onmousemove, true);
document.removeEventListener("mouseup", node.onmouseup, true); } else node.releaseCapture(false);
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; }; zf_PhotoGrid.prototype._clickSelect
= function(e, node, item, down) { ; ; ; var ctrl = false; var shift = false; if (this._selectionMode
== zf_PhotoGrid.Multiple) { ctrl = e.ctrlKey || e.metaKey; shift = e.shiftKey; } if ((ctrl || shift)
&& !down) return; var change = false; var anchor = this._anchor; if (ctrl) { if (item.selected)
change = this._deselectItem(item, node); else if (!item.selected) change = this._selectItem(item,
node); this._anchor = item; } else if (shift && anchor != null && anchor != item) { var deselect
= []; var itemIndex = item.index; var anchorIndex = anchor.index; for (var id in this._selected)
{ var sel = this._selected[id]; var 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; var 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);
change = 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) { if (this._deselectAll() && this.onselchange != null) this.onselchange(null);
} }; 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];
if (item == null) { if (!this._pendingSelect[index]) { this._pendingSelect[index] = true; return true;
} return false; } } else if (typeof(item) != "object") item = this._items[item]; if (item == null
|| item.selected) return false; if (this._selectionMode == zf_PhotoGrid.Single || this._selectionMode
== zf_PhotoGrid.SingleForced) { var other = this.getSelectedItem(); if (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, null, "pg-selected"); item.selected = true; return true;
}; zf_PhotoGrid.prototype._deselectItem = function(item, node) { if (typeof(item) == "number")
{ var index = item; if (index < 0 || index >= this._items.length) return false; item = 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]; if (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, "pg-selected",
null); item.selected = false; return true; }; zf_PhotoGrid.prototype._deselectAll = function(item)
{ var change = false; for (var id in this._selected) { var sel = this._selected[id]; if (sel != item)
{ if (sel._view != null) zf_stdReplaceClassName(sel._view.id, "pg-selected", null); sel.selected
= false; 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;
zf_PhotoGrid.prototype.deselectItem = zf_PhotoGrid.prototype._deselectItem; zf_PhotoGrid.prototype.deselectAll
= zf_PhotoGrid.prototype._deselectAll; zf_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); delete this._items[item.id]; delete this._selected[item.id];
} else delete this._pendingSelect[index]; } this._items.splice(first, last - first); };
; function zf_Pager(id, width, size, current, flags) { ; ; ; ; zf_Control.prototype.constructor.call(this,
id); this._width = width; this._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; this.update = zf_stdMakeDeferred(this.id + ".update", this._update);
if (size > 0 && !this._noUpdate) this.update(size, current); if (this._showAll) { this._linkEvent("a",
"onall"); this._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; }; 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"); var 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; if (mode == zf_Pager.All) this._update(0, 0, false); this._mode
= mode; }; zf_Pager.prototype._update = function(size, current, fromEvent) { 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, maxSlots); 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); for (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; var 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,
1, 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,
this._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, remainder -
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, remainder,
this._size); } else { node = this._updatePageButtons(node, 1, 1); node = this._updateEllipsis(node,
current - halfWidth - 1); node = this._updatePageButtons(node, current - halfWidth, current + 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); backNode.onclick
= zf_stdFalse; nextNode.onmousedown = this._getHandler(current + 1); nextNode.onclick = zf_stdFalse;
this._setStyleHandlers(backNode); this._setStyleHandlers(nextNode); backNode.style.visibility = (current
> 0) ? "inherit" : "hidden"; nextNode.style.visibility = (current < size - 1) ? "inherit" : "hidden";
backNode = null; nextNode = null; parentNode = null; if (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, i.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; node.className = "pager-color3 pager-bgcolor3 pager-border3 pager-c";
} this._setStyleHandlers(node); node.onclick = zf_stdFalse; if (i >= 10) node.style.width = "auto";
else node.style.cssText = ""; node = node.nextSibling; } return node; }; zf_Pager.prototype._updateEllipsis
= function(node, page) { node.href = "#"; zf_stdSetText(node, "..."); node.className = "pager-color1 pager-bgcolor1 pager-border1";
node.onmousedown = this._getHandler(page - 1); node.onclick = zf_stdFalse; this._setStyleHandlers(node);
node.style.cssText = ""; 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; this.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; this.blur(); if (self[handler]) self[handler].apply(self);
return false; }; this._setStyleHandlers(node); node.onclick = zf_stdFalse; node.style.width = "auto";
node = null; }; zf_Pager.prototype._setStyleHandlers = function(node) { node.onmouseover = function()
{ var className = this.className.split(' '); if (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"; this.className = className.join(' '); }; node.onmouseout = function()
{ var className = this.className.split(' '); if (className[0] == "pager-color2") className[0] = "pager-color1";
if (className[1] == "pager-bgcolor2") className[1] = "pager-bgcolor1"; if (className[2] == "pager-border2")
className[2] = "pager-border1"; this.className = className.join(' '); }; };
; function zf_Prefetch(id, slots) { zf_Control.prototype.constructor.call(this, id); var i = 0;
var self = this; var append = function() { var item = document.createElement("DIV"); item.className
= "prefetch-" + i; self.dom().appendChild(item); item = null; if (++i < slots) setTimeout(append,
200); }; 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); if (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)); b.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; }
; var _zf_sha256Init = [ 0x6A09E667, -0x4498517B, 0x3C6EF372, -0x5AB00AC6, 0x510E527F, -0x64FA9774,
0x1F83D9AB, 0x5BE0CD19 ]; var _zf_sha256Roots = [ 0x428A2F98, 0x71374491, -0x4A3F0431, -0x164A245B,
0x3956C25B, 0x59F111F1, -0x6DC07D5C, -0x54E3A12B, -0x27F85568, 0x12835B01, 0x243185BE, 0x550C7DC3,
0x72BE5D74, -0x7F214E02, -0x6423F959, -0x3E640E8C, -0x1B64963F, -0x1041B87A, 0x0FC19DC6, 0x240CA1CC,
0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, -0x67C1AEAE, -0x57CE3993, -0x4FFCD838, -0x40A68039,
-0x391FF40D, -0x2A586EB9, 0x06CA6351, 0x14292967, 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
0x650A7354, 0x766A0ABB, -0x7E3D36D2, -0x6D8DD37B, -0x5D40175F, -0x57E599B5, -0x3DB47490, -0x3893AE5D,
-0x2E6D17E7, -0x2966F9DC, -0x0BF1CA7B, 0x106AA070, 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, 0x748F82EE, 0x78A5636F, -0x7B3787EC, -0x7338FDF8,
-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, 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, 0x00,
0x00, 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,
len - 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; } 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); var 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]; var 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); var 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]; h = 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;
res[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,
data.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); out.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) { if ($('#page-frame').addClass('no-flash').length
== 0) { $('.frame:first').addClass('no-flash'); } } }; zf_Flash.show = function() { ; if (--zf_Flash._hideCount
== 0) { if ($('#page-frame').removeClass('no-flash').length == 0) { $('.frame:first').removeClass('no-flash');
} } }; zf_Flash.installed = function(majorVersion, minorVersion, revision) { var isIE = navigator.appVersion.indexOf("MSIE")
!= -1; var isWin = navigator.appVersion.toLowerCase().indexOf("win"); var 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"]; if (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); } 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"; ; } 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"; ; } else if
(isIE && isWin && !isOpera) { version = zf_Flash._getVersionActiveX(); } if (version == -1) { ;
return false; } ; var parsed = version.split("."); var parsedMajor = parseInt(parsed[0]); var 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); if (revision) return (parsedRevision > revision); return true;
} return true; } return true; }; zf_Flash.createHtml = function(id, classes, src, vars, transparent,
width, height) { var fvars = []; $.each(vars, function(k, v) { fvars.push(k + "=" + escape(v != null
? v : "")); }); var html = null; var bgcolor = ""; if (vars.bgcolor) bgcolor = ' bgcolor="' + vars.bgcolor
+ '"'; html = [ '<embed', ' id="', id, '"', ' class="', classes, ' zfflash', '"', ' src="', src, '"',
' quality="high"', ' width="', width ? width : 1, '"', ' height="', height ? height : 1, '"', bgcolor,
' align=""', ' type="application/x-shockwave-flash"', ' pluginspage="', zf_Flash.pluginPage, '"',
' allowFullScreen="true"', transparent ? ' wmode="transparent"' : '', ' allowScriptAccess="always"',
' flashvars="', fvars.join("&"), '">', '</embed>' ]; return html.join(""); }; 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");
version = "WIN 6,0,21,0"; axo.AllowScriptAccess = "always"; version = axo.GetVariable("$version");
; } catch (e) { } } if (!version) { try { axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
version = 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; version = 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; else 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); } 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(); } } 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, data);
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)
{ ; ; 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, 1); 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) { ; } this._keys = []; this._data = {}; }; var zf_storage = null; if (typeof(jQuery)
!= "undefined") { $(function() { try { if (window.localStorage) zf_storage = new zf_Storage(window.localStorage);
else 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(); } }); }
; function zf_stdPost(url, data) { if (zf_stdPost.counter == null) zf_stdPost.counter = 0; else
++zf_stdPost.counter; var domForm = document.createElement("FORM"); domForm.id = domForm.name = "__zf_form"
+ zf_stdPost.counter; domForm.method = "post"; domForm.action = url; domForm.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]; domForm.appendChild(domInput); }
var domBody = document.getElementsByTagName("BODY")[0]; domBody.appendChild(domForm); domForm.submit();
} function zf_stdSetOpacity(dom, opacity) { dom.style.opacity = opacity; }
; 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) { ;
if (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"; this.dom().style.display = style; }; zfl_Control.prototype.notifyResize
= function(deferred) { if (this.onresize) this.onresize(deferred); };
; function zfl_Curtain(id) { zfl_Control.prototype.constructor.call(this, id); var self = this;
this._animation = new zf_Animation( { "darkest": 90, "dark" : 70, "light": 50, "hide" : 0 }, function(v)
{ zf_stdSetOpacity(self.dom(), v / 100); } ); } zfl_Curtain.inherits(zfl_Control); zfl_Curtain.show
= function(style, speed, callback, parentNode) { var current = zfl_Curtain._current; if (!current)
{ var dom = document.createElement("DIV"); dom.id = "dimmer"; parentNode = parentNode ? parentNode
: document.body; parentNode.appendChild(dom); $("#page-frame").addClass("page-dimmed"); zf_Flash.hide();
zfl_Curtain._current = current = new zfl_Curtain(dom.id); current._resizeHandler = current.eventHandler(current._window_onresize);
zf_stdAttachEvent(window, "resize", current._resizeHandler); } zfl_Curtain._current._show(style,
speed, callback); zfl_Popup.hideAny(); }; zfl_Curtain.hide = function() { var current = zfl_Curtain._current;
if (!current) return; current._hide(); var dom = current.dom(); zf_stdDetachEvent(window, "resize",
current._resizeHandler); dom.parentNode.removeChild(dom); zfl_Curtain._current = null; $("#page-frame").removeClass("page-dimmed");
zf_Flash.show(); }; zfl_Curtain.prototype._show = function(style, speed, callback) { if (!style)
style = "light"; if (speed) this._animation.animate(style, speed, callback); else { this._animation.jump(style);
if (callback) callback(); } }; zfl_Curtain.prototype._hide = function() { this._animation.jump("hide");
}; zfl_Curtain.prototype._window_onresize = function() { };
; ; function zf_MulticastDelegate(owner) { this._owner = owner; this._list = []; } 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,
1); 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 = {}; zfl_PasswordManager.pending
= {}; zfl_PasswordManager.hints = {}; zfl_PasswordManager.notify = new zf_MulticastDelegate(zfl_PasswordManager);
zfl_PasswordManager.init = function(ids) { ; for (var i = 0; i < ids.length; i++) this.unlocked[ids[i]]
= true; }; zfl_PasswordManager.subscribe = function(realmId, onunlock) { if (this.unlocked[realmId])
zf_stdDeferCall(null, onunlock); else if (this.pending[realmId]) this.pending[realmId].push(onunlock);
else this.pending[realmId] = [ onunlock ]; }; zfl_PasswordManager.retrieveHint = function(realmId,
onhint) { var existing = this.hints[realmId]; if (existing !== null && existing !== undefined)
{ zf_stdDeferCall(null, onhint, null, existing === false ? null : existing); return; } var self
= this; zf_stdServerRequest( "POST", "/zf/layout/layout.asmx", "GetPasswordHint", [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; onhint(res); }); }; zfl_PasswordManager.validate
= function(realmId, password, onpassword) { if (this.unlocked[realmId]) { zf_stdDeferCall(null,
onpassword, null, true); return; } var self = this; zf_stdServerRequest( "POST", "/zf/app/manage.asmx",
"RegisterRealmPassword", [realmId, password], function(status, retVal) { if (status != 200 || retVal.error
!= null || !retVal.result) { onpassword(false); return; } self.unlocked[realmId] = true; var subscribers
= self.pending[realmId]; self.pending[realmId] = null; if (subscribers) { for (var i = 0; subscribers
&& i < subscribers.length; i++) subscribers[i](); } onpassword(true); self.notify.invoke(); });
};
; function zfl_stdTransformResponse(source, name) { 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); zf_stdPreventDefault(e); var args = []; for (var i = 3;
i < arguments.length; i++) args.push(arguments[i]); method.apply(self, args); }
; ; function zfl_Column(id, stretcherId, waterlines, decorated) { zfl_Control.prototype.constructor.call(this,
id); if (stretcherId != null && document.getElementById(stretcherId) != null) this.stretcherId = stretcherId;
this._waterlines = []; for (var i = 0; i < waterlines.length; i++) { var w = waterlines[i]; if (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(); var cyTotal; if (this.hasWaterline) { var above = zf_stdGetHeightAbove(domSelf);
var offset = this._getWaterlineOffset(domSelf); cyTotal = above + offset; ; } else { cyTotal = zf_stdGetHeightOverall(domSelf);
; } if (this.stretcherId != null) { var domStretcher = document.getElementById(this.stretcherId);
var cyStretcher = zf_stdGetHeightOverall(domStretcher); cyTotal -= cyStretcher; ; } ; 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);
cyStretcher = zf_stdGetHeightOverall(domStretcher); } ; return cyTotal - cyStretcher; }; zfl_Column.prototype.stretch
= function(height) { var stretcher = document.getElementById(this.stretcherId); if (this.onstretch
&& this.onstretch(height, stretcher)) { var actual = stretcher.offsetHeight; actual += zf_stdExtractPixels(zf_stdGetCurrentStyle(
stretcher, 'margin-top', 'marginTopWidth')); actual += zf_stdExtractPixels(zf_stdGetCurrentStyle(
stretcher, 'margin-bottom', 'marginBottomWidth')); this.updateDecoration(); return actual; } height
-= zf_stdGetHeightAbove(stretcher); height -= zf_stdGetHeightBelow(stretcher); stretcher.style.height
= height + "px"; this.updateDecoration(); return height; }; zfl_Column.prototype.updateDependencies
= function() { if (this.dependencies) { for (var i = 0; i < this.dependencies.length; i++) { var
control = this.dependencies[i]; if (control && control.oncolumnresize instanceof Function) control.oncolumnresize(this);
} } }; zfl_Column.prototype.updateDecoration = function() { }; zfl_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; if (offset == null) offset = wo; else offset
= Math.min(offset, wo); } return offset; };
; ; function zfl_Button(id, callback) { zfl_Control.prototype.constructor.call(this, id); this._callback
= callback; this.clickable = true; } zfl_Button.inherits(zfl_Control); zfl_Button._abutton_onmouseover
= function(btn) { zf_stdReplaceClassName(btn, "button-bgcolor1", "button-bgcolor2"); zf_stdReplaceClassName(btn,
"button-color1", "button-color2"); zf_stdReplaceClassName(btn, "button-border1", "button-border2");
}; zfl_Button._abutton_onmouseout = function(btn) { zf_stdReplaceClassName(btn, "button-bgcolor2",
"button-bgcolor1"); zf_stdReplaceClassName(btn, "button-color2", "button-color1"); zf_stdReplaceClassName(btn,
"button-border2", "button-border1"); }; zfl_Button.enableButton = function(btn, enable) { zf_stdReplaceClassName(btn,
enable ? "button-bgcolor3" : null, enable ? null : "button-bgcolor3"); zf_stdReplaceClassName(btn,
enable ? "button-color3" : null, enable ? null : "button-color3"); zf_stdReplaceClassName(btn,
enable ? "button-border3" : null, enable ? null : "button-border3"); zf_stdReplaceClassName(btn,
enable ? "abutton-disabled" : null, enable ? null : "abutton-disabled"); for (var icon = btn.firstChild;
icon != null; icon = icon.nextSibling) { if (zf_stdHasClassName(icon, "icon")) { zf_stdReplaceClassName(icon,
enable ? "icon-disabled" : null, enable ? null : "icon-disabled"); return; } } }; zfl_Button.createHtml
= function(id, label, classes) { ; classes = classes == null ? [] : classes; classes = ["button",
"button-font1"].concat(classes); classes = classes.join(" "); var stdclass = "standard button-color1 button-bgcolor1 button-border1";
var over = "this.className='hover button-color2 button-bgcolor2 button-border2'"; var out = "this.className='standard button-color1 button-bgcolor1 button-border1'";
return [ '<div class="', classes, '"', (id == null ? [] : [' id="', id, '"']), '>', '<div class="',
stdclass, '" onmouseover="', over, '" onmouseout="', out, '">', '<div class="left"></div>', '<div class="right"></div>',
'<div class="middle">', '<div class="label">', zf_stdHtmlEncode(label), '</div>', '<div class="icon"></div>',
'</div>', '</div>', '</div>' ].join(""); }; zfl_Button.prototype._button_onclick = function() {
if (this._callback && this.clickable) this._callback(); return false; };
; ; function zfl_Bin(id) { zfl_Control.prototype.constructor.call(this, id); 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, cookieMask = 0, cookieBit = 0; var cookieIndex = parseInt(this.dom().getAttribute("zf:cookie"));
if (!isNaN(cookieIndex)) { cookieValue = parseInt(zf_stdGetCookie("zf_10y_lbinv")); if (isNaN(cookieValue))
cookieValue = 0; cookieMask = parseInt(zf_stdGetCookie("zf_10y_lbinm")); if (isNaN(cookieMask))
cookieMask = 0; cookieBit = 1 << cookieIndex; } var domState = this.dom("state"); if (this.expanded)
{ zf_stdReplaceClassName(domState, "bin-collapsed", "bin-expanded"); cookieValue = cookieValue | cookieBit;
cookieMask = cookieMask | cookieBit; } else { zf_stdReplaceClassName(domState, "bin-expanded", "bin-collapsed");
cookieValue = cookieValue & ~cookieBit; cookieMask = cookieMask | cookieBit; } if (!isNaN(cookieIndex))
{ zf_stdSetCookie("zf_10y_lbinv", cookieValue, new 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()); var scroll = zf_stdGetClientScroll();
var binHeight = this.$().outerHeight(true) + 40; var clientHeight = zf_stdGetClientHeight(); if
(scroll.cy + clientHeight - 100 < offset.cy) { scroll = offset.cy + Math.min(clientHeight - 10, binHeight)
- clientHeight; $('html').animate({ scrollTop: scroll }, 300); } } }; zfl_Bin.prototype._feeds_onclick
= function(e) { zf_stdStopPropagation(e); zf_stdPreventDefault(e); if (this.onfeeds != null) this.onfeeds(zf_stdGetEventSource(e));
}; zfl_Bin.prototype.setTitleSuffix = function(suffix) { this.$dom("title-suffix") .toggleClass('none',
!suffix) .html(suffix); };
; ; 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);
zfl_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));
this.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); this.display(true);
} }; zfl_Pair.formatters["PhotoPage.Taken"] = function(photo) { if ((photo.access.mask & zf_AccessMask.ProtectDateTaken)
!= 0) { this.display(false); } 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"); var 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">', text, '</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) {
; ; 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, function() { self._formatter(obj);
}, function() { self.showLoading(); } ); } this.current = obj; };
; ; function zfl_PhotoSelection(scope) { this._scope = scope; this._selection = {}; } zfl_PhotoSelection._storage_prefix
= "layout.selection."; zfl_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]); var changed = false; var selection = this._selection; $.each(photoIds,
function(k, v) { changed = changed || !selection[v]; selection[v] = v; }); if (changed && this.onchange)
this.onchange(); return 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; } if (!$.isArray(photoIds)) return this.unselect([photoIds]); var
changed = false; var selection = this._selection; $.each(photoIds, function(k, v) { changed = changed
|| selection[v]; delete selection[v]; }); 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); if (!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; offset
< data.length; offset += 8) { var decoded = parseInt(data.substr(offset, 8), 16); ; if (isNaN(decoded))
return self; selection[decoded] = decoded; } ; self._selection = selection; return 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); return; } var data = ["v1", this._scope ? this._scope : "", ","]; var count = 0; $.each(this._selection,
function(k, v) { ; var encoded = v.toString(16); ; if (encoded.length < 8) data.push(zfl_PhotoSelection._paddings[8
- encoded.length]); data.push(encoded); ++count; }); zf_storage.setItem(zfl_PhotoSelection._storage_prefix
+ key, data.join("")); ; }; zfl_PhotoSelection.prototype.get = function() { var ids = []; $.each(this._selection,
function(k, v) { ids.push(v); }); return ids; };
; ; ; function zfl_SearchInput(id, customize) { zfl_Control.prototype.constructor.call(this, id);
this._customize = customize; } zfl_SearchInput.inherits(zfl_Control); zfl_SearchInput.prototype.search
= function(verb) { var uri = null; if (verb == "browse") { uri = ["http://", zf_defaultHost, "/zf/search/"].join("");
uri = zf_stdGetTransferUrl(uri); } else { var search = this.dom("input"); if (!search.edited) {
; return; } var query = encodeURIComponent(search.value); if (verb == "global") { uri = ["http://",
zf_defaultHost, "/zf/search/#q=", query].join(""); uri = zf_stdGetTransferUrl(uri); } else if (verb
== "local") { zf_stdSetCookie("zfl_search", "", null, true, true); uri = "/?q=" + query; if (this._customize)
uri += "&customize=" + this._customize; } } if (uri) location.href = uri; }; zfl_SearchInput.prototype._menuitem_onmouseover
= function(item) { zf_stdReplaceClassName(item, null, "hover"); zf_stdReplaceClassName(item, null,
"header-bgcolor4"); var a = item.getElementsByTagName("A"); if (a.length > 0) a[0].className = "header-color2";
}; zfl_SearchInput.prototype._menuitem_onmouseout = function(item) { zf_stdReplaceClassName(item,
"hover", null); zf_stdReplaceClassName(item, "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.value == "SEARCH") item.value = ""; item.edited = true; }; zfl_SearchInput.prototype._input_onblur
= function(item) { if (zf_stdTrim(item.value) == "") { item.value = "SEARCH"; item.edited = false;
} }; zfl_SearchInput.prototype._input_onkeydown = function(e) { e = zf_stdGetEvent(e); if (e.keyCode
== 13) { zf_stdPreventDefault(e); zf_stdStopPropagation(e); this.dom("input").blur(); this.search("local");
} }; zfl_SearchInput.prototype._showMenu = function(show) { var menu = this.dom("menu"); if (menu)
menu.style.visibility = show ? "visible" : "hidden"; }; zfl_SearchInput.prototype._onmouseout = function(e)
{ e = zf_stdGetEvent(e); var 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); };
; function zfl_Header(id, collapsibleSearch) { zfl_Control.prototype.constructor.call(this, id);
this._search_slider_delay = new zf_DelayedInvoke(800); var self = this; if (collapsibleSearch)
{ this.$dom("search-slider") .mouseenter(this.closure(this._slider_search_onmouseenter)) .mouseleave(this.closure(this._slider_search_onmouseleave));
} } 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);
if (search.length > 0) search += "&customize=1"; else search = "?customize=1"; location.href = location.pathname
+ search + location.hash; }; zfl_Header.login = function(comeback, verb) { var href = comeback ? comeback
: location.href; href = encodeURIComponent(href); var url = ["https://", zf_defaultHost, "/zf/login.aspx",
"?success=", href, "&cancel=", href]; if (verb) url.push("&signup=", verb); location.href = zf_stdGetTransferUrl(url.join(""));
}; 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; if (this.current && this.current.loaded) href = this.current.getHref("full");
else href = location.href; var url = [ "http://", zf_defaultHost, "/zf/logout.aspx", "?uri=", encodeURIComponent(href),
"&token=", zf_stdGetCookie("zf_token") ]; location.href = zf_stdGetTransferUrl(url.join("")); };
zfl_Header.prototype.update = function(photo) { }; zfl_Header.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, "lb")) return; } } this._search_slider_delay.clear();
this.$dom("search-slider") .removeClass("collapsed") .animate( { width: "204px" }, { duration: "fast",
easing: "swing", queue: false, complete: function() { $(this).addClass("expanded"); } }); }; zfl_Header.prototype._slider_search_onmouseleave
= function() { var self = this; this._search_slider_delay.invoke(function() { $(self.dom("search-slider"))
.removeClass("expanded") .animate( { width: "22px" }, { duration: "slow", easing: "swing", queue:
false, complete: function() { $(this).addClass("collapsed"); } }); }); };
; 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, height) { var i; var sb = []; var sgprefix, sgsuffix; var elements; if (!type || type
== "system") { if (width <= 300 && height <= 300) { zfl_DecorationInfo._getSystemShadowHtml( sb,
className, name, size, left, top, width, height); } else { zfl_DecorationInfo._getSystemShadowHtml(
sb, className, name, size, left, top, width, height, "left"); zfl_DecorationInfo._getSystemShadowHtml(
sb, className, name, size, left, top, width, height, "right"); zfl_DecorationInfo._getSystemShadowHtml(
sb, className, name, size, left, top, width, height, "top"); zfl_DecorationInfo._getSystemShadowHtml(
sb, className, 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", left: 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, width: 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, width: 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, width: size, height: size } ]; sgprefix = 'background-image:url(/zf/img/layout/presets/';
sgsuffix = '.png)'; for (i = 0; i < elements.length; i++) { zfl_DecorationInfo._getCustomShadowHtml(sb,
className, 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, top: 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 }, { 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, top: 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/'; sgsuffix = '.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, className, name,
size, left, top, width, height, side) { var inner = 16; var sgprefix, sgsuffix; var hostname = "";
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(""); } 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:', width, 'px;height:', height, 'px;', sgprefix, name, '.', size, '.', width-size*2, '.',
height-size*2, sgsuffix, '"></div>'); } else if (side == "left") { sb.push('<div class="', className
,'" style="left:', left, 'px;top:', top, 'px;width:', size+inner, 'px;height:', height, 'px;',
sgprefix, name, '.', size, '.', inner, '.', height-size*2, '.left', sgsuffix, '"></div>'); } 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, '.', size, '.', inner, '.',
height-size*2, '.right', sgsuffix, '"></div>'); } else if (side == "top") { sb.push('<div class="',
className ,'" style="left:', left+size+inner, 'px;top:', top, '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); sb.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, '.', size, '.',
width-size*2, '.', inner, '.bottom', sgsuffix, '"></div>'); } }; zfl_DecorationInfo._getCustomShadowHtml
= function(sb, className, name, info, sgprefix, sgsuffix) { sb.push( '<div class="', className, '" style="left:',
info.left, 'px;top:', info.top, 'px;width:', info.width, 'px;height:', info.height, 'px;', sgprefix,
name, '-', info.part, sgsuffix, '"></div>'); };
; function zf_AddToCart(id, decoration) { zf_Control.prototype.constructor.call(this, id); var self
= this; this._document_onkeydown = function(e) { if (e.keyCode == 27) self.hide(); }; this._defaultTitle
= this.$dom('title').text(); if (decoration) this.setDecorationInfo(decoration); } zf_AddToCart.inherits(zf_Control);
zf_AddToCart.prototype.setDecorationInfo = function(decorationInfo) { this._decorationInfo = decorationInfo;
}; zf_AddToCart.prototype.show = function(cart, titleOrCategory, currency) { if (arguments.length
== 3) { this._cart = null; this._productMap = cart; this._photos = []; this._initCategoryId = titleOrCategory;
} else { this._cart = cart; this._productMap = null; this._photos = null; this._hasPhotos = false;
this.$dom('title').text(titleOrCategory ? titleOrCategory : this._defaultTitle); } $(document).bind('keydown',
this._document_onkeydown); zf_stdSetText(this.dom("subtitle"), "Loading..."); this.dom("header").innerHTML
= ""; $('.addToCart-view', this.dom()).css('visibility', 'hidden'); this._shadow = zf_AddToCart._showPopup(this.dom());
this._returnUrl = null; if (this._init == null) { var self = this; zf_stdLoadScript("cart.js",
function() { if (self._photos != null) self._init(currency); }); } else if (this._photos != null)
this._init(currency); }; zf_AddToCart.prototype.selectProduct = function(vendorId, productId) {
var pref = [ '', vendorId, '', productId ].join(':'); zf_stdSetCookie('zf_cartpref', pref); if (this._pricing
&& this._hasPhotos) this._renderUI(); }; zf_AddToCart.prototype.setPhoto = function(photo, defaultList)
{ ; this._photos = [ photo ]; this._singlePhoto = true; this._defaultList = defaultList; this._hasPhotos
= true; if (this._init) this._init(); }; zf_AddToCart.prototype.setPhotos = function(photos, defaultList)
{ ; ; this._photos = photos; this._singlePhoto = false; this._defaultList = defaultList; this._hasPhotos
= true; if (this._init) this._init(); }; zf_AddToCart.prototype.setReturnUrl = function(returnUrl)
{ this._returnUrl = returnUrl; }; zf_AddToCart.prototype.hide = function() { this.dom().style.visibility
= "hidden"; $(document).unbind('keydown', this._document_onkeydown); if (typeof(zfl_Curtain) != "undefined")
zfl_Curtain.hide(); else { zf_dialogHideShadow(this._shadow); this._shadow = null; } }; zf_AddToCart.navigateToCart
= function() { var url = "http://" + zf_defaultHost + "/zf/cart/cart.aspx"; url = zf_stdGetTransferUrl(url);
var navigate = function() { location.href = url; }; if (typeof(_zfl_init) == "undefined" || zf_stdGetCookie("zf_cartredir")
!= null) { navigate(); return; } zf_AddToCart._showWait(null, "Opening your Shopping Cart managed by a fulfillment company...");
setTimeout(navigate, 2600); zf_stdSetCookie("zf_cartredir", "1"); }; zf_AddToCart.getShippingZone
= function(pricelist) { var szCode = zf_stdGetCookie('zf_shipzone'); if (!szCode) szCode = 'US';
if (szCode.length > 2 && szCode.charAt(0) == '!') { szCode = szCode.substring(1); } else { var vendors
= pricelist.getVendorIds(); var hasMpix = vendors['mpix'] == true; var hasPhotobox = vendors['photobox']
== true; if (hasMpix && !hasPhotobox) szCode = szCode == 'CA' ? szCode : 'US'; else if (!hasMpix
&& hasPhotobox) szCode = (szCode == 'CA' || szCode == 'US') ? 'WW' : szCode; } var zone = zf_ShippingZone.all[szCode];
; return zone; }; zf_AddToCart.setShippingZone = function(shippingZone) { var code = shippingZone
instanceof zf_ShippingZone ? shippingZone.code : shippingZone; zf_stdSetCookie('zf_shipzone', '!'
+ code, null, true); }; zf_AddToCart._showWait = function(id, message) { var popupNode = document.createElement("DIV");
popupNode.className = "addToCart popup popup-bgcolor2" + " popup-border1 popup-color1 popup-font1";
popupNode.innerHTML = [ '<div class="addToCart-redir">', '<img src="/zf/img/image-wait.gif" />',
zf_stdHtmlEncode(message), '</div>' ].join(""); if (id != null) popupNode.id = id; return zf_AddToCart._showPopup(popupNode);
}; zf_AddToCart._showPopup = function(popupNode) { document.body.appendChild(popupNode); var displayStyle
= zf_stdGetCurrentStyle(popupNode, "display"); if (!displayStyle || displayStyle == "none") { popupNode.style.top
= "0px"; popupNode.style.left = "0px"; popupNode.style.visibility = "hidden"; popupNode.style.display
= "block"; } var width = popupNode.offsetWidth; var height = popupNode.offsetHeight; var handle
= null; var left = Math.max(0, ((zf_stdGetClientWidth() - width) / 2)); var top = Math.max(0, (2 *
(zf_stdGetClientHeight() - height) / 5)); top += document.documentElement.scrollTop; popupNode.style.left
= left + "px"; popupNode.style.top = top + "px"; if (typeof(zfl_Curtain) != "undefined") zfl_Curtain.show();
else handle = zf_dialogShowShadow(popupNode); popupNode.style.visibility = "inherit"; popupNode
= null; return handle; }; zf_AddToCart.prototype._button_onclick = function(node, method) { if (!zf_stdHasClassName(node,
"disabled")) this[method].call(this, node); }; zf_AddToCart.prototype._button_onmouseover = function(node)
{ var btn = $(node); if (!btn.hasClass("disabled")) { btn.removeClass("standard button-color1 button-bgcolor1 button-border1");
btn.addClass("hover button-color2 button-bgcolor2 button-border2"); } }; zf_AddToCart.prototype._button_onmouseout
= function(node) { var btn = $(node); if (!btn.hasClass("disabled")) { btn.removeClass("hover button-color2 button-bgcolor2 button-border2");
btn.addClass("standard button-color1 button-bgcolor1 button-border1"); } };
; function zf_CartSummary(size, currency) { this.size = size ? size : 0; this.currency = currency;
this.change = new zf_MulticastDelegate(this); } zf_CartSummary.prototype.applyUpdate = function(update)
{ if (typeof(update) == "number") { this.size = update; if (this.size == 0) this.currency = null;
return this; } this.size = update.cartSize; if (this.size == 0) this.currency = null; else if (update.added.length
> 0) this.currency = update.added[0].currency; else if (update.updated.length > 0) this.currency
= update.updated[0].currency; this.change.invoke(this); return this; };
; function zfl_ZenBar(id, cart, addToCart, decorAddToCart, hidden) { zfl_Control.prototype.constructor.call(this,
id); this.cart = cart; this._addToCart = addToCart; this._hidden = hidden; if (addToCart) { addToCart.setDecorationInfo(decorAddToCart);
addToCart.onadd = this.closure(this._addtocart_onadd); } this._delayMenu = new zf_DelayedInvoke(400);
this.$(".zenbar-account-link,.zenbar-menu").hover( this.closure(this._menu_onmouseover), this.closure(this._menu_onmouseout));
if (zf_stdGetCookie("zf_zb_opensb")) setTimeout(this.closure(this.showScrapbook), 10); this._addtocart_onadd();
} zfl_ZenBar.inherits(zfl_Control); zfl_ZenBar.customize = function() { var search = location.search.replace(/(\?|&)customize=\d/g,
""); 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;
}; zfl_ZenBar.prototype.customize = function() { zfl_ZenBar.customize(); }; zfl_ZenBar.login = function(comeback,
verb) { var href = comeback ? comeback : location.href; href = encodeURIComponent(href); var url
= ["https://", zf_defaultHost, "/zf/login.aspx", "?success=", href, "&cancel=", href]; if (verb)
url.push("&signup=", verb); location.href = zf_stdGetTransferUrl(url.join("")); }; zfl_ZenBar.prototype.login
= function(verb) { var href = null; if (this.current && this.current.loaded) href = this.current.getHref("full");
zfl_ZenBar.login(href, verb); }; zfl_ZenBar.prototype.logout = function() { var href; if (this.current
&& this.current.loaded) href = this.current.getHref("full"); else href = location.href; var url =
[ "http://", zf_defaultHost, "/zf/logout.aspx", "?uri=", encodeURIComponent(href), "&token=", zf_stdGetCookie("zf_token")
]; location.href = zf_stdGetTransferUrl(url.join("")); }; zfl_ZenBar.prototype.checkout = function()
{ zf_AddToCart.navigateToCart(); }; zfl_ZenBar.prototype._menu_onmouseover = function(item) { var
self = this; this._delayMenu.clear(); var left = this.$(".zenbar-account-link").position().left
- 8; this.$(".zenbar-menu") .css("left", left) .removeClass("none"); }; zfl_ZenBar.prototype._menu_onmouseout
= function(item) { var self = this; this._delayMenu.invoke(function() { self.$(".zenbar-menu").addClass("none");
}); }; zfl_ZenBar.prototype._addtocart_onadd = function(update) { var cart = this.cart; if (!cart)
return; if (update) cart.applyUpdate(update); if (!this._updateVisibility()) return; if (!cart.size)
{ this.$().removeClass("zenbar-s-checkout"); return; } var text = zf_stdFormatString("Cart ({0} items)",
cart.size); this.$() .addClass("zenbar-s-checkout") .find(".zenbar-cart-link .text") .text(text);
}; zfl_ZenBar.prototype.setScrapbookInfo = function(scrapbook, scrapbookEdit) { this.scrapbook = scrapbook;
this._updateVisibility(); if (!this._updateVisibility()) return; this.$() .toggleClass("zenbar-s-scrapbook",
scrapbook != null); if (!scrapbook) return; this.$(".zenbar-scrapbook") .toggleClass("zenbar-s-scrapbook-edit",
scrapbookEdit != null); if (scrapbookEdit) { this.$(".zenbar-scrapbook .close") .get(0) .onclick
= function() { scrapbookEdit.hide(); return false; }; return; } var text = zf_stdFormatString("{0} ({1})",
scrapbook.name, scrapbook.photoCount); this.$(".zenbar-scrapbook .link") .text(text); this.$(".zenbar-scrapbook .sharer")
.toggleClass("none", !scrapbook.isSharedWith) .text(scrapbook.sharerName ? (scrapbook.sharerName
+ ": ") : ""); if (scrapbook.addedCount != undefined && scrapbook.addedCount + scrapbook.existedCount
> 0) { var parent = this.$(".zenbar-scrapbook"); parent .find(".back") .width(parent.width()) .css({
display: "block" }); parent .find(".link") .css({ color: "#D07A0F" }); parent .clearQueue() .delay(800)
.queue(function(next) { $(".back", this) .fadeOut(1000); $(".link", this) .animate({ color: "white"
}, { duration: 1000, queue: false }); next(); }); parent = null; } }; zfl_ZenBar.prototype.update
= function(photo) { this.current = photo; }; zfl_ZenBar.prototype._updateVisibility = function()
{ var visible = !this._hidden && (zf_userId || this.cart.size || this.scrapbook); this.$().toggleClass("none",
!visible); return visible; }; zfl_ZenBar.prototype.addToCart = function(title, vendorId, productId)
{ var popup = this._addToCart; popup.show(this.cart, title); popup.setReturnUrl(location.href);
if (vendorId && productId) popup.selectProduct(vendorId, productId); return function(photos) {
if (photos instanceof Array) popup.setPhotos(photos); else popup.setPhoto(photos); }; }; zfl_ZenBar.prototype.showScrapbook
= function() { if (this.onscrapbook) this.onscrapbook(); zf_stdRemoveCookie("zf_zb_opensb", true);
};
; ; function zfl_Footer(id) { zfl_Control.prototype.constructor.call(this, id); } zfl_Footer.inherits(zfl_Control);
zfl_Footer.prototype.login = function(verb) { var href = null; if (this.current && this.current.loaded)
href = this.current.getHref("full"); zfl_Header.login(href, verb); }; zfl_Footer.prototype.logout
= function() { var href; if (this.current && this.current.loaded) href = this.current.getHref("full");
else href = location.href; var url = [ "http://", zf_defaultHost, "/zf/logout.aspx", "?uri=", encodeURIComponent(href),
"&token=", zf_stdGetCookie("zf_token") ]; location.href = zf_stdGetTransferUrl(url.join("")); };
zfl_Footer.prototype.update = function(photo) { this.current = photo; };
; ; ; 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; zfl_Popup.prototype.show = function(domOrigin, constraint) { var domPopup = this.dom();
if (!this.embedded) { if (zfl_Popup.current != null) zfl_Popup.current.hide(); document.body.appendChild(domPopup.parentNode.removeChild(domPopup));
} var cxBody = document.body.offsetWidth; var cyBody = zf_stdGetClientHeight(); var ptOrigin = zf_stdGetOffset(domOrigin);
var xOrigin = ptOrigin.cx, yOrigin = ptOrigin.cy; var cxOrigin = domOrigin.offsetWidth; var cyOrigin
= domOrigin.offsetHeight; var cxPopup, cyPopup; var displayStyle = zf_stdGetCurrentStyle(domPopup,
"display"); if (!displayStyle || displayStyle == "none") { domPopup.style.top = "0px"; domPopup.style.left
= "0px"; domPopup.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); var 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"; domPopup.style.display = "block";
domPopup.style.visibility = "inherit"; if (!this.embedded) { zfl_Popup.current = this; setTimeout(function()
{ zf_stdAttachEvent(document.body, "mousedown", zfl_Popup._any_onclick); zf_stdAttachEvent(document.body,
"keypress", zfl_Popup._any_onkeypress); }, 10); } domPopup = null; domBody = null; domOrigin = null;
}; zfl_Popup.prototype.hide = function() { this.display(false); if (this.embedded) return; if (zfl_Popup.current
!= this) return; zf_stdDetachEvent(document.body, "mousedown", zfl_Popup._any_onclick); zf_stdDetachEvent(document.body,
"keypress", zfl_Popup._any_onkeypress); zfl_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; obj != 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();
}; zfl_Popup.hideAny = function() { if (zfl_Popup.current) zfl_Popup.current.hide(); };
; function zfl_Feeds(id) { if (zf_stdNoArgs(arguments)) return; zfl_Popup.prototype.constructor.call(this,
id, false); } zfl_Feeds.inherits(zfl_Popup);
; ; function zfl_MenuBar(id) { zfl_Control.prototype.constructor.call(this, id); this.$("a").hover(
function() { $(this).removeClass("menubar-color1").addClass("menubar-color2 menubar-bgcolor2");
}, function() { $(this).addClass("menubar-color1").removeClass("menubar-color2 menubar-bgcolor2");
}); } zfl_MenuBar.inherits(zfl_Control);
; var zfl_PhotoViewStyle = { FolderElement : "FolderElement", GalleryPhoto : "GalleryPhoto", PhotoNavList
: "PhotoNavList", PhotoNavThumbnail : "PhotoNavThumbnail", CurrentPhoto : "CurrentPhoto", DimLights
: "DimLights", BioPhoto : "BioPhoto", ProductCategory : "ProductCategory", Slideshow : "Slideshow",
CommentBrowser : "CommentBrowser" };
; ; function zf_Folder() { zf_Loadable.prototype.constructor.call(this); this.caption = ""; this.photos
= 0; this.subfolders = 0; this.galleries = 0; this.collections = 0; this.elements = []; } zf_Folder.inherits(zf_Loadable);
zf_Folder.prefix = "f"; zf_Folder._fields = [ "id", "title", "caption", "customReference", "created",
"modified", "photos", "galleries", "collections", "subfolders", "isEmpty", "sortOrder", "views",
"pricing", "theme" ]; zf_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);
cloned.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; }; zf_Folder.prototype.postSerialize
= function() { zf_Loadable.prototype.postSerialize.call(this); if (this.pricingKey != null) { this.pricing
= new zf_PricingInfo(null, this.pricingKey); this.pricing.isDerived = !!this.isPricingDerived;
} }; zf_Folder.prototype.getHref = function(style) { if (style == "edit") { return [ "http://",
zf_defaultHost, "/", this.owner.loginName, "/f", this.id, "/edit" ].join(""); } else { var m = location.search.match(/(customize=[1|2])/);
var query = m ? "?" + m[0] : ""; var href = []; if (style != null && style != "analytics") href.push("http://",
this.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) return "/" + this.customReference; return "/f" + this.id; };
; 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; this.type = type;
this.title = title; this.customReference = customReference; this.folders = []; this.done(); } this.items
= []; this.photos = 0; this.bytes = 0; this.views = 0; this.photoChangeNumber = 0; this.caption
= ""; this.keywords = []; this.category = 0; this.isRandomTitlePhoto = false; this.watermarkId =
0; } zf_PhotoSet.inherits(zf_Loadable); zf_PhotoSet.prefix = "p"; zf_PhotoSet.Gallery = "Gallery";
zf_PhotoSet.Collection = "Collection"; zf_PhotoSet._fields = [ "id", "type", "title", "caption",
"photos", "created", "modified", "sortOrder", "isRandomTitlePhoto", "views", "customReference",
"pricing", "watermarkId", "photoChangeNumber", "isFeatured", "category", "bytes", "theme" ]; zf_PhotoSet.clone
= function(photoSet) { if (photoSet == null) return null; var cloned = zf_stdCopyFields(new zf_PhotoSet(),
photoSet, zf_PhotoSet._fields); cloned.keywords = photoSet.keywords != null ? [].concat(photoSet.keywords)
: null; cloned.categories = photoSet.categories != null ? [].concat(photoSet.categories) : null;
cloned.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);
return 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; if (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];
}; zf_PhotoSet.prototype.getHref = function(style) { var m = location.search.match(/(customize=[1|2])/);
var query = m ? "?" + m[0] : ""; if (style == "edit") { return [ "http://", zf_defaultHost, "/", this.owner.loginName,
"/p", this.id, "/edit" ].join(""); } else if (style == "external") return "http://" + this.owner.domainName
+ this.getBaseHref() + query; else return this.getBaseHref() + query; }; zf_PhotoSet.prototype.getBaseHref
= function() { if (this.customReference != null) return "/" + this.customReference; return "/p" +
this.id; };
; function zf_PhotoMeta() { zf_Loadable.prototype.constructor.call(this); this.exif = {}; this.keywords
= []; this.categories = []; this.caption = ""; this.comments = 0; this.recentComments = []; } zf_PhotoMeta.inherits(zf_Loadable);
zf_PhotoMeta._fields = [ "categories", "category", "keywords", "caption", "exif", "comments", "recentComments"];
zf_PhotoMeta.requests = new zf_RequestQueue(200); zf_PhotoMeta.urgent = new zf_RequestQueue(1, 8);
zf_PhotoMeta.prototype.postSerialize = function() { zf_Loadable.prototype.postSerialize.call(this);
this.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, urgent) { ; ; ; ; 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, meta, zf_PhotoMeta._fields); self._synthesize(); self.done();
}; var params = [ this.photo.id, this.photo.flags, this.photo.metacn, this.photo.token, zf_userId
]; var queue = urgent ? zf_PhotoMeta.urgent : zf_PhotoMeta.requests; queue.enqueueEx("GET", "/zf/layout/layout.asmx",
"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);
}; 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, title: "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"; break; 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;
} 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}",
this.exif[0x829A].display, ap) }; } var accessType = photo.access.type; if (accessType != zf_AccessType.Public)
{ exif = this.exif[-5] = { tag: -5, title: "Access Control", display: "" }; if (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"; } 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, title: "Date uploaded",
display: zf_stdFormatDateTime(uploaded) }; } }; zf_PhotoMeta.prototype.addComment = function(message)
{ ; ; if (message instanceof Array) { for (var k = 0; k < message.length; k++) this.addComment(message[k]);
return; } ; ; ; if (this.comments == 0 || this.recentComments.length == 0 || this.recentComments[0].index
< message.index) { this.photo.flags |= zf_PhotoFlags.HasComments; ++this.comments; this.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, 1, 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, 0, 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; i < 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; };
; function zf_Photo() { zf_Loadable.prototype.constructor.call(this); zf_PhotoImage.prototype.constructor.call(this);
this.priceKey = ""; this.isPricingDerived = false; this.views = 0; this.fileType = ".jpg"; this.fileSize
= 0; this.flags = zf_PhotoFlags.None; this.metacn = 0; this.watermarkId = 0; this.isWatermarkDerived
= false; } zf_Photo.inherits(zf_PhotoImage, zf_Loadable); zf_Photo._fields = [ "access", "gallery",
"owner", "priceKey", "photoSet", "views", "uploaded", "taken", "title", "fileType", "fileSize", "flags",
"metacn", "fileName", "copyright", "isPricingDerived", "pricing", "watermarkId", "isWatermarkDerived"
].concat(zf_PhotoImage._fields); zf_Photo.prefix = "p"; zf_Photo.clone = function(photo) { return zf_stdCopyFields(new
zf_Photo(), photo, 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; owner = this.owner || scope.owner; } var
href = []; var m = location.search.match(/(customize=[1|2])/); var query = m ? "?" + m[0] : "";
if (style != null && style != "analytics") href.push("http://", owner.domainName); if (scope == null)
{ href.push("/?photo=", this.id); } else if (style == "edit") { href = [ "http://", zf_defaultHost,
"/", this.owner.loginName, "/p", this.gallery.id, "/edit#h", this.id.toString(16) ]; } else if (style
== "external" || style == "analytics") { href.push(scope.getBaseHref(), "/e", this.id.toString(16));
} else { href.push(scope.getBaseHref(), "/h", this.id.toString(16), query); } return href.join("");
}; zf_Photo.prototype.postSerialize = function() { this.image = this; zf_Loadable.prototype.postSerialize.call(this);
zf_BasicImage.prototype.postSerialize.call(this); if (this.title == null) this.title = ""; if (this.taken
!= null) this.taken.setMinutes(this.taken.getMinutes() + this.taken.getTimezoneOffset()); }; zf_Photo.prototype.getMeta
= function(urgent) { ; if (this._meta == null) { this._meta = new zf_PhotoMeta(); if (!this.loaded)
{ this._meta.setRequested(); var 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, height) { var options = [ { method: zf_ProcessingMethod.StandardSmallSize, mask:
0 }, { method: zf_ProcessingMethod.StandardMediumSize, mask: zf_AccessMask.ProtectMedium }, { method:
zf_ProcessingMethod.StandardLargeSize, mask: zf_AccessMask.ProtectLarge }, { method: zf_ProcessingMethod.StandardExtraLargeSize,
mask: zf_AccessMask.ProtectExtraLarge }, { method: zf_ProcessingMethod.StandardXXLargeSize, mask:
zf_AccessMask.ProtectXXLarge } ]; var method = null; var previous = null; for (var i = 0; i < options.length;
i++) { var option = options[i]; if ((option.mask & this.access.mask) != 0) continue; var size = this.getScaledSize(option.method);
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; };
; 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">', this._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;
child != null; child = 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; var 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) pad1.push([ "Galleries {0}", data.galleries ], [ "Collections {0}", data.collections
]); if ((data.access.mask & zf_AccessMask.ProtectDateModified) == 0) pad2.push([ "Modified {0}",
zf_stdFormatDate(data.modified)]); if (this.params.count) pad2.push([ "{0} photos", data.photos ]);
} else if (data instanceof zf_PhotoSet) { if ((data.access.mask & zf_AccessMask.ProtectVisits) ==
0) pad1.push([ "Visitors {0}", data.views ]); if (this.params.count) pad1.push(["{0} photos", data.photos
]); if ((data.access.mask & zf_AccessMask.ProtectDateCreated) == 0) pad2.push([ "Created {0}", zf_stdFormatDate(data.created)
]); if ((data.access.mask & zf_AccessMask.ProtectDateModified) == 0) pad2.push([ "Modified {0}",
zf_stdFormatDate(data.modified) ]); } if (pad1.length == 0) { var tmp = pad2; pad2 = pad1; pad1 =
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">', zf_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">'); for (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>'); } elements.push('</div>'); } return elements.join(""); };
; ; ; ; ; function zfl_InfoIconPlugin(params) { this.params = params != null ? params : {}; } zfl_InfoIconPlugin.prototype.getOuterContent
= function(id, context) { 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);
return ""; }; zfl_InfoIconPlugin.prototype.getInnerContent = function(id, context) { if (context
== null) return ""; var data = context.data; var access = context.data.access; var index = context.index;
var 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>');
else 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>');
} if (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, outer, 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; child != 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;
child = 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; else if (child.className == "pv-index") domPhotoIndex = child; } } if (domAccess) { switch
(context.data.access) { case zf_AccessType.Public: domAccess.className = "pv-ac ac-pub"; domAccess.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"; domAccess.title = "Password Protected";
break; case zf_AccessType.Protected: domAccess.className = "pv-ac ac-pro"; domAccess.title = "tooltipProtected";
break; default: break; } } if (domTypeIcon) { if (context.data instanceof zf_PhotoSet && context.data.type
== "Gallery") domTypeIcon.className = "pv-type gallery-icon"; else 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"; } if (domPhotoIndex)
{ zf_stdSetText(domPhotoIndex, context.index + 1); } }; zfl_InfoIconPlugin.prototype._access = function(accessType)
{ switch (accessType) { case zf_AccessType.Public: return ''; case 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>';
case 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; this.style = style;
this.params = params != null ? 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>'); if (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, context, smap) { if (context == null)
return ""; var data = context.data; var image = context.image; var method = context.method; var
folder = context.data instanceof zf_Folder; var elements = []; if ((!folder || this.params.fthumb)
&& this.info.shadowSize > 0) { var extent = this.info.shadowSize + this.info.borderSize; var size
= null; if (!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); if (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; if (shadow) { elements.push( zfl_DecorationInfo.getShadowHtml(
"pv-shadow", shadow, this.info.shadowType, this.info.shadowSize, left, top, width, height)); }
} if (folder && !this.params.fthumb || this.info.borderSize > 0) elements.push('<div class="pv-border"></div>');
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, cy: 60 }; if (method == zf_ProcessingMethod.StandardLargeThumbnail)
return { cx: 120, cy: 80 }; if (method == zf_ProcessingMethod.StandardVeryLargeThumbnail) return {
cx: 200, cy: 133 }; if (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; if (context.data instanceof zf_Folder && !this.params.fthumb)
{ if (isNew) outer.className += " folder"; return; } };
; function zfl_WaitAnimationPlugin(inner) { this._inner = inner; } 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" />'; }; 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" />'; };
; function zfl_CensoredPlugin() { } zfl_CensoredPlugin.prototype.getInnerContent = function(id, context)
{ if (!context.data.access.isCensored) return ''; if (context.method == zf_ProcessingMethod.StandardSmallThumbnail)
return ''; return '<div class="pv-censored">CENSORED</div>'; };
; function zfl_PhotoOverlayPlugin() { } zfl_PhotoOverlayPlugin.prototype.getInnerContent = function(id,
context) { return '<div class="pv-overlay"></div>'; };
; function zfl_SelectionPlugin() { this._callback = function(now, fx) { var pos = -(4 - Math.floor(now))
* 40; $(this).children().css({ backgroundPosition: pos + "px 0px" }); }; } zfl_SelectionPlugin.prototype.getOuterContent
= function(id, context) { return ""; }; zfl_SelectionPlugin.prototype.getInnerContent = function(id,
context) { ; ; if (!context.selection) return ""; return '<span class="pv-sl"><span class="pv-sl-icon"></span></span>';
}; zfl_SelectionPlugin.prototype.onCreateDom = function(view, outer, inner, context, isNew) { ;
; ; ; if (!context.selection) return; for (var child = inner.firstChild; child != null; child = child.nextSibling)
{ if (child.className.indexOf("pv-sl") == 0) { this._hookEvent(child, "onmouseover", this._inner_onmouseover,
context); this._hookEvent(child, "onmouseout", this._inner_onmouseout, context); } } }; zfl_SelectionPlugin.prototype._hookEvent
= function(element, name, callback, context) { ; ; ; var self = this; var old = element[name];
element[name] = function(e) { e = zf_stdGetEvent(e); callback.call(self, context, this, e); if (old)
old.call(this, this, e); }; }; zfl_SelectionPlugin.prototype._inner_onmouseover = function(context,
element, e) { for (var related = e.relatedTarget || e.fromElement; related != null; related = related.parentNode)
{ if (related == element) return; } var self = this; $(element) .addClass("pv-sh") .animate({ animation:
4 }, { duration: 150, easing: "linear", step: this._callback, queue: false }) .attr("title", "Click here to select this photo")
.get(0) .onclick = function() { return self._onclick(context, this); }; }; zfl_SelectionPlugin.prototype._inner_onmouseout
= function(context, element, e) { for (var related = e.relatedTarget || e.toElement; related != null;
related = related.parentNode) { if (related == element) return; } $(element) .removeClass('pv-sh')
.animate({ animation: 0 }, { duration: 150, easing: "linear", step: this._callback, queue: false })
.attr("title", null) .get(0) .onclick = null; }; zfl_SelectionPlugin.prototype._onclick = function(context,
element) { var id = context.data.id; var selection = context.selection; var selected = !selection.selected(id);
if (selected) { context.grid.selectItem(context.index); selection.select(id); } else { context.grid.deselectItem(context.index);
selection.unselect(id); } return false; };
; function zf_NoClickPlugin() { } zf_NoClickPlugin.prototype.onCreateDom = function(view, outer,
inner, context, isNew) { inner.onclick = zf_stdFalse; };
; ; 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"); if (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(); }; 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); this.current = photo; this.currentMeta
= null; if (photo.loaded) { this.set(photo, context); } else { var self = this; photo.advise(this,
function() { self.set(photo, context); }); } }; zfl_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; this.display((photo.access.mask & zf_AccessMask.ProtectComments) == 0); this._showAddLink(canAdd);
if ((photo.flags & zf_PhotoFlags.HasComments) == 0) { this.setCount(0); return; } var meta = photo.getMeta();
this.currentMeta = meta; if (meta.loaded) { this.setCount(meta.comments); } else { meta.bump();
var self = this; meta.advise(this, function() { self.setCount(meta.comments); }); } }; zfl_MailboxLink.prototype._showAddLink
= function(show) { var link = this.dom("add"); if (link) { zf_stdReplaceClassName(link, show ? "none"
: null, show ? null : "none"); } }; 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()); $('html').animate({ scrollTop:
offset.cy - 50 }, 300); };
; function zf_Analytics(propertyId) { this._queue = []; this._tracker = null; this._retries = 0;
if (propertyId != null && propertyId.length > 0) { this._propertyId = propertyId; zf_stdDeferCall(null,
this._init, this); } } zf_Analytics._MAX_RETRIES = 20; zf_Analytics.prototype.trackPageView = function(path)
{ if (this._propertyId == null) return; ; if (this._tracker != null) { ; zf_stdDeferCall(null, this._trackPageView,
this, path); } else { ; this._queue.push(path); } }; zf_Analytics.prototype.getPropertyId = function()
{ return this._propertyId; }; zf_Analytics.prototype._init = function() { ; ; var gaScript = (("https:"
== document.location.protocol) ? "https://ssl." : "http://www.") + "google-analytics.com/ga.js";
var script = document.createElement("SCRIPT"); script.type = "text/javascript"; script.src = gaScript;
document.body.appendChild(script); script = null; var self = this; setTimeout(function() { self._waitForTracker();
}, 500); ; }; zf_Analytics.prototype._waitForTracker = function() { ; this._retries++; if (typeof(_gat)
== "undefined" || _gat == null || typeof(_gat._getTracker) != "function") { ; if (this._retries
>= zf_Analytics._MAX_RETRIES) { this._propertyId = null; this._tracker = null; ; return; } var self
= this; setTimeout(function() { self._waitForTracker(); }, 500); return; } ; try { this._tracker
= _gat._getTracker(this._propertyId); } catch (e) { this._propertyId = null; this._tracker = null;
; return; } if (typeof(this._tracker._trackPageview) != "function") { this._propertyId = null;
this._tracker = null; ; return; } ; ; while (this._queue.length > 0) this._trackPageView(this._queue.shift());
}; zf_Analytics.prototype._trackPageView = function(path) { try { this._tracker._trackPageview(path);
} catch(e) { ; } };
; ; function zfl_Analytics(isPhotoPage, gaWebPropertyId, layoutStat) { this._isPhotoPage = isPhotoPage;
this._layoutStat = layoutStat; zf_Analytics.prototype.constructor.call(this, gaWebPropertyId);
zf_stdMakeMethodsDeferred(this, "Analytics", [ "registerLayoutLoad", "registerLightsDimmed" ]); }
zfl_Analytics.inherits(zf_Analytics); zfl_Analytics.prototype.registerNonPhotoVisit = function()
{ if (this._isPhotoPage) return; ; if (this.getPropertyId() != null) this.trackPageView(null); };
zfl_Analytics.prototype.registerPhotoVisit = function(photo) { ; var path = photo.getHref("analytics");
; if (this.getPropertyId() != null) this.trackPageView(path); }; zfl_Analytics.prototype.update =
function(photo) { ; ; if (this.current != null) this.current.unadvise(photo); this.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(),
cy: zf_stdGetClientHeight() }; var invoker = new zf_DelayedInvoke(3000); zf_stdAttachEvent(window,
"resize", flipper.eventHandler(zfl_Analytics._resizeHandler, this, flipper, oldDim, invoker));
this._sendLayoutStats(flipper, false); } }; zfl_Analytics.prototype.registerLightsDimmed = function(flipper)
{ if (this._layoutStat) this._sendLayoutStats(flipper, false, "dimlights"); }; zfl_Analytics._resizeHandler
= function(eventArgs, analytics, flipper, oldDimensions, delay) { if (oldDimensions.cx == zf_stdGetClientWidth()
&& oldDimensions.cy == zf_stdGetClientHeight()) return; delay.invoke(function() { analytics._sendLayoutStats(flipper,
true); }); }; zfl_Analytics.prototype._sendLayoutStats = function(flipper, isResample, layoutName)
{ var size = flipper ? flipper.getAvailSize() : { cx: 0, cy: 0 }; var stats = { screenWidth: screen.width,
screenHeight: screen.height, clientWidth: zf_stdGetClientWidth(), clientHeight: zf_stdGetClientHeight(),
photoViewportWidth: size.cx, photoViewportHeight: size.cy, theme: this._layoutStat.themeName, layout:
layoutName ? layoutName : this._layoutStat.layoutName, photoSetId: this._layoutStat.photoSetId,
ownerId: this._layoutStat.ownerId, isResample: isResample }; zf_stdServerRequest("POST", "/zf/layout/layout.asmx",
"ReportClientStatistics", [stats]); };
; ; function zfl_Mat(id, offsetTop, offsetBottom, layoutId) { zfl_Control.prototype.constructor.call(this,
id); this._offsetTop = offsetTop; this._offsetBottom = offsetBottom; this._layoutId = layoutId; }
zfl_Mat.inherits(zfl_Control); zfl_Mat.current = null; zfl_Mat.recalc = function() { var self =
zfl_Mat.current; if (!self) return; var domHeight = self.dom("height"); var layout = $(document.getElementById(self._layoutId));
$(domHeight).find(".mat-width").width(layout.innerWidth()); $(domHeight).css({ display: "block" });
};
; function zfl_PhotoDownload() { } zfl_PhotoDownload.prototype._startBatchDownload = function(ids,
title, key) { var counter; if (!zfl_PhotoDownload.__downloadCount) counter = zfl_PhotoDownload.__downloadCount
= 1; else counter = ++zfl_PhotoDownload.__downloadCount; var frameName = "_zfl_PhotoDownload_download"
+ counter; var frameNode; frameNode = document.createElement("IFRAME"); frameNode.name = frameName;
frameNode.style.cssText = "position:absolute;visibility:hidden;left:0px;top:0px;"; document.body.appendChild(frameNode);
var formNode = document.createElement("FORM"); formNode.action = "/zf/batchDownload"; formNode.method
= "POST"; formNode.target = frameName; formNode.innerHTML = '<input type="hidden" name="ids" />'
+ '<input type="hidden" name="title" />' + '<input type="hidden" name="key" />'; document.body.appendChild(formNode);
formNode["ids"].value = ids.join(","); formNode["title"].value = title; if (key) formNode["key"].value
= key; formNode.submit(); }; zfl_PhotoDownload.prototype._getDownloadInput = function(ids, info,
callback) { ; if (info.lockedCount == 0) { callback(null); return; } var id = this.id + '-dlinput';
var classes = this.downloadPopupClasses ? this.downloadPopupClasses : ''; var removePopup = function()
{ $('#' + id).remove(); zfl_Curtain.hide(); }; var 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>');
else 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, "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>');
buttons.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>');
} 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>');
buttons.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">', '<div class="prompt">Hint:</div>', '<div class="password-hint-text">', zf_stdHtmlEncode(info.passwordHint),
'</div>', '</div>'); content.push( '<div class="form">', '<div class="item">', '<div class="prompt">Password:</div>',
'<input name="password" type="password"></input>', '</div>', '</div>'); if (retry) content.push('<div class="incorrect">Incorrect password</div>');
} 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); var left =
Math.floor((zf_stdGetClientWidth() - 450) / 2); content = [].concat( '<div class="download-input ',
classes, '" ', 'id="', id, '" ', 'style="left:', left, 'px;top:', top, 'px">', '<div class="password-box popup-border1 popup-color1 popup-bgcolor1">',
content, '</div>', '</div>'); removePopup(); zfl_Curtain.show("light"); var jPopup = $(content.join("")).appendTo("body");
var goHandler = function() { onpassword($('#' + id).find("input").attr("value")); }; var cancelHandler
= function() { removePopup(); }; var skipHandler = function() { removePopup(); callback(null); };
jPopup.find(".download").click(goHandler); jPopup.find(".cancel").click(cancelHandler); jPopup.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(); }); try { input.focus(); } catch (e)
{ } } }; var run = function(retry) { renderPopup(retry, function(password) { zf_stdServerRequestEx("POST",
"/zf/core/core.asmx", "VerifySrcPassword", [ids, password], function(key, error) { if (error != null)
{ removePopup(); return; } if (key == null) { run(true); return; } removePopup(); callback(key);
}); }); }; run(false); }; zfl_PhotoDownload.prototype._downloadOriginals = function(title, photos)
{ ; ; var self = this; if (photos instanceof Array) { var ids = jQuery.map(photos, function(photo)
{ return typeof(photo) == 'number' ? photo : photo.id; }); if (this._canShortCircuit(photos)) {
this._startBatchDownload(ids, title, null); return; } zf_stdServerRequestEx("POST", "/zf/core/core.asmx",
"GetSrcPasswordInfo", [ids], function(info, error) { if (error != null) { return; } ; var start =
function(key) { self._startBatchDownload(ids, title, key); }; self._getDownloadInput(ids, info, start);
}); return; } var photoList = photos; photoList.loadAll(function() { var photoArray = []; for (var
i = 0; i < photoList.length; i++) { var photo = photoList.get(i); ; photoArray.push(photo); } self._downloadOriginals(title,
photoArray); }); }; zfl_PhotoDownload.prototype._canShortCircuit = function(photos) { for (var i =
0; i < 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.access.mask & zf_AccessMask.ProtectOriginals)
!= 0 || (photo.access.mask & zf_AccessMask.PasswordProtectOriginals) != 0) { return false; } }
return true; }; zfl_PhotoDownload.prototype._downloadOriginal = function(photo) { ; if ((photo.access.mask
& zf_AccessMask.PasswordProtectOriginals) == 0) { location.href = [photo.getOriginalUrl(photo.fileType),
"?dl=1"].join(""); return; } var self = this; var ids = [photo.id]; zf_stdServerRequestEx("POST",
"/zf/core/core.asmx", "GetSrcPasswordInfo", [ids], function(info, error) { if (error != null) {
return; } var start = function(key) { var uri = [photo.getOriginalUrl(photo.fileType), "?dl=1"];
if (key) uri.push("&key=", key); location.href = uri.join(""); }; self._getDownloadInput(ids, info,
start); }); };
function zfb_Api() { ; } zfb_Api._queue = new zf_RequestQueue(1, 1); zfb_Api.loadScrapbook = function(scrapbookInfo,
oncomplete) { ; ; var changerNumber = function() { return scrapbookInfo.changeNumber; }; zfb_Api._queue.enqueueEx(
'POST', '/zf/core/scrapbook.asmx', 'LoadScrapbook', [ scrapbookInfo.token, changerNumber ], function(result,
error) { ; if (error != null) return; result.loaded = true; oncomplete(result); }); }; zfb_Api.addToScrapbook
= function(scrapbook, photogId, photoIds, oncomplete) { ; ; var token = scrapbook ? scrapbook.token
: null; zfb_Api._queue.enqueueEx( "POST", "/zf/core/scrapbook.asmx", "AddToScrapbook", [token, photogId,
photoIds], oncomplete); }; zfb_Api.removeFromScrapbook = function(scrapbook, photoIds, oncomplete)
{ ; ; var changerNumber = function() { return scrapbook.changeNumber; }; zfb_Api._queue.enqueueEx(
'POST', '/zf/core/scrapbook.asmx', 'RemoveFromScrapbook', [ scrapbook.token, photoIds, changerNumber
], oncomplete); }; zfb_Api.reindexScrapbook = function(scrapbook, indices, oncomplete) { ; ; ;
var changerNumber = function() { return scrapbook.changeNumber; }; zfb_Api._queue.enqueueEx( 'POST',
'/zf/core/scrapbook.asmx', 'ReindexScrapbook', [ scrapbook.token, indices, changerNumber ], oncomplete);
}; zfb_Api.loadScrapbooks = function(photogId, oncomplete) { zfb_Api._queue.enqueueEx( 'POST', '/zf/core/scrapbook.asmx',
'LoadScrapbooks', [ photogId ], oncomplete); }; zfb_Api.createScrapbook = function(name, photogId,
oncomplete) { ; ; zfb_Api._queue.enqueueEx( 'POST', '/zf/core/scrapbook.asmx', 'CreateScrapbook',
[ name, photogId ], oncomplete); }; zfb_Api.deleteScrapbook = function(scrapbook, oncomplete) {
; ; var changerNumber = function() { return scrapbook.changeNumber; }; zfb_Api._queue.enqueueEx(
'POST', '/zf/core/scrapbook.asmx', 'DeleteScrapbook', [ scrapbook.token, changerNumber ], oncomplete);
}; zfb_Api.renameScrapbook = function(scrapbook, name, oncomplete) { ; ; ; var changerNumber = function()
{ return scrapbook.changeNumber; }; zfb_Api._queue.enqueueEx( 'POST', '/zf/core/scrapbook.asmx',
'RenameScrapbook', [ scrapbook.token, name, changerNumber ], oncomplete); }; zfb_Api.copyScrapbook
= function(scrapbook, name, oncomplete) { ; ; ; var changerNumber = function() { return scrapbook.changeNumber;
}; zfb_Api._queue.enqueueEx( 'POST', '/zf/core/scrapbook.asmx', 'CopyScrapbook', [ scrapbook.token,
name, changerNumber ], oncomplete); }; zfb_Api.shareScrapbook = function(scrapbook, name, sharerName,
sharerEmail, sharerMessage, oncomplete) { ; ; ; var changerNumber = function() { return scrapbook.changeNumber;
}; zfb_Api._queue.enqueueEx( "POST", "/zf/core/scrapbook.asmx", "ShareScrapbook", [scrapbook.token,
name, sharerName, sharerEmail, sharerMessage, changerNumber], oncomplete); }; zfb_Api.getScrapbookToken
= function(scrapbook, shared, readOnly, oncomplete) { ; ; zf_stdServerRequestEx( "GET", "/zf/core/scrapbook.asmx",
"GetScrapbookToken", [scrapbook.token, shared, readOnly], oncomplete); };
function zfb_ScrapbookEdit( id, currentInfo, openedInfo, photogId, canShareWithPhotog, canShareWithOthers)
{ zfl_Control.prototype.constructor.call(this, id); zfl_PhotoDownload.prototype.constructor.call(this);
; ; this.current = openedInfo ? openedInfo : currentInfo; this._owned = currentInfo; this._photogId
= photogId; this._canShareWithPhotog = canShareWithPhotog; this._canShareWithOthers = canShareWithOthers;
this.downloadPopupClasses = "lb lb-font1"; } zfb_ScrapbookEdit.inherits(zfl_Control, zfl_PhotoDownload);
zfb_ScrapbookEdit.prototype.show = function() { if (this._isShown) return; this._isShown = true;
var self = this; var parent = document.getElementById('mat-frame'); zf_Flash.hide(); $('BODY').css('overflow-y',
'hidden'); $(parent).append($(this.dom()).removeClass('none')); if (this._init === undefined) {
this.$('.sbe-btn-close').click(this.closure(this.hide)); zf_stdLoadScript('scrapbook.js', function()
{ self._init(); }); } else this._init(); }; zfb_ScrapbookEdit.prototype.hide = function() { $('BODY').css('overflow-y',
'scroll'); $(this.dom()).addClass('none'); zf_Flash.show(); this._isShown = false; $(window).unbind('.sbe');
if (this._select) this._select.hide(); var scrapbook = this.current; if (scrapbook && scrapbook.isReadOnly
&& !scrapbook.isOwned) scrapbook = this._owned; this._makeCurrent(scrapbook); }; zfb_ScrapbookEdit.prototype.keyDown
= function(e) { if (this._isShown && this._keyDown) this._keyDown(e); if (this._isShown) e.stopImmediatePropagation();
}; zfb_ScrapbookEdit.prototype.addPhotos = function(photoIds) { var self = this; zfb_Api.addToScrapbook(
this.current, this._photogId, photoIds, function(result, error) { if (error != null) { return;
} self._makeCurrent(result); } ); }; zfb_ScrapbookEdit.prototype._makeCurrent = function(scrapbook)
{ this.current = scrapbook; if (this.onchange) this.onchange(scrapbook, this._isShown ? this : null);
if (!scrapbook) { zf_stdRemoveCookie("zf_csb", true); zf_stdRemoveCookie("zf_osb", true); } else
if (scrapbook.isOwned) { var expires = new Date(); expires.setMonth(expires.getMonth() + 3); zf_stdSetCookie("zf_csb",
scrapbook.token, expires, true, true); zf_stdRemoveCookie("zf_osb", true); } else { zf_stdSetCookie("zf_osb",
scrapbook.token, null, true, true); } };
; ; function zfl_Layout(id, global, local) { zfl_Control.prototype.constructor.call(this, id);
this.zenbar = global.zenbar; this.header = global.header; this.menubar = global.menubar; this.footer
= global.footer; this.customizer = global.customizer; this.administrator = global.administrator;
this.scrapbook = global.scrapbook; this._decorations = zfl_stdTransformResponse(global.decorations,
"decorations"); this._columns = local.columns; this._fixedWidth = local.fixedWidth; this._fillers
= local.fillers; this._keyHandlers = []; var self = this; zf_stdAttachEvent(window, "DOMContentLoaded",
this.eventHandler(this._window_onload, "DOMContentLoaded")); zf_stdAttachEvent(window, "load",
this.eventHandler(this._window_onload, "window.onload")); zf_stdAttachEvent(window, "resize", this.eventHandler(this._window_onresize));
this._feeds = local.feeds; var ontoggle = function(expanded) { self._bin_ontoggle(this, expanded);
}; 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; this._bins[key] = bin;
bin.ontoggle = ontoggle; bin.onfeeds = onfeeds; } this._grids = local.grids; this._pairs = local.pairs;
if (local.analytics) local.analytics.registerNonPhotoVisit(); if (this.zenbar) { if (this.scrapbook)
{ this.zenbar.setScrapbookInfo(this.scrapbook.current); this.zenbar.onscrapbook = this.scrapbook.closure(this.scrapbook.show);
this.scrapbook.onchange = this.zenbar.closure(this.zenbar.setScrapbookInfo); this.scrapbook.addtocart
= this.zenbar.closure(this.zenbar.addToCart); this._keyHandlers.push(this.scrapbook.closure(this.scrapbook.keyDown));
} else { this.zenbar.setScrapbookInfo(null); } } } zfl_Layout.inherits(zfl_Control); zfl_Layout.prototype.recalc
= function(deferred) { if (!this.__loaded) { ; return; } if (deferred) { zf_stdDeferCall(this.id
+ ".recalc", this.recalc, this); return; } if (this.__recalc_running) { ; return; } this.__recalc_running
= true; var start = new Date(); this.onrecalc(); zfl_Mat.recalc(); ; this.__recalc_running = false;
}; zfl_Layout.prototype._window_onresize = function() { ; this.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));
start = new Date().getTime(); this.onload(); ; this.recalc(); }; zfl_Layout.prototype.onload = function()
{ if (this.footer) this.footer.visibility(true); }; zfl_Layout.prototype.onrecalc = function() {
var domSelf = this.dom(); var i; var cyWindow = zf_stdGetClientHeight(); cyWindow = Math.max(300,
cyWindow); var cyCustomizer = this.__cyCustomizer; if (cyCustomizer == null) { cyCustomizer = this.__cyCustomizer
= !this.customizer ? 0 : (zf_stdGetHeightOverall(this.customizer.dom()) + 10); } var cyZenBar = this.__cyZenBar;
if (cyZenBar == null) { cyZenBar = this.__cyZenBar = !this.zenbar ? 0 : zf_stdGetHeightOverall(this.zenbar.dom());
} var cyHeader = this.__cyHeader; if (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());
} var cyFooter = this.__cyFooter; if (cyFooter == null) { cyFooter = this.__cyFooter = (this.footer
== null) ? 0 : zf_stdGetHeightOverall(this.footer.dom()); } var cyPaddingTop = this.__cyPaddingTop;
var cyPaddingBottom = this.__cyPaddingBottom; if (cyPaddingTop == null) { cyPaddingTop = this.__cyPaddingTop
= zf_stdGetHeightAbove(domSelf); cyPaddingBottom = this.__cyPaddingBottom = zf_stdGetHeightBelow(domSelf);
} var cyTaken = cyCustomizer + cyZenBar + cyHeader + cyMenuBar + cyPaddingBottom + cyFooter; var
cyLeft = cyWindow - cyTaken; var 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; var cyOffset = zf_stdGetOffset(column.dom(),
domSelf).cy; cyFixed += cyOffset; cyMin += cyOffset; if (cyFixed > cyColumns) cyColumns = cyFixed;
if (column.stretcherId) { columns.push(column); column.__minHeight = cyMin; column.__fixedHeight
= cyFixed; } ; } if (this.cyMinFooter != null && cyFooter != 0) { cyLeft += cyFooter - this.cyMinFooter;
cyFooter = this.cyMinFooter; } var maxColumn = cyLeft; if (!this.keepFooter && cyColumns > cyLeft)
{ if (cyColumns < cyLeft + cyFooter) maxColumn = cyColumns; else maxColumn = cyLeft + cyFooter;
} ; var overStretch = 0; for (i = 0; i < columns.length; i++) { column = columns[i]; var actualStretch;
var desiredStretch; if (column.__minHeight < maxColumn) desiredStretch = maxColumn - column.__minHeight;
else desiredStretch = 0; actualStretch = column.stretch(desiredStretch); ; column.__actualStretch
= actualStretch; if (actualStretch + column.__fixedHeight > maxColumn) { var maxColumn2 = actualStretch
+ column.__fixedHeight; if (maxColumn2 < cyLeft + cyFooter) maxColumn2 = actualStretch + column.__fixedHeight;
else 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; columns[j].stretch(updatedStretch);
; } } } } } var cyOldFillers = 0; var nFillers = this._fillers.length; for (i = 0; i < nFillers;
i++) cyOldFillers += document.getElementById(this._fillers[i]).clientHeight; var cyLayout = cyCustomizer
+ cyHeader + cyZenBar + cyMenuBar + cyFooter + zf_stdGetHeightOverall(domSelf) - cyOldFillers;
var cyNewFillers = 0; if (cyLayout < cyWindow) cyNewFillers = cyWindow - cyLayout; if (cyOldFillers
!= cyNewFillers && nFillers > 0) { var cyFiller1 = Math.floor(cyNewFillers / nFillers); var 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"; } } ; }; 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;
methodAuto = true; } else if (params.method == "auto2") { params.method = (screen.width < 1600) ?
zf_ProcessingMethod.StandardLargeThumbnail : zf_ProcessingMethod.StandardVeryLargeThumbnail; methodAuto
= true; } else if (params.method == "auto3") { params.method = (screen.width <= 1024) ? zf_ProcessingMethod.StandardThumbnail
: ((screen.width < 1600) ? zf_ProcessingMethod.StandardLargeThumbnail : zf_ProcessingMethod.StandardVeryLargeThumbnail);
methodAuto = true; } for (var name in zf_ProcessingMethod) { if (zf_ProcessingMethod[name].code
== params.method) { params.method = zf_ProcessingMethod[name]; break; } } ; var method = params.method;
grid.__zfl_params = params; grid.__zfl_selection = selection; var decor = this._getDecorationInfo(style,
method); if (methodAuto) { var dom = document.getElementById(grid.id); var classNames = dom.className.split(" ");
if (decor != null && decor.className != null) classNames = classNames.concat(decor.className.split(" "));
var suffixedNames = []; for (var c = 0; c < classNames.length; c++) { if (classNames[c] == "pg-empty")
continue; suffixedNames.push(classNames[c] + "-method-" + method.code); } classNames = classNames.concat(suffixedNames);
dom.className = classNames.join(" "); dom = null; } if (params.lynx) return; grid.init(this._createPlugins(style,
decor, params)); if (objects) { var self = this; if (objects instanceof Array) { grid.setSize(objects.length);
grid.onqueryitem = function(index) { self.setGridItem(grid, index, objects[index]); }; } else if
(objects instanceof Function) { ; grid.setSize(size); grid.onqueryitem = function(index) { self.setGridItem(grid,
index, objects(index)); }; } } }; zfl_Layout.prototype.setGridItem = function(grid, index, object)
{ ; ; ; if (grid.__zfl_params.lynx) return; var self = this; if (!object.loaded) { object.advise(grid,
function() { self.setGridItem(grid, index, object); }); return; } var image = object.image; if (!image)
image = new zf_BasicImage((object instanceof zf_Folder) ? -2 : -1); if (object.access.type == zf_AccessType.Private)
{ if (object instanceof zf_Folder || object instanceof zf_PhotoSet) image = new zf_BasicImage(-3);
} var id = object.id; if (object.constructor.prefix) id = object.constructor.prefix + id; var styles
= []; var method = grid.__zfl_params.method; if (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;
} 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;
var locked = !nocheck && access.type == zf_AccessType.Password && !zfl_PasswordManager.unlocked[image.access.realmId];
var noaccess = !nocheck && (access.type == zf_AccessType.Private || access.isCensored); var accessible
= nocheck || access.type == zf_AccessType.Public || access.type == zf_AccessType.Password && !locked;
var generated = image.flags != null && (method == zf_ProcessingMethod.StandardThumbnail && (image.flags
& zf_PhotoFlags.HasImage0) != 0 || method == zf_ProcessingMethod.StandardSmallThumbnail && (image.flags
& zf_PhotoFlags.HasImage1) != 0 || method == zf_ProcessingMethod.StandardLargeThumbnail && (image.flags
& zf_PhotoFlags.HasImage10) != 0 || method == zf_ProcessingMethod.StandardVeryLargeThumbnail &&
(image.flags & zf_PhotoFlags.HasImage11) != 0); burnable = generated && (locked || noaccess || accessible);
if (locked) { zfl_PasswordManager.subscribe( image.access.realmId, function() { self.setGridItem(grid,
index, object); }); image = new zf_BasicImage(-4); styles.push("pv-s-password"); } if (noaccess)
{ image = new zf_BasicImage(-5); styles.push("pv-s-noaccess"); } } var selection = grid.__zfl_selection;
if (selection && selection.selected(object.id)) grid.selectItem(index); ; var context = { data:
object, method: method, index: index, image: image, burnable: burnable, grid: grid, selection: selection
}; grid.setItem(index, id, href, image, method, burnable, styles, context); }; zfl_Layout.prototype._getDecorationInfo
= function(style, method) { if (this._decorations == null) return null; var info; if (method != null)
{ info = this._decorations[style + "." + method.code]; if (info != null) return info; } info = this._decorations[style];
if (info != null) return info; info = this._decorations["default"]; if (info != null) return info;
return null; }; zfl_Layout.prototype._createPlugins = function(style, decor, params) { var plugins
= []; 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)); } if (params && params.mselection && style == zfl_PhotoViewStyle.GalleryPhoto)
plugins.push(new zfl_SelectionPlugin()); plugins.push(new zfl_InfoIconPlugin(params)); plugins.push(new
zfl_CensoredPlugin()); plugins.push(new zfl_WaitAnimationPlugin(true)); if (style == zfl_PhotoViewStyle.PhotoNavList)
plugins.push(new zf_NoClickPlugin()); if (style == zfl_PhotoViewStyle.CurrentPhoto || style == zfl_PhotoViewStyle.DimLights
|| style == zfl_PhotoViewStyle.Slideshow || style == zfl_PhotoViewStyle.CommentBrowser) plugins.push(new
zfl_PhotoOverlayPlugin()); return plugins; }; zfl_Layout.formatDecorationClasses = function(baseClass,
decoration, method) { var classes = []; if (baseClass) classes.push(baseClass, ' ', baseClass, '-method-',
method.code); if (decoration && decoration.className) { var decorClasses = decoration.className.split(' ');
for (var i = 0; i < decorClasses.length; i++) { if (classes.length > 0) classes.push(' '); classes.push(decorClasses[i],
' ', decorClasses[i], '-method-', method.code); } } return classes.join(""); }; zfl_Layout.prototype._bin_ontoggle
= function(bin, expanded) { ; this.recalc(); }; 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; if (!guestbook) return; guestbook.onresize
= this.closure(this.recalc); var zenbar = global.zenbar; if (zenbar) guestbook.onlogin = zenbar.closure(zenbar.login);
var bin = local.bins.guestbook; if (bin) { var link = local.mailboxLink; if (link) { link.onshow
= function() { if (!bin.expanded) bin.toggle(); else link.scrollTo(guestbook); }; link.onadd = function()
{ if (!bin.expanded) bin.toggle(); else link.scrollTo(guestbook); guestbook.add(); }; } var countFormat
= zf_stdHtmlEncode("{0} entries"); guestbook.oncountchange = function(count) { if (link) link.setCount(count);
bin.setTitleSuffix(zf_stdFormatString(countFormat, count)); }; bin.setTitleSuffix(zf_stdFormatString(countFormat,
guestbook.getCount())); } }; zfl_Layout.prototype.resolveEmail = function(id, userId, 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, null, function()
{ document.location.href = "mailto:" + email; }); }; zf_stdSetText(dom, email); dom = null; };
zf_stdServerRequest( "GET", "/zf/layout/layout.asmx", "ResolveEmail", [ userId, token, zfl_SessionCookie.current.sessionKey
], oncomplete); }; zfl_Layout.prototype._document_onkeydown = function(e) { for (var i = 0; i < this._keyHandlers.length;
i++) { this._keyHandlers[i](e); if (e.isImmediatePropagationStopped()) break; } };
; ; ; ; var zf_MailboxType = { FolderGuestbook: 2, PhtoSetGuestbook: 1, PhotoComments: 0 }; function
zf_Mailbox(ownerIdOrMessage, type, id) { 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; this.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; };
function zf_MailboxAuthorization(mailbox) { this._mailbox = mailbox; this._retrieveToken(); var
self = this; this._timer = setInterval(function() { self._retrieveToken(); }, 3600 * 1000); } 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); else setTimeout(wait, 500);
++count; } else { ; ; var offset = new Date().getTime() - self._timestamp.getTime(); if (offset
< 5000) setTimeout(function() { callback(self._token); }, 5000 - 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();
if (error != null) return; self._token = token; }); };
var zf_AttachmentType = { None: 0, CroppingSuggestion: 1, HighlightedArea: 2 }; var zf_MessageFlags
= { None: 0x00, CanEdit: 0x01, CanDelete: 0x02, CanCensor: 0x04, CanUndelete: 0x08, CanUncensor:
0x10, CanShowInfo: 0x20, CanEmail: 0x40, CanPurge: 0x80, ControlMask: 0x1F }; function 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", "index",
"poster", "posterName", "posterEmail", "posterUrl", "postedOn", "body", "attachment", "attachmentType",
"isPrivate", "isDeleted", "isCensored", "flags", "postedFrom", "isEdited", "editedOn", "editedFrom",
"editor", "censoredOn", "censoredFrom", "censorer", "deletedOn", "deletedFrom", "deletor" ]; 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 = "http://" + this.poster.domainName;
} }; zf_Message.prePostMessage = function(mailbox, oncomplete) { ; ; ; ; var params = [ mailbox ];
zf_stdServerRequestEx("POST", "/zf/layout/message.asmx", "PrePostMessage", params, oncomplete);
}; zf_Message.postMessage = function(auth, mailbox, updater, oncomplete) { ; ; ; ; ; ; auth.delayPost(
function(token) { zf_stdServerRequestEx("POST", "/zf/layout/message.asmx", "PostMessage", [ token,
mailbox, updater ], oncomplete); auth.dispose(); }); }; zf_Message.updateMessage = function(auth,
mailbox, index, updater, oncomplete) { ; ; ; ; ; ; auth.delayPost( function(token) { zf_stdServerRequestEx("POST",
"/zf/layout/message.asmx", "UpdateMessage", [ token, mailbox, index, updater ], oncomplete); auth.dispose();
}); }; zf_Message.loadMessageRange = function(mailbox, mailboxToken, first, count, oncomplete) {
; ; ; ; ; var params = [ mailbox, mailboxToken, first, count ]; zf_stdServerRequestEx("GET", "/zf/layout/message.asmx",
"LoadMessageRange", params, oncomplete); }; zf_Message._bake = function(method) { return function(mailbox,
index, oncomplete) { ; ; ; ; var params = [ mailbox, index ]; zf_stdServerRequestEx("POST", "/zf/layout/message.asmx",
method, params, oncomplete); }; }; zf_Message.deleteMessage = zf_Message._bake("DeleteMessage");
zf_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");
; ; 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;
if (message.posterUrl) { var posterLink = this.dom("poster-link"); if (posterLink) posterLink.href
= message.posterUrl; } } else { var postedOn = this.dom().getAttribute("zf:posted", 2); if (postedOn)
{ postedOn = zf_stdParseDateTimeUTC(postedOn); zf_stdSetText(this.dom("posted"), zf_stdFormatDateTimeEx(postedOn));
} } var self = this; var subscribe = function(name, ask) { var dom = self.dom(name); if (dom != null)
{ var handler = "on" + name; dom.onclick = function() { if (ask && !confirm("Do you really want to perform this action?"))
return; if (self[handler]) self[handler](self.getMessage()); }; } }; subscribe("edit"); subscribe("email");
subscribe("delete"); subscribe("undelete"); subscribe("censor"); subscribe("uncensor"); subscribe("purge",
true); this._attachmentVisible = false; var link = this.dom("attachment-link"); if (link) { link.onclick
= function() { if (self.onattachment) self.onattachment(self._message, !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();
message.index = this.getIndex(); message.posterName = zf_stdGetText(this.dom("poster-name")); var
posterId = this.dom().getAttribute("zf:poster", 2); if (posterId) { message.poster = new zf_User();
message.poster.id = parseInt(posterId); message.poster.displayName = message.posterName; ; } var
posterEmail = this.dom().getAttribute("zf:email"); if (posterEmail && posterEmail.length > 0) message.posterEmail
= posterEmail; var posterLink = this.dom("poster-link"); if (posterLink && posterLink.tagName == "A")
{ message.posterUrl = posterLink.href; } else { message.posterUrl = ""; } var postedOn = this.dom().getAttribute("zf:posted",
2); 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,
""); } this._message = message; return message; }; zfl_MessageView.prototype.getMailbox = function()
{ if (this._mailbox) return this._mailbox; var raw = this.dom().getAttribute("zf:mailbox", 2);
; 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;
return 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;
return 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", '">', 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">',
'</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>',
'private', '</span>'); poster = poster.join(""); return [ '<div class="mv-header mv-font2">', '<div class="mv-date mv-color4">',
zf_stdFormatDateTimeEx(message.postedOn), '</div>', '<div class="mv-title">', '<span class="mv-index">',
message.index + 1, '.</span>', '<span class="mv-poster">', poster, '</span>', '</div>', '</div>'
].join(""); }; zfl_MessageView._createInfoHtml = function(id, message) { if ((message.flags & zf_MessageFlags.CanShowInfo)
== 0) return ""; var 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">');
content.push( '<div>', zf_stdFormatString("Posted by {0} on {1} from {2}", formatValue(formatUser(message.poster)),
formatValue(zf_stdFormatDateTime(message.postedOn, true)), formatValue(message.postedFrom)), '</div>');
if (message.isEdited) { content.push( '<div>', zf_stdFormatString("Edited by {0} on {1} from {2}",
formatValue(formatUser(message.editor)), formatValue(zf_stdFormatDateTime(message.editedOn, true)),
formatValue(message.editedFrom)), '</div>'); } if (message.isCensored) { content.push( '<div>',
zf_stdFormatString("Censored by {0} on {1} from {2}", formatValue(formatUser(message.censorer)),
formatValue(zf_stdFormatDateTime(message.censoredOn, true)), formatValue(message.censoredFrom)),
'</div>'); } if (message.isDeleted) { content.push( '<div>', zf_stdFormatString("Deleted by {0} on {1} from {2}",
formatValue(formatUser(message.deletor)), formatValue(zf_stdFormatDateTime(message.deletedOn, true)),
formatValue(message.deletedFrom)), '</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>'; var
content = []; if (message.body) content.push('<div class="mv-content mv-body mv-font1 mv-color1">',
message.body, '</div>'); if (message.isDeleted) content.push('<div class="mv-content mv-deleted mv-font3 mv-color4">',
'Deleted.', '</div>'); content = content.join(""); var controls = ""; if (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; if (!first) controls.push('<span class="mv-control-separator">|</span>');
controls.push( '<a class="mv-control" href="javascript:;" id="', id, linkId, '">', label, '</a>');
first = false; }; addLink(zf_MessageFlags.CanEdit, "-edit", "Edit"); addLink(zf_MessageFlags.CanEmail,
"-email", "Reply via E-mail"); addLink(zf_MessageFlags.CanDelete, "-delete", "Delete"); addLink(zf_MessageFlags.CanUndelete,
"-undelete", "Undelete"); addLink(zf_MessageFlags.CanCensor, "-censor", "Censor"); addLink(zf_MessageFlags.CanUncensor,
"-uncensor", "Uncensor"); addLink(zf_MessageFlags.CanPurge, "-purge", "Purge"); controls.push('</div>');
controls = controls.join(""); } var attachment = ""; if (message.attachmentType == zf_AttachmentType.CroppingSuggestion)
{ attachment = ['<div class="mv-attachment mv-attachment-crop mv-font3">', '<div class="icon"></div>',
'<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">',
'<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">', controls, attachment, '</div>']; footer = footer.join("");
} return [ '<div class="mv', message.isDeleted ? ' mv-s-deleted' : '', ' mv-bgcolor1" id="', id, '">',
zfl_MessageView.createHeaderHtml(id, message), censored, zfl_MessageView._createInfoHtml(id, message),
content, footer, '</div>' ].join(""); }; zfl_MessageView.prototype.setAttachmentVisible = function(visible)
{ if (this._attachmentVisible == visible) return; this._attachmentVisible = visible; if (this._message.attachmentType
== zf_AttachmentType.CroppingSuggestion) { zf_stdSetText(this.dom("attachment-link"), visible ?
"Hide Suggested Cropping" : "View Suggested Cropping"); } else if (this._message.attachmentType
== zf_AttachmentType.HighlightedArea) { zf_stdSetText(this.dom("attachment-link"), visible ? "Hide Highlighted Area"
: "View Highlighted Area"); } };
; function zf_ScrollBar(id, cyLine) { zf_Control.prototype.constructor.call(this, id); this._cyLine
= cyLine; this.update = zf_stdMakeDeferred(id + ".ScrollBar.update", this._update); this.update();
} zf_ScrollBar.inherits(zf_Control); zf_ScrollBar.prototype.close = function() { this._isClosed
= true; }; zf_ScrollBar.prototype._update = function() { if (this._isClosed) return; var scrollNode
= this.dom().parentNode; this._outerHeight = scrollNode.offsetHeight; this._innerHeight = scrollNode.scrollHeight;
if (this._outerHeight + scrollNode.scrollTop > this._innerHeight) scrollNode.scrollTop = Math.max(0,
this._innerHeight - this._outerHeight); var show = this._innerHeight > this._outerHeight; this._show(show);
this._outerHeight = scrollNode.offsetHeight; this._innerHeight = scrollNode.scrollHeight; if (show
&& this._nodesCreated) this._scrollTo(); }; zf_ScrollBar.prototype.getLineHeight = function() {
return this._cyLine; }; zf_ScrollBar.prototype.getScrollPos = function() { return this.dom().parentNode.scrollTop;
}; zf_ScrollBar.prototype.scrollTo = function(pos) { if (this._isClosed) return; this.dom().parentNode.scrollTop
= pos; this.update(); }; 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(); }; zf_ScrollBar.prototype._show = function(show)
{ var barStyle = this._nodesCreated ? this.dom("_bar").style : null; if (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,
"sv-noscroll", "sv-scroll"); barStyle.visibility = "inherit"; } if (!show && barStyle != null && barStyle.visibility
!= "hidden") { zf_stdReplaceClassName(this.dom().parentNode.parentNode, "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"); var 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; cyActive = 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); cyThumb = 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"; upperNode.style.height = cyPos + "px"; lowerNode.style.height = (cyActive - cyPos) + "px";
}; zf_ScrollBar.prototype._createNodes = function() { var id = this.id; var barNode = document.createElement("DIV");
barNode.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>', '</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="',
id, '-_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>', '</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; this.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"); var thumbNode = this.dom("_thumb"); this._cyTop = topNode.offsetHeight;
this._cyBottom = bottomNode.offsetHeight; var cyThumbOuter = thumbNode.offsetHeight; var cyThumbInner
= zf_stdExtractPixels( zf_stdGetCurrentStyle(thumbNode, "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"; }; 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";
self._elem_onclick(e, this); }; upperNode.onmouseup = lowerNode.onmouseup = function() { this.firstChild.className
= "sb-hover sb-color1 sb-bgcolor1"; self._elem_onmouseup(this); }; 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"; self._elem_onmouseup(this);
}; topNode.onmousedown = function(e) { this.firstChild.className = "sb-active sb-color3 sb-bgcolor6 sb-bgimage1";
self._elem_onclick(e, this); }; topNode.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";
}; 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"; self._elem_onclick(e, this); }; bottomNode.onmouseup
= function() { this.firstChild.className = "sb-hover sb-color2 sb-bgcolor5 sb-bgimage2"; self._elem_onmouseup(this);
}; upperNode.dblclick = lowerNode.ondblclick = topNode.ondblclick = bottomNode.ondblclick = zf_stdFalse;
thumbNode.onmouseover = function(e) { self._thumb_onmouseover(e, this); }; thumbNode.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, this); }; thumbNode.onmousemove
= function(e) { self._thumb_onmousemove(e, this); }; thumbNode.onselectstart = zf_stdFalse; upperNode
= null; lowerNode = null; topNode = null; bottomNode = null; thumbNode = null; this.dom().addEventListener("DOMMouseScroll",
this.eventHandler(this._parent_onmousewheel), false); this._nodesCreated = true; return barNode;
}; zf_ScrollBar.prototype._lineUp = function() { var scrollNode = this.dom().parentNode; if (scrollNode.scrollTop
> 0) { scrollNode.scrollTop -= this._cyLine; this._scrollTo(); } }; zf_ScrollBar.prototype._lineDown
= function() { var scrollNode = this.dom().parentNode; if (scrollNode.scrollTop < scrollNode.scrollHeight)
{ scrollNode.scrollTop += this._cyLine; this._scrollTo(); } }; zf_ScrollBar.prototype._pageUp = function()
{ var scrollNode = this.dom().parentNode; if (scrollNode.scrollTop > 0) { var cyPage = Math.max(this._outerHeight
- this._cyLine, this._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, this._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]; switch (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; case "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; this._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(); if (self.onscroll != null) self.onscroll(); } }, 80);
} }, 400); }; zf_ScrollBar.prototype._elem_onmouseup = function() { if (this._interval != null)
{ clearInterval(this._interval); delete this._interval; } 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";
if (document.addEventListener) { document.addEventListener("mouseover", zf_ScrollBar._noop, true);
document.addEventListener("mouseout", zf_ScrollBar._noop, true); document.addEventListener("selectstart",
zf_ScrollBar._noop, true); document.addEventListener("mousemove", thumbNode.onmousemove, true);
document.addEventListener("mouseup", thumbNode.onmouseup, true); } else if (thumbNode.setCapture)
thumbNode.setCapture(); this._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(); zf_stdStopPropagation(e); zf_stdPreventDefault(e); }; zf_ScrollBar.prototype._thumb_onmousemove
= function(e) { if (!this._thumbTrack) return; e = zf_stdGetEvent(e); zf_stdStopPropagation(e);
zf_stdPreventDefault(e); var top = this._anchorTop + e.clientY - this._anchorY; var cyActive; var
cyThumb; cyActive = this.dom("_bar").offsetHeight - this._cyTop - this._cyBottom; cyActive = 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)); this.dom().parentNode.scrollTop = scrollTop; this._scrollTo(); if (this.onscrolling
!= null) this.onscrolling(); }; zf_ScrollBar.prototype._thumb_onmouseup = function(e) { this._thumbTrack
= false; e = 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";
else thumbNode.firstChild.className = "sb-normal sb-color4 sb-bgcolor4 sb-bgimage3"; if (document.removeEventListener)
{ document.removeEventListener("mouseover", zf_ScrollBar._noop, true); document.removeEventListener("mouseout",
zf_ScrollBar._noop, true); document.removeEventListener("selectstart", zf_ScrollBar._noop, true);
document.removeEventListener("mousemove", thumbNode.onmousemove, true); document.removeEventListener("mouseup",
thumbNode.onmouseup, true); } else if (thumbNode.releaseCapture) thumbNode.releaseCapture(); if
(this.onscroll != null) this.onscroll(); }; 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, thumbNode) { if (!this._thumbTrack) thumbNode.firstChild.className
= "sb-normal sb-color4 sb-bgcolor4 sb-bgimage3"; }; zf_ScrollBar.prototype._parent_onmousewheel
= function(e) { var delta; delta = e.detail > 0 ? -120 : 120; if (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); zf_stdStopPropagation(e); }; zf_ScrollBar._noop
= function(e) { zf_stdPreventDefault(e); zf_stdStopPropagation(e); return false; };
; ; 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, arguments); }; } }; handlers._bake("onedit"); handlers._bake("onemail");
handlers._bake("ondelete"); handlers._bake("onundelete"); handlers._bake("oncensor"); handlers._bake("onuncensor");
handlers._bake("onpurge"); handlers._bake("onattachment"); this.onemail = function(message) { if
(message.posterEmail && message.posterEmail.length > 0) { window.location = "mailto:" + message.posterEmail;
} }; 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");
for (var i = 0; i < items.length; i++) { for (var ve = items[i].firstChild; ve != null; ve = ve.nextSibling)
{ if (!zf_stdHasClassName(ve, "mv")) continue; var view = new zfl_MessageView(ve.id); var 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; break; } } this._updateCount(); this._height
= -1; this._sb = new zf_ScrollBar(this.id + "-items", 20); this._selectable = selectable; this._selectedItem
= -1; zf_stdMakeMethodsDeferred(this, this.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; while (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; this._count = 0; this._totalCount = totalCount; this._selectedItem = -1; if (messages && messages.length
> 0) { this._last = messages[0].index; this.add(messages); } this.setHeight(); this._updateCount();
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]); } else { this._update(message);
} this._totalCount = Math.min(this._count + this._first, this._totalCount); this._updateCount();
this.setHeight(); if (this._pendingSelection != null) { this._pendingSelection(); this._pendingSelection
= null; } }; zfl_MessageList.prototype._update = function(message) { ; var index = message.index;
var view = this._views[index]; var id = this.id + "-" + index; if (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; } 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"; item.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]; } } if (previous != null)
{ previous = previous.dom().parentNode; zf_stdReplaceClassName(previous, null, "ml-border2"); }
else previous = this.dom("more"); this.dom("items").insertBefore(item, previous); 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; dom.parentNode.removeChild(dom); this._views[index]
= null; }; zfl_MessageList.prototype.getFirstView = function() { return this._first < this._views.length
? this._views[this._first] : null; }; zfl_MessageList.prototype.getSelectedView = function() {
return this._selectedItem != -1 ? this._views[this._selectedItem] : null; }; zfl_MessageList.prototype.getView
= function(index) { return this._views[index]; }; 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(),
count > 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, this._totalCount
> 0 ? null : "ml-s-empty"); this._moreCount = count; }; zfl_MessageList.prototype._more_onclick
= function() { ; if (this._moreCount <= 0) return; if (this.onrequest) this.onrequest(this._first
- 1, this._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; view[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(),
null, "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"); } ; var dom = this._views[index].dom(); zf_stdReplaceClassName(dom,
null, "none"); return dom.parentNode; }; zfl_MessageList.prototype.restoreContainer = function(index)
{ if (index < 0) { zf_stdReplaceClassName(this.dom(), "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(); zf_stdReplaceClassName(dom, "none", null);
}; zfl_MessageList.prototype.remove = function(index) { ; if (index == this._selectedItem) { this._selectedItem
= -1; if (this.ondeselect) this.ondeselect(index); } this._remove(index); --this._totalCount; --this._count;
this._updateCount(); this.setHeight(); }; zfl_MessageList.prototype.setEditing = function(editing)
{ zf_stdReplaceClassName(this.dom(), editing ? null : "mv-s-editing", editing ? "mv-s-editing" : null);
this.setHeight(); }; zfl_MessageList.prototype.setLoading = function(loading) { zf_stdReplaceClassName(this.dom(),
loading ? null : "ml-s-loading", loading ? "ml-s-loading" : null); this.setHeight(); }; zfl_MessageList.prototype.setAccess
= function(mask, mailboxType) { var check = mailboxType != zf_MailboxType.PhotoComments ? { add:
zf_AccessMask.NoPublicGuestbookPosts | zf_AccessMask.NoPrivateGuestbookPosts, registeredOnly: zf_AccessMask.NoAnonymousGuestbookPosts
} : { add: zf_AccessMask.NoPublicComments | zf_AccessMask.NoPrivateComments, registeredOnly: zf_AccessMask.NoAnonymousComments
}; var allowAdd = (mask & check.add) != check.add; var registeredOnly = (mask & check.registeredOnly)
!= 0; var dom = this.dom(); zf_stdReplaceClassName(dom, "ml-s-not-allowed", null); zf_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, null, "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(); };
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"));
height = 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";
} else { this.dom("outer").style.cssText = ""; this.dom("inner").style.cssText = ""; } this._sb.update();
}; zfl_MessageList.prototype._item_onclick = function(event, index) { ; if (!this._selectable)
return; this.select(index); }; zfl_MessageList.prototype.select = function(index) { ; if (this._selectedItem
== index) return; if (this._selectedItem != -1) this.deselect(this._selectedItem); var view = this._views[index];
if (view != null) { zf_stdReplaceClassName(view.dom().parentNode, null, "ml-s-selected"); this._selectedItem
= index; var item = view.dom().parentNode; var 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; var scrollOffset = this._sb.getScrollPos(); ;
if (itemOffset < scrollOffset) { this._sb.scrollTo(itemOffset); } else if (itemOffset + itemHeight
> scrollOffset + scrollHeight) { if (itemHeight > scrollHeight) this._sb.scrollTo(itemOffset);
else if (index == this._first) this._sb.scrollTo(totalHeight - scrollHeight); else this._sb.scrollTo(itemOffset
+ itemHeight - scrollHeight); } if (this.onselect) this.onselect(index); } this._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,
"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; i <= 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; i >= 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; if (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; } } }; this._more_onclick(); } }; zfl_MessageList.prototype._top_onclick
= function() { if (document.location.hash == "#guestbook") document.location.hash = "#"; window.scrollTo(0,
0); };
; ; 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"]; self._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"); }; 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);
} 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"),
"me-missing", null); self.showMessage(); }; this.dom("url").onkeydown = function() { self.showMessage();
}; this.dom("email").onkeydown = function() { zf_stdReplaceClassName(self.dom("email-field"), "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(); if (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);
updater.posterEmail = zf_stdTrim(this.dom("email").value); updater.body = this.dom("body").value;
return updater; }; zfl_MessageEdit.prototype._save_onclick = function() { if (!this._validate())
return; this.setSaving(true); zfl_Button._abutton_onmouseout(this.dom("save")); zfl_Button._abutton_onmouseout(this.dom("add"));
if (this.onsave) this.onsave(this._getUpdater()); }; zfl_MessageEdit.prototype._cancel_onclick =
function() { zfl_Button._abutton_onmouseout(this.dom("cancel")); if (this.oncancel) this.oncancel();
}; zfl_MessageEdit.prototype.setOriginal = function(message) { this._original = message; zf_stdReplaceClassName(this.dom(),
"me-s-saving", null); zf_stdReplaceClassName(this.dom(), "me-s-continue", null); if (!message)
{ zf_stdReplaceClassName(this.dom(), "me-s-editing", null); this.dom("body").value = ""; this._attachmentType
= zf_AttachmentType.None; this._attachment = null; } else { zf_stdReplaceClassName(this.dom(), null,
"me-s-editing"); this.dom("header").innerHTML = zfl_MessageView.createHeaderHtml(this.id + "-view",
message); var body = message.body; body = 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; zf_stdReplaceClassName(this.dom("access-info"), null, "none"); this._attachmentType
= message.attachmentType; this._attachment = message.attachment; } zf_stdReplaceClassName(this.dom("name-field"),
"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; if (this.onattachment) this.onattachment(this._attachmentType, this._attachment); this.setSaving(false);
this.showMessage(); }; zfl_MessageEdit.prototype.getOriginal = function() { return this._original;
}; 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"), null, "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", true); 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",
true); 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");
this.showMessage("This is not a valid e-mail address.", true); return false; } return true; };
zfl_MessageEdit.prototype.showMessage = function(message, error) { if (error) this.setSaving(false);
if (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("");
this.dom("message").innerHTML = html; }; zfl_MessageEdit.prototype.setAccess = function(mask, mailboxType)
{ ; ; var check = mailboxType != zf_MailboxType.PhotoComments ? { nopublic: zf_AccessMask.NoPublicGuestbookPosts,
noprivate: zf_AccessMask.NoPrivateGuestbookPosts, noanonymous: zf_AccessMask.NoAnonymousGuestbookPosts
} : { nopublic: zf_AccessMask.NoPublicComments, noprivate: zf_AccessMask.NoPrivateComments, noanonymous:
zf_AccessMask.NoAnonymousComments }; var radio = this.dom("form").elements["me-access"]; var domInfo
= this.dom("access-info"); zf_stdReplaceClassName(domInfo, "me-private-info", null); zf_stdReplaceClassName(domInfo,
"me-public-info", null); if (mask & (check.nopublic | check.noprivate)) { zf_stdReplaceClassName(this.dom("access-info"),
"none", null); zf_stdReplaceClassName(this.dom("access-field"), null, "none"); zf_stdReplaceClassName(
domInfo, null, (mask & check.nopublic) ? "me-private-info" : "me-public-info"); radio[(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"), zf_userId == 0 ? "none" : null,
zf_userId == 0 ? null : "none"); zf_stdReplaceClassName(domInfo, null, "me-public-info"); radio[0].checked
= true; this._private = false; } }; 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"];
if (radio[0].checked) { this._attachmentType = zf_AttachmentType.None; this._attachment = null;
} else if (radio[1].checked) { this._attachmentType = zf_AttachmentType.CroppingSuggestion; this._attachment
= null; } else if (radio[2].checked) { this._attachmentType = zf_AttachmentType.HighlightedArea;
this._attachment = null; } if (this.onattachment) this.onattachment(this._attachmentType, this._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(); } 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, message, oncontinue) { if (error == null) { zf_stdReplaceClassName(this.dom(),
"me-s-continue", null); return; } zf_stdReplaceClassName( this.dom("continue-message"), error ? null
: "me-color3", error ? "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; };
; ; 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; this._mailboxToken
= mailboxToken; this._editable = true; this._mask = mask; if (edit) { edit.onsave = this.closure(this._edit_onsave);
edit.oncancel = this.closure(this._edit_oncancel); edit.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, true); list.onlogin = function() { if (self.onlogin) self.onlogin();
}; list.ondelete = this.closure(this._list_onaction, "deleteMessage"); list.onundelete = this.closure(this._list_onaction,
"undeleteMessage"); list.oncensor = this.closure(this._list_onaction, "censorMessage"); list.onuncensor
= this.closure(this._list_onaction, "uncensorMessage"); list.onpurge = this.closure(this._list_onaction,
"purgeMessage"); } zfl_Guestbook.inherits(zfl_Control); zfl_Guestbook.prototype.add = function(withScroll)
{ if (!this._editable) return; this._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();
container.appendChild(edit.parentNode.removeChild(edit)); this._edit.setFocus(); this.notifyResize();
if (withScroll) { var offset = zf_stdGetOffset(edit); var scroll = zf_stdGetClientScroll(); var
editHeight = $(edit).outerHeight(true) + 40; var clientHeight = zf_stdGetClientHeight(); if (scroll.cy
+ clientHeight < offset.cy + editHeight) { scroll = offset.cy + Math.min(clientHeight - 10, editHeight)
- clientHeight; $('html').animate({ scrollTop: scroll }, 300); } } this._auth = new zf_MailboxAuthorization(this._mailbox);
}; zfl_Guestbook.prototype._edit_onsave = function(updater) { var self = this; var original = this._edit.getOriginal();
var onpost = function(message, error) { if (!error) { if (message != null) { self._enableEditing(true);
self._list.add(message); } else if (original != null) { self._enableEditing(true); self._list.remove(original.index);
} else { if (zf_userId == 0 && updater.isPrivate) { self._edit.setContinue( false, "Your entry has been sent directly to the owner of the guestbook. It will not appear in the list.",
function() { self._enableEditing(true); self._updateCount(); self.notifyResize(); }); self.notifyResize();
return; } } self._enableEditing(true); self._updateCount(); self.notifyResize(); return; } self._edit.setContinue(true,
error.message, function() { self._edit.setContinue(); }); }; if (original == null) zf_Message.postMessage(this._auth,
this._mailbox, updater, onpost); else zf_Message.updateMessage(this._auth, this._mailbox, original.index,
updater, onpost); }; zfl_Guestbook.prototype._edit_oncancel = function() { this._enableEditing(true);
this.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(); if (edit.parentNode != editbox) editbox.appendChild(edit.parentNode.removeChild(edit));
var original = this._edit.getOriginal(); this._list.restoreContainer(original ? original.index : -1);
} }; 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;
} }; zf_Message.loadMessageRange(this._mailbox, this._mailboxToken, first, count, onload); }; zfl_Guestbook.prototype._list_onedit
= function(message) { this._edit.setOriginal(message); this._enableEditing(false); var container =
this._list.prepareContainer(message.index); var edit = this._edit.dom(); container.appendChild(edit.parentNode.removeChild(edit));
this._edit.setFocus(); this._auth = new zf_MailboxAuthorization(this._mailbox); this.notifyResize();
}; zfl_Guestbook.prototype._list_onaction = function(message, action) { var self = this; var oncomplete
= function(updated, error) { if (!error) { if (updated) self._list.add(updated); else self._list.remove(message.index);
} self._updateCount(); self._enableEditing(true); self.notifyResize(); }; this._enableEditing(false);
this.notifyResize(); zf_Message[action](message.mailbox, message.index, oncomplete); }; zfl_Guestbook.prototype._updateCount
= function() { var count = this._list.getCount(); zf_stdReplaceClassName( this.dom("empty"), count
== 0 ? "none" : null, count == 0 ? null : "none"); if (this.oncountchange) this.oncountchange(count);
}; zfl_Guestbook.prototype._login_onclick = function() { if (this.onlogin) this.onlogin(); }; 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", more) .toggleClass("rootlink-open",
!more); };
; function zfl_UserLayout(id, global, local) { if (zf_stdNoArgs(arguments)) return; zfl_Layout.prototype.constructor.call(this,
id, global, local); 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(); zfl_Layout.prototype.onrecalc.call(this); }; zfl_UserLayout.prototype.recalcBins
= function() { if (this._bins.featured && this._bins.featured.expanded) this._grids.featured.recalcLayout();
if (this._bins.recent && this._bins.recent.expanded) this._grids.recent.recalcLayout(); if (this._bins.root
&& this._bins.root.expanded) { var info = this._grids.root.recalcLayout(); if (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, zfl_PhotoViewStyle.FolderElement,
this._grids.recentParams, this._data.recent); this._grids.recent.minRows = 1; this._grids.recent.setHeight(0);
} this.initGrid( this._grids.featured, zfl_PhotoViewStyle.FolderElement, this._grids.featuredParams,
this._data.featured); if (this._grids.root) { this.initGrid( this._grids.root, zfl_PhotoViewStyle.FolderElement,
this._grids.rootParams, this._data.root); if (this._rootLink) this._grids.root.maxRows = 2; } zfl_Layout.prototype.onload.call(this);
};
; ; ; 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, "folder")
}; this.setupGuestbook(global, local); } zfl_FolderLayout.inherits(zfl_Layout); zfl_FolderLayout.prototype.onload
= function() { this.initGrid( this._grids.folder, zfl_PhotoViewStyle.FolderElement, this._grids.folderParams,
this._data.folder); zfl_Layout.prototype.onload.call(this); }; zfl_FolderLayout.prototype.onrecalc
= function() { if (this._grids.folder != null) this._grids.folder.recalcLayout(); zfl_Layout.prototype.onrecalc.call(this);
};
; ; ; function zf_Sociable() { zf_Object.prototype.constructor.call(this); } zf_Sociable.inherits(zf_Object);
zf_Sociable.prototype.shareOnFacebook = function(shareable) { ; var title = shareable.title ? shareable.title
: ''; var fbUrl = [ 'http://www.facebook.com/sharer.php?u=', encodeURIComponent(shareable.url) ];
if (shareable.title) fbUrl.push('&t=', encodeURIComponent(shareable.title)); var name = Math.floor(Math.random()
* 1000); window.open(fbUrl.join(''), name.toString(), 'toolbar=0,status=0,width=626,height=436');
return false; }; zf_Sociable.prototype.shareOnTwitter = function(shareable) { ; var title = shareable.title
&& shareable.title.length < 100 ? shareable.title : ''; var url = [ '/zf/partners/twitter/tweet.aspx?u=',
encodeURIComponent(shareable.url) ]; url.push('&t=', encodeURIComponent(title)); window.open(url.join(''));
return false; }; 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; $(node).unbind('click.sociable').bind('click.sociable',
function(e) { sharefunction.apply(self, args); }); }; zf_Sociable.prototype.sharePhoto = function(photo)
{ var hostname = typeof(zf_userDomain) == 'undefined' ? document.location.hostname : zf_userDomain;
var icon = ['http://', hostname, photo.getExternalUrl(zf_ProcessingMethod.StandardThumbnail)].join('');
var url = photo.getHref('external'); var share = { url: url, title: photo.title, summary: '', icon:
icon }; return share; }; zf_Sociable.prototype.sharePhotoSet = function(photoSet) { var share =
{ url: photoSet.getHref('external'), title: photoSet.title ? photoSet.title : '', summary: '',
icon: '' }; return share; }; zf_Sociable.prototype.shareSlideshow = function(photoSet) { var share
= { url: [photoSet.getHref('external'), '/slideshow'].join(''), title: photoSet.title ? photoSet.title
: '', summary: '', icon: '' }; return share; }; zf_Sociable.prototype.sharePhotoSlideshow = function(photo,
text) { var url = [ photo.gallery.getHref('external'), '/e', photo.id.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'),
title: folder.title ? folder.title : '', summary: '', icon: '' }; return share; };
; function zfl_Links(id, photoPage, isAuth, refCode, refAmount, promotion, collection, slideshow)
{ zfl_Popup.prototype.constructor.call(this, id, false); this._photoPage = photoPage; this._isAuth
= isAuth; this._refCode = refCode; this._refAmount = refAmount; this._promotion = promotion; this._collection
= collection; this._slideshow = slideshow; this.$('.links-share-icon').hover( function() { $(this).addClass('links-share-icon-hover button-border2');
}, function() { $(this).removeClass('links-share-icon-hover button-border2'); } ); } zfl_Links.inherits(zfl_Popup);
zfl_Links.prototype._addTableRow = function(domTable, label, url) { var boxClass = "links-box links-color1 links-bgcolor1 links-border1 links-font1";
var labelClass = "links-directLabel links-font1"; var self = this; if (label == null) { boxClass
+= " invisible"; labelClass += " invisible"; label = url = ""; } var domRow = domTable.insertRow(-1);
var domLabel = domRow.insertCell(-1); domLabel.className = labelClass; zf_stdSetText(domLabel, label);
var domLink; domLink = document.createElement("INPUT"); domLink.type = "text"; domLink.readOnly
= true; domLink.value = url; domLink.onclick = function(e) { zf_stdGetEventSource(e).select(); } ;
domLink.className = boxClass; domRow.insertCell(-1).appendChild(domLink); domLabel = null; domLinnk
= null; domRow = null; }; zfl_Links.prototype.show = function(domOrigin, photoSet, photo) { if (!this._sociable)
this._sociable = new zf_Sociable(); var sociable = this._sociable; var self = this; var bindLinks
= function(id, shareable) { var fbNode = $(self.dom(id)).closest('.links-line').find('.links-fb-icon');
var twNode = $(self.dom(id)).closest('.links-line').find('.links-twitter-icon'); sociable.bind(fbNode,
sociable.shareOnFacebook, shareable); sociable.bind(twNode, sociable.shareOnTwitter, shareable);
}; bindLinks('Gallery', sociable.sharePhotoSet(photoSet)); bindLinks('Slideshow', sociable.shareSlideshow(photoSet));
if (photo) bindLinks('Photo', sociable.sharePhoto(photo)); if (photo == null) { zfl_Popup.prototype.show.call(this,
domOrigin); return; } var domPhotoLink = this.dom("Photo"); var domDirectLinks = this.dom("direct");
var domNoDirectLinks = this.dom("nodirect"); var link; var domLoginLink = this.dom("loginLink");
if (domLoginLink) { ; var a = domLoginLink.getElementsByTagName("A"); for (var i = 0; i < a.length;
i++) { if (a[i].className == "login") a[i].onclick = this.eventHandler(this._login_onclick, photo);
} } domPhotoLink.value = photo.getHref("external"); if (domDirectLinks == null || domNoDirectLinks
== null) { zfl_Popup.prototype.show.call(this, domOrigin); return; } if (photo.owner.id != zf_userId)
{ domDirectLinks.style.display = "none"; domNoDirectLinks.style.display = "block"; zfl_Popup.prototype.show.call(this,
domOrigin); return; } domNoDirectLinks.style.display = "none"; domDirectLinks.style.display = "block";
var width = photo.image.width; var height = photo.image.height; var list = [ { method: zf_ProcessingMethod.StandardSmallThumbnail,
mask: 0 }, { method: zf_ProcessingMethod.StandardThumbnail, mask: 0 }, { method: zf_ProcessingMethod.StandardLargeThumbnail,
mask: 0 }, { method: zf_ProcessingMethod.StandardVeryLargeThumbnail, mask: 0 }, { method: zf_ProcessingMethod.StandardSmallSize,
mask: 0 }, { method: zf_ProcessingMethod.StandardMediumSize, mask: zf_AccessMask.ProtectMedium
}, { method: zf_ProcessingMethod.StandardLargeSize, mask: zf_AccessMask.ProtectLarge }, { method:
zf_ProcessingMethod.StandardExtraLargeSize, mask: zf_AccessMask.ProtectExtraLarge }, { method: zf_ProcessingMethod.StandardXXLargeSize,
mask: zf_AccessMask.ProtectXXLarge } ]; var strUrl; var strLabel; var domTable = domDirectLinks.getElementsByTagName("TABLE")[0];
while (domTable.rows.length > 0) domTable.deleteRow(0); var warningTopRow, warningBottomRow; var
rows = 0; for (i = 0; i <= list.length; i++) { if (i < list.length) { var method = list[i].method;
if (method.cx >= width && method.cy >= height) continue; var size = photo.image.getScaledSize(method);
strLabel = zf_stdFormatString(method.format, size.cx, size.cy); strUrl = photo.getExternalUrl(method);
} else { strUrl = photo.getOriginalUrl(photo.fileType); strLabel = zf_stdFormatString("Original Photo ({0} x {1})",
width, height); } strUrl = document.location.protocol + "//" + document.location.hostname + strUrl;
var publicPhoto = photo.access.type == zf_AccessType.Public; var protectOriginals = (photo.access.mask
& zf_AccessMask.ProtectOriginals) != 0; var protect = !publicPhoto || i < list.length && (list[i].mask
& photo.access.mask) != 0 || i == list.length && protectOriginals; if (protect && warningTopRow ==
null) { warningTopRow = rows++; this._addTableRow(domTable); } if (!protect && warningBottomRow
== null && warningTopRow != null) { warningBottomRow = rows++; this._addTableRow(domTable); } this._addTableRow(domTable,
strLabel, strUrl); ++rows; } if (warningBottomRow == null && warningTopRow != null) { warningBottomRow
= rows++; this._addTableRow(domTable); } var domWarning = this.dom("warning"); if (warningTopRow
!= null) { var rowHeight = 22; var top = rowHeight * warningTopRow + rowHeight / 2; height = (warningBottomRow
- warningTopRow) * rowHeight; domWarning.style.top = top + "px"; domWarning.style.height = height
+ "px"; domWarning.style.display = "block"; } else { domWarning.style.display = "none"; } zfl_Popup.prototype.show.call(this,
domOrigin); }; zfl_Links.prototype._linkbox_onclick = function(e) { zf_stdGetEventSource(e).select();
}; zfl_Links.prototype.send = function() { var subject = this._promotion ? "Invitation to view photographs on Zenfolio"
: "Invitation to view photographs"; var body; var urlGallery; var urlPhoto; var urlSlideshow; urlGallery
= this.dom("Gallery").value; if (this._photoPage) { urlPhoto = this.dom("Photo").value; } if (this._slideshow)
{ urlSlideshow = this.dom("Slideshow").value; if (!this._photoPage) { body = zf_stdFormatString(
this._collection ? "Collection:\r\n{0} \r\n\r\nSlideshow:\r\n{1}" : "Gallery:\r\n{0} \r\n\r\nSlideshow:\r\n{1}",
urlGallery, urlSlideshow); } else { body = zf_stdFormatString( this._collection ? "Collection:\r\n{0} \r\n\r\nSlideshow:\r\n{1} \r\n\r\nPhoto:\r\n{2}"
: "Gallery:\r\n{0} \r\n\r\nSlideshow:\r\n{1} \r\n\r\nPhoto:\r\n{2}", urlGallery, urlSlideshow, urlPhoto);
} } else { if (!this._photoPage) { body = zf_stdFormatString( this._collection ? "Collection:\r\n{0}"
: "Gallery:\r\n{0}", urlGallery); } else { body = zf_stdFormatString( this._collection ? "Collection:\r\n{0} \r\n\r\nPhoto:\r\n{1}"
: "Gallery:\r\n{0} \r\n\r\nPhoto:\r\n{1}", urlGallery, urlPhoto); } } var footer = ""; if (this._promotion)
{ var footerFormat; if (!this._isAuth) { footerFormat = "\r\n\r\n-----------------------------------------------\r\nGet a Free Trial account on Zenfolio in less than 60 seconds\r\n{0}";
var urlZenfolio = "http://" + zf_defaultHost; footer = zf_stdFormatString(footerFormat, urlZenfolio);
} else { footerFormat = "\r\n\r\n-----------------------------------------------\r\Open a Zenfolio account with my referral code {0} and save {1}";
footer = zf_stdFormatString(footerFormat, this._refCode, this._refAmount); } } var mailto = "mailto:?subject="
+ escape(subject) + "&body=" + escape(body + footer); document.location.href = mailto; this.hide();
}; zfl_Links.prototype._login_onclick = function(e, photo) { zfl_Header.login(photo.getHref("full"));
};
; function zf_CurrencyInfo() { this.name = null; this.code = null; this.numericCode = 0; } zf_CurrencyInfo.prototype.toString
= function() { return this.code; }; zf_CurrencyInfo.all = _zf_stdTransformResponse( [{"$type": "CurrencyInfo","name":
"US Dollar","pluralName": "US Dollars","shortName": "USD","code": "USD","symbol": "$"},{"$type": "CurrencyInfo","name":
"Canadian Dollar","pluralName": "Canadian Dollars","shortName": "CAD","code": "CAD","symbol": "C$"},{"$type":
"CurrencyInfo","name": "Euro","pluralName": "Euros","shortName": "EUR","code": "EUR","symbol": "\u20AC"},{"$type":
"CurrencyInfo","name": "Pound Sterling","pluralName": "Pounds Sterling","shortName": "GBP","code":
"GBP","symbol": "\u00A3"},{"$type": "CurrencyInfo","name": "Australian Dollar","pluralName": "Australian Dollars","shortName":
"AUD","code": "AUD","symbol": "AU$"},{"$type": "CurrencyInfo","name": "Czech Koruna","pluralName":
"Czech Koruny","shortName": "CZK","code": "CZK","symbol": "K\u010D"},{"$type": "CurrencyInfo","name":
"Danish Krone","pluralName": "Danish Kroner","shortName": "DKK","code": "DKK","symbol": "kr"},{"$type":
"CurrencyInfo","name": "Hong Kong Dollar","pluralName": "Hong Kong Dollars","shortName": "HKD","code":
"HKD","symbol": "HK$"},{"$type": "CurrencyInfo","name": "Hungarian Forint","pluralName": "Hungarian Forint","shortName":
"HUF","code": "HUF","symbol": "Ft"},{"$type": "CurrencyInfo","name": "Israeli New Shekel","pluralName":
"Israeli New Shekels","shortName": "ILS","code": "ILS","symbol": "\u20AA"},{"$type": "CurrencyInfo","name":
"Japanese Yen","pluralName": "Japanese Yen","shortName": "JPY","code": "JPY","symbol": "\u00A5"},{"$type":
"CurrencyInfo","name": "Mexican Peso","pluralName": "Mexican Pesos","shortName": "MXN","code": "MXN","symbol":
"Mex$"},{"$type": "CurrencyInfo","name": "New Zealand Dollar","pluralName": "New Zealand Dollars","shortName":
"NZD","code": "NZD","symbol": "NZ$"},{"$type": "CurrencyInfo","name": "Norwegian Krone","pluralName":
"Norwegian Kroner","shortName": "NOK","code": "NOK","symbol": "kr"},{"$type": "CurrencyInfo","name":
"Polish Zloty","pluralName": "Polish Zloty","shortName": "PLN","code": "PLN","symbol": "z\u0142"},{"$type":
"CurrencyInfo","name": "Singapore Dollar","pluralName": "Singapore Dollars","shortName": "SGD","code":
"SGD","symbol": "S$"},{"$type": "CurrencyInfo","name": "Swedish Krona","pluralName": "Swedish Kronor","shortName":
"SEK","code": "SEK","symbol": "kr"},{"$type": "CurrencyInfo","name": "Swiss Franc","pluralName": "Swiss Francs","shortName":
"CHF","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];
} })();
; function zfl_ControlBox(id, photoPage, init) { this._photoPage = photoPage; this._buttons = [];
if (init.buttons.addToCart) this._buttons.push(init.buttons.addToCart); if (init.buttons.share)
this._buttons.push(init.buttons.share); if (init.buttons.slideshow) this._buttons.push(init.buttons.slideshow);
jQuery.extend(this._buttons, init.buttons); this._popups = init.popups; this._photoDisplayed = false;
zfl_Control.prototype.constructor.call(this, id); zf_stdMakeMethodsDeferred(this, this.id, ["_showButtons"]);
if (this._buttons.slideshow) { var installed = this._popups.flash.installed; if (installed) { this._buttons.slideshow.clickable
= false; var self = this; this._popups.flash.onselect = function(index) { if (self.onselect) self.onselect(index);
}; this._popups.flash.onslide = function(id, index) { if (self.onslide) self.onslide(id, index);
}; } else { this.$().addClass("controlbox-no-flash"); } } } zfl_ControlBox.inherits(zfl_Control);
zfl_ControlBox.prototype.init = function(photoList, photoSet) { ; this._photoList = photoList;
this._photoSet = photoSet; if (this._buttons.length > 1) { $(this._buttons[0].dom()).css('float',
'left'); if (this._buttons.length == 3) { var domButton = this._buttons[1].dom(); $(domButton).css('float',
'left'); var domLeft = this._buttons[0].dom(); var domRight = this._buttons[2].dom(); var left = domLeft.offsetWidth;
var right = domRight.offsetWidth; var center = domButton.offsetWidth; var whole = domButton.parentNode.offsetWidth;
var shift = Math.ceil((whole - (left + right + center)) / 2); domButton.style.left = shift + "px";
domLeft = null; domRight = null; } domButton = null; } if (!this._photoPage) this._showButtons(true);
}; zfl_ControlBox.prototype._showButtons = function(show) { if (this._buttons.addToCart) this._buttons.addToCart.visibility(!this._photoPage
|| this.canAddToCart()); if (this._buttons.slideshow) this._buttons.slideshow.visibility(show);
if (this._buttons.share) this._buttons.share.visibility(show); }; zfl_ControlBox.prototype.share
= function() { this._popups.links.show(this._buttons.share.dom(), this._photoSet, this.current);
}; zfl_ControlBox.prototype.addToCart = function() { if (this.onaddtocart) this.onaddtocart(); };
zfl_ControlBox.prototype.update = function(photo, context) { ; ; ; if (this.current == photo) return;
if (this._popups.links) this._popups.links.hide(); if (this._popups.addToCart) this._popups.addToCart.hide();
if (this.current != null) this.current.unadvise(this); this.current = photo; this._photoDisplayed
= context.displayed; this._showButtons(photo.loaded); if (!photo.loaded) { var self = this; photo.advise(this,
function() { self._showButtons(true); }); } if (this._popups.flash) this._popups.flash.update(photo,
context); }; zfl_ControlBox.prototype.canAddToCart = function() { return this._buttons.addToCart
!= null && this.current != null && this.current.loaded && this.current.priceKey != "" && this._photoDisplayed
== true; }; zfl_ControlBox.prototype.canShare = function() { return this._popups.links; }; zfl_ControlBox.prototype.canSlideshow
= function() { return this._buttons.slideshow; }; zfl_ControlBox.prototype.photoDisplayed = function()
{ this._photoDisplayed = true; this._showButtons(true); }; zfl_ControlBox.prototype.slideshow =
function() { var uri = location.pathname + "/slideshow" + location.hash; var formatFeatures = "left=0,top=0,width={0},height={1},resizable=yes,fullscreen=yes,"
+ "scrollbars=no,menubar=no,toolbar=no,location=no," + "status=no"; var width = screen.availWidth
? screen.availWidth : screen.width; var height = screen.availHeight ? screen.availHeight : screen.height;
var features = zf_stdFormatString(formatFeatures, width, height); var w = window.open(uri, "zf_Slideshow",
features); 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.");
};
; ; function zfl_SessionCookie(cookie) { ; var parts = cookie.split("."); ; this.sessionKey = parts[0];
this.recentPhotoSetId = parts[1].length > 0 ? parseInt(parts[1]) : 0; this.recentPhotoIndex = parts[2].length
> 0 ? parseInt(parts[2]) : -1; this.showAll = false; if (parts.length > 3) this.showAll = parts[3]
== "1"; ; ; } zfl_SessionCookie.prototype.setRecent = function(photoSetId, photoIndex) { ; ; this.recentPhotoSetId
= photoSetId; this.recentPhotoIndex = photoIndex; this._save(); }; zfl_SessionCookie.prototype.setShowAll
= function(showAll) { this.showAll = showAll; this._save(); }; zfl_SessionCookie.prototype._save
= function() { if (!this.sessionKey) return; zf_stdSetCookie( "zf_lsc", [ this.sessionKey, this.recentPhotoSetId,
this.recentPhotoIndex, this.showAll ? 1 : 0 ].join(".")); };
; ; function zf_User() { zf_Loadable.prototype.constructor.call(this); this.photos = 0; this.galleries
= 0; this.collections = 0; this.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; var 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); if (this.domainName == null) this.domainName
= this.loginName + zf_defaultDomain; this.copyright = "Copyright \xA9 " + this.displayName; };
; ; function zf_PhotoList(offset, page, length, ids) { ; this._offset = offset; this._page = page;
this._photos = []; this._map = {}; if (typeof(ids) == "number") { this._photoSetId = ids; } else
{ ; ; this._photoIds = ids; for (var i = 0; i < ids.length; i++) this._map[ids[i]] = i; } this.length
= length; this._fresh = true; } zf_PhotoList.prototype.get = function(index, touch) { ; if (index
>= this.length) return null; if (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; to = 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; i < 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, from); if (from + photos.length < to) { self.length = from + photos.length;
if (self.onshrink != null) { if (!self.onshrink()) return; } } if (self.onload != null) self.onload(first);
}; if (this._photoSetId != null) { this.getPhotoRange(from, to, 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; if (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; return photo; }; zf_PhotoList.prototype.find
= function(id) { var index = this._map[id]; return index != null ? index : -1; }; zf_PhotoList.prototype.setDefaults
= function(photoSet, owner) { this._defaultPhotoSet = photoSet; this._defaultOwner = owner; };
zf_PhotoList.prototype.loadAll = function(callback) { ; ; var from = null; var 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();
return; } 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; if (self.onshrink != null) self.onshrink(); } if (self.onload != null) self.onload(false);
callback(); }); }; zf_PhotoList.prototype._adopt = function(photos, offset) { ; ; for (i = 0; i <
photos.length; i++) { var src = photos[i]; var dest = this._photos[i + offset]; ; this._map[src.id]
= i + offset; if (this._defaultPhotoSet) src.photoSet = this._defaultPhotoSet; if (this._defaultOwner
&& src.owner && src.owner.id == this._defaultOwner.id) src.owner = this._defaultOwner; if (!(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(); } } } };
; function zfl_PhotoList(offset, page, length, ids, token, photoSetPcn, tokenId) { zf_PhotoList.prototype.constructor.call(this,
offset, page, length, ids); this._token = token; this._photoSetPcn = photoSetPcn; this._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,
this._photoSetId, from, to, this._token, zfl_SessionCookie.current.sessionKey, this._photoSetPcn ];
var callback = function(status, retVal) { if (status != 200 || retVal.error != null) return; oncomplete(retVal.result);
}; if (urgent) { zf_stdServerRequest("GET", "/zf/layout/layout.asmx", "GetPhotoRange", params, callback);
} else { zfl_PhotoList.requests.enqueue("GET", "/zf/layout/layout.asmx", "GetPhotoRange", params,
callback); } }; zfl_PhotoList.prototype.getPhotoBatch = function(ids, oncomplete) { var params = [
this._defaultOwner.id, this._tokenId, ids, this._token, zfl_SessionCookie.current.sessionKey, this._photoSetPcn
]; zfl_PhotoList.requests.enqueue("GET", "/zf/layout/layout.asmx", "GetPhotoBatch", params, function(status,
retVal) { if (status != 200 || retVal.error != null) return; oncomplete(retVal.result); }); };
; function zfl_ActionLinks(id, pinned) { zfl_Control.prototype.constructor.call(this, id); this._pinned
= pinned; zf_stdMakeMethodsDeferred(this, this.id, ["_showPhotoLinks"]); } zfl_ActionLinks.inherits(zfl_Control);
zfl_ActionLinks.prototype.safecall = function(name) { ; if (this[name]) this[name](); }; zfl_ActionLinks.prototype.show
= function(animate) { if (this._pinned) return; if (animate) { var self = this; this.$() .clearQueue()
.delay(600) .queue(function(next) { zf_stdDeferCall(null, self.recalc, self); next(); }) .slideDown(600);
} else { this.$() .clearQueue() .css({ display: "block", height: "auto" }); this.recalc(); } };
zfl_ActionLinks.prototype.hide = function(animate) { if (this._pinned) return; if (animate) { this.$()
.clearQueue() .delay(1000) .slideUp(600); } else { this.$() .clearQueue() .css({ display: "none",
height: "auto" }); } }; zfl_ActionLinks.prototype.update = function(photo, context) { ; ; if (this.current
== photo) return; if (this.current != null) this.current.unadvise(this); this.current = photo;
this._photoDisplayed = context.displayed; this._showPhotoLinks(); if (!photo.loaded) { var self
= this; photo.advise(this, function() { self._showPhotoLinks(); }); } }; zfl_ActionLinks.prototype.photoDisplayed
= function() { this._photoDisplayed = true; this._showPhotoLinks(); }; zfl_ActionLinks.prototype._showPhotoLinks
= function() { var photo = this.current; if (!photo) return; var ready = photo.loaded && this._photoDisplayed;
var actions = { addToFavorites : ready && photo.photoSet.owner.id == photo.owner.id, addToCart
: ready && photo.priceKey != "", download : ready && (photo.access.mask & zf_AccessMask.ProtectOriginals)
== 0 }; this.enableActions(actions); }; zfl_ActionLinks.prototype.recalc = function() { var width
= this.$().width(); var centered = this.$(".actions-center").length > 0; var hasSelect = this.$(".actions-select").length
> 0; if (centered && hasSelect) this.$(".actions-inner").toggleClass("actions-squeezed", width < 580);
}; zfl_ActionLinks.prototype.enableActions = function(actions) { this.$dom("addtofav").toggleClass("none",
actions.addToFavorites ? false : true); this.$dom("addtocart").toggleClass("none", actions.addToCart
? false : true); this.$dom("download").toggleClass("none", actions.download ? false : true); };
; function zfl_MessageBox(id, args) { zfl_Control.prototype.constructor.call(this, id); this._onbutton
= args.onbutton; var self = this; this.$(".mbox-btn").click(function() { self._button_onclick(this);
return false; }); } zfl_MessageBox.inherits(zfl_Control); zfl_MessageBox._counter = 0; zfl_MessageBox.show
= function(args) { ; var id = "_zfl_MessageBox_" + zfl_MessageBox._counter++; var buttons = $.map(args.buttons,
function(label, index) { return zfl_Button.createHtml(null, label, ["mbox-btn", "mbox-btn-" + index]);
}); var classes = ""; if (args.classes) classes = args.classes; var markup = [ '<div class="mbox-outer ',
classes, '" id="', id, '">', '<div class="mbox popup-border1 popup-color1 popup-bgcolor1">', '<div class="text">',
zf_stdHtmlEncode(args.text), '</div>', '<div class="buttons">', buttons.join(""), '</div>', '</div>',
'</div>' ]; if (args.curtain == undefined || args.curtain) zfl_Curtain.show("light"); var mbox =
$(markup.join("")).appendTo("body"); var top = Math.floor((zf_stdGetClientHeight() - mbox.outerHeight())
/ 2); var left = Math.floor((zf_stdGetClientWidth() - mbox.outerWidth()) / 2); mbox.css({ top: top
+ "px", left: left + "px" }); return new zfl_MessageBox(id, args); }; zfl_MessageBox.prototype.hide
= function() { this.$().remove(); zfl_Curtain.hide(); }; zfl_MessageBox.prototype._button_onclick
= function(button) { ; var matches = /mbox-btn-(\d+)/.exec(button.className); ; var index = parseInt(matches[1]);
if (!this._onbutton || this._onbutton(index) != false) this.hide(); };
; function zfl_PhotoSetLayout(id, global, local) { zfl_Layout.prototype.constructor.call(this, id,
global, local); zfl_PhotoDownload.prototype.constructor.call(this); var self = this; this._photoSet
= zfl_stdTransformResponse(local.photoSet, "photoSet"); this._photoList = local.photoList; this._photoList.setDefaults(this._photoSet,
this._photoSet.owner); this._photoList.onload = this.closure(this._photoList_onload); this._controlBox
= local.controlBox; var pager = local.pager; var grid = this._grids.photos; this.showAll = local.pager
== null; if (grid && pager) { this._pager = pager; this.showAll = false; var cookie = zfl_SessionCookie.current;
if (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,
info.currentPage); }; pager.onall = function() { self._setPagerMode(zf_Pager.All); self.recalc();
}; pager.onpaged = function() { self._setPagerMode(zf_Pager.Paged); self.recalc(); }; pager.onchange
= function(page) { grid.setPage(page); grid.recalcLayout(); }; } if (grid) { this._photoList.onshrink
= function() { grid.setSize(self._photoList.length); return true; }; } if (local.controlBox) {
local.controlBox.onslide = function(id, index) { self._registerSlideVisit(index); }; local.controlBox.onaddtocart
= this.closure(this._addToCart); } this.setupGuestbook(global, local); if (local.actions) { this._actions
= local.actions; local.actions.onselectall = this.closure(this._selectAll); local.actions.onselectnone
= this.closure(this._selectNone); local.actions.onaddtofav = this.closure(this._addToFavorites);
local.actions.onaddtocart = this.closure(this._addToCart); local.actions.ondownload = this.closure(this._download);
} if (local.quickPriceList) { local.quickPriceList.addtocart = this.closure(this._addToCart); local.quickPriceList.init(this.zenbar.cart);
} if (this.scrapbook) this.scrapbook.onchange = this.closure(this._scrapbook_onchange); this.cyMinFooter
= 15; } zfl_PhotoSetLayout.inherits(zfl_Layout, zfl_PhotoDownload); zfl_PhotoSetLayout.prototype.onrecalc
= function() { zfl_Layout.prototype.onrecalc.call(this); if (this._pager && this._grids.photos)
{ var info = this._grids.photos.getLayoutInfo(); this._pager.update(info.totalPages, info.currentPage);
} if (this._actions) this._actions.recalc(); }; zfl_PhotoSetLayout.prototype.onload = function()
{ if (this._grids.photosParams && this._grids.photosParams.mselection) { this._selection = zfl_PhotoSelection.load("photos",
this._photoSet.id); this._selection.onchange = this.closure(this._selection_onchange); } var photoList
= this._photoList; this.initGrid( this._grids.photos, zfl_PhotoViewStyle.GalleryPhoto, this._grids.photosParams,
function(index) { return photoList.get(index); }, photoList.length, this._selection); if (this._controlBox)
this._controlBox.init(this._photoList, this._photoSet); 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; grid.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; if (cookie && cookie.recentPhotoSetId
== this._photoSet.id && cookie.recentPhotoIndex >= 0 && cookie.recentPhotoIndex < this._photoList.length)
{ info = grid.getLayoutInfo(); if (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; } else { info.currentPage = Math.floor(cookie.recentPhotoIndex
/ info.itemsPerPage); grid.setPage(info.currentPage); } info = null; } else { if (cookie) cookie.setRecent(this._photoSet.id,
0); } 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; this.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); ; if (photo.loaded) { if (photo.access.type == zf_AccessType.Password
&& photo.access.ownerId != zf_userId) return; var sessionKey = zfl_SessionCookie.current.sessionKey;
zf_stdServerRequest("GET", "/zf/layout/layout.asmx", "RegisterVisit", [ photo.owner.id, photo.gallery.id,
photo.id, this._photoSet.owner.id, this._photoSet.id, sessionKey ], zf_stdTrue); } else { var self
= this; photo.advise({}, function() { self._registerSlideVisit(photoIndex); }); } }; zfl_PhotoSetLayout.prototype._selection_onchange
= function() { zf_stdDeferCall(this.id + ".selection", this._selection.save, this._selection, "photos");
this._updateActions(); }; zfl_PhotoSetLayout.prototype._selectAll = function() { if (!this._selection)
return; var self = this; var photoList = this._photoList; var grid = this._grids.photos; photoList.loadAll(function()
{ var ids = []; for (var i = 0; i < photoList.length; i++) { var photo = photoList.get(i); ids.push(photo.id);
if (grid) grid.selectItem(i); } self._selection.select(ids); }); }; zfl_PhotoSetLayout.prototype._selectNone
= function() { if (!this._selection) return; this._selection.unselect(); if (this._grids.photos)
this._grids.photos.deselectAll(); }; zfl_PhotoSetLayout.prototype._addToFavorites = function(noconfirm)
{ if (!this.scrapbook) return; var self = this; if (!noconfirm && this._selection && this._selection.none())
{ var text = this._photoSet.type == zf_PhotoSet.Gallery ? "You are about to add all photos from the gallery to Favorites"
: "You are about to add all photos from the collection to Favorites"; var button = this._photoSet.type
== zf_PhotoSet.Gallery ? "Add the entire gallery" : "Add the entire collection"; zfl_MessageBox.show({
text: text, buttons: ["Cancel", button], onbutton: function(i) { if (i == 1) self._addToFavorites(true);
} }); return; } if (!this._selection || this._selection.none()) { var photoList = this._photoList;
photoList.loadAll(function() { var ids = []; for (var i = 0; i < photoList.length; i++) { var photo
= photoList.get(i); ids.push(photo.id); } self.scrapbook.addPhotos(ids); }); } else { this.scrapbook.addPhotos(this._selection.get());
} }; zfl_PhotoSetLayout.prototype._addToCart = function(vendorId, productId) { if (!this.zenbar)
return; var photoList = this._photoList; var photos = []; var dereference = function(id) { var index
= photoList.find(id); return index == -1 ? null : photoList.get(index); }; var printable = function(photo)
{ return photo.priceKey != "" ? photo : null; }; var setPhotos = this.zenbar.addToCart(null, vendorId,
productId); if (this._selection && !this._selection.none()) { var ids = this._selection.get();
photos = $.map(ids, dereference); if (photos.length < ids.length) { photoList.loadAll(function()
{ photos = $.map(ids, dereference); setPhotos($.map(photos, printable)); }); return; } setPhotos($.map(photos,
printable)); return; } photoList.loadAll(function() { for (var i = 0; i < photoList.length; i++)
{ var photo = photoList.get(i); ; if (photo.priceKey != "") photos.push(photo); } setPhotos(photos);
}); }; zfl_PhotoSetLayout.prototype._download = function() { if (!this._selection || this._selection.none())
{ var text = this._photoSet.type == zf_PhotoSet.Gallery ? "You are about to download all photos from the gallery"
: "You are about to download all photos from the collection"; var button = this._photoSet.type ==
zf_PhotoSet.Gallery ? "Download the entire gallery" : "Download the entire collection"; var self
= this; zfl_MessageBox.show({ text: text, buttons: ["Cancel", button], onbutton: function(i) {
if (i == 1) self._downloadOriginals(self._photoSet.title, self._photoList); } }); return; } this._downloadOriginals(this._photoSet.title,
this._selection.get()); }; zfl_PhotoSetLayout.prototype._scrapbook_onchange = function(info, edit)
{ 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.";
else 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, buttons: ["OK"] }); } }; zfl_PhotoSetLayout.prototype._photoList_onload
= function(first) { ; this.recalc(); var selection = this._selection; if (first && selection) {
if (selection.none()) { selection.__zfl_verified = true; this._updateActions(true); return; } var
self = this; this._photoList.loadAll(function() { selection.__zfl_verified = true; var 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); else self._updateActions(true);
}); } }; zfl_PhotoSetLayout.prototype._updateActions = function(first) { if (!this._actions || !this._selection)
return; if (!this._selection.__zfl_verified) return; if (this._selection.none()) { this._actions.enableActions({
addToFavorites: true, addToCart: true, download: true }); this._actions.hide(true); return; } var
actions = { addToFavorites: false, addToCart: false, download: false }; var selected = this._selection.get();
for (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;
actions.addToFavorites = actions.addToFavorites || photo.owner.id == this._photoSet.owner.id; actions.addToCart
= actions.addToCart || photo.priceKey != ""; actions.download = actions.download || (photo.access.mask
& zf_AccessMask.ProtectOriginals) == 0; } this._actions.enableActions(actions); this._actions.show(!first);
};
; function zfl_QuickPriceList(id, isPhotoSet, priceKey) { zfl_Control.prototype.constructor.call(this,
id); this._popup = new zfl_Popup(this.dom('popup').id); var self = this; var template = this.$('.qpl-template');
template.hover( function() { $(this).addClass('qpl-product-hover qpl-bgcolor2'); }, function() { $(this).removeClass('qpl-product-hover qpl-bgcolor2');
} ); var name = template.find('.qpl-product-name').hover( function() { $(this).addClass('qpl-color2').removeClass('qpl-color1');
}, function() { $(this).addClass('qpl-color1').removeClass('qpl-color2'); } ); template.click(this.closure(this._product_onclick));
this._priceKey = priceKey; this._isPhotoSet = isPhotoSet; } zfl_QuickPriceList.inherits(zfl_Control);
zfl_QuickPriceList.prototype.init = function(cart) { this._cart = cart; var self = this; cart.change.attach(function()
{ if (self._rawPriceList && self._cart.currency) { if (self._rawPriceList.currency.code != self._cart.currency.code)
self._loadAndRender(self._priceKey, self._cart.currency); } }); var bin = zf_Control.find(this.$('.bin:first')[0].id);
bin.setTitleSuffix([ '<span class="qpl-header-right">', '<a id="', this.id, '-currencies"><span class="qpl-currency"></span>&#9660;</a> ',
'from', '</span>' ].join('')); this.$('.qpl-addtocart').click(function() { self.addtocart(); });
$(this.dom('currencies')).click(this.closure(this._currencies_onclick)); if (this._isPhotoSet && this._priceKey)
this._loadAndRender(this._priceKey); }; zfl_QuickPriceList.prototype.update = function(photo) {
var oldKey = this._priceKey; if (this.current) this.current.unadvise(this); this.current = photo;
var self = this; var onPhotoLoaded = function() { var pricekey = new zf_PriceKey(photo); if (!pricekey.equals(oldKey))
self._loadAndRender(pricekey, self._cart.currency); }; if (photo.loaded) onPhotoLoaded(); else
photo.advise(this, onPhotoLoaded); }; zfl_QuickPriceList.prototype._loadAndRender = function(pricekey,
currency) { ; var self = this; this._priceKey = pricekey; if (pricekey.pricingKey == '') { $(this.dom()).removeClass('qpl-loading').addClass('qpl-nopricing');
return; } $(this.dom()).removeClass('qpl-nopricing').addClass('qpl-loading'); ; if (currency && this._cart.size
== 0) this._cart.currency = currency; else if (!currency) currency = this._cart.currency; zf_PriceList.loadFeatured(pricekey,
currency, function(cacheKey, pricelist) { if (self._priceKey && self._priceKey.equals(pricekey))
{ if (!self._cart.currency || self._cart.currency.code == currency.code) self._renderPricing(pricelist);
} }); }; zfl_QuickPriceList.prototype._renderPricing = function(pricelist) { ; this._rawPriceList
= pricelist; $(this.dom()).removeClass('qpl-loading'); var shipzone = zf_AddToCart.getShippingZone(pricelist);
pricelist = pricelist.filter(shipzone); this.$('.qpl-currency').text(pricelist.currency.shortName);
var products = []; for (vendorId in pricelist.vendors) { var vendor = pricelist.vendors[vendorId];
for (productId in vendor.products) products.push(vendor.products[productId]); } var sortWeights
= pricelist.getWeights(zf_PricingSortWeight.Type.FeaturedProduct); if (jQuery.isEmptyObject(sortWeights))
sortWeights = pricelist.getWeights(zf_PricingSortWeight.Type.Product); products.sort(pricelist.getProductComparer(null,
sortWeights)); var container = this.$('.qpl-products').empty(); var cntPrintable = 0; var lastWeight
= 0; for (var i = 0; i < products.length; i++) { var product = products[i]; var weight = sortWeights[zf_PricingSortWeight.getProductKey(true,
product)]; if (weight == null) weight = lastWeight; if (this.current && !zf_AddToCart.isPhotoPrintable(product,
this.current)) continue; cntPrintable++; if (weight - lastWeight > 100) container.append('<div class="qpl-separator">&nbsp;</div>');
var name = product.meta().name; var row = this.$('.qpl-template').clone(true).removeClass('qpl-template');
row.find('.qpl-product-price').text(zf_stdFormatMoney(product.minPrice)); row.find('.qpl-product-name').text(name);
row.data('zf-product', product); container.append(row); lastWeight = weight; } $(this.dom()).toggleClass('qpl-empty',
cntPrintable == 0); }; zfl_QuickPriceList.prototype._product_onclick = function(e) { var product =
$(e.currentTarget).closest('.qpl-product').data('zf-product'); this.addtocart(product.vendor.id,
product.id); }; zfl_QuickPriceList.prototype._currencies_onclick = function(e) { ; var pricelist
= this._rawPriceList; var popup = $(this.dom('popup')); var container = popup.find('.qpl-popup-currencies').empty();
var currencies = []; currencies.push(this._rawPriceList.currency); currencies = currencies.concat(this._rawPriceList.alternateCurrencies);
var shipzone = zf_AddToCart.getShippingZone(this._rawPriceList); for (var i = 0; i < currencies.length;
i++) { var cssClass = i == 0 ? ' selected qpl-bgcolor3' : ''; var html = [ '<a data-code="', currencies[i].code,
'" class="qpl-popup-currency', cssClass, '">', currencies[i].shortName, '</a>' ]; if (i < currencies.length
- 1) html.push(' | '); container.append(html.join('')); } popup.find('.qpl-popup-section-currency').toggle(
this._cart.size == 0 && this._rawPriceList.alternateCurrencies.length > 0); popup.find('.qpl-popup-shipzone').removeClass('selected qpl-bgcolor3')
.filter('[data-shipzone=' + shipzone.code + ']') .addClass('selected qpl-bgcolor3'); popup.find('.qpl-popup-shipzone, .qpl-popup-currency').unbind('click').bind('click',
function() { $(this).addClass('selected qpl-bgcolor3') .siblings().removeClass('selected qpl-bgcolor3');
}); var self = this; popup.find('.qpl-popup-btn-ok').unbind('click').bind('click', function() {
var szCode = popup.find('.qpl-popup-shipzone.selected').attr('data-shipzone'); var currencyCode
= popup.find('.qpl-popup-currency.selected').attr('data-code'); var currency = zf_CurrencyInfo.all[currencyCode];
if (szCode != shipzone.code) zf_AddToCart.setShippingZone(szCode); if (currencyCode != pricelist.currency.code)
self._loadAndRender(self._priceKey, currency); else self._renderPricing(pricelist); popup.hide();
}); this._popup.show(e.currentTarget); };
; ; 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, loading) { if (!loading) this.visibility(text != ""); var label = this.dom("label");
zf_stdReplaceClassName(label, loading ? null : "copyright-loading", loading ? "copyright-loading"
: null); zf_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); if (photo.loaded) { this.set(photo.copyright
== null ? photo.owner.copyright : photo.copyright); } else { var self = this; photo.advise(this,
function() { self.set(photo.copyright == null ? photo.owner.copyright : photo.copyright); self.notifyResize(true);
}, function() { self.showLoading(); self.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");
zfl_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; var url =
[ "http://", zf_defaultHost, "/zf/logout.aspx", "?uri=", encodeURIComponent(href), "&token=", zf_stdGetCookie("zf_token")
]; location.href = zf_stdGetTransferUrl(url.join("")); };
; ; function zfl_Caption(id) { zfl_Control.prototype.constructor.call(this, id); this._showGallery
= this.dom("gallery") != null; zf_stdMakeMethodsDeferred(this, this.id, [ "setTitle", "setCaption",
"setGallery", "setDisplay", "_updateClasses" ]); } 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, loading ? null : "title-loading", loading ?
"title-loading" : null); zf_stdSetText(label, text); }; zfl_Caption.prototype.setCaption = function(html,
loading) { var label = this.dom("caption"); if (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); } 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"; if (gallery == null || loading) return; label = label.getElementsByTagName("A")[0];
label.href = zf_stdGetTransferUrl(this.current.getHref("gallery")); zf_stdSetText(label, this.current.gallery.title);
}; zfl_Caption.prototype.showLoading = function() { this.setTitle("Loading...", true); this.setCaption(null,
true); this.setGallery(null, true); }; zfl_Caption.prototype.update = function(photo) { ; ; if (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; if (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); } ); } }; zfl_Caption.prototype.set
= function(photo) { ; var hasTitle = photo.title.length > 0; var hasCaption = (photo.flags & zf_PhotoFlags.HasCaption)
!= 0; if (!hasTitle && !hasCaption && !this._showGallery) { this.setDisplay(false); this.setTitle("");
this.setCaption(""); return; } this.setTitle(photo.title); if (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, true); var self = this; meta.bump(); meta.advise(this, function()
{ self.setCaption(meta.caption); self.notifyResize(true); }, function() { self.setCaption(null,
true); self.notifyResize(true); }); } } 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, hasCaption) { var prefixes = ["captionbox-wide",
"captionbox-regular"]; var suffix; if (hasTitle && hasCaption) suffix = { add: "-tc", remove: ["-t",
"-c", "-g"] }; else if (hasTitle) suffix = { add: "-t", remove: ["-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; i < 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; j < 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, id); 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"); var html = this._generateHTML(meta);
if (html.length == 0) { this.$dom("content").addClass("none"); this.$dom("notavailable").removeClass("none");
return; } this.$dom("text").html(html); this.$dom("content").removeClass("none"); this.$dom("notavailable").addClass("none");
}; zfl_ShortExif.prototype.showLoading = function() { this.$dom("loading").removeClass("none");
this.$dom("content").addClass("none"); this.$dom("notavailable").addClass("none"); }; zfl_ShortExif.prototype.update
= function(photo) { ; ; var meta = photo.getMeta(); if (this.current == meta) return; if (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); self.notifyResize(true);
}, function() { self.showLoading(); self.notifyResize(true); } ); } }; zfl_ShortExif.prototype._compose
= function(exif) { var sb = []; var val; var make = exif[0x010F]; var model = exif[0x0110]; if (make
!= null && model != null) { if (model.data.indexOf(make.data) != 0) sb.push(make.display, " ", model.display);
else sb.push(model.display); } else if (model != null) sb.push(model.display); else if (make != null)
sb.push(make.display); var fNumberAdded = false; val = exif[0x829D]; if (val != null) { if (sb.length
> 0) sb.push(", "); sb.push('<span class="nowrap">', val.display, '</span>'); fNumberAdded = true;
} 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(" @ ");
else if (sb.length > 0) sb.push(", "); sb.push('<span class="nowrap">' + val.display + '</span>');
} val = exif[0x829A]; if (val != null) { if (sb.length > 0) sb.push(", "); sb.push('<span class="nowrap">',
val.display, '</span>'); } val = exif[0x8827]; if (val != null) { if (sb.length > 0) sb.push(", ");
sb.push('<span class="nowrap">', 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">', val, '</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); if (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(); var 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"; domTip.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"; domTip.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);
};
; ; 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); return; } zf_stdServerRequestEx("GET", "/zf/core/core.asmx",
"GetCategoryInfo", [ ], function(result, error) { if (error != null) { oncomplete(new zf_CategoryInfo({}));
return; } 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 : ""; }; 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) { ; return ((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]; code = 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];
code = 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 = {}; var 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, id); zf_stdMakeMethodsDeferred(this,
this.id, [ "setCategory", "setKeywords"]); } zfl_Categories.inherits(zfl_Control); zfl_Categories.prototype.setCategory
= function(category, loading) { var ct1 = "", ct2 = "", ct3 = ""; var c1 = this.dom("category").getElementsByTagName("B")[0];
var c2 = this.dom("subcategory").getElementsByTagName("B")[0]; var c3 = this.dom("subcategoryDetail").getElementsByTagName("B")[0];
zf_stdReplaceClassName(c1, loading ? null : "pair-loading", loading ? "pair-loading" : null); if
(loading) { ct1 = "loading..."; } else if (category != 0) { ; ct1 = this.categoryList.getSubject(category);
ct2 = this.categoryList.getSubjectMatter(category); ct3 = this.categoryList.getSubjectDetail(category);
} zf_stdSetText(c1, ct1); zf_stdSetText(c2, ct2); zf_stdSetText(c3, ct3); }; zfl_Categories.prototype.setKeywords
= function(keywords, loading) { var label = this.dom("keywords").getElementsByTagName("B")[0];
if (loading) { zf_stdReplaceClassName(label, null, "pair-loading"); zf_stdSetText(label, "loading...");
return; } zf_stdReplaceClassName(label, "pair-loading", null); var text = []; for (var i = 0; i <
keywords.length; i++) { var keyword = keywords[i]; var quoted = keyword; if (quoted.indexOf(' ')
!= -1) quoted = '"' + quoted + '"'; quoted = encodeURI(quoted); text.push(['<a href="/?q=', quoted,
'">', zf_stdHtmlEncode(keyword), '</a>'].join("")); } 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; if (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); } 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;
; var hasCategories = (photo.flags & zf_PhotoFlags.HasCategories) != 0; var hasKeywords = (photo.flags
& zf_PhotoFlags.HasKeywords) != 0; if (!hasCategories) this.setCategory(0, false); if (!hasKeywords)
this.setKeywords([], false); if (!hasCategories && !hasKeywords) { this.notifyResize(true); return;
} var self; if (hasCategories && !this.categoryList) { self = this; zf_CategoryInfo.load( function(catInfo)
{ self.categoryList = catInfo; self.set(); self.notifyResize(true); }); self.notifyResize(true);
return; } var meta = photo.getMeta(); this.currentMeta = meta; if (meta.loaded) { if (hasCategories)
this.setCategory(meta.category, false); if (hasKeywords) this.setKeywords(meta.keywords, false);
} else { self = this; meta.bump(); meta.advise(this, function() { self.setCategory(meta.category);
self.setKeywords(meta.keywords); self.notifyResize(true); }, function() { if (hasCategories) self.setCategory(0,
true); if (hasKeywords) self.setKeywords([], true); self.notifyResize(true); }); } };
; ; ; ; var zfl_ExifViewStyle = { Overlay : 0, Inline : 1 }; function zfl_ExifView(id, style) {
this.style = style; zfl_Control.prototype.constructor.call(this, id); 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; this._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>', '<div class="listitem">',
'<span class="exif-loading">Loading...</span>', '</div>']; html = html.join(""); this.dom().innerHTML
= html; }; zfl_ExifView.prototype.update = function(photo) { ; ; 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); } else { var self = this; meta.bump(); meta.advise(this,
function() { self.set(meta); self.notifyResize(true); }, function() { self.showLoading(); self.notifyResize(true);
} ); } }; zfl_ExifView.prototype._generateHTML = function(meta) { var content = []; var items1,
items2; if ((meta.photo.access.mask & zf_AccessMask.ProtectExif) != 0) { items1 = [-5, -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]; } this._addExifSection(content,
"Photo Info", meta, items1); this._addExifSection(content, "Shooting Conditions", meta, items2);
return content.join(""); }; zfl_ExifView.prototype._addExifSection = function(builder, title, 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 ',
this.style == zfl_ExifViewStyle.Overlay ? 'listheader-color1' : 'listheader-color1', '">', title,
'</div>', '<div class="separator separator-border2"><hr/></div>', '<div class="listitem">'); if
(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">',
'<span>', tag.title, ':</span>', '<b class="pair-0 pair-color2 pair-font2">', tag.display, '</b>',
'</span>', '</div>'); } } else if (this.style == zfl_ExifViewStyle.Overlay) { for (i = 0; i < items.length;
i++) { tag = exif[items[i]]; if (!tag) continue; builder.push('<div class="exif-name pair-color1 pair-font1">',
tag.title, '</div>', '<div class="exif-value pair-color2 pair-font1">', tag.display, '</div><div class="clear"></div>');
} } builder.push('</div>'); };
; function zfl_ExifPopup(id, style) { zfl_Popup.prototype.constructor.call(this, id, true); this._displayed
= false; this._view = new zfl_ExifView(id + "-content", style); this._view.onresize = zf_stdMakeDeferred(
this.id + ".updateBackground", this.closure(this._updateBackground), this); } 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="',
id, '">', '<div class="exif-popup-content" id="', id, '-content"></div>', '<div class="exif-popup-background popup-bgcolor1" id="',
id, '-background"></div>', '</div>'); return 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(); } }; 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, domOrigin, constraint); this._updateBackground(); }; zfl_ExifPopup.prototype.hide
= function() { zfl_Popup.prototype.hide.call(this); this._displayed = false; }; zfl_ExifPopup.prototype._updateBackground
= function() { };
; ; function zfl_PhotoMenu(items, classes) { ; this.id = "__photo_menu_" + zfl_PhotoMenu.counter++;
this.dom = zfl_Control.prototype.dom; this.display = zfl_Control.prototype.display; this.visibility
= zfl_Control.prototype.visibility; this._delayedSubMenu = new zf_DelayedInvoke(500); this._delayedActive
= new zf_DelayedInvoke(300); if (classes && classes.length > 0) this._classes = classes; else this._classes
= "overlayMenu photoMenu"; this._map = {}; for (var i = 0; i < 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; } 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(); parent.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('<table>');
for (i = 0; i < items.length; i++) { if (items[i].separator) { content.push('<tr><td><div class="overlayMenu-separator"></div></td></tr>');
continue; } content.push('<tr><td><div class="item item-', items[i].id, '"'); 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, '</div>'); content.push('</div></td></tr>');
} content.push('</table>'); }; content.push('<div class="overlay-background">'); buildContent(false);
content.push('</div>'); buildContent(true); return content.join(""); }; 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(); dom.onmouseover = function() { self._delayedActive.invoke(function()
{ self.onactive(); }); }; dom.onmouseout = function() { self._delayedActive.clear(); }; dom = null;
} return; } if (item.separator) return; var 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,
false); 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;
if (!selected && item != this.selected) return; var self = this; var switchSubMenu = function()
{ var oldMenu = self._activeSubMenu; var newMenu = self._pendingSubMenu; self._activeSubMenu = newMenu;
self._pendingSubMenu = null; if (oldMenu) oldMenu.onsubmenu(false); if (newMenu) { var dom = self.dom(item.id);
var pos = zf_stdGetOffset(dom); pos.cx += dom.clientWidth; dom = null; newMenu.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", "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; this._delayedSubMenu.invoke(switchSubMenu);
} } else { this._pendingSubMenu = null; this._delayedSubMenu.clear(); } } else if (!selected) {
zf_stdReplaceClassName( this.dom(item.id), "item-hover", "item-standard"); if (item == this._pendingSubMenu)
{ this._pendingSubMenu = null; this._delayedSubMenu.invoke(switchSubMenu); } this.selected = null;
item.onselect(false); } 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(); this._delayedSubMenu.clear();
} item.onclick(); }; zfl_PhotoMenu.prototype.show = function(toshow, x, y, parent) { this.parent
= parent; if (!toshow) { if (this._activeSubMenu) this._activeSubMenu.onsubmenu(false); this._activeSubMenu
= this._pendingSubMenu = null; this._delayedSubMenu.clear(); if (this.selected) this.select(this.selected.id,
false); } else if (x && y) { var dom = this.dom(); dom.style.left = x + "px"; dom.style.top = y +
"px"; } this.display(toshow); }; zfl_PhotoMenu.prototype.destroy = function() { this.show(false);
var dom = this.dom(); if (dom != null) dom.parentNode.removeChild(dom); }; zfl_PhotoMenu.prototype.get
= function(id) { return this._map[id]; };
; ; ; 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", "/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, photoId) { var self = this; var formatSuccess = "Photo added to {0} collection.";
var formatError = "An error occured while adding photo to the \x27{0}\x27 collection."; var 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; index < 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", "/zf/app/manage.asmx", "AddSingleToCollection",
[ photoId, collectionId ], function(status, retVal) { if (status == 200 && index > 0) { self.list.splice(index,
1); self.list.unshift(collection); } var url = zf_stdGetTransferUrl( [ "http://", zf_userDomain, collection.getBaseHref(),
"/h", photoId.toString(16) ].join("")); var markup = [' <a href="', url, '" onclick="location.href=\x27',
url, '\x27', '">View &raquo;</a>'].join(""); var format; switch (status) { case 200: format = (retVal.result
? formatSuccess : formatDuplicated) + markup; break; case 404: format = formatNotFound; break;
default: format = formatError; break; } var message = zf_stdFormatString( format, ['<a href="',
url, '" onclick="location.href=\x27', url, '\x27">', zf_stdHtmlEncode(collection.title), '</a>'].join(""));
if (self.onmessage) self.onmessage(photoId, message, status != 200); }); }; zfl_CollectionList.prototype.addPhotoToNew
= function(title, photoId) { 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, "Collection", title)); self.addPhoto(result, photoId);
} else { var message = zf_stdFormatString("An error occured while adding photo to the \x27{0}\x27 collection.",
title); if (self.onmessage) self.onmessage(photoId, message, true); } }); };
; function zfl_CollectionMenu() { zfl_PhotoMenu.prototype.constructor.call(this, [], "overlayMenu photoMenu collectionMenu");
this.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(); self._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"; root.id = this.id; var content = []; if (!this.authenticated) { root.innerHTML = [ '<div class="collectionMenu-box">',
'<div class="collectionMenu-header">', '<div class="collectionMenu-icon"></div>', '<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. ',
'<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. ',
'</div>', '<div class="collectionMenu-footer">', '<div class="collectionMenu-button" id="', this.id,
'-login">', 'Continue »', '</div>', '<div class="collectionMenu-button" id="', this.id, '-hide">',
'Cancel', '</div>', '</div>', '<div class="overlay-background">', '<div class="collectionMenu-header">',
'<div class="collectionMenu-icon"></div>', '<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. ',
'<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. ',
'</div>', '<div class="collectionMenu-footer">', '<div class="collectionMenu-button">', 'Continue »',
'</div>', '<div class="collectionMenu-button">', 'Cancel', '</div>', '</div>', '</div>', '</div>'
].join(""); } else { if (!this.list) { root.innerHTML = ['<div class="collectionMenu-loading">',
'<div class="overlay-background"></div>', 'Loading...', '</div>'].join(""); if (this.list == null)
{ this.list = false; var collectionList = zfl_CollectionList.current; if (!collectionList.loaded)
{ collectionList.load(function() { self.list = true; self._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"); }; 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); }; } 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", id); }; }; var collections = zfl_CollectionList.current.list;
for (i = 0; i < collections.length; i++) { var content = []; var ps = collections[i]; for (var j =
ps.folders.length - 1; j > 0 ; j--) { content.push( '<span class="folder">', zf_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) }); } 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"); } }); this.items.push({ id: "sep2", separator:
true }); this.items.push( { id: "collectEdit", text: "Open my collections in Edit View", onclick:
function() { self.oncommand("collectEdit"); } }); 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);
};
; ; ; function zfl_DownloadMenu(photo) { ; zfl_PhotoMenu.prototype.constructor.call(this, [], "overlayMenu photoMenu downloadMenu");
this.current = photo; this.oncommand = zf_stdFalse; } zfl_DownloadMenu.inherits(zfl_PhotoMenu);
zfl_DownloadMenu.prototype.create = function(parent) { ; ; 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">', '<div class="overlay-background"></div>',
'Loading...', '</div>'].join(""); this.current.advise(this, function() { self.dom().innerHTML = self._build();
self._subscribe(); } ); } parent.appendChild(root); if (this.current.loaded) this._subscribe();
parent = null; root = null; }; zfl_DownloadMenu.prototype._build = function() { ; this.items = [];
this._map = {}; var i; var self = this; var list = [ { method: zf_ProcessingMethod.StandardXXLargeSize,
mask: zf_AccessMask.ProtectXXLarge }, { method: zf_ProcessingMethod.StandardExtraLargeSize, mask:
zf_AccessMask.ProtectExtraLarge }, { method: zf_ProcessingMethod.StandardLargeSize, mask: zf_AccessMask.ProtectLarge
}, { method: zf_ProcessingMethod.StandardMediumSize, mask: zf_AccessMask.ProtectMedium }, { method:
zf_ProcessingMethod.StandardSmallSize, mask: -1 } ]; var photo = this.current; var width = photo.width;
var height = photo.height; var createHandler = function(uri) { return function() { self.oncommand("download-"
+ uri); document.location.href = uri; }; }; for (i = 0; i < list.length; i++) { var method = list[i].method;
var mask = list[i].mask; if (mask > 0 && (photo.access.mask & mask) == mask) continue; if (!method.original
&& method.cx >= width && method.cy >= height) continue; var text; var uri; if (!method.original)
{ var size = photo.getScaledSize(method); text = zf_stdFormatString(method.format, size.cx, size.cy);
uri = photo.getGeneratedUrl(method, true) + "&dl=1"; } else { text = zf_stdFormatString("Original Photo ({0} x {1})",
width, height); uri = photo.getOriginalUrl(photo.fileType) + "?dl=1"; } this.items.push( { id: "download_"
+ i, text: text, onclick: createHandler(uri) }); } 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);
};
; function zfl_PhotoOverlay() { var self = this; this.id = "_overlay_" + zfl_PhotoOverlay.counter++;
this.attached = false; this.dom = zf_Control.prototype.dom; this.closure = zf_Control.prototype.closure;
this.eventHandler = zf_Control.prototype.eventHandler; this._parentExit = new zf_DelayedInvoke(400);
this._overlayExit = new zf_DelayedInvoke(400); this._parentEnter = new zf_DelayedInvoke(400); this._invokeParentExit
= function() { return this._parentExit.invoke( function() { self._overlayExit.clear(); self._trackIdle(false);
self._onleave(); }); }; this._invokeOverlayExit = function() { return this._overlayExit.invoke(
function() { self._trackIdle(true); }); }; this.menus = {}; this.animation = {}; this.idle = {};
} zfl_PhotoOverlay.counter = 0; zfl_PhotoOverlay.prototype.init = function(flags, oncommand, oncommandtest)
{ this.flags = flags; this.oncommand = oncommand; this.oncommandtest = oncommandtest; var self =
this; if (this.flags.exifIcon) { this.animation.exif = new zf_Animation( { "hidden": 0, "visible":
100 }, function(v) { zf_stdSetOpacity(self.dom("exif-icon"), v / 100); }); } if (this.flags.menuBar)
{ this.animation.menubar = new zf_Animation( { "hidden": -32, "visible": 0 }, function(v) { self._menuActive
= (v > -32); self._createMenus(); self.dom("menu-bar").style.left = v + "px"; }); } if (this.flags.message)
{ zfl_CollectionList.current.onmessage = function(photoId, message, error) { if (self.menus.collect)
{ self.menus.collect.destroy(); self.menus.collect = null; } if (self.attached && self.current.id
== photoId) self.showMessage(message, error); }; this.animation.message = new zf_Animation( { "hidden":
0, "status": 200, "error": 300 }, function(v) { var dom = self.dom("message"); v = Math.min(v, 80);
if (v < 10) dom.style.visibility = "hidden"; else { zf_stdSetOpacity(dom, v / 100); dom.style.visibility
= "visible"; } }); } }; zfl_PhotoOverlay.prototype.attach = function(parent) { var start = new Date().getTime();
; ; var self = this; var iroot = document.createElement("DIV"); iroot.className = "overlay-iroot";
iroot.id = this.id + "-iroot"; var icontent = []; if (this.flags.menuBar) { icontent.push( '<div class="overlay-menu-hotspot overlay-hotspot" id="',
this.id, '-menu-hotspot">', '<div class="overlay-menu-bar overlay-window" id="', this.id, '-menu-bar">',
'<div class="overlay-background"></div>', '</div>', '</div>'); } if (this.flags.exifIcon) { icontent.push(
'<div class="overlay-hotspot overlay-exif-icon" id="', this.id, '-exif-icon">', '</div>'); } if (this.flags.message)
{ icontent.push( '<div class="overlay-window overlay-background overlay-message" id="', this.id,
'-message">', '<span></span>', '</div>'); } iroot.innerHTML = icontent.join(""); parent.appendChild(iroot);
if (this.flags.menuBar) { var menuSpot = this.dom("menu-hotspot"); ; menuSpot.style.height = parent.clientHeight
+ "px"; this.animation.menubar.jump("hidden"); menuSpot.onmouseover = function(e) { self._menuspot_onmouseover(e);
}; } if (this.flags.exifIcon) { this.animation.exif.jump("hidden"); var icon = this.dom("exif-icon");
icon.onmouseover = function(e) { self._exificon_onmouseover(e); }; icon.onmouseout = function(e) {
self._exificon_onmouseout(e); }; } var oroot = document.createElement("DIV"); oroot.className = "overlay-oroot";
oroot.id = this.id + "-oroot"; var ocontent = []; if (this.flags.exifIcon) ocontent.push(zfl_ExifPopup.createHtml(this.id
+ "-exif")); oroot.innerHTML = ocontent.join(""); document.body.appendChild(oroot); parent.onmouseover
= this.eventHandler(this._parent_onmouseover); parent.onmouseout = this.eventHandler(this._parent_onmouseout);
parent.onmousemove = this.eventHandler(this._parent_onmousemove); parent.oncontextmenu = this.eventHandler(this._parent_oncontextmenu);
var omouseover = this.eventHandler(this._overlay_onmouseover); var omouseout = this.eventHandler(this._overlay_onmouseout);
iroot.onmouseover = omouseover; iroot.onmouseout = omouseout; oroot.onmouseover = omouseover; oroot.onmouseout
= omouseout; var block = function(e) { zf_stdStopPropagation(e); zf_stdPreventDefault(e); }; block
= this.eventHandler(block); oroot.oncontextmenu = block; iroot.oncontextmenu = block; iroot.onclick
= block; var defaultCommand = this.flags.defaultCommand; if (defaultCommand && this.oncommandtest(defaultCommand,
this.flags)) { parent.style.cursor = "pointer"; parent.onclick = this.eventHandler(this._parent_onclick);
} this.exifPopup = null; this.attached = true; parent = null; iroot = null; oroot = null; menuSpot
= null; exifIcon = null; }; zfl_PhotoOverlay.prototype.detach = function(parent) { if (!this.attached)
return; if (this.exifPopup) this.exifPopup.hide(); for (var key in this.animation) this.animation[key].jump("hidden");
this._trackIdle(false); this._destroyMenus(); this._menuActive = false; var iroot = this.dom("iroot");
iroot.parentNode.removeChild(iroot); var oroot = this.dom("oroot"); oroot.parentNode.removeChild(oroot);
parent.onmouseover = null; parent.onmouseout = null; parent.onmousemove = null; parent.oncontextmenu
= null; parent.onclick = null; parent.style.cursor = "auto"; this.attached = false; }; zfl_PhotoOverlay.prototype._parent_onmouseover
= function(e) { var self = this; this._parentEnter.invoke( function() { if (self._parentExit.pending)
self._parentExit.clear(); else self._trackIdle(true); }); }; zfl_PhotoOverlay.prototype._parent_onmouseout
= function(e) { if (this._parentEnter.pending) this._parentEnter.clear(); else this._invokeParentExit();
}; zfl_PhotoOverlay.prototype._parent_onmousemove = function(e) { if (!this.idle.timer) return;
e = zf_stdGetEvent(e); var x = e.clientX; var y = e.clientY; if (this.idle.x && Math.abs(this.idle.x
- x) > 5 || this.idle.y && Math.abs(this.idle.y - y) > 5) { if (this.idle.counter > 16) { this._idle_onstop();
this.idle.counter = 0; } if (this.idle.interrupt < 2) this.idle.interrupt = 0; } this.idle.x = x;
this.idle.y = y; }; zfl_PhotoOverlay.prototype._parent_oncontextmenu = function(e) { zf_stdStopPropagation(e);
zf_stdPreventDefault(e); if (!this.current || !this.current.loaded) return; this._createMenus(true);
if (!this.menus.contextMenu) return; var x, y; x = e.pageX; y = e.pageY; this.menus.contextMenu.show(true,
x - 5, y - 5); }; zfl_PhotoOverlay.prototype._parent_onclick = function(e) { zf_stdStopPropagation(e);
zf_stdPreventDefault(e); if (!this.current || !this.current.loaded) return; var defaultCommand = this.flags.defaultCommand;
if (!defaultCommand || !this.oncommandtest(defaultCommand, this.flags)) return; this.hide("now");
this.oncommand(defaultCommand); }; zfl_PhotoOverlay.prototype._overlay_onmouseover = function(e)
{ zf_stdStopPropagation(e); if (!this._overlayExit.pending) this._trackIdle(false); this._overlayExit.clear();
this._parentExit.clear(); }; zfl_PhotoOverlay.prototype._overlay_onmouseout = function(e) { zf_stdStopPropagation(e);
var self = this; this._invokeOverlayExit(); this._invokeParentExit(); }; zfl_PhotoOverlay.prototype._exificon_onmouseover
= function(e) { this.animation.exif.jump("visible"); if (!this.exifPopup) { var id = this.id + "-exif";
this.exifPopup = new zfl_ExifPopup(id, zfl_ExifViewStyle.Overlay); if (this.current) this.exifPopup.update(this.current);
} this.hide("slow", "not exif"); this.exifPopup.show(this.dom("exif-icon"), "shift-right"); };
zfl_PhotoOverlay.prototype._exificon_onmouseout = function(e) { if (this.exifPopup) this.exifPopup.hide();
}; zfl_PhotoOverlay.prototype._menuspot_onmouseover = function(e) { this.animation.menubar.jump("visible");
}; zfl_PhotoOverlay.prototype._trackIdle = function(enable) { if (!enable) { if (!this.idle.timer)
return; clearInterval(this.idle.timer); this.idle.timer = null; return; } if (this.idle.timer)
return; this.idle = { counter : 0, interrupt: 0 }; var self = this; this.idle.timer = setInterval(function()
{ ++self.idle.counter; if (self.idle.counter == 16) self._idle_onstart(); ++self.idle.interrupt;
if (self.idle.interrupt == 2) { self._idle_onstop(); self.idle.counter = 0; } }, 200); }; zfl_PhotoOverlay.prototype._onleave
= function() { this.hide("fast"); }; zfl_PhotoOverlay.prototype._idle_onstart = function() { this.hide("slow");
}; zfl_PhotoOverlay.prototype._idle_onstop = function(enable) { if (this.animation.exif) this.animation.exif.animate("visible",
{ s: 400, t: 1000 }); if (this.animation.menubar) this.animation.menubar.animate("visible", { s: 200,
t: 1000 }); }; zfl_PhotoOverlay.prototype.update = function(photo) { ; ; if (this.current == photo)
return; if (this.current != null) this.current.unadvise(this); this.current = photo; this._destroyMenus();
if (photo.loaded) { this._createMenus(); } else { var self = this; photo.advise(this, function() {
self._createMenus(); }); } if (this.exifPopup) this.exifPopup.update(photo); }; zfl_PhotoOverlay.prototype._createMenus
= function(always) { var photo = this.current; if (!photo || !photo.loaded) return; if (!this.attached)
return; if (!always && !this._menuActive) return; if (this._menuCreated) return; this._menuCreated
= true; var i, item; var self = this; var items = [ { id: "addToCart", text: "Buy", command: true,
context: true, main: true }, { id: "addToFavorites", text: "Add To Favorites", main: true, context:
true, command: true }, { id: "share", text: "Share", command: true, context: true, main: true,
contextText: "Share This Photo" }, { id: "downloadPhoto2", text: "Download This Photo", main: false,
context: true, command: true }, { id: "dimLights", text: "Dim The Lights", command: true, context:
true, main: true, contextText: "Dim The Lights (single-click)" }, { id: "download", text: "Save Image",
main: true, context: true, submenu: "download" }, { id: "downloadOriginal", text: "Download Original",
main: true, context: false, submenu: "downloadOriginal" }, { id: "downloadPhoto", text: "This Photo",
parent: "downloadOriginal", command: true }, { id: "downloadGallery", text: "All Available", parent:
"downloadOriginal", command: true }, { id: "downloadCollection", text: "All Available", parent:
"downloadOriginal", command: true }, { id: "collect", text: "Add to Collection", main: true, submenu:
"collect" }, { id: "admin", text: "Administrator", main: true, submenu: "admin" }, { id: "censorPhoto",
text: "Censor", parent: "admin", command: true }, { id: "uncensorPhoto", text: "Uncensor", parent:
"admin", command: true }, { id: "censorGallery", text: "Censor Gallery", parent: "admin", command:
true }, { id: "purgePhoto", text: "Purge", parent: "admin", command: true }, { id: "purgeGallery",
text: "Purge Gallery", parent: "admin", command: true }, { id: "undimLights", text: "Close", command:
true, context: true, main: true, contextText: "Close (single-click)" } ]; var map = {}; var bakeOnClickHandler
= function(name) { map[name].onclick = function() { self.hide("now"); self.oncommand(name); };
}; for (i = 0; i < items.length; i++) { item = items[i]; if (!this.oncommandtest(item.id, this.flags))
continue; map[item.id] = item; if (item.command) { bakeOnClickHandler(item.id); } else if (item.submenu)
{ item.text += ' &raquo;'; } } var selector = function(filter) { var selected = []; for (i = 0;
i < items.length; i++) { item = items[i]; if (!map[item.id]) continue; var fmet = true; for (var
fkey in filter) { fmet = (filter[fkey] == item[fkey]); if (!fmet) break; } if (fmet) selected.push(item);
} return selected; }; var bakeOnSubmenuHander = function(name, factory) { if (map[name]) map[name].onsubmenu
= function(show, x, y, parent) { var menu = self.menus[map[name].submenu]; if (!menu && show) {
menu = factory(); menu.onactive = function() { this.parent.select(name, true); }; menu.create(self.dom("oroot"));
self.menus[map[name].submenu] = menu; } if (menu) menu.show(show, x, y, parent); }; }; bakeOnSubmenuHander("admin",
function() { return new zfl_PhotoMenu(selector( {parent: "admin"} )); }); bakeOnSubmenuHander("collect",
function() { var cm = new zfl_CollectionMenu(); cm.oncommand = function() { self.hide("now"); self.oncommand.apply(self,
arguments); }; return cm; }); bakeOnSubmenuHander("download", function() { var cm = new zfl_DownloadMenu(self.current);
cm.oncommand = function() { self.hide("now"); self.oncommand.apply(self, arguments); }; return cm;
}); bakeOnSubmenuHander("downloadOriginal", function() { return new zfl_PhotoMenu(selector( {parent:
"downloadOriginal"} )); }); if (this.flags.menuBar) { var mainMenu = new zfl_PhotoMenu(selector({
main: true }), "overlayMenu photoMenu photoMenu-main"); mainMenu.create(this.dom("oroot")); this.menus.mainMenu
= mainMenu; var createIcon = function(item) { return { id : item.id, onclick : function() { mainMenu.click(item.id);
}, onselect : function(selected) { if (selected) { var pos = zf_stdGetOffset(self.dom("iroot"));
mainMenu.show(true, pos.cx + 32, pos.cy); self.hide("slow", "not menubar"); } mainMenu.select(item.id,
selected); } }; }; var iconItems = []; for (i = 0; i < mainMenu.items.length; i++) iconItems.push(createIcon(mainMenu.items[i]));
var iconMenu = new zfl_PhotoMenu(iconItems, "overlayMenu iconMenu"); iconMenu.create(this.dom("menu-bar"));
iconMenu.show(true); this.menus.iconMenu = iconMenu; var adjustItem = function(item) { var old = item.onselect;
item.onselect = function(selected) { if (old) old(selected); iconMenu.select(item.id, selected);
}; }; for (i = 0; i < mainMenu.items.length; i++) adjustItem(mainMenu.items[i]); } if (this.flags.contextMenu)
{ var ci = []; var si = selector({ context: true }); for (i = 0; i < si.length; i++) { ci.push({
id: si[i].id, text: si[i].contextText ? si[i].contextText : si[i].text, onclick: si[i].onclick,
onsubmenu: si[i].onsubmenu }); } if (ci.length > 0) { var contextMenu = new zfl_PhotoMenu(ci, "overlayMenu photoMenu photoMenu-context");
contextMenu.onactive = function() { self.hide("fast", "not context"); }; contextMenu.create(this.dom("oroot"));
this.menus.contextMenu = contextMenu; } } }; zfl_PhotoOverlay.prototype._destroyMenus = function()
{ for (var key in this.menus) { var obj = this.menus[key]; if (obj && obj.destroy instanceof Function)
obj.destroy(); } this.menus = {}; this._menuCreated = false; }; zfl_PhotoOverlay.prototype.hide
= function(mode, except) { if (except != "not menubar") { if (this.menus.iconMenu && this.menus.iconMenu.selected)
this.menus.iconMenu.select(this.menus.iconMenu.selected.id, false); if (this.menus.mainMenu) this.menus.mainMenu.show(false);
} if (except != "not context") { if (this.menus.contextMenu) this.menus.contextMenu.show(false);
} if (mode == "now") { if (this.animation.message && except != "not message") this.animation.message.jump("hidden");
if (this.animation.exif && except != "not exif") this.animation.exif.jump("hidden"); if (this.animation.menubar
&& except != "not menubar") this.animation.menubar.jump("hidden"); } else { if (this.animation.exif
&& except != "not exif") { speed = mode == "fast" ? { s: 300, t: 1000 } : { s: 160, t: 1000 };
this.animation.exif.animate("hidden", speed); } if (this.animation.menubar && except != "not menubar")
{ speed = mode == "fast" ? { s: 150, t: 1000 } : { s: 80, t: 1000 }; this.animation.menubar.animate("hidden",
speed); } } }; zfl_PhotoOverlay.prototype.showMessage = function(message, error) { if (!this.flags.message)
return; var span; var dom = this.dom("message"); dom.innerHTML = ""; span = document.createElement("SPAN");
span.innerHTML = message; dom.appendChild(span); zf_stdReplaceClassName(dom, error ? null : "overlay-message-error",
error ? "overlay-message-error" : null); var self = this; dom.onmouseover = function(e) { self.animation.message.jump("status");
self.hide("fast", "not message"); }; dom.onmouseout = function(e) { self.animation.message.animate("hidden",
{ s: 80, t: 2000 }); }; dom = null; span = null; this.animation.message.jump(error ? "error" : "status");
this.animation.message.animate("hidden", { s: 40, t: 2000 }); };
; ; ; function zfl_Photographer(id) { zfl_Control.prototype.constructor.call(this, id); 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,
loading) { ; var label = this.dom("label"); if (loading) { zf_stdReplaceClassName(label, null, "photographer-loading");
zf_stdSetText(label, "Loading..."); } else { if (user.id == this._owner.id) { this.display(false);
} else { this.display(true); zf_stdReplaceClassName(label, "photographer-loading"); label.innerHTML
= zf_stdFormatString("Photo by: {0}", ['<a href="', zf_stdGetTransferUrl("http://" + user.domainName
+ "/"), '">', 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; if (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); self.notifyResize(true); }, function()
{ self.showLoading(); self.notifyResize(true); } ); } };
; ; ; ; ; function zfl_PhotoFlipper(id, style, lynx) { zfl_Control.prototype.constructor.call(this,
id); 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", this._prefetch);
if (this._static) this.$dom().html("").removeClass("pf-static"); this.relaxedHeight = false; }
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) { this._decoration = decoration; this._plugins
= plugins; var extent = 0; if (decoration) extent = decoration.shadowSize + decoration.borderSize
+ decoration.extraSize; this._extent = extent; if (overlayFlags) { ; this._overlay = new zfl_PhotoOverlay();
this._overlay.init(overlayFlags, oncommand, oncommandtest); } this._transition = transition; this.transitionEnabled
= true; var self = this; this._animTransition = new zf_Animation( { "start": 0, "end": 100 }, function(v)
{ zf_stdSetOpacity(self._views[zfl_PhotoFlipper.Front].getInner(), v / 100); zf_stdSetOpacity(self._views[zfl_PhotoFlipper.Back].getInner(),
(100 - v) / 100); }); this._animSpeed = { s: 100, t: 1000 }; this._fullHeight = fullHeight; };
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(); this._attachOverlay(false);
if (this.current) this.current.unadvise(this); this.current = null; this.dom().innerHTML = "";
this._views = []; }; zfl_PhotoFlipper.prototype.update = function(photo, context) { ; ; if (this.current
== photo) return; if (this.current) this.current.unadvise(this); ; var forward = context.previousIndex
<= context.currentIndex; if (photo.loaded) { if (this._availWidth != null) { ; this.set(photo);
} if (context.photoList) this._prefetch(context.photoList, context.currentIndex, forward); } else
{ var self = this; photo.advise(this, function() { ; self._set(photo); self._prefetch(context.photoList,
context.currentIndex, forward); }); } this.current = photo; ; this._forward = (context.previousIndex
< context.currentIndex); if (this._overlay) this._overlay.update(photo, context); }; zfl_PhotoFlipper.prototype._set
= function(photo) { ; ; if (this._availWidth == null) { ; return; } ; this._load(zfl_PhotoFlipper.Back,
photo); 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._availWidth, cy: 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, cy: 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) { ; this._recalc(true);
return true; } this._availWidth = width; this._availHeight = height; ; if (first && this.current &&
this.current.loaded) { ; ; this._set(this.current); if (this._postponedPrefetch) { this._postponedPrefetch();
this._postponedPrefetch = null; } return true; } var view; var canresize = false; view = this._views[zfl_PhotoFlipper.Front];
if (view && view.getPhoto()) { this._load(zfl_PhotoFlipper.Front, view.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); } return canresize; }; zfl_PhotoFlipper.prototype.flip
= function() { ; this._stopTransition(); var back = this._views[zfl_PhotoFlipper.Back]; var front
= this._views[zfl_PhotoFlipper.Front]; if (!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];
front = this._views[zfl_PhotoFlipper.Front]; zf_stdReplaceClassName(front.dom().parentNode, "none",
null); var now = new Date(); var since = this._lastFlip ? (now.getTime() - this._lastFlip.getTime())
: 0; this._lastFlip = now; var transition = this._transition && this.transitionEnabled; if (!back
|| !transition ) { this._flipDone(true, "skipping animaiton", false); return; } if (!transition)
return; this._recalc(true); ; this._animTransition.jump("start"); zf_stdReplaceClassName(front.dom().parentNode,
"none", null); zf_stdReplaceClassName(front.dom().parentNode, "invisible", null); this._animTransition.animate(
"end", this._animSpeed, this.closure(this._flipDone, false, "animation end", false)); }; zfl_PhotoFlipper._getPoolKey
= function(photo, method) { return [ '-', photo.id, '-', method.code ].join(""); }; zfl_PhotoFlipper.prototype._load
= function(code, photo, resize, reload) { ; ; var extent2 = this._extent * 2; this._stopTransition();
var width = this._availWidth - extent2; var height = this._availHeight - extent2; if (this.relaxedHeight
&& photo.height > photo.width) height += 40; var method = photo.pickMethod(width, height); if (!method)
method = zf_ProcessingMethod.StandardSmallSize; ; var 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; var inner; var view = this._views[code]; if (!reload && view && view.getPhoto()
&& view.getPhoto().id == photo.id && view.getMethod() == method) { ; inner = view.getInner(); inner.style.left
= x + "px"; inner.style.top = y + "px"; inner = null; if (resize) return; if (!view.__zfl_state
|| view.__zfl_state == zf_PhotoLoader.Loading) return; if (code == zfl_PhotoFlipper.Back && this.onload)
{ ; this.onload(view.__zfl_state, true); } return; } this._queue = null; var context = { method: method,
data: photo, image: photo }; var styles = "pf-plane " + zfl_Layout.formatDecorationClasses("pf",
this._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++;
plane.className = styles; var viewId = this.id + "-view" + zfl_PhotoFlipper._counter++; plane.innerHTML
= zf_PhotoView.createHtml( viewId, null, null, this._plugins, context, photo, method ); 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);
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; view.__zfl_width
= size.cx + extent2; inner = view.getInner(); inner.style.left = x + "px"; inner.style.top = y +
"px"; 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,
method); var immediate = (loader.state != zf_PhotoLoader.Loading && loader.state != zf_PhotoLoader.Initialized);
view.onload = this.closure(this._view_onload, view, 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); if (code == zfl_PhotoFlipper.Back && this._views[zfl_PhotoFlipper.Front]
== null && loader.state == zf_PhotoLoader.Loading) { ; this._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; var password
= state == zf_PhotoLoader.PasswordRequired; this._showPassword(view, password, false); if (!back
&& state == zf_PhotoLoader.Complete) { if (view.getPhoto().id == this.current.id) this._attachOverlay(true);
if (this.ondisplay) { ; this.ondisplay(view.getPhoto(), false); } } 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(),
null, "pf-loaded"); } return state != zf_PhotoLoader.Complete; }; 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];
if (!view || !this._overlay) return; var inner = view.getInner(); var o = null; for (o = inner.firstChild;
o != null; o = o.nextSibling) { if (o.className == "pv-overlay") break; } if (!o) return; if (attach)
{ ; this._overlay.attach(o); } else { ; this._overlay.detach(o); } }; zfl_PhotoFlipper.prototype._showPassword
= function(view, show, retry) { ; ; ; var id = view.id + "-password"; ; var dom = view.dom("password");
if (!show) { if (dom) dom.parentNode.removeChild(dom); dom = null; zf_stdReplaceClassName(view.dom(),
"pv-s-password", null); this.passwordEditing = false; return; } dom = document.createElement("DIV");
dom.id = id; dom.className = "pv-password"; view.setSpecial(null); zf_stdReplaceClassName(view.dom(),
null, "pv-s-password"); var content = []; content.push( '<div class="password-box popup-border1 popup-color1 popup-bgcolor1">',
'<div class="text">Content protected with password.</div>', '<div class="text">If you do not have the password please contact the owner.</div>',
'<div class="separator separator-border1"></div>', '<div class="item none" id="', id, '-hint">',
'<div class="prompt">Hint:</div>', '<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>',
'<input id="', id, '-input" name="password" type="password"></input>', '<a id="', id, '-go">Go</a>',
'</div>', '</div>'); if (retry) { content.push( '<div class="incorrect" id="', id, '-incorrect">',
'Incorrect password', '</div>'); } content.push( '</div>'); dom.innerHTML = content.join(""); var
inner = view.getInner(); inner.appendChild(dom); inner = null; dom = null; var self = this; var
photo = view.getPhoto(); var realmId = photo.access.realmId; ; zfl_PasswordManager.retrieveHint(realmId,
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");
var divPHText = view.dom("password-hint-text"); if (divPHint != null && divPHText != null) { zf_stdReplaceClassName(divPHint,
"none", null); zf_stdSetText(divPHText, hint); ; } else { ; } } 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, loader); zfl_PasswordManager.subscribe(realmId, loader.__zfl_onunlock);
; } var handler = function() { var password = view.dom("password-input").value; ; self._showPassword(view,
false); zfl_PasswordManager.validate(realmId, password, self.closure(self._password_onpassword, photo));
}; if (!retry) this.passwordEditing = false; view.dom("password-go").onclick = handler; view.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; }; 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]; var 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; zf_stdReplaceClassName(domBack,
null, "none"); zf_stdReplaceClassName(domBack, null, "invisible"); back.clear(); back.__zfl_height
= null; back.__zfl_state = null; ; } this._recalc(immediate); if (front.__zfl_state != zf_PhotoLoader.Loading)
{ zf_stdReplaceClassName(this.dom(), null, "pf-loaded"); } if (front.__zfl_state == zf_PhotoLoader.Complete)
{ 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)
{ ; if (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];
var 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, height); 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;
} this.dom().style.height = height + "px"; ; if (!immediate) this.notifyResize(false); }; zfl_PhotoFlipper.prototype._stopTransition
= function() { if (this._animTransition.inprogress) { this._animTransition.jump("end"); this._flipDone(true,
"transition interrupted", true); } }; zfl_PhotoFlipper.prototype._prefetch = function(photoList,
index, forward) { if (this._availWidth == null) { ; var self = this; this._postponedPrefetch = function()
{ self._prefetch(photoList, index, forward); }; return; } this._postponedPrefetch = null; var prefetch
= 8; var increment = forward ? 1 : -1; this._queue = []; var extent2 = this._extent * 2; var width
= this._availWidth - extent2; var height = this._availHeight - extent2; var loader; for (var i = 0;
i < prefetch; i++) { if (index < 0 || index >= photoList.length) break; var photo = photoList.get(index);
index += increment; if (!photo.loaded) continue; var method = photo.pickMethod(width, height);
if (!method) method = zf_ProcessingMethod.StandardSmallSize; var 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); } 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, loader); }; 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; if (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, loader.start, loader); var self = this; setTimeout(function()
{ self._prefetch_onload(zf_PhotoLoader.Loading, null, loader); }, 1000); }; zfl_PhotoFlipper.prototype._password_onunlock
= function(loader) { ; var front = this._views[zfl_PhotoFlipper.Front]; var back = this._views[zfl_PhotoFlipper.Back];
if (front && (loader.photo == front.getPhoto())) this._showPassword(view, false); var 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,
front.getPhoto(), false, true); if (back && back.getPhoto() == back.getPhoto() && back.getMethod()
== loader.getMethod()) this._load(zfl_PhotoFlipper.Back, back.getPhoto(), false, true); }; zfl_PhotoFlipper.prototype._password_onpassword
= function(unlocked, photo) { ; if (unlocked) return; var view = this._views[zfl_PhotoFlipper.Front];
if (view && view.getPhoto() == photo) this._showPassword(view, true, true); };
; ; ; function zfl_DimLights(id, flipper) { zfl_Control.prototype.constructor.call(this, id); this._flipper
= flipper; this.visible = false; var 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),
v / 100); }); }; this._leftAnim = createAnimation("left"); this._rightAnim = createAnimation("right");
this._closeAnim = createAnimation("closebox"); this._speed1 = { s: 100, t: 500 }; this._speed2 =
{ s: 100, t: 250 }; this._speed3 = { s: 100, t: 400 }; this.dom().onmousemove = this.eventHandler(this._dimlights_onmousemove);
this.dom().oncontextmenu = zf_stdFalse; this._flipper.ondisplay = function() { if (self.ondisplay)
self.ondisplay.apply(this, arguments); }; } zfl_DimLights.inherits(zfl_Control); zfl_DimLights.prototype.init
= function(decoration, plugins, overlayFlags, oncommand, oncommandtest, analytics) { this._oncommandtest
= oncommandtest; this._oncommand = oncommand; this._analytics = analytics; var self = this; oncommand
= function(id) { self._oncommand("undimLights"); self._oncommand(id); }; this.dom("close").onclick
= function() { self._oncommand("undimLights"); }; this.dom("left").onmousedown = this.eventHandler(this._back);
this.dom("right").onmousedown = this.eventHandler(this._next); this._flipper.init( decoration,
plugins, overlayFlags, oncommand, oncommandtest, true, null ); }; zfl_DimLights.prototype.show =
function() { if (this.visible) return; this.visible = true; if (zfl_Popup.current) zfl_Popup.current.hide();
zfl_Curtain.show("darkest"); if (this._analytics) this._analytics.registerLightsDimmed(this._flipper);
this._show(); }; zfl_DimLights.prototype._show = function() { var dom = this.dom(); if (dom.parentNode
!= document.body) document.body.appendChild(dom.parentNode.removeChild(dom)); dom = null; this._resizeHandler
= this.eventHandler(this._window_onresize); zf_stdAttachEvent(window, "resize", this._resizeHandler);
var cx = zf_stdGetClientWidth() - (16 + 120); var cy = zf_stdGetClientHeight(); this._flipper.onload
= this.closure(this._flipper_onload); this.dom("center").style.top = Math.floor(cy / 2) + "px";
if (this.current) { this._flipper.resize(cx, cy); this._flipper.update(this.current, this.currentContext);
this._updateNavigation(); } this.display(true); var speed4 = { s: 100, t: 3000 }; this._leftAnim.jump("visible");
this._leftAnim.animate("hidden", speed4); this._rightAnim.jump("visible"); this._rightAnim.animate("hidden",
speed4); this._closeAnim.jump("visible"); this._closeAnim.animate("hidden", speed4); }; zfl_DimLights.prototype.hide
= function() { if (!this.visible) return; this.visible = false; if (this._resizeHandler) { zf_stdDetachEvent(window,
"resize", this._resizeHandler); this._resizeHandler = null; } this._flipper.clear(); this.display(false);
zfl_Curtain.hide(); }; zfl_DimLights.prototype.update = function(photo, context) { ; ; if (this.current
== photo) return; this.current = photo; this.currentContext = context; if (this.visible) { this._flipper.update(photo,
context); this._updateNavigation(); } }; zfl_DimLights.prototype._window_onresize = function()
{ ; zf_stdDeferCall( this.id + ".onresize", function() { var cx = zf_stdGetClientWidth() - (4 + 100);
var cy = zf_stdGetClientHeight(); this.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();
}; zfl_DimLights.prototype._updateNavigation = function() { this.dom("left").style.display = this._oncommandtest("back")
? "block" : "none"; this.dom("right").style.display = this._oncommandtest("next") ? "block" : "none";
}; zfl_DimLights.prototype._dimlights_onmousemove = function(e) { var cxClient = zf_stdGetClientWidth();
var cyClient = zf_stdGetClientHeight(); var 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; var 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", this._speed1);
if (!this._hotRight && hotRight) this._rightAnim.animate("visible", this._speed2); else if (this._hotRight
&& !hotRight) this._rightAnim.animate("hidden", this._speed1); if (!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", this._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", this._speed1); else if (this._warmClose
&& !warmClose) this._closeAnim.animate("hidden", this._speed1); else if (this._hotClose && !hotClose)
this._closeAnim.animate("semi", this._speed1); this._hot = hot; this._hotLeft = hotLeft; this._hotRight
= hotRight; this._hotClose = hotClose; this._warmClose = warmClose; }; zfl_DimLights.prototype._next
= function(e) { this._oncommand("next"); this._rightAnim.jump("pressed"); this._rightAnim.animate("visible",
this._speed3); }; zfl_DimLights.prototype._back = function(e) { this._leftAnim.jump("pressed");
this._leftAnim.animate("visible", this._speed3); this._oncommand("back"); };
; ; ; function zfl_AddressBar(updateable) { this._updateable = updateable; if (!updateable) { this.update
= zf_stdFalse; return; } this.set = zf_stdMakeDeferred("AddressBar", this.set); this.closure = zf_Control.prototype.closure;
this._replaceInvoke = new zf_DelayedInvoke(600); this._hash = location.hash; var 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, false); if (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) { ; ; 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, context);
} else { var self = this; photo.advise(this, function() { self.set(photo, context); }); } }; zfl_AddressBar.prototype.set
= function(photo, context) { ; ; var hash = '#h' + photo.id.toString(16); if (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,
hash) { ; 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;
if (hash.indexOf("#h") == 0) { id = parseInt(hash.substr(2), 16); } else if (legacy) { id = parseInt(hash.substr(1),
10); } if (!id || isNaN(id)) return defaultValue; return id; };
; 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; } } zf_Rect.prototype.toString = function(precision) { return "{" + [ this.left.toPrecision(precision),
this.top.toPrecision(precision), this.width.toPrecision(precision), this.height.toPrecision(precision)
].join(",") + "}"; }; 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*}/;
var 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])); };
; ; function zfl_CommentAreaPlugin() { this._active = false; this._readOnly = false; this._onclose
= null; this._areaRect = null; } zfl_CommentAreaPlugin.prototype.activate = function(attachment,
readOnly, onclose) { ; this._areaRect = (attachment != null) ? zf_Rect.parse(attachment) : null;
var dom = this._dom(); this._cxArena = dom.parentNode.offsetWidth; this._cyArena = dom.parentNode.offsetHeight;
zf_stdReplaceClassName(dom, readOnly ? "cap-active" : "cap-active-ro", readOnly ? "cap-active-ro"
: "cap-active"); this._active = true; this._readOnly = readOnly; this._onclose = onclose; if (this._areaRect
!= null) { this._workRect = this._toWorkRect(this._areaRect); this._moveRect(this._workRect); }
else this._dom("oframe").style.visibility = "hidden"; var self = this; if (!readOnly) { dom.onmousedown
= function(e) { self._area_onmousedown(this, e); return false; }; dom.onmouseup = function(e) { self._area_onmouseup(this,
e); }; dom.onmousemove = function(e) { self._area_onmousemove(this, e); }; dom.onselectstart = zf_stdFalse;
} else { this._dom("close").onclick = function() { if (onclose != null) onclose(); self.deactivate();
}; } dom = null; }; zfl_CommentAreaPlugin.prototype.deactivate = function() { ; zf_stdReplaceClassName(this._dom(),
"cap-active", null); zf_stdReplaceClassName(this._dom(), "cap-active-ro", null); this._active = false;
this._readOnly = false; this._onclose = null; }; 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="', id,
'-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>', '</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(), this._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, rect.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, rect.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;
var workRight = this._cxArena - workLeft - workWidth; var workBottom = this._cyArena - workTop - workHeight;
var style; style = this._dom("oframe").style; style.visibility = "inherit"; style.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"; style.height = workHeight
+ "px"; }; zfl_CommentAreaPlugin.prototype._area_onmousedown = function(dom, e) { if (this._readOnly)
return; e = zf_stdGetEvent(e); if (document.addEventListener) { document.addEventListener("mousemove",
dom.onmousemove, true); document.addEventListener("mouseup", dom.onmouseup, true); document.addEventListener("selectstart",
dom.onselectstart, true); } else if (dom.setCapture) dom.setCapture(); this._dom("oframe").style.visibility
= "hidden"; var pos = this._getEventPos(e); this._anchorX = pos.x; this._anchorY = pos.y; this._tracking
= true; zf_stdStopPropagation(e); }; zfl_CommentAreaPlugin.prototype._area_onmouseup = function(dom,
e) { if (!this._tracking) return; e = zf_stdGetEvent(e); if (document.removeEventListener) { document.removeEventListener("mousemove",
dom.onmousemove, true); document.removeEventListener("mouseup", dom.onmouseup, true); document.removeEventListener("selectstart",
dom.onselectstart, true); } else if (dom.releaseCapture) dom.releaseCapture(); this._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); this._tracking = false;
zf_stdStopPropagation(e); }; zfl_CommentAreaPlugin.prototype._area_onmousemove = function(dom, e)
{ if (this._tracking) this._moveRect(this._getTrackingRect(zf_stdGetEvent(e))); zf_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, 0), 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), Math.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; while (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; this._onclose
= null; this._cropRect = null; } zfl_CommentCropPlugin.prototype.activate = function(attachment,
readOnly, onclose) { ; this._cropRect = attachment != null ? zf_Rect.parse(attachment) : null;
if (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; this._workRect
= this._toWorkRect(this._cropRect); this._moveRect(this._workRect); zf_stdReplaceClassName(dom,
readOnly ? "ccp-active" : "ccp-active-ro", readOnly ? "ccp-active-ro" : "ccp-active"); this._active
= true; this._readOnly = readOnly; this._onclose = onclose; var self = this; if (!readOnly) { var
onmousedown = function(e) { self._handle_onmousedown(this, e); return false; }; var onmouseup =
function(e) { self._handle_onmouseup(this, e); }; var onmousemove = function(e) { self._handle_onmousemove(this,
e); }; var ids = [ "ne", "nw", "se", "sw", "frame" ]; for (var i = 0; i < ids.length; i++) { handle
= this._dom(ids[i]); handle.onmousedown = onmousedown; handle.onmouseup = onmouseup; handle.onmousemove
= onmousemove; handle.onselectstart = zf_stdFalse; } 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(), "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);
}; 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="', id, '-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>',
'<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="', id, '-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="',
id, '-ccp-se"></div>', '<div class="ccp-close" id="', id, '-ccp-close"></div>', '</div>', '</div>'
].join(""); }; zfl_CommentCropPlugin.prototype.onCreateDom = function(view, outer, inner, context,
isNew) { ; 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); }; 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), Math.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, rect.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;
var workRight = this._cxArena - workLeft - workWidth; var workBottom = this._cyArena - workTop - workHeight;
var style; style = this._dom("frame").style; style.left = (workLeft - 2) + "px"; style.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"; style = 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"; style.height = workHeight + "px"; style.width
= workRight + "px"; }; zfl_CommentCropPlugin.prototype._handle_onmousedown = function(handle, e)
{ if (this._readOnly) return; e = zf_stdGetEvent(e); if (document.addEventListener) { document.addEventListener("mousemove",
handle.onmousemove, true); document.addEventListener("mouseup", handle.onmouseup, true); document.addEventListener("selectstart",
handle.onselectstart, true); } else if (handle.setCapture) handle.setCapture(); this._anchorX = e.clientX;
this._anchorY = e.clientY; this._track = handle.className.split(' ')[1]; if (this._track == null)
this._track = "frame"; zf_stdStopPropagation(e); }; zfl_CommentCropPlugin.prototype._handle_onmouseup
= function(handle, e) { if (this._track == null) return; e = zf_stdGetEvent(e); if (document.removeEventListener)
{ document.removeEventListener("mousemove", handle.onmousemove, true); document.removeEventListener("mouseup",
handle.onmouseup, true); document.removeEventListener("selectstart", handle.onselectstart, true);
} else if (handle.releaseCapture) handle.releaseCapture(); this._workRect = this._getTrackingRect(e);
this._cropRect = this._fromWorkRect(this._workRect); this._track = null; zf_stdStopPropagation(e);
}; zfl_CommentCropPlugin.prototype._handle_onmousemove = function(handle, e) { if (this._track !=
null) this._moveRect(this._getTrackingRect(zf_stdGetEvent(e))); zf_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; ; ; ; ; var dx = e.clientX - this._anchorX;
var dy = e.clientY - this._anchorY; var snapDelta = (e.ctrlKey || e.metaKey) ? 0 : 6; switch (this._track)
{ case "ccp-handle-nw": left = Math.min(Math.max(0, left + 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, right + 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, left + 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; case "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; if (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; right = 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; if (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, bottom - top); };
; function zfl_CommentFinder(photoList, origin, forward, ondone) { ; ; ; this._cancelled = false;
this._photoList = photoList; this._step = forward ? 1 : -1; this._ondone = ondone; this.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); return; } 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); return; } var meta = photo.getMeta();
if (!meta.loaded) { meta.advise(this, this.closure(this._checkPhoto, index)); return; } if (meta.comments
== 0) { this._checkNext(index); return; } 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); }; zfl_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); }; 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; this._aggregatedMask = 0; this._controls = controls;
var edit = controls.edit; this._edit = edit; this._flipper = controls.flipper; this._flipper.onload
= this.closure(this._flipper_onload); this._flipper.ondisplay = this.closure(this._flipper_ondisplay);
var self = this; edit.onsave = this.closure(this._edit_onsave); edit.oncancel = this.closure(this._edit_oncancel);
edit.onlogin = function() { if (self.onlogin) self.onlogin(); }; edit.onattachment = this.closure(this._displayAttachment,
false); edit.onerror = this.closure(this._edit_onerror); var 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); list.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, "deleteMessage"); list.onundelete = this.closure(this._list_onaction,
"undeleteMessage"); list.oncensor = this.closure(this._list_onaction, "censorMessage"); list.onuncensor
= this.closure(this._list_onaction, "uncensorMessage"); list.onpurge = this.closure(this._list_onaction,
"purgeMessage"); var photoIndex = this._controls.photoIndex; if (photoIndex) { photoIndex.update
= function(photo, context) { this.set(context.currentIndex + 1); }; } this._setupAttachment = zf_stdFalse;
this._compact = screen.width <= 1200; if (this._compact) zf_stdReplaceClassName(this.dom(), null,
"cb-s-compact"); zf_stdMakeMethodsDeferred(this, this.id, ["_setupCommentFinders"]); } zfl_CommentBrowser.inherits(zfl_Control);
zfl_CommentBrowser.prototype.init = function(decoration, plugins, overlayFlags, oncommand, oncommandtest)
{ this._oncommandtest = oncommandtest; this._oncommand = oncommand; this.dom("close").onclick = function()
{ self._oncommand("closeComments"); }; var self = this; oncommand = function(id) { self._oncommand("closeComments");
self._oncommand(id); }; this._cropPlugin = new zfl_CommentCropPlugin(); this._areaPlugin = new zfl_CommentAreaPlugin();
plugins = [].concat(plugins, this._cropPlugin, this._areaPlugin); this._flipper.init( decoration,
plugins, overlayFlags, oncommand, oncommandtest, true, null ); this._extent = decoration != null ?
(decoration.shadowSize + decoration.borderSize + decoration.extraSize) : 0; }; zfl_CommentBrowser.prototype.show
= function(add) { if (this._visible) return; this._visible = true; this._editOnOpen = add; if (zfl_Popup.current)
zfl_Popup.current.hide(); zfl_Curtain.show("dark"); var dom = this.dom(); if (dom.parentNode != document.body)
document.body.appendChild(dom.parentNode.removeChild(dom)); this._resizeHandler = this.eventHandler(this._window_onresize);
zf_stdAttachEvent(window, "resize", this._resizeHandler); this._keydownHandler = this.eventHandler(this._document_onkeydown);
zf_stdAttachEvent(document, "keydown", this._keydownHandler); this.setMode("viewing"); this.display(true);
this._recalcLayout(); if (this.current) this._update(); }; zfl_CommentBrowser.prototype.hide = function()
{ if (!this._visible) return; this._visible = false; if (this._resizeHandler) { zf_stdDetachEvent(window,
"resize", this._resizeHandler); this._resizeHandler = null; } if (this._keydownHandler) { zf_stdDetachEvent(document,
"keydown", this._keydownHandler); this._keydownHandler = null; } this._flipper.clear(); this.display(false);
zfl_Curtain.hide(); }; zfl_CommentBrowser.prototype.update = function(photo, context) { ; ; if (this.current
== photo) return; if (this.current != null) { this.current.unadvise(this); this.current.getMeta().unadvise(this);
} this.current = photo; this.currentContext = context; this._mailbox = null; this._editOnOpen = false;
if (this._visible) this._update(); }; zfl_CommentBrowser.prototype._update = function() { ; ; ;
var photo = this.current; var context = this.currentContext; this.dom("back").style.visibility = this._oncommandtest("back")
? "inherit" : "hidden"; this.dom("next").style.visibility = this._oncommandtest("next") ? "inherit"
: "hidden"; this._displayed = false; this._prepared = false; for (var key in this._controls) {
var control = this._controls[key]; if (control == null || typeof (control.update) != "function")
continue; control.update(photo, context); } this._list.setEditing(true); if (photo.loaded) { this._setPhoto(photo);
} else { var self = this; photo.advise(this, function() { self._setPhoto(photo); }); } this._setupCommentFinders();
}; zfl_CommentBrowser.prototype._window_onresize = function() { ; zf_stdDeferCall( this.id + ".onresize",
this._recalcLayout, this); }; zfl_CommentBrowser.prototype._flipper_onload = function(state, immediate)
{ this._flipper.flip(); }; zfl_CommentBrowser.prototype._flipper_ondisplay = function(photo) {
; this._displayed = true; this._onload(); }; zfl_CommentBrowser.prototype.next = function(e) {
this._oncommand("next"); }; zfl_CommentBrowser.prototype.back = function(e) { this._oncommand("back");
}; zfl_CommentBrowser.prototype._recalcLayout = function() { var dom = this.dom(); var getPixels =
function(node, a, b) { return zf_stdExtractPixels(zf_stdGetCurrentStyle(node, a, b)); }; var x = 34;
var y = 34; var cx = zf_stdGetClientWidth() - x * 2; var cy = zf_stdGetClientHeight() - y * 2;
var cxPadding = getPixels(dom, "border-left-width", "borderLeftWidth") + getPixels(dom, "padding-left",
"paddingLeft") + getPixels(dom, "padding-right", "paddingRight") + getPixels(dom, "border-right-width",
"borderRightWidth"); var cyPadding = getPixels(dom, "border-top-width", "borderTopWidth") + getPixels(dom,
"padding-top", "paddingTop") + getPixels(dom, "padding-bottom", "paddingBottom") + getPixels(dom,
"border-bottom-width", "borderBottomWidth"); cx -= cxPadding; cy -= cyPadding; cx = Math.max(cx,
900); cy = Math.max(cy, (this._compact ? 550 : 620)); 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, mask: 0 }, { method: zf_ProcessingMethod.StandardMediumSize,
mask: zf_AccessMask.ProtectMedium }, { method: zf_ProcessingMethod.StandardLargeSize, mask: zf_AccessMask.ProtectLarge
}, { method: zf_ProcessingMethod.StandardExtraLargeSize, mask: zf_AccessMask.ProtectExtraLarge },
{ method: zf_ProcessingMethod.StandardXXLargeSize, mask: zf_AccessMask.ProtectXXLarge } ]; var 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; method = 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"; dom.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"; left.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); }; zfl_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);
this._list.setAccess(photo.access.mask, zf_MailboxType.PhotoComments); this._edit.setAccess(photo.access.mask,
zf_MailboxType.PhotoComments); this.setMode("viewing"); this._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); } else { var self = this; meta.bump();
meta.advise(this, function() { self._setMeta(meta); }, function() { self._list.setLoading(true); });
} }; zfl_CommentBrowser.prototype._setMeta = function(meta) { ; var list = this._list; list.reinit(meta.comments,
meta.recentComments); if (meta.recentComments.length > 0) list.select(meta.recentComments[0].index);
this._prepared = true; this._onload(); }; zfl_CommentBrowser.prototype.add = function() { if (!this._editable)
return; this._edit.setOriginal(null); this.setMode("editing"); }; zfl_CommentBrowser.prototype._edit_onsave
= function(updater) { ; var 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;
var 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);
} meta.addComment(message); } else if (original != null) { if (self.current === photo) list.remove(original.index);
meta.removeComment(original.index); } else { if (zf_userId == 0 && updater.isPrivate) { self._edit.setContinue(
false, "Your comment has been sent directly to the photographer. It will not appear in the list.",
function() { self.setMode("viewing"); }); return; } } self.setMode("viewing"); return; } if (self.current
=== photo) self._edit.setContinue(true, error.message, function() { self._edit.setContinue(); });
}; if (original == null) zf_Message.postMessage(this._auth, this._mailbox, updater, onpost); else
zf_Message.updateMessage(this._auth, this._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(); if (selected != null) { list.deselect(selected.getIndex()); list.select(selected.getIndex());
} else { this._displayAttachment(zf_AttachmentType.None, null, true); } }; zfl_CommentBrowser.prototype.setMode
= function(mode) { ; this._mode = mode; if (mode == "editing") { this._auth = new zf_MailboxAuthorization(this._mailbox);
zf_stdReplaceClassName(this.dom(), "cb-s-viewing", "cb-s-editing"); this._oncommand("enableKeyNavigation",
false); this._edit.setFocus(); } else { zf_stdReplaceClassName(this.dom(), "cb-s-editing", "cb-s-viewing");
this._oncommand("enableKeyNavigation", true); this._list.setHeight(); } }; 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); if (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); this.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; var 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); } } else { meta.removeComment(message.index); if (self.current === photo)
list.remove(message.index); } } self._list.setEditing(false); self._list.setHeight(); }; self._list.setEditing(true);
zf_Message[action](message.mailbox, message.index, oncomplete); }; zfl_CommentBrowser.prototype._displayAttachment
= function(attachmentType, attachment, readOnly) { if (!this._displayed) return; this._setupAttachment
= zf_stdFalse; var help = ""; var icon = ""; if (attachmentType == zf_AttachmentType.None) { this._areaPlugin.deactivate();
this._cropPlugin.deactivate(); if (!readOnly) help = ""; } else if (attachmentType == zf_AttachmentType.CroppingSuggestion)
{ this._areaPlugin.deactivate(); this._cropPlugin.activate(attachment, readOnly, this.closure(this._plugin_onclose));
if (!readOnly) { this._setupAttachment = function(updater) { updater.attachmentType = zf_AttachmentType.CroppingSuggestion;
updater.attachment = this._cropPlugin.getAttachment(); }; 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(); this._areaPlugin.activate(attachment, readOnly, this.closure(this._plugin_onclose));
if (!readOnly) { this._setupAttachment = function(updater) { updater.attachmentType = zf_AttachmentType.HighlightedArea;
updater.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>'; } } 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);
var 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); var message = view.getMessage(); this._displayAttachment(zf_AttachmentType.None,
null, true); view.setAttachmentVisible(false); }; zfl_CommentBrowser.prototype._list_onattachment
= function(message, show) { var selected = this._list.getSelectedView(); if (!selected || selected.getIndex()
!= message.index) { this._list.select(message.index); } else { selected.setAttachmentVisible(show);
this._displayAttachment( show ? message.attachmentType : zf_AttachmentType.None, message.attachment,
true); } }; zfl_CommentBrowser.prototype._onload = function() { if (!this._prepared || !this._displayed)
return; var photo = this.current; var meta = photo.getMeta(); var list = this._list; ; ; list.setEditing(false);
list.setLoading(false); if (this._editOnOpen) { this._editOnOpen = true; this.add(); } else { var
selected = list.getSelectedView(); if (selected != null) { var message = selected.getMessage();
this._displayAttachment(message.attachmentType, message.attachment, true); } else { this._displayAttachment(zf_AttachmentType.None,
null, true); } } }; zfl_CommentBrowser.prototype._list_onattachment = function(message, show) {
var selected = this._list.getSelectedView(); if (!selected || selected.getIndex() != message.index)
{ this._list.select(message.index); } else { selected.setAttachmentVisible(show); this._displayAttachment(
show ? message.attachmentType : zf_AttachmentType.None, message.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; var 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; switch (e.keyCode) { case 38: this._list.selectNext(); break; case 40: this._list.selectPrevious();
break; default: return false; } } zf_stdStopPropagation(e); zf_stdPreventDefault(e); return 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',
'</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">', message,
'</div>' ].join(""); } this.dom("error").innerHTML = message; }; zfl_CommentBrowser.prototype._finder_ondone
= function(found, index, forward) { var button = this.dom(forward ? "seekNext" : "seekBack"); zfl_Button.enableButton(button,
found); if (found) { button.title = forward ? "Next photo with comments" : "Previous photo with comments";
} else { button.title = "No more photos with comments"; } }; zfl_CommentBrowser.prototype._setupCommentFinders
= function() { ; if (this._finderBack) this._finderBack.cancel(); if (this._finderNext) this._finderNext.cancel();
var button; button = this.dom("seekBack"); zfl_Button.enableButton(button, false); button.title
= "Searching for photos with comments"; this._finderBack = new zfl_CommentFinder( this.currentContext.photoList,
this.currentContext.currentIndex, false, this.closure(this._finder_ondone, false)); button = this.dom("seekNext");
zfl_Button.enableButton(button, false); button.title = "Searching for photos with comments"; this._finderNext
= new zfl_CommentFinder( this.currentContext.photoList, this.currentContext.currentIndex, true,
this.closure(this._finder_ondone, true)); }; zfl_CommentBrowser.prototype.seekBack = function()
{ if (this._finderBack && this._finderBack.found) this._oncommand("select", this._finderBack.index);
}; zfl_CommentBrowser.prototype.seekNext = function() { if (this._finderNext && this._finderNext.found)
this._oncommand("select", this._finderNext.index); };
; ; ; ; function zfl_RecentComments(id) { zfl_Control.prototype.constructor.call(this, id); zf_stdMakeMethodsDeferred(this,
this.id, ["_setPhoto" ]); } zfl_RecentComments.inherits(zfl_Control); zfl_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); this.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); }, function() { self._showLoading();
self.notifyResize(false); }); } }; zfl_RecentComments.prototype._setPhoto = function(photo) { ;
if ((photo.flags & zf_PhotoFlags.HasComments) == 0) { this._showComments(photo, null); 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); self.notifyResize(false);
}, function() { self._showLoading(); self.notifyResize(false); }); } }; zfl_RecentComments.prototype._setMeta
= function(meta) { ; this._showComments(meta.photo, meta.recentComments); }; zfl_RecentComments.prototype._showLoading
= function() { zf_stdReplaceClassName(this.dom(), "recentcomments-s-empty", "recentcomments-s-loading");
}; zfl_RecentComments.prototype._showComments = function(photo, comments) { zf_stdReplaceClassName(this.dom(),
"recentcomments-s-loading", null); var mask = zf_AccessMask.NoPublicComments | zf_AccessMask.NoPrivateComments;
var canAdd = (photo.access.mask & mask) != mask; if (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(), canAdd ? "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]; break; } } } if (!comment) { zf_stdReplaceClassName(this.dom(),
null, "recentcomments-s-empty"); } else { var posterName; if (comment.posterUrl) { posterName = [
'<a href="" id="', this.id, '-poster-link" class="recentcomments-poster">', zf_stdHtmlEncode(comment.posterName),
'</a>']; } else { posterName = [ '<span class="recentcomments-poster">', zf_stdHtmlEncode(comment.posterName),
'</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">',
zf_stdFormatDateTime(comment.postedOn), '</span>'].join("") ), '</div>', '<div class="recentcomments-text">',
comment.body, '</div>' ]; this.dom("content").innerHTML = content.join(""); var posterLink = this.dom("poster-link");
if (posterLink && comment.posterUrl) posterLink.href = comment.posterUrl; var domCount = this.dom("count");
if (domCount) zf_stdSetText(domCount, photo.getMeta().comments); zf_stdReplaceClassName(this.dom(),
"recentcomments-s-empty", null); } }; zfl_RecentComments.prototype._view_onclick = function() {
if (this.onshow) this.onshow(); }; zfl_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); };
; ; function zfl_PhotoLayout(id, global, local) { zfl_Layout.prototype.constructor.call(this, id,
global, local); zfl_PhotoDownload.prototype.constructor.call(this); var key; var self = this; this._photoSet
= zfl_stdTransformResponse(local.photoSet, "photoSet"); this._photoList = local.photoList; this._photoList.setDefaults(this._photoSet,
this._photoSet.owner); this._photoList.onload = this.closure(this._photoList_onload); this._photoList.onshrink
= this.closure(this._photoList_onshrink); this._initial = local.initial; this.current = { index:
-1, photo: null, previousIndex: -2 }; this.slideshow = local.slideshow; this._handlers = this._createHandlers();
var controls = this._controls = { list: [], all: [], add: function(control) { if (control) { this.all.push(control);
if (arguments.length > 1) { var args = []; for (var a = 1; a < arguments.length; a++) args.push(arguments[a]);
control.init.apply(control, args); } } }, addUpdate : function(updateMethod) { var c = { update :
updateMethod }; this.all.push(c); return c; }, addDeferredUpdate : function(tag, updateMethod) {
var c = this.addUpdate(updateMethod); c.update = zf_stdMakeDeferred(self.id + "." + tag, updateMethod);
return c; } }; controls.list = controls.all; controls.add(local.copyright); controls.add(local.caption);
controls.add(local.shortExif); controls.add(local.categories); controls.add(local.photographer,
this._photoSet.owner); controls.add(local.addressBar, this); controls.add(this.header); controls.add(this.footer);
controls.add(local.analytics); controls.add(local.mailboxLink); controls.add(local.recentComments);
controls.add(global.customizer); controls.analytics = local.analytics; var controlBox = local.controlBox;
if (controlBox) { controls.add(local.controlBox, this._photoList, this._photoSet); controls.controlBox
= controlBox; controlBox.onselect = this.closure(this.select); controlBox.onslide = function(id, index)
{ self._registerSlideVisit(index); }; controlBox.onaddtocart = this.closure(this._addToCart); }
var actions = local.actions; if (actions) { controls.add(actions); controls.actions = actions;
actions.onaddtofav = this.closure(this._addToFavorites); actions.onaddtocart = this.closure(this._addToCart);
actions.ondownload = this.closure(this._download); } var overlay = null; var decoration, plugins,
overlayFlags; if (local.flipper) { local.flipper.relaxedHeight = true; decoration = this._getDecorationInfo(local.flipper.style);
plugins = this._createPlugins(local.flipper.style, decoration); overlayFlags = { exifIcon: local.overlayExif,
menuBar: local.overlayMenu || this.administrator, message: local.overlayMenu || this.administrator,
download: local.overlayDownload, contextMenu: true, dimLights: !this.slideshow, defaultCommand:
!this.slideshow ? "dimLights" : null }; controls.add(local.flipper, decoration, plugins, overlayFlags,
this._handlers.oncommand, this._handlers.oncommandtest, this.slideshow, this.slideshow ? "slow-fade"
: null ); controls.flipper = local.flipper; controls.flipper.onload = this.closure(this._flipper_onload);
controls.flipper.ondisplay = this.closure(this._flipper_ondisplay); } var cookieControl = controls.addDeferredUpdate(
"setRecentCookie", function(photo, context) { zfl_SessionCookie.current.setRecent( self._photoSet.id,
context.currentIndex); }); if (local.dimlights) { decoration = this._getDecorationInfo(zfl_PhotoViewStyle.DimLights);
plugins = this._createPlugins(zfl_PhotoViewStyle.DimLights, decoration); overlayFlags = { download:
local.overlayDownload, contextMenu: true, undimLights: true, defaultCommand: "undimLights" }; controls.add(
local.dimlights, decoration, plugins, overlayFlags, this._handlers.oncommand, this._handlers.oncommandtest,
local.analytics ); controls.dimlights = local.dimlights; controls.dimlights.ondisplay = this.closure(this._registerVisit);
controls.listDimLights = [ local.dimlights, cookieControl, local.addressBar, local.analytics];
} if (local.comments) { decoration = this._getDecorationInfo(zfl_PhotoViewStyle.CommentBrowser);
plugins = this._createPlugins(zfl_PhotoViewStyle.CommentBrowser, decoration); overlayFlags = {
download: local.overlayDownload, contextMenu: false }; controls.add( local.comments, decoration,
plugins, overlayFlags, this._handlers.oncommand, this._handlers.oncommandtest ); controls.comments
= local.comments; controls.comments.ondisplay = this.closure(this._registerVisit); controls.listComments
= [local.comments, cookieControl, local.addressBar, local.analytics]; if (local.mailboxLink) {
local.mailboxLink.onshow = this.closure(this._showComments, false); local.mailboxLink.onadd = this.closure(this._showComments,
true); controls.mailboxLink = local.mailboxLink; } if (local.recentComments) { local.recentComments.onshow
= this.closure(this._showComments, false); local.recentComments.onadd = this.closure(this._showComments,
true); controls.recentComments = local.recentComments; } if (this.header) controls.comments.onlogin
= this.header.closure(this.header.login); } var onresize = this.closure(this.recalc); for (var i =
0; i < controls.list.length; i++) controls.all[i].onresize = onresize; for (key in this._pairs)
{ var pair = this._pairs[key]; if (!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, 1); } if (pair.field == "PhotoPage.Viewed") controls.pairViewed
= pair; controls.add(pair); } this._navigation = local.navigation; var navNext = this._navigation.next;
var navBack = this._navigation.back; if (navNext && navBack) { ; controls.addDeferredUpdate( "updateNavigation",
function(photo, context) { navBack.visibility(context.currentIndex > 0); navNext.visibility(context.currentIndex
< context.photoList.length - 1); }); } this._pager = local.pager; var pager = this._pager; var grid
= this._grids.photos; if (grid) { controls.addDeferredUpdate( "selectGridItem", function(photo,
context) { grid.deselectAll(); grid.selectItem(context.currentIndex); }); } if (grid && pager)
{ grid.onlayoutchange = function(info) { pager.update(info.totalPages, info.currentPage); }; pager.onchange
= function(page) { grid.setPage(page); grid.recalcLayout(); }; } if (local.quickPriceList) { controls.add(local.quickPriceList,
this.zenbar.cart); local.quickPriceList.addtocart = this.closure(this._addToCart); } if (this.scrapbook)
this.scrapbook.onchange = this.closure(this._scrapbook_onchange); zf_stdMakeMethodsDeferred(this,
this.id, [ "_ensureThumbnailVisible", "_registerVisit" ]); this._delayedViewsUpdate = new zf_DelayedInvoke(500);
this.cyMinFooter = 15; this._keyNavigation = true; } zfl_PhotoLayout.inherits(zfl_Layout, zfl_PhotoDownload);
zfl_PhotoLayout.prototype.onrecalc = function() { zfl_Layout.prototype.onrecalc.call(this); };
zfl_PhotoLayout.prototype.onload = function() { zfl_Layout.prototype.onload.call(this); if (this._grids.photos)
{ var photoList = this._photoList; this.initGrid( this._grids.photos, zfl_PhotoViewStyle.PhotoNavList,
this._grids.photosParams, function(index) { return photoList.get(index); }, photoList.length);
var self = this; this._grids.photos.onselchange = function(item) { self.select(item.index); };
} ; ; var legacy = location.search.indexOf("photo=") != -1; 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; if (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); this._initial.index = -1; this._initial.id = id;
} else if (this._photoList.length == 0) { ; } else { ; this.select(this._initial.index); } if (this._controls.analytics)
this._controls.analytics.registerLayoutLoad(this._controls.flipper); }; 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; zfl_PasswordManager.subscribe( photo.access.realmId, function() { self.navigate(photo.id,
true); }); } } if (this._initial.index < 0) { ; ; this.navigate(this._initial.id); } } 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, true); return false; }; zfl_PhotoLayout.prototype._redirect = function(photoId)
{ ; var dest = []; dest.push("/p", this._photoSet.id); if (photoId != null) dest.push("/e", photoId.toString(16));
if (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, reload) { if (!photoId) { ; this._redirect(photoId); return; } if (reload)
{ ; this._redirect(photoId); return; } var index = this._photoList.find(photoId); if (index < 0)
{ ; this._redirect(photoId); return; } ; this.select(index); }; zfl_PhotoLayout.prototype.select
= function(index) { ; ; var start = new Date().getTime(); var photo = this._photoList.get(index);
if (index != this.current.index) this.current.previousIndex = this.current.index; if (this.current.photo)
this.current.photo.unadvise(this); this.current.index = index; this.current.photo = photo; var context
= { currentIndex: index, previousIndex: this.current.previousIndex, photoList: this._photoList,
displayed: false }; var list = this._controls.list; for (var i = 0; i < list.length; i++) { if (list[i])
list[i].update(photo, context); } this._prefetchMeta(this.current.index >= this.current.previousIndex);
this.recalc(true); if (!this._dimmed) this._ensureThumbnailVisible(); zfl_Popup.hideAny(); ; };
zfl_PhotoLayout.prototype.next = function() { if (this.current.index >= 0 && this.current.index
< this._photoList.length - 1) { this.select(this.current.index + 1); } }; zfl_PhotoLayout.prototype.back
= function() { if (this.current.index > 0) { this.select(this.current.index - 1); } }; zfl_PhotoLayout.prototype.nextPage
= function() { ; var layoutInfo = this._grids.photos.getLayoutInfo(); this.select(layoutInfo.lastVisible);
}; zfl_PhotoLayout.prototype.backPage = function() { ; var layoutInfo = this._grids.photos.getLayoutInfo();
if (layoutInfo.firstVisible > 0) this.select(layoutInfo.firstVisible - 1); }; zfl_PhotoLayout.prototype._createHandlers
= function() { var self = this; var test = { addToCart: function() { return this._controls.controlBox
&& this._controls.controlBox.canAddToCart(); }, share: function() { return this._controls.controlBox
&& this._controls.controlBox.canShare(); }, dimLights: function(id, photo, params) { return this._controls.dimlights
&& params.dimLights; }, undimLights: function(id, photo, params) { return this._controls.dimlights
&& params.undimLights; }, admin: function() { return this.administrator; }, censorPhoto: function(id,
photo) { return this.administrator && !photo.access.isCensored; }, uncensorPhoto: function(id, photo)
{ return this.administrator && photo.access.isCensored; }, censorGallery: function(id, photo) {
return this.administrator && photo.photoSet.type == zf_PhotoSet.Gallery; }, purgeGallery: function(id,
photo) { return this.administrator && photo.photoSet.type == zf_PhotoSet.Gallery; }, purgePhoto:
"admin", download: function(id, photo, params) { return params.download; }, downloadOriginal: function(id,
photo, params) { return this.administrator || (photo.access.mask & zf_AccessMask.ProtectOriginals)
== 0; }, downloadPhoto: "downloadOriginal", downloadPhoto2: "downloadOriginal", downloadGallery:
function(id, photo, params) { return this._photoSet.type == zf_PhotoSet.Gallery; }, downloadCollection:
function(id, photo, params) { return this._photoSet.type == zf_PhotoSet.Collection; }, collect:
function(id, photo) { return (photo.access.mask & zf_AccessMask.NoCollections) == 0; }, collectNew:
"collect", collectEdit: "collect", collectPhoto: "collect", collectLogin: "collect", back: function()
{ return this.current.index > 0; }, next: function() { return this.current.index < this._photoList.length
- 1; }, enableKeyNavigation: function() { return this._keyNavigation; }, addToFavorites: function()
{ return this.scrapbook != null && this.current.photo.owner.id == this._photoSet.owner.id; } };
var exec = { addToCart: function() { this._controls.controlBox.addToCart(); }, share: function()
{ this._controls.controlBox.share(); }, dimLights: function() { this._dimmed = true; this._controls.list
= this._controls.listDimLights; this._controls.dimlights.show(); }, undimLights: function() { this._dimmed
= false; this._controls.list = this._controls.all; this.select(this.current.index); this._controls.dimlights.hide();
}, openComments: function() { this._showComments(false); }, closeComments: function() { this._dimmed
= false; this._controls.list = this._controls.all; this.select(this.current.index); if (this._controls.mailboxLink)
this._controls.mailboxLink.refresh(); if (this._controls.recentComments) this._controls.recentComments.refresh();
this._controls.comments.hide(); }, censorPhoto: function() { if (!confirm("Are you sure that you want to censor this photograph?"))
return; zf_stdServerRequest( "POST", "/zf/layout/layout.asmx", "CensorPhoto", [this.current.photo.id,
true], function() { self._redirect(self.current.photo.id); }); }, uncensorPhoto: function() { zf_stdServerRequest(
"POST", "/zf/layout/layout.asmx", "CensorPhoto", [this.current.photo.id, false], function() { self._redirect(self.current.photo.id);
}); }, censorGallery: function() { if (!confirm("Are you sure that you want to censor this entire gallery?"))
return; zf_stdServerRequest( "POST", "/zf/layout/layout.asmx", "CensorGallery", [this._photoSet.id],
function() { self._redirect(); }); }, purgePhoto: function() { if (!confirm("Are you sure that you want to immediately and permanently detele this photograph?"))
return; var uri = "/p" + this.current.photo.photoSet.id; zf_stdServerRequest( "POST", "/zf/layout/layout.asmx",
"PurgePhoto", [this.current.photo.id], function() { self._redirect(); }); }, purgeGallery: function()
{ if (!confirm("Are you sure that you want to immediately and permanently detele all photographs from this gallery?"))
return; var uri = "/p" + this.current.photo.photoSet.id; zf_stdServerRequest( "POST", "/zf/layout/layout.asmx",
"PurgeGallery", [this._photoSet.id], function() { location.href = uri; }); }, collectNew: function()
{ zfl_CollectionList.current.addPhotoToNew( "Quick Collection", this.current.photo.id); }, collectEdit:
function() { var url = ["http://", zf_defaultHost, "/", zf_userName, "/edit"]; location.href = zf_stdGetTransferUrl(url.join(""));
}, collectPhoto: function(id, collectionId) { zfl_CollectionList.current.addPhoto(collectionId,
this.current.photo.id); }, collectLogin: function() { zfl_Header.login(this.current.photo.getHref("full"),
"collect." + this.current.photo.id); }, downloadPhoto: function() { this._downloadOriginal(this.current.photo);
}, downloadPhoto2: function() { this._downloadOriginal(this.current.photo); }, downloadGallery:
function() { this._downloadOriginals(this._photoSet.title, this._photoList); }, downloadCollection:
function() { this._downloadOriginals(this._photoSet.title, this._photoList); }, back: function()
{ this.back(); }, next: function() { this.next(); }, select: function(id, index) { this.select(index);
}, enableKeyNavigation: function(id, enable) { this._keyNavigation = enable; }, addToFavorites:
function(id) { return this.scrapbook.addPhotos([this.current.photo.id]); } }; return { oncommandtest:
function(id, params) { var photo = self.current.photo; if (!photo || (!photo.loaded && id != "next"
&& id != "back")) return false; if (typeof (test[id]) == "function") return test[id].call(self,
id, photo, params); if (typeof (test[id]) == "string") return test[test[id]].call(self, id, photo,
params); return false; }, oncommand: function() { ; var id = arguments[0]; ; ; if (typeof (exec[id])
== "function") return exec[id].apply(self, arguments); } }; }; zfl_PhotoLayout.prototype._photo_onstretch
= function(height, stretcher) { var flipper = this._controls.flipper; if (flipper) { var width =
stretcher.offsetWidth; if (!flipper.resize(width, height)) { stretcher.style.height = height + "px";
} else { stretcher.style.height = flipper.dom().style.height; } this._updateFlipperDependencies();
return true; } return false; }; zfl_PhotoLayout.prototype._flipper_onload = function(state, immediate)
{ var flipper = this._controls.flipper; ; flipper.flip(); this._updateFlipperDependencies(); if (!immediate)
this.recalc(false); }; zfl_PhotoLayout.prototype._flipper_ondisplay = function(photo) { ; var controlBox
= this._controls.controlBox; if (controlBox && controlBox.current == photo) controlBox.photoDisplayed(true);
var actions = this._controls.actions; if (actions && actions.current == photo) actions.photoDisplayed(true);
this._registerVisit(photo); }; zfl_PhotoLayout.prototype._ensureThumbnailVisible = function() {
; var grid = this._grids.photos; if (!grid) return; var pageIndex = grid.getItemPage(this.current.index);
if (pageIndex != grid.getPage()) { grid.setPage(pageIndex); grid.recalcLayout(); } }; zfl_PhotoLayout.prototype._prefetchMeta
= function(forward) { var increment = forward ? 1 : -1; var prefetch = 5; var 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); var meta = photo.getMeta(); meta.bump(); index
-= increment; } }; zfl_PhotoLayout.prototype._document_onkeydown = function(e) { zfl_Layout.prototype._document_onkeydown.apply(this,
arguments); if (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; switch (e.which) { case 39: if (this._keyNavigation) this.next(); break; case 37:
if (this._keyNavigation) this.back(); break; case 27: if (this._dimmed) { this._handlers.oncommand("undimLights");
this._handlers.oncommand("closeComments"); } break; case 122: return true; default: return false;
} e.stopPropagation(); e.preventDefault(); return true; }; zfl_PhotoLayout.prototype._registerVisit
= function(photo) { ; if (this.administrator) return; if (photo.__visit_registered) return; photo.__visit_registered
= true; if (photo.owner.id == zf_userId) return; var self = this; var pair = this._controls.pairViewed;
var 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); }); } } }; var sessionKey = zfl_SessionCookie.current.sessionKey;
zf_stdServerRequest("GET", "/zf/layout/layout.asmx", "RegisterVisit", [ photo.owner.id, photo.gallery.id,
photo.id, this._photoSet.owner.id, this._photoSet.id, sessionKey ], oncomplete); }; zfl_PhotoLayout.prototype._registerSlideVisit
= function(photoIndex) { var photo = this._photoList.get(photoIndex); ; if (photo.loaded) { if (photo.access.type
== zf_AccessType.Password && photo.access.ownerId != zf_userId) return; this._registerVisit(photo);
} 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; this._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 = []; for (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; if (!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; i++) { var control = flipper.__zfl_widthdeps[i]; control.dom().style.width
= width + "px"; } } }; zfl_PhotoLayout.prototype._addToCart = function(vendorId, productId) { ;
; if (!this.zenbar) return; var setPhotos = this.zenbar.addToCart(null, vendorId, productId); setPhotos(this.current.photo);
}; zfl_PhotoLayout.prototype._addToFavorites = function() { if (!this.scrapbook) return; ; this.scrapbook.addPhotos([this.current.photo.id]);
}; 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,
edit); if (info && info.addedCount != undefined) { var message = null; if (info.failedCount > 0)
message = "An error has occurred while trying to add this photos to favorites."; if (message) zfl_MessageBox.show({
text: message, buttons: ["OK"] }); } };
; ; ; function zfl_TabGroup(id, tabs) { if (zf_stdNoArgs(arguments)) return; zfl_Control.prototype.constructor.call(this,
id); this._tabs = {}; for (var i = 0; i < 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; } } zfl_TabGroup.inherits(zfl_Control); zfl_TabGroup._switch_onmouseover
= function(event) { var dom = zf_stdGetEventSource(event); if (zf_stdHasClassName(dom, "tab-label"))
dom = dom.parentNode; if (zf_stdHasClassName(dom, "tab-standard")) { zf_stdReplaceClassName(dom,
"tab-standard", "tab-hover"); zf_stdReplaceClassName(dom, "tab-bgcolor2", "tab-bgcolor3"); zf_stdReplaceClassName(dom,
"tab-bgimage2", "tab-bgimage3"); zf_stdReplaceClassName(dom, "tab-color2", "tab-color3"); } };
zfl_TabGroup._switch_onmouseout = function(event) { var dom = zf_stdGetEventSource(event); if (zf_stdHasClassName(dom,
"tab-label")) dom = dom.parentNode; if (zf_stdHasClassName(dom, "tab-hover")) { zf_stdReplaceClassName(dom,
"tab-hover", "tab-standard"); zf_stdReplaceClassName(dom, "tab-bgcolor3", "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); if (selected)
{ zf_stdReplaceClassName(dom, "tab-standard", null); zf_stdReplaceClassName(dom, "tab-hover", "tab-selected");
zf_stdReplaceClassName(dom, "tab-bgcolor3", null); zf_stdReplaceClassName(dom, "tab-bgcolor2", "tab-bgcolor1");
zf_stdReplaceClassName(dom, "tab-bgimage3", null); zf_stdReplaceClassName(dom, "tab-bgimage2", "tab-bgimage1");
zf_stdReplaceClassName(dom, "tab-color3", null); zf_stdReplaceClassName(dom, "tab-color2", "tab-color1");
} else { zf_stdReplaceClassName(dom, "tab-selected", "tab-standard"); zf_stdReplaceClassName(dom,
"tab-bgcolor1", "tab-bgcolor2"); zf_stdReplaceClassName(dom, "tab-bgimage1", "tab-bgimage2"); zf_stdReplaceClassName(dom,
"tab-color1", "tab-color2"); } }; 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, false); 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]; if (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]; if (!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, false); 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; if (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; } 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, global, 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, "collections"), photos : zfl_stdTransformResponse(local.data.photos,
"photos") }; var self = this; this._customize = local.customize; if (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, stretcher) { return self._tabs_onstretch(height,
stretcher); }; } var 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, info.currentPage); }; pager.onchange = function(page) { grid.setPage(page);
self.recalc(true); }; }; setupPage("galleries", 2); setupPage("collections", 2); setupPage("photos",
3); } 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, zfl_PhotoViewStyle.FolderElement, this._grids.galleriesParams, this._data.galleries);
this.initGrid( this._grids.collections, zfl_PhotoViewStyle.FolderElement, this._grids.collectionsParams,
this._data.collections); this.initGrid( this._grids.photos, zfl_PhotoViewStyle.GalleryPhoto, this._grids.photosParams,
this._data.photos); if (this._tabs) this._tabs.init(zf_stdGetCookie("zfl_search")); 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, true); if (!init) this.recalc(); }; zfl_SearchLayout.prototype._tabs_onstretch
= function(height, stretcher) { var tab = this._tabs.selected; var grid; if (tab) grid = this._grids[tab.key];
if (!grid) return false; grid.setHeight(height); stretcher.style.height = "auto"; stretcher.style.minHeight
= height + "px"; grid.recalcLayout(); return true; }; zfl_SearchLayout.prototype._onsearch = function()
{ var search = this.dom("query")["q"]; var query = encodeURIComponent(search.value); uri = "/?q="
+ query; if (this._customize) uri += "&customize=" + this._customize; location.href = uri; };
; ; ; ; function zfl_PhotoCtrThLayout(id, global, local) { zfl_PhotoLayout.prototype.constructor.call(this,
id, global, local); var grid = this._grids.photos; if (grid) { grid.minRows = grid.maxRows = 1;
grid.setHeight(0); var self = this; grid.onlayoutchange = function(info) { var nextPage = self._navigation.nextPage;
var backPage = self._navigation.backPage; if (nextPage) nextPage.visibility(info.lastVisible < self._photoList.length);
if (backPage) backPage.visibility(info.firstVisible > 0); }; } } zfl_PhotoCtrThLayout.inherits(zfl_PhotoLayout);
zfl_PhotoCtrThLayout.prototype.onrecalc = function() { zfl_PhotoLayout.prototype.onrecalc.call(this);
var grid = this._grids.photos; if (grid) { var info = null; if (grid.getSelectedItem() == null &&
this.current.index >= 0) { info2 = info = grid.getLayoutInfo(); grid.setPage(Math.floor(this.current.index
/ info.itemsPerPage)); info = null; } else { info = grid.getLayoutInfo(zf_PhotoGrid.KeepVisible);
} grid.recalcLayout(info); } }; zfl_PhotoCtrThLayout.prototype.onload = function() { zfl_PhotoLayout.prototype.onload.call(this);
};
; ; function zfl_PhotoLtRtLayout(id, global, local) { zfl_PhotoLayout.prototype.constructor.call(this,
id, global, local); var self = this; var style = zfl_PhotoViewStyle.PhotoNavThumbnail; var method
= zf_ProcessingMethod.StandardSmallThumbnail; var plugins = this._createPlugins(style, this._getDecorationInfo(style,
method)); this._pool = {}; if (this._navigation.backThumbId && this._navigation.nextThumbId) {
var view; view = new zf_PhotoView(this._navigation.backThumbId, plugins); view.waitTimeout = 800;
this._navigation.backThumb = view; view = new zf_PhotoView(this._navigation.nextThumbId, plugins);
view.waitTimeout = 800; this._navigation.nextThumb = view; this._controls.addDeferredUpdate( "updateNavigation2",
this.closure(this._updateNavigation)); var domBack = this._navigation.back.dom(); domBack.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); }; 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;
var photoList = this._photoList; var backThumb = this._navigation.backThumb; var nextThumb = this._navigation.nextThumb;
if (this._backPhoto) { this._backPhoto.unadvise(backThumb); this._backPhoto = null; } if (this._nextPhoto)
{ this._nextPhoto.unadvise(nextThumb); this._nextPhoto = null; } var self = this; if (index > 0)
{ var backPhoto = photoList.get(index - 1); if (backPhoto.loaded) { this._loadThumb(backThumb, backPhoto);
} else { this._backPhoto = backPhoto; backPhoto.advise(backThumb, function() { self._loadThumb(backThumb,
backPhoto); }); } } if (index < photoList.length - 1) { var nextPhoto = photoList.get(index + 1);
if (nextPhoto.loaded) { this._loadThumb(nextThumb, nextPhoto); } else { this._nextPhoto = nextPhoto;
nextPhoto.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, method); 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, method); 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];
if (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:;",
null, 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; if (view.getPhoto() == photo) self._loadThumb(view, photo); }; zfl_PasswordManager.subscribe(photo.access.realmId,
loader.__zfl_onpassword); } } return false; }; view.onload = onload; view.load(loader); };
; ; ; ; function zfl_PhotoLtRtThLayout(id, global, local) { zfl_PhotoLayout.prototype.constructor.call(this,
id, global, local); var self = this; this._tabs = local.tabs; this._tabs.onselect = function(tab,
selected, init) { self._tabs_onselect(tab, selected, init); }; var exifView = local.exifView; if
(exifView) { this._controls.list.push(exifView); exifView.onresize = this.closure(this.recalc);
} this._hasQpl = local.quickPriceList != null; } zfl_PhotoLtRtThLayout.inherits(zfl_PhotoLayout);
zfl_PhotoLtRtThLayout.prototype.onrecalc = function() { zfl_PhotoLayout.prototype.onrecalc.call(this);
}; zfl_PhotoLtRtThLayout.prototype.onload = function() { this._tabs.init(); zfl_PhotoLayout.prototype.onload.call(this);
}; zfl_PhotoLtRtThLayout.prototype._tabs_onselect = function(tab, selected, init) { if (selected
&& !init) this.recalc(); }; zfl_PhotoLtRtThLayout.prototype._tabs_onstretch = function(height, stretcher)
{ if (this._tabs.get("thumbnails").selected) { var grid = this._grids.photos; var cy = grid.getCellSize().cy;
if (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);
stretcher.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));
info = null; } else { info = grid.getLayoutInfo(zf_PhotoGrid.KeepVisible); } grid.recalcLayout(info);
return true; } else if (this._tabs.get("info").selected) { stretcher.style.height = "0px"; return true;
} return false; };
; ; function zfl_FolderCtrLayout(id, global, local) { if (zf_stdNoArgs(arguments)) return; zfl_FolderLayout.prototype.constructor.call(this,
id, 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) { var grid = this._grids.folder; var cxCell = grid.getCellSize().cx;
var cxWindow = zf_stdGetClientWidth() - 80; var row = Math.floor(cxWindow / cxCell); var width;
if (this._data.folder.length < row) width = this._data.folder.length * cxCell; else width = row *
cxCell; width = Math.max(width, 660); this.dom("gridbox").style.width = width + "px"; } zfl_FolderLayout.prototype.onrecalc.call(this);
};
; ; function zfl_PhotoSetCtrLayout(id, global, local) { if (zf_stdNoArgs(arguments)) return; zfl_PhotoSetLayout.prototype.constructor.call(this,
id, global, local); } 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); };
; ; function zfl_PageSlideshow(id, minWidth, minHeight, maxWidth, maxHeight, staticWidth, staticHeight,
decoration, mode, flashvars, target, photoViewId, photo) { ; ; zfl_Control.prototype.constructor.call(this,
id); this.minWidth = minWidth; this.minHeight = minHeight; this.maxWidth = maxWidth; this.maxHeight
= maxHeight; this.staticWidth = staticWidth; this.staticHeight = staticHeight; this._decoration
= decoration; this._mode = mode; this._flashvars = flashvars; this._target = target; this._extent
= this._decoration.borderSize + this._decoration.shadowSize + this._decoration.extraSize; this._flash
= zf_Flash.installed(9) && mode == zfl_PageSlideshow.Flash; if (this._flash) { this._generateFlash
= true; } else if (mode == zfl_PageSlideshow.EmptyOwner) { this._renderPlaceholder(); } else if
(mode != zfl_PageSlideshow.Empty) { this._static = photo == null; if (photo) { this._photoView = new
zf_PhotoView(photoViewId); this._photo = photo; } } if (!this._generateFlash) this.$(".pv").removeClass("pv-s-init");
this.$(".pv").css("padding", [decoration.borderSize + decoration.shadowSize + "px", decoration.borderSize
+ "px"].join(" ")); zf_stdMakeMethodsDeferred(this, this.id, ["_generate" ]); } zfl_PageSlideshow.inherits(zfl_Control);
zfl_PageSlideshow.Empty = 0; zfl_PageSlideshow.Static = 1; zfl_PageSlideshow.Flash = 2; zfl_PageSlideshow.EmptyOwner
= 3; zfl_PageSlideshow.prototype.resize = function(width, height) { ; ; var extent = this._decoration.borderSize
+ this._decoration.shadowSize; ; if (this._static && this._mode != zfl_PageSlideshow.Empty && this._mode
!= zfl_PageSlideshow.EmptyOwner) { width = this.staticWidth + extent * 2; height = this.staticHeight
+ extent * 2; if (this.minWidth) width = Math.min(width, this.minWidth); ; return { cx: width, cy:
height, cxShadow: this._decoration.shadowSize * 2 }; } var minWidth = zf_ProcessingMethod.StandardSmallSize.cx;
var minHeight = this.minHeight ? this.minHeight : zf_ProcessingMethod.StandardSmallSize.cy; width
-= extent * 2; height -= extent * 2; ; ; width = Math.max(width, minWidth); height = Math.max(height,
minHeight); ; width = Math.min(width, this.maxWidth); height = Math.min(height, this.maxHeight);
; var v = Math.floor(height * this.maxWidth / this.maxHeight); if (v <= width) width = v; 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) { this._photoView.__zfl_method = method; this._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, this.minWidth); ; this.$(".pv-inner").width(width).height(height);
width += extent * 2; height += extent * 2; if (this._decoration.shadowName != null) { this.$(".pv-shadow").remove();
var shadows = zfl_DecorationInfo.getShadowHtml( "pv-shadow", this._decoration.shadowName, this._decoration.shadowType,
this._decoration.shadowSize, -extent, -extent, width, height); this.$(".pv-inner").append(shadows);
} if (this._generateFlash) { this._generateFlash = false; this._generate(); } return { cx: width,
cy: height, cxShadow: this._decoration.shadowSize * 2 }; }; zfl_PageSlideshow.prototype.onClick
= function(id) { ; if (this._target) location.href = zf_stdFormatString(this._target, parseInt(id).toString(16));
}; zfl_PageSlideshow.prototype._generate = function(id) { this.$(".pv").removeClass("pv-s-init");
var inner = this.$(".pv-inner"); var isTransparent = this._flashvars["bgcolor"] == "transparent";
var markup = zf_Flash.createHtml( this.id + "-flash", "pv-img pv-flash", "/zf/code/slideshow/embedded.swf",
this._flashvars, isTransparent, inner.width(), inner.height()); this.$(".pv-img").replaceWith(markup);
; }; zfl_PageSlideshow.prototype._renderPlaceholder = function(id) { var markup = [ '<div class="pv-ph">',
'<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', '</div>',
'</div>', '</div>' ]; this.$(".pv-inner").append(markup.join("")); this.$(".pv-ph a").click(function()
{ zf_stdSetCookie("zf_cv_options", "slideshow", null, true, true); 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; } 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;
if (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,
this.minWidth); return width + this._extent * 2; };
; ; ; function zfl_HomeMenu(id, vertical, maxWidth) { zfl_Control.prototype.constructor.call(this,
id); this.$("a").hover( function() { $(this) .removeClass("homemenu-color2 homemenu-bgcolor2 homemenu-bgimage2")
.addClass("homemenu-color3 homemenu-bgcolor3 homemenu-bgimage3"); }, function() { $(this) .removeClass("homemenu-color3 homemenu-bgcolor3 homemenu-bgimage3")
.addClass("homemenu-color2 homemenu-bgcolor2 homemenu-bgimage2"); } ); this.vertical = vertical;
if (maxWidth) this.setWidth(maxWidth); } zfl_HomeMenu.inherits(zfl_Control); zfl_HomeMenu.prototype.setWidth
= function(maxWidth) { if (maxWidth) { ; var items = this.$("a,.sep"); 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; } else { width += inc; inc =
0; } } } ; width += 2; this.$(".homemenu-inner").width(width); } else { this.$(".homemenu-inner").width("auto");
} };
; ; function zfl_UserPortfolioLayout(id, global, local) { zfl_UserLayout.prototype.constructor.call(this,
id, global, local); this._slideshow = local.slideshow; this._column = local.column; this._padding
= parseInt(this.$().css("paddingLeft")); ; this._slideshowOffset = local.slideshowOffset ? local.slideshowOffset
: 0; var menuOffset = 0; if (local.menuOffset != null) { menuOffset = local.menuOffset; } 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", "normal"); nameWidth = crumbs.find("span").width();
crumbs.width(nameWidth); } menuOffset += nameWidth; } else { menuOffset += local.menulogo.$(".homelogo-logo").width();
} menuOffset += 40; } ; if (local.menu && !local.menu.vertical && local.slideshow) { var minWidth
= this._fixedWidth ? 870 : (995 - this._padding * 2); var slidesOffset = local.slideshowOffset ? local.slideshowOffset
: 0; var slidesWidth; if (this._fixedWidth) slidesWidth = Math.min(810 - slidesOffset, this._slideshow.getMaxWidth());
else slidesWidth = 0; slidesWidth = Math.max(slidesWidth, this._slideshow.getMinWidth()); minWidth
= Math.min(slidesWidth + slidesOffset, minWidth); minWidth -= menuOffset; minWidth = Math.max(0,
minWidth); ; local.menu.setWidth(minWidth); } this.cyMinFooter = 0; } zfl_UserPortfolioLayout.inherits(zfl_UserLayout);
zfl_UserPortfolioLayout.prototype.onrecalc = function() { zfl_UserLayout.prototype.onrecalc.call(this);
}; zfl_UserPortfolioLayout.prototype.onload = function() { zfl_UserLayout.prototype.onload.call(this);
}; zfl_UserPortfolioLayout.prototype._onstretch = function(height, stretcher) { var availWidth = $(this.dom().parentNode).width()
- (this._slideshowOffset + this._padding * 2); var availHeight = height; if (this._fixedWidth)
{ availWidth = Math.min(availWidth, 870 - this._slideshowOffset); availHeight = 10000; } var size
= this._slideshow.resize(availWidth, availHeight); $(this.dom()).width(size.cx - size.cxShadow + this._slideshowOffset);
stretcher.style.minHeight = size.cy + "px"; this.recalcBins(); return true; };
; ; function zfl_RecentFeaturedLayout(id, global, local) { zfl_Layout.prototype.constructor.call(thi
