app.redirect("/telecharger.html","/mac-info.html");
app.redirect("/aide/faq.html","http://www.aide.pmu.fr/aide-poker/poker-pmufr","true");

if(typeof(app.navPMU)=="undefined")app.navPMU=function(){
    var ul=$("#header_links ul");
    $("li a",ul).hover(function(){ul.addClass($(this).attr("class"))},function(){ul.removeClass($(this).attr("class"))});
    $(window).scroll(function(){
        if($(this).scrollTop()>50)$('#back-to-top').fadeIn();else $('#back-to-top').fadeOut();
    });
    $('#back-to-top a').click(function(e){
        e.preventDefault();
        $('body,html').animate({scrollTop:0},500);
    });
}

app.footerTooltip=function(){
    var t=$("#footer #pmu-interdiction-text");
    $("#footer #pmu-interdiction a").hover(function(){t.css({'top':$(this).offset().top+$(this).height()}).stop(false,true).fadeIn(300)},function(){t.stop(false,true).fadeOut(300)});
}

app.attachTelecharger=function(){
    $("a[href*='/telecharger']").click(function(){
        app.launchDownload($(this).attr('href'));
    });
}

$(function(){
    $("a.navPoker").attr("target","_self");
    app.attachDownload("a[href*='/telecharger']");
    app.navPMU();
    app.PMUtracking();
    app.footerTooltip();
});

app.PMUsifrtracking=function(t,url){
    var sifrtags={
        "http://poker.pmu.fr/ecole-de-poker.html":"accueil.bloc.ecole_poker.acceder",
        "http://poker.pmu.fr/tournois.html":"accueil.bloc.nos_tournois.acceder",
        "http://poker.pmu.fr/evenements-poker.html":"accueil.les_promotions.decouvrez",
        "http://poker.blog.pmu.fr/":"accueil.blog_poker.decouvrez",
        "http://twitter.com/#!/PMU_Poker":"accueil.blog_poker.news",
        "#":"accueil.bloc.videos_tutorielles.acceder"
    }
    ns_onclick(t,'','poker.clic.'+sifrtags[url],"clickin");
}

