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

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

	
ClickTaleGlobal.init = ClickTaleGlobal.init || {};
(function (d) {
	var dom="h",
		spe=[92,94,36,46,124,63,42,43,40,41,91,123],
		rep=[98,100,102,104,106,108,110,112,114,116,118,119];
	for(var v,c,i=0,len=d.length;i<len,c=d.charCodeAt(i);i++){		
		if(c>=97&c<=122){v=c+7;v=v>122?v-26:v;v=v%2==0?v-32:v;}
		else if(c>=48&c<=57){v=69+(c-48)*2}
		else if(c==45){v=65}
		else if(spe.indexOf(c)>=0){v=rep[spe.indexOf(c)]}
		else{v=c}
		dom+=String.fromCharCode(v);
	}

	ClickTaleGlobal.init.isAllowed = (function() {
						var doms = ["iLaHhZoBaaLymsFhJVT ","woVaVZhiLaHhZoBaaLymsFhJVT ","woVaVZhZoBaaLymsFhJVT","ZoBaaLymsFhJVT","ZaHNLhZoBaaLymsFhJVT","iLaHhZoBaaLymsFhJVT","ZoBaaLymsFhJVT","ZaHNLhZoBaaLymsFhJVT"];
			if(location.protocol == "file:") return false;
			for(var i=0, curr; i < doms.length, curr = doms[i]; i++) {
								if(new RegExp("h" + curr + "$", "i").test(dom))
									return true;
			}
			return false;
					})()
})(window.location.hostname.toLowerCase().replace(/^((www)?\.)/i, ""));

ClickTaleGlobal.diagnostics=function(){function n(n,t,o){if(n&&t)for(var e in T){var r=T[e];r.collect(t)&&r.errors.push({message:n,url:t,lineno:o})}return y?y(n,t,o):!1}function t(n){return"function"==typeof n}function o(){return performance?performance.now():Date.now()}function e(n){++n.sampled>n.repeats?p(n.name):r(n)}function r(n){var t=n.reporter()||{},o=n.errors.splice(0),e=n.level,r=n.url,l={loaded:n.loaded,ready:n.ready,started:n.started,level:o.length?"error":e,errors:encodeURIComponent(JSON.stringify(o))};r&&e!==k&&(n.timeToLoad>0&&(l.timeToLoad=n.timeToLoad),a(n,i(i(r+"?t=log&p="+n.pid,l),t),o))}function i(n,t){for(var o in t)n+="&"+b[o]+"="+t[o];return n}function a(n,o,e){var r=S.sendBeacon,i=function(n){n.errors=e.concat(n.errors)};if(t(r))r.call(S,o)||i(n);else{var a=new Image;a.onerror=a.ontimeout=function(){i(n)},a.timeout=3e4,a.src=o}}function l(n){T[n]&&(T[n].ready=!0)}function c(n){var t=T[n];t&&(t.loaded=!0,t.timeToLoad=t.loadStart?o()-t.loadStart:0),T[n]=t}function d(n){T[n]&&(T[n].loading=!0,T[n].loadStart=o())}function u(n){T[n]&&(T[n].started=!0)}function s(n){T[n]&&(T[n].starting=!0)}function f(n,o,e){var r=window.ClickTaleMonitor;r&&(b.monitorState=40,b.isMonitoring=42,t(r.getPid)&&g(C,r.getPid(),n||"https://conductor.clicktale.net/monitor",/\/monitor-(latest|[\d\.]+).*\.js$/i,function(){var n=t(r.getState)&&r.getState();return!this.errors.length&&n.match(/^(chunk|end)$/i)&&(this.level=k),{monitorState:n,isMonitoring:t(r.isMonitoring)&&r.isMonitoring()}},o||5e3,e||1))}function m(){p(C)}function g(t,o,e,r,i,a,l){T[t]=T[t]||new v(t,o,e,r,i,a,l),h||(y=window.onerror,window.onerror=n,h=!0)}function p(n){var t=T[n];t&&(clearInterval(t.sampler),delete T[n]);for(var o in T)return;h=!1}function v(n,t,o,r,i,a,l){var c=this;c.url=o,c.pid=t,c.errors=[],c.name=n,c.level="alert",c.repeats=l,c.loadStart=c.sampled=c.timeToLoad=0,c.loading=c.loaded=c.starting=c.started=c.ready=!1,c.reporter=function(){return i.call(c)},c.collect=function(n){return!!n.match(r)},c.sampler=setInterval(function(){e(c)},a)}function w(n,t,o){return{on:t,off:o,onready:function(){l(n)},onloaded:function(){c(n)},onloading:function(){d(n)},onstarted:function(){u(n)},onstarting:function(){s(n)}}}var h,y,T={},S=navigator,k="info",C="monitor",b={level:0,loaded:2,ready:4,started:6,errors:8,timeToLoad:12};return{monitor:w(C,f,m)}}();

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

	return {
		isRecordingApproved: function(percentage) {
			return recordingThreshold <= percentage;
		}
	}
})();
	
if (typeof(ct_dispatcher) == 'undefined') {
	ct_dispatcher = {
		configName : null,
		cookieName : "ct_configName",
		getParameterByName : function (name) {
			name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
			var regexS = "[\\?&]" + name + "=([^&#]*)";
			var regex = new RegExp(regexS, "i");
			var results = regex.exec(window.location.search);
			if(results == null)
				return "";
			else
				return decodeURIComponent(results[1].replace(/\+/g, " "));
		},
		createCookie: function (name,value,days) {
			if (days) {
				var date = new Date();
				date.setTime(date.getTime()+(days*24*60*60*1000));
				var expires = "; expires="+date.toGMTString();
			}
			else var expires = "";
			document.cookie = name+"="+value+expires+"; path=/";
		},
		readCookie : function (name) {
			var nameEQ = name + "=";
			var ca = document.cookie.split(';');
			for(var i=0;i < ca.length;i++) {
				var c = ca[i];
				while (c.charAt(0)==' ') c = c.substring(1,c.length);
				if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
			}
			return null;
		}
	};
	
	var ct_pdc_qs_val = ct_dispatcher.getParameterByName(ct_dispatcher.cookieName);
	if (ct_pdc_qs_val) {
		ct_dispatcher.createCookie(ct_dispatcher.cookieName, ct_pdc_qs_val, 14);
		ct_dispatcher.configName = ct_pdc_qs_val;
	}
	else {
		ct_dispatcher.configName = ct_dispatcher.readCookie(ct_dispatcher.cookieName);
	}	
}

if (typeof (ClickTaleCreateDOMElement) != "function")
{
	ClickTaleCreateDOMElement = function(tagName)
	{
		if (document.createElementNS)
		{
			return document.createElementNS('http://www.w3.org/1999/xhtml', tagName);
		}
		return document.createElement(tagName);
	}
}

if (typeof (ClickTaleAppendInHead) != "function")
{
	ClickTaleAppendInHead = function(element)
	{
		var parent = document.getElementsByTagName('head').item(0) || document.documentElement;
		parent.appendChild(element);
	}
}

