// Copyright 2006-2017 ClickTale Ltd., US Patent Pending

window.ClickTaleGlobal = window.ClickTaleGlobal || {};
ClickTaleGlobal.scripts = ClickTaleGlobal.scripts || {};


ClickTaleGlobal.scripts.filter = ClickTaleGlobal.scripts.filter || (function () {
	var recordingThreshold = Math.random() * 100;

	return {
		isRecordingApproved: function(percentage) {
			return recordingThreshold <= percentage;
		}
	}
})();
	
		
// Copyright 2006-2017 ClickTale Ltd., US Patent Pending
// PID: 14403

var ctRules_PrePCC={"rules":"name|VE+Event+%7C+Photos+%7C+Action+%7C+Interacted+with+ANY+TOP+menu+item|action|type|CTEventAction|eventName|VE+Event+%7C+Photos+%7C+Action+%7C+Interacted+with+ANY+TOP+menu+item|triggers|OrCondition|childConditions|ClickCondition|ctSelector|elementAddressing|tagCode|elementID|demo|index|tl_primary_bar|alias|SPAN|DIV|states|LocationCondition|url|https://photos.shutterfly.com|mode|StartsWith|ignoreQueryString|VE+Event+%7C+Photos+%7C+Action+%7C+Interacted+with+any+Home+Decor+menu+item|VE+Event+%7C+Photos+%7C+Action+%7C+Interacted+with+any+Home+Decor+menu+item|VE+Action+%7C+Cart+Page+%7C+Clicked+on+Homepage+Logo|VE+Action+%7C+Cart+Page+%7C+Clicked+on+Homepage+Logo|totallyNonConflictingWrapper|headerContainer|personalToolbar3_0|personalToolbar|I|https://www.shutterfly.com/checkout/cart.sfly|Equals|VE+Action+%7C+Cart+Page+%7C+Clicked+on+Preview+First+Product|VE+Action+%7C+Cart+Page+%7C+Clicked+on+Preview+First+Product|docWide|main|leftArea|bagsArea|A|VE+Event+%7C+Photos+%7C+Action+%7C+Interacted+with+any+Calendars+menu+item|VE+Event+%7C+Photos+%7C+Action+%7C+Interacted+with+any+Calendars+menu+item|VE+Action+%7C+Photo+Books+%7C+Clicked+on+Make+My+Book|VE+Action+%7C+Photo+Books+%7C+Clicked+on+Make+My+Book|&lid=PBCAT_Make+My+Book|https://www.shutterfly.com/photo-books|VE+Event+%7C+Photos+%7C+Action+%7C+Interacted+with+any+Photo+Books+menu+item|VE+Event+%7C+Photos+%7C+Action+%7C+Interacted+with+any+Photo+Books+menu+item|VE+Action+%7C+Cart+Page+%7C+Clicked+on+Checkout|VE+Action+%7C+Cart+Page+%7C+Clicked+on+Checkout|titleArea|BUTTON|actionArea|VE+Action+%7C+Cart+Page+%7C+Clicked+on+Remove+First+Product|VE+Action+%7C+Cart+Page+%7C+Clicked+on+Remove+First+Product|VE+Action+%7C+Cart+Page+%7C+Clicked+on+Visa+Checkout|VE+Action+%7C+Cart+Page+%7C+Clicked+on+Visa+Checkout|visaCheckout|IMG|VE+Event+%7C+Photos+%7C+Action+%7C+Interacted+with+any+Cards+menu+item|VE+Event+%7C+Photos+%7C+Action+%7C+Interacted+with+any+Cards+menu+item|VE+Event+%7C+Photos+%7C+Action+%7C+Upload|VE+Event+%7C+Photos+%7C+Action+%7C+Upload|tl_bottom_bar|tl_bottom_bar_btns|tl_bottom_bar_left|VE+Event+%7C+Photos+%7C+Action+%7C+Interacted+with+any+Photo+Gifts+menu+item|VE+Event+%7C+Photos+%7C+Action+%7C+Interacted+with+any+Photo+Gifts+menu+item|VE+Event+%7C+Photos+%7C+Action+%7C+Interacted+with+any+Prints+menu+item|VE+Event+%7C+Photos+%7C+Action+%7C+Interacted+with+any+Prints+menu+item|VE+Action+%7C+Cart+Page+%7C+Clicked+on+Shopping+Bag|VE+Action+%7C+Cart+Page+%7C+Clicked+on+Shopping+Bag|cart-count-container|sfly3-my-cart|&lid=GlobalHeader_carticon|VE+Action+%7C+Cart+Page+%7C+Interacted+with+Promo+Code+Field|VE+Action+%7C+Cart+Page+%7C+Interacted+with+Promo+Code+Field|promoArea|promoEntry|promo|typeCode|INPUT|VE+Action+%7C+Cart+Page+%7C+Clicked+on+First+Product+Image|VE+Action+%7C+Cart+Page+%7C+Clicked+on+First+Product+Image|VE+Event+%7C+Photos+%7C+Action+%7C+Clicked+on+Shopping+Cart|VE+Event+%7C+Photos+%7C+Action+%7C+Clicked+on+Shopping+Cart|VE+Action+%7C+Cart+Page+%7C+Clicked+Apply+Promo+Code|VE+Action+%7C+Cart+Page+%7C+Clicked+Apply+Promo+Code|promoEntryButton^284|0|284|0|284|1|284|0|284|1|39|0|24|0|284|0|43|0|284|B|284|1|284|0|284|1|284|0|284|0|284|0|284|1|284|0|284|1|39|0|24|1|284|0|43|0|284|7|284|1|284|0|284|1|284|0|284|0|284|0|284|1|284|0|284|1|39|0|24|2|284|0|43|0|284|E|284|1|284|0|284|1|284|0|284|0|284|1|284|0|284|1|39|0|24|3|284|0|43|0|284|D|284|1|284|0|284|1|284|0|284|0|284|0|284|1|284|0|284|1|39|0|24|4|284|0|43|0|284|A|284|1|284|0|284|1|284|0|284|0|284|1|284|0|284|1|39|0|24|5|284|0|43|0|284|C|284|1|284|0|284|1|284|0|284|0|284|0|284|1|284|0|284|1|39|0|24|5|284|0|43|0|284|C|284|1|284|0|284|1|284|0|284|4|284|0|284|0|284|0|1|0|9|0|284|4|284|1|284|4|284|1|284|1|284|0|284|0|284|2|284|0|284|1|284|1|284|0|39|0|24|0|1|0|284|0|284|0|284|1|284|0|284|1|39|0|24|3|284|0|43|0|284|D|284|1|284|0|284|1|284|4|284|1|284|4|284|2|284|0|284|1|284|2|284|0|1|0|284|0|284|0|284|1|284|0|284|1|39|0|24|1|284|0|43|0|284|7|284|1|284|0|284|1|284|0|284|4|284|1|284|4|284|0|284|0|284|1|23M|0|284|4|284|1|284|4|284|2|284|0|284|0|284|1|23M|0|284|4|284|1|284|4|284|1|284|1|284|0|284|0|284|2|284|0|284|1|284|1|284|0|39|0|24|1|1|0|284|4|284|1|284|4|284|2|284|0|284|0|284|2|284|0|284|0|284|0|284|0|284|0|O9|0|284|0|284|0|284|1|284|0|284|1|39|0|24|2|284|0|43|0|284|E|284|1|284|0|284|1|284|0|284|C|284|0|284|0|284|1|1|0|284|0|284|0|284|1|284|0|284|1|39|0|24|4|284|0|43|0|284|A|284|1|284|0|284|1|284|0|284|0|284|1|284|0|284|1|39|0|24|0|284|0|43|0|284|B|284|1|284|0|284|1|284|0|284|4|284|0|284|0|284|0|39|0|24|4|1|0|284|4|284|1|284|4|284|2|284|0|284|0|284|0|284|2|284|0|284|0|284|0|1NT|1O|0|284|4|284|1|284|4|284|1|284|1|284|0|284|0|284|2|284|0|284|0|1|0|O9|0|284|0|284|0|284|2|284|0|1|3|284|0|284|4|284|1|284|4|284|2|284|0|284|0|284|0|284|2|284|0|284|0|284|0|23M|0^^@$0|1|2|$3|4|5|6]|7|$3|8|9|@$3|A|B|$C|@$D|2N|E|F|G|2O]|$D|2P|E|H|G|2Q]|$D|2R|G|2S]|$D|2T|G|2U]|$D|2V|G|2W]|$D|2X|G|2Y]|$D|2Z|G|30]|$D|31|G|32]|$D|33|G|34]]]|I|J]|$3|A|B|$C|@$D|35|G|36]|$D|37|G|38]|$D|39|G|3A]|$D|3B|G|3C]|$D|3D|G|3E]]]|I|K]|$3|A|B|$C|@$D|3F|E|F|G|3G]|$D|3H|E|H|G|3I]|$D|3J|G|3K]|$D|3L|G|3M]|$D|3N|G|3O]|$D|3P|G|3Q]|$D|3R|G|3S]|$D|3T|G|3U]|$D|3V|G|3W]]]|I|J]|$3|A|B|$C|@$D|3X|G|3Y]|$D|3Z|G|40]|$D|41|G|42]|$D|43|G|44]|$D|45|G|46]]]|I|K]|$3|A|B|$C|@$D|47|E|F|G|48]|$D|49|E|H|G|4A]|$D|4B|G|4C]|$D|4D|G|4E]|$D|4F|G|4G]|$D|4H|G|4I]|$D|4J|G|4K]|$D|4L|G|4M]|$D|4N|G|4O]]]|I|J]|$3|A|B|$C|@$D|4P|G|4Q]|$D|4R|G|4S]|$D|4T|G|4U]|$D|4V|G|4W]]]|I|K]|$3|A|B|$C|@$D|4X|E|F|G|4Y]|$D|4Z|E|H|G|50]|$D|51|G|52]|$D|53|G|54]|$D|55|G|56]|$D|57|G|58]|$D|59|G|5A]|$D|5B|G|5C]|$D|5D|G|5E]]]|I|J]|$3|A|B|$C|@$D|5F|G|5G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2G|2|$3|4|5|2H]|7|$3|8|9|@$3|A|B|$C|@$D|H6|E|W|G|H7]|$D|H8|E|15|G|H9]|$D|HA|E|16|G|HB]|$D|HC|E|17|G|HD]|$D|HE|E|18|G|HF]|$D|HG|G|HH]|$D|HI|G|HJ]|$D|HK|G|HL]|$D|HM|G|HN]|$D|HO|G|HP]|$D|HQ|G|HR]|$D|HS|G|HT]]]|I|1S]]]|L|$3|M|N|11|P|12|R|-1]]|$0|2I|2|$3|4|5|2J]|7|$3|8|9|@$3|A|B|$C|@$D|HU|E|F|G|HV]|$D|HW|E|H|G|HX]|$D|HY|G|HZ]|$D|I0|G|I1]|$D|I2|G|I3]|$D|I4|G|I5]]]|I|K]]]|L|$3|M|N|O|P|Q|R|-2]]|$0|2K|2|$3|4|5|2L]|7|$3|8|9|@$3|A|B|$C|@$D|I6|E|W|G|I7]|$D|I8|E|15|G|I9]|$D|IA|E|16|G|IB]|$D|IC|E|1M|G|ID]|$D|IE|G|IF]|$D|IG|G|IH]|$D|II|G|IJ]|$D|IK|E|2B|G|IL]|$D|IM|G|IN]|$D|IO|G|IP]|$D|IQ|G|IR]|$D|IS|E|2M|G|IT]]]|I|1L]]]|L|$3|M|N|11|P|12|R|-1]]]","isTransformed":true}; (function(){function CTSimplePromise(){var e=[],t=!1,n=void 0;this.resolve=function(r){if(!t){n=r,t=!0;for(var o=0;o<e.length;o++)e[o](r);e=[]}},this.then=function(r){t?r(n):e.push(r)}}function CTAnyPromise(e){for(var t=new CTSimplePromise,n=0;n<e.length;n++)e[n].then(function(e){t.resolve(e)});return t}function Rule(e){logger.log("Rule name: ",e.name),this.name=e.name;var t=actionsFactory.construct(e.action,e),n=observablesFactory.construct(e.triggers),r=statesFactory.construct(e.states);n&&n.subscribe(function(e){if(r.evaluate())return t.execute(e)}),logger.log("\n")}function Observable(){this.subscribers=[]}function State(e){}function Action(e){}function ClickObservable(e){Observable.call(this);var t=this;ctSelectorUtils.bindEventHandler(clickHandlers,e,function(n){logger.log("Click event associated with selector: ",e);var r={domElement:n};t.notify(r)})}function onMouseDown(e){currentMouseDownElement=e.target||e.srcElement}function onMouseUp(e){var t,n=e.target||e.srcElement;if(n===currentMouseDownElement){logger.log("Click detected on element: ",n);for(t in clickHandlers)clickHandlers.hasOwnProperty(t)&&ctSelectorUtils.isAncestor(clickHandlers[t][0].ctSelector,n)&&clickHandlers[t].forEach(function(e){var r=ctSelectorUtils.getAncestorDomElement(clickHandlers[t][0].ctSelector,n);e.callback.call(null,r)})}currentMouseDownElement=null}function DelayObservable(e){function t(){setTimeout(function(){n.notify()},e)}Observable.call(this);var n=this;onRulesBoundHandlers.push(t),CTLogicalPageEvent.subscribe(t)}function ElementDeclarationObservable(e){Observable.call(this);var t=this;ctSelectorUtils.bindEventHandler(elementDeclarationHandlers,e,function(n){return logger.log("Element declaration event associated with selector: ",e),t.notify()})}function OrObservable(e){Observable.call(this);var t=this;e.forEach(function(e){e.subscribe(function(e){return t.notify(e)})})}function PageLoadObservable(){function e(){logger.log("PageLoad event"),t.notify()}Observable.call(this);var t=this;onRulesBoundHandlers.push(e),CTLogicalPageEvent.subscribe(e)}function CTEventAction(e){this.actionData=e}function ElementCategoryAction(e){this.categoryId=e}function AndCondition(e){this.children=e}function CookieExistsState(e,t){this.cookieName=e,this.cookieValue=t}function ExistsState(e){this.ctSelector=e}function JSVariableExistsState(e,t){this.jsVariableName=e,this.jsVariableValue=t}function LocationState(e){this.url=e.url.toLowerCase(),this.mode=e.mode,this.ignoreQueryString=e.ignoreQueryString}function NotCondition(e){this.childState=e}function OrCondition(e){this.children=e}function QSParamExistsState(e,t){this.queryStringParamName=e,this.queryStringParamValue=t}function UrlHashExistsState(e){this.urlHashValue=e}function init(){onDomReady(function(){if(startRulesEngine(),whenRecording(function(){ctRecordingPromise.resolve()}),window.ClickTaleMonitor&&ClickTaleMonitor.Settings){var e=window.ClickTaleMonitor.Settings.get();e.onReady(function(){ctMonitorReadyPromise.resolve()})}})}function whenRecording(e){if("undefined"!=typeof window.ClickTaleIsRecording&&window.ClickTaleIsRecording()===!0)e();else{var t=window.ClickTaleOnRecording;window.ClickTaleOnRecording=function(){e(),"undefined"!=typeof t&&"function"==typeof t&&t.apply(this,arguments)}}}function startRulesEngine(){try{if(!isSupportedBrowser())return;ct.ElementAddressing.bootstrap(window,!0),buildRules()}catch(e){logger.error("startRulesEngine: ",e)}}function onDomReady(e){function t(){r||(r=!0,e())}function n(){if(!r)try{document.documentElement.doScroll("left"),t()}catch(e){setTimeout(n,10)}}var r=!1;if("complete"===document.readyState||"interactive"===document.readyState)return void t();if(document.addEventListener)document.addEventListener("DOMContentLoaded",t,!1);else if(document.attachEvent){try{var o=null!=window.frameElement}catch(i){}document.documentElement.doScroll&&!o&&n(),document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&t()})}if(window.addEventListener)window.addEventListener("load",t,!1);else if(window.attachEvent)window.attachEvent("onload",t);else{var a=window.onload;window.onload=function(){a&&a(),t()}}}function isIE(){var e=navigator.userAgent.toLowerCase();return e.indexOf("msie")!=-1&&parseInt(e.split("msie")[1])}function isSupportedBrowser(){try{return!isIE()||isIE()>9}catch(e){return logger.error("isSupportedBrowser: ",e),!1}}function buildRules(){if(ctRules_PrePCC){var e=null;e=ctRules_PrePCC.isTransformed?rulesEngine.jsonUnpacker.unpack(ctRules_PrePCC.rules):ctRules_PrePCC.rules,rules=e.map(function(e){return new Rule(e)})}onRulesBoundHandlers.forEach(function(e){e()})}Function.prototype.bind||(Function.prototype.bind=function(e){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),n=this,r=function(){},o=function(){return n.apply(this instanceof r?this:e,t.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(r.prototype=this.prototype),o.prototype=new r,o}),"function"!=typeof Object.create&&(Object.create=function(){function e(){}var t=Object.prototype.hasOwnProperty;return function(n){if("object"!=typeof n)throw TypeError("Object prototype may only be an Object or null");e.prototype=n;var r=new e;if(e.prototype=null,arguments.length>1){var o=Object(arguments[1]);for(var i in o)t.call(o,i)&&(r[i]=o[i])}return r}}());var logger=function(){function e(){var e=Array.prototype.slice.call(arguments);n&&(window.console&&window.console.log?window.console.log.apply(window.console,e):window.alert&&window.alert(e.join(" ")))}for(var t={},n=!(!window.localStorage||"true"!==localStorage.getItem("ctRuleEngineDebug")),r=window.location.search.split("&"),o=[],i=0;i<r.length;i++)/^\??ctRuleEngine=/.test(r[i])&&o.push(r[i]);return o.length&&(n="true"===o[0].split("=").splice(1)[0],window.localStorage&&localStorage.setItem("ctRuleEngineDebug",n)),t.log=function(){e.apply(this,arguments)},t.error=function(t){e.apply(this,arguments)},t}();!function(){function e(e,t){var n=e.split("."),r=k;!(n[0]in r)&&r.execScript&&r.execScript("var "+n[0]);for(var o;n.length&&(o=n.shift());)n.length||t===E?r=r[o]?r[o]:r[o]={}:r[o]=t}function t(e,t){var n;if(e.map)n=e.map(t,E);else{n=[];for(var r=e.length,o=window,i=0;i<r;i++)n.push(t.call(o,e[i],i))}return n}function n(e,t){var n;if(e.filter)n=e.filter(t,E);else{n=[];for(var r=e.length,o=window,i=0;i<r;i++){var a=e[i];t.call(o,a,i)&&n.push(a)}}return n}function r(e,t){P||(e.ClickTaleSetCustomElementID=c(e.ClickTaleSetCustomElementID),P=S),t&&i(R,e.document.documentElement),x=S}function o(e){}function i(e,t){var n=t.firstChild,r=l(t).CustomID;r&&(r in e?(V[r]=S,o("duplicate registration of custom id "+r+"were found on multiple elements")):e[r]=t);for(;n;n=n.nextSibling)1===n.nodeType&&i(e,n)}function a(e,t){l(e).CustomID=t}function c(e){return function(t,n){n in R?(V[n]=S,o("duplicate registration of custom id "+n+" were found on multiple elements")):(e(t,n),x&&(R[n]=t))}}function l(e){var t=e.ClickTale;return t||(t={},e.ClickTale=t),t}function s(e){return w.getComputedStyle?w.getComputedStyle(e,C):e.currentStyle}function u(e){return L[e]||(L[e]=(e.charCodeAt(0)-64&31)+((e.charCodeAt(1)-64&28)<<3)+((e.charCodeAt(2)-64&30)<<7)),L[e]}function d(e){return(e.charCodeAt(0)-64&7)+((e.charCodeAt(0)-64&16)>>1)+((e.charCodeAt(1)-64&4)<<2)+((e.charCodeAt(3)-64&4)<<3)}function f(e,t,n){var r,o,i,a,c,f,y=0,v=C;r=O;for(var h,g=C,b=C,w=t.length,E=0;e&&E<w;E++)for(r=O,b=t[E],v=e.firstChild,y=0;!r&&v;v=v.nextSibling)if(1===v.nodeType&&u(v.tagName)===b.tagCode){if(y===b.index){if(g=v,e=b.name,r=b.typeCode,o=b.customID,f=b.elementID,i=p(g,"id"),a=p(g,"type"),c=p(g,"name"),h=l(g).CustomID,!m([o,h])&&o!=h||!m([f,i])&&f!=i||!m([e,c])&&e!=c||!m([r,a])&&a&&r!=d(a))return C;r=S,e=g}y++}return n?e:(r=r&&"none"!==s(e).display.toLowerCase())?e:C}function p(e,t){var n=e.getAttributeNode(t);return n?n.value:C}function m(e){return T(e,function(e){return!e})}function y(e,t){var n,r=t.customID;if(r){var i;r in V&&V[r]?o("duplicate custom id "+r+" were found on multiple elements"):i=R[r],n=i}else e:{if(r=t.elementID){try{n=e.querySelectorAll("#"+r),n.length||(n=e.querySelectorAll("[id='"+r.replace(/'/g,"\\'")+"']"))}catch(a){n=e.querySelectorAll("[id='"+r.replace(/'/g,"\\'")+"']")}if(n&&0!==n.length){if(1===n.length){n=n[0];break e}o("duplicate id "+r+" were found on multiple elements.")}else o("no element with id "+r+" was found.")}n=E}return n}function v(e,t){for(var n,r,i=t.length,a=i,c={},l=e.ownerDocument;0<a;a--){if(n=t[a-1],r=y(l,n),!r&&(n=n.name)&&a===i){r=l;var s,u=t,d=E,f=C,p=u.slice(0,a-1);e:{s=r;for(var m=p.length,v=E,v=E;0<m;m--)if(v=p[m-1],(v=y(s,v))&&1===v.nodeType&&"form"===v.tagName.toLowerCase()){s=v;break e}s=C}(d=s)?f=h(r,n,d,u):o("could not resolve form. form doesn't have an anchor."),r=f}if(r)return i=t.slice(a,i),c.b=i,c.a=r,c}return c.b=t,c.a=e,c}function h(e,t,r,i){var a,e=e.getElementsByName(t);if(1<e.length){if(e=n(e,function(e){return A(r,e)}),b(e))return t=i[i.length-1].index,g(e,t);o("duplicate name "+t+" found on multiple non radio elements.")}else 1===e.length&&(i=e[0],A(r,i)?a=i:o("could not resolve nested element with name "+t+" in form."));return a}function g(e,t){for(var n,r,o,i=[],a=O,c=0;c<e.length;c++)if(o=e[c],r=o.parentNode,-1===D(i,r)&&(i.push(r),r=r.getElementsByTagName(o.tagName),r.length-1>=t)){if(a)return C;n=r[t],a=S}return n}function b(e){for(var t=0;t<e.length;t++){var n=p(e[t],"type");if(!n||"radio"!==n.toLowerCase())return O}return S}if(!window.ct||!ct.ElementAddressing){var w,E=void 0,S=!0,C=null,O=!1,k=this,A=function(){var e=document.documentElement;return e.compareDocumentPosition||e.contains?function(e,t){var n=9===e.nodeType?e.documentElement:e;return e===t||n.contains&&n.contains(t)||e.compareDocumentPosition&&16&e.compareDocumentPosition(t)}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return S;return O}}(),D=Array.prototype.indexOf?function(e,t){return e.indexOf(t)}:function(e,t){for(var n=e.length,r=0;r<n;r++)if(e[r]===t)return r;return-1},T=Array.prototype.every?function(e,t){return e.every(t)}:function(e,t){for(var n=e.length,r=0;r<n;r++)if(!t(e[r]))return O;return S},x=O,P=O,V={},R={},N=c(a),L={};e("ct.ElementAddressing.bootstrap",function(e,t){t=!!t,w=e,e.ClickTaleSetCustomElementID=a,/complete|interactive/.test(document.readyState)?r(e,t):e.document.addEventListener?e.document.addEventListener("DOMContentLoaded",function(){r(e,t)},O):document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&r(e,t)})}),e("ct.ElementAddressing.elementFromPath",function(e,n,r){var o=!(e[0]instanceof Array);return o&&(e=[e]),e=t(e,function(e){return e=v(n,e),e.a&&0<e.b.length&&(e.a=f(e.a,e.b,r)),!r&&e.a&&"hidden"===s(e.a).visibility.toLowerCase()?C:e.a}),o?e[0]:e}),e("ct.ElementAddressing.pathFromElement",function(e,t){var n,r=0,o=0,i=C,a=[],c=e;if(!t)return a;for(;c&&c!==t;)if(1!==c.nodeType)c=c.parentNode;else{for(o=0,i={},e=c,r=u(c.nodeName),i.tagCode=r,(n=l(e).CustomID)&&(i.customID=n),(n=p(e,"id"))&&(i.elementID=n),(n=p(e,"name"))&&(i.name=n),(n=p(e,"type"))&&(i.typeCode=d(n)),n=c;n=n.previousSibling;)u(n.nodeName)===r&&o++;i.index=o,c=c.parentNode,a.push(i)}return a.reverse(),a}),e("ct.ElementAddressing.elementAndVisibilityFromPath",function(e,n){var r=!(e[0]instanceof Array);r&&(e=[e]);var o=t(e,function(e){if(e=v(n,e),e.a&&0<e.b.length&&(e.a=f(e.a,e.b,S)),e.a){var t={};t.dom=e.a,t.isHidden="hidden"===s(e.a).visibility.toLowerCase(),e=t}else e=C;return e});return r?o[0]:o}),e("ct.ElementAddressing.setCustomElementID",N),e("ct.ElementAddressing.calcTagCode",u),e("ct.ElementAddressing.calcTypeCode",d)}}();var ctRecordingPromise=new CTSimplePromise,ctMonitorReadyPromise=new CTSimplePromise,ctAnyRecorderReadyPromise=new CTAnyPromise([ctRecordingPromise,ctMonitorReadyPromise]),CTLogicalPageEvent=function(){function e(){setTimeout(function(){for(var e=0;e<t.length;e++)t[e]()},250)}var t=[];return ctAnyRecorderReadyPromise.then(function(){if(window.ClickTaleMonitor){var t=window.ClickTaleMonitor.restart;ClickTaleMonitor.restart=function(){"function"==typeof t&&t.apply(this,arguments),e()}}else{var t=window.ClickTaleLogical;window.ClickTaleLogical=function(){"function"==typeof t&&t.apply(this,arguments),e()}}}),{subscribe:function(e){t.push(e)}}}(),exports={},rulesEngine=exports;Observable.prototype.subscribe=function(e){this.subscribers.push(e)},Observable.prototype.notify=function(e){var t,n=this;return n.subscribers.forEach(function(n){var r=n(e);null!=r&&(t=r)}),t};var observablesFactory={construct:function(e){return null==e?null:this["construct"+e.type.replace("Condition","")](e)}};State.prototype.evaluate=function(e){};var statesFactory={construct:function(e){return this["construct"+e.type.replace("Condition","")](e)}},actionsFactory={construct:function(e,t){return this["construct"+e.type.replace("Action","")](e,t)}};Action.prototype.execute=function(e){};var ctSelectorUtils=function(){function e(e){var t=[];if(e.elementAddressing){var n=ct.ElementAddressing.elementFromPath(e.elementAddressing,document.body,!0);n&&t.push(n)}else if(e.querySelector)try{t=Array.prototype.slice.call(document.querySelectorAll(e.querySelector))}catch(r){}return t}function t(e){switch(Object.keys(e)[0]){case"elementAddressing":return JSON.stringify(e.elementAddressing);case"querySelector":return e.querySelector}}function n(e,t){var n,r=e.length;for(n=0;n<r;n+=1)if(e[n]===t)return!0;return!1}var r={};return r.bindEventHandler=function(e,n,r){var o=t(n);e[o]=e[o]||[],e[o].push({callback:r,ctSelector:n})},r.isAncestor=function(e,t){var n=r.getAncestorDomElement(e,t);return null!=n},r.getAncestorDomElement=function(e,t){for(var o=!1,i=t,a=r.getDOMelements(e);!o&&"HTML"!==i.tagName&&i.parentElement;)o=n(a,i),o||(i=i.parentElement);return o?i:null},r.getDOMelements=function(t){if(Array.isArray(t)){var n=[];return t.forEach(function(t){n=n.concat(e(t))}),n}return e(t)},r.getFirstDOMelement=function(t){if(t&&null!=t){var n=e(t);if(null!=n&&n.length>0)return n[0]}return null},r}();ClickObservable.prototype=Object.create(Observable.prototype),ClickObservable.prototype.constructor=ClickObservable,observablesFactory.constructClick=function(e){return new ClickObservable(e.ctSelector)},document.addEventListener&&(document.addEventListener("mousedown",onMouseDown,!1),document.addEventListener("mouseup",onMouseUp,!1));var clickHandlers={},currentMouseDownElement=null;DelayObservable.prototype=Object.create(Observable.prototype),DelayObservable.prototype.constructor=DelayObservable,observablesFactory.constructDelay=function(e){return new DelayObservable(e.delay)};var elementDeclarationHandlers={};ElementDeclarationObservable.prototype=Object.create(Observable.prototype),ElementDeclarationObservable.prototype.constructor=ElementDeclarationObservable,observablesFactory.constructElementDeclaration=function(e){return new ElementDeclarationObservable(e.ctSelector)},window.ClickTaleSettings=window.ClickTaleSettings||{},window.ClickTaleSettings.AugmentElementPath=function(e){var t,n;for(t in elementDeclarationHandlers)elementDeclarationHandlers.hasOwnProperty(t)&&ctSelectorUtils.isAncestor(elementDeclarationHandlers[t][0].ctSelector,e)&&elementDeclarationHandlers[t].forEach(function(t){n=t.callback.call(null,e)||n});return null!=n?{type:"pathdata",data:{categoryid:n}}:null},OrObservable.prototype=Object.create(Observable.prototype),OrObservable.prototype.constructor=OrObservable,observablesFactory.constructOr=function(e){var t=e.childConditions.map(function(e){return observablesFactory.construct(e)});return new OrObservable(t)},PageLoadObservable.prototype=Object.create(Observable.prototype),PageLoadObservable.prototype.constructor=PageLoadObservable,observablesFactory.constructPageLoad=function(){return new PageLoadObservable};var dynamicEventNameUtils=function(){var e={};e.getDynamicEventName=function(e,o){var s="";if(e&&e.parts&&e.parts.length>0){for(var u="undefined"!=typeof e.delimiter?e.delimiter:" ",d=0;d<e.parts.length;d++){var f=e.parts[d],p="";try{switch(f.type){case"TextValue":p=f.name;break;case"ElementValue":p=t(f);break;case"TriggeredElementValue":"undefined"!=typeof o&&null!=o&&(p=n(f,o));break;case"CookieValue":p=c(f.name);break;case"JSVariableValue":p=r(f.name);break;case"QueryStringParamName":p=l(f.name);break;case"BookmarkName":p=a();break;case"URLValue":p=i()}null==p&&(p="")}catch(m){"undefined"!=typeof logger&&logger.error("getDynamicEventName: ",m)}s+=u+p}s.length>0&&(s=s.substring(u.length))}return s};var t=function(e){var t=ctSelectorUtils.getFirstDOMelement(e.ctSelector);return null!=t?n(e,t):""},n=function(e,t){var n=e.subType;switch(n){case"Attribute":var r=e.name,o=t.getAttribute(r);return null!=o?o:t[r];case"AllInnerText":return u(t).join(" ");case"InnerText":default:return"undefined"!=typeof t.firstChild&&null!=t.firstChild?"function"==typeof t.firstChild.nodeValue.trim?t.firstChild.nodeValue.trim():t.firstChild.nodeValue:"undefined"!=typeof t.value&&null!=t.value?"function"==typeof t.value.trim?t.value.trim():t.value:""}},r=function(e){for(var t=e.split("."),n=window[t[0]],r=1;r<t.length;r++)n=n[t[r]];return o(n)};e.getJSVariable=function(e){return r(e)};var o=function(e){return e="undefined"==typeof e||"object"==typeof e?null:e.toString()},i=function(e){return e||(e="-"),window.location.pathname.split("/").join(e).substring(1)},a=function(){return window.location.hash?window.location.hash.split("#")[1]:null},c=function(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""};e.getCookieValue=function(e){return c(e)};var l=function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)"),r=n.exec(t);return r?r[2]?decodeURIComponent(r[2].replace(/\+/g," ")):"":null};e.getQueryStringParameterValue=function(e){return l(e)};var s=function(e,t){for(t(e),e=e.firstChild;e;)s(e,t),e=e.nextSibling},u=function(e){function t(e){switch(e.nodeType){case 1:"undefined"!=typeof e.value&&null!=e.value&&n.push("function"==typeof e.value.trim?e.value.trim():e.value);break;case 3:"undefined"!=typeof e.nodeValue&&null!=e.nodeValue&&n.push("function"==typeof e.nodeValue.trim?e.nodeValue.trim():e.nodeValue)}}"string"==typeof e&&(e=document.getElementById(e));var n=[];return s(e,t),n};return e}();CTEventAction.prototype=Object.create(Action.prototype),CTEventAction.prototype.constructor=Action,CTEventAction.prototype.execute=function(e){var t=this;ctRecordingPromise.then(function(){if("function"==typeof window.ClickTaleIsRecording&&window.ClickTaleIsRecording()&&"function"==typeof window.ClickTaleEvent){var n;e&&(n=e.domElement);var r=t.geEventName(n);""!=r&&(window.ClickTaleEvent(r),logger.log("ClickTaleEvent: "+r))}})},CTEventAction.prototype.geEventName=function(e){return this.actionData.dynamicEventName?dynamicEventNameUtils.getDynamicEventName(this.actionData.dynamicEventName,e):this.actionData.eventName},actionsFactory.constructCTEvent=function(e){return new CTEventAction(e)},ElementCategoryAction.prototype=Object.create(Action.prototype),ElementCategoryAction.prototype.constructor=Action,ElementCategoryAction.prototype.execute=function(){return this.categoryId},actionsFactory.constructElementCategory=function(e){return new ElementCategoryAction(e.categoryId)},AndCondition.prototype=Object.create(State.prototype),AndCondition.prototype.constructor=AndCondition,AndCondition.prototype.evaluate=function(){for(var e=0;e<this.children.length;e++){var t=this.children[e].evaluate();if(0==t)return!1}return!0},statesFactory.constructAnd=function(e){var t=e.childConditions.map(function(e){return statesFactory.construct(e)});return new AndCondition(t)},CookieExistsState.prototype=Object.create(State.prototype),CookieExistsState.prototype.constructor=CookieExistsState,CookieExistsState.prototype.evaluate=function(){for(var e=!1,t=document.cookie.split(";"),n=0;n<t.length;n++)if(t[n].split("=")[0].trim()==this.cookieName){e=!0;break}return!!e&&(void 0==this.cookieValue||this.cookieValue==dynamicEventNameUtils.getCookieValue(this.cookieName))},statesFactory.constructCookieExists=function(e){return new CookieExistsState(e.name,e.value)},ExistsState.prototype=Object.create(State.prototype),ExistsState.prototype.constructor=ExistsState,ExistsState.prototype.evaluate=function(){var e=ctSelectorUtils.getDOMelements(this.ctSelector);return e.length>0},statesFactory.constructExists=function(e){return new ExistsState(e.ctSelector)},JSVariableExistsState.prototype=Object.create(State.prototype),JSVariableExistsState.prototype.constructor=JSVariableExistsState,JSVariableExistsState.prototype.evaluate=function(){try{for(var e=this.jsVariableName.split("."),t=window[e[0]],n=1;n<e.length;n++)t=t[e[n]]}catch(r){}return"undefined"!=typeof t&&("undefined"==typeof this.jsVariableValue||(null===t&&(t="null"),t==this.jsVariableValue||t.toString()==this.jsVariableValue))},statesFactory.constructJSVariableExists=function(e){return new JSVariableExistsState(e.name,e.value)},LocationState.prototype=Object.create(State.prototype),LocationState.prototype.constructor=State,LocationState.prototype.evaluate=function(e){var t=e||window.location.href;switch(t=t.toLowerCase(),this.ignoreQueryString===!0&&(t=t.split(/[?#]/)[0],this.url=this.url.split(/[?#]/)[0]),this.mode){case"AllPages":return!0;case"StartsWith":return 0==t.indexOf(this.url);case"Equals":return t===this.url;case"Contains":return t.indexOf(this.url)>-1}},statesFactory.constructLocation=function(e){return new LocationState(e)},NotCondition.prototype=Object.create(State.prototype),NotCondition.prototype.constructor=NotCondition,NotCondition.prototype.evaluate=function(){return!this.childState.evaluate()},statesFactory.constructNot=function(e){var t=statesFactory.construct(e.condition);return new NotCondition(t)},OrCondition.prototype=Object.create(State.prototype),OrCondition.prototype.constructor=OrCondition,OrCondition.prototype.evaluate=function(){for(var e=0;e<this.children.length;e++){var t=this.children[e].evaluate();if(1==t)return!0}return!1},statesFactory.constructOr=function(e){var t=e.childConditions.map(function(e){return statesFactory.construct(e)});return new OrCondition(t)},QSParamExistsState.prototype=Object.create(State.prototype),QSParamExistsState.prototype.constructor=QSParamExistsState,QSParamExistsState.prototype.evaluate=function(){for(var e=!1,t=window.location.search.substring(1).split("&"),n=0;n<t.length;n++)if(t[n].split("=")[0]==this.queryStringParamName){e=!0;break}return!!e&&(void 0==this.queryStringParamValue||this.queryStringParamValue==dynamicEventNameUtils.getQueryStringParameterValue(this.queryStringParamName))},statesFactory.constructQSParamExists=function(e){return new QSParamExistsState(e.name,e.value)},UrlHashExistsState.prototype=Object.create(State.prototype),UrlHashExistsState.prototype.constructor=UrlHashExistsState,UrlHashExistsState.prototype.evaluate=function(){return window.location.hash.split("#")[1]==this.urlHashValue},statesFactory.constructUrlHashExists=function(e){return new UrlHashExistsState(e.name)},function(e){var t=-1,n=-2,r=-3,o=-4,i=-5,a=function(e){var a=e.split("^"),s=[],u=a[0];if(""!==u){u=u.split("|");for(var d=0,f=u.length;d<f;d++)s.push(c(u[d]))}if(u=a[1],""!==u){u=u.split("|");for(var d=0,f=u.length;d<f;d++)s.push(l(u[d]))}if(u=a[2],""!==u){u=u.split("|");for(var d=0,f=u.length;d<f;d++)s.push(parseFloat(u[d]))}delete u;for(var p="",m=[],y=a[3].length,d=0;d<y;d++){var v=a[3].charAt(d);"|"===v||"$"===v||"@"===v||"]"===v?(p&&(m.push(l(p)),p=""),"|"!==v&&m.push(v)):p+=v}var h=m.length,g=0;return function b(){var e=m[g++];if("@"===e){for(var a=[];g<h;g++){var c=m[g];if("]"===c)return a;if("@"===c||"$"===c)a.push(b());else switch(c){case t:a.push(!0);break;case n:a.push(!1);break;case r:a.push(null);break;case i:a.push(void 0);break;case o:a.push("");break;default:a.push(s[c])}}return a}if("$"===e){for(var a={};g<h;g++){var l=m[g];if("]"===l)return a;l=l===o?"":s[l];var c=m[++g];if("@"===c||"$"===c)a[l]=b();else switch(c){case t:a[l]=!0;break;case n:a[l]=!1;break;case r:a[l]=null;break;case i:a[l]=void 0;break;case o:a[l]="";break;default:a[l]=s[c]}}return a}throw new TypeError("Bad token "+e+" isn't a type")}()},c=function(e){return"string"!=typeof e?e:e.replace(/\+|%2B|%7C|%5E|%25/g,function(e){return{"+":" ","%2B":"+","%7C":"|","%5E":"^","%25":"%"}[e]})},l=function(e){return parseInt(e,36)};e.jsonUnpacker={unpack:function(e){return a(e)}}}(exports);var rules,onRulesBoundHandlers=[];init();}());

/*browsers exclusion start*/function doOnlyWhen(toDoHandler, toCheckHandler, interval, times, failHandler) {
    if ((!toDoHandler) || (!toCheckHandler)) return;
    if (typeof interval == "undefined") interval = 1000;
    if (typeof times == "undefined") times = 20;

    if (--times < 0 && typeof failHandler === 'function') {
        failHandler();
        return;
    }
    if (toCheckHandler()) {
        toDoHandler();
        return;
    }

    setTimeout(function () { doOnlyWhen(toDoHandler, toCheckHandler, interval, times); }, interval);
}
doOnlyWhen(function () { if (window.ClickTaleSettings.PTC.okToRunPCC) { (function(){
window.ClickTaleSettings = window.ClickTaleSettings || {};
window.ClickTaleSettings.PTC = window.ClickTaleSettings.PTC || {};
window.ClickTaleSettings.PTC.originalPCCLocation = "P8_PID14403";
var c=!0,d=!1,f=this;var h,i,j,l;function aa(){return f.navigator?f.navigator.userAgent:null}l=j=i=h=d;var q;if(q=aa()){var ba=f.navigator;h=0==q.indexOf("Opera");i=!h&&-1!=q.indexOf("MSIE");j=!h&&-1!=q.indexOf("WebKit");l=!h&&!j&&"Gecko"==ba.product}var ca=h,r=i,t=l,u=j,v;
a:{var w="",x;if(ca&&f.opera)var y=f.opera.version,w="function"==typeof y?y():y;else if(t?x=/rv\:([^\);]+)(\)|;)/:r?x=/MSIE\s+([^\);]+)(\)|;)/:u&&(x=/WebKit\/(\S+)/),x)var da=x.exec(aa()),w=da?da[1]:"";if(r){var z,ea=f.document;z=ea?ea.documentMode:void 0;if(z>parseFloat(w)){v=""+z;break a}}v=w}var fa={};
function B(b){var a;if(!(a=fa[b])){a=0;for(var e=(""+v).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),g=(""+b).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),k=Math.max(e.length,g.length),n=0;0==a&&n<k;n++){var Z=e[n]||"",Ba=g[n]||"",A=RegExp("(\\d*)(\\D*)","g"),p=RegExp("(\\d*)(\\D*)","g");do{var m=A.exec(Z)||["","",""],o=p.exec(Ba)||["","",""];if(0==m[0].length&&0==o[0].length)break;a=((0==m[1].length?0:parseInt(m[1],10))<(0==o[1].length?0:parseInt(o[1],10))?-1:(0==m[1].length?0:parseInt(m[1],
10))>(0==o[1].length?0:parseInt(o[1],10))?1:0)||((0==m[2].length)<(0==o[2].length)?-1:(0==m[2].length)>(0==o[2].length)?1:0)||(m[2]<o[2]?-1:m[2]>o[2]?1:0)}while(0==a)}a=fa[b]=0<=a}return a}var ga={};function ha(){ga[9]||(ga[9]=r&&!!document.documentMode&&9<=document.documentMode)};!r||ha();!r||ha();r&&B("8");!u||B("528");t&&B("1.9b")||r&&B("8")||ca&&B("9.5")||u&&B("528");!t||B("8");var ia;function C(b,a,e,g,k){b&&a&&("undefined"==typeof e&&(e=1E3),"undefined"==typeof g&&(g=20),0>--g?"function"===typeof k&&k():a()?b():setTimeout(function(){C(b,a,e,g,k)},e))}function ja(b){var a="someText".trim,e=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;ia=a&&!a.call(new String("\ufeff\u00a0"))?function(b){return null==b?"":a.call(b)}:function(b){return null==b?"":(b+"").replace(e,"")};return ia(b)};function D(b,a){var e=Element.prototype;D=function(b,a){return!b||!document.documentElement.contains(b)?d:D.e.call(b,a)};D.e=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;return D(b,a)}function E(b,a){E=Element.prototype.closest?function(b,a){return Element.prototype.closest.call(b,a)}:function(b,a){for(;b&&!D(b,a);)b=b.parentElement;return b};return E(b,a)};function ka(b){function a(){e||(e=c,b())}var e=d;"complete"===document.readyState||"interactive"===document.readyState?a():document.addEventListener&&document.addEventListener("DOMContentLoaded",a,d)}
function F(b,a,e,g,k){if("string"===typeof b)b=document.querySelectorAll(b),Array.prototype.forEach.call(b,function(b){F(b,a,e,g,k)});else if(b instanceof Array||b instanceof NodeList)Array.prototype.forEach.call(b,function(b){F(b,a,e,g,k)});else return b.addEventListener(a,function(b,a,e,g,k){return function(m){if("function"===typeof e)e.apply(this,arguments),k&&b.removeEventListener(a,arguments.callee,d);else{var o=E(m.target,e);o&&(g.apply(o,arguments),k&&b.removeEventListener(a,arguments.callee,
d))}}}(b,a,e,g,k),d),b}function la(b,a){document.addEventListener("mouseup",function(e){b===e.target&&a();document.removeEventListener("mouseup",arguments.callee,d)},d)}function ma(b,a){function e(e){document.removeEventListener("touchend",arguments.callee,d);b===e.target&&a()}document.addEventListener("touchend",e,d);document.addEventListener("touchmove",function(b){document.removeEventListener("touchmove",arguments.callee,d);document.removeEventListener("touchend",e,d)},d)}
function G(b,a){var e=H();e&&(G=e.m?ma:la,G(b,a))}function na(b){for(var a=0;a<b.length;a++){var e=b[a];e&&("string"===typeof e?(e=ja(e))&&I(e):Array.isArray(e)&&na(e))}};function J(b){if(window.CSS&&"function"===typeof window.CSS.escape)J=function(b){return window.CSS.escape.call(window.CSS,b)};else{var a=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,e=function(b,a){return a?"\x00"===b?"\ufffd":b.slice(0,-1)+"\\"+b.charCodeAt(b.length-1).toString(16)+" ":"\\"+b};J=function(b){return(b+"").replace(a,e)}}return J(b)};function oa(){"function"===typeof ClickTaleStop&&ClickTaleStop()}function I(b,a){"function"===typeof ClickTaleEvent&&(a?I.b[b]!==c&&(I.b[b]=c,ClickTaleEvent(b)):ClickTaleEvent(b))}I.b={};function K(b,a){"function"===typeof window.ClickTaleRegisterElementAction&&ClickTaleRegisterElementAction(b,a)}function pa(b){"function"===typeof window.ClickTaleRegisterElementAction&&ClickTaleRegisterElementAction("click",b)}function qa(b,a){var e={},g;for(g in b)e[g]=b[g];e.target=a;e.srcElement=a;pa(e)}
window.ClickTaleDetectAgent&&window.ClickTaleDetectAgent()&&window.ClickTaleDetectAgent();
function L(b,a){"object"==typeof b&&"string"==typeof a&&(window.ClickTaleContext&&-1!=document.referrer.indexOf(location.hostname)&&window.parent.ct&&window.parent.ct.ElementAddressing&&"function"===typeof window.parent.ct.ElementAddressing.setCustomElementID?window.parent.ct.ElementAddressing.setCustomElementID(b,a):(window.ClickTaleSetCustomElementID=window.ClickTaleSetCustomElementID||function(b,a){b.ClickTale=b.ClickTale||{};b.ClickTale.CustomID=a},window.ClickTaleSetCustomElementID(b,a)))}
function ra(){Array.prototype.forEach.call(document.querySelectorAll("[id]"),function(b){if(!D(b,'input[type="hidden"]')){var a=b.getAttribute("id");a.match(/(?:\r|\n)/)&&"function"===typeof ClickTaleNote&&ClickTaleNote("ctlib.api.SetCustomElementIdDuplicates: ids with line break found!");var b=document.querySelectorAll('[id="'+J(a)+'"]'),e=sa;1<b.length&&!e[a]&&(e[a]=c,Array.prototype.forEach.call(b,function(b,e){L(b,a.replace(/(\r|\n|\r\n|\s+)+/g,"_").replace(/\W/g,"_")+"_"+e)}))}})}var sa={};
function ta(b,a){"function"===typeof ClickTaleLogical&&(I.b={},sa={},a?ClickTaleLogical(b,a):ClickTaleLogical(b))}function H(){if("function"===typeof ClickTaleDetectAgent){var b=ClickTaleDetectAgent();if(b)return H=function(){return b},H()}return null}
function ua(){var b;if(!b){b="mousedown";if("boolean"!=typeof M){var a=H();a&&(M=a.m)}M&&(b="touchstart")}F(document,b,"img, a, button, textarea, input, select",function(b){var a=b.target,k=this;G(a,function(b,a){return function(){if(!M)if(D(this,"button,a,textarea")&&this!=b)qa(a,this);else{var e=function(){};document.addEventListener("click",function(b){return e=function(a){a.target===b&&(va=c);document.removeEventListener("click",arguments.callee,d)}}(b),d);setTimeout(function(){va||pa(a);document.removeEventListener("click",
e,d);va=void 0},200)}}.bind(k)}(a,b))})}var M,va;function N(b,a,e,g){N.d&&(N.d=d,g=g||400,"number"==typeof e&&(g=e,e=""),a=a||document.location.href,oa(),window.ClickTaleIncludedOnDOMReady=c,window.ClickTaleIncludedOnWindowLoad=c,"function"===typeof ClickTaleUploadPage&&ClickTaleUploadPage(void 0,void 0),ta(a,e),b(),setTimeout(function(){N.d=c},g))}N.d=c;function wa(b){"function"===typeof ClickTaleExec&&ClickTaleExec(b)}var O=I,xa=F;function ya(){var b=za.toString();"function"===typeof ClickTaleField&&ClickTaleField("isMobile",b)}var P=E,Aa=G;var Q="",R=document.location.pathname.toLowerCase(),Ca="",za=d,S="on",Da,Ea,Fa=location.href,T="Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Nov,Dec".split(","),U;function V(b,a){if("string"===typeof b&&"string"===typeof a)if(1<jQuery(b).length)jQuery(b).each(function(b,e){L(e,a+b)});else if(jQuery(b).length){var e=jQuery(b);L(e[0],a)}}
function W(){C(Ga,function(){var b=d;document.querySelector("#loading-view")?document.querySelector("#loading-view[style $='none;']")&&(b=c):b=c;var a=d;document.querySelector(".loading .throbber")||(a=c);return b&&a},500,10)}function Ga(){setTimeout(function(){N(X)},1E3)}
function Ha(b){var a=b.attributes,b=b.moved;if("Album"===Q||"Add"===Q)for(var e=0;e<a.length;e++){var g=a[e];jQuery(g.node).is(".album_name")&&V(".album_name","albumName")}-1<R.indexOf("/library")&&jQuery(".after-upload.visible .failed-sofar").filter(":visible").length&&O("Action| Error - upload skipped",c);if("Album"===Q)0===document.location.pathname.indexOf("/album/")&&-1<document.location.pathname.indexOf("/add")&&W();else if("Edit Image"===Q){g={side:d,bottom:d};for(e=0;e<b.length;e++){var k=
b[e];!g.side&&jQuery(k).closest(".full_view_sidebar").length&&(V(".full_view_sidebar .full_view_btn","sideBtn_"),g.side=c);!g.bottom&&jQuery(k).closest(".full_view_bottom_bar").length&&(V(".full_view_bottom_bar .full_view_btn","bottomBtn_"),g.bottom=c);if(g.side&&g.bottom)break}if(!g.bottom)for(e=0;e<a.length;e++)if(g=a[e],jQuery(g.node).closest(".full_view_bottom_bar").length){V(".full_view_bottom_bar .full_view_btn","bottomBtn_");break}}else"Add"===Q&&(jQuery(".dz-drag-hover-overlay").is(":visible")&&
O("Action| Add| Drag & Drop",c),0===document.location.pathname.indexOf("/album/")&&-1===document.location.pathname.indexOf("/add")&&W());return c}function Ia(){var b=["/albums"];if(window.onpopstate&&"function"===typeof window.onpopstate){var a=window.onpopstate;window.onpopstate=function(){a.apply(this,arguments);arguments[2]&&"string"===typeof arguments[2]&&-1===b.indexOf(arguments[2])&&W()}}window.onpopstate=function(){W()}}
function Ja(){var b="Cart"===Q?"#main.cart":"Cart Step 2"===Q?"#main.checkout":"";b&&C(function(){document.querySelector("#promoEntry")&&document.querySelector("#promoEntry").addEventListener("input",function(){var b=document.querySelector("#promoEntry").value;wa("jQuery('input#promoEntry').val(unescape('"+escape(b)+"'));")},d)},function(){return!!document.querySelector(b)},250,40)}
function Ka(){document.querySelectorAll("#bagsArea").length&&document.querySelector("#bagsArea").addEventListener("change",function(b){b=b.target;b.tagName&&"INPUT"===b.tagName&&b.classList&&b.classList.contains("cartitem-quantity-selector")&&O("Action| "+Q+"| Changed quantity",c)},d)}function La(b){var a=b.target.parentNode;K("click",b);if(a){var e={},g;for(g in b)e[g]=b[g];e.target=a;e.srcElement=a;K("mouseover",e)}}
function Ma(b){"function"===typeof window.MutationObserver&&C(function(){var a=new MutationObserver(function(){switch(Q){case "Cart":("visible"===jQuery("#preview-carousel").css("visibility")||0<jQuery(".preview").filter(":visible").not(".preview-generic").length)&&C(function(){for(var b=0;b<U.length;b++)V(U[b].selector,U[b].prefix)},function(){return!!jQuery("#modalArea .modal-footer-actions a, #modalArea .modal-footer-actions button").length},250,10);break;case "Cart Step 2":document.querySelector("ul.block-actionable-action")&&
(V('a[data-action="edit"]',"shipInfo_edit"),V('a[data-action="add"]',"shipInfo_add"))}}),e={childList:c,subtree:c},g=document.querySelector(b);g&&a.observe(g,e)},function(){return!!document.querySelector(b)},250,10)}
function X(){ra();R=document.location.pathname.toLowerCase();Ca=document.location.hostname.toLowerCase();Fa=location.href;var b="";ya();if("www.shutterfly.com"===Ca){-1<R.indexOf("/calendars")&&O("Onload| Calendar Page");if("/calendars"===R)Q="Calendar home version 2";else if(-1<R.indexOf("/myshutterfly.sfly"))Q="My Shutterfly";else if("/calendar/"===R)Q="Calendar home";else if("/order/recommendations.sfly"===R)Q="Recommendations",V('#recommendationArea .CTASection a[title="Preview"]',"preview_"),
V('#recommendationArea .CTASection a[title="Edit"]',"edit_"),V('#recommendationArea .CTASection a[title="Get Started"]',"getstarted_");else if("/checkout/cart.sfly"===R)if(-1<document.location.hash.indexOf("checkout.")){Q="Cart Step 2";var a=!(!jQuery("#paymentArea.block-editable").length&&!jQuery("#paymentArea .selected-payment > .block-mini").length),e=!!jQuery("#shippingAddressArea.block-editable").length,g="";a&&e?g="No address or payment on page":!a&&e?g="Payment on page \u00e2\u20ac\u201c no address details":
a&&!e?g="Address on page \u00e2\u20ac\u201c no payment details":!a&&!e&&(g="Payment & address details on page");""!==g&&O("Onload| Cart step 2| "+g,c);if(window.s&&window.s.products){a=window.s.products.split(",");for(e=0;e<a.length;e++)g=a[e].split(";"),1<g.length&&O("Onload| Cart step 2| product Type "+g[1],c)}Ja();Ka();V('a[data-action="edit"]',"shipInfo_edit");V('a[data-action="add"]',"shipInfo_add");Ma("#shippingArea")}else Q="Cart",V('button[data-action="checkout"]',"checkout_"),U=[{selector:'button[data-action="checkout"]',
prefix:"checkout_"},{selector:"button.modal-action",prefix:"preview_done"},{selector:'a[data-action="edit"]',prefix:"preview_edit"},{selector:'a[data-action="make-new"]',prefix:"preview_version"}],document.querySelector("#viewOfferDiscountsLink")&&O("Onload| See Saved Offers"),Ma("#modalArea"),Ja(),Ka();else-1<R.indexOf("/maincart/viewconfirm.sfly")?Q="Confirmation Page":"/account/orderdetails.jsp"===R&&(Q="Order Details");-1<document.location.href.indexOf("/calendar-styles/")?jQuery(".calendar-info button").filter("visible").length?
O("Onload| Styles Personalized"):O("Onload| Calendar styles"):-1<R.indexOf("/creationpath/")&&0<R.indexOf("/views/projects/")&&(b=window.scw&&window.scw.projType&&0<window.scw.projType.length?" "+window.scw.projType:"",0===R.indexOf("/creationpath/views/projects/")?Q="Personalize":0===R.indexOf("/creationpath/bundle/views/projects/")&&(Q="Personalize Bundle"),V("#surfaceNavigation > span","topView_"),V("#surfaceNavigation > span > img:visible","topViewImage_"));-1<document.location.href.indexOf("/calendar/viewStyle.sfly")&&
O("Onload| Styles Default")}else"photos.shutterfly.com"===Ca&&(V(".orange-btn.upload","uploadBtn"),V(".orange-btn.feedback_btn","feedbackBtn"),V(".orange-btn.faq_btn","faqBtn"),V(".album_name","albumName"),V(".feedback_secondary > div","feedbackDiv"),0<jQuery(".login_modal").length&&O("Onload| Log-In Pop Up"+Q),0===R.indexOf("/library")?(Q="Photos",a=jQuery("#library_slider .ui-slider-handle .month").length?jQuery("#library_slider .ui-slider-handle .month").text():"",Da=-1<T.indexOf(a)?T.indexOf(a):
0,a=jQuery("#library_slider .ui-slider-handle .year").length?jQuery("#library_slider .ui-slider-handle .year").text():0,Ea=parseInt(a,10)):0===R.indexOf("/folder/")?Q="Folders":-1<R.indexOf("/add")?(Q="Add",V(".upload-buttons .orange-btn.file-upload-btn","selectFilesBtn"),V(".upload-buttons .orange-btn:not(.file-upload-btn)","selectFoldersBtn")):0===R.indexOf("/album/")?-1<R.indexOf("/full/")?Q="Edit Image":(Q="Album",jQuery.each(jQuery("a.orange-btn"),function(b,a){"add photos"===jQuery(a).text().toLowerCase()&&
L(a,"addPhotosBtn")})):-1<R.indexOf("/full/")&&(Q="Edit Image",setTimeout(function(){V(".full_view","editArea_");V(".full_view_sidebar .full_view_btn","sideBtn_");V(".full_view_bottom_bar .full_view_btn","bottomBtn_");V(".full_view_btn.close","closeBtn");V(".full_view_btn.prev","prevBtn_");V(".full_view_btn.next","nextBtn_")},500)));""!==Q&&O("Onload| "+Q+b)}function Y(b,a){"string"===typeof b&&"string"===typeof a&&(b.length&&(a+="| Clicked on "+b),O(a,c))}
function Na(){var b=jQuery("#library_slider .ui-slider-handle .month").length?jQuery("#library_slider .ui-slider-handle .month").text():"",b=-1<T.indexOf(b)?T.indexOf(b):0,a=jQuery("#library_slider .ui-slider-handle .year").length?jQuery("#library_slider .ui-slider-handle .year").text():0,a=parseInt(a,10);0<a&&0<b&&(b=new Date(Ea+"-"+Da+"-1")-new Date(a+"-"+b+"-1"),31556952E3<b&&O("Action| "+Q+"| Scrolled more than a year",c),15778476E3<b&&O("Action| "+Q+"| Scrolled more than 6 months",c));jQuery("#library_slider").off("mouseleave mouseup",
Na)}
function Oa(){if(!window.ClickTaleFirstPCCGo){window.ClickTaleFirstPCCGo=c;var b=H();b&&(za=b.m);b=za?"touchstart":"mousedown";"function"!=typeof jQuery.fn.on&&(S="delegate");Ia();X();C(function(){window.ClickTaleSettings.PTC.CMBeforeFilter=Ha},function(){return!(!window.ClickTaleSettings||!window.ClickTaleSettings.PTC)},1E3,10);var a="on"===S?["mouseup","#editPageContainer"]:["#editPageContainer","mouseup"];jQuery(document)[S](a[0],a[1],function(b){b=jQuery(b.target);!b.closest("#editNavLeft").length&&!b.closest("#editNavRight").length&&
O("Action| Personalize| Interacted with Product image",c)});"Photos"==Q&&(jQuery("li.primary_btn").on("mouseenter",function(){var b=jQuery(this);setTimeout(function(){jQuery(b).is(":hover")&&O("Action| "+Q+"| interacted with top navigation",c)},3E3)}),jQuery(".scroll_control_btn").on(b,function(){O("Action| "+Q+"| Interacted with Carousel Arrows",c)}),jQuery("#library_slider").on("mousedown",function(b){b=jQuery(b.target);if(b.closest(".ui-slider-handle").length||b.closest(".tooltipline").length)jQuery("#library_slider").on("mouseleave mouseup",
Na),O("Action| "+Q+"| Interacted with Scroll",c)}),jQuery(document).on("keydown",function(b){("37"==b.keyCode||"39"==b.keyCode)&&O("Action| "+Q+"| interacted with scroll bar using keyborad",c)}));if(-1<Q.indexOf("Personalize")&&"function"===typeof window.MutationObserver){var a=new MutationObserver(function(){V("#surfaceNavigation > span","topView_");V("#surfaceNavigation > span > img:visible","topViewImage_")}),e={childList:c},g=jQuery("#surfaceNavigationContainer");g.length&&a.observe(g[0],e)}a=
"";switch(Q){case "Recommendations":a+=".primaryButton, .recommendationEntity, a.ctaLink";break;case "Cart":case "Cart Step 2":a+='#personalToolbar, img[role = "button"], button[data-action = "checkout"], .block-maskable, #promoEntry, #promoEntryButton, #continueShoppingDropdown ul, .checkout-retailEligible-learnMore, #modalArea, #viewOfferDiscountsLink, a.mobile-only, #returnToCartButton, #shippingAddressArea a, img[role = "button"], button[data-action="place-order"], .visaCheckoutButton img, img.mp-button, a[data-action="save"], #promoEntry, #promoEntryButton, #mobile-cart-item-toggle';
break;case "Confirmation Page":a+=".confirmList a";break;case "Order Details":a+="#cancelOrderButton";break;case "My Shutterfly":a+=".sfly_wgt_listview_scroll_arrow,.sfly_wgt_product"}a&&xa(document,b,a,function(b){var a=b.target;Aa(a,function(a,e,n){return function(){switch(Q){case "Recommendations":P(a,'.primaryButton[href *= "/order/cart.jsp"]')?O("Action| "+Q+"| Clicked on Continue to Cart",c):P(a,".recommendationEntity")&&(P(a,'a.secondaryButton[title="Get Started"]')&&O("Action| "+Q+"| Clicked on Get started",
c),P(a,'a.ctaLink[title="Preview"]')?O("Action| "+Q+"| Clicked on Preview",c):P(a,'a.ctaLink[title="Edit"]')&&O("Action| "+Q+"| Clicked on Edit",c));break;case "Cart":if(P(a,"#personalToolbar"))if(P(a,'a[href="/"]'))O("Action| "+Q+"| Clicked on Shutterfly home button",c);else{if(P(a,"#personalToolbar > ul"))if(O("Action| "+Q+"| Interacted with top menu",c),P(a,"a#sf3-user-dropdown-trigger"))O("Action| "+Q+"| Clicked on Account details",c);else if(P(a,"ul.sf3-dropdown-menu")&&P(a,"a")){var e=P(a,"a").innerText;
O("Action| "+Q+"| Hi Visitor| Clicked on "+e,c)}}else P(a,'img[role = "button"], button[data-action = "checkout"]')?(O("Action| "+Q+"| Clicked on any check-out CTA",c),P(a,'button[data-action="checkout"]')?(O("Action| "+Q+"| Clicked on orange check out",c),La(b)):P(a,"img.v-button")?O("Action| "+Q+"| Clicked on Visa checkout",c):P(a,"img.mp-button")&&O("Action| "+Q+"| Clicked on Masterpass",c)):P(a,".block-maskable")?P(a,".cartitem-quantity-selector")?O("Action| "+Q+"| Interacted with Change quantity Input",
c):P(a,'.cartitem-actionsArea a[data-action = "preview"]')?O("Action| "+Q+"| Clicked on Preview",c):P(a,'.cartitem-actionsArea a[data-action = "remove"]')&&O("Action| "+Q+"| Clicked on Remove",c):P(a,"#promoEntry")?O("Action| "+Q+"| Interacted with Promo Code Input",c):P(a,"#promoEntryButton")?(O("Action| "+Q+"| Entered promotion code",c),C(function(){if(document.querySelector("#promoEntry")&&document.querySelector("#promoEntry").classList.contains("form-error")){var b=document.querySelector("#promoErrorText").innerText;
O("Action| "+Q+"| error validation on promotion",c);O("Action| "+Q+"| error validation on promotion - "+b,c)}},function(){return!(!document.querySelector("#promoEntry")||!document.querySelector("#promoEntry").classList.contains("form-error"))},300,20)):P(a,"#continueShoppingDropdown ul")?P(a,".dropdown-continue-link")?O("Action| "+Q+"| Clicked on continue shopping",c):P(a,"a")&&(e=P(a,"a").innerText,O("Action| "+Q+"| Continue shopping| Clicked on "+e,c)):P(a,'a.mobile-only[href*="entry/home."]')?
O("Action| "+Q+"| Clicked on continue shopping",c):P(a,".checkout-retailEligible-learnMore")?O("Action| "+Q+"| Clicked on pick up options",c):P(a,"#modalArea")?P(a,'a[data-action = "make-new"]')?O("Action| "+Q+"| Preview| Clicked on Make a new version",c):P(a,'a[data-action = "edit"]')?O("Action| "+Q+"| Preview| Clicked on Edit",c):P(a,"button.modal-action")&&O("Action| "+Q+"| Preview| Clicked on Done",c):P(a,"#viewOfferDiscountsLink")&&(O("Action| "+Q+"| Clicked on See saved offers",c),La(b));break;
case "Cart Step 2":if(P(a,"#returnToCartButton"))O("Action| "+Q+"| Clicked on Edit Cart",c),La(b);else if(P(a,"#mobile-cart-item-toggle"))O("Action| "+Q+"| Clicked on Expand items in cart",c);else if(P(a,'img[role = "button"], button[data-action = "place-order"]'))if(O("Action| "+Q+"| Clicked on any payment CTA",c),P(a,".visaCheckoutButton img"))O("Action| "+Q+"| Clicked on Visa Checkout",c);else if(P(a,"img.mp-button"))O("Action| "+Q+"| Clicked on Masterpass",c);else{if(P(a,'button[data-action="place-order"]')&&
(P(a,"#orderTotal")?O("Action| "+Q+"| Clicked on top order CTA",c):P(a,".not-fto")&&O("Action| "+Q+"| Clicked on bottom order CTA",c),document.querySelectorAll(".shippingMethodSelectors").length)){for(var e=document.querySelectorAll(".shippingMethodSelectors input"),n,g=0;g<e.length;++g)if(e[g].checked){n=e[g].value;break}n&&O("Action| "+Q+"| Chose "+n.trim(),c)}}else P(a,"#shippingAddressArea")?P(a,'a[data-action="edit"]')?(O("Action| "+Q+"| Clicked on Edit shipping information",c),(e=document.querySelector('a[data-action="edit"]'))&&
qa(a,e)):P(a,'a[data-action="add"]')?(O("Action| "+Q+"| Clicked on Add address",c),(e=document.querySelector('a[data-action="add"]'))&&qa(a,e)):P(a,".js-recipientModeSwapButton")&&O("Action| "+Q+"| Clicked on Send to multiple addresses",c):P(a,'a[data-action="save"]')?O("Action| "+Q+"| Clicked on Save payments",c):P(a,"#promoEntry")?O("Action| "+Q+"| Interacted with Promo Code Input",c):P(a,"#promoEntryButton")&&(O("Action| "+Q+"| Entered promotion code",c),setTimeout(function(){if(document.querySelector("#promoEntry")&&
document.querySelector("#promoEntry").classList.contains("form-error")&&document.querySelector("#promoErrorText")){var b=document.querySelector("#promoErrorText").innerText;O("Action| "+Q+"| Promotion error validation",c);O("Action| "+Q+"| Promotion error validation - "+b,c)}},1E3));case "Confirmation Page":P(a,".confirmList a")&&O("Action| "+Q+"| Clicked on Order status",c);break;case "Order Details":P(a,"#cancelOrderButton")&&O("Action| "+Q+"| Clicked on Cancel order",c);break;case "My Shutterfly":P(a,
".sfly_wgt_listview_scroll_arrow")?O("Action | "+Q+" | Product Carousel: Spin",c):P(a,".sfly_wgt_product")&&O("Action | "+Q+" | Product Carousel: Select Product",c)}}.bind(n)}(a,b,this))});if(-1<"Photos,Folders,Album,Edit Image,Add,Personalize,Personalize Bundle".split(",").indexOf(Q))jQuery(document).on(b,function(b){var a=jQuery(b.target);Aa(b.target,function(){if(a.closest(".feedback_icon").length)O("Action| "+Q+"| Clicked on Feedback & Help",c);else if(a.closest(".upload").length)O("Action| "+
Q+"| Clicked on Upload",c),pa(b);else{if(jQuery("#bucket-wrapper").length){if(a.closest("#tree-view .hide-container").length){O("Action| "+Q+"| Clicked on Side Menu",c);return}if(a.closest(".create-folder").length){O("Action| "+Q+"| Clicked on Create Folder",c);return}}switch(Q){case "Photos":if(a.closest(".section_dropdown_wrap.sub_section_dropdown").length)O("Action| "+Q+'| Clicked on "View All"',c);else if(a.closest("div.primary_btn").length){var e="";if(e=jQuery(a.closest("div.primary_btn")).attr("data-href")){switch(e){case "add":e=
"upload";break;case "edit":e="Organize";break}e&&O("Action| photos| "+e,c)}}else a.closest("#section_dropdown.people").length?O("Action| photos| Tag",c):a.closest(".checkcircle").length?O("Action| photos| Photo selected",c):a.closest("#section_dropdown.people").length?O("Action| photos| Tag",c):a.closest(".create_floating_wrapper").length&&(O("Action| photos| interacted with top navigation",c),a.closest(".sfly-wgt-tl-create-photobook .sfly-wgt-tl-orange-btn").length&&O("Action| photos| photo books - see more styles",
c));break;case "Folders":a.closest(".edit").length?O("Action| "+Q+"| Clicked on Actions",c):a.closest("#tree-view .hide-container").length?O("Action| "+Q+"| Clicked on Side Menu",c):a.closest(".create-folder").length?O("Action| "+Q+"| Clicked on Create Folder",c):a.closest("#grid_edit_menu").length&&(O("Action| "+Q+"| Interacted with Actions",c),e=jQuery(a.closest("div")).attr("class"),O("Action| "+Q+"| Actions - Clicked on "+e,c));break;case "Album":a.closest(".album_name").length?O("Action| "+Q+
"| Clicked on Edit Album Name",c):a.closest(".orange-btn").length?"add photos"===jQuery(a.closest(".orange-btn")).text().toLowerCase()&&O("Action| "+Q+"| Clicked on Add Photos",c):a.closest(".count-wrap").length&&O("Action| "+Q+"| Clicked on Mark all Pictures",c);break;case "Edit Image":(a.closest(".full_view_btn.next").length||a.closest(".full_view_btn.prev").length)&&N(X);a.closest(".location .add_tag_btn").length?O("Action| "+Q+"| Interacted with Set Location",c):a.closest(".tags .add_tag_btn").length?
O("Action| "+Q+"| Clicked on Tags",c):a.closest(".people .add_tag_btn").length?O("Action| "+Q+"| Clicked on People",c):a.closest(".caption .add_tag_btn").length?O("Action| "+Q+"| Clicked on Caption",c):a.closest(".full_view_btn.info").length?O("Action| "+Q+"| Clicked on Information",c):a.closest(".full_view_btn.download").length?O("Action| "+Q+"| Clicked on Download",c):a.closest(".full_view_btn.crop").length?O("Action| "+Q+"| Clicked on Crop",c):a.closest(".full_view_btn_group.rotate").length?O("Action| "+
Q+"| Interacted with Rotate",c):a.closest(".full_view_btn.tag_people").length?O("Action| "+Q+"| Clicked on Tag People",c):a.closest(".full_view_btn.edit").length?O("Action| "+Q+"| Clicked on Edit",c):a.closest(".full_view_btn.share").length?O("Action| "+Q+"| Clicked on Share",c):a.closest(".full_view_btn.remove_from_story").length?O("Action| "+Q+"| Clicked on Remove from Album",c):a.closest(".full_view_btn.copy_to_story").length&&O("Action| "+Q+"| Clicked on Copy to",c);break;case "Add":a.closest(".upload-buttons").length?
a.closest(".orange-btn.file-upload-btn").length?O("Action| "+Q+"| Clicked on Select Files",c):O("Action| "+Q+"| Clicked on Select Folder",c):a.closest(".album_name").length&&O("Action| "+Q+"| Clicked on Edit Album Name",c);break;case "Personalize":case "Personalize Bundle":if(a.closest(".paletteLabel:visible").length)e=a.closest(".paletteLabel:visible").find("> div").text(),O("Action| Personalize| Clicked on "+e+" tab",c);else if(a.closest(".paletteContent:visible").length){var e=jQuery(".paletteLabel.active > div").text(),
g="Action| Personalize| Interacted with "+e+" tab";O(g,c);if(a.closest(".optionType").length){e=a.closest(".optionType").find(".productOptionLbl").text();e.length&&(g+="| Clicked on "+e);if(a.closest(".storeOption").length||a.closest(".storeOptionSelected").length)e=a.closest(".storeOption").find("label").text(),e.length&&(g+=": "+e);O(g,c)}else if(a.closest(".swatchCategory").length){e=a.closest(".swatchCategory").find(".assetCategoryLabel").text();e.length&&(g+="| Clicked on "+e);if(a.closest("img").length){e=
a.closest("img").attr("src");if(e.length)var A=e.split("&");jQuery.each(A,function(a,b){if(-1<b.indexOf("assetname")){var e=b.split("=");0<e.length&&(g+=": "+e[1])}})}O(g,c)}else a.closest(".bundle").length?(e=a.closest(".bundle").find(".label").text(),Y(e,g)):a.closest(".layoutCategory")&&(e=a.closest(".layoutCategory").find(".assetCategoryLabel").text(),Y(e,g));a.closest("label").length?Y(a.closest("label").text(),g):a.closest(".colorItem")?Y(a.closest(".colorItem").text(),g):a.closest(".imageOtion")&&
Y(a.closest(".imageOtion").text(),g)}else if(a.closest("#actionContainer #addToCartLink").length)O("Action| Personalize| Clicked on add to cart",c);else if(a.closest("#surfaceNavigation > span.surfacenavunit > .surfaceNavEdit").length){var p=a.closest("#surfaceNavigation > span.surfacenavunit");if(p.length){var A=p.index()+1,p=p[0],m={};for(e in b)m[e]=b[e];m.target=p;m.srcElement=p;O("Action| Personalize| Clicked on top navigation product view "+A,c);K("click",b);K("mouseover",m)}}else a.closest("#editNavLeft").length||
a.closest("#editNavRight").length?O("Action| Personalize| Interacted with carousel ",c):a.closest("#arrowForwardEdit").length||a.closest("#arrowBackwardEdit").length?O("Action| Personalize| Interacted with carousel ",c):a.closest("#actionContainer #previewLink").length?O("Action| Personalize| Clicked on preview",c):a.closest("#getPicturesBtnLarge").length?O("Action| Personalize| Clicked get photos",c):a.closest("#saveProjectLink").length&&O("Action| Personalize| Clicked save",c)}}})});a=".feedback-button.status-left a, .empty-photo-indicator";
"Photos"==Q&&(a+=", .sfly_wgt_listview_spread_container .sfly_wgt_product_hover, .select_action");if(-1<document.location.href.indexOf("/calendars")||"/calendar/"==document.location.pathname)a+=", #offer-banner1 ,#tab1, #tab2, #tab3, #walCalCtaButton, #deskCalendarScroll, #makeWallCal, .actionZone_control #startMonth, .actionZone_control #startYear, .makeacalendar, #content_0 area, .startSelection #startMonth, .startSelection #startYear, .size_8x11 input, .size_8x11 img, .size_12x12 input, .size_12x12 img";
-1<document.location.href.indexOf("/calendar-styles/")&&(a+=", .ReactModalPortal .btn-primary, .filter-styles, .calendar-info button, .calendars, .savedProjectLink");-1<document.location.href.indexOf("/calendar/viewStyle.sfly")&&(a+=", #startOverLink, #topnav_center img, #nextBtn, #startLengthWidget a, #palette_body, #startLengthWidgetMonths, #startLengthWidgetYear, #confirmDialogContainer-cancelBtnImg, #confirmDialogContainer-okBtnImg");b="on"===S?[b,a]:[a,b];jQuery(document)[S](b[0],b[1],function(a){var b=
a.target;jQuery(a);var e=jQuery(this);Aa(b,function(a){return function(){if(a.closest(".feedback-button.status-left a").length)O("Action|clicked on Send us your feedback",c);else if(a.closest(".empty-photo-indicator").length)O('Action | selectprints | Clicked on "Get Photos"',c);else{if("Photos"==Q){if(a.closest(".sfly_wgt_listview_spread_container .sfly_wgt_product_hover").length){var b=a.closest(".create_floating_wrapper").find(".sfly_wgt_listview_embedded_caption");if(b[0]){b=jQuery(b).text();
O("Action| "+b+"| Cards - see more styles",c);return}}if(a.closest(".select_action").length){O("Action| photos| "+a.closest(".select_action").text(),c);return}}if(-1<document.location.href.indexOf("/calendars")||"/calendar/"==document.location.pathname){if(a.closest("#offer-banner1").length){O("Action| Calendar home|Clicked on free shipping",c);return}if(a.closest("#tab1").length){O("Action| Calendar home|Clicked on wall calendars",c);return}if(a.closest("#tab2").length){O("Action| Calendar home| Clicked on Desk Calendars",
c);return}if(a.closest("#tab3").length){O("Action| Calendar home| Clicked on Calendar Posters ",c);return}if(a.closest(".actionZone_control #startMonth").length){jQuery("#tab1.selected").length&&O("Action| Calendar home|Interacted with month",c);jQuery("#tab2.selected").length&&O("Action| Calendar home|Interacted with month - Desk calendars",c);return}if(a.closest(".actionZone_control #startYear").length){jQuery("#tab1.selected").length&&O("Action| Calendar home|Interacted with year",c);jQuery("#tab2.selected").length&&
O("Action| Calendar home|Interacted with year - Desk calendars",c);return}if(a.closest(".makeacalendar").length){jQuery("#tab1.selected").length&&O("Action| Calendar home| Clicked on Make a calendar",c);jQuery("#tab2.selected").length&&O("Action| Calendar home| Clicked on Make a calendar -- Desk calendars",c);jQuery("#tab3.selected").length&&O("Action| Calendar home| Clicked on Make a calendar - Posters",c);return}if(a.closest("#content_0 area").length){O("Action| Calendar home| Clicked on see all styles",
c);return}if(a.closest(".actionZone_control select[name='sizeDropDown']").length){O("Action| Calendar home|Interacted with size - Posters",c);return}if(a.closest(".size_8x11 input").length||a.closest(".size_8x11 img").length){O("Action| Calendar home - version 2| Clicked on size 8*11",c);return}if(a.closest(".size_12x12 input").length||a.closest(".size_12x12 img").length){O("Action| Calendar home - version 2| Clicked on size 12*12",c);return}if(a.closest(".startSelection #startMonth").length){O("Action| Calendar home - version 2| Clicked on month",
c);return}if(a.closest(".startSelection #startYear").length){O("Action| Calendar home - version 2| Clicked on year",c);return}if(a.closest("#walCalCtaButton").length){O("Action| Calendar home - version 2| Clicked on Make a calendar",c);return}if(a.closest("#deskCalendarScroll").length){O("Action| Calendar home - version 2| Clicked on desk calendar & more",c);return}if(a.closest("#makeWallCal").length){O("Action| Calendar home - version 2| Clicked on Make a wall calendar",c);return}}if(-1<document.location.href.indexOf("/calendar-styles/")){if(a.closest(".ReactModalPortal .btn-primary").length){O("Action| Calendar styles |Clicked on Choose style - on choose style",
c);return}if(a.closest(".filter-styles").length){O("Action| interacted with All Styles",c);return}if(a.closest(".calendar-info button").length){O("Action| Calendar styles - personalize |Clicked on Personalize",c);return}if(a.closest(".calendars").length){O("Action| Clicked on any calendar",c);return}if(a.closest(".savedProjectLink").length){O("Action| Clicked on My saved projects",c);return}}-1<document.location.href.indexOf("/calendar/viewStyle.sfly")&&(a.closest("#startOverLink").length?O("Action| Calendar styles - default |Clicked on start new calendars",
c):a.closest("#topnav_center img").length?(b=a.closest("#topnav_center img").attr("src"))&&(-1<b.indexOf("style")?O("Action| Calendar styles - default |Clicked on Style",c):-1<b.indexOf("edit")?O("Action| Calendar styles - default |Clicked on Edit",c):-1<b.indexOf("preview")&&O("Action| Calendar styles - default |Clicked on Preview",c)):a.closest("#nextBtn").length?O("Action| Calendar styles - default |Clicked on Next",c):a.closest("#startLengthWidget a").length?O("Action| Calendar styles - default |Interacted with date",
c):a.closest("#palette_body").length?O("Action| Calendar styles - default |Clicked on any style",c):a.closest("#startLengthWidgetMonths").length?O("Action| Calendar styles - default |Clicked on month",c):a.closest("#startLengthWidgetYear").length?O("Action| Calendar styles - default |Clicked on year",c):a.closest("#confirmDialogContainer-okBtnImg").length?O("Action| Calendar styles - default |Clicked on Save",c):a.closest("#confirmDialogContainer-cancelBtnImg").length&&O("Action| Calendar styles - default |Clicked on Don't save",
c))}}.bind(a[0])}(e,b,a))});jQuery("#siteSubNav>li").on("mouseenter mouseleave",function(a){var b='jQuery("#siteSubNav>li .dropdownContent").eq('+jQuery("#siteSubNav>li").index(jQuery(this))+")",b="mouseenter"==a.type?b+".show();":b+".hide();";wa(b)});if(0<jQuery("#srchTxtField").length&&"function"===typeof jQuery.fn.on)jQuery("#srchTxtField").on("input",function(){var a=jQuery(this).val()||"";wa('jQuery("#srchTxtField").val(unescape("'+escape(a)+'"));')})}}
(function(b){function a(){2==++window.okToStartOn2&&b()}window.okToStartOn2=0;ka(function(){a()});if("function"==typeof ClickTaleIsRecording&&ClickTaleIsRecording()===c)a();else{var e=window.ClickTaleOnRecording||function(){};window.ClickTaleOnRecording=function(){a();return e.apply(this,arguments)}}})(function(){ua();C(Oa,function(){return window.jQuery&&"function"===typeof jQuery.fn.on?c:d},250,40)});
window.ClicktaleIntegrationExperienceHandler=function(b,a,e){var g;return function(){var k=this,n=arguments,Z=e&&!g;clearTimeout(g);g=setTimeout(function(){g=null;e||b.apply(k,n)},a);Z&&b.apply(k,n)}}(function(){N(X,document.location.href);arguments.length&&na(arguments)},400,d);window.clickTaleStartEventSignal=function(b){N(X,location.href,Fa);b&&"string"===typeof b&&O(b)};window.clickTaleEndEventSignal=function(){oa()};})();} }, function () { return !!(window.ClickTaleSettings && window.ClickTaleSettings.PTC && typeof window.ClickTaleSettings.PTC.okToRunPCC != 'undefined'); }, 500, 20);

