
function pg_get_method(o_,fct_){return(function(){o_[fct_]()});}
var $PG_Banner={base_url:"http://roule.direction-x.com/",url_track_click:"http://statsroule.direction-x.com/track.php?c&i=",url_track_view:"http://statsroule.direction-x.com/track.php?v&i=",width:460,height:120,current:0,active:true,complete:false,stats:true,datas:{"groups":[{"weight":100,"bans":[{"id":2457,"file":"42cb5a43ea9ddb9ad9db12abe1dd7c1f.gif","pos":1,"duration":99,"track":"99-98-1-2457"}],"size":1}],"tweight":100},initialize:function(){this.target_href=this.construct_url("http://acces.direction-x.com/a.php?",{o:"if"});this.group=new Array();if(this.datas.groups.length>1){var r=Math.random()*this.datas.tweight;var o=0;for(var i=0;i<this.datas.groups.length;i++){o+=this.datas.groups[i].weight;if(o>=r){this.data=this.datas.groups[i];break;}
this.data=this.datas.groups[0];}}else{this.data=this.datas.groups[0];}
for(var i=1;i<=this.data.size;i++){this.randomize();for(var j=0;j<this.data.bans.length;j++){if(this.data.bans[j].pos==i){var ban=this.data.bans[j];this.group[this.group.length]=ban;break;}}
var new_bans=new Array();for(var j=0;j<this.data.bans.length;j++){if(this.data.bans[j].id!=ban.id){new_bans[new_bans.length]=this.data.bans[j];}}
this.data.bans=new_bans;}},get_target_url:function(){return this.target_href+'&tci13=ban-'+this.group[this.current].track;},track_click:function(){if((this.active==true)&&(this.stats==true)){var i=new Image();i.src=this.url_track_click+this.group[this.current-1].track;this.active=false;}},track_view:function(o){if((this.complete==false)&&(this.stats==true)){var i=new Image();i.src=this.url_track_view+o.track;}},display:function(){if(typeof this.tlk!="undefined"){document.body.removeChild(this.tlk);}
var current_banner=this.group[this.current];if(typeof current_banner.html!='undefined'){this.tlk=document.createElement("iframe");this.tlk.setAttribute('allowTransparency',true);this.tlk.setAttribute('width',this.width);this.tlk.setAttribute('height',this.height);this.tlk.setAttribute('frameBorder',0);this.tlk.setAttribute('scrolling','no');this.tlk.setAttribute('src',this.base_url+current_banner.html);document.body.insertBefore(this.tlk,document.body.firstChild);}else{var _ext=current_banner.file.split(".")[1];if(_ext=="swf"){var flashvars="?_track="+escape("javas"+"cript:__track_clic()")+"&_target_url="+escape(this.get_target_url());this.tlk=document.createElement("div");this.tlk.innerHTML='<embed src="'+this.base_url+current_banner.file+flashvars+'" width="'+this.width+'" height="'+this.height+'" menu="false" quality="high" wmode="transparent" allowfullscreen="false" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';document.body.insertBefore(this.tlk,document.body.firstChild);}else{this.tlk=document.createElement("a");this.tlk.href=this.get_target_url();this.tlk.target="_blank";document.body.insertBefore(this.tlk,document.body.firstChild);this.tlk.banner=current_banner;this.tlk.onclick=function(){$PG_Banner.track_click();}
this.timg=document.createElement("img");this.timg.width=this.width;this.timg.border=0;this.timg.height=this.height;this.timg.src=this.base_url+this.tlk.banner.file;this.tlk.appendChild(this.timg);}}
this.track_view(current_banner);},next:function(){if(this.active){if(this.current>=this.group.length){this.current=0;this.complete=true;}
this.display();if(this.group.length>1){setTimeout(pg_get_method(this,"next"),this.group[this.current].duration*1000);}
if((this.complete==false)&&(this.current!=this.group.length-1)){var ban=this.group[this.current+1];if(typeof ban.file!='unefined'){this.preload=new Image();this.preload.src=this.base_url+ban.file;}}
this.current++;}},construct_url:function(url,o){var params=window.location.search;params=params.substring(1);var set_params={};var tmp=params.split("&");for(var i=0;i<tmp.length;i++){var tmp2=tmp[i].split("=");if(tmp2.length==2){if(o[tmp2[0]]!=undefined){url+=tmp2[0]+"="+o[tmp2[0]]+"&";}else{url+=tmp2[0]+"="+tmp2[1]+"&";}
set_params[tmp2[0]]=1;}}
if(typeof set_params.clicktag!='undefined'){url=set_params.clicktag;}else{for(var i in o){if(set_params[i]==undefined){url+=i+"="+o[i]+"&";}}}
return url;},randomize:function(){var i,num;var nb=this.data.bans.length;var tab=new Array();tab=tab.concat(this.data.bans);while(nb>0){num=Math.floor(Math.random()*nb);nb--;szTmp=tab[num];for(i=num;i<nb;i++){tab[i]=tab[i+1]}
tab[nb]=szTmp;}
tab.reverse();this.data.bans=tab;}}
function __track_clic(){$PG_Banner.track_click();}
function __stop(){$PG_Banner.active=false;}
function __get_target_url(){return $PG_Banner.get_target_url();}
$PG_Banner.initialize();$PG_Banner.next();