app.PMUattachTracking=function(s,v){
    var tag=[];
    $(s).each(function(){
        var value=v.split(',');
        tag=[value[0],typeof(value[1])=="undefined"?'clickin':'clickout'];
        $(this).data('tag',tag).unbind('clik').click(function(){
            var tag=$(this).data('tag'),href=$(this).attr('href').replace('http://poker.pmu.fr','').split('/');
            if(tag[0].match(/%basename%/))tag[0]=tag[0].replace("%basename%",(href[0].match(/^#/)?href[0].replace("#",""):(href[href.length-1]!=""?href[href.length-1].replace(".html",""):href[href.length-2])));
            if(tag[0].match(/%section%/)){
                var path=location.pathname.replace('.html','').split('/'),section={'aide':'aide','boutique':'boutique','ecole-de-poker':'ecole_poker','tournois':'programme_tournois','team-pmu-poker':'team_poker','evenements-poker':'evenements'}
                var first=path[1];
                path.splice(0,2);
                tag[0]=tag[0].replace('%section%',section[first]+(path.length>0?'.'+path.join('.'):''));
            }
            if(tag[0].match(/telechargez/)){
                debug('http://fr.sitestat.com/pmu/pmu-fr/s?poker.clic.'+tag[0]+'&amp;ns_type=clickin&amp;ns_url='+encodeURIComponent($(this).attr('href')));
                app.launchDownload('http://fr.sitestat.com/pmu/pmu-fr/s?poker.clic.'+tag[0]+'&amp;ns_type=clickin&amp;ns_url='+encodeURIComponent($(this).attr('href')));
            }else ns_onclick(this,'','poker.clic.'+tag[0],tag[1]);
            return false;
        });
    });
}

app.PMUtracking=function(){
    var tags={
        "global":{"#sidebar a[href$='/telecharger.html']":"%section%.telechargez","#pmu-footer-menu a[href$='/entreprise/']":"footer.entreprise","#pmu-footer-menu a[href$='/partenaires/partenaires-poker.html']":"footer.partenaires","#pmu-footer-menu a[href$='/turf/sinformer/informations-legales.html']":"footer.infos_legales","#pmu-footer-menu a[href$='/turf/sinformer/contact.html']":"footer.contact","#pmu-footer-menu a[href$='/aide.html']":"footer.aide","#pmu-footer-menu a[href$='/turf/sinformer/plan-du-site.html']":"footer.plan_site","#pmu-footer-menu a[href$='/turf/actualites/news/index.html']":"footer.newsletter","#pmu-footer-icons a.jouons-responsable":"footer.jeu_responsable","#pmu-footer-icons a.ans-18":"footer.parier_18_ans","#pmu-footer-icons a.pmu-fr":"footer.pmu","#pmu-footer-icons a.empa":"footer.epma","#pmu-footer-icons a.verisign":"footer.verisign","#pmu-footer-icons a.arjel":"footer.arjel","#social-footer a.youtube":"footer.youtube,clickout","#social-footer a.facebook":"footer.facebook,clickout","#social-footer a.twitter":"footer.twitter,clickout","#header_links a.navHippiques":"header.paris_hippiques","#header_links a.navSportifs":"header.paris_sportifs","#header_links a.navPoker":"header.poker","#branding a":"header.logo_pmu","#header #disclaimer a":"header.bandeau_arjel","#pmu-footer-sub-menu a[href$='/guide/texas-hold-em/texas-holdem-en-ligne.html']":"footer.texas_holdem","#pmu-footer-sub-menu a[href$='/guide.html']":"footer.big_blind","#pmu-footer-sub-menu a[href$='/guide/glossaire/bluff.html']":"footer.bluff","#pmu-footer-sub-menu a[href$='/guide/glossaire/freeroll-tournament.html']":"footer.freeroll_tournament","#pmu-footer-sub-menu a[href$='/guide/glossaire/variantes-poker.html']":"footer.variantes_poker","#pmu-footer-sub-menu a[href$='/guide/glossaire/limit-poker.html']":"footer.limites_poker","#pmu-footer-sub-menu a[href$='/guide/glossaire/tournoi-satellite.html']":"footer.tournoi_satellite",".navigation .telecharger a":"bloc.menu.telechargez",".navigation .ecoledepoker a":"bloc.menu.ecole_poker",".navigation .tournois a":"bloc.menu.tournois",".navigation .evenementspoker a":"bloc.menu.evenements",".navigation .boutique a":"bloc.menu.boutique"},
        "/":{"#pmu-hp-banner .pmu-download-button a":"accueil.telechargez",".hp-slider .promotion a":"accueil.bloc.evenements.%basename%",".hp-slider .arrow-left a,.hp-slider .arrow-right a":"accueil.bloc.evenements.bouton_fleche","#pmu-hp-banner .pmu-download-button a":"accueil.telechargez","#pmu-how-to-play-box .cta_button a":"accueil.bloc.ecole_poker.en_savoir_plus","#pmu-tournaments-box .cta_button a":"accueil.bloc.nos_tournois.en_savoir_plus","#pmu-tutorials-box .cta_button a":"accueil.bloc.videos_tutorielles.en_savoir_plus","#pmu-tutorials-box a[href*='poker-jouez.html']":"accueil.bloc.videos_tutorielles.comment_jouer","#pmu-tutorials-box a[href*='poker-mon-portefeuille.html']":"accueil.bloc.videos_tutorielles.portefeuille_poker"},
        "/evenements-poker.html":{".promo-item a":"evenements.bloc.%basename%"},
        "/ecole-de-poker.html":{"#main a[href$='/logiciel-poker.html":"ecole_poker.accueil.infos_generales","#main a[href$='/debutants.html":"ecole_poker.accueil.deroulement_partie","#main a[href$='/debutants/classement-des-mains.html":"ecole_poker.accueil.mains_gagnantes","#main a[href$='/avances.html":"ecole_poker.accueil.strategie_poker","#main a[href$='/avances/variantes.html":"ecole_poker.accueil.variantes_poker","#main a[href$='/lexique-poker.html":"ecole_poker.accueil.infos_generales"},
        "/ecole-de-poker/debutants.html":{"#main a[href$='/classement-des-mains.html']:eq(0)":"ecole_poker.debutant.commencer.classement_mains.haut","#main a[href$='/classement-des-mains.html']:eq(1)":"ecole_poker.debutant.commencer.classement_mains.bas"},
        "/ecole-de-poker/debutants/types-de-tournois.html":{".navigationleft a[href$='/sit-go-unique.html']":"ecole_poker.debutant.types_tournois.menu_gauche.sit_and_go",".navigationleft a[href$='/parties-multiples.html']":"ecole_poker.debutant.types_tournois.menu_gauche.multi_tables",".navigationleft a[href$='/tournois-shootout.html']":"ecole_poker.debutant.types_tournois.menu_gauche.shootouts",".navigationleft a[href$='/les-tournois-duels.html']":"ecole_poker.debutant.types_tournois.menu_gauche.duels","#main a[href$='/sit-go-unique.html']":"ecole_poker.debutant.types_tournois.bas_page.sit_and_go","#main a[href$='/parties-multiples.html']":"ecole_poker.debutant.types_tournois.bas_page.multi_tables","#main a[href$='/tournois-shootout.html']":"ecole_poker.debutant.types_tournois.bas_page.shootouts","#main a[href$='/les-tournois-duels.html']":"ecole_poker.debutant.types_tournois.bas_page.duels"},
        "/ecole-de-poker/lexique-poker.html":{"#glossary-index a":"ecole_poker.lexique.lettres.%basename%"},
        "/tournois.html":{"#main a[href$='/reglement.html']":"programme_tournois.reglement_conditions","#main a[href$='/structure-des-blinds.html']":"programme_tournois.comissions_blinds"},
        "/boutique.html":{"#main a[href$='/telecharger.html']":"boutique.telechargez","#main a[href$='/structure-des-blinds.html']":"boutique.comissions",".navigationleft a[href$='/tournois-shootout.html']":"menu.boutique_fidelite"},
        "/aide.html":{"#main a[href$='/faq-paris-hippiques-ouvrir-un-compte.html']:eq(0)":"aide.compte.avantages","#main a[href$='/faq-paris-hippiques-ouvrir-un-compte.html']:eq(1)":"aide.compte.recuperer_gains","#main a[href$='/faq-paris-hippiques-ouvrir-un-compte.html']:eq(2)":"aide.compte.codes_perdus","#main a[href$='/faq-paris-hippiques-la-securite.html']":"aide.compte.securite_internet","#main a[href$='/ouvrir-son-compte.html']":"aide.compte.ouverture","#main a[href$='/gerer-son-compte.html']":"aide.compte.gestion","#main a[href$='/debutants.html']":"aide.jeu.commencer","#main a[href$='/classement-des-mains.html']":"aide.jeu.classement_mains","#main a[href$='/caves-et-enjeux.html']":"aide.jeu.caves_enjeux","#main a[href$='/types-de-tournois.html']":"aide.jeu.types_tournois","#main a[href$='/variantes.html']":"aide.jeu.variantes_poker","#main a[href$='/logiciel-poker.html']":"aide.jeu.logiciel","#main a[href$='/avances.html']":"aide.jeu.strategie","#main a[href$='/etiquette-poker.html']":"aide.jeu.etiquette","#main a[href$='/parties-multiples.html']":"aide.jeu.multi_tables","#main a[href$='/le-sitngo-conseils-strategie/']":"aide.jeu.sit_and_go","#main a[href$='/les-tournois-sit-sur-pmu-poker/']":"aide.jeu.3_bonnes_raisons","#main a[href$='/augmenter-ses-fonds-la-gestion-de-bankroll/']":"aide.jeu.gestion_bankroll","#main a[href$='/limportance-de-la-position/']":"aide.jeu.position.importance","#main a[href$='/jouer-en-position-tardive/']":"aide.jeu.position.limper","#main a[href$='/jouer-en-position-tardive/']":"aide.jeu.position.vol_blind","#main a[href$='/la-position-tactiques-avancees/']":"aide.jeu.position.squeeze_floatting","#main a[href$='/turf/sinformer/contact.html'],#main a[href$='/turf/sinformer/contact-compte.html']":"aide.service_clients"},
        "/aide/faq.html":{"#main a[href$='/turf/sinformer/contact.html']":"aide.service_clients"},
        "/team-pmu-poker.html":{".navigationleft a":"bloc.menu.team_poker.portrait.%basename%"},
        "/telecharger.html":{"#main #downloadCTA a[href$='/telecharger.html']":"telechargez.telechargez","#main #downloadStep1 .small a[href$='/telecharger.html']":"telechargez_bis.telecharger"}
    }
    for(var j in tags)if(j=="global"||location.pathname==j)for(var i in tags[j])app.PMUattachTracking(i,tags[j][i]);
}

function debug(){if(typeof(console)!="undefined")if(arguments.length>1)console.log(arguments);else console.log(arguments[0])}

// FromUrl v1.5 Copyright (c) 2001-2008 Nedstat B.V. Allrights reserved.
function sitestat(ns_l){var ns_type="";var r="";var t="?";var p=new Array;var w="";var l="";var d=document;var n=navigator;var ns_0="";if(top!=self){if("A"=="A"){var u=n.userAgent;if(u.indexOf("Safari")==-1){var b=u.indexOf("Opera");if(b==-1||u.charAt(b+6)+0>5){b=u.indexOf("Mozilla");var xb=b!=-1?u.charAt(b+8)>4:1;if(u.indexOf("compatible")!=-1||xb){var c="try{ns_0=top.document.referrer}catch(e){}";eval(c);c="try{l=top.document.location.href}catch(e){}";eval(c)}}}}}else{ns_0=d.referrer;l=d.location.href}if(ns_0.lastIndexOf("/")==ns_0.length-1){ns_0=ns_0.substring(ns_0.lastIndexOf("/"),0)}var f=ns_l.indexOf("?");if(f!=-1){var q=ns_l.substring(f+1);ns_l=ns_l.substring(0,f);if(q){var m=q.indexOf("&");w=q.substring(0,m==-1?q.length:m);if(w.indexOf("=")!=-1){w=""}if(w){q=q.substring(m==-1?q.length:m+1);q+=(q?"&":"")+"ns_name="+w}if(ns_0.length>0){q+=(q?"&":"")+"ns_referrer="+escape(ns_0)}var s=0;var e=0;while(q.length){e=q.indexOf("&");if(e==-1){e=q.length}var o=q.substring(s,e);if(o.substring(0,4)=="amp;"){o=o.substring(4)}if(o)p[p.length]=o;q=q.substring(e+1)}}}var a=l.indexOf(t);a=a==-1?0:l.substring(a+1);var j;if(r=="yes")j=ns_0.length;else if(r=="no")j=!ns_0.length;else if(r=="")j=1;if(a&&j){while(a.length){var e=a.indexOf("&");if(e==-1){e=a.length}var k=a.substring(0,a.substring(0,e).indexOf("="));var v=a.substring(a.substring(0,e).indexOf("=")+1,e);if(k.substring(0,4)=="amp;"){k=k.substring(4)}while(v.substring(0,1)=="="){v=v.substring(1)}if(k=="ns_name"){w=v}else if(k=="ns_or"){var g="ns_referrer=";for(var z=0;z<p.length;z++){if(p[z].substring(0,g.length)==g){p[z]="ns_referrer="+v}}}else{if(k.substring(0,3)=="ns_"&&v&&k){var h=0;for(var x=0;x<p.length;x++){if(p[x].substring(0,p[x].indexOf("="))==k){p[x]=k+"="+v;h=1}}if(!h){p[p.length]=k+"="+v}}}a=a.substring(e+1)}}if(!w){return}var s="";var y="";for(var i=0;i<p.length;i++)if(p[i].substring(0,8)!="ns_name="){if(p[i].substring(0,12)!="ns_referrer="){s+="&"+p[i]}else{y="&"+p[i]}}s+=ns_type?"&ns_type="+ns_type+"&ns_action=view":"";ns_pixelUrl=ns_l+"?"+w+"&ns__t="+(new Date).getTime();ns_l=ns_pixelUrl+s+y;if(d.images){ns_1=new Image;ns_1.src=ns_l}else{d.write("<img src="+ns_l+' width="1" height="1">')}}
//Begin comScore OnClick v1.1.1 code (c) 2004-2009 Copyright Nedstat B.V. All rights reserved
function ns_onclick(a,b,c,d,e){var f="";if(typeof ns_pixelUrl=="string"){f=ns_pixelUrl.substring(0,ns_pixelUrl.indexOf("?")+1)}f+=c;f+="&ns_type="+d+"&ns_action=view";f+="&ns__t="+(new Date).getTime();if(!b){b=a.href}var g=document.referrer;if(g.lastIndexOf("/")==g.length-1){g=g.substring(g.lastIndexOf("/"),0)}if(g.length>0){f+="&ns_referrer="+escape(g)}e=e||"";var h=a&&a.target&&a.target!=""?a.target.substring(0,1)=="_"?a.target.substring(1):a.target:"self";var i=new Image;if(h&&b){if(window[h]){window.ns_softclick_timer=function(a,b){return function(){if(window.ns_softclick_timeout){window.clearTimeout(window.ns_softclick_timeout)}i.onload=i.onerror=function(){return};window[window[a]?a:"self"].location.href=b}}(h,b);ns_softclick_timeout=window.setTimeout("ns_softclick_timer()",5e3);i.onload=i.onerror=window.ns_softclick_timer}else{window.open(b,h,e)}}debug(f);i.src=f;return false}


