var __NP=function(){this.overlay,this.frame={elt:null,style:""},this.close={elt:null,style:{top:0,left:0,width:22},half:22/2},this.pop={elt:null,style:{top:false,left:false,right:false,width:300,height:250,bottom:false,margin:""},data:[],base:[]},this.local_timeout,this.height=250,this.width=300,this.margin=5,this.goclose=false,this.params={tempo:1,time:25,type:0,recursive:0,px:0,py:0},this.animation={_ti:0,_ta:500,_tf:10,_ar:0,back:false},this.locals={docheight:0,docwidth:0,middle:{top:0,left:0}},this.test,this.IE=false,this._id;this.initLocals();this.initRatio();if(this.preset()==false)return false;this.build();var that=this;this.frame.elt.onload=function(){window.setTimeout(function(){that.start.call(that)},200+parseInt(that.params.tempo)*1e3)};return this};__NP.prototype.initLocals=function(){this.locals.docheight=window.outerHeight||800;this.locals.docwidth=document.body.clientWidth;this.locals.middle.top=this.height>=this.locals.docheight?0:(this.locals.docheight-this.height)/2-this.height/4;this.locals.middle.left=this.width>=this.locals.docwidth?0:(this.locals.docwidth-this.width)/2-this.width/2};__NP.prototype.initRatio=function(){this.animation._ar=this.animation._ta/this.animation._tf};__NP.prototype.preset=function(){this._id=(new Date).getTime();var browser=getJQBrowser();this.IE=browser.msie?true:false;var k=escape("http://affiliation.voyance.fr/ad/21/300x250.jpg?tag=cabinetoracle&a=d&t=1&w=1&uri=/&c=8256&s=1&tg=2&si=300x250&px=0&py=0");if(this.params.recursive==1&&this.readCookie(k)==1)return false;else if(this.params.recursive==1)this.createCookie(k,this.params.recursive,1);if(this.params.px==this.params.py&&this.params.py==2&&this.params.type!=0)this.params.type=0;this.test=this.params.px+"_"+this.params.py;if(this.params.type==0){this.params.px=this.params.py=2;this.setOverlay()}this.initFrame();this.initPop();this.initPopData();this.initClose()};__NP.prototype.setOverlay=function(){this.overlay=document.createElement("div");this.overlay.setAttribute("id","ov_"+this._id);var _s=" position:fixed; top:0; left:0; width:100%; height:100%; opacity:0.8; background-color:white; z-index:10; display:none;";if(this.overlay.getAttribute("style")!=null&&typeof this.overlay.getAttribute("style")=="object")this.overlay.getAttribute("style").cssText=_s;else this.overlay.setAttribute("style",_s)};__NP.prototype.initFrame=function(){if(this.params.py==0)this.frame.style="";else if(this.test!="0_0"||this.test!="1_0")this.frame.style=" margin-top:"+this.close.half+"px;";if(this.params.px==1)this.frame.style+=" margin-left:"+this.close.half+"px;"};__NP.prototype.initPop=function(){var px=this.params.px;var py=this.params.py;if(py==1){this.pop.style.top=false;this.pop.style.bottom=this.margin}else{if(py==2)this.pop.style.top=this.locals.middle.top;else this.pop.style.top=this.margin;this.pop.style.bottom=false}if(px<2){this.pop.style.height=this.height+this.close.half;if(py==0)this.pop.style.height+=this.margin}else this.pop.style.margin=" margin-left:50%;";this.pop.style.width=this.width+this.close.half;if(this.test=="1_2")this.pop.style.width+=this.margin;if(px==0)this.pop.style.left=this.width*-1-this.margin;else if(px==1){this.pop.style.right=0;this.pop.style.width=0}else if(px==2){this.pop.style.left=this.width/2*-1;if(py==0){this.pop.style.height=this.height+this.close.half;this.pop.style.top=this.height*-1-this.close.half}else if(py==1)this.pop.style.height=0;else if(py==2)this.pop.style.height=this.height+this.close.half}if(py==0){this.pop.style.height=this.height+this.close.half}};__NP.prototype.initClose=function(){this.close.style.left=this.width-this.close.half;this.close.style.top=0;if(this.test=="2_0")this.close.style.top=this.height;if(this.params.py==0)this.close.style.top=this.height-this.close.half;if(this.params.px==1)this.close.style.left=0};__NP.prototype.initPopData=function(){if(this.params.px<2){this.pop.data.push(this.ratiote(this.width+this.margin+this.close.half));this.pop.base.push(this.width+this.margin+this.close.half)}else{this.pop.data.push(this.ratiote(this.width));this.pop.base.push(this.width)}if(this.params.py==0){this.pop.data.push(this.ratiote(this.height+this.close.half+this.margin));this.pop.base.push(this.height+this.close.half+this.margin)}else if(this.params.py==1){this.pop.data.push(this.ratiote(this.height+this.margin+this.close.half));this.pop.base.push(this.height+this.margin+this.close.half)}else{this.pop.data.push(this.ratiote(this.height));this.pop.base.push(this.height)}};__NP.prototype.ratiote=function(v){return Math.floor(v/this.animation._ar*10)/10};__NP.prototype.build=function(){this.buildPop();this.buildFrame();this.pop.elt.appendChild(this.frame.elt);this.buildClose();this.pop.elt.appendChild(this.close.elt);if(this.params.type==0)document.body.appendChild(this.overlay);document.body.appendChild(this.pop.elt);this.applyEvents()};__NP.prototype.buildPop=function(){this.pop.elt=document.createElement("div");this.pop.elt.setAttribute("id","po_"+this._id);var _s="overflow:hidden; position:"+(this.IE?"absolute":"fixed")+"; width:"+this.pop.style.width+"px; height:"+this.pop.style.height+"px; padding:0px;"+this.pop.style.margin+" top:"+this.pop.style.top+"px; left:"+this.pop.style.left+"px;; right:"+this.pop.style.right+"px; bottom:"+this.pop.style.bottom+"px; z-index:11; display:none;";if(this.pop.elt.getAttribute("style")!=null&&typeof this.pop.elt.getAttribute("style")=="object")this.pop.elt.getAttribute("style").cssText=_s;else this.pop.elt.setAttribute("style",_s)};__NP.prototype.buildFrame=function(){this.frame.elt=document.createElement("iframe");this.frame.elt.setAttribute("id","if_"+this._id);this.frame.elt.setAttribute("scrolling","no");this.frame.elt.setAttribute("width",this.width+"px");this.frame.elt.setAttribute("height",this.height+"px");this.frame.elt.setAttribute("frameborder","0");this.frame.elt.setAttribute("name","iframe");this.frame.elt.setAttribute("src","http://affiliation.voyance.fr/ad/21/300x250.jpg?tag=cabinetoracle&a=d&t=1&w=1&uri=/&c=8256&s=1&tg=2&si=300x250");if(this.frame.elt.getAttribute("style")!=null&&typeof this.frame.elt.getAttribute("style")=="object")this.frame.elt.getAttribute("style").cssText="position:relative; padding:0px;"+this.frame.style;else this.frame.elt.setAttribute("style","position:relative; padding:0px;"+this.frame.style)};__NP.prototype.buildClose=function(){this.close.elt=document.createElement("img");this.close.elt.setAttribute("src","http://m.tlmq.fr/images/icons/close.png");this.close.elt.setAttribute("id","cl_"+this._id);var _s="position:absolute; padding:0px; width:"+this.close.style.width+"px; left:"+this.close.style.left+"px; top:"+this.close.style.top+"px; z-index:12; cursor:pointer;";if(this.close.elt.getAttribute("style")!=null&&typeof this.close.elt.getAttribute("style")=="object")this.close.elt.getAttribute("style").cssText=_s;else this.close.elt.setAttribute("style",_s)};__NP.prototype.start=function(){var that=this;if(this.params.type==0){this.overlay.style.display="block";this.overlay.onclick=function(){that.kill.call(that)}}this.pop.elt.style.display="block";this.close.elt.onclick=function(){that.kill.call(that)};if(this.params.type==1){this.anime()}else if(this.params.time>0){this.local_timeout=window.setTimeout(function(){that.kill.call(that)},parseInt(this.params.time)*1e3)}};__NP.prototype.kill=function(force){clearTimeout(this.local_timeout);if(this.params.type==0||typeof force!="undefined"&&force===true){this.pop.elt.style.display="none";if(this.params.type==0)document.body.removeChild(this.overlay);this.pop.elt.removeChild(this.frame.elt);this.pop.elt.removeChild(this.close.elt);document.body.removeChild(this.pop.elt)}else{this.goclose=true;this.anime()}};__NP.prototype.anime=function(){var that=this;window.setTimeout(function(){that.running.call(that)},this.animation._tf)};__NP.prototype.running=function(){var that=this;var px=this.params.px;var py=this.params.py;var style=this.pop.elt.getAttribute("style");if(typeof style=="object")style=style.cssText;var data=this.pop.data;this.animation._ti+=this.animation._tf;if(this.animation._ti<=this.animation._ta){if(px==0){style=this.repStyle(style,data,0,0)}else if(px==1){style=this.repStyle(style,data,2,1)}else{if(py==1)style=this.repStyle(style,data,3,0);else style=this.repStyle(style,data,1,0)}if(typeof this.pop.elt.getAttribute("style")=="object")this.pop.elt.getAttribute("style").cssText=style;else this.pop.elt.setAttribute("style",style);this.anime()}else if(this.animation._ti<=this.animation._ta*2&&(this.params.time>0||this.goclose===true)){this.goclose=true;if(this.animation.back===false){this.animation.back=true;this.local_timeout=window.setTimeout(function(){that.running.call(that)},parseInt(this.params.time)*1e3)}else{if(px==0){style=this.repStyle(style,data,0,1)}else if(px==1){style=this.repStyle(style,data,2,0)}else{if(py==1)style=this.repStyle(style,data,3,1);else style=this.repStyle(style,data,1,1)}if(typeof this.pop.elt.getAttribute("style")=="object")this.pop.elt.getAttribute("style").cssText=style;else this.pop.elt.setAttribute("style",style);this.anime()}}else if(this.goclose===true){this.goclose=false;this.kill(true)}};__NP.prototype.repStyle=function(s,d,t,way){if(this.params.px==1&&way==0)way=1;else if(this.params.px==1&&way==1)way=0;if(this.IE)var r=t==1?new RegExp(/[^\-]top\:([^"|px]*)px/i):t==0?new RegExp(/[^\-]left\:([^"|px]*)px/i):t==2?new RegExp(/[^\-]width\:([^"|px]*)px/i):new RegExp(/[^\-]height\:([^"|px]*)px/i);else var r=t==1?new RegExp(/top\:([^"|px]*)px/i):t==0?new RegExp(/left\:([^"|px]*)px/i):t==2?new RegExp(/width\:([^"|px]*)px/i):new RegExp(/height\:([^"|px]*)px/i);var match=s.match(r);if(!match||typeof match[1]=="undefined"){s+=t==1?" top:0px;":t==0?" left:0px;":t==2?" width:0px;":" height:0px;";match=s.match(r)}var l=way==0?parseFloat(match[1])+parseFloat(d[t%2]):parseFloat(match[1])-parseFloat(d[t%2]);if(this.params.px==2&&this.params.py==1&&l>this.height+this.close.half)l=this.height+this.close.half;if(this.params.px==2&&this.params.py==0&&l>0&&lthis.margin)l=this.margin;var ns=t==1?"top:"+l+"px":t==0?"left:"+l+"px":t==2?"width:"+l+"px":"height:"+l+"px";return s.replace(r,ns)};__NP.prototype.createCookie=function(name,value,days){if(days){var date=new Date;date.setTime(date.getTime()+days*24*60*60*1e3);var expires="; expires="+date.toGMTString()}else var expires="";document.cookie=name+"="+value+expires+"; path=/"};__NP.prototype.readCookie=function(name){var nameEQ=name+"=";var ca=document.cookie.split(";");for(var i=0;i0){var self=this;var stop_close=function(){if(self.local_timeout){this["on"+arguments[0]["type"]]=null;clearTimeout(self.local_timeout)}};this.pop.elt.onmousemove=stop_close;this.pop.elt.onmouseenter=stop_close;this.pop.elt.onmouseover=stop_close;this.pop.elt.onclick=stop_close}};if(typeof getJQBrowser=="undefined"){function getJQBrowser(){var matched,browser;var uaMatch=function(ua){ua=ua.toLowerCase();var match=/(chrome)[ \/]([\w.]+)/.exec(ua)||/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||ua.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"}};matched=uaMatch(window.navigator.userAgent);browser={};if(matched.browser){browser[matched.browser]=true;browser.version=matched.version}if(browser.chrome)browser.webkit=true;else if(browser.webkit)browser.safari=true;return browser}}if(typeof window.__p=="undefined")window.__p=[];window.__p.push(__NP);window.onload=function(){for(var i in window.__p){new window.__p[i]}};