PageSourceSearch

https://bucksbeekeepers.com/BuiltTheme/kaleidoscope_jelly_beans.v3.0/bdc4d134/Scripts/combined.js

js bucksbeekeepers.com collected 2026-09-27 09:17:48 UTC 526,920 bytes, 5,565 lines download raw bytes

1
2
3/*compiled*/
4/*! jQuery v1.8.2 jquery.com | jquery.org/license v3*/
vendor: 14,535 bytes, lines 4-5
4
5(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d<e;d++)p.event.add(b,c,h[c][d])}g.data&&(g.data=p.extend({},g.data))}function bE(a,b){var c;if(b.nodeType!==1)return;b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?(b.parentNode&&(b.outerHTML=a.outerHTML),p.support.html5Clone&&a.innerHTML&&!p.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):c==="input"&&bv.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text),b.removeAttribute(p.expando)}function bF(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bG(a){bv.test(a.type)&&(a.defaultChecked=a.checked)}function bY(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=bW.length;while(e--){b=bW[e]+c;if(b in a)return b}return d}function bZ(a,b){return a=b||a,p.css(a,"display")==="none"||!p.contains(a.ownerDocument,a)}function b$(a,b){var c,d,e=[],f=0,g=a.length;for(;f<g;f++){c=a[f];if(!c.style)continue;e[f]=p._data(c,"olddisplay"),b?(!e[f]&&c.style.display==="none"&&(c.style.display=""),c.style.display===""&&bZ(c)&&(e[f]=p._data(c,"olddisplay",cc(c.nodeName)))):(d=bH(c,"display"),!e[f]&&d!=="none"&&p._data(c,"olddisplay",d))}for(f=0;f<g;f++){c=a[f];if(!c.style)continue;if(!b||c.style.display==="none"||c.style.display==="")c.style.display=b?e[f]||"":"none"}return a}function b_(a,b,c){var d=bP.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function ca(a,b,c,d){var e=c===(d?"border":"content")?4:b==="width"?1:0,f=0;for(;e<4;e+=2)c==="margin"&&(f+=p.css(a,c+bV[e],!0)),d?(c==="content"&&(f-=parseFloat(bH(a,"padding"+bV[e]))||0),c!=="margin"&&(f-=parseFloat(bH(a,"border"+bV[e]+"Width"))||0)):(f+=parseFloat(bH(a,"padding"+bV[e]))||0,c!=="padding"&&(f+=parseFloat(bH(a,"border"+bV[e]+"Width"))||0));return f}function cb(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=!0,f=p.support.boxSizing&&p.css(a,"boxSizing")==="border-box";if(d<=0||d==null){d=bH(a,b);if(d<0||d==null)d=a.style[b];if(bQ.test(d))return d;e=f&&(p.support.boxSizingReliable||d===a.style[b]),d=parseFloat(d)||0}return d+ca(a,b,c||(f?"border":"content"),e)+"px"}function cc(a){if(bS[a])return bS[a];var b=p("<"+a+">").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write("<!doctype html><html><body>"),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h<i;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function cA(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h,i=a[f],j=0,k=i?i.length:0,l=a===cv;for(;j<k&&(l||!h);j++)h=i[j](c,d,e),typeof h=="string"&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=cA(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=cA(a,c,d,e,"*",g)),h}function cB(a,c){var d,e,f=p.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&p.extend(!0,a,e)}function cC(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);while(j[0]==="*")j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}if(g)return g!==j[0]&&j.unshift(g),d[g]}function cD(a,b){var c,d,e,f,g=a.dataTypes.slice(),h=g[0],i={},j=0;a.dataFilter&&(b=a.dataFilter(b,a.dataType));if(g[1])for(c in a.converters)i[c.toLowerCase()]=a.converters[c];for(;e=g[++j];)if(e!=="*"){if(h!=="*"&&h!==e){c=i[h+" "+e]||i["* "+e];if(!c)for(d in i){f=d.split(" ");if(f[1]===e){c=i[h+" "+f[0]]||i["* "+f[0]];if(c){c===!0?c=i[d]:i[d]!==!0&&(e=f[0],g.splice(j--,0,e));break}}}if(c!==!0)if(c&&a["throws"])b=c(b);else try{b=c(b)}catch(k){return{state:"parsererror",error:c?k:"No conversion from "+h+" to "+e}}}h=e}return{state:"success",data:b}}function cL(){try{return new a.XMLHttpRequest}catch(b){}}function cM(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function cU(){return setTimeout(function(){cN=b},0),cN=p.now()}function cV(a,b){p.each(b,function(b,c){var d=(cT[b]||[]).concat(cT["*"]),e=0,f=d.length;for(;e<f;e++)if(d[e].call(a,b,c))return})}function cW(a,b,c){var d,e=0,f=0,g=cS.length,h=p.Deferred().always(function(){delete i.elem}),i=function(){var b=cN||cU(),c=Math.max(0,j.startTime+j.duration-b),d=1-(c/j.duration||0),e=0,f=j.tweens.length;for(;e<f;e++)j.tweens[e].run(d);return h.notifyWith(a,[j,d,c]),d<1&&f?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:p.extend({},b),opts:p.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:cN||cU(),duration:c.duration,tweens:[],createTween:function(b,c,d){var e=p.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(e),e},stop:function(b){var c=0,d=b?j.tweens.length:0;for(;c<d;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;cX(k,j.opts.specialEasing);for(;e<g;e++){d=cS[e].call(j,a,k,j.opts);if(d)return d}return cV(j,k),p.isFunction(j.opts.start)&&j.opts.start.call(a,j),p.fx.timer(p.extend(i,{anim:j,queue:j.opts.queue,elem:a})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function cX(a,b){var c,d,e,f,g;for(c in a){d=p.camelCase(c),e=b[d],f=a[c],p.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=p.cssHooks[d];if(g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}}function cY(a,b,c){var d,e,f,g,h,i,j,k,l=this,m=a.style,n={},o=[],q=a.nodeType&&bZ(a);c.queue||(j=p._queueHooks(a,"fx"),j.unqueued==null&&(j.unqueued=0,k=j.empty.fire,j.empty.fire=function(){j.unqueued||k()}),j.unqueued++,l.always(function(){l.always(function(){j.unqueued--,p.queue(a,"fx").length||j.empty.fire()})})),a.nodeType===1&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],p.css(a,"display")==="inline"&&p.css(a,"float")==="none"&&(!p.support.inlineBlockNeedsLayout||cc(a.nodeName)==="inline"?m.display="inline-block":m.zoom=1)),c.overflow&&(m.overflow="hidden",p.support.shrinkWrapBlocks||l.done(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b){f=b[d];if(cP.exec(f)){delete b[d];if(f===(q?"hide":"show"))continue;o.push(d)}}g=o.length;if(g){h=p._data(a,"fxshow")||p._data(a,"fxshow",{}),q?p(a).show():l.done(function(){p(a).hide()}),l.done(function(){var b;p.removeData(a,"fxshow",!0);for(b in n)p.style(a,b,n[b])});for(d=0;d<g;d++)e=o[d],i=l.createTween(e,q?h[e]:0),n[e]=h[e]||p.style(a,e),e in h||(h[e]=i.start,q&&(i.end=i.start,i.start=e==="width"||e==="height"?1:0))}}function cZ(a,b,c,d,e){return new cZ.prototype.init(a,b,c,d,e)}function c$(a,b){var c,d={height:a},e=0;b=b?1:0;for(;e<4;e+=2-b)c=bV[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function da(a){return p.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var c,d,e=a.document,f=a.location,g=a.navigator,h=a.jQuery,i=a.$,j=Array.prototype.push,k=Array.prototype.slice,l=Array.prototype.indexOf,m=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=String.prototype.trim,p=function(a,b){return new p.fn.init(a,b,c)},q=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,r=/\S/,s=/\s+/,t=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,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(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i<j;i++)if((a=arguments[i])!=null)for(c in a){d=h[c],e=a[c];if(h===e)continue;k&&e&&(p.isPlainObject(e)||(f=p.isArray(e)))?(f?(f=!1,g=d&&p.isArray(d)?d:[]):g=d&&p.isPlainObject(d)?d:{},h[c]=p.extend(k,g,e)):e!==b&&(h[c]=e)}return h},p.extend({noConflict:function(b){return a.$===p&&(a.$=i),b&&a.jQuery===p&&(a.jQuery=h),p},isReady:!1,readyWait:1,holdReady:function(a){a?p.readyWait++:p.ready(!0)},ready:function(a){if(a===!0?--p.readyWait:p.isReady)return;if(!e.body)return setTimeout(p.ready,1);p.isReady=!0;if(a!==!0&&--p.readyWait>0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f<g;)if(c.apply(a[f++],d)===!1)break}else if(h){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;f<g;)if(c.call(a[f],f,a[f++])===!1)break;return a},trim:o&&!o.call("
5? 
vendor: 78,722 bytes, line 5
5")?function(a){return a==null?"":o.call(a)}:function(a){return a==null?"":(a+"").replace(t,"")},makeArray:function(a,b){var c,d=b||[];return a!=null&&(c=p.type(a),a.length==null||c==="string"||c==="function"||c==="regexp"||p.isWindow(a)?j.call(d,a):p.merge(d,a)),d},inArray:function(a,b,c){var d;if(b){if(l)return l.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=c.length,e=a.length,f=0;if(typeof d=="number")for(;f<d;f++)a[e++]=c[f];else while(c[f]!==b)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;c=!!c;for(;f<g;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],h=0,i=a.length,j=a instanceof p||i!==b&&typeof i=="number"&&(i>0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h<i;h++)e=c(a[h],h,d),e!=null&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),e!=null&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){var d,e,f;return typeof c=="string"&&(d=a[c],c=a,a=d),p.isFunction(a)?(e=k.call(arguments,2),f=function(){return a.apply(c,e.concat(k.call(arguments)))},f.guid=a.guid=a.guid||p.guid++,f):b},access:function(a,c,d,e,f,g,h){var i,j=d==null,k=0,l=a.length;if(d&&typeof d=="object"){for(k in d)p.access(a,c,k,d[k],1,g,e);f=1}else if(e!==b){i=h===b&&p.isFunction(e),j&&(i?(i=c,c=function(a,b,c){return i.call(p(a),c)}):(c.call(a,e),c=null));if(c)for(;k<l;k++)c(a[k],d,i?e.call(a[k],k,c(a[k],d)):e,h);f=1}return f?a:j?c.call(a):l?c(a[0],d):g},now:function(){return(new Date).getTime()}}),p.ready.promise=function(b){if(!d){d=p.Deferred();if(e.readyState==="complete")setTimeout(p.ready,1);else if(e.addEventListener)e.addEventListener("DOMContentLoaded",D,!1),a.addEventListener("load",p.ready,!1);else{e.attachEvent("onreadystatechange",D),a.attachEvent("onload",p.ready);var c=!1;try{c=a.frameElement==null&&e.documentElement}catch(f){}c&&c.doScroll&&function g(){if(!p.isReady){try{c.doScroll("left")}catch(a){return setTimeout(g,50)}p.ready()}}()}}return d.promise(b)},p.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){E["[object "+b+"]"]=b.toLowerCase()}),c=p(e);var F={};p.Callbacks=function(a){a=typeof a=="string"?F[a]||G(a):p.extend({},a);var c,d,e,f,g,h,i=[],j=!a.once&&[],k=function(b){c=a.memory&&b,d=!0,h=f||0,f=0,g=i.length,e=!0;for(;i&&h<g;h++)if(i[h].apply(b[0],b[1])===!1&&a.stopOnFalse){c=!1;break}e=!1,i&&(j?j.length&&k(j.shift()):c?i=[]:l.disable())},l={add:function(){if(i){var b=i.length;(function d(b){p.each(b,function(b,c){var e=p.type(c);e==="function"&&(!a.unique||!l.has(c))?i.push(c):c&&c.length&&e!=="string"&&d(c)})})(arguments),e?g=i.length:c&&(f=b,k(c))}return this},remove:function(){return i&&p.each(arguments,function(a,b){var c;while((c=p.inArray(b,i,c))>-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return a!=null?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b<d;b++)c[b]&&p.isFunction(c[b].promise)?c[b].promise().done(g(b,j,c)).fail(f.reject).progress(g(b,i,h)):--e}return e||f.resolveWith(j,c),f.promise()}}),p.support=function(){var b,c,d,f,g,h,i,j,k,l,m,n=e.createElement("div");n.setAttribute("className","t"),n.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="<div></div>",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||p.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e<f;e++)delete d[b[e]];if(!(c?K:p.isEmptyObject)(d))return}}if(!c){delete h[i].data;if(!K(h[i]))return}g?p.cleanData([a],!0):p.support.deleteExpando||h!=h.window?delete h[i]:h[i]=null},_data:function(a,b,c){return p.data(a,b,c,!0)},acceptData:function(a){var b=a.nodeName&&p.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),p.fn.extend({data:function(a,c){var d,e,f,g,h,i=this[0],j=0,k=null;if(a===b){if(this.length){k=p.data(i);if(i.nodeType===1&&!p._data(i,"parsedAttrs")){f=i.attributes;for(h=f.length;j<h;j++)g=f[j].name,g.indexOf("data-")||(g=p.camelCase(g.substring(5)),J(i,g,k[g]));p._data(i,"parsedAttrs",!0)}}return k}return typeof a=="object"?this.each(function(){p.data(this,a)}):(d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!",p.access(this,function(c){if(c===b)return k=this.triggerHandler("getData"+e,[d[0]]),k===b&&i&&(k=p.data(i,a),k=J(i,a,k)),k===b&&d[1]?this.data(d[0]):k;d[1]=c,this.each(function(){var b=p(this);b.triggerHandler("setData"+e,d),p.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length<d?p.queue(this[0],a):c===b?this:this.each(function(){var b=p.queue(this,a,c);p._queueHooks(this,a),a==="fx"&&b[0]!=="inprogress"&&p.dequeue(this,a)})},dequeue:function(a){return this.each(function(){p.dequeue(this,a)})},delay:function(a,b){return a=p.fx?p.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){var d,e=1,f=p.Deferred(),g=this,h=this.length,i=function(){--e||f.resolveWith(g,[g])};typeof a!="string"&&(c=a,a=b),a=a||"fx";while(h--)d=p._data(g[h],a+"queueHooks"),d&&d.empty&&(e++,d.empty.add(i));return i(),f.promise(c)}});var L,M,N,O=/[\t\r\n]/g,P=/\r/g,Q=/^(?:button|input)$/i,R=/^(?:button|input|object|select|textarea)$/i,S=/^a(?:rea|)$/i,T=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,U=p.support.getSetAttribute;p.fn.extend({attr:function(a,b){return p.access(this,p.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{f=" "+e.className+" ";for(g=0,h=b.length;g<h;g++)f.indexOf(" "+b[g]+" ")<0&&(f+=b[g]+" ");e.className=p.trim(f)}}}return this},removeClass:function(a){var c,d,e,f,g,h,i;if(p.isFunction(a))return this.each(function(b){p(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(s);for(h=0,i=this.length;h<i;h++){e=this[h];if(e.nodeType===1&&e.className){d=(" "+e.className+" ").replace(O," ");for(f=0,g=c.length;f<g;f++)while(d.indexOf(" "+c[f]+" ")>=0)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(O," ").indexOf(b)>=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c<d;c++){e=h[c];if(e.selected&&(p.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!p.nodeName(e.parentNode,"optgroup"))){b=p(e).val();if(i)return b;g.push(b)}}return i&&!g.length&&h.length?p(h[f]).val():g},set:function(a,b){var c=p.makeArray(b);return p(a).find("option").each(function(){this.selected=p.inArray(p(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g<d.length;g++)e=d[g],e&&(c=p.propFix[e]||e,f=T.test(e),f||p.attr(a,e,""),a.removeAttribute(U?e:c),f&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(Q.test(a.nodeName)&&a.parentNode)p.error("type property can't be changed");else if(!p.support.radioValue&&b==="radio"&&p.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return L&&p.nodeName(a,"button")?L.get(a,b):b in a?a.value:null},set:function(a,b,c){if(L&&p.nodeName(a,"button"))return L.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g,h=a.nodeType;if(!a||h===3||h===8||h===2)return;return g=h!==1||!p.isXMLDoc(a),g&&(c=p.propFix[c]||c,f=p.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&(e=f.get(a,c))!==null?e:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):R.test(a.nodeName)||S.test(a.nodeName)&&a.href?0:b}}}}),M={get:function(a,c){var d,e=p.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;return b===!1?p.removeAttr(a,c):(d=p.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},U||(N={name:!0,id:!0,coords:!0},L=p.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(N[c]?d.value!=="":d.specified)?d.value:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=e.createAttribute(c),a.setAttributeNode(d)),d.value=b+""}},p.each(["width","height"],function(a,b){p.attrHooks[b]=p.extend(p.attrHooks[b],{set:function(a,c){if(c==="")return a.setAttribute(b,"auto"),c}})}),p.attrHooks.contenteditable={get:L.get,set:function(a,b,c){b===""&&(b="false"),L.set(a,b,c)}}),p.support.hrefNormalized||p.each(["href","src","width","height"],function(a,c){p.attrHooks[c]=p.extend(p.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),p.support.style||(p.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=b+""}}),p.support.optSelected||(p.propHooks.selected=p.extend(p.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),p.support.enctype||(p.propFix.enctype="encoding"),p.support.checkOn||p.each(["radio","checkbox"],function(){p.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),p.each(["radio","checkbox"],function(){p.valHooks[this]=p.extend(p.valHooks[this],{set:function(a,b){if(p.isArray(b))return a.checked=p.inArray(p(a).val(),b)>=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j<c.length;j++){k=W.exec(c[j])||[],l=k[1],m=(k[2]||"").split(".").sort(),r=p.event.special[l]||{},l=(f?r.delegateType:r.bindType)||l,r=p.event.special[l]||{},n=p.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,needsContext:f&&p.expr.match.needsContext.test(f),namespace:m.join(".")},o),q=i[l];if(!q){q=i[l]=[],q.delegateCount=0;if(!r.setup||r.setup.call(a,e,m,h)===!1)a.addEventListener?a.addEventListener(l,h,!1):a.attachEvent&&a.attachEvent("on"+l,h)}r.add&&(r.add.call(a,n),n.handler.guid||(n.handler.guid=d.guid)),f?q.splice(q.delegateCount++,0,n):q.push(n),p.event.global[l]=!0}a=null},global:{},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,q,r=p.hasData(a)&&p._data(a);if(!r||!(m=r.events))return;b=p.trim(_(b||"")).split(" ");for(f=0;f<b.length;f++){g=W.exec(b[f])||[],h=i=g[1],j=g[2];if(!h){for(h in m)p.event.remove(a,h+b[f],c,d,!0);continue}n=p.event.special[h]||{},h=(d?n.delegateType:n.bindType)||h,o=m[h]||[],k=o.length,j=j?new RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(l=0;l<o.length;l++)q=o[l],(e||i===q.origType)&&(!c||c.guid===q.guid)&&(!j||j.test(q.namespace))&&(!d||d===q.selector||d==="**"&&q.selector)&&(o.splice(l--,1),q.selector&&o.delegateCount--,n.remove&&n.remove.call(a,q));o.length===0&&k!==o.length&&((!n.teardown||n.teardown.call(a,j,r.handle)===!1)&&p.removeEvent(a,h,r.handle),delete m[h])}p.isEmptyObject(m)&&(delete r.handle,p.removeData(a,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,f,g){if(!f||f.nodeType!==3&&f.nodeType!==8){var h,i,j,k,l,m,n,o,q,r,s=c.type||c,t=[];if($.test(s+p.event.triggered))return;s.indexOf("!")>=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j<q.length&&!c.isPropagationStopped();j++)k=q[j][0],c.type=q[j][1],o=(p._data(k,"events")||{})[c.type]&&p._data(k,"handle"),o&&o.apply(k,d),o=m&&k[m],o&&p.acceptData(k)&&o.apply&&o.apply(k,d)===!1&&c.preventDefault();return c.type=s,!g&&!c.isDefaultPrevented()&&(!n._default||n._default.apply(f.ownerDocument,d)===!1)&&(s!=="click"||!p.nodeName(f,"a"))&&p.acceptData(f)&&m&&f[s]&&(s!=="focus"&&s!=="blur"||c.target.offsetWidth!==0)&&!p.isWindow(f)&&(l=f[m],l&&(f[m]=null),p.event.triggered=s,f[s](),p.event.triggered=b,l&&(f[m]=l)),c.result}return},dispatch:function(c){c=p.event.fix(c||a.event);var d,e,f,g,h,i,j,l,m,n,o=(p._data(this,"events")||{})[c.type]||[],q=o.delegateCount,r=k.call(arguments),s=!c.exclusive&&!c.namespace,t=p.event.special[c.type]||{},u=[];r[0]=c,c.delegateTarget=this;if(t.preDispatch&&t.preDispatch.call(this,c)===!1)return;if(q&&(!c.button||c.type!=="click"))for(f=c.target;f!=this;f=f.parentNode||this)if(f.disabled!==!0||c.type!=="click"){h={},j=[];for(d=0;d<q;d++)l=o[d],m=l.selector,h[m]===b&&(h[m]=l.needsContext?p(m,this).index(f)>=0:p.find(m,this,null,[f]).length),h[m]&&j.push(l);j.length&&u.push({elem:f,matches:j})}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d<u.length&&!c.isPropagationStopped();d++){i=u[d],c.currentTarget=i.elem;for(e=0;e<i.matches.length&&!c.isImmediatePropagationStopped();e++){l=i.matches[e];if(s||!c.namespace&&!l.namespace||c.namespace_re&&c.namespace_re.test(l.namespace))c.data=l.data,c.handleObj=l,g=((p.event.special[l.origType]||{}).handle||l.handler).apply(i.elem,r),g!==b&&(c.result=g,g===!1&&(c.preventDefault(),c.stopPropagation()))}}return t.postDispatch&&t.postDispatch.call(this,c),c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,f,g,h=c.button,i=c.fromElement;return a.pageX==null&&c.clientX!=null&&(d=a.target.ownerDocument||e,f=d.documentElement,g=d.body,a.pageX=c.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=c.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?c.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0),a}},fix:function(a){if(a[p.expando])return a;var b,c,d=a,f=p.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=p.Event(d);for(b=g.length;b;)c=g[--b],a[c]=d[c];return a.target||(a.target=d.srcElement||e),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,f.filter?f.filter(a,d):a},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){p.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=p.extend(new p.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?p.event.trigger(e,null,b):p.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},p.event.handle=p.event.dispatch,p.removeEvent=e.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]=="undefined"&&(a[d]=null),a.detachEvent(d,c))},p.Event=function(a,b){if(this instanceof p.Event)a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?bb:ba):this.type=a,b&&p.extend(this,b),this.timeStamp=a&&a.timeStamp||p.now(),this[p.expando]=!0;else return new p.Event(a,b)},p.Event.prototype={preventDefault:function(){this.isDefaultPrevented=bb;var a=this.originalEvent;if(!a)return;a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=bb;var a=this.originalEvent;if(!a)return;a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()},isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba},p.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){p.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj,g=f.selector;if(!e||e!==d&&!p.contains(d,e))a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b;return c}}}),p.support.submitBubbles||(p.event.special.submit={setup:function(){if(p.nodeName(this,"form"))return!1;p.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=p.nodeName(c,"input")||p.nodeName(c,"button")?c.form:b;d&&!p._data(d,"_submit_attached")&&(p.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),p._data(d,"_submit_attached",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&p.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(p.nodeName(this,"form"))return!1;p.event.remove(this,"._submit")}}),p.support.changeBubbles||(p.event.special.change={setup:function(){if(V.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")p.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),p.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),p.event.simulate("change",this,a,!0)});return!1}p.event.add(this,"beforeactivate._change",function(a){var b=a.target;V.test(b.nodeName)&&!p._data(b,"_change_attached")&&(p.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&p.event.simulate("change",this.parentNode,a,!0)}),p._data(b,"_change_attached",!0))})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){return p.event.remove(this,"._change"),!V.test(this.nodeName)}}),p.support.focusinBubbles||p.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){p.event.simulate(b,a.target,p.event.fix(a),!0)};p.event.special[b]={setup:function(){c++===0&&e.addEventListener(a,d,!0)},teardown:function(){--c===0&&e.removeEventListener(a,d,!0)}}}),p.fn.extend({on:function(a,c,d,e,f){var g,h;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(h in a)this.on(h,c,d,a[h],f);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=ba;else if(!e)return this;return f===1&&(g=e,e=function(a){return p().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=p.guid++)),this.each(function(){p.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,p(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if(typeof a=="object"){for(f in a)this.off(f,c,a[f]);return this}if(c===!1||typeof c=="function")d=c,c=b;return d===!1&&(d=ba),this.each(function(){p.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){return p(this.context).on(a,this.selector,b,c),this},die:function(a,b){return p(this.context).off(a,this.selector||"**",b),this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length===1?this.off(a,"**"):this.off(b,a||"**",c)},trigger:function(a,b){return this.each(function(){p.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return p.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||p.guid++,d=0,e=function(c){var e=(p._data(this,"lastToggle"+a.guid)||0)%d;return p._data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),p.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){p.fn[b]=function(a,c){return c==null&&(c=a,a=null),arguments.length>0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bc(a,b,c,d){c=c||[],b=b||r;var e,f,i,j,k=b.nodeType;if(!a||typeof a!="string")return c;if(k!==1&&k!==9)return[];i=g(b);if(!i&&!d)if(e=P.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&h(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return w.apply(c,x.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&_&&b.getElementsByClassName)return w.apply(c,x.call(b.getElementsByClassName(j),0)),c}return bp(a.replace(L,"$1"),b,c,d,i)}function bd(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function be(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bf(a){return z(function(b){return b=+b,z(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function bg(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bh(a,b){var c,d,f,g,h,i,j,k=C[o][a];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){if(!c||(d=M.exec(h)))d&&(h=h.slice(d[0].length)),i.push(f=[]);c=!1;if(d=N.exec(h))f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=d[0].replace(L," ");for(g in e.filter)(d=W[g].exec(h))&&(!j[g]||(d=j[g](d,r,!0)))&&(f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=g,c.matches=d);if(!c)break}return b?h.length:h?bc.error(a):C(a,i).slice(0)}function bi(a,b,d){var e=b.dir,f=d&&b.dir==="parentNode",g=u++;return b.first?function(b,c,d){while(b=b[e])if(f||b.nodeType===1)return a(b,c,d)}:function(b,d,h){if(!h){var i,j=t+" "+g+" ",k=j+c;while(b=b[e])if(f||b.nodeType===1){if((i=b[o])===k)return b.sizset;if(typeof i=="string"&&i.indexOf(j)===0){if(b.sizset)return b}else{b[o]=k;if(a(b,d,h))return b.sizset=!0,b;b.sizset=!1}}}else while(b=b[e])if(f||b.nodeType===1)if(a(b,d,h))return b}}function bj(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function bk(a,b,c,d,e){var f,g=[],h=0,i=a.length,j=b!=null;for(;h<i;h++)if(f=a[h])if(!c||c(f,d,e))g.push(f),j&&b.push(h);return g}function bl(a,b,c,d,e,f){return d&&!d[o]&&(d=bl(d)),e&&!e[o]&&(e=bl(e,f)),z(function(f,g,h,i){if(f&&e)return;var j,k,l,m=[],n=[],o=g.length,p=f||bo(b||"*",h.nodeType?[h]:h,[],f),q=a&&(f||!b)?bk(p,m,a,h,i):p,r=c?e||(f?a:o||d)?[]:g:q;c&&c(q,r,h,i);if(d){l=bk(r,n),d(l,[],h,i),j=l.length;while(j--)if(k=l[j])r[n[j]]=!(q[n[j]]=k)}if(f){j=a&&r.length;while(j--)if(k=r[j])f[m[j]]=!(g[m[j]]=k)}else r=bk(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):w.apply(g,r)})}function bm(a){var b,c,d,f=a.length,g=e.relative[a[0].type],h=g||e.relative[" "],i=g?1:0,j=bi(function(a){return a===b},h,!0),k=bi(function(a){return y.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==l)||((b=c).nodeType?j(a,c,d):k(a,c,d))}];for(;i<f;i++)if(c=e.relative[a[i].type])m=[bi(bj(m),c)];else{c=e.filter[a[i].type].apply(null,a[i].matches);if(c[o]){d=++i;for(;d<f;d++)if(e.relative[a[d].type])break;return bl(i>1&&bj(m),i>1&&a.slice(0,i-1).join("").replace(L,"$1"),c,i<d&&bm(a.slice(i,d)),d<f&&bm(a=a.slice(d)),d<f&&a.join(""))}m.push(c)}return bj(m)}function bn(a,b){var d=b.length>0,f=a.length>0,g=function(h,i,j,k,m){var n,o,p,q=[],s=0,u="0",x=h&&[],y=m!=null,z=l,A=h||f&&e.find.TAG("*",m&&i.parentNode||i),B=t+=z==null?1:Math.E;y&&(l=i!==r&&i,c=g.el);for(;(n=A[u])!=null;u++){if(f&&n){for(o=0;p=a[o];o++)if(p(n,i,j)){k.push(n);break}y&&(t=B,c=++g.el)}d&&((n=!p&&n)&&s--,h&&x.push(n))}s+=u;if(d&&u!==s){for(o=0;p=b[o];o++)p(x,q,i,j);if(h){if(s>0)while(u--)!x[u]&&!q[u]&&(q[u]=v.call(k));q=bk(q)}w.apply(k,q),y&&!h&&q.length>0&&s+b.length>1&&bc.uniqueSort(k)}return y&&(t=B,l=z),x};return g.el=0,d?z(g):g}function bo(a,b,c,d){var e=0,f=b.length;for(;e<f;e++)bc(a,b[e],c,d);return c}function bp(a,b,c,d,f){var g,h,j,k,l,m=bh(a),n=m.length;if(!d&&m.length===1){h=m[0]=m[0].slice(0);if(h.length>2&&(j=h[0]).type==="ID"&&b.nodeType===9&&!f&&e.relative[h[1].type]){b=e.find.ID(j.matches[0].replace(V,""),b,f)[0];if(!b)return c;a=a.slice(h.shift().length)}for(g=W.POS.test(a)?-1:h.length-1;g>=0;g--){j=h[g];if(e.relative[k=j.type])break;if(l=e.find[k])if(d=l(j.matches[0].replace(V,""),R.test(h[0].type)&&b.parentNode||b,f)){h.splice(g,1),a=d.length&&h.join("");if(!a)return w.apply(c,x.call(d,0)),c;break}}}return i(a,m)(d,b,f,c,R.test(a)),c}function bq(){}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=String,r=a.document,s=r.documentElement,t=0,u=0,v=[].pop,w=[].push,x=[].slice,y=[].indexOf||function(a){var b=0,c=this.length;for(;b<c;b++)if(this[b]===a)return b;return-1},z=function(a,b){return a[o]=b==null||b,a},A=function(){var a={},b=[];return z(function(c,d){return b.push(c)>e.cacheLength&&delete a[b.shift()],a[c]=d},a)},B=A(),C=A(),D=A(),E="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",G=F.replace("w","w#"),H="([*^$|!~]?=)",I="\\["+E+"*("+F+")"+E+"*(?:"+H+E+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+G+")|)|)"+E+"*\\]",J=":("+F+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+I+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)",L=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g"),M=new RegExp("^"+E+"*,"+E+"*"),N=new RegExp("^"+E+"*([\\x20\\t\\r\\n\\f>+~])"+E+"*"),O=new RegExp(J),P=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Q=/^:not/,R=/[\x20\t\r\n\f]*[+~]/,S=/:not\($/,T=/h\d/i,U=/input|select|textarea|button/i,V=/\\(?!\\)/g,W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+J),POS:new RegExp(K,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),needsContext:new RegExp("^"+E+"*[>+~]|"+K,"i")},X=function(a){var b=r.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},Y=X(function(a){return a.appendChild(r.createComment("")),!a.getElementsByTagName("*").length}),Z=X(function(a){return a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),$=X(function(a){a.innerHTML="<select></select>";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),_=X(function(a){return a.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),ba=X(function(a){a.id=o+0,a.innerHTML="<a name='"+o+"'></a><div name='"+o+"'></div>",s.insertBefore(a,s.firstChild);var b=r.getElementsByName&&r.getElementsByName(o).length===2+r.getElementsByName(o+0).length;return d=!r.getElementById(o),s.removeChild(a),b});try{x.call(s.childNodes,0)[0].nodeType}catch(bb){x=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}bc.matches=function(a,b){return bc(a,null,null,b)},bc.matchesSelector=function(a,b){return bc(b,null,null,[a]).length>0},f=bc.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=f(b);return c},g=bc.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},h=bc.contains=s.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:s.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc.attr=function(a,b){var c,d=g(a);return d||(b=b.toLowerCase()),(c=e.attrHandle[b])?c(a):d||$?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},e=bc.selectors={cacheLength:50,createPseudo:z,match:W,attrHandle:Z?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:d?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:Y?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:ba&&function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:_&&function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(V,""),a[3]=(a[4]||a[5]||"").replace(V,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||bc.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&bc.error(a[0]),a},PSEUDO:function(a){var b,c;if(W.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(b=a[4])O.test(b)&&(c=bh(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b;return a.slice(0,3)}},filter:{ID:d?function(a){return a=a.replace(V,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(V,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(V,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=B[o][a];return b||(b=B(a,new RegExp("(^|"+E+")"+a+"("+E+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return function(d,e){var f=bc.attr(d,a);return f==null?b==="!=":b?(f+="",b==="="?f===c:b==="!="?f!==c:b==="^="?c&&f.indexOf(c)===0:b==="*="?c&&f.indexOf(c)>-1:b==="$="?c&&f.substr(f.length-c.length)===c:b==="~="?(" "+f+" ").indexOf(c)>-1:b==="|="?f===c||f.substr(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d){return a==="nth"?function(a){var b,e,f=a.parentNode;if(c===1&&d===0)return!0;if(f){e=0;for(b=f.firstChild;b;b=b.nextSibling)if(b.nodeType===1){e++;if(a===b)break}}return e-=d,e===c||e%c===0&&e/c>=0}:function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||bc.error("unsupported pseudo: "+a);return d[o]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?z(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=y.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:z(function(a){var b=[],c=[],d=i(a.replace(L,"$1"));return d[o]?z(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)if(f=g[h])a[h]=!(b[h]=f)}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:z(function(a){return function(b){return bc(a,b).length>0}}),contains:z(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!e.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},header:function(a){return T.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:bd("radio"),checkbox:bd("checkbox"),file:bd("file"),password:bd("password"),image:bd("image"),submit:be("submit"),reset:be("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return U.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement},first:bf(function(a,b,c){return[0]}),last:bf(function(a,b,c){return[b-1]}),eq:bf(function(a,b,c){return[c<0?c+b:c]}),even:bf(function(a,b,c){for(var d=0;d<b;d+=2)a.push(d);return a}),odd:bf(function(a,b,c){for(var d=1;d<b;d+=2)a.push(d);return a}),lt:bf(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:bf(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},j=s.compareDocumentPosition?function(a,b){return a===b?(k=!0,0):(!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition:a.compareDocumentPosition(b)&4)?-1:1}:function(a,b){if(a===b)return k=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,h=b.parentNode,i=g;if(g===h)return bg(a,b);if(!g)return-1;if(!h)return 1;while(i)e.unshift(i),i=i.parentNode;i=h;while(i)f.unshift(i),i=i.parentNode;c=e.length,d=f.length;for(var j=0;j<c&&j<d;j++)if(e[j]!==f[j])return bg(e[j],f[j]);return j===c?bg(a,f[j],-1):bg(e[j],b,1)},[0,0].sort(j),m=!k,bc.uniqueSort=function(a){var b,c=1;k=m,a.sort(j);if(k)for(;b=a[c];c++)b===a[c-1]&&a.splice(c--,1);return a},bc.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},i=bc.compile=function(a,b){var c,d=[],e=[],f=D[o][a];if(!f){b||(b=bh(a)),c=b.length;while(c--)f=bm(b[c]),f[o]?d.push(f):e.push(f);f=D(a,bn(e,d))}return f},r.querySelectorAll&&function(){var a,b=bp,c=/'|\\/g,d=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,e=[":focus"],f=[":active",":focus"],h=s.matchesSelector||s.mozMatchesSelector||s.webkitMatchesSelector||s.oMatchesSelector||s.msMatchesSelector;X(function(a){a.innerHTML="<select><option selected=''></option></select>",a.querySelectorAll("[selected]").length||e.push("\\["+E+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),X(function(a){a.innerHTML="<p test=''></p>",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+E+"*(?:\"\"|'')"),a.innerHTML="<input type='hidden'/>",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=new RegExp(e.join("|")),bp=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a))){var i,j,k=!0,l=o,m=d,n=d.nodeType===9&&a;if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){i=bh(a),(k=d.getAttribute("id"))?l=k.replace(c,"\\$&"):d.setAttribute("id",l),l="[id='"+l+"'] ",j=i.length;while(j--)i[j]=l+i[j].join("");m=R.test(a)&&d.parentNode||d,n=i.join(",")}if(n)try{return w.apply(f,x.call(m.querySelectorAll(n),0)),f}catch(p){}finally{k||d.removeAttribute("id")}}return b(a,d,f,g,h)},h&&(X(function(b){a=h.call(b,"div");try{h.call(b,"[test!='']:sizzle"),f.push("!=",J)}catch(c){}}),f=new RegExp(f.join("|")),bc.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!g(b)&&!f.test(c)&&(!e||!e.test(c)))try{var i=h.call(b,c);if(i||a||b.document&&b.document.nodeType!==11)return i}catch(j){}return bc(c,null,null,[b]).length>0})}(),e.pseudos.nth=e.pseudos.eq,e.filters=bq.prototype=e.pseudos,e.setFilters=new bq,bc.attr=p.attr,p.find=bc,p.expr=bc.selectors,p.expr[":"]=p.expr.pseudos,p.unique=bc.uniqueSort,p.text=bc.getText,p.isXMLDoc=bc.isXML,p.contains=bc.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b<c;b++)if(p.contains(h[b],this))return!0});g=this.pushStack("","find",a);for(b=0,c=this.length;b<c;b++){d=g.length,p.find(a,this[b],g);if(b>0)for(e=d;e<g.length;e++)for(f=0;f<d;f++)if(g[f]===g[e]){g.splice(e--,1);break}}return g},has:function(a){var b,c=p(a,this),d=c.length;return this.filter(function(){for(b=0;b<d;b++)if(p.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(bj(this,a,!1),"not",a)},filter:function(a){return this.pushStack(bj(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?bf.test(a)?p(a,this.context).index(this[0])>=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d<e;d++){c=this[d];while(c&&c.ownerDocument&&c!==b&&c.nodeType!==11){if(g?g.index(c)>-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/<tbody/i,br=/<|&#?\w+;/,bs=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,bu=new RegExp("<(?:"+bl+")[\\s/>]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,bz={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,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X<div>","</div>"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return bh(this[0])?this.length?this.pushStack(p(p.isFunction(a)?a():a),"replaceWith",a):this:p.isFunction(a)?this.each(function(b){var c=p(this),d=c.html();c.replaceWith(a.call(this,b,d))}):(typeof a!="string"&&(a=p(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;p(this).remove(),b?p(b).before(a):p(c).append(a)}))},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=[].concat.apply([],a);var e,f,g,h,i=0,j=a[0],k=[],l=this.length;if(!p.support.checkClone&&l>1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i<l;i++)d.call(c&&p.nodeName(this[i],"table")?bC(this[i],"tbody"):this[i],i===h?g:p.clone(g,!0,!0))}g=f=null,k.length&&p.each(k,function(a,b){b.src?p.ajax?p.ajax({url:b.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):p.error("no ajax"):p.globalEval((b.text||b.textContent||b.innerHTML||"").replace(by,"")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),p.buildFragment=function(a,c,d){var f,g,h,i=a[0];return c=c||e,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,a.length===1&&typeof i=="string"&&i.length<512&&c===e&&i.charAt(0)==="<"&&!bt.test(i)&&(p.support.checkClone||!bw.test(i))&&(p.support.html5Clone||!bu.test(i))&&(g=!0,f=p.fragments[i],h=f!==b),f||(f=c.createDocumentFragment(),p.clean(a,c,f,d),g&&(p.fragments[i]=h&&f)),{fragment:f,cacheable:g}},p.fragments={},p.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){p.fn[a]=function(c){var d,e=0,f=[],g=p(c),h=g.length,i=this.length===1&&this[0].parentNode;if((i==null||i&&i.nodeType===11&&i.childNodes.length===1)&&h===1)return g[b](this[0]),this;for(;e<h;e++)d=(e>0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1></$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]==="<table>"&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,cs=/([?&])_=[^&]*/,ct=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,cu=p.fn.load,cv={},cw={},cx=["*/"]+["*"];try{ck=f.href}catch(cy){ck=e.createElement("a"),ck.href="",ck=ck.href}cj=ct.exec(ck.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&cu)return cu.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):c&&typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("<div>").append(a.replace(cr,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cB(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cB(a,b),a},ajaxSettings:{url:ck,isLocal:cn.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cx},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cz(cv),ajaxTransport:cz(cw),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cC(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cD(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=(c||y)+"",k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cm.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(cl,"").replace(cp,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=ct.exec(l.url.toLowerCase())||!1,l.crossDomain=i&&i.join(":")+(i[3]?"":i[1]==="http:"?80:443)!==cj.join(":")+(cj[3]?"":cj[1]==="http:"?80:443)),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cA(cv,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!co.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cq.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cs,"$1_="+z);l.url=A+(A===l.url?(cq.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cx+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cA(cw,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cE=[],cF=/\?/,cG=/(=)\?(?=&|$)|\?\?/,cH=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cE.pop()||p.expando+"_"+cH++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cG.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cG.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cG,"$1"+f):m?c.data=i.replace(cG,"$1"+f):k&&(c.url+=(cF.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cE.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cI,cJ=a.ActiveXObject?function(){for(var a in cI)cI[a](0,1)}:!1,cK=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cL()||cM()}:cL,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cJ&&delete cI[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cK,cJ&&(cI||(cI={},p(a).unload(cJ)),cI[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cN,cO,cP=/^(?:toggle|show|hide)$/,cQ=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cR=/queueHooks$/,cS=[cY],cT={"*":[function(a,b){var c,d,e=this.createTween(a,b),f=cQ.exec(b),g=e.cur(),h=+g||0,i=1,j=20;if(f){c=+f[2],d=f[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&h){h=p.css(e.elem,a,!0)||c||1;do i=i||".5",h=h/i,p.style(e.elem,a,h+d);while(i!==(i=e.cur()/g)&&i!==1&&--j)}e.unit=d,e.start=h,e.end=f[1]?h+(f[1]+1)*c:c}return e}]};p.Animation=p.extend(cW,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d<e;d++)c=a[d],cT[c]=cT[c]||[],cT[c].unshift(b)},prefilter:function(a,b){b?cS.unshift(a):cS.push(a)}}),p.Tween=cZ,cZ.prototype={constructor:cZ,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(p.cssNumber[c]?"":"px")},cur:function(){var a=cZ.propHooks[this.prop];return a&&a.get?a.get(this):cZ.propHooks._default.get(this)},run:function(a){var b,c=cZ.propHooks[this.prop];return this.options.duration?this.pos=b=p.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):cZ.propHooks._default.set(this),this}},cZ.prototype.init.prototype=cZ.prototype,cZ.propHooks={_default:{get:function(a){var b;return a.elem[a.prop]==null||!!a.elem.style&&a.elem.style[a.prop]!=null?(b=p.css(a.elem,a.prop,!1,""),!b||b==="auto"?0:b):a.elem[a.prop]},set:function(a){p.fx.step[a.prop]?p.fx.step[a.prop](a):a.elem.style&&(a.elem.style[p.cssProps[a.prop]]!=null||p.cssHooks[a.prop])?p.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},cZ.propHooks.scrollTop=cZ.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},p.each(["toggle","show","hide"],function(a,b){var c=p.fn[b];p.fn[b]=function(d,e,f){return d==null||typeof d=="boolean"||!a&&p.isFunction(d)&&p.isFunction(e)?c.apply(this,arguments):this.animate(c$(b,!0),d,e,f)}}),p.fn.extend({fadeTo:function(a,b,c,d){return this.filter(bZ).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=p.isEmptyObject(a),f=p.speed(b,c,d),g=function(){var b=cW(this,p.extend({},a),f);e&&b.stop(!0)};return e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){var e=function(a){var b=a.stop;delete a.stop,b(d)};return typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,c=a!=null&&a+"queueHooks",f=p.timers,g=p._data(this);if(c)g[c]&&g[c].stop&&e(g[c]);else for(c in g)g[c]&&g[c].stop&&cR.test(c)&&e(g[c]);for(c=f.length;c--;)f[c].elem===this&&(a==null||f[c].queue===a)&&(f[c].anim.stop(d),b=!1,f.splice(c,1));(b||!d)&&p.dequeue(this,a)})}}),p.each({slideDown:c$("show"),slideUp:c$("hide"),slideToggle:c$("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){p.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),p.speed=function(a,b,c){var d=a&&typeof a=="object"?p.extend({},a):{complete:c||!c&&b||p.isFunction(a)&&a,duration:a,easing:c&&b||b&&!p.isFunction(b)&&b};d.duration=p.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in p.fx.speeds?p.fx.speeds[d.duration]:p.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";return d.old=d.complete,d.complete=function(){p.isFunction(d.old)&&d.old.call(this),d.queue&&p.dequeue(this,d.queue)},d},p.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},p.timers=[],p.fx=cZ.prototype.init,p.fx.tick=function(){var a,b=p.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||p.fx.stop()},p.fx.timer=function(a){a()&&p.timers.push(a)&&!cO&&(cO=setInterval(p.fx.tick,p.fx.interval))},p.fx.interval=13,p.fx.stop=function(){clearInterval(cO),cO=null},p.fx.speeds={slow:600,fast:200,_default:400},p.fx.step={},p.expr&&p.expr.filters&&(p.expr.filters.animated=function(a){return p.grep(p.timers,function(b){return a===b.elem}).length});var c_=/^(?:body|html)$/i;p.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){p.offset.setOffset(this,a,b)});var c,d,e,f,g,h,i,j={top:0,left:0},k=this[0],l=k&&k.ownerDocument;if(!l)return;return(d=l.body)===k?p.offset.bodyOffset(k):(c=l.documentElement,p.contains(c,k)?(typeof k.getBoundingClientRect!="undefined"&&(j=k.getBoundingClientRect()),e=da(l),f=c.clientTop||d.clientTop||0,g=c.clientLeft||d.clientLeft||0,h=e.pageYOffset||c.scrollTop,i=e.pageXOffset||c.scrollLeft,{top:j.top+h-f,left:j.left+i-g}):j)},p.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;return p.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(p.css(a,"marginTop"))||0,c+=parseFloat(p.css(a,"marginLeft"))||0),{top:b,left:c}},setOffset:function(a,b,c){var d=p.css(a,"position");d==="static"&&(a.style.position="relative");var e=p(a),f=e.offset(),g=p.css(a,"top"),h=p.css(a,"left"),i=(d==="absolute"||d==="fixed")&&p.inArray("auto",[g,h])>-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c_.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c_.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=da(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g,null)}})}),a.j
5q$=a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window);(function(window,document,undefined){var defaults={messages:{required:"The %s field is required.",matches:"The %s field does not match the %s field.","default":"The %s field is still set to default, please change.",valid_email:"The %s field must contain a valid email address.",valid_emails:"The %s field must contain all valid email addresses.",min_length:"The %s field must be at least %s characters in length.",max_length:"The %s field must not exceed %s characters in length.",exact_length:"The %s field must be exactly %s characters in length.",greater_than:"The %s field must contain a number greater than %s.",less_than:"The %s field must contain a number less than %s.",alpha:"The %s field must only contain alphabetical characters.",alpha_numeric:"The %s field must only contain alpha-numeric characters.",alpha_dash:"The %s field must only contain alpha-numeric characters, underscores, and dashes.",numeric:"The %s field must contain only numbers.",integer:"The %s field must contain an integer.",decimal:"The %s field must contain a decimal number.",is_natural:"The %s field must contain only positive numbers.",is_natural_no_zero:"The %s field must contain a number greater than zero.",valid_ip:"The %s field must contain a valid IP.",valid_base64:"The %s field must contain a base64 string.",valid_credit_card:"The %s field must contain a valid credit card number.",is_file_type:"The %s field must contain only %s files.",valid_url:"The %s field must contain a valid URL.",greater_than_date:"The %s field must contain a more recent date than %s.",less_than_date:"The %s field must contain an older date than %s.",greater_than_or_equal_date:"The %s field must contain a date that's at least as recent as %s.",less_than_or_equal_date:"The %s field must contain a date that's %s or older."},onSubmit:function(errors){},onBlurField:function(errors){}};var ruleRegex=/^(.+?)\[(.+)\]$/,numericRegex=/^[0-9]+$/,integerRegex=/^\-?[0-9]+$/,decimalRegex=/^\-?[0-9]*\.?[0-9]+$/,emailRegex=/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,alphaRegex=/^[a-z]+$/i,alphaNumericRegex=/^[a-z0-9]+$/i,alphaDashRegex=/^[a-z0-9_\-]+$/i,naturalRegex=/^[0-9]+$/i,naturalNoZeroRegex=/^[1-9][0-9]*$/i,ipRegex=/^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$/i,base64Regex=/[^a-zA-Z0-9\/\+=]/i,numericDashRegex=/^[\d\-\s]+$/,urlRegex=/^((http|https):\/\/(\w+:{0,1}\w*@)?(\S+)|)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,dateRegex=/\d{4}-\d{1,2}-\d{1,2}/;var FormValidator=function(options){var formNameOrNode=options.form,autoConfig=!!options.autoConfig||true,fields=options.fields,validateOnBlur=!!options.validateOnBlur||false,onSubmit=options.onSubmit,onBlurField=options.onBlurField;this.formNameOrNode=formNameOrNode;this.onSubmit=onSubmit||defaults.onSubmit;this.onBlurField=onBlurField||defaults.onBlurField;this.errors=[];this.fields={};this.form=this._formByNameOrNode(formNameOrNode)||{};this.messages={};this.handlers={};this.conditionals={};this.validateOnBlur=validateOnBlur;if(autoConfig){fields=this._generateFieldParams();}this._buildMasterFieldsArray(fields);var _onsubmit=this.form.onsubmit;var self=this;this.form.onsubmit=(function(evt){try{return self._validateForm(evt)&&(_onsubmit===undefined||_onsubmit());}catch(e){}});};attributeValue=function(element,attributeName){var i;if((element.length>0)&&(element[0].type==="radio"||element[0].type==="checkbox")){for(i=0,elementLength=element.length;i<elementLength;i++){if(element[i].checked){return element[i][attributeName];}}return;}return element[attributeName];};FormValidator.prototype.setMessage=function(rule,message){this.messages[rule]=message;return this;};FormValidator.prototype.registerCallback=function(name,handler){if(name&&typeof name==="string"&&handler&&typeof handler==="function"){this.handlers[name]=handler;}return this;};FormValidator.prototype.registerConditional=function(name,conditional){if(name&&typeof name==="string"&&conditional&&typeof conditional==="function"){this.conditionals[name]=conditional;}return this;};FormValidator.prototype.validateForm=function(){return this._val
5idateForm();};FormValidator.prototype.isValidateForm=function(){this.errors=[];for(var key in this.fields){this._preValidateField(key);}if(this.errors.length>0){return false;}return true;};FormValidator.prototype._formByNameOrNode=function(formNameOrNode){return(typeof formNameOrNode==="object")?formNameOrNode:document.forms[formNameOrNode];};FormValidator.prototype._generateFieldParams=function(){return jq$("input[data-validate]").map(function(i,el){return{name:jq$(el).attr("name"),display:jq$('[for="'+jq$(el).attr("id")+'"]').text(),rules:jq$(el).data("validate")};}).get();};FormValidator.prototype._buildMasterFieldsArray=function(fields){var self=this;for(var i=0,fieldLength=fields.length;i<fieldLength;i++){var field=fields[i];if((!field.name&&!field.names)||!field.rules){console.warn("basic validate: The following field is being skipped due to a misconfiguration: "+field);continue;}if(field.names){for(var j=0,fieldNamesLength=field.names.length;j<fieldNamesLength;j++){this._addField(field,field.names[j]);}}else{this._addField(field,field.name);}if(this.validateOnBlur){var fieldElement=this.form.querySelector("[name="+field.name+"]");if(fieldElement!==null){fieldElement.addEventListener("blur",function(e){self._onFieldBlur(e);});}}}};FormValidator.prototype._onFieldBlur=function(evt){this.errors=[];var key=evt.target.getAttribute("name");this._preValidateField(key);if(typeof this.onBlurField==="function"){this.onBlurField(this.errors,evt);}};FormValidator.prototype._addField=function(field,nameValue){this.fields[nameValue]={name:nameValue,display:field.display||nameValue,rules:field.rules,depends:field.depends,id:null,element:null,type:null,value:null,checked:null};};FormValidator.prototype._validateForm=function(evt){this.errors=[];for(var key in this.fields){this._preValidateField(key);}if(typeof this.onSubmit==="function"){this.onSubmit(this.errors,evt);}if(this.errors.length>0){WA.stopEventDefault(evt);return false;}return true;};FormValidator.prototype._preValidateField=function(key){if(this.fields.hasOwnProperty(key)){var field=this.fields[key]||{},element=this.form[field.name];if(element&&element!==undefined){field.id=attributeValue(element,"id");field.element=element;field.type=(element.length>0)?element[0].type:element.type;field.value=attributeValue(element,"value");field.checked=attributeValue(element,"checked");if(field.depends&&typeof field.depends==="function"){if(field.depends.call(this,field)){this._validateField(field);}}else{if(field.depends&&typeof field.depends==="string"&&this.conditionals[field.depends]){if(this.conditionals[field.depends].call(this,field)){this._validateField(field);}}else{this._validateField(field);}}}}};FormValidator.prototype._validateField=function(field){var i,j,rules=field.rules.split("|"),indexOfRequired=field.rules.indexOf("required"),isEmpty=(!field.value||field.value===""||field.value===undefined);for(i=0,ruleLength=rules.length;i<ruleLength;i++){var method=rules[i],param=null,failed=false,parts=ruleRegex.exec(method);if(indexOfRequired===-1&&method.indexOf("!callback_")===-1&&isEmpty){continue;}
5if(parts){method=parts[1];param=parts[2];}if(method.charAt(0)==="!"){method=method.substring(1,method.length);}if(typeof this._hooks[method]==="function"){if(!this._hooks[method].apply(this,[field,param])){failed=true;}}else{if(method.substring(0,9)==="callback_"){method=method.substring(9,method.length);if(typeof this.handlers[method]==="function"){if(this.handlers[method].apply(this,[field.value,param,field])===false){failed=true;}}}}if(failed){var source=this.messages[field.name+"."+method]||this.messages[method]||defaults.messages[method],message="An error has occurred with the "+field.display+" field.";if(source){message=source.replace("%s",field.display);if(param){message=message.replace("%s",(this.fields[param])?this.fields[param].display:param);}}var existingError;for(j=0;j<this.errors.length;j+=1){if(field.id===this.errors[j].id){existingError=this.errors[j];}}var errorObject=existingError||{id:field.id,display:field.display,element:field.element,name:field.name,message:message,messages:[],rule:method};errorObject.messages.push(message);if(!existingError){this.errors.push(errorObject);}}}};FormValidator.prototype._getValidDate=function(date){if(!date.match("today")&&!date.match(dateRegex)){return false;}var validDate=new Date(),validDateArray;if(!date.match("today")){validDateArray=date.split("-");validDate.setFullYear(validDateArray[0]);validDate.setMonth(validDateArray[1]-1);validDate.setDate(validDateArray[2]);}return validDate;};FormValidator.prototype._hooks={required:function(field){var value=field.value;if((field.type==="checkbox")||(field.type==="radio")){return(field.checked===true);}return(value!==null&&value!=="");},"default":function(field,defaultName){return field.value!==defaultName;},matches:function(field,matchName){var el=this.form[matchName];if(el){return field.value===el.value;}return false;},valid_email:function(field){return emailRegex.test(field.value);},valid_emails:function(field){var result=field.value.split(/\s*,\s*/g);for(var i=0,resultLength=result.length;i<resultLength;i++){if(!emailRegex.test(result[i])){return false;}}return true;},min_length:function(field,length){if(!numericRegex.test(length)){return false;}return(field.value.length>=parseInt(length,10));},max_length:function(field,length){if(!numericRegex.test(length)){return false;}return(field.value.length<=parseInt(length,10));},exact_length:function(field,length){if(!numericRegex.test(length)){return false;}return(field.value.length===parseInt(length,10));},greater_than:function(field,param){if(!decimalRegex.test(field.value)){return false;}return(parseFloat(field.value)>parseFloat(param));},less_than:function(field,param){if(!decimalRegex.test(field.value)){return false;}return(parseFloat(field.value)<parseFloat(param));},alpha:function(field){return(alphaRegex.test(field.value));},alpha_numeric:function(field){return(alphaNumericRegex.test(field.value));},alpha_dash:function(field){return(alphaDashRegex.test(field.value));},numeric:function(field){return(numericRegex.test(field.value));},integer:function(field){return(integerRegex.test(field.value));},decimal:function(field){return(decimalRegex.test(field.value));},is_natural:function(field){return(naturalRegex.test(field.value));},is_natural_no_zero:function(field){return(naturalNoZeroRegex.test(field.value));},valid_ip:function(field){return(ipRegex.test(field.value));},valid_base64:function(field){return(base64Regex.test(field.value));},valid_url:function(field){return(urlRegex.test(field.value));},valid_credit_card:function(field){if(!numericDashRegex.test(field.value)){return false;}var nCheck=0,nDigit=0,bEven=false;var strippedField=field.value.replace(/\D/g,"");for(var n=strippedField.length-1;n>=0;n--){var cDigit=strippedField.charAt(n);nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9){nDigit-=9;}}nCheck+=nDigit;bEven=!bEven;}return(nCheck%10)===0;},is_file_type:function(field,type){if(field.type!=="file"){return true;}var ext=field.value.substr((field.value.lastIndexOf(".")+1)),typeArray=type.split(","),inArray=false,i=0,len=typeArray.length;for(i;i<len;i++){if(ext.toUpperCase()==typeArray[i].toUpperCase()){inArray=true;}}return inArray;},greater_than_date:function(field,date){var enteredDate=this._getValidDate(field.value),validDate=this._getValidDate(date);if(!validDate||!enteredDate){return false;}return enteredDate>validDate;},less_than_date:function(field,date){var enteredDate=this._getValidDate(field.value),validDate=this._getValidDate(date);if(!validDate||!enteredDate){return false;}return enteredDate<validDate;},greater_than_or_equal_date:function(field,date){var enteredDate=this._getValidDate(field.value),validDate=this._getValidDate(date);if(!validDate||!enteredDate){return false;}return enteredDate>=validDate;},less_than_or_equal_date:function(field,date){var enteredDate=this._getValidDate(field.value),validDate=this._getValidDate(date);if(!validDate||!enteredDate){return false;}return enteredDate<=validDate;}};window.FormValidator=FormValidator;})(window,document);(function(window,WA,undefined){if(!window.WaBasicWizard){window.WaBasicWizard=BasicWizard;}function BasicWizard(userOptions){if(!userOptions||!userOptions.element){return;}var defaults={selected:0,stepsBarContainer:"ul",stepsElements:"> * > .step",pagesContainer:".pagesContainer",pagesElements:"*",backButtonSupport:true,useURLhash:true,showStepURLhash:true,anchorSettings:{anchorClickable:true,enableAllAnchors:false,markDoneStep:true,markAllPreviousStepsAsDone:true,removeDoneStepOnNavigateBack:false,enableAnchorOnDoneStep:true},disabledSteps:[]};var self=this,options=$.extend(true,{},defaults,userOptions),main=jq$(options.element),nav=main.children(options.stepsBarContainer),steps=jq$(options.stepsElements,nav),container=main.find(options.pagesContainer),pages=container.children(options.pagesElements),currentIndex=null;init();
5function init(){setElements();var idx=options.selected;idx=getSelectedStepFromUrl(idx);if(idx>0&&options.anchorSettings.markDoneStep&&options.anchorSettings.markAllPreviousStepsAsDone){steps.eq(idx).parent().prevAll().addClass("done");}showStep(idx);}function getSelectedStepFromUrl(idx){if(!options.useURLhash){return idx;}var hash=window.location.hash;if(!hash||hash.length==0){return idx;}var elm=jq$('.step[href*="'+hash+'"]',nav);if(elm.length){var id=steps.index(elm);idx=id>=0?id:idx;}return idx;}function setElements(){main.addClass("basicWizward_main");nav.addClass("bw_nav bw_navTabs bw_stepAnchor");if(options.anchorSettings.enableAllAnchors!==false&&options.anchorSettings.anchorClickable!==false){steps.parent().addClass("clickable");}container.addClass("bw_container bw_tabContent");pages.addClass("bw_stepContent");if(options.disabledSteps&&options.disabledSteps.length>0){jq$.each(options.disabledSteps,function(i,n){steps.eq(n).parent().addClass("disabled");});}return true;}function setEvents(){jq$(steps).on("click",function(e){e.preventDefault();if(options.anchorSettings.anchorClickable===false){return true;}var idx=steps.index(this);if(options.anchorSettings.enableAnchorOnDoneStep===false&&steps.eq(idx).parent().hasClass("done")){return true;}if(idx!==currentIndex){if(options.anchorSettings.enableAllAnchors!==false&&options.anchorSettings.anchorClickable!==false){showStep(idx);}else{if(steps.eq(idx).parent().hasClass("done")){showStep(idx);}}}});if(options.backButtonSupport){jq$(window).on("hashchange",function(e){if(!options.useURLhash){return true;}if(window.location.hash){var elm=jq$('.step[href*="'+window.location.hash+'"]',nav);if(elm&&elm.length>0){e.preventDefault();showStep(steps.index(elm));}}});}return true;}function showNext(){var si=currentIndex+1;for(var i=si;i<steps.length;i++){if(!steps.eq(i).parent().hasClass("disabled")){si=i;break;}}if(steps.length<=si){return false;}showStep(si);return true;}function showPrevious(){var si=currentIndex-1;for(var i=si;i>=0;i--){if(!steps.eq(i).parent().hasClass("disabled")){si=i;break;}}if(0>si){return false;}showStep(si);return true;}function showStep(idx){if(!steps.eq(idx)){return false;}if(idx==currentIndex){return false;}loadStepContent(idx);return true;}function loadStepContent(idx){var curTab=steps.eq(currentIndex);var stepDirection="";var elm=steps.eq(idx);if(currentIndex!==null&&currentIndex!==idx){stepDirection=currentIndex<idx?"forward":"backward";}if(currentIndex!==null&&triggerEvent("leaveStep",[curTab,currentIndex,stepDirection])===false){return false;}transitPage(idx);return true;}function transitPage(idx){var curTab=steps.eq(currentIndex);var curPage=curTab.length>0?jq$(curTab.attr("href"),main):null;var selTab=steps.eq(idx);var selPage=selTab.length>0?jq$(selTab.attr("href"),main):null;var stepDirection="";if(currentIndex!==null&&currentIndex!==idx){stepDirection=currentIndex<idx?"forward":"backward";}var stepPosition="middle";if(idx===0){stepPosition="first";}else{if(idx===steps.length-1){stepPosition="final";}}if(curPage&&curPage.length>0){curPage.hide();}selPage.show();setURLHash(selTab.attr("href"));setAnchor(idx);currentIndex=idx;triggerEvent("showStep",[selTab,currentIndex,stepDirection,stepPosition]);return true;}function setAnchor(idx){steps.eq(currentIndex).parent().removeClass("active loading");if(options.anchorSettings.markDoneStep!==false&&currentIndex!==null){steps.eq(currentIndex).parent().addClass("done");if(options.anchorSettings.removeDoneStepOnNavigateBack!==false){steps.eq(idx).parent().nextAll().removeClass("done");}}steps.eq(idx).parent().removeClass("done loading").addClass("active");return true;}function triggerEvent(name,params){var e=jq$.Event(name);main.trigger(e,params);if(e.isDefaultPrevented()){return false;}return e.result;}function setURLHash(hash){if(options.showStepURLhash&&window.location.hash!==hash){window.location.hash=hash;}}self.next=next;self.prev=prev;self.getStep=getStep;self.reset=reset;self.showModalStep=showModalStep;self.hideModalStep=hideModalStep;function next(){showNext();}function prev(){showPrevious();}function getStep(){return +currentIndex;}function reset(){if(triggerEvent("beginReset")===false){return false;}pages.hide();currentIndex=null;setURLHash(steps.eq(options.selected).attr("href"));steps.removeClass();steps.parents().removeClass();steps.data("has-content",false);init();triggerEvent("endReset");}function showModalStep(name){pages.hide();steps.hide();jq$(name,main).show();}function hideModalStep(name){reset();}}})(window,window.WA);(function(window,WA,undefined){if(!window.WaGoogleMapsGadgetsManager){window.WaGoogleMapsGadgetsManager=new GoogleMapsGadgetsManager();}function GoogleMapsGadgetsManager(){if(!WA){return;}var pThis=this,typeName="WaGoogleMapsGadgetsManager";pThis.toString=function(){return typeName;};pThis.Dispose=WA.Tools.EventHandlers.createHandlers(pThis,{id:"Dispose"});pThis.GoogleMapsApiLoaded=WA.Tools.EventHandlers.createHandlers(pThis,{id:"GoogleMapsApiLoaded",type:WA.Tools.EventHandlers.Type.Long});pThis.createGadget=createGadget;pThis.onGoogleMapsApiLoaded=onGoogleMapsApiLoaded;var gadgets={},isDisposed=false,apiUrlTemplate="https://maps.googleapis.com/ma
5ps/api/js?"+"key={key}"+"&libraries={libraries}"+"&callback={callback}",apiLoadOptions={key:"",callback:typeName+".onGoogleMapsApiLoaded",libraries:[]},apiScriptId="id_waGoogleApiScript";function onGadgetDispose(sender,args){delete gadgets[args&&args.id];}function createGadget(gadgetConstructor,model,args){model=model||{};args=args||{};var gadgetId=model.id;if(gadgets.hasOwnProperty(gadgetId)&&gadgets[gadgetId].dispose){gadgets[gadgetId].dispose();}args.parentComponent=pThis;gadgets[gadgetId]=new gadgetConstructor(model,args);gadgets[gadgetId].Dispose.addHandler(onGadgetDispose);if(!(window.google&&window.google.maps)&&!WA.$(apiScriptId,window)){loadGoogleMapsApi(model);}}function loadGoogleMapsApi(model){var apiScript=document.createElement("script");apiLoadOptions.key=model.apiKey||apiLoadOptions.key;apiLoadOptions.libraries=(model.libraries||apiLoadOptions.libraries).join(",");apiScript.id=apiScriptId;apiScript.src=WA.String.formatNamed(apiUrlTemplate,apiLoadOptions);document.getElementsByTagName("head")[0].appendChild(apiScript);}function onGoogleMapsApiLoaded(){pThis.GoogleMapsApiLoaded.fireHandlers();}function init(){if(window.google&&window.google.maps){onGoogleMapsApiLoaded();}}function dispose(){if(isDisposed){return;}isDisposed=true;pThis.Dispose.fireHandlers();window[typeName]=null;gadgets=null;pThis.Dispose=null;pThis.GoogleMapsApiLoaded=null;}BonaPage.addPageStateHandler(BonaPage.PAGE_PARSED,init,BonaPage.HANDLERTYPE_ALWAYS);BonaPage.addPageStateHandler(BonaPage.PAGE_UNLOADED,dispose,BonaPage.HANDLERTYPE_ALWAYS);}})(window,window.WA);!function(t,e){function n(t,e,n){var r=t.children(),o=!1;t.empty();for(var i=0,d=r.length;d>i;i++){var l=r.eq(i);if(t.append(l),n&&t.append(n),a(t,e)){l.remove(),o=!0;break;}n&&n.detach();}return o;}function r(e,n,i,d,l){var s=!1,c="a, table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, blockquote, select, optgroup, option, textarea, script, style",u="script, .dotdotdot-keep";return e.contents().detach().each(function(){var h=this,f=t(h);if("undefined"==typeof h){return !0;}if(f.is(u)){e.append(f);}else{if(s){return !0;}e.append(f),!l||f.is(d.after)||f.find(d.after).length||e[e.is(c)?"after":"append"](l),a(i,d)&&(s=3==h.nodeType?o(f,n,i,d,l):r(f,n,i,d,l)),s||l&&l.detach();}}),n.addClass("is-truncated"),s;}function o(e,n,r,o,d){var c=e[0];if(!c){return !1;}var h=s(c),f=-1!==h.indexOf(" ")?" ":" ",p="letter"==o.wrap?"":f,g=h.split(p),v=-1,w=-1,b=0,y=g.length-1;for(o.fallbackToLetter&&0==b&&0==y&&(p="",g=h.split(p),y=g.length-1);y>=b&&(0!=b||0!=y);){var m=Math.floor((b+y)/2);if(m==w){break;}w=m,l(c,g.slice(0,w+1).join(p)+o.ellipsis),r.children().each(function(){t(this).toggle().toggle();}),a(r,o)?(y=w,o.fallbackToLetter&&0==b&&0==y&&(p="",g=g[0].split(p),v=-1,w=-1,b=0,y=g.length-1)):(v=w,b=w);}if(-1==v||1==g.length&&0==g[0].length){var x=e.parent();e.detach();var T=d&&d.closest(x).length?d.length:0;x.contents().length>T?c=u(x.contents().eq(-1-T),n):(c=u(x,n,!0),T||x.detach()),c&&(h=i(s(c),o),l(c,h),T&&d&&t(c).parent().append(d));}else{h=i(g.slice(0,v+1).join(p),o),l(c,h);}return !0;}function a(t,e){return t.innerHeight()>e.maxHeight;}function i(e,n){for(;t.inArray(e.slice(-1),n.lastCharacter.remove)>-1;){e=e.slice(0,-1);}return t.inArray(e.slice(-1),n.lastCharacter.noEllipsis)<0&&(e+=n.ellipsis),e;}function d(t){return{width:t.innerWidth(),height:t.innerHeight()};}function l(t,e){t.innerText?t.innerText=e:t.nodeValue?t.nodeValue=e:t.textContent&&(t.textContent=e);}function s(t){return t.innerText?t.innerText:t.nodeValue?t.nodeValue:t.textContent?t.textContent:"";}function c(t){do{t=t.previousSibling;}while(t&&1!==t.nodeType&&3!==t.nodeType);return t;}function u(e,n,r){var o,a=e&&e[0];if(a){if(!r){if(3===a.nodeType){return a;}if(t.trim(e.text())){return u(e.contents().last(),n);}}for(o=c(a);!o;){if(e=e.parent(),e.is(n)||!e.length){return !1;}o=c(e[0]);}if(o){return u(t(o),n);}}return !1;}function h(e,n){return e?"string"==typeof e?(e=t(e,n),e.length?e:!1):e.jquery?e:!1:!1;}function f(t){for(var e=t.innerHeight(),n=["paddingTop","paddingBottom"],r=0,o=n.length;o>r;r++){var a=parseInt(t.css(n[r]),10);isNaN(a)&&(a=0),e-=a;}return e;}if(!t.fn.dotdotdot){t.fn.dotdotdot=function(e){if(0==this.length){return t.fn.dotdotdot.debug('No element found for "'+this.selector+'".'),this;}if(this.length>1){return this.each(function(){t(this).dotdotdot(e);});}var o=this,i=o.contents();o.data("dotdotdot")&&o.trigger("destroy.dot"),o.data("dotdotdot-style",o.attr("style")||""),o.css("word-wrap","break-word"),"nowrap"===o.css("white-space")&&o.css("white-space","normal"),o.bind_events=function(){return o.bind("update.dot",function(e,d){switch(o.removeClass("is-truncated"),e.preventDefault(),e.stopPropagation(),typeof l.height){case"number":l.maxHeight=l.height;break;case"function":l.maxHeight=l.height.call(o[0]);break;default:l.maxHeight=f(o);}l.maxHeight+=l.tolerance,"undefined"!=typeof d&&(("string"==typeof d||"nodeType" in d&&1===d.nodeType)&&(d=t("<div />").append(d).contents()),d instanceof t&&(i=d)),g=o.wrapInner('<div class="dotdotdot" />').children(),g.contents().detach().end().append(i.clone(!0)).find("br").replaceWith("  <br />  ").end().css({height:"auto",width:"auto",border:"none",padding:0,margin:0});var c=!1,u=!1;
5return s.afterElement&&(c=s.afterElement.clone(!0),c.show(),s.afterElement.detach()),a(g,l)&&(u="children"==l.wrap?n(g,l,c):r(g,o,g,l,c)),g.replaceWith(g.contents()),g=null,t.isFunction(l.callback)&&l.callback.call(o[0],u,i),s.isTruncated=u,u;}).bind("isTruncated.dot",function(t,e){return t.preventDefault(),t.stopPropagation(),"function"==typeof e&&e.call(o[0],s.isTruncated),s.isTruncated;}).bind("originalContent.dot",function(t,e){return t.preventDefault(),t.stopPropagation(),"function"==typeof e&&e.call(o[0],i),i;}).bind("destroy.dot",function(t){t.preventDefault(),t.stopPropagation(),o.unwatch().unbind_events().contents().detach().end().append(i).attr("style",o.data("dotdotdot-style")||"").data("dotdotdot",!1);}),o;},o.unbind_events=function(){return o.unbind(".dot"),o;},o.watch=function(){if(o.unwatch(),"window"==l.watch){var e=t(window),n=e.width(),r=e.height();e.bind("resize.dot"+s.dotId,function(){n==e.width()&&r==e.height()&&l.windowResizeFix||(n=e.width(),r=e.height(),u&&clearInterval(u),u=setTimeout(function(){o.trigger("update.dot");},100));});}else{c=d(o),u=setInterval(function(){if(o.is(":visible")){var t=d(o);(c.width!=t.width||c.height!=t.height)&&(o.trigger("update.dot"),c=t);}},500);}return o;},o.unwatch=function(){return t(window).unbind("resize.dot"+s.dotId),u&&clearInterval(u),o;};var l=t.extend(!0,{},t.fn.dotdotdot.defaults,e),s={},c={},u=null,g=null;return l.lastCharacter.remove instanceof Array||(l.lastCharacter.remove=t.fn.dotdotdot.defaultArrays.lastCharacter.remove),l.lastCharacter.noEllipsis instanceof Array||(l.lastCharacter.noEllipsis=t.fn.dotdotdot.defaultArrays.lastCharacter.noEllipsis),s.afterElement=h(l.after,o),s.isTruncated=!1,s.dotId=p++,o.data("dotdotdot",!0).bind_events().trigger("update.dot"),l.watch&&o.watch(),o;},t.fn.dotdotdot.defaults={ellipsis:"... ",wrap:"word",fallbackToLetter:!0,lastCharacter:{},tolerance:0,callback:null,after:null,height:null,watch:!1,windowResizeFix:!0},t.fn.dotdotdot.defaultArrays={lastCharacter:{remove:[" "," ",",",";",".","!","?"],noEllipsis:[]}},t.fn.dotdotdot.debug=function(t){};var p=1,g=t.fn.html;t.fn.html=function(n){return n!=e&&!t.isFunction(n)&&this.data("dotdotdot")?this.trigger("update",[n]):g.apply(this,arguments);};var v=t.fn.text;t.fn.text=function(n){return n!=e&&!t.isFunction(n)&&this.data("dotdotdot")?(n=t("<div />").text(n).html(),this.trigger("update",[n])):v.apply(this,arguments);};}}(jQuery);!function($,window,document){function Linkified(element,options){this._defaults=defaults,this.element=element,this.setOptions(options),this.init();}var defaults={tagName:"a",newLine:"\n",target:"_blank",linkClass:null,linkClasses:[],linkAttributes:null};Linkified.prototype={constructor:Linkified,init:function(){1===this.element.nodeType?Linkified.linkifyNode.call(this,this.element):this.element=Linkified.linkify.call(this,this.element.toString());},setOptions:function(options){this.settings=Linkified.extendSettings(options,this.settings);},toString:function(){return this.element.toString();}},Linkified.extendSettings=function(options,settings){var prop;settings=settings||{};for(prop in defaults){settings[prop]||(settings[prop]=defaults[prop]);}for(prop in options){settings[prop]=options[prop];}return settings;},Linkified.linkMatch=new RegExp(["(",'\\s|[^a-zA-Z0-9.\\+_\\/"\\>\\-]|^',")(?:","(","[a-zA-Z0-9\\+_\\-]+","(?:","\\.[a-zA-Z0-9\\+_\\-]+",")*@",")?(","http:\\/\\/|https:\\/\\/|ftp:\\/\\/",")?(","(?:(?:[a-z0-9][a-z0-9_%\\-_+]*\\.)+)",")(","(?:com|ca|co|edu|gov|net|org|dev|biz|cat|int|pro|tel|mil|aero|asia|coop|info|jobs|mobi|museum|name|post|travel|local|[a-z]{2})",")(","(?::\\d{1,5})",")?(","(?:","[\\/|\\?]","(?:","[\\-a-zA-Z0-9_%#*&+=~!?,;:.\\/]*",")*",")","[\\-\\/a-zA-Z0-9_%#*&+=~]","|","\\/?",")?",")(",'[^a-zA-Z0-9\\+_\\/"\\<\\-]|$',")"].join(""),"g"),Linkified.emailLinkMatch=/(<[a-z]+ href=\")(http:\/\/)([a-zA-Z0-9\+_\-]+(?:\.[a-zA-Z0-9\+_\-]+)*@)/g,Linkified.linkify=function(text,options){var attr,settings,linkClasses,linkReplace=[];this.constructor===Linkified&&this.settings?(settings=this.settings,options&&(settings=Linkified.extendSettings(options,settings))):settings=Linkified.extendSettings(options),linkClasses=settings.linkClass?settings.linkClass.split(/\s+/):[],linkClasses.push.apply(linkClasses,settings.linkClasses),text=text.replace(/</g,"&lt;").replace(/(\s)/g,"$1$1"),linkReplace.push("$1<"+settings.tagName,'href="http://$2$4$5$6$7"'),linkReplace.push('class="linkified'+(linkClasses.length>0?" "+linkClasses.join(" "):"")+'"'),settings.target&&linkReplace.push('target="'+settings.target+'"');for(attr in settings.linkAttributes){linkReplace.push([attr,'="',settings.linkAttributes[attr].replace(/\"/g,"&quot;").replace(/\$/g,"&#36;"),'"'].join(""));}return linkReplace.push(">
5$2$3$4$5$6$7</"+settings.tagName+">$8"),text=text.replace(Linkified.linkMatch,linkReplace.join(" ")),text=text.replace(Linkified.emailLinkMatch,"$1mailto:$3"),text=text.replace(/(\s){2}/g,"$1"),text=text.replace(/\n/g,settings.newLine);},Linkified.linkifyNode=function(node){var children,childNode,childCount,dummyElement,i;if(node&&"object"==typeof node&&1===node.nodeType&&"a"!==node.tagName.toLowerCase()&&!/[^\s]linkified[\s$]/.test(node.className)){for(children=[],dummyElement=Linkified._dummyElement||document.createElement("div"),childNode=node.firstChild,childCount=node.childElementCount;childNode;){if(3===childNode.nodeType){for(;dummyElement.firstChild;){dummyElement.removeChild(dummyElement.firstChild);}for(dummyElement.innerHTML=Linkified.linkify.call(this,childNode.textContent||childNode.innerText||childNode.nodeValue),children.push.apply(children,dummyElement.childNodes);dummyElement.firstChild;){dummyElement.removeChild(dummyElement.firstChild);}}else{1===childNode.nodeType?children.push(Linkified.linkifyNode(childNode)):children.push(childNode);}childNode=childNode.nextSibling;}for(;node.firstChild;){node.removeChild(node.firstChild);}for(i=0;i<children.length;i++){node.appendChild(children[i]);}}return node;},Linkified._dummyElement=document.createElement("div"),$.fn.linkify=function(options){return this.each(function(){var linkified;(linkified=$.data(this,"plugin-linkify"))?(linkified.setOptions(options),linkified.init()):$.data(this,"plugin-linkify",new Linkified(this,options));});},$.fn.linkify.Constructor=Linkified,$(window).on("load",function(){$("[data-linkify]").each(function(){var $target,$this=$(this),target=$this.attr("data-linkify"),options={tagName:$this.attr("data-linkify-tagname"),newLine:$this.attr("data-linkify-newline"),target:$this.attr("data-linkify-target"),linkClass:$this.attr("data-linkify-linkclass")};for(var option in options){"undefined"==typeof options[option]&&delete options[option];}$target="this"===target?$this:$this.find(target),$target.linkify(options);});}),$("body").on("click",".linkified",function(){var $link=$(this),url=$link.attr("href"),isEmail=/^mailto:/i.test(url),target=$link.attr("target");return isEmail?window.location.href=url:window.open(url,target),!1;});}(jQuery,window,document);(function(){function activeStateIeFix(){var authenticateLoginLink=jq$("a.wa-authenticateLoginLink");authenticateLoginLink.mouseup(function(){jq$(this).addClass("activeState");});authenticateLoginLink.mouseout(function(){jq$(this).removeClass("activeState");});}jq$(document).ready(activeStateIeFix);})();jq$.iFormValidate={build:function(user_options){var defaults={showSummary:true,validateOnLoad:false,errorMessageHeader:null};return jq$(this).each(function(){var options=jq$.extend(defaults,user_options);var $validators=jq$(this).find("span").filter(function(){var validator=jq$(this).attr("validatorType");return validator!=null;});var $suppressValidationControls=jq$(this).find("input").filter(function(){var causesValidation=jq$(this).attr("causesValidation");return causesValidation=="false";});jq$(this).submit(function(){var isValid=jq$.iFormValidate.validateForm($validators,options.showSummary,options.errorMessageHeader);return isValid;});jq$.iFormValidate.setValidators($validators);jq$.iFormValidate.createValidatorsCollection($validators,$suppressValidationControls);if(options.validateOnLoad){jq$.iFormValidate.validateForm($validators,false);}else{var $onLoadValidators=$validators.filter(function(){var validator=jq$(this).attr("validateOnLoad");return(validator!=null&&validator=="true");});if($onLoadValidators!=null&&$onLoadValidators.length>0){jq$.iFormValidate.validateForm($onLoadValidators,false);}}});},suppressValidation:false,validatorCollection:{},createValidatorsCollection:function($validators,$suppressValidationControls){$validators.each(putIntoCollection);$suppressValidationControls.each(suppressValidation);function putIntoCollection(){var id=jq$(this).attr("controlToValidate");if(id!=null&&id.length>0){if(jq$.iFormValidate.validatorCollection[id]==null||jq$.iFormValidate.validatorCollection[id]=="undefined"){jq$.iFormValidate.validatorCollection[id]=jq$([]);}jq$.iFormValidate.validatorCollection[id].push($(this));}}function suppressValidation(){jq$(this).click(function(){jq$.iFormValidate.suppressValidation=true;});}},setValidators:function($validators){var alreadySet=[];$validators.each(setDefaultAttributes);$validators.each(setValidator);function setDefaultAttributes(){var type=jq$(this).attr("validatorType");if(type=="required"){if(jq$(this).attr("validateOnType")!="false"){jq$(this).attr("validateOnType","true");}}if(type=="minLength"||type=="email"||type=="passwordCompare"){if(jq$(this).attr("validateOnBlur")!="false"){jq$(this).attr("validateOnBlur","true");}}}function setValidator(){var validatorType=jq$(this).attr("validatorType");var id=jq$(this).attr("controlToValidate");var testErrorMessage=jq$(this).attr("errorMessage");if((validatorType!="method")&&(id==null||id=="undefined"||id.length==0)){throw ("Undefined controlToValidate attribute. ValidatorType: "+validatorType);}if(testErrorMessage==null||testErrorMessage=="undefined"||testErrorMessage.length==0){throw ("Undefined errorMessage attribute. ValidatorType: "+validatorType);}if(alreadySet[id]==null&&(validatorType!="method")){alreadySet[id]={};var $control=jq$("#"+id);
5$control.keyup(function(){jq$.iFormValidate.validateControl(this,"validateOnType");});$control.blur(function(){jq$.iFormValidate.validateControl(this,"validateOnBlur");});$control.filter("select").change(function(){jq$.iFormValidate.validateControl(this);});}}},validateControl:function(inputObject,validationEventName){var $validators=jq$.iFormValidate.validatorCollection[inputObject.id];if(validationEventName){$validators=$validators.filter(function(){var attribute=jq$(this).attr(validationEventName);return attribute!=null&&attribute=="true";});}if($validators!=null&&$validators.length>0){jq$.iFormValidate.validateForm($validators,false);}},validateForm:function($validators,showSummaryAlert,errorMessageHeader){if(jq$.iFormValidate.suppressValidation){return true;}var isValid=false;var errorMessage="";$validators.each(jq$.iFormValidate.validate);var stopValidations=$validators.filter(function(){return $(this).attr("shouldStopValidation")!=null;});if(stopValidations&&stopValidations.length>0){return false;}var $errors=$validators.filter(function(){return $(this).attr("invalid")!=null;});if($errors.length>0){if(showSummaryAlert){if(errorMessageHeader!=null){errorMessage+=errorMessageHeader+"\n\n";}$errors.each(collectErrors);alert(errorMessage);var $errorControl=jq$("#"+$errors.first().attr("controlToValidate"));if($errorControl!=null){$errorControl.trigger("focus");}}isValid=false;}else{isValid=true;}function collectErrors(){var message=jq$(this).attr("errorMessage");if(message!=null&&message.length>0){errorMessage+="- "+message+"\n";}}return isValid;},validate:function(){var validatorType=jq$(this).attr("validatorType");var $controlToValidate=null;if(validatorType!="method"){$controlToValidate=jq$("#"+$(this).attr("controlToValidate"));}var error=null;switch(validatorType){case"passwordCompare":error=new jq$.iFormValidate.validator.passwordCompare(jq$(this),$controlToValidate).validate();break;case"email":error=new jq$.iFormValidate.validator.email(jq$(this),$controlToValidate).validate();break;case"minLength":error=new jq$.iFormValidate.validator.minLength(jq$(this),$controlToValidate).validate();break;case"required":error=new jq$.iFormValidate.validator.required(jq$(this),$controlToValidate).validate();break;case"method":validationResult=new jq$.iFormValidate.validator.method(jq$(this)).validate();error=validationResult.error;if(validationResult.shouldStopValidation){jq$(this).attr("shouldStopValidation","true");}else{jq$(this).removeAttr("shouldStopValidation");}break;case"date":error=new jq$.iFormValidate.validator.date(jq$(this),$controlToValidate).validate();break;default:throw ("Validator type not supported: "+validatorType);}if(error!=null&&error.length>0){jq$(this).attr("invalid","true");if(validatorType!="method"){setErrorStyle(jq$(this));}}else{jq$(this).removeAttr("invalid");if(validatorType!="method"){setNormalStyle(jq$(this));}}function setErrorStyle($validator){var displayType=$validator.attr("display");switch(displayType){case"dynamic":$validator.css("display","block");default:$validator.css("visibility","visible");break;}}function setNormalStyle($validator){var displayType=$validator.attr("display");switch(displayType){case"dynamic":$validator.css("display","none");default:$validator.css("visibility","hidden");break;}}},validator:{passwordCompare:function($validator,$controlToValidate){var pThis=this;var val=$controlToValidate.val();var $compareWithControl=jq$("#"+$validator.attr("compareWith"));var compareWithValue=$compareWithControl.val();pThis.validate=validate;function init(){if($compareWithControl==null){throw ("Invalid compareWith attribute");}if(compareWithValue==null||compareWithValue=="undefined"){throw ("Invalid compareWith attribute");}}function validate(){if(val!=null&&compareWithValue!=null&&val!="undefined"&&compareWithValue!="undefined"&&val===compareWithValue){return"";}return $validator.attr("errorMessage");}init();},minLength:function($validator,$controlToValidate){var pThis=this;var val=$controlToValidate.val();var minLengthValue=parseInt($validator.attr("minLengthValue"),10);pThis.validate=validate;
5function init(){if(isNaN(minLengthValue)||minLengthValue<0){throw ("Invalid minLengthValue");}}function validate(){if(val==null||val.length==0||val.length>=minLengthValue){return"";}return $validator.attr("errorMessage");}init();},email:function($validator,$controlToValidate){var pThis=this;var Regex=/^\s*[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\s*$/;var val=$controlToValidate.val();pThis.validate=validate;function validate(){if(val==null||val.length==0||Regex.test(val)){return"";}return $validator.attr("errorMessage");}},date:function($validator,$controlToValidate){var pThis=this;var Regex=/^([\d]|1[0,1,2]|0[1-9])(\-|\/|\.)([0-9]|[0,1,2][0-9]|3[0,1])(\-|\/|\.)\d{4}$/;var val=$controlToValidate.val();pThis.validate=validate;function validate(){if(Regex.test(val)){return"";}return $validator.attr("errorMessage");}},required:function($validator,$controlToValidate){var pThis=this;var val=$controlToValidate.val();pThis.validate=validate;function validate(){if(val!=null&&val!="undefined"&&val.length>0){return"";}return $validator.attr("errorMessage");}},method:function($validator){var pThis=this;pThis.validate=validate;function validate(){var validationResult={result:true,shouldStopValidation:false};$validator.trigger("wavalidate",[validationResult]);if(validationResult.result){return{error:"",shouldStopValidation:validationResult.shouldStopValidation};}return{error:$validator.attr("errorMessage"),shouldStopValidation:validationResult.shouldStopValidation};}}}};jq$.fn.FormValidate=jq$.iFormValidate.build;(function(window,document){function getIanaTimeZone(){return Intl.DateTimeFormat().resolvedOptions().timeZone;}function processItem(itemElement,ianaTimeZone,timezoneRegex,timeRegex){var clientTimeZone=itemElement.getAttribute("client-tz-item");if(clientTimeZone===ianaTimeZone){return;}var formattedTimezone=itemElement.getAttribute("client-tz-formatted");if(formattedTimezone&&!timezoneRegex.test(itemElement.innerText)){if(itemElement.tagName==="A"){updateAnchorTitle(itemElement,formattedTimezone,timeRegex);}else{appendTimezone(itemElement,formattedTimezone);}}}function updateAnchorTitle(itemElement,formattedTimezone,timeRegex){var originalTitle=itemElement.getAttribute("title");var formattedTitle=originalTitle.replace(timeRegex,function(match){return match+formattedTimezone;});itemElement.setAttribute("title",formattedTitle);}function appendTimezone(itemElement,formattedTimezone){itemElement.innerText+=formattedTimezone;}function init(){var timezoneRegex=/\(\w+\/[A-Za-z_\/-]+\)|\([A-Z]{2,9}\)$/;var timeRegex=/\b(\d{1,2}:\d{2})(?:\s?(AM|PM))?\b/g;var items=document.querySelectorAll("[client-tz-item]");if(items.length===0){return;}var ianaTimeZone=getIanaTimeZone();for(var i=0;i<items.length;i++){processItem(items[i],ianaTimeZone,timezoneRegex,timeRegex);}}BonaPage.addPageStateHandler(BonaPage.PAGE_LOADED,init,BonaPage.HANDLERTYPE_ALWAYS);})(window,document);(function(window,document){if(!window.WA.WaitlistCancellationDialog){window.WA.WaitlistCancellationDialog=WaitlistCancellationDialog;}function WaitlistCancellationDialog(confirmRemovalFromWaitlistDialogTitle,closeButtonText,leaveWaitListButtonText,waitListConfirmationQuestion,removeFromWaitListText,isButton,eventId){var cancellationDialog;window.onCancelClick=function(registrationId){if(!cancellationDialog){cancellationDialog=createWaitlistCancellationDialog(registrationId);}cancellationDialog.show();return false;};window.onRemoveFromWaitlistClick=function onRemoveFromWaitlistClick(){if(!waitlistCancellationDialog){var waitlistCancellationDialog=createWaitlistCancellationDialog(eventId);}waitlistCancellationDialog.show();};function createWaitlistCancellationDialog(registrationId){var dialogId="waitlistCancellationDialog";var leaveWaitListButtonId=dialogId+"_LeaveWaitList";var closeButtonId=dialogId+"_CloseButton";var dialog=WA.UI.WaWindowManager.createDialog(dialogId,{width:400,height:200,isModal:true,hideCloseButton:true});dialog.addMainContainerCssClass("waitlistCancellationDialog");dialog.setTitle(confirmRemovalFromWaitlistDialogTitle);var contentModel={confirmationMessage:waitListConfirmationQuestion};dialog.setContent(waitlistCancellationDialogContentTemplate(contentModel));var footerModel={cancelButtonId:leaveWaitListButtonId,cancelButtonText:leaveWaitListButtonText,closeButtonId:closeButtonId,closeButtonText:closeButtonText};dialog.setFooter(waitlistCancellationDialogFooterTemplate(footerModel));var closeButton=new WA.UI.Button({id:closeButtonId},{parentComponent:dialog});closeButton.ButtonClick.addHandler(function(){dialog.hide();});closeButton.renderComplete();var cancelButton=new WA.UI.Button({id:leaveWaitListButtonId},{parentComponent:dialog});cancelButton.ButtonClick.addHandler(function(){onRemoveWaitlistButtonClick(registrationId,dialog);});cancelButton.renderComplete();return dialog;}function waitlistCancellationDialogContentTemplate(model){var containerTemplate=WA.UI.ContainerTemplate;return containerTemplate({cssClass:"waitlistCancellationDialogContent",contentHTML:containerTemplate({cssClass:"confirmMessage",contentHTML:model.confirmationMessage})});}function waitlistCancellationDialogFooterTemplate(model){var buttonTemplate=WA.UI.WaButtonTemplate;return WA.UI.ContainerTemplate({cssClass:"actionButtons",contentHTML:buttonTemplate({id:model.cancelButtonId,name:model.cancelButtonText,enabled:true},{color:WA.UI.WaButton.ButtonColor.Green})+buttonTemplate({id:model.closeButtonId,name:model.closeButtonText},{color:WA.UI.WaButton.ButtonColor.Green})});}function setDisplayStyleForElements(className,displayStyle){var elements=document.getElementsByClassName(className);for(var i=0;i<elements.length;i++){elements[i].style.display=displayStyle;}}function hideMessagesPopup(){var messagePopup=document.getElementById("WA_messagePopup");if(messagePopup){messagePopup.style.display="none";}}function onRemoveWaitlistButtonClick(registrationId,dialog){var cancellationComment="";sendWaitlistCancellationRequest(registrationId,cancellationComment,dialog);}function sendWaitlistCancellationRequest(registrationId,cancellationComment,dialog){var model={registrationId:registrationId,comment:cancellationComment,waitlistCancellation:true};var cancelRegistrationUrl="/Sys/Finances/MemberProfileAction/CancelRegistration";var sessionKeyField=document.getElementById("jsCookieHiddenField");if(sessionKeyField&&sessionKeyField.value){try{var sessionCookies=JSON.parse(sessionKeyField.value);if(sessionCookies&&sessionCookies.length>0&&sessionCookies[0].cookieValue){cancelRegistrationUrl+="?sk="+encodeURIComponent(sessionCookies[0].cookieValue);}}catch(e){}}WA.Ajax({url:cancelRegistrationUrl,dataType:"text",contentType:"application/json; charset=utf-8",global:false,type:"POST",data:JSON.stringify(model),success:function(){if(!isButton){var row=document.querySelector('tr[data-registration-id="'+registrationId+'"]');if(row){row.parentNode.removeChild(row);}}else{setDisplayStyleForElements("cancelMessageBox","block");setDisplayStyleForElements("warningMessageBox","none");setDisplayStyleForElements("paymentMessageBox","none");setDisplayStyleForElements("infoMessageBox","none");
5setDisplayStyleForElements("removeWaitlistButton","none");setDisplayStyleForElements("actionInvoiceButton","none");setDisplayStyleForElements("newRegistrationButton","none");setDisplayStyleForElements("completeRegistrationButton","none");hideMessagesPopup();}dialog.hide();}});}function getRemoveWaitListLink(item){if(!item.IsWaitList||item.isPast){return"";}return'&nbsp;<a class="noLine" href="#" onclick="onCancelClick('+item.registrationId+');">'+removeFromWaitListText+"</a>";}function processWaitlistLinks(){var elements=document.querySelectorAll("div[data-is-waitList]");for(var i=0;i<elements.length;i++){var IsWaitList=elements[i].getAttribute("data-is-waitList")==="true";var registrationId=elements[i].getAttribute("data-registration-id");var isPast=elements[i].getAttribute("data-is-past")==="true";var item={IsWaitList:IsWaitList,registrationId:registrationId,isPast:isPast};var link=getRemoveWaitListLink(item);if(link){elements[i].innerHTML+=link;}}}if(isButton){var removeWaitlistButton=WA.$(removeFromWaitListText,window);WA.addHandler(removeWaitlistButton,"click",onRemoveFromWaitlistClick);}else{processWaitlistLinks();}}})(window,document);(function(){function aa(a,b,c){return a.call.apply(a.bind,arguments);}function ba(a,b,c){if(!a){throw Error();}if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c);};}return function(){return a.apply(b,arguments);};}function n(a,b,c){n=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?aa:ba;return n.apply(null,arguments);}var p=Date.now||function(){return +new Date;};function q(a,b){this.F=a;this.k=b||a;this.H=this.k.document;}var ca=!!window.FontFace;q.prototype.createElement=function(a,b,c){a=this.H.createElement(a);if(b){for(var d in b){b.hasOwnProperty(d)&&("style"==d?a.style.cssText=b[d]:a.setAttribute(d,b[d]));}}c&&a.appendChild(this.H.createTextNode(c));return a;};function s(a,b,c){a=a.H.getElementsByTagName(b)[0];a||(a=document.documentElement);a.insertBefore(c,a.lastChild);}function t(a,b,c){b=b||[];c=c||[];for(var d=a.className.split(/\s+/),e=0;e<b.length;e+=1){for(var f=!1,g=0;g<d.length;g+=1){if(b[e]===d[g]){f=!0;break;}}f||d.push(b[e]);}b=[];for(e=0;e<d.length;e+=1){f=!1;for(g=0;g<c.length;g+=1){if(d[e]===c[g]){f=!0;break;}}f||b.push(d[e]);}a.className=b.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"");}function u(a,b){for(var c=a.className.split(/\s+/),d=0,e=c.length;d<e;d++){if(c[d]==b){return !0;}}return !1;}function v(a){if("string"===typeof a.fa){return a.fa;}var b=a.k.location.protocol;"about:"==b&&(b=a.F.location.protocol);return"https:"==b?"https:":"http:";}function x(a,b,c){function d(){l&&e&&f&&(l(g),l=null);}b=a.createElement("link",{rel:"stylesheet",href:b,media:"all"});var e=!1,f=!0,g=null,l=c||null;ca?(b.onload=function(){e=!0;d();},b.onerror=function(){e=!0;g=Error("Stylesheet failed to load");d();}):setTimeout(function(){e=!0;d();},0);s(a,"head",b);}function y(a,b,c,d){var e=a.H.getElementsByTagName("head")[0];if(e){var f=a.createElement("script",{src:b}),g=!1;f.onload=f.onreadystatechange=function(){g||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(g=!0,c&&c(null),f.onload=f.onreadystatechange=null,"HEAD"==f.parentNode.tagName&&e.removeChild(f));};e.appendChild(f);setTimeout(function(){g||(g=!0,c&&c(Error("Script load timeout")));},d||5000);return f;}return null;}function z(){this.S=0;this.K=null;}function A(a){a.S++;return function(){a.S--;B(a);};}function C(a,b){a.K=b;B(a);}function B(a){0==a.S&&a.K&&(a.K(),a.K=null);}function D(a){this.ea=a||"-";}D.prototype.d=function(a){for(var b=[],c=0;c<arguments.length;c++){b.push(arguments[c].replace(/[\W_]+/g,"").toLowerCase());}return b.join(this.ea);};function E(a,b){this.Q=a;this.M=4;this.L="n";var c=(b||"n4").match(/^([nio])([1-9])$/i);c&&(this.L=c[1],this.M=parseInt(c[2],10));}E.prototype.getName=function(){return this.Q;};function da(a){return G(a)+" "+(a.M+"00")+" 300px "+H(a.Q);}function H(a){var b=[];a=a.split(/,\s*/);for(var c=0;c<a.length;c++){var d=a[c].replace(/['"]/g,"");-1!=d.indexOf(" ")||/^\d/.test(d)?b.push("'"+d+"'"):b.push(d);}return b.join(",");}function I(a){return a.L+a.M;}function G(a){var b="normal";"o"===a.L?b="oblique":"i"===a.L&&(b="italic");return b;}function ea(a){var b=4,c="n",d=null;a&&((d=a.match(/(normal|oblique|italic)/i))&&d[1]&&(c=d[1].substr(0,1).toLowerCase()),(d=a.match(/([1-9]00|normal|bold)/i))&&d[1]&&(/bold/i.test(d[1])?b=7:/[1-9]00/.test(d[1])&&(b=parseInt(d[1].substr(0,1),10))));return c+b;}function fa(a,b){this.a=a;this.j=a.k.document.documentElement;this.O=b;this.g="wf";this.e=new D("-");this.da=!1!==b.events;this.u=!1!==b.classes;}function ga(a){a.u&&t(a.j,[a.e.d(a.g,"loading")]);J(a,"loading");}function K(a){if(a.u){var b=u(a.j,a.e.d(a.g,"active")),c=[],d=[a.e.d(a.g,"loading")];b||c.push(a.e.d(a.g,"inactive"));t(a.j,c,d);}J(a,"inactive");}function J(a,b,c){if(a.da&&a.O[b]){if(c){a.O[b](c.getName(),I(c));}else{a.O[b]();}}}function ha(){this.t={};}function ia(a,b,c){var d=[],e;for(e in b){if(b.hasOwnProperty(e)){var f=a.t[e];f&&d.push(f(b[e],c));}}return d;}function L(a,b){this.a=a;this.h=b;this.m=this.a.createElement("span",{"aria-hidden":"true"},this.h);}function M(a,b){var c=a.m,d;d="display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+H(b.Q)+";"+("font-style:"+G(b)+";font-weight:"+(b.M+"00")+";");c.style.cssText=d;}function N(a){s(a.a,"body",a.m);}L.prototype.remove=function(){var a=this.m;a.parentNode&&a.parentNode.removeChild(a);};function O(a,b,c,d,e,f){this.G=a;this.J=b;this.f=d;this.a=c;this.v=e||3000;this.h=f||void 0;}O.prototype.start=function(){var a=this.a.k.document,b=this;Promise.race([new Promise(function(a,d){setTimeout(function(){d(b.f);},b.v);}),a.fonts.load(da(this.f),this.h)]).then(function(a){1===a.length?b.G(b.f):b.J(b.f);},function(){b.J(b.f);});};function P(a,b,c,d,e,f,g){this.G=a;this.J=b;this.a=c;this.f=d;this.h=g||"BESbswy";this.s={};this.v=e||3000;this.Z=f||null;this.D=this.C=this.A=this.w=null;this.w=new L(this.a,this.h);this.A=new L(this.a,this.h);this.C=new L(this.a,this.h);this.D=new L(this.a,this.h);M(this.w,new E(this.f.getName()+",serif",I(this.f)));M(this.A,new E(this.f.getName()+",sans-serif",I(this.f)));M(this.C,new E("serif",I(this.f)));M(this.D,new E("sans-serif",I(this.f)));N(this.w);N(this.A);N(this.C);N(this.D);}var Q={ia:"serif",ha:"sans-serif"},R=null;
5function S(){if(null===R){var a=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);R=!!a&&(536>parseInt(a[1],10)||536===parseInt(a[1],10)&&11>=parseInt(a[2],10));}return R;}P.prototype.start=function(){this.s.serif=this.C.m.offsetWidth;this.s["sans-serif"]=this.D.m.offsetWidth;this.ga=p();T(this);};function ja(a,b,c){for(var d in Q){if(Q.hasOwnProperty(d)&&b===a.s[Q[d]]&&c===a.s[Q[d]]){return !0;}}return !1;}function T(a){var b=a.w.m.offsetWidth,c=a.A.m.offsetWidth,d;(d=b===a.s.serif&&c===a.s["sans-serif"])||(d=S()&&ja(a,b,c));d?p()-a.ga>=a.v?S()&&ja(a,b,c)&&(null===a.Z||a.Z.hasOwnProperty(a.f.getName()))?U(a,a.G):U(a,a.J):ka(a):U(a,a.G);}function ka(a){setTimeout(n(function(){T(this);},a),50);}function U(a,b){setTimeout(n(function(){this.w.remove();this.A.remove();this.C.remove();this.D.remove();b(this.f);},a),0);}function V(a,b,c){this.a=a;this.p=b;this.P=0;this.ba=this.Y=!1;this.v=c;}var la=!!window.FontFace;V.prototype.V=function(a){var b=this.p;b.u&&t(b.j,[b.e.d(b.g,a.getName(),I(a).toString(),"active")],[b.e.d(b.g,a.getName(),I(a).toString(),"loading"),b.e.d(b.g,a.getName(),I(a).toString(),"inactive")]);J(b,"fontactive",a);this.ba=!0;ma(this);};V.prototype.W=function(a){var b=this.p;if(b.u){var c=u(b.j,b.e.d(b.g,a.getName(),I(a).toString(),"active")),d=[],e=[b.e.d(b.g,a.getName(),I(a).toString(),"loading")];c||d.push(b.e.d(b.g,a.getName(),I(a).toString(),"inactive"));t(b.j,d,e);}J(b,"fontinactive",a);ma(this);};function ma(a){0==--a.P&&a.Y&&(a.ba?(a=a.p,a.u&&t(a.j,[a.e.d(a.g,"active")],[a.e.d(a.g,"loading"),a.e.d(a.g,"inactive")]),J(a,"active")):K(a.p));}function na(a){this.F=a;this.q=new ha;this.$=0;this.T=this.U=!0;}na.prototype.load=function(a){this.a=new q(this.F,a.context||this.F);this.U=!1!==a.events;this.T=!1!==a.classes;oa(this,new fa(this.a,a),a);};function pa(a,b,c,d,e){var f=0==--a.$;(a.T||a.U)&&setTimeout(function(){var a=e||null,l=d||null||{};if(0===c.length&&f){K(b.p);}else{b.P+=c.length;f&&(b.Y=f);var h,k=[];for(h=0;h<c.length;h++){var m=c[h],w=l[m.getName()],r=b.p,F=m;r.u&&t(r.j,[r.e.d(r.g,F.getName(),I(F).toString(),"loading")]);J(r,"fontloading",F);r=null;r=la?new O(n(b.V,b),n(b.W,b),b.a,m,b.v,w):new P(n(b.V,b),n(b.W,b),b.a,m,b.v,a,w);k.push(r);}for(h=0;h<k.length;h++){k[h].start();}}},0);}function oa(a,b,c){var d=[],e=c.timeout;ga(b);var d=ia(a.q,c,a.a),f=new V(a.a,b,e);a.$=d.length;b=0;for(c=d.length;b<c;b++){d[b].load(function(b,c,d){pa(a,f,b,c,d);});}}function qa(a,b,c){this.N=a?a:b+ra;this.o=[];this.R=[];this.ca=c||"";}var ra="//fonts.googleapis.com/css";function sa(a,b){for(var c=b.length,d=0;d<c;d++){var e=b[d].split(":");3==e.length&&a.R.push(e.pop());var f="";2==e.length&&""!=e[1]&&(f=":");a.o.push(e.join(f));}}qa.prototype.d=function(){if(0==this.o.length){throw Error("No fonts to load!");}if(-1!=this.N.indexOf("kit=")){return this.N;}for(var a=this.o.length,b=[],c=0;c<a;c++){b.push(this.o[c].replace(/ /g,"+"));}a=this.N+"?family="+b.join("%7C");0<this.R.length&&(a+="&subset="+this.R.join(","));0<this.ca.length&&(a+="&text="+encodeURIComponent(this.ca));return a;};function ta(a){this.o=a;this.aa=[];this.I={};}var ua={latin:"BESbswy",cyrillic:"&#1081;&#1103;&#1046;",greek:"&#945;&#946;&#931;",khmer:"&#x1780;&#x1781;&#x1782;",Hanuman:"&#x1780;&#x1781;&#x1782;"},va={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},wa={i:"i",italic:"i",n:"n",normal:"n"},xa=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;ta.prototype.parse=function(){for(var a=this.o.length,b=0;b<a;b++){var c=this.o[b].split(":"),d=c[0].replace(/\+/g," "),e=["n4"];if(2<=c.length){var f;var g=c[1];f=[];if(g){for(var g=g.split(","),l=g.length,h=0;h<l;h++){var k;k=g[h];if(k.match(/^[\w-]+$/)){if(k=xa.exec(k.toLowerCase()),null==k){k="";}else{var m;m=k[1];if(null==m||""==m){m="4";}else{var w=va[m];m=w?w:isNaN(m)?"4":m.substr(0,1);}k=k[2];k=[null==k||""==k?"n":wa[k],m].join("");}}else{k="";}k&&f.push(k);}}0<f.length&&(e=f);3==c.length&&(c=c[2],f=[],c=c?c.split(","):f,0<c.length&&(c=ua[c[0]])&&(this.I[d]=c));}this.I[d]||(c=ua[d])&&(this.I[d]=c);for(c=0;c<e.length;c+=1){this.aa.push(new E(d,e[c]));}}};function ya(a,b){this.a=a;this.c=b;}var za={Arimo:!0,Cousine:!0,Tinos:!0};ya.prototype.load=function(a){var b=new z,c=this.a,d=new qa(this.c.api,v(c),this.c.text),e=this.c.families;sa(d,e);var f=new ta(e);f.parse();x(c,d.d(),A(b));C(b,function(){a(f.aa,f.I,za);});};function W(a,b){this.a=a;this.c=b;this.X=[];}W.prototype.B=function(a){var b=this.a;return v(this.a)+(this.c.api||"//f.fontdeck.com/s/css/js/")+(b.k.location.hostname||b.F.location.hostname)+"/"+a+".js";};W.prototype.load=function(a){var b=this.c.id,c=this.a.k,d=this;b?(c.__webfontfontdeckmodule__||(c.__webfontfontdeckmodule__={}),c.__webfontfontdeckmodule__[b]=function(b,c){for(var g=0,l=c.fonts.length;g<l;++g){var h=c.fonts[g];d.X.push(new E(h.name,ea("font-weight:"+h.weight+";font-style:"+h.style)));}a(d.X);},y(this.a,this.B(b),function(b){b&&a([]);})):a([]);};function X(a,b){this.a=a;this.c=b;}X.prototype.B=function(a){return(this.c.api||"https://use.typekit.net")+"/"+a+".js";};X.prototype.load=function(a){var b=this.c.id,c=this.a.k;b?y(this.a,this.B(b),function(b){if(b){a([]);}else{if(c.Typekit&&c.Typekit.config&&c.Typekit.config.fn){b=c.Typekit.config.fn;for(var e=[],f=0;f<b.length;f+=2){for(var g=b[f],l=b[f+1],h=0;h<l.length;h++){e.push(new E(g,l[h]));}}try{c.Typekit.load({events:!1,classes:!1,async:!0});}catch(k){}a(e);}}},2000):a([]);};function Y(a,b){this.a=a;this.c=b;}Y.prototype.B=function(a,b){var c=v(this.a),d=(this.c.api||"fast.fonts.net/jsapi").replace(/^.*http(s?):(\/\/)?/,"");return c+"//"+d+"/"+a+".js"+(b?"?v="+b:"");};Y.prototype.load=function(a){function b(){if(e["__mti_fntLst"+c]){var d=e["__mti_fntLst"+c](),g=[],l;if(d){for(var h=0;h<d.length;h++){var k=d[h].fontfamily;void 0!=d[h].fontStyle&&void 0!=d[h].fontWeight?(l=d[h].fontStyle+d[h].fontWeight,g.push(new E(k,l))):g.push(new E(k));}}a(g);}else{setTimeout(function(){b();},50);}}var c=this.c.projectId,d=this.c.version;if(c){var e=this.a.k;y(this.a,this.B(c,d),function(c){c?a([]):b();}).id="__MonotypeAPIScript__"+c;}else{a([]);}};function Aa(a,b){this.a=a;this.c=b;}Aa.prototype.load=function(a){var b,c,d=this.c.urls||[],e=this.c.families||[],f=this.c.testStrings||{},g=new z;b=0;for(c=d.length;b<c;b++){x(this.a,d[b],A(g));}var l=[];b=0;for(c=e.length;b<c;b++){if(d=e[b].split(":"),d[1]){for(var h=d[1].split(","),k=0;k<h.length;k+=1){l.push(new E(d[0],h[k]));}}else{l.push(new E(d[0]));}}C(g,function(){a(l,f);});};var Z=new na(window);Z.q.t.custom=function(a,b){return new Aa(b,a);};Z.q.t.fontdeck=function(a,b){return new W(b,a);};Z.q.t.monotype=function(a,b){return new Y(b,a);};Z.q.t.typekit=function(a,b){return new X(b,a);};Z.q.t.google=function(a,b){return new ya(b,a);};var $={load:n(Z.load,Z)};"function"===typeof define&&define.amd?define(function(){return $;}):"undefined"!==typeof module&&module.exports?module.exports=$:(window.WebFont=$,window.WebFontConfig&&Z.load(window.WebFontConfig));}());(function(jq$){if(!window.OAuthButtons){window.OAuthButtons=OAuthButtons;}function OAuthButtons(args){if(!args.id){throw new Error("id was not defined!");}var container,form;function onContainerClick(e){var attr=e.target.getAttribute("provider");if(!attr){return;}switch(attr){case"Facebook":case"GooglePlus":case"Microsoft":case"Apple":submitExternalAuthForm(attr);break;default:throw new Error("unsupported provider: "+attr);}}function submitExternalAuthForm(providerName){var providerField=jq$(form).find(".oAuthProvider");providerField.val(providerName);jq$(form).submit();}
5function init(){var containerId=args.id+"_container";container=document.getElementById(containerId);form=document.getElementById(args.formId);var browserCapabilitiesField=document.getElementById(args.id+"_browserCapabilities");var browserData=browserInfo.getBrowserCapabilitiesData();browserCapabilitiesField.value=browserData;if(!container){throw new Error("Could not find container by id: "+containerId);}if(!form){throw new Error("Could not find form by id: "+args.formId);}jq$(container).click(onContainerClick);}init();}})(window.jq$);(function(window){if(window.BlogHelper){return;}window.BlogHelper=new Object();var hiddenFormFormCommentExists=null;var commentBottom=null;var formDisabled=false;var commentLengthValidator=null;var oldValidatorMessage;window.BlogHelper.previousReplyLink=null;function setUrlFragment(value,w){var wnd=w||window;if(!wnd.location){return"";}var match=(/#([^#]*)$/gi).exec(wnd.location.toString()),activeUrl=wnd.location.toString(),newUrl=match?activeUrl.replace(/#([^#]+)$/gi,"#"+value):activeUrl+"#"+value;wnd.location.replace(newUrl);}BlogHelper.replyToComment=function(replyLink){var comment=BlogHelper.getCommentContainer(replyLink);if(!comment){return;}var messageId=comment.getAttribute("messageId");if(!messageId){return false;}var addNewCommentFormContainer=WA.$("idAddNewCommentFormContainer",window);var replyToCommentHidden=WA.$(BlogHelper.idReplyToCommentId,window);if(formDisabled){return;}if(DataChangeWatcher){var checkResult=DataChangeWatcher.confirmIfDataChanged();DataChangeWatcher.resumeWatching();if(!checkResult){return;}}if(commentBottom){commentBottom.style.display="";}var commentBottom=BlogHelper.getCommentBottomBlock(comment);var replyFormContainer=comment;do{replyFormContainer=replyFormContainer.nextSibling;}while(replyFormContainer&&replyFormContainer.nodeType!=1);if(commentBottom){commentBottom.style.display="none";}if(window.BlogHelper.previousReplyLink){window.BlogHelper.previousReplyLink.style.display="inline";}window.BlogHelper.previousReplyLink=replyLink;window.BlogHelper.replyingOnCommentId=getReplyId();if(!replyToCommentHidden){replyToCommentHidden=WA.$(BlogHelper.idReplyToCommentId,window);}replyToCommentHidden.value=messageId;commentLengthValidator=window.setTimeout("BlogHelper.validateCommentLength()",300);};BlogHelper.showReplyIfAwailable=function(replyLink){var comment=BlogHelper.getCommentContainer(replyLink);if(!comment){return true;}var messageId=comment.getAttribute("messageId");if(!messageId){return true;}if(window.BlogHelper.replyingOnCommentId!=messageId){return true;}WA.$("idAddNewCommentFormContainer",window).style.display="";return false;};BlogHelper.hideButtonsIfJsEnabled=function(){var commentsContainer=WA.$("idBlogCommentsListContainer",window);var buttons=commentsContainer.getElementsByTagName("INPUT");var links=commentsContainer.getElementsByTagName("A");for(var i=0;i<buttons.length;i++){if(buttons[i].attributes["HideIfJsEnabled"]){buttons[i].style.display="none";}}for(var i=0;i<links.length;i++){if(links[i].attributes["ShowIfJsEnabled"]){links[i].style.display="";}}};BlogHelper.hideCommentForm=function(){var addNewCommentFormContainer=WA.$("idAddNewCommentFormContainer",window);var commentText=WA.$(BlogHelper.idCommentText,window);if(WA.String.gtrim(commentText.value).length>0){DataChangeWatcher.setChanged();}else{DataChangeWatcher.setNotChanged();}if(DataChangeWatcher&&DataChangeWatcher.confirmIfDataChanged()){addNewCommentFormContainer.style.display="none";commentText.value="";if(commentLengthValidator){window.clearTimeout(commentLengthValidator);}if(commentBottom){commentBottom.style.display="";}if(window.BlogHelper.previousReplyLink){window.BlogHelper.previousReplyLink.style.display="";}return true;}return true;};BlogHelper.validateComment=function(){var commentText,commentLength,message,captchaCode;commentText=WA.$(BlogHelper.idCommentText,window);commentLength=BlogHelper.getCommentLength();message="";if(commentText.value.trim().length==0){message=BlogHelper.strCommentIsEmpty;}if(commentLength>BlogHelper.intMaxCommentLength){message=BlogHelper.strCommentLengthExeededAlertMessage;}captchaCode=WA.$(BlogHelper.idCaptchaCodeId,window);if(captchaCode&&captchaCode.value.trim().length==0){if(message!=""){message+="\r\n";}message+=BlogHelper.strCaptchaCodeIsEmpty;}if(message!=""){alert(message);return false;}Page_IsValid=true;Page_BlockSubmit=false;return true;};BlogHelper.validateCommentLength=function(){var commentText,commentLength,errorContainer,errorText,newValidatorMessage;if(!(commentText=WA.$(BlogHelper.idCommentText,window))){return;}commentLength=BlogHelper.getCommentLength();errorText=WA.$("errorMessage",window);errorContainer=WA.$(BlogHelper.idErrorMessageContainer,window);newValidatorMessage=commentLength>BlogHelper.intMaxCommentLength?BlogHelper.strCommentLengthExeededValidatorMessage.toString().replace(/\[0\]/,commentLength):"";if(oldValidatorMessage!=newValidatorMessage){oldValidatorMessage=errorText.
5innerHTML=newValidatorMessage;}errorContainer.style.display=errorText.innerHTML!=""?"block":"none";commentLengthValidator=window.setTimeout("BlogHelper.validateCommentLength()",300);};BlogHelper.getCommentLength=function(){return WA.$(BlogHelper.idCommentText,window).value.replace(/\r\n/g,"\n").replace(/\n/g,"\r\n").length;};BlogHelper.disableCommentForm=function(){if(DataChangeWatcher){DataChangeWatcher.pauseWatching();}window.setTimeout(function(){WA.$(BlogHelper.idPostCommentButton,window).disabled=true;WA.$(BlogHelper.idCommentText,window).disabled=true;var captchaCode=WA.$(BlogHelper.idCaptchaCodeId,window);var captchaReload=WA.$(BlogHelper.idCaptchaReloadId,window);var anonimousAuthorTextBox=WA.$(BlogHelper.idAnonimousAuthorTextBoxId,window);if(captchaCode){captchaCode.disabled=true;}if(captchaReload){captchaReload.style.display="none";}if(anonimousAuthorTextBox){anonimousAuthorTextBox.disabled=true;}formDisabled=true;},10);};BlogHelper.disablePostForm=function(){if(DataChangeWatcher){DataChangeWatcher.pauseWatching();}window.setTimeout(function(){if(Page_IsValid){formDisabled=true;}},100);};BlogHelper.deleteComment=function(){};BlogHelper.stokeComment=function(anyCommentInnerObject,enabled){var comment;if(comment=BlogHelper.getCommentContainer(anyCommentInnerObject)){comment.className=enabled?"commentViewContainer Stoked":"commentViewContainer";}};BlogHelper.getCommentContainer=function(innerObject){var comment=innerObject;if(!comment){return null;}while(!comment.getAttribute("messageId")&&comment.tagName!="BODY"){comment=comment.parentNode;}return(comment.tagName!="BODY")?comment:null;};BlogHelper.getCommentBottomBlock=function(comment){var elements,i;if(comment.className=="commentBottom"||comment.className=="postBottom"){return comment;}elements=comment.getElementsByTagName("DIV");for(i=0;i<elements.length;i++){if(elements[i].className=="commentBottom"||elements[i].className=="postBottom"){return elements[i];}}};BlogHelper.AutoexpandReplyFormIfNeeded=function(){var replyId=getReplyId();var commentOnPost=isAddingCommentToPost();var replyOnMessage;if(replyId){replyOnMessage=findMessageByMessageId(replyId);setUrlFragment(replyId,window);BlogHelper.replyToComment(replyOnMessage);}else{if(commentOnPost){replyOnMessage=WA.$(BlogHelper.postContainerId,window);BlogHelper.replyToComment(replyOnMessage);}}};BlogHelper.AutoScrollToAnchor=function(anchorParamName){var searchPattern=new RegExp(anchorParamName+"=([0-9a-zA-Z]+)");var match=searchPattern.exec(window.location);if(match!=null){setUrlFragment(match[1],window);}};BlogHelper.getTwoDigitsNumber=function(number){return number<10?"0"+number:number;};BlogHelper.ValidateBody=function(sender,args){var box,value;if(WidgetMode==1){if(box=WA.$(BodyTextBoxId,window)){args.IsValid=(box.value.replace(/^\s*|\s*$/g,"")!="");}return;}if(!top||!WA.BonaEditor.EditorsManager){return;}box=WA.BonaEditor.EditorsManager.getEditorById(BlogHelper.idEditor);if(box==null){return;}value=box.getHtmlData().replace(/&nbsp;|\s|<br>|<p>|<\/p>/ig,"");args.IsValid=value.length>0;};BlogHelper.ValidateBodyLength=function(sender,args){var box,value,valueLength;if(WidgetMode==1){if(box=WA.$(BodyTextBoxId,window)){args.IsValid=(box.value.replace(/^\s*|\s*$/g,"").length<=BlogHelper.intMaxPostLength);}return;}if(!top||!WA.BonaEditor.EditorsManager){return;}box=WA.BonaEditor.EditorsManager.getEditorById(BlogHelper.idEditor);if(box==null){return;}valueLength=box.getHtmlDataLength();args.IsValid=(valueLength<=BlogHelper.intMaxPostLength);};BlogHelper.OnLoad=function(){BlogHelper.AutoScrollToAnchor("anchor");BlogHelper.AutoexpandReplyFormIfNeeded();};function getReplyId(){var url=window.location?window.location.toString():"";var searchRegExs=[/replyTo\=(\d+)/i,/#replyTo(\d+)$/i];for(var i=0;i<searchRegExs.length;i++){var match=searchRegExs[i].exec(url);if(match){return match[1];}}return 0;}function isAddingCommentToPost(){var url=window.location?window.location.toString():"";var searchRegEx=/#addComment$/i;var match=searchRegEx.exec(url);return match?true:false;}function findMessageByMessageId(messageId){var elements=document.getElementsByTagName("DIV");for(var i=0;i<elements.length;i++){var element=elements[i];var attribute=element.getAttribute("messageId");if(attribute==messageId){return element;}}return null;}})(window);if(window.BonaPage){BonaPage.addPageStateHandler(BonaPage.PAGE_PARSED,BlogHelper.OnLoad);}jq$(function(){if(jq$(".blogEntryContainer #idAddNewCommentFormContainer").size()){$("body").animate({scrollTop:jq$("#idAddNewCommentFormContainer").offset().top},0);}jq$(document).ready(function(){jq$(".WaGadgetBlog .fixedHeight").dotdotdot();});jq$(".WaGadgetBlog .boxesList .boxesListItem .boxHeaderOuterContainer").each(function(){blogPanel(this);});jq$(".WaGadgetBlog .blogEntryOuterContainer .boxHeaderOuterContainer").each(function(){blogPanel(this);});function blogPanel(element){var linkReadMore=jq$(element).parent().find("[id*=blogPostList_postList] .boxFooterPrimaryOuterContainer a:first-child").addClass("readMore"),linkComment=jq$(element).parent().find('[id*=blogPostList_postList] .boxFooterPrimaryOuterContainer a[href*="#comments"]').addClass("comments"),linkAddComment=jq$(element).parent().find('.boxFooterPrimaryOuterContainer a[href*="addComment"]').addClass("addComment"),linkEdit=jq$(element).parent().find("a.editPost"),linkDelete=jq$(element).parent().find("a.deletePost");if(linkReadMore.size()||linkComment.size()||linkAddComment.size()||linkEdit.size()||linkDelete.size()){$(element).before('<div class="controlPanel"><span class="toggleButton"></span><div class="controlPanelInner"></div></div>');jq$(element).parent().find(".controlPanelInner").append(linkReadMore);jq$(element).parent().find(".controlPanelInner").append(linkComment);jq$(element).parent().find(".controlPanelInner").append(linkAddComment);jq$(element).parent().find(".controlPanelInner").append(linkEdit);jq$(element).parent().find(".controlPanelInner").append(linkDelete);jq$(element).parent().find(".postBottom").remove();var panel=jq$(element).parent().find(".controlPanel");var panelButton=jq$(element).parent().find(".toggleButton");panel.isOpening=false;panelButton.on("click",function(e){panel.isOpening=true;jq$("body").trigger("click");panel.isOpening=false;panel.toggleClass("opened");e.stopPropagation();});jq$("body").on("click",function(){if(!panel.isOpening){panel.removeClass("opened");}});var numCom=jq$(element).parent().find(".comments").text();if(numCom){numCom=numCom.match(/\(\d+\)/g);
5numCom=numCom[0].slice(1,-1);jq$(element).parent().find(".boxInfoContainer").prepend('<span class="numCom">'+numCom+"</span>");}}}});(function(window,WA,undefined){if(!window.WaContentGadgetResizer){window.WaContentGadgetResizer=WaContentGadgetResizer;}function WaContentGadgetResizer(initModel){var pThis=this,typeName="WaContentGadgetResizer",viewModel=initModel;pThis.toString=function(){return typeName;};var isDisposed=false,container,editableContainer,editableAttribute="data-editableArea",setHeightTimeout=50,editableHeightAttribute="data-areaHeight";function resetEditableContainerHeight(){WA.removeHandler(this,"load",resetEditableContainerHeight);WA.throttle(setEditableContainerHeight,{timeout:setHeightTimeout});}function setEditableContainerHeight(){if(isDisposed){return;}var gadgetHeight=container.offsetHeight-WA.Style.getElementStyleInt(container,"paddingBottom",window),gadgetPosition=container.style.position||"",heightMeter=document.createElement("waContentHeightMeter"),editableContainerHeight,height;heightMeter.style.display="block";heightMeter.style["float"]="none";heightMeter.style["clear"]="both";heightMeter.style.height="0px";heightMeter.style.fontSize="0px";container.style.position="relative";container.appendChild(heightMeter);editableContainerHeight=editableContainer.offsetHeight-WA.Style.getElementStyleInt(editableContainer,"paddingTop",window)-WA.Style.getElementStyleInt(editableContainer,"paddingBottom",window);height=Math.max(editableContainerHeight+gadgetHeight-heightMeter.offsetTop,0);container.removeChild(heightMeter);heightMeter=null;container.style.position=gadgetPosition;editableContainer.style.height=height+"px";editableContainer.setAttribute(editableHeightAttribute,height,0);}function init(){var containerImages,i,len;container=WA.$(viewModel.id,window);if(!container){return;}editableContainer=container.querySelector("["+editableAttribute+"]");if(editableContainer){editableContainer.style.height="";containerImages=container.getElementsByTagName("img");for(i=0,len=containerImages.length;i<len;i++){if(!containerImages[i]["complete"]){WA.addHandler(containerImages[i],"load",resetEditableContainerHeight);}}resetEditableContainerHeight();}}function dispose(){if(isDisposed){return;}WA.clearThrottle(setEditableContainerHeight);viewModel=null;container=null;editableContainer=null;isDisposed=true;}BonaPage.addPageStateHandler(BonaPage.PAGE_PARSED,init,BonaPage.HANDLERTYPE_ALWAYS);BonaPage.addPageStateHandler(BonaPage.PAGE_UNLOADED,dispose,BonaPage.HANDLERTYPE_ALWAYS);}})(window,window.WA);(function(){if(!window.Bonasource){window.Bonasource=new Object();}if(window.Bonasource.ControlTooltip){return;}window.Bonasource.ControlTooltip=controlTooltip;function controlTooltip(elementId,tooltipCssClass,tooltipHTML){var _tooltipShowDelegate=null;var _tooltipHideDelegate=null;var _tooltipMoveDelegate=null;var _tooltipDiv=null;var _tooltipHTML=tooltipHTML;var _tooltipCssClass=tooltipCssClass;var _element=WA.$(elementId,window);var _pThis=this;addStateHandlers(elementId);function addStateHandlers(elementId){BonaPage.addHandler(_element,"mouseover",element_OnMouseOver);BonaPage.addHandler(_element,"mouseout",element_OnMouseOut);BonaPage.addHandler(_element,"mousemove",element_OnMouseOver);}function getTooltipDiv(){if(!_tooltipDiv){_tooltipDiv=document.createElement("div");_tooltipDiv.className=_tooltipCssClass;_tooltipDiv.innerHTML=_tooltipHTML;_tooltipDiv.style.position="absolute";_tooltipDiv.style.zIndex=1000;_tooltipDiv.style.display="none";document.body.appendChild(_tooltipDiv);BonaPage.addHandler(_tooltipDiv,"mouseover",element_OnMouseOver);BonaPage.addHandler(_tooltipDiv,"mouseout",element_OnMouseOut);}return _tooltipDiv;}var _tooltipX;var _tooltipY;var _mouseOverTimeout;var _mouseOutTimeout;function element_OnMouseOver(evt){if(_mouseOverTimeout){clearTimeout(_mouseOverTimeout);}if(_mouseOutTimeout){clearTimeout(_mouseOutTimeout);}var mouseXY=WA.getEventMouseCoords(evt);_tooltipY=mouseXY.top;_tooltipX=mouseXY.left;_mouseOverTimeout=setTimeout(showDiv,10);}function element_OnMouseOut(evt){if(_mouseOutTimeout){clearTimeout(_mouseOutTimeout);}_mouseOutTimeout=setTimeout(hideDiv,10);}function showDiv(){try{var div=getTooltipDiv();div.style.display="block";div.style.top=_tooltipY+21+"px";div.style.left=_tooltipX+11+"px";}catch(err){}}function hideDiv(){var div=getTooltipDiv();div.style.display="none";}return _pThis;}})();(function(){if(window.ForumHelper){return;}window.ForumHelper=new Object();function $(id){return document.getElementById(id);}
5ForumHelper.navigateToTopic=function(topicUrl){window.location=topicUrl;};ForumHelper.highlight=function(elem){jq$(elem).removeClass("normal").addClass("highlight");};ForumHelper.normlight=function(elem){jq$(elem).removeClass("highlight").addClass("normal");};ForumHelper.subscribeForum=function(forumId){var subscribeLink=$(ForumHelper.subscribeLinkID);var subscribingLabel=$(ForumHelper.subscribingLabelID);subscribingLabel.style.display="inline-block";subscribeLink.style.display="none";try{WA.Ajax({url:ForumModel.Urls.SubscribeForum,cache:false,global:false,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify({forumId:forumId}),type:"POST",success:ForumHelper.subscribedSuccessfully,error:ForumHelper.subscriptionFailed});}catch(e){return true;}return false;};ForumHelper.unsubscribeForum=function(forumId){var unsubscribeLink=$(ForumHelper.unsubscribeLinkID);var unsubscribingLabel=$(ForumHelper.unsubscribingLabelID);unsubscribingLabel.style.display="inline-block";unsubscribeLink.style.display="none";try{WA.Ajax({url:ForumModel.Urls.UnsubscribeForum,cache:false,global:false,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify({forumId:forumId}),type:"POST",success:ForumHelper.unsubscribedSuccessfully,error:ForumHelper.unsubscriptionFailed});}catch(e){return true;}return false;};ForumHelper.subscribedSuccessfully=function(){var unsubscribeLink=$(ForumHelper.unsubscribeLinkID);var subscribingLabel=$(ForumHelper.subscribingLabelID);var unsubscribingLabel=$(ForumHelper.unsubscribingLabelID);unsubscribeLink.style.display="inline-block";subscribingLabel.style.display="none";unsubscribingLabel.style.display="none";};ForumHelper.subscriptionFailed=function(){var subscribeLink=$(ForumHelper.subscribeLinkID);var subscribingLabel=$(ForumHelper.subscribingLabelID);var unsubscribingLabel=$(ForumHelper.unsubscribingLabelID);subscribeLink.style.display="inline-block";subscribingLabel.style.display="none";unsubscribingLabel.style.display="none";};ForumHelper.unsubscribedSuccessfully=function(){var subscribeLink=$(ForumHelper.subscribeLinkID);var subscribingLabel=$(ForumHelper.unsubscribingLabelID);var unsubscribingLabel=$(ForumHelper.unsubscribingLabelID);subscribeLink.style.display="inline-block";subscribingLabel.style.display="none";unsubscribingLabel.style.display="none";};ForumHelper.unsubscriptionFailed=function(){var unsubscribeLink=$(ForumHelper.unsubscribeLinkID);var subscribingLabel=$(ForumHelper.subscribingLabelID);var unsubscribingLabel=$(ForumHelper.unsubscribingLabelID);unsubscribeLink.style.display="inline-block";subscribingLabel.style.display="none";unsubscribingLabel.style.display="none";};ForumHelper.subscribeTopic=function(topicId){var subscribeTopicLink=$(ForumHelper.subscribeTopicLinkID);var subscribingTopicLabel=$(ForumHelper.subscribingTopicLabelID);subscribingTopicLabel.style.display="inline-block";subscribeTopicLink.style.display="none";try{WA.Ajax({url:ForumModel.Urls.SubscribeTopic,cache:false,global:false,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify({topicId:topicId}),type:"POST",success:ForumHelper.subscribedTopicSuccessfully,error:ForumHelper.subscriptionTopicFailed});}catch(e){return true;}return false;};ForumHelper.unsubscribeTopic=function(topicId){var unsubscribeTopicLink=$(ForumHelper.unsubscribeTopicLinkID);var unsubscribingTopicLabel=$(ForumHelper.unsubscribingTopicLabelID);unsubscribingTopicLabel.style.display="inline-block";unsubscribeTopicLink.style.display="none";WA.Ajax({url:ForumModel.Urls.UnsubscribeTopic,cache:false,global:false,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify({topicId:topicId}),type:"POST",success:ForumHelper.unsubscribedTopicSuccessfully,error:ForumHelper.unsubscriptionTopicFailed});return false;};ForumHelper.subscribedTopicSuccessfully=function(){var unsubscribeTopicLink=$(ForumHelper.unsubscribeTopicLinkID);var subscribingTopicLabel=$(ForumHelper.subscribingTopicLabelID);var unsubscribingTopicLabel=$(ForumHelper.unsubscribingTopicLabelID);unsubscribeTopicLink.style.display="inline-block";subscribingTopicLabel.style.display="none";unsubscribingTopicLabel.style.display="none";};ForumHelper.subscriptionTopicFailed=function(){var subscribeTopicLink=$(ForumHelper.subscribeTopicLinkID);var subscribingTopicLabel=$(ForumHelper.subscribingTopicLabelID);var unsubscribingTopicLabel=$(ForumHelper.unsubscribingTopicLabelID);subscribeTopicLink.style.display="inline-block";subscribingTopicLabel.style.display="none";unsubscribingTopicLabel.style.display="none";};ForumHelper.unsubscribedTopicSuccessfully=function(){var subscribeTopicLink=$(ForumHelper.subscribeTopicLinkID);var subscribingTopicLabel=$(ForumHelper.unsubscribingTopicLabelID);var unsubscribingTopicLabel=$(ForumHelper.unsubscribingTopicLabelID);subscribeTopicLink.style.display="inline-block";subscribingTopicLabel.style.display="none";unsubscribingTopicLabel.style.display="none";};ForumHelper.unsubscriptionTopicFailed=function(){var unsubscribeTopicLink=$(ForumHelper.unsubscribeTopicLinkID);var subscribingTopicLabel=$(ForumHelper.subscribingTopicLabelID);var unsubscribingTopicLabel=$(ForumHelper.unsubscribingTopicLabelID);unsubscribeTopicLink.style.display="inline-block";subscribingTopicLabel.style.display="none";unsubscribingTopicLabel.style.display="none";};ForumHelper.existedCategorySelected=function(){var existingCategoryDiv=$(ForumHelper.idExistingCategoryDiv);var newCategoryDiv=$(ForumHelper.idNewCategoryDiv);existingCategoryDiv.style.display="";newCategoryDiv.style.display="none";};ForumHelper.newCategorySelected=function(){var existingCategoryDiv=$(ForumHelper.idExistingCategoryDiv);var newCategoryDiv=$(ForumHelper.idNewCategoryDiv);existingCategoryDiv.style.display="none";newCategoryDiv.style.display="";};})();jq$(function(){jq$(".WaGadgetForumStateTopicList .boxBodyOuterContainer .threadImage img[src*=stickies]").each(function(){jq$(this).parent().addClass("stickyForumTopic");});});jq$(function(){jq$("td.repliesCountTD .repliesCount:contains('—')").addClass("noBubble");jq$("td.threadImageTD .threadImage.stickyForumTopic").parent().next().addClass("showStickyIcon");jq$(".WaGadgetForum.WaGadgetForumStateMessageList .boxesList .boxesListItem").each(function(){var forumMessageHeaderInfoContainer=$(this).find("table.forumMessageHeaderTable td.forumMessageHeaderInfoContainer");$(this).find("table.forumMessageTable td.left").clone().addClass("forumMessageHeaderInfoContainerAuthorPhantom").insertAfter(forumMessageHeaderInfoContainer);});jq$(".WaGadgetForum.WaGadgetForumStateMessageList .boxesList .boxesListItem table.forumMessageHeaderTable td.forumMessageHeaderBodyContainer").each(function(){forumPanel(this);});function forumPanel(element){$(element).before('<td class="forumMessageHeaderBodyContainerPhantom"><div class="controlPanel"><div class="toggleButton"><div class="controlPanelInner"></div></div></div></td>');var linkEdit=$(element).find("a[id*=forumMessage_edit]").addClass("Edit").wrapInner("<span></span>"),linkMove=$(element).find("a[id*=forumMessage_move]").addClass("Move").wrapInner("<span></span>"),linkDelete=$(element).find("a[id*=forumMessage_deleteLink]").addClass("Delete").wrapInner("<span></span>
5"),linkQuote=$(element).find("a[id*=forumMessage_reply]").addClass("Quote").wrapInner("<span></span>"),replyNumberSpan=$(element).find("span[id*=messageIdText]").addClass("replyNumberSpan");$(element).parent().find(".controlPanelInner").append(linkEdit);$(element).parent().find(".controlPanelInner").append(linkMove);$(element).parent().find(".controlPanelInner").append(linkDelete);$(element).parent().find(".controlPanelInner").append(linkQuote);$(element).parent().find(".controlPanel").prepend(replyNumberSpan);var panel=$(element).parent().find(".controlPanel");var panelButton=$(element).parent().find(".toggleButton");var controlPanelInner=$(element).parent().find(".controlPanelInner");if(linkEdit.length+linkMove.length+linkDelete.length+linkQuote.length===0){panelButton.remove();}function resizeControlPanelInner(){var newWidth=panel.outerWidth()-replyNumberSpan.outerWidth()-panelButton.outerWidth();var menuItemsCount=controlPanelInner.find("a").length;if(menuItemsCount&&(newWidth>menuItemsCount*50)){controlPanelInner.css("width",newWidth).removeClass("mobile");controlPanelInner.find("a").css("width",100/menuItemsCount+"%");}else{controlPanelInner.css("width","").addClass("mobile");controlPanelInner.find("a").css("width","");}}resizeControlPanelInner();jq$(window).on("resize",function(){resizeControlPanelInner();});panelButton.on("click",function(e){panel.toggleClass("opened");e.stopPropagation();});$("body").on("click",function(){if(panel.hasClass("opened")){panel.removeClass("opened");}});return false;}});function redirectToUrl(urlString){window.location.href=urlString;return false;}function changeStateAndSubmit(buttonId,state,hiddehId){var button=document.getElementById(buttonId);var hidden=document.getElementById(hiddehId);if(button!=null&&hidden!=null){hidden.value=state;button.click();}return false;}function submitClick(buttonId){var button=document.getElementById(buttonId);if(button!=null){button.click();}return false;}jq$(function(){jq$(".WaGadgetEvents .generalFieldsContainer .fieldSubContainer .fieldLabel").each(function(k,v){jq$(v).html(jq$(v).html().replace("&nbsp;"," "));});jq$(".WaGadgetEventsStateList ul.boxesList li").each(function(){var footer=$(this).find(".boxFooterOuterContainer");$(this).find(".boxBodyContentContainer").after(footer);});try{jq$(".WaGadgetEventsStateList .fixedHeight").dotdotdot();}catch(err){}function resizeLeftColEventDetail(){var leftEventDetailsColumnDiv=jq$(".WaGadgetEventsStateDetails .boxOuterContainer .boxBodyInfoOuterContainer .boxBodyInfoContainer");var rightEventDetailsColumnDiv=jq$(".WaGadgetEventsStateDetails .boxOuterContainer .boxBodyContentOuterContainer .boxBodyContentContainer");if(leftEventDetailsColumnDiv.length&&rightEventDetailsColumnDiv.length){var leftEventDetailsColumnHeight=leftEventDetailsColumnDiv.height();var rightEventDetailsColumnHeight=rightEventDetailsColumnDiv.height();if(rightEventDetailsColumnHeight>leftEventDetailsColumnHeight){leftEventDetailsColumnDiv.css("height",rightEventDetailsColumnHeight);}}}function resizeLeftColEventList(){jq$(".WaGadgetEventsStateList .boxesList .boxesListItem").each(function(k,v){var left=jq$(this).find(".boxBodyInfoContainer");var right=jq$(this).find(".boxBodyContentOuterContainer");if(right.height()>left.height()){left.css("height",right.height());}});}resizeLeftColEventDetail();resizeLeftColEventList();jq$(window).resize(function(){resizeLeftColEventDetail();resizeLeftColEventList();});if(jq$("#idPastEventsContainer table td").size()==0){jq$("#idPastEventsContainer").remove();}jq$(".WaGadgetEventsStateCalendar .monthViewType .EventListCalendar td > div").addClass("eventDivItem");jq$(".WaGadgetEventsStateCalendar .monthViewType .EventListCalendar").on("click","td > div",function(e){jq$(this).addClass("eventDivItem");if(e.target.tagName.toLowerCase()!="a"){jq$(this).find("a")[0].click();}});jq$(".WaGadgetEventsStateCalendar .yearViewType .EventListCalendar td").each(function(){var htmlCode=jq$(this).html();htmlCode=htmlCode.replace(new RegExp("</a>[^<]","g"),"</a></span>");htmlCode=htmlCode.replace(new RegExp("<br>","g"),"<br><span>");jq$(this).html(htmlCode);});});(function(window,WA,undefined){if(!window.WaFacebookPagePlugin){window.WaFacebookPagePlugin=FacebookPagePlugin;}function FacebookPagePlugin(initModel,initArgs){if(!WA){return;}
5initArgs=initArgs||{};var pThis=this,typeName="WaFacebookPagePlugin",viewModel=initModel,parentComponent=initArgs.parentComponent,facebookPagePluginContainerId=initArgs.facebookPagePluginContainerId;pThis.toString=function(){return typeName;};pThis.Dispose=WA.Tools.EventHandlers.createHandlers(pThis,{id:"Dispose"});pThis.dispose=dispose;function onFacebookSdkLoaded(sender,args){var sdk=args&&args.sdk,facebookPagePluginContainer=WA.$(facebookPagePluginContainerId,window);sdk.XFBML.parse(facebookPagePluginContainer);}function onGadgetDeleted(sender,args){args=args||{};if(args.componentId==viewModel.id){dispose();}}function init(){parentComponent.Dispose.addHandler(dispose);parentComponent.FacebookSdkLoaded.addHandler(onFacebookSdkLoaded,{period:"once"});WA.Gadgets.GadgetDeleted.addHandler(onGadgetDeleted);}function dispose(){pThis.Dispose.fireHandlers({id:viewModel.id});parentComponent.FacebookSdkLoaded.removeHandler(onFacebookSdkLoaded);WA.Gadgets.GadgetDeleted.removeHandler(onGadgetDeleted);parentComponent.Dispose.removeHandler(dispose);viewModel=null;parentComponent=null;pThis.RenderComplete=null;pThis.Dispose=null;}init();}})(window,window.WA);(function(window,WA,undefined){if(!window.WaFacebookPagePluginManager){window.WaFacebookPagePluginManager=new FacebookPagePluginManager();}function FacebookPagePluginManager(){if(!WA){return;}var pThis=this,typeName="WaFacebookPagePluginManager";pThis.toString=function(){return typeName;};pThis.Dispose=WA.Tools.EventHandlers.createHandlers(pThis,{id:"Dispose"});pThis.FacebookSdkLoaded=WA.Tools.EventHandlers.createHandlers(pThis,{id:"FacebookSdkLoaded",type:WA.Tools.EventHandlers.Type.Long});pThis.createGadget=createGadget;var gadgets={},sdkScriptSrc="//connect.facebook.net/en_US/all.js#xfbml=1&status=0",sdkScriptId="facebook-jssdk",fbRootId="fb-root";function onFbSdkReady(){FB.Event.subscribe("xfbml.render",onXfbmlRendered);pThis.FacebookSdkLoaded.fireHandlers({sdk:FB});}function onGadgetDispose(sender,args){delete gadgets[args&&args.id];}function createGadget(model,args){model=model||{};args=args||{};var gadgetId=model.id;if(gadgets.hasOwnProperty(gadgetId)&&gadgets[gadgetId].dispose){gadgets[gadgetId].dispose();}args.parentComponent=pThis;gadgets[gadgetId]=new WaFacebookPagePlugin(model,args);gadgets[gadgetId].Dispose.addHandler(onGadgetDispose);createFbRootElement();if(window.FB&&FB.XFBML&&FB.XFBML.parse){onFbSdkReady();return;}if(!WA.$(sdkScriptId,window)){loadFacebookSdk();}}function onXfbmlRendered(){WA.Gadgets.notifyGadgetChanged();}function createFbInitCallback(){var oldFbAsyncInit=window.fbAsyncInit;window.fbAsyncInit=function(){if(typeof oldFbAsyncInit=="function"){oldFbAsyncInit();}onFbSdkReady();};}function loadFacebookSdk(){var sdkScript=document.createElement("script");sdkScript.id=sdkScriptId;sdkScript.async=true;sdkScript.src=sdkScriptSrc;document.getElementsByTagName("head")[0].appendChild(sdkScript);}function createFbRootElement(){var fbRoot=WA.$(fbRootId,window);if(fbRoot){return;}fbRoot=document.createElement("div");fbRoot.id=fbRootId;document.body.appendChild(fbRoot);}function init(){if(window.FB&&FB.XFBML&&FB.XFBML.parse){onFbSdkReady();return;}createFbInitCallback();}function dispose(){if(window.FB&&FB.XFBML&&FB.XFBML.parse){FB.Event.unsubscribe("xfbml.render",onXfbmlRendered);}pThis.Dispose.fireHandlers();window[typeName]=null;gadgets=null;pThis.Dispose=null;pThis.FacebookSdkLoaded=null;}BonaPage.addPageStateHandler(BonaPage.PAGE_PARSED,init,BonaPage.HANDLERTYPE_ALWAYS);BonaPage.addPageStateHandler(BonaPage.PAGE_UNLOADED,dispose,BonaPage.HANDLERTYPE_ALWAYS);}})(window,window.WA);(function(){if(window.ForumSummaryHelper){return;}window.ForumSummaryHelper=new Object();function $(id){return document.getElementById(id);}ForumSummaryHelper.navigateToTopic=function(topicUrl){window.location=topicUrl;};ForumSummaryHelper.highlight=function(elem){jq$(elem).removeClass("normal").addClass("highlight");};ForumSummaryHelper.normlight=function(elem){jq$(elem).removeClass("highlight").addClass("normal");};ForumSummaryHelper.allForumsRadioSelected=function(){var selectForumsListDiv=$(ForumSummaryHelper.selectForumsListId);selectForumsListDiv.style.display="none";};ForumSummaryHelper.selectedForumsRadioSelected=function(){var selectForumsListDiv=$(ForumSummaryHelper.selectForumsListId);selectForumsListDiv.style.display="";};})();(function(window,WA,undefined){if(!window.WaGoogleMap){window.WaGoogleMap=GoogleMap;}function GoogleMap(initModel,initArgs){if(!WA){return;}
5initArgs=initArgs||{};var pThis=this,typeName="WaGoogleMap",viewModel=initModel,parentComponent=initArgs.parentComponent,address=initArgs.address||"",zoom=initArgs.zoom||13,mapWindow=initArgs.mapWindow||window,mapContainerId=initArgs.mapContainerId;pThis.toString=function(){return typeName;};pThis.Dispose=WA.Tools.EventHandlers.createHandlers(pThis,{id:"Dispose"});pThis.dispose=dispose;var isDisposed=false,api;function getCoordinates(){if(isDisposed){return;}var geocoder=new api.Geocoder();geocoder.geocode({address:address},function(locResult,status){if(status==api.GeocoderStatus.OK){setGoogleMap(locResult[0].geometry.location.lat(),locResult[0].geometry.location.lng());}else{}});}function setGoogleMap(x,y){if(isDisposed){return;}var mapContainer=mapContainerId&&WA.$(mapContainerId,mapWindow),mapOptions,map,markerOptions,marker;mapOptions={center:new api.LatLng(x,y),zoom:zoom,mapTypeId:api.MapTypeId.ROADMAP};map=new api.Map(mapContainer,mapOptions);markerOptions={map:map,position:new api.LatLng(x,y)};marker=new api.Marker(markerOptions);dispose();}function onGoogleMapsApiLoaded(){api=google.maps;if(address!=""){getCoordinates();}else{setGoogleMap(0,0);}}function onGadgetDeleted(sender,args){args=args||{};if(args.componentId==viewModel.id){dispose();}}function init(){parentComponent.Dispose.addHandler(dispose);parentComponent.GoogleMapsApiLoaded.addHandler(onGoogleMapsApiLoaded);WA.Gadgets.GadgetDeleted.addHandler(onGadgetDeleted);}function dispose(){isDisposed=true;pThis.Dispose.fireHandlers({id:viewModel.id});parentComponent.GoogleMapsApiLoaded.removeHandler(onGoogleMapsApiLoaded);WA.Gadgets.GadgetDeleted.removeHandler(onGadgetDeleted);parentComponent.Dispose.removeHandler(dispose);viewModel=null;parentComponent=null;api=null;pThis.RenderComplete=null;pThis.Dispose=null;}init();}})(window,window.WA);(function(window,WA,undefined){if(!window.WaHeadlineGadgetResizer){window.WaHeadlineGadgetResizer=WaHeadlineGadgetResizer;}function WaHeadlineGadgetResizer(initModel){var pThis=this,typeName="WaHeadlineGadgetResizer",viewModel=initModel;pThis.toString=function(){return typeName;};var isDisposed=false,container,editableContainer,editableAttribute="data-editableArea",setHeightTimeout=50,editableHeightAttribute="data-areaHeight";function resetEditableContainerHeight(){WA.removeHandler(this,"load",resetEditableContainerHeight);WA.throttle(setEditableContainerHeight,{timeout:setHeightTimeout});}function setEditableContainerHeight(){if(isDisposed){return;}var gadgetHeight=container.offsetHeight-WA.Style.getElementStyleInt(container,"paddingBottom",window),gadgetPosition=container.style.position||"",heightMeter=document.createElement("waHeadlineHeightMeter"),editableContainerHeight,height;heightMeter.style.display="block";heightMeter.style["float"]="none";heightMeter.style["clear"]="both";heightMeter.style.height="0px";heightMeter.style.fontSize="0px";container.style.position="relative";container.appendChild(heightMeter);editableContainerHeight=editableContainer.offsetHeight-WA.Style.getElementStyleInt(editableContainer,"paddingTop",window)-WA.Style.getElementStyleInt(editableContainer,"paddingBottom",window);height=Math.max(editableContainerHeight+gadgetHeight-heightMeter.offsetTop,0);container.removeChild(heightMeter);heightMeter=null;container.style.position=gadgetPosition;editableContainer.style.height=height+"px";editableContainer.setAttribute(editableHeightAttribute,height,0);}function init(){var containerImages,i,len;container=WA.$(viewModel.id,window);if(!container){return;}editableContainer=container.querySelector("["+editableAttribute+"]");if(editableContainer){editableContainer.style.height="";containerImages=container.getElementsByTagName("img");for(i=0,len=containerImages.length;i<len;i++){if(!containerImages[i]["complete"]){WA.addHandler(containerImages[i],"load",resetEditableContainerHeight);}}resetEditableContainerHeight();}}function dispose(){if(isDisposed){return;}WA.clearThrottle(setEditableContainerHeight);viewModel=null;container=null;editableContainer=null;isDisposed=true;}BonaPage.addPageStateHandler(BonaPage.PAGE_PARSED,init,BonaPage.HANDLERTYPE_ALWAYS);BonaPage.addPageStateHandler(BonaPage.PAGE_UNLOADED,dispose,BonaPage.HANDLERTYPE_ALWAYS);}})(window,window.WA);(function(){if(!window.ContactAdvancedSearch){window.ContactAdvancedSearch={};}var contactAdvancedSearch=window.ContactAdvancedSearch;var anyConditionValue=-1;var textBoxConditionValue={Empty:4,NotEmpty:5};var dateConditionValue={ThisMonth:4,ThisYear:5,LastMonth:7,LastYear:8,NotDefined:9,AnyDate:10,NextYear:11,NextMonth:12};var conditionSelectorState={Empty:0,NotEmpty:1,Same:2};var selectorTypeId={String:0,RadioButtonList:1,CheckBoxList:2,Date:3,Dropdown:4,Int:5,Decimal
5:6};var dropdownTypeId=4;var checkCriteriaChangedTimeout;contactAdvancedSearch.initialize=function(optionItems){contactAdvancedSearch.optionItems=optionItems||contactAdvancedSearch.optionItems;contactAdvancedSearch.initialized=true;};contactAdvancedSearch.dispose=function(){if(!contactAdvancedSearch.initialized){return;}contactAdvancedSearch.initialized=false;};contactAdvancedSearch.validateCriteriaSelected=function(source,args){for(var i=0;i<contactAdvancedSearch.optionItems.length;i++){var conditionSelector=WA.$(contactAdvancedSearch.optionItems[i].csId,window);if(conditionSelector.value!=anyConditionValue){args.IsValid=true;return;}}args.IsValid=false;};contactAdvancedSearch.prepareValidators=function(){for(var i=0;i<contactAdvancedSearch.optionItems.length;i++){var conditionSelector=WA.$(contactAdvancedSearch.optionItems[i].csId,window);if(conditionSelector.value==anyConditionValue){disableValidators(contactAdvancedSearch.optionItems[i].vIds);continue;}if(contactAdvancedSearch.optionItems[i].t==selectorTypeId.String&&!requiredTextBoxConditionSelected(conditionSelector)){disableValidators(contactAdvancedSearch.optionItems[i].vIds);continue;}if(contactAdvancedSearch.optionItems[i].t==selectorTypeId.Date&&!requiredDateConditionSelected(conditionSelector)){disableValidators(contactAdvancedSearch.optionItems[i].vIds);continue;}enableValidators(contactAdvancedSearch.optionItems[i].vIds);}};contactAdvancedSearch.dateConditionSelector=function(controlId,linkedControlId){var dropDownList=WA.$(controlId,window);var dateControlContainer=WA.$(linkedControlId,window).parentNode;var newReadOnlyContainer=document.createElement("DIV");var readOnlyContainerId="readOnlyContainer_"+linkedControlId;newReadOnlyContainer.setAttribute("id",readOnlyContainerId);newReadOnlyContainer.setAttribute("class","fieldItem");var readOnlyContainer=WA.$(readOnlyContainerId,window);var dateTextThisMonth=MemberDirectoryAdvancedSearchCriteriaList.Labels.DateTextThisMonth;var dateTextThisYear=MemberDirectoryAdvancedSearchCriteriaList.Labels.DateTextThisYear;var dateTextLastMonth=MemberDirectoryAdvancedSearchCriteriaList.Labels.DateTextLastMonth;var dateTextLastYear=MemberDirectoryAdvancedSearchCriteriaList.Labels.DateTextLastYear;var dateTextNextYear=MemberDirectoryAdvancedSearchCriteriaList.Labels.DateTextNextYear;var dateTextNextMonth=MemberDirectoryAdvancedSearchCriteriaList.Labels.DateTextNextMonth;function setReadonlyContainerText(text){if(!readOnlyContainer){newReadOnlyContainer.innerHTML=text;newReadOnlyContainer.style.display="block";dateControlContainer.parentNode.appendChild(newReadOnlyContainer);}else{readOnlyContainer.innerHTML=text;readOnlyContainer.style.display="block";}dateControlContainer.style.display="none";}var selectedValue=dropDownList.options[dropDownList.selectedIndex].value;if(selectedValue==anyConditionValue||selectedValue==dateConditionValue.NotDefined||selectedValue==dateConditionValue.AnyDate){dateControlContainer.style.display="none";if(readOnlyContainer){readOnlyContainer.innerHTML="";readOnlyContainer.style.display="none";}return;}if(selectedValue==dateConditionValue.ThisMonth){setReadonlyContainerText(dateTextThisMonth);return;}if(selectedValue==dateConditionValue.LastMonth){setReadonlyContainerText(dateTextLastMonth);return;}if(selectedValue==dateConditionValue.ThisYear){setReadonlyContainerText(dateTextThisYear);return;}if(selectedValue==dateConditionValue.LastYear){setReadonlyContainerText(dateTextLastYear);return;}if(selectedValue==dateConditionValue.NextYear){setReadonlyContainerText(dateTextNextYear);return;}if(selectedValue==dateConditionValue.NextMonth){setReadonlyContainerText(dateTextNextMonth);return;}dateControlContainer.style.display="block";if(readOnlyContainer){readOnlyContainer.innerHTML="";readOnlyContainer.style.display="none";}};contactAdvancedSearch.textBoxConditionSelector=function(controlId,linkedControlContainerId){var control=WA.$(controlId,window);var linkedControlContainer=WA.$(linkedControlContainerId,window);if(control.value==textBoxConditionValue.Empty||control.value==textBoxConditionValue.NotEmpty){linkedControlContainer.style.display="none";}else{linkedControlContainer.style.display="block";}};contactAdvancedSearch.disposeCriteriaChangeScript=function(){checkCriteriaChangedTimeout=null;};contactAdvancedSearch.initCriteriaChangeScript=function(){for(var i=0;i<optionItems.length;i++){var valuesContainer=WA.$(optionItems[i].vsCId,window);if(optionItems[i].t==selectorTypeId.Dropdown){optionItems[i].inputs=valuesContainer.getElementsByTagName("SELECT");}else{optionItems[i].inputs=valuesContainer.getElementsByTagName("INPUT");}optionItems[i].conditionSelector=WA.$(optionItems[i].csId,window);}runCriteriaChanged();};function runCriteriaChanged(){for(var i=0;i<optionItems.length;i++){var changeStateTo=getChangeDirection(optionItems[i]);applyChangeDirection(optionItems[i],changeStateTo);clearValueIfConditionEmpty(optionItems[i]);}checkCriteriaChangedTimeout=setTimeout(function(){runCriteriaChanged();},300);}function getChangeDirection(item){if(!item.inputs||item.inputs.length==0||!item.inputs[0]){return;}if(item.t==selectorTypeId.Dropdown){var change=conditionSelectorState.Same;if(item.prevSelectedIndex!=item.inputs[0].selectedIndex&&item.inputs[0].selectedIndex!=0){change=conditionSelectorState.NotEmpty;}else{if(item.inputs[0].selectedIndex==0){change=conditionSelectorState.Empty;}}item.prevSelectedIndex=item.inputs[0].selectedIndex;return change;}else{if(item.t==selectorTypeId.String||item.t==selectorTypeId.Int||item.t==selectorTypeId.Decimal||item.toLocaleStr
5ing==selectorTypeId.Date){return item.inputs[0].value?conditionSelectorState.NotEmpty:conditionSelectorState.Empty;}else{if(item.t==selectorTypeId.CheckBoxList){for(var i=0;i<item.inputs.length;i++){if(item.inputs[i].checked){return conditionSelectorState.NotEmpty;}}return conditionSelectorState.Empty;}else{if(item.t==selectorTypeId.RadioButtonList){for(var i=0;i<item.inputs.length;i++){if(item.inputs[i].checked){var change=item.prevSelectedIndex!=i?conditionSelectorState.NotEmpty:conditionSelectorState.Same;item.prevSelectedIndex=i;return change;}}return conditionSelectorState.Same;}}}}}function applyChangeDirection(item,changeStateTo){if(item.prevChangeStateTo!=changeStateTo&&changeStateTo!=conditionSelectorState.Same){if(changeStateTo==conditionSelectorState.Empty&&item.conditionSelector.selectedIndex!=conditionSelectorState.Empty&&!((item.t==selectorTypeId.String||item.t==selectorTypeId.Int||item.t==selectorTypeId.Decimal)&&(item.conditionSelector.value==textBoxConditionValue.Empty||item.conditionSelector.value==textBoxConditionValue.NotEmpty))){item.conditionSelector.selectedIndex=conditionSelectorState.Empty;}if(changeStateTo==conditionSelectorState.NotEmpty&&item.conditionSelector.selectedIndex==conditionSelectorState.Empty){item.conditionSelector.selectedIndex=conditionSelectorState.NotEmpty;}}item.prevChangeStateTo=changeStateTo;}function clearValueIfConditionEmpty(item){if(!item.inputs||item.inputs.length==0||!item.inputs[0]){return;}if(item.conditionSelector.selectedIndex!=0){return;}if(item.t==selectorTypeId.Dropdown){item.prevSelectedIndex=item.inputs[0].selectedIndex;if(item.inputs[0].selectedIndex!==0){item.inputs[0].selectedIndex=0;}}else{if(item.t==selectorTypeId.String||item.t==selectorTypeId.Int||item.t==selectorTypeId.Decimal||item.toLocaleString==selectorTypeId.Date){item.inputs[0].value="";}else{if(item.t==selectorTypeId.CheckBoxList){for(var i=0;i<item.inputs.length;i++){item.inputs[i].checked=false;}}else{if(item.t==selectorTypeId.RadioButtonList){for(var i=0;i<item.inputs.length;i++){if(item.inputs[i].checked){item.prevSelectedIndex=i;}item.inputs[i].checked=false;}}}}}}function requiredDateConditionSelected(conditionSelector){if(conditionSelector.value!=dateConditionValue.ThisMonth&&conditionSelector.value!=dateConditionValue.ThisYear&&conditionSelector.value!=dateConditionValue.NextYear&&conditionSelector.value!=dateConditionValue.NextMonth&&conditionSelector.value!=dateConditionValue.LastMonth&&conditionSelector.value!=dateConditionValue.LastYear&&conditionSelector.value!=dateConditionValue.NotDefined&&conditionSelector.value!=dateConditionValue.AnyDate){return true;}return false;}function requiredTextBoxConditionSelected(conditionSelector){if(conditionSelector.value!=textBoxConditionValue.Empty&&conditionSelector.value!=textBoxConditionValue.NotEmpty){return true;}return false;}function enableValidators(vIds){for(var i=0;i<vIds.length;i++){WA.$(vIds[i],window).enabled=true;}}function disableValidators(vIds){for(var i=0;i<vIds.length;i++){WA.$(vIds[i],window).enabled=false;}}})();function ContactAdvancedSearch_Page_Parsed(){ContactAdvancedSearch.initialize(optionItems);}
6
7/*compiled*/
8var MemberDirectoryListRenderer;
9
10(function() {
11// start of MemberDirectoryListRenderer singleton
12
13  var $ = function (id) { return document.getElementById(id); };
14
15  if(MemberDirectoryListRenderer == null) 
16  {
17    MemberDirectoryListRenderer = new Object();
18
19    /*debug*/var logEnabled = false; function log(text) { if (logEnabled && WA.Log) { WA.Log.add('MemberDirectoryListRenderer', text); } }
20
21    MemberDirectoryListRenderer.FormId = 0;
22    MemberDirectoryListRenderer.DataSourceId = 0;
23
24    MemberDirectoryListRenderer.outputBlockId = 'memberDirectory';
25    MemberDirectoryListRenderer.foundBlockId = 'membersFound';
26    MemberDirectoryListRenderer.pagingBlockId = 'idPagingData';
27    MemberDirectoryListRenderer.pagingBlock2Id = 'idPagingData2';
28    MemberDirectoryListRenderer.waitMessagesBlockId = 'idWaitMessages';
29    MemberDirectoryListRenderer.reloadLinkId = 'idReloadData';
30    MemberDirectoryListRenderer.selectedMembersFieldId = '';
31    MemberDirectoryListRenderer.titleLabelId = '';
32    MemberDirectoryListRenderer.titleTemplate = '';
33    MemberDirectoryListRenderer.imgTemplateRelativePath = '';
34    MemberDirectoryListRenderer.MemberDirectoryListWebServiceUrl_LoadMembers = '';
35    MemberDirectoryListRenderer.notifyGadgetChangedTimeout = 27;
36
37    MemberDirectoryListRenderer.labels = 
38    {
39      serverLoadingStarted    :  '<img src="/Admin/html_res/images/asyncloadprogress.gif">Loading...'
40     ,serverLoadingError      : 'Loading error&nbsp;'
41     ,serverLoadingErrorAlert : 'Server error while loading data.<br>Please contact us at [email protected] and let us know what led to this error.<br><br>Sorry for inconvenience.'
42     ,processingServerData    : 'Processing data, please wait...'
43     ,processingCachedData    : 'Processing cache...'
44     ,searchingKeywords       : 'searching...'
45     ,searchingEmpty          : 'loading...'
46     ,displayingFound         : 'displaying...'
47     ,pagingTemplate          : 'Show:{0}'
48     ,noMembersInDatabase     : 'No members in your database.'
49     ,noMembersFound          : 'No members found. Edit your search text or clear search box to show all members.'
50     ,detailsUrlTitle         : 'Go to member details'
51     ,viewDetails             : 'View details'
52     ,headers                 : { column1: '', column2: '', column3: '', column4: '' }
53    };
54
55    // public methods
56    MemberDirectoryListRenderer.init = init;
57    MemberDirectoryListRenderer.highlightRowAndNext = highlightRowAndNext;
58    MemberDirectoryListRenderer.normlightRowAndNext = normlightRowAndNext;
59    MemberDirectoryListRenderer.highlightRowAndPrev = highlightRowAndPrev;
60    MemberDirectoryListRenderer.normlightRowAndPrev = normlightRowAndPrev;
61    MemberDirectoryListRenderer.redirectToMemberDetails = redirectToMemberDetails;
62    MemberDirectoryListRenderer.pagerChanged = pagerChanged;
63  }
64
65  // state vars
66  var isInited = false;
67  var directoryData;
68  var searchAsyncData;
69  var forceNextAskSearch = false;
70  var lastSeachBoxAskValue = '';
71  var isCached = false;
72  var cache;
73
74  // timeouts and intervals
75  var searchBoxAskTimeout;
76  var processSearchTimeout;
77  var searchAsyncTimeout;
78  var notifyGadgetChangedTimeout = MemberDirectoryListRenderer.notifyGadgetChangedTimeout;
79  
80  // consts
81  var pagerRangeNameLength = 4;
82  var pagerRangeLevelLength = 5;
83  var maxDisplayRecords = 50;
84  var searchBoxAskIntervalMs = 50;
85  var processSearchTimeoutMs = 250;
86  var searchAsyncTimeoutMs = 10;
87  var searchAsyncMaxRecords = 1000;
88
89  //filter
90  var maxFilterQty = 4;
91  var filterValues = new Array (null, null, null, null);
92  var filterOptionCounters = new Array (null, null, null, null);
93  var filterOptionNames = new Array (null, null, null, null);
94  
95  // templates
96
97  var footerTemplate = '</table>';
98  var pagerTemplate = [
99    '<select onchange="MemberDirectoryListRenderer.pagerChanged(this);">'
100  , '</select>'];
101  var pagerOptionTemplate = [
102    '<option value="'
103  , '">'
104  , '-'
105  , '</option>'];
106  var tableStart = '<table id="membersTable" class="membersTable" cellspacing="0"><thead><tr>';
107  var thTemplate = [
108    '<th width="'
109  , '%">'
110  , '</th>'];
111  var headerEnd = "</tr></thead>"
112  var tdTemplate = [
113    '<td class="'
114  , '" width="'
115  , '%">'
116  , '</td>'];
117  var linkTemplate = [
118    '<h5><a title="'
119  , '" onclick="globalUtils.stopEventPropogation(event)" href="'
120  , '">'
121  , '</a></h5>'];
122  var bottomRowTemplate = [
123    '</tr><tr class="normal" bottomrow=\'true\' onclick="MemberDirectoryListRenderer.redirectToMemberDetails(\''
124  , '\')" onmouseover="MemberDirectoryListRenderer.highlightRowA
124ndPrev(this)" onmouseout="MemberDirectoryListRenderer.normlightRowAndPrev(this)"><td class=\'memberDirectoryBottomRow\' colspan=\''
125  , '\'><div class=\'mainDiv\'>'
126  , '</div></td>'];
127  var memberTemplate = [
128    '<tr class="normal" onclick="MemberDirectoryListRenderer.redirectToMemberDetails(\''
129  , '\')" onmouseover="MemberDirectoryListRenderer.highlightRowAndNext(this)" onmouseout="MemberDirectoryListRenderer.normlightRowAndNext(this)">'
130  , '</tr>'];
131  var imgTemplate = [
132    '<img src=\''
133  , '?memberId='
134  , '&id='
135  , '&t='
136  , '\'></img>'];
137  var emailTemplate = [
138    '<a href="mailto:'
139  , '" onclick="window.location=this.href;BonaPage.stopEvent(event);">'
140  , '</a>'];
141
142  var emailReplaceTemplate = '<a href="mailto:$1" onclick="window.location=this.href;BonaPage.stopEvent(event);">$1</a>';
143
144  // reexp
145  var emailReplace1 = /([\w#%\"\*\.!\$\+\-\=\?\^\'\{\}\|\~\&]+@(?:[a-zA-Z0-9_-]+\.)+[a-zA-Z]{1,20})/gim;
146
147  /*****************************************************/
148  /***   INITIALIZATION AND DISPOSING                ***/
149  /*****************************************************/
150
151  function init()
152  {
153    /*debug*/log('init');
154
155    disableSearch();
156    initDisposeEvents();    
157    loadRecordsAsync();
158    initCache();
159    initFilter();
160
161    WA.Gadgets.GadgetDeleted.addHandler(onGadgetDeleted);
162
163    isInited = true;
164  }  
165  
166  function initDisposeEvents()
167  {
168    /*debug*/log('initDisposeEvents');
169
170    if (document.all)
171      window.attachEvent('onunload', dispose);
172    else
173      window.addEventListener('unload', dispose, false);
174  }
175  
176  function dispose()
177  {
178    /*debug*/log('dispose');
179
180    isInited = false;
181
182    WA.Gadgets.GadgetDeleted.removeHandler(onGadgetDeleted);
183
184    disposeAllTimeouts();
185    disposeSearchData();
186    directoryData = null;
187  }
188
189
190  function onGadgetDeleted(sender, args)
191  {
192    /*debug*/log('onGadgetDeleted');
193    args = args || {};
194
195    var versionData = MemberDirectoryListRenderer.VersionData;
196
197    if (versionData && args.componentId && args.componentId == versionData.componentId)
198    {
199      dispose();
200    }
201  }
202
203  
204  function disposeAllTimeouts()
205  {
206    /*debug*/log('disposeAllTimeouts');
207
208    WA.clearThrottle(doNotifyGadgetChanged);
209
210    if (searchBoxAskTimeout)
211      clearTimeout(searchBoxAskTimeout);
212  
213    if (processSearchTimeout)
214      clearTimeout(processSearchTimeout);
215
216    terminateAsyncSearch();
217  }
218  
219  function disposeSearchData()
220  {
221    /*debug*/log('disposeSearchData');
222
223    searchData = null;
224  }
225
226  /*****************************************************/
227  /***   CACHE HELPERS                               ***/
228  /*****************************************************/
229  
230  function initCache()
231  {
232    /*debug*/log('initCache');
233
234    if (!cache)
235    {
236      cache = new Object();
237    }
238  
239    try
240    {
241      top.cache = cache;
242    }
243    catch(e){}
244          
245    if (!cache.memberDirectory)
246    {
247      cache.memberDirectory = {
248        isReady : false,
249        serverResponse : null,
250        totalCount : null,
251        colTitlesData : null,
252        membersData : null,
253        searchData : null,
254        safeData : null,
255        foundCount: null
256      };     
257    }
258  }
259  
260  function clearCache()
261  {
262    /*debug*/log('clearCache');
263
264    if (cache && cache.memberDirectory)
265    {
266      cache.memberDirectory = null;
267    }
268    
269    initCache();
270  }
271
272  function getCachedDirectoryData()
273  {
274    /*debug*/log('getCachedDirectoryData');
275
276    initCache();
277    return cache.memberDirectory;
278  }
279
280  /*****************************************************/
281  /***   DISPLAY MESSAGES HELPERS                    ***/
282  /*****************************************************/
283  
284  function setMessage(message)
285  {
286    /*debug*/log('setMessage');
287
288    var messageBlock = $(MemberDirectoryListRenderer.waitMessagesBlockId);
289    if (messageBlock)
290    {
291      messageBlock.innerHTML = message;
292      messageBlock.style.display = message ? 'inline' : 'none';
293    }
294  }
295
296  function setFound(found)
297  {
298    /*debug*/log('setFound');
299
300    var foundBlock = $(MemberDirectoryListRenderer.foundBlockId);
301
302    if (foundBlock)
303    {
304      if (found != 0 && (found == null || found == ''))
305      {
306        foundBlock.innerHTML = '';
307        foundBlock.style.display = 'none';
308        hideReload()
309        hidePaging();
310      }
311      else
312      {
313        foundBlock.innerHTML = found;
314        foundBlock.style.display = 'inline';
315      }
316    }
317  }
318  
319  function hideReload()
320  {
321    /*debug*/log('hideReload');
322
323    $(MemberDirectoryListRenderer.reloadLinkId).style.display = 'none';
324  }
325  
326  function showReload()
327  {
328    /*debug*/log('showReload');
329
330    var reloadLink = $(MemberDirectoryListRenderer.reloadLinkId);
331    reloadLink.style.display = 'inline';
332    reloadLink.onclick = null;
333    reloadLink.onclick = reloadData;
334  }
335  
336  function setPaging(selectHTML, seletedValue)
337  {
338    /*debug*/log('setPaging');
339
340    var pagers = [
341      $(MemberDirectoryListRenderer.pagingBlockId),
342      $(MemberDirectoryListRenderer.pagingBlock2Id)
343    ]
344    var i;
345    var oi;
346    
347    for (i = 0; i < pagers.length; i++)
348    {
349      pagers[i].innerHTML = MemberDirectoryListRenderer.labels.pagingTemplate.replace(/\{0\}/g, selectHTML); 
350      pagers[i].style.display = 'inline';
351
352      var pagerSelect = pagers[i].getElementsByTagName('SELECT')[0];
353      for (oi = 0; oi < pagerSelect.options.length; oi++)
354      {
355        if (pagerSelect.options[oi].value == seletedValue)
356        {
357          pagerSelect.options[oi].selected = true;
358          break;
359        }
360      }
361    }
362  }
363  
364  function hidePaging()
365  {
366    /*debug*/log('hidePaging');
367
368    var pagingBlock = $(MemberDirectoryListRenderer.pagingBlockId);
369    if (pagingBlock)
370    {
371      pagingBlock.style.display = 'none';
372    }
373    var pagingBlock2 = $(MemberDirectoryListRenderer.pagingBlock2Id);
374    if(pagingBlock2)
375    {
376      pagingBlock2.style.display = 'none';
377    }
378  }
379  
380  function isPagerHidden()
381  {
382    /*debug*/log('isPagerHidden');
383
384    return $(MemberDirectoryListRenderer.pagingBlockId) && ($(MemberDirectoryListRenderer.pagingBlockId).style.dysplay != 'inline');
385  }
386  function setDirectoryOutput(html, encodeHtml)
387  {
388    /*debug*/log('setDirectoryOutput');
389
390    var outputBlock = $(MemberDirectoryListRenderer.outputBlockId);
391    
392    if (!outputBlock)
393    {
394      return;
395    }
396    
397    if (encodeHtml == true) //encodeHtml may not be bool
398    {
399      outputBlock[document.all ? "innerText" : "textContent"] = html ? html : '';
400    }
401    else
402    {
403      outputBlock.innerHTML = html ? html : '';
404    }
405  }
406
407  /*****************************************************/
408  /***   SEARCHBOX                                   ***/
409  /*****************************************************/
410
411  function getSearchKeywords()
412  {
413    /*debug*///log('getSearchKeywords');
414
415    var searchBoxElem = $(MemberDirectoryListRenderer.searchBoxId);
416    
417    if (!searchBoxElem)
418    {
419      dispose();
420      return false;
421    }
422    
423    var normalizedSearchPhrase = searchBoxElem.value.replace(/\s+/g, ' ');
424    normalizedSearchPhrase = normalizedSearchPhrase.replace(/^\s*(.*?)\s*$/, '$1');
425    return normalizedSearchPhrase;
426  }
427
428  function convertKeywordsToArray(keywords)
429  {
430    /*debug*/log('convertKeywordsToArray');
431
432    if (!keywords)
433      return new Array();
434    
435    var keywordsBeforeEncode = keywords.toLowerCase().split(' ');
436    var result = new Array();
437    
438    for (var i = 0; i < keywordsBeforeEncode.length; i++)
439    {
440      result[i] = BonaPage.encodeHtml(keywordsBeforeEncode[i]);
441    }
442    
443    return result;
444  }
445
446  function enableSearch(searchValue, autofocus)
447  {
448    /*debug*/log('enableSearch');
449
450    var searchBox;
451
452    autofocus = autofocus === undefined ? true : autofocus;
453
454    if (!WA.AdminPanel || !WA.AdminPanel.PageMode || WA.AdminPanel.PageMode.Mode() != WA.AdminPanel.PageModeType.Edit)
455    {
456      searchBox = $(MemberDirectoryListRenderer.searchBoxId);
457
458      if (searchValue)
459        searchBox.value = searchValue;
460
461      searchBox.onkeypress = searchBoxIgnoreEnter;
462      searchBox.disabled = false;
463      try 
464      {
465        if(autofocus)
466        {
467          searchBox.focus();
468        }
469     } catch (e) {}
470    }
471    
472    if (searchBoxAskTimeout)
473      clearTimeout(searchBoxAskTimeout);
474      
475    searchBoxAskTimeout = setTimeout(searchBoxAsk, searchBoxAskIntervalMs);
476  }
477  
478  function disableSearch()
479  {
480    /*debug*/log('disableSearch');
481
482    if (searchBoxAskTimeout)
483      clearTimeout(searchBoxAskTimeout);
484
485    var searchBox = $(MemberDirectoryListRenderer.searchBoxId);
486    //searchBox.disabled = true;
487  }
488  
489  function stopAskSearchBox()
490  {
491    /*debug*/log('stopAskSearchBox');
492
493    if (searchBoxAskTimeout)
494      clearTimeout(searchBoxAskTimeout);
495  }
496  
497  function searchBoxIgnoreEnter(e)
498  {
499    /*debug*/log('searchBoxIgnoreEnter');
500
501    if (!isInited) 
502      return false;
503
504    if (!e) 
505      e = event;
506
507    if (e.keyCode == 13)
508    {
509      forceNextAskSearch = true;
510      return false;
511    }
512  }
513
514  function searchBoxAsk()
515  {
516    if (searchBoxAskTimeout)
517      clearTimeout(searchBoxAskTimeout);
518
519    if (!isInited) { return; }
520
521    /*debug*///log('searchBoxAsk');
522
523    var searchKeywords = getSearchKeywords();
524    
525    if (searchKeywords == lastSeachBoxAskValue && !forceNextAskSearch)
526    {
527      searchBoxAskTimeout = setTimeout(searchBoxAsk, searchBoxAskIntervalMs);
528      return;
529    }
530
531    forceNextAskSearch = false;      
532    lastSeachBoxAskValue = searchKeywords;
533
534    if (processSearchTimeout) 
535      clearTimeout(processSearchTimeout);
536
537    terminateAsyncSearch();
538
539    var searchMessage = searchKeywords ? 
540      MemberDirectoryListRenderer.labels.searchingKeywords :
541      MemberDirectoryListRenderer.labels.searchingEmpty;
542    
543    setFound();
544    setMessage(searchMessage);
545
546    notifyGadgetChanged();
547
548    processSearchTimeout = setTimeout(function() { searchAndRenderAsync(searchKeywords); }, processSearchTimeoutMs);
549    searchBoxAskTimeout = setTimeout(searchBoxAsk, searchBoxAskIntervalMs);
550  }
551  function setTitle(count)
552  {
553    /*debug*/log('setTitle');
554
555    return;
556    var titleLabel = $(MemberDirectoryListRenderer.titleLabelId);
557    titleLabel.innerHTML = MemberDirectoryListRenderer.titleTemplate.replace(/\{0\}/g, count); 
558    titleLabel.style.visibility = 'visible';
559  }
560  /*****************************************************/
561  /***   DATA LOADING AND PROCESSING                 ***/
562  /*****************************************************/
563
564  function loadRecordsAsync()
565  {
566    /*debug*/log('loadRecordsAsync');
567
568    directoryData = getCachedDirectoryData();
569
570    isCached = false;
571    setFound(MemberDirectoryListRenderer.labels.serverLoadingStarted);
572
573    notifyGadgetChanged();
574    
575    /*
576    var match = document.body.id.match(/pageid_(\d+)/i);
577    
578    if (match != null) 
579    {
580	    var pageId = match[1];
581    } 
582    */
583
584    var formData = { 'formId' : MemberDirectoryListRenderer.FormId };
585
586    if (MemberDirectoryListRenderer.VersionData)
587    {
588      formData.pageId = MemberDirectoryListRenderer.VersionData.pageId;
589      formData.versionId = MemberDirectoryListRenderer.VersionData.versionId;
590      formData.componentId = MemberDirectoryListRenderer.VersionData.componentId;
591    }
592
593    // AJAX call
594    WA.Ajax({
595      url : MemberDirectoryListRenderer.MemberDirectoryListWebServiceUrl_LoadMembers,
596      data : formData,
597      type : 'POST',
598      success : loadRecordsCallback,
599      error : loadRecordsErrorCallback
600    });
601  }
602  
603  function loadRecordsErrorCallback(result)
604  {
605    /*debug*/log('loadRecordsErrorCallback');
606
607    setFound(MemberDirectoryListRenderer.labels.serverLoadingError);
608    setMessage();    
609    showReload();
610    setDirectoryOutput(MemberDirectoryListRenderer.labels.serverLoadingErrorAlert);
611    notifyGadgetChanged();
612  }
613  
614  function loadRecordsCallback(result)
615  {
616    /*debug*/log('loadRecordsCallback');
617
618    setFound(result.TotalCount);
619    setMessage(MemberDirectoryListRenderer.labels.processingServerData);
620    directoryData.serverResponse = result;
621    notifyGadgetChanged();
622    setTimeout(processServerData, 10);
623  }
624
625  function processCachedData()
626  {
627    /*debug*/log('processCachedData');
628
629    lastSeachBoxAskValue = directoryData.lastKeywords;
630    forceNextAskSearch = false;
631    enableSearch(lastSeachBoxAskValue);
632    searchAndRenderAsync(directoryData.lastKeywords, directoryData.lastRenderIndex);
633  }
634 
635
636
637
638  function processServerData()
639  {
640    /*debug*/log('processServerData');
641
642    var jsonStructure;
643    eval('jsonStructure = ' + directoryData.serverResponse.JsonStructure + ';');
644	
645	//directoryData.serverResponse = createMembers(20000);
646	//jsonStructure=directoryData.serverResponse.JsonStructure;
647
648    directoryData.totalCount = directoryData.serverResponse.TotalCount;
649    directoryData.serverResponse = null;
650    directoryData.layout = jsonStructure.layout;
651    directoryData.membersData = jsonStructure.members;
652
653    prepareSearchData();
654    setTitle(directoryData.totalCount);    
655    jsonStructure = null;
656    directoryData.statuses = null;
657
658    directoryData.isReady = true;
659    forceNextAskSearch = true;
660    enableSearch(undefined, false);
661  }
662
663
664
665
666  function prepareSearchData()
667  {
668    /*debug*/log('prepareSearchData');
669
670    directoryData.searchData = new Array();
671    directoryData.safeData = new Array();
672    directoryData.counterData = new Array();
673    var searchData = directoryData.searchData;
674    var safeData = directoryData.safeData;
675    var counterData = directoryData.counterData;
676    var totalCount = directoryData.totalCount;
677    var searchableMembersData = directoryData.membersData[0];
678    var searchDataForMember = new Array();
679    
680    for (i = 0; i < totalCount; i++)
681    {
682      pushColumnToSearchableData(searchDataForMember, searchableMembersData[i].c1);
683      pushColumnToSearchableData(searchDataForMember, searchableMembersData[i].c2);
684      pushColumnToSearchableData(searchDataForMember, searchableMembersData[i].c3);
685      pushColumnToSearchableData(searchDataForMember, searchableMembersData[i].c4);
686      pushColumnToSearchableData(searchDataForMember, searchableMembersData[i].c5);
687      
688      searchData.push(searchDataForMember.join(' '));
689      safeData.push(searchDataForMember.join(' '));
690
691
692      searchDataForMember = new Array();
693    }
694  }
695  function pushColumnToSearchableData(searchData, column)
696  {
697    /*debug*///log('pushColumnToSearchableData');
698
699    if (!column)
700      {
701        return;
702      }
703      
704      for (var j = 0; j < column.length; j++)
705      {
706        if (column[j].fft != 12)// picture
707        {
708          searchData.push(column[j].v.toLowerCase());          
709        }
710      }
711  }
712
713
714  function reloadData()
715  {
716    /*debug*/log('reloadData');
717
718    disposeAllTimeouts();
719    hideReload();
720    hidePaging();
721    setFound();
722    disableSearch();
723    lastSeachBoxAskValue = '';
724    clearCache();
725    setDirectoryOutput();
726    notifyGadgetChanged();
727
728    setTimeout(loadRecordsAsync, 10);
729  }
730//------------
731//filter stuff
732//------------
733	function isFilterEnabled()
734	{
735    /*debug*/log('isFilterEnabled');
736
737    return $("idFilterColumns");
738	}
739
740	function initFilter()
741	{
742    /*debug*/log('initFilter');
743
744    var i, j;
745	var optColumn;
746	var options;
747
748	for (i = 1; i <= maxFilterQty; i++)
749	{
750		optColumn = $("idF"+i+"Options");
751
752		if (optColumn)
753		{
754			$("idF"+i+"Change").onclick=changeClick;
755			filterOptionCounters[i-1]=new Array();
756			filterOptionNames[i-1]=new Array();
757	 		options=WA.$$('.optionLink', optColumn);
758
759      if (options)
760      {
761        for (j = 0; j < options.length; j++)
762        {
763          options[j].onclick = optionClick;
764          filterOptionCounters[i - 1]['opt' + options[j].getAttribute("fId", 0)] = 0;
765          filterOptionNames[i - 1]['opt' + options[j].getAttribute("fId", 0)] = options[j].innerHTML;
766        }
767      }
768		}
769 	}
770  }
771
772
773  function optionClick()
774  {
775    /*debug*/log('optionClick');
776
777    var curRow = this.parentNode.parentNode.parentNode.id.substr(3,1);
778  	  $("idF"+curRow+"Options").style.display = "none";
779  	  $("idF"+curRow+"Selected").style.display = "block";
780  	  $("idF"+curRow+"SelName").innerHTML = '&raquo; ' + filterOptionNames[curRow - 1]['opt'+this.getAttribute("fId", 0)];
781  	  filterValues[curRow-1] = this.getAttribute("fId", 0);
782  	  applyFilters();
783  	  return false;
784  }
785
786  function changeClick()
787  {
788    /*debug*/log('changeClick');
789
790    var curRow = this.id.substr(3,1);
791  	  $("idF"+curRow+"Options").style.display = "block";
792  	  $("idF"+curRow+"Selected").style.display = "none";
793  	  $("idF"+curRow+"SelName").innerHTML = "";
794  	  filterValues[curRow-1] = null;
795  	  applyFilters();
796  	  return false;
797  }
798
799	function filterIsOn()
800	{
801    /*debug*/log('filterIsOn');
802
803    var i;
804		var l = filterValues.length;
805		var cnt = 0;
806
807		for (i = 0; i < l; i++)
808		{
809			if (filterValues[i] != null)
810			{
811				cnt++;
812			}
813		}
814		return cnt;
815	}
816
817	function applyFilters()
818	{
819    /*debug*/log('applyFilters');
820
821    var i, j, l;
822		var matchCount = 0;
823		var totalCount = directoryData.totalCount;
824		var filterVal = filterIsOn();
825
826		//preparing
827		setFound();
828	    setMessage(MemberDirectoryListRenderer.labels.searchingKeywords);
829
830		for (i = 0; i < totalCount; i++)
831		{
832			directoryData.searchData[i]=directoryData.safeData[i];
833		}
834
835		if (filterVal)
836		{
837			for (i = 0; i < totalCount; i++)
838			{
839				matchCount = 0;
840
841				for (l = 1; l < maxFilterQty+1; l++)
842				{
843					if (filterValues[l-1] == null) //no filter is set for column
844					{
845						matchCount++;
846						continue;
847					}
848
849					var memberFilterValue = directoryData.membersData[0][i]['f' + l];
850
851					if (!memberFilterValue)
852					{
853						continue;
854					}
855
856					for (j = 0; j < memberFilterValue.length; j++)  
857					{
858						if (memberFilterValue[j] == filterValues[l-1])
859						{
860							matchCount++;
861							break;
862						}
863					}
864				}
865
866				if (matchCount != maxFilterQty)
867				{
868					directoryData.searchData[i] = '';
869				}
870			}
871		}
872
873
874		searchAndRenderAsync(getSearchKeywords());
875    notifyGadgetChanged();
876	}
877
878
879	function updateCounters(searchInResults)
880	{
881    /*debug*/log('updateCounters');
882
883    var i, l, m;
884		var memberFilterValue;
885
886		if (!isFilterEnabled) return;
887
888		var finalIndex = searchInResults ? searchAsyncData.foundIndexes.length : directoryData.totalCount;
889		
890		resetCounters();
891
892		for (i = 0; i < finalIndex; i++)
893		{
894			for (l = 1; l < maxFilterQty+1; l++)
895			{
896				if (filterValues[l-1]) //filter is set, why bother updating invisible numbers?
897				{
898					continue;
899				}
900				memberFilterValue = searchInResults ? directoryData.membersData[0][searchAsyncData.foundIndexes[i]]['f' + l] : directoryData.membersData[0][i]['f' + l];
901
902				if (memberFilterValue)
903				{
904					for (m = 0; m < memberFilterValue.length; m++)
905					{
906					    if (filterOptionCounters[l-1])
907					    {
908						    filterOptionCounters[l-1]['opt'+memberFilterValue[m]]++;
909						}
910					}
911				}
912
913			}
914		}
915
916		drawCounters();
917	}
918
919
920	function resetCounters()
921	{
922    /*debug*/log('resetCounters');
923
924    var l, m;
925
926		for (l = 0; l < filterOptionCounters.length; l++)
927		{
928			if (filterOptionCounters[l])
929			{
930				for (m in filterOptionCounters[l])
931				{
932					if (typeof(filterOptionCounters[l][m]) == "number")
933					{
934						filterOptionCounters[l][m] = 0;
935					}
936				}
937			}
938		}
939	}
940
941	function drawCounters()
942	{
943    /*debug*/log('drawCounters');
944
945    var i, j;
946		var optColumn;
947		var options;
948		var qty, name;
949		var whereIsSpace;
950
951	    for (i = 1; i <= maxFilterQty; i++)
952	    {
953	    	optColumn=jq$("#idF"+i+"Options");
954
955
956		 	if (optColumn)
957		 	{
958		 		options = jq$("#idF"+i+"Options .optionLink");
959
960        if (options)
961        {
962          for (j = 0; j < options.length; j++)
963          {
964            qty = filterOptionCounters[i - 1]['opt' + options[j].getAttribute("fId", 0)] * 1;
965            name = WA.String.gtrim(filterOptionNames[i - 1]['opt' + options[j].getAttribute("fId", 0)]);
966
967
968            whereIsSpace = name.lastIndexOf(' ');
969
970            if (whereIsSpace >= 0)
971            {
972              name = name.slice(0, whereIsSpace) + ' <nobr>' + name.slice(whereIsSpace + 1);
973            } else
974            {
975              name = '<nobr>' + name;
976            }
977
978            options[j].innerHTML = name + ' ' + '<span class="optionCounter">(' + qty + ')</span></nobr>';
979            options[j].className = (qty && qty > 0) ? "optionLink" : "optionLink emptyName";
980          }
981        }
982		 	}
983		}
984	}
985
986  /*****************************************************/
987  /***   SEARHCING                                   ***/
988  /*****************************************************/
989
990  function searchAndRenderAsync(keywords, renderStartIndex)
991  {
992    /*debug*/log('searchAndRenderAsync');
993
994    terminateAsyncSearch();
995
996    directoryData.lastKeywords = keywords;
997
998    if (!searchAsyncData)
999    {
1000      searchAsyncData = new Object();
1001      searchAsyncData.sessionId = 0;
1002    }
1003
1004    var sessionId = searchAsyncData.sessionId + 1;
1005    searchAsyncData.sessionId = sessionId;
1006    searchAsyncData.inProgress = true;
1007    searchAsyncData.foundCount = 0;
1008    searchAsyncData.nextIndex = 0;
1009    searchAsyncData.sourceKeywords = keywords;
1010    searchAsyncData.keywordsArray = convertKeywordsToArray(keywords);
1011    searchAsyncData.foundIndexes = new Array();
1012    searchAsyncData.pagerHtml = null;
1013    
1014    if (searchAsyncData.keywordsArray.length > 0 || filterIsOn())
1015    {
1016      searchAsyncTimeout = setTimeout(function() { searchAsync(sessionId, renderStartIndex); }, 5);
1017    }
1018    else
1019    {
1020      searchAsyncData.foundCount = directoryData.totalCount;      
1021      searchAsyncData.nextIndex = searchAsyncData.foundCount;
1022      searchAsyncData.inProgress = false;
1023      renderAsync(renderStartIndex);
1024      updateCounters(false);
1025    }
1026  }
1027
1028
1029
1030
1031  function searchAsync(sessionId, renderStartIndex)
1032  {
1033    /*debug*/log('searchAsync');
1034
1035    if (searchAsyncTimeout)
1036      clearTimeout(searchAsyncTimeout);
1037  
1038    if (!searchAsyncData || sessionId != searchAsyncData.sessionId)
1039    {
1040      terminateAsyncSearch();
1041      return;
1042    }
1043    
1044    if (searchAsyncData.nextIndex >= directoryData.totalCount)
1045    {
1046      terminateAsyncSearch();
1047      searchAsyncData.inProgress = false;
1048      //search is over
1049      updateCounters(true);
1050      renderAsync(renderStartIndex);
1051      return;
1052    }
1053
1054    var keywordsArray = searchAsyncData.keywordsArray;
1055    var searchIndexData = directoryData.searchData;
1056    var stopCycleIndex = Math.min(directoryData.totalCount, searchAsyncData.nextIndex + searchAsyncMaxRecords);
1057
1058    var keywordsArrayLength = keywordsArray.length;
1059
1060
1061    for (i = searchAsyncData.nextIndex; i < stopCycleIndex; i++)
1062    {
1063
1064      var searchIndexDataLength = searchIndexData[i].length;
1065
1066      if (searchIndexDataLength == 0)
1067      {
1068      	  continue;
1069      }
1070
1071      for (j = 0; j < keywordsArrayLength; j++)
1072      {
1073        if (searchIndexData[i].indexOf(keywordsArray[j]) == -1)
1074          break;
1075      }
1076      
1077      if (j == keywordsArrayLength)
1078      {
1079        searchAsyncData.foundCount++;
1080        searchAsyncData.foundIndexes.push(i);
1081      }
1082    }
1083
1084    searchAsyncData.nextIndex = stopCycleIndex;
1085
1086    searchAsyncTimeout = setTimeout(function() { searchAsync(sessionId, renderStartIndex); }, searchAsyncTimeoutMs);
1087  }
1088  
1089  
1090
1091
1092
1093  function terminateAsyncSearch()
1094  {
1095    /*debug*/log('terminateAsyncSearch');
1096
1097    if (searchAsyncTimeout)
1098      clearTimeout(searchAsyncTimeout);
1099  }
1100  
1101  /*****************************************************/
1102  /***   RENDERING                                   ***/
1103  /*****************************************************/
1104
1105  function renderAsync(startIndex)
1106  {
1107    /*debug*/log('renderAsync');
1108
1109    if (!searchAsyncData || searchAsyncData.inProgress)
1110      return;
1111    
1112    hidePaging();
1113    //setMessage(MemberDirectoryListRenderer.labels.displayingFound);
1114
1115    startIndex = parseInt(startIndex);
1116    if (!startIndex)
1117      startIndex = 0;
1118
1119    setTimeout(function() { render(startIndex); }, 10);
1120  }
1121  function prepareHeader()
1122  {
1123    /*debug*/log('prepareHeader');
1124
1125    var layout = directoryData.layout;
1126    var headerTemplate = new Array();
1127    
1128    headerTemplate.push(tableStart);
1129    addHeaderIfReq(headerTemplate, layout.c1);
1130    addHeaderIfReq(headerTemplate, layout.c2);
1131    addHeaderIfReq(headerTemplate, layout.c3);
1132    addHeaderIfReq(headerTemplate, layout.c4); 
1133    headerTemplate.push(headerEnd);
1134    
1135    return headerTemplate.join('');
1136  }
1137  function addHeaderIfReq(headerTemplate, column)
1138  {
1139    /*debug*/log('addHeaderIfReq');
1140
1141    if (column.v == true) // visible
1142    {
1143      headerTemplate.splice(headerTemplate.length, 0,
1144        thTemplate[0], column.w, // width
1145        thTemplate[1], column.h, // header
1146        thTemplate[2]);
1147    }
1148  }  
1149  function render(startIndex)
1150  {
1151    /*debug*/log('render');
1152
1153    if (!searchAsyncData || searchAsyncData.inProgress)
1154    {
1155      notifyGadgetChanged();
1156      return;
1157    }
1158    
1159    directoryData.lastRenderIndex = startIndex;
1160
1161    var keywordsDefined = searchAsyncData.keywordsArray.length > 0 || filterIsOn();
1162    
1163    if (searchAsyncData.foundCount > 0)
1164    {
1165      var i;  
1166      var a = new Array();
1167      
1168      a.splice(a.length, 0, prepareHeader());
1169
1170      stopRenderIndex = Math.min(startIndex + maxDisplayRecords, searchAsyncData.foundCount);
1171
1172      var realIndex,
1173          detailsUrlTooltip = MemberDirectoryListRenderer.labels.detailsUrlTitle,
1174          searchableMembersData = directoryData.membersData[0],
1175          otherMembersData = directoryData.membersData[1],
1176          detailsUrlPrefix = MemberDirectoryListRenderer.detailsUrlTemplate,
1177          formId = MemberDirectoryListRenderer.FormId;
1178     
1179      for (i = startIndex; i < stopRenderIndex; i++)
1180      {
1181        realIndex = keywordsDefined ? searchAsyncData.foundIndexes[i] : i;
1182        a.splice(a.length, 0, 
1183          memberTemplate[0], createDetailsUrl(detailsUrlPrefix, otherMembersData[realIndex], formId),
1184          memberTemplate[1], prepareColumn(searchableMembersData[realIndex], otherMembersData[realIndex]),
1185          memberTemplate[2]
1186        );
1187      }
1188
1189      a.push(footerTemplate);
1190      
1191      setDirectoryOutput(a.join(''));
1192      a = null;
1193    }
1194    else
1195    {
1196      // no records
1197      setDirectoryOutput(keywordsDefined ?
1198        MemberDirectoryListRenderer.labels.noMembersFound.replace(/\{0\}/g, searchAsyncData.sourceKeywords) :
1199        MemberDirectoryListRenderer.labels.noMembersInDatabase, true);
1200    }
1201
1202    setMessage();
1203    setFound(searchAsyncData.foundCount);
1204    
1205    if (isCached)
1206      showReload();
1207    
1208    renderPager(startIndex);
1209    notifyGadgetChanged();
1210  }
1211
1212
1213  function notifyGadgetChanged()
1214  {
1215    /*debug*/log('notifyGadgetChanged');
1216
1217    WA.throttle(doNotifyGadgetChanged, notifyGadgetChangedTimeout);
1218  }
1219
1220
1221  function doNotifyGadgetChanged()
1222  {
1223    /*debug*/log('doNotifyGadgetChanged');
1224
1225    WA.Gadgets.notifyGadgetChanged();
1226  }
1227
1228
1229  function createDetailsUrl(detailsUrlPrefix, memberId, formId)
1230  {
1231    /*debug*///log('createDetailsUrl');
1232
1233    var url;
1234
1235    if (formId == 0)
1236    {
1237      url = detailsUrlPrefix + memberId;
1238    } 
1239    else
1240    {
1241      url = detailsUrlPrefix + memberId + '/' + formId; 
1242    }
1243
1244    return url;
1245  }
1246  function prepareColumn(memberData, memberId)
1247  {
1248    /*debug*/log('prepareColumn');
1249
1250    var layout = directoryData.layout; 
1251    var memberTdTemplate = new Array();
1252    var detailsUrlTooltip = MemberDirectoryListRenderer.labels.detailsUrlTitle;    
1253    
1254    var columnsCount = new Object();
1255    columnsCount.value = 0;
1256    addColumnIfReq(layout.c1, memberData.c1, memberTdTemplate, columnsCount, memberId, true);
1257    addColumnIfReq(layout.c2, memberData.c2, memberTdTemplate, columnsCount, memberId, false);
1258    addColumnIfReq(layout.c3, memberData.c3, memberTdTemplate, columnsCount, memberId, false);
1259    addColumnIfReq(layout.c4, memberData.c4, memberTdTemplate, columnsCount, memberId, false);
1260    addBottomRowIfReq(layout.c5, memberData.c5, memberTdTemplate, columnsCount, memberId, false);
1261
1262    return memberTdTemplate.join('');
1263  }
1264  function addColumnIfReq(layoutColumn, memberColumn, memberTdTemplate, columnsCount, memberId, makeLink)
1265  {
1266    /*debug*///log('addColumnIfReq');
1267
1268    if (layoutColumn.v != true) 
1269    {
1270      return;
1271    }
1272    
1273    ++columnsCount.value;
1274  
1275    memberTdTemplate.splice(memberTdTemplate.length, 0, 
1276      tdTemplate[0], 'memberDirectoryColumn' + columnsCount.value,
1277      tdTemplate[1], layoutColumn.w,
1278      tdTemplate[2], getValueFromColumn(memberColumn, memberId, makeLink),
1279      tdTemplate[3]);
1280  }    
1281  function addBottomRowIfReq(bottomRow, memberColumn, memberTdTemplate, columnsCount, memberId)
1282  {
1283    /*debug*///log('addBottomRowIfReq');
1284
1285    var url = MemberDirectoryListRenderer.detailsUrlTemplate + memberId;
1286    
1287    if (bottomRow.v != true) // visible
1288    {
1289      return;
1290    }
1291    
1292    memberTdTemplate.splice(memberTdTemplate.length, 0, 
1293      bottomRowTemplate[0], url,
1294      bottomRowTemplate[1], columnsCount.value,
1295      bottomRowTemplate[2], getValueFromColumn(memberColumn, memberId, false),
1296      bottomRowTemplate[3]);
1297  }    
1298  
1299  function getValueFromColumn(memberColumn, memberId, makeLink)
1300  {
1301    /*debug*///log('getValueFromColumn');
1302
1303    var inner = '';
1304      
1305    if (!memberColumn)
1306    {
1307      return inner;
1308    }
1309
1310    for (var i = 0; i < memberColumn.length; i++)
1311    {
1312      var ar;
1313      var value = memberColumn[i].v;
1314      var imgValue = value;
1315
1316      if (i == 0)
1317      {
1318        var ix = imgValue.lastIndexOf(' (');
1319
1320        if (ix >= 0)
1321        {
1322          imgValue = imgValue.substr(0, ix);
1323        }
1324      }
1325
1326      var fieldType = memberColumn[i].fft;
1327      
1328      // check for email
1329      if(fieldType != 5 && emailReplace1.test(BonaPage.decodeHtml(value))) 
1330      {
1331        value = BonaPage.decodeHtml(value).replace(emailReplace1, emailReplaceTemplate);
1332      }
1333      
1334      if (fieldType == 12) //Picture
1335      {
1336        if (value != '')
1337        {
1338          ar = new Array();
1339          ar.splice(ar.length, 0,
1340            imgTemplate[0], MemberDirectoryListRenderer.imgTemplateRelativePath,
1341            imgTemplate[1], memberId,
1342            imgTemplate[2], imgValue,
1343            imgTemplate[3], (new Date()).getTime(),
1344            imgTemplate[4]);
1345          value = ar.join('');
1346        }
1347      }
1348      else if (fieldType == 5 && !(makeLink == true && i == 0)) // Email
1349      {
1350        if (value != '')
1351        {
1352          ar = new Array();
1353          ar.splice(ar.length, 0,
1354            emailTemplate[0], value,
1355            emailTemplate[1], value,
1356            emailTemplate[2]);
1357          value = ar.join('');
1358          ar = new Array();
1359        }
1360      }
1361      else if (value != '' && !(makeLink == true && i == 0))
1362      {
1363        var reLinkReplace1 = new RegExp("(\\s|^|\\>|\\<|\\}
1363|\\]|\\[|\\{)((http|https|ftp)://[^\\n\\s\\<\\>\\[\\{\\]\\}]+)", "gi");
1364        var reLinkReplace2 = new RegExp("(\\s|^|\\>|\\<|\\}|\\]|\\[|\\{)(([io]?www\.|ftp\.)[^\\n\\s\\<\\>\\[\\{\\]\\}]+)", "gi");
1365        var processedValue = 
1366        value = (reLinkReplace1.test(value))
1367          ? value.replace(reLinkReplace1, '$1<a onclick="window.open(\'$2\');BonaPage.stopEvent(event);" href="$2" target=_blank>$2</a>')
1368          : value.replace(reLinkReplace2, '$1<a onclick="window.open(\'http://$2\');BonaPage.stopEvent(event);" href="http://$2" target=_blank>$2</a>');
1369      }
1370
1371      if (i === 0 && makeLink === true)
1372      {
1373        var ar = new Array();
1374        ar.splice(ar.length, 0,
1375          linkTemplate[0], MemberDirectoryListRenderer.labels.detailsUrlTitle,
1376          linkTemplate[1], createDetailsUrl(MemberDirectoryListRenderer.detailsUrlTemplate, memberId, MemberDirectoryListRenderer.FormId),
1377          linkTemplate[2], value == '' ? MemberDirectoryListRenderer.labels.viewDetails : value,
1378          linkTemplate[3]);
1379        value = ar.join('');
1380      }
1381
1382      if (value != '')
1383      {
1384        inner += '<div class=\'memberValue\'>' + value + '</div>';
1385      }
1386    }
1387    
1388    return inner;
1389  }
1390  function renderPager(startIndex)
1391  {
1392    /*debug*/log('renderPager');
1393
1394    if (!searchAsyncData || searchAsyncData.inProgress || searchAsyncData.foundCount <= maxDisplayRecords)
1395    {
1396      hidePaging();
1397      return;
1398    }
1399
1400    if (!searchAsyncData.pagerHtml)
1401    {
1402      var i;
1403      var a = new Array();
1404      var useSearchData = (searchAsyncData.keywordsArray.length > 0) || filterIsOn();
1405      var value;
1406      var firstIndex;
1407      var lastIndex;
1408      var recordsFirstIndex;
1409      var recordsLastIndex;
1410
1411      a.push(pagerTemplate[0]);
1412      
1413      for (i = 0; i < searchAsyncData.foundCount; i = i + maxDisplayRecords)
1414      {
1415        value = i;
1416        firstIndex = i;
1417        lastIndex = Math.min(searchAsyncData.foundCount - 1, i + maxDisplayRecords - 1);
1418        recordsFirstIndex = firstIndex + 1;
1419        recordsLastIndex = lastIndex + 1;
1420
1421        if (useSearchData)
1422        {
1423          firstIndex = searchAsyncData.foundIndexes[firstIndex];
1424          lastIndex = searchAsyncData.foundIndexes[lastIndex];
1425        }
1426
1427        a.splice(a.length, 0, 
1428          pagerOptionTemplate[0], value,
1429/*
1430          pagerOptionTemplate[1], preparePagerRangeWord(firstIndex, true),
1431          pagerOptionTemplate[2], preparePagerRangeWord(lastIndex, false),
1432          pagerOptionTemplate[3], recordsFirstIndex,
1433          pagerOptionTemplate[4], recordsLastIndex,
1434*/
1435          pagerOptionTemplate[1], recordsFirstIndex,
1436          pagerOptionTemplate[2], recordsLastIndex,
1437          pagerOptionTemplate[3]);
1438      }
1439      
1440      a.push(pagerTemplate[1]);
1441      searchAsyncData.pagerHtml = a.join('');
1442
1443    }
1444
1445
1446    if (isPagerHidden())
1447    {
1448      setPaging(searchAsyncData.pagerHtml, startIndex);
1449    }
1450  }
1451  
1452  function preparePagerRangeWord(index, appendSpacesBefore)
1453  {
1454    /*debug*/log('preparePagerRangeWord');
1455
1456    var v = directoryData.membersData[0][index].c1[0].v;
1457    var value = v == '' ? 'View details' : v;
1458    var word = value.split(',')[0].substr(0, pagerRangeNameLength);
1459    word = word.replace(/\s/g, "&nbsp;");
1460    return word;
1461  }
1462  
1463  function pagerChanged(pagerSelect)
1464  {
1465    /*debug*/log('pagerChanged');
1466
1467    try { $(MemberDirectoryListRenderer.searchBoxId).focus(); } catch (e) {}
1468    var startIndex = pagerSelect.options[pagerSelect.selectedIndex].value;
1469    render(parseInt(startIndex));
1470  }
1471  
1472  /*****************************************************/
1473  /***   MEMBER RECORD EVENTS                        ***/
1474  /*****************************************************/
1475
1476  function highlightRowAndNext(memberTr)
1477  {
1478    /*debug*/log('highlightRowAndNext');
1479
1480    SetClassToRowAndNext(memberTr, 'hover');
1481  }
1482  function normlightRowAndNext(memberTr)
1483  {
1484    /*debug*/log('normlightRowAndNext');
1485
1486    SetClassToRowAndNext(memberTr, 'normal');
1487  }
1488  function SetClassToRowAndNext(memberTr, className)
1489  {
1490    /*debug*/log('SetClassToRowAndNext');
1491
1492    memberTr.className = className;
1493    
1494    var nextSibling = memberTr.nextSibling;
1495    
1496    if (!nextSibling)
1497    {
1498      return;
1499    }
1500    
1501    while (nextSibling.nodeType != 1)
1502    {
1503      nextSibling = nextSibling.nextSibling;
1504        
1505      if (!nextSibling)
1506      {
1507        return;
1508      }
1509    }
1510    
1511    if (nextSibling.getAttribute('bottomrow', 0) == 'true')
1512    {
1513        nextSibling.className = className;
1514    }
1515  }  
1516  function highlightRowAndPrev(memberTr)
1517  {
1518    /*debug*/log('highlightRowAndPrev');
1519
1520    SetClassToRowAndPrev(memberTr, 'hover');
1521  }
1522
1523  function normlightRowAndPrev(memberTr)
1524  {
1525    /*debug*/log('normlightRowAndPrev');
1526
1527    SetClassToRowAndPrev(memberTr, 'normal');
1528  }
1529  
1530  function SetClassToRowAndPrev(memberTr, className)
1531  {
1532    /*debug*/log('SetClassToRowAndPrev');
1533
1534    memberTr.className = className;
1535    
1536    var previousSibling = memberTr.previousSibling;
1537    
1538    if (!previousSibling)
1539    {
1540      return;
1541    }
1542    
1543    while (previousSibling.nodeType != 1)
1544    {
1545      previousSibling = previousSibling.previousSibling;
1546        
1547      if (!previousSibling)
1548      {
1549        return;
1550      }
1551    }
1552    
1553    previousSibling.className = className;
1554  }  
1555
1556  function redirectToMemberDetails(url)
1557  {
1558    /*debug*/log('redirectToMemberDetails');
1559
1560    window.location = url;
1561    return false;
1562  }
1563  
1564  MemberDirectoryListRenderer.GetSelectedMembersId  = function()
1565  {
1566    /*debug*/log('GetSelectedMembersId');
1567
1568    if (!searchBoxAskTimeout) {
1569      return false;
1570    }
1571    var element = document.getElementById(MemberDirectoryListRenderer.selectedMembersFieldId);
1572    if (element == null) {
1573      return false;
1574    }
1575    try {
1576      element.value = GetCurrentMembersSelectionIdStr();
1577      if (element.value == '') {
1578        return false;
1579      }
1580    } catch (error) {
1581    }
1582  }
1583  
1584  MemberDirectoryListRenderer.ValidateEmailMembersList = function(sender, args) {
1585    /*debug*/log('ValidateEmailMembersList');
1586
1587    var element = document.getElementById(MemberDirectoryListRenderer.selectedMembersFieldId);
1588      if (element == null || element.value == '') {
1589         args.IsValid = false;
1590      }
1591  }
1592  
1593  function GetCurrentMembersSelectionIdStr()
1594  {
1595    /*debug*/log('GetCurrentMembersSelectionIdStr');
1596
1597    if (!searchAsyncData || searchAsyncData.inProgress)
1598          return;
1599      var otherMembersData = directoryData.membersData[1];
1600      if (searchAsyncData.foundCount == 0) {
1601        return '';
1602      }
1603      var realIndex;
1604      var keywordsDefined = searchAsyncData.keywordsArray.length > 0;
1605      var result = '';
1606      var foundCount = searchAsyncData.foundCount;
1607      for (var i = 0; i < foundCount; i++) {
1608        realIndex = keywordsDefined ? searchAsyncData.foundIndexes[i] : i;
1609        if (otherMembersData[realIndex][1] != 0) {
1610          result += otherMembersData[realIndex][0];
1611          if (foundCount - i > 1)
1612           result += ',';
1613        }
1614      }
1615      return result;
1616  }
1617
1618// end of MemberDirectoryListRenderer singleton
1619}) ();
1620jq$(function(){var service=WaOnlineStoreCart.getInstance().getService();service.savingCompleted=showCart;var cart=service.localLoad()||{};showCart(cart);function showCart(cart){if(!cart.items||cart.items.length===0){jq$(".cart-gadget_count").text("");jq$(".cart-gadget_quantity").removeClass("cart-gadget_quantity__filled");return;}var quantity=0;cart.items.forEach(function(item){quantity+=item.quantity;});jq$(".cart-gadget_count").text(quantity);jq$(".cart-gadget_quantity").addClass("cart-gadget_quantity__filled");return quantity;}});(function(){if(!window.PhotoAlbumGadget){window.PhotoAlbumGadget={};}var albumParam="";var processingText="Please wait...";var deleteConfirmation="Are you sure you want to delete?";var deletePhotoConfirmation="Are you sure you want to delete this photo?";var saveAction=false;var photosHolder=false;
1620var photosHolderHeight=false;var titleTextBox=false;var descriptionTextBox=false;var saveButton=false;var altSaveButton=false;var saveLinkButton=false;var deleteButton=false;var cancelButton=false;var uploadButton=false;var uploadAction=false;var viewModeRadioContainer=false;var uploadButtonContainer=false;var descriptionContainer=false;var descriptionHeightUrlKey=false;var countPhotosPerRowUrlKey=false;var pagingKey=false;var saveAlbumDialogInited=false;var uploadPhotosDialogInited=false;var photoItemId=false;var photoItemTimeout=false;var actionIsRunning=false;var pendingSender=false;var pendingImageDivId=false;var pendingFullDescriptionDivId=false;var pendingSmallDescriptionDivId=false;PhotoAlbumGadget.InitPhotoGallery=initPhotoGallery;PhotoAlbumGadget.InitJsFunctions=initJsFunctions;PhotoAlbumGadget.Page_Parsed=pageParsed;PhotoAlbumGadget.Page_Unloading=pageUnloading;PhotoAlbumGadget.CloseSaveAlbumDialog=closeSaveAlbumDialog;PhotoAlbumGadget.CloseUploadPhotosDialog=closeUploadPhotosDialog;PhotoAlbumGadget.Get_SaveAction=getSaveAction;PhotoAlbumGadget.Get_SaveTitle=getSaveTitle;PhotoAlbumGadget.Get_SaveDescription=getSaveDescription;PhotoAlbumGadget.Get_SaveButton=getSaveButton;PhotoAlbumGadget.Get_DeleteButton=getDeleteButton;PhotoAlbumGadget.Get_UploadButton=getUploadButton;PhotoAlbumGadget.Get_UploadAction=getUploadAction;PhotoAlbumGadget.ProcessingButton_OnClick=processingButtonClick;PhotoAlbumGadget.DeleteButton_OnClick=deleteButtonClick;PhotoAlbumGadget.UploadButton_OnClick=uploadButtonClick;PhotoAlbumGadget.SaveButton_OnClick=saveButtonClick;PhotoAlbumGadget.ImageMenu_OnMouseOver=imageMenuMouseOver;PhotoAlbumGadget.ImageMenu_OnMouseOut=imageMenuMouseOut;PhotoAlbumGadget.MenuButton_OnMouseOver=menuButtonMouseOver;PhotoAlbumGadget.MenuButton_OnMouseOut=menuButtonMouseOut;PhotoAlbumGadget.MenuButton_OnClick=menuButtonClick;PhotoAlbumGadget.NavigateToList=navigateToList;PhotoAlbumGadget.CheckLength=checkLength;function initPhotoGallery(p){if(p.albumParam){albumParam=p.albumParam;}if(p.processingText){processingText=p.processingText;}if(p.deleteConfirmation){deleteConfirmation=p.deleteConfirmation;}if(p.deletePhotoConfirmation){deletePhotoConfirmation=p.deletePhotoConfirmation;}if(p.photosHolderId){photosHolder=WA.$(p.photosHolderId,window);}if(p.saveActionId){saveAction=WA.$(p.saveActionId,window);}if(p.titleTextBoxId){titleTextBox=WA.$(p.titleTextBoxId,window);}if(p.descriptionTextBoxId){descriptionTextBox=WA.$(p.descriptionTextBoxId,window);}if(p.saveButtonId){saveButton=WA.$(p.saveButtonId,window);}if(p.altSaveButtonId){altSaveButton=WA.$(p.altSaveButtonId,window);}if(p.saveLinkButtonId){saveLinkButton=WA.$(p.saveLinkButtonId,window);}if(p.deleteButtonId){deleteButton=WA.$(p.deleteButtonId,window);}if(p.cancelButtonId){cancelButton=WA.$(p.cancelButtonId,window);}if(p.uploadButtonId){uploadButton=WA.$(p.uploadButtonId,window);}if(p.uploadActionId){uploadAction=WA.$(p.uploadActionId,window);}if(p.viewModeRadioContainerId){viewModeRadioContainer=WA.$(p.viewModeRadioContainerId,window);}if(p.uploadButtonContainerId){uploadButtonContainer=WA.$(p.uploadButtonContainerId,window);}if(p.descriptionContainerId){descriptionContainer=WA.$(p.descriptionContainerId,window);}if(p.descriptionHeightUrlKey){descriptionHeightUrlKey=p.descriptionHeightUrlKey;}if(p.countPhotosPerRowUrlKey){countPhotosPerRowUrlKey=p.countPhotosPerRowUrlKey;}if(p.pagingUrlKey){pagingKey=p.pagingUrlKey;}}function initJsFunctions(){setDisplayInline(saveLinkButton);setDisplayInline(uploadButton);setDisplay(viewModeRadioContainer);setDisplay(uploadButtonContainer);}function pageParsed(){initJsFunctions();}function pageUnloading(){setDisabled(saveButton);setDisabled(uploadButton);setDisabled(deleteButton);if(saveLinkButton){setDisabled(saveLinkButton);setDisabled(altSaveButton);setDisabled(cancelButton);}}function setDisplay(element){if(element){element.style.display="";}}function setDisplayInline(element){if(element){element.style.display="inline";}}function setDisplayBlock(element){if(element){element.style.display="block";}}function setVisibilityVisible(element){if(element){element.style.visibility="visible";}}function setVisibilityHidden(element){if(element){element.style.visibility="hidden";}}function setDisplayNone(element){if(element){element.style.display="none";}}function setDisabled(element){if(element){element.disabled=true;}}function closeSaveAlbumDialog(){PhotoAlbumsDialog.saveAlbumDialog.close();}function closeUploadPhotosDialog(){PhotoAlbumsDialog.uploadPhotosDialog.close();}function getSaveAction(){return saveAction;}function getSaveTitle(){return titleTextBox;}function getSaveDescription(){return descriptionTextBox;}function getSaveButton(){return saveButton;}function getDeleteButton(){return deleteButton;}function getUploadButton(){return uploadButton;}function getUploadAction(){return uploadAction;}function processingButtonClick(sender,otherIds){if(sender){sender.value=processingText;}
1620if(otherIds&&otherIds.length){for(var i=0;i<otherIds.length;i++){var btn=WA.$(otherIds[i],window);if(btn&&btn.id!=sender.id){btn.disabled=true;}}}return true;}function deleteButtonClick(sender,otherIds){if(confirm(deleteConfirmation)){return processingButtonClick(sender,otherIds);}return false;}function uploadButtonClick(){if(!uploadPhotosDialogInited){PhotoAlbumsDialog.uploadPhotosDialog.initialize({albumParam:albumParam});uploadPhotosDialogInited=true;}if(uploadAction.value=="1"){uploadAction.value="";if(uploadButton){uploadButton.value=processingText;}WA.reloadCurrentPage(pagingKey,window);return;}PhotoAlbumsDialog.uploadPhotosDialog.open(null,{"PhotoGallery":PhotoGallery});}function saveButtonClick(){if(!saveAlbumDialogInited){PhotoAlbumsDialog.saveAlbumDialog.initialize({albumParam:albumParam});saveAlbumDialogInited=true;}if(saveAction.value=="1"){saveAction.value="";if(saveButton){saveButton.value=processingText;}return true;}PhotoAlbumsDialog.saveAlbumDialog.open(null,{"PhotoGallery":PhotoGallery});return false;}function imageMenuMouseOver(sender,imageDivId,fullDescriptionDivId,smallDescriptionDivId){if(photoItemTimeout&&photoItemId==imageDivId){clearTimeout(photoItemTimeout);photoItemTimeout=false;return;}if(actionIsRunning){return;}sender.parentNode.style.height=sender.offsetHeight+"px";WA.$(imageDivId,window).className="photoAlbumItemThumbnailPhotoHover";sender.className="photoInnerContainerOver";sender.style.zIndex=sender.style.zIndex+1;var fullDescriptionDiv=WA.$(fullDescriptionDivId,window);setDisplayBlock(fullDescriptionDiv);setVisibilityVisible(fullDescriptionDiv);setDisplayNone(WA.$(smallDescriptionDivId,window));if(photosHolder){photosHolderHeight=photosHolder.offsetHeight;if(!photosHolder.Y){WA.Dimensions.getXY(photosHolder);}if(!fullDescriptionDiv.Y){WA.Dimensions.getXY(fullDescriptionDiv);}var outHeigth=fullDescriptionDiv.Y+fullDescriptionDiv.offsetHeight-photosHolder.Y-photosHolderHeight;if(outHeigth>0){photosHolder.style.height=(photosHolderHeight+outHeigth+10)+"px";}}}function doImageMenuMouseOut(sender,imageDivId,fullDescriptionDivId,smallDescriptionDivId){WA.$(imageDivId,window).className="photoAlbumItemThumbnailPhoto";sender.className="photoInnerContainer";sender.style.zIndex=sender.style.zIndex-1;setVisibilityHidden(WA.$(fullDescriptionDivId,window));setDisplayBlock(WA.$(smallDescriptionDivId,window));if(photosHolderHeight&&photosHolder.offsetHeight>photosHolderHeight){photosHolder.style.height=photosHolderHeight+"px";}photoItemId=false;photoItemTimeout=false;}function imageMenuMouseOut(sender,imageDivId,fullDescriptionDivId,smallDescriptionDivId){if(actionIsRunning){if(!pendingSender){pendingSender=sender;pendingImageDivId=imageDivId;pendingFullDescriptionDivId=fullDescriptionDivId;pendingSmallDescriptionDivId=smallDescriptionDivId;}return;}if(photoItemTimeout&&photoItemId==imageDivId){return;}photoItemId=imageDivId;photoItemTimeout=setTimeout(function(){doImageMenuMouseOut(sender,imageDivId,fullDescriptionDivId,smallDescriptionDivId);},10);}function menuButtonMouseOver(sender){sender.className="overButton";}function menuButtonMouseOut(sender){sender.className="outButton";}function menuButtonClick(linkId,secondButtonId,processingContainerId,confirmVariableName){var linkobj=WA.$(linkId,window);if(linkobj){setDisplayNone(linkobj);var secondButton=WA.$(secondButtonId,window);var processingContainer=WA.$(processingContainerId,window);setDisplayNone(secondButton);setDisplayBlock(processingContainer);if(confirmVariableName){actionIsRunning=true;if(!confirm(eval(confirmVariableName))){actionIsRunning=false;setDisplayNone(processingContainer);setDisplay(secondButton);setDisplay(linkobj);if(pendingSender){imageMenuMouseOut(pendingSender,pendingImageDivId,pendingFullDescriptionDivId,pendingSmallDescriptionDivId);pendingSender=false;}return;}}actionIsRunning=false;eval(linkobj.href.substr(11).replace(/\%20/g," ").replace(/\%22/g,'"'));}}function navigateToList(url){var descriptionHeight=(descriptionContainer)?descriptionContainer.offsetHeight:0;var countPhotosPerRow=0;if(photosHolder){var y=0;var bulets=photosHolder.getElementsByTagName("LI");for(var i=0;i<bulets.length;i++){WA.Dimensions.getXY(bulets[i]);if(i==0){y=bulets[i].Y;}else{if(y<bulets[i].Y){countPhotosPerRow=i;break;}}}}if(descriptionHeightUrlKey&&countPhotosPerRowUrlKey){var index=url.indexOf("?",0);url=index==-1?url+"?":url+"&";url+=descriptionHeightUrlKey+"="+descriptionHeight+"&"+countPhotosPerRowUrlKey+"="+countPhotosPerRow;}url+="#photo";window.location=url;}function checkLength(e,oObject,maxLength){if(oObject.value.length<maxLength){return true;}else{var keyID=(window.event)?event.keyCode:e.keyCode;if((keyID>=37&&keyID<=40)||(keyID==8)||(keyID==46)){if(window.event){e.returnValue=true;}}else{if(window.event){e.returnValue=false;}else{e.preventDefault();}}}}})();(function(window,WA){if(!WA){return;}if(!window.PhotoAlbumsDialog){window.PhotoAlbumsDialog={};}PhotoAlbumsDialog.uploadPhotosDialog=new WA.topWindow.BonaDialogHandler({name:"PhotoAlbumsDialog_UploadPhotosDialog",dialogParameters:{clipContainerId:"idClipMainContainer",mainContainerId:"contentDiv",directURLTemplate:"/Content/Members/PhotoGallery/UploadPhotosDialog.aspx?frameMode=0{albumParam}&version="+WA.version,reloadURLTemplate:"/Content/Pictures/PhotoGallery/UploadPhotosInnerDialog.aspx?version="+WA.version+"{albumParam}",top:null,left:null,width:430,height:355,minWidth:430,minHeight:355,isMoveable:true,isResizeable:false,isModal:true,isScrollable:false,callBackParameters:{}},onDialogClose:function(){if(PhotoGallery.Get_UploadAction().value=="1"){PhotoGallery.Get_UploadButton().click();}}});})(window,window.WA);(function(window){if(!window.PhotoAlbumGadgetHelperScript){window.PhotoAlbumGadgetHelperScript=new photoAlbumGadgetHelper();}function photoAlbumGadgetHelper(){var pThis=this;pThis.init=init;
1620function init(){BonaPage.addPageStateHandler(BonaPage.PAGE_PARSED,render);}function render(){setScroll();setLabels();renderButtons();}function setScroll(){if(jq$(".WaGadgetPhotoAlbumStatePhoto .editCaptionTextBox").size()){$("body").animate({scrollTop:$(".WaGadgetPhotoAlbumStatePhoto .editCaptionTextBox").offset().top},0);}}function setLabels(){jq$('.WaGadgetPhotoAlbumStatePhoto .pageBackContainer a:contains("All album photos")').html("All album photos");jq$('.WaGadgetPhotoAlbumStatePhoto .linkContainer a:contains("Previous"), .WaGadgetPhotoAlbumStatePhoto .linkContainer span:contains("Previous")').html("Previous");jq$('.WaGadgetPhotoAlbumStatePhoto .linkContainer a:contains("Next"), .WaGadgetPhotoAlbumStatePhoto .linkContainer span:contains("Next")').html("Next");jq$('.WaGadgetPhotoAlbumStatePhoto .buttonsInTitleContainer input[value="Delete photo"]').val("Delete");jq$("#idPhotoHeaderContainer .pageBackContainer span").text(function(index,text){return text.replace("/","|");});}function renderButtons(){if(jq$(".WaGadgetPhotoAlbum.gadgetStyleNone").length>0){if(jq$(".photoAlbumUploadButtonContainer input").length>0){if(jq$(".photosContainerUL").length>0){jq$(".photosContainerUL").append('<li class="photoAlbumItemContainerLi"><div class="photoAlbumUploadButton">Upload</div></li>');}else{jq$("#idPhotoAlbumMainSectionContainer").append('<div class="photoAlbumUploadButton">Upload</div>');}jq$(".photoAlbumUploadButton").click(function(){$(".photoAlbumUploadButtonContainer input").trigger("click");});}jq$("#idPhotoHeaderContainer").append(jq$(".infoContainer"));jq$("#idPhotoHeaderContainer .infoContainer").wrap('<div class="infoContainerWrap"></div>');jq$("#idPhotoHeaderContainer .photoInfo, #idPhotoHeaderContainer .photoInfoGray").text(function(index,text){return text.replace(" |","");});jq$("#idImageContainer").after('<div class="photoAlbumButtonBlock"></div>');jq$(".photoAlbumButtonBlock").append(jq$(".menuHeaderLeftContainer .linkContainer:first"));if(jq$('.footerContainer a:contains("Add caption")').length>0){jq$(".photoAlbumButtonBlock").append('<a href="#" class="photoAlbumCaptionButton photoAlbumAddCaptionButton" title="Add caption">Add caption</a>');}else{if(jq$(".footerContainer .buttonsContainer").length>0){jq$(".photoAlbumButtonBlock").append('<span class="photoAlbumEditCaptionButton">Edit caption</span>');}else{if(jq$('.footerContainer a:contains("Edit")').length>0){jq$(".photoAlbumButtonBlock").append('<a href="#" class="photoAlbumCaptionButton photoAlbumEditCaptionButton" title="Edit caption">Edit caption</a>');}else{jq$(".photoAlbumButtonBlock").append('<span class="photoAlbumCaptionButton photoAlbumNoButton">&nbsp;</span>');}}}if(jq$(".buttonsInTitleContainer input").length>0){jq$(".photoAlbumButtonBlock").append('<a href="#" class="photoAlbumDeleteButton" title="Delete photo">Delete photo</a>');}else{jq$(".photoAlbumButtonBlock").append('<span class="photoAlbumCaptionButton photoAlbumNoButton">&nbsp;</span>');}jq$(".photoAlbumButtonBlock").append(jq$(".menuHeaderLeftContainer .linkContainer:last"));jq$(".photoAlbumCaptionButton").click(function(){$(".footerContainer a")[0].click();});jq$(".photoAlbumDeleteButton").click(function(){$(".buttonsInTitleContainer input").trigger("click");});var WidthImgContainer=jq$("#idImageContainer").width();jq$("#idImageContainer").css({"height":WidthImgContainer,"line-height":WidthImgContainer+"px"});jq$("#idImageContainer img").css({"max-height":WidthImgContainer});jq$(".photoAlbumButtonBlock > a, .photoAlbumButtonBlock > span").css("width",WidthImgContainer/2-50);jq$(window).resize(function(){var WidthImgContainer=jq$("#idImageContainer").width();jq$("#idImageContainer").css({"height":WidthImgContainer,"line-height":WidthImgContainer+"px"});jq$("#idImageContainer img").css({"max-height":WidthImgContainer});jq$(".photoAlbumButtonBlock > a, .photoAlbumButtonBlock > span").css("width",WidthImgContainer/2-50);});}}}})(window);(function(){if(!window.PhotoAlbumSummaryGadget){window.PhotoAlbumSummaryGadget={};}PhotoAlbumSummaryGadget.FieldArrow=PhotoAlbumSummaryFieldArrow;function PhotoAlbumSummaryFieldArrow(container,direction,callBackClick){var pThis=this,arrowContainer;function draw(){arrowContainer=document.createElement("div");if(direction==="left"){arrowContainer.id="button_leftphotoAlbumSummary";arrowContainer.setAttribute("class","button_leftphotoAlbumSummary");var svgContent='<g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><path d="M0.666666667,10 C0.847222222,10 1.00347222,9.93815104 1.13541667,9.81445312 L1.13541667,9.81445312 L5.80208333,5.43945312 C5.93402778,5.31575521 6,5.16927083 6,5 C6,4.83072917 5.93402778,4.68424479 5.80208333,4.56054687 L5.80208333,4.56054687 L1.13541667,0.185546875 C1.00347222,0.0618489583 0.847222222,0 0.666666667,0 C0.486111111,0 0.329861111,0.0618489583 0.197916667,0.185546875 C0.0659722222,0.309244792 0,0.455729167 0,0.625 L0,0.625 L0,9.375 C0,9.54427083 0.0659722222,9.69075521 0.197916667,9.81445312 C0.329861111,9.93815104 0.486111111,10 0.666666667,10 Z" id="?" fill="#000000" fill-rule="nonzero" transform="translate(3.000000, 5.000000) scale(-1, -1) translate(-3.000000, -5.000000) "></path></g>';var svgElement=document.createElementNS("http://www.w3.org/2000/svg","svg");
1620svgElement.setAttribute("width","6px");svgElement.setAttribute("height","10px");svgElement.setAttribute("viewBox","0 0 6 10");svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg");svgElement.innerHTML=svgContent;arrowContainer.appendChild(svgElement);container.appendChild(arrowContainer);}else{if(direction==="right"){arrowContainer.id="button_rightphotoAlbumSummary";arrowContainer.setAttribute("class","button_rightphotoAlbumSummary");var svgContent='<g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><path d="M0.666666667,10 C0.847222222,10 1.00347222,9.93815104 1.13541667,9.81445312 L1.13541667,9.81445312 L5.80208333,5.43945312 C5.93402778,5.31575521 6,5.16927083 6,5 C6,4.83072917 5.93402778,4.68424479 5.80208333,4.56054687 L5.80208333,4.56054687 L1.13541667,0.185546875 C1.00347222,0.0618489583 0.847222222,0 0.666666667,0 C0.486111111,0 0.329861111,0.0618489583 0.197916667,0.185546875 C0.0659722222,0.309244792 0,0.455729167 0,0.625 L0,0.625 L0,9.375 C0,9.54427083 0.0659722222,9.69075521 0.197916667,9.81445312 C0.329861111,9.93815104 0.486111111,10 0.666666667,10 Z" id="?" fill="#000000" fill-rule="nonzero" transform="translate(3.000000, 5.000000) scale(1, -1) translate(-3.000000, -5.000000) "></path></g>';var svgElement=document.createElementNS("http://www.w3.org/2000/svg","svg");svgElement.setAttribute("width","6px");svgElement.setAttribute("height","10px");svgElement.setAttribute("viewBox","0 0 6 10");svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg");svgElement.innerHTML=svgContent;arrowContainer.appendChild(svgElement);container.appendChild(arrowContainer);}else{if(direction==="buttonLeft"){arrowContainer.setAttribute("class","leftFullScreen");arrowContainer.id="pasLeftFullScreen";var svgContent='<g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><path d="M31.3593002,62.7186005 C31.8280484,62.7186005 32.2030482,62.5779758 32.4842976,62.2967265 L32.4842976,62.2967265 L33.6092949,61.1717292 C33.8905442,60.8904798 34.0311689,60.51548 34.0311689,60.0467318 C34.0311689,59.5779837 33.8905442,59.1561097 33.6092949,58.7811099 L33.6092949,58.7811099 L6.04686058,31.3593002 L33.6092949,3.93749061 C33.8905442,3.56249079 34.0311689,3.1406168 34.0311689,2.67186863 C34.0311689,2.20312046 33.8905442,1.82812064 33.6092949,1.54687131 L33.6092949,1.54687131 L32.4842976,0.421873994 C32.2030482,0.140624665 31.8280484,0 31.3593002,0 C30.8905521,0 30.5155522,0.140624665 30.2343029,0.421873994 L30.2343029,0.421873994 L0.421873994,30.2343029 C0.140624665,30.5155522 0,30.8905521 0,31.3593002 C0,31.8280484 0.140624665,32.2030482 0.421873994,32.4842976 L0.421873994,32.4842976 L30.2343029,62.2967265 C30.5155522,62.5779758 30.8905521,62.7186005 31.3593002,62.7186005 Z" id="?" fill="#FFFFFF" fill-rule="nonzero"></path></g>';var svgElement=document.createElementNS("http://www.w3.org/2000/svg","svg");svgElement.setAttribute("width","34px");svgElement.setAttribute("height","63px");svgElement.setAttribute("viewBox","0 0 34 63");svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg");svgElement.innerHTML=svgContent;arrowContainer.appendChild(svgElement);container.appendChild(arrowContainer);}else{if(direction==="buttonRight"){arrowContainer.setAttribute("class","rightFullScreen");arrowContainer.id="pasRightFullScreen";var svgContent='<g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><path d="M2.67186863,62.7186005 C3.1406168,62.7186005 3.51561662,62.5779758 3.79686595,62.2967265 L3.79686595,62.2967265 L33.6092949,32.4842976 C33.8905442,32.2030482 34.0311689,31.8280484 34.0311689,31.3593002 C34.0311689,30.8905521 33.8905442,30.5155522 33.6092949,30.2343029 L33.6092949,30.2343029 L3.79686595,0.421873994 C3.51561662,0.140624665 3.1406168,0 2.67186863,0 C2.20312046,0 1.82812064,0.140624665 1.54687131,0.421873994 L1.54687131,0.421873994 L0.421873994,1.54687131 C0.140624665,1.82812064 0,2.20312046 0,2.67186863 C0,3.1406168 0.140624665,3.56249079 0.421873994,3.93749061 L0.421873994,3.93749061 L27.9843083,31.3593002 L0.421873994,58.7811099 C0.140624665,59.1561097 0,59.5779837 0,60.0467318 C0,60.51548 0.140624665,60.8904798 0.421873994,61.1717292 L0.421873994,61.1717292 L1.54687131,62.2967265 C1.82812064,62.5779758 2.20312046,62.7186005 2.67186863,62.7186005 Z" id="?" fill="#FFFFFF" fill-rule="nonzero"></path></g>';var svgElement=document.createElementNS("http://www.w3.org/2000/svg","svg");
1620svgElement.setAttribute("width","34px");svgElement.setAttribute("height","63px");svgElement.setAttribute("viewBox","0 0 34 63");svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg");svgElement.innerHTML=svgContent;arrowContainer.appendChild(svgElement);container.appendChild(arrowContainer);}}}}}pThis.show=function(){arrowContainer.style.opacity="0.9";arrowContainer.addEventListener("click",onClick);};pThis.hide=function(){arrowContainer.style.opacity="0.5";arrowContainer.removeEventListener("click",onClick);};pThis.enable=function(){arrowContainer.className=arrowContainer.className.replace(/\s+disabled/g,"");arrowContainer.addEventListener("click",onClick);};pThis.disable=function(){if(!(/\s+disabled/).test(arrowContainer.className)){arrowContainer.className+=" disabled";}arrowContainer.removeEventListener("click",onClick);};pThis.displayShow=function(){arrowContainer.style.visibility="visible";arrowContainer.addEventListener("click",onClick);};pThis.displayHide=function(){arrowContainer.style.visibility="hidden";arrowContainer.removeEventListener("click",onClick);};function onClick(){if(typeof(callBackClick)==="function"){callBackClick();}}draw();}})();(function(){if(!window.PhotoAlbumSummaryGadget){window.PhotoAlbumSummaryGadget={};}PhotoAlbumSummaryGadget.ScrollBar=PhotoAlbumSummaryScrollBar;function PhotoAlbumSummaryScrollBar(renderGallery,gadgetContainer,rows,numberOfColumns,lengthThumbnails,buttonLeft,buttonRight){var slider=gadgetContainer.querySelector('DIV[class="PhotoAlbumSummaryGadgetSlider"]'),scrollBar=gadgetContainer.querySelector('DIV[class="PhotoAlbumSummaryGadgetScrollBar"]'),scrollElement=gadgetContainer.querySelector('DIV[class="PhotoAlbumSummaryGadgetScrollElement"]');var scrollBarWidth,quantityCell,lengthCell;var numberCell=0,previousCell=0;var shiftX,realPosition;var pThis=this;this.setImages=function(thumbnailsCount){pThis.lengthThumbnails=thumbnailsCount;};function init(){slider.addEventListener("mousedown",mouseDown);scrollBar.addEventListener("mousedown",scrollBarMouseDown);styleScrollBar();}pThis.resizeStyleScroll=function(){renderGallery.resizeScrollGallery(numberCell);};pThis.resizeStyleScrollBar=function(resizeColumns){styleScrollBar(resizeColumns);realPositionSlider();renderGallery.resizeScrollGallery(numberCell);};function scrollBarMouseDown(event){if(event.button===2){return;}numberCell=Math.floor((event.clientX-scrollBar.getBoundingClientRect().left)/lengthCell);realPositionSlider();quantityCellScroll(numberCell);}function quantityCellScroll(scrollCel){var rate=scrollCel-previousCell;previousCell=scrollCel;if(rate>0){renderGallery.scrollGallery(true,rate,false);}else{if(rate<0){renderGallery.scrollGallery(false,-rate,false);}}}function mouseDown(event){event.stopPropagation();if(event.button===2){return;}document.addEventListener("mousemove",onMouseMove);document.addEventListener("mouseup",onMouseUp);document.addEventListener("dragstart",dragDropStop);shiftX=event.clientX-slider.getBoundingClientRect().left;}function onMouseMove(event){var limit=scrollBarWidth-slider.getBoundingClientRect().width;realPosition=event.clientX-shiftX-scrollBar.getBoundingClientRect().left;if(realPosition>=limit){realPosition=limit;}else{if(realPosition<=0){realPosition=0;}}numberCell=Math.floor((realPosition+lengthCell/2)/lengthCell);quantityCellScroll(numberCell);slider.style.left=realPosition+"px";slider.setAttribute("class","PhotoAlbumSummaryGadgetSliderPress");}function styleScrollBar(columns){if(columns){numberOfColumns=columns;}if(lengthThumbnails<=rows*numberOfColumns){buttonLeft.displayHide();buttonRight.displayHide();scrollElement.style.position="absolute";scrollElement.style.left="-4000px";scrollElement.style.top="-4000px";}else{buttonLeft.displayShow();buttonRight.displayShow();scrollElement.style.position="";scrollElement.style.left="";scrollElement.style.top="";}scrollBarWidth=scrollBar.getBoundingClientRect().width;quantityCell=Math.ceil(lengthThumbnails/rows)-numberOfColumns+1;lengthCell=scrollBarWidth/quantityCell;slider.style.width=lengthCell+"px";}function realPositionSlider(){realPosition=Math.ceil(lengthCell*numberCell);slider.style.left=realPosition+"px";if(numberCell===0){if(lengthThumbnails<=rows*numberOfColumns){buttonLeft.disable();buttonRight.disable();}else{buttonLeft.disable();buttonRight.enable();}}else{if(numberCell===(quantityCell-1)){buttonRight.disable();buttonLeft.enable();}else{buttonLeft.enable();buttonRight.enable();}}if(realPosition>=scrollBar.getBoundingClientRect().width){realPosition=Math.ceil(lengthCell*(quantityCell-1));slider.style.left=realPosition+"px";}}pThis.positionSlider=function(shiftScroll,direction){if(direction){if(numberCell<quantityCell-1){shiftScroll>=quantityCell-numberCell?numberCell=quantityCell-1:numberCell=numberCell+shiftScroll;}}else{if(numberCell>0){numberCell-shiftScroll<=0?numberCell=0:numberCell=numberCell-shiftScroll;}}previousCell=numberCell;realPositionSlider();};function onMouseUp(){realPositionSlider();slider.setAttribute("class","PhotoAlbumSummaryGadgetSlider");document.removeEventListener("mousemove",onMouseMove);document.removeEventListener("mouseup",onMouseUp);document.removeEventListener("dragstart",dragDropStop);}function dragDropStop(e){e.stopPropagation();e.preventDefault();}init();}})();(function(){if(!window.PhotoAlbumSummaryGadget){window.PhotoAlbumSummaryGadget={};}PhotoAlbumSummaryGadget.RenderSummary=RenderAlbumSummary;
1620function RenderAlbumSummary(gadgetId,numberOfRows,columns,size,resolution){var gallery,pThis=this;var gadgetContainer=document.getElementById("idPhotoAlbumSummaryGadget_Container_"+gadgetId),gadgetScrollbar=gadgetContainer.querySelector('DIV[class="PhotoAlbumSummaryGadgetScrollElement"]'),innerContainer=gadgetContainer.querySelector('DIV[class="containerPhotoInner"]'),outerContainer=gadgetContainer.querySelector('DIV[class="containerPhotoOuter"]');var numberOfColumns=null;var marginHorizontal=9,marginVertical=9;var isThumbnailSizeFixed=false;var isThumbnailMarginFixed=true;var startTouchEventX,startTime;var focusGallery,scrollBar,thumbnailQuantity,thumbnailSize=null,thumbnails=[];var buttonLeft,buttonRight;var activeElementIndex=0;var i=0;numberOfRows=Number(numberOfRows);function getAlbums(){var albums=[],container=document.querySelector('DIV[data-componentId="'+gadgetId+'"]'),element,elements,i;if(!container){return null;}elements=container.querySelectorAll("DIV[data-thumb]");for(i=0;i<elements.length;i++){element=elements[i];albums.push({"albumId":element.getAttribute("data-target"),"count":element.getAttribute("data-count"),"name":element.getAttribute("data-title"),"origin":element.getAttribute("data-src"),"thumbnail":element.getAttribute("data-thumb")});}return albums;}this.init=function(){gallery=getAlbums();createAlbumGallery();if(focusGallery){focusGallery.addEventListener("focus",pThis.onFocus);focusGallery.addEventListener("blur",pThis.onBlur);}outerContainer.addEventListener("scroll",scrollReverse);gadgetContainer.addEventListener("touchstart",eventSwipeTouchStart);gadgetContainer.addEventListener("touchend",eventSwipeTouchEnd);window.addEventListener("resize",resizeGalleryBasic);};function eventSwipeTouchStart(e){startTouchEventX=e.changedTouches[0].screenX;startTime=new Date().getTime();}function eventSwipeTouchEnd(e){if(new Date().getTime()-startTime>100){if(e.changedTouches[0].screenX-startTouchEventX>50){scrollLeftButton();}else{if(e.changedTouches[0].screenX-startTouchEventX<-50){scrollRightButton();}}}}function scrollReverse(){showVisible();scrollBar.resizeStyleScroll();}function resizeGalleryBasic(){pThis.resizeGallery();resizeGalleryReserve();}function resizeGalleryReserve(){setTimeout(pThis.resizeGallery,100);}pThis.resizeGallery=function(){styleAlbumsGallery();var newHeight=0;for(i=0;i<thumbnails.length;i++){var height=thumbnails[i].resizeThumbnail(thumbnailSize,marginHorizontal,marginVertical);if(height>newHeight){newHeight=height;}}scrollBar.resizeStyleScrollBar(thumbnailQuantity);var thumbnailsByRow=numberOfColumns;if(thumbnailsByRow==null){thumbnailsByRow=Math.floor(innerContainer.clientWidth/(thumbnailSize+marginHorizontal));}if(thumbnails.length>=thumbnailsByRow*numberOfRows){thumbnailsByRow=Math.ceil(thumbnails.length/numberOfRows);}innerContainer.style.height=(numberOfRows*newHeight+numberOfRows*marginVertical)+"px";innerContainer.style.width=(thumbnailsByRow*(thumbnailSize+marginHorizontal))+"px";showVisible();};function styleAlbumsGallery(){var outerContainerWidth=outerContainer.getBoundingClientRect().width;if(isThumbnailSizeFixed){thumbnailQuantity=Math.floor(outerContainerWidth/thumbnailSize);if(outerContainerWidth<thumbnailSize){thumbnailQuantity=1;}if(thumbnailQuantity===1){marginHorizontal=Math.floor(outerContainerWidth%thumbnailSize/thumbnailQuantity);}else{marginHorizontal=Math.floor(outerContainerWidth%thumbnailSize/(thumbnailQuantity-1));}}if(isThumbnailMarginFixed){thumbnailQuantity=numberOfColumns;thumbnailSize=Math.floor((outerContainerWidth+marginHorizontal)/thumbnailQuantity)-marginHorizontal;}innerContainer.style.height=(numberOfRows*thumbnailSize+numberOfRows*marginVertical)+"px";}function createAlbumGallery(){var str="";focusGallery=gadgetContainer.querySelector('DIV[class="PhotoAlbumSummaryGadgetFocus"]');if(resolution==="NumberOfThumbnails"){numberOfColumns=Number(columns);isThumbnailSizeFixed=false;isThumbnailMarginFixed=true;}else{if(resolution==="SizeOfThumbnails"){thumbnailSize=Number(size);isThumbnailSizeFixed=true;isThumbnailMarginFixed=false;}}styleAlbumsGallery();for(i=0;i<gallery.length;i++){thumbnails.push(new PhotoAlbumSummaryGadget.Thumbnail(pThis,innerContainer,gallery[i],i));}for(i=0;i<thumbnails.length;
1620i++){str+=thumbnails[i].render(thumbnailSize,marginHorizontal,marginVertical);}innerContainer.innerHTML=str;for(i=0;i<thumbnails.length;i++){thumbnails[i].init(innerContainer);}if(buttonLeft==null){buttonLeft=new PhotoAlbumSummaryGadget.FieldArrow(gadgetScrollbar,"left",scrollLeftButton);}if(buttonRight==null){buttonRight=new PhotoAlbumSummaryGadget.FieldArrow(gadgetScrollbar,"right",scrollRightButton);}if(scrollBar==null){scrollBar=new PhotoAlbumSummaryGadget.ScrollBar(pThis,gadgetContainer,numberOfRows,thumbnailQuantity,thumbnails.length,buttonLeft,buttonRight);}else{scrollBar.setImages(thumbnails.length);}showVisible();setTimeout(pThis.resizeGallery,250);}pThis.scrollGallery=function(direction,multiplier,resolution){if(direction){outerContainer.scrollLeft+=(thumbnailSize+marginHorizontal)*multiplier;}else{if(!direction){outerContainer.scrollLeft-=(thumbnailSize+marginHorizontal)*multiplier;}}if(resolution){scrollBar.positionSlider(multiplier,direction);}};pThis.resizeScrollGallery=function(resizeScroll){outerContainer.scrollLeft=(thumbnailSize+marginHorizontal)*resizeScroll;};function scrollLeftButton(){pThis.scrollGallery(false,thumbnailQuantity,true);}function scrollRightButton(){pThis.scrollGallery(true,thumbnailQuantity,true);}function showVisible(){for(var i=0;i<thumbnails.length;i++){thumbnails[i].checkVisibility();}}pThis.onFocus=function(){gadgetContainer.addEventListener("keydown",addDocumentEventFocus);var activeElement=gadgetContainer.querySelector('DIV[data-indeximg="'+activeElementIndex+'"]');activeElement.style.border="3px ridge rgba(255, 255, 255, 1)";};pThis.onBlur=function(){gadgetContainer.querySelector('DIV[data-indeximg="'+(activeElementIndex)+'"]').style.border="";gadgetContainer.removeEventListener("keydown",addDocumentEventFocus);};function addDocumentEventFocus(event){if(event.key==="ArrowUp"||event.key==="Up"){if(activeElementIndex%numberOfRows!==0){setActiveThumbnail(event,activeElementIndex,(activeElementIndex-1));}}else{if(event.key==="ArrowDown"||event.key==="Down"){if(activeElementIndex%numberOfRows!==(numberOfRows-1)&&activeElementIndex<thumbnails.length-1){setActiveThumbnail(event,activeElementIndex,(activeElementIndex+1));}}else{if((event.key==="ArrowLeft"||event.key==="Left")){if(activeElementIndex>=numberOfRows){setActiveThumbnail(event,activeElementIndex,activeElementIndex-numberOfRows,false);}}else{if((event.key==="ArrowRight"||event.key==="Right")){if(activeElementIndex<thumbnails.length-numberOfRows){setActiveThumbnail(event,activeElementIndex,activeElementIndex+numberOfRows,true);}else{setActiveThumbnail(event,activeElementIndex,thumbnails.length-1,true);}}else{if(event.key==="Enter"){gadgetContainer.querySelector('DIV[data-indeximg="'+Number(activeElementIndex)+'"]').click();}}}}}}function setActiveThumbnail(event,currentIndex,newIndex,isRightDirection){thumbnails[currentIndex].setViewState(false);thumbnails[newIndex].setViewState(true,isRightDirection);activeElementIndex=newIndex;event.preventDefault();event.stopPropagation();}pThis.init();}})();(function(){if(!window.PhotoAlbumSummaryGadget){window.PhotoAlbumSummaryGadget={};}PhotoAlbumSummaryGadget.Thumbnail=Thumbnail;function Thumbnail(renderGallery,parentContainer,item,ind){var borderSize=3,container,image,isVisible=false,pThis=this;pThis.imageUrl=item.origin;pThis.init=function(parentContainer){container=parentContainer.querySelector('DIV[data-indeximg="'+ind+'"]');image=parentContainer.querySelector('IMG[data-indeximg="'+ind+'"]');};pThis.render=function(thumbnailSize,marginHorizontal,marginVertical){return'<a href="/'+item.albumId+'">'+(item.name?'<div class="img_invisible" style="height:'+thumbnailSize+"px;width:"+thumbnailSize+"px;margin:0 "+marginHorizontal+"px "+marginVertical+'px 0;" data-indeximg="'+ind+'">'+'<img data-src="'+item.thumbnail+'" data-indeximg="'+ind+'" alt="" src="" />'+'<div class="img_caption" id="img_caption'+ind+'" style="max-width:'+(thumbnailSize-borderSize*2)+'px;">'+'<span class="caption_text" id="caption_text'+ind+'">'+item.name+"</span>"+'<span class="caption_count"> ('+item.count+")</span>"+"</div>"+"</div>":'<div class="img_invisible" style="height:'+thumbnailSize+"px;width:"+thumbnailSize+"px;margin: 0 "+marginHorizontal+"px "+marginVertical+'px 0;" data-indeximg="'+ind+'">'+'<img data-src="'+item.thumbnail+'" data-indeximg="'+ind+'" alt="" src="" />'+"</div>")+"</a>";};pThis.renderFullPhoto=function(){return item.origin;};pThis.resizeThumbnail=function(size,marginHorizontal,marginVertical){var caption=document.getElementById("img_caption"+ind),captionHeight=0,captionText=document.getElementById("caption_text"+ind);if(caption){var margins=(marginVertical*2);if(caption.clientHeight>margins){captionHeight=caption.clientHeight-margins+30;}else{captionHeight=caption.clientHeight+30;}var allowedChars=measureTextInALine(captionText.innerText,caption.clientWidth-marginHorizontal)*2;if(captionText.innerText.length>allowedChars){captionText.innerText=captionText.innerText.substr(0,allowedChars-8)+"...";}caption.style.width=(size-borderSize*2)+"px";image.style.height=(size-borderSize*2)+"px";}
1620var containerHeight=size+captionHeight;container.style.width=size+"px";container.style.height=containerHeight+"px";container.style.margin=0+"px "+marginHorizontal+"px "+marginVertical+"px "+0+"px";return containerHeight;};pThis.checkVisibility=function(){if(!isVisible&&getIsVisible(false)){isVisible=true;if(item.count>0){image.setAttribute("src",image.getAttribute("data-src"));image.removeAttribute("data-src");setClasses();}else{image.removeAttribute("data-src");}}};pThis.setViewState=function(isActive,isRightDirection){container.style.border=(isActive?borderSize+"px ridge rgba(255, 255, 255, 1)":"");if(isActive&&!getIsVisible(isRightDirection)){if(isRightDirection){renderGallery.scrollGallery(true,1,true);}else{renderGallery.scrollGallery(false,1,true);}}};function getIsVisible(isRightCorner){var parentRect=parentContainer.getBoundingClientRect(),rect=container.getBoundingClientRect();return(isRightCorner?rect.right:rect.left)<(parentRect.left+parentRect.width)&&(isRightCorner?rect.right:rect.left-parentRect.left)-container.scrollLeft>=0;}function measureTextInALine(text,targetWidth){var fit=text.length,i,span=document.createElement("span");document.body.appendChild(span);span.style.whiteSpace="nowrap";for(i=0;i<fit;++i){span.innerHTML+=text[i];if(span.offsetWidth>targetWidth){fit=i-1;break;}}document.body.removeChild(span);return i;}function setClasses(){if(image.naturalWidth&&image.naturalHeight){container.setAttribute("class",((image.naturalHeight>image.naturalWidth)?"img_vertical":"img_horizontal"));}else{setTimeout(setClasses,100);}}}})();(function(){if(!window.PhotoGalleryGadget){window.PhotoGalleryGadget={};}PhotoGalleryGadget.FieldArrow=FieldArrow;function FieldArrow(container,direction,callBackClick){var pThis=this,arrowContainer;function draw(){arrowContainer=document.createElement("div");if(direction==="left"){arrowContainer.setAttribute("class","button_leftPhotoGallery");var svgContent='<g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><path d="M0.666666667,10 C0.847222222,10 1.00347222,9.93815104 1.13541667,9.81445312 L1.13541667,9.81445312 L5.80208333,5.43945312 C5.93402778,5.31575521 6,5.16927083 6,5 C6,4.83072917 5.93402778,4.68424479 5.80208333,4.56054687 L5.80208333,4.56054687 L1.13541667,0.185546875 C1.00347222,0.0618489583 0.847222222,0 0.666666667,0 C0.486111111,0 0.329861111,0.0618489583 0.197916667,0.185546875 C0.0659722222,0.309244792 0,0.455729167 0,0.625 L0,0.625 L0,9.375 C0,9.54427083 0.0659722222,9.69075521 0.197916667,9.81445312 C0.329861111,9.93815104 0.486111111,10 0.666666667,10 Z" id="?" fill="#000000" fill-rule="nonzero" transform="translate(3.000000, 5.000000) scale(-1, -1) translate(-3.000000, -5.000000) "></path></g>';var svgElement=document.createElementNS("http://www.w3.org/2000/svg","svg");svgElement.setAttribute("width","6px");svgElement.setAttribute("height","10px");svgElement.setAttribute("viewBox","0 0 6 10");svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg");svgElement.innerHTML=svgContent;arrowContainer.appendChild(svgElement);container.appendChild(arrowContainer);}else{if(direction==="right"){arrowContainer.setAttribute("class","button_rightPhotoGallery");var svgContent='<g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><path d="M0.666666667,10 C0.847222222,10 1.00347222,9.93815104 1.13541667,9.81445312 L1.13541667,9.81445312 L5.80208333,5.43945312 C5.93402778,5.31575521 6,5.16927083 6,5 C6,4.83072917 5.93402778,4.68424479 5.80208333,4.56054687 L5.80208333,4.56054687 L1.13541667,0.185546875 C1.00347222,0.0618489583 0.847222222,0 0.666666667,0 C0.486111111,0 0.329861111,0.0618489583 0.197916667,0.185546875 C0.0659722222,0.309244792 0,0.455729167 0,0.625 L0,0.625 L0,9.375 C0,9.54427083 0.0659722222,9.69075521 0.197916667,9.81445312 C0.329861111,9.93815104 0.486111111,10 0.666666667,10 Z" id="?" fill="#000000" fill-rule="nonzero" transform="translate(3.000000, 5.000000) scale(1, -1) translate(-3.000000, -5.000000) "></path></g>';var svgElement=document.createElementNS("http://www.w3.org/2000/svg","svg");
1620svgElement.setAttribute("width","6px");svgElement.setAttribute("height","10px");svgElement.setAttribute("viewBox","0 0 6 10");svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg");svgElement.innerHTML=svgContent;arrowContainer.appendChild(svgElement);container.appendChild(arrowContainer);}else{if(direction==="buttonLeft"){arrowContainer.setAttribute("class","leftFullScreen");var svgContent='<g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><path d="M31.3593002,62.7186005 C31.8280484,62.7186005 32.2030482,62.5779758 32.4842976,62.2967265 L32.4842976,62.2967265 L33.6092949,61.1717292 C33.8905442,60.8904798 34.0311689,60.51548 34.0311689,60.0467318 C34.0311689,59.5779837 33.8905442,59.1561097 33.6092949,58.7811099 L33.6092949,58.7811099 L6.04686058,31.3593002 L33.6092949,3.93749061 C33.8905442,3.56249079 34.0311689,3.1406168 34.0311689,2.67186863 C34.0311689,2.20312046 33.8905442,1.82812064 33.6092949,1.54687131 L33.6092949,1.54687131 L32.4842976,0.421873994 C32.2030482,0.140624665 31.8280484,0 31.3593002,0 C30.8905521,0 30.5155522,0.140624665 30.2343029,0.421873994 L30.2343029,0.421873994 L0.421873994,30.2343029 C0.140624665,30.5155522 0,30.8905521 0,31.3593002 C0,31.8280484 0.140624665,32.2030482 0.421873994,32.4842976 L0.421873994,32.4842976 L30.2343029,62.2967265 C30.5155522,62.5779758 30.8905521,62.7186005 31.3593002,62.7186005 Z" id="?" fill="#FFFFFF" fill-rule="nonzero"></path></g>';var svgElement=document.createElementNS("http://www.w3.org/2000/svg","svg");svgElement.setAttribute("width","34px");svgElement.setAttribute("height","63px");svgElement.setAttribute("viewBox","0 0 34 63");svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg");svgElement.innerHTML=svgContent;arrowContainer.appendChild(svgElement);container.appendChild(arrowContainer);}else{if(direction==="buttonRight"){arrowContainer.setAttribute("class","rightFullScreen");var svgContent='<g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><path d="M2.67186863,62.7186005 C3.1406168,62.7186005 3.51561662,62.5779758 3.79686595,62.2967265 L3.79686595,62.2967265 L33.6092949,32.4842976 C33.8905442,32.2030482 34.0311689,31.8280484 34.0311689,31.3593002 C34.0311689,30.8905521 33.8905442,30.5155522 33.6092949,30.2343029 L33.6092949,30.2343029 L3.79686595,0.421873994 C3.51561662,0.140624665 3.1406168,0 2.67186863,0 C2.20312046,0 1.82812064,0.140624665 1.54687131,0.421873994 L1.54687131,0.421873994 L0.421873994,1.54687131 C0.140624665,1.82812064 0,2.20312046 0,2.67186863 C0,3.1406168 0.140624665,3.56249079 0.421873994,3.93749061 L0.421873994,3.93749061 L27.9843083,31.3593002 L0.421873994,58.7811099 C0.140624665,59.1561097 0,59.5779837 0,60.0467318 C0,60.51548 0.140624665,60.8904798 0.421873994,61.1717292 L0.421873994,61.1717292 L1.54687131,62.2967265 C1.82812064,62.5779758 2.20312046,62.7186005 2.67186863,62.7186005 Z" id="?" fill="#FFFFFF" fill-rule="nonzero"></path></g>';var svgElement=document.createElementNS("http://www.w3.org/2000/svg","svg");svgElement.setAttribute("width","34px");svgElement.setAttribute("height","63px");svgElement.setAttribute("viewBox","0 0 34 63");svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg");svgElement.innerHTML=svgContent;arrowContainer.appendChild(svgElement);container.appendChild(arrowContainer);}}}}}pThis.show=function(){arrowContainer.style.opacity="0.9";arrowContainer.addEventListener("click",onClick);};pThis.hide=function(){arrowContainer.style.opacity="0.5";arrowContainer.removeEventListener("click",onClick);};pThis.enable=function(){arrowContainer.className=arrowContainer.className.replace(/\s+disabled/g,"");arrowContainer.addEventListener("click",onClick);};pThis.disable=function(){if(!(/\s+disabled/).test(arrowContainer.className)){arrowContainer.className+=" disabled";}arrowContainer.removeEventListener("click",onClick);};pThis.displayShow=function(){arrowContainer.style.visibility="visible";arrowContainer.addEventListener("click",onClick);};pThis.displayHide=function(){arrowContainer.style.visibility="hidden";arrowContainer.removeEventListener("click",onClick);};function onClick(){if(typeof(callBackClick)==="function"){callBackClick();}}draw();}})();(function(){if(!window.PhotoGalleryGadget){window.PhotoGalleryGadget={};}PhotoGalleryGadget.PhotoGallery=PhotoGallery;function PhotoGallery(gadgetId,numberOfRows,numberOfColumns,marginHorizontal,resolution,sort){var pictures=getPictures();var sortBy=sort;function getPictures(){var i,pics=[],elements,container=document.querySelector('DIV[data-componentId="'+gadgetId+'"]');if(!container){return null;}elements=container.querySelectorAll("DIV[data-thumb]");for(i=0;i<elements.length;i++){pics[i]={"thumbnail":elements[i].getAttribute("data-thumb"),"origin":elements[i].getAttribute("data-src"),"date":"June.03.2019","name":elements[i].getAttribute("data-src").replace(/.*?\/([^\/]+)$/,"$1")};}return pics;}pictures.sort(function(a,b){var sortA=null,sortB=null;if(sortBy==="Date"){sortA=new Date(a.date);sortB=new Date(b.date);}else{if(sortBy==="Name"){sortA=a.name;sortB=b.name;}}if(sortA>sortB){return 1;}else{if(sortA<sortB){return -1;}else{if(sortA===sortB){return 0;}}}});if(pictures){new PhotoGalleryGadget.RenderGallery(gadgetId,pictures,numberOfRows,numberOfColumns,marginHorizontal,resolution);}}})();(function(){if(!window.PhotoGalleryGadget){window.PhotoGalleryGadget={};}PhotoGalleryGadget.LightBox=LightBox;function LightBox(renderGallery,gadgetContainer,objThumbnails,focusGallery){var darkLayer,WaGadgetPhotoGalleryPhotoContainer,arrowLeft,arrowRight,indexPhoto;var currentPhoto;var containerImg,containerDivImg,containerImgNaturalHeight,containerImgNaturalWi
1620dth,containerDivImgHeight,containerDivImgWidth,widthDefaultScrollBar;var objThumbnailsLength=objThumbnails.length;var ratioContainerPlane;var fullScreenContainerQuantityPhotos;var plane,close_arrow;var pThis=this;function init(){document.getElementById("close_arrowFullScreen").addEventListener("click",closeEventDark);document.getElementById("ContainerImageFullScreen").addEventListener("mousemove",photoContainerPlane);document.getElementById("ContainerImageFullScreen").addEventListener("click",ContainerImageFullScreenPlane);document.getElementById("WaGadgetPhotoGalleryPhotoContainer").addEventListener("mousemove",WaGadgetPhotoGalleryPhotoContainerPlane);document.addEventListener("keydown",addDocumentHandlers);window.addEventListener("resize",resizeFullPhoto);}function resizeFullPhoto(){ratioContainerPlane=document.documentElement.clientWidth/document.documentElement.clientHeight;fullPhotoSizeCheck();}pThis.draw=function(e){renderGallery.onBlur();if(!e.target.getAttribute("data-indeximg")){return;}createDarkLayer();drawFullImage();indexPhoto=e.target.getAttribute("data-indeximg");arrowLeft=new PhotoGalleryGadget.FieldArrow(document.querySelector('DIV[class="containerLeftFullScreen"]'),"buttonLeft",scrollLeft);arrowRight=new PhotoGalleryGadget.FieldArrow(document.querySelector('DIV[class="containerRightFullScreen"]'),"buttonRight",scrollRight);arrowLeft.hide();arrowRight.hide();fullScreenContainerQuantityPhotos=document.getElementById("fullScreenContainerQuantityPhotos");currentPhoto=(Number(indexPhoto)+1);fullScreenContainerQuantityPhotos.innerHTML="Image "+currentPhoto+" / "+objThumbnailsLength;ratioContainerPlane=document.documentElement.clientWidth/document.documentElement.clientHeight;styleElementControls();loadImage(indexPhoto);init();};function addDocumentHandlers(event){if(event.key==="ArrowRight"||event.key==="Right"){scrollRight();}else{if(event.key==="ArrowLeft"||event.key==="Left"){scrollLeft();}else{if(event.key==="Esc"||event.key==="Escape"){closeEventDark();}else{if(event.key==="Enter"||event.key==="Tab"){event.preventDefault();event.stopPropagation();}}}}}function WaGadgetPhotoGalleryPhotoContainerPlane(event){if(event.target===(document.querySelector('DIV[class="containerRightFullScreen"]'))||event.target===(document.querySelector('DIV[class="rightFullScreen"]'))){arrowRight.show();closeArrowHide();styleElementControlsRight();}else{if(event.target===(document.querySelector('DIV[class="containerLeftFullScreen"]'))||event.target===(document.querySelector('DIV[class="leftFullScreen"]'))){arrowLeft.show();closeArrowHide();styleElementControlsLeft();}}}function photoContainerPlane(event){stylePlane();if(event.target===document.getElementById("photoGalleryImageFullScreen")){closeArrowHide();}if(event.target===(document.querySelector('DIV[class="containerRightFullScreen"]'))){arrowRight.show();closeArrowHide();styleElementControlsRight();}else{if(event.target===(document.getElementById("containerRightFullScreen"))){arrowLeft.show();closeArrowHide();styleElementControlsLeft();}}ContainerPlane(event);}function stylePlane(){if(plane===4||plane===2){closeArrowShow();arrowLeft.hide();arrowRight.hide();}else{if(plane===1){styleElementControlsLeft();closeArrowHide();arrowRight.hide();}else{if(plane===3){styleElementControlsRight();closeArrowHide();arrowLeft.hide();}}}}function ContainerImageFullScreenPlane(event){ContainerPlane(event);stylePlane();if(plane===4||plane===2){if(event.target===document.getElementById("photoGalleryImageFullScreen")){closeArrowHide();return;}closeEventDark();}else{if(plane===1){scrollLeft();}else{if(plane===3){scrollRight();}}}}function closeArrowHide(){close_arrow.setAttribute("class","close_arrowFullScreenHover");}function closeArrowShow(){close_arrow.setAttribute("class","close_arrowFullScreen");close_arrow.style.cursor="pointer";}function styleElementControlsLeft(){if(indexPhoto<=0){arrowLeft.hide();}else{arrowLeft.show();}}function styleElementControlsRight(){if(indexPhoto>=objThumbnailsLength-1){arrowRight.hide();}else{arrowRight.show();}}function styleElementControls(){if(indexPhoto<=0){arrowLeft.displayHide();}else{arrowLeft.displayShow();}if(indexPhoto>=objThumbnailsLength-1){arrowRight.displayHide();}else{arrowRight.displayShow();}}function ContainerPlane(event){var y1=event.clientX/(-ratioContainerPlane)+document.documentElement.clientHeight;var y2=event.clientX/ratioContainerPlane;if(y1>
1620event.clientY&&y2<event.clientY){plane=1;}else{if(y1<event.clientY&&y2<event.clientY){plane=2;}else{if(y1<event.clientY&&y2>event.clientY){plane=3;}else{if(y1>event.clientY&&y2>event.clientY){plane=4;}}}}}function scrollLeft(){if(indexPhoto>0){indexPhoto--;loadImage(indexPhoto);}styleElementControls();currentPhoto=(Number(indexPhoto)+1);fullScreenContainerQuantityPhotos.innerHTML="Image "+currentPhoto+" / "+objThumbnailsLength;}function scrollRight(){if(indexPhoto<objThumbnailsLength-1){indexPhoto++;loadImage(indexPhoto);}styleElementControls();currentPhoto=(Number(indexPhoto)+1);fullScreenContainerQuantityPhotos.innerHTML="Image "+currentPhoto+" / "+objThumbnailsLength;}function createDarkLayer(){widthDefaultScrollBar=window.innerWidth-document.querySelector("html").getBoundingClientRect().width;darkLayer=document.createElement("div");darkLayer.id="darkLayer";darkLayer.setAttribute("class","photoGalleryShadingWhite");setTimeout(function(){darkLayer.setAttribute("class","photoGalleryShadingDark");},100);document.body.appendChild(darkLayer);renderGallery.resizeGallery();document.body.style.paddingRight=hiddenDefaultScrollBar(getComputedStyle(document.body).paddingRight,10)+widthDefaultScrollBar+"px";document.body.style.overflow="hidden";}function hiddenDefaultScrollBar(parsedPaddingRight,base){var parsed=parseInt(parsedPaddingRight,base);if(isNaN(parsed)){return 0;}return parsed;}function drawFullImage(){WaGadgetPhotoGalleryPhotoContainer=document.createElement("div");WaGadgetPhotoGalleryPhotoContainer.id="WaGadgetPhotoGalleryPhotoContainer";WaGadgetPhotoGalleryPhotoContainer.setAttribute("class","photoGalleryPhotoContainer");WaGadgetPhotoGalleryPhotoContainer.innerHTML='<div id="fullScreenContainerQuantityPhotos" class="fullScreenContainerQuantityPhotos">quantityPhotos</div>'+'<div class="containerLeftFullScreen"></div>'+'<div id="ContainerImageFullScreen"><img id="photoGalleryImageFullScreen" src="" alt=""></div>'+'<div class="containerRightFullScreen"><div class="close_arrowFullScreen" id="close_arrowFullScreen">'+'<svg width="45px" height="45px" viewBox="0 0 45 45" xmlns="http://www.w3.org/2000/svg" >'+'<g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">'+'<path d="M40.7109375,45 C41.0390618,45 41.2968757,44.9062493 41.484375,44.71875 L41.484375,44.71875 L44.71875,41.484375 C44.9062493,41.2968757 45,41.0390618 45,40.7109375 C45,40.3828132 44.9062493,40.1249993 44.71875,39.9375 L44.71875,39.9375 L27.28125,22.5 L41.765625,8.015625 L44.71875,5.0625 C44.9062493,4.87500072 45,4.61718678 45,4.2890625 C45,3.96093822 44.9062493,3.70312428 44.71875,3.515625 L44.71875,3.515625 L41.484375,0.28125 C41.2968757,0.0937507153 41.0390618,0 40.7109375,0 C40.3828132,0 40.1249993,0.0937507153 39.9375,0.28125 L39.9375,0.28125 L22.5,17.71875 L5.0625,0.28125 C4.87500072,0.0937507153 4.61718678,0 4.2890625,0 C3.96093822,0 3.70312428,0.0937507153 3.515625,0.28125 L3.515625,0.28125 L0.28125,3.515625 C0.0937507153,3.70312428 0,3.96093822 0,4.2890625 C0,4.61718678 0.0937507153,4.87500072 0.28125,5.0625 L0.28125,5.0625 L17.71875,22.5 L0.28125,39.9375 C0.0937507153,40.1249993 0,40.3828132 0,40.7109375 C0,41.0390618 0.0937507153,41.2968757 0.28125,41.484375 L0.28125,41.484375 L3.515625,44.71875 C3.70312428,44.9062493 3.96093822,45 4.2890625,45 C4.61718678,45 4.87500072,44.9062493 5.0625,44.71875 L5.0625,44.71875 L22.5,27.28125 L39.9375,44.71875 C40.1249993,44.9062493 40.3828132,45 40.7109375,45 Z" id="?" fill="#FFFFFF" fill-rule="nonzero"></path>'+"</g></svg></div></div>";document.body.appendChild(WaGadgetPhotoGalleryPhotoContainer);}function checkSizeContainer(){var sizeWidthArrow,containerLeft=document.querySelector('DIV[class="containerLeftFullScreen"]'),containerRight=document.querySelector('DIV[class="containerRightFullScreen"]');close_arrow=document.getElementById("close_arrowFullScreen");containerDivImg=document.getElementById("ContainerImageFullScreen");sizeWidthArrow=document.documentElement.clientWidth*4/100;containerDivImgHeight=document.documentElement.clientHeight*90/100;containerDivImgWidth=document.documentElement.clientWidth-sizeWidthArrow*2;if(sizeWidthArrow>76){containerLeft.style.width=76+"px";containerRight.style.width=76+"px";close_arrow.style.height=76+"px";}else{containerLeft.style.width=sizeWidthArrow+"px";containerRight.style.width=sizeWidthArrow+"px";close_arrow.style.height=sizeWidthArrow+"px";}if(containerDivImgWidth>1770||containerDivImgHeight>921){containerDivImg.style.width=1770+"px";containerDivImg.style.height=921+"px";}else{containerDivImg.style.width=containerDivImgWidth+"px";containerDivImg.style.height=containerDivImgHeight+"px";}}function loadImage(ind){containerImg=document.getElementById("photoGalleryImageFullScreen");containerImg.addEventListener("load",onLoad);containerImg.style.visibility="hidden";containerImg.setAttribute("src",objThumbnails[ind].renderFullPhoto());if(indexPhoto<=0){arrowLeft.hide();}else{if(indexPhoto>=objThumbnailsLength-1){arrowRight.hide();}}}function onLoad(){fullPhotoSizeCheck();}function fullPhotoSizeCheck(){checkSizeContainer();var ratioImgNatural;containerImgNaturalHeight=containerImg.naturalHeight;
1620containerImgNaturalWidth=containerImg.naturalWidth;if(containerImgNaturalHeight<containerDivImgHeight&&containerImgNaturalWidth<containerDivImgWidth){containerImg.style.height=containerImgNaturalHeight+"px";containerImg.style.width=containerImgNaturalWidth+"px";containerDivImg.setAttribute("class","imageFullScreen_smallSize");}else{if(containerImgNaturalHeight>=containerImgNaturalWidth){containerDivImg.setAttribute("class","imageFullScreen_vertical");ratioImgNatural=containerImgNaturalHeight/containerImgNaturalWidth;if(containerImgNaturalHeight>containerDivImgHeight){containerImgNaturalHeight=containerDivImgHeight;containerImgNaturalWidth=containerDivImgHeight/ratioImgNatural;}if(containerImgNaturalWidth>containerDivImgWidth){containerImgNaturalWidth=containerDivImgWidth;containerImgNaturalHeight=containerImgNaturalWidth*ratioImgNatural;}}else{if(containerImgNaturalHeight<containerImgNaturalWidth){containerDivImg.setAttribute("class","imageFullScreen_vertical");ratioImgNatural=containerImgNaturalWidth/containerImgNaturalHeight;if(containerImgNaturalWidth>containerDivImgWidth){containerImgNaturalWidth=containerDivImgWidth;containerImgNaturalHeight=containerDivImgWidth/ratioImgNatural;}if(containerImgNaturalHeight>containerDivImgHeight){containerImgNaturalHeight=containerDivImgHeight;containerImgNaturalWidth=containerDivImgHeight*ratioImgNatural;}}}}containerImg.style.width=containerImgNaturalWidth+"px";containerImg.style.height=containerImgNaturalHeight+"px";containerImg.style.visibility="visible";}function closeEventDark(){document.body.style.paddingRight=hiddenDefaultScrollBar(getComputedStyle(document.body).paddingRight,10)-widthDefaultScrollBar+"px";document.body.style.overflow="";renderGallery.resizeGallery();document.getElementById("close_arrowFullScreen").removeEventListener("click",closeEventDark);document.getElementById("ContainerImageFullScreen").removeEventListener("mousemove",photoContainerPlane);document.getElementById("ContainerImageFullScreen").removeEventListener("click",ContainerImageFullScreenPlane);document.getElementById("WaGadgetPhotoGalleryPhotoContainer").removeEventListener("mousemove",WaGadgetPhotoGalleryPhotoContainerPlane);document.removeEventListener("keydown",addDocumentHandlers);window.removeEventListener("resize",resizeFullPhoto);document.getElementById("WaGadgetPhotoGalleryPhotoContainer").parentNode.removeChild(document.getElementById("WaGadgetPhotoGalleryPhotoContainer"));document.getElementById("darkLayer").parentNode.removeChild(document.getElementById("darkLayer"));if(document.activeElement===focusGallery){renderGallery.onFocus();}}}})();(function(){if(!window.PhotoGalleryGadget){window.PhotoGalleryGadget={};}PhotoGalleryGadget.RenderGallery=RenderGallery;function RenderGallery(gadgetId,gallery,numberOfRows,columns,size,resolution){var pThis=this;var gadgetContainer=document.getElementById("idPhotoGalleryGadget_Container_"+gadgetId),photoContainer=gadgetContainer.querySelector('DIV[class="containerPhotoInner"]'),innerContainer=gadgetContainer.querySelector('DIV[class="containerPhotoOuter"]'),photoGalleryGadgetScrollElement=gadgetContainer.querySelector('DIV[class="photoGalleryGadgetScrollElement"]');var numberOfColumns=null;var thumbnailsSizes=null;var marginHorizontal=9,marginVertical=9;var isThumbnailSizeFixed=false;var isThumbnailMarginFixed=true;var objThumbnails=[];var startTouchEventX,startTime;var quantityThumbnails,lightBox,scrollBar,focusGallery;var buttonLeft,buttonRight;var activeElementIndex=0;var i=0;numberOfRows=Number(numberOfRows);function init(){createGallery();if(focusGallery){focusGallery.addEventListener("focus",pThis.onFocus);focusGallery.addEventListener("blur",pThis.onBlur);}innerContainer.addEventListener("scroll",scrollReverse);gadgetContainer.addEventListener("touchstart",eventSwipeTouchStart);gadgetContainer.addEventListener("touchend",eventSwipeTouchEnd);window.addEventListener("resize",resizeGalleryBasic);}function eventSwipeTouchStart(e){startTouchEventX=e.changedTouches[0].screenX;startTime=new Date().getTime();}function eventSwipeTouchEnd(e){if(new Date().getTime()-startTime>100){if(e.changedTouches[0].screenX-startTouchEventX>50){scrollLeftButton();}else{if(e.changedTouches[0].screenX-startTouchEventX<-50){scrollRightButton();}}}}function scrollReverse(){showVisible();scrollBar.resizeStyleScroll();}function resizeGalleryBasic(){pThis.resizeGallery();resizeGalleryReserve();}function resizeGalleryReserve(){setTimeout(pThis.resizeGallery,100);}pThis.resizeGallery=function(){styleGallery();for(i=0;i<objThumbnails.length;i++){objThumbnails[i].resizeThumbnail(thumbnailsSizes,marginHorizontal,marginVertical);}innerContainer.style.height=(numberOfRows*thumbnailsSizes+numberOfRows*marginVertical)+"px";scrollBar.resizeStyleScrollBar(quantityThumbnails);var thumbnailsByRow=numberOfColumns;if(thumbnailsByRow==null){thumbnailsByRow=Math.floor(photoContainer.clientWidth/(thumbnailsSizes+marginHorizontal));}if(objThumbnails.length>
1620=thumbnailsByRow*numberOfRows){thumbnailsByRow=Math.ceil(objThumbnails.length/numberOfRows);}photoContainer.style.width=(thumbnailsByRow*(thumbnailsSizes+marginHorizontal))+"px";showVisible();};function styleGallery(){var widthInnerContainer=innerContainer.getBoundingClientRect().width;if(isThumbnailSizeFixed){quantityThumbnails=Math.floor(widthInnerContainer/thumbnailsSizes);if(widthInnerContainer<thumbnailsSizes){quantityThumbnails=1;}if(quantityThumbnails===1){marginHorizontal=Math.floor(widthInnerContainer%thumbnailsSizes/quantityThumbnails);}else{marginHorizontal=Math.floor(widthInnerContainer%thumbnailsSizes/(quantityThumbnails-1));}}if(isThumbnailMarginFixed){quantityThumbnails=numberOfColumns;thumbnailsSizes=Math.floor((widthInnerContainer+marginHorizontal)/quantityThumbnails)-marginHorizontal;}innerContainer.style.height=(numberOfRows*thumbnailsSizes+numberOfRows*marginVertical)+"px";}function createGallery(){var str="";focusGallery=gadgetContainer.querySelector('DIV[class="photoGalleryGadgetFocus"]');if(resolution==="NumberOfThumbnails"){numberOfColumns=Number(columns);isThumbnailSizeFixed=false;isThumbnailMarginFixed=true;}else{if(resolution==="SizeOfThumbnails"){thumbnailsSizes=Number(size);isThumbnailSizeFixed=true;isThumbnailMarginFixed=false;}}styleGallery();for(i=0;i<gallery.length;i++){objThumbnails.push(new PhotoGalleryGadget.Thumbnail(pThis,innerContainer,gallery[i],i));}for(i=0;i<objThumbnails.length;i++){str+=objThumbnails[i].render(thumbnailsSizes,marginHorizontal,marginVertical);}photoContainer.innerHTML=str;for(i=0;i<objThumbnails.length;i++){objThumbnails[i].init(photoContainer);}buttonLeft=new PhotoGalleryGadget.FieldArrow(photoGalleryGadgetScrollElement,"left",scrollLeftButton);buttonRight=new PhotoGalleryGadget.FieldArrow(photoGalleryGadgetScrollElement,"right",scrollRightButton);lightBox=new PhotoGalleryGadget.LightBox(pThis,gadgetContainer,objThumbnails,focusGallery);scrollBar=new PhotoGalleryGadget.ScrollBar(pThis,gadgetContainer,numberOfRows,quantityThumbnails,objThumbnails.length,buttonLeft,buttonRight);innerContainer.addEventListener("click",lightBox.draw);showVisible();setTimeout(pThis.resizeGallery,250);}pThis.scrollGallery=function(direction,multiplier,resolution){if(direction){innerContainer.scrollLeft+=(thumbnailsSizes+marginHorizontal)*multiplier;}else{if(!direction){innerContainer.scrollLeft-=(thumbnailsSizes+marginHorizontal)*multiplier;}}if(resolution){scrollBar.positionSlider(multiplier,direction);}};pThis.resizeScrollGallery=function(resizeScroll){innerContainer.scrollLeft=(thumbnailsSizes+marginHorizontal)*resizeScroll;};function scrollLeftButton(){pThis.scrollGallery(false,quantityThumbnails,true);}function scrollRightButton(){pThis.scrollGallery(true,quantityThumbnails,true);}function showVisible(){for(var i=0;i<objThumbnails.length;i++){objThumbnails[i].checkVisibility();}}pThis.onFocus=function(){gadgetContainer.addEventListener("keydown",addDocumentEventFocus);var activeElement=gadgetContainer.querySelector('DIV[data-indeximg="'+activeElementIndex+'"]');activeElement.style.border="3px ridge rgba(255, 255, 255, 1)";};pThis.onBlur=function(){gadgetContainer.querySelector('DIV[data-indeximg="'+(activeElementIndex)+'"]').style.border="";gadgetContainer.removeEventListener("keydown",addDocumentEventFocus);};function addDocumentEventFocus(event){if(event.key==="ArrowUp"||event.key==="Up"){if(activeElementIndex%numberOfRows!==0){setActiveThumbnail(event,activeElementIndex,(activeElementIndex-1));}}else{if(event.key==="ArrowDown"||event.key==="Down"){if(activeElementIndex%numberOfRows!==(numberOfRows-1)&&activeElementIndex<objThumbnails.length-1){setActiveThumbnail(event,activeElementIndex,(activeElementIndex+1));}}else{if((event.key==="ArrowLeft"||event.key==="Left")){if(activeElementIndex>=numberOfRows){setActiveThumbnail(event,activeElementIndex,activeElementIndex-numberOfRows,false);}}else{if((event.key==="ArrowRight"||event.key==="Right")){if(activeElementIndex<objThumbnails.length-numberOfRows){setActiveThumbnail(event,activeElementIndex,activeElementIndex+numberOfRows,true);}
1620else{setActiveThumbnail(event,activeElementIndex,objThumbnails.length-1,true);}}else{if(event.key==="Enter"){gadgetContainer.querySelector('DIV[data-indeximg="'+Number(activeElementIndex)+'"]').click();}}}}}}function setActiveThumbnail(event,currentIndex,newIndex,isRightDirection){objThumbnails[currentIndex].setViewState(false);objThumbnails[newIndex].setViewState(true,isRightDirection);activeElementIndex=newIndex;event.preventDefault();event.stopPropagation();}init();}})();(function(){if(!window.PhotoGalleryGadget){window.PhotoGalleryGadget={};}PhotoGalleryGadget.ScrollBar=ScrollBar;function ScrollBar(renderGallery,gadgetContainer,rows,numberOfColumns,lengthThumbnails,buttonLeft,buttonRight){var slider=gadgetContainer.querySelector('DIV[class="photoGalleryGadgetSlider"]'),scrollBar=gadgetContainer.querySelector('DIV[class="photoGalleryGadgetScrollBar"]'),scrollElement=gadgetContainer.querySelector('DIV[class="photoGalleryGadgetScrollElement"]');var scrollBarWidth,quantityCell,lengthCell;var numberCell=0,previousCell=0;var shiftX,realPosition;var pThis=this;function init(){slider.addEventListener("mousedown",mouseDown);scrollBar.addEventListener("mousedown",scrollBarMouseDown);styleScrollBar();}pThis.resizeStyleScroll=function(){renderGallery.resizeScrollGallery(numberCell);};pThis.resizeStyleScrollBar=function(resizeColumns){styleScrollBar(resizeColumns);realPositionSlider();renderGallery.resizeScrollGallery(numberCell);};function scrollBarMouseDown(event){if(event.button===2){return;}numberCell=Math.floor((event.clientX-scrollBar.getBoundingClientRect().left)/lengthCell);realPositionSlider();quantityCellScroll(numberCell);}function quantityCellScroll(scrollCel){var rate=scrollCel-previousCell;previousCell=scrollCel;if(rate>0){renderGallery.scrollGallery(true,rate,false);}else{if(rate<0){renderGallery.scrollGallery(false,-rate,false);}}}function mouseDown(event){event.stopPropagation();if(event.button===2){return;}document.addEventListener("mousemove",onMouseMove);document.addEventListener("mouseup",onMouseUp);document.addEventListener("dragstart",dragDropStop);shiftX=event.clientX-slider.getBoundingClientRect().left;}function onMouseMove(event){var limit=scrollBarWidth-slider.getBoundingClientRect().width;realPosition=event.clientX-shiftX-scrollBar.getBoundingClientRect().left;if(realPosition>=limit){realPosition=limit;}else{if(realPosition<=0){realPosition=0;}}numberCell=Math.floor((realPosition+lengthCell/2)/lengthCell);quantityCellScroll(numberCell);slider.style.left=realPosition+"px";slider.setAttribute("class","photoGalleryGadgetSliderPress");}function styleScrollBar(columns){if(columns){numberOfColumns=columns;}if(lengthThumbnails<=rows*numberOfColumns){buttonLeft.displayHide();buttonRight.displayHide();scrollElement.style.position="absolute";scrollElement.style.left="-4000px";scrollElement.style.top="-4000px";}else{buttonLeft.displayShow();buttonRight.displayShow();scrollElement.style.position="";scrollElement.style.left="";scrollElement.style.top="";}scrollBarWidth=scrollBar.getBoundingClientRect().width;quantityCell=Math.ceil(lengthThumbnails/rows)-numberOfColumns+1;lengthCell=scrollBarWidth/quantityCell;slider.style.width=lengthCell+"px";}function realPositionSlider(){realPosition=Math.ceil(lengthCell*numberCell);slider.style.left=realPosition+"px";if(numberCell===0){if(lengthThumbnails<=rows*numberOfColumns){buttonLeft.disable();buttonRight.disable();}else{buttonLeft.disable();buttonRight.enable();}}else{if(numberCell===(quantityCell-1)){buttonRight.disable();buttonLeft.enable();}else{buttonLeft.enable();buttonRight.enable();}}if(realPosition>=scrollBar.getBoundingClientRect().width){realPosition=Math.ceil(lengthCell*(quantityCell-1));slider.style.left=realPosition+"px";}}pThis.positionSlider=function(shiftScroll,direction){if(direction){if(numberCell<quantityCell-1){shiftScroll>=quantityCell-numberCell?numberCell=quantityCell-1:numberCell=numberCell+shiftScroll;}}else{if(numberCell>0){numberCell-shiftScroll<=0?numberCell=0:numberCell=numberCell-shiftScroll;}}previousCell=numberCell;realPositionSlider();};function onMouseUp(){realPositionSlider();slider.setAttribute("class","photoGalleryGadgetSlider");document.removeEventListener("mousemove",onMouseMove);document.removeEventListener("mouseup",onMouseUp);document.removeEventListener("dragstart",dragDropStop);}function dragDropStop(e){e.stopPropagation();e.preventDefault();}init();}})();(function(){if(!window.PhotoGalleryGadget){window.PhotoGalleryGadget={};}PhotoGalleryGadget.Thumbnail=Thumbnail;function Thumbnail(renderGallery,parentContainer,item,ind){var pThis=this;var container,image,isVisible=false;
1620pThis.render=function(thumbnailsSizes,marginHorizontal,marginVertical){return'<div class="img_invisible"  style="height: '+thumbnailsSizes+"px; width: "+thumbnailsSizes+"px; margin: 0 "+marginHorizontal+"px "+marginVertical+'px 0;" data-indeximg="'+ind+'"><img src="" data-src="'+item.thumbnail+'" data-indeximg="'+ind+'" alt=""></div>';};pThis.renderFullPhoto=function(){return item.origin;};pThis.resizeThumbnail=function(resize,marginHorizontal,marginVertical){container.style.width=resize+"px";container.style.height=resize+"px";container.style.margin=0+"px "+marginHorizontal+"px "+marginVertical+"px "+0+"px";};pThis.init=function(parentContainer){container=parentContainer.querySelector('DIV[data-indeximg="'+ind+'"]');image=parentContainer.querySelector('IMG[data-indeximg="'+ind+'"]');};pThis.checkVisibility=function(){if(!isVisible&&getIsVisible(false)){isVisible=true;image.setAttribute("src",image.getAttribute("data-src"));image.setAttribute("data-src","");setClasses();}};function getIsVisible(isRightCorner){var parentContainerCoords=parentContainer.getBoundingClientRect();var coords=container.getBoundingClientRect();return(isRightCorner?coords.right:coords.left)<(parentContainerCoords.left+parentContainerCoords.width)&&(isRightCorner?coords.right:coords.left-parentContainerCoords.left)-container.scrollLeft>=0;}function setClasses(){if(image.naturalWidth&&image.naturalHeight){container.setAttribute("class",((image.naturalHeight>image.naturalWidth)?"img_vertical":"img_horizontal"));}else{setTimeout(setClasses,100);}}pThis.setViewState=function(isActive,isRightDirection){container.style.border=(isActive?"3px ridge rgba(255, 255, 255, 1)":"");if(isActive&&!getIsVisible(isRightDirection)){if(isRightDirection){renderGallery.scrollGallery(true,1,true);}else{renderGallery.scrollGallery(false,1,true);}}};}})();
1621
1622/*compiled*/
1623
1624(function()
1625{
1626  if (!window.WASiteSearchGadget)
1627  {
1628    window.WASiteSearchGadget = WASiteSearchGadget;
1629  }
1630  
1631  function WASiteSearchGadget(args)
1632  {
1633	var pThis = this;
1634    
1635	pThis.init = init;
1636	pThis.doSearch = doSearch;
1637  
1638	var model, searchBox, resultDiv, selectedTypes, timer, delay = 600,
1639	items, searchInProgress, thereWasAnotherRequest,
1640	selectedSugestion = -1; 
1641	
1642	
1643	model = args || {};
1644  
1645	function init()
1646	{
1647	    if (!document.getElementById(model.searchBoxId))
1648		{
1649		  throw new Error("couldn't find searchBoxId");
1650		}
1651		
1652		searchInProgress = false;
1653		thereWasAnotherRequest = false;
1654		
1655	    searchBox = jq$('#' + model.searchBoxId);
1656		searchBox.bind('keypress', moveToSearchPage)
1657		selectedTypes = model.selectedTypes;
1658		
1659		if (model.autoSuggest)
1660		{
1661		    resultDiv = jq$('#' + model.resultDivId);
1662
1663			searchBox.bind('input', search)
1664			searchBox.bind('keydown', handleKey)
1665		}
1666	}
1667
1668	function moveToSearchPage(e)
1669	{
1670		if (e.keyCode == 13) // enter
1671		{
1672			var url;
1673
1674			if (selectedSugestion >= 0 && selectedSugestion < items.length)
1675			{
1676				url = items[selectedSugestion].url;
1677			}
1678			else
1679			{
1680				url = WA.String.format(model.searchTemplate, 
1681					encodeURIComponent(searchBox.val()),
1682					selectedTypes, 1);
1683			}
1684			
1685			window.location = url;
1686			return false;
1687		}
1688	}
1689	function handleKey(e)
1690	{
1691		if (e.keyCode == 40)  // down
1692		{
1693			setSelectedDown();
1694			return false;
1695		}
1696		if (e.keyCode == 38)  // up
1697		{
1698			setSelectedUp();
1699			return false;
1700		}
1701	}
1702	  
1703	function search() 
1704	{
1705		if (timer)
1706		{
1707		  clearTimeout(timer);
1708		}
1709
1710		timer = setTimeout(doSearch, delay);
1711	}
1712
1713	function doSearch()
1714	{
1715        thereWasAnotherRequest = false;
1716		
1717		selectedSugestion = -1;
1718		if (searchBox.val().length == 0) 
1719		{
1720		  setEmptyResult();
1721		  return;
1722		} 
1723
1724		var filter = selectedTypes;
1725		if (filter == 0)
1726		{
1727		  setEmptyResult();
1728		  return;
1729		}
1730
1731		if (searchInProgress)
1732		{
1733			thereWasAnotherRequest = true;
1734			return;
1735		}
1736
1737		searchInProgress = true;
1738		jq$.ajax({
1739		  type: 'POST',
1740		  url: model.searchActionUrl,
1741		  data: JSON.stringify({ 'q' : searchBox.val(), 'types': filter, 'pageNumber' : 1, 'noPaging' : 0 , 'pageSize' : 10, titlesOnly: 1}),
1742		  contentType: 'application/json; charset=utf-8',
1743		  dataType: 'text'
1744		}).done(function(data)
1745		{
1746			searchInProgress = false;
1747			if (thereWasAnotherRequest) { doSearch(); }
1748			else
1749			{
1750				selectedSugestion = -1;
1751				var jsonData = JSON.parse( data.replace("while(1); ","","i").trim() );		  
1752				renderResult(jsonData);
1753		    }
1754		})
1755		.fail(function()
1756		{
1757			searchInProgress = false;
1758			if (thereWasAnotherRequest) { doSearch(); }
1759		});
1760	}
1761
1762	function setEmptyResult()
1763	{
1764		resultDiv.html('');
1765		resultDiv.hide();
1766	}
1767
1768	function renderResult(data)
1769	{
1770		resultDiv.show();
1771		items = data.entities;
1772		var a = [];
1773
1774		for (var i = 0; i < items.length; i++)
1775		{
1776		  var o = items[i];
1777		  a.push('<div id="' + getSuggestionDivId(i) + '" class="item">');
1778		  a.push('<a class="' + o.className + '" title="' + o.tooltip + '" href="' + o.url + '"><span>' + o.title + '</span></a>');
1779		  a.push('</div>');
1780		}
1781
1782		  a.push('<div id="' + getSuggestionDivId(i) + '" class="item last">');
1783		  a.push('<a href="' + WA.String.format(model.searchTemplate, encodeURIComponent(searchBox.val()), selectedTypes, 1) +
1784			'"><span>' + WA.String.format(model.GoToSearchPageTextTemplate, $('<div/>').text(searchBox.val()).html()) + '</span></a>');
1785		  a.push('</div>');
1786		resultDiv.html(a.join(''));
1787	}
1788	
1789	function getSuggestionDivId(i)
1790	{
1791		return model.gadgetId + '_' + i + 'Suggestion';
1792	}
1793	
1794	function setSelectedDown()
1795	{
1796	   if (!items || selectedSugestion >= items.length)
1797	   {
1798		return;
1799	   }
1800	   
1801		clearCurrentSuggestion();
1802		selectedSugestion++;
1803		setCurrentSuggestion();
1804	}
1805	
1806	function setSelectedUp()
1807	{
1808	   if (!items || (selectedSugestion <= 0))
1809	   {
1810		return;
1811	   }
1812	   
1813		clearCurrentSuggestion();
1814		selectedSugestion--;
1815		setCurrentSuggestion();
1816	}
1817
1818	function clearCurrentSuggestion()
1819	{
1820	   if (selectedSugestion < 0)
1821	   {
1822		return;
1823	   }
1824	   
1825	   var div  = jq$('#' + getSuggestionDivId(selectedSugestion)); 
1826	   div.removeClass('selectedSuggestions');
1827	}
1828	
1829	function setCurrentSuggestion()
1830	{
1831	   if (selectedSugestion < 0)
1832	   {
1833		return;
1834	   }
1835	   
1836	   var div  = jq$('#' +  getSuggestionDivId(selectedSugestion)); 
1837	   div.addClass('selectedSuggestions');
1838	}
1839
1840	init();
1841	}
1842}) ();
1843
1844/*compiled*/
1845// Camera slideshow v1.3.3 - a jQuery slideshow with many effects, transitions, easy to customize, using canvas and mobile ready, based on jQuery 1.4+
1846// Copyright (c) 2012 by Manuel Masia - www.pixedelic.com
1847// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
1848;(function($){$.fn.camera = function(opts, callback) {
1849	
1850	var defaults = {
1851		alignment			: 'center', //topLeft, topCenter, topRight, centerLeft, center, centerRight, bottomLeft, bottomCenter, bottomRight
1852		
1853		autoAdvance			: true,	//true, false
1854		
1855		mobileAutoAdvance	: true, //true, false. Auto-advancing for mobile devices
1856		
1857		barDirection		: 'leftToRight',	//'leftToRight', 'rightToLeft', 'topToBottom', 'bottomToTop'
1858		
1859		barPosition			: 'bottom',	//'bottom', 'left', 'top', 'right'
1860		
1861		cols				: 6,
1862		
1863		easing				: 'easeInOutExpo',	//for the complete list http://jqueryui.com/demos/effect/easing.html
1864		
1865		mobileEasing		: '',	//leave empty if you want to display the same easing on mobile devices and on desktop etc.
1866		
1867		fx					: 'random',	//'random','simpleFade', 'curtainTopLeft', 'curtainTopRight', 'curtainBottomLeft', 'curtainBottomRight', 'curtainSliceLeft', 'curtainSliceRight', 'blindCurtainTopLeft', 'blindCurtainTopRight', 'blindCurtainBottomLeft', 'blindCurtainBottomRight', 'blindCurtainSliceBottom', 'blindCurtainSliceTop', 'stampede', 'mosaic', 'mosaicReverse', 'mosaicRandom', 'mosaicSpiral', 'mosaicSpiralReverse', 'topLeftBottomRight', 'bottomRightTopLeft', 'bottomLeftTopRight', 'bottomLeftTopRight'
1868										//you can also use more than one effect, just separate them with commas: 'simpleFade, scrollRight, scrollBottom'
1869
1870		mobileFx			: '',	//leave empty if you want to display the same effect on mobile devices and on desktop etc.
1871
1872		gridDifference		: 250,	//to make the grid blocks slower than the slices, this value must be smaller than transPeriod
1873		
1874		height				: '50%',	//here you can type pixels (for instance '300px'), a percentage (relative to the width of the slideshow, for instance '50%') or 'auto'
1875		
1876		imagePath			: 'images/',	//he path to the image folder (it serves for the blank.gif, when you want to display videos)
1877		
1878		hover				: true,	//true, false. Puase on state hover. Not available for mobile devices
1879				
1880		loader				: 'pie',	//pie, bar, none (even if you choose "pie", old browsers like IE8- can't display it... they will display always a loading bar)
1881		
1882		loaderColor			: '#eeeeee', 
1883		
1884		loaderBgColor		: '#222222', 
1885		
1886		loaderOpacity		: .8,	//0, .1, .2, .3, .4, .5, .6, .7, .8, .9, 1
1887		
1888		loaderPadding		: 2,	//how many empty pixels you want to display between the loader and its background
1889		
1890		loaderStroke		: 7,	//the thickness both of the pie loader and of the bar loader. Remember: for the pie, the loader thickness must be less than a half of the pie diameter
1891				
1892		minHeight			: '200px',	//you can also leave it blank
1893		
1894		navigation			: true,	//true or false, to display or not the navigation buttons
1895		
1896		navigationHover		: true,	//if true the navigation button (prev, next and play/stop buttons) will be visible on hover state only, if false they will be visible always
1897		
1898		mobileNavHover		: true,	//same as above, but only for mobile devices
1899		
1900		opacityOnGrid		: false,	//true, false. Decide to apply a fade effect to blocks and slices: if your slideshow is fullscreen or simply big, I recommend to set it false to have a smoother effect 
1901		
1902		overlayer			: true,	//a layer on the images to prevent the users grab them simply by clicking the right button of their mouse (.camera_overlayer)
1903		
1904		pagination			: true,
1905		
1906		playPause			: true,	//true or false, to display or not the play/pause buttons
1907		
1908		pauseOnClick		: true,	//true, false. It stops the slideshow when you click the sliders.
1909		
1910		pieDiameter			: 38,
1911		
1912		piePosition			: 'rightTop',	//'rightTop', 'leftTop', 'leftBottom', 'rightBottom'
1913		
1914		portrait			: false, //true, false. Select true if you don't want that your images are cropped
1915		
1916		rows				: 4,
1917		
1918		slicedCols			: 12,	//if 0 the same value of cols
1919		
1920		slicedRows			: 8,	//if 0 the same value of rows
1921		
1922		slideOn				: 'random',	//next, prev, random: decide if the transition effect will be applied to the current (prev) or the next slide
1923		
1924		thumbnails			: false,
1925		
1926		time				: 7000,	//milliseconds between the end of the sliding effect and the start of the nex one
1927		
1928		transPeriod			: 1500,	//lenght of the sliding effect in milliseconds
1929		
1930    randomSlide : false,
1931		
1932////////callbacks
1933
1934		onEndTransition		: function() {  },	//this callback is invoked when the transition effect ends
1935
1936		onLoaded			: function() {  },	//this callback is invoked when the image on a slide has completely loaded
1937		
1938		onStartLoading		: function() {  },	//this callback is invoked when the image on a slide start loading
1939		
1940		onStartTransition	: function() {  }	//this callback is invoked when the transition effect starts
1941
1942    };
1943	
1944	
1945	function isMobile() {
1946		if( navigator.userAgent.match(/Android/i) ||
1947			navigator.userAgent.match(/webOS/i) ||
1948			navigator.userAgent.match(/iPad/i) ||
1949			navigator.userAgent.match(/iPhone/i) ||
1950			navigator.userAgent.match(/iPod/i)
1951			){
1952				return true;
1953		}
1954	}
1955
1956	var opts = $.extend({}, defaults, opts);
1957	
1958	var wrap = $(this).addClass('camera_wrap');
1959	
1960	wrap.wrapInner(
1961        '<div class="camera_src" />'
1962		).wrapInner(
1963	    '<div class="camera_fakehover" />'
1964		);
1965		
1966	var fakeHover = $('.camera_fakehover',wrap);
1967	
1968	fakeHover.append(
1969		'<div class="camera_target"></div>'
1970		);
1971	if(opts.overlayer == true){
1972		fakeHover.append(
1973			'<div class="camera_overlayer"></div>'
1974			)
1975	}
1976		fakeHover.append(
1977        '<div class="camera_target_content"></div>'
1978		);
1979		
1980	var loader;
1981	
1982	if(opts.loader=='pie' && $.browser.msie && $.browser.version < 9){
1983		loader = 'bar';
1984	} else {
1985		loader = opts.loader;
1986	}
1987	
1988	if(loader == 'pie'){
1989		fakeHover.append(
1990			'<div class="camera_pie"></div>'
1991			)
1992	} else if (loader == 'bar') {
1993		fakeHover.append(
1994			'<div class="camera_bar"></div>'
1995			)
1996	} else {
1997		fakeHover.append(
1998			'<div class="camera_bar" style="display:none"></div>'
1999			)
2000	}
2001	
2002	if(opts.playPause==true){
2003		fakeHover.append(
2004        '<div class="camera_commands"></div>'
2005		)
2006	}
2007		
2008	if(opts.navigation==true){
2009		fakeHover.append(
2010			'<div class="camera_prev"><span></span></div>'
2011			).append(
2012			'<div class="camera_next"><span></span></div>'
2013			);
2014	}
2015		
2016	if(opts.thumbnails==true){
2017		wrap.append(
2018			'<div class="camera_thumbs_cont" />'
2019			);
2020	}
2021	
2022	if(opts.thumbnails==true && opts.pagination!=true){
2023		$('.camera_thumbs_cont',wrap).wrap(
2024			'<div />'
2025			).wrap(
2026				'<div class="camera_thumbs" />'
2027			).wrap(
2028				'<div />'
2029			).wrap(
2030				'<div class="camera_command_wrap" />'
2031			);
2032	}
2033		
2034	if(opts.pagination==true){
2035		wrap.append(
2036			'<div class="camera_pag"></div>'
2037			);
2038	}
2039		
2040	wrap.append(
2041		'<div class="camera_loader"></div>'
2042		);
2043		
2044	$('.camera_caption',wrap).each(function(){
2045		$(this).wrapInner('<div />');
2046	});
2047		
2048                
2049	var pieID = 'pie_'+wrap.index('.camera_wrap'),
2050		elem = $('.camera_src',wrap),
2051		target = $('.camera_target',wrap),
2052		content = $('.camera_target_content',wrap),
2053		pieContainer = $('.camera_pie',wrap),
2054		barContainer = $('.camera_bar',wrap),
2055		prevNav = $('.camera_prev',wrap),
2056		nextNav = $('.camera_next',wrap),
2057		commands = $('.camera_commands',wrap),
2058		pagination = $('.camera_pag',wrap),
2059		thumbs = $('.camera_thumbs_cont',wrap);	
2060
2061	
2062	var w,
2063		h;
2064
2065
2066	var allImg = new Array();
2067	$('> div', elem).each( function() { 
2068		allImg.push($(this).attr('data-src'));
2069	});
2070	
2071	var allLinks = new Array();
2072	$('> div', elem).each( function() {
2073		if($(this).attr('data-link')){
2074			allLinks.push($(this).attr('data-link'));
2075		} else {
2076			allLinks.push('');
2077		}
2078	});
2079	
2080	var allTargets = new Array();
2081	$('> div', elem).each( function() {
2082		if($(this).attr('data-target')){
2083			allTargets.push($(this).attr('data-target'));
2084		} else {
2085			allTargets.push('');
2086		}
2087	});
2088	
2089  var allTitles = new Array();
2090	$('> div', elem).each( function() {
2091		if($(this).attr('data-title')){
2092			allTitles.push($(this).attr('data-title'));
2093		} else {
2094			allTitles.push('');
2095		}
2096	});
2097	
2098	var allPor = new Array();
2099	$('> div', elem).each( function() {
2100		if($(this).attr('data-portrait')){
2101			allPor.push($(this).attr('data-portrait'));
2102		} else {
2103			allPor.push('');
2104		}
2105	});
2106	
2107	var allAlign= new Array();
2108	$('> div', elem).each( function() { 
2109		if($(this).attr('data-alignment')){
2110			allAlign.push($(this).attr('data-alignment'));
2111		} else {
2112			allAlign.push('');
2113		}
2114	});
2115	
2116		
2117	var allThumbs = new Array();
2118	$('> div', elem).each( function() { 
2119		if($(this).attr('data-thumb')){
2120			allThumbs.push($(this).attr('data-thumb'));
2121		} else {
2122			allThumbs.push('');
2123		}
2124	});
2125	
2126	var amountSlide = allImg.length;
2127
2128	$(content).append('<div class="cameraContents" />');
2129	var loopMove;
2130	for (loopMove=0;loopMove<amountSlide;loopMove++)
2131	{
2132		$('.cameraContents',content).append('<div class="cameraContent" />');
2133		if(allLinks[loopMove]!=''){
2134			//only for Wordpress plugin
2135			var dataBox = $('> div ',elem).eq(loopMove).attr('data-box');
2136			if(typeof dataBox !== 'undefined' && dataBox !== false && dataBox != '') {
2137				dataBox = 'data-box="'+$('> div ',elem).eq(loopMove).attr('data-box')+'"';
2138			} else {
2139				dataBox = '';
2140			}
2141			//
2142			$('.camera_target_content .cameraContent:eq('+loopMove+')',wrap).append('<a class="camera_link" href="'+allLinks[loopMove]+'" '+dataBox+' target="'+allTargets[loopMove]+'" title="'+allTitles[loopMove]+'"></a>');
2143		}
2144
2145	}
2146	$('.camera_caption',wrap).each(function(){
2147		var ind = $(this).parent().index(),
2148			cont = wrap.find('.cameraContent').eq(ind);
2149		$(this).appendTo(cont);
2150	});
2151	
2152	target.append('<div class="cameraCont" />');
2153	var cameraCont = $('.cameraCont',wrap);
2154	
2155
2156	
2157	var loop;
2158	for (loop=0;loop<amountSlide;loop++)
2159	{
2160		cameraCont.append('<div class="cameraSlide cameraSlide_'+loop+'" />');
2161		var div = $('> div:eq('+loop+')',elem);
2162		target.find('.cameraSlide_'+loop).clone(div);
2163	}
2164	
2165	
2166	function thumbnailVisible() {
2167		var wTh = $(thumbs).width();
2168		$('li', thumbs).removeClass('camera_visThumb');
2169		$('li', thumbs).each(function(){
2170			var pos = $(this).position(),
2171				ulW = $('ul', thumbs).outerWidth(),
2172				offUl = $('ul', thumbs).offset().left,
2173				offDiv = $('> div',thumbs).offset().left,
2174				ulLeft = offDiv-offUl;
2175				if(ulLeft>0){
2176					$('.camera_prevThumbs',camera_thumbs_wrap).removeClass('hideNav');
2177				} else {
2178					$('.camera_prevThumbs',camera_thumbs_wrap).addClass('hideNav');
2179				}
2180				if((ulW-ulLeft)>wTh){
2181					$('.camera_nextThumbs',camera_thumbs_wrap).removeClass('hideNav');
2182				} else {
2183					$('.camera_nextThumbs',camera_thumbs_wrap).addClass('hideNav');
2184				}
2185				var left = pos.left,
2186					right = pos.left+($(this).width());
2187				if(right-ulLeft<=wTh && left-ulLeft>=0){
2188					$(this).addClass('camera_visThumb');
2189				}
2190		});
2191	}
2192
2193  function placeThumbsOnWindowResize()
2194  {
2195    thumbnailPos();
2196    thumbnailVisible();
2197  }
2198
2199  $(window).on('load resize pageshow',placeThumbsOnWindowResize);
2200
2201	cameraCont.append('<div class="cameraSlide cameraSlide_'+loop+'" />');
2202	
2203	
2204	var started;
2205	
2206	wrap.show();
2207	var w = target.width();
2208	var h = target.height();
2209	
2210	var setPause;
2211
2212  function onWindowResize()
2213  {
2214    if(started == true) {
2215      resizeImage();
2216    }
2217    $('ul', thumbs).animate({'margin-top':0},0,thumbnailPos);
2218    if(!elem.hasClass('paused')){
2219      elem.addClass('paused');
2220      if($('.camera_stop',camera_thumbs_wrap).length){
2221        $('.camera_stop',camera_thumbs_wrap).hide()
2222        $('.camera_play',camera_thumbs_wrap).show();
2223        if(loader!='none'){
2224          $('#'+pieID).hide();
2225        }
2226      } else {
2227        if(loader!='none'){
2228          $('#'+pieID).hide();
2229        }
2230      }
2231      clearTimeout(setPause);
2232      setPause = setTimeout(function(){
2233        elem.removeClass('paused');
2234        if($('.camera_play',camera_thumbs_wrap).length){
2235          $('.camera_play',camera_thumbs_wrap).hide();
2236          $('.camera_stop',camera_thumbs_wrap).show();
2237          if(loader!='none'){
2238            $('#'+pieID).fadeIn();
2239          }
2240        } else {
2241          if(loader!='none'){
2242            $('#'+pieID).fadeIn();
2243          }
2244        }
2245      },1500);
2246    }
2247  }
2248		
2249	$(window).on('resize pageshow', onWindowResize);
2250	
2251	function resizeImage(){	
2252		var res;
2253		function resizeImageWork(){
2254
2255      if (!wrap)
2256      {
2257        if (res) clearTimeout(res);
2258
2259        return;
2260      }
2261
2262      var prevW = w,
2263          prevH = h;
2264
2265			w = wrap.width();
2266			if(opts.height.indexOf('%')!=-1) {
2267				var startH = Math.round(w / (100/parseFloat(opts.height)));
2268				if(opts.minHeight != '' && startH < parseFloat(opts.minHeight)){
2269					h = parseFloat(opts.minHeight);
2270				} else {
2271					h = startH;
2272				}
2273				wrap.css({height:h});
2274			} else if (opts.height=='auto') {
2275				h = wrap.height();
2276			} else {
2277				h = parseFloat(opts.height);
2278				wrap.css({height:h});
2279			}
2280
2281			$('.camerarelative',target).css({'width':w,'height':h});
2282
2283      if (w != prevW || h != prevH)
2284      {
2285        WA.Gadgets.notifyGadgetChanged();
2286      }
2287
2288			$('.imgLoaded',target).each(function(){
2289				var t = $(this),
2290					wT = t.attr('width'),
2291					hT = t.attr('height'),
2292					imgLoadIn = t.index(),
2293					mTop,
2294					mLeft,
2295					alignment = t.attr('data-alignment'),
2296					portrait =  t.attr('data-portrait');
2297					
2298					if(typeof alignment === 'undefined' || alignment === false || alignment === ''){
2299						alignment = opts.alignment;
2300					}
2301					
2302					if(typeof portrait === 'undefined' || portrait === false || portrait === ''){
2303						portrait = opts.portrait;
2304					}
2305										
2306					if(portrait==false||portrait=='false'){
2307						if((wT/hT)<(w/h)) {
2308							var r = w / wT;
2309							var d = (Math.abs(h - (hT*r)))*0.5;
2310							switch(alignment){
2311								case 'topLeft':
2312									mTop = 0;
2313									break;
2314								case 'topCenter':
2315									mTop = 0;
2316									break;
2317								case 'topRight':
2318									mTop = 0;
2319									break;
2320								case 'centerLeft':
2321									mTop = '-'+d+'px';
2322									break;
2323								case 'center':
2324									mTop = '-'+d+'px';
2325									break;
2326								case 'centerRight':
2327									mTop = '-'+d+'px';
2328									break;
2329								case 'bottomLeft':
2330									mTop = '-'+d*2+'px';
2331									break;
2332								case 'bottomCenter':
2333									mTop = '-'+d*2+'px';
2334									break;
2335								case 'bottomRight':
2336									mTop = '-'+d*2+'px';
2337									break;
2338							}
2339							t.css({
2340								'height' : hT*r,
2341								'margin-left' : 0,
2342								'margin-top' : mTop,
2343								'position' : 'absolute',
2344								'visibility' : 'visible',
2345								'width' : w
2346							});
2347						}
2348						else {
2349							var r = h / hT;
2350							var d = (Math.abs(w - (wT*r)))*0.5;
2351							switch(alignment){
2352								case 'topLeft':
2353									mLeft = 0;
2354									break;
2355								case 'topCenter':
2356									mLeft = '-'+d+'px';
2357									break;
2358								case 'topRight':
2359									mLeft = '-'+d*2+'px';
2360									break;
2361								case 'centerLeft':
2362									mLeft = 0;
2363									break;
2364								case 'center':
2365									mLeft = '-'+d+'px';
2366									break;
2367								case 'centerRight':
2368									mLeft = '-'+d*2+'px';
2369									break;
2370								case 'bottomLeft':
2371									mLeft = 0;
2372									break;
2373								case 'bottomCenter':
2374									mLeft = '-'+d+'px';
2375									break;
2376								case 'bottomRight':
2377									mLeft = '-'+d*2+'px';
2378									break;
2379							}
2380							t.css({
2381								'height' : h,
2382								'margin-left' : mLeft,
2383								'margin-top' : 0,
2384								'position' : 'absolute',
2385								'visibility' : 'visible',
2386								'width' : wT*r
2387							});
2388						}
2389					} else {
2390						if((wT/hT)<(w/h)) {
2391							var r = h / hT;
2392							var d = (Math.abs(w - (wT*r)))*0.5;
2393							switch(alignment){
2394								case 'topLeft':
2395									mLeft = 0;
2396									break;
2397								case 'topCenter':
2398									mLeft = d+'px';
2399									break;
2400								case 'topRight':
2401									mLeft = d*2+'px';
2402									break;
2403								case 'centerLeft':
2404									mLeft = 0;
2405									break;
2406								case 'center':
2407									mLeft = d+'px';
2408									break;
2409								case 'centerRight':
2410									mLeft = d*2+'px';
2411									break;
2412								case 'bottomLeft':
2413									mLeft = 0;
2414									break;
2415								case 'bottomCenter':
2416									mLeft = d+'px';
2417									break;
2418								case 'bottomRight':
2419									mLeft = d*2+'px';
2420									break;
2421							}
2422							t.css({
2423								'height' : h,
2424								'margin-left' : mLeft,
2425								'margin-top' : 0,
2426								'position' : 'absolute',
2427								'visibility' : 'visible',
2428								'width' : wT*r
2429							});
2430						}
2431						else {
2432							var r = w / wT;
2433							var d = (Math.abs(h - (hT*r)))*0.5;
2434							switch(alignment){
2435								case 'topLeft':
2436									mTop = 0;
2437									break;
2438								case 'topCenter':
2439									mTop = 0;
2440									break;
2441								case 'topRight':
2442									mTop = 0;
2443									break;
2444								case 'centerLeft':
2445									mTop = d+'px';
2446									break;
2447								case 'center':
2448									mTop = d+'px';
2449									break;
2450								case 'centerRight':
2451									mTop = d+'px';
2452									break;
2453								case 'bottomLeft':
2454									mTop = d*2+'px';
2455									break;
2456								case 'bottomCenter':
2457									mTop = d*2+'px';
2458									break;
2459								case 'bottomRight':
2460									mTop = d*2+'px';
2461									break;
2462							}
2463							t.css({
2464								'height' : hT*r,
2465								'margin-left' : 0,
2466								'margin-top' : mTop,
2467								'position' : 'absolute',
2468								'visibility' : 'visible',
2469								'width' : w
2470							});
2471						}
2472					}
2473			});
2474		}
2475		if (started == true) {
2476			clearTimeout(res);
2477			res = setTimeout(resizeImageWork,200);
2478		} else {
2479			resizeImageWork();
2480		}
2481		
2482		started = true;
2483	}
2484	
2485	
2486	var u,
2487		setT;
2488
2489	var clickEv,
2490		autoAdv,
2491		navHover,
2492		commands,
2493		pagination;
2494
2495	var videoHover,
2496		videoPresent;
2497		
2498	if(isMobile() && opts.mobileAutoAdvance!=''){
2499		autoAdv = opts.mobileAutoAdvance;
2500	} else {
2501		autoAdv = opts.autoAdvance;
2502	}
2503	
2504	if(autoAdv==false){
2505		elem.addClass('paused');
2506	}
2507
2508	if(isMobile() && opts.mobileNavHover!=''){
2509		navHover = opts.mobileNavHover;
2510	} else {
2511		navHover = opts.navigationHover;
2512	}
2513
2514	if(elem.length!=0){
2515			
2516		var selector = $('.cameraSlide',target);
2517		selector.wrapInner('<div class="camerarelative" />');
2518		
2519		var navSlide;
2520			
2521		var barDirection = opts.barDirection;
2522	
2523		var camera_thumbs_wrap = wrap;
2524
2525
2526		$('iframe',fakeHover).each(function(){
2527			var t = $(this);
2528			var src = t.attr('src');
2529			t.attr('data-src',src);
2530			var divInd = t.parent().index('.camera_src > div');
2531			$('.camera_target_content .cameraContent:eq('+divInd+')',wrap).append(t);
2532		});
2533		function imgFake() {
2534				$('iframe',fakeHover).each(function(){
2535					$('.camera_caption',fakeHover).show();
2536					var t = $(this);
2537					var cloneSrc = t.attr('data-src');
2538					t.attr('src',cloneSrc);
2539					var imgFakeUrl = opts.imagePath+'blank.gif';
2540					var imgFake = new Image();
2541					imgFake.src = imgFakeUrl;
2542					if(opts.height.indexOf('%')!=-1) {
2543						var startH = Math.round(w / (100/parseFloat(opts.height)));
2544						if(opts.minHeight != '' && startH < parseFloat(opts.minHeight)){
2545							h = parseFloat(opts.minHeight);
2546						} else {
2547							h = startH;
2548						}
2549					} else if (opts.height=='auto') {
2550						h = wrap.height();
2551					} else {
2552						h = parseFloat(opts.height);
2553					}
2554					t.after($(imgFake).attr({'class':'imgFake','width':w,'height':h}));
2555					var clone = t.clone();
2556					t.remove();
2557					$(imgFake).on('click',function(){
2558						if($(this).css('position')=='absolute') {
2559							$(this).remove();
2560							if(cloneSrc.indexOf('vimeo') != -1 || cloneSrc.indexOf('youtube') != -1) {
2561								if(cloneSrc.indexOf('?') != -1){
2562									autoplay = '&autoplay=1';
2563								} else {
2564									autoplay = '?autoplay=1';
2565								}
2566							} else if(cloneSrc.indexOf('dailymotion') != -1) {
2567								if(cloneSrc.indexOf('?') != -1){
2568									autoplay = '&autoPlay=1';
2569								} else {
2570									autoplay = '?autoPlay=1';
2571								}
2572							}
2573							clone.attr('src',cloneSrc+autoplay);
2574							videoPresent = true;
2575						} else {
2576							$(this).css({position:'absolute',top:0,left:0,zIndex:10}).after(clone);
2577							clone.css({position:'absolute',top:0,left:0,zIndex:9});
2578						}
2579					});
2580				});
2581		}
2582		
2583		imgFake();
2584		
2585		
2586		if(opts.hover==true){
2587			if(!isMobile()){
2588				fakeHover.hover(function(){
2589					elem.addClass('hovered');
2590				},function(){
2591					elem.removeClass('hovered');
2592				});
2593			}
2594		}
2595
2596    if (navHover==true)
2597    {
2598      $(prevNav,wrap).animate({opacity:0}
2598,0);
2599      $(nextNav,wrap).animate({opacity:0},0);
2600      $(commands,wrap).animate({opacity:0},0);
2601
2602      if (isMobile())
2603      {
2604        wrap.on
2605        (
2606          'vmouseover',
2607          '.camera_fakehover',
2608          function()
2609          {
2610            $(prevNav,wrap).animate({opacity:1},200);
2611            $(nextNav,wrap).animate({opacity:1},200);
2612            $(commands,wrap).animate({opacity:1},200);
2613          }
2614        );
2615
2616        wrap.on
2617        (
2618          'vmouseout',
2619          '.camera_fakehover',
2620          function()
2621          {
2622            $(prevNav,wrap).delay(500).animate({opacity:0},200);
2623            $(nextNav,wrap).delay(500).animate({opacity:0},200);
2624            $(commands,wrap).delay(500).animate({opacity:0},200);
2625          }
2626        );
2627      }
2628      else
2629      {
2630        fakeHover.hover(function(){
2631		  $(prevNav,wrap).stop(true);
2632		  $(nextNav,wrap).stop(true);
2633		  $(commands,wrap).stop(true);
2634          $(prevNav,wrap).animate({opacity:1},200);
2635          $(nextNav,wrap).animate({opacity:1},200);
2636          $(commands,wrap).animate({opacity:1},200);
2637        },function(){
2638		  $(prevNav,wrap).stop(true);
2639		  $(nextNav,wrap).stop(true);
2640		  $(commands,wrap).stop(true);
2641          $(prevNav,wrap).animate({opacity:0}
2641,200);
2642          $(nextNav,wrap).animate({opacity:0},200);
2643          $(commands,wrap).animate({opacity:0},200);
2644        });
2645      }
2646    }
2647
2648
2649    camera_thumbs_wrap.on
2650    (
2651      'click',
2652      '.camera_stop',
2653      function()
2654      {
2655        autoAdv = false;
2656        elem.addClass('paused');
2657
2658        if ($('.camera_stop',camera_thumbs_wrap).length)
2659        {
2660          $('.camera_stop',camera_thumbs_wrap).hide();
2661          $('.camera_play',camera_thumbs_wrap).show();
2662
2663          if (loader!='none')
2664          {
2665            $('#'+pieID).hide();
2666          }
2667        }
2668        else
2669        {
2670          if (loader!='none')
2671          {
2672            $('#'+pieID).hide();
2673          }
2674        }
2675      }
2676    );
2677
2678    camera_thumbs_wrap.on
2679    (
2680      'click',
2681      '.camera_play',
2682      function()
2683      {
2684        autoAdv = true;
2685        elem.removeClass('paused');
2686
2687        if ($('.camera_play',camera_thumbs_wrap).length)
2688        {
2689          $('.camera_play',camera_thumbs_wrap).hide();
2690          $('.camera_stop',camera_thumbs_wrap).show();
2691
2692          if (loader!='none')
2693          {
2694            $('#'+pieID).show();
2695          }
2696        }
2697        else
2698        {
2699          if (loader!='none')
2700          {
2701            $('#'+pieID).show();
2702          }
2703        }
2704      }
2705    );
2706	
2707		if(opts.pauseOnClick==true){
2708			$('.camera_target_content',fakeHover).mouseup(function(){
2709				autoAdv = false;
2710				elem.addClass('paused');
2711				$('.camera_stop',camera_thumbs_wrap).hide()
2712				$('.camera_play',camera_thumbs_wrap).show();
2713				$('#'+pieID).hide();
2714			});
2715		}
2716		$('.cameraContent, .imgFake',fakeHover).hover(function(){
2717			videoHover = true;
2718		},function(){
2719			videoHover = false;
2720		});
2721		
2722		$('.cameraContent, .imgFake',fakeHover).on('click',function(){
2723			if(videoPresent == true && videoHover == true) {
2724				autoAdv = false;
2725				$('.camera_caption',fakeHover).hide();
2726				elem.addClass('paused');
2727				$('.camera_stop',camera_thumbs_wrap).hide()
2728				$('.camera_play',camera_thumbs_wrap).show();
2729				$('#'+pieID).hide();
2730			}
2731		});
2732		
2733		
2734	}
2735	
2736	
2737		function shuffle(arr) {
2738			for(
2739			  var j, x, i = arr.length; i;
2740			  j = parseInt(Math.random() * i),
2741			  x = arr[--i], arr[i] = arr[j], arr[j] = x
2742			);
2743			return arr;
2744		}
2745	
2746		function isInteger(s) {
2747			return Math.ceil(s) == Math.floor(s);
2748		}	
2749	
2750		if (loader != 'pie') {
2751			barContainer.append('<span class="camera_bar_cont" />');
2752			$('.camera_bar_cont',barContainer)
2753				.animate({opacity:opts.loaderOpacity},0)
2754				.css({'position':'absolute', 'left':0, 'right':0, 'top':0, 'bottom':0, 'background-color':opts.loaderBgColor})
2755				.append('<span id="'+pieID+'" />');
2756			$('#'+pieID).animate({opacity:0}
2756,0);
2757			var canvas = $('#'+pieID);
2758			canvas.css({'position':'absolute', 'background-color':opts.loaderColor});
2759			switch(opts.barPosition){
2760				case 'left':
2761					barContainer.css({right:'auto',width:opts.loaderStroke});
2762					break;
2763				case 'right':
2764					barContainer.css({left:'auto',width:opts.loaderStroke});
2765					break;
2766				case 'top':
2767					barContainer.css({bottom:'auto',height:opts.loaderStroke});
2768					break;
2769				case 'bottom':
2770					barContainer.css({top:'auto',height:opts.loaderStroke});
2771					break;
2772			}
2773			switch(barDirection){
2774				case 'leftToRight':
2775					canvas.css({'left':0, 'right':0, 'top':opts.loaderPadding, 'bottom':opts.loaderPadding});
2776					break;
2777				case 'rightToLeft':
2778					canvas.css({'left':0, 'right':0, 'top':opts.loaderPadding, 'bottom':opts.loaderPadding});
2779					break;
2780				case 'topToBottom':
2781					canvas.css({'left':opts.loaderPadding, 'right':opts.loaderPadding, 'top':0, 'bottom':0});
2782					break;
2783				case 'bottomToTop':
2784					canvas.css({'left':opts.loaderPadding, 'right':opts.loaderPadding, 'top':0, 'bottom':0});
2785					break;
2786			}
2787		} else {
2788			pieContainer.append('<canvas id="'+pieID+'"></canvas>');
2789			var G_vmlCanvasManager;
2790			var canvas = document.getElementById(pieID);
2791			canvas.setAttribute("width", opts.pieDiameter);
2792			canvas.setAttribute("height", opts.pieDiameter);
2793			var piePosition;
2794			switch(opts.piePosition){
2795				case 'leftTop' :
2796					piePosition = 'left:0; top:0;';
2797					break;
2798				case 'rightTop' :
2799					piePosition = 'right:0; top:0;';
2800					break;
2801				case 'leftBottom' :
2802					piePosition = 'left:0; bottom:0;';
2803					break;
2804				case 'rightBottom' :
2805					piePosition = 'right:0; bottom:0;';
2806					break;
2807			}
2808			canvas.setAttribute("style", "position:absolute; z-index:1002; "+piePosition);
2809			var rad;
2810			var radNew;
2811	
2812			if (canvas && canvas.getContext) {
2813				var ctx = canvas.getContext("2d");
2814				ctx.rotate(Math.PI*(3/2));
2815				ctx.translate(-opts.pieDiameter,0);
2816			}
2817		
2818		}
2819		if(loader=='none' || autoAdv==false) {
2820			$('#'+pieID).hide();
2821			$('.camera_canvas_wrap',camera_thumbs_wrap).hide();
2822		}
2823		
2824		if($(pagination).length) {
2825			$(pagination).append('<ul class="camera_pag_ul" />');
2826			var li;
2827			for (li = 0; li < amountSlide; li++){
2828				$('.camera_pag_ul',wrap).append('<li class="pag_nav_'+li+'" style="position:relative; z-index:1002"><span><span>'+li+'</span></span></li>');
2829			}
2830			$('.camera_pag_ul li',wrap).hover(function(){
2831				$(this).addClass('camera_hover');
2832				if($('.camera_thumb',this).length){
2833					var wTh = $('.camera_thumb',this).outerWidth(),
2834					hTh = $('.camera_thumb',this).outerHeight(),
2835					wTt = $(this).outerWidth();
2836					$('.camera_thumb',this).show().css({'top':'-'+hTh+'px','left':'-'+(wTh-wTt)/2+'px'}).animate({'opacity':1,'margin-top':'-3px'},200);
2837					$('.thumb_arrow',this).show().animate({'opacity':1,'margin-top':'-3px'},200);
2838				}
2839			},function(){
2840				$(this).removeClass('camera_hover');
2841				$('.camera_thumb',this).animate({'margin-top':'-20px','opacity':0},200,function(){
2842					$(this).css({marginTop:'5px'}).hide();
2843				});
2844				$('.thumb_arrow',this).animate({'margin-top':'-20px','opacity':0},200,function(){
2845					$(this).css({marginTop:'5px'}).hide();
2846				});
2847			});
2848		}
2849			
2850	
2851	
2852		if($(thumbs).length) {
2853			var thumbUrl;
2854			if(!$(pagination).length) {
2855				$(thumbs).append('<div />');
2856				$(thumbs).before('<div class="camera_prevThumbs hideNav"><div></div></div>').before('<div class="camera_nextThumbs hideNav"><div></div></div>');
2857				$('> div',thumbs).append('<ul />');
2858				$.each(allThumbs, function(i, val) {
2859					if($('> div', elem).eq(i).attr('data-thumb')!='') {
2860						var thumbUrl = $('> div', elem).eq(i).attr('data-thumb'),
2861							newImg = new Image();
2862						newImg.src = thumbUrl;
2863						$('ul',thumbs).append('<li class="pix_thumb pix_thumb_'+i+'"' + ((true || WA.Browser.isIE && WA.Browser.isIE > 8) ? ' style="position: relative;"' : '') + ' />');
2864						$('li.pix_thumb_'+i,thumbs).append($(newImg).attr('class','camera_thumb').attr('style',((true || WA.Browser.isIE && WA.Browser.isIE > 8) ? 'object-fit: inherit; position: absolute; left: 0; top: 0;' : '')));
2865            
2866            if (true || WA.Browser.isIE && WA.Browser.isIE > 8)
2867            {
2868              fixCoverInIE();
2869            }
2870					}
2871				});
2872			} else {
2873				$.each(allThumbs, function(i, val) {
2874					if($('> div', elem).eq(i).attr('data-thumb')!='') {
2875						var thumbUrl = $('> div', elem).eq(i).attr('data-thumb'),
2876							newImg = new Image();
2877						newImg.src = thumbUrl;
2878						$('li.pag_nav_'+i,pagination).append($(newImg).attr('class','camera_thumb').css({'position':'absolute'}).animate({opacity:0}
2878,0));
2879						$('li.pag_nav_'+i+' > img',pagination).after('<div class="thumb_arrow" />');
2880						$('li.pag_nav_'+i+' > .thumb_arrow',pagination).animate({opacity:0},0);
2881					}
2882				});
2883				wrap.css({marginBottom:$(pagination).outerHeight()});
2884			}
2885		} else if(!$(thumbs).length && $(pagination).length) {
2886			wrap.css({marginBottom:$(pagination).outerHeight()});
2887		}
2888    
2889    
2890    function fixCoverInIE ()
2891    {
2892      var i,
2893          thumbImages = document.querySelectorAll('IMG[class~="camera_thumb"]');
2894          
2895      for (i = 0; i < thumbImages.length; i++)
2896      {
2897        thumbImages[i].onload = function ()
2898        {
2899          var thumbImg = this,
2900              naturalWidth = thumbImg.naturalWidth,
2901              naturalHeight = thumbImg.naturalHeight,
2902              ratio = naturalWidth / naturalHeight,
2903              currentWidth = thumbImg.offsetWidth,
2904              currentHeight = thumbImg.offsetHeight,
2905              width,
2906              height;
2907          
2908          if (naturalWidth > naturalHeight)
2909          {
2910            width = currentHeight * ratio;
2911            thumbImg.style.width = Math.round(width) + 'px';
2912            thumbImg.style.left = -Math.round((width - currentWidth) / 2) + 'px';
2913          }
2914          else
2915          {
2916            height = currentWidth / ratio;
2917            thumbImg.style.height = Math.round(height) + 'px';
2918            thumbImg.style.top = -Math.round((height - currentHeight) / 2) + 'px';
2919          }
2920        }
2921      }
2922    }
2923
2924	
2925		var firstPos = true;
2926
2927		function thumbnailPos() {
2928			if($(thumbs).length && !$(pagination).length) {
2929				var wTh = $(thumbs).outerWidth(),
2930					owTh = $('ul > li',thumbs).outerWidth(),
2931					pos = $('li.cameracurrent', thumbs).length ? $('li.cameracurrent', thumbs).position() : '',
2932					ulW = ($('ul > li', thumbs).length * $('ul > li', thumbs).outerWidth()),
2933					offUl = $('ul', thumbs).offset().left,
2934					offDiv = $('> div', thumbs).offset().left,
2935					ulLeft;
2936
2937					if(offUl<0){
2938						ulLeft = '-'+ (offDiv-offUl);
2939					} else {
2940						ulLeft = offDiv-offUl;
2941					}
2942					
2943					
2944					
2945				if(firstPos == true) {
2946					$('ul', thumbs).width($('ul > li', thumbs).length * $('ul > li', thumbs).outerWidth());
2947					if($(thumbs).length && !$(pagination).lenght) {
2948						wrap.css({marginBottom:$(thumbs).outerHeight()});
2949					}
2950					thumbnailVisible();
2951					/*I repeat this two lines because of a problem with iPhones*/
2952					$('ul', thumbs).width($('ul > li', thumbs).length * $('ul > li', thumbs).outerWidth());
2953					if($(thumbs).length && !$(pagination).lenght) {
2954						wrap.css({marginBottom:$(thumbs).outerHeight()});
2955					}
2956					/*...*/
2957				}
2958				firstPos = false;
2959				
2960					var left = $('li.cameracurrent', thumbs).length ? pos.left : '',
2961						right = $('li.cameracurrent', thumbs).length ? pos.left+($('li.cameracurrent', thumbs).outerWidth()) : '';
2962					if(left<$('li.cameracurrent', thumbs).outerWidth()) {
2963						left = 0;
2964					}
2965					if(right-ulLeft>wTh){
2966						if((left+wTh)<ulW){
2967							$('ul', thumbs).animate({'margin-left':'-'+(left)+'px'},500,thumbnailVisible);
2968						} else {
2969							$('ul', thumbs).animate({'margin-left':'-'+($('ul', thumbs).outerWidth()-wTh)+'px'},500,thumbnailVisible);
2970						}
2971					} else if(left-ulLeft<0) {
2972						$('ul', thumbs).animate({'margin-left':'-'+(left)+'px'},500,thumbnailVisible);
2973					} else {
2974						$('ul', thumbs).css({'margin-left':'auto', 'margin-right':'auto'});
2975						setTimeout(thumbnailVisible,100);
2976					}
2977					
2978			}
2979		}
2980
2981		if($(commands).length) {
2982			$(commands).append('<div class="camera_play"></div>').append('<div class="camera_stop"></div>');
2983			if(autoAdv==true){
2984				$('.camera_play',camera_thumbs_wrap).hide();
2985				$('.camera_stop',camera_thumbs_wrap).show();
2986			} else {
2987				$('.camera_stop',camera_thumbs_wrap).hide();
2988				$('.camera_play',camera_thumbs_wrap).show();
2989			}
2990			
2991		}
2992			
2993			
2994		function canvasLoader() {
2995			rad = 0;
2996			var barWidth = $('.camera_bar_cont',camera_thumbs_wrap).width(),
2997				barHeight = $('.camera_bar_cont',camera_thumbs_wrap).height();
2998
2999			if (loader != 'pie') {
3000				switch(barDirection){
3001					case 'leftToRight':
3002						$('#'+pieID).css({'right':barWidth}
3002);
3003						break;
3004					case 'rightToLeft':
3005						$('#'+pieID).css({'left':barWidth});
3006						break;
3007					case 'topToBottom':
3008						$('#'+pieID).css({'bottom':barHeight});
3009						break;
3010					case 'bottomToTop':
3011						$('#'+pieID).css({'top':barHeight});
3012						break;
3013				}
3014			} else {
3015				ctx.clearRect(0,0,opts.pieDiameter,opts.pieDiameter); 
3016			}
3017		}
3018		
3019		
3020		canvasLoader();
3021		
3022		
3023		$('.moveFromLeft, .moveFromRight, .moveFromTop, .moveFromBottom, .fadeIn, .fadeFromLeft, .fadeFromRight, .fadeFromTop, .fadeFromBottom',fakeHover).each(function(){
3024			$(this).css('visibility','hidden');
3025		});
3026		
3027		opts.onStartLoading.call(this);
3028		
3029	
3030	/*************************** FUNCTION nextSlide() ***************************/
3031	
3032	var isRandomSlide = opts.randomSlide,
3033      prevVis = [-1, -1, -1];
3034  
3035  function nextSlide(navSlide)
3036  { 
3037		elem.addClass('camerasliding');
3038		
3039		videoPresent = false;
3040
3041		var vis = parseFloat($('div.cameraSlide.cameracurrent',target).index()),
3042        slideI,
3043        koRandom;
3044
3045		if(navSlide > 0)
3046    { 
3047      slideI = navSlide - 1;
3048    }
3049    else if (isRandomSlide)
3050    {
3051      do
3052      {
3053        koRandom = (new Date()).getTime() % 10 + 1;
3054        
3055        while (koRandom--)
3056        {
3057          slideI = Math.floor(Math.random() * amountSlide);
3058        }
3059      }
3060      while (slideI == null || isNaN(slideI) || slideI >= amountSlide || (amountSlide > 1 && slideI === vis) || (amountSlide > 2 && slideI === prevVis[0]) || (amountSlide > 3 && slideI === prevVis[1]) || (amountSlide > 4 && slideI === prevVis[2]))
3061    }
3062    else if (vis == amountSlide - 1)
3063    { 
3064      slideI = 0;
3065    }
3066    else
3067    {
3068      slideI = vis + 1;
3069		}
3070		
3071    prevVis.unshift(vis);
3072    prevVis.pop();
3073				
3074		var slide = $('.cameraSlide:eq('+slideI+')',target);
3075		var slideNext = $('.cameraSlide:eq('+(slideI+1)+')',target).addClass('cameranext');
3076		if( vis != slideI+1 ) {
3077			slideNext.hide();
3078		}
3079		$('.cameraContent',fakeHover).fadeOut(600);
3080		$('.camera_caption',fakeHover).show();
3081		
3082		$('.camerarelative',slide).append($('> div ',elem).eq(slideI).find('> div.camera_effected'));
3083
3084		$('.camera_target_content .cameraContent:eq('+slideI+')',wrap).append($('> div ',elem).eq(slideI).find('> div'));
3085		
3086		if(!$('.imgLoaded',slide).length){
3087			var imgUrl = allImg[slideI];
3088			var imgLoaded = new Image();
3089			imgLoaded.src = imgUrl; // +"?"+ new Date().getTime();
3090			slide.css('visibility','hidden');
3091			slide.prepend($(imgLoaded).attr('class','imgLoaded').css('visibility','hidden'));
3092			var wT, hT;
3093			if (!$(imgLoaded).get(0).complete || wT == '0' || hT == '0' || typeof wT === 'undefined' || wT === false || typeof hT === 'undefined' || hT === false) {
3094				$('.camera_loader',wrap).delay(500).fadeIn(400);
3095				imgLoaded.onload = function() {
3096					wT = imgLoaded.naturalWidth;
3097					hT = imgLoaded.naturalHeight;
3098					$(imgLoaded).attr('data-alignment',allAlign[slideI]).attr('data-portrait',allPor[slideI]);
3099					$(imgLoaded).attr('width',wT);
3100					$(imgLoaded).attr('height',hT);
3101					target.find('.cameraSlide_'+slideI).hide().css('visibility','visible');
3102					resizeImage();
3103					nextSlide(slideI+1);
3104				};
3105			}
3106		} else {
3107			if( allImg.length > (slideI+1) && !$('.imgLoaded',slideNext).length ){
3108				var imgUrl2 = allImg[(slideI+1)];
3109				var imgLoaded2 = new Image();
3110				imgLoaded2.src = imgUrl2; // +"?"+ new Date().getTime();
3111				slideNext.prepend($(imgLoaded2).attr('class','imgLoaded').css('visibility','hidden'));
3112				imgLoaded2.onload = function() {
3113					wT = imgLoaded2.naturalWidth;
3114					hT = imgLoaded2.naturalHeight;
3115					$(imgLoaded2).attr('data-alignment',allAlign[slideI+1]).attr('data-portrait',allPor[slideI+1]);
3116					$(imgLoaded2).attr('width',wT);
3117					$(imgLoaded2).attr('height',hT);
3118					resizeImage();
3119				};
3120			}
3121			opts.onLoaded.call(this);
3122			if($('.camera_loader',wrap).is(':visible')){
3123				$('.camera_loader',wrap).fadeOut(400);
3124			} else {
3125				$('.camera_loader',wrap).css({'visibility':'hidden'});
3126				$('.camera_loader',wrap).fadeOut(400,function(){
3127					$('.camera_loader',wrap).css({'visibility':'visible'});
3128				});
3129			}
3130			var rows = opts.rows,
3131				cols = opts.cols,
3132				couples = 1,
3133				difference = 0,
3134				dataSlideOn,
3135				time,
3136				transPeriod,
3137				fx,
3138				easing,
3139				randomFx = new Array('simpleFade','curtainTopLeft','curtainTopRight','curtainBottomLeft','curtainBottomRight','curtainSliceLeft','curtainSliceRight','blindCurtainTopLeft','blindCurtainTopRight','blindCurtainBottomLeft','blindCurtainBottomRight','blindCurtainSliceBottom','blindCurtainSliceTop','stampede','mosaic','mosaicReverse','mosaicRandom','mosaicSpiral','mosaicSpiralReverse','topLeftBottomRight','bottomRightTopLeft','bottomLeftTopRight','topRightBottomLeft','scrollLeft','scrollRight','scrollTop','scrollBottom','scrollHorz');
3140				marginLeft = 0,
3141				marginTop = 0,
3142				opacityOnGrid = 0;
3143				
3144				if(opts.opacityOnGrid==true){
3145					opacityOnGrid = 0;
3146				} else {
3147					opacityOnGrid = 1;
3148				}
3149 
3150			
3151			
3152			var dataFx = $(' > div',elem).eq(slideI).attr('data-fx');
3153				
3154			if(isMobile()&&opts.mobileFx!=''&&opts.mobileFx!='default'){
3155				fx = opts.mobileFx;
3156			} else {
3157				if(typeof dataFx !== 'undefined' && dataFx!== false && dataFx!== 'default'){
3158					fx = dataFx;
3159				} else {
3160					fx = opts.fx;
3161				}
3162			}
3163			
3164			if(fx=='random') {
3165				fx = shuffle(randomFx);
3166				fx = fx[0];
3167			} else {
3168				fx = fx;
3169				if(fx.indexOf(',')>0){
3170					fx = fx.replace(/ /g,'');
3171					fx = fx.split(',');
3172					fx = shuffle(fx);
3173					fx = fx[0];
3174				}
3175			}
3176			
3177			dataEasing = $(' > div',elem).eq(slideI).attr('data-easing');
3178			mobileEasing = $(' > div',elem).eq(slideI).attr('data-mobileEasing');
3179
3180			if(isMobile()&&opts.mobileEasing!=''&&opts.mobileEasing!='default'){
3181				if(typeof mobileEasing !== 'undefined' && mobileEasing!== false && mobileEasing!== 'default') {
3182					easing = mobileEasing;
3183				} else {
3184					easing = opts.mobileEasing;
3185				}
3186			} else {
3187				if(typeof dataEasing !== 'undefined' && dataEasing!== false && dataEasing!== 'default') {
3188					easing = dataEasing;
3189				} else {
3190					easing = opts.easing;
3191				}
3192			}
3193	
3194			dataSlideOn = $(' > div',elem).eq(slideI).attr('data-slideOn');
3195			if(typeof dataSlideOn !== 'undefined' && dataSlideOn!== false){
3196				slideOn = dataSlideOn;
3197			} else {
3198				if(opts.slideOn=='random'){
3199					var slideOn = new Array('next','prev');
3200					slideOn = shuffle(slideOn);
3201					slideOn = slideOn[0];
3202				} else {
3203					slideOn = opts.slideOn;
3204				}
3205			}
3206				
3207			var dataTime = $(' > div',elem).eq(slideI).attr('data-time');
3208			if(typeof dataTime !== 'undefined' && dataTime!== false && dataTime!== ''){
3209				time = parseFloat(dataTime);
3210			} else {
3211				time = opts.time;
3212			}
3213				
3214			var dataTransPeriod = $(' > div',elem).eq(slideI).attr('data-transPeriod');
3215			if(typeof dataTransPeriod !== 'undefined' && dataTransPeriod!== false && dataTransPeriod!== ''){
3216				transPeriod = parseFloat(dataTransPeriod);
3217			} else {
3218				transPeriod = opts.transPeriod;
3219			}
3220				
3221			if(!$(elem).hasClass('camerastarted')){
3222				fx = 'simpleFade';
3223				slideOn = 'next';
3224				easing = '';
3225				transPeriod = 400;
3226				$(elem).addClass('camerastarted')
3227			}
3228	
3229			switch(fx){
3230				case 'simpleFade':
3231					cols = 1;
3232					rows = 1;
3233						break;
3234				case 'curtainTopLeft':
3235					if(opts.slicedCols == 0) {
3236						cols = opts.cols;
3237					} else {
3238						cols = opts.slicedCols;
3239					}
3240					rows = 1;
3241						break;
3242				case 'curtainTopRight':
3243					if(opts.slicedCols == 0) {
3244						cols = opts.cols;
3245					} else {
3246						cols = opts.slicedCols;
3247					}
3248					rows = 1;
3249						break;
3250				case 'curtainBottomLeft':
3251					if(opts.slicedCols == 0) {
3252						cols = opts.cols;
3253					} else {
3254						cols = opts.slicedCols;
3255					}
3256					rows = 1;
3257						break;
3258				case 'curtainBottomRight':
3259					if(opts.slicedCols == 0) {
3260						cols = opts.cols;
3261					} else {
3262						cols = opts.slicedCols;
3263					}
3264					rows = 1;
3265						break;
3266				case 'curtainSliceLeft':
3267					if(opts.slicedCols == 0) {
3268						cols = opts.cols;
3269					} else {
3270						cols = opts.slicedCols;
3271					}
3272					rows = 1;
3273						break;
3274				case 'curtainSliceRight':
3275					if(opts.slicedCols == 0) {
3276						cols = opts.cols;
3277					} else {
3278						cols = opts.slicedCols;
3279					}
3280					rows = 1;
3281						break;
3282				case 'blindCurtainTopLeft':
3283					if(opts.slicedRows == 0) {
3284						rows = opts.rows;
3285					} else {
3286						rows = opts.slicedRows;
3287					}
3288					cols = 1;
3289						break;
3290				case 'blindCurtainTopRight':
3291					if(opts.slicedRows == 0) {
3292						rows = opts.rows;
3293					} else {
3294						rows = opts.slicedRows;
3295					}
3296					cols = 1;
3297						break;
3298				case 'blindCurtainBottomLeft':
3299					if(opts.slicedRows == 0) {
3300						rows = opts.rows;
3301					} else {
3302						rows = opts.slicedRows;
3303					}
3304					cols = 1;
3305						break;
3306				case 'blindCurtainBottomRight':
3307					if(opts.slicedRows == 0) {
3308						rows = opts.rows;
3309					} else {
3310						rows = opts.slicedRows;
3311					}
3312					cols = 1;
3313						break;
3314				case 'blindCurtainSliceTop':
3315					if(opts.slicedRows == 0) {
3316						rows = opts.rows;
3317					} else {
3318						rows = opts.slicedRows;
3319					}
3320					cols = 1;
3321						break;
3322				case 'blindCurtainSliceBottom':
3323					if(opts.slicedRows == 0) {
3324						rows = opts.rows;
3325					} else {
3326						rows = opts.slicedRows;
3327					}
3328					cols = 1;
3329						break;
3330				case 'stampede':
3331					difference = '-'+transPeriod;
3332						break;
3333				case 'mosaic':
3334					difference = opts.gridDifference;
3335						break;
3336				case 'mosaicReverse':
3337					difference = opts.gridDifference;
3338						break;
3339				case 'mosaicRandom':
3340						break;
3341				case 'mosaicSpiral':
3342					difference = opts.gridDifference;
3343					couples = 1.7;
3344						break;
3345				case 'mosaicSpiralReverse':
3346					difference = opts.gridDifference;
3347					couples = 1.7;
3348						break;
3349				case 'topLeftBottomRight':
3350					difference = opts.gridDifference;
3351					couples = 6;
3352						break;
3353				case 'bottomRightTopLeft':
3354					difference = opts.gridDifference;
3355					couples = 6;
3356						break;
3357				case 'bottomLeftTopRight':
3358					difference = opts.gridDifference;
3359					couples = 6;
3360						break;
3361				case 'topRightBottomLeft':
3362					difference = opts.gridDifference;
3363					couples = 6;
3364						break;
3365				case 'scrollLeft':
3366					cols = 1;
3367					rows = 1;
3368						break;
3369				case 'scrollRight':
3370					cols = 1;
3371					rows = 1;
3372						break;
3373				case 'scrollTop':
3374					cols = 1;
3375					rows = 1;
3376						break;
3377				case 'scrollBottom':
3378					cols = 1;
3379					rows = 1;
3380						break;
3381				case 'scrollHorz':
3382					cols = 1;
3383					rows = 1;
3384						break;
3385			}
3386			
3387			var cycle = 0;
3388			var blocks = rows*cols;
3389			var leftScrap = w-(Math.floor(w/cols)*cols);
3390			var topScrap = h-(Math.floor(h/rows)*rows);
3391			var addLeft;
3392			var addTop;
3393			var tAppW = 0;	
3394			var tAppH = 0;
3395			var arr = new Array();
3396			var delay = new Array();
3397			var order = new Array();
3398			while(cycle < blocks){
3399				arr.push(cycle);
3400				delay.push(cycle);
3401				cameraCont.append('<div class="cameraappended" style="display:none; overflow:hidden; position:absolute; z-index:1000" />');
3402				var tApp = $('.cameraappended:eq('+cycle+')',target);
3403				if(fx=='scrollLeft' || fx=='scrollRight' || fx=='scrollTop' || fx=='scrollBottom' || fx=='scrollHorz'){
3404					selector.eq(slideI).clone().show().appendTo(tApp);
3405				} else {
3406					if(slideOn=='next'){
3407						selector.eq(slideI).clone().show().appendTo(tApp);
3408					} else {
3409						selector.eq(vis).clone().show().appendTo(tApp);
3410					}
3411				}
3412
3413				if(cycle%cols<leftScrap){
3414					addLeft = 1;
3415				} else {
3416					addLeft = 0;
3417				}
3418				if(cycle%cols==0){
3419					tAppW = 0;
3420				}
3421				if(Math.floor(cycle/cols)<topScrap){
3422					addTop = 1;
3423				} else {
3424					addTop = 0;
3425				}
3426				tApp.css({
3427					'height': Math.floor((h/rows)+addTop+1),
3428					'left': tAppW,
3429					'top': tAppH,
3430					'width': Math.floor((w/cols)+addLeft+1)
3431				});
3432				$('> .cameraSlide', tApp).css({
3433					'height': h,
3434					'margin-left': '-'+tAppW+'px',
3435					'margin-top': '-'+tAppH+'px',
3436					'width': w
3437				});
3438				tAppW = tAppW+tApp.width()-1;
3439				if(cycle%cols==cols-1){
3440					tAppH = tAppH + tApp.height() - 1;
3441				}
3442				cycle++;
3443			}
3444			
3445
3446			
3447			switch(fx){
3448				case 'curtainTopLeft':
3449						break;
3450				case 'curtainBottomLeft':
3451						break;
3452				case 'curtainSliceLeft':
3453						break;
3454				case 'curtainTopRight':
3455					arr = arr.reverse();
3456						break;
3457				case 'curtainBottomRight':
3458					arr = arr.reverse();
3459						break;
3460				case 'curtainSliceRight':
3461					arr = arr.reverse();
3462						break;
3463				case 'blindCurtainTopLeft':
3464						break;
3465				case 'blindCurtainBottomLeft':
3466					arr = arr.reverse();
3467						break;
3468				case 'blindCurtainSliceTop':
3469						break;
3470				case 'blindCurtainTopRight':
3471						break;
3472				case 'blindCurtainBottomRight':
3473					arr = arr.reverse();
3474						break;
3475				case 'blindCurtainSliceBottom':
3476					arr = arr.reverse();
3477						break;
3478				case 'stampede':
3479					arr = shuffle(arr);
3480						break;
3481				case 'mosaic':
3482						break;
3483				case 'mosaicReverse':
3484					arr = arr.reverse();
3485						break;
3486				case 'mosaicRandom':
3487					arr = shuffle(arr);
3488						break;
3489				case 'mosaicSpiral':
3490					var rows2 = rows/2, x, y, z, n=0;
3491						for (z = 0; z < rows2; z++){
3492							y = z;
3493							for (x = z; x < cols - z - 1; x++) {
3494								order[n++] = y * cols + x;
3495							}
3496							x = cols - z - 1;
3497							for (y = z; y < rows - z - 1; y++) {
3498								order[n++] = y * cols + x;
3499							}
3500							y = rows - z - 1;
3501							for (x = cols - z - 1; x > z; x--) {
3502								order[n++] = y * cols + x;
3503							}
3504							x = z;
3505							for (y = rows - z - 1; y > z; y--) {
3506								order[n++] = y * cols + x;
3507							}
3508						}
3509						
3510						arr = order;
3511
3512						break;
3513				case 'mosaicSpiralReverse':
3514					var rows2 = rows/2, x, y, z, n=blocks-1;
3515						for (z = 0; z < rows2; z++){
3516							y = z;
3517							for (x = z; x < cols - z - 1; x++) {
3518								order[n--] = y * cols + x;
3519							}
3520							x = cols - z - 1;
3521							for (y = z; y < rows - z - 1; y++) {
3522								order[n--] = y * cols + x;
3523							}
3524							y = rows - z - 1;
3525							for (x = cols - z - 1; x > z; x--) {
3526								order[n--] = y * cols + x;
3527							}
3528							x = z;
3529							for (y = rows - z - 1; y > z; y--) {
3530								order[n--] = y * cols + x;
3531							}
3532						}
3533
3534						arr = order;
3535						
3536						break;
3537				case 'topLeftBottomRight':
3538					for (var y = 0; y < rows; y++)
3539					for (var x = 0; x < cols; x++) {
3540						order.push(x + y);
3541					}
3542						delay = order;
3543						break;
3544				case 'bottomRightTopLeft':
3545					for (var y = 0; y < rows; y++)
3546					for (var x = 0; x < cols; x++) {
3547						order.push(x + y);
3548					}
3549						delay = order.reverse();
3550						break;
3551				case 'bottomLeftTopRight':
3552					for (var y = rows; y > 0; y--)
3553					for (var x = 0; x < cols; x++) {
3554						order.push(x + y);
3555					}
3556						delay = order;
3557						break;
3558				case 'topRightBottomLeft':
3559					for (var y = 0; y < rows; y++)
3560					for (var x = cols; x > 0; x--) {
3561						order.push(x + y);
3562					}
3563						delay = order;
3564						break;
3565			}
3566			
3567			
3568						
3569			$.each(arr, function(index, value) {
3570
3571				if(value%cols<leftScrap){
3572					addLeft = 1;
3573				} else {
3574					addLeft = 0;
3575				}
3576				if(value%cols==0){
3577					tAppW = 0;
3578				}
3579				if(Math.floor(value/cols)<topScrap){
3580					addTop = 1;
3581				} else {
3582					addTop = 0;
3583				}
3584							
3585				switch(fx){
3586					case 'simpleFade':
3587						height = h;
3588						width = w;
3589						opacityOnGrid = 0;
3590							break;
3591					case 'curtainTopLeft':
3592						height = 0,
3593						width = Math.floor((w/cols)+addLeft+1),
3594						marginTop = '-'+Math.floor((h/rows)+addTop+1)+'px';
3595							break;
3596					case 'curtainTopRight':
3597						height = 0,
3598						width = Math.floor((w/cols)+addLeft+1),
3599						marginTop = '-'+Math.floor((h/rows)+addTop+1)+'px';
3600							break;
3601					case 'curtainBottomLeft':
3602						height = 0,
3603						width = Math.floor((w/cols)+addLeft+1),
3604						marginTop = Math.floor((h/rows)+addTop+1)+'px';
3605							break;
3606					case 'curtainBottomRight':
3607						height = 0,
3608						width = Math.floor((w/cols)+addLeft+1),
3609						marginTop = Math.floor((h/rows)+addTop+1)+'px';
3610							break;
3611					case 'curtainSliceLeft':
3612						height = 0,
3613						width = Math.floor((w/cols)+addLeft+1);
3614						if(value%2==0){
3615							marginTop = Math.floor((h/rows)+addTop+1)+'px';					
3616						} else {
3617							marginTop = '-'+Math.floor((h/rows)+addTop+1)+'px';					
3618						}
3619							break;
3620					case 'curtainSliceRight':
3621						height = 0,
3622						width = Math.floor((w/cols)+addLeft+1);
3623						if(value%2==0){
3624							marginTop = Math.floor((h/rows)+addTop+1)+'px';					
3625						} else {
3626							marginTop = '-'+Math.floor((h/rows)+addTop+1)+'px';					
3627						}
3628							break;
3629					case 'blindCurtainTopLeft':
3630						height = Math.floor((h/rows)+addTop+1),
3631						width = 0,
3632						marginLeft = '-'+Math.floor((w/cols)+addLeft+1)+'px';
3633							break;
3634					case 'blindCurtainTopRight':
3635						height = Math.floor((h/rows)+addTop+1),
3636						width = 0,
3637						marginLeft = Math.floor((w/cols)+addLeft+1)+'px';
3638							break;
3639					case 'blindCurtainBottomLeft':
3640						height = Math.floor((h/rows)+addTop+1),
3641						width = 0,
3642						marginLeft = '-'+Math.floor((w/cols)+addLeft+1)+'px';
3643							break;
3644					case 'blindCurtainBottomRight':
3645						height = Math.floor((h/rows)+addTop+1),
3646						width = 0,
3647						marginLeft = Math.floor((w/cols)+addLeft+1)+'px';
3648							break;
3649					case 'blindCurtainSliceBottom':
3650						height = Math.floor((h/rows)+addTop+1),
3651						width = 0;
3652						if(value%2==0){
3653							marginLeft = '-'+Math.floor((w/cols)+addLeft+1)+'px';
3654						} else {
3655							marginLeft = Math.floor((w/cols)+addLeft+1)+'px';
3656						}
3657							break;
3658					case 'blindCurtainSliceTop':
3659						height = Math.floor((h/rows)+addTop+1),
3660						width = 0;
3661						if(value%2==0){
3662							marginLeft = '-'+Math.floor((w/cols)+addLeft+1)+'px';
3663						} else {
3664							marginLeft = Math.floor((w/cols)+addLeft+1)+'px';
3665						}
3666							break;
3667					case 'stampede':
3668						height = 0;
3669						width = 0;					
3670						marginLeft = (w*0.2)*(((index)%cols)-(cols-(Math.floor(cols/2))))+'px';					
3671						marginTop = (h*0.2)*((Math.floor(index/cols)+1)-(rows-(Math.floor(rows/2))))+'px';	
3672							break;
3673					case 'mosaic':
3674						height = 0;
3675						width = 0;					
3676							break;
3677					case 'mosaicReverse':
3678						height = 0;
3679						width = 0;					
3680						marginLeft = Math.floor((w/cols)+addLeft+1)+'px';					
3681						marginTop = Math.floor((h/rows)+addTop+1)+'px';					
3682							break;
3683					case 'mosaicRandom':
3684						height = 0;
3685						width = 0;					
3686						marginLeft = Math.floor((w/cols)+addLeft+1)*0.5+'px';					
3687						marginTop = Math.floor((h/rows)+addTop+1)*0.5+'px';					
3688							break;
3689					case 'mosaicSpiral':
3690						height = 0;
3691						width = 0;
3692						marginLeft = Math.floor((w/cols)+addLeft+1)*0.5+'px';					
3693						marginTop = Math.floor((h/rows)+addTop+1)*0.5+'px';					
3694							break;
3695					case 'mosaicSpiralReverse':
3696						height = 0;
3697						width = 0;
3698						marginLeft = Math.floor((w/cols)+addLeft+1)*0.5+'px';					
3699						marginTop = Math.floor((h/rows)+addTop+1)*0.5+'px';					
3700							break;
3701					case 'topLeftBottomRight':
3702						height = 0;
3703						width = 0;					
3704							break;
3705					case 'bottomRightTopLeft':
3706						height = 0;
3707						width = 0;					
3708						marginLeft = Math.floor((w/cols)+addLeft+1)+'px';					
3709						marginTop = Math.floor((h/rows)+addTop+1)+'px';					
3710							break;
3711					case 'bottomLeftTopRight':
3712						height = 0;
3713						width = 0;					
3714						marginLeft = 0;					
3715						marginTop = Math.floor((h/rows)+addTop+1)+'px';					
3716							break;
3717					case 'topRightBottomLeft':
3718						height = 0;
3719						width = 0;					
3720						marginLeft = Math.floor((w/cols)+addLeft+1)+'px';					
3721						marginTop = 0;					
3722							break;
3723					case 'scrollRight':
3724						height = h;
3725						width = w;
3726						marginLeft = -w;					
3727							break;
3728					case 'scrollLeft':
3729						height = h;
3730						width = w;
3731						marginLeft = w;					
3732							break;
3733					case 'scrollTop':
3734						height = h;
3735						width = w;
3736						marginTop = h;					
3737							break;
3738					case 'scrollBottom':
3739						height = h;
3740						width = w;
3741						marginTop = -h;					
3742							break;
3743					case 'scrollHorz':
3744						height = h;
3745						width = w;
3746						if(vis==0 && slideI==amountSlide-1) {
3747							marginLeft = -w;	
3748						} else if(vis<slideI  || (vis==amountSlide-1 && slideI==0)) {
3749							marginLeft = w;	
3750						} else {
3751							marginLeft = -w;	
3752						}
3753							break;
3754					}
3755					
3756			
3757				var tApp = $('.cameraappended:eq('+value+')',target);
3758								
3759				if(typeof u !== 'undefined'){
3760					clearInterval(u);
3761					clearTimeout(setT);
3762					setT = setTimeout(canvasLoader,transPeriod+difference);
3763				}
3764				
3765				
3766				if($(pagination).length){
3767					$('.camera_pag li',wrap).removeClass('cameracurrent');
3768					$('.camera_pag li',wrap).eq(slideI).addClass('cameracurrent');
3769				}
3770						
3771				if($(thumbs).length){
3772					$('li', thumbs).removeClass('cameracurrent');
3773					$('li', thumbs).eq(slideI).addClass('cameracurrent');
3774					$('li', thumbs).not('.cameracurrent').animate({opacity:.34},0);
3775					$('li.cameracurrent', thumbs).animate({opacity:1},0);
3776					$('li', thumbs).hover(function(){
3777						$(this).stop(true,false).animate({opacity:1},150);
3778					},function(){
3779						if(!$(this).hasClass('cameracurrent')){
3780							$(this).stop(true,false).animate({opacity:.34},150);
3781						}
3782					});
3783				}
3784								
3785						
3786				var easedTime = parseFloat(transPeriod)+parseFloat(difference);
3787				
3788				function cameraeased() {
3789
3790					$(this).addClass('cameraeased');
3791					if($('.cameraeased',target).length>=0){
3792						$(thumbs).css({visibility:'visible'});
3793					}
3794					if($('.cameraeased',target).length==blocks){
3795						
3796						thumbnailPos();
3797						
3798						$('.moveFromLeft, .moveFromRight, .moveFromTop, .moveFromBottom, .fadeIn, .fadeFromLeft, .fadeFromRight, .fadeFromTop, .fadeFromBottom',fakeHover).each(function(){
3799							$(this).css('visibility','hidden');
3800						});
3801		
3802						selector.eq(slideI).show().css('z-index','999').removeClass('cameranext').addClass('cameracurrent');
3803						selector.eq(vis).css('z-index','1').removeClass('cameracurrent');
3804						$('.cameraContent',fakeHover).eq(slideI).addClass('cameracurrent');
3805						if (vis >= 0) {
3806							$('.cameraContent',fakeHover).eq(vis).removeClass('cameracurrent');
3807						}
3808						
3809						opts.onEndTransition.call(this);
3810						
3811						if($('> div', elem).eq(slideI).attr('data-video')!='hide' && $('.cameraContent.cameracurrent .imgFake',fakeHover).length ){
3812							$('.cameraContent.cameracurrent .imgFake',fakeHover).click();
3813						}
3814
3815						
3816						var lMoveIn = selector.eq(slideI).find('.fadeIn').length;
3817						var lMoveInContent = $('.cameraContent',fakeHover).eq(slideI).find('.moveFromLeft, .moveFromRight, .moveFromTop, .moveFromBottom, .fadeIn, .fadeFromLeft, .fadeFromRight, .fadeFromTop, .fadeFromBottom').length;
3818						
3819						if (lMoveIn!=0){
3820							$('.cameraSlide.cameracurrent .fadeIn',fakeHover).each(function(){
3821								if($(this).attr('data-easing')!=''){
3822									var easeMove = $(this).attr('data-easing');
3823								} else {
3824									var easeMove = easing;
3825								}
3826								var t = $(this);
3827								if(typeof t.attr('data-outerWidth') === 'undefined' || t.attr('data-outerWidth') === false || t.attr('data-outerWidth') === '') {
3828									var wMoveIn = t.outerWidth();
3829									t.attr('data-outerWidth',wMoveIn);
3830								} else {
3831									var wMoveIn = t.attr('data-outerWidth');
3832								}
3833								if(typeof t.attr('data-outerHeight') === 'undefined' || t.attr('data-outerHeight') === false || t.attr('data-outerHeight') === '') {
3834									var hMoveIn = t.outerHeight();
3835									t.attr('data-outerHeight',hMoveIn);
3836								} else {
3837									var hMoveIn = t.attr('data-outerHeight');
3838								}
3839								//t.css('width',wMoveIn);
3840								var pos = t.position();
3841								var left = pos.left;
3842								var top = pos.top;
3843								var tClass = t.attr('class');
3844								var ind = t.index();
3845								var hRel = t.parents('.camerarelative').outerHeight();
3846								var wRel = t.parents('.camerarelative').outerWidth();
3847								if(tClass.indexOf("fadeIn") != -1) {
3848									t.animate({opacity:0}
3848,0).css('visibility','visible').delay((time/lMoveIn)*(0.1*(ind-1))).animate({opacity:1},(time/lMoveIn)*0.15,easeMove);
3849								} else {
3850									t.css('visibility','visible');
3851								}
3852							});
3853						}
3854
3855						$('.cameraContent.cameracurrent',fakeHover).show();
3856						if (lMoveInContent!=0){
3857							
3858							$('.cameraContent.cameracurrent .moveFromLeft, .cameraContent.cameracurrent .moveFromRight, .cameraContent.cameracurrent .moveFromTop, .cameraContent.cameracurrent .moveFromBottom, .cameraContent.cameracurrent .fadeIn, .cameraContent.cameracurrent .fadeFromLeft, .cameraContent.cameracurrent .fadeFromRight, .cameraContent.cameracurrent .fadeFromTop, .cameraContent.cameracurrent .fadeFromBottom',fakeHover).each(function(){
3859								if($(this).attr('data-easing')!=''){
3860									var easeMove = $(this).attr('data-easing');
3861								} else {
3862									var easeMove = easing;
3863								}
3864								var t = $(this);
3865								var pos = t.position();
3866								var left = pos.left;
3867								var top = pos.top;
3868								var tClass = t.attr('class');
3869								var ind = t.index();
3870								var thisH = t.outerHeight();
3871								if(tClass.indexOf("moveFromLeft") != -1) {
3872									t.css({'left':'-'+(w)+'px','right':'auto'});
3873									t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'left':pos.left},(time/lMoveInContent)*0.15,easeMove);
3874								} else if(tClass.indexOf("moveFromRight") != -1) {
3875									t.css({'left':w+'px','right':'auto'});
3876									t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'left':pos.left},(time/lMoveInContent)*0.15,easeMove);
3877								} else if(tClass.indexOf("moveFromTop") != -1) {
3878									t.css({'top':'-'+h+'px','bottom':'auto'});
3879									t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'top':pos.top},(time/lMoveInContent)*0.15,easeMove,function(){
3880										t.css({top:'auto',bottom:0});
3881									});
3882								} else if(tClass.indexOf("moveFromBottom") != -1) {
3883									t.css({'top':h+'px','bottom':'auto'});
3884									t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'top':pos.top},(time/lMoveInContent)*0.15,easeMove);
3885								} else if(tClass.indexOf("fadeFromLeft") != -1) {
3886									t.animate({opacity:0}
3886,0).css({'left':'-'+(w)+'px','right':'auto'});
3887									t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'left':pos.left,opacity:1},(time/lMoveInContent)*0.15,easeMove);
3888								} else if(tClass.indexOf("fadeFromRight") != -1) {
3889									t.animate({opacity:0},0).css({'left':(w)+'px','right':'auto'});
3890									t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'left':pos.left,opacity:1},(time/lMoveInContent)*0.15,easeMove);
3891								} else if(tClass.indexOf("fadeFromTop") != -1) {
3892									t.animate({opacity:0},0).css({'top':'-'+(h)+'px','bottom':'auto'});
3893									t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'top':pos.top,opacity:1},(time/lMoveInContent)*0.15,easeMove,function(){
3894										t.css({top:'auto',bottom:0});
3895									});
3896								} else if(tClass.indexOf("fadeFromBottom") != -1) {
3897									t.animate({opacity:0},0).css({'bottom':'-'+thisH+'px'});
3898									t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'bottom':'0',opacity:1},(time/lMoveInContent)*0.15,easeMove);
3899								} else if(tClass.indexOf("fadeIn") != -1) {
3900									t.animate({opacity:0}
3900,0).css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({opacity:1},(time/lMoveInContent)*0.15,easeMove);
3901								} else {
3902									t.css('visibility','visible');
3903								}
3904							});
3905						}
3906
3907						
3908						$('.cameraappended',target).remove();
3909						elem.removeClass('camerasliding');	
3910							selector.eq(vis).hide();
3911							var barWidth = $('.camera_bar_cont',camera_thumbs_wrap).width(),
3912								barHeight = $('.camera_bar_cont',camera_thumbs_wrap).height(),
3913								radSum;
3914							if (loader != 'pie') {
3915								radSum = 0.05;
3916							} else {
3917								radSum = 0.005;
3918							}
3919							$('#'+pieID).animate({opacity:opts.loaderOpacity},200);
3920							u = setInterval(
3921								function(){
3922									if(elem.hasClass('stopped')){
3923										clearInterval(u);
3924									}
3925
3926									if(rad <= 1 && !elem.hasClass('stopped') && !elem.hasClass('paused') && !elem.hasClass('hovered')){
3927										rad = +(rad+radSum).toFixed(5);
3928									}
3929									if(rad > 1) {
3930										if(!elem.hasClass('stopped') && !elem.hasClass('paused') && !elem.hasClass('hovered')) {
3931											clearInterval(u);
3932											imgFake();
3933
3934
3935											$('#'+pieID).animate({opacity:0}
3935,200,function(){
3936												clearTimeout(setT);
3937												//setT = setTimeout(canvasLoader, easedTime);
3938												canvasLoader();
3939												nextSlide();
3940												opts.onStartLoading.call(this);
3941											});
3942
3943										}
3944									}
3945
3946									progressBarUpdater(radSum, time, barWidth, barHeight);
3947
3948								},time*radSum
3949							);
3950						}
3951
3952				}
3953
3954
3955				
3956				if(fx=='scrollLeft' || fx=='scrollRight' || fx=='scrollTop' || fx=='scrollBottom' || fx=='scrollHorz'){
3957					opts.onStartTransition.call(this);
3958					easedTime = 0;
3959					tApp.delay((((transPeriod+difference)/blocks)*delay[index]*couples)*0.5).css({
3960							'display' : 'block',
3961							'height': height,
3962							'margin-left': marginLeft,
3963							'margin-top': marginTop,
3964							'width': width
3965						}).animate({
3966							'height': Math.floor((h/rows)+addTop+1),
3967							'margin-top' : 0,
3968							'margin-left' : 0,
3969							'width' : Math.floor((w/cols)+addLeft+1)
3970						},(transPeriod-difference),easing,cameraeased);
3971					selector.eq(vis).delay((((transPeriod+difference)/blocks)*delay[index]*couples)*0.5).animate({
3972							'margin-left': marginLeft*(-1),
3973							'margin-top': marginTop*(-1)
3974						},(transPeriod-difference),easing,function(){
3975							$(this).css({'margin-top' : 0,'margin-left' : 0});
3976						});
3977				} else {
3978					opts.onStartTransition.call(this);
3979					easedTime = parseFloat(transPeriod)+parseFloat(difference);
3980					if(slideOn=='next'){
3981						tApp.delay((((transPeriod+difference)/blocks)*delay[index]*couples)*0.5).css({
3982								'display' : 'block',
3983								'height': height,
3984								'margin-left': marginLeft,
3985								'margin-top': marginTop,
3986								'width': width,
3987								'opacity' : opacityOnGrid
3988							}).animate({
3989								'height': Math.floor((h/rows)+addTop+1),
3990								'margin-top' : 0,
3991								'margin-left' : 0,
3992								'opacity' : 1,
3993								'width' : Math.floor((w/cols)+addLeft+1)
3994							},(transPeriod-difference),easing,cameraeased);
3995					} else {
3996						selector.eq(slideI).show().css('z-index','999').addClass('cameracurrent');
3997						selector.eq(vis).css('z-index','1').removeClass('cameracurrent');
3998						$('.cameraContent',fakeHover).eq(slideI).addClass('cameracurrent');
3999						$('.cameraContent',fakeHover).eq(vis).removeClass('cameracurrent');
4000						tApp.delay((((transPeriod+difference)/blocks)*delay[index]*couples)*0.5).css({
4001								'display' : 'block',
4002								'height': Math.floor((h/rows)+addTop+1),
4003								'margin-top' : 0,
4004								'margin-left' : 0,
4005								'opacity' : 1,
4006								'width' : Math.floor((w/cols)+addLeft+1)
4007							}).animate({
4008								'height': height,
4009								'margin-left': marginLeft,
4010								'margin-top': marginTop,
4011								'width': width,
4012								'opacity' : opacityOnGrid
4013							},(transPeriod-difference),easing,cameraeased);
4014					}
4015				}
4016			});
4017		}
4018	}
4019
4020  nextSlide();
4021
4022
4023				if($(prevNav).length){
4024					$(prevNav).click(function(){
4025						if(!elem.hasClass('camerasliding')){
4026							var idNum = parseFloat($('.cameraSlide.cameracurrent',target).index());
4027							clearInterval(u);
4028							imgFake();
4029							$('#'+pieID+', .camera_canvas_wrap',wrap).animate({opacity:0}
4029,0);
4030							canvasLoader();
4031							if(idNum!=0){
4032								nextSlide(idNum);
4033							} else {
4034								nextSlide(amountSlide);
4035						   }
4036						   opts.onStartLoading.call(this);
4037						}
4038					});
4039				}
4040			
4041				if($(nextNav).length){
4042					$(nextNav).click(function(){
4043						if(!elem.hasClass('camerasliding')){
4044							var idNum = parseFloat($('.cameraSlide.cameracurrent',target).index()); 
4045							clearInterval(u);
4046							imgFake();
4047							$('#'+pieID+', .camera_canvas_wrap',camera_thumbs_wrap).animate({opacity:0},0);
4048							canvasLoader();
4049							if(idNum==amountSlide-1){
4050								nextSlide(1);
4051							} else {
4052								nextSlide(idNum+2);
4053						   }
4054						   opts.onStartLoading.call(this);
4055						}
4056					});
4057				}
4058
4059
4060				if(isMobile()){
4061					fakeHover.on('swipeleft',function(event){
4062						if(!elem.hasClass('camerasliding')){
4063							var idNum = parseFloat($('.cameraSlide.cameracurrent',target).index()); 
4064							clearInterval(u);
4065							imgFake();
4066							$('#'+pieID+', .camera_canvas_wrap',camera_thumbs_wrap).animate({opacity:0},0);
4067							canvasLoader();
4068							if(idNum==amountSlide-1){
4069								nextSlide(1);
4070							} else {
4071								nextSlide(idNum+2);
4072						   }
4073						   opts.onStartLoading.call(this);
4074						}
4075					});
4076					fakeHover.on('swiperight',function(event){
4077						if(!elem.hasClass('camerasliding')){
4078							var idNum = parseFloat($('.cameraSlide.cameracurrent',target).index());
4079							clearInterval(u);
4080							imgFake();
4081							$('#'+pieID+', .camera_canvas_wrap',camera_thumbs_wrap).animate({opacity:0}
4081,0);
4082							canvasLoader();
4083							if(idNum!=0){
4084								nextSlide(idNum);
4085							} else {
4086								nextSlide(amountSlide);
4087						   }
4088						   opts.onStartLoading.call(this);
4089						}
4090					});
4091				}
4092
4093				if($(pagination).length){
4094					$('.camera_pag li',wrap).click(function(){
4095						if(!elem.hasClass('camerasliding')){
4096							var idNum = parseFloat($(this).index());
4097							var curNum = parseFloat($('.cameraSlide.cameracurrent',target).index());
4098							if(idNum!=curNum) {
4099								clearInterval(u);
4100								imgFake();
4101								$('#'+pieID+', .camera_canvas_wrap',camera_thumbs_wrap).animate({opacity:0},0);
4102								canvasLoader();
4103								nextSlide(idNum+1);
4104								opts.onStartLoading.call(this);
4105							}
4106						}
4107					});
4108				}
4109
4110				if($(thumbs).length) {
4111
4112					$('.pix_thumb img',thumbs).click(function(){
4113						if(!elem.hasClass('camerasliding')){
4114							var idNum = parseFloat($(this).parents('li').index());
4115							var curNum = parseFloat($('.cameracurrent',target).index());
4116							if(idNum!=curNum) {
4117								clearInterval(u);
4118								imgFake();
4119								$('#'+pieID+', .camera_canvas_wrap',camera_thumbs_wrap).animate({opacity:0}
4119,0);
4120								$('.pix_thumb',thumbs).removeClass('cameracurrent');
4121								$(this).parents('li').addClass('cameracurrent');
4122								canvasLoader();
4123								nextSlide(idNum+1);
4124								thumbnailPos();
4125								opts.onStartLoading.call(this);
4126							}
4127						}
4128					});
4129
4130					$('.camera_thumbs_cont .camera_prevThumbs',camera_thumbs_wrap).hover(function(){
4131						$(this).stop(true,false).animate({opacity:1},250);
4132					},function(){
4133						$(this).stop(true,false).animate({opacity:.7},250);
4134					});
4135					$('.camera_prevThumbs',camera_thumbs_wrap).click(function(){
4136						var sum = 0,
4137							wTh = $(thumbs).outerWidth(),
4138							offUl = $('ul', thumbs).offset().left,
4139							offDiv = $('> div', thumbs).offset().left,
4140							ulLeft = offDiv-offUl;
4141							$('.camera_visThumb',thumbs).each(function(){
4142								var tW = $(this).outerWidth();
4143								sum = sum+tW;
4144							});
4145							if(ulLeft-sum>0){
4146								$('ul', thumbs).animate({'margin-left':'-'+(ulLeft-sum)+'px'},500,thumbnailVisible);
4147							} else {
4148								$('ul', thumbs).animate({'margin-left':0},500,thumbnailVisible);
4149							}
4150					});
4151
4152					$('.camera_thumbs_cont .camera_nextThumbs',camera_thumbs_wrap).hover(function(){
4153						$(this).stop(true,false).animate({opacity:1},250);
4154					},function(){
4155						$(this).stop(true,false).animate({opacity:.7},250);
4156					});
4157					$('.camera_nextThumbs',camera_thumbs_wrap).click(function(){
4158						var sum = 0,
4159							wTh = $(thumbs).outerWidth(),
4160							ulW = $('ul', thumbs).outerWidth(),
4161							offUl = $('ul', thumbs).offset().left,
4162							offDiv = $('> div', thumbs).offset().left,
4163							ulLeft = offDiv-offUl;
4164							$('.camera_visThumb',thumbs).each(function(){
4165								var tW = $(this).outerWidth();
4166								sum = sum+tW;
4167							});
4168							if(ulLeft+sum+sum<ulW){
4169								$('ul', thumbs).animate({'margin-left':'-'+(ulLeft+sum)+'px'},500,thumbnailVisible);
4170							} else {
4171								$('ul', thumbs).animate({'margin-left':'-'+(ulW-wTh)+'px'},500,thumbnailVisible);
4172							}
4173					});
4174
4175				}
4176
4177    function progressBarUpdater(radSum, time, barWidth, barHeight)
4178    {
4179        if (loader != 'pie') {
4180
4181            var cssStyle;
4182
4183            switch(barDirection){
4184                case 'leftToRight':
4185                    cssStyle = {'right':barWidth-(barWidth*rad)}; break;
4186                case 'rightToLeft':
4187                    cssStyle = {'left':barWidth-(barWidth*rad)}; break;
4188                case 'topToBottom':
4189                    cssStyle = {'bottom':barHeight-(barHeight*rad)}; break;
4190                case 'bottomToTop':
4191                    cssStyle = {'bottom':barHeight-(barHeight*rad)}; break;
4192            }
4193            if(rad > 1) {
4194                $('#'+pieID).css(cssStyle);
4195            } else {
4196                $('#'+pieID).animate(cssStyle,(time*radSum),'linear');
4197            }
4198
4199        } else {
4200            radNew = rad;
4201            ctx.clearRect(0,0,opts.pieDiameter,opts.pieDiameter);
4202            ctx.globalCompositeOperation = 'destination-over';
4203            ctx.beginPath();
4204            ctx.arc((opts.pieDiameter)/2, (opts.pieDiameter)/2, (opts.pieDiameter)/2-opts.loaderStroke,0,Math.PI*2,false);
4205            ctx.lineWidth = opts.loaderStroke;
4206            ctx.strokeStyle = opts.loaderBgColor;
4207            ctx.stroke();
4208            ctx.closePath();
4209            ctx.globalCompositeOperation = 'source-over';
4210            ctx.beginPath();
4211            ctx.arc((opts.pieDiameter)/2, (opts.pieDiameter)/2, (opts.pieDiameter)/2-opts.loaderStroke,0,Math.PI*2*radNew,false);
4212            ctx.lineWidth = opts.loaderStroke-(opts.loaderPadding*2);
4213            ctx.strokeStyle = opts.loaderColor;
4214            ctx.stroke();
4215            ctx.closePath();
4216        }
4217    }
4218
4219  function dispose()
4220  {
4221    if (setPause) clearTimeout(setPause);
4222    if (setT) clearTimeout(setT);
4223    if (u) clearInterval(u);
4224
4225    $(window).off('load resize pageshow',placeThumbsOnWindowResize);
4226    $(window).off('resize pageshow', onWindowResize);
4227
4228    wrap.stop(true, false);
4229    wrap.find('*').filter(':animated').stop(true, false);
4230    wrap.empty();
4231
4232    wrap = null;
4233    opts = null;
4234
4235    WA.Gadgets.GadgetDeleted.removeHandler(onGadgetDeleted);
4236  }
4237
4238  function onGadgetDeleted(sender, args)
4239  {
4240    if (args && args.componentId == opts.componentId)
4241    {
4242      dispose();
4243    }
4244  }
4245
4246  WA.Gadgets.GadgetDeleted.addHandler(onGadgetDeleted);
4247}
4248
4249})(jQuery);
4250
4251;(function($){$.fn.cameraStop = function() {
4252	var wrap = $(this),
4253		elem = $('.camera_src',wrap),
4254		pieID = 'pie_'+wrap.index();
4255	elem.addClass('stopped');
4256	if($('.camera_showcommands').length) {
4257		var camera_thumbs_wrap = $('.camera_thumbs_wrap',wrap);
4258	} else {
4259		var camera_thumbs_wrap = wrap;
4260	}
4261}
4262})(jQuery);
4263
4264;(function($){$.fn.cameraPause = function() {
4265	var wrap = $(this);
4266	var elem = $('.camera_src',wrap);
4267	elem.addClass('paused');
4268}
4269}
4269)(jQuery);
4270
4271;(function($){$.fn.cameraResume = function() {
4272	var wrap = $(this);
4273	var elem = $('.camera_src',wrap);
4274	if(typeof autoAdv === 'undefined' || autoAdv!==true){
4275		elem.removeClass('paused');
4276	}
4277}
4278})(jQuery);
4279
4280/*compiled*/
4281/*!
4282	Colorbox v1.4.29 - 2013-09-10
4283	jQuery lightbox and modal window plugin
4284	(c) 2013 Jack Moore - http://www.jacklmoore.com/colorbox
4285	license: http://www.opensource.org/licenses/mit-license.php
4286*/
4287(function ($, document, window) {
4288	var
4289	// Default settings object.
4290	// See http://jacklmoore.com/colorbox for details.
4291	defaults = {
4292		transition: "elastic",
4293		speed: 300,
4294		fadeOut: 300,
4295		width: false,
4296		initialWidth: "600",
4297		innerWidth: false,
4298		maxWidth: false,
4299		height: false,
4300		initialHeight: "450",
4301		innerHeight: false,
4302		maxHeight: false,
4303		scalePhotos: true,
4304		scrolling: true,
4305		inline: false,
4306		html: false,
4307		iframe: false,
4308		fastIframe: true,
4309		photo: false,
4310		href: false,
4311		title: false,
4312		rel: false,
4313		opacity: 0.9,
4314		preloading: true,
4315		className: false,
4316
4317		// alternate image paths for high-res displays
4318		retinaImage: false,
4319		retinaUrl: false,
4320		retinaSuffix: '@2x.$1',
4321
4322		// internationalization
4323		current: "image {current} of {total}",
4324		previous: "previous",
4325		next: "next",
4326		close: "close",
4327		xhrError: "This content failed to load.",
4328		imgError: "This image failed to load.",
4329
4330		open: false,
4331		returnFocus: true,
4332		trapFocus: true,
4333		reposition: true,
4334		loop: true,
4335		slideshow: false,
4336		slideshowAuto: true,
4337		slideshowSpeed: 2500,
4338		slideshowStart: "start slideshow",
4339		slideshowStop: "stop slideshow",
4340		photoRegex: /\.(gif|png|jp(e|g|eg)|bmp|ico|webp)((#|\?).*)?$/i,
4341
4342		onOpen: false,
4343		onLoad: false,
4344		onComplete: false,
4345		onCleanup: false,
4346		onClosed: false,
4347
4348		overlayClose: true,
4349		escKey: true,
4350		arrowKey: true,
4351		top: false,
4352		bottom: false,
4353		left: false,
4354		right: false,
4355		fixed: false,
4356		data: undefined,
4357		closeButton: true
4358	},
4359	
4360	// Abstracting the HTML and event identifiers for easy rebranding
4361	colorbox = 'colorbox',
4362	prefix = 'cbox',
4363	boxElement = prefix + 'Element',
4364	
4365	// Events
4366	event_open = prefix + '_open',
4367	event_load = prefix + '_load',
4368	event_complete = prefix + '_complete',
4369	event_cleanup = prefix + '_cleanup',
4370	event_closed = prefix + '_closed',
4371	event_purge = prefix + '_purge',
4372
4373	// Cached jQuery Object Variables
4374	$overlay,
4375	$box,
4376	$wrap,
4377	$content,
4378	$topBorder,
4379	$leftBorder,
4380	$rightBorder,
4381	$bottomBorder,
4382	$related,
4383	$window,
4384	$loaded,
4385	$loadingBay,
4386	$loadingOverlay,
4387	$title,
4388	$current,
4389	$slideshow,
4390	$next,
4391	$prev,
4392	$close,
4393	$groupControls,
4394	$events = $('<a/>'),
4395	
4396	// Variables for cached values or use across multiple functions
4397	settings,
4398	interfaceHeight,
4399	interfaceWidth,
4400	loadedHeight,
4401	loadedWidth,
4402	element,
4403	index,
4404	photo,
4405	open,
4406	active,
4407	closing,
4408	loadingTimer,
4409	publicMethod,
4410	div = "div",
4411	className,
4412	requests = 0,
4413	previousCSS = {},
4414	init;
4415
4416	// ****************
4417	// HELPER FUNCTIONS
4418	// ****************
4419	
4420	// Convenience function for creating new jQuery objects
4421	function $tag(tag, id, css) {
4422		var element = document.createElement(tag);
4423
4424		if (id) {
4425			element.id = prefix + id;
4426		}
4427
4428		if (css) {
4429			element.style.cssText = css;
4430		}
4431
4432		return $(element);
4433	}
4434	
4435	// Get the window height using innerHeight when available to avoid an issue with iOS
4436	// http://bugs.jquery.com/ticket/6724
4437	function winheight() {
4438		return window.innerHeight ? window.innerHeight : $(window).height();
4439	}
4440
4441	// Determine the next and previous members in a group.
4442	function getIndex(increment) {
4443		var
4444		max = $related.length,
4445		newIndex = (index + increment) % max;
4446		
4447		return (newIndex < 0) ? max + newIndex : newIndex;
4448	}
4449
4450	// Convert '%' and 'px' values to integers
4451	function setSize(size, dimension) {
4452		return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : winheight()) / 100) : 1) * parseInt(size, 10));
4453	}
4454	
4455	// Checks an href to see if it is a photo.
4456	// There is a force photo option (photo: true) for hrefs that cannot be matched by the regex.
4457	function isImage(settings, url) {
4458		return settings.photo || settings.photoRegex.test(url);
4459	}
4460
4461	function retinaUrl(settings, url) {
4462		return settings.retinaUrl && window.devicePixelRatio > 1 ? url.replace(settings.photoRegex, settings.retinaSuffix) : url;
4463	}
4464
4465	function trapFocus(e) {
4466		if ('contains' in $box[0] && !$box[0].contains(e.target)) {
4467			e.stopPropagation();
4468			$box.focus();
4469		}
4470	}
4471
4472	// Assigns function results to their respective properties
4473	function makeSettings() {
4474		var i,
4475			data = $.data(element, colorbox);
4476		
4477		if (data == null) {
4478			settings = $.extend({}, defaults);
4479			if (console && console.log) {
4480				console.log('Error: cboxElement missing settings object');
4481			}
4482		} else {
4483			settings = $.extend({}, data);
4484		}
4485		
4486		for (i in settings) {
4487			if ($.isFunction(settings[i]) && i.slice(0, 2) !== 'on') { // checks to make sure the function isn't one of the callbacks, they will be handled at the appropriate time.
4488				settings[i] = settings[i].call(element);
4489			}
4490		}
4491		
4492		settings.rel = settings.rel || element.rel || $(element).data('rel') || 'nofollow';
4493		settings.href = settings.href || $(element).attr('href');
4494		settings.title = settings.title || element.title;
4495		
4496		if (typeof settings.href === "string") {
4497			settings.href = $.trim(settings.href);
4498		}
4499	}
4500
4501	function trigger(event, callback) {
4502		// for external use
4503		$(document).trigger(event);
4504
4505		// for internal use
4506		$events.trigger(event);
4507
4508		if ($.isFunction(callback)) {
4509			callback.call(element);
4510		}
4511	}
4512
4513
4514	var slideshow = (function(){
4515		var active,
4516			className = prefix + "Slideshow_",
4517			click = "click." + prefix,
4518			timeOut;
4519
4520		function clear () {
4521			clearTimeout(timeOut);
4522		}
4523
4524		function set() {
4525			if (settings.loop || $related[index + 1]) {
4526				clear();
4527				timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
4528			}
4529		}
4530
4531		function start() {
4532			$slideshow
4533				.html(settings.slideshowStop)
4534				.unbind(click)
4535				.one(click, stop);
4536
4537			$events
4538				.bind(event_complete, set)
4539				.bind(event_load, clear);
4540
4541			$box.removeClass(className + "off").addClass(className + "on");
4542		}
4543
4544		function stop() {
4545			clear();
4546			
4547			$events
4548				.unbind(event_complete, set)
4549				.unbind(event_load, clear);
4550
4551			$slideshow
4552				.html(settings.slideshowStart)
4553				.unbind(click)
4554				.one(click, function () {
4555					publicMethod.next();
4556					start();
4557				});
4558
4559			$box.removeClass(className + "on").addClass(className + "off");
4560		}
4561
4562		function reset() {
4563			active = false;
4564			$slideshow.hide();
4565			clear();
4566			$events
4567				.unbind(event_complete, set)
4568				.unbind(event_load, clear);
4569			$box.removeClass(className + "off " + className + "on");
4570		}
4571
4572		return function(){
4573			if (active) {
4574				if (!settings.slideshow) {
4575					$events.unbind(event_cleanup, reset);
4576					reset();
4577				}
4578			} else {
4579				if (settings.slideshow && $related[1]) {
4580					active = true;
4581					$events.one(event_cleanup, reset);
4582					if (settings.slideshowAuto) {
4583						start();
4584					} else {
4585						stop();
4586					}
4587					$slideshow.show();
4588				}
4589			}
4590		};
4591
4592	}());
4593
4594
4595	function launch(target) {
4596		if (!closing) {
4597			
4598			element = target;
4599			
4600			makeSettings();
4601			
4602			$related = $(element);
4603			
4604			index = 0;
4605			
4606			if (settings.rel !== 'nofollow') {
4607				$related = $('.' + boxElement).filter(function () {
4608					var data = $.data(this, colorbox),
4609						relRelated;
4610
4611					if (data) {
4612						relRelated =  $(this).data('rel') || data.rel || this.rel;
4613					}
4614					
4615					return (relRelated === settings.rel);
4616				});
4617				index = $related.index(element);
4618				
4619				// Check direct calls to Colorbox.
4620				if (index === -1) {
4621					$related = $related.add(element);
4622					index = $related.length - 1;
4623				}
4624			}
4625			
4626			$overlay.css({
4627				opacity: parseFloat(settings.opacity),
4628				cursor: settings.overlayClose ? "pointer" : "auto",
4629				visibility: 'visible'
4630			}).show();
4631			
4632
4633			if (className) {
4634				$box.add($overlay).removeClass(className);
4635			}
4636			if (settings.className) {
4637				$box.add($overlay).addClass(settings.className);
4638			}
4639			className = settings.className;
4640
4641			if (settings.closeButton) {
4642				$close.html(settings.close).appendTo($content);
4643			} else {
4644				$close.appendTo('<div/>');
4645			}
4646
4647			if (!open) {
4648				open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
4649				
4650				// Show colorbox so the sizes can be calculated in older versions of jQuery
4651				$box.css({visibility:'hidden', display:'block'});
4652				
4653				$loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden');
4654				$content.css({width:'', height:''}).append($loaded);
4655
4656				// Cache values needed for size calculations
4657				interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();
4658				interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
4659				loadedHeight = $loaded.outerHeight(true);
4660				loadedWidth = $loaded.outerWidth(true);
4661
4662				// Opens inital empty Colorbox prior to content being loaded.
4663				settings.w = setSize(settings.initialWidth, 'x');
4664				settings.h = setSize(settings.initialHeight, 'y');
4665				$loaded.css({width:'', height:settings.h});
4666				publicMethod.position();
4667
4668				trigger(event_open, settings.onOpen);
4669				
4670				$groupControls.add($title).hide();
4671
4672				$box.focus();
4673				
4674				if (settings.trapFocus) {
4675					// Confine focus to the modal
4676					// Uses event capturing that is not supported in IE8-
4677					if (document.addEventListener) {
4678
4679						document.addEventListener('focus', trapFocus, true);
4680						
4681						$events.one(event_closed, function () {
4682							document.removeEventListener('focus', trapFocus, true);
4683						});
4684					}
4685				}
4686
4687				// Return focus on closing
4688				if (settings.returnFocus) {
4689					$events.one(event_closed, function () {
4690						$(element).focus();
4691					});
4692				}
4693			}
4694			load();
4695		}
4696	}
4697
4698	// Colorbox's markup needs to be added to the DOM prior to being called
4699	// so that the browser will go ahead and load the CSS background images.
4700	function appendHTML() {
4701		if (!$box && document.body) {
4702			init = false;
4703			$window = $(window);
4704			$box = $tag(div).attr({
4705				id: colorbox,
4706				'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS.
4707				role: 'dialog',
4708				tabindex: '-1'
4709			}).hide();
4710			$overlay = $tag(div, "Overlay").hide();
4711			$loadingOverlay = $([$tag(div, "LoadingOverlay")[0],$tag(div, "LoadingGraphic")[0]]);
4712			$wrap = $tag(div, "Wrapper");
4713			$content = $tag(div, "Content").append(
4714				$title = $tag(div, "Title"),
4715				$current = $tag(div, "Current"),
4716				$prev = $('<button type="button"/>').attr({id:prefix+'Previous'}),
4717				$next = $('<button type="button"/>').attr({id:prefix+'Next'}),
4718				$slideshow = $tag('button', "Slideshow"),
4719				$loadingOverlay
4720			);
4721
4722			$close = $('<button type="button"/>').attr({id:prefix+'Close'});
4723			
4724			$wrap.append( // The 3x3 Grid that makes up Colorbox
4725				$tag(div).append(
4726					$tag(div, "TopLeft"),
4727					$topBorder = $tag(div, "TopCenter"),
4728					$tag(div, "TopRight")
4729				),
4730				$tag(div, false, 'clear:left').append(
4731					$leftBorder = $tag(div, "MiddleLeft"),
4732					$content,
4733					$rightBorder = $tag(div, "MiddleRight")
4734				),
4735				$tag(div, false, 'clear:left').append(
4736					$tag(div, "BottomLeft"),
4737					$bottomBorder = $tag(div, "BottomCenter"),
4738					$tag(div, "BottomRight")
4739				)
4740			).find('div div').css({'float': 'left'});
4741			
4742			$loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none');
4743			
4744			$groupControls = $next.add($prev).add($current).add($slideshow);
4745
4746			$(document.body).append($overlay, $box.append($wrap, $loadingBay));
4747		}
4748	}
4749
4750	// Add Colorbox's event bindings
4751	function addBindings() {
4752		function clickHandler(e) {
4753			// ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
4754			// See: http://jacklmoore.com/notes/click-events/
4755			if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {
4756				e.preventDefault();
4757				launch(this);
4758			}
4759		}
4760
4761		if ($box) {
4762			if (!init) {
4763				init = true;
4764
4765				// Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
4766				$next.click(function () {
4767					publicMethod.next();
4768				});
4769				$prev.click(function () {
4770					publicMethod.prev();
4771				});
4772				$close.click(function () {
4773					publicMethod.close();
4774				});
4775				$overlay.click(function () {
4776					if (settings.overlayClose) {
4777						publicMethod.close();
4778					}
4779				});
4780				
4781				// Key Bindings
4782				$(document).bind('keydown.' + prefix, function (e) {
4783					var key = e.keyCode;
4784					if (open && settings.escKey && key === 27) {
4785						e.preventDefault();
4786						publicMethod.close();
4787					}
4788					if (open && settings.arrowKey && $related[1] && !e.altKey) {
4789						if (key === 37) {
4790							e.preventDefault();
4791							$prev.click();
4792						} else if (key === 39) {
4793							e.preventDefault();
4794							$next.click();
4795						}
4796					}
4797				});
4798
4799				if ($.isFunction($.fn.on)) {
4800					// For jQuery 1.7+
4801					$(document).on('click.'+prefix, '.'+boxElement, clickHandler);
4802				} else {
4803					// For jQuery 1.3.x -> 1.6.x
4804					// This code is never reached in jQuery 1.9, so do not contact me about 'live' being removed.
4805					// This is not here for jQuery 1.9, it's here for legacy users.
4806					$('.'+boxElement).live('click.'+prefix, clickHandler);
4807				}
4808			}
4809			return true;
4810		}
4811		return false;
4812	}
4813
4814	// Don't do anything if Colorbox already exists.
4815	if ($.colorbox) {
4816		return;
4817	}
4818
4819	// Append the HTML when the DOM loads
4820	$(appendHTML);
4821
4822
4823	// ****************
4824	// PUBLIC FUNCTIONS
4825	// Usage format: $.colorbox.close();
4826	// Usage from within an iframe: parent.jQuery.colorbox.close();
4827	// ****************
4828	
4829	publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
4830		var $this = this;
4831		
4832		options = options || {};
4833		
4834		appendHTML();
4835
4836		if (addBindings()) {
4837			if ($.isFunction($this)) { // assume a call to $.colorbox
4838				$this = $('<a/>');
4839				options.open = true;
4840			} else if (!$this[0]) { // colorbox being applied to empty collection
4841				return $this;
4842			}
4843			
4844			if (callback) {
4845				options.onComplete = callback;
4846			}
4847			
4848			$this.each(function () {
4849				$.data(this, colorbox, $.extend({}, $.data(this, colorbox) || defaults, options));
4850			}).addClass(boxElement);
4851			
4852			if (($.isFunction(options.open) && options.open.call($this)) || options.open) {
4853				launch($this[0]);
4854			}
4855		}
4856		
4857		return $this;
4858	};
4859
4860	publicMethod.position = function (speed, loadedCallback) {
4861		var
4862		css,
4863		top = 0,
4864		left = 0,
4865		offset = $box.offset(),
4866		scrollTop,
4867		scrollLeft;
4868		
4869		$window.unbind('resize.' + prefix);
4870
4871		// remove the modal so that it doesn't influence the document width/height
4872		$box.css({top: -9e4, left: -9e4});
4873
4874		scrollTop = $window.scrollTop();
4875		scrollLeft = $window.scrollLeft();
4876
4877		if (settings.fixed) {
4878			offset.top -= scrollTop;
4879			offset.left -= scrollLeft;
4880			$box.css({position: 'fixed'});
4881		} else {
4882			top = scrollTop;
4883			left = scrollLeft;
4884			$box.css({position: 'absolute'});
4885		}
4886
4887		// keeps the top and left positions within the browser's viewport.
4888		if (settings.right !== false) {
4889			left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(sett
vendor: 4,326 bytes, lines 4889-5026
4889ings.right, 'x'), 0);
4890		} else if (settings.left !== false) {
4891			left += setSize(settings.left, 'x');
4892		} else {
4893			left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2);
4894		}
4895		
4896		if (settings.bottom !== false) {
4897			top += Math.max(winheight() - settings.h - loadedHeight - interfaceHeight - setSize(settings.bottom, 'y'), 0);
4898		} else if (settings.top !== false) {
4899			top += setSize(settings.top, 'y');
4900		} else {
4901			top += Math.round(Math.max(winheight() - settings.h - loadedHeight - interfaceHeight, 0) / 2);
4902		}
4903
4904		$box.css({top: offset.top, left: offset.left, visibility:'visible'});
4905		
4906		// this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
4907		// but it has to be shrank down around the size of div#colorbox when it's done.  If not,
4908		// it can invoke an obscure IE bug when using iframes.
4909		$wrap[0].style.width = $wrap[0].style.height = "9999px";
4910		
4911		function modalDimensions() {
4912			$topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = (parseInt($box[0].style.width,10) - interfaceWidth)+'px';
4913			$content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = (parseInt($box[0].style.height,10) - interfaceHeight)+'px';
4914		}
4915
4916		css = {width: settings.w + loadedWidth + interfaceWidth, height: settings.h + loadedHeight + interfaceHeight, top: top, left: left};
4917
4918		// setting the speed to 0 if the content hasn't changed size or position
4919		if (speed) {
4920			var tempSpeed = 0;
4921			$.each(css, function(i){
4922				if (css[i] !== previousCSS[i]) {
4923					tempSpeed = speed;
4924					return;
4925				}
4926			});
4927			speed = tempSpeed;
4928		}
4929
4930		previousCSS = css;
4931
4932		if (!speed) {
4933			$box.css(css);
4934		}
4935
4936		$box.dequeue().animate(css, {
4937			duration: speed || 0,
4938			complete: function () {
4939				modalDimensions();
4940				
4941				active = false;
4942				
4943				// shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation.
4944				$wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px";
4945				$wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px";
4946				
4947				if (settings.reposition) {
4948					setTimeout(function () {  // small delay before binding onresize due to an IE8 bug.
4949						$window.bind('resize.' + prefix, publicMethod.position);
4950					}, 1);
4951				}
4952
4953				if (loadedCallback) {
4954					loadedCallback();
4955				}
4956			},
4957			step: modalDimensions
4958		});
4959	};
4960
4961	publicMethod.resize = function (options) {
4962		var scrolltop;
4963		
4964		if (open) {
4965			options = options || {};
4966			
4967			if (options.width) {
4968				settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
4969			}
4970
4971			if (options.innerWidth) {
4972				settings.w = setSize(options.innerWidth, 'x');
4973			}
4974
4975			$loaded.css({width: settings.w});
4976			
4977			if (options.height) {
4978				settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
4979			}
4980
4981			if (options.innerHeight) {
4982				settings.h = setSize(options.innerHeight, 'y');
4983			}
4984
4985			if (!options.innerHeight && !options.height) {
4986				scrolltop = $loaded.scrollTop();
4987				$loaded.css({height: "auto"});
4988				settings.h = $loaded.height();
4989			}
4990
4991			$loaded.css({height: settings.h});
4992
4993			if(scrolltop) {
4994				$loaded.scrollTop(scrolltop);
4995			}
4996			
4997			publicMethod.position(settings.transition === "none" ? 0 : settings.speed);
4998		}
4999	};
5000
5001	publicMethod.prep = function (object) {
5002		if (!open) {
5003			return;
5004		}
5005		
5006		var callback, speed = settings.transition === "none" ? 0 : settings.speed;
5007
5008		$loaded.empty().remove(); // Using empty first may prevent some IE7 issues.
5009
5010		$loaded = $tag(div, 'LoadedContent').append(object);
5011		
5012		function getWidth() {
5013			settings.w = settings.w || $loaded.width();
5014			settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;
5015			return settings.w;
5016		}
5017		function getHeight() {
5018			settings.h = settings.h || $loaded.height();
5019			settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;
5020			return settings.h;
5021		}
5022		
5023		$loaded.hide()
5024		.appendTo($loadingBay.show())// content has to be appended to the DOM for accurate size calculations.
5025		.css({width: getWidth(), overflow: settings.scrolling ? 'auto' : 'hidden'})
5026		.css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height.
5027		.prependTo($content);
5028		
5029		$loadingBay.hide();
5030		
5031		// floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
5032		
5033		$(photo).css({'float': 'none'});
5034
5035		callback = function () {
5036			var total = $related.length,
5037				iframe,
5038				frameBorder = 'frameBorder',
5039				allowTransparency = 'allowTransparency',
5040				complete;
5041			
5042			if (!open) {
5043				return;
5044			}
5045			
5046			function removeFilter() { // Needed for IE7 & IE8 in versions of jQuery prior to 1.7.2
5047				if ($.support.opacity === false) {
5048					$box[0].style.removeAttribute('filter');
5049				}
5050			}
5051			
5052			complete = function () {
5053				clearTimeout(loadingTimer);
5054				$loadingOverlay.hide();
5055				trigger(event_complete, settings.onComplete);
5056			};
5057
5058			
5059			$title.html(settings.title).add($loaded).show();
5060			
5061			if (total > 1) { // handle grouping
5062				if (typeof settings.current === "string") {
5063					$current.html(settings.current.replace('{current}', index + 1).replace('{total}', total)).show();
5064				}
5065				
5066				$next[(settings.loop || index < total - 1) ? "show" : "hide"]().html(sett
5066ings.next);
5067				$prev[(settings.loop || index) ? "show" : "hide"]().html(settings.previous);
5068				
5069				slideshow();
5070				
5071				// Preloads images within a rel group
5072				if (settings.preloading) {
5073					$.each([getIndex(-1), getIndex(1)], function(){
5074						var src,
5075							img,
5076							i = $related[this],
5077							data = $.data(i, colorbox);
5078
5079						if (data && data.href) {
5080							src = data.href;
5081							if ($.isFunction(src)) {
5082								src = src.call(i);
5083							}
5084						} else {
5085							src = $(i).attr('href');
5086						}
5087
5088						if (src && isImage(data, src)) {
5089							src = retinaUrl(data, src);
5090							img = document.createElement('img');
5091							img.src = src;
5092						}
5093					});
5094				}
5095			} else {
5096				$groupControls.hide();
5097			}
5098			
5099			if (settings.iframe) {
5100				iframe = $tag('iframe')[0];
5101				
5102				if (frameBorder in iframe) {
5103					iframe[frameBorder] = 0;
5104				}
5105				
5106				if (allowTransparency in iframe) {
5107					iframe[allowTransparency] = "true";
5108				}
5109
5110				if (!settings.scrolling) {
5111					iframe.scrolling = "no";
5112				}
5113				
5114				$(iframe)
5115					.attr({
5116						src: settings.href,
5117						name: (new Date()).getTime(), // give the iframe a unique name to prevent caching
5118						'class': prefix + 'Iframe',
5119						allowFullScreen : true, // allow HTML5 video to go fullscreen
5120						webkitAllowFullScreen : true,
5121						mozallowfullscreen : true
5122					})
5123					.one('load', complete)
5124					.appendTo($loaded);
5125				
5126				$events.one(event_purge, function () {
5127					iframe.src = "//about:blank";
5128				});
5129
5130				if (settings.fastIframe) {
5131					$(iframe).trigger('load');
5132				}
5133			} else {
5134				complete();
5135			}
5136			
5137			if (settings.transition === 'fade') {
5138				$box.fadeTo(speed, 1, removeFilter);
5139			} else {
5140				removeFilter();
5141			}
5142		};
5143		
5144		if (settings.transition === 'fade') {
5145			$box.fadeTo(speed, 0, function () {
5146				publicMethod.position(0, callback);
5147			});
5148		} else {
5149			publicMethod.position(speed, callback);
5150		}
5151	};
5152
5153	function load () {
5154		var href, setResize, prep = publicMethod.prep, $inline, request = ++requests;
5155		
5156		active = true;
5157		
5158		photo = false;
5159		
5160		element = $related[index];
5161		
5162		makeSettings();
5163		
5164		trigger(event_purge);
5165		
5166		trigger(event_load, settings.onLoad);
5167		
5168		settings.h = settings.height ?
5169				setSize(settings.height, 'y') - loadedHeight - interfaceHeight :
5170				settings.innerHeight && setSize(settings.innerHeight, 'y');
5171		
5172		settings.w = settings.width ?
5173				setSize(settings.width, 'x') - loadedWidth - interfaceWidth :
5174				settings.innerWidth && setSize(settings.innerWidth, 'x');
5175		
5176		// Sets the minimum dimensions for use in image scaling
5177		settings.mw = settings.w;
5178		settings.mh = settings.h;
5179		
5180		// Re-evaluate the minimum width and height based on maxWidth and maxHeight values.
5181		// If the width or height exceed the maxWidth or maxHeight, use the maximum values instead.
5182		if (settings.maxWidth) {
5183			settings.mw = setSize(settings.maxWidth, 'x') - loadedWidth - interfaceWidth;
5184			settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw;
5185		}
5186		if (settings.maxHeight) {
5187			settings.mh = setSize(settings.maxHeight, 'y') - loadedHeight - interfaceHeight;
5188			settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;
5189		}
5190		
5191		href = settings.href;
5192		
5193		loadingTimer = setTimeout(function () {
5194			$loadingOverlay.show();
5195		}, 100);
5196		
5197		if (settings.inline) {
5198			// Inserts an empty placeholder where inline content is being pulled from.
5199			// An event is bound to put inline content back when Colorbox closes or loads new content.
5200			$inline = $tag(div).hide().insertBefore($(href)[0]);
5201
5202			$events.one(event_purge, function () {
5203				$inline.replaceWith($loaded.children());
5204			});
5205
5206			prep($(href));
5207		} else if (settings.iframe) {
5208			// IFrame element won't be added to the DOM until it is ready to be displayed,
5209			// to avoid problems with DOM-ready JS that might be trying to run in that iframe.
5210			prep(" ");
5211		} else if (settings.html) {
5212			prep(settings.html);
5213		} else if (isImage(settings, href)) {
5214
5215			href = retinaUrl(settings, href);
5216
5217			photo = document.createElement('img');
5218
5219			$(photo)
5220			.addClass(prefix + 'Photo')
5221			.bind('error',function () {
5222				settings.title = false;
5223				prep($tag(div, 'Error').html(settings.imgError));
5224			})
5225			.one('load', function () {
5226				var percent;
5227
5228				if (request !== requests) {
5229					return;
5230				}
5231
5232				photo.alt = $(element).attr('alt') || $(element).attr('data-alt') || '';
5233
5234				if (settings.retinaImage && window.devicePixelRatio > 1) {
5235					photo.height = photo.height / window.devicePixelRatio;
5236					photo.width = photo.width / window.devicePixelRatio;
5237				}
5238
5239				if (settings.scalePhotos) {
5240					setResize = function () {
5241						photo.height -= photo.height * percent;
5242						photo.width -= photo.width * percent;
5243					};
5244					if (settings.mw && photo.width > settings.mw) {
5245						percent = (photo.width - settings.mw) / photo.width;
5246						setResize();
5247					}
5248					if (settings.mh && photo.height > settings.mh) {
5249						percent = (photo.height - settings.mh) / photo.height;
5250						setResize();
5251					}
5252				}
5253				
5254				if (settings.h) {
5255					photo.style.marginTop = Math.max(settings.mh - photo.height, 0) / 2 + 'px';
5256				}
5257				
5258				if ($related[1] && (settings.loop || $related[index + 1])) {
5259					photo.style.cursor = 'pointer';
5260					photo.onclick = function () {
5261						publicMethod.next();
5262					};
5263				}
5264
5265				photo.style.width = photo.width + 'px';
5266				photo.style.height = photo.height + 'px';
5267
5268				setTimeout(function () { // A pause because Chrome will sometimes report a 0 by 0 size otherwise.
5269					prep(photo);
5270				}, 1);
5271			});
5272			
5273			setTimeout(function () { // A pause because Opera 10.6+ will sometimes not run the onload function otherwise.
5274				photo.src = href;
5275			}, 1);
5276		} else if (href) {
5277			$loadingBay.load(href, settings.data, function (data, status) {
5278				if (request === requests) {
5279					prep(status === 'error' ? $tag(div, 'Error').html(settings.xhrError) : $(this).contents());
5280				}
5281			});
5282		}
5283	}
5284		
5285	// Navigates to the next page/image in a set.
5286	publicMethod.next = function () {
5287		if (!active && $related[1] && (settings.loop || $related[index + 1])) {
5288			index = getIndex(1);
5289			launch($related[index]);
5290		}
5291	};
5292	
5293	publicMethod.prev = function () {
5294		if (!active && $related[1] && (settings.loop || index)) {
5295			index = getIndex(-1);
5296			launch($related[index]);
5297		}
5298	};
5299
5300	// Note: to use this within an iframe use the following format: parent.jQuery.colorbox.close();
5301	publicMethod.close = function () {
5302		if (open && !closing) {
5303			
5304			closing = true;
5305			
5306			open = false;
5307			
5308			trigger(event_cleanup, settings.onCleanup);
5309			
5310			$window.unbind('.' + prefix);
5311			
5312			$overlay.fadeTo(settings.fadeOut || 0, 0);
5313			
5314			$box.stop().fadeTo(settings.fadeOut || 0, 0, function () {
5315			
5316				$box.add($overlay).css({'opacity': 1, cursor: 'auto'}).hide();
5317				
5318				trigger(event_purge);
5319				
5320				$loaded.empty().remove(); // Using empty first may prevent some IE7 issues.
5321				
5322				setTimeout(function () {
5323					closing = false;
vendor: 4,185 bytes, lines 5324-5452
5324					trigger(event_closed, settings.onClosed);
5325				}, 1);
5326			});
5327		}
5328	};
5329
5330	// Removes changes Colorbox made to the document, but does not remove the plugin.
5331	publicMethod.remove = function () {
5332		if (!$box) { return; }
5333
5334		$box.stop();
5335		$.colorbox.close();
5336		$box.stop().remove();
5337		$overlay.remove();
5338		closing = false;
5339		$box = null;
5340		$('.' + boxElement)
5341			.removeData(colorbox)
5342			.removeClass(boxElement);
5343
5344		$(document).unbind('click.'+prefix);
5345	};
5346
5347	// A method for fetching the current element Colorbox is referencing.
5348	// returns a jQuery object.
5349	publicMethod.element = function () {
5350		return $(element);
5351	};
5352
5353	publicMethod.settings = defaults;
5354
5355}(jQuery, document, window));
5356
5357
5358/*compiled*/
5359/*
5360 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
5361 *
5362 * Uses the built in easing capabilities added In jQuery 1.1
5363 * to offer multiple easing options
5364 *
5365 * TERMS OF USE - jQuery Easing
5366 * 
5367 * Open source under the BSD License. 
5368 * 
5369 * Copyright © 2008 George McGinley Smith
5370 * All rights reserved.
5371 * 
5372 * Redistribution and use in source and binary forms, with or without modification, 
5373 * are permitted provided that the following conditions are met:
5374 * 
5375 * Redistributions of source code must retain the above copyright notice, this list of 
5376 * conditions and the following disclaimer.
5377 * Redistributions in binary form must reproduce the above copyright notice, this list 
5378 * of conditions and the following disclaimer in the documentation and/or other materials 
5379 * provided with the distribution.
5380 * 
5381 * Neither the name of the author nor the names of contributors may be used to endorse 
5382 * or promote products derived from this software without specific prior written permission.
5383 * 
5384 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
5385 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5386 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
5387 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
5388 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
5389 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
5390 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
5391 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
5392 * OF THE POSSIBILITY OF SUCH DAMAGE. 
5393 *
5394*/
5395
5396// t: current time, b: begInnIng value, c: change In value, d: duration
5397jQuery.easing['jswing'] = jQuery.easing['swing'];
5398
5399jQuery.extend( jQuery.easing,
5400{
5401	def: 'easeOutQuad',
5402	swing: function (x, t, b, c, d) {
5403		//alert(jQuery.easing.default);
5404		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
5405	},
5406	easeInQuad: function (x, t, b, c, d) {
5407		return c*(t/=d)*t + b;
5408	},
5409	easeOutQuad: function (x, t, b, c, d) {
5410		return -c *(t/=d)*(t-2) + b;
5411	},
5412	easeInOutQuad: function (x, t, b, c, d) {
5413		if ((t/=d/2) < 1) return c/2*t*t + b;
5414		return -c/2 * ((--t)*(t-2) - 1) + b;
5415	},
5416	easeInCubic: function (x, t, b, c, d) {
5417		return c*(t/=d)*t*t + b;
5418	},
5419	easeOutCubic: function (x, t, b, c, d) {
5420		return c*((t=t/d-1)*t*t + 1) + b;
5421	},
5422	easeInOutCubic: function (x, t, b, c, d) {
5423		if ((t/=d/2) < 1) return c/2*t*t*t + b;
5424		return c/2*((t-=2)*t*t + 2) + b;
5425	},
5426	easeInQuart: function (x, t, b, c, d) {
5427		return c*(t/=d)*t*t*t + b;
5428	},
5429	easeOutQuart: function (x, t, b, c, d) {
5430		return -c * ((t=t/d-1)*t*t*t - 1) + b;
5431	},
5432	easeInOutQuart: function (x, t, b, c, d) {
5433		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
5434		return -c/2 * ((t-=2)*t*t*t - 2) + b;
5435	},
5436	easeInQuint: function (x, t, b, c, d) {
5437		return c*(t/=d)*t*t*t*t + b;
5438	},
5439	easeOutQuint: function (x, t, b, c, d) {
5440		return c*((t=t/d-1)*t*t*t*t + 1) + b;
5441	},
5442	easeInOutQuint: function (x, t, b, c, d) {
5443		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
5444		return c/2*((t-=2)*t*t*t*t + 2) + b;
5445	},
5446	easeInSine: function (x, t, b, c, d) {
5447		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
5448	},
5449	easeOutSine: function (x, t, b, c, d) {
5450		return c * Math.sin(t/d * (Math.PI/2)) + b;
5451	},
5452	easeInOutSine: function (x, t, b, c, d) {
vendor: 4,186 bytes, lines 5453-5556
5453		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
5454	},
5455	easeInExpo: function (x, t, b, c, d) {
5456		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
5457	},
5458	easeOutExpo: function (x, t, b, c, d) {
5459		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
5460	},
5461	easeInOutExpo: function (x, t, b, c, d) {
5462		if (t==0) return b;
5463		if (t==d) return b+c;
5464		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
5465		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
5466	},
5467	easeInCirc: function (x, t, b, c, d) {
5468		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
5469	},
5470	easeOutCirc: function (x, t, b, c, d) {
5471		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
5472	},
5473	easeInOutCirc: function (x, t, b, c, d) {
5474		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
5475		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
5476	},
5477	easeInElastic: function (x, t, b, c, d) {
5478		var s=1.70158;var p=0;var a=c;
5479		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
5480		if (a < Math.abs(c)) { a=c; var s=p/4; }
5481		else var s = p/(2*Math.PI) * Math.asin (c/a);
5482		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
5483	},
5484	easeOutElastic: function (x, t, b, c, d) {
5485		var s=1.70158;var p=0;var a=c;
5486		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
5487		if (a < Math.abs(c)) { a=c; var s=p/4; }
5488		else var s = p/(2*Math.PI) * Math.asin (c/a);
5489		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
5490	},
5491	easeInOutElastic: function (x, t, b, c, d) {
5492		var s=1.70158;var p=0;var a=c;
5493		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
5494		if (a < Math.abs(c)) { a=c; var s=p/4; }
5495		else var s = p/(2*Math.PI) * Math.asin (c/a);
5496		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
5497		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
5498	},
5499	easeInBack: function (x, t, b, c, d, s) {
5500		if (s == undefined) s = 1.70158;
5501		return c*(t/=d)*t*((s+1)*t - s) + b;
5502	},
5503	easeOutBack: function (x, t, b, c, d, s) {
5504		if (s == undefined) s = 1.70158;
5505		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
5506	},
5507	easeInOutBack: function (x, t, b, c, d, s) {
5508		if (s == undefined) s = 1.70158; 
5509		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
5510		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
5511	},
5512	easeInBounce: function (x, t, b, c, d) {
5513		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
5514	},
5515	easeOutBounce: function (x, t, b, c, d) {
5516		if ((t/=d) < (1/2.75)) {
5517			return c*(7.5625*t*t) + b;
5518		} else if (t < (2/2.75)) {
5519			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
5520		} else if (t < (2.5/2.75)) {
5521			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
5522		} else {
5523			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
5524		}
5525	},
5526	easeInOutBounce: function (x, t, b, c, d) {
5527		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
5528		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
5529	}
5530});
5531
5532/*
5533 *
5534 * TERMS OF USE - EASING EQUATIONS
5535 * 
5536 * Open source under the BSD License. 
5537 * 
5538 * Copyright © 2001 Robert Penner
5539 * All rights reserved.
5540 * 
5541 * Redistribution and use in source and binary forms, with or without modification, 
5542 * are permitted provided that the following conditions are met:
5543 * 
5544 * Redistributions of source code must retain the above copyright notice, this list of 
5545 * conditions and the following disclaimer.
5546 * Redistributions in binary form must reproduce the above copyright notice, this list 
5547 * of conditions and the following disclaimer in the documentation and/or other materials 
5548 * provided with the distribution.
5549 * 
5550 * Neither the name of the author nor the names of contributors may be used to endorse 
5551 * or promote products derived from this software without specific prior written permission.
5552 * 
5553 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
5554 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5555 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
5556 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
5557 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
5558 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
5559 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
5560 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
5561 * OF THE POSSIBILITY OF SUCH DAMAGE. 
5562 *
5563 */
5564 
5565 var memberProfileHelper;(function(){if(window.memberProfileHelper==null){window.memberProfileHelper=new Object();}memberProfileHelper.setFilter=function(){var shadingFieldset=document.getElementById("shadingFieldset");if(shadingFieldset==null){return;}if(document.all){shadingFieldset.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=40)";}else{shadingFieldset.style.MozOpacity=0.4;}};memberProfileHelper.disableAllInputs=function(){var shadingFieldset=document.getElementById("shadingFieldset");var i;if(shadingFieldset==null){return;}var inputs=shadingFieldset.getElementsByTagName("INPUT");if(inputs.length>0){for(i=0;i<inputs.length;i++){inputs[i].disabled="true";}}inputs=shadingFieldset.getElementsByTagName("TEXTAREA");if(inputs.length>0){for(i=0;i<inputs.length;i++){inputs[i].disabled="true";}}inputs=shadingFieldset.getElementsByTagName("SELECT");if(inputs.length>0){for(i=0;i<inputs.length;i++){inputs[i].disabled="true";}}};memberProfileHelper.checkMemberReceiveRemindersFieldChanged=function(sender,args){var receiveRemindersCheckbox=document.getElementById(receiveRemindersCheckBoxId);var state=receiveRemindersCheckbox.checked?"checked":"nonChecked";DataChangeWatcher.changeValidatorCustom("ReceiveRemindersEnabledDisabled",state,args);};memberProfileHelper.checkMemberReceiveNewsLettersFieldChanged=function(sender,args){var receiveNewslettersCheckbox=document.getElementById(receiveNewsLettersCheckBoxId);var state=receiveNewslettersCheckbox.checked?"checked":"nonChecked";DataChangeWatcher.changeValidatorCustom("ReceiveNewsLettersEnabledDisabled",state,args);};memberProfileHelper.stopWatchDataChanging=function(){if(typeof(DataChangeWatcher)=="undefined"){return;}DataChangeWatcher.setNotChanged();DataChangeWatcher.pauseWatching();};memberProfileHelper.makeButtonWatchDataChanging=function(btnId,sourceAction,causesValidation,checkIfDataChanged,awayMessage){var btn=document.getElementById(btnId);if(!btn){return;}btn.onclick=function(){var dcw=DataChangeWatcher;if(!causesValidation){if(dcw){dcw.resumeWatching();if(checkIfDataChanged){if(!dcw.confirmIfDataChanged()){return;}}}Page_ValidationActive=false;}else{if(!checkIfDataChanged){if(dcw){dcw.pauseWatching();}}}var actionResult=sourceAction();if(causesValidation){if(Page_IsValid&&!Page_BlockSubmit){if(checkIfDataChanged){if(dcw&&!dcw.confirmIfDataChanged()){Page_BlockSubmit=true;return;}}}else{if(!checkIfDataChanged){if(dcw){dcw.resumeWatching();}}}}};memberProfileHelper.TransferToPaymentSystem=function(paymentUrl){if(paymentUrl==null||paymentUrl==""){return false;}DataChangeWatcher.pauseWatching();location.href=paymentUrl;};};memberProfileHelper.EmailChangedNotfication=function(){var hiddenEmail=document.getElementById(hiddenEmailId);var textboxEmail=document.getElementById(textboxEmailId);if(memberProfileHelper.trim(hiddenEmail.value)!=memberProfileHelper.trim(textboxEmail.value)){return confirm(this.changingEmailMessageText);}else{return true;}};memberProfileHelper.trim=function(str){return str.replace(/^\s*(.*)\s*$/,"$1");};function $(id){return document.getElementById(id);}memberProfileHelper.setTabHidden=function setTabHidden(tabModeName){var tabModeHidden=$(this.tabModeHiddenID);tabModeHidden.value=tabModeName;};memberProfileHelper.showProfile=function showProfile(){var mandatoryLink=$(this.editMandatoryFieldTopMessageID);if(mandatoryLink){mandatoryLink.style.display="block";}var profileLink=$(this.profileTabLinkID);var profileLabel=$(this.profileTabLabelID);var fieldsLink=$(this.accessTabLinkID);var fieldsLabel=$(this.accessTabLabelID);var subscriptionsLink=$(this.subscriptionsTabLinkID);var subscriptionsLabel=$(this.subscriptionsTabLabelID);profileLink.style.display="none";profileLabel.style.display="inline";subscriptionsLink.style.display="inline";subscriptionsLabel.style.display="none";if(fieldsLink){fieldsLink.style.display="inline";fieldsLabel.style.display="none";}var profileContainer=$(this.mainProfileTrID);var includeMemberDirectoryContainer=$(this.trIncludeInMemberDirectoryID);var fieldsContainer=$(this.trDetailsToShowID);var subscriptionsContainer=$(this.divEnableNotificationsID);if(profileContainer){profileContainer.style.display="block";}if(includeMemberDirectoryContainer){includeMemberDirectoryContainer.style.display="none";}if(fieldsContainer){fieldsContainer.style.display="none";}if(subscriptionsContainer){subscriptionsContainer.style.display="none";}this.setTabHidden(this.tabModeNameProfile);return false;};memberProfileHelper.showFieldSettings=function showFieldSettings(){var mandatoryLink=$(this.editMandatoryFieldTopMessageID);if(mandatoryLink){mandatoryLink.style.display="none";}var profileLink=$(this.profileTabLinkID);var profileLabel=$(this.profileTabLabelID);var fieldsLink=$(this.accessTabLinkID);var fieldsLabel=$(this.accessTabLabelID);var subscriptionsLink=$(this.subscriptionsTabLinkID);var subscriptionsLabel=$(this.subscriptionsTabLabelID);profileLink.style.display="inline";profileLabel.style.display="none";subscriptionsLink.style.display="inline";subscriptionsLabel.style.display="none";if(fieldsLink){fieldsLink.style.display="none";fieldsLabel.style.display="inline";}var profileContainer=$(this.mainProfileTrID);var includeMemberDirectoryContainer=$(this.trIncludeInMemberDirectoryID);var fieldsContainer=$(this.trDetailsToShowID);var subscriptionsContainer=$(this.divEnableNotificationsID);if(profileContainer){profileContainer.style.display="none";}if(includeMemberDirectoryContainer){includeMemberDirectoryContainer.style.display="block";}if(fieldsContainer){fieldsContainer.style.display="block";}if(subscriptionsContainer){subscriptionsContainer.style.display="none";}this.setTabHidden(this.tabModeNameAccess);return false;};memberProfileHelper.showSubscriptions=function showSubscriptions(){var mandatoryLink=$(this.editMandatoryFieldTopMessageID);if(mandatoryLink){mandatoryLink.style.display="none";}var profileLink=$(this.profileTabLinkID);var profileLabel=$(this.profileTabLabelID);var fieldsLink=$(this.accessTabLinkID);var fieldsLabel=$(this.accessTabLabelID);var subscriptionsLink=$(this.subscriptionsTabLinkID);var subscriptionsLabel=$(this.subscriptionsTabLabelID);profileLink.style.display="inline";profileLabel.style.display="none";subscriptionsLink.style.display="none";subscriptionsLabel.style.display="inline";if(fieldsLink){fieldsLink.style.display="inline";fieldsLabel.style.display="none";}var profileContainer=$(this.mainProfileTrID);var includeMemberDirectoryContainer=$(this.trIncludeInMemberDirectoryID);var fieldsContainer=$(this.trDetailsToShowID);var subscriptionsContainer=$(this.divEnableNotificationsID);if(profileContainer){profileContainer.style.display="none";}if(includeMemberDirectoryContainer){includeMemberDirectoryContainer.style.display="none";}if(fieldsContainer){fieldsContainer.style.display="none";}if(subscriptionsContainer){subscriptionsContainer.style.display="block";}this.setTabHidden(this.tabModeNameSubscriptions);return false;};
5565memberProfileHelper.displayMemberAllDataTable=function(){var memberAllDataTable=$("memberAllDataTable");memberAllDataTable.style.display="block";};})();var memberDirectoryDetailsToShowHelper;(function(){if(memberDirectoryDetailsToShowHelper==null){memberDirectoryDetailsToShowHelper={};}function $(id){return document.getElementById(id);}memberDirectoryDetailsToShowHelper.editIncludeMeInMemberDirectoryClick=function(){memberDirectoryDetailsToShowHelper.checkAllowDisplayCheckBox();};memberDirectoryDetailsToShowHelper.checkAllowDisplayCheckBox=function(){var allowDisplayCheckBox=$(memberDirectoryDetailsToShowHelper.AllowDisplayCheckBoxId);if(allowDisplayCheckBox){memberDirectoryDetailsToShowHelper.setMemberFieldTableMode(!allowDisplayCheckBox.checked);}};memberDirectoryDetailsToShowHelper.setMemberFieldTableMode=function(disabled){var fieldsControl=$(memberDirectoryDetailsToShowHelper.FieldsControlId);var inputs=memberDirectoryDetailsToShowHelper.getInputs(fieldsControl);for(var i=0;i<inputs.length;i++){if(inputs[i]&&!inputs[i].getAttribute(memberDirectoryDetailsToShowHelper.LockedFieldHtmlAttr)){inputs[i].disabled=disabled;}}};memberDirectoryDetailsToShowHelper.getInputs=function(node){var inputs=[];memberDirectoryDetailsToShowHelper.populateInputs(inputs,node);return inputs;};memberDirectoryDetailsToShowHelper.populateInputs=function(inputs,node){if(!node){return;}if(node.tagName&&node.tagName.toLowerCase()=="input"){inputs[inputs.length]=node;}if(!node.childNodes||node.childNodes.length==0){return;}for(var i=0;i<node.childNodes.length;i++){var subNode=node.childNodes[i];memberDirectoryDetailsToShowHelper.populateInputs(inputs,subNode);}};})();(function(){if(!window.memberSubscriptionsHelper){window.memberSubscriptionsHelper={};}memberSubscriptionsHelper.editEnableEmailsClick=function(){this.setSubscriptionsEnabling();};memberSubscriptionsHelper.setSubscriptionsEnabling=function(){var allowDisplayCheckBox=WA.$(this.AllowDisplayCheckBoxId,window);var contentControl=WA.$(this.ContentControlId,window);if(!contentControl||!allowDisplayCheckBox){return;}contentControl.style.display=allowDisplayCheckBox.checked?"block":"none";};memberSubscriptionsHelper.enableSubscription=function(checkBoxID,dropDownID){var enableCheckBox=WA.$(checkBoxID,window);var typeDropDown=WA.$(dropDownID,window);if(!enableCheckBox||!typeDropDown){return;}typeDropDown.disabled=!enableCheckBox.checked;};})();(function(){if(!window.PhotoGallery){window.PhotoGallery={};}var albumParam="";var processingText="Please wait...";var deleteConfirmation="Are you sure you want to delete?";var deletePhotoConfirmation="Are you sure you want to delete this photo?";var saveAction=false;var photosHolder=false;var photosHolderHeight=false;var titleTextBox=false;var descriptionTextBox=false;var saveButton=false;var altSaveButton=false;var saveLinkButton=false;var deleteButton=false;var cancelButton=false;var uploadButton=false;var uploadAction=false;var viewModeRadioContainer=false;var uploadButtonContainer=false;var descriptionContainer=false;var descriptionHeightUrlKey=false;var countPhotosPerRowUrlKey=false;var pagingKey=false;var saveAlbumDialogInited=false;var uploadPhotosDialogInited=false;var photoItemId=false;var photoItemTimeout=false;var actionIsRunning=false;var pendingSender=false;var pendingImageDivId=false;var pendingFullDescriptionDivId=false;var pendingSmallDescriptionDivId=false;PhotoGallery.InitPhotoGallery=initPhotoGallery;PhotoGallery.InitJsFunctions=initJsFunctions;PhotoGallery.Page_Parsed=pageParsed;PhotoGallery.Page_Unloading=pageUnloading;PhotoGallery.CloseSaveAlbumDialog=closeSaveAlbumDialog;PhotoGallery.CloseUploadPhotosDialog=closeUploadPhotosDialog;PhotoGallery.Get_SaveAction=getSaveAction;PhotoGallery.Get_SaveTitle=getSaveTitle;PhotoGallery.Get_SaveDescription=getSaveDescription;PhotoGallery.Get_SaveButton=getSaveButton;PhotoGallery.Get_DeleteButton=getDeleteButton;PhotoGallery.Get_UploadButton=getUploadButton;PhotoGallery.Get_UploadAction=getUploadAction;PhotoGallery.ProcessingButton_OnClick=processingButtonClick;PhotoGallery.DeleteButton_OnClick=deleteButtonClick;PhotoGallery.UploadButton_OnClick=uploadButtonClick;PhotoGallery.SaveButton_OnClick=saveButtonClick;PhotoGallery.ImageMenu_OnMouseOver=imageMenuMouseOver;PhotoGallery.ImageMenu_OnMouseOut=imageMenuMouseOut;PhotoGallery.MenuButton_OnMouseOver=menuButtonMouseOver;PhotoGallery.MenuButton_OnMouseOut=menuButtonMouseOut;PhotoGallery.MenuButton_OnClick=menuButtonClick;PhotoGallery.NavigateToList=navigateToList;PhotoGallery.CheckLength=checkLength;function initPhotoGallery(p){if(p.albumParam){albumParam=p.albumParam;}if(p.processingText){processingText=p.processingText;}if(p.deleteConfirmation){deleteConfirmation=p.deleteConfirmation;}if(p.deletePhotoConfirmation){deletePhotoConfirmation=p.deletePhotoConfirmation;}if(p.photosHolderId){photosHolder=WA.$(p.photosHolderId,window);}if(p.saveActionId){saveAction=WA.$(p.saveActionId,window);}if(p.titleTextBoxId){titleTextBox=WA.$(p.titleTextBoxId,window);}if(p.descriptionTextBoxId){descriptionTextBox=WA.$(p.descriptionTextBoxId,window);}if(p.saveButtonId){saveButton=WA.$(p.saveButtonId,window);}if(p.altSaveButtonId){altSaveButton=WA.$(p.altSaveButtonId,window);}if(p.saveLinkButtonId){saveLinkButton=WA.$(p.saveLinkButtonId,window);}if(p.deleteButtonId){deleteButton=WA.$(p.deleteButtonId,window);}if(p.cancelButtonId){cancelButton=WA.$(p.cancelButtonId,window);}if(p.uploadButtonId){uploadButton=WA.$(p.uploadButtonId,window);}if(p.uploadActionId){uploadAction=WA.$(p.uploadActionId,window);}if(p.viewModeRadioContainerId){viewModeRadioContainer=WA.$(p.viewModeRadioContainerId,window);}if(p.uploadButtonContainerId){uploadButtonContainer=WA.$(p.uploadButtonContainerId,window);}if(p.descriptionContainerId){descriptionContainer=WA.$(p.descriptionContainerId,window);}if(p.descriptionHeightUrlKey){descriptionHeightUrlKey=p.descriptionHeightUrlKey;}if(p.countPhotosPerRowUrlKey){countPhotosPerRowUrlKey=p.countPhotosPerRowUrlKey;}if(p.pagingUrlKey){pagingKey=p.pagingUrlKey;}}function initJsFunctions(){setDisplayInline(saveLinkButton);setDisplayInline(uploadButton);setDisplay(viewModeRadioContainer);setDisplay(uploadButtonContainer);}function pageParsed(){initJsFunctions();}function pageUnloading(){setDisabled(saveButton);setDisabled(uploadButton);setDisabled(deleteButton);if(saveLinkButton){setDisabled(saveLinkButton);setDisabled(altSaveButton);setDisabled(cancelButton);}}function setDisplay(element){if(element){element.style.display="";}}function setDisplayInline(element){if(element){element.style.display="inline";}}function setDisplayBlock(element){if(element){element.style.display="block";}}function setDisplayNone(element){if(element){element.style.display="none";}}function setDisabled(element){if(element){element.disabled=true;}}function closeSaveAlbumDialog(){PhotoAlbumsDialog.saveAlbumDialog.close();}function closeUploadPhotosDialog(){PhotoAlbumsDialog.uploadPhotosDialog.close();}function getSaveAction(){return saveAction;}function getSaveTitle(){return titleTextBox;}function getSaveDescription(){return descriptionTextBox;}function getSaveButton(){return saveButton;}function getDeleteButton(){return deleteButton;}function getUploadButton(){return uploadButton;}function getUploadAction(){return uploadAction;}function processingButtonClick(sender,otherIds){if(sender){sender.value=processingText;}
5565if(otherIds&&otherIds.length){for(var i=0;i<otherIds.length;i++){var btn=WA.$(otherIds[i],window);if(btn&&btn.id!=sender.id){btn.disabled=true;}}}return true;}function deleteButtonClick(sender,otherIds){if(confirm(deleteConfirmation)){return processingButtonClick(sender,otherIds);}return false;}function uploadButtonClick(){if(!uploadPhotosDialogInited){PhotoAlbumsDialog.uploadPhotosDialog.initialize({albumParam:albumParam});uploadPhotosDialogInited=true;}if(uploadAction.value=="1"){uploadAction.value="";if(uploadButton){uploadButton.value=processingText;}WA.reloadCurrentPage(pagingKey,window);return;}PhotoAlbumsDialog.uploadPhotosDialog.open(null,{"PhotoGallery":PhotoGallery});}function saveButtonClick(){if(!saveAlbumDialogInited){PhotoAlbumsDialog.saveAlbumDialog.initialize({albumParam:albumParam});saveAlbumDialogInited=true;}if(saveAction.value=="1"){saveAction.value="";if(saveButton){saveButton.value=processingText;}return true;}PhotoAlbumsDialog.saveAlbumDialog.open(null,{"PhotoGallery":PhotoGallery});return false;}function imageMenuMouseOver(sender,imageDivId,fullDescriptionDivId,smallDescriptionDivId){if(photoItemTimeout&&photoItemId==imageDivId){clearTimeout(photoItemTimeout);photoItemTimeout=false;return;}if(actionIsRunning){return;}sender.parentNode.style.height=sender.offsetHeight+"px";WA.$(imageDivId,window).className="photoAlbumItemThumbnailPhotoHover";sender.className="photoInnerContainerOver";sender.style.zIndex=sender.style.zIndex+1;var fullDescriptionDiv=WA.$(fullDescriptionDivId,window);setDisplayBlock(fullDescriptionDiv);setDisplayNone(WA.$(smallDescriptionDivId,window));if(photosHolder){photosHolderHeight=photosHolder.offsetHeight;if(!photosHolder.Y){WA.Dimensions.getXY(photosHolder);}if(!fullDescriptionDiv.Y){WA.Dimensions.getXY(fullDescriptionDiv);}var outHeigth=fullDescriptionDiv.Y+fullDescriptionDiv.offsetHeight-photosHolder.Y-photosHolderHeight;if(outHeigth>0){photosHolder.style.height=(photosHolderHeight+outHeigth+10)+"px";}}}function doImageMenuMouseOut(sender,imageDivId,fullDescriptionDivId,smallDescriptionDivId){WA.$(imageDivId,window).className="photoAlbumItemThumbnailPhoto";sender.className="photoInnerContainer";sender.style.zIndex=sender.style.zIndex-1;setDisplayNone(WA.$(fullDescriptionDivId,window));setDisplayBlock(WA.$(smallDescriptionDivId,window));if(photosHolderHeight&&photosHolder.offsetHeight>photosHolderHeight){photosHolder.style.height=photosHolderHeight+"px";}photoItemId=false;photoItemTimeout=false;}function imageMenuMouseOut(sender,imageDivId,fullDescriptionDivId,smallDescriptionDivId){if(actionIsRunning){if(!pendingSender){pendingSender=sender;pendingImageDivId=imageDivId;pendingFullDescriptionDivId=fullDescriptionDivId;pendingSmallDescriptionDivId=smallDescriptionDivId;}return;}if(photoItemTimeout&&photoItemId==imageDivId){return;}photoItemId=imageDivId;photoItemTimeout=setTimeout(function(){doImageMenuMouseOut(sender,imageDivId,fullDescriptionDivId,smallDescriptionDivId);},10);}function menuButtonMouseOver(sender){sender.className="overButton";}function menuButtonMouseOut(sender){sender.className="outButton";}function menuButtonClick(linkId,secondButtonId,processingContainerId,confirmVariableName){var linkobj=WA.$(linkId,window);if(linkobj){setDisplayNone(linkobj);var secondButton=WA.$(secondButtonId,window);var processingContainer=WA.$(processingContainerId,window);setDisplayNone(secondButton);setDisplayBlock(processingContainer);if(confirmVariableName){actionIsRunning=true;if(!confirm(eval(confirmVariableName))){actionIsRunning=false;setDisplayNone(processingContainer);setDisplay(secondButton);setDisplay(linkobj);if(pendingSender){imageMenuMouseOut(pendingSender,pendingImageDivId,pendingFullDescriptionDivId,pendingSmallDescriptionDivId);pendingSender=false;}return;}}actionIsRunning=false;eval(linkobj.href.substr(11).replace(/\%20/g," ").replace(/\%22/g,'"'));}}function navigateToList(url){var descriptionHeight=(descriptionContainer)?descriptionContainer.offsetHeight:0;var countPhotosPerRow=0;if(photosHolder){var y=0;var bulets=photosHolder.getElementsByTagName("LI");for(var i=0;i<bulets.length;i++){WA.Dimensions.getXY(bulets[i]);if(i==0){y=bulets[i].Y;}else{if(y<bulets[i].Y){countPhotosPerRow=i;break;}}}}if(descriptionHeightUrlKey&&countPhotosPerRowUrlKey){var index=url.indexOf("?",0);url=index==-1?url+"?":url+"&";url+=descriptionHeightUrlKey+"="+descriptionHeight+"&"+countPhotosPerRowUrlKey+"="+countPhotosPerRow;}window.location=url;}function checkLength(e,oObject,maxLength){if(oObject.value.length<maxLength){return true;}else{var keyID=(window.event)?event.keyCode:e.keyCode;if((keyID>=37&&keyID<=40)||(keyID==8)||(keyID==46)){if(window.event){e.returnValue=true;}}else{if(window.event){e.returnValue=false;}else{e.preventDefault();}}}}})();(function(window,WA){if(!WA){return;}if(!window.PhotoAlbumsDialog){window.PhotoAlbumsDialog={};}window.PhotoAlbumsDialog.saveAlbumDialog=new WA.topWindow.BonaDialogHandler({name:"PhotoAlbumsDialog_SaveAlbumDialog",dialogParameters:{clipContainerId:"idPrimaryContentContainer",mainContainerId:"idMainContainer",directURLTemplate:"/Content/Members/PhotoGallery/CreateAlbumDialog.aspx?frameMode=0{albumParam}&version="+WA.version,reloadURLTemplate:"/Content/Members/PhotoGallery/CreateAlbumDialog.aspx?frameMode=1{albumParam}&version="+WA.version,top:null,left:null,width:500,height:290,minWidth:500,minHeight:290,isMoveable:true,isResizeable:false,isModal:true,isScrollable:true,callBackParameters:{}}});})(window,window.WA);(function(window,WA){if(!WA){return;}if(!window.PhotoAlbumsDialog){window.PhotoAlbumsDialog={};}PhotoAlbumsDialog.uploadPhotosDialog=new WA.topWindow.BonaDialogHandler({name:"PhotoAlbumsDialog_UploadPhotosDialog",dialogParameters:{clipContainerId:"idClipMainContainer",mainContainerId:"contentDiv",directURLTemplate:"/Content/Members/PhotoGallery/UploadPhotosDialog.aspx?frameMode=0{albumParam}&version="+WA.version,reloadURLTemplate:"/Content/Pictures/PhotoGallery/UploadPhotosInnerDialog.aspx?version="+WA.version+"{albumParam}",top:null,left:null,width:430,height:355,minWidth:430,minHeight:355,isMoveable:true,isResizeable:false,isModal:true,isScrollable:false,callBackParameters:{}},onDialogClose:function(){if(PhotoGallery.Get_UploadAction().value=="1"){PhotoGallery.Get_UploadButton().click();}}});})(window,window.WA);jq$(function(){if(jq$(".WaGadgetContactProfileStatePhotoGallery .editCaptionTextBox").size()){$("body").animate({scrollTop:$(".WaGadgetContactProfileStatePhotoGallery .editCaptionTextBox").offset().top},0);}});jq$(function(){jq$('.WaGadgetContactProfileStatePhotoGallery .pageBackContainer a:contains("All album photos")').html("All album photos");jq$('.WaGadgetContactProfileStatePhotoGallery .linkContainer a:contains("Previous"), .WaGadgetContactProfileStatePhotoGallery .linkContainer span:contains("Previous")').html("Previous");jq$('.WaGadgetContactProfileStatePhotoGallery .linkContainer a:contains("Next"), .WaGadgetContactProfileStatePhotoGallery .linkContainer span:contains("Next")').html("Next");});(function(){if(window.Wizard==null){window.Wizard=new Object();}Wizard.SetRadioChosen=SetRadioChosen;Wizard.SetMethosRadioChosen=SetMethosRadioChosen;Wizard.SetMethodValidate=SetMethodValidate;Wizard.SetCreditCardIsChosen=SetCreditCardIsChosen;
5565Wizard.GetCreditCardIsChosen=GetCreditCardIsChosen;Wizard.ValidateIsRadioChosen=ValidateIsRadioChosen;Wizard.ValidateIsMethodRadioChosen=ValidateIsMethodRadioChosen;Wizard.SetRadioValidatorsIds=SetRadioValidatorsIds;Wizard.DisableButtons=DisableButtonsWithTimeout;Wizard.NavigateToCreditCard=NavigateToCreditCard;Wizard.SetContainerVisibility=SetContainerVisibility;Wizard.StopWatching=StopWatching;Wizard.ShowAdminCancelDialog=ShowAdminCancelDialog;Wizard.SubstituteFormTargetIfReq=SubstituteFormTargetIfReq;var isRadioChosen=false;var isMethodRadioChosen=false;var isMethodValidate=false;var isCreditCardChosen=false;var radioValidatorId=false;var radioMethodValidatorId=false;function SetRadioChosen(){isRadioChosen=true;if(radioValidatorId){ValidatorValidate(document.getElementById(radioValidatorId));}else{Page_ClientValidate("WizardValidationGroup");}if(radioMethodValidatorId){ValidatorValidate(document.getElementById(radioMethodValidatorId));}}function SetMethosRadioChosen(){isMethodRadioChosen=true;if(radioValidatorId){ValidatorValidate(document.getElementById(radioValidatorId));}if(radioMethodValidatorId){ValidatorValidate(document.getElementById(radioMethodValidatorId));}}function validateRados(){}function SetMethodValidate(isValidate){isMethodValidate=isValidate;}function SetCreditCardIsChosen(isChosen){isCreditCardChosen=isChosen;}function GetCreditCardIsChosen(){return isCreditCardChosen;}function ValidateIsRadioChosen(sender,args){args.IsValid=isRadioChosen;}function ValidateIsMethodRadioChosen(sender,args){args.IsValid=!isMethodValidate||isMethodRadioChosen;}function SetRadioValidatorsIds(radioValidatorClientId,radioMethodValidatorClientId){radioValidatorId=radioValidatorClientId;radioMethodValidatorId=radioMethodValidatorClientId;}function DisableButtonsWithTimeout(){if(typeof(Page_ValidationActive)!="undefined"&&Page_ValidationActive&&Page_IsValid==false){return;}var ids=arguments;setTimeout(function(){DisableButtons(ids);},50);}function NavigateToCreditCard(url){document.body.style.display="none";WA.topWindow.location=url;}function DisableButtons(ids){if(!ids){return;}for(i=0;i<ids.length;i++){var elemToDisable=document.getElementById(ids[i]);if(elemToDisable){elemToDisable.disabled=true;}}}function SetContainerVisibility(containerId,visible){var container=document.getElementById(containerId);if(!container){return;}container.style.display=visible?"block":"none";}function StopWatching(){if(window.DataChangeWatcher){DataChangeWatcher.pauseWatching();}if(window.Page_ClientValidate){Page_ClientValidate("WizardValidationGroup");}var resumeWatching=false;if(window.Page_IsValid){resumeWatching=!Page_IsValid;}if(window.DataChangeWatcher&&resumeWatching){DataChangeWatcher.resumeWatching();}}function ShowAdminCancelDialog(text){if(!confirm(text)){return false;}return true;}function SubstituteFormTargetIfReq(){var planRadiosContainer=document.getElementById("idPlansContainer");var selectedPlanId=getSelectedRadioAttrVal(planRadiosContainer.getElementsByTagName("INPUT"),"planId");var selectedSubscriptionPeriod=getSelectedSubscriptionPeriod();if(selectedPlanId==0||selectedPlanId==null){return;}var shouldSubstituteTarget=false;var wasFreePlanChoosen=selectedPlanId==freePlanId;var payOutstandingBalanceNowRadio=document.getElementById(payOutstandingBalanceNowId);var newCreditCardRadio=document.getElementById(newCreditCardRadioId);var shouldPayOutstandingAmountNow=wasFreePlanChoosen&&isAccountOverdue&&payOutstandingBalanceNowRadio&&payOutstandingBalanceNowRadio.checked;var isSelectedPeriodAnnualInvoice=selectedSubscriptionPeriod==3;if(isSelectedPeriodAnnualInvoice){shouldSubstituteTarget=false;}else{if(!isCurrentPlanChargeable){shouldSubstituteTarget=true;}else{var shouldEnterNewCard=wasFreePlanChoosen?shouldPayOutstandingAmountNow:(newCreditCardRadio&&newCreditCardRadio.checked)||isBillingInfoEmpty;shouldSubstituteTarget=shouldEnterNewCard;}}if(shouldSubstituteTarget){document.getElementById(formClientId).target="_top";}}function getSelectedSubscriptionPeriod(){var selectedMethodId=0;var paymentMethodRadiosContainer=document.getElementById("idPaymentMethodsContainer");if(paymentMethodRadiosContainer){var paymentMethodRadios=paymentMethodRadiosContainer.getElementsByTagName("INPUT");selectedMethodId=getSelectedRadioAttrVal(paymentMethodRadiosContainer.getElementsByTagName("INPUT"),"methodId");}return selectedMethodId;}function getSelectedRadioAttrVal(radios,attrName){for(var i=0;i<radios.length;i++){if(radios[i].checked){return radios[i].getAttribute(attrName);}}}})();(function(){if(!window.MemberPublicProfilePhotoGallery){window.MemberPublicProfilePhotoGallery={};}var albumParam="";var processingText="Please wait...";var deleteConfirmation="Are you sure you want to delete?";var deletePhotoConfirmation="Are you sure you want to delete this photo?";var saveAction=false;var photosHolder=false;
5565var photosHolderHeight=false;var titleTextBox=false;var descriptionTextBox=false;var saveButton=false;var altSaveButton=false;var saveLinkButton=false;var deleteButton=false;var cancelButton=false;var uploadButton=false;var uploadAction=false;var viewModeRadioContainer=false;var uploadButtonContainer=false;var descriptionContainer=false;var descriptionHeightUrlKey=false;var countPhotosPerRowUrlKey=false;var pagingKey=false;var saveAlbumDialogInited=false;var uploadPhotosDialogInited=false;var photoItemId=false;var photoItemTimeout=false;var actionIsRunning=false;var pendingSender=false;var pendingImageDivId=false;var pendingFullDescriptionDivId=false;var pendingSmallDescriptionDivId=false;MemberPublicProfilePhotoGallery.InitPhotoGallery=initPhotoGallery;MemberPublicProfilePhotoGallery.ImageMenu_OnMouseOver=imageMenuMouseOver;MemberPublicProfilePhotoGallery.ImageMenu_OnMouseOut=imageMenuMouseOut;MemberPublicProfilePhotoGallery.NavigateToList=navigateToList;MemberPublicProfilePhotoGallery.CheckLength=checkLength;function initPhotoGallery(p){if(p.albumParam){albumParam=p.albumParam;}if(p.processingText){processingText=p.processingText;}if(p.deleteConfirmation){deleteConfirmation=p.deleteConfirmation;}if(p.deletePhotoConfirmation){deletePhotoConfirmation=p.deletePhotoConfirmation;}if(p.photosHolderId){photosHolder=WA.$(p.photosHolderId,window);}if(p.saveActionId){saveAction=WA.$(p.saveActionId,window);}if(p.titleTextBoxId){titleTextBox=WA.$(p.titleTextBoxId,window);}if(p.descriptionTextBoxId){descriptionTextBox=WA.$(p.descriptionTextBoxId,window);}if(p.saveButtonId){saveButton=WA.$(p.saveButtonId,window);}if(p.altSaveButtonId){altSaveButton=WA.$(p.altSaveButtonId,window);}if(p.saveLinkButtonId){saveLinkButton=WA.$(p.saveLinkButtonId,window);}if(p.deleteButtonId){deleteButton=WA.$(p.deleteButtonId,window);}if(p.cancelButtonId){cancelButton=WA.$(p.cancelButtonId,window);}if(p.uploadButtonId){uploadButton=WA.$(p.uploadButtonId,window);}if(p.uploadActionId){uploadAction=WA.$(p.uploadActionId,window);}if(p.viewModeRadioContainerId){viewModeRadioContainer=WA.$(p.viewModeRadioContainerId,window);}if(p.uploadButtonContainerId){uploadButtonContainer=WA.$(p.uploadButtonContainerId,window);}if(p.descriptionContainerId){descriptionContainer=WA.$(p.descriptionContainerId,window);}if(p.descriptionHeightUrlKey){descriptionHeightUrlKey=p.descriptionHeightUrlKey;}if(p.countPhotosPerRowUrlKey){countPhotosPerRowUrlKey=p.countPhotosPerRowUrlKey;}if(p.pagingUrlKey){pagingKey=p.pagingUrlKey;}}function setDisplay(element){if(element){element.style.display="";}}function setDisplayInline(element){if(element){element.style.display="inline";}}function setDisplayBlock(element){if(element){element.style.display="block";}}function setDisplayNone(element){if(element){element.style.display="none";}}function setDisabled(element){if(element){element.disabled=true;}}function imageMenuMouseOver(sender,imageDivId,fullDescriptionDivId,smallDescriptionDivId){if(photoItemTimeout&&photoItemId==imageDivId){clearTimeout(photoItemTimeout);photoItemTimeout=false;return;}if(actionIsRunning){return;}sender.parentNode.style.height=sender.offsetHeight+"px";WA.$(imageDivId,window).className="photoAlbumItemThumbnailPhotoHover";sender.className="photoInnerContainerOver";sender.style.zIndex=sender.style.zIndex+1;var fullDescriptionDiv=WA.$(fullDescriptionDivId,window);setDisplayBlock(fullDescriptionDiv);setDisplayNone(WA.$(smallDescriptionDivId,window));if(photosHolder){photosHolderHeight=photosHolder.offsetHeight;if(!photosHolder.Y){WA.Dimensions.getXY(photosHolder);}if(!fullDescriptionDiv.Y){WA.Dimensions.getXY(fullDescriptionDiv);}var outHeigth=fullDescriptionDiv.Y+fullDescriptionDiv.offsetHeight-photosHolder.Y-photosHolderHeight;if(outHeigth>0){photosHolder.style.height=(photosHolderHeight+outHeigth+10)+"px";}}}function doImageMenuMouseOut(sender,imageDivId,fullDescriptionDivId,smallDescriptionDivId){WA.$(imageDivId,window).className="photoAlbumItemThumbnailPhoto";sender.className="photoInnerContainer";sender.style.zIndex=sender.style.zIndex-1;setDisplayNone(WA.$(fullDescriptionDivId,window));setDisplayBlock(WA.$(smallDescriptionDivId,window));
5565if(photosHolderHeight&&photosHolder.offsetHeight>photosHolderHeight){photosHolder.style.height=photosHolderHeight+"px";}photoItemId=false;photoItemTimeout=false;}function imageMenuMouseOut(sender,imageDivId,fullDescriptionDivId,smallDescriptionDivId){if(actionIsRunning){if(!pendingSender){pendingSender=sender;pendingImageDivId=imageDivId;pendingFullDescriptionDivId=fullDescriptionDivId;pendingSmallDescriptionDivId=smallDescriptionDivId;}return;}if(photoItemTimeout&&photoItemId==imageDivId){return;}photoItemId=imageDivId;photoItemTimeout=setTimeout(function(){doImageMenuMouseOut(sender,imageDivId,fullDescriptionDivId,smallDescriptionDivId);},10);}function navigateToList(url){var descriptionHeight=(descriptionContainer)?descriptionContainer.offsetHeight:0;var countPhotosPerRow=0;if(photosHolder){var y=0;var bulets=photosHolder.getElementsByTagName("LI");for(var i=0;i<bulets.length;i++){WA.Dimensions.getXY(bulets[i]);if(i==0){y=bulets[i].Y;}else{if(y<bulets[i].Y){countPhotosPerRow=i;break;}}}}if(descriptionHeightUrlKey&&countPhotosPerRowUrlKey){var index=url.indexOf("?",0);url=index==-1?url+"?":url+"&";url+=descriptionHeightUrlKey+"="+descriptionHeight+"&"+countPhotosPerRowUrlKey+"="+countPhotosPerRow;}window.location=url;}function checkLength(e,oObject,maxLength){if(oObject.value.length<maxLength){return true;}else{var keyID=(window.event)?event.keyCode:e.keyCode;if((keyID>=37&&keyID<=40)||(keyID==8)||(keyID==46)){if(window.event){e.returnValue=true;}}else{if(window.event){e.returnValue=false;}else{e.preventDefault();}}}}})();(function(window,WA,undefined){if(!window.WaOnlineStoreCart){window.WaOnlineStoreCart=OnlineStoreCart;}function OnlineStoreCart(){var service=new WaOnlineStoreCartService(),self=this;self.add=add;self.get=get;self.load=load;self.remove=remove;self.setQuantity=setQuantity;self.getService=getService;function add(productId,variantId,quantity){return service.addProduct(productId,variantId,quantity);}function getService(){return service;}function get(productId,variantId){return service.getProduct(productId,variantId);}function load(){return service.loadCurrent();}function remove(productId,variantId){return service.removeProduct(productId,variantId);}function setQuantity(productId,variantId,quantity){return service.setQuantity(productId,variantId,quantity);}}var instance;OnlineStoreCart.getInstance=function(){return instance||(instance=new OnlineStoreCart());};OnlineStoreCart.load=function(initModel){var cart=this.getInstance(initModel);return cart.load();};})(window,window.WA);(function(window,WA,undefined){if(!window.WaOnlineStoreCartGateway){window.WaOnlineStoreCartGateway=OnlineStoreCartGateway;}function OnlineStoreCartGateway(){var self=this;self.addProduct=addProduct;self.loadCurrent=loadCurrent;self.recalculateCurrent=recalculateCurrent;function addProduct(model){return WA.Ajax({contentType:"application/json; charset=utf-8",data:JSON.stringify(model),dataType:"json",processData:false,type:"POST",url:"/Sys/Store/Cart/Add"});}function loadCurrent(){return WA.Ajax({dataType:"json",type:"GET",url:"/Sys/Store/Cart/Current"});}function transformCartModel(oldCartModel){var newCart=jq$.extend(true,{},oldCartModel);jq$.each(newCart.items,function(i,item){delete item.price;delete item.title;delete item.total;delete item.pictureUrl;});delete newCart.total;return newCart;}function recalculateCurrent(model,deliveryOptionId){var url="/Sys/Store/Cart/RecalculateCart";if(deliveryOptionId){url=url+"?deliveryOptionId="+deliveryOptionId;}return WA.Ajax({contentType:"application/json; charset=utf-8",data:JSON.stringify(transformCartModel(model)),dataType:"json",processData:false,type:"POST",url:url});}}})(window,window.WA);(function(window,WA,undefined){if(!window.WaOnlineStoreCartLayout){window.WaOnlineStoreCartLayout=OnlineStoreCartLayout;}function OnlineStoreCartLayout(service,initModel){var container=document.getElementById("cartLayout"),self=this;var productDetailsUrl="/Sys/ProductDetails",currencySymbol="$",currency="USD";self.render=render;self.onError=onError;var isSaveFailed=null;var isDisabled=null;var checkoutURL="/Sys/Store/Checkout";init();resetViewStates();
5565function init(){jq$(container).on("input",".storeCartTable_tdQuantity input",onProductQuantityInput);jq$(container).on("click",".storeCartTable_deleteButton",onProductDelete);jq$(container).on("click",".quantitySnippet .quantity-button",onProductQuantityUpDown);jq$(container).on("click",".storeCartControlNav__back",onBackToShopping);jq$(container).on("click",".toCheckout",onCheckout);service.savingStart=onSavingStart;}function onBackToShopping(){window.history.go(-1);return false;}function onCheckout(){window.location.href=checkoutURL;}function resetViewStates(){isSaveFailed=false;isDisabled=false;}function render(model){container.innerHTML=model.items&&model.items.length>0?renderTable(model):renderEmpty();}function renderEmpty(){var html=[];if(isSaveFailed){html.push(renderGeneralError());}html.push('<div class="emptyCartContainer">');html.push('<div class="emptyCartIcon2"></div>');html.push('<p class="emptyCartMessage">Your cart is empty.</p>');html.push("</div>");return html.join("");}function renderTable(model){var html=[];if(isSaveFailed){html.push(renderGeneralError());}html.push('<table class="storeCartTable">');html.push(renderItems(model.items));html.push(renderTotal(model));html.push("</table>");html.push(renderControlNav());return html.join("");}function renderItems(items){var html=[],i,length=items.length;for(i=0;i<length;i++){html.push(renderItem(items[i]));}return html.join("");}function renderItem(item){var html=[];html.push('<tr class="storeCartTable_row" data-product-id="',item.productId,'" data-variant-id="',item.variantId,'">');html.push('<td class="storeCartTable_tdImage">',renderImage(item),"</td>");html.push('<td class="storeCartTable_tdTitle">');html.push('<a href="',getItemUrl(item.productId,item.variantId),'">',BonaPage.encodeHtml(item.title),"</a>");html.push(renderOptions(item));html.push("</td>");html.push('<td class="storeCartTable_tdPprice">',renderPrice(item.price),"</td>");html.push('<td class="storeCartTable_tdQuantity">');html.push('<div class="quantitySnippet">');if(item.productType==="DIGITAL"||item.productType==="ECOURSE"){html.push('<span class="typeNumber">'+item.quantity+"</span>");}else{html.push("<input ",(isDisabled&&'disabled="disabled"'),' class="typeNumber" min="1" size="2" type="number" value="',item.quantity,'">');html.push('<div class="quantity-button quantity-down">&nbsp;</div><div class="quantity-button quantity-up">&nbsp;</div>');}html.push("</div>");html.push("</td>");html.push('<td class="storeCartTable_tdAmount">',renderPrice(item.total),"</td>");html.push('<td class="storeCartTable_tdDelete">');html.push('<button title="Remove item" class="storeCartTable_deleteButton"></button>');html.push("</td>");html.push("</tr>");return html.join("");}function renderOption(option){return'<div class="storeCartTable_itemOption">'+BonaPage.encodeHtml(option.title)+": "+BonaPage.encodeHtml(option.value)+"</div>";}function renderOptions(item){if(!item.options){return"";}return jq$.map(item.options,function(option,i){return renderOption(option);}).join("");}function renderImage(item){var html=[];if(item.pictureUrl){html.push('<a class="storeCartTable_img" href="',getItemUrl(item.productId,item.variantId),'">');html.push('<img src="',item.pictureUrl,'" width="100"/></a>');}else{html.push('<div class="storeCartTable_img storeCartTable_no_img" title="No photo"></div>');}return html.join("");}function getItemUrl(productId,variantId){return initModel.productDetailsUrl+"/"+productId;}function renderPrice(price){if(initModel.currencySymbol){return'<span class="priceContainer">'+initModel.currencySymbol+price.toFixed(2)+"</span>";}else{return'<span class="priceContainer">'+price.toFixed(2)+" "+initModel.currency+"</span>";}}function renderTotal(model){var html=[];var total=model.total;var subTotal=model.subTotal;var isTaxesApplied=model.isTaxesApplied||false;var isTaxesIncludedTotal=model.isTaxesIncludedTotal||false;var taxes=model.taxes||[];if(initModel.taxesEnable&&isTaxesApplied&&!isTaxesIncludedTotal){html.push('<tr class="storeCartSubTotalInfoRowFirst">');html.push('<td colspan="4" class="storeCartTable_totalLabel">Subtotal:</td>');if(initModel.currencySymbol){html.push('<td class="storeCartTable_totalValue">',initModel.currencySymbol,subTotal.toFixed(2),"</td>");}else{html.push('<td class="storeCartTable_totalValue">',subTotal.toFixed(2)," ",initModel.currency,"</td>");}html.push('<td class="storeCartTable_totalValue"></td>');html.push("</tr>");html.push(renderTaxes(taxes,isTaxesIncludedTotal));}if(total||total===0){if(!isTaxesIncludedTotal){html.push('<tr class="storeCartTotal storeCartTotalInfoRow">');}else{html.push('<tr class="storeCartTotal storeCartTotalInfoRowFirst">');}html.push('<td colspan="4" class="storeCartTable_totalLabel">Total:</td>');if(initModel.currencySymbol){html.push('<td class="storeCartTable_totalValue">',initModel.currencySymbol,total.toFixed(2),"</td>");}else{html.push('<td class="storeCartTable_totalValue">',total.toFixed(2)," ",initModel.currency,"</td>");}html.push('<td class="storeCartTable_totalValue"></td>');html.push("</tr>");}if(initModel.taxesEnable&&isTaxesApplied&&isTaxesIncludedTotal){html.push(renderTaxes(taxes,isTaxesIncludedTotal));}return html.join("");}function renderTaxes(taxes,isTaxesIncludedTotal){var html=[];for(var taxIndex in taxes){var tax=taxes[taxIndex];var taxLabel=tax.title+":";if(isTaxesIncludedTotal){taxLabel="Incl."+tax.title+":";}html.push('<tr class="storeCartTotalInfoRow">');html.push('<td colspan="4" class="storeCartTable_totalLabel">',taxLabel,"</td>");if(initModel.currencySymbol){html.push('<td class="storeCartTable_totalValue">',initModel.currencySymbol,tax.amount.toFixed(2),"</td>");}else{html.push('<td class="storeCartTable_totalValue">',tax.amount.toFixed(2)," ",initModel.currency,"</td>");}html.push('<td class="storeCartTable_totalValue"></td>');html.push("</tr>");}return html.join("");}function renderControlNav(){var html=[];html.push('<div class="storeCartControlNav">');html.push('<div class="storeCartControlNav_left">');html.push('<a href="#" class="storeCartControlNav__back">Continue shopping</a>');html.push("</div>");html.push('<div class="storeCartControlNav_right">');html.push("<input ",(isDisabled&&'disabled="disabled"'),' type="button" name="continue" value="Proceed to checkout" class="functionalButton toCheckout">');html.push("</div>");html.push("</div>");return html.join("");}function renderGeneralError(){var html=[];html.push('<div class="noticeBox boxTypeError">');html.push('<div class="text">');html.push("Cannot complete operation. Please try again later or contact administrator");html.push("</div>");html.push("</div>");return html.join("");}function onError(cart){isSaveFailed=true;render(cart);resetViewStates();}function onSaved(cart){render(cart);resetViewStates();}function onSavingStart(cart){isDisabled=true;render(cart);resetViewStates();}function onProductDelete(){if(isDisabled){return;}var sender=jq$(this),productId=sender.closest(".storeCartTable_row").data("productId"),variantId=sender.closest(".storeCartTable_row").data("variantId");service.removeProduct(productId,variantId).done(onSaved).fail(onError);}function onProductQuantityInput(){var sender=jq$(this),productId=sender.closest(".storeCartTable_row").data("productId"),variantId=sender.closest(".storeCartTable_row").data("variantId"),quantity=+sender.val(),min=+sender.attr("min");
5565if(quantity<=min){quantity=min;}service.setQuantity(productId,variantId,quantity).done(onSaved).fail(onError);}function onProductQuantityUpDown(){var sender=jq$(this),input=sender.closest(".quantitySnippet").find("input"),value=+input.val();value+=sender.hasClass("quantity-up")?1:-1;input.val(value).trigger("input");}}})(window,window.WA);(function(window,WA,undefined){if(!window.WaOnlineStoreCartService){window.WaOnlineStoreCartService=OnlineStoreCartService;}function OnlineStoreCartService(){var cache={},cacheKey={cart:"OnlineStoreCart"},defaultSaveDelay=400,delayedSave,delayedSaveTimerId,gateway=new WaOnlineStoreCartGateway(),self=this;self.addProduct=addProduct;self.getProduct=getProduct;self.loadCurrent=loadCurrent;self.removeProduct=removeProduct;self.setQuantity=setQuantity;self.savingStart=null;self.savingCompleted=null;self.resetCart=resetCart;self.localLoad=localLoad;self.saveWithDelay=saveWithDelay;self.saveInCache=saveInCache;cache.get=function(key){var serialized=WA.Storage.read(key);if(typeof serialized!=="string"){return undefined;}try{return JSON.parse(serialized);}catch(e){console.log(e);return serialized||undefined;}};cache.remove=function(key){WA.Storage.del(key);};cache.set=function(key,value){var serialized=JSON.stringify(value);try{WA.Storage.write(key,serialized);}catch(e){console.log(e);}};function onSavingStart(cart){if(typeof self.savingStart==="function"){self.savingStart(cart);}}function onSavingCompleted(cart){if(typeof self.savingCompleted==="function"){self.savingCompleted(cart);}}function resetCart(){cache.remove(cacheKey.cart);}function addProduct(productId,variantId,quantity){var cart=cache.get(cacheKey.cart),cartItems,i,productNotFound=true;variantId=variantId||undefined;quantity=validateQuantity(quantity,1);if(cart){cartItems=cart.items;for(i=0,productNotFound=true;i<cartItems.length;i++){if(cartItems[i].productId===productId&&cartItems[i].variantId==variantId){cartItems[i].quantity+=quantity;productNotFound=false;break;}}if(productNotFound){cartItems.push({productId:productId,variantId:variantId,quantity:quantity});}return gateway.recalculateCurrent(cart).done(saveInCache);}return gateway.addProduct({productId:productId,variantId:variantId,quantity:quantity}).done(saveInCache);}function getProduct(productId,variantId){var cart=cache.get(cacheKey.cart),cartItems,i;variantId=variantId||undefined;if(cart){cartItems=cart.items;for(i=0;i<cartItems.length;i++){if(cartItems[i].productId===productId&&cartItems[i].variantId==variantId){return cartItems[i];}}}return null;}function localLoad(){var cart=cache.get(cacheKey.cart);return cart;}function loadCurrent(deliveryOptionId){var cart=cache.get(cacheKey.cart);if(cart){return gateway.recalculateCurrent(cart,deliveryOptionId).done(saveInCache);}return gateway.loadCurrent().done(saveInCache);}function removeProduct(productId,variantId){var cart=cache.get(cacheKey.cart),cartItems,i;variantId=variantId||undefined;cartItems=cart.items;for(i=cartItems.length-1;i>=0;i--){if(cartItems[i].productId===productId&&cartItems[i].variantId==variantId){cartItems.splice(i,1);break;}}return saveWithDelay(cart);}function setQuantity(productId,variantId,quantity){var cart=cache.get(cacheKey.cart),cartItems,i;variantId=variantId||undefined;cartItems=cart.items;quantity=validateQuantity(quantity,0);for(i=0;i<cartItems.length;i++){if(cartItems[i].productId===productId&&cartItems[i].variantId==variantId){cartItems[i].quantity=quantity;break;}}return saveWithDelay(cart);}function save(cart){return gateway.recalculateCurrent(cart);}function saveInCache(cart){onSavingCompleted(cart);cache.set(cacheKey.cart,cart);}function saveWithDelay(cart,delay){var deferred;if(delayedSave&&delayedSave.state()==="pending"){deferred=jq$.Deferred();}else{deferred=delayedSave=jq$.Deferred().done(saveInCache);}clearTimeout(delayedSaveTimerId);delayedSaveTimerId=setTimeout(function(){onSavingStart(cart);save(cart).done(function(cart){delayedSave.resolve(cart);}).fail(function(error){delayedSave.reject(cache.get(cacheKey.cart),error);});},delay||defaultSaveDelay);return deferred;}function validateQuantity(quantity,quantityMinimum){quantity=+quantity;return quantity<quantityMinimum||isNaN(quantity)?quantityMinimum:quantity;}}})(window,window.WA);(function(window,WA,undefined){if(!window.InventoryIssuesHelper){window.InventoryIssuesHelper=new InventoryIssuesHelper();}function InventoryIssuesHelper(){this.hasInventoryIssues=hasInventoryIssues;this.getInventoryIssue=getInventoryIssue;function hasInventoryIssues(item,issues){return getInventoryIssue(item,issues)!=null;}function getInventoryIssue(item,issues){var _issues=$.grep(issues,function(obj){return(obj.productId===item.productId&&obj.variantId===item.variantId);});return _issues.length>0?_issues[0]:null;}}})(window,window.WA);(function(window,WA,undefined){if(!window.InventoryIssuesStepTableRenderer){window.InventoryIssuesStepTableRenderer=InventoryIssuesStepTableRenderer;}function InventoryIssuesStepTableRenderer(){this.render=render;function render(model){return confirmationRenderTable(model);}function confirmationRenderTable(model){var html=[];html.push('<table class="storeCartTable">');html.push(confirmationRenderItems(model.items,model.issues));html.push("</table>");return html.join("");}function confirmationRenderItems(items,issues){var html=[],i,length=items.length;for(i=0;i<length;i++){if(InventoryIssuesHelper.hasInventoryIssues(items[i],issues)){html.push(confirmationRenderItem(items[i],issues));}}return html.join("");}function confirmationRenderItem(item,issues){var html=[];html.push('<tr class="storeCartTable_row',item.isDeleted?" storeCartTable_rowDeleted":"",'">');html.push('<td class="storeCartTable_tdImage">',renderImage(item),"</td>");html.push('<td class="storeCartTable_tdTitle">');html.push('<div class="storeCartTable_itemTitle">',item.title,"</div>");html.push(renderOptions(item));html.push("</td>");html.push('<td class="storeCartTable_tdInventoryIssue" align="right">',renderInventoryIssues(item,issues),"</td>");html.push('<td class="storeCartTable_tdDelete">');if(!item.isDeleted){html.push('<button title="Remove item" class="storeCartTable_deleteButton" item-productId="',item.productId,'" item-variantId="',item.variantId,'"></button>');}html.push("</td>");html.push("</tr>");return html.join("");}function renderOptions(item){if(!item.options){return"";}return jq$.map(item.options,function(option,i){return renderOption(option);}).join("");}function renderOption(option){return'<div class="storeCartTable_itemOption">'+BonaPage.encodeHtml(option.title)+": "+BonaPage.encodeHtml(option.value)+"</div>";}function renderImage(item){var html=[];
5565if(item.pictureUrl){html.push('<img src="',item.pictureUrl,'" width="100"/>');}else{html.push('<div class="storeCartTable_img storeCartTable_no_img" title="No photo"></div>');}return html.join("");}function renderInventoryIssues(item,issues){if(item.isDeleted){return"<div>Deleted</div>";}var html=[];var issue=$.grep(issues,function(obj){return(obj.productId===item.productId&&obj.variantId===item.variantId);})[0];switch(issue.type){case"NOTENOUGH":html.push('<div class="storeCartTable_itemInventoryIssue_notEnough">'+issue.quantity+" -> only "+issue.stock+" left</div>");break;case"OUTOFSTOCK":html.push('<div class="storeCartTable_itemInventoryIssue_outOfStock">Out of stock</div>');break;default:throw ({"message":"Invalid issue type","productId":item.productId,"variantId":item.variantId});}return html.join("");}}})(window,window.WA);(function(window,WA,undefined){if(!window.WaOnlineStoreCheckout){window.WaOnlineStoreCheckout=OnlineStoreCheckout;}var SHIPPING="SHIPPING",PICKUP="PICKUP";var DELIVERY_OPTION_TYPES={};DELIVERY_OPTION_TYPES[SHIPPING]=SHIPPING;DELIVERY_OPTION_TYPES[PICKUP]=PICKUP;window.WaOnlineStoreCheckout.SHIPPING=SHIPPING;window.WaOnlineStoreCheckout.PICKUP=PICKUP;window.WaOnlineStoreCheckout.DELIVERY_OPTION_TYPES=DELIVERY_OPTION_TYPES;function OnlineStoreCheckout(){var serviceCart=WaOnlineStoreCart.getInstance().getService(),serviceCheckout=new WaOnlineStoreCheckoutService(serviceCart),self=this;self.getService=getService;function getService(){return serviceCheckout;}}var instance;OnlineStoreCheckout.getInstance=function(){return instance||(instance=new OnlineStoreCheckout());};OnlineStoreCheckout.load=function(){return WaOnlineStoreCart.getInstance().load();};})(window,window.WA);(function(window,WA,undefined){if(!window.WaOnlineStoreCheckoutGateway){window.WaOnlineStoreCheckoutGateway=OnlineStoreCheckoutGateway;}function OnlineStoreCheckoutGateway(){var self=this;self.invoiceMe=invoiceMe;self.payOnline=payOnline;self.bankTransfer=bankTransfer;self.freeOrder=freeOrder;self.checkEmail=checkEmail;function payRequest(url,model){return WA.Ajax({contentType:"application/json; charset=utf-8",data:JSON.stringify(model),dataType:"json",processData:false,type:"POST",url:url});}function invoiceMe(model){return payRequest("/Sys/Store/Checkout/InvoiceMe",model);}function payOnline(model){return payRequest("/Sys/Store/Checkout/PayOnline",model);}function bankTransfer(model){return payRequest("/Sys/Store/Checkout/BankTransfer",model);}function freeOrder(model){return payRequest("/Sys/Store/Checkout/FreeOrder",model);}function checkEmail(model){return WA.Ajax({contentType:"application/json; charset=utf-8",data:JSON.stringify(model),dataType:"json",processData:false,type:"POST",url:"/Sys/Store/Checkout/CheckEmail"});}}})(window,window.WA);(function(window,WA,undefined){if(!window.WaOnlineStoreCheckoutLayout){window.WaOnlineStoreCheckoutLayout=OnlineStoreCheckoutLayout;}function OnlineStoreCheckoutLayout(serviceCheckout,serviceCart,opts){var self=this,isAuthorized=opts.isAuthorized,initModel=opts.initModel,checkEmptyCart=opts.checkEmptyCart,checkCartIssues=opts.checkCartIssues,step1,step2,step3,inventoryIssuesStep,wizard,checkoutContentContainer=jq$("#OnlineStoreCheckout_content_container"),wizardContainer=document.getElementById("idCheckoutWizardContainer"),deliveryEnable=initModel.deliveryEnable,deliveryOptions=initModel.deliveryOptions;if(!initModel){throw (new Error("Not define initModel in layout opts"));}if(!checkEmptyCart){throw (new Error("Not define checkEmptyCart in layout opts"));}if(!wizardContainer){return;}self.render=render;self.showContainer=showContainer;init();function init(){jq$(wizardContainer).on("click",".wizardBackButton",onPressWizardBackButton);jq$(wizardContainer).on("click",".wizardNextButton",onPressWizardNextButton);jq$(wizardContainer).on("showStep",onShowWizardStep);step1=new WaOnlineStoreCheckoutLayoutStep1(serviceCheckout,isAuthorized);step2=new WaOnlineStoreCheckoutLayoutStep2(serviceCheckout,initModel);step3=new WaOnlineStoreCheckoutLayoutStep3(serviceCheckout,initModel);step3.onOrderCreateFailed(onOrderCreateFailed);inventoryIssuesStep=new OnlineStoreCheckoutLayoutInventoryIssuesStep(serviceCheckout,serviceCart);inventoryIssuesStep.onUpdateAndContinueClick(onUpdateAndContinueClick);wizard=new WaBasicWizard({element:wizardContainer,stepsBarContainer:"h1.stepsContainer",selected:0,showStepURLhash:true});if(isDisableDelivery()){jq$(".stepsContainer").addClass("stepsContainer_withoutDelivery");}}function showContainer(){checkoutContentContainer.show();}function render(){step1.render();step2.render();step3.render();inventoryIssuesStep.render();checkCartHasIssues();}function onSuccessCheckEmail(model){if(model.IsEmailExists===null||!model.IsEmailExists){step1.saveContactModel().done(function(){step1.deactivatePreload();if(isSkipDeliveryStep()){wizard.next();}wizard.next();}).fail(function(){step1.deactivatePreload();step1.checkEmailFailedRender();});}else{step1.deactivatePreload();step1.emailExistErrorRender();return;}}function onFailureCheckEmail(error){console.log(error.message||"check email: Fail");step1.deactivatePreload();step1.checkEmailFailedRender();wizard.next();}function isDisableDelivery(){var card=serviceCart.localLoad()||{};var items=card.items||[];var isAllProductsDigital=items.length>0&&items.filter(function(item){return item.productType==="DIGITAL";}).length===items.length;return(deliveryOptions.length===0&&deliveryEnable)||isAllProductsDigital;}function isSkipDeliveryStep(){var isDisableDeliveryStep=(wizard.getStep()===2||wizard.getStep()===0);return(isDisableDelivery()&&isDisableDeliveryStep);}function onPressWizardBackButton(e){e.preventDefault();if(checkEmptyCart()){return;}if(wizard.getStep()===2&&checkCartHasIssues()){return false;}if(isSkipDeliveryStep()){wizard.prev();}wizard.prev();if(wizard.getStep()===0){step1.render();}if(wizard.getStep()===1){step2.render();}return false;}function onPressWizardNextButton(e){e.preventDefault();if(checkEmptyCart()){return false;}var inventoryIssuesStep=1;if(isDisableDelivery()){inventoryIssuesStep=0;}if(wizard.getStep()===inventoryIssuesStep&&checkCartHasIssues()){return false;}if(wizard.getStep()===0){step1.activatePreload();step1.checkEmail().done(onSuccessCheckEmail).fail(onFailureCheckEmail);}if(wizard.getStep()===1){step2.saveForm().done(function(){wizard.next();}).fail(function(){renderGeneralError();});return false;}return false;}function renderGeneralError(){}function onShowWizardStep(e,anchorObject,stepNumber,stepDirection,stepPosition){if(stepNumber===2){step3.render();}}function onOrderCreateFailed(data){window.location.reload();}function onUpdateAndContinueClick(e){checkCartHasIssues();}function checkCartHasIssues(){var cart=serviceCart.localLoad()||{};if(cart.isValid){inventoryIssuesStep.hide();wizardContainer.style.display="block";if(wizard.getStep()===2){step3.render();}}else{inventoryIssuesStep.render();inventoryIssuesStep.show();wizardContainer.style.display="none";}return !cart.isValid;}}})(window,window.WA);(function(window,WA,undefined){if(!window.OnlineStoreCheckoutLayoutInventoryIssuesStep){window.OnlineStoreCheckoutLayoutInventoryIssuesStep=OnlineStoreCheckoutLayoutInventoryIssuesStep;}function OnlineStoreCheckoutLayoutInventoryIssuesStep(service,serviceCart){var formName="form_invetory_issues",container=document.getElementById("step-inventoryIssues"),tableContainer=document.getElementById("step-inventoryIssues-tableContainer"),tableRenderer=new InventoryIssuesStepTableRenderer(),$container=jq$(container),form=jq$("form[name="+formName+"]"),updateAndContinueEventName="CheckoutInventoryIssueUpdateAndContinueClick",
5565self=this,validator,model;self.render=render;self.updateAndContinue=updateAndContinue;self.deleteProduct=deleteProduct;self.show=show;self.hide=hide;self.onUpdateAndContinueClick=onUpdateAndContinueClick;init();function init(){service.getConfirmModel().done(function(confirmModel){model=jq$.extend(true,{},confirmModel.cart);});}function show(){container.style.display="block";}function hide(){container.style.display="none";}function render(){service.getConfirmModel().done(function(confirmModel){model=model?model:jq$.extend(true,{},confirmModel.cart);tableContainer.innerHTML=tableRenderer.render(model);jq$("button.storeCartTable_deleteButton",tableContainer).click(deleteProduct);});jq$("#idUpdateAndContinueButton",container).click(updateAndContinue);}function deleteProduct(e){var productId=e.target.getAttribute("item-productId"),variantId=e.target.getAttribute("item-variantId");if(variantId==""){variantId=null;}var itemsToDelete=jq$.grep(model.items,function(el,idx){return el.productId==productId&&el.variantId==variantId;});for(var i=itemsToDelete.length-1;i>=0;i--){itemsToDelete[i].isDeleted=true;}render();}function updateAndContinue(){model.items=$.grep(model.items,function(obj){return obj.isDeleted;},true);for(var i=model.items.length-1;i>=0;i--){var item=model.items[i];if(InventoryIssuesHelper.hasInventoryIssues(item,model.issues)){var issue=InventoryIssuesHelper.getInventoryIssue(item,model.issues);switch(issue.type){case"NOTENOUGH":model.items[i].quantity=issue.stock;break;case"OUTOFSTOCK":model.items[i]=null;break;default:throw ({"message":"Invalid issue type","productId":item.productId,"variantId":item.variantId});}}}model.items=$.grep(model.items,function(obj){return obj;});serviceCart.saveWithDelay(model).done(function(cart){jq$.event.trigger(updateAndContinueEventName);serviceCart.saveInCache(cart);});}function onUpdateAndContinueClick(actionFunc){jq$(document).bind(updateAndContinueEventName,actionFunc);}}})(window,window.WA);(function(window,WA,undefined){if(!window.WaOnlineStoreCheckoutLayoutStep1){window.WaOnlineStoreCheckoutLayoutStep1=OnlineStoreCheckoutLayoutStep1;}function OnlineStoreCheckoutLayoutStep1(service,isAuthorized){var container=document.getElementById("step-1"),$container=jq$(container),self=this,validator,loginURL="/Sys/Login?ReturnUrl=%2fSys%2fStore%2fCheckout",formName="contact_details",form=jq$("form[name="+formName+"]"),$terms=form.find("input.storeCheckoutTerm");self.render=render;self.checkEmail=checkEmail;self.activatePreload=activatePreload;self.deactivatePreload=deactivatePreload;self.saveContactModel=saveContactModel;self.emailExistErrorRender=emailExistErrorRender;self.checkEmailFailedRender=checkEmailFailedRender;init();function init(){validatorInit();jq$("#loginPageButton").on("click",function(){window.location.href=loginURL;});$terms.on("change",tryEnableNextButton);tryEnableNextButton();}function isCheckedTerms(){var checkedAllTerms=true;$terms.each(function(i,el){checkedAllTerms=checkedAllTerms&&el.checked;});return checkedAllTerms;}function validatorInit(){validator=new FormValidator({form:formName,autoConfig:true,validateOnBlur:true,onBlurField:onBlurValidate,onSubmit:onSubmitValidate});}function render(){service.getContactModel().done(function(model){getEmailField().val(model.Email);getFirstNameField().val(model.FirstName);getLastNameField().val(model.LastName);getPhoneField().val(model.Phone);jq$(model.RulesAndTerms).each(function(i,id){jq$("#term_"+id)[0].checked=true;});if(!isAuthorized&&!model.Email){disableNextButton();}tryEnableNextButton();});}function getNextButton(){return $container.find(".wizardNextButton");}function tryEnableNextButton(){if(isCheckedTerms()&&validator.validateForm()){enableNextButton();}else{disableNextButton();}}function tryHideNotifications(){if(validator.validateForm()){getExistEmailNotification().hide();}}function getEmailField(){return form.find("#billingDetails_email");}function getFirstNameField(){return form.find("#billingDetails_firstName");}function getLastNameField(){return form.find("#billingDetails_lastName");}function getPhoneField(){return form.find("#billingDetails_phone");}function checkEmail(){return service.checkEmail({Email:getEmailField().val()});}function getGeneralErrorNotification(){return jq$("#generalError");}function saveContactModel(){var checkedTerms=$terms.filter(function(i,el){return el.checked;}).map(function(i,el){return +$(el).val();}).get();var model={Email:getEmailField().val(),FirstName:getFirstNameField().val(),LastName:getLastNameField().val(),Phone:getPhoneField().val(),RulesAndTerms:checkedTerms};getGeneralErrorNotification().hide();getExistEmailNotification().hide();return service.saveContactModel(model);}function disableNextButton(){getNextButton().attr("disabled","disabled");}function enableNextButton(){getNextButton().removeAttr("disabled");}function activatePreload(){disableNextButton();}function deactivatePreload(){enableNextButton();}function onSubmitValidate(errors,evt){if(errors.length>0||!isCheckedTerms()){disableNextButton();}else{enableNextButton();}}function onBlurValidate(errors,evt){var sender=jq$(evt.target);putErrors(errors,sender);}function putErrors(errors,sender){if(!sender.next(".errorField").length){sender.after('<div class="errorField"></div>');}var errorField=sender.next(".errorField");if(errors.length>0){errorField.html(errors[0].message).addClass("errorField__visible");sender.parents(".formFieldContainer").addClass("error");disableNextButton();}else{errorField.removeClass("errorField__visible");sender.parents(".formFieldContainer").removeClass("error");tryEnableNextButton();tryHideNotifications();}}function getExistEmailNotification(){return jq$("#existEmail");}function emailExistErrorRender(){putErrors([{message:"Already used"}],getEmailField());getExistEmailNotification().show();}function checkEmailFailedRender(){getGeneralErrorNotification().show();captchaReset();}}
5565})(window,window.WA);(function(window,WA,undefined){if(!window.WaOnlineStoreCheckoutLayoutStep2){window.WaOnlineStoreCheckoutLayoutStep2=OnlineStoreCheckoutLayoutStep2;}function OnlineStoreCheckoutLayoutStep2(service,initModel){var SHIPPING=WaOnlineStoreCheckout.SHIPPING,PICKUP=WaOnlineStoreCheckout.PICKUP;var formName="delivery_details",container=document.getElementById("step-2"),$container=jq$(container),self=this,validator,deliveryOptionId=null,deliveryEnable=initModel.deliveryEnable,deliveryOptions=initModel.deliveryOptions,$shippingAddressContainer=$container.find(".delivery.delivery__shipping-address"),$pickupContainer=$container.find(".delivery.delivery__pickup-address"),$deliveryDetailsForm=$container.find("form[name="+formName+"]"),$shippingAddressContainer=$shippingAddressContainer,$deliveryOptionsContainer=$container.find(".delivery-methods"),$pickupContainer=$container.find(".delivery.delivery__pickup-address"),$deliveryOptionsRadio=$container.find('input[type="radio"][name="delivery-options"]'),deliveryOptionType=null;self.render=render;self.saveForm=saveForm;$deliveryOptionsRadio.on("change",function(){deliveryOptionId=jq$(this).val();var isShipping=jq$(this).hasClass("delivery-method-radio-button_shipping-option");deliveryOptionType=isShipping?SHIPPING:PICKUP;showFormByType(deliveryOptionType);});deliveryOptionId=$deliveryOptionsRadio.first().val();init();function init(){$deliveryOptionsContainer.hide();$pickupContainer.hide();$shippingAddressContainer.hide();if(!deliveryEnable){$container.find(".formFieldContainer.required").removeClass("required");}validatorInit();disableNextButton();if(deliveryEnable){$deliveryOptionsContainer.show();$shippingAddressContainer.show();}else{$shippingAddressContainer.show();}if(deliveryEnable&&deliveryOptions.length>0){$deliveryOptionsRadio.first().attr("checked",true);$deliveryOptionsRadio.first().trigger("change");}}function validatorInit(){if(deliveryEnable){validator=new FormValidator({form:formName,autoConfig:true,validateOnBlur:true,onBlurField:onBlurValidate,onSubmit:onSubmitValidate});}else{validator={isValidateForm:function(){return true;},validateForm:function(){return true;}};}var onChangeField=function(){tryEnableNextButton();};$shippingAddressContainer.find("#shippingAddress_address1").on("input",onChangeField);$shippingAddressContainer.find("#shippingAddress_city").on("input",onChangeField);$shippingAddressContainer.find("#shippingAddress_region").on("input",onChangeField);$shippingAddressContainer.find("#shippingAddress_zipcode").on("input",onChangeField);$shippingAddressContainer.find("#shippingAddress_country").on("change",function(evt){var errors=[],sender=jq$(evt.target);if(deliveryEnable&&!isSelectedCountry()){errors=[{message:"The Country is required"}];}putErrors(errors,sender);tryEnableNextButton();});$deliveryOptionsRadio.on("change",onChangeField);}function onSubmitValidate(errors,evt){if(errors.length>0){disableNextButton();}else{enableNextButton();}}function onBlurValidate(errors,evt){var sender=jq$(evt.target);putErrors(errors,sender);}function putErrors(errors,sender){if(!sender.next(".errorField").length){sender.after('<div class="errorField"></div>');}var errorField=sender.next(".errorField");if(errors.length>0){errorField.html(errors[0].message).addClass("errorField__visible");sender.parents(".formFieldContainer").addClass("error");disableNextButton();}else{errorField.removeClass("errorField__visible");sender.parents(".formFieldContainer").removeClass("error");tryEnableNextButton();}}function showFormByType(optionType){if(optionType===SHIPPING){$pickupContainer.hide();$shippingAddressContainer.show();}else{$pickupContainer.show();$shippingAddressContainer.hide();}}function render(){service.getDeliveryModel().done(function(deliveryModel){var shippingAddress=deliveryModel.shippingAddress;jq$('input[name="delivery-options"][value="'+deliveryOptionId+'"]').prop("checked",true);if(shippingAddress){$shippingAddressContainer.find("#shippingAddress_address1").val(shippingAddress.addressLine1);$shippingAddressContainer.find("#shippingAddress_address2").val(shippingAddress.addressLine2);$shippingAddressContainer.find("#shippingAddress_city").val(shippingAddress.city);$shippingAddressContainer.find("#shippingAddress_country").val(shippingAddress.countryId);
5565$shippingAddressContainer.find("#shippingAddress_region").val(shippingAddress.province);$shippingAddressContainer.find("#shippingAddress_zipcode").val(shippingAddress.zip);}tryEnableNextButton();});}function disableNextButton(){getNextButton().attr("disabled","disabled");}function enableNextButton(){getNextButton().removeAttr("disabled");}function getNextButton(){return $container.find(".wizardNextButton");}function tryEnableNextButton(){if(!deliveryEnable){return enableNextButton();}if((validator.isValidateForm()&&isSelectedCountry())||(deliveryOptionType===PICKUP)){enableNextButton();}else{disableNextButton();}}function getSelectedCountry(){var $countrySelect=$shippingAddressContainer.find("#shippingAddress_country"),countryId=+$countrySelect.val(),countryName="";if(countryId===0){countryId=null;countryName="";}else{countryName=$countrySelect.find("option:selected").text();}return{countryName:countryName,countryId:countryId};}function isSelectedCountry(){var country=getSelectedCountry();return country.countryId!==null;}function saveForm(){var selectedCountry=getSelectedCountry(),countryName=selectedCountry.countryName,countryId=selectedCountry.countryId;var shippingAddress={addressLine1:$shippingAddressContainer.find("#shippingAddress_address1").val(),addressLine2:$shippingAddressContainer.find("#shippingAddress_address2").val(),city:$shippingAddressContainer.find("#shippingAddress_city").val(),countryId:countryId,countryName:countryName,province:$shippingAddressContainer.find("#shippingAddress_region").val(),zip:$shippingAddressContainer.find("#shippingAddress_zipcode").val()};var deliveryModel={shippingAddress:shippingAddress,deliveryOptionId:deliveryOptionId};return service.saveDeliveryModel(deliveryModel);}}})(window,window.WA);(function(window,WA,undefined){if(!window.WaOnlineStoreCheckoutLayoutStep3){window.WaOnlineStoreCheckoutLayoutStep3=OnlineStoreCheckoutLayoutStep3;}function OnlineStoreCheckoutLayoutStep3(service,initModel){var SHIPPING=WaOnlineStoreCheckout.SHIPPING,PICKUP=WaOnlineStoreCheckout.PICKUP,DELIVERY_OPTION_TYPES=WaOnlineStoreCheckout.DELIVERY_OPTION_TYPES;var self=this,model,captchaVerify=false,mainContainer=document.getElementById("step-3-content"),captchaEnable=true,captchaWidgetId=undefined,deliveryEnable=initModel.deliveryEnable,isNewPaymentUIEnabled=initModel.isNewPaymentUIEnabled,recaptchaElementId="recaptchaContainer",$commentInput=jq$("#order_comments"),$paymentProcessingFeeDonationCheckBox=jq$("#paymentProcessingFeeDonationCheckBox"),orderCreateFailedEventName="OrderCreateFailedEvent";self.render=render;self.confirmationRender=confirmationRender;self.onOrderCreateFailed=onOrderCreateFailed;self.showGeneralError=showGeneralError;init();function init(){var $payInvoiceButton=getPayInvoiceButton();var $payOnlineButton=getPayOnlineButton();var $bankTransferButton=getBankTransferButton();var $freeOrderButton=getFreeOrderButton();$payInvoiceButton.on("click",function(){disablePayButtons();payInvoice(captchaVerify);});$payOnlineButton.on("click",function(){disablePayButtons();payOnline(captchaVerify);});$bankTransferButton.on("click",function(){disablePayButtons();bankTransfer(captchaVerify);});$freeOrderButton.on("click",function(){disablePayButtons();freeOrder(captchaVerify);});if(isNewPaymentUIEnabled){initAccordion();}captchaInit();}function captchaInit(){if(captchaEnable){var sitekey=getRecaptchaContainer().data("sitekey");captchaWidgetId=grecaptcha.render(recaptchaElementId,{sitekey:sitekey,callback:captchaSuccessCallback});}}function captchaSuccessCallback(responseToken){captchaVerify=responseToken;enablePayButtons();}function getRecaptchaContainer(){return jq$("#"+recaptchaElementId);}function render(){getGeneralErrorNotification().hide();disablePayButtons();captchaReset();service.getConfirmModel().done(function(confirmModel){model=confirmModel;confirmationRender(model);displayPayButtons(model);displayPaymentProcessingFeeDonationCheckBox(model);if(isNewPaymentUIEnabled){updatePayOnlineButtonLabel(model);}});}function updatePayOnlineButtonLabel(model){var button=document.getElementById("button_pay_online");if(!button||!model.cart||model.cart.total==null){return;}var total=model.cart.total;var baseLabel="Pay "+initModel.currencySymbol+total.toFixed(2);button.value=baseLabel;var checkbox=$paymentProcessingFeeDonationCheckBox[0];if(checkbox){var feeAmount=total*(initModel.paymentProcessingFeeDonationPercent||0)/100+(initModel.paymentProcessingFeeDonationIncrease||0);var donationLabel="Pay "+initModel.currencySymbol+(total+feeAmount).toFixed(2);checkbox.onchange=function(){button.value=this.checked?donationLabel:baseLabel;};}}function getFreeOrderButton(){return jq$("#button_free_order");}function getPayInvoiceButton(){return jq$("#button_pay_invoice");}function getPayOnlineButton(){return jq$("#button_pay_online");}function getBankTransferButton(){return jq$("#button_bank_transfer");}function getGeneralErrorNotification(){return jq$("#generalError");}function confirmationRender(model){mainContainer.innerHTML=confirmationRenderTable(model);}function displayPayButtons(model){if(model.cart&&model.cart.total===0){getFreeOrderButton().show();if(isNewPaymentUIEnabled){jq$("#accordionPaymentMethods").hide();}else{getPayInvoiceButton().hide();getPayOnlineButton().hide();getBankTransferButton().hide();}}else{getFreeOrderButton().hide();if(isNewPaymentUIEnabled){jq$("#accordionPaymentMethods").show();}else{getPayInvoiceButton().show();getPayOnlineButton().show();getBankTransferButton().show();}}}function initAccordion(){var cards=document.querySelectorAll("#accordionPaymentMethods .payment-method-card");var radios=document.querySelectorAll('#accordionPaymentMethods input[type="radio"]');if(cards.length>0){cards[0].classList.add("selected");}cards.forEach(function(card){card.addEventListener("click",function(e){if(e.target.closest(".payment-action-button")){return;}var radio=card.querySelector('input[type="radio"]');if(radio){radio.checked=true;updateAccordionSelection(cards);}});});radios.forEach(function(radio){radio.addEventListener("change",function(){updateAccordionSelection(cards);});});}function updateAccordionSelection(cards){cards.forEach(function(card){var radio=card.querySelector('input[type="radio"]');card.classList.toggle("selected",!!(radio&&radio.checked));});}function displayPaymentProcessingFeeDonationCheckBox(model){if(!$paymentProcessingFeeDonationCheckBox.length){return;}if(model.cart&&model.cart.total===0){jq$("#paymentProcessingFeeDonation").hide();}var amount=model.cart.total*initModel.paymentProcessingFeeDonationPercent/100+initModel.paymentProcessingFeeDonationIncrease;jq$("#paymentProcessingFeeDonationAmount").html(initModel.currencySymbol+amount.toFixed(2));}function disablePayButtons(){getPayInvoiceButton().attr("disabled","disabled");getPayOnlineButton().attr("disabled","disabled");getFreeOrderButton().attr("disabled","disabled");getBankTransferButton().attr("disabled","disabled");}function enablePayButtons(){getPayInvoiceButton().removeAttr("disabled");getPayOnlineButton().removeAttr("disabled");getFreeOrderButton().removeAttr("disabled");getBankTransferButton().removeAttr("disabled");}function captchaReset(){grecaptcha.reset(captchaWidgetId);}function captchaValidationFailureCallback(){showGeneralError();captchaReset();}function patchModel(model){model.comments=$commentInput.val();model.comments=$commentInput.val();model.paymentProcessingFeeDonationChecked=$paymentProcessingFeeDonationCheckBox.length&&$paymentProcessingFeeDonationCheckBox[0].checked;return model;}function payInvoice(captchaToken){return service.invoiceMe(patchModel(model),captchaToken).done(function(resp){if(!resp.IsReCaptchaValid){captchaValidationFailureCallback();}}).fail(function(data){var err=getErrorData(data);if(err.errorType=="NotEnoughStock"){jq$.event.trigger(orderCreateFailedEventName);}else{showGeneralError();}});}function payOnline(captchaToken){return service.payOnline(patchModel(model),captchaToken).done(function(resp){if(!resp.IsReCaptchaValid){captchaValidationFailureCallback();}}).fail(function(data){var err=getErrorData(data);if(err.errorType=="NotEnoughStock"){jq$.event.trigger(orderCreateFailedEventName);}else{showGeneralError();}});}function bankTransfer(captchaToken){return service.bankTransfer(patchModel(model),captchaToken).done(function(resp){if(!resp.IsReCaptchaValid){captchaValidationFailureCallback();}}).fail(function(data){var err=getErrorData(data);if(err.errorType=="NotEnoughStock"){jq$.event.trigger(orderCreateFailedEventName);}else{showGeneralError();}});}function freeOrder(captchaToken){return service.freeOrder(patchModel(model),captchaToken).done(function(resp){if(!resp.IsReCaptchaValid){captchaValidationFailureCallback();}}).fail(function(data){var err=getErrorData(data);if(err.errorType=="NotEnoughStock"){jq$.event.trigger(orderCreateFailedEventName);}else{showGeneralError();}});}function getErrorData(data){try{return JSON.parse(data.responseText).data;}catch(e){return data.responseText;}}function showGeneralError(){getGeneralErrorNotification().show();}function confirmationRenderTable(model){var html=[];html.push('<table class="storeCartTable">');html.push(confirmationRenderItems(model.cart.items));if(deliveryEnable&&model.deliveryModel&&model.deliveryModel.deliveryOptionId){html.push(confirmationRenderDelivery(model.deliveryModel));}html.push(confirmationRenderTotal(model.cart));html.push("</table>");html.push(deliveryInformationRender(model));return html.join("");}function confirmationRenderItems(items){var html=[],i,length=items.length;for(i=0;i<length;i++){html.push(confirmationRenderItem(items[i]));}return html.join("");}function renderImage(item){var html=[];
5565if(item.pictureUrl){html.push('<img src="',item.pictureUrl,'" width="100"/>');}else{html.push('<div class="storeCartTable_img storeCartTable_no_img" title="No photo"></div>');}return html.join("");}function getItemUrl(productId){return initModel.productDetailsUrl+"/"+productId;}function renderPrice(price){var fixedPrice=price?price.toFixed(2):"0.0";if(initModel.currencySymbol){return'<span class="priceContainer">'+initModel.currencySymbol+fixedPrice+"</span>";}else{return'<span class="priceContainer">'+fixedPrice+" "+initModel.currency+"</span>";}}function confirmationRenderItem(item){var html=[];html.push('<tr class="storeCartTable_row">');html.push('<td class="storeCartTable_tdImage">',renderImage(item),"</td>");html.push('<td class="storeCartTable_tdTitle">');html.push('<div class="storeCartTable_itemTitle">',enc(item.title),"</div>");html.push(renderOptions(item));html.push("</td>");html.push('<td class="storeCartTable_tdPprice">',renderPrice(item.price),"</td>");html.push('<td class="storeCartTable_tdQuantity qtyLabel">',item.quantity,"</td>");html.push('<td class="storeCartTable_tdAmount">',renderPrice(item.total),"</td>");html.push("</tr>");return html.join("");}function confirmationRenderDelivery(deliveryModel){var html=[];var deliveryOption=currentDeliveryOption(deliveryModel.deliveryOptionId,initModel.deliveryOptions);html.push('<tr class="storeCartTable_row">');html.push('<td class="storeCartTable_tdImage"></td>');html.push('<td class="storeCartTable_tdTitle">');html.push('<div class="storeCartTable_itemTitle">Delivery: ',enc(deliveryOption.title),"</div>");html.push("</td>");html.push('<td class="storeCartTable_tdPprice"></td>');html.push('<td class="storeCartTable_tdQuantity"></td>');html.push('<td class="storeCartTable_tdAmount">',renderPrice(deliveryOption.price),"</td>");html.push("</tr>");return html.join("");}function renderOption(option){return'<div class="storeCartTable_itemOption">'+enc(option.title)+": "+enc(option.value)+"</div>";}function renderOptions(item){if(!item.options){return"";}return jq$.map(item.options,function(option,i){return renderOption(option);}).join("");}function confirmationRenderTotal(cart){var html=[];var total=cart.total;var subTotal=cart.subTotal;var isTaxesApplied=cart.isTaxesApplied||false;var isTaxesIncludedTotal=cart.isTaxesIncludedTotal||false;var taxes=cart.taxes||[];if(initModel.taxesEnable&&isTaxesApplied&&!isTaxesIncludedTotal){html.push('<tr class="storeCartTotalInfoRowFirst">');html.push('<td colspan="4" class="storeCartTable_totalLabel">Subtotal:</td>');if(initModel.currencySymbol){html.push('<td class="storeCartTable_totalValue">',initModel.currencySymbol,subTotal.toFixed(2),"</td>");}else{html.push('<td class="storeCartTable_totalValue">',subTotal.toFixed(2)," ",initModel.currency,"</td>");}html.push("</tr>");html.push(renderTaxes(taxes,isTaxesIncludedTotal));}if(total||total===0){if(!isTaxesIncludedTotal){html.push('<tr class="storeCartTotalInfoRow">');}else{html.push('<tr class="storeCartTotalInfoRowFirst">');}html.push('<td colspan="4" class="storeCartTable_totalLabel">Total:</td>');if(initModel.currencySymbol){html.push('<td class="storeCartTable_totalValue">',initModel.currencySymbol,total.toFixed(2),"</td>");}else{html.push('<td class="storeCartTable_totalValue">',total.toFixed(2)," ",initModel.currency,"</td>");}html.push("</tr>");}if(initModel.taxesEnable&&isTaxesApplied&&isTaxesIncludedTotal){html.push(renderTaxes(taxes,isTaxesIncludedTotal));}return html.join("");}function renderTaxes(taxes,isTaxesIncludedTotal){var html=[];for(var taxIndex in taxes){var tax=taxes[taxIndex];var taxLabel=tax.title+":";if(isTaxesIncludedTotal){taxLabel="Incl."+enc(tax.title)+":";}html.push('<tr class="storeCartTotalInfoRow">');html.push('<td colspan="4" class="storeCartTable_totalLabel">',enc(taxLabel),"</td>");if(initModel.currencySymbol){html.push('<td class="storeCartTable_totalValue">',initModel.currencySymbol,tax.amount.toFixed(2),"</td>");}else{html.push('<td class="storeCartTable_totalValue">',tax.amount.toFixed(2)," ",initModel.currency,"</td>");}html.push("</tr>");}return html.join("");}function enc(val){return BonaPage.encodeHtml(val);}function onOrderCreateFailed(actionFunc){jq$(document).bind(orderCreateFailedEventName,actionFunc);}function currentDeliveryOption(deliveryOptionId,deliveryOptions){deliveryOptions=deliveryOptions.filter(function(option){return +option.id===+deliveryOptionId;})[0];return deliveryOptions||{title:null,optionId:null,type:null};}function deliveryInformationRender(model){var shippingAddress,deliveryOption,withShipping=true,html=[],owner=(model.billingDetails||{});shippingAddress=model.deliveryModel.shippingAddress||model.shippingAddress;if(deliveryEnable){deliveryOption=currentDeliveryOption(model.deliveryModel.deliveryOptionId,initModel.deliveryOptions);withShipping=DELIVERY_OPTION_TYPES[SHIPPING]===deliveryOption.type;}else{withShipping=!!shippingAddress;}html.push("<h2>Billing and shipping information</h2>");html.push("<p><strong>Billing details</strong><br />");html.push(enc(owner.FirstName)," ",enc(owner.LastName)," ",enc(owner.Email),"<br/>");if(owner.Phone){html.push(enc(owner.Phone),"<br/>");}html.push("</p>");if(withShipping){html.push("<p><strong>Shipping address</strong><br/>");if(shippingAddress.addressLine1){html.push(enc(shippingAddress.addressLine1)," ");}if(shippingAddress.addressLine2){html.push(enc(shippingAddress.addressLine2)," ");}if(shippingAddress.addressLine1||shippingAddress.addressLine2){html.push("<br/>");}var countryName=(shippingAddress.countryName!=="< Select >")?enc(shippingAddress.countryName):"";html.push(enc(shippingAddress.city)," ",enc(shippingAddress.province)," ",countryName," ",enc(shippingAddress.zip),"<br />");html.push("</p>");}html.push("<p>&nbsp;</p>");return html.join("");}}})(window,window.WA);(function(window,WA,undefined){if(!window.WaOnlineStoreCheckoutService){window.WaOnlineStoreCheckoutService=OnlineStoreCheckoutService;}function OnlineStoreCheckoutService(serviceCart){var cache={}
5565,cacheKey={billingDetails:"billingDetails",deliveryModel:"deliveryModel",rulesAndTerms:"rulesAndTerms"},gateway=new WaOnlineStoreCheckoutGateway(),self=this;var defaultShippingAddressModel={addressLine1:null,addressLine2:null,city:null,countryId:null,province:null,zip:null};var defaultDeliveryModel={shippingAddressModel:defaultShippingAddressModel,deliveryOptionId:null};self.invoiceMe=invoiceMe;self.payOnline=payOnline;self.bankTransfer=bankTransfer;self.freeOrder=freeOrder;self.checkEmail=checkEmail;self.saveContactModel=saveContactModel;self.getContactModel=getContactModel;self.getShippingAddressModel=getShippingAddressModel;self.getDeliveryModel=getDeliveryModel;self.saveDeliveryModel=saveDeliveryModel;self.getConfirmModel=getConfirmModel;cache.get=function(key){var serialized=WA.Storage.read(key);if(typeof serialized!=="string"){return undefined;}try{return JSON.parse(serialized);}catch(e){console.log(e);return serialized||undefined;}};cache.remove=function(key){WA.Storage.del(key);};cache.set=function(key,value){var serialized=JSON.stringify(value);try{WA.Storage.write(key,serialized);}catch(e){console.log(e);}};function getShippingAddressModel(){var model=cache.get(cacheKey.deliveryModel);if(model){return jq$.Deferred().resolve(model.shippingAddress||defaultShippingAddressModel);}else{return defaultShippingAddressModel;}}function getDeliveryModel(){var model=cache.get(cacheKey.deliveryModel);return jq$.Deferred().resolve(model||defaultDeliveryModel);}function saveDeliveryModel(model){cache.set(cacheKey.deliveryModel,model);return jq$.Deferred().resolve(model);}function resetAllData(){serviceCart.resetCart();cache.remove(cacheKey.deliveryModel);cache.remove(cacheKey.billingDetails);}function invoiceMe(checkoutModel,captchaToken){var data={CheckoutModel:checkoutModel,Captcha:captchaToken};return gateway.invoiceMe(data).fail(payFailed).done(paySuccess);}function payOnline(checkoutModel,captchaToken){var data={CheckoutModel:checkoutModel,Captcha:captchaToken};return gateway.payOnline(data).fail(payFailed).done(paySuccess);}function bankTransfer(checkoutModel,captchaToken){var data={CheckoutModel:checkoutModel,Captcha:captchaToken};return gateway.bankTransfer(data).fail(payFailed).done(paySuccess);}function freeOrder(checkoutModel,captchaToken){var data={CheckoutModel:checkoutModel,Captcha:captchaToken};return gateway.freeOrder(data).fail(payFailed).done(paySuccess);}function paySuccess(data){if(data.IsReCaptchaValid&&data.RedirectUrl){resetAllData();window.location=data.RedirectUrl;}}function payFailed(data,textStatus){console.log("Failed!",data,textStatus);}function checkEmail(model){return gateway.checkEmail(model);}function getContactModel(){var model=cache.get(cacheKey.billingDetails);return jq$.Deferred().resolve(model||{});}function saveContactModel(model){var contactModel=cache.get(cacheKey.billingDetails);var billingDetails=jq$.extend(contactModel,model);cache.set(cacheKey.billingDetails,billingDetails);return jq$.Deferred().resolve(billingDetails);}function getConfirmModel(){var def=jq$.Deferred();getContactModel().done(function(billingDetails){getDeliveryModel().done(function(deliveryModel){serviceCart.loadCurrent(deliveryModel.deliveryOptionId).done(function(cart){def.resolve({billingDetails:billingDetails,deliveryModel:deliveryModel,cart:cart});});});});return def;}}})(window,window.WA);jq$(function(){if(!window.currentProduct){window.currentProduct={id:0};}if(window.currentProduct.id>0){var cartService=WaOnlineStoreCart.getInstance(),cartUrl="/Sys/Store/Cart",cartKey="OnlineStoreCart",buttonAdd=document.getElementById("OnlineStoreProduct_addToCart"),outOfStockLabel=document.getElementById("idOnlineStoreCatalog_OutOfStock_container"),alreadyInCartLabel=document.getElementById("idOnlineStoreCatalog_AlreadyInCart_container"),buttonView=document.getElementById("OnlineStoreProduct_viewCart"),qtyContainer=document.getElementsByClassName("OnlineStoreProductQty")[0],inputQty=document.getElementById("idInputQuantity"),qtyLimitContainer=document.getElementById("idOnlineStoreCatalog_QuantityLimitContainer"),qtyLimit=document.getElementById("idOnlineStoreCatalog_QuantityLimit"),quantitySnippet=document.querySelector(".quantitySnippet"),options=document.querySelectorAll("SELECT.OnlineStoreProduct_optionsSelect"),optionErrorLabels={},variantsModel={};for(var i=options.length-1;i>=0;i--){var option=options[i];var errorLabel=document.getElementById("idOnlineStoreProduct_Option"+option.getAttribute("option-id")+"_ErrorLabel");optionErrorLabels[option.getAttribute("option-id")]=errorLabel;}if(!window.currentProduct.outOfStock&&quantitySnippet){quantitySnippet.onclick=function(event){var target=event.target,value;if(target.className.indexOf("quantity-button")!==-1){value=getQuantity();value+=target.className.indexOf("quantity-up")>=0?1:-1;inputQty.value=value;inputQty.oninput();}};}if(!window.currentProduct.outOfStock&&inputQty){inputQty.oninput=function(){var value=getQuantity(),min=parseInt(inputQty.getAttribute("min"));if(value<min){value=min;}inputQty.value=value;};}buttonView.onclick=function(e){document.location=cartUrl;e.preventDefault();return false;};buttonAdd.onclick=function(){if(!validate()){return false;}var variant=getVariant(),variantId=null,quantity=getQuantity();if(variant){variantId=variant.id;}if(quantity>0){cartService.add(currentProduct.id,variantId,quantity).fail(function(error){console.log(error);}).done(update);}return false;};cartService.load().fail(function(error){console.log(error);}).done(update);function getVariant(selectedOptions){if(!selectedOptions){selectedOptions=getSelectedOptions();}if(!selectedOptions||selectedOptions.length==0||!currentProduct.variants||currentProduct.variants.length==0){return null;}var variant=null;for(var i=currentProduct.variants.length-1;i>=0;i--){var optionValues=currentProduct.variants[i].options;var isMatch=true;for(var j=selectedOptions.length-1;j>=0;j--){var found=false;for(var k=optionValues.length-1;k>=0;k--){if(optionValues[k].title==selectedOptions[j].title&&optionValues[k].value==selectedOptions[j].value){found=true;break;}}if(!found){isMatch=false;break;}}if(isMatch){variant=currentProduct.variants[i];}}return variant;}function getSelectedOptions(){var selectedOptions=[];for(var i=options.length-1;i>=0;i--){var option=options[i];selectedOptions.push({title:option.getAttribute("option-title"),value:option.value});}return selectedOptions;}function getQuantity(){if(inputQty){var value=parseInt(inputQty.value);return value>0?value:1;}return 1;}function getProductsInCartQuantity(cart){if(!cart){return;}var quantity=0;
5565cart.items.forEach(function(item){quantity+=item.quantity;});return quantity;}function init(){for(var i=options.length-1;i>=0;i--){var optionSelect=options[i];optionSelect.onchange=function(event){var hasValue=event.target.value!="";optionErrorLabels[event.target.getAttribute("option-id")].style.display=hasValue?"none":"block";var variant=getVariant();setVariantData(variant);};}}function setVariantData(variant){if(!variant){outOfStockLabel.style.display="none";qtyLimitContainer.style.visibility="hidden";buttonAdd.disabled=true;return;}qtyLimitContainer.style.visibility=variant.outOfStock||!variant.stock?"hidden":"visible";qtyLimit.innerText=variant.stock;outOfStockLabel.style.display=variant.outOfStock?"block":"none";buttonAdd.disabled=variant.outOfStock;}function validate(){var isValid=false;var errors=getValidationErrors();isValid=errors.length==0;displayErrorState(errors);return isValid;}function getValidationErrors(){var errors=[];var selectedOptions=[];if(options.length==0){return errors;}for(var i=options.length-1;i>=0;i--){var option=options[i];if(option.selectedIndex==0){errors.push({type:"option",id:option.getAttribute("option-id")});}else{selectedOptions.push({title:option.getAttribute("option-title"),value:option.value});}}if(errors.length>0){return errors;}var variant=getVariant(selectedOptions);if(variant&&variant.outOfStock){return[{type:"outOfStock"}];}return errors;}function displayErrorState(errors){for(var i=optionErrorLabels.length-1;i>=0;i--){optionErrorLabels[i].style.display="none";}for(var i=errors.length-1;i>=0;i--){var error=errors[i];switch(error.type){case"option":optionErrorLabels[error.id].style.display="block";break;case"outOfStock":outOfStockLabel.style.display="block";break;}}buttonAdd.disabled=errors.length>0;}function isProductDigital(){if(!currentProduct){return false;}return currentProduct.type==="DIGITAL";}function isProductEcourse(){if(!currentProduct){return false;}return currentProduct.type==="ECOURSE";}function isProductInCart(productId){var cart=JSON.parse(WA.Storage.read(cartKey));if(!cart||!cart.items){return false;}var result=false;for(var i=0;i<cart.items.length;i++){if(cart.items[i].productId===productId){result=true;break;}}return result;}function displayAlreadyInCartState(){alreadyInCartLabel.style.visibility="visible";buttonAdd.disabled=true;}function updateLayoutForDigitalProduct(){if(isProductInCart(currentProduct.id)){displayAlreadyInCartState();}}function update(){var cart,productsInCartQuantity,currentProductQuantity,currentProductQuantityLimit;cart=JSON.parse(WA.Storage.read(cartKey));productsInCartQuantity=getProductsInCartQuantity(cart);updateViewInCartText(productsInCartQuantity);if(isProductDigital()||isProductEcourse()){updateLayoutForDigitalProduct();}}function updateViewInCartText(value){if(typeof value!=="number"){return;}buttonView.textContent=value>0?"View cart ("+value+")":"View cart";}function quantityLimitElement(options){var self=this,main=options.element,delay=options.delay||400;self.hide=hide;self.show=show;self.text=text;function hide(){if(main){main.style.display="none";}}function show(){if(main){main.style.display="block";setTimeout(hide,delay);}}function text(value){if(main){main.textContent=value;}}}var coverContainer=document.querySelector(".OnlineStoreProduct_gallery_cover_container"),coverImg=document.getElementById("OnlineStoreProduct_gallery_cover_img"),thumbs=document.getElementById("OnlineStoreProduct_gallery_thumbs");if(thumbs){thumbs.onclick=function(e){var target=e.target;while(target!=this){if(target.nodeName=="A"){showThumbnail(target.href,target.title);return false;}target=target.parentNode;}};var imgs=thumbs.getElementsByTagName("img");for(var i=0;i<imgs.length;i++){var img=document.createElement("img");img.src=imgs[i].parentNode.href;}}function showThumbnail(href,title){coverImg.src=href;coverImg.alt=title;coverContainer.href=href;}init();}});(function(window,WA,undefined){if(!window.WaPollBallot){window.WaPollBallot=PollBallot;}function PollBallot(){var self=this,confirmDialogId="pollSubmitConfirmationDialog",pollGadgetSelector=".WaGadgetPoll",validator=new WaPollBallotValidator(".WaGadgetPoll .votingBlock");self.Dispose=WA.Tools.EventHandlers.createHandlers(self,{id:"Dispose"});var confirmDialog=new WA.UI.ConfirmationDialog({id:confirmDialogId,resources:{Title:"Confirmation",ContentHTML:"Do you want to submit your answers?",ConfirmButtonLabel:"Yes",CancelButtonLabel:"No"}},{parentComponent:self});init();
5565function init(){jq$(pollGadgetSelector).on("keydown","form input",onKeyDown);confirmDialog.CancelClick.addHandler(onCancelClick);confirmDialog.ConfirmClick.addHandler(onConfirmClick);jq$(pollGadgetSelector).on("click","form input[type=submit]",onSubmit);jq$(pollGadgetSelector).on("click","form input[type=checkbox], form input[type=radio]",onPressCheckbox);}function onSubmit(){return validator.validate();}function onPressCheckbox(e){return validator.validateOption(e.target);}function onKeyDown(e){if(e.which==13&&validator.validate()){var confirmDialogElement=jq$("#"+confirmDialogId);var top=(jq$(window).height()-confirmDialogElement.outerHeight())/2;confirmDialog.show();confirmDialogElement.css({top:top+"px"});return false;}}function onConfirmClick(){confirmDialog.hide();document.getElementById("pollBallotForm").submit();}function onCancelClick(){confirmDialog.hide();}}var instance;PollBallot.getInstance=function(){return instance||(instance=new PollBallot());};})(window,window.WA);(function(window,WA,undefined){if(!window.WaPollBallotValidator){window.WaPollBallotValidator=PollBallotValidator;}function PollBallotValidator(questionBlockSelector){var self=this;self.validate=function(){var questionNodes=[].slice.call(document.querySelectorAll(questionBlockSelector)),result=true;questionNodes.forEach(function(item,i,arr){if(checkQuestionNode(item)===false){result=false;}});return result;};self.validateOption=function(target){var questionNode=target.closest(questionBlockSelector),limit=getLimitForQuestion(questionNode),selected=getCheckedOptions(questionNode);if(selected.length>0&&(selected.length<=limit||limit==0)){hideError(questionNode);}};function checkQuestionNode(questionNode){var limit=getLimitForQuestion(questionNode),selected=getCheckedOptions(questionNode),suggestionInput=getSuggestionInput(questionNode),isRequired=getIsRequiredForQuestion(questionNode);if(isRequired&&selected.length<1&&(!suggestionInput||suggestionInput.value.trim()==="")||selected.length===1&&selected[0].value==="suggestion"&&suggestionInput.value.trim()===""){showError(questionNode,"An answer is required");return false;}if(limit>0&&selected.length>limit){showError(questionNode,"Maximum "+limit+" options");return false;}return true;}function getLimitForQuestion(questionNode){return +questionNode.getAttribute("data-limit")||0;}function getIsRequiredForQuestion(questionNode){return questionNode.getAttribute("data-isRequired").toLowerCase()!=="false";}function getCheckedOptions(questionNode){return questionNode.querySelectorAll(".optionItem input[type=checkbox]:checked, .optionItem input[type=radio]:checked");}function getSuggestionInput(questionNode){return questionNode.querySelector("input[type=text]");}function showError(questionNode,text){if(text){questionNode.querySelector(".errorMsg").innerHTML=text;}questionNode.querySelector(".errorMsg").style.display="block";}function hideError(questionNode){questionNode.querySelector(".errorMsg").style.display="none";}}})(window,window.WA);(function(ELEMENT){ELEMENT.matches=ELEMENT.matches||ELEMENT.mozMatchesSelector||ELEMENT.msMatchesSelector||ELEMENT.oMatchesSelector||ELEMENT.webkitMatchesSelector;ELEMENT.closest=ELEMENT.closest||function closest(selector){if(!this){return null;}if(this.matches(selector)){return this;}if(!this.parentElement){return null;}else{return this.parentElement.closest(selector);}};}(Element.prototype));(function(){if(!window.WASearchResultsGadget){window.WASearchResultsGadget=WASearchResultsGadget;}function WASearchResultsGadget(args){var pThis=this;pThis.init=init;pThis.doSearch=doSearch;var model,foundLabel,searchBox,resultDiv,foundRecordsSpan,recordsFoundMessage,pager,selectedTypesCaption,searchInProgress,thereWasAnotherRequest;model=args||{};function init(){if(model.searchUnavailable==true){return;}var prefix="#"+model.modelId;searchInProgress=false;thereWasAnotherRequest=false;searchBox=jq$(prefix+"_searchBox");resultDiv=jq$(prefix+"_resultDiv");foundLabel=jq$(prefix+"_foundLabel");foundRecordsSpan=jq$(prefix+"_foundRecords");recordsFoundMessage=jq$(prefix+"_recordsFoundMessage");selectedTypesCaption=jq$(prefix+"_selectedTypesCaption");pager=jq$(prefix+"_pager");$("input[name="+model.modelId+"_type]").on("click",checkedChanged);$(prefix+"_togglePanelLink").on("click",function(){jq$(prefix+"_contentTypesPanel").slideToggle(100);jq$(this).toggleClass("fa-caret-down","fa-caret-right");});var timer;var delay=600;searchBox.bind("input",function(){window.clearTimeout(timer);timer=window.setTimeout(function(){doSearch(1);},delay);});searchBox.focus();if(searchBox.val().length>0){doSearch(model.pageNumber);}}function doSearch(pageNum){if(!pageNum){return;}thereWasAnotherRequest=false;if(searchBox.val().length==0){setEmptyResult();return;}var filter=getSelectedTypes();if(filter==0){setEmptyResult();return;}if(searchInProgress){thereWasAnotherRequest=true;return;}searchInProgress=true;foundRecordsSpan.html(model.text.searchInProgress);jq$.ajax({type:"POST",url:model.searchActionUrl,data:JSON.stringify({"q":searchBox.val(),"types":filter,"pageNumber":pageNum,"noPaging":model.noPaging}),contentType:"application/json; charset=utf-8",dataType:"text"}).done(function(data){searchInProgress=false;if(thereWasAnotherRequest){doSearch(1);}else{foundLabel.show();var jsonData=JSON.parse(data.replace("while(1); ","","i").trim());if(jsonData.entities.length>0){renderResult(jsonData);}else{setEmptyResult();}var url=WA.String.format(model.getUrlTemplate,encodeURIComponent(searchBox.val()),filter,pageNum);if(model.noPaging==true){url=url+"&nopaging=true";}window.history.replaceState({},"",url);}}).fail(function(){searchInProgress=false;if(thereWasAnotherRequest){doSearch(1);}else{recordsFoundMessage.html("Search is not available now.");}});}function checkedChanged(){refreshSelectedTypesCaption();doSearch(1);}function refreshSelectedTypesCaption(){var all=true;var captions=new Array();$("input[name="+model.modelId+"_type]").each(function(){if($(this).attr("checked")=="checked"){captions.push($("label[for="+$(this).attr("id")+"]:first").text());}else{all=false;}});var text="";if(all){text="all";}else{if(captions.length==0){text="none";}else{text=captions.join(", ");}}selectedTypesCaption.html(WA.String.format(model.text.contentTypeTemplate,text));}function getSelectedTypes(){var filter=0;$("input[name="+model.modelId+"_type]:checked").each(function(){filter=filter|$(this).attr("value");});return filter;}function setEmptyResult(){setFoundRecords(0,model.text.noResultsFound);resultDiv.html("");pager.html("");}function renderResult(data){var items=data.entities;var a=new Array();for(var i=0;i<items.length;i++){var o=items[i];var text=o.text;a.push('<div class="row">');a.push('<div class="title"><a class="'+o.className+'" title="'+o.tooltip+'" href="'+o.url+'"><span>'+o.title+"</span></a></div>");a.push('<div class="text">'+o.text+"</div>");if(o.additionalInfo!=""){a.push('<div class="additionalInfo">'+o.additionalInfo+"</div>");}a.push("</div>");}resultDiv.html(a.join(""));setFoundRecords(data.recordsFound,data.recordsFoundMessage);renderPager(parseInt(data.pagesFound),parseInt(data.currentPage),9);}function setFoundRecords(recordsFound,message){foundRecordsSpan.html(""+recordsFound+"");recordsFoundMessage.html(message);}function renderPager(pagesCount,currentPage,pagesToDisplay){if(pagesCount==1){pager.html("");return;}var pagerItems=[];pagerItems.push({text:model.text.first,page:currentPage==1?null:1});pagerItems.push({text:model.text.previous,page:currentPage==1?null:currentPage-1});var firstPage,lastPage;if(pagesCount<pagesToDisplay){firstPage=1;lastPage=pagesCount;}else{firstPage=Math.min(currentPage-Math.floor(pagesToDisplay/2),pagesCount-pagesToDisplay+1);if(firstPage<1){firstPage=1;}lastPage=firstPage+pagesToDisplay-1;}for(var i=firstPage;i<=lastPage;i++){pagerItems.push({text:i,page:currentPage==i?null:i});}pagerItems.push({text:model.text.next,page:currentPage==pagesCount?null:currentPage+1});pagerItems.push({text:model.text.last,page:currentPage==pagesCount?null:pagesCount});var arr=renderPagerItems(pagerItems);}function renderPagerItems(jsonArr){var i,linkElements,a=new Array();WA.Array.foreach(jsonArr,function(item){if(item.page){a.push('<a style="cursor: pointer;" data-page="'+item.page+'">'+item.text+"</a>");}else{a.push("<span>"+item.text+"</span>");}});pager.html(a.join("&nbsp;&nbsp;"));linkElements=document.body.querySelectorAll("A[data-page]");for(i=0;i<linkElements.length;i++){WA.addHandler(linkElements[i],"click",gotoPage);}}function gotoPage(e){var targetElement;if(!e&&event){e=event;}if(e){targetElement=e.target||e.srcElement;if(targetElement){doSearch(targetElement.getAttribute("data-page"));}}}init();}})();

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