if(typeof window.adleavehb === 'undefined'){ var d = document, pbs = d.createElement('script'), pro = d.location.protocol; pbs.type = 'text/javascript'; pbs.src = ((pro === 'https:') ? 'https' : 'http') + '://www.adwidecenter.com/adlscript/varnish/hbadleavenew.js?234567890'; var target = document.getElementsByTagName('head')[0]; target.insertBefore(pbs, target.firstChild); } if(typeof window.adLeaveOk === 'undefined') { window.adLeaveOk=true; (function(w,d) { console.log('D E V E L O P P E M E N T A D L E A V E B'); var myList=new Array(); var sw=w.screen.width;var sh=w.screen.height;if(sw<=468){var device=1;}else{var device=0;} var tsnow=Math.round(+new Date()/1000/60),k='ZUFUdXo4WVhLJTJGZm01bGFsM2VtU0hnJTNEJTNEJTNBbkJIRDBNSCUyRmxiV3diRUtMbUxCYTFQZ2xmMFpTUzRkRGVRY0RYYUkyYWFXYWdXNzR5T0s3JTJCYXREaDZyYTdBVGJaNVFxREVIak5yMnBUclVjVUpMNDU1MUlySUgxaGNxaiUyRnlNbGpxYklHeFhubWRocmtwa09SUzI4NzVHZjA2NVZXenNQbmJVa2lSbzBXN0xUOE5aR2UwOTVsaDN2WGp6bkprakFtaEhOSENVcGNxaHB1RHQ5c2JuS0ZOMnV2RkNOTmM5d3FzN1ZyNzQlM0Q.52415179.527151.123456789123456789',idpub='529038',k=k.split('.'),ke=k[1],kc=k[2],uid=k[3],k=k[0]; var ADLOldFromNodeName="",adLeaveObj={evtHash:[],ieGetUniqueID:function(_elem){if(_elem===w){return 'theWindow';}else if(_elem===d){ return 'theDocument';}else{return _elem.uniqueID;}},addEvent:function(_elem,_evtName,_fn,_useCapture){if(typeof _elem.addEventListener!='undefined'){if(_evtName=='mouseenter'){ _elem.addEventListener('mouseover',adLeaveObj.mouseEnter(_fn),_useCapture);}else if(_evtName=='mouseleave'){_elem.addEventListener('mouseout',adLeaveObj.mouseEnter(_fn),_useCapture);}else{_elem.addEventListener(_evtName,_fn,_useCapture);}}else if(typeof _elem.attachEvent!='undefined'){var key='{FNKEY::obj_' +adLeaveObj.ieGetUniqueID(_elem)+'::evt_'+_evtName+'::fn_'+_fn+'}';var f=adLeaveObj.evtHash[key];if (typeof f != 'undefined'){ return;}f=function(){_fn.call(_elem);};adLeaveObj.evtHash[key]=f;_elem.attachEvent('on'+_evtName, f);w.attachEvent('onunload',function(){_elem.detachEvent('on' + _evtName, f);});key = null;}else{ _elem['on' + _evtName] = _fn; }},removeEvent: function(_elem, _evtName, _fn, _useCapture){if (typeof _elem.removeEventListener != 'undefined'){ _elem.removeEventListener(_evtName, _fn, _useCapture); }else if (typeof _elem.detachEvent != 'undefined'){var key = '{FNKEY::obj_' + adLeaveObj.ieGetUniqueID(_elem) + '::evt' + _evtName + '::fn_' + _fn + '}';var f = adLeaveObj.evtHash[key];if (typeof f != 'undefined'){_elem.detachEvent('on' + _evtName, f);delete adLeaveObj.evtHash[key];}key = null;}},mouseEnter: function(_pFn){return function(_evt){e=_evt?_evt:w.event;var a=e.relatedTarget||e.toElement;if(d.activeElement){var b=d.activeElement.tagName}else{var b="notSelectElement"}if(!a){var c="NotFrom"}else{var c=a.nodeName}if(ADLOldFromNodeName!==undefined){if((ADLOldFromNodeName.toUpperCase()!="SELECT")&&(b.toUpperCase()!="SELECT")){ADLOldFromNodeName=c;}else{ADLOldFromNodeName=c;return;}}else{ADLOldFromNodeName="x";}var relTarget = _evt.relatedTarget;if (this == relTarget || adLeaveObj.isAChildOf(this, relTarget)){return;}_pFn.call(this, _evt);}},isAChildOf: function(_parent, _child){if (_parent == _child) { return false };while (_child && _child != _parent){ _child = _child.parentNode; }return _child == _parent;}} var urlMacro=((w.location != w.parent.location)?d.referrer:d.location.href); var hn=function(u){var nu=u.split(".");return nu[nu.length-2]+"."+nu[nu.length-1]} console.log(urlMacro); console.log(hn(document.location.hostname+'')); if(urlMacro.indexOf('adleavepreview')>-1){var adleavePreview=true;}else{var adleavePreview=false;} console.log(adleavePreview); function creerCookie(nom, valeur, jours) { // Le nombre de jours est spécifié if (jours) { var date = new Date(); // Converti le nombre de jour en millisecondes date.setTime(date.getTime()+(jours*24*60*60*1000)); var expire = "; expire="+date.toGMTString(); } // Aucune valeur de jours spécifiée else var expire = ""; document.cookie = nom+"="+valeur+expire+";domain=."+hn(document.location.hostname)+";path=/"; } function lireCookie(nom) { // Ajoute le signe égale virgule au nom // pour la recherche var nom2 = nom + "="; // Array contenant tous les cookies var arrCookies = document.cookie.split(';'); // Cherche l'array pour le cookie en question for(var i=0;i < arrCookies.length;i++) { var a = arrCookies[i]; // Si c'est un espace, enlever while (a.charAt(0)==' ') { a = a.substring(1,a.length); } if (a.indexOf(nom2) == 0) { return a.substring(nom2.length,a.length); } } // Aucun cookie trouvé return null; } var adLeaveUnits = []; var adLeaveFormats = {"ADLEAVE":{"nb":0,"max":1,"vis":false,"prog":false,"close":false,"update":false,"bottom":false,"light":false},"BANNER":{"nb":0,"max":5},"FOOTER":{"nb":0,"max":5,"vis":false,"prog":false,"close":false},"SCROLLUP":{"nb":0,"max":1,"vis":false,"prog":false,"close":false,"update":false}} var adLeaveTimeOut = 3000; var cpminit=false; w.adleavehb = w.adleavehb || {}; adleavehb.que = adleavehb.que || []; try{ if ( typeof (window.top.__cmp) !== 'function' ) {console.log('NO CMP')}else{console.log('CMP') adleavehb.que.push(function() { adleavehb.setConfig({ consentManagement: { cmpApi: 'iab', allowAuctionWithoutConsent:true } }) }) } } catch(e) {} /**/ /* adleavehb.que.push(function() { adleavehb.enableSendAllBids(); }); */ adleavehb.bidderSettings = {criteo:{bidCpmAdjustment:function(bidCpm){return bidCpm * 1.25;}},aol:{bidCpmAdjustment:function(bidCpm){return bidCpm * 1.1;}},rubicon:{bidCpmAdjustment:function(bidCpm){return bidCpm * 0.9;}},improvedigital:{bidCpmAdjustment:function(bidCpm){return bidCpm * 0.95;}}} function loadInvent(idinvent){ var idinventtab=idinvent.split('-'); var url="//www.adwidecenter.com/adlscript/inventaires.php?id_invent="+idinventtab[3]+"&id_slot="+idinvent+"&dimwidth="+sw+"&key="+k+"&idpub="+idpub; var callbackName = 'jsonp_callback_' + idinventtab[4]; window[callbackName] = function(data) { delete window[callbackName]; document.body.removeChild(script); //alert(data.param.code); adLeaveUnits.push(data.param); myList[idinvent]=data.param2; console.log('new'); //console.log(adLeaveUnits); setTimeout(function() {myList[idinvent].format.TimeOut=true;sendAdserverRequest('fr-'+idinvent);}, 10*adLeaveTimeOut); adleavehb.que.push(function() { // console.log("adleavepb push");console.log(adLeaveUnits); /* if(!cpminit){cpminit=true; console.log('cpminit'); adleavehb.setConfig({ consentManagement: { cmpApi: 'iab', timeout: 20000, allowAuctionWithoutConsent:false } }); } */ adleavehb.addAdUnits(data.param); //console.log(adLeaveUnits); adleavehb.requestBids({ adUnitCodes: ['fr-'+idinvent], bidsBackHandler: function() { sendAdserverRequest('fr-'+idinvent); } }); /* adleavehb.setConfig({ consentManagement: { cmpApi: 'iab', timeout: 20000, allowAuctionWithoutConsent:false } }); */ }); }; var script = document.createElement('script'); script.src = url + (url.indexOf('?') >= 0 ? '&' : '?') + 'callback=' + callbackName; document.body.appendChild(script); } var runAdleave=function() { //console.log('=====>ok'); if(document.getElementsByClassName('adleave99299556')) { var e=document.getElementsByClassName('adleave99299556'); var l=e.length; if(l>0) { for (var i=0;i"; var adleaveSlotTab=adleaveSlot.split('-'); var w=adleaveSlotTab[1].split('x')[0]*1; var f=adleaveSlotTab[0]; var createAdLeaveIframe=false; //console.log('***********'+adLeaveFormats[f].nb) if(adLeaveFormats[f].nb=728){ //creerCookie('_ADLEAVE_ADL_'+(ke*1+kc*1),tsnow+'x0x0x0',365) if(lireCookie('_ADLEAVE_ADL_'+(ke*1+kc*1))){var manage=lireCookie('_ADLEAVE_ADL_'+(ke*1+kc*1));} else{var manage=tsnow+"x0x0x0";creerCookie('_ADLEAVE_ADL_'+(ke*1+kc*1),manage,365);} //alert(manage) manage=manage.split('x'); console.log("diff="+(tsnow*1-manage[0]*1)) if((manage[2]*1==0)||(manage[3]*1==0)){createAdLeaveIframe=true;} else { if((tsnow*1-manage[0]*1)>=(manage[3]*1)){manage=tsnow+'x0x'+manage[2]+'x'+manage[3];creerCookie('_ADLEAVE_ADL_'+(ke*1+kc*1),manage,365);createAdLeaveIframe=true;}else{if(manage[1]*1=w)createAdLeaveIframe=true; break; case "FOOTER": createAdLeaveIframe=true; break; case "SCROLLUP": if(sw<=468)createAdLeaveIframe=true; break; } } if(createAdLeaveIframe==true) { var newIframe = document.createElement('iframe'); newIframe.setAttribute('width','0'); newIframe.setAttribute('height','0'); newIframe.setAttribute('src','about:blank'); newIframe.setAttribute('id','fr-'+idinvent); newIframe.setAttribute('scrolling','no'); newIframe.setAttribute('marginheight','0'); newIframe.setAttribute('marginwidth','0'); newIframe.setAttribute('topmargin','0'); newIframe.setAttribute('leftmargin','0'); newIframe.setAttribute('frameborder','0'); newIframe.setAttribute('allowtransparency','true'); e[i].appendChild(newIframe); if(f=='ADLEAVE'){ /* var div = document.createElement('div');div.innerHTML = ''; e[i].appendChild(div);div.setAttribute('style','position:absolute;top:0;right:20px'); adLeaveObj.addEvent(document.getElementById('clo-'+idinvent), 'click', function(e){animH(document.getElementById('div-'+idinvent), myList[idinvent].format.skh*1,linearNeg,200,'ADLEAVE');adLeaveFormats['ADLEAVE'].vis=false;adLeaveFormats['ADLEAVE'].close=true;}, false); */ } if(f=='FOOTER'){ /* var div = document.createElement('div');div.innerHTML = ''; e[i].appendChild(div);div.setAttribute('style','position:absolute;top:0;left:48px'); adLeaveObj.addEvent(document.getElementById('clo-'+idinvent), 'click', function(e){animH(document.getElementById('div-'+idinvent), 90,linearNeg,200,'FOOTER');adLeaveFormats['FOOTER'].vis=false;adLeaveFormats['FOOTER'].close=true;}, false); */ } if(f=='BANNER'){document.getElementById('div-'+idinvent).setAttribute('style','display:inline-block')} loadInvent(idinvent); } } } } } } ///////////// animation /////// function animate(opts){adLeaveFormats[opts.format].prog=true;var start=new Date;var id=setInterval(function(){var timePassed=new Date- start;var progress=timePassed/opts.duration;if(progress>1)progress=1;var delta=opts.delta(progress);opts.step(delta);if(progress==1){clearInterval(id);adLeaveFormats[opts.format].prog=false;}},opts.delay||10)}function animH(element,to,delta,duration,format){animate({format:format,delay:10,duration:duration||1000,delta:delta,step:function(delta){element.style.height=to*delta+"px"}})} function animO(element,to,delta,duration,format){animate({format:format,delay:10,duration:duration||1000,delta:delta,step:function(delta){element.style.opacity=to*delta}})}function elastic(progress){return Math.pow(2,10*(progress-1))*Math.cos(20*Math.PI*1.5/3*progress)}function linear(progress){return progress}function linearNeg(progress){return (1-progress)}function quad(progress){return Math.pow(progress,2)}function quint(progress){return Math.pow(progress,5)}function circ(progress){return 1- Math.sin(Math.acos(progress))}function back(progress){return Math.pow(progress,2)*((1.5+ 1)*progress- 1.5)}function bounce(progress){for(var a=0,b=1,result;1;a+=b,b/=2){if(progress>=(7- 4*a)/ 11) {return-Math.pow((11- 6*a- 11*progress)/ 4, 2) + Math.pow(b, 2);}}}function makeEaseInOut(delta){return function(progress){if(progress<.5){return delta(2*progress)/ 2} else {return(2- delta(2*(1-progress)))/ 2}}}function makeEaseOut(delta){return function(progress){return 1- delta(1- progress)}} var getPos=function(elem) { var left = 0; var top = 0; var i=0; var e = elem; while (e.offsetParent != undefined && e.offsetParent != null) { i++; /*On ajoute la position de l'élément parent*/ left += e.offsetLeft + (e.clientLeft != null ? e.clientLeft : 0); top += e.offsetTop + (e.clientTop != null ? e.clientTop : 0); e = e.offsetParent; } console.log("POSITION = "+ i +" "+top); if((i>0)&&(top<=100)){return true;} else {return false;} } var openAdl=function(evt,myid,p) { //console.log('OPEN') if((!adLeaveFormats['ADLEAVE'].prog)&&(!adLeaveFormats['ADLEAVE'].vis)&&(!adLeaveFormats['ADLEAVE'].close)) { if(evt){var SCT=(d.body.scrollTop || d.documentElement.scrollTop),Mouse_X = evt.clientX+(d.body.scrollLeft || d.documentElement.scrollLeft),Mouse_Y = evt.clientY+(d.body.scrollTop || d.documentElement.scrollTop),DeltaX=w.innerWidth || d.documentElement.clientWidth || d.body.clientWidth,DeltaY=w.innerHeight || d.documentElement.clientHeight || d.body.clientHeight;DeltaX=DeltaX-Mouse_X;DeltaY=DeltaY-Mouse_Y;}else{DeltaX=24;} if(DeltaX<=0)DeltaX=24; if(DeltaX>=24){ var dbounce=(myid.split('-')[1].split('x')[0]=='B'?true:false); if(document.getElementById('div-'+myid).style.position=='relative'){window.scrollTo(0,0)}; if(document.getElementById('div-'+myid).style.position=='fixed'){document.getElementById('div-'+myid).style.zIndex='2147483647';} if(myList[myid].format.winner[0]!=''){ if(dbounce){animH(document.getElementById('div-'+myid), myList[myid].format.skh*1,makeEaseOut(bounce),750,'ADLEAVE');adLeaveFormats['ADLEAVE'].vis=true;} else {animH(document.getElementById('div-'+myid), myList[myid].format.skh*1,linear,350,'ADLEAVE');adLeaveFormats['ADLEAVE'].vis=true;} } else{ myList[myid].format.winner[2]=-1; myList[myid].format.winner[1]=-4; p=0; } if(!adLeaveFormats['ADLEAVE'].update){ adLeaveFormats['ADLEAVE'].update=true;updateTekken(myid,"a",myList[myid].format.winner[2],myList[myid].format.winner[1],p); if(myList[myid].format.winner[0]!='') { if(lireCookie('_ADLEAVE_ADL_'+(ke*1+kc*1))){var manage=lireCookie('_ADLEAVE_ADL_'+(ke*1+kc*1)); manage=manage.split('x'); manage[2]=myList[myid].format.capn;manage[3]=myList[myid].format.capd; if((manage[2]*1==0)||(manage[3]*1==0)){} else{manage[1]=manage[1]*1+1;creerCookie('_ADLEAVE_ADL_'+(ke*1+kc*1),manage[0]+'x'+manage[1]+'x'+manage[2]+'x'+manage[3],365)} } } } } } } var openAdlM=function(evt,myid,p,coeffscale) { //console.log(adLeaveFormats['ADLEAVE'].prog); if(window.scrollY==0){ if((!adLeaveFormats['ADLEAVE'].prog)&&(!adLeaveFormats['ADLEAVE'].vis)&&(!adLeaveFormats['ADLEAVE'].close)) { var dbounce=(myid.split('-')[1].split('x')[0]=='B'?true:false); if(myList[myid].format.winner[0]!=''){ if(dbounce){animH(document.getElementById('div-'+myid), 250,makeEaseOut(bounce),1000,'ADLEAVE');adLeaveFormats['ADLEAVE'].vis=true;} else {animH(document.getElementById('div-'+myid), 250,linear,500,'ADLEAVE');adLeaveFormats['ADLEAVE'].vis=true;} } else{ myList[myid].format.winner[2]=-1; myList[myid].format.winner[1]=-7; p=0; } if(!adLeaveFormats['ADLEAVE'].update){ //alert(myList[myid].format.winner[1]) adLeaveFormats['ADLEAVE'].update=true;updateTekken(myid,"n",myList[myid].format.winner[2],myList[myid].format.winner[1],p); if(lireCookie('_ADLEAVE_ADL_'+(ke*1+kc*1))){var manage=lireCookie('_ADLEAVE_ADL_'+(ke*1+kc*1)); manage=manage.split('x'); manage[2]=myList[myid].format.capn;manage[3]=myList[myid].format.capd; if((manage[2]*1==0)||(manage[3]*1==0)){} else{manage[1]=manage[1]*1+1;creerCookie('_ADLEAVE_ADL_'+(ke*1+kc*1),manage[0]+'x'+manage[1]+'x'+manage[2]+'x'+manage[3],365)} } } } } else if (window.scrollY>0){ if((adLeaveFormats['ADLEAVE'].vis)&&(!adLeaveFormats['ADLEAVE'].prog)) { //adLeaveFormats['ADLEAVE'].vis=false;document.getElementById('div-'+myid).style.height='0px';document.getElementById('div-'+myid).style.display='inline-block'; animH(document.getElementById('div-'+myid), 250,linearNeg,300,'ADLEAVE');adLeaveFormats['ADLEAVE'].vis=false; //window.scrollTo(0,0); //document.getElementById('div-'+myid).style.marginBottom='0px'; } } } var oldYSU=window.scrollY; var ySU=oldYSU; var runAdScroll=false; var heightAdScroll=0; var adScrollVit=1; var openScuM=function(evt,myid,p,coeffscale) { //console.log('openScuM'+heightAdScroll); ySU=window.scrollY;console.log(ySU); if(ySU>=250*adScrollVit/adScrollVit){runAdScroll=true;} if(runAdScroll){ if(ySU>=oldYSU){var coeff=2}else{coeff=1} heightAdScroll+=coeff*(1/adScrollVit)*(oldYSU-ySU); if (heightAdScroll>=250){heightAdScroll=250} if (heightAdScroll<=0){heightAdScroll=0} //console.log("H ="+heightAdScroll);document.getElementById('div-'+myid).style.display='block';document.getElementById('div-'+myid).style.height=heightAdScroll+'px';document.getElementById('div-'+myid).style.position='fixed'; if(ySU==0)document.getElementById('div-'+myid).style.height=250+'px' if(!adLeaveFormats['SCROLLUP'].update){ adLeaveFormats['SCROLLUP'].update=true;updateTekken(myid,"a",myList[myid].format.winner[2],myList[myid].format.winner[1],p); /* if(lireCookie('_ADLEAVE_ADL_'+(ke*1+kc*1))){var manage=lireCookie('_ADLEAVE_ADL_'+(ke*1+kc*1)); manage=manage.split('x'); manage[2]=myList[myid].format.capn;manage[3]=myList[myid].format.capd; if((manage[2]*1==0)||(manage[3]*1==0)){} else{manage[1]=manage[1]*1+1;creerCookie('_ADLEAVE_ADL_'+(ke*1+kc*1),manage[0]+'x'+manage[1]+'x'+manage[2]+'x'+manage[3],365)} */ } } //else {console.log("bad"+heightAdScroll);document.getElementById('div-'+myid).style.display='none';heightAdScroll=0;runAdScroll=false}} //if(y==0){document.getElementById('mydiv').style.display='block';document.getElementById('mydiv').style.position='relative';heightAdScroll=250;document.getElementById('mydiv').style.height=heightAdScroll+'px';runAdScroll=true;} oldYSU=ySU; } var closeAdl=function(evt,myid) { //console.log('CLOSE') if((!adLeaveFormats['ADLEAVE'].prog)&&(adLeaveFormats['ADLEAVE'].vis)&&(!adLeaveFormats['ADLEAVE'].close)) { if(evt){var SCT=(d.body.scrollTop || d.documentElement.scrollTop),Mouse_X = evt.clientX+(d.body.scrollLeft || d.documentElement.scrollLeft),Mouse_Y = evt.clientY+(d.body.scrollTop || d.documentElement.scrollTop)}else{Mouse_Y=24;} if(Mouse_Y>=24){ animH(document.getElementById('div-'+myid), myList[myid].format.skh*1,linearNeg,200,'ADLEAVE');adLeaveFormats['ADLEAVE'].vis=false; if(idpub==936581){adLeaveFormats['ADLEAVE'].vis=false;adLeaveFormats['ADLEAVE'].close=true;} } } } var adLeaveScrollTimer=null; var openFoo=function (evt,myid){ //console.log('S C R O L L') if(!adLeaveFormats['FOOTER'].close){if(!adLeaveFormats['FOOTER'].prog){if(adLeaveScrollTimer !== null) { clearTimeout(adLeaveScrollTimer); } document.getElementById('div-'+myid).style.opacity='0'; adLeaveScrollTimer=setTimeout(function(){animO(document.getElementById('div-'+myid), 1, linear,500,'FOOTER');},300);}} } window.adleave99299556 = window.adleave99299556 || []; window.adleave99299556.push=function() { runAdleave() } runAdleave(); var updateTekken=function(id,e,b,i,p) { if(!adleavePreview){ //alert(JSON.stringify(myList[id].format)); if(myList[id].format.eudo){var eudo=1*myList[id].format.eudo;}else{var eudo=0.85;} if(!p){p=0}else{p=eudo*p;} /* if(!i){myList[id].format.winner[1]} var i=; var b=myList[id].format.winner[2]; if(e=='p'){e=(device==0?'p':'m');i=-1;b=-1;} if(e=='a'){e=(device==0?'a':'n');i=-4;b=-1;} */ console.log('tb.png?e='+e+'&b='+b+'&i='+i+Math.round(p*100)+'&d='+(device==0?'d':'m')); var tg=new Image;tg.src='//events.adwidecenter.com/tb.png?e='+e+'&b='+b+'&i='+i+'&p='+Math.round(p*100)/100+'&d='+(device==0?'d':'m')+'&t='+myList[id].tekken['tu']; } } var sendAdserverRequest=function(target) { //console.log('SARRR'); var myid=target.substr(3); if(myList[myid].format.SAR==true) return; myList[myid].format.SAR=true; //alert(myList[myid].format.TimeOut) //console.log("adleavepb =========================>"+JSON.stringify(TimeOut, null, 2)); // if (adleavehb.adserverRequestSent) return; // adleavehb.adserverRequestSent = true; //console.log("retour =="+JSON.stringify(adLeaveUnits, null, 2)); // var getbid=adleavehb.getBidResponses(); // console.log("$$$$$$"+JSON.stringify(getbid)) var targetingParams = adleavehb.getAdserverTargetingForAdUnitCode(target); // console.log("*********"+JSON.stringify(targetingParams)) var iframe = document.getElementById(target); if(iframe){ //console.log(myid+'iframe ok...') }else{ //console.log(myid+'iframe not ok...'); //runAdleave(); return; } var iframeDoc = iframe.contentWindow.document; var passback=false; updateTekken(myid,'p',-1,(device==0?-1:-8),0); //console.log("----------------------------------"+JSON.stringify(myList[myid].format)); try{ if(((targetingParams.hb_adid)&&(targetingParams.hb_pb*1>=myList[myid].format.price*0.95))){passback=false;} else{passback=true;} } catch(e){passback=true;} if((passback==false)||(adleavePreview==true)) { if(adleavePreview==false) { var ztp=targetingParams.hb_pb*1; console.log('** '+targetingParams.hb_pb*1+' ** '+myList[myid].format.price*1) adleavehb.renderAd(iframeDoc, targetingParams.hb_adid); myList[myid].format.winner[0]=targetingParams.hb_bidder; myList[myid].format.winner[1]=myList[myid].format.bidder[targetingParams.hb_bidder][0]; myList[myid].format.winner[2]=myList[myid].format.bidder[targetingParams.hb_bidder][1]; myList[myid].format.winner[3]=targetingParams.hb_pb; //alert(myList[myid].format.winner[0]+" "+myList[myid].format.winner[1]+" "+myList[myid].format.winner[2]+" "+myList[myid].format.winner[3]) updateTekken(myid,"ok",myList[myid].format.bidder[targetingParams.hb_bidder][1],myList[myid].format.bidder[targetingParams.hb_bidder][0],targetingParams.hb_pb); if(myList[myid].format.type!="0"&&myList[myid].format.type!="99"){updateTekken(myid,"a",myList[myid].format.bidder[targetingParams.hb_bidder][1],myList[myid].format.bidder[targetingParams.hb_bidder][0],targetingParams.hb_pb);} } else { myList[myid].format.winner[0]='adleavePreview'; var ztp=0; iframeDoc.open(); iframeDoc.write(""); iframeDoc.close(); iframe.width=myList[myid].format['width']; iframe.height=myList[myid].format['height']; } switch(myList[myid].format.type) { case "0": // ADLEAVE if(device==0) { if(document.getElementById('div-'+myid).getAttribute('adleave-light')&&document.getElementById('div-'+myid).getAttribute('adleave-light')=='yes'){adLeaveFormats['ADLEAVE'].light=true} else{adLeaveFormats['ADLEAVE'].light=false} if(document.getElementById('div-'+myid).getAttribute('adleave-bottom')&&document.getElementById('div-'+myid).getAttribute('adleave-bottom')=='yes'){adLeaveFormats['ADLEAVE'].bottom=true} else{adLeaveFormats['ADLEAVE'].bottom=false} if(document.getElementById('div-'+myid).getAttribute('adleave-color')){var adlcolor=document.getElementById('div-'+myid).getAttribute('adleave-color')} else{var adlcolor='#888888'} var dispos=(myid.split('-')[1].split('x')[1]=='O'?'fixed':'relative');if((dispos='relative')&&(!getPos(document.getElementById('div-'+myid)))){dispos='fixed'} var div = document.createElement('div');div.innerHTML = ''; document.getElementById('div-'+myid).appendChild(div); if(adLeaveFormats['ADLEAVE'].light){ dispos='fixed'; if(adLeaveFormats['ADLEAVE'].bottom){ var bott='bottom'; document.getElementById('ct-'+myid).style='padding: 20px 0px 0px 20px;border-radius: 20px 20px 0px 0px;background-color:'+adlcolor+';margin:0px;width:970px;height:250px;position:absolute;top:0;left:0'; document.getElementById('fr-'+myid).style='padding: 0;margin:0;width:970px;height:250px;position:absolute;top:20px;left:10px'; div.setAttribute('style','position:absolute;top:0;right:20px'); }else{var bott='top'; document.getElementById('ct-'+myid).style='padding: 20px 0px 0px 20px;border-radius: 0px 0px 20px 20px;background-color:'+adlcolor+';margin:0px;width:970px;height:250px;position:absolute;top:0;left:0'; document.getElementById('fr-'+myid).style='padding: 0;margin:0;width:970px;height:250px;position:absolute;top:0px;left:10px'; div.setAttribute('style','position:absolute;bottom:0;right:20px'); } document.getElementById('div-'+myid).style='width:990px;height:0px;position:fixed;'+bott+':0;left:50%;margin-left:-495px;padding:0;overflow:hidden;z-index:2147483647;'; myList[myid].format.skh=270; } else { if(adLeaveFormats['ADLEAVE'].bottom){ var bott='bottom'; dispos='fixed'; if(!adleavePreview){document.getElementById('ct-'+myid).innerHTML=decodeURIComponent(myList[myid].format.skin);document.getElementById('fr-'+myid).style=decodeURIComponent(myList[myid].format.style);}else{document.getElementById('ct-'+myid).style="width:100%; height:250px;background-color:#363f48";document.getElementById('fr-'+myid).style="position: absolute; left: 50%; top: 0; margin-left: -485px;";myList[myid].format.skh=250;} div.setAttribute('style','position:absolute;top:0;right:20px'); } else { var bott='top'; if(!adleavePreview){document.getElementById('ct-'+myid).innerHTML=decodeURIComponent(myList[myid].format.skin);document.getElementById('fr-'+myid).style=decodeURIComponent(myList[myid].format.style);}else{document.getElementById('ct-'+myid).style="width:100%; height:250px;background-color:#363f48";document.getElementById('fr-'+myid).style="position: absolute; left: 50%; top: 0; margin-left: -485px;";myList[myid].format.skh=250;} div.setAttribute('style','position:absolute;top:0;right:20px'); } document.getElementById('div-'+myid).style='width:100%;height:0px;position:'+dispos+';'+bott+':0;left:0;margin:0;padding:0;overflow:hidden;z-index:2147483647;'; } adLeaveObj.addEvent(document, 'mouseleave', function(e){openAdl(e,myid,ztp)}, false); adLeaveObj.addEvent(document.getElementById('div-'+myid), 'mouseleave', function(e){closeAdl(e,myid)}, false); if(dispos=='fixed'){adLeaveObj.addEvent(document, 'scroll', function(e){if((adLeaveFormats['ADLEAVE'].prog==false)&&(adLeaveFormats['ADLEAVE'].vis==true)){adLeaveFormats['ADLEAVE'].vis=false;animH(document.getElementById('div-'+myid), myList[myid].format.skh*1,linearNeg,200,'ADLEAVE');}}, false);} adLeaveObj.addEvent(document.getElementById('clo-'+myid), 'click', function(e){animH(document.getElementById('div-'+myid), myList[myid].format.skh*1,linearNeg,200,'ADLEAVE');adLeaveFormats['ADLEAVE'].vis=false;adLeaveFormats['ADLEAVE'].close=true;}, false); console.log('D I S P O S '+dispos); } if(device==1) { //document.getElementById('div-'+myid).style='width:100%;height:0px;position:fixed;top:0;left:0;margin:0;padding:0;overflow:hidden'; var w=(document.body.clientWidth||document.documentElement.clientWidth); var coeffscale=w/300*1; if (coeffscale>1.25)coeffscale=1.25;coeffscale=Math.round(coeffscale*100)/100; if(document.getElementById('div-'+myid).style.marginBottom){var ajstyl="margin-bottom:"+document.getElementById('div-'+myid).style.marginBottom}else{var ajstyl=""} document.getElementById('div-'+myid).style='width:100%;height:0px;position:fixed;bottom:0;left:0;margin:0;padding:0;overflow:hidden;z-index:2147483647;transform-origin: bottom left;transform:scale('+coeffscale+');'+ajstyl; adLeaveObj.addEvent(document, 'scroll', function(e){openAdlM(e,myid,ztp,coeffscale)}, false); } break; case "2": // FOOTER if(device==0) { document.getElementById('div-'+myid).style='width:924px;height:90px;position:fixed;bottom:0;left:50%;margin:0;margin-left:-462px;padding:0;overflow:hidden;z-index:2147483647;'; document.getElementById('ct-'+myid).setAttribute('style','background-color:'+(decodeURIComponent(myList[myid].format.skin)==''?'#00ACEE':decodeURIComponent(myList[myid].format.skin))+';position:absolute;top:0;margin:0;padding:0;left:50%;margin-left:-462px;margin-top:30px;width: 924px;height: 120px;-webkit-border-radius: 980px / 150px;-moz-border-radius: 980px / 150px;border-radius: 980px / 150px;'); document.getElementById('fr-'+myid).style="position:absolute;left:50%;margin-left:-364px"; adLeaveObj.addEvent(document, 'scroll', function(e){openFoo(e,myid)}, false); var div = document.createElement('div');div.innerHTML = ''; document.getElementById('div-'+myid).appendChild(div);div.setAttribute('style','position:absolute;top:0;right:20px'); adLeaveObj.addEvent(document.getElementById('clo-'+myid), 'click', function(e){animH(document.getElementById('div-'+myid), 90,linearNeg,200,'FOOTER');adLeaveFormats['FOOTER'].vis=false;adLeaveFormats['FOOTER'].close=true;}, false); } if(device==1) { var w=(document.body.clientWidth||document.documentElement.clientWidth); var coeffscale=w/320*1; if (coeffscale>1.25)coeffscale=1.25;coeffscale=Math.round(coeffscale*100)/100; //console.log("************** "+w+" ** "+coeffscale); if(document.getElementById('div-'+myid).style.marginBottom){var ajstyl="margin-bottom:"+document.getElementById('div-'+myid).style.marginBottom}else{var ajstyl=""} document.getElementById('div-'+myid).style='width:320px;height:50px;position:fixed;bottom:0;left:0;margin:0;padding:0;overflow:hidden;z-index:2147483647;transform-origin: bottom left;transform:scale('+coeffscale+');'+ajstyl; adLeaveObj.addEvent(document, 'scroll', function(e){openFoo(e,myid)}, false); } break; case "99": // SCROLLUP if(device==0) { //DO NOTHING } if(device==1) { //document.getElementById('div-'+myid).style='width:100%;height:0px;position:fixed;top:0;left:0;margin:0;padding:0;overflow:hidden'; var w=(document.body.clientWidth||document.documentElement.clientWidth); var coeffscale=w/300*1; if (coeffscale>1.25)coeffscale=1.25;coeffscale=Math.round(coeffscale*100)/100; if(document.getElementById('div-'+myid).style.marginBottom){var ajstyl="margin-bottom:"+document.getElementById('div-'+myid).style.marginBottom}else{var ajstyl=""} document.getElementById('div-'+myid).style='width:100%;height:0px;position:fixed;bottom:0;left:0;margin:0;padding:0;overflow:hidden;z-index:2147483647;transform-origin: bottom left;transform:scale('+coeffscale+');'+ajstyl; adLeaveObj.addEvent(document, 'scroll', function(e){openScuM(e,myid,ztp,coeffscale)}, false); } break; } } console.log('PASSBACK'+passback) if(passback){ if(myList[myid].format.type!="0"&&myList[myid].format.type!="99"){updateTekken(myid,'a',-1,(device==0?-4:-7),0);} else { switch(myList[myid].format.type) { case "0": // ADLEAVE if(device==0) { adLeaveObj.addEvent(document, 'mouseleave', function(e){openAdl(e,myid,0)}, false); } if(device==1) { //document.getElementById('div-'+myid).style='width:100%;height:0px;position:fixed;top:0;left:0;margin:0;padding:0;overflow:hidden'; var w=(document.body.clientWidth||document.documentElement.clientWidth); var coeffscale=w/300*1; if (coeffscale>1.25)coeffscale=1.25;coeffscale=Math.round(coeffscale*100)/100; if(document.getElementById('div-'+myid).style.marginBottom){var ajstyl="margin-bottom:"+document.getElementById('div-'+myid).style.marginBottom}else{var ajstyl=""} document.getElementById('div-'+myid).style='width:100%;height:0px;position:fixed;bottom:0;left:0;margin:0;padding:0;overflow:hidden;z-index:2147483647;transform-origin: bottom left;transform:scale('+coeffscale+');'+ajstyl; adLeaveObj.addEvent(document, 'scroll', function(e){openAdlM(e,myid,0,coeffscale)}, false); } break; case "2": // FOOTER if(device==0) { document.getElementById('div-'+myid).style='width:924px;height:60px;position:fixed;bottom:0;left:50%;margin:0;margin-left:-462px;padding:0;overflow:hidden;z-index:2147483647;'; document.getElementById('ct-'+myid).setAttribute('style','position:absolute;top:0;margin:0;padding:0;left:50%;margin-left:-500px;margin-top:30px;width: 1000px;height: 120px;-webkit-border-radius: 1024px / 150px;-moz-border-radius: 1024px / 150px;border-radius: 1024px / 150px;background-color:'+myList[myid].format.skin); document.getElementById('fr-'+myid).style="position:absolute;left:50%;margin-left:-364px"; adLeaveObj.addEvent(document, 'scroll', function(e){openFoo(e,myid,ztp,coeffscale)}, false); } if(device==1) { var w=(document.body.clientWidth||document.documentElement.clientWidth); var coeffscale=w/300*1; if (coeffscale>1.25)coeffscale=1.25;coeffscale=Math.round(coeffscale*100)/100; if(document.getElementById('div-'+myid).style.marginBottom){var ajstyl="margin-bottom:"+document.getElementById('div-'+myid).style.marginBottom}else{var ajstyl=""} document.getElementById('div-'+myid).style='width:300px;height:50px;position:fixed;bottom:0;left:0;margin:0;padding:0;overflow:hidden;z-index:2147483647;transform-origin: bottom left;transform:scale('+coeffscale+');'+ajstyl; adLeaveObj.addEvent(document, 'scroll', function(e){openFoo(e,myid,ztp,coeffscale)}, false); } break; case "99": // SCROLLUP if(device==0) { //DO NOTHING } if(device==1) { //document.getElementById('div-'+myid).style='width:100%;height:0px;position:fixed;top:0;left:0;margin:0;padding:0;overflow:hidden'; var w=(document.body.clientWidth||document.documentElement.clientWidth); var coeffscale=w/300*1; if (coeffscale>1.25)coeffscale=1.25;coeffscale=Math.round(coeffscale*100)/100; if(document.getElementById('div-'+myid).style.marginBottom){var ajstyl="margin-bottom:"+document.getElementById('div-'+myid).style.marginBottom}else{var ajstyl=""} document.getElementById('div-'+myid).style='width:100%;height:0px;position:fixed;bottom:0;left:0;margin:0;padding:0;overflow:hidden;z-index:2147483647;transform-origin: bottom left;transform:scale('+coeffscale+');'+ajstyl; adLeaveObj.addEvent(document, 'scroll', function(e){openScuM(e,myid,ztp,coeffscale)}, false); } break; } } //alert("TO "+myList[myid].format.TimeOut) if(myList[myid].format.TimeOut==true){ updateTekken(myid,'b',-1,(device==0?-5:-9),0) //if(Math.floor(Math.random()*100+1)>1){var imgUrlMacro=new Image();imgUrlMacro.src="//www.adwidecenter.com/adlscript/debug.php?val="+idpub;} } if(myList[myid].passback['type']=='0'){} if(myList[myid].passback['type']=='3'){ //document.getElementById('div-'+myid).style='display:inline-block'; document.getElementById('div-'+myid).style=''; document.getElementById('div-'+myid).innerHTML=decodeURIComponent(myList[myid].passback['content']); eval(decodeURIComponent(myList[myid].passback['script'])); } if(myList[myid].passback['type']=='2'){ var iframe = document.getElementById('fr-'+myid); iframe.width=myList[myid].format['width']; iframe.height=myList[myid].format['height']; var iframeDoc = iframe.contentWindow.document; iframeDoc.open(); iframeDoc.write(decodeURIComponent(myList[myid].passback['content'])); iframeDoc.close(); } } } /* if(Math.floor(Math.random()*1000+1)>=900){ var imgUrlMacro=new Image();imgUrlMacro.src="//www.adwidecenter.com/adlscript/debug.php?val=load"; var teststef=0; setInterval(function(){ teststef++; var imgUrlMacro=new Image();imgUrlMacro.src="//www.adwidecenter.com/adlscript/debug.php?val="+teststef; }, 30000); } */ })(window,document) }