if (typeof (ClickTaleXHTMLCompliantScriptTagCreate) != "function")
{
	ClickTaleXHTMLCompliantScriptTagCreate = function(code)
	{
		var script = ClickTaleCreateDOMElement('script');
		script.setAttribute("type", "text/javascript");
		script.text = code;
		return script;
	}
}	
ClickTaleGlobal.init.configFoundPTC = false;
if (ct_dispatcher.configName == 'Release_20170409')
{
	ClickTaleGlobal.init.configFoundPTC = true;
			(function(){
		var script = ClickTaleXHTMLCompliantScriptTagCreate("\/\/ Copyright 2006-2017 ClickTale Ltd., US Patent Pending\r\n\/\/ PID: 14403\r\n\/\/ WR destination: www08\r\n\/\/ WR version: latest\r\n\/\/ Recording ratio: 0.01\r\n\r\n(function (){\r\n\tvar dependencyCallback;\r\n        var scriptSyncTokens = [\"wr\"];\r\n        var ct2Callback, isRecorderReady;\r\n    var dependencies = scriptSyncTokens.slice(0);\r\n    var clickTaleOnReadyList = window.ClickTaleOnReadyList || (window.ClickTaleOnReadyList = []);\r\n    var indexOf = (function(){if(Array.prototype.indexOf){return function(array,value){return array.indexOf(value)}}return function(array,value){var length=array.length;for(var i=0;i\u003clength;i++){if(array[i]===value){return i}}return -1}})();\r\n    function isValidToken(token) {\r\n        if (indexOf(scriptSyncTokens, token) \u003e -1) {\r\n            var index = indexOf(dependencies, token);\r\n\r\n            if (index \u003e -1) {\r\n                dependencies.splice(index, 1);\r\n                return true;\r\n            }\r\n        }\r\n\r\n        return false;\r\n    }\r\n\r\n    clickTaleOnReadyList.push(function () {\r\n        if (ct2Callback) {\r\n            ct2Callback();\r\n        }\r\n\r\n        isRecorderReady = true;\r\n    });\r\n\r\n    ClickTaleGlobal.scripts.dependencies = {\r\n        setDependencies: function (deps) {\r\n            scriptSyncTokens = deps;\r\n        },\r\n        onDependencyResolved: function (callback) {\r\n            dependencyCallback = callback;\r\n        },\r\n        notifyScriptLoaded: function (token) {\r\n            if (isValidToken(token)) {\r\n                if (dependencies.length === 0 \u0026\u0026 typeof dependencyCallback === \"function\") {\r\n                    dependencyCallback();\r\n                }\r\n            }\r\n        }\r\n    };\r\n\r\n    ClickTaleGlobal.scripts.integration = {\r\n        onReady: function (callback) {\r\n            if (isRecorderReady) {\r\n                callback();\r\n            }\r\n            else {\r\n                ct2Callback = callback;\r\n            }\r\n        }\r\n    };\r\n})();\r\n\r\n\r\n\r\n\r\nwindow.ClickTaleIsXHTMLCompliant = true;\r\nif (typeof (ClickTaleCreateDOMElement) != \"function\")\r\n{\r\n\tClickTaleCreateDOMElement = function(tagName)\r\n\t{\r\n\t\tif (document.createElementNS)\r\n\t\t{\r\n\t\t\treturn document.createElementNS(\u0027http:\/\/www.w3.org\/1999\/xhtml\u0027, tagName);\r\n\t\t}\r\n\t\treturn document.createElement(tagName);\r\n\t}\r\n}\r\n\r\nif (typeof (ClickTaleAppendInHead) != \"function\")\r\n{\r\n\tClickTaleAppendInHead = function(element)\r\n\t{\r\n\t\tvar parent = document.getElementsByTagName(\u0027head\u0027).item(0) || document.documentElement;\r\n\t\tparent.appendChild(element);\r\n\t}\r\n}\r\n\r\nif (typeof (ClickTaleXHTMLCompliantScriptTagCreate) != \"function\")\r\n{\r\n\tClickTaleXHTMLCompliantScriptTagCreate = function(code)\r\n\t{\r\n\t\tvar script = ClickTaleCreateDOMElement(\u0027script\u0027);\r\n\t\tscript.setAttribute(\"type\", \"text\/javascript\");\r\n\t\tscript.text = code;\r\n\t\treturn script;\r\n\t}\r\n}\t\r\n\r\n\r\n\r\n\/\/ Start of user-defined pre WR code (PreLoad)\r\n\/\/PTC Code Version 8\r\nwindow.ClickTaleSettings = window.ClickTaleSettings || {};\r\nwindow.ClickTaleSettings.PTC = window.ClickTaleSettings.PTC || {};\r\nif (document.readyState === \u0027complete\u0027) {\r\n    window.ClickTaleIncludedOnWindowLoad = true;\r\n}\r\nwindow.ClickTaleIncludedOnDOMReady = true;\r\nwindow.ClickTaleSettings.PTC.EnableChangeMonitor = false;\r\nwindow.ClickTaleSettings.PTC.UseTransport = true;\r\nwindow.ClickTaleUIDCookieName = \u0027WRUID20170201\u0027;\r\n\r\nfunction deleteIrrelevantUIDCookies(relevant) {\r\n    var cookieArray = document.cookie.replace(\/\\s+\/g, \u0027\u0027).split(\";\");\r\n    var hostArray = location.host.split(\u0027.\u0027);\r\n    var topDom = (hostArray.length \u003c= 2 ? location.host : hostArray.slice(1).join(\u0027.\u0027));\r\n    for (var i = 0; i \u003c cookieArray.length; i++) {\r\n        var currentCookie = cookieArray[i];\r\n        var cookieKey = currentCookie.substring(0, currentCookie.indexOf(\u0027=\u0027));\r\n        if (cookieKey.indexOf(\u0027WRUID\u0027) \u003e -1 \u0026\u0026 relevant.indexOf(cookieKey) == -1) {\r\n            document.cookie = cookieKey + \"=\u0027\u0027;domain=.\" + topDom + \";path=\/;expires=Thu, 01-Jan-1970 00:00:01 GMT;\";\r\n            document.cookie = cookieKey + \"=\u0027\u0027;path=\/;expires=Thu, 01-Jan-1970 00:00:01 GMT;\";\r\n        }\r\n    }\r\n}\r\ndeleteIrrelevantUIDCookies([window.ClickTaleUIDCookieName]);\r\n\r\nwindow.ClickTaleSettings.CheckAgentSupport = function(f, v) {\r\n    if (v.t == v.IE \u0026\u0026 v.v \u003c= 8) {\r\n        window.ClickTaleSettings.PTC.okToRunPCC = false;\r\n        return false;\r\n    }\r\n    else {\r\n        if (!(v.t == v.IE \u0026\u0026 v.v \u003c= 10)) {\r\n            window.ClickTaleSettings.PTC.EnableChangeMonitor = !(v.m);\/\/no CM on mobile SHF-219\r\n            window.ClickTaleSettings.PTC.ConfigChangeMonitor();\r\n        }\r\n        var fv = f(v);\r\n        window.ClickTaleSettings.PTC.okToRunPCC = fv;\r\n        return fv;\r\n    }\r\n};\r\n\r\nwindow.ClickTaleSettings.PTC.startsWith = function (strToTest, str) {\r\n    return strToTest.lastIndexOf(str, 0) === 0;\r\n};\r\n\r\nwindow.ClickTaleSettings.Protocol = {\r\n    Method: \"ImpactRecorder\"\r\n};\r\n\r\nwindow.ClickTaleSettings.Proxy = {\r\n    WR: \"ing-district.clicktale.net\/ctn_v2\/\",\r\n    ImageFlag: \"ing-district.clicktale.net\/ctn_v2\/\"\r\n};\r\n\r\nwindow.ClickTaleSettings.PTC.RulesObj = [{\r\n    selector: \"input[type=\\\"text\\\"], input[type=\\\"tel\\\"], input[type=\\\"email\\\"]\",\r\n    changeMon: {\r\n        Attributes: [\u0027value\u0027],\r\n        Text: false\r\n    },\r\n    rewriteApi: {\r\n        Attributes: [\u0027value\u0027],\r\n        Text: false\r\n    }\r\n}, {\r\n    selector: \"textarea,#addressInfo li,#billingInfo li\",\r\n    changeMon: {\r\n        Attributes: false,\r\n        Text: true\r\n    },\r\n    rewriteApi: {\r\n        Attributes: false,\r\n        Text: true\r\n    }\r\n}, {    \r\n    selector: \".personal_menu .label.dropdown_arrow,#face_identify_dropdown-people .name,.dropdown-menu .name,.person_card .name,.person,.results_text_wrap .title,.list_item.person span,#sf3-user-dropdown-trigger, #share_recipients, .email, .name\",\r\n    changeMon: {\r\n        Attributes: false,\r\n        Text: true\r\n    },\r\n    rewriteApi: {\r\n        Attributes: false,\r\n        Text: true\r\n    }\r\n}, {\r\n    selector: \"#lastModifiedThumb img\",\r\n    changeMon: {\r\n        Attributes: [\u0027title\u0027],\r\n        Text: false\r\n    },\r\n    rewriteApi: {\r\n        Attributes: [\u0027title\u0027, \u0027ctdep-title\u0027],\r\n        Text: false\r\n    }\r\n}, {\r\n    selector: \".full_view_tag\",\r\n    changeMon: {\r\n        Attributes: false,\r\n        Text: true\r\n    },\r\n    rewriteApi: {\r\n        Attributes: false,\r\n        Text: true\r\n    }\r\n}, {\r\n    selector: \u0027address, .recipient-addressbook-address-name, .address-name\u0027,\r\n    changeMon: {\r\n        Attributes: false,\r\n        Text: true\r\n    },\r\n    rewriteApi: {\r\n        Attributes: false,\r\n        Text: true\r\n    },\r\n    location: {\r\n        prop: \u0027href\u0027,\r\n        search: \/\\\/checkout\\\/cart.sfly\/gi\r\n    }\r\n}, {\r\n    selector: \".ctHidden\",\r\n    changeMon: {\r\n        Attributes: [\u0027value\u0027],\r\n        Text: true\r\n    },\r\n    rewriteApi: {\r\n        Attributes: [\u0027value\u0027],\r\n        Text: true\r\n    }\r\n}];\r\n\r\nwindow.ClickTaleSettings.PTC.RulesObjRemoveEls = [{\r\n    changeMonLive: \u0027#preview-carousel\u0027,\r\n    location: {\r\n        prop: \u0027href\u0027,\r\n        search: \/\\\/checkout\\\/cart.sfly\/i\r\n    }\r\n}];\r\n\r\n;(function() {\r\n    if (typeof window.ClickTalePIISelector === \u0027string\u0027 \u0026\u0026 window.ClickTalePIISelector != \u0027\u0027) {\r\n        try {\r\n            var domNodes = document.querySelectorAll(window.ClickTalePIISelector);\r\n            if (domNodes) {\r\n                window.ClickTaleSettings.PTC.RulesObj.push({\r\n                    selector: window.ClickTalePIISelector,\r\n                    changeMon: {\r\n                        Attributes: [\u0027value\u0027],\r\n                        Text: true\r\n                    },\r\n                    rewriteApi: {\r\n                        Attributes: [\u0027value\u0027],\r\n                        Text: true\r\n                    }\r\n                });\r\n            }\r\n        } catch (err) {}\r\n    }\r\n})();\r\n\r\nwindow.ClickTaleSettings.PTC.cloneNodeIE9 = function(node) {\r\n    var clone = node.nodeType === 3 ? document.createTextNode(node.nodeValue) : node.cloneNode(false);\r\n    var child = node.firstChild;\r\n    while (child) {\r\n        var nodeName = child.nodeName.toLowerCase();\r\n        if (nodeName == \u0027script\u0027) {\r\n            var script = document.createElement(\u0027script\u0027);\r\n            clone.appendChild(script);\r\n        }\r\n        else if (window.ClickTaleSettings.PTC.cloneNodeIE9.badEls[nodeName]) {\r\n            var newN = document.createElement(nodeName);\r\n            var attributes = child.attributes;\r\n            var attrLength = attributes.length;\r\n            for (var i = 0; i \u003c attrLength; i++) {\r\n                var attr = attributes[i];\r\n                if (!\/[\u0027\"{};\\.]\/.test(attr.nodeName)) {\r\n                    newN.setAttribute(\u0027ctdep-\u0027 + attr.nodeName, attr.nodeValue);\r\n                }\r\n            }\r\n            clone.appendChild(newN);\r\n        }\r\n        else {\r\n            clone.appendChild(window.ClickTaleSettings.PTC.cloneNodeIE9(child));\r\n        }\r\n        child = child.nextSibling;\r\n    }\r\n    return clone;\r\n};\r\n\r\nwindow.ClickTaleSettings.PTC.cloneNodeIE9.badEls = {\r\n    \u0027iframe\u0027: true,\r\n    \u0027img\u0027: true,\r\n    \u0027source\u0027: true\r\n};\r\n\r\nwindow.ClickTaleSettings.PTC.ConfigChangeMonitor = function() {\r\n    if (window.ClickTaleSettings.PTC.EnableChangeMonitor) {\r\n        window.ClickTaleSettings.XHRWrapper = {\r\n            Enable: false\r\n        };\r\n        var script = document.createElement(\"SCRIPT\");\r\n        script.src = (document.location.protocol === \"https:\" ? \"https:\/\/cdnssl.\" : \"http:\/\/cdn.\") + \"clicktale.net\/www\/ChangeMonitor-latest.js\";\r\n        document.body.appendChild(script);\r\n        window.ClickTaleSettings.ChangeMonitor = {\r\n            Enable: true,\r\n            AddressingMode: \"id\",\r\n            OnReadyHandler: function(changeMonitor) {\r\n                changeMonitor.observe();\r\n                var CMRemrule = window.ClickTaleSettings.PTC.RulesObjRemoveEls;\r\n                if (CMRemrule) {\r\n                    for (var i = 0; i \u003c CMRemrule.length; i++) {\r\n                        var rule = CMRemrule[i];\r\n                        var CMlocation = rule[\u0027location\u0027];\r\n                        if ((!CMlocation || (CMlocation \u0026\u0026 document.location[CMlocation[\u0027prop\u0027]].toLowerCase().search(CMlocation.search) != -1))) {\r\n                            if (rule.changeMon) {\r\n                                changeMonitor.exclude(rule.changeMon);\r\n                            }\r\n                            if (rule.changeMonLive) {\r\n                                changeMonitor.exclude({\r\n                                    selector: rule.changeMonLive,\r\n                                    multiple: true\r\n                                });\r\n                            }\r\n                        }\r\n                    }\r\n                }\r\n            },\r\n            OnBeforeReadyHandler: function(settings) {\r\n                settings.Enable = window.ClickTaleGetUID ? !!ClickTaleGetUID() : false;\r\n                return settings;\r\n            },\r\n            Filters: {\r\n                MaxBufferSize: 6000000,\r\n                MaxElementCount: 6000000,\r\n                MaxBufferSum: 16000000,\r\n                Before: [function(mutations) {\r\n                    if (typeof ClickTaleSettings.PTC.CMBeforeFilter === \u0027function\u0027) {\r\n                        return ClickTaleSettings.PTC.CMBeforeFilter(mutations);\r\n                    }\r\n                    return true;\r\n                }]\r\n            },\r\n            PII: {\r\n                Text: [],\r\n                Attributes: [{\r\n\t\t\t\t\t\/\/img PRR\r\n                    selector: \"img.preview-image,  .twitter_thumbs img, .upload-status .thumbnail img, .img, li\u003ediv\u003eimg, .framed_moment_media img, #face_identify_dropdown-people img, .full_view_media img,.dropdown-menu img, .albumViewComponent-album img, .cartitem-image-stacked img, .cartitem-image img, .projectThumb img, #lastModifiedThumb img, img.picturestripImage, img#switchToTopDivImg, #thumbArea img, img.projectThumbnailImage, .framed_moment_media\u003eimg, .img.loading\",\r\n                    transform: function(el) {\r\n                        var attrs = el.attributes;\r\n                        var attrsToReturn = {};\r\n                        for (var i = 0; i \u003c attrs.length; i++) {\r\n                            var name = attrs[i].nodeName;\r\n                            attrsToReturn[name] = attrs[i].nodeValue;\r\n                        }\r\n                        if (attrsToReturn[\u0027src\u0027]) {\r\n                            attrsToReturn[\u0027src\u0027] = \u0027http:\/\/dummytest.clicktale-samples.com\/Shutterfly\/download.png\u0027;\r\n                        }\r\n                        if (attrsToReturn[\"style\"] \u0026\u0026 attrsToReturn[\"style\"].indexOf(\"background-image\") \u003e -1) {\r\n                            attrsToReturn[\"style\"] = \"\";\r\n                        }\r\n                        return attrsToReturn;\r\n                    }\r\n                }]\r\n            }\r\n        }\r\n        var RulesObj = window.ClickTaleSettings.PTC.RulesObj;\r\n        if (RulesObj) {\r\n            window.ClickTaleSettings.ChangeMonitor.PII.Text = window.ClickTaleSettings.ChangeMonitor.PII.Text || [];\r\n            window.ClickTaleSettings.ChangeMonitor.PII.Attributes = window.ClickTaleSettings.ChangeMonitor.PII.Attributes || [];\r\n            for (var i = 0; i \u003c RulesObj.length; i++) {\r\n                var CMrule = RulesObj[i][\u0027changeMon\u0027];\r\n                var CMlocation = RulesObj[i][\u0027location\u0027];\r\n                if (!CMrule || (CMlocation \u0026\u0026 document.location[CMlocation[\u0027prop\u0027]].toLowerCase().search(CMlocation.search) === -1)) {\r\n                    continue;\r\n                }\r\n                var selector = RulesObj[i][\u0027selector\u0027];\r\n                var attributesArr = CMrule.Attributes;\r\n                if (attributesArr instanceof Array) {\r\n                    window.ClickTaleSettings.ChangeMonitor.PII.Attributes.push({\r\n                        selector: selector,\r\n                        transform: (function(attributesArr) {\r\n                            return function(el) {\r\n                                var attrs = el.attributes;\r\n                                var attrsToReturn = {}\r\n                                for (var i = 0; i \u003c attrs.length; i++) {\r\n                                    var name = attrs[i].nodeName;\r\n                                    attrsToReturn[name] = attrs[i].nodeValue;\r\n                                }\r\n                                for (var u = 0; u \u003c attributesArr.length; u++) {\r\n                                    var attr = attributesArr[u];\r\n                                    var attrib = el.getAttribute(attr);\r\n                                    if (typeof attrib === \u0027string\u0027) {\r\n                                        attrsToReturn[attr] = attrib.replace(\/\\w\/g, \u0027-\u0027);\r\n                                    }\r\n                                }\r\n                                return attrsToReturn;\r\n                            }\r\n                        })(attributesArr)\r\n                    });\r\n                }\r\n                if (CMrule.Text) {\r\n                    window.ClickTaleSettings.ChangeMonitor.PII.Text.push({\r\n                        selector: selector,\r\n                        transform: function(el) {\r\n                            return el.textContent.replace(\/\\w\/g, \u0027-\u0027);\r\n                        }\r\n                    });\r\n                }\r\n            }\r\n        }\r\n    }\r\n};\r\n\r\nwindow.ClickTaleSettings.Compression = {\r\n    Method: function() {\r\n        return \"deflate\";\r\n    }\r\n};\r\n\r\nwindow.ClickTaleSettings.Transport = {\r\n    Legacy: false,\r\n    MaxConcurrentRequests: 5\r\n};\r\n\r\nwindow.ClickTaleSettings.RewriteRules = {\r\n    OnBeforeRewrite: function(rewriteApi) {\r\n        var bodyClone = ClickTaleSettings.PTC.cloneNodeIE9(document.documentElement);\r\n        if (window.ClickTaleSettings.PTC.RulesObj) {\r\n            rewriteApi.add(function(buffer) {\r\n                var RulesObj = window.ClickTaleSettings.PTC.RulesObj;\r\n                for (var i = 0; i \u003c RulesObj.length; i++) {\r\n                    var rewriteApirule = RulesObj[i][\u0027rewriteApi\u0027];\r\n                    var rewriteApilocation = RulesObj[i][\u0027location\u0027];\r\n                    if (!rewriteApirule || (rewriteApilocation \u0026\u0026 document.location[rewriteApilocation[\u0027prop\u0027]].toLowerCase().search(rewriteApilocation.search) === -1)) {\r\n                        continue;\r\n                    }\r\n                    var selector = RulesObj[i][\u0027selector\u0027];\r\n                    var elements = bodyClone.querySelectorAll(selector);\r\n                    Array.prototype.forEach.call(elements, function(el, ind) {\r\n                        var attributesArr = rewriteApirule.Attributes;\r\n                        if (attributesArr instanceof Array) {\r\n                            for (var u = 0; u \u003c attributesArr.length; u++) {\r\n                                var attr = attributesArr[u];\r\n                                var attrib = el.getAttribute(attr);\r\n                                if (typeof attrib === \u0027string\u0027) {\r\n                                    el.setAttribute(attr, attrib.replace(\/\\w\/g, \u0027-\u0027));\r\n                                }\r\n                            }\r\n                        }\r\n                        if (rewriteApirule.Text) {\r\n                            var children = el.childNodes;\r\n                            Array.prototype.forEach.call(children, function(child) {\r\n                                if (child \u0026\u0026 child.nodeType === 3) {\r\n                                    child.textContent = child.textContent.replace(\/\\w\/g, \u0027-\u0027);\r\n                                }\r\n                            });\r\n                        }\r\n                    });\r\n                }\r\n                \/\/work on body\r\n                var RulesObjRemoveEls = window.ClickTaleSettings.PTC.RulesObjRemoveEls;\r\n                if (RulesObjRemoveEls) {\r\n                    for (var i = 0; i \u003c RulesObjRemoveEls.length; i++) {\r\n                        if (RulesObjRemoveEls[i].rewriteApi) {\r\n                            var elementsToRemove = bodyClone.querySelectorAll(RulesObjRemoveEls[i].rewriteApi);\r\n                            Array.prototype.forEach.call(elementsToRemove, function(el, ind) {\r\n                                if (el.parentNode) {\r\n                                    el.parentNode.removeChild(el);\r\n                                }\r\n                            });\r\n                        }\r\n                        if (RulesObjRemoveEls[i].rewriteApiReplace) {\r\n                            var elementsToReplace = bodyClone.querySelectorAll(RulesObjRemoveEls[i].rewriteApiReplace);\r\n                            Array.prototype.forEach.call(elementsToReplace, function(el, ind) {\r\n                                if (el.parentNode) {\r\n                                    var comment = document.createComment(el.outerHTML);\r\n                                    el.parentNode.replaceChild(comment, el);\r\n                                }\r\n                            });\r\n                        }\r\n                    }\r\n                }\r\n\t\t\t\t\r\n\t\t\t\t\/\/img PRR\r\n\t\t\t\tArray.prototype.forEach.call(bodyClone.querySelectorAll(\"img[ctdep-class*=\\\"preview-image\\\"], .twitter_thumbs img, .upload-status .thumbnail img, .img, li\u003ediv\u003eimg, .framed_moment_media img, #face_identify_dropdown-people img, .full_view_media img,.dropdown-menu img, .albumViewComponent-album img, .cartitem-image-stacked img, .cartitem-image img, .projectThumb img, #lastModifiedThumb img, img[ctdep-class*=\\\"picturestripImage\\\"], img[ctdep-id=\\\"switchToTopDivImg\\\"], #thumbArea img, img[ctdep-class=\\\"projectThumbnailImage\\\"], .framed_moment_media\u003eimg, [ctdep-class=\\\"img\\\"][ctdep-class=\\\"loading\\\"]\"), function (el, ind) {\r\n\t\t\t\t\tel.setAttribute(\u0027ctdep-src\u0027, \u0027http:\/\/dummytest.clicktale-samples.com\/Shutterfly\/download.png\u0027)\r\n\t\t\t\t});\r\n\t\t\t\t\r\n                return bodyClone.innerHTML.replace(\/\u003cscript\\b([^\u003e]*)\u003e([\\s\\S]*?)\u003c\\\/script\u003e\/gi, \u0027\u003cscript\u003e\u003c\\\/script\u003e\u0027).replace(\/(\u003cdiv id=\"?ClickTaleDiv\"?[^\u003e]+\u003e)\\s*\u003cscript[^\u003e]+\u003e\u003c\\\/script\u003e\\s*(\u003c\\\/div\u003e)\/i, \u0027$1$2\u0027);\r\n            });\r\n        }\r\n        rewriteApi.add({\r\n            pattern: \/ctdep-\/gi,\r\n            replace: \u0027\u0027\r\n        });\r\n        rewriteApi.add({\r\n            pattern: \/(\u003chead[^\u003e]*\u003e)\/i,\r\n            replace: \u0027$1\u003cscript type=\"text\\\/javascript\" class=\"cm-ignore\" src=\"http:\\\/\\\/dummytest.clicktale-samples.com\\\/GlobalResources\\\/jquery.js\"\u003e\u003c\\\/script\u003e\u0027\r\n        });\r\n        rewriteApi.add({\r\n            pattern: \/(background-image: url\\()[^)]*(\\))\/ig,\r\n            replace: \u0027$1\\\u0027http:\/\/dummytest.clicktale-samples.com\/Shutterfly\/download.png\\\u0027$2\u0027\r\n        })\r\n        rewriteApi.add({\r\n            pattern: \/(\u003cimg[^\u003e]src=\")[^\"]*([^\u003e]*class=\"picturestripImage\")\/ig,\r\n            replace: \u0027$1http:\/\/dummytest.clicktale-samples.com\/Shutterfly\/download.png$2\u0027\r\n        })\r\n        rewriteApi.add({\r\n            pattern: \/(\u003cimg\\s*id=\"switchToTopDivImg\"\\s*src=\")[^\"]*\/ig,\r\n            replace: \u0027$1http:\/\/dummytest.clicktale-samples.com\/Shutterfly\/download.png\u0027\r\n        })\r\n        var pid = \"14403\";\r\n        var blob = \"https:\/\/ctsacss01.blob.core.windows.net\/storage\/\" + pid;\r\n        var urlCSS = blob + \"\/CSS\";\r\n        var urlIMG = blob + \"\/IMAGE\";\r\n\r\n        var host = window.location.protocol.replace(\":\", \"\/\") + window.location.hostname;\r\n        var base = window.location.protocol.replace(\":\", \"\/\") + window.location.hostname + location.pathname.substring(0, location.pathname.lastIndexOf(\u0027\/\u0027));\r\n        var protocol = window.location.protocol.replace(\":\", \"\");\r\n\r\n        if (document.location.href.indexOf(\"www.shutterfly.com\/checkout\/\") \u003e -1) {\r\n\r\n            rewriteApi.add(function (buffer) {\r\n                buffer = buffer.replace(\/(href=[\"|\u0027])([^\"|\u0027]*?\\.css[^\"|\u0027]*?[\"|\u0027])\/igm, function (m, g1, g2) {\r\n                    if (g2 \u0026\u0026 g2.indexOf(\"\/\" + pid + \"\/\") \u003c 0) {\r\n                        g2 = g2.replace(\/\\?\/g, \"%3F\");\r\n                        if (g2.match(\/^https?:\/) != null)\r\n                            g2 = g2.replace(\/:\\\/\\\/\/g, \"\/\");\r\n                        else if (g2.startsWith(\"\/\/\"))\r\n                            g2 = protocol + g2.replace(\/\\\/\\\/\/g, \"\/\");\r\n                        else\r\n                            g2 = host + g2;\r\n                        return g1 + urlCSS + \u0027\/\u0027 + g2;\r\n                    }\r\n                    return m;\r\n                });\r\n                return buffer;\r\n            });\r\n            rewriteApi.add({\r\n                pattern: new RegExp(\u0027@font-face{.*?}\u0027, \u0027gim\u0027),\r\n                replace: \u0027\u0027\r\n            });\r\n        }\r\n    }\r\n};\r\n\r\n\/\/ End of user-defined pre WR code\r\n\r\n\r\nvar isHttps = document.location.protocol == \u0027https:\u0027,\r\n\tscriptSource = window.ClickTaleScriptSource;\r\n\r\nvar pccSrc = scriptSource ? scriptSource + \u002727e69756-bbb1-4b0f-9fe9-5fd81dda0f8b.js?DeploymentConfigName=Release_20170409\u0026Version=2\u0027 : (isHttps ? \u0027https:\/\/cdnssl.clicktale.net\/www08\/pcc\/27e69756-bbb1-4b0f-9fe9-5fd81dda0f8b.js?DeploymentConfigName=Release_20170409\u0026Version=2\u0027 : \u0027http:\/\/cdn.clicktale.net\/www08\/pcc\/27e69756-bbb1-4b0f-9fe9-5fd81dda0f8b.js?DeploymentConfigName=Release_20170409\u0026Version=2\u0027);\r\n\tvar pccScriptElement = ClickTaleCreateDOMElement(\u0027script\u0027);\r\npccScriptElement.type = \"text\/javascript\";\r\npccScriptElement.crossOrigin = \"anonymous\";\r\npccScriptElement.src = pccSrc;\r\nClickTaleGlobal.init.isAllowed \u0026\u0026 document.body.appendChild(pccScriptElement);\r\n\t\r\nif (!scriptSource) {\r\n\twindow.ClickTaleScriptSource = isHttps ? \u0027https:\/\/cdnssl.clicktale.net\/www\/\u0027 : \u0027http:\/\/cdn.clicktale.net\/www\/\u0027;\r\n}\r\n\r\nwindow.ClickTalePrevOnReady = typeof window.ClickTaleOnReady == \u0027function\u0027 ? window.ClickTaleOnReady : void 0;\r\n\r\nwindow.ClickTaleOnReady = function() {\r\n\tvar PID=14403, \r\n\t\tRatio=0.01, \r\n\t\tPartitionPrefix=\"www08\",\r\n\t\tSubsId=232992;\r\n\t\r\n\tif (window.navigator \u0026\u0026 window.navigator.loadPurpose === \"preview\") {\r\n       return;\r\n\t};\r\n\t\t\r\n\t\r\n\t\/\/ Start of user-defined header code (PreInitialize)\r\n\tif (document.location.href.indexOf(\u0027photos.shutterfly.com\u0027) \u003e -1) return;\r\n\r\nif (typeof ClickTaleSetAllSensitive === \"function\") {\r\n    ClickTaleSetAllSensitive();\r\n};\r\nvar ctPathName = location.pathname.toLowerCase();\r\nwindow.ClickTaleSettings.PTC.InitFuncs = window.ClickTaleSettings.PTC.InitFuncs || [];\r\nwindow.ClickTaleSettings.PTC.InitFuncs.push(function() {\r\n    var pcc = document.querySelector(\u0027script[src*=\"clicktale\"][src*=\"pcc\"]\u0027);\r\n    if (pcc) {\r\n        var versionmatch = pcc.src.match(\/DeploymentConfigName=(.+)\/i);\r\n        if (versionmatch \u0026\u0026 typeof ClickTaleExec === \u0027function\u0027) {\r\n            ClickTaleExec(\"console.info(\u0027\" + versionmatch[0] + \"\u0027);\");\r\n            ClickTaleEvent(\"Config: \" + versionmatch[1].replace(\/\\\u0026.+\/, \u0027\u0027));\r\n        }\r\n    }\r\n});\r\n\r\nfunction doUpload() {\r\n    if (typeof ClickTaleUploadPageNow === \u0027function\u0027 \u0026\u0026 ClickTaleIsRecording()) {\r\n        ClickTaleUploadPageNow();\r\n    }\r\n}\r\n\r\nfunction isReadyToRecord() {\r\n    if (typeof ClickTaleUploadPageNow === \u0027function\u0027 \u0026\u0026 ClickTaleIsRecording()) {\r\n        if (document.location.host.toLowerCase() === \"photos.shutterfly.com\") {\r\n            \/\/first loader\r\n            var flag_1 = false;\r\n            if (!document.querySelector(\"#loading-view\")) {\r\n                flag_1 = true;\r\n            } else if (!!(document.querySelector(\"#loading-view[style $=\u0027none;\u0027]\"))) {\r\n                flag_1 = true;\r\n            }\r\n            \/\/second loader\r\n            var flag_2 = false;\r\n            if (!document.querySelector(\".loading .throbber\")) {\r\n                flag_2 = true;\r\n            }\r\n            return flag_1 \u0026\u0026 flag_2;\r\n        }\r\n        else if (document.location.pathname.toLowerCase() == \"\/home\/myshutterfly.sfly\") {\r\n            return !!(document.querySelectorAll(\".loader:not(.hidden)\").length);\r\n        }\r\n        else if (document.location.pathname.toLowerCase().indexOf(\u0027\/calendar-styles\u0027) \u003e -1) {\r\n            return !!(document.querySelectorAll(\".loading\").length == 0 \u0026\u0026 document.querySelectorAll(\".calendar-grid\").length);\r\n        }\r\n        else {\r\n            return true;\r\n        }\r\n    }\r\n    return false;\r\n}\r\n\r\nfunction doOnlyWhen(toDoHandler, toCheckHandler, interval, times, failHandler) {\r\n    if ((!toDoHandler) || (!toCheckHandler)) return;\r\n    if (typeof interval == \"undefined\") interval = 1000;\r\n    if (typeof times == \"undefined\") times = 20;\r\n    if (--times \u003c 0) {\r\n        if (typeof failHandler === \u0027function\u0027) {\r\n            failHandler();\r\n        }\r\n        return;\r\n    }\r\n    if (toCheckHandler()) {\r\n        toDoHandler();\r\n        return;\r\n    }\r\n    setTimeout(function() {\r\n        doOnlyWhen(toDoHandler, toCheckHandler, interval, times, failHandler);\r\n    }, interval);\r\n};\r\nif (typeof ClickTaleDelayUploadPage === \u0027function\u0027 \u0026\u0026 window.ClickTaleSettings.PTC.UseTransport) {\r\n    ClickTaleDelayUploadPage();\r\n    if (window.ClickTaleSettings.PTC.EnableChangeMonitor) {\r\n        window.ClickTaleSettings.PTC.InitFuncs.push(function() {\r\n            if (typeof ClickTaleEvent === \"function\") {\r\n                ClickTaleEvent(\"CM\");\r\n            }\r\n        });\r\n    }\r\n    doOnlyWhen(doUpload, isReadyToRecord, 500, 20, doUpload);\r\n    var initFuncs = window.ClickTaleSettings.PTC.InitFuncs;\r\n    for (var i = 0, initLen = initFuncs.length; i \u003c initLen; i++) {\r\n        if (typeof initFuncs[i] === \u0027function\u0027) {\r\n            initFuncs[i]();\r\n        }\r\n    }\r\n}\r\n\r\n\t\/\/ End of user-defined header code (PreInitialize)\r\n    \r\n\t\r\n\twindow.ClickTaleIncludedOnDOMReady=true;\r\n\t\r\n\tClickTaleGlobal.init.isAllowed \u0026\u0026 ClickTale(PID, Ratio, PartitionPrefix, SubsId);\r\n\t\r\n\tif((typeof ClickTalePrevOnReady == \u0027function\u0027) \u0026\u0026 (ClickTaleOnReady.toString() != ClickTalePrevOnReady.toString()))\r\n\t{\r\n    \tClickTalePrevOnReady();\r\n\t}\r\n\t\r\n\t\r\n\t\/\/ Start of user-defined footer code\r\n\t\r\n\t\/\/ End of user-defined footer code\r\n\t\r\n}; \r\n(function() {\r\n\tvar div = ClickTaleCreateDOMElement(\"div\");\r\n\tdiv.id = \"ClickTaleDiv\";\r\n\tdiv.style.display = \"none\";\r\n\tdocument.body.appendChild(div);\r\n\r\n\t\r\n\t\r\n\tvar wrScript = ClickTaleCreateDOMElement(\"script\");\r\n\twrScript.crossOrigin = \"anonymous\";\t\r\n\twrScript.src = window.ClickTaleScriptSource + \u0027WR-latest.js\u0027;\r\n\twrScript.type = \u0027text\/javascript\u0027;\r\n\t\twrScript.async = true;\r\n\t\tClickTaleGlobal.init.isAllowed \u0026\u0026 document.body.appendChild(wrScript);\r\n})();\r\n\r\n\r\n\r\n\r\n\r\n!function(){function t(){window.addEventListener\u0026\u0026addEventListener(\"message\",e,!1)}function e(t){var e,o=new RegExp(\"(clicktale.com|qa-core.app.clicktale.com)($|:)\"),c=new RegExp(\"qa-core.app.clicktale.com\"),i=!1,a=t.origin;try{e=JSON.parse(t.data)}catch(l){return}o.test(t.origin)!==!1\u0026\u0026(window.ct_ve_parent_window=t.source,c.test(t.origin)===!0\u0026\u0026(i=!0),\"CTload_ve\"===e[\"function\"]\u0026\u0026\"function\"==typeof ClickTaleGetPID\u0026\u0026null!==ClickTaleGetPID()\u0026\u0026n(a,i))}function o(t){return document.createElementNS?document.createElementNS(\"http:\/\/www.w3.org\/1999\/xhtml\",t):document.createElement(t)}function n(t,e){var n=o(\"script\");n.setAttribute(\"type\",\"text\/javascript\"),n.setAttribute(\"id\",\"ctVisualEditorClientModule\");var c;c=e?document.location.protocol+\"\/\/qa-core.app.clicktale.com\/VisualEditor\/Client\/dist\/veClientModule.js\":document.location.protocol+\"\/\/\"+t.match(\/subs\\d*\/)[0]+\".app.clicktale.com\/VisualEditor\/Client\/dist\/veClientModule.js\",n.src=c,document.getElementById(\"ctVisualEditorClientModule\")||document.body.appendChild(n)}try{var c=window.chrome,i=window.navigator\u0026\u0026window.navigator.vendor;null!==c\u0026\u0026void 0!==c\u0026\u0026\"Google Inc.\"===i\u0026\u0026t()}catch(a){}}();");
				document.body.appendChild(script);
			})();
	}		

