$(document).ready(function(){var stickyNavTop=$("#wrapper > header").offset().top;var stickyNav=function(){var scrollTop=$(window).scrollTop();if(scrollTop>stickyNavTop){$("#wrapper > header").addClass("sticky")}else{$("#wrapper > header").removeClass("sticky")}};stickyNav();$(window).scroll(function(){stickyNav()})});
window.matchMedia=window.matchMedia||function(doc,undefined){"use strict";var bool,docElem=doc.documentElement,refNode=docElem.firstElementChild||docElem.firstChild,fakeBody=doc.createElement("body"),div=doc.createElement("div");div.id="mq-test-1";div.style.cssText="position:absolute;top:-100em";fakeBody.style.background="none";fakeBody.appendChild(div);return function(q){div.innerHTML='&shy;<style media="'+q+'"> #mq-test-1 { width: 42px; }</style>';docElem.insertBefore(fakeBody,refNode);bool=div.offsetWidth===42;docElem.removeChild(fakeBody);return{matches:bool,media:q}}}(document);
(function(w){"use strict";w.picturefillOptions={selector:"picturefill-background",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"50% 50%"};w.picturefill=function(){var picturefills=w.document.getElementsByClassName(w.picturefillOptions.selector);for(var i=0,il=picturefills.length;i<il;i++){var sources=picturefills[i].getElementsByTagName("span"),matches=[];for(var j=0,jl=sources.length;j<jl;j++){var media=sources[j].getAttribute("data-media");if(!media||w.matchMedia&&w.matchMedia(media).matches){matches.push(sources[j])}}if(matches.length){picturefills[i].style.backgroundImage="url("+matches.pop().getAttribute("data-src")+")";picturefills[i].style.backgroundSize=w.picturefillOptions.backgroundSize;picturefills[i].style.backgroundRepeat=w.picturefillOptions.backgroundRepeat;picturefills[i].style.backgroundPosition=w.picturefillOptions.backgroundPosition}}};if(w.addEventListener){w.addEventListener("load",w.picturefill,false);w.addEventListener("resize",w.picturefill,false);w.addEventListener("DOMContentLoaded",function(){w.picturefill();w.removeEventListener("load",w.picturefill,false)},false)}else if(w.attachEvent){w.attachEvent("onload",w.picturefill)}})(this);
(function($){"use strict";var $albox=null;var AlboxSettings;var Albox=function(settings,mode){var countStack=0;settings=$.extend({mode:mode||"html"},settings,AlboxSettings);if(Albox.stack.length>1){for(var i in Albox.stack){if(typeof Albox.stack[i].settings!=="undefined"){if(settings.url&&settings.url===Albox.stack[i].settings.url||!settings.url&&settings.content===Albox.stack[i].settings.content){countStack++}}}if(countStack>1){return false}}this.init(settings);if(typeof settings.callbacks==="object"){for(var j in settings.callbacks){if(typeof this.settings.context[j]==="undefined"){this.settings.context[j]=settings.callbacks[j]}}}};Albox.stack=[];Albox.instance=[];Albox.push=function(instance){Albox.stack.unshift(instance);Albox.instance=instance};Albox.pop=function(instance){Albox.stack.shift(instance);Albox.instance=Albox.stack[0]||null;$albox=Albox.instance===null?null:Albox.instance.$content.find(".lb-content")};Albox.config=function(settings){AlboxSettings=settings};Albox.settings={context:$("body"),append:"body",title:"",description:"",url:null,content:null,crossdomain:false,post:{},keyboard:true,current:null,steps:{},items:[],stepsKeys:[],locale:{close:"&times;",navigate:{previous:"&lsaquo; pr&eacute;c&eacute;dent",next:"suivant &rsaquo;",close:"fermer",stop:"terminer"},alert:{notFound:"404 - Not Found",close:"Fermeture automatique dans",seconds:{singular:"seconde",plural:"secondes"}}},overlay:.5,speed:200,close:true,skin:"default",width:"auto",minWidth:320,margin:30,height:"auto",minHeight:0,button:null,zoom:false,afterShow:$.noop,beforeLoad:$.noop,afterLoad:$.noop,beforeClose:$.noop,afterClose:$.noop,beforePos:$.noop,afterPos:$.noop,beforeNextStep:$.noop,beforePrevStep:$.noop,afterStepLoad:$.noop,callbacks:{},render:{html:'<div class="albox"><div class="lb-overlay"></div><div class="lb-box lb-loading"><div class="lb-header"><div class="lb-close"></div><div class="lb-title"></div></div><div class="lb-content"></div><div class="lb-footer"></div></div></div>',alert:'<div class="albox"><div class="lb-overlay"></div><div class="lb-box lb-alert"><div class="lb-content"></div></div></div>',image:'<div class="albox"><div class="lb-overlay"></div><div class="lb-box lb-loading"><div class="lb-header"><div class="lb-close"></div><div class="lb-title"></div></div><div class="lb-content"></div><div class="lb-navigate"><a href="javascript:void(0)" class="lb-previous lb-disable"></a><span class="lb-count"></span><a href="javascript:void(0)" class="lb-next lb-disable"></a></div></div></div>',steps:'<div class="albox"><div class="lb-overlay"></div><div class="lb-box lb-loading"><div class="lb-header"><div class="lb-close"></div><div class="lb-title"></div></div><div class="lb-content"></div><div class="lb-navigate"><a href="javascript:void(0)" class="lb-previous lb-disable"></a><span class="lb-count"></span><a href="javascript:void(0)" class="lb-next lb-disable"></a></div></div></div>'}};Albox.prototype={init:function(settings){var $this=this;Albox.push(this);if(!$.isEmptyObject(settings.steps)){settings.mode="steps";settings.stepsKeys=Object.keys(settings.steps);if(parseInt(settings.current,10)!=="NaN"){settings.current=Math.min(Math.max(settings.current-1,1),settings.stepsKeys.length)}else{settings.current=Math.max($.inArray(settings.current,settings.stepsKeys),0)}}this.settings=$.extend({},Albox.settings,settings||{});this.settings.beforeLoad();this.$content=$(this.settings.render[this.settings.mode]).appendTo(this.settings.append).addClass(this.settings.skin).find(".lb-overlay").hide().css("z-index",1e5+Albox.stack.length*1e3).fadeTo(this.settings.speed,this.settings.overlay,function(){$this.$content.find(".lb-box").fadeIn($this.settings.speed,function(){$this.reveal()})}).end().find(".lb-box").css("z-index",1e5+10+Albox.stack.length*1e3).hide().end().find(".lb-close").html(this.settings.locale.close).end();$albox=this.$content.find(".lb-content");this.$content.find(".lb-header, .lb-footer, .lb-navigate").hide();if(this.settings.close===true){this.$content.on("click",".lb-overlay, .lb-close",function(){$this.close()})}else{this.$content.find(".lb-close").hide()}if(this.settings.button!==null){$.each(this.settings.button,function(index,value){var input=$("<input />").attr({type:"button",name:index,id:value.id,"class":value.className,value:value.text});$this.$content.find(".lb-footer").append(input)});this.$content.find(".lb-footer input:button").on("click",function(){$this.settings.button[$(this).attr("name")].call()})}else{this.$content.find(".lb-footer").remove()}if(this.settings.mode==="image"){if(this.settings.current>0){this.$content.find(".lb-previous").removeClass("lb-disable")}else{this.$content.find(".lb-previous").addClass("lb-disable")}if(this.settings.current<this.settings.items.length-1){this.$content.find(".lb-next").html(this.settings.locale.navigate.next).removeClass("lb-disable")}else{this.$content.find(".lb-next").html(this.settings.locale.navigate.close).removeClass("lb-disable")}this.$content.find(".lb-previous").html(this.settings.locale.navigate.previous).on("click",function(){if($(this).hasClass("lb-disable")===false){$this.gallery($this.settings.current-1)}}).end().find(".lb-next").on("click",function(){if($(this).hasClass("lb-disable")===false){if($(this).text()===$this.settings.locale.navigate.close){$this.close()}else{$this.gallery($this.settings.current+1)}}}).end()}if(this.settings.mode==="steps"){this.$content.find(".lb-previous").html(this.settings.locale.navigate.previous).on("click",function(){if($(this).hasClass("lb-disable")===false){if($this.settings.beforePrevStep($this.settings.stepsKeys[$this.settings.current],$this.settings.current+1)!==false){$this.steps($this.settings.current-1)}}}).end().find(".lb-next").html(this.settings.locale.navigate.next).on("click",function(){if($(this).hasClass("lb-disable")===false){if($this.settings.beforeNextStep($this.settings.stepsKeys[$this.settings.current],$this.settings.current+1)!==false){if($(this).text()===$this.settings.locale.navigate.stop){$this.close()}else{$this.steps($this.settings.current+1)}}}}).end();$albox.on("keypress",":input:visible:first,:input:visible:last",function(event){if(event.keyCode===9){event.preventDefault()}})}},steps:function(index){if(this.settings.mode==="steps"&&index>=0&&index<this.settings.stepsKeys.length){var $this=this;if(index>0){this.$content.find(".lb-previous").removeClass("lb-disable")}else{this.$content.find(".lb-previous").addClass("lb-disable")}this.$content.find(".lb-next").html(index<this.settings.stepsKeys.length-1?this.settings.locale.navigate.next:this.settings.locale.navigate.stop).removeClass("lb-disable");this.settings.current=index;this.$content.find(".lb-count").html("Etape "+(index+1)+" / "+this.settings.stepsKeys.length);$albox.width(this.settings.width).height(this.settings.height).find("#"+this.settings.stepsKeys.join(", #")).hide().end().find("#"+this.settings.stepsKeys[index]).show();this.settings.afterStepLoad(this.settings.stepsKeys[index],index+1);$albox.find("> *").fadeTo(0,0);this.position(function(){$this.title(null,$this.settings.steps[Albox.instance.settings.stepsKeys[index]]);$albox.find("> *").fadeTo($this.settings.speed,1,function(){$this.settings.afterShow($this.settings.stepsKeys[index],index+1)})})}},gallery:function(index){if(index>=0&&index<this.settings.items.length){var $this=this;if(index>0){this.$content.find(".lb-previous").removeClass("lb-disable")}else{this.$content.find(".lb-previous").addClass("lb-disable")}this.$content.find(".lb-next").html(index<this.settings.items.length-1?this.settings.locale.navigate.next:this.settings.locale.navigate.close).removeClass("lb-disable").end().find(".lb-title").fadeOut(this.settings.speed,function(){$this.settings.current=index;$this.reveal()})}},stopLoading:function(){this.$content.find(".lb-box").removeClass("lb-loading").addClass("lb-"+this.settings.mode)},title:function(title,subtitle){this.$content.find(".lb-title").html((title||this.settings.title)+(typeof subtitle!=="undefined"&&subtitle.length>0?"<span>"+subtitle+"</span>":""));return this.$content.find(".lb-title")},zoomable:function(enable){if(enable===true&&this.settings.zoom===true){var $this=this;$albox.find("img").css("cursor","pointer").on("click",function(){window.open($this.settings.url)})}},safeSize:function(element){element={width:parseInt(element.outerWidth(true),10)||0,height:parseInt(element.outerHeight(true),10)||0};return{width:Math.min(parseInt($(window).width(),10)-parseInt(this.settings.margin,10),Math.max(element.width,parseInt(this.settings.minWidth,10),this.settings.width==="auto"?0:parseInt(this.settings.width,10))),height:Math.min(parseInt($(window).height(),10)-parseInt(this.settings.margin,10),Math.max(element.height,parseInt(this.settings.minHeight,10),this.settings.height==="auto"?0:parseInt(this.settings.height,10)))}},close:function(callback){var $this=this;if(this.$content.find(".lb-box").hasClass("lb-loading")===false){this.settings.beforeClose();this.$content.find(".lb-box").fadeOut(this.settings.speed,function(){$this.$content.fadeOut($this.settings.speed,function(){$(this).remove();$this.settings.afterClose();if(typeof $this.settings.callbacks==="object"){for(var i in $this.settings.callbacks){if(typeof $this.settings.context[i]!=="undefined"){$($this.settings.context).removeData($this.settings.callbacks[i])}}}Albox.pop();if(typeof callback==="function"){callback()}})})}},position:function(callback){var box=this.$content.find(".lb-box"),$this=this;box.width("").height("");box.find("> *").show();var size={box:this.safeSize(box),window:{width:parseInt($(window).width(),10),height:parseInt($(window).height(),10)}};this.boxSize=this.boxSize||[0,0];this.settings.beforePos(size.box);box.width(parseInt(this.boxSize[0],10)).height(parseInt(this.boxSize[1],10)).stop().animate(size.box,{duration:$this.settings.speed,easing:"linear",step:function(now,fx){if(fx.prop==="width"){box.css("left",(size.window.width-parseInt(now,10))/2)}else{box.css("top",(size.window.height-parseInt(now,10))/2)}},complete:function(){$this.boxSize=[size.box.width,size.box.height];$this.settings.afterPos(size.box);if(typeof callback==="function"){callback(size.box)}}})},reveal:function(){var $this=this;this.settings.afterLoad();if(this.settings.mode==="image"){if(this.settings.items.length>0){$.extend(this.settings,this.settings.items[this.settings.current]);$albox.find("img").fadeTo(0,0).end().append($("<div />").addClass("lb-loading"));this.$content.find(".lb-count").html("Image "+(this.settings.current+1)+" / "+this.settings.items.length)}var imgLoad=new Image;imgLoad.onerror=function(){$this.close(function(){$.albox.alert()})};imgLoad.onload=function(){if($this.settings.items.length<=1){$this.$content.find(".lb-navigate").remove()}var $image=this,maxSize={width:parseInt($(window).width(),10)-parseInt($this.settings.margin,10),height:parseInt($(window).height(),10)-parseInt($this.settings.margin,10)-$this.$content.find(".lb-navigate").outerHeight(true)};var ratio=$image.width>maxSize.width||$image.height>maxSize.height?Math.max($image.width/maxSize.width,$image.height/maxSize.height):1;var size={width:Math.round($image.width/ratio),height:Math.round($image.height/ratio)};$this.stopLoading();$albox.html($("<img />").css(size).fadeTo(0,0).attr("src",$this.settings.url));$this.title($this.settings.title,$this.settings.description).hide();$this.zoomable($image.width!==size.width||$image.height!==size.height);$this.position(function(){if($this.$content.find(".lb-navigate").length){$this.$content.find(".lb-title").css("bottom",parseInt($this.$content.find(".lb-navigate").outerHeight(true),10))}$albox.find("img").show().fadeTo($this.settings.speed,1,function(){$this.$content.find(".lb-title:not(:empty), .lb-close:hidden").slideDown($this.settings.speed);$this.settings.afterShow()})})};imgLoad.src=this.settings.url}else{if(this.settings.content!==null){this.stopLoading();$albox.html(this.settings.content);this.title();this.position(function(){$this.settings.afterShow()})}else if(this.settings.url!==null){if(this.settings.url.substr(0,1).search(/#|\./)!==-1){if($(this.settings.url).length){this.stopLoading();$albox.hide().html($(this.settings.url).html());this.title(this.settings.title);this.position(function(){$this.settings.afterShow()})}else{this.close(function(){$.albox.alert()})}}else if(this.settings.url.match(/^https?:\/\//i)&&this.settings.crossdomain===false||this.settings.iframe===true){if(this.settings.width==="auto"){$.extend(this.settings,{width:1e6})}if(this.settings.height==="auto"){$.extend(this.settings,{height:1e6})}this.title($this.settings.title);$("<iframe />").attr("src",this.settings.url).addClass("lb-iframe").fadeTo(0,0).css("height",this.safeSize(this.$content.find(".lb-box")).height-this.$content.find(".lb-header").height()).load(function(){if($albox!==null){$this.stopLoading();$this.position(function(){$albox.find(".lb-iframe").fadeTo($this.settings.speed,1,function(){$this.settings.afterShow()})})}}).appendTo($albox)}else if(this.settings.url!==null){$.ajax({url:this.settings.url,data:this.settings.post,xhrFields:{withCredentials:this.settings.crossdomain},type:"POST",success:function(content){$this.stopLoading();$albox.hide().html(function(){if($this.settings.mode==="steps"){if($("#"+$this.settings.stepsKeys[$this.settings.current],content).length<1){$this.close(function(){$.albox.alert()})}}return content});if($this.settings.stepsKeys.length>0){$this.steps($this.settings.current)}else{$this.title($this.settings.title);$this.position(function(){$this.settings.afterShow()})}},error:function(error){$this.close(function(){$.albox.alert(error.status+" - "+error.statusText)})}})}}else{this.close(function(){$.albox.alert()})}}},call:function(){return this.settings.context}};$.albox=function(settings,mode){new Albox(settings,mode)};$.fn.Albox=function(settings,mode){settings=settings||{};$(this).on("click",function(event){event.preventDefault();settings.context=this;new Albox(settings,mode)})};$.albox.call=function(){if(Albox.stack.length){return Albox.instance.call()}};$.albox.position=function(callback){if(Albox.stack.length){return Albox.instance.position(callback)}};$.albox.parent=function(){if(Albox.stack.length){return Albox.stack[1]}};$.albox.close=function(){if(Albox.stack.length){return Albox.instance.close()}};$.albox.previous=function(){if(Albox.stack.length&&$(".lb-previous",Albox.instance.$content).length){Albox.instance.$content.find(".lb-previous").trigger("click")}};$.albox.next=function(){if(Albox.stack.length&&$(".lb-next",Albox.instance.$content).length){Albox.instance.$content.find(".lb-next").trigger("click")}};$.albox.title=function(title,subtitle){if(Albox.stack.length){return Albox.instance.title(title,subtitle)}};$.albox.alert=function(message,timeout,callback){timeout=typeof timeout==="undefined"?4:timeout;$.albox({content:message,close:false,afterLoad:function(){var settings=Albox.instance.settings,locale=settings.locale.alert;settings.content=settings.content||locale.notFound;if(timeout>0){var left=Math.max(1,timeout-1);settings.content+="<span>"+locale.close+" <span>"+left+" "+(left>1?locale.seconds.plural:locale.seconds.singular)+"</span>.</span>"}},afterShow:function(){if(timeout>0){var locale=Albox.instance.settings.locale.alert,change=$albox.find("span span"),timer=window.setInterval(function(){var num=parseInt(change.text(),10)-1;change.text(num+" "+(num>1?locale.seconds.plural:locale.seconds.singular))},1e3);window.setTimeout(function(){window.clearInterval(timer);$.albox.close()},(timeout-1)*1e3)}},afterClose:function(){if(typeof callback==="function"){callback()}}},"alert")};$(document).ready(function(){$("*[rel~=albox]").on("click",function(){$.albox({title:$(this).attr("title"),url:$(this).attr("href")});return false});$("*[rel*=albox-gallery], *[rel*=albox-image]").on("click",function(){var items=[];$($(this).attr("rel").search(/albox-gallery/i)!==-1?"*[rel^=albox-gallery]":this).each(function(){items.push({url:$(this).attr("src")||$(this).attr("href"),title:$(this).attr("title")||"",description:$(this).attr("rev")||"",zoom:$(this).attr("rel").search(/zoom/i)!==-1})});if(items.length===1){$.albox(items[0],"image")}else if(items.length>1){$.albox({items:items,current:$(this).index("*[rel^=albox-gallery]")},"image")}return false});$(window).on("focus",function(){if(Albox.stack.length){$(window).on("resize",function(){$.albox.position()})}});$(document).keypress(function(event){if(Albox.stack.length&&Albox.instance.settings.keyboard===true){if(event.keyCode===37){$.albox.previous()}else if(event.keyCode===39){$.albox.next()}else if(event.keyCode===27&&Albox.instance.settings.close===true){$.albox.close()}}})});window.Albox=Albox;if(typeof define==="function"&&define.amd&&define.amd.Albox){define("albox",[],function(){return Albox})}})(jQuery);
$(document).ready(function(){$.modal=function(settings,mode){$.albox(settings,mode)};$.modal.close=function(){$.albox.close()};$.modal.call=function(){$.albox.call()};$.modal.position=function(){$.albox.position()};$.modal.parent=function(){$.albox.parent()};$.modal.previous=function(){$.albox.previous()};$.modal.next=function(){$.albox.next()};$.modal.title=function(){$.albox.title()};$.modal.alert=function(message,timer,callback){$.albox.alert(message,timer,callback)};$.modal.close=function(){$.albox.close()};$.modal.content=function(){return Albox.instance.$content.find(".lb-content")};$.modal.button=function(name){return Albox.instance.settings.button[name]};$("[class*=modal] form").each(function(){var form=$(this);var button=$(this);form.find("[type=button]").click(function(){var button=$(this);button.button("loading");var params="";var target=$(form.attr("data-target"));if(form.attr("data-params")){var parameters=jQuery.parseJSON(form.attr("data-params"));params=parameters.value;for(key in parameters.fields){var field=$("#"+parameters.fields[key]);params[key]=field.val()}params=jQuery.param(params)+"&"}$.ajax({type:form.attr("method"),url:form.attr("action"),data:params+form.serialize()}).done(function(response){target.html(response)}).always(function(response){button.button("reset")})})});$("[data-toggle=modal]").click(function(event){var popup=$(this.getAttribute("data-target"));if(popup.find("form")){popup.find("form").attr("data-params",$(this).attr("data-params"))}})});
var cookieu=null;$(function(){var currentElt;$("#switch-univers li").hover(function(){currentElt=$(this).find("span:first-child").attr("class");if(!$(this).hasClass("active")){$(this).find("span:first-child").addClass(currentElt+"-hover")}},function(){if(!$(this).hasClass("active")){$(this).find("span:first-child").removeClass(currentElt+"-hover")}});var excludePages=/jackpot\/play.html|e3-le-jeu-concours-child-of-eden-2770/;var expireLayer=new Date;expireLayer.setDate(expireLayer.getDate()+365);var isMobile={Android:function(){return navigator.userAgent.match(/Android/i)},BlackBerry:function(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return navigator.userAgent.match(/IEMobile/i)},any:function(){return isMobile.Android()||isMobile.BlackBerry()||isMobile.iOS()||isMobile.Opera()||isMobile.Windows()}};if(!window.layerWasTest){layerWasTest=true;if(nbSuggest=getCookie("nfsuggestnl2")){if(nbSuggest!="stop"&&!excludePages.test(document.location)){document.cookie="nfsuggestnl2=stop; expires="+expireLayer.toGMTString()+"; path=/; domain=.jeuxvideo.fr";document.cookie="nfsuggestnl2=stop; expires="+expireLayer.toGMTString()+"; path=/; domain=.jeuxvideopc.com";secondTracker._trackPageview("/outgoing/layer_newsletter/show_layer")}}else{document.cookie="nfsuggestnl2=1; expires="+expireLayer.toGMTString()+"; path=/; domain=.jeuxvideo.fr";document.cookie="nfsuggestnl2=1; expires="+expireLayer.toGMTString()+"; path=/; domain=.jeuxvideopc.com"}}function showLayerNL(){showLayerNLv2()}function showLayerNLv2(){console.log("showLayerNLv2");if(typeof $.modal!=="undefined"){$.modal({url:"/api/membre/facebox.newsletter_suggest_ajax.php",close:false,skin:"layer_suggestions"})}else{$.facebox({url:"/api/membre/facebox.newsletter_suggest_ajax.php",close:false,skin:"layer_suggestions"})}}var cookieuHtml="<p>";cookieuHtml+="<img class='info' src='"+Cookieu.icons.info+"'/>";cookieuHtml+="<a class='close' onclick='cookieu.confirmUsage()'><img src='"+Cookieu.icons.close+"'/></a>";cookieuHtml+="En poursuivant votre navigation sur nos sites, vous acceptez l'installation et l'utilisation de cookies sur votre poste, notamment &agrave; des fins promotionnelles et/ou publicitaires, dans le respect de notre politique de <a onclick='window.open(\"http://www.clubic.com/api/politique-de-confidentialite.pdf\");cookieu.confirmUsage()' target='_blank'>protection de votre vie priv&eacutee</a>.";cookieuHtml+="</p>";cookieu=new Cookieu({html:cookieuHtml,onHide:function(){if(resizeAdsColsTop&&resizeAdsColsTop!="undefined"){resizeAdsColsTop()}}});var menuPattern={pc:{url_pattern:"/jeux/(?!.*?soluce).*",host_pattern:".*.jeuxvideopc.com",univers:"pc"},console:{url_pattern:"/jeux/(?!.*?soluce).*",host_pattern:".*.jeuxvideo.fr",univers:"consoles"},video:{url_pattern:"/video.*",univers:"videos"},soluces:{url_pattern:"/solutions.*",univers:"soluces"}};for(var key in menuPattern){var obj=menuPattern[key];if(window.location.pathname.search(new RegExp(obj.url_pattern))!==-1&&window.location.host.search(new RegExp(obj.host_pattern))!==-1){$("#switch-univers > *").removeClass("active");$("#switch-univers").find("."+obj.univers).addClass("active");$("#switch-univers").find(".jvfr-picto-univers-"+obj.univers).addClass("jvfr-picto-univers-"+obj.univers+"-hover")}}if($(".OUTBRAIN").length>0){var ob=document.createElement("script");ob.type="text/javascript";ob.async=true;ob.src="http://widgets.outbrain.com/outbrainLT.js";var h=document.getElementsByTagName("script")[0];h.parentNode.insertBefore(ob,h)}function checkAdBlock(log){log=typeof log!=="undefined"?log:true;if(typeof jvfrpccomtotolilolraoul=="undefined"){if(log){logError("http://mon.m6web.fr/statsd/service.site_jeuxvideo.adblocker.adblocker/increment?token=ddde992a742c3eadb91b18f667457e73")}return true}else{if(log){logError("http://mon.m6web.fr/statsd/service.site_jeuxvideo.adblocker.noadblocker/increment?token=ad389de34ef7ab9b0e950b4993eb4cb1")}return false}}function logError(url){var pix=document.createElement("img");pix.src=url}checkAdBlock()});
(function(d,w){"use strict";var M6=w.M6||{};M6.CommentsBox={id:null,config:{version:1,node:"livefyre-comments",url:null,title:null,tags:{},sample:100,track:["comments","$type","$id"],close:false,login:"/api/membre/facebox.login.php",notif:"/api/membre/livefyre.notif.php",ranks:{administrateur:"#D90",animateur:"#090",testeur:"#A513A5","Rédacteur":"#C00","modérateur":"#1580E4","Invité":"#A513A5"},callbacks:{init:function(){},loggedin:function(){},posted:function(){},flagged:function(){},liked:function(){},shared:function(){},social:function(){}},domains:{clubic:{visible:10,profileUrl:"http://www.clubic.com/profil/actualite.html",stats:{preload:"7d390d74926923abe3b681462e6322d0",loaded:"7de395ffdeaeddce26e9e7d5168b3a60",posted:"fa2b25d8dfcbf922f4754e90e31afd39"},customLogin:function(){$(window).trigger("auth.signin")},loginEvent:"auth.login",logoutEvent:"auth.logout"},deco:{visible:10,profileUrl:"/forum-deco/profil/mon-compte.html",stats:{preload:"17f5a82275bf808a13527d2cf824bf73",loaded:"cca6b6fad056f234057dbc21fd7b4e00",posted:"6243b159f616672c2fad55a025f639c0"}},jeuxvideo:{visible:5,profileUrl:"http://www.jeuxvideo.fr/forum/profil/mon-compte.html",stats:{preload:"d1c0333bcd458273df7a79d30f48d193",loaded:"522bbb5062b005995e2f12c0af1ab302",posted:"abe591d568ac6481fa98e7a916e7a9ec"}},turbo:{visible:10,profileUrl:"/forum-auto/profil/mon-compte.html",stats:{preload:"dc322963aa619925bebbf3130f5bc754",loaded:"de38b1e93d88167c8f1af3f6f5f7b704",posted:"3754376d73d3ddc6c122d243b36dd3da"}}},locale:{archiveHeaderTitle:"Archives",archiveShowMore:"Montrer plus de commentaires",banCancelButton:"Annuler",banConfirmation:"Etes vous certain de vouloir bannir cet utilisateur ?",banConfirmationButton:"OK",banTitle:"Bannir l'utilisateur",banUserButton:"Bannir l'utilisateur",bozoButton:"Bozo",commentCountLabel:"%s commentaire",commentCountLabelPlural:"%s commentaires",commentNotifier:"Nouveau commentaire",commentNotifierPlural:"Nouveaux commentaires",commentTombstone:"Ce commentaire a été effacé.",copyright:"Powered by LiveFyre",deleteButton:"Supprimer",deleteCommentTooltip:"Supprimer",displayName:"%s",displayNameGuest:"%s <em>(invité)</em>",editButton:"Editer",editProfile:"Editer le profil",editorDisabled:"Cette conversation est actuellement fermée.",errorAuthError:"Vous n'êtes pas autorisé à commenter cette discussion",errorCommentsNotAllowed:"Les commentaires ne sont pas autorisés sur ce sujet",errorDefault:"Une erreur est survenue. Merci de reessayer.",errorDuplicate:"Vous n'êtes pas autorisé à reposter le même commentaire.",errorEditDuplicate:"Vous devez modifier le corps de votre commentaire lors de votre édition.",errorEditNotAllowed:"Vous n'êtes pas autorisé à éditer les commentaires sur ce sujet",errorEditTimeExceeded:"Désolé, le temps autorisé pour l'édition a expiré.",errorEmpty:"Il semblerait que vous essayez de poster un commentaire vide.",errorExpired:"Votre session a expiré. Merci de recharger la page.",errorFlagNotSelected:"Please select a flag type",errorGuestLiked:"Sorry, only those with accounts can like content.",errorInsufficientPermissions:"Permissions insuffisantes",errorInvalidChar:"Il semble que votre commentaire contient un caractère non autorisé.",errorLikeOwnComment:"Vous ne pouvez pas aimer votre propre commentaire.",errorMalformed:"l semble que votre commentaire soit mal formaté.",errorMaxChars:"Désolé, votre commentaire est trop long. Merci d'éditer puis de retenter la publication.",errorShowMore:"Il y a eu une erreur lors du chargement des commentaires.",featureButton:"+ MEA",featureCommentTooltip:"Mettre en avant",featuredCommentTooltip:"Ne plus mettre en avant",featuredCommentsPost:"Comment",featuredCommentsTag:"mis en avant",featuredCommentsTitle:"Featured Comments",featuredCommentsTitlePlural:"Commentaires mis en avant",flagButton:"Bouton de signalement",flagCancelButton:"Annuler",flagConfirmButton:"OK",flagDisagree:"Message biaisé/faux",flagDisagreeButton:"Message biaisé/faux",flagEmail:"Email",flagEmailPlaceholder:"vous@exemple.com",flagNotes:"Notes",flagNotesPlaceholder:"Commencez à écrire ici...",flagOffTopic:"Hors sujet",flagOffensive:"Offensant",flagOffensiveButton:"Offensant",flagOfftopicButton:"Hors sujet",flagSpam:"Spam",flagSpamButton:"Spam",flagSubtitle:"Signaler en tant que",flagSuccessMsg:"Le commentaire a été signalé",flagTitle:"Signaler",follow:"+ S'abonner",hotThreadsContentNotFoundMsg:"Il n'y a pas assez de sujets pour le moment",hovercardViewProfile:"Voir le profil complet",likeButton:"J'aime",listenerCount:"suit la conversation",listenerCountPlural:"suivent la conversation",liveblogFollow:"+ S'abonner",liveblogNotifier:"Nouveau message",liveblogNotifierPlural:"Nouveaux messages",liveblogPostCountLabel:"message",liveblogPostCountLabelPlural:"messages",liveblogUnfollow:"+ Se désabonner",livechatOtherInstruction:"",livechatPostEditButton:"Editer",livechatPostButtonLabel:"Poster",livechatWindowsInstruction:"",loadingPermalink:"Chargement de l'url courte...",mentionCancelButton:"Annuler",mentionConfirmButton:"OK",mentionDefaultText:"Je t'ai mentionné dans un commentaire !",mentionErrorGeneral:"Oops ! Quelques chose ne s'est pas bien passé. Une alerte a été envoyé.",mentionErrorNoneSelected:"Vous devez avoir au moins une mention activée.",mentionMenuTitle:"Pour voir et mentionner vos amis",mentionSubtitleFacebook:"Partager le message sur compte Facebook de :",mentionSubtitleTwitter:"Partager le message sur compte Twitter de :",mentionSuccessMsg:"Les mentions ont été correctement envoyées.",mentionTitle:"Partager le message avec un ami",moderator:"modérateur",moderatorEditTimeStamp:"Edité par un modérateur",MultipleMediaNotAllowedError:"Vous ne pouvez joindre qu'un media à la fois",newComment:"Nouveau commentaire",newComments:"Nouveaux commentaires",newReplies:"nouvelles réponses",newReply:"nouvelle réponse",notificationMenu:"Notifications",notificationTitle:"Gestion des notifications emails",pendingComment:"en attente",permalinkHeader:"Partagé",permalinkHeaderDeleted:"Ce commentaire n'est plus visibile",permaLinkNotFoundMsg:"Ce commentaire n'est plus visibile",postAsButton:"Publier le commentaire en tant que...",postButton:"Publier le commentaire",postEditButton:"Editer le commentaire",postEditCancelButton:"Annuler",postReplyButton:"Répondre au commentaire",postReplyAsButton:"Répondre au commentaire en tant que...",quickProfileTooltip:"Profil rapide",refresh:"Rafraîchissement",replyButton:"Répondre",replyButtonSingular:"Répondre",replyButtonPlural:"Répondre",shareButton:"Partager",shareButtonText:"Partager",shareCommentTooltip:"Partager le commentaire",shareDefaultText:"Regardez le message !",shareLabel:"Partager sur :",sharePermalink:"Lien",shareTitle:"Partager le commentaire",showMore:"Montrer plus de commentaires",signIn:"Se connecter",signOut:"Se déconnecter",siteAdmin:"Site Admin",sortBackButton:"Retour aux top commentaires",sortHotThreads:"Top Commentaires",sortNewest:"Les plus récents",sortOldest:"Les plus anciens",sortSeparator:" | ",sortTopComments:"Top Commentaires",streamSorting:"Chargement",streamRefreshMsg:"Rafraîchir",threadBreakoutButton:"Montrer l'ensemble du fil de discussion",timeAgo:"Il y a",timeInDays:"dans %s jour",timeInDaysPlural:"dans %s jours",timeInHours:"dans %s heure",timeInHoursPlural:"dans %s heures",timeInMinutes:"dans %s minute",timeInMinutesPlural:"dans %s minutes",timeJustNow:"A l'instant",timeDaysAgo:"jour",timeDaysAgoPlural:"jours",timeHoursAgo:"heure",timeHoursAgoPlural:"heures",timeMinutesAgo:"minute",timeMinutesAgoPlural:"minutes",topCommentsContentNotFoundMsg:"Il n'y a pas asser de \"j'aime\" pour le moment",topContentRefreshMsg:"Regardez ce qui est nouveau",unfeaturedButton:"- MEA",unfollow:"- Se désabonner",unlikeButton:"Je n'aime plus"}},cssFix:function(){setTimeout(function(){if(null===d.getElementById(M6.CommentsBox.config.node).querySelector("#fyre-copyrights")){var copyright=d.createElement("a");copyright.id="fyre-copyrights";copyright.href="http://web.livefyre.com/";copyright.style.cssText="color:#404040;display:block;text-align:right;background:url(http://zor.t402.livefyre.com/wjs/v3.0/images/editor/sprites.png) no-repeat 100% -439px;padding:5px 40px 5px 0";copyright.innerHTML=M6.CommentsBox.config.locale.copyright;d.getElementById(M6.CommentsBox.config.node).appendChild(copyright);d.getElementById(M6.CommentsBox.config.node).querySelector(".fyre-help").style.display="none"}var levels=d.getElementById(M6.CommentsBox.config.node).querySelectorAll(".fyre-user-level");if(null!==levels){for(var k in levels){if(true===levels.hasOwnProperty(k)&&"object"===typeof levels[k]){levels[k].style.display="none"}}}if("object"===typeof M6.CommentsBox.config.ranks){for(var i in M6.CommentsBox.config.ranks){if(true===M6.CommentsBox.config.ranks.hasOwnProperty(i)){var els=d.getElementById(M6.CommentsBox.config.node).querySelectorAll('[data-fyre-author-tag="'+i+'"]');if(null!==els){for(var j in els){if(true===els.hasOwnProperty(j)&&"object"===typeof els[j]){els[j].style.cssText="background-color:"+M6.CommentsBox.config.ranks[i]+";display:inline"}}}}}}var articles=d.getElementById(M6.CommentsBox.config.node).querySelectorAll(".fyre-comment-article");if(null!==articles){for(var l in articles){if(true===articles.hasOwnProperty(l)&&"object"===typeof articles[l]){articles[l].style.display="block"}}}if("function"===typeof w.$){w.$(M6.CommentsBox.config.node+" .fyre-share-button").css("width","auto");w.$(M6.CommentsBox.config.node+" .fyre-share-button div.fyre-button-right-inner-box").css("background-position","90% 50%");w.$(M6.CommentsBox.config.node+".fyre .fyre-comment-stream .fyre-comment-footer").css({width:"auto",display:"block",margin:"0 0 7px 61px"})}},1e3)},host:function(){var split=w.location.hostname.replace("jeuxvideopc.com","jeuxvideo.fr").split(".").slice(-2);return{name:split[0],domain:split.join(".")}},encodeString:function(content){content=(content+"").toString();return w.encodeURIComponent(w.decodeURIComponent(content.replace(/%(?![\da-f]{2})/gi,function(){return"%25"}).replace(/\+/g,"%20"))).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")},dispatch:function(route){var routes={meta:"conversations/{id}/meta",sso:"users/{userid}/sso"},baseUrl=w.location.protocol+"//";if("string"!==typeof routes[route]){throw new ReferenceError('M6.CommentsBox.dispatch: Route "'+route+'" does not exist')}if(-1!==w.location.host.search(".dev.")){baseUrl+=w.location.host.split(".",2).join(".")+"."}else if(-1!==w.location.host.search(/recette|preprod/)){baseUrl+="preprod."}routes[route]=routes[route].replace("{id}",M6.CommentsBox.id);routes[route]=routes[route].replace("{userid}",null!==d.cookie.match("nfuserid")?d.cookie.match(/nfuserid=(\d+)/i)[1]:"");return baseUrl+="comments."+M6.CommentsBox.host().domain+"/v"+w.parseInt(M6.CommentsBox.config.version,10)+"/"+routes[route]},stats:function(route){if(true===M6.CommentsBox.config.sample){var domain=M6.CommentsBox.host().name,node="service.comments."+domain+"."+route;if("undefined"!==typeof M6.CommentsBox.config.domains[domain].stats&&"string"===typeof M6.CommentsBox.config.domains[domain].stats[route]){var statsImg=new Image;statsImg.src="http://mon.m6web.fr/statsd/"+node+"/increment?token="+M6.CommentsBox.config.domains[domain].stats[route]}else{throw new Error("M6.CommentsBox.stats: Stats token or route are not valid")}}},cors:function(method,url,parameters,success,error){method="string"===typeof method&&"POST"===method?"POST":"GET";if("undefined"!==typeof w.XMLHttpRequest||"undefined"!==typeof w.XDomainRequest){var xhr="undefined"!==typeof w.XDomainRequest?w.XDomainRequest():new w.XMLHttpRequest,datas=[];xhr.open(method,url,true);if(-1!==w.location.host.search(/\.dev\./i)){xhr.withCredentials=true}if("object"===typeof parameters&&null!==parameters){for(var i in parameters){if(true===parameters.hasOwnProperty(i)){if("object"===typeof parameters[i]){for(var j in parameters[i]){if(true===parameters[i].hasOwnProperty(j)){datas.push(M6.CommentsBox.encodeString(i)+"["+M6.CommentsBox.encodeString(j)+"]="+M6.CommentsBox.encodeString(parameters[i][j]))}}}else{datas.push(M6.CommentsBox.encodeString(i)+"="+M6.CommentsBox.encodeString(parameters[i]))}}}datas=datas.join("&");if("function"===typeof xhr.setRequestHeader){xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded")}}if("undefined"!==typeof w.XDomainRequest){xhr.onload=function(){if("function"===typeof success){success({responseText:xhr.responseText})}}}else{xhr.onreadystatechange=function(){if(4===xhr.readyState&&(200==xhr.status||204==xhr.status||1223==xhr.status)){if("function"===typeof success){success(xhr)}}if(4===xhr.readyState&&400<=xhr.status&&500>xhr.status){if("function"===typeof error){error(xhr)}}}}xhr.onerror=function(){if("function"===typeof success){success(xhr)}throw new ReferenceError("M6.CommentsBox.post: Error during XHR call")};xhr.send(0<datas.length?datas:null)}else{throw new Error("M6.CommentsBox.post: Unable to do XMLHttpRequest, please update your browser")}},tracking:function(action){if("object"===typeof M6.CommentsBox.config.tags&&null!==M6.CommentsBox.config.tags){var track=M6.CommentsBox.config.track;if("object"===typeof track&&3===track.length){for(var k in track){if(true===track.hasOwnProperty(k)){if("$"===track[k][0]){if("undefined"!==typeof M6.CommentsBox.config.tags[track[k].substr(1)]){track[k]=M6.CommentsBox.config.tags[track[k].substr(1)].toString()}else{track[k]="null"}}}}if("comments"!==track[0]&&"post"===action){action="comments"}if("object"===typeof w._gaq&&-1!==w._gaq._getAsyncTracker()._getAccount().search(/UA-\d+-\d+/)){w._gaq.push(["secondTracker._trackEvent",track[0],action,track[1],track[2]])}else if("object"===typeof w.secondTracker){w.secondTracker._trackEvent(track[0],action,track[1],track[2])}else if("object"===typeof w.gaGlobal){throw new Error("M6.CommentsBox.tracking: Google Analytics Tracker (eg.: secondTracker) not found")}}else{throw new Error("M6.CommentsBox.tracking: Invalid track configuration")}}else{throw new Error("M6.CommentsBox.tracking: Unable to find tags")}},init:function(id,settings){settings=settings||{};if("string"!==typeof id||-1===id.search(/^[0-9a-f]{32}$/i)){throw new Error("M6.CommentsBox.init: ID have invalid MD5 format")}M6.CommentsBox.id=id;if(undefined!==settings&&"object"!==typeof settings){throw new Error("M6.CommentsBox.init: Settings is not an object")}for(var j in settings){if(true===M6.CommentsBox.config.hasOwnProperty(j)){M6.CommentsBox.config[j]=settings[j]}}if(null===d.getElementById(M6.CommentsBox.config.node)){throw new ReferenceError("M6.CommentsBox.init: Container Node ID not defined")}if("number"===typeof M6.CommentsBox.config.sample){M6.CommentsBox.config.sample=Math.floor(Math.random()*10)<=w.parseFloat(w.parseFloat(M6.CommentsBox.config.sample/10).toFixed(2))}var loading=d.createElement("div");loading.id="loadingLF";loading.style.cssText="text-align:center;color:#DDD;font-weight:bold;font-size:18px;padding:20px 0";loading.innerHTML=M6.CommentsBox.config.locale.streamSorting+"...";d.getElementById(M6.CommentsBox.config.node).appendChild(loading);var script=d.createElement("script");script.type="text/javascript";script.src="http://zor."+(-1!==w.location.host.search(/\.dev\.|recette|preprod/i)?"t402.livefyre.com":"fyre.co")+"/wjs/v3.0/javascripts/livefyre.js";script.onload=script.onreadystatechange=function(){if(!this.readyState||"loaded"===this||"loaded"===this.readyState||"complete"===this.readyState){M6.CommentsBox.stats("preload");M6.CommentsBox.meta();d.onload=d.onreadystatechange=null}};d.getElementsByTagName("head")[0].appendChild(script)},login:function(modal){var domain=M6.CommentsBox.host().name;if(-1!==d.cookie.search(/livefyre-token/i)&&-1===d.cookie.search(/nfpassword/i)){d.cookie="livefyre-token=;domain=."+M6.CommentsBox.host()+";expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/;"}if(-1!==d.cookie.search(/livefyre-token/i)){w.fyre.conv.login(d.cookie.match(/livefyre-token=([^;]+)/i)[1])}else{var userCookies=d.cookie.match(/nf(userid|password)/g);if(null!==userCookies&&2===userCookies.length){M6.CommentsBox.cors("POST",M6.CommentsBox.dispatch("sso"),{_username:d.cookie.match(/nfusername=([^;]+);?/i)[1],_password:d.cookie.match(/nfpassword=([a-z0-9]{32})/i)[1]},function(xhr){try{var token=JSON.parse(xhr.responseText).token,expire=new Date((new Date).setHours((new Date).getHours()+1)).toUTCString();d.cookie="livefyre-token="+token+";domain=."+M6.CommentsBox.host()+";expires="+expire+";path=/;";w.fyre.conv.login(token)}catch(e){throw new Error("M6.CommentsBox.login: Unable to log user (response: "+xhr.responseText+")")}})}else if(true===modal){if(-1!==w.location.hostname.search(/mobile\./gi)){w.location.href="/connection.php"}else{if("function"===typeof M6.CommentsBox.config.domains[domain].customLogin){M6.CommentsBox.config.domains[domain].customLogin()}else{if("function"===typeof w.$){if("function"===typeof w.$.modal){w.$.modal({title:M6.CommentsBox.config.locale.signIn,url:M6.CommentsBox.config.login})}else if("function"===typeof w.$.facebox){w.$.facebox({titre:M6.CommentsBox.config.locale.signIn,url:M6.CommentsBox.config.login})}else{throw new ReferenceError("M6.CommentsBox.login: $.modal or $.facebox are not defined")}}else{throw new ReferenceError("M6.CommentsBox.login: $ (or jQuery) is not defined")}}}}}},meta:function(){M6.CommentsBox.cors("GET",M6.CommentsBox.dispatch("meta"),null,function(xhr){try{M6.CommentsBox.display(JSON.parse(xhr.responseText))}catch(e){throw new Error("M6.CommentsBox.meta: Unable to decode meta informations (response: "+xhr.responseText+")")}},function(){M6.CommentsBox.cors("POST",M6.CommentsBox.dispatch("meta"),{url:M6.CommentsBox.config.url||w.location.href,title:M6.CommentsBox.config.title||d.title,tags:M6.CommentsBox.config.tags},function(xhr){try{M6.CommentsBox.display(JSON.parse(xhr.responseText))}catch(e){throw new Error("M6.CommentsBox.meta: Unable to decode meta informations (response: "+xhr.responseText+")")}},function(xhr){throw new ReferenceError("M6.CommentsBox.meta: Can't post meta data (Status: "+xhr.status+")")})})},display:function(meta){var domain=M6.CommentsBox.host().name;try{meta.el=M6.CommentsBox.config.node;meta.initialNumVisible=Math.min(50,Math.max(0,parseInt(M6.CommentsBox.config.domains[M6.CommentsBox.host().name].visible,10)));meta.readOnly=!!M6.CommentsBox.config.close;meta.datetimeFormat=function(time){var offset=Math.floor(((new Date).getTime()-new Date(time).getTime())/1e3),value=0;switch(true){case offset<60:return M6.CommentsBox.config.locale.timeJustNow;case offset<3600:value=Math.floor(offset/60);return M6.CommentsBox.config.locale.timeAgo+" "+value+" "+M6.CommentsBox.config.locale["timeMinutesAgo"+(value>1?"Plural":"")];case offset<86400:value=Math.floor(offset/3600);return M6.CommentsBox.config.locale.timeAgo+" "+value+" "+M6.CommentsBox.config.locale["timeHoursAgo"+(value>1?"Plural":"")];case offset<2592e3:value=Math.floor(offset/86400);return M6.CommentsBox.config.locale.timeAgo+" "+value+" "+M6.CommentsBox.config.locale["timeDaysAgo"+(value>1?"Plural":"")];default:return new Date(time).toLocaleString().replace(/^(\d{1})\//,"0$1/").replace(/\/(\d{1})\//,"/0$1/")}};var authDelegate=new w.fyre.conv.RemoteAuthDelegate;authDelegate.login=function(handler){M6.CommentsBox.login(true);handler.success()};authDelegate.logout=function(){if("clubic"===M6.CommentsBox.host().name){w.$("#user_barre li.deconnect").trigger("click")}else{if("function"===typeof w.$){if(M6.CommentsBox.config.domains[domain].logoutEvent){w.$(window).trigger(M6.CommentsBox.config.domains[domain].logoutEvent)}else{w.$(window).trigger("user.loggedOut")}}}};authDelegate.viewProfile=function(handler,author){if("string"===typeof author.profileUrl&&0===author.profileUrl.search(/https?:\/\//i)){w.location.href=author.profileUrl}handler.success()};authDelegate.editProfile=function(handler,author){if("string"===typeof author.settingsUrl&&0===author.settingsUrl.search(/https?:\/\//i)){w.location.href=author.settingsUrl}else{var profileUrl=M6.CommentsBox.config.domains[M6.CommentsBox.host().name].profileUrl;if("string"===typeof profileUrl){w.location.href=profileUrl}}handler.success()};d.getElementById(M6.CommentsBox.config.node).innerHTML="";if("function"===typeof w.$){if(M6.CommentsBox.config.domains[domain].loginEvent){w.$(window).bind(M6.CommentsBox.config.domains[domain].loginEvent,function(){M6.CommentsBox.login()})}else{w.$(window).bind("user.loggedIn",function(){M6.CommentsBox.login()})}}w.fyre.conv.load({network:meta.network,strings:M6.CommentsBox.config.locale,authDelegate:authDelegate},[meta],function(instance){instance.on("initialRenderComplete",function(){if(null!==d.getElementById(M6.CommentsBox.config.node).querySelector("#loadingLF")){d.getElementById(M6.CommentsBox.config.node).querySelector("#loadingLF").parentNode.removeChild(d.getElementById.querySelector("#loadingLF"))}if(null!==d.getElementById(M6.CommentsBox.config.node).querySelector("#mobileLF")){d.getElementById(M6.CommentsBox.config.node).querySelector("#mobileLF").parentNode.removeChild(d.getElementById.querySelector("#mobileLF"))}M6.CommentsBox.login();M6.CommentsBox.cssFix();M6.CommentsBox.stats("loaded");if(null!==d.querySelector("#"+M6.CommentsBox.config.node+" .fyre-stream-more")){d.querySelector("#"+M6.CommentsBox.config.node+" .fyre-stream-more").onclick=function(){setTimeout(function(){M6.CommentsBox.cssFix()},1e3)}}if("function"===typeof w.$){setTimeout(function(){w.$("#"+M6.CommentsBox.config.node+" .fyre-box-list").on("click",".fyre-notif-link a",function(){if("function"===typeof w.$.modal){w.$.modal({title:M6.CommentsBox.config.locale.notificationTitle,url:M6.CommentsBox.config.notif,width:"540px"})}else if("function"===typeof w.$.facebox){w.$.facebox({titre:M6.CommentsBox.config.locale.notificationTitle,url:M6.CommentsBox.config.notif,width:"540px"})}});w.$("#"+M6.CommentsBox.config.node+" .fyre-auth .fyre-box-list").prepend("<li class='fyre-notif-link'><a>"+M6.CommentsBox.config.locale.notificationMenu+"</a></li>");if(w.$("#"+M6.CommentsBox.config.node+" .fyre-box-list .fyre-admin-link").length){var url="http://admin."+meta.network+"/v3/site/"+meta.siteId+"/content?"+"q=*&conv_id="+instance.getCollection().attributes.id+"&max=all&order=created";w.$("#"+M6.CommentsBox.config.node+" .fyre-box-list .fyre-admin-link a").attr("href",url)}},1e3)}if("function"===typeof M6.CommentsBox.config.callbacks.init){M6.CommentsBox.config.callbacks.init(instance)}});instance.on("userLoggedIn",function(data){M6.CommentsBox.tracking("login");d.getElementById(M6.CommentsBox.config.node).className+=" loggedin";if("function"===typeof M6.CommentsBox.config.callbacks.loggedin){M6.CommentsBox.config.callbacks.loggedin(data,instance)}});instance.on("commentPosted",function(data){M6.CommentsBox.tracking("post");M6.CommentsBox.stats("posted");M6.CommentsBox.cssFix();if("function"===typeof M6.CommentsBox.config.callbacks.posted){M6.CommentsBox.config.callbacks.posted(data,instance)}});instance.on("commentFlagged",function(data){M6.CommentsBox.tracking("flag");if("function"===typeof M6.CommentsBox.config.callbacks.flagged){M6.CommentsBox.config.callbacks.flagged(data,instance)}});instance.on("commentLiked",function(data){M6.CommentsBox.tracking("like");if("function"===typeof M6.CommentsBox.config.callbacks.liked){M6.CommentsBox.config.callbacks.like(data,instance)}});instance.on("commentShared",function(data){if("function"===typeof M6.CommentsBox.config.callbacks.shared){M6.CommentsBox.config.callbacks.share(data,instance)}});instance.on("socialMention",function(data){if("function"===typeof M6.CommentsBox.config.callbacks.social){M6.CommentsBox.config.callbacks.social(data,instance)}})})}catch(xhr){throw new Error("M6.CommentsBox.init: Unable to get meta informations (response: "+xhr.responseText+")")}}};w.M6=M6})(document,window);
var console=console||{time:function(marker){},timeEnd:function(marker){},trace:function(){},inject:function(object){},profile:function(){},profileEnd:function(){},profiles:function(){},memory:function(){},markTimeline:function(){},group:function(){},groupCollapsed:function(){},groupEnd:function(){},dir:function(){},dirXml:function(){},count:function(){},assert:function(){},debug:function(message){},log:function(message){},info:function(message){},warn:function(message){},error:function(message){}};(function(){var M6=M6||{Console:{debugConfig:false,group:function(message,type){if(M6.Console.debugConfig){if(console.group){type=type||"";console.group(message,type)}else{M6.Console.log(message,type)}}},groupCollapsed:function(message,type){if(M6.Console.debugConfig){if(console.groupCollapsed){type=type||"";console.groupCollapsed(message,type)}else{M6.Console.log(message,type)}}},groupEnd:function(message,type){if(M6.Console.debugConfig){if(console.groupEnd){console.groupEnd(message,type)}}},debug:function(message,type){if(M6.Console.debugConfig){if(console.debug){type=type||"";console.debug(message,type)}}},log:function(message,type){if(M6.Console.debugConfig){type=type||"";console.log(message,type)}},info:function(message,type){if(M6.Console.debugConfig){type=type||"";console.info(message,type)}},warn:function(message,type,trace){if(M6.Console.debugConfig){type=type||"";console.warn(message,type);if(trace){console.trace()}}},error:function(message,type){if(M6.Console.debugConfig){type=type||"";console.error(message,type);console.trace()}}}};M6.Events={manager:null,eventsFired:[],eventsFiredInfos:[],fireEvent:function(ev,args){M6.Console.warn("M6.Events: firevent "+ev,"M6.Events");var eventInfos,eventFiredIndex,loopLenOverFiredEvents=M6.Events.eventsFiredInfos.length,loopLenOverListeners;if(!M6.Events.eventsFired.inArray(ev)){eventInfos={name:ev,count:1,args:args,listenerCalled:0}}else{for(var i=0;i<loopLenOverFiredEvents;i++){if(M6.Events.eventsFiredInfos[i].name===ev){eventFiredIndex=i;eventInfos=M6.Events.eventsFiredInfos[eventFiredIndex];eventInfos.count++;i=M6.Events.eventsFiredInfos.length}}}if(!!this.listeners[ev]){M6.Console.warn("M6.Events: firevent "+ev+" listeners found","M6.Events");loopLenOverListeners=this.listeners[ev].length;for(var i=0;i<loopLenOverListeners;i++){if(this.listeners[ev][i]!=="undefined"&&this.listeners[ev][i]){try{if(!!args){this.listeners[ev][i].apply(window,args)}else{this.listeners[ev][i].call(window)}}catch(e){M6.Console.error(e)}eventInfos.listenerCalled++}}}if(eventInfos){if(!eventFiredIndex){M6.Events.eventsFired.push(ev);M6.Events.eventsFiredInfos.push(eventInfos)}else{M6.Events.eventsFiredInfos[eventFiredIndex]=eventInfos}}},enable:function(){var self=this;if(!self.listeners){self.listeners={}}self.fireEvent=function(ev,args){M6.Events.fireEvent.call(self,ev,args)};self.addListener=function(ev,fn){M6.Events.addListener.call(self,ev,fn)};self.removeListener=function(ev,fn){M6.Events.removeListener.call(self,ev,fn)}},addListener:function(ev,fn){M6.Events.enable.call(this,ev);var list=this.listeners[ev]||[],loopLen=list.length;M6.Console.warn("M6.Events: addListener "+ev,"M6.Events");if(fn instanceof Function){var exists=false;for(var i=0;i<loopLen;i++){if(list[i]===fn){exists=true}}if(false===exists){list.push(fn)}}this.listeners[ev]=list},removeListener:function(ev,fn){M6.Console.warn("M6.Events: removeListener "+ev,"M6.Events");if(!!this.listeners[ev]&&this.listeners[ev].length>0){if(!!fn){var fns=[],loopLen=this.listeners[ev].length;for(var i=0;i<loopLen;i++){if(fn!=this.listeners[ev][i]){fns.push(this.listeners[ev][i])}}this.listeners[ev]=fns}else{this.listeners[ev]=[]}}}};M6.Tools=M6.Tools||{};M6.Tools.checkScriptLoaded=function(jsEl,callback){M6.Console.groupCollapsed("M6.Tools.checkScriptLoaded init for "+jsEl.src,"DOM");if(window.attachEvent){jsEl.onreadystatechange=function funcOnReadyStateChange(){M6.Console.groupCollapsed("M6.Tools.checkScriptLoaded funcOnReadyStateChange","DOM");if(jsEl.readyState=="complete"){jsEl.onreadystatechange="";M6.Console.info("jsEl complete: "+jsEl.src,"DOM")}else if(jsEl.readyState=="loaded"){jsEl.onreadystatechange="";M6.Console.info("jsEl loaded: "+jsEl.src,"DOM")}if(typeof callback==="function"){callback()}M6.Console.groupEnd()}}else{jsEl.onload=function funcOnLoad(){M6.Console.groupCollapsed("M6.Tools.checkScriptLoaded funcOnLoad","DOM");M6.Console.info("jsEl onload: "+jsEl.src,"DOM");if(typeof callback==="function"){callback()}M6.Console.groupEnd()}}M6.Console.groupEnd()};M6.Tools.addOtherAttributes=M6.Tools.addOtherAttributes||function(myEl,params,prefix){M6.Console.groupCollapsed("M6.Tools.addOtherAttributes","DOM");if(Object.prototype.toString.call(params)==="[object Array]"&&params.length>0||Object.prototype.toString.call(params)==="[object Object]"){var mode=Object.prototype.toString.call(params)==="[object Object]"?"array":"object",paramsKey;for(paramsKey in params){if(params.hasOwnProperty(paramsKey)){if(mode=="array"){var value=params[paramsKey]}else{var value=params.paramsKey}var attName=prefix===undefined?paramsKey:prefix+paramsKey;M6.Console.info(attName+": "+value,"DOM");myEl.setAttribute(attName,value)}}}M6.Console.info(myEl,"DOM");M6.Console.groupEnd()};M6.Tools.setPrototypes=function(mode){M6.social.twitter.tweet.prototype.addOtherAttributes=M6.Tools.addOtherAttributes;M6.social.twitter.followme.prototype.addOtherAttributes=M6.Tools.addOtherAttributes;if(mode!=="gi"){M6.social.twitter.timeline.prototype.addOtherAttributes=M6.Tools.addOtherAttributes}M6.social.google.plusOne.prototype.addOtherAttributes=M6.Tools.addOtherAttributes;M6.social.google.badge.prototype.addOtherAttributes=M6.Tools.addOtherAttributes;M6.social.pinterest.pinIt.prototype.addOtherAttributes=M6.Tools.addOtherAttributes;if(mode!=="gi"){M6.social.pinterest.follow.prototype.addOtherAttributes=M6.Tools.addOtherAttributes}M6.social.facebook.like.prototype.addOtherAttributes=M6.Tools.addOtherAttributes;M6.social.facebook.likeBox.prototype.addOtherAttributes=M6.Tools.addOtherAttributes;M6.social.facebook.recommendationsBar.prototype.addOtherAttributes=M6.Tools.addOtherAttributes;if(mode!=="gi"){M6.social.facebook.recommendationsBox.prototype.addOtherAttributes=M6.Tools.addOtherAttributes;M6.social.facebook.activityFeed.prototype.addOtherAttributes=M6.Tools.addOtherAttributes;M6.social.facebook.subscribe.prototype.addOtherAttributes=M6.Tools.addOtherAttributes;M6.social.facebook.login.prototype.addOtherAttributes=M6.Tools.addOtherAttributes}M6.social.linkedin.share.prototype.addOtherAttributes=M6.Tools.addOtherAttributes;M6.social.viadeo.share.prototype.addOtherAttributes=M6.Tools.addOtherAttributes};M6.social=M6.social||function(){this._=[];if(M6.Events.manager===null){this.date=new Date;M6.Events.enable.call(this);this._["main"]=this;M6.Events.manager=this._["main"]}return this};M6.social.services=new M6.social;M6.Console.log(M6.social.services);M6.social.twitter=function(){if(!M6.social.services._["twitter"]){this.date=new Date;M6.social.services._["twitter"]=this}return M6.social.services._["twitter"]};M6.social.google=function(){if(!M6.social.services._["google"]){this.date=new Date;M6.social.services._["google"]=this}return M6.social.services._["google"]};M6.social.pinterest=function(){if(!M6.social.services._["pinterest"]){this.date=new Date;M6.social.services._["pinterest"]=this}return M6.social.services._["pinterest"]};M6.social.facebook=function(){if(!M6.social.services._["facebook"]){this.date=new Date;M6.social.services._["facebook"]=this}return M6.social.services._["facebook"]};M6.social.linkedin=function(){if(!M6.social.services._["linkedin"]){this.date=new Date;M6.social.services._["linkedin"]=this}return M6.social.services._["linkedin"]};M6.social.viadeo=function(){if(!M6.social.services._["viadeo"]){this.date=new Date;M6.social.services._["viadeo"]=this}return M6.social.services._["viadeo"]};M6.social.twitter.tweet=function(){};M6.social.twitter.followme=function(){};M6.social.twitter.timeline=function(){};M6.social.google.plusOne=function(){};M6.social.google.badge=function(){};M6.social.pinterest.pinIt=function(){};M6.social.pinterest.follow=function(){};M6.social.facebook.like=function(){};M6.social.facebook.likeBox=function(){};M6.social.facebook.login=function(){};M6.social.facebook.subscribe=function(){};M6.social.facebook.recommendationsBar=function(){};M6.social.facebook.recommendationsBox=function(){};M6.social.facebook.activityFeed=function(){};M6.social.linkedin.share=function(){};M6.social.viadeo.share=function(){};M6.Tools.setPrototypes();M6.social.twitter.prototype.loadScriptOfflineBehavior=function(){M6.Console.groupCollapsed("M6.social.twitter.loadScriptOfflineBehavior","DOM");if(typeof jQuery!=="undefined"){var myMouseOverEvent=function funcMyMouseOverEvent(myEvent){var i=$(this),h="",d;g=i.parent().get(0);var paramsKey,dataOptions=i.data();for(paramsKey in dataOptions){if(dataOptions.hasOwnProperty(paramsKey)){h+="data-"+paramsKey+'="'+dataOptions[paramsKey]+'" '}}d="<a "+h+" class='"+i.attr("class")+"' href='"+i.attr("href")+"'></a>";i.replaceWith(d);return window.twttr.widgets.load()};$(".M6SocialWidget.TwitterTweet").on("mouseover",this,myMouseOverEvent)}else{}M6.Console.groupEnd()};M6.social.twitter.prototype.loadScript=function(){M6.Console.info("M6.social.twitter.loadScript","DOM");var id,js,s;id="twitter-wjs";if(!document.getElementById(id)){js=document.createElement("script");js.type="text/javascript";js.async=true;js.src="//platform.twitter.com/widgets.js";M6.Tools.checkScriptLoaded(js,function eventLoaded(callback){M6.Events.manager.fireEvent("twitter.library.loaded",[callback])});s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(js,s)}M6.social.twitter.prototype.loadScript=function(){M6.Console.info("twitter script already loaded","DOM")}};M6.social.twitter.tweet.prototype.init=function(idTag,href,layout){M6.Console.groupCollapsed("M6.social.twitter.tweet.init","DOM");M6.Console.info("idTag : "+idTag,"DOM");var myEl;if(typeof href==="undefined"){href=null}if(typeof layout==="undefined"){layout=null}if(layout!=="none"&&layout!=="horizontal"&&layout!=="vertical"&&layout!==null){M6.Console.info("3rd parameter should be none/horizontal/vertical, current is "+layout)}myEl=document.getElementById(idTag);if(myEl!=="undefined"&&myEl!==null){if(href!==null){myEl.setAttribute("data-url",href)}if(layout!==null){myEl.setAttribute("data-count",layout)}if(arguments.length>3){this.addOtherAttributes(myEl,arguments[3],"data-")}}M6.Console.groupEnd();return myEl};M6.social.twitter.followme.prototype.init=function(idTag,href,layout){M6.Console.groupCollapsed("M6.social.twitter.followme.init","DOM");M6.Console.info("idTag : "+idTag,"DOM");var myEl;if(typeof href==="undefined"){href=null}if(typeof layout==="undefined"){layout=null}if(layout!=="true"&&layout!=="false"&&layout!==null){M6.Console.info("3rd parameter should be true or false, current is "+layout,"DOM")}myEl=document.getElementById(idTag);if(myEl!=="undefined"&&myEl!==null){if(href!==null){myEl.setAttribute("href",href)}if(layout!==null){myEl.setAttribute("data-show-count",layout)}if(arguments.length>3){this.addOtherAttributes(myEl,arguments[3],"data-")}}M6.Console.groupEnd();return myEl};M6.social.twitter.timeline.prototype.init=function(idTag,href,layout){M6.Console.groupCollapsed("M6.social.twitter.timeline.init","DOM");M6.Console.info("idTag : "+idTag,"DOM");var myEl;if(typeof href==="undefined"){href=null}if(href===null){M6.Console.info("2nd parameter should not be null","DOM")}myEl=document.getElementById(idTag);if(myEl!=="undefined"&&myEl!==null){if(href!==null){myEl.setAttribute("href",href)}if(arguments.length>3){if(arguments[3]["width"]!=="undefined"){myEl.setAttribute("width",arguments[3]["width"]);delete arguments[3]["width"]}if(arguments[3]["height"]!=="undefined"){myEl.setAttribute("height",arguments[3]["height"]);delete arguments[3]["height"]}console.log("test");this.addOtherAttributes(myEl,arguments[3],"data-")}}M6.Console.groupEnd();return myEl};M6.social.google.prototype.loadScript=function(){M6.Console.info("M6.social.google.loadScript","DOM");var js,s;window.___gcfg={lang:"fr-FR",parsetags:"onload"};js=document.createElement("script");js.type="text/javascript";js.async=true;js.src="https://apis.google.com/js/plusone.js";js.innerHTML='{"parsetags": "explicit"}';M6.Tools.checkScriptLoaded(js,function eventLoaded(callback){M6.Events.manager.fireEvent("google.library.loaded",[callback])});s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(js,s);M6.social.google.prototype.loadScript=function(){M6.Console.info("google script already loaded","DOM")}};M6.social.google.plusOne.prototype.go=function(){M6.Console.info("M6.social.google.plusOne.prototype.go","DOM");M6.Events.manager.addListener("google.library.loaded",function(){window.gapi.plusone.go()})};M6.social.google.plusOne.prototype.init=function(idTag,href,layout){M6.Console.groupCollapsed("M6.social.google.plusOne.init","DOM");M6.Console.info("idTag : "+idTag,"DOM");var myEl;if(typeof href==="undefined"){href=null}if(typeof layout==="undefined"){layout=null}if(layout!=="none"&&layout!=="bubble"&&layout!=="inline"&&layout!==null){M6.Console.info("3rd parameter should be none/bubble/inline, current is "+layout,"DOM")}myEl=document.getElementById(idTag);if(myEl!=="undefined"&&myEl!==null){if(href!==null){myEl.setAttribute("href",href)}if(layout!==null){myEl.setAttribute("annotation",layout)}if(arguments.length>3){this.addOtherAttributes(myEl,arguments[3])}this.go()}M6.Console.groupEnd();return myEl};M6.social.google.badge.prototype.go=function(instance){M6.Console.info("M6.social.google.badge.prototype.go","DOM");M6.Events.manager.addListener("google.library.loaded",function(){window.gapi.plus.go()})};M6.social.google.badge.prototype.init=function(idTag,href,layout){M6.Console.groupCollapsed("M6.social.google.google.init","DOM");M6.Console.info("idTag : "+idTag,"DOM");var myEl;if(typeof href==="undefined"){href=null}myEl=document.getElementById(idTag);if(myEl!=="undefined"&&myEl!==null&&href!==null){if(arguments.length>3){this.addOtherAttributes(myEl,arguments[3])}this.go()}M6.Console.groupEnd();return myEl};M6.social.pinterest.prototype.loadScript=function(){M6.Console.info("M6.social.pinterest.loadScript","DOM");var js,s;js=document.createElement("script");js.type="text/javascript";js.async=true;js.src="//assets.pinterest.com/js/pinit.js";M6.Tools.checkScriptLoaded(js,function eventLoaded(callback){M6.Events.manager.fireEvent("pinterest.library.loaded",[callback])});s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(js,s);M6.social.google.prototype.loadScript=function(){M6.Console.info("M6.social.pinterest : pinterest script already loaded","DOM")}};M6.social.pinterest.pinIt.prototype.init=function(idTag,href,layout){M6.Console.groupCollapsed("M6.social.pinterest.pinIt.init","DOM");M6.Console.info("idTag : "+idTag,"DOM");var url,imgInfo,myEl;if(typeof href==="undefined"){href=document.location.href}if(typeof layout==="undefined"){layout=null}if(layout!=="none"&&layout!=="horizontal"&&layout!=="vertical"&&layout!==null){M6.Console.info("3rd parameter should be none/horizontal/vertical, current is "+layout,"DOM")}url="http://pinterest.com/pin/create/button/?";url+="url="+encodeURIComponent(href);if(arguments.length>3){imgInfo=arguments[3];if(imgInfo.media!=="undefined"){url+="&media="+encodeURIComponent(imgInfo.media);delete imgInfo.media}if(imgInfo.description!=="undefined"){url+="&description="+imgInfo.description;delete imgInfo.description}}myEl=document.getElementById(idTag);if(myEl!=="undefined"&&myEl!==null){myEl.setAttribute("href",url);if(layout!==null){myEl.setAttribute("count-layout",layout)}if(arguments.length>3){this.addOtherAttributes(myEl,arguments[3])}}M6.Console.groupEnd();return myEl};M6.social.pinterest.follow.prototype.init=function(idTag,href,layout){M6.Console.groupCollapsed("M6.social.pinterest.follow.init","DOM");M6.Console.info("idTag : "+idTag,"DOM");var myEl;if(typeof href==="undefined"){href=null}myEl=document.getElementById(idTag);if(myEl!=="undefined"&&myEl!==null){if(href!==null){myEl.setAttribute("href",href)}if(arguments.length>3){this.addOtherAttributes(myEl,arguments[3])}}M6.Console.groupEnd();return myEl};M6.social.facebook.prototype.parseMeta=function(el){M6.Console.groupCollapsed("M6.social.facebook.parseMeta","DOM");var returnData={};if(typeof jQuery!=="undefined"){returnData={url:el.data("href")||el.attr("href")||$("meta[property='og:url']").attr("content")||$("link[rel='canonical']").attr("href")||window.location.href,media:el.data("thumb")||$("meta[property='og:image']").attr("content"),description:el.data("description")||$("meta[property='og:description']").attr("content")||$("meta[name='description']").attr("content"),title:el.data("title")||$("title").text(),callback:el.data("callback")}}M6.Console.info(returnData,"DOM");M6.Console.groupEnd();return returnData};M6.social.facebook.prototype.loadScriptOfflineBehavior=function(){M6.Console.groupCollapsed("M6.social.facebook.loadScriptOfflineBehavior","DOM");if(typeof jQuery!=="undefined"){var myMouseOverEvent=function funcMyMouseOverEvent(myEvent){M6.Console.info(myEvent.data,"DOM");var i=$(this),h="",d,f,g,myM6Object=myEvent.data,fbAction;g=i.parent().get(0);f=myM6Object.parseMeta(i);var paramsKey,dataOptions=i.data();for(paramsKey in dataOptions){if(dataOptions.hasOwnProperty(paramsKey)){h+=paramsKey+'="'+dataOptions[paramsKey]+'" '}}fbAction=i.attr("id").split("_")[0].substring(8).toLowerCase();if(fbAction.length==0){fbAction="like"}d="<fb:"+fbAction+" "+(f.url!=="undefined"?"href='"+f.url+"' ":"")+h+"></fb:"+fbAction+">";i.replaceWith(d);return FB.XFBML.parse(g)};$(".M6SocialWidget.FacebookLike").on("mouseover",this,myMouseOverEvent);$(".M6SocialWidget.FacebookSubscribe").on("mouseover",this,myMouseOverEvent)}else{}M6.Console.groupEnd()};M6.social.facebook.prototype.FbInit=function(appId,channelUrl){M6.Console.groupCollapsed("M6.social.facebook.FbInit","DOM");var myAppId=appId,myChannelUrl=channelUrl;if(!this.FbInitCalled()){window.fbAsyncInit=function(){M6.Console.groupCollapsed("M6.social.facebook.FbInit fbAsyncInit","DOM");M6.Console.info("prepare FB.init with appId: "+myAppId+" and channelUrl: "+myChannelUrl,"DOM");var fbParams={status:true,xfbml:true,cookie:true,oauth:true,frictionlessRequests:true};if(typeof myAppId!=="undefined"&&myAppId.length>0){fbParams.appId=myAppId}if(typeof myChannelUrl!=="undefined"&&myChannelUrl.length>0){fbParams.channelUrl=myChannelUrl}if(M6.Console.debug){fbParams.logging=true}if(M6.social.facebook.apiWaiting){M6.social.facebook.apiWaiting.loadWhenReady(function loadFbInit(){M6.Console.groupCollapsed("M6.social.facebook.FbInit loadFbInit","DOM");M6.Console.info("call FB.init with fbParams : ","DOM");M6.Console.info(fbParams,"DOM");FB.init(fbParams);M6.Events.manager.fireEvent("facebook.fbinit.called");M6.Console.groupEnd()})}else{setTimeout(function loopUntilFbApiAvailable(){var msixFacebook=new M6.social.facebook;msixFacebook.FbInit(appId,channelUrl)},500)}M6.Console.groupEnd()};M6.social.facebook.prototype.FbInitCalled=function(){return true}}M6.Console.groupEnd()};M6.social.facebook.prototype.FbInitCalled=function(){return false};M6.social.facebook.prototype.loadScript=function(){M6.Console.info("M6.social.facebook.loadScript","DOM");var xmlNsFbName,htmlTag,divIdAttName,divFbRoot,id,js,s;xmlNsFbName="xmlns:fb";divIdAttName="fb-root";htmlTag=document.getElementsByTagName("html")[0];if(htmlTag.getAttribute(xmlNsFbName)){htmlTag.setAttribute(xmlNsFbName,"http://ogp.me/ns/fb#")}if(!document.getElementById(divIdAttName)){divFbRoot=document.createElement("div");divFbRoot.setAttribute("id",divIdAttName);document.getElementsByTagName("body")[0].appendChild(divFbRoot)}id="facebook-jssdk";if(!document.getElementById(id)){js=document.createElement("script");js.async=true;js.src="//connect.facebook.net/fr_FR/all.js";if(!this.FbInitCalled()){js.src+="#xfbml=1"}js.id=id;M6.Tools.checkScriptLoaded(js,function eventLoaded(callback){M6.Events.manager.fireEvent("facebook.library.loaded",[callback])});s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(js,s)}M6.social.facebook.prototype.loadScript=function(){M6.Console.info("facebook script already loaded","DOM")}};M6.social.facebook.login.prototype.init=function(idTag,href,layout){M6.Console.groupCollapsed("M6.social.facebook.login.init","DOM");M6.Console.info("idTag : "+idTag,"DOM");if(typeof layout!=="undefined"&&layout!==null){M6.Console.info("M6.social.facebook.login : 3rd parameter should be set to null, current is "+layout);layout=null}if(typeof href!=="undefined"&&href!==null){M6.Console.info("M6.social.facebook.login : 3rd parameter should be set to null, current is "+layout);href=null}var myEl=document.getElementById(idTag);if(myEl!=="undefined"&&myEl!==null){if(href!==null){myEl.setAttribute("href",href)}if(layout!==null){myEl.setAttribute("layout",layout)}if(arguments.length>3){this.addOtherAttributes(myEl,arguments[3])}}M6.Console.groupEnd();return myEl};M6.social.facebook.like.prototype.init=function(idTag,href,layout){M6.Console.groupCollapsed("M6.social.facebook.like.init","DOM");M6.Console.info("idTag : "+idTag,"DOM");if(typeof href==="undefined"){href=null}if(typeof layout==="undefined"){layout=null}if(layout!=="standard"&&layout!=="button_count"&&layout!=="box_count"&&layout!==null){M6.Console.info("M6.social.facebook.like : 3rd parameter should be standard/button_count/box_count, current is "+layout,"DOM")}var myEl=document.getElementById(idTag);if(myEl!=="undefined"&&myEl!==null){if(href!==null){myEl.setAttribute("href",href)}if(layout!==null){myEl.setAttribute("layout",layout)}myEl.setAttribute("send",false);if(arguments.length>3){if(layout==="button_count"&&arguments[3]["show_faces"]==="true"){M6.Console.warn("facebook like: layout button_count is incompatible with show_faces true"+" if you want show_faces, so change layout, or if you want button_count, set show_faces to false, or unset it")}this.addOtherAttributes(myEl,arguments[3])}}M6.Console.groupEnd();return myEl};M6.social.facebook.likeBox.prototype.init=function(idTag,href,layout){M6.Console.groupCollapsed("M6.social.facebook.likeBox.init","DOM");M6.Console.info("idTag : "+idTag,"DOM");if(typeof href==="undefined"){href=null}if(typeof layout!=="undefined"&&layout!==null){M6.Console.info("M6.social.facebook.likeBox : 3rd parameter should be set to null, current is "+layout,"DOM");layout=null}var myEl=document.getElementById(idTag);if(myEl!=="undefined"&&myEl!==null){if(href!==null){myEl.setAttribute("href",href)}if(layout!==null){myEl.setAttribute("layout",layout)}if(arguments.length>3){this.addOtherAttributes(myEl,arguments[3])}}M6.Console.groupEnd();return myEl};M6.social.facebook.subscribe.prototype.init=function(idTag,href,layout){M6.Console.groupCollapsed("M6.social.facebook.subscribe.init","DOM");M6.Console.info("idTag : "+idTag,"DOM");if(typeof href==="undefined"){href=null}if(typeof layout==="undefined"){layout=null}if(layout!=="standard"&&layout!=="button_count"&&layout!=="box_count"&&layout!==null){M6.Console.info("M6.social.facebook.subscribe : 3rd parameter should be standard/button_count/box_count, current is "+layout,"DOM")}var myEl=document.getElementById(idTag);if(myEl!=="undefined"&&myEl!==null){if(href!==null){myEl.setAttribute("href",href)}if(layout!==null){myEl.setAttribute("layout",layout)}if(arguments.length>3){this.addOtherAttributes(myEl,arguments[3])}}M6.Console.groupEnd();return myEl};M6.social.facebook.recommendationsBar.prototype.init=function(idTag,href,layout){M6.Console.groupCollapsed("M6.social.facebook.recommendationsBar.init","DOM");M6.Console.info("idTag : "+idTag,"DOM");if(typeof href==="undefined"||href===null||href===""){M6.Console.info("M6.social.facebook.recommendationsBar : 2nd parameter should be set to null, current is "+href,"DOM");href=null}var myEl=document.getElementById(idTag);if(myEl!=="undefined"&&myEl!==null){if(href!==null){myEl.setAttribute("href",href)}if(layout!==null){myEl.setAttribute("side",layout)}if(arguments.length>3){this.addOtherAttributes(myEl,arguments[3])}}M6.Console.groupEnd();return myEl};M6.social.facebook.recommendationsBox.prototype.init=function(idTag,href,layout){M6.Console.groupCollapsed("M6.social.facebook.recommendationsBox.init","DOM");M6.Console.info("idTag : "+idTag,"DOM");if(typeof layout!=="undefined"&&layout!==null){M6.Console.info("3rd parameter should be set to null, current is "+layout,"DOM");layout=null}if(typeof href!=="undefined"&&href!==null){M6.Console.info("2nd parameter should be set to null, current is "+href,"DOM");href=null}var myEl=document.getElementById(idTag);if(myEl!=="undefined"&&myEl!==null){if(href!==null){myEl.setAttribute("href",href)}if(layout!==null){myEl.setAttribute("layout",layout)}if(arguments.length>3){this.addOtherAttributes(myEl,arguments[3])}}M6.Console.groupEnd();return myEl};M6.social.facebook.activityFeed.prototype.init=function(idTag,href,layout){M6.Console.groupCollapsed("M6.social.facebook.activityFeed.init","DOM");M6.Console.info("idTag : "+idTag,"DOM");if(typeof layout!=="undefined"&&layout!==null){M6.Console.info("3rd parameter should be set to null, current is "+layout,"DOM");layout=null}if(typeof href!=="undefined"&&href!==null){M6.Console.info("2nd parameter should be set to null, current is "+href,"DOM");href=null}var myEl=document.getElementById(idTag);if(myEl!=="undefined"&&myEl!==null){if(href!==null){myEl.setAttribute("href",href)}if(layout!==null){myEl.setAttribute("layout",layout)}if(arguments.length>3){this.addOtherAttributes(myEl,arguments[3])}}M6.Console.groupEnd();return myEl};M6.social.linkedin.prototype.loadScript=function(){M6.Console.info("M6.social.linkedin.loadScript","DOM");var js,s;js=document.createElement("script");js.type="text/javascript";js.async=true;js.src="//platform.linkedin.com/in.js";js.innerHTML="lang:fr_FR";M6.Tools.checkScriptLoaded(js,function eventLoaded(callback){M6.Events.manager.fireEvent("linkedin.library.loaded",[callback])});s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(js,s);M6.social.twitter.prototype.loadScript=function(){M6.Console.info("linkedin script already loaded","DOM")}};M6.social.linkedin.share.prototype.init=function(idTag,href,layout){M6.Console.groupCollapsed("M6.social.linkedin.share.init","DOM");M6.Console.info("idTag : "+idTag,"DOM");var myEl;if(typeof href==="undefined"){href=null}if(typeof layout==="undefined"){layout=null}if(layout!==null){M6.Console.info("M6.social.linkedin.share : 3rd parameter should be set to null, current is "+layout,"DOM")}myEl=document.getElementById(idTag);if(myEl!=="undefined"&&myEl!==null){if(href!==null){myEl.setAttribute("data-url",href)}if(layout!==null){myEl.setAttribute("data-counter",layout)}if(arguments.length>3){this.addOtherAttributes(myEl,arguments[3],"data-")}}M6.Console.groupEnd();return myEl};M6.social.viadeo.prototype.loadScript=function(){M6.Console.info("M6.social.viadeo.loadScript","DOM");var js,s;js=document.createElement("script");js.type="text/javascript";js.async=true;js.src="//widgets.viadeo.com/js/viadeowidgets.js";M6.Tools.checkScriptLoaded(js,function eventLoaded(callback){M6.Events.manager.fireEvent("viadeo.library.loaded",[callback])});s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(js,s);window.viadeoWidgetsJsUrl=document.location.protocol+"//widgets.viadeo.com";M6.social.viadeo.prototype.loadScript=function(){M6.Console.info("viadeo script already loaded","DOM")}};M6.social.viadeo.share.prototype.init=function(idTag,href,layout){M6.Console.groupCollapsed("M6.social.viadeo.share.init","DOM");M6.Console.info("idTag : "+idTag,"DOM");var myEl;if(typeof href==="undefined"){href=null}if(typeof layout==="undefined"){layout=null}if(layout!==null){M6.Console.info("M6.social.viadeo.share : 3rd parameter should be set to null, current is "+layout,"DOM")}myEl=document.getElementById(idTag);if(myEl!=="undefined"&&myEl!==null){if(href!==null){myEl.setAttribute("data-url",href)}if(layout!==null){myEl.setAttribute("data-layout",layout)}if(arguments.length>3){this.addOtherAttributes(myEl,arguments[3],"data-")}}M6.Console.groupEnd();return myEl};window.M6=M6})();
(function(){if(typeof M6==="undefined"||typeof M6.social==="undefined"){throw"M6.social object is not available"}if(typeof FB==="undefined"){M6.Console.warn("FB object is not available")}M6.Utils=M6.Utils||function(){};if(typeof Array.inArray==="undefined"){Array.prototype.inArray=function(p_val){var l=this.length,i;for(i=0;i<l;i++){if(this[i]==p_val){return true}}return false}}if(typeof Utils!=="undefined"&&typeof Utils.setCookie!=="undefined"){M6.Utils.setCookie=Utils.setCookie}else{M6.Utils.setCookie=function(c_name,value,UTCString){var c_value=escape(value)+"; expires="+UTCString;document.cookie=c_name+"="+c_value}}if(typeof Utils!=="undefined"&&typeof Utils.getCookie!=="undefined"){M6.Utils.getCookie=Utils.getCookie}else{M6.Utils.getCookie=function funcGetCookie(c_name){var i,x,y,ARRcookies=document.cookie.split(";"),cookieValue="",loopLen=ARRcookies.length;for(i=0;i<loopLen;i++){x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);x=x.replace(/^\s+|\s+$/g,"");if(x==c_name){cookieValue=unescape(y);i=ARRcookies.length}}return cookieValue}}if(M6.Utils.strtotime==="undefined"&&typeof Utils!=="undefined"){M6.Utils.strtotime=Utils.strtotime}else{M6.Utils.strtotime=function funcStrToTime(){var now=new Date;now.setFullYear(now.getFullYear()+1);return now.getTime()}}if(localStorage){M6.Utils.setLocalData=function funcSetLocalData(key,value){localStorage.setItem(key,value)};M6.Utils.getLocalData=function funcGetLocalData(key){return localStorage.getItem(key)}}else{M6.Utils.setLocalData=M6.Utils.setCookie;M6.Utils.getLocalData=M6.Utils.getCookie}if(typeof Object.create==="undefined"){Object.create=function(o){var initArgs=Array.prototype.slice.call(arguments,1);function F(){if(typeof o.init==="function"&&initArgs.length){o.init.apply(this,initArgs)}}F.prototype=o;return new F}}M6.social.facebook.apiWaiting={_loaderLaunched:false,_loaded:false,loadWhenReady:function loadWhenReady(myFunc){M6.Console.groupCollapsed("M6.social.facebook.apiWaiting.loadWhenReady","loadWhenReady");M6.Console.info(myFunc,"loadWhenReady");M6.Console.info("name: "+myFunc.name,"loadWhenReady");if(!M6.social.facebook.apiWaiting.isReady()){M6.Console.info("addListener","loadWhenReady");if(!M6.social.facebook.apiWaiting._loaderLaunched){M6.social.facebook.apiWaiting._loaderLaunched=true;M6.Events.manager.addListener("facebook.library.loaded",M6.social.facebook.apiWaiting.setLoaded);var statusFb_SC=function funcFbAuthStatusCheck(){FB.Event.subscribe("auth.login",function funcFbEventAuthLogin(response){M6.Console.info("FB.Events : auth.login","loadWhenReady")});FB.Event.subscribe("auth.authResponseChange",function funcFbEventAuthResponseChange(response){M6.Console.info("FB.Events : auth.authResponseChange","loadWhenReady")});FB.Event.subscribe("xfbml.parse",function funcFbEventXfbmlParse(response){M6.Console.info("FB.Events : xfbml.parse","loadWhenReady")});FB.Event.subscribe("auth.statusChange",function funcFbEventStatusChange(response){M6.Console.info("FB.Events : auth.statusChange","loadWhenReady")});FB.Event.subscribe("FB.loginStatus",function funcFbEventFbLoginStatus(response){M6.Console.info("FB.Events : FB.loginStatus","loadWhenReady")})};M6.Events.manager.addListener("facebook.library.loaded",statusFb_SC)}M6.Events.manager.addListener("facebook.library.loaded",myFunc)}else{M6.Console.info("callback executed directly","loadWhenReady");myFunc()}M6.Console.groupEnd();return this},isReady:function isReady(){var returnedData=false;if(M6.social.facebook.apiWaiting._loaded){returnedData=true}return returnedData},setLoaded:function setLoaded(){M6.Console.info("M6.social.facebook.apiWaiting.setLoaded","loadWhenReady");M6.social.facebook.apiWaiting._loaded=true;M6.Events.manager.removeListener("facebook.library.loaded",M6.social.facebook.apiWaiting.setLoaded);return this}};M6.social.facebook.auth={_getLoginStatusCalled:false,_getPermissionsCalled:false,_loginStatus:null,_permissions:null,resetAuth:function resetAuth(){this._getLoginStatusCalled=false;this._loginStatus=null;this._permissions=null},getLoginStatus:function getLoginStatus(){M6.Console.info("M6.social.facebook.auth.getLoginStatus","getLoginStatus");var returnedData=false;if(!M6.social.facebook.auth._getLoginStatusCalled){M6.social.facebook.auth._getLoginStatusCalled=true;FB.Event.subscribe("auth.statusChange",function funcFbAuthStatusChange(response){M6.Console.info("FB.Event/getLoginStatus/auth.statusChange","getLoginStatus")});FB.Event.subscribe("auth.authResponseChange",function funcFbAuthResponseChange(response){M6.Console.info("FB.Event/getLoginStatus/auth.authResponseChange","getLoginStatus");M6.social.facebook.auth.resetAuth();FB.getLoginStatus(function funcFbGetLoginStatus(response){M6.Console.info("FB.getLoginStatus","getLoginStatus");M6.Events.manager.fireEvent("facebook.loginstatus.received",[response]);M6.social.facebook.auth._loginStatus=response;if(M6.social.facebook.auth.isConnected()){M6.social.facebook.auth.getPermissions()}})})}if(M6.social.facebook.auth._loginStatus){returnedData=M6.social.facebook.auth._loginStatus}return returnedData},setLoginStatus:function funcSetLoginStatus(response){if(response.authResponse&&response.status){M6.social.facebook.auth._loginStatus=response;M6.social.facebook.auth.getPermissions()}},getAccessToken:function funcGetAccessToken(){M6.Console.groupCollapsed("M6.social.facebook.auth","getAccessToken");var returnedData=false,loginStatus=M6.social.facebook.auth.getLoginStatus();if(typeof loginStatus!=="undefined"&&typeof loginStatus.authResponse!=="undefined"&&loginStatus.authResponse!==null){M6.Console.info(loginStatus,"getAccessToken");M6.Console.info(loginStatus.authResponse,"getAccessToken");returnedData=loginStatus.authResponse.accessToken}M6.Console.groupEnd();return returnedData},isConnected:function funcIsConnected(){var loginStatus=M6.social.facebook.auth.getLoginStatus();if(typeof loginStatus==="undefined"){loginStatus={status:null}}return loginStatus.status==="connected"?true:false},isAuthorized:function funcIsAuthorized(){var loginStatus=M6.social.facebook.auth.getLoginStatus(),returnedData=false;if(typeof loginStatus==="undefined"){loginStatus={status:null}}returnedData=loginStatus.status==="not_authorized"?false:true;if(returnedData){M6.Events.manager.fireEvent("facebook.isAuthorized",[])}return returnedData},getUserId:function funcGetUserId(){var returnedData=false,loginStatus=M6.social.facebook.auth.getLoginStatus();if(typeof loginStatus!=="undefined"){returnedData=loginStatus.authResponse.userID}return returnedData},getPermissions:function funcGetPermissions(index,callback){var returnedData=false;if(typeof index==="undefined"){index=0}if(!M6.social.facebook.auth._getPermissionsCalled&&(!M6.social.facebook.auth._permissions||M6.social.facebook.auth._permissions.error)){if(M6.social.facebook.auth._permissions!==null&&typeof M6.social.facebook.auth._permissions.error!=="undefined"){M6.Console.warn("Permissions error");M6.Console.warn(typeof M6.social.facebook.auth._permissions);M6.Console.warn(M6.social.facebook.auth._permissions.error)}var myGetPermissionsCallback=function funcGetPermissionsCallBack(){M6.Console.info("M6.social.facebook.auth.getPermissions called from FB.api");M6.Console.info(Date());M6.social.facebook.auth._getPermissionsCalled=true;FB.api("/me/permissions",function funcFbApiGetPermissions(response){M6.Console.info("FB.api => M6.social.facebook.auth.getPermissions","getPermissions");M6.Console.info(Date());M6.Console.info(response,"getPermissions");M6.Console.info(typeof callback+(callback?" callback name : "+callback.name:" no callback"),"getPermissions");M6.Events.manager.fireEvent("facebook.permissions.received",[response]);M6.social.facebook.auth._permissions=response;if(typeof callback==="function"){callback(response)}})};if(!this._getLoginStatusCalled){M6.Events.manager.addListener("facebook.loginstatus.received",myGetPermissionsCallback);this.getLoginStatus()}else if(this._getLoginStatusCalled&&!this._loginStatus){M6.Events.manager.addListener("facebook.loginstatus.received",myGetPermissionsCallback)}else{myGetPermissionsCallback()}}if(M6.social.facebook.auth._permissions){M6.Console.info("getPermissions : perms stored","getPermissions");if(M6.social.facebook.auth._permissions.error){M6.Console.error("Error on permissions access: ("+M6.social.facebook.auth._permissions.error.code+") "+M6.social.facebook.auth._permissions.error.message+" ["+M6.social.facebook.auth._permissions.error.type+"]","getPermissions");if(M6.social.facebook.auth._permissions.error.code===2500||M6.social.facebook.auth._permissions.error.code===4){M6.Console.info("M6.social.facebook.auth._permissions.error.code 2500","getPermissions");M6.social.facebook.og._isReadyCounter=M6.social.facebook.og._retryLimit;M6.Events.manager.removeListener("facebook.loginstatus.received",myGetPermissionsCallback)}}else{if(M6.social.facebook.auth._permissions.data.length>1){M6.Console.info("Data permissions has more than one index","getPermissions")}else{returnedData=M6.social.facebook.auth._permissions.data[index]}}if(typeof callback==="function"){callback(response)}}return returnedData},getUserInfo:function(){M6.Console.groupCollapsed("M6.social.facebook.auth.getUserInfo","getUserInfo");var loginStatus=M6.social.facebook.auth.getLoginStatus();if(M6.social.facebook.auth.isConnected()&&!M6.social.facebook.auth._userInfo){FB.api("/me",function funcFbApiMe(response){M6.Console.groupCollapsed("FB.api => M6.social.facebook.auth.getUserInfo","getUserInfo");M6.Console.info("FB.api/me : cgetUserInfo callback on response","getUserInfo");M6.Console.info(response,"getUserInfo");M6.Events.manager.fireEvent("facebook.getuserinfo.received",[response]);M6.social.facebook.auth._userInfo=response;M6.Console.groupEnd()})}M6.Console.groupEnd();return M6.social.facebook.auth._userInfo}};M6.social.facebook.og={_disableAutoPublish:false,disableAutoPublish:function(){this._disableAutoPublish=true},enableAutoPublish:function(){this._disableAutoPublish=false},addFeed:function(feedMessage,forceReSend){M6.Console.groupCollapsed("M6.social.facebook.og.addFeed","addFeed");var forceReSend=forceReSend||false,cookieHashContent=feedMessage,myAddFeedCallBackOnEvent;myAddFeedCallBackOnEvent=function funcMyAddFeedCallBackOnEvent(permissionsResponse){M6.Console.groupCollapsed("M6.social.facebook.og.addFeed funcMyAddFeedCallBackOnEvent","addFeed");if(typeof feedMessage=="object"){if(typeof feedMessage.message!=="undefined"){cookieHashContent+=feedMessage.message}if(typeof feedMessage.link!=="undefined"){cookieHashContent+=feedMessage.link}if(typeof feedMessage.picture!=="undefined"){cookieHashContent+=feedMessage.picture}}else{feedMessage={message:feedMessage}}var accessToken=M6.social.facebook.auth.getAccessToken(),alreadyAddFeed="",permissions=M6.social.facebook.auth.getPermissions(),cookieName;if(M6.social.facebook.auth.isAuthorized()&&permissions.installed&&(permissions.publish_stream||permissions.publish_actions)){cookieName=M6.social.facebook.og.tools.getLocalStorageKeyName("addFeed");M6.Console.info("cookieName addFeed: "+cookieName,"addFeed");alreadyAddFeed=M6.Utils.getLocalData(cookieName);if(!alreadyAddFeed||!alreadyAddFeed.split(";").inArray(cookieHashContent)||forceReSend){M6.Events.manager.removeListener("facebook.permissions.received",myAddFeedCallBackOnEvent);FB.api("/me/feed","post",feedMessage,function funcFbApiFeed(response){M6.Console.groupCollapsed("FB.api/me/ : addFeed callback on response","addFeed");M6.Console.info(response,"addFeed");if(!response||response.error){M6.Console.info("FB.api/me/ : addFeed error","addFeed")}else{M6.Console.info("FB.api/me/ : addFeed success post ID "+response.id,"addFeed");alreadyAddFeed+=";"+cookieHashContent;M6.Utils.setLocalData(cookieName,alreadyAddFeed,M6.Utils.strtotime("+1 year"))}M6.Events.manager.fireEvent("facebook.addfeed.received",[response]);M6.Console.groupEnd()})}}M6.Console.groupEnd()};if(!M6.social.facebook.auth.getPermissions()){M6.Events.manager.addListener("facebook.permissions.received",myAddFeedCallBackOnEvent)}else{myAddFeedCallBackOnEvent()}M6.Console.groupEnd()},publishActions:function funcPublishActions(action,object,publish_url,explicitlyShare,callback){M6.Console.groupCollapsed("M6.social.facebook.og.publishActions","publishActions");var myPublishActionsCallBackOnEvent=function funcMyPublishActionsCallBackOnEvent(permissionsResponse){M6.Console.groupCollapsed("M6.social.facebook.og.publishActions funcMyPublishActionsCallBackOnEvent","publishActions");M6.Console.log("publishActions ready","publishActions");var share=explicitlyShare&&explicitlyShare!="false"?"true":"false",accessToken=M6.social.facebook.auth.getAccessToken(),alreadyRead="",permissions=M6.social.facebook.auth.getPermissions(),cookieName,FbApiActionObject=JSON.parse('{"'+object+'": "'+publish_url+'"'+"}"),returnedData=0,disableAutoPublish=M6.social.facebook.og._disableAutoPublish;if(permissions.installed&&permissions.publish_actions&&!disableAutoPublish){cookieName=M6.social.facebook.og.tools.getLocalStorageKeyName(action);alreadyRead=M6.Utils.getLocalData(cookieName);M6.Console.info("cookie (name: "+cookieName+") content: "+alreadyRead,"publishActions");if(alreadyRead==="undefined"||!alreadyRead.split(";").map(function filterCookie(item){var result=item.split("|");return result[0]}).inArray(publish_url)){M6.Console.info("FB.api/me/"+action+" publishAction","publishActions");M6.Console.info(FbApiActionObject,"publishActions");M6.Events.manager.removeListener("facebook.permissions.received",myPublishActionsCallBackOnEvent);FB.api("/me/"+action,"post",FbApiActionObject,function funcFbApiPostAction(response){M6.Console.groupCollapsed("FB.api/me/"+action+" : publishAction callback on response","publishActions");M6.Console.info(response,"publishActions");if(!response||response.error){M6.Console.info("FB.api/me/"+action+" : publishAction error","publishActions")}else{M6.Console.info("FB.api/me/"+action+" :  publishAction success","publishActions");M6.Console.info("FB.api/me/"+action+" : publishAction post ID: "+response.id,"publishActions")}if(typeof callback==="function"){callback(response,returnedData)}M6.Events.manager.fireEvent("facebook.publishaction.received",[response,action,object,publish_url]);M6.Console.groupEnd()})}else{M6.Console.info("PublishActions already read, and found in cookie, no call to FB.api done","publishActions");var alreadyReadItem=alreadyRead.split(";").filter(function filterCookie(item){var result=item.split("|");if(result[0]===publish_url){return true}else{return false}});M6.Console.warn(alreadyReadItem);M6.Events.manager.fireEvent("facebook.publishaction.alreadydone",[alreadyReadItem[0].split("|")[1],action,object,publish_url])}}M6.Console.groupEnd()};if(!M6.social.facebook.auth.getPermissions()){M6.Events.manager.addListener("facebook.permissions.received",myPublishActionsCallBackOnEvent)}else{myPublishActionsCallBackOnEvent()}M6.Console.groupEnd()},publishNewsReading:function funcPublishNewsReading(explicitlyShare,callback){var publish_url,action,object,share=explicitlyShare||false,res=false;if($("[property='og:type']").length!=0){publish_url=$("[property='og:url']").attr("content");action="news.reads";object="article";M6.social.facebook.og.publishActions(action,object,publish_url,share,callback)}},getActionsInfos:function funcGetActionsInfos(action,callback){M6.Console.groupCollapsed("M6.social.facebook.og.getActionsInfos","getActionsInfos");window.myGetActionsInfosCallBackOnEvent=function funcMyGetActionsInfosCallBackOnEvent(){M6.Console.groupCollapsed("M6.social.facebook.og.getActionsInfos funcMyGetActionsInfosCallBackOnEvent","getActionsInfos");M6.Console.info("getActionsInfos ready","getActionsInfos");var accessToken=M6.social.facebook.auth.getAccessToken(),permissions=M6.social.facebook.auth.getPermissions(),FbApiActionObject=JSON.parse('{"pretty": "1"}');if(M6.social.facebook.auth.isAuthorized()&&permissions.installed&&permissions.publish_actions){M6.Console.info("/me/"+action+" : getActionsInfos","getActionsInfos");M6.Console.info(FbApiActionObject,"getActionsInfos");M6.Events.manager.removeListener("facebook.permissions.received",window.myGetActionsInfosCallBackOnEvent);FB.api("/me/"+action,"get",FbApiActionObject,function funcFbApiGetAction(response){M6.Console.groupCollapsed("FB.api/me/"+action+" : getActionsInfos callback on response","getActionsInfos");M6.Console.info(response,"getActionsInfos");if(!response||response.error){M6.Console.info("FB.api/me/"+action+" : getActionsInfos error","getActionsInfos")}else{M6.Console.info("FB.api/me/"+action+" : getActionsInfos success","getActionsInfos")}M6.Console.info(myGetActionsInfosCallBackOnEvent);M6.Events.manager.fireEvent("facebook.getactioninfos."+action+".received",[response,action]);if(typeof callback==="function"){M6.Console.info("callback called on getactioninfos.received");callback(response)}M6.Console.groupEnd()})}else{M6.Console.warn(M6.social.facebook.auth.isAuthorized());M6.Console.warn(permissions)}M6.Console.groupEnd()};if(!M6.social.facebook.auth.getPermissions()){M6.Events.manager.addListener("facebook.permissions.received",window.myGetActionsInfosCallBackOnEvent)}else{window.myGetActionsInfosCallBackOnEvent()}M6.Console.groupEnd()},deleteAction:function funcDeleteAction(actionId,action,object,publishUrl,callback){M6.Console.groupCollapsed("M6.social.facebook.og.deleteAction","deleteAction");var myDeleteActionCallBackOnEvent=function funcMyDeleteActionCallBackOnEvent(){M6.Console.groupCollapsed("M6.social.facebook.og.deleteAction funcMyDeleteActionCallBackOnEvent","deleteAction");M6.Console.info("deleteAction ready","deleteAction");M6.Events.manager.removeListener("facebook.permissions.received",myDeleteActionCallBackOnEvent);FB.api("/"+actionId,"delete",function funcFbApiDeleteActionId(response){M6.Console.groupCollapsed("FB.api/me/"+action+" delete : deleteAction callback on response","deleteAction");M6.Console.info(response,"deleteAction");if(!response||response.error){M6.Console.info("FB.api/me/"+action+" : deleteAction error","deleteAction")}else{M6.Console.info("FB.api/me/"+action+" : deleteAction success","deleteAction");M6.Console.info("FB.api/me/"+action+" : deleteAction publishActions post ID: "+actionId,"deleteAction")}if(typeof callback==="function"){callback(response)}M6.Events.manager.fireEvent("facebook.deleteaction.received",[response,actionId,action,object,publishUrl]);M6.Console.groupEnd()});M6.Console.groupEnd()};if(!M6.social.facebook.auth.getPermissions()){M6.Events.manager.addListener("facebook.permissions.received",myDeleteActionCallBackOnEvent)}else{myDeleteActionCallBackOnEvent()}M6.Console.groupEnd()}};M6.social.facebook.og.tools={_urlFilters:[function(strToTransform){return strToTransform.replace("://www.","://")},function(str){return strToTransform.replace("http://","")},function(str){return strToTransform.replace("https://","")}],_urlSpecificFilters:[],manageLocalStorageOnPublishAction:function funcManageLocalStorageOnPublishAction(response,action,object,publishUrl){M6.Console.groupCollapsed("M6.social.facebook.og.tools.managePublishAction","addObject.manager");var cookieName=M6.social.facebook.og.tools.getLocalStorageKeyName(action);alreadyRead=M6.Utils.getLocalData(cookieName);if(alreadyRead){alreadyRead+=";"}else{alreadyRead=""}if(!response||response.error){if(response.error.code===3501){M6.Console.info("action already done on this object","addObject.manager");if(response.error.message.match(/ID: \d+/)){alreadyRead+=publishUrl+"|"+response.error.message.match(/ID: \d+/)[0].substr(4);M6.Utils.setLocalData(cookieName,alreadyRead,M6.Utils.strtotime("+1 year"));M6.Console.info("update cookie (name: "+cookieName+") content: "+alreadyRead,"addObject.manager")}else{M6.Console.warn("no action ID specified in error message, can not update localStorage","addObject.manager")}}else{M6.Console.info("nothing to do in that case of error","addObject.manager")}}else{M6.Console.info("publishActions post ID: "+response.id,"addObject.manager");alreadyRead+=publishUrl+"|"+response.id;M6.Utils.setLocalData(cookieName,alreadyRead,M6.Utils.strtotime("+1 year"));M6.Console.info("cookie (name: "+cookieName+") content: "+alreadyRead,"addObject.manager")}M6.Console.groupEnd()},manageLocalStorageOnDeleteAction:function funcManageLocalStorageOnDeleteAction(response,actionId,action,object,publishUrl){M6.Console.groupCollapsed("M6.social.facebook.og.tools.manageLocalStorageOnDeleteAction","delObject.manager");var cookieName=M6.social.facebook.og.tools.getLocalStorageKeyName(action);alreadyRead=M6.Utils.getLocalData(cookieName),data=M6.social.facebook.og.tools.parseAlreadyReadData(alreadyRead);if(!response||response.error){M6.Console.info("error during delete action, force remove from localStorage","delObject.manager")}if(alreadyRead){if(data.urlList.inArray(publishUrl)){alreadyRead=alreadyRead.replace(publishUrl+"|"+actionId+"|"+object,"").replace(";;","");M6.Utils.setLocalData(cookieName,alreadyRead,M6.Utils.strtotime("+1 year"))}}M6.Console.groupEnd()},parseAlreadyReadData:function funcParseAlreadyReadData(alreadyRead){var urlList=[],itemIdList=[],itemObjectTypeList=[];if(alreadyRead){urlList=alreadyRead.split(";").map(function filterCookie(item){var result=item.split("|");return result[0]}),itemIdList=alreadyRead.split(";").map(function filterCookie(item){var result=item.split("|");return result[1]});itemObjectTypeList=alreadyRead.split(";").map(function filterCookie(item){var result=item.split("|");if(result.length>1){return result[2]}return null})}return{urlList:urlList,itemIdList:itemIdList,itemObjectList:itemObjectTypeList}},getLocalStorageKeyName:function funcGetLocalStorageKeyName(action,object){var cookieName="msix-social-"+location.host.replace(/\./g,"-").split(":")[0]+"-"+(typeof object!=="undefined"?object+"-":"")+action;return cookieName},getCleanPublishUrl:function funcGetCleanPublishUrl(url){if(M6.social.facebook.og.tools._urlFilters.length>0){for(filterCallbackIndex in M6.social.facebook.og.tools._urlFilters){M6.social.facebook.og.tools._urlFilters[filterCallbackIndex](url)}}if(M6.social.facebook.og.tools._urlSpecificFilters.length>0){for(filterCallback in M6.social.facebook.og.tools._urlSpecificFilters){M6.social.facebook.og.tools._urlSpecificFilters[filterCallbackIndex](url)}}},setFilterCleanPublishUrl:function funcSetFilterCleanPublishUrl(filters){if(Object.prototype.toString.call(filters)==="[object Array]"&&filters.length>0||Object.prototype.toString.call(filters)==="[object Object]"){filters.forEach(function(item,index){M6.social.facebook.og.tools.setFilterCleanPublishUrl(item)})}else{M6.social.facebook.og.tools._urlSpecificFilters.push(filters)}},getPropertyNameFromJson:function funcGetPropertyNameFromJson(jsonString,index){try{var myJson;index=index||0;M6.Console.warn("------"+typeof jsonString);M6.Console.warn(jsonString);myJson=typeof jsonString==="array"?jsonString[index]:jsonString;if(myJson.data.lenght>1){M6.Console.warn("More than one data found in jsonString, so will return only first one","getDataFromUnkownPropertyNameFromJson")}for(i in myJson.data){return i}}catch(e){console.trace(e)}},getDataFromUnkownPropertyNameFromJson:function funcGetDataFromUnkownPropertyNameFromJson(jsonString,index){try{var myJson;index=index||0;myJson=typeof jsonString==="array"?jsonString[index]:jsonString;return myJson.data[M6.social.facebook.og.tools.getPropertyNameFromJson(jsonString,index)]}catch(e){console.trace(e)}}};M6.social.facebook.og.widgets={connectApp:{},shareStatus:{_selector:null,_action:null,_object:null,setSelectorContainer:function funcSetSelectorContainer(sel){"use strict";if(document.querySelector(sel)){this._selector=sel}else{throw sel+" doesn't exists in current page"}},changeStatus:function funcChangeStatus(mode){"use strict";var fbShareBtn=$(sel+" a").last(),modeSelected=mode||fbShareBtn.data("mode"),init=typeof mode==="undefined"?true:false,disableFunc=function funcDisableFunc(){fbShareBtn.data("mode",1);fbShareBtn.css("background-position","-42px");fbShareBtn[0].title="Cliquez pour que vos actions sur Clubic soient automatiquement partagées avec vos amis Facebook";fbShareBtn.parent().parent()[0].title="PARTAGE AUTOMATIQUE INACTIF - Aucun contenu ne sera partagé avec vos amis Facebook";M6.social.facebook.og.disableAutoPublish()},activeMode=function funcActiveMode(){fbShareBtn.data("mode",0);fbShareBtn.css("background-position","0px");fbShareBtn[0].title="Cliquez pour qu'aucun contenu ne soit partagé avec vos amis Facebook";fbShareBtn.parent().parent()[0].title="PARTAGE AUTOMATIQUE ACTIF - Vos actions sur Clubic sont automatiquement partagées avec vos amis Facebook";M6.social.facebook.og.enableAutoPublish();M6.social.facebook.apiWaiting.loadWhenReady(function(){M6.social.facebook.auth.getLoginStatus();try{var url=$('meta[property="og:url"]')[0].content;M6.social.facebook.og.publishActions(this._action,this._object,url,"")}catch(e){}})};if(init){if(modeSelected){fbShareBtn.toggleClass("disabled");disableFunc()}else{fbShareBtn.toggleClass("activated");activeMode()}}else{if(modeSelected){fbShareBtn.toggleClass("disabled").toggleClass("activated");activeMode()}else{fbShareBtn.toggleClass("activated").toggleClass("disabled");disableFunc()}}}},boxActivities:{_selector:null,_action:"news.reads",_title:"Mon activité partagée :",_delItemText:"supprimer la publication",_delAppText:"Supprimer l'application",_confirmDelAppText:"Souhaitez-vous supprimer l'application facebook de clubic.com ?",_localeStorageCacheName:"componentSocialCache",_loginScope:"publish_actions",_callbackOnDelApp:function funcCallbackOnDelApp(){M6.social.facebook.apiWaiting.loadWhenReady(function(){FB.api("/me/permissions","DELETE",function(response){if(!response||response.error){}else{location.href=location.href}})})},_callbackOnFBLogout:function funcCallbackOnFBLogout(){window.alert("You have been disconnected from Facebook, please logout from this app.")},setLocaleStorageCacheName:function funcSetLocaleStorageCacheName(localeStorageCacheName){"use strict";this._localeStorageCacheName=localeStorageCacheName||"componentSocialCache"},setSelectorContainer:function funcSetSelectorContainer(sel){"use strict";if(sel.substr(0,1)!=="."&&sel.substr(0,1)!=="#"){sel="#"+sel}if(document.querySelector(sel)){this._selector=sel}else{throw"selector "+sel+" doesn't exists in current page"}},setAction:function funcSetAction(action){"use strict";this._action=action||"news.reads"},setTitle:function funcSetTitle(title){"use strict";this._title=title||"Mon activité partagée :"},setDelItemText:function funcSetDelItemText(delItemText){"use strict";this._delItemText=delItemText||"supprimer la publication"},setDelAppText:function funcSetDelAppText(delAppText){"use strict";this._delAppText=delAppText||"Supprimer l'application"},setConfirmDelAppText:function funcSetConfirmDelAppText(confirmDelAppText){"use strict";this._confirmDelAppText=confirmDelAppText||"Souhaitez-vous supprimer l'application facebook ?"},setCallbackOnDelApp:function funcSetCallbackOnDelApp(callbackOnDelApp){"use strict";if(typeof callbackOnDelApp!=="function"){callbackOnDelApp=function funcCallbackOnDelApp(){M6.social.facebook.apiWaiting.loadWhenReady(function(){FB.api("/me/permissions","DELETE",function funcFbApiMePermissionsFromFuncCallbackOnDelApp(response){if(!response||response.error){}else{location.href=location.href}})})}}this._callbackOnDelApp=callbackOnDelApp},setCallbackOnFBLogout:function funcSetCallbackOnFBLogout(callbackOnFBLogout){"use strict";if(typeof callbackOnFBLogout!=="function"){callbackOnFBLogout=function funcCallbackOnDelApp(){window.alert("You have been disconnected from Facebook, please logout from this app.")}}this._callbackOnFBLogout=callbackOnFBLogout},setLoginScope:function funcSetLoginScope(loginScope){"use strict";this._loginScope=loginScope||"publish_actions"},startListeners:function funcStartListeners(sel,action){"use strict";var selfObj=this;selfObj.setSelectorContainer(sel);selfObj.setAction(action);if(selfObj._localeStorageCacheName==="componentSocialCache"){selfObj.setLocaleStorageCacheName("componentSocialCache"+"-"+selfObj._action)}var listContainer=document.createElement("ul"),rowPendingBar=document.createElement("li");listContainer.setAttribute("id",selfObj.getMainContainerName());rowPendingBar.setAttribute("id",selfObj.getPendingContainerName());listContainer.appendChild(rowPendingBar);document.querySelector(selfObj._selector).appendChild(listContainer);M6.social.facebook.apiWaiting.loadWhenReady(function funcLoadWhenReadyFbShareLoadActions(){selfObj.loadOgActivities();FB.Event.subscribe("auth.logout",function funcFbeventSubOnstartListeners(response){M6.Console.groupCollapsed("startListeners FB.Event auth.logout","auth.logout");M6.Console.warn("deconnexion facebook");M6.Console.warn(response);selfObj.getCallbackOnFBLogout();M6.Console.groupEnd()})});M6.Events.manager.addListener("facebook.publishaction.alreadydone",function funcUpdateBoxCozFbPublishActionAlreadyDone(itemId,action,object,publishUrl){selfObj.updateBoxCozFbPublishActionAlreadyDone(itemId,action,object,publishUrl)});M6.Events.manager.addListener("facebook.publishaction.received",function funcUpdateBoxCozFbPublishActionReceived(response,action,object,publishUrl){selfObj.updateBoxCozFbPublishActionReceived(response,action,object,publishUrl)});M6.Events.manager.addListener("facebook.deleteaction.received",function funcUpdateBoxCozFbDeleteActionReceived(response,actionId,action,object,publishUrl){selfObj.updateBoxCozFbDeleteActionReceived(response,actionId,action,object,publishUrl)});M6.Events.manager.addListener("facebook.getactioninfos."+selfObj._action+".received",function funcBuildActionsList(response,action){selfObj.buildActionsList(response,action)});setTimeout(function funcSetErrorOnTimeOut(){selfObj.setBoxInError()},1e4)},loadOgActivities:function funcLoadOgActivities(){"use strict";M6.social.facebook.og.getActionsInfos(this._action)},getTitleText:function funcGetTitleText(){return this._title},getDelItemText:function funcGetDelItemText(){return this._delItemText},getDelAppText:function funcGetDelAppText(){return this._delAppText},getConfirmDelAppText:function funcGetConfirmDelAppText(){return this._confirmDelAppText},getCallbackOnDelApp:function funcGetCallbackOnDelApp(){return this._callbackOnDelApp},getCallbackOnFBLogout:function funcGetCallbackOnFBLogout(){return this._callbackOnFBLogout},getActionName:function funcGetActionName(action){"use strict";var action=action||this._action;return this._action.split(".").map(function ucFirst(item){return item.substr(0,1).toUpperCase()+item.substr(1)}).join("")},getMainContainerName:function funcGetMainContainerName(addCssSelector){var prefix=addCssSelector?"#":"";return prefix+"fbShareActivityList"+this.getActionName()},getRowContainerName:function funcGetRowContainerName(id,addCssSelector){var prefix=addCssSelector?"#":"";return prefix+"fbShareActivityItem"+this.getActionName()+"_"+id},getErrorContainerName:function funcGetErrorContainerName(addCssSelector){var prefix=addCssSelector?"#":"";return prefix+this.getMainContainerName()+"ConnectionError"},getPendingContainerName:function funcGetPendingContainerName(addCssSelector){var prefix=addCssSelector?"#":"";return prefix+this.getMainContainerName()+"LoadingBar"},getTitleContainerName:function funcGetTitleContainerName(addCssSelector){var prefix=addCssSelector?"#":"";return prefix+this.getMainContainerName()+"Title"},getDelAppContainerName:function funcGetDelAppContainerName(addCssSelector){var prefix=addCssSelector?"#":"";return prefix+this.getMainContainerName()+"RemoveApplicationRedir"},getLocaleStorageCacheName:function funcGetLocaleStorageCacheName(){return this._localeStorageCacheName},getLoginScope:function funcGetLoginScope(){return this._loginScope},setBoxInError:function funcSetBoxInError(){"use strict";M6.Console.groupCollapsed("M6.social.facebook.og.widgets.boxActivities.setBoxInError","boxActivities.setBoxInError");
M6.Console.info("timeOutForFbShareBoxDisplay :");var permissions=M6.social.facebook.auth.getPermissions(),elNFbCconnection=document.createElement("li");elNFbCconnection.id=this.getErrorContainerName();if(!M6.social.facebook.auth.isConnected()){M6.Console.warn("M6.social.facebook.auth.isConnected NOT CONNECTED, auth: ","widgets.boxActivities");M6.Console.warn(M6.social.facebook.auth,"widgets.boxActivities");elNFbCconnection.innerHTML="Erreur de connection facebook<br />"+"<a onclick=\"if (FB) { M6.social.facebook.og.widgets.boxActivities.checkFBLogin(); } else { this.append('Facebook est indisponible<br />Recommencez dans quelques <br />instants');};return;\">Connectez-vous à Facebook ici</a>";$(this.getPendingContainerName(true)).replaceWith(elNFbCconnection)}else if(!permissions.publish_actions){M6.Console.info("M6.social.facebook.auth.isConnected but missing permissions","widgets.boxActivities");elNFbCconnection.innerHTML="Droits facebook manquant<br />"+'<a href="#" onclick="javascript:M6.social.facebook.og.widgets.boxActivities.addF8Permissions();">Vérifiez les droits</a>';$(this.getPendingContainerName(true)).replaceWith(elNFbCconnection)}else{M6.Console.info("M6.social.facebook.auth.isConnected so nothing to do","widgets.boxActivities")}M6.Console.groupEnd()},addF8Permissions:function funcAddF8Permissions(callbackOnSuccess){FB.login(function funcFbLoginOnAddF8Permissions(response){if(response.authResponse){if(typeof callbackOnSuccess==="function"){M6.Events.manager.addListener("facebook.permissions.received",function getInfosAfterNewPerms(response){callbackOnSuccess.call()})}}else{}},{scope:"publish_actions"})},checkFBLogin:function funcCheckFBLogin(callBackWhenNotAppInstalled,domErrorContainer){var dom=domErrorContainer||this;FB.login(function funcFbLoginOnCheckFBLogin(response){if(response.authResponse){M6.Events.manager.addListener("facebook.permissions.received",function checkRightsForCurrentApp(response){var permissions=M6.social.facebook.auth.getPermissions();if(!response||response.error){}else{if(!permissions.installed){if(typeof callBackWhenNotAppInstalled==="function"){callBackWhenNotAppInstalled()}else{dom.innerHTML="FB application not installed"}}else{if(!permissions.publish_actions){M6.social.facebook.og.widgets.boxActivities.addF8Permissions(M6.social.facebook.og.widgets.boxActivities.loadOgActivities)}else{M6.social.facebook.og.widgets.boxActivities.loadOgActivities()}}}});M6.social.facebook.auth.getPermissions()}else{}})},getPublishUrl:function funcGetPublishUrl(){"use strict";var publishUrl=$("[property='og:url']").attr("content");return publishUrl},getListNode:function funcGetListNode(responseItem){var link=document.createElement("a"),data=M6.social.facebook.og.tools.getDataFromUnkownPropertyNameFromJson(responseItem),objectName=M6.social.facebook.og.tools.getPropertyNameFromJson(responseItem);link.setAttribute("href",data.url);link.setAttribute("title",data.title);link.setAttribute("style","float:left;");link.innerHTML=data.title.substr(0,20)+"...&nbsp;";var rmLink=document.createElement("a");rmLink.setAttribute("href","#");rmLink.setAttribute("title",this.getDelItemText());rmLink.setAttribute("onclick","M6.social.facebook.og.deleteAction('"+responseItem.id+"', '"+this._action+"', '"+objectName+"', '"+data.url+"')");rmLink.setAttribute("class","rm");rmLink.innerHTML="x";var itemList=document.createElement("li");itemList.setAttribute("id",this.getRowContainerName(responseItem.id));itemList.setAttribute("class","link");itemList.appendChild(link);itemList.appendChild(rmLink);return itemList},injectHeaderFooterInBox:function funcInjectHeaderFooterInBox(){M6.Console.groupCollapsed("M6.social.facebook.og.widgets.boxActivities.injectHeaderFooterInBox","boxActivities.injectHeaderFooterInBox");var titleMyActivity=document.createElement("li"),removeAppRow=document.createElement("li"),removeAppAction=document.createElement("a");if(!$(this.getDelAppContainerName(true)).length){titleMyActivity.innerHTML=this.getTitleText();titleMyActivity.setAttribute("id",this.getTitleContainerName());removeAppAction.setAttribute("href",'javascript:if (window.confirm("'+this.getConfirmDelAppText()+'")) {('+this.getCallbackOnDelApp()+")()};");removeAppAction.innerHTML="<span style='color:red'>X</span> "+this.getDelAppText();removeAppRow.appendChild(removeAppAction);removeAppRow.setAttribute("id",this.getDelAppContainerName());$(this.getMainContainerName(true)).prepend(titleMyActivity);$(this.getMainContainerName(true)).append(removeAppRow);M6.Console.info(this.getMainContainerName(true),"clubic.js")}M6.Console.groupEnd()},updateBoxCozFbPublishActionAlreadyDone:function funcUpdateBoxCozFbPublishActionAlreadyDone(itemId,action,object,publishUrl){M6.Console.groupCollapsed("M6.social.facebook.og.widgets.boxActivities.updateBoxCozFbPublishActionAlreadyDone","boxActivities.updateBoxCozFbPublishActionAlreadyDone");M6.Console.info(arguments,"boxActivities.updateBoxCozFbPublishActionAlreadyDone");var objectName=object,responseItem=JSON.parse("{id: "+itemId+", data: {"+object+': {url:"", title:""}}}');data=M6.social.facebook.og.tools.getDataFromUnkownPropertyNameFromJson(responseItem),localStorageList,newLocalStorageList={data:[]},elItemToPrepend,elToSearchInBox,localStorageList;if(localStorage){localStorageList=JSON.parse(localStorage.getItem(this.getLocalStorageCacheName()+this.getActionName(action)))}data.url=publishUrl;data.title=$("[property='og:title']").attr("content");var elItemToPrepend=this.getListNode(responseItem),elLoadingBar=$(this.getPendingContainerName(true));if(elLoadingBar.length){elLoadingBar.remove()}elToSearchInBox=$(this.getRowContainerName(itemId,true));M6.Console.info(this.getRowContainerName(itemId,true),"boxActivities.updateBoxCozFbPublishActionAlreadyDone");this.addCurentElToBox(elToSearchInBox,elItemToPrepend,action,objectName,publishUrl);M6.Console.groupEnd()},updateBoxCozFbPublishActionReceived:function funcUpdateBoxCozFbPublishActionReceived(response,action,object,publishUrl){M6.Console.groupCollapsed("M6.social.facebook.og.widgets.boxActivities.updateBoxCozFbPublishActionReceived","boxActivities.updateBoxCozFbPublishActionReceived");M6.Console.info(arguments,"boxActivities.updateBoxCozFbPublishActionReceived");var objectName=object,responseItem=JSON.stringify("{id: null, data: {"+objectName+":{}}}"),data=M6.social.facebook.og.tools.getDataFromUnkownPropertyNameFromJson(responseItem),localStorageList,newLocalStorageList={data:[]},elItemToPrepend,elToSearchInBox,localStorageList;if(!response||response.error&&response.error.code===3501){M6.Console.warn("error sent by FB on publishAction","boxActivities.updateBoxCozFbPublishActionReceived");if(response.error.message.match(/ID: \d+/)){responseItem.id=response.error.message.match(/ID: \d+/)[0].substr(4)}}else{responseItem.id=response.id}if(responseItem.id){if(localStorage){localStorageList=JSON.parse(localStorage.getItem(this.getLocalStorageCacheName()+this.getActionName(action)))}data.url=publishUrl;data.title=$("[property='og:title']").attr("content");var elItemToPrepend=this.getListNode(responseItem),elLoadingBar=$(this.getPendingContainerName(true));if(elLoadingBar.length){M6.Console.info("publishAction : loading bar was still in box... remove it, bu that means that no action has been done before, or nothinf has been received by FB, here is current Event status: ","boxActivities.updateBoxCozFbPublishActionReceived");M6.Console.info(M6.Events.eventsFired,"boxActivities.updateBoxCozFbPublishActionReceived");M6.Console.info(M6.Events.eventsFiredInfos,"boxActivities.updateBoxCozFbPublishActionReceived");elLoadingBar.remove()}elToSearchInBox=$(this.getRowContainerName(responseItem.id,true));M6.Console.info("publishAction :","boxActivities.updateBoxCozFbPublishActionReceived");M6.Console.info(this.getRowContainerName(responseItem.id,true),"boxActivities.updateBoxCozFbPublishActionReceived");M6.Console.info(elToSearchInBox,"boxActivities.updateBoxCozFbPublishActionReceived");M6.Console.info(elToSearchInBox.length,"boxActivities.updateBoxCozFbPublishActionReceived");this.addCurentElToBox(elToSearchInBox,elItemToPrepend,action,objectName,publishUrl)}M6.Console.groupEnd()},updateBoxCozFbDeleteActionReceived:function funcUpdateBoxCozFbDeleteActionReceived(response,actionId,action,object,publishUrl){M6.Console.groupCollapsed("M6.social.facebook.og.widgets.boxActivities.updateBoxCozFbDeleteActionReceived","boxActivities.updateBoxCozFbDeleteActionReceived");if(response.error){M6.Console.info("error on delete, remove from box and storage forced","boxActivities.updateBoxCozFbDeleteActionReceived")}var elToRemove=$(this.getRowContainerName(actionId,true)),newCacheData;if(elToRemove){var localStorageList=localStorage.getItem(this._localeStorageCacheName)?JSON.parse(localStorage.getItem(this._localeStorageCacheName)):null,dataShifted,itemForReplacement;dataShifted=localStorageList&&localStorageList.data.length>0?localStorageList.data.shift():null;M6.Console.info("dataShifted :","boxActivities.updateBoxCozFbDeleteActionReceived");M6.Console.info(dataShifted,"boxActivities.updateBoxCozFbDeleteActionReceived");if(dataShifted){if(action==="news.reads"){itemForReplacement=this.getListNode(dataShifted)}}M6.Console.info("itemForReplacement: ","boxActivities.updateBoxCozFbDeleteActionReceived");M6.Console.info(itemForReplacement,"boxActivities.updateBoxCozFbDeleteActionReceived");elToRemove.remove();if(itemForReplacement){M6.Console.info("ondelete : add at bottom","boxActivities.updateBoxCozFbDeleteActionReceived");$(this.getDelAppContainerName(true)).before(itemForReplacement)}else{M6.Console.info("ondelete : remove only","boxActivities.updateBoxCozFbDeleteActionReceived")}if($(this.getMainContainerName(true)).children().length===0){var noActivities=document.createElement("li");noActivities.innerHTML="Aucune lecture";$(this.getMainContainerName(true)).append(noActivities)}newCacheData=JSON.stringify(localStorageList);if(newCacheData){localStorage.setItem(this._localeStorageCacheName,newCacheData)}else{delete localStorage[this._localeStorageCacheName]}}M6.Console.groupEnd()},buildActionsList:function funcBuildActionsList(response,action){"use strict";M6.Console.groupCollapsed("M6.social.facebook.og.widgets.boxActivities.buildActionsList","boxActivities.buildActionsList");M6.Console.info("facebook.getactioninfos."+action+".received callback called","boxActivities.buildActionsList");var displayedUrl=[],localStorageList={data:[]},loopIndex=0,cookieName,alreadyRead,publishUrl,selfObj=this;$(selfObj.getMainContainerName(true)).children().toArray().forEach(function funcForEachChildrenListOgToClean(item,index){$(item).remove()});if(response.data.length===0){var noActivities=document.createElement("li");noActivities.innerHTML="Aucune lecture";$(selfObj.getMainContainerName(true)).children().remove();$(selfObj.getMainContainerName(true)).append(noActivities);this.injectHeaderFooterInBox();return}response.data.forEach(function funcForEachDisplayFiveItems(item,index){"use strict";M6.Console.groupCollapsed("M6.social.facebook.og.widgets.boxActivities.buildActionsList funcForEachDisplayFiveItems","boxActivities.buildActionsList");M6.Console.info("item","boxActivities.buildActionsList");M6.Console.info(item,"boxActivities.buildActionsList");var objectData,dataResponse=M6.social.facebook.og.tools.getDataFromUnkownPropertyNameFromJson(item),objectName=M6.social.facebook.og.tools.getPropertyNameFromJson(item);if(loopIndex<=4){var itemList=selfObj.getListNode(item);$(selfObj.getMainContainerName(true)).append(itemList);displayedUrl.push(dataResponse.url);M6.Console.info("itemList :","boxActivities.buildActionsList");M6.Console.info(itemList,"boxActivities.buildActionsList")}else{objectData=JSON.stringify('{"id": '+item.id+', "data": {'+objectName+': {"url": '+dataResponse.url+', "title": '+dataResponse.title+"}}}");localStorageList.data.push(objectData);M6.Console.info("objectData :","boxActivities.buildActionsList");M6.Console.info(objectData,"boxActivities.buildActionsList")}loopIndex++;M6.Console.groupEnd()});if(localStorage){localStorage.setItem(selfObj._localeStorageCacheName,JSON.stringify(localStorageList))}if(localStorageList.data.length<5&&response.data.length>=25){selfObj.loadOgActivities(action)}var cookieName=M6.social.facebook.og.tools.getLocalStorageKeyName(action),alreadyRead=M6.Utils.getLocalData(cookieName),publishUrl=selfObj.getPublishUrl();if(alreadyRead!=="undefined"){var data=M6.social.facebook.og.tools.parseAlreadyReadData(alreadyRead),newAlreadyRead;M6.Console.debug("cookieName: "+cookieName,"boxActivities.buildActionsList");M6.Console.debug("alreadyRead: "+alreadyRead,"boxActivities.buildActionsList");M6.Console.debug("publishUrl: "+publishUrl,"boxActivities.buildActionsList");M6.Console.debug(data,"boxActivities.buildActionsList");if(data&&data.urlList.inArray(publishUrl)){data.urlList.forEach(function funcForEachOnUrlList(item,index){if(item===publishUrl){if(!displayedUrl.inArray(publishUrl)){M6.Console.debug("item not found in displayedUrl","boxActivities.buildActionsList");M6.Console.debug(displayedUrl,"boxActivities.buildActionsList");M6.Console.debug(index,"boxActivities.buildActionsList");var responseItem=JSON.stringify("{id: "+data.itemIdList[index]+", data: {"+data.itemObjectList[index]+":{}}}"),dataResponse=M6.social.facebook.og.tools.getDataFromUnkownPropertyNameFromJson(responseItem);dataResponse.url=$("[property='og:url']").attr("content");dataResponse.title=$("[property='og:title']").attr("content");M6.Console.debug("responseItem","boxActivities.buildActionsList");M6.Console.debug(responseItem,"boxActivities.buildActionsList");var elItemToPrepend=$(selfObj.getListNode(action,responseItem));displayedUrl.push(publishUrl)}else{M6.Console.debug("item found in displayedUrl","boxActivities.buildActionsList");M6.Console.debug(displayedUrl,"boxActivities.buildActionsList");var elItemToPrepend=$(selfObj.getRowContainerName(data.itemIdList[index],true)).clone();$(selfObj.getRowContainerName(data.itemIdList[index],true)).remove()}elItemToPrepend.addClass("currentObject");$(selfObj.getMainContainerName(true)).prepend(elItemToPrepend);return}})}}this.injectHeaderFooterInBox();M6.Console.groupEnd()},addCurentElToBox:function funcAddCurentElToBox(elToSearchInBox,elItemToPrepend,action,objectName,publishUrl){M6.Console.groupCollapsed("M6.social.facebook.og.widgets.boxActivities.addCurentElToBox","boxActivities.addCurentElToBox");var localStorageList=JSON.parse(localStorage.getItem(this.getLocalStorageCacheName()+this.getActionName(action))),newLocalStorageList={data:[]};if(!elToSearchInBox.length){elItemToPrepend.className=elItemToPrepend.className+" currentObject";if($(this.getMainContainerName(true)).children().length===1&&($(this.getMainContainerName(true)).children()[0].innerHTML==="Aucune lecture"||$(this.getMainContainerName(true)).children()[0].id===this.getPendingContainerName()||$(this.getMainContainerName(true)).children()[0].id===this.getErrorContainerName())){$(this.getMainContainerName(true)).children().first().replaceWith(elItemToPrepend)}else{$(this.getTitleContainerName(true)).after(elItemToPrepend);if($(this.getMainContainerName(true)).children().length>7){var itemToRemoveFromList=$(this.getDelAppContainerName(true)).prev();var itemToAddToLocalStorage=JSON.stringify("{id: "+itemToRemoveFromList.attr("id").split("_")[1]+", data: {"+objectName+":{}}}"),dataToAddToLocalstorage=M6.social.facebook.og.tools.getDataFromUnkownPropertyNameFromJson(itemToAddToLocalStorage);dataToAddToLocalstorage.url=itemToRemoveFromList.children().first().attr("href");dataToAddToLocalstorage.title=itemToRemoveFromList.children().first().attr("title");localStorageList.data.push(itemToAddToLocalStorage);localStorage.setItem(this.getLocalStorageCacheName()+this.getActionName(action),JSON.stringify(localStorageList));$(this.getDelAppContainerName(true)).prev().remove()}}}else{elToSearchInBox.addClass("currentObject")}if(localStorageList){localStorageList.data.forEach(function funcForEachLocalStorage(item,index){var dataLocalStorage=M6.social.facebook.og.tools.getDataFromUnkownPropertyNameFromJson(item);if(dataLocalStorage.url!==publishUrl){newLocalStorageList.data.push(item)}});localStorage.setItem(this.getLocalStorageCacheName()+this.getActionName(action),JSON.stringify(newLocalStorageList))}M6.Console.groupEnd()}}};M6.Events.manager.addListener("facebook.library.loaded",M6.social.facebook.apiWaiting.setLoaded);M6.Events.manager.addListener("facebook.publishaction.received",M6.social.facebook.og.tools.manageLocalStorageOnPublishAction);M6.Events.manager.addListener("facebook.deleteaction.received",M6.social.facebook.og.tools.manageLocalStorageOnDeleteAction)})();