(function(){var ccJs=function(options){var mode="BCP";var useFPC=false;var includeReferrer=false;var runOptimusOnly=false;var cmp={daisybit:null,wait:250,done:0,start:0};var baseDomain=".crwdcntrl.net";var validPrefix=["bcp","cn"];var bcpDomainPrefix="bcp",async_props={async:false,asyncBehaviors:{},asyncOpportunityIds:[],asyncOpportunities:[]},behaviors={},bcpd_callback=null,consentSetCB=null,consentGetCB=null,pv="pv\x3dy",dobcp=false,placementOpps={p:[],pt:[]};var domain=document.domain,test=false, sep="/",delim="/",autoFire=false;var _cc_testCkeName="_cc_cc";var _cc_testCkeVal="ctst";var referrer;var _cc_idCkeName="_cc_id";var client,bcpClient;client=bcpClient=10578;var firstPartyHost="cc.thoughtco.com";var actualClient={id:10578,useFirstPartyDomain:"never",domainPrefix:"cc",cookieDomain:"thoughtco.com",cookieDomainIDN:"thoughtco.com"};useFPC=/^(?!.*(chrome|crios).*).*(safari\/\d+|\[fban\/fbios|firefox\/\d+).*/.test(navigator.userAgent.toLowerCase());includeReferrer=/^(?!.*chrome.*).*safari\/\d+.*/.test(navigator.userAgent.toLowerCase()); var useFirstPartyDomain=false;function setCMPWait(waitMs){cmp.wait=waitMs}function setTest(testOn){if(typeof testOn!="undefined"&&(testOn==true||testOn==false))test=testOn}function parseQueryStringToParameters(doc){var qs=parseQuery(running.src.replace(/^[^\?]+\??/,""));ns=qs["ns"]||"LOTCC_"+client;if(mode=="BCP"){autoFire=!!(qs["autobcp"]||false);if(typeof qs["pre"]!="undefined")setBCPDomainPrefix(qs["pre"][0]);if(typeof qs["cmpwait"]!="undefined")setCMPWait(qs["cmpwait"][0]);if("true"==qs["runOptimusOnly"])runOptimusOnly= true;delete qs["ns"];delete qs["autobcp"];delete qs["pre"];delete qs["cmpwait"];delete qs["runOptimusOnly"];for(var type in qs)if(isArray(qs[type]))for(var i=0,beh;beh=qs[type][i++];)add(type,beh)}}var ns,running=document.getElementById("LOTCC_"+client);if(running)parseQueryStringToParameters(running);else ns="LOTCC_"+client;if(!(ns in window))window[ns]={};function parseQuery(query){var params={};if(!query)return params;var pairs=query.split(/[;&]/);for(var i=0;i0){var delimToUse=getDefinedValue(delimArg,delim);var vals;if(isArray(val))vals=val;else vals=val.split(",");var vn=delimToUse+vr+"\x3d";for(var i=0;i0)bcpDomainPrefix=prefix;else if(typeof console!="undefined")console.log(prefix+ " is not valid")}function baseURL(is_pv,version,domainArg,sepArg,delimArg){if(typeof version=="undefined"||version==null)version="5";is_pv=is_pv&&!namespace.pvdone;var domainToUse;if(typeof domainArg!="undefined"&&domainArg!=null)domainToUse=domainArg;else domainToUse=getDomain();var url=getPrefix()+domainToUse;var sepToUse=getDefinedValue(sepArg,sep);var delimToUse=getDefinedValue(delimArg,delim);url+="/"+version+sepToUse+"c\x3d"+bcpClient+delimToUse+"rand\x3d"+getRandomNumber();if(cmp["daisybit"]!= null)url+=delimToUse+"db\x3d"+cmp["daisybit"];if(is_pv&&mode=="BCP")url+=delimToUse+pv;return url}function getRandomNumber(){var min=1E8;var max=999999999;var randomnumber=Math.floor(min+(max-min)*Math.random());return randomnumber}function getPrefix(){return(document.location.protocol=="https:"?"https:":"http:")+"//"}function storageAvailable(type){var storage;try{storage=window[type];var x="__storage_test__";storage.setItem(x,x);storage.removeItem(x);return true}catch(e){return e instanceof DOMException&& (e["code"]===22||e["code"]===1014||e["name"]==="QuotaExceededError"||e["name"]==="NS_ERROR_DOM_QUOTA_REACHED")&&(storage&&storage.length!==0)}}var useLocalStorage=storageAvailable("localStorage");function readData(key){var retVal=getCookie(key);if(!retVal&&useLocalStorage)retVal=readLocalStorage(key);return retVal}function getCookie(cookieName){var cookieValue=null;var cookieString=""+document.cookie;if(cookieString.length!=0){var cookieMatch=cookieString.match(cookieName+"\x3d([^;]*)");if(typeof cookieMatch!= "undefined"&&cookieMatch!=null)cookieValue=cookieMatch[1]}return cookieValue}function readLocalStorage(key){return localStorage.getItem(key)}function handleCookies(data){var firstPartyCookieDomain=getFirstPartyCookieDomain(data);var cookieSuccess=false;if(firstPartyCookieDomain!=null)if(data.cookies&&data.cookies!="undefined"&&data.cookies!=null&&data.cookies.length>0)cookieSuccess=writeData(data.cookies,firstPartyCookieDomain);return cookieSuccess}function getFirstPartyCookieDomain(data){var cookieDomain= null;if(typeof data!=="undefined"&&data.domain&&data.domain!="undefined"&&data.domain!=null&&actualClient.cookieDomain.length>0){var domainCandidate=document.domain;if(actualClient.cookieDomain=="."+domainCandidate||actualClient.cookieDomain===domainCandidate)cookieDomain=actualClient.cookieDomain;else if(actualClient.cookieDomainIDN=="."+domainCandidate||actualClient.cookieDomainIDN===domainCandidate)cookieDomain=actualClient.cookieDomainIDN;else if(domainCandidate.indexOf(actualClient.cookieDomain)!== -1)cookieDomain=actualClient.cookieDomain;else if(domainCandidate.indexOf(actualClient.cookieDomainIDN)!==-1)cookieDomain=actualClient.cookieDomainIDN}return cookieDomain}function writeData(cookieArray,domainArg){var cookieSuccess=writeCookies(cookieArray,domainArg);var localStorageSuccess=writeLocalStorage(cookieArray,domainArg);return cookieSuccess||localStorageSuccess}function writeCookies(cookieArray,domainArg){if(typeof cookieArray!="undefined"&&cookieArray!=null){var cookieCount=cookieArray.length; for(var i=0;i0){var vn=delim+vr+"\x3d";for(var i=0;i 0||placementOpps.pt.length>0)url=append(url,"y","dp");if(async_props.async)url=append(url,"y","async");return url}function getDomain(){if(useFirstPartyDomain)return"bcp."+(test?"test.":"")+firstPartyHost;else return test?"bcp.test.lotame.com":bcpDomainPrefix+baseDomain}function bcp(){if(runOptimusOnly)return;if(typeof __cmp!="undefined"){setTimeout(function(){if(cmp.done==0){cmp.done=2;add("cmp","1");add("cmpto",cmp.wait);bcpinternal()}},cmp.wait);cmp.start=Date.now();__cmp("getConsentData",null, function(val,success){cmp.daisybit=val["consentData"];if(cmp.done==0){cmp.done=1;add("cmpwait",Date.now()-cmp.start);add("cmp","1");bcpinternal()}})}else bcpinternal()}function bcpinternal(){namespace.loaded?firebcp():dobcp=true}function bcpdpv(){var pvbak=namespace.pvdone;namespace.pvdone=true;bcpd();namespace.pvdone=pvbak}function bcpd(cb){var url=appendAll(baseURL(false));pixel(url,cb)}function bcpw(){var len=arguments.length;if(len>0)for(var i=0;i0)namespace.pvdone=true}function bcpf(){firebcp();dobcp= false}function getWaitingAddValues(){var rtn=0;for(var type in behaviors){var vals=behaviors[type];if(typeof vals!="undefined")rtn+=vals.length}return rtn}function executeOptimus(){var startCount=getWaitingAddValues();addTrigger({"act":["$1 : Buyer Interest : Clicked on Buy On Retailer link"],location:"([a-zA-Z0-9_-]+)\\.(com|org|net)/([a-zA-Z0-9_-]+)",element:"{{a.mntl-sc-block-commerce__button span.link__wrapper}}",event:"click",opr:85626});addTrigger({"seg":['ThoughtCo : {{meta[name\x3d"lotame:tax0"]}}.content : {{meta[name\x3d"lotame:tax1"]}}.content : {{meta[name\x3d"lotame:tax2"]}}.content : {{meta[name\x3d"lotame:tax3"]}}.content'], location:"thoughtco\\.com",element:'{{meta[name\x3d"lotame:tax3"]}}',event:"",opr:77058});addTrigger({"seg":['ThoughtCo : {{meta[name\x3d"lotame:tax0"]}}.content : {{meta[name\x3d"lotame:tax1"]}}.content : {{meta[name\x3d"lotame:tax2"]}}.content'],location:"thoughtco\\.com",element:'{{meta[name\x3d"lotame:tax2"]}}',event:"",opr:77059});addTrigger({"seg":['ThoughtCo : {{meta[name\x3d"lotame:tax0"]}}.content : {{meta[name\x3d"lotame:tax1"]}}.content'],location:"thoughtco\\.com",element:'{{meta[name\x3d"lotame:tax1"]}}', event:"",opr:77060});addTrigger({"seg":['ThoughtCo : {{meta[name\x3d"lotame:tax0"]}}.content'],location:"thoughtco\\.com",element:'{{meta[name\x3d"lotame:tax0"]}}',event:"",opr:77061});addTrigger({"seg":['ThoughtCo: {{meta[name\x3d"lotame:tax0"]}}.content : {{meta[name\x3d"lotame:tax1"]}}.content : {{meta[name\x3d"lotame:tax2"]}}.content : {{meta[name\x3d"lotame:tax3"]}}.content : {{meta[name\x3d"lotame:tax4"]}}.content'],location:"thoughtco\\.com",element:'{{meta[name\x3d"lotame:tax4"]}}',event:"", opr:78382});bindTriggers();return getWaitingAddValues()-startCount}function firebcp(){if(namespace.runOptimus)try{executeOptimus()}catch(exception){}if(namespace.dropSyncPixels)if(useFPC){var url=generateFirebcpURL("j");makeJsonpCall(url,"jsonpCallback")}else{var url=generateFirebcpURL("5");try{var tempIFrame=document.createElement("iframe");tempIFrame.setAttribute("id","LOTCCFrame_"+(new Date).getTime());url=append(url,"ifr","rt");tempIFrame.setAttribute("src",url.replace(/'/g,"%27"));tempIFrame.setAttribute("title", "empty");tempIFrame.setAttribute("tabindex","-1");tempIFrame.setAttribute("role","presentation");tempIFrame.setAttribute("aria-hidden","true");tempIFrame.style.border="0px";tempIFrame.style.width="0px";tempIFrame.style.height="0px";tempIFrame.style.display="block";document.body.appendChild(tempIFrame)}catch(exception){var pixel=new Image(1,1);pixel.src=url.replace(/'/g,"%27")}}reset(url)}function generateFirebcpURL(version){var url=appendAll(baseURL(true,version));if(typeof lotbcp!="undefined")url= append(url,lotbcp,"b");if(typeof lotact!="undefined")url=append(url,lotact,"act");if(typeof lotint!="undefined")url=append(url,lotint,"int");if(typeof lotmed!="undefined")url=append(url,lotmed,"med");if(includeReferrer)url=append(url,encodeURIComponent(getReferrer()),"ref");return url}function doneload(){if(dobcp)bcpf();namespace.loaded=true}function loadAsync(){if(async_props.async)try{for(type in async_props.asyncBehaviors)for(var i=0,b;b=async_props.asyncBehaviors[type][i++];)add(type,b);for(var i= 0,id;id=async_props.asyncOpportunityIds[i++];)addOpportunityId(async_props.asyncOpportunityIds[id]);for(var i=0,tag;tag=async_props.asyncOpportunities[i++];)addOpportunity(async_props.asyncOpportunities[tag]);bcp()}catch(e){}}var placement_rules=[],addTrigger=addOptimusRule;function bindTriggers(){placement_rules.sort(function(a,b){var regex=/^#/;if(regex.test(a.element)&&!regex.test(b.element))return-1;if(!regex.test(a.element)&®ex.test(b.element))return 1;return 0});for(var i=0,pl;pl=placement_rules[i++];)pl.process(); if(OptimusRule.element_cache.length>0)for(var i=OptimusRule.element_cache.length-1;i>=0;i--){var el=OptimusRule.element_cache[i][0];var handlers=OptimusRule.element_cache[i][1];for(var ev in handlers)addEvent(el,ev,function(h){var evt_el=el;return function(evt){for(var j=0,callback;callback=h[j++];)callback.call(evt_el,evt);var hasBehaviors=false;for(var type in behaviors){hasBehaviors=true;break}if(hasBehaviors||OptimusRule.rbData!==null){if(runOptimusOnly){parseQueryStringToParameters(running); add("amskip","Y")}bcpw()}}}(handlers[ev]));delete OptimusRule.element_cache[i];OptimusRule.element_cache.length--}}function addOptimusRule(r){var o=new OptimusRule(r);return o.process()}function addHapaxRule(r){var h=new HapaxRule(r);return h.process()}function addPlacementRule(r){placement_rules.push(new PlacementRule(r))}function OptimusRule(o){o=o||{};this.location=o.location||null;this.rule_id=o.opr||null;this.element=o.element||null;this.event=o.event||null;this.location_matches=null;this.element_matches= null;this.current_document=document;this.rbk=o.rbk||null;for(var bt in o)if(typeof o[bt]==="object"&&o[bt]!==null&&o[bt].length>0){this.behavior_type=bt;this.behavior=o[bt][0]}}OptimusRule.prototype={process:function(){var rule_matches=0;if(!this.is_valid())return false;for(var href in this.document_map){if(this.document_map[href]===null)continue;var loc_match=null;try{var re=new RegExp(this.location);loc_match=re.exec(href)}catch(e){this.add("opterr")}if(loc_match===null)continue;this.location_matches= loc_match;var doc=this.document_map[href];if(this.element!==null){this.query_regex.lastIndex=0;var query_element=this.query_regex.test(this.element)?this.element:"{{#"+this.element+"}}";var elm_match=this.query(query_element,doc);if(elm_match.length==0&&this.event==null)continue;var missing_property=false;for(var i=0,el;el=elm_match[i++];)if(typeof el["property_name"]!=="undefined"&&el["property_name"]!==null&&el["property_content"]===null)missing_property=true;if(missing_property)continue;this.element_matches= elm_match;this.event!==null?this.create_event(doc):this.match(doc);rule_matches++}else{this.match(doc);rule_matches++}}return rule_matches},match:function(doc){var matches=this.query(this.behavior,doc);if(this.rbk===null){var p_behavior=this.behavior;for(var i=0,m;m=matches[i++];)p_behavior=p_behavior.replace(m.expression,m.property_content!==null?m.property_content:"");p_behavior=p_behavior.replace(this.query_regex,"");if(this.location_matches!==null&&this.location_matches.length>0)for(var i=0;i< this.location_matches.length;i++){var sub_regex=new RegExp("\\$"+i.toString()+"\\b");p_behavior=p_behavior.replace(sub_regex,this.location_matches[i])}if(p_behavior!==""){p_behavior="#OpR#"+this.rule_id+"#"+decodeURI(p_behavior);this.add(p_behavior)}}else this.matchRBK(matches)},matchRBK:function(matches){var rbVals=[];var locs=this.location_matches;var subRegexes=[];if(locs!==null&&locs.length>0)for(var i=0;i0)for(var i=0,m;m=matches[i++];)if(typeof m.properties!=="undefined"&&m.properties.length>0)for(var x=0,p;p=m.properties[x++];)addToVals((""+this.behavior).replace(m.expression,p));else addToVals((""+this.behavior).replace(m.expression,m.property_content!==null?m.property_content:""));else{var v=(""+this.behavior).replace(this.query_regex,"");addToVals(v)}if(rbVals.length>0)OptimusRule.addRBData(this.rbk, rbVals)},add:function(b){add(this.behavior_type,b)},create_event:function(doc){var bind_to=[];if(this.element_matches.length>0)for(var i=0;i0)for(var j=0,el;el=el_list.elements[j++];)if(evt.target&&evt.target==el||evt.srcElement&&evt.srcElement==el){inst.match(curDoc);found=true;break}if(found)break}}else if(this===curr_elm)inst.match(curDoc)}};for(var i=0,curr_elm;curr_elm=bind_to[i++];){if(!(curr_elm.nodeType&&(curr_elm.nodeType==1||curr_elm.nodeType==9)))continue;var found=false; for(var j=0,arr_elm;arr_elm=OptimusRule.element_cache[j++];){if(!isArray(arr_elm))continue;var cached_elm=arr_elm[0];var handler=arr_elm[1];if(curr_elm===cached_elm){if(!(this.event in handler))handler[this.event]=[];handler[this.event].push(create_callback(curr_elm,this));found=true}}if(found===false){var new_elm=[curr_elm,{}];new_elm[1][this.event]=[create_callback(curr_elm,this)];OptimusRule.element_cache.push(new_elm)}}return OptimusRule.element_cache},is_valid:function(){var valid=true;if(this.location=== ""||this.location===null||typeof this.location!=="string")valid=false;if(this.rule_id===null||isNaN(parseInt(this.rule_id,10)))valid=false;if(this.element!==null&&typeof this.element!=="string")valid=false;if(this.event!==null&&(this.element==null||typeof this.event!=="string"))valid=false;return valid},filter:function(c){var str=c.replace(/<\/?[^>]+\/?>/gi,"").replace(/\n|\t|\r/gi," ").replace(/\s{2,}/g," ").replace(/\[quote\][\s\S]*\[\/quote\]/gi,"");try{str=decodeURIComponent(str)}catch(e){}if(typeof client!== "undefined"&&client==2241)str=str.replace(/[^\u0020-\u007e]/g,"");return str},query:function(q,doc){var matches=[],results,expr,selector,property,els,prefix;try{this.query_regex.lastIndex=0;while((results=this.query_regex.exec(q))!==null){expr=results[0];prefix=results[1]||"e";selector=results[2];property=results[4]||null;els=typeof OptimusRule.supported_sources[prefix]==="function"?OptimusRule.supported_sources[prefix].call(this,selector,property,doc):[];if(els.length>0)matches.push({expression:expr, elements:els[0],property_name:property,property_content:els[1],properties:els[2]})}}catch(e){this.add("opterr");matches=[]}return matches},query_regex:/([a-zA-Z]+)?\{\{([^}}]*)\}\}(\.([a-zA-Z0-9\._-]+))?/g,document_map:function(w,doc_map){doc_map[w.location.href]=w.document;var has_access=false;if(window.parent!=w){try{if(w.parent.location.href){has_access=true;return arguments.callee(w.parent,doc_map)}}catch(e){}if(!has_access)if(w.document.referrer!=="")doc_map[w.document.referrer]=null}return doc_map}(window, {})};OptimusRule.element_cache=[];OptimusRule.supported_sources={e:function(s,p,d){p=p||"value";var els=this.query_by_selector(s,d);var props=[];for(var i=0,e;e=els[i++];){var prop_arr=p.split(".");for(var j=0;typeof e[prop_arr[j]]!=="undefined";j++)e=e[prop_arr[j]];if(j===prop_arr.length)props.push(this.filter(e.toString()))}var p_content=props.length>0?props.join(","):null;return els.length>0?[els,p_content,props]:[]},r:function(s,p,d){p=parseInt(p,10)||0;var re=new RegExp(s);var matches=re.exec(d.referrer); var r_prop=matches!==null&&typeof matches[p]!=="undefined"?this.filter(matches[p]):null;return r_prop!==null?[matches,r_prop,[r_prop]]:[]}};OptimusRule.rbData=null;OptimusRule.addRBData=function(k,a){OptimusRule.rbData=OptimusRule.rbData||{};if(typeof OptimusRule.rbData[k]==="undefined")OptimusRule.rbData[k]=a.length>1?a:a[0];else{if(window.toString.call(OptimusRule.rbData[k])!=="[object Array]")OptimusRule.rbData[k]=[OptimusRule.rbData[k]];Array.prototype.push.apply(OptimusRule.rbData[k],a)}};OptimusRule.applyRBData= function(){if(OptimusRule.rbData!==null){add("rb",JSON.stringify(OptimusRule.rbData));OptimusRule.rbData=null}};function HapaxRule(h){OptimusRule.call(this,h);this.behavior_type="ugc";this.behavior=h["ug"][0]||null}HapaxRule.prototype=new OptimusRule;HapaxRule.prototype.is_valid=function(){var valid=true;if(this.location===""||this.location===null||typeof this.location!=="string")valid=false;if(this.element===""||this.element===null||typeof this.element!=="string")valid=false;if(this.event===""|| this.event===null||typeof this.event!=="string")valid=false;if(this.behavior===""||this.behavior===null||typeof this.behavior!=="object")valid=false;return valid};function PlacementRule(p){OptimusRule.call(this,p);this.placement_id=p.placement_id||null;this.placement=p.placement||null}PlacementRule.prototype=new OptimusRule;PlacementRule.prototype.process=function(){if(!this.is_valid)return false;var els=this.query(this.query_regex.test(this.element)?this.element:"{{"+this.element+"}}",document); if(els.length<=0)return false;if(this.placement_id!==null)this.addOpportunityId();else if(this.placement!==null)this.addOpportunity();else return false;return true};PlacementRule.prototype.addOpportunityId=function(){addOpportunityId(this.placement_id)};PlacementRule.prototype.addOpportunity=function(){addOpportunity(this.placement)};PlacementRule.prototype.is_valid=function(){var valid=true;if((this.placement==null||typeof this.placement!=="string")&&(this.placement_id==null||isNaN(parseInt(this.placement_id, 10))))valid=false;if(this.element===""||this.element===null||typeof this.element!=="string")valid=false;return valid};(function(){var doc=document;var isIE=/(?!.*?opera.*?)msie(?!.*?opera.*?)/i.test(navigator.userAgent);var isWebKit=/webkit/i.test(navigator.userAgent);var cache={};var cacheOn=!isIE&&!isWebKit;var persistCache={};var _uid=0;var reg={trim:/^\s+|\s+$/g,quickTest:/^[^:\[>+~ ,]+$/,typeSelector:/(^[^\[:]+?)(?:\[|:|$)/,tag:/^(\w+|\*)/,id:/^(\w*|\*)#/,classRE:/^(\w*|\*)\./,attributeName:/(\w+)(?:[!+~*\^$|=])|\w+/, attributeValue:/(?:[!+~*\^$|=]=*)(.+)(?:\])/,pseudoName:/(:[^\(]+)/,pseudoArgs:/(?:\()(.+)(?:\))/,nthParts:/([+-]?\d)*(n)([+-]\d+)*/i,combinatorTest:/[+>~ ](?![^\(]+\)|[^\[]+\])/,combinator:/\s*[>~]\s*(?![=])|\s*\+\s*(?![0-9)])|\s+/g,recursive:/:(not|has)\((\w+|\*)?([#.](\w|\d)+)*(:(\w|-)+(\([^\)]+\))?|\[[^\}]+\])*(\s*,\s*(\w+|\*)?([#.](\w|\d)+)*(:(\w|-)+(\([^\)]+\))?|\[[^\}]+\])*)*\)/gi};var arrayIt=function(a){if(!!(window.attachEvent&&!window.opera))return function(a){if(a instanceof Array)return a; for(var i=0,result=[],m;m=a[i++];)result[result.length]=m;return result};else return function(a){return Array.prototype.slice.call(a)}}(null);function filter(a,tag){var r=[],uids={};if(tag)tag=new RegExp("^"+tag+"$","i");for(var i=0,ae;ae=a[i++];){ae.uid=ae.uid||_uid++;if(!uids[ae.uid]&&(!tag||ae.nodeName.search(tag)!==-1))r[r.length]=uids[ae.uid]=ae}return r}function getAttribute(e,a){if(!e)return null;if(a==="class"||a==="className")return e.className;if(a==="for")return e.htmlFor;return e.getAttribute(a)|| e[a]}function getByClass(selector,selectorRE,root,includeRoot,cacheKey,tag,flat){var result=[];if(!!flat)return selectorRE.test(root.className)?[root]:[];if(root.getElementsByClassName){result=arrayIt(root.getElementsByClassName(selector));if(!!includeRoot)if(selectorRE.test(root.className))result[result.length]=root;if(tag!="*")result=filter(result,tag);cache[cacheKey]=result.slice(0);return result}else if(doc.getElementsByClassName){result=arrayIt(doc.getElementsByClassName(selector));if(tag!="*")result= filter(result,tag);cache[cacheKey]=result.slice(0);return result}var es=tag=="*"&&root.all?root.all:root.getElementsByTagName(tag);if(!!includeRoot)es[es.length]=root;for(var index=0,e;e=es[index++];)if(selectorRE.test(e.className))result[result.length]=e;return result}function getById(selector,root,includeRoot,cacheKey,tag,flat){var rs,result=[];if(!!flat)return getAttribute(root,"id")===selector?[root]:[];if(root.getElementById)rs=root.getElementById(selector);else rs=doc.getElementById(selector); if(rs&&getAttribute(rs,"id")===selector){result[result.length]=rs;cache[cacheKey]=result.slice(0);return result}var es=root.getElementsByTagName(tag);if(!!includeRoot)es[es.length]=root;for(var index=0,e;e=es[index++];)if(getAttribute(e,"id")===selector){result[result.length]=e;break}return result}function getContextFromSequenceSelector(selector,roots,includeRoot,flat){var context,contextRE,tag,contextType="",result=[],tResult=[],root,rootCount,rootsLength;reg.id.lastIndex=reg.typeSelector.lastIndex= reg.classRE.lastIndex=0;if(!reg.tag.test(selector))selector="*"+selector;context=reg.typeSelector.exec(selector)[1];roots=roots instanceof Array?roots.slice(0):[roots];rootsLength=roots.length;rootCount=rootsLength-1;if(reg.id.test(context)){contextType="id";tag=(tag=context.match(/^\w+/))?tag[0]:"*";context=context.replace(reg.id,"")}else if(reg.classRE.test(context)){contextType="class";tag=(tag=context.match(reg.tag))?tag[0]:"*";context=context.replace(reg.tag,"");contextRE=persistCache[context+ "RegExp"]||(persistCache[context+"RegExp"]=new RegExp("(?:^|\\s)"+context.replace(/\./g,"\\s*")+"(?:\\s|$)"));context=context.replace(/\./g," ")}while(rootCount>-1){root=roots[rootCount--];root.uid=root.uid||_uid++;var cacheKey=selector+root.uid;if(cacheOn&&cache[cacheKey]){result=result.concat(cache[cacheKey]);continue}if(contextType==="id")tResult=getById(context,root,includeRoot,cacheKey,tag,flat);else if(contextType==="class")tResult=getByClass(context,contextRE,root,includeRoot,cacheKey,tag, flat);else{tResult=arrayIt(root.getElementsByTagName(context));if(!!includeRoot&&(root.nodeName.toUpperCase()===context.toUpperCase()||context==="*"))tResult[tResult.length]=root}result=rootsLength>1?result.concat(tResult):tResult;cache[cacheKey]=result.slice(0)}return result}var peppy={query:function(selectorGroups,root,includeRoot,recursed,flat){var elements=[];if(!recursed)selectorGroups=selectorGroups.replace(reg.trim,"").replace(/(\[)\s+/g,"$1").replace(/\s+(\])/g,"$1").replace(/(\[[^\] ]+)\s+/g, "$1").replace(/\s+([^ \[]+\])/g,"$1").replace(/(\()\s+/g,"$1").replace(/(\+)([^0-9])/g,"$1 $2").replace(/['"]/g,"").replace(/\(\s*even\s*\)/gi,"(2n)").replace(/\(\s*odd\s*\)/gi,"(2n+1)");if(typeof root==="string")root=(root=getContextFromSequenceSelector(root,doc)).length>0?root:undefined;root=root||doc;root.uid=root.uid||_uid++;var cacheKey=selectorGroups+root.uid;if(cacheOn&&cache[cacheKey])return cache[cacheKey];reg.quickTest.lastIndex=0;if(reg.quickTest.test(selectorGroups)){elements=getContextFromSequenceSelector(selectorGroups, root,includeRoot,flat);return cache[cacheKey]=elements.slice(0)}var groupsWorker,groups,selector;groupsWorker=selectorGroups.split(/\s*,\s*/g);groups=groupsWorker.length>1?[""]:groupsWorker;for(var gwi=0,tc=0,gi=0,g;groupsWorker.length>1&&(g=groupsWorker[gwi++])!==undefined;){var l,r;tc+=((l=g.match(/\(/g))?l.length:0)-((r=g.match(/\)/g))?r.length:0);groups[gi]=groups[gi]||"";groups[gi]+=groups[gi]===""?g:","+g;if(tc===0)gi++}var gCount=0;while((selector=groups[gCount++])!==undefined){reg.quickTest.lastIndex= 0;if(reg.quickTest.test(selector)){result=getContextFromSequenceSelector(selector,root,includeRoot,flat);elements=groups.length>1?elements.concat(result):result;continue}reg.combinatorTest.lastIndex=0;if(reg.combinatorTest.test(selector)){var parts,pLength,pCount=0,combinators,cCount=0,result;parts=selector.split(reg.combinator);pLength=parts.length;combinators=selector.match(reg.combinator)||[""];while(pCount1?elements.concat(result):result;result=undefined}else{result=peppy.querySelector(selector,root,includeRoot,flat);elements=groups.length>1?elements.concat(result):result}}if(groups.length>1)elements=filter(elements);return cache[cacheKey]=elements.slice(0)},queryCombinator:function(l,r,c){var result=[],uids={},proc= {},succ={},fail={},combinatorCheck=peppy.simpleSelector.combinator[c];for(var li=0,le;le=l[li++];){le.uid=le.uid||_uid++;uids[le.uid]=le}for(var ri=0,re;re=r[ri++];){re.uid=re.uid||_uid++;if(!proc[re.uid]&&combinatorCheck(re,uids,fail,succ))result[result.length]=re;proc[re.uid]=re}return result},querySelector:function(selector,root,includeRoot,flat){var context,passed=[],count,totalCount,e,first=true;context=getContextFromSequenceSelector(selector,root,includeRoot,flat);count=context.length;totalCount= count-1;var tests,recursive;if(/:(not|has)/i.test(selector)){recursive=selector.match(reg.recursive);selector=selector.replace(reg.recursive,"")}if(!(tests=selector.match(/:(\w|-)+(\([^\(]+\))*|\[[^\[]+\]/g)))tests=[];if(recursive)tests=tests.concat(recursive);var aTest;while((aTest=tests.pop())!==undefined){var pc=persistCache[aTest],testFuncScope,testFunc,testFuncKey,testFuncArgs=[],isCountTest=false;passed=[];if(pc){testFuncKey=pc[0];testFuncScope=pc[1];testFuncArgs=pc.slice(2);testFunc=testFuncScope[testFuncKey]}else if(!/^:/.test(aTest)){var n= aTest.match(reg.attributeName);var v=aTest.match(reg.attributeValue);testFuncArgs[1]=n[1]||n[0];testFuncArgs[2]=v?v[1]:"";testFuncKey=""+aTest.match(/[~!+*\^$|=]/);testFuncScope=peppy.simpleSelector.attribute;testFunc=testFuncScope[testFuncKey];persistCache[aTest]=[testFuncKey,testFuncScope].concat(testFuncArgs)}else{var pa=aTest.match(reg.pseudoArgs);testFuncArgs[1]=pa?pa[1]:"";testFuncKey=aTest.match(reg.pseudoName)[1];testFuncScope=peppy.simpleSelector.pseudos;if(/nth-(?!.+only)/i.test(aTest)){var a, b,nArg=testFuncArgs[1],nArgPC=persistCache[nArg];if(nArgPC){a=nArgPC[0];b=nArgPC[1]}else{var nParts=nArg.match(reg.nthParts);if(nParts){a=parseInt(nParts[1],10)||0;b=parseInt(nParts[3],10)||0;if(/^\+n|^n/i.test(nArg))a=1;else if(/^-n/i.test(nArg))a=-1;testFuncArgs[2]=a;testFuncArgs[3]=b;persistCache[nArg]=[a,b]}}}else if(/^:contains/.test(aTest)){var cArg=testFuncArgs[1];var cArgPC=persistCache[cArg];if(cArgPC)testFuncArgs[1]=cArgPC;else testFuncArgs[1]=persistCache[cArg]=new RegExp(cArg)}testFunc= testFuncScope[testFuncKey];persistCache[aTest]=[testFuncKey,testFuncScope].concat(testFuncArgs)}isCountTest=/^:(nth[^-]|eq|gt|lt|first|last)/i.test(aTest);if(isCountTest)testFuncArgs[3]=totalCount;var cLength=context.length,cCount=cLength-1;while(cCount>-1){e=context[cCount--];if(first)e.peppyCount=cCount+1;var pass=true;testFuncArgs[0]=e;if(isCountTest)testFuncArgs[2]=e.peppyCount;if(!testFunc.apply(testFuncScope,testFuncArgs))pass=false;if(pass)passed.push(e)}context=passed;first=false}return passed}, simpleSelector:{attribute:{"null":function(e,a,v){return!!getAttribute(e,a)},"\x3d":function(e,a,v){return getAttribute(e,a)==v},"~":function(e,a,v){return getAttribute(e,a).match(new RegExp("\\b"+v+"\\b"))},"^":function(e,a,v){return getAttribute(e,a).indexOf(v)===0},"$":function(e,a,v){var attr=getAttribute(e,a);return attr.lastIndexOf(v)===attr.length-v.length},"*":function(e,a,v){return getAttribute(e,a).indexOf(v)!=-1},"|":function(e,a,v){return getAttribute(e,a).match("^"+v+"-?(("+v+"-)*("+ v+"$))*")},"!":function(e,a,v){return getAttribute(e,a)!==v}},pseudos:{":root":function(e){return e===doc.getElementsByTagName("html")[0]?true:false},":nth-child":function(e,n,a,b,t){if(!e.nodeIndex){var node=e.parentNode.firstChild,count=0,last;for(;node;node=node.nextSibling)if(node.nodeType==1){last=node;node.nodeIndex=++count}last.IsLastNode=true;if(count==1)last.IsOnlyChild=true}var position=e.nodeIndex;if(n=="first")return position==1;if(n=="last")return!!e.IsLastNode;if(n=="only")return!!e.IsOnlyChild; return!a&&!b&&position==n||(a==0?position==b:a>0?position>=b&&(position-b)%a==0:position<=b&&(position+b)%a==0)},":nth-last-child":function(e,n){return this[":nth-child"](e,n)},":nth-of-type":function(e,n,t){return this[":nth-child"](e,n,null,null,t)},":nth-last-of-type":function(e,n,t){return this[":nth-child"](e,n,null,null,t)},":first-child":function(e){return this[":nth-child"](e,"first")},":last-child":function(e){return this[":nth-child"](e,"last")},":first-of-type":function(e,n,t){return this[":nth-child"](e, "first",null,null,t)},":last-of-type":function(e,n,t){return this[":nth-child"](e,"last",null,null,t)},":only-child":function(e){return this[":nth-child"](e,"only")},":only-of-type":function(e,n,t){return this[":nth-child"](e,"only",null,null,t)},":empty":function(e){for(var node=e.firstChild;node!==null;node=node.nextSibling)if(node.nodeType===1||node.nodeType===3)return false;return true},":not":function(e,s){return peppy.query(s,e,true,true,true).length===0},":has":function(e,s){return peppy.query(s, e,true,true,true).length>0},":selected":function(e){return e.selected},":hidden":function(e){return e.type==="hidden"||e.style.display==="none"},":visible":function(e){return e.type!=="hidden"&&e.style.display!=="none"},":input":function(e){return e.nodeName.search(/input|select|textarea|button/i)!==-1},":radio":function(e){return e.type==="radio"},":checkbox":function(e){return e.type==="checkbox"},":text":function(e){return e.type==="text"},":header":function(e){return e.nodeName.search(/h\d/i)!== -1},":enabled":function(e){return!e.disabled&&e.type!=="hidden"},":disabled":function(e){return e.disabled},":checked":function(e){return e.checked},":contains":function(e,s){return s.test(e.textContent||e.innerText||"")},":parent":function(e){return!!e.firstChild},":odd":function(e){return this[":nth-child"](e,"2n+2",2,2)},":even":function(e){return this[":nth-child"](e,"2n+1",2,1)},":nth":function(e,s,i){return s==i},":eq":function(e,s,i){return s==i},":gt":function(e,s,i){return i>s},":lt":function(e, s,i){return i0){add("amskip","Y");bcpd()}return}bcp(); window[ns].jsonpCallback=jsonpCallback;var _cc_dcCkeName="_cc_dc";var _cc_cloCkeName="_cc_clo";function makeJsonpCall(url,callbackMethod,delimArg){var delimToUse=getDefinedValue(delimArg,delim);var callbackId="cc_"+callbackMethod;var urlString=String(url);urlString=append(urlString,ns+"."+callbackMethod,"callback",delimToUse);urlString=append(urlString,callbackId,"callbackid",delimToUse);urlString=append(urlString,encodeURIComponent(delimToUse),"delim",delimToUse);var fpcJsonArray=getFirstPartyCookiesJson(); if(fpcJsonArray.length>0){var jsonPayload=[createJsonPayload(fpcJsonArray)];urlString=append(urlString,jsonPayload,"jsonpayload",delimToUse);if(urlString.indexOf("fpc\x3dy")==-1)urlString=append(urlString,"y","fpc",delimToUse)}var tempScriptTag=document.createElement("script");tempScriptTag.type="text/javascript";tempScriptTag.src=urlString;tempScriptTag.id=callbackId;document.body.appendChild(tempScriptTag)}function jsonpCallback(data){if(data==null||data=="undefined")return;removeJsonpTag(data); handleCookies(data);var delimToUse=getDefinedValue(data["delim"],delim);if(data["redirect"]){var redirectUrl=String(data["redirect"]);var redirectType=getDefinedValue(data["redirectType"],"JSONP");switch(redirectType){case "WINDOW_LOCATION":window.location.assign(redirectUrl);break;case "JSONP":default:redirectUrl=removeCallbackParams(redirectUrl,data,delimToUse);var firstPartyCookieDomain=getFirstPartyCookieDomain(data);if(redirectUrl.indexOf("ct\x3dy")!=-1){var isCookieable=false;if(firstPartyCookieDomain!= null)isCookieable=writeTestCookie(firstPartyCookieDomain);if(isCookieable)redirectUrl=addFpcParam(redirectUrl)}var url=getPrefix()+getDomain()+redirectUrl;makeJsonpCall(url,"jsonpCallback",delimToUse);break}}}function removeJsonpTag(data){if(!data["callbackId"]||data["callbackId"]=="undefined"||data["callbackId"]==null)return;var scriptTag=document.getElementById(data["callbackId"]);document.body.removeChild(scriptTag)}function removeCallbackParams(url,data,delimArg){var delimToUse=getDefinedValue(delimArg, delim);if(typeof data["calback"]!=="undefined"&&data["callback"]!="undefined"&&data["callback"]!=null)url=removeUrlParam(url,delimToUse+"callback\x3d"+data["callback"]);if(data["callbackId"])url=removeUrlParam(url,delimToUse+"callbackid\x3d"+data["callbackId"]);if(data["delim"])url=removeUrlParam(url,delimToUse+"delim\x3d"+data["delim"]);return url}function removeUrlParam(url,param){var array=url.split(param);return String(array[0]+array[1])}function getFirstPartyCookiesJson(){var retVal=new Array; var fpcId=readData(_cc_idCkeName);if(fpcId!=null)retVal.push(createCookieJson(_cc_idCkeName,fpcId));var fpcDc=getCookie(_cc_dcCkeName);if(fpcDc!=null)retVal.push(createCookieJson(_cc_dcCkeName,fpcDc));var fpcClo=getCookie(_cc_cloCkeName);if(fpcClo!=null)retVal.push(createCookieJson(_cc_cloCkeName,fpcClo));return retVal}function addFpcParam(url){if(url.indexOf("fpc\x3dy")==-1)url=append(url,"y","fpc");return url}function createCookieJson(name,value){return'{"name":"'+name+'","value":"'+value+'"}'} function createJsonPayload(cookies){var jsonPayload="{";if(cookies!=null&&typeof cookies=="object"&&cookies.length>0){var cookiesJson='"cookies":[';var cookiesCount=cookies.length;for(var i=0;i