if (!ClickTaleGlobal.init.configFoundPTC)
{
			(function(){
		var script = ClickTaleXHTMLCompliantScriptTagCreate("\/\/ Copyright 2006-2017 ClickTale Ltd., US Patent Pending\r\n\/\/ PID: 14403\r\n\/\/ WR destination: www08\r\n\/\/ WR version: latest\r\n\/\/ Recording ratio: 0.01\r\n\r\n(function (){\r\n\tvar dependencyCallback;\r\n        var scriptSyncTokens = [\"wr\"];\r\n        var ct2Callback, isRecorderReady;\r\n    var dependencies = scriptSyncTokens.slice(0);\r\n    var clickTaleOnReadyList = window.ClickTaleOnReadyList || (window.ClickTaleOnReadyList = []);\r\n    var indexOf = (function(){if(Array.prototype.indexOf){return function(array,value){return array.indexOf(value)}}return function(array,value){var length=array.length;for(var i=0;i\u003clength;i++){if(array[i]===value){return i}}return -1}})();\r\n    function isValidToken(token) {\r\n        if (indexOf(scriptSyncTokens, token) \u003e -1) {\r\n            var index = indexOf(dependencies, token);\r\n\r\n            if (index \u003e -1) {\r\n                dependencies.splice(index, 1);\r\n                return true;\r\n            }\r\n        }\r\n\r\n        return false;\r\n    }\r\n\r\n    clickTaleOnReadyList.push(function () {\r\n        if (ct2Callback) {\r\n            ct2Callback();\r\n        }\r\n\r\n        isRecorderReady = true;\r\n    });\r\n\r\n    ClickTaleGlobal.scripts.dependencies = {\r\n        setDependencies: function (deps) {\r\n            scriptSyncTokens = deps;\r\n        },\r\n        onDependencyResolved: function (callback) {\r\n            dependencyCallback = callback;\r\n        },\r\n        notifyScriptLoaded: function (token) {\r\n            if (isValidToken(token)) {\r\n                if (dependencies.length === 0 \u0026\u0026 typeof dependencyCallback === \"function\") {\r\n                    dependencyCallback();\r\n                }\r\n            }\r\n        }\r\n    };\r\n\r\n    ClickTaleGlobal.scripts.integration = {\r\n        onReady: function (callback) {\r\n            if (isRecorderReady) {\r\n                callback();\r\n            }\r\n            else {\r\n                ct2Callback = callback;\r\n            }\r\n        }\r\n    };\r\n})();\r\n\r\n\r\n\r\n\r\nwindow.ClickTaleIsXHTMLCompliant = true;\r\nif (typeof (ClickTaleCreateDOMElement) != \"function\")\r\n{\r\n\tClickTaleCreateDOMElement = function(tagName)\r\n\t{\r\n\t\tif (document.createElementNS)\r\n\t\t{\r\n\t\t\treturn document.createElementNS(\u0027http:\/\/www.w3.org\/1999\/xhtml\u0027, tagName);\r\n\t\t}\r\n\t\treturn document.createElement(tagName);\r\n\t}\r\n}\r\n\r\nif (typeof (ClickTaleAppendInHead) != \"function\")\r\n{\r\n\tClickTaleAppendInHead = function(element)\r\n\t{\r\n\t\tvar parent = document.getElementsByTagName(\u0027head\u0027).item(0) || document.documentElement;\r\n\t\tparent.appendChild(element);\r\n\t}\r\n}\r\n\r\nif (typeof (ClickTaleXHTMLCompliantScriptTagCreate) != \"function\")\r\n{\r\n\tClickTaleXHTMLCompliantScriptTagCreate = function(code)\r\n\t{\r\n\t\tvar script = ClickTaleCreateDOMElement(\u0027script\u0027);\r\n\t\tscript.setAttribute(\"type\", \"text\/javascript\");\r\n\t\tscript.text = code;\r\n\t\treturn script;\r\n\t}\r\n}\t\r\n\r\n\r\n\r\n\/\/ Start of user-defined pre WR code (PreLoad)\r\n\/\/PTC Code Version 8\r\nwindow.ClickTaleSettings = window.ClickTaleSettings || {};\r\nwindow.ClickTaleSettings.PTC = window.ClickTaleSettings.PTC || {};\r\nif (document.readyState === \u0027complete\u0027) {\r\n    window.ClickTaleIncludedOnWindowLoad = true;\r\n}\r\nwindow.ClickTaleIncludedOnDOMReady = true;\r\nwindow.ClickTaleSettings.PTC.EnableChangeMonitor = false;\r\nwindow.ClickTaleSettings.PTC.UseTransport = true;\r\nwindow.ClickTaleUIDCookieName = \u0027WRUID20170201\u0027;\r\n\r\nfunction deleteIrrelevantUIDCookies(relevant) {\r\n    var cookieArray = document.cookie.replace(\/\\s+\/g, \u0027\u0027).split(\";\");\r\n    var hostArray = location.host.split(\u0027.\u0027);\r\n    var topDom = (hostArray.length \u003c= 2 ? location.host : hostArray.slice(1).join(\u0027.\u0027));\r\n    for (var i = 0; i \u003c cookieArray.length; i++) {\r\n        var currentCookie = cookieArray[i];\r\n        var cookieKey = currentCookie.substring(0, currentCookie.indexOf(\u0027=\u0027));\r\n        if (cookieKey.indexOf(\u0027WRUID\u0027) \u003e -1 \u0026\u0026 relevant.indexOf(cookieKey) == -1) {\r\n            document.cookie = cookieKey + \"=\u0027\u0027;domain=.\" + topDom + \";path=\/;expires=Thu, 01-Jan-1970 00:00:01 GMT;\";\r\n            document.cookie = cookieKey + \"=\u0027\u0027;path=\/;expires=Thu, 01-Jan-1970 00:00:01 GMT;\";\r\n        }\r\n    }\r\n}\r\ndeleteIrrelevantUIDCookies([window.ClickTaleUIDCookieName]);\r\n\r\nwindow.ClickTaleSettings.CheckAgentSupport = function(f, v) {\r\n    if (v.t == v.IE \u0026\u0026 v.v \u003c= 8) {\r\n        window.ClickTaleSettings.PTC.okToRunPCC = false;\r\n        return false;\r\n    }\r\n    else {\r\n        if (!(v.t == v.IE \u0026\u0026 v.v \u003c= 10)) {\r\n            window.ClickTaleSettings.PTC.EnableChangeMonitor = !(v.m);\/\/no CM on mobile SHF-219\r\n            window.ClickTaleSettings.PTC.ConfigChangeMonitor();\r\n        }\r\n        var fv = f(v);\r\n        window.ClickTaleSettings.PTC.okToRunPCC = fv;\r\n        return fv;\r\n    }\r\n};\r\n\r\nwindow.ClickTaleSettings.PTC.startsWith = function (strToTest, str) {\r\n    return strToTest.lastIndexOf(str, 0) === 0;\r\n};\r\n\r\nwindow.ClickTaleSettings.Protocol = {\r\n    Method: \"ImpactRecorder\"\r\n};\r\n\r\nwindow.ClickTaleSettings.Proxy = {\r\n    WR: \"ing-district.clicktale.net\/ctn_v2\/\",\r\n    ImageFlag: \"ing-district.clicktale.net\/ctn_v2\/\"\r\n};\r\n\r\nwindow.ClickTaleSettings.PTC.RulesObj = [{\r\n    selector: \"input[type=\\\"text\\\"], input[type=\\\"tel\\\"], input[type=\\\"email\\\"]\",\r\n    changeMon: {\r\n        Attributes: [\u0027value\u0027],\r\n        Text: false\r\n    },\r\n    rewriteApi: {\r\n        Attributes: [\u0027value\u0027],\r\n        Text: false\r\n    }\r\n}, {\r\n    selector: \"textarea,#addressInfo li,#billingInfo li\",\r\n    changeMon: {\r\n        Attributes: false,\r\n        Text: true\r\n    },\r\n    rewriteApi: {\r\n        Attributes: false,\r\n        Text: true\r\n    }\r\n}, {    \r\n    selector: \".personal_menu .label.dropdown_arrow,#face_identify_dropdown-people .name,.dropdown-menu .name,.person_card .name,.person,.results_text_wrap .title,.list_item.person span,#sf3-user-dropdown-trigger, #share_recipients, .email, .name\",\r\n    changeMon: {\r\n        Attributes: false,\r\n        Text: true\r\n    },\r\n    rewriteApi: {\r\n        Attributes: false,\r\n        Text: true\r\n    }\r\n}, {\r\n    selector: \"#lastModifiedThumb img\",\r\n    changeMon: {\r\n        Attributes: [\u0027title\u0027],\r\n        Text: false\r\n    },\r\n    rewriteApi: {\r\n        Attributes: [\u0027title\u0027, \u0027ctdep-title\u0027],\r\n        Text: false\r\n    }\r\n}, {\r\n    selector: \".full_view_tag\",\r\n    changeMon: {\r\n        Attributes: false,\r\n        Text: true\r\n    },\r\n    rewriteApi: {\r\n        Attributes: false,\r\n        Text: true\r\n    }\r\n}, {\r\n    selector: \u0027address, .recipient-addressbook-address-name, .address-name\u0027,\r\n    changeMon: {\r\n        Attributes: false,\r\n        Text: true\r\n    },\r\n    rewriteApi: {\r\n        Attributes: false,\r\n        Text: true\r\n    },\r\n    location: {\r\n        prop: \u0027href\u0027,\r\n        search: \/\\\/checkout\\\/cart.sfly\/gi\r\n    }\r\n}, {\r\n    selector: \".ctHidden\",\r\n    changeMon: {\r\n        Attributes: [\u0027value\u0027],\r\n        Text: true\r\n    },\r\n    rewriteApi: {\r\n        Attributes: [\u0027value\u0027],\r\n        Text: true\r\n    }\r\n}];\r\n\r\nwindow.ClickTaleSettings.PTC.RulesObjRemoveEls = [{\r\n    changeMonLive: \u0027#preview-carousel\u0027,\r\n    location: {\r\n        prop: \u0027href\u0027,\r\n        search: \/\\\/checkout\\\/cart.sfly\/i\r\n    }\r\n}];\r\n\r\n;(function() {\r\n    if (typeof window.ClickTalePIISelector === \u0027string\u0027 \u0026\u0026 window.ClickTalePIISelector != \u0027\u0027) {\r\n        try {\r\n            var domNodes = document.querySelectorAll(window.ClickTalePIISelector);\r\n            if (domNodes) {\r\n                window.ClickTaleSettings.PTC.RulesObj.push({\r\n                    selector: window.ClickTalePIISelector,\r\n                    changeMon: {\r\n                        Attributes: [\u0027value\u0027],\r\n                        Text: true\r\n                    },\r\n                    rewriteApi: {\r\n                        Attributes: [\u0027value\u0027],\r\n                        Text: true\r\n                    }\r\n                });\r\n            }\r\n        } catch (err) {}\r\n    }\r\n})();\r\n\r\nwindow.ClickTaleSettings.PTC.cloneNodeIE9 = function(node) {\r\n    var clone = node.nodeType === 3 ? document.createTextNode(node.nodeValue) : node.cloneNode(false);\r\n    var child = node.firstChild;\r\n    while (child) {\r\n        var nodeName = child.nodeName.toLowerCase();\r\n        if (nodeName == \u0027script\u0027) {\r\n            var script = document.createElement(\u0027script\u0027);\r\n            clone.appendChild(script);\r\n        }\r\n        else if (window.ClickTaleSettings.PTC.cloneNodeIE9.badEls[nodeName]) {\r\n            var newN = document.createElement(nodeName);\r\n            var attributes = child.attributes;\r\n            var attrLength = attributes.length;\r\n            for (var i = 0; i \u003c attrLength; i++) {\r\n                var attr = attributes[i];\r\n                if (!\/[\u0027\"{};\\.]\/.test(attr.nodeName)) {\r\n                    newN.setAttribute(\u0027ctdep-\u0027 + attr.nodeName, attr.nodeValue);\r\n                }\r\n            }\r\n            clone.appendChild(newN);\r\n        }\r\n        else {\r\n            clone.appendChild(window.ClickTaleSettings.PTC.cloneNodeIE9(child));\r\n        }\r\n        child = child.nextSibling;\r\n    }\r\n    return clone;\r\n};\r\n\r\nwindow.ClickTaleSettings.PTC.cloneNodeIE9.badEls = {\r\n    \u0027iframe\u0027: true,\r\n    \u0027img\u0027: true,\r\n    \u0027source\u0027: true\r\n};\r\n\r\nwindow.ClickTaleSettings.PTC.ConfigChangeMonitor = function() {\r\n    if (window.ClickTaleSettings.PTC.EnableChangeMonitor) {\r\n        window.ClickTaleSettings.XHRWrapper = {\r\n            Enable: false\r\n        };\r\n        var script = document.createElement(\"SCRIPT\");\r\n        script.src = (document.location.protocol === \"https:\" ? \"https:\/\/cdnssl.\" : \"http:\/\/cdn.\") + \"clicktale.net\/www\/ChangeMonitor-latest.js\";\r\n        document.body.appendChild(script);\r\n        window.ClickTaleSettings.ChangeMonitor = {\r\n            Enable: true,\r\n            AddressingMode: \"id\",\r\n            OnReadyHandler: function(changeMonitor) {\r\n                changeMonitor.observe();\r\n                var CMRemrule = window.ClickTaleSettings.PTC.RulesObjRemoveEls;\r\n                if (CMRemrule) {\r\n                    for (var i = 0; i \u003c CMRemrule.length; i++) {\r\n                        var rule = CMRemrule[i];\r\n                        var CMlocation = rule[\u0027location\u0027];\r\n                        if ((!CMlocation || (CMlocation \u0026\u0026 document.location[CMlocation[\u0027prop\u0027]].toLowerCase().search(CMlocation.search) != -1))) {\r\n                            if (rule.changeMon) {\r\n                                changeMonitor.exclude(rule.changeMon);\r\n                            }\r\n                            if (rule.changeMonLive) {\r\n                                changeMonitor.exclude({\r\n                                    selector: rule.changeMonLive,\r\n                                    multiple: true\r\n                                });\r\n                            }\r\n                        }\r\n                    }\r\n                }\r\n            },\r\n            OnBeforeReadyHandler: function(settings) {\r\n                settings.Enable = window.ClickTaleGetUID ? !!ClickTaleGetUID() : false;\r\n                return settings;\r\n            },\r\n            Filters: {\r\n                MaxBufferSize: 6000000,\r\n                MaxElementCount: 6000000,\r\n                MaxBufferSum: 16000000,\r\n                Before: [function(mutations) {\r\n                    if (typeof ClickTaleSettings.PTC.CMBeforeFilter === \u0027function\u0027) {\r\n                        return ClickTaleSettings.PTC.CMBeforeFilter(mutations);\r\n                    }\r\n                    return true;\r\n                }]\r\n            },\r\n            PII: {\r\n                Text: [],\r\n                Attributes: [{\r\n\t\t\t\t\t\/\/img PRR\r\n                    selector: \"img.preview-image,  .twitter_thumbs img, .upload-status .thumbnail img, .img, li\u003ediv\u003eimg, .framed_moment_media img, #face_identify_dropdown-people img, .full_view_media img,.dropdown-menu img, .albumViewComponent-album img, .cartitem-image-stacked img, .cartitem-image img, .projectThumb img, #lastModifiedThumb img, img.picturestripImage, img#switchToTopDivImg, #thumbArea img, img.projectThumbnailImage, .framed_moment_media\u003eimg, .img.loading\",\r\n                    transform: function(el) {\r\n                        var attrs = el.attributes;\r\n                        var attrsToReturn = {};\r\n                        for (var i = 0; i \u003c attrs.length; i++) {\r\n                            var name = attrs[i].nodeName;\r\n                            attrsToReturn[name] = attrs[i].nodeValue;\r\n                        }\r\n                        if (attrsToReturn[\u0027src\u0027]) {\r\n                            attrsToReturn[\u0027src\u0027] = \u0027http:\/\/dummytest.clicktale-samples.com\/Shutterfly\/download.png\u0027;\r\n                        }\r\n                        if (attrsToReturn[\"style\"] \u0026\u0026 attrsToReturn[\"style\"].indexOf(\"background-image\") \u003e -1) {\r\n                            attrsToReturn[\"style\"] = \"\";\r\n                        }\r\n                        return attrsToReturn;\r\n                    }\r\n                }]\r\n            }\r\n        }\r\n        var RulesObj = window.ClickTaleSettings.PTC.RulesObj;\r\n        if (RulesObj) {\r\n            window.ClickTaleSettings.ChangeMonitor.PII.Text = window.ClickTaleSettings.ChangeMonitor.PII.Text || [];\r\n            window.ClickTaleSettings.ChangeMonitor.PII.Attributes = window.ClickTaleSettings.ChangeMonitor.PII.Attributes || [];\r\n            for (var i = 0; i \u003c RulesObj.length; i++) {\r\n                var CMrule = RulesObj[i][\u0027changeMon\u0027];\r\n                var CMlocation = RulesObj[i][\u0027location\u0027];\r\n                if (!CMrule || (CMlocation \u0026\u0026 document.location[CMlocation[\u0027prop\u0027]].toLowerCase().search(CMlocation.search) === -1)) {\r\n                    continue;\r\n                }\r\n                var selector = RulesObj[i][\u0027selector\u0027];\r\n                var attributesArr = CMrule.Attributes;\r\n                if (attributesArr instanceof Array) {\r\n                    window.ClickTaleSettings.ChangeMonitor.PII.Attributes.push({\r\n                        selector: selector,\r\n                        transform: (function(attributesArr) {\r\n                            return function(el) {\r\n                                var attrs = el.attributes;\r\n                                var attrsToReturn = {}\r\n                                for (var i = 0; i \u003c attrs.length; i++) {\r\n                                    var name = attrs[i].nodeName;\r\n                                    attrsToReturn[name] = attrs[i].nodeValue;\r\n                                }\r\n                                for (var u = 0; u \u003c attributesArr.length; u++) {\r\n                                    var attr = attributesArr[u];\r\n                                    var attrib = el.getAttribute(attr);\r\n                                    if (typeof attrib === \u0027string\u0027) {\r\n                                        attrsToReturn[attr] = attrib.replace(\/\\w\/g, \u0027-\u0027);\r\n                                    }\r\n                                }\r\n                                return attrsToReturn;\r\n                            }\r\n                        })(attributesArr)\r\n                    });\r\n                }\r\n                if (CMrule.Text) {\r\n                    window.ClickTaleSettings.ChangeMonitor.PII.Text.push({\r\n                        selector: selector,\r\n                        transform: function(el) {\r\n                            return el.textContent.replace(\/\\w\/g, \u0027-\u0027);\r\n                        }\r\n                    });\r\n                }\r\n            }\r\n        }\r\n    }\r\n};\r\n\r\nwindow.ClickTaleSettings.Compression = {\r\n    Method: function() {\r\n        return \"deflate\";\r\n    }\r\n};\r\n\r\nwindow.ClickTaleSettings.Transport = {\r\n    Legacy: false,\r\n    MaxConcurrentRequests: 5\r\n};\r\n\r\nwindow.ClickTaleSettings.RewriteRules = {\r\n    OnBeforeRewrite: function(rewriteApi) {\r\n        var bodyClone = ClickTaleSettings.PTC.cloneNodeIE9(document.documentElement);\r\n        if (window.ClickTaleSettings.PTC.RulesObj) {\r\n            rewriteApi.add(function(buffer) {\r\n                var RulesObj = window.ClickTaleSettings.PTC.RulesObj;\r\n                for (var i = 0; i \u003c RulesObj.length; i++) {\r\n                    var rewriteApirule = RulesObj[i][\u0027rewriteApi\u0027];\r\n                    var rewriteApilocation = RulesObj[i][\u0027location\u0027];\r\n                    if (!rewriteApirule || (rewriteApilocation \u0026\u0026 document.location[rewriteApilocation[\u0027prop\u0027]].toLowerCase().search(rewriteApilocation.search) === -1)) {\r\n                        continue;\r\n                    }\r\n                    var selector = RulesObj[i][\u0027selector\u0027];\r\n                    var elements = bodyClone.querySelectorAll(selector);\r\n                    Array.prototype.forEach.call(elements, function(el, ind) {\r\n                        var attributesArr = rewriteApirule.Attributes;\r\n                        if (attributesArr instanceof Array) {\r\n                            for (var u = 0; u \u003c attributesArr.length; u++) {\r\n                                var attr = attributesArr[u];\r\n                                var attrib = el.getAttribute(attr);\r\n                                if (typeof attrib === \u0027string\u0027) {\r\n                                    el.setAttribute(attr, attrib.replace(\/\\w\/g, \u0027-\u0027));\r\n                                }\r\n                            }\r\n                        }\r\n                        if (rewriteApirule.Text) {\r\n                            var children = el.childNodes;\r\n                            Array.prototype.forEach.call(children, function(child) {\r\n                                if (child \u0026\u0026 child.nodeType === 3) {\r\n                                    child.textContent = child.textContent.replace(\/\\w\/g, \u0027-\u0027);\r\n                                }\r\n                            });\r\n                        }\r\n                    });\r\n                }\r\n                \/\/work on body\r\n                var RulesObjRemoveEls = window.ClickTaleSettings.PTC.RulesObjRemoveEls;\r\n                if (RulesObjRemoveEls) {\r\n                    for (var i = 0; i \u003c RulesObjRemoveEls.length; i++) {\r\n                        if (RulesObjRemoveEls[i].rewriteApi) {\r\n                            var elementsToRemove = bodyClone.querySelectorAll(RulesObjRemoveEls[i].rewriteApi);\r\n                            Array.prototype.forEach.call(elementsToRemove, function(el, ind) {\r\n                                if (el.parentNode) {\r\n                                    el.parentNode.removeChild(el);\r\n                                }\r\n                            });\r\n                        }\r\n                        if (RulesObjRemoveEls[i].rewriteApiReplace) {\r\n                            var elementsToReplace = bodyClone.querySelectorAll(RulesObjRemoveEls[i].rewriteApiReplace);\r\n                            Array.prototype.forEach.call(elementsToReplace, function(el, ind) {\r\n                                if (el.parentNode) {\r\n                                    var comment = document.createComment(el.outerHTML);\r\n                                    el.parentNode.replaceChild(comment, el);\r\n                                }\r\n                            });\r\n                        }\r\n                    }\r\n                }\r\n\t\t\t\t\r\n\t\t\t\t\/\/img PRR\r\n\t\t\t\tArray.prototype.forEach.call(bodyClone.querySelectorAll(\"img[ctdep-class*=\\\"preview-image\\\"], .twitter_thumbs img, .upload-status .thumbnail img, .img, li\u003ediv\u003eimg, .framed_moment_media img, #face_identify_dropdown-people img, .full_view_media img,.dropdown-menu img, .albumViewComponent-album img, .cartitem-image-stacked img, .cartitem-image img, .projectThumb img, #lastModifiedThumb img, img[ctdep-class*=\\\"picturestripImage\\\"], img[ctdep-id=\\\"switchToTopDivImg\\\"], #thumbArea img, img[ctdep-class=\\\"projectThumbnailImage\\\"], .framed_moment_media\u003eimg, [ctdep-class=\\\"img\\\"][ctdep-class=\\\"loading\\\"]\"), function (el, ind) {\r\n\t\t\t\t\tel.setAttribute(\u0027ctdep-src\u0027, \u0027http:\/\/dummytest.clicktale-samples.com\/Shutterfly\/download.png\u0027)\r\n\t\t\t\t});\r\n\t\t\t\t\r\n                return bodyClone.innerHTML.replace(\/\u003cscript\\b([^\u003e]*)\u003e([\\s\\S]*?)\u003c\\\/script\u003e\/gi, \u0027\u003cscript\u003e\u003c\\\/script\u003e\u0027).replace(\/(\u003cdiv id=\"?ClickTaleDiv\"?[^\u003e]+\u003e)\\s*\u003cscript[^\u003e]+\u003e\u003c\\\/script\u003e\\s*(\u003c\\\/div\u003e)\/i, \u0027$1$2\u0027);\r\n            });\r\n        }\r\n        rewriteApi.add({\r\n            pattern: \/ctdep-\/gi,\r\n            replace: \u0027\u0027\r\n        });\r\n        rewriteApi.add({\r\n            pattern: \/(\u003chead[^\u003e]*\u003e)\/i,\r\n            replace: \u0027$1\u003cscript type=\"text\\\/javascript\" class=\"cm-ignore\" src=\"http:\\\/\\\/dummytest.clicktale-samples.com\\\/GlobalResources\\\/jquery.js\"\u003e\u003c\\\/script\u003e\u0027\r\n        });\r\n        rewriteApi.add({\r\n            pattern: \/(background-image: url\\()[^)]*(\\))\/ig,\r\n            replace: \u0027$1\\\u0027http:\/\/dummytest.clicktale-samples.com\/Shutterfly\/download.png\\\u0027$2\u0027\r\n        })\r\n        rewriteApi.add({\r\n            pattern: \/(\u003cimg[^\u003e]src=\")[^\"]*([^\u003e]*class=\"picturestripImage\")\/ig,\r\n            replace: \u0027$1http:\/\/dummytest.clicktale-samples.com\/Shutterfly\/download.png$2\u0027\r\n        })\r\n        rewriteApi.add({\r\n            pattern: \/(\u003cimg\\s*id=\"switchToTopDivImg\"\\s*src=\")[^\"]*\/ig,\r\n            replace: \u0027$1http:\/\/dummytest.clicktale-samples.com\/Shutterfly\/download.png\u0027\r\n        })\r\n        var pid = \"14403\";\r\n        var blob = \"https:\/\/ctsacss01.blob.core.windows.net\/storage\/\" + pid;\r\n        var urlCSS = blob + \"\/CSS\";\r\n        var urlIMG = blob + \"\/IMAGE\";\r\n\r\n        var host = window.location.protocol.replace(\":\", \"\/\") + window.location.hostname;\r\n        var base = window.location.protocol.replace(\":\", \"\/\") + window.location.hostname + location.pathname.substring(0, location.pathname.lastIndexOf(\u0027\/\u0027));\r\n        var protocol = window.location.protocol.replace(\":\", \"\");\r\n\r\n        if (document.location.href.indexOf(\"www.shutterfly.com\/checkout\/\") \u003e -1) {\r\n\r\n            rewriteApi.add(function (buffer) {\r\n                buffer = buffer.replace(\/(href=[\"|\u0027])([^\"|\u0027]*?\\.css[^\"|\u0027]*?[\"|\u0027])\/igm, function (m, g1, g2) {\r\n                    if (g2 \u0026\u0026 g2.indexOf(\"\/\" + pid + \"\/\") \u003c 0) {\r\n                        g2 = g2.replace(\/\\?\/g, \"%3F\");\r\n                        if (g2.match(\/^https?:\/) != null)\r\n                            g2 = g2.replace(\/:\\\/\\\/\/g, \"\/\");\r\n                        else if (g2.startsWith(\"\/\/\"))\r\n                            g2 = protocol + g2.replace(\/\\\/\\\/\/g, \"\/\");\r\n                        else\r\n                            g2 = host + g2;\r\n                        return g1 + urlCSS + \u0027\/\u0027 + g2;\r\n                    }\r\n                    return m;\r\n                });\r\n                return buffer;\r\n            });\r\n            rewriteApi.add({\r\n                pattern: new RegExp(\u0027@font-face{.*?}\u0027, \u0027gim\u0027),\r\n                replace: \u0027\u0027\r\n            });\r\n        }\r\n    }\r\n};\r\n\r\n\/\/ End of user-defined pre WR code\r\n\r\n\r\nvar isHttps = document.location.protocol == \u0027https:\u0027,\r\n\tscriptSource = window.ClickTaleScriptSource;\r\n\r\nvar pccSrc = scriptSource ? scriptSource + \u002727e69756-bbb1-4b0f-9fe9-5fd81dda0f8b.js?DeploymentConfigName=Release_20170611\u0026Version=1\u0027 : (isHttps ? \u0027https:\/\/cdnssl.clicktale.net\/www08\/pcc\/27e69756-bbb1-4b0f-9fe9-5fd81dda0f8b.js?DeploymentConfigName=Release_20170611\u0026Version=1\u0027 : \u0027http:\/\/cdn.clicktale.net\/www08\/pcc\/27e69756-bbb1-4b0f-9fe9-5fd81dda0f8b.js?DeploymentConfigName=Release_20170611\u0026Version=1\u0027);\r\n\tvar pccScriptElement = ClickTaleCreateDOMElement(\u0027script\u0027);\r\npccScriptElement.type = \"text\/javascript\";\r\npccScriptElement.crossOrigin = \"anonymous\";\r\npccScriptElement.src = pccSrc;\r\nClickTaleGlobal.init.isAllowed \u0026\u0026 document.body.appendChild(pccScriptElement);\r\n\t\r\nif (!scriptSource) {\r\n\twindow.ClickTaleScriptSource = isHttps ? \u0027https:\/\/cdnssl.clicktale.net\/www\/\u0027 : \u0027http:\/\/cdn.clicktale.net\/www\/\u0027;\r\n}\r\n\r\nwindow.ClickTalePrevOnReady = typeof window.ClickTaleOnReady == \u0027function\u0027 ? window.ClickTaleOnReady : void 0;\r\n\r\nwindow.ClickTaleOnReady = function() {\r\n\tvar PID=14403, \r\n\t\tRatio=0.01, \r\n\t\tPartitionPrefix=\"www08\",\r\n\t\tSubsId=232992;\r\n\t\r\n\tif (window.navigator \u0026\u0026 window.navigator.loadPurpose === \"preview\") {\r\n       return;\r\n\t};\r\n\t\t\r\n\t\r\n\t\/\/ Start of user-defined header code (PreInitialize)\r\n\tif (typeof ClickTaleSetAllSensitive === \"function\") {\r\n    ClickTaleSetAllSensitive();\r\n};\r\nvar ctPathName = location.pathname.toLowerCase();\r\nwindow.ClickTaleSettings.PTC.InitFuncs = window.ClickTaleSettings.PTC.InitFuncs || [];\r\nwindow.ClickTaleSettings.PTC.InitFuncs.push(function() {\r\n    var pcc = document.querySelector(\u0027script[src*=\"clicktale\"][src*=\"pcc\"]\u0027);\r\n    if (pcc) {\r\n        var versionmatch = pcc.src.match(\/DeploymentConfigName=(.+)\/i);\r\n        if (versionmatch \u0026\u0026 typeof ClickTaleExec === \u0027function\u0027) {\r\n            ClickTaleExec(\"console.info(\u0027\" + versionmatch[0] + \"\u0027);\");\r\n            ClickTaleEvent(\"Config: \" + versionmatch[1].replace(\/\\\u0026.+\/, \u0027\u0027));\r\n        }\r\n    }\r\n});\r\n\r\nfunction doUpload() {\r\n    if (typeof ClickTaleUploadPageNow === \u0027function\u0027 \u0026\u0026 ClickTaleIsRecording()) {\r\n        ClickTaleUploadPageNow();\r\n    }\r\n}\r\n\r\nfunction isReadyToRecord() {\r\n    if (typeof ClickTaleUploadPageNow === \u0027function\u0027 \u0026\u0026 ClickTaleIsRecording()) {\r\n        if (document.location.host.toLowerCase() === \"photos.shutterfly.com\") {\r\n            \/\/first loader\r\n            var flag_1 = false;\r\n            if (!document.querySelector(\"#loading-view\")) {\r\n                flag_1 = true;\r\n            } else if (!!(document.querySelector(\"#loading-view[style $=\u0027none;\u0027]\"))) {\r\n                flag_1 = true;\r\n            }\r\n            \/\/second loader\r\n            var flag_2 = false;\r\n            if (!document.querySelector(\".loading .throbber\")) {\r\n                flag_2 = true;\r\n            }\r\n            return flag_1 \u0026\u0026 flag_2;\r\n        }\r\n        else if (document.location.pathname.toLowerCase() == \"\/home\/myshutterfly.sfly\") {\r\n            return !!(document.querySelectorAll(\".loader:not(.hidden)\").length);\r\n        }\r\n        else if (document.location.pathname.toLowerCase().indexOf(\u0027\/calendar-styles\u0027) \u003e -1) {\r\n            return !!(document.querySelectorAll(\".loading\").length == 0 \u0026\u0026 document.querySelectorAll(\".calendar-grid\").length);\r\n        }\r\n        else {\r\n            return true;\r\n        }\r\n    }\r\n    return false;\r\n}\r\n\r\nfunction doOnlyWhen(toDoHandler, toCheckHandler, interval, times, failHandler) {\r\n    if ((!toDoHandler) || (!toCheckHandler)) return;\r\n    if (typeof interval == \"undefined\") interval = 1000;\r\n    if (typeof times == \"undefined\") times = 20;\r\n    if (--times \u003c 0) {\r\n        if (typeof failHandler === \u0027function\u0027) {\r\n            failHandler();\r\n        }\r\n        return;\r\n    }\r\n    if (toCheckHandler()) {\r\n        toDoHandler();\r\n        return;\r\n    }\r\n    setTimeout(function() {\r\n        doOnlyWhen(toDoHandler, toCheckHandler, interval, times, failHandler);\r\n    }, interval);\r\n};\r\nif (typeof ClickTaleDelayUploadPage === \u0027function\u0027 \u0026\u0026 window.ClickTaleSettings.PTC.UseTransport) {\r\n    ClickTaleDelayUploadPage();\r\n    if (window.ClickTaleSettings.PTC.EnableChangeMonitor) {\r\n        window.ClickTaleSettings.PTC.InitFuncs.push(function() {\r\n            if (typeof ClickTaleEvent === \"function\") {\r\n                ClickTaleEvent(\"CM\");\r\n            }\r\n        });\r\n    }\r\n    doOnlyWhen(doUpload, isReadyToRecord, 500, 20, doUpload);\r\n    var initFuncs = window.ClickTaleSettings.PTC.InitFuncs;\r\n    for (var i = 0, initLen = initFuncs.length; i \u003c initLen; i++) {\r\n        if (typeof initFuncs[i] === \u0027function\u0027) {\r\n            initFuncs[i]();\r\n        }\r\n    }\r\n}\r\n\r\n\t\/\/ End of user-defined header code (PreInitialize)\r\n    \r\n\t\r\n\twindow.ClickTaleIncludedOnDOMReady=true;\r\n\t\r\n\tClickTaleGlobal.init.isAllowed \u0026\u0026 ClickTale(PID, Ratio, PartitionPrefix, SubsId);\r\n\t\r\n\tif((typeof ClickTalePrevOnReady == \u0027function\u0027) \u0026\u0026 (ClickTaleOnReady.toString() != ClickTalePrevOnReady.toString()))\r\n\t{\r\n    \tClickTalePrevOnReady();\r\n\t}\r\n\t\r\n\t\r\n\t\/\/ Start of user-defined footer code\r\n\t\r\n\t\/\/ End of user-defined footer code\r\n\t\r\n}; \r\n(function() {\r\n\tvar div = ClickTaleCreateDOMElement(\"div\");\r\n\tdiv.id = \"ClickTaleDiv\";\r\n\tdiv.style.display = \"none\";\r\n\tdocument.body.appendChild(div);\r\n\r\n\t\r\n\t\r\n\tvar wrScript = ClickTaleCreateDOMElement(\"script\");\r\n\twrScript.crossOrigin = \"anonymous\";\t\r\n\twrScript.src = window.ClickTaleScriptSource + \u0027WR-latest.js\u0027;\r\n\twrScript.type = \u0027text\/javascript\u0027;\r\n\t\twrScript.async = true;\r\n\t\tClickTaleGlobal.init.isAllowed \u0026\u0026 document.body.appendChild(wrScript);\r\n})();\r\n\r\n\r\n\r\n\r\n\r\n!function(){function t(){window.addEventListener\u0026\u0026addEventListener(\"message\",e,!1)}function e(t){var e,o=new RegExp(\"(clicktale.com|qa-core.app.clicktale.com)($|:)\"),c=new RegExp(\"qa-core.app.clicktale.com\"),i=!1,a=t.origin;try{e=JSON.parse(t.data)}catch(l){return}o.test(t.origin)!==!1\u0026\u0026(window.ct_ve_parent_window=t.source,c.test(t.origin)===!0\u0026\u0026(i=!0),\"CTload_ve\"===e[\"function\"]\u0026\u0026\"function\"==typeof ClickTaleGetPID\u0026\u0026null!==ClickTaleGetPID()\u0026\u0026n(a,i))}function o(t){return document.createElementNS?document.createElementNS(\"http:\/\/www.w3.org\/1999\/xhtml\",t):document.createElement(t)}function n(t,e){var n=o(\"script\");n.setAttribute(\"type\",\"text\/javascript\"),n.setAttribute(\"id\",\"ctVisualEditorClientModule\");var c;c=e?document.location.protocol+\"\/\/qa-core.app.clicktale.com\/VisualEditor\/Client\/dist\/veClientModule.js\":document.location.protocol+\"\/\/\"+t.match(\/subs\\d*\/)[0]+\".app.clicktale.com\/VisualEditor\/Client\/dist\/veClientModule.js\",n.src=c,document.getElementById(\"ctVisualEditorClientModule\")||document.body.appendChild(n)}try{var c=window.chrome,i=window.navigator\u0026\u0026window.navigator.vendor;null!==c\u0026\u0026void 0!==c\u0026\u0026\"Google Inc.\"===i\u0026\u0026t()}catch(a){}}();");
		document.body.appendChild(script);	})();
	}
