if(typeof LOTCC=="undefined"){var LOTCC={};LOTCC.pvdone=false;LOTCC.userAgent=navigator.userAgent.toLowerCase();LOTCC.domain=document.domain;LOTCC.test=false;LOTCC.bcpDomain='';LOTCC.client='';LOTCC.loaded=false;LOTCC.te=new Array();LOTCC.mnpct=50;LOTCC.mxidle=20;LOTCC.mxstart=0;LOTCC.lstact=new Date();LOTCC.isFocused=true;LOTCC.expinited=false;LOTCC.maxPolls=5;LOTCC.icnt=0;LOTCC.numPolls=0;LOTCC.stepIncrement=0;LOTCC.pollInterval=0;LOTCC.pollIncrement=3;LOTCC.sw="_SW["+(new Date()).getTime()+"]";LOTCC.swSize=0;LOTCC.lastStr="";LOTCC.ichks=0;LOTCC.pvdone=false;LOTCC.behaviors=new Object();LOTCC.urls=new Object();LOTCC.sep="/";LOTCC.version="4";LOTCC.delim="|";LOTCC.bcpd_callback=null;LOTCC.pv="pv=y";LOTCC.dobcp=false}function bcp(){if(typeof(lotbcp)!="undefined"){LOTCC.bhv=lotbcp}if(typeof(domain)!="undefined"){LOTCC.domain=domain}if(typeof(lotclient)!="undefined"){LOTCC.client=lotclient}LOTCC.bcp()}LOTCC.flash=function(msg){if(div=document.getElementById('LOTCC.status'))div.innerHTML=msg};LOTCC.isArray=function(v){return v&&typeof v==='object'&&typeof v.length==='number'&&!(v.propertyIsEnumerable('length'))};LOTCC.add=function(name,id){if(LOTCC.behaviors[name]==null){LOTCC.behaviors[name]=new Array()}var entry=LOTCC.behaviors[name];var encodedId=encodeURIComponent(id);entry[entry.length]=encodedId.replace(/%2F/g,"/")};LOTCC.addBehavior=function(id){LOTCC.add("b",id)};LOTCC.addAction=function(id){LOTCC.add("act",id)};LOTCC.addInterest=function(id){LOTCC.add("int",id)};LOTCC.addMedia=function(id){LOTCC.add("med",id)};LOTCC.addMemberId=function(id){};LOTCC.addContentId=function(id){};LOTCC.appendInternal=function(url,vals,vr){if((typeof(vals)!="undefined")&&(vals.length>0)){var vn=LOTCC.delim+vr+"=";for(var i=0;i<vals.length;i++){url+=vn+vals[i]}}return url};LOTCC.append=function(url,val,vr){if((typeof(val)!="undefined")&&(val.length>0)){var vals;if(LOTCC.isArray(val)){vals=val}else{vals=val.split(",")}var vn=LOTCC.delim+vr+"=";for(var i=0;i<vals.length;i++){url+=vn+vals[i]}}return url};LOTCC.appendAll=function(url){for(var type in LOTCC.behaviors){url=LOTCC.appendInternal(url,LOTCC.behaviors[type],type)}return url};LOTCC.baseURL=function(pv){pv=!LOTCC.pvdone;var min=100000000;var max=999999999;var randomnumber=Math.floor(min+(max-min)*Math.random());var prefix=document.location.protocol+'//';var url=prefix+LOTCC.getDomain()+"/"+LOTCC.version+LOTCC.sep+"c="+LOTCC.client+LOTCC.delim+"rand="+randomnumber;if(pv){url+=LOTCC.delim+LOTCC.pv}if(typeof(LOTCC.group)!="undefined"){url+=LOTCC.delim+"brg="+LOTCC.group}return url};LOTCC.getDomain=function(){return(LOTCC.test)?'bcp.test.lotame.com':'bcp.crwdcntrl.net'};LOTCC.bcp=function(){if(LOTCC.client=="15"||/fotolog/i.test(LOTCC.domain)){var foundUS=false;var ints=LOTCC.behaviors["int"]||[];for(var i=0;i<ints.length;i++){if(decodeURIComponent(ints[i]).toLowerCase()=="country:us"||decodeURIComponent(ints[i]).toLowerCase()=="country:ca"){foundUS=true}}if(!foundUS){return}}LOTCC.bcpinternal()};LOTCC.bcpinternal=function(){if(LOTCC.loaded){LOTCC.firebcp()}else{LOTCC.dobcp=true}};LOTCC.enableDiv=function(){};LOTCC.enableNamedDiv=function(name){};LOTCC.fillDiv=function(content){};LOTCC.bcpd=function(cb){var url=LOTCC.appendAll(LOTCC.baseURL(false));LOTCC.pixel(url,cb)};LOTCC.bcpw=function(){var len=LOTCC.bcpw.arguments.length;if(len>0){for(var i=0;i<len;i+=2){if(i+1<len){LOTCC.add(LOTCC.bcpw.arguments[i],LOTCC.bcpw.arguments[i+1])}}}LOTCC.bcpd()};LOTCC.pixel=function(url,cb){var pi=new Image();pi.onload=LOTCC.img_done;pi.onerror=LOTCC.img_done;pi.onabort=LOTCC.img_done;LOTCC.bcpd_callback=cb;LOTCC.reset(url);pi.src=url};LOTCC.img_done=function(url){if(LOTCC.bcpd_callback){LOTCC.bcpd_callback()}};LOTCC.reset=function(url){LOTCC.behaviors=new Object();if(typeof(lotbcp)!="undefined"){lotbcp=""}if(typeof(lotact)!="undefined"){lotact=""}if(typeof(lotint)!="undefined"){lotint=""}if(typeof(lotmed)!="undefined"){lotmed=""}if(url&&url.indexOf(LOTCC.pv)>0){LOTCC.pvdone=true}};LOTCC.browser={version:(LOTCC.userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(LOTCC.userAgent),opera:/opera/.test(LOTCC.userAgent),msie:/msie/.test(LOTCC.userAgent)&&!/opera/.test(LOTCC.userAgent),mozilla:/mozilla/.test(LOTCC.userAgent)&&!/(compatible|webkit)/.test(LOTCC.userAgent)};LOTCC.addEvent=(function(){if(document.addEventListener){return function(obj,sEvent,func){obj.addEventListener(sEvent,func,false);return true}}else{if(document.attachEvent){return function(obj,sEvent,func){obj.attachEvent("on"+sEvent,func);return true}}else{return function(obj,sEvent,func){return false}}}})();LOTCC.expinit=function(){if(LOTCC.expinited==true){return}LOTCC.flash("initializing");var f=function(){LOTCC.activity();LOTCC.isFocused=true};var b=function(){LOTCC.activity();LOTCC.isFocused=false};LOTCC.addEvent((LOTCC.browser.mozilla||LOTCC.browser.opera)?document:window,"focus",f);LOTCC.addEvent((LOTCC.browser.mozilla||LOTCC.browser.opera)?document:window,"blur",b);LOTCC.addEvent(window,"scroll",LOTCC.activity);LOTCC.addEvent(window,"resize",LOTCC.activity);LOTCC.addEvent(window,"load",LOTCC.activity);LOTCC.addEvent(window,"mousemove",LOTCC.activity);LOTCC.addEvent(document,"mousemove",LOTCC.activity);LOTCC.addEvent(document,"keyup",LOTCC.activity);LOTCC.addEvent(document,"click",LOTCC.activity);LOTCC.addEvent(window,"unload",LOTCC.record);setInterval("LOTCC.track()",1000);LOTCC.expinited=true;LOTCC.flash("Initialized")};LOTCC.firebcp=function(){var url=LOTCC.appendAll(LOTCC.baseURL(true));if(typeof(lotbcp)!="undefined"){url=LOTCC.append(url,lotbcp,"b")}if(typeof(lotact)!="undefined"){url=LOTCC.append(url,lotact,"act")}if(typeof(lotint)!="undefined"){url=LOTCC.append(url,lotint,"int")}if(typeof(lotmed)!="undefined"){url=LOTCC.append(url,lotmed,"med")}try{var tempIFrame=document.createElement('iframe');tempIFrame.setAttribute('id','LOTCCFrame'+new Date());url=LOTCC.append(url,"ifr","rt");tempIFrame.setAttribute('src',url.replace(/'/g,"%27"));tempIFrame.style.border='0px';tempIFrame.style.width='0px';tempIFrame.style.height='0px';document.body.appendChild(tempIFrame)}catch(exception){var pixel=new Image(1,1);pixel.src=url.replace(/'/g,"%27")}LOTCC.reset(url)};LOTCC.doneload=function(){if(LOTCC.dobcp){LOTCC.firebcp();LOTCC.dobcp=false}LOTCC.loaded=true};LOTCC.activity=function(){LOTCC.lstact=new Date()};LOTCC.record=function(){var ad_exp=new Array();var camp_exp=new Array();var swArray=new Array();for(var i=0;i<LOTCC.te.length;i++){var eInf=LOTCC.te[i];if(eInf==undefined)continue;if(eInf['last_seen']==null)continue;var d=Math.round(LOTCC.getTime(eInf['element'].elm)/1000);var start_time=eInf['max_start'];if(d==undefined||d<start_time)continue;var last_seen=Math.floor(eInf['last_seen'].getTime()/1000);var aInf=ad_exp['a'+eInf["adId"]];var cInf=camp_exp['c'+eInf["campaignId"]];if(aInf==undefined){aInf=new Array();aInf['id']=eInf["adId"];ad_exp['a'+eInf["adId"]]=aInf;ad_exp.push(aInf)}if(cInf==undefined){cInf=new Array();cInf['id']=eInf["campaignId"];camp_exp['c'+eInf["campaignId"]]=cInf;camp_exp.push(cInf)}aInf["duration"]=(aInf["duration"]==undefined)?d:aInf["duration"]+d;cInf["duration"]=(cInf["duration"]==undefined)?d:cInf["duration"]+d;aInf["last_seen"]=last_seen;if(cInf["last_seen"]==undefined||last_seen>cInf["last_seen"])cInf["last_seen"]=last_seen;swArray.push(eInf["txId"]+"."+eInf["adId"]+"."+eInf["zoneId"]+"."+aInf["duration"])}if(swArray.length>0&&LOTCC.icnt>0){var cks=new Array();cks.push(LOTCC.sw+"="+swArray.join("_"));for(var i=0;i<ad_exp.length;i++){var aInf=ad_exp[i];var ab_name='_OAAEBLOCK['+aInf['id']+']';var ac_name='_OAAECAP['+aInf['id']+']';cks.push(ac_name+"="+aInf["duration"]);cks.push(ab_name+"="+aInf["last_seen"])}for(var i=0;i<camp_exp.length;i++){var cInf=camp_exp[i];var cb_name='_OACEBLOCK['+cInf['id']+']';var cc_name='_OACECAP['+cInf['id']+']';cks.push(cc_name+"="+cInf["duration"]);cks.push(cb_name+"="+cInf["last_seen"])}if(swArray.length>LOTCC.swSize){LOTCC.pollInterval=0;LOTCC.stepIncrement=0}LOTCC.swSize=swArray.length;if(LOTCC.stepIncrement==LOTCC.pollInterval){var str=cks.join("&");if(str!=null&&str.length>0&&str!=LOTCC.lastStr){var min=100000000;var max=999999999;var rand=Math.floor(min+(max-min)*Math.random());var tracker=new Image(1,1);var prefix=document.location.protocol+'//';var poll=prefix+LOTCC.getDomain()+"/exp?"+str+"&rand="+rand;tracker.src=poll;LOTCC.flash("Poll "+poll);LOTCC.lastStr=str;LOTCC.stepIncrement=0;LOTCC.numPolls++}else{LOTCC.flash("no changes to poll")}if(LOTCC.numPolls==LOTCC.maxPolls){LOTCC.numPolls=0;LOTCC.maxPolls=Math.ceil(LOTCC.maxPolls/2);LOTCC.pollInterval+=LOTCC.pollIncrement}}else{LOTCC.stepIncrement++}}LOTCC.icnt++};LOTCC.track=function(){var msg="";for(var i=0;i<LOTCC.te.length;i++){var eInf=LOTCC.te[i];var e=eInf['element'];if(e==undefined)continue;e=e.elm;var pct=LOTCC.getPctVisible(e);var activityInterval=Math.round((new Date().getTime()-LOTCC.lstact.getTime())/1000);var exposure_time=Math.round(LOTCC.getTime(e)/1000);if(pct>=eInf['min_visible']&&activityInterval<eInf['max_idle']&&LOTCC.isFocused){msg+=LOTCC.startTimer(e)}else{msg+=LOTCC.stopTimer(e)}msg+=": "+pct+" visible, "+activityInterval+" seconds idle. exposure timer @ "+exposure_time+" seconds for tx "+eInf['txId']+"<br \>"}LOTCC.flash(msg);LOTCC.record()};LOTCC.stopTimer=function(e){if(e==undefined)return;var eInf=LOTCC.getElementInfo(e);var msg='';if(eInf['start']!=undefined){eInf['totaltime']=LOTCC.getTime(e);delete eInf['start'];msg='Stop Timer'}else{msg='Timer Stopped'}return msg};LOTCC.startTimer=function(e){if(e==undefined)return;var eInf=LOTCC.getElementInfo(e);var msg='';eInf['last_seen']=new Date();if(eInf['start']==undefined){eInf['start']=new Date();msg='Start Timer'}else{msg='Timer Running'}return msg};LOTCC.getTime=function(e){if(e==undefined)return;var eInf=LOTCC.getElementInfo(e);var duration=0;if(eInf['start']!=undefined){duration=new Date().getTime()-eInf['start'].getTime();duration=eInf['totaltime']+duration}else{duration=eInf['totaltime']}return duration};LOTCC.getElementInfo=function(e){var len=LOTCC.te.length;for(var i=0;i<len;i++){if(LOTCC.te[i]['element'].elm==e)return LOTCC.te[i]}return null};LOTCC.addExpTracker=function(txId,elementId,zoneId,adId,campaignId,expInfo){var e=document.getElementById(elementId);if(e==undefined||adId==undefined){LOTEXP.flash(elementId+" not found");return}LOTCC.addExpTrackerElm(txId,e,zoneId,adId,campaignId,expInfo)};LOTCC.addExpTrackerElm=function(txId,e,zoneId,adId,campaignId,expInfo){if(e==undefined||adId==undefined)return;LOTCC.expinit();if(!(e.offsetHeight>0||e.offsetWidth>0))return;for(var i=0;i<LOTCC.te.length;i++){if(LOTCC.te[i]['element'].elm==e)return}LOTCC.flash("adding tracker for tx "+txId);var eInf=new Array();eInf['element']={elm:e};eInf['adId']=adId;eInf['zoneId']=zoneId;eInf['txId']=txId;eInf['campaignId']=campaignId;eInf['min_visible']=expInfo.pct_visible||LOTCC.mnpct;eInf['max_idle']=expInfo.max_idle||LOTCC.mxidle;eInf['max_start']=expInfo.max_start||LOTCC.mxstart;eInf['rand']=Math.floor(100000000+(999999999-100000000)*Math.random());eInf['last_seen']=null;eInf['totaltime']=0;LOTCC.te.push(eInf)};LOTCC.getPctVisible=function(e){if(e==null)return 0;var elementX1=elementY1=0;var workingElement=e;if(workingElement.offsetParent){do{elementX1+=workingElement.offsetLeft;elementY1+=workingElement.offsetTop}while(workingElement=workingElement.offsetParent)}var elementX2=elementX1+e.offsetWidth;var elementY2=elementY1+e.offsetHeight;if(elementX2==elementX1)elementX2=elementX1+1;if(elementY2==elementY1)elementY2=elementY1+1;LOTCC.flash(elementX1+","+elementX2+","+elementY1+","+elementY2);var viewX1=window.pageXOffset?window.pageXOffset:document.body.scrollLeft;var viewY1=window.pageYOffset?window.pageYOffset:document.body.scrollTop;var viewX2=viewX1+(window.innerWidth?window.innerWidth:document.body.clientWidth);var viewY2=viewY1+(window.innerHeight?window.innerHeight:document.body.clientHeight);var overlap;var x_overlap;var y_overlap;if(elementX1>viewX2){overlap=0}else if(elementX2<viewX1){overlap=0}else if(elementY1>viewY2){overlap=0}else if(elementY2<viewY1){overlap=0}else{x_overlap=Math.min(viewX2,elementX2)-Math.max(viewX1,elementX1);y_overlap=Math.min(viewY2,elementY2)-Math.max(viewY1,elementY1)}var areaOriginal=(elementX2-elementX1)*(elementY2-elementY1);overlap=x_overlap*y_overlap;var overlapPct=overlap/areaOriginal*100.0;return overlapPct>=0?overlapPct:0};LOTCC.checkForAds=function(){var fs=document.getElementsByTagName("IFRAME");var len=fs.length;for(var i=0;i<len;i++){var f=fs[i].contentWindow;try{var h=f.location.href;}catch(e){for(var j=0;j<fs[i].contentWindow.frames.length;j++){try{var loc=fs[i].contentWindow.frames[j].location.toString();var index=loc.indexOf("#LOTEXP.");if(index>0){var ps=loc.substring(index+8).split("_");if(ps.length>=6)LOTCC.addExpTrackerElm(ps[0],fs[i],ps[1],ps[2],ps[3],{max_idle:ps[4],pct_visible:ps[5]})}}catch(e){}}}}};LOTCC.adChk=function(){if(!LOTCC.loaded){LOTCC.checkForAds();if(LOTCC.ichks<10){setTimeout(LOTCC.adChk,1000)}LOTCC.ichks++}};LOTCC.addEvent(window,"load",LOTCC.checkForAds);LOTCC.addEvent(window,"load",LOTCC.doneload);setTimeout(LOTCC.adChk,1000);LOTCC.client=1;

