(function(){var f=!1,i,k=this;function l(a,c){var b=a.split("."),d=k;!(b[0]in d)&&d.execScript&&d.execScript("var "+b[0]);for(var e;b.length&&(e=b.shift());)!b.length&&void 0!==c?d[e]=c:d=d[e]?d[e]:d[e]={}}var m=Array.prototype,n=m.forEach?function(a,c,b){m.forEach.call(a,c,b)}:function(a,c,b){for(var d=a.length,e="string"==typeof a?a.split(""):a,g=0;g=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},tokenizeQuery:function(b){return a.trim(b).toLowerCase().split(/[\s]+/)},tokenizeText:function(b){return a.trim(b).toLowerCase().split(/[\s\-_]+/)},getProtocol:function(){return location.protocol},noop:function(){}},d=function(){var a=/\s+/;return{on:function(b,c){var d;if(!c)return this;for(this._callbacks=this._callbacks||{},b=b.split(a);d=b.shift();)this._callbacks[d]=this._callbacks[d]||[],this._callbacks[d].push(c);return this},trigger:function(b,c){var d,e;if(!this._callbacks)return this;for(b=b.split(a);d=b.shift();)if(e=this._callbacks[d])for(var f=0;fa;a++)(b=f.key(a)).match(this.keyMatcher)&&c.push(b.replace(this.keyMatcher,""));for(a=c.length;a--;)this.remove(c[a]);return this},isExpired:function(a){var d=e(f.getItem(this._ttlKey(a)));return c.isNumber(d)&&b()>d?!0:!1}}:{get:c.noop,set:c.noop,remove:c.noop,clear:c.noop,isExpired:c.noop},c.mixin(a.prototype,g),a}(),g=function(){function a(a){c.bindAll(this),a=a||{},this.sizeLimit=a.sizeLimit||10,this.cache={},this.cachedKeysByAge=[]}return c.mixin(a.prototype,{get:function(a){return this.cache[a]},set:function(a,b){var c;this.cachedKeysByAge.length===this.sizeLimit&&(c=this.cachedKeysByAge.shift(),delete this.cache[c]),this.cache[a]=b,this.cachedKeysByAge.push(a)}}),a}(),h=function(){function b(a){c.bindAll(this),a=c.isString(a)?{url:a}:a,i=i||new g,h=c.isNumber(a.maxParallelRequests)?a.maxParallelRequests:h||6,this.url=a.url,this.wildcard=a.wildcard||"%QUERY",this.filter=a.filter,this.replace=a.replace,this.ajaxSettings={type:"get",cache:a.cache,timeout:a.timeout,dataType:a.dataType||"json",beforeSend:a.beforeSend},this._get=(/^throttle$/i.test(a.rateLimitFn)?c.throttle:c.debounce)(this._get,a.rateLimitWait||300)}function d(){j++}function e(){j--}function f(){return h>j}var h,i,j=0,k={};return c.mixin(b.prototype,{_get:function(a,b){function c(c){var e=d.filter?d.filter(c):c;b&&b(e),i.set(a,c)}var d=this;f()?this._sendRequest(a).done(c):this.onDeckRequestArgs=[].slice.call(arguments,0)},_sendRequest:function(b){function c(){e(),k[b]=null,f.onDeckRequestArgs&&(f._get.apply(f,f.onDeckRequestArgs),f.onDeckRequestArgs=null)}var f=this,g=k[b];return g||(d(),g=k[b]=a.ajax(b,this.ajaxSettings).always(c)),g},get:function(a,b){var d,e,f=this,g=encodeURIComponent(a||"");return b=b||c.noop,d=this.replace?this.replace(this.url,g):this.url.replace(this.wildcard,g),(e=i.get(d))?c.defer(function(){b(f.filter?f.filter(e):e)}):this._get(d,b),!!e}}),b}(),i=function(){function d(b){c.bindAll(this),c.isString(b.template)&&!b.engine&&a.error("no template engine specified"),b.local||b.prefetch||b.remote||a.error("one of local, prefetch, or remote is required"),this.name=b.name||c.getUniqueId(),this.limit=b.limit||5,this.minLength=b.minLength||1,this.header=b.header,this.footer=b.footer,this.valueKey=b.valueKey||"value",this.template=e(b.template,b.engine,this.valueKey),this.local=b.local,this.prefetch=b.prefetch,this.remote=b.remote,this.itemHash={},this.adjacencyList={},this.storage=b.name?new f(b.name):null}function e(a,b,d){var e,f;return c.isFunction(a)?e=a:c.isString(a)?(f=b.compile(a),e=c.bind(f.render,f)):e=function(a){return"

"+a[d]+"

"},e}var g={thumbprint:"thumbprint",protocol:"protocol",itemHash:"itemHash",adjacencyList:"adjacencyList"};return c.mixin(d.prototype,{_processLocalData:function(a){this._mergeProcessedData(this._processData(a))},_loadPrefetchData:function(d){function e(a){var b=d.filter?d.filter(a):a,e=m._processData(b),f=e.itemHash,h=e.adjacencyList;m.storage&&(m.storage.set(g.itemHash,f,d.ttl),m.storage.set(g.adjacencyList,h,d.ttl),m.storage.set(g.thumbprint,n,d.ttl),m.storage.set(g.protocol,c.getProtocol(),d.ttl)),m._mergeProcessedData(e)}var f,h,i,j,k,l,m=this,n=b+(d.thumbprint||"");return this.storage&&(f=this.storage.get(g.thumbprint),h=this.storage.get(g.protocol),i=this.storage.get(g.itemHash),j=this.storage.get(g.adjacencyList)),k=f!==n||h!==c.getProtocol(),d=c.isString(d)?{url:d}:d,d.ttl=c.isNumber(d.ttl)?d.ttl:864e5,i&&j&&!k?(this._mergeProcessedData({itemHash:i,adjacencyList:j}),l=a.Deferred().resolve()):l=a.getJSON(d.url).done(e),l},_transformDatum:function(a){var b=c.isString(a)?a:a[this.valueKey],d=a.tokens||c.tokenizeText(b),e={value:b,tokens:d};return c.isString(a)?(e.datum={},e.datum[this.valueKey]=a):e.datum=a,e.tokens=c.filter(e.tokens,function(a){return!c.isBlankString(a)}),e.tokens=c.map(e.tokens,function(a){return a.toLowerCase()}),e},_processData:function(a){var b=this,d={},e={};return c.each(a,function(a,f){var g=b._transformDatum(f),h=c.getUniqueId(g.value);d[h]=g,c.each(g.tokens,function(a,b){var d=b.charAt(0),f=e[d]||(e[d]=[h]);!~c.indexOf(f,h)&&f.push(h)})}),{itemHash:d,adjacencyList:e}},_mergeProcessedData:function(a){var b=this;c.mixin(this.itemHash,a.itemHash),c.each(a.adjacencyList,function(a,c){var d=b.adjacencyList[a];b.adjacencyList[a]=d?d.concat(c):c})},_getLocalSuggestions:function(a){var b,d=this,e=[],f=[],g=[];return c.each(a,function(a,b){var d=b.charAt(0);!~c.indexOf(e,d)&&e.push(d)}),c.each(e,function(a,c){var e=d.adjacencyList[c];return e?(f.push(e),(!b||e.length").css({position:"absolute",left:"-9999px",visibility:"hidden",whiteSpace:"nowrap",fontFamily:b.css("font-family"),fontSize:b.css("font-size"),fontStyle:b.css("font-style"),fontVariant:b.css("font-variant"),fontWeight:b.css("font-weight"),wordSpacing:b.css("word-spacing"),letterSpacing:b.css("letter-spacing"),textIndent:b.css("text-indent"),textRendering:b.css("text-rendering"),textTransform:b.css("text-transform")}).insertAfter(b)}function f(a,b){return a=(a||"").replace(/^\s*/g,"").replace(/\s{2,}/g," "),b=(b||"").replace(/^\s*/g,"").replace(/\s{2,}/g," "),a===b}return c.mixin(b.prototype,d,{_handleFocus:function(){this.trigger("focused")},_handleBlur:function(){this.trigger("blured")},_handleSpecialKeyEvent:function(a){var b=this.specialKeyCodeMap[a.which||a.keyCode];b&&this.trigger(b+"Keyed",a)},_compareQueryToInputValue:function(){var a=this.getInputValue(),b=f(this.query,a),c=b?this.query.length!==a.length:!1;c?this.trigger("whitespaceChanged",{value:this.query}):b||this.trigger("queryChanged",{value:this.query=a})},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$hint=this.$input=this.$overflowHelper=null},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(a){this.query=a},getInputValue:function(){return this.$input.val()},setInputValue:function(a,b){this.$input.val(a),!b&&this._compareQueryToInputValue()},getHintValue:function(){return this.$hint.val()},setHintValue:function(a){this.$hint.val(a)},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},isOverflow:function(){return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>this.$input.width()},isCursorAtEnd:function(){var a,b=this.$input.val().length,d=this.$input[0].selectionStart;return c.isNumber(d)?d===b:document.selection?(a=document.selection.createRange(),a.moveStart("character",-b),b===a.text.length):!0}}),b}(),k=function(){function b(b){c.bindAll(this),this.isOpen=!1,this.isEmpty=!0,this.isMouseOverDropdown=!1,this.$menu=a(b.menu).on("mouseenter.tt",this._handleMouseenter).on("mouseleave.tt",this._handleMouseleave).on("click.tt",".tt-suggestion",this._handleSelection).on("mouseover.tt",".tt-suggestion",this._handleMouseover)}function e(a){return a.data("suggestion")}var f={suggestionsList:''},g={suggestionsList:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"}};return c.mixin(b.prototype,d,{_handleMouseenter:function(){this.isMouseOverDropdown=!0},_handleMouseleave:function(){this.isMouseOverDropdown=!1},_handleMouseover:function(b){var c=a(b.currentTarget);this._getSuggestions().removeClass("tt-is-under-cursor"),c.addClass("tt-is-under-cursor")},_handleSelection:function(b){var c=a(b.currentTarget);this.trigger("suggestionSelected",e(c))},_show:function(){this.$menu.css("display","block")},_hide:function(){this.$menu.hide()},_moveCursor:function(a){var b,c,d,f;if(this.isVisible()){if(b=this._getSuggestions(),c=b.filter(".tt-is-under-cursor"),c.removeClass("tt-is-under-cursor"),d=b.index(c)+a,d=(d+1)%(b.length+1)-1,-1===d)return this.trigger("cursorRemoved"),void 0;-1>d&&(d=b.length-1),f=b.eq(d).addClass("tt-is-under-cursor"),this._ensureVisibility(f),this.trigger("cursorMoved",e(f))}},_getSuggestions:function(){return this.$menu.find(".tt-suggestions > .tt-suggestion")},_ensureVisibility:function(a){var b=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom"),10),c=this.$menu.scrollTop(),d=a.position().top,e=d+a.outerHeight(!0);0>d?this.$menu.scrollTop(c+d):e>b&&this.$menu.scrollTop(c+(e-b))},destroy:function(){this.$menu.off(".tt"),this.$menu=null},isVisible:function(){return this.isOpen&&!this.isEmpty},closeUnlessMouseIsOverDropdown:function(){this.isMouseOverDropdown||this.close()},close:function(){this.isOpen&&(this.isOpen=!1,this.isMouseOverDropdown=!1,this._hide(),this.$menu.find(".tt-suggestions > .tt-suggestion").removeClass("tt-is-under-cursor"),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,!this.isEmpty&&this._show(),this.trigger("opened"))},setLanguageDirection:function(a){var b={left:"0",right:"auto"},c={left:"auto",right:" 0"};"ltr"===a?this.$menu.css(b):this.$menu.css(c)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getSuggestionUnderCursor:function(){var a=this._getSuggestions().filter(".tt-is-under-cursor").first();return a.length>0?e(a):null},getFirstSuggestion:function(){var a=this._getSuggestions().first();return a.length>0?e(a):null},renderSuggestions:function(b,d){var e,h,i,j,k,l="tt-dataset-"+b.name,m='
%body
',n=this.$menu.find("."+l);0===n.length&&(h=a(f.suggestionsList).css(g.suggestionsList),n=a("
").addClass(l).append(b.header).append(h).append(b.footer).appendTo(this.$menu)),d.length>0?(this.isEmpty=!1,this.isOpen&&this._show(),i=document.createElement("div"),j=document.createDocumentFragment(),c.each(d,function(c,d){d.dataset=b.name,e=b.template(d.datum),i.innerHTML=m.replace("%body",e),k=a(i.firstChild).css(g.suggestion).data("suggestion",d),k.children().each(function(){a(this).css(g.suggestionChild)}),j.appendChild(k[0])}),n.show().find(".tt-suggestions").html(j)):this.clearSuggestions(b.name),this.trigger("suggestionsRendered")},clearSuggestions:function(a){var b=a?this.$menu.find(".tt-dataset-"+a):this.$menu.find('[class^="tt-dataset-"]'),c=b.find(".tt-suggestions");b.hide(),c.empty(),0===this._getSuggestions().length&&(this.isEmpty=!0,this._hide())}}),b}(),l=function(){function b(a){var b,d,f;c.bindAll(this),this.$node=e(a.input),this.datasets=a.datasets,this.dir=null,this.eventBus=a.eventBus,b=this.$node.find(".tt-dropdown-menu"),d=this.$node.find(".tt-query"),f=this.$node.find(".tt-hint"),this.dropdownView=new k({menu:b}).on("suggestionSelected",this._handleSelection).on("cursorMoved",this._clearHint).on("cursorMoved",this._setInputValueToSuggestionUnderCursor).on("cursorRemoved",this._setInputValueToQuery).on("cursorRemoved",this._updateHint).on("suggestionsRendered",this._updateHint).on("opened",this._updateHint).on("closed",this._clearHint).on("opened closed",this._propagateEvent),this.inputView=new j({input:d,hint:f}).on("focused",this._openDropdown).on("blured",this._closeDropdown).on("blured",this._setInputValueToQuery).on("enterKeyed tabKeyed",this._handleSelection).on("queryChanged",this._clearHint).on("queryChanged",this._clearSuggestions).on("queryChanged",this._getSuggestions).on("whitespaceChanged",this._updateHint).on("queryChanged whitespaceChanged",this._openDropdown).on("queryChanged whitespaceChanged",this._setLanguageDirection).on("escKeyed",this._closeDropdown).on("escKeyed",this._setInputValueToQuery).on("tabKeyed upKeyed downKeyed",this._managePreventDefault).on("upKeyed downKeyed",this._moveDropdownCursor).on("upKeyed downKeyed",this._openDropdown).on("tabKeyed leftKeyed rightKeyed",this._autocomplete)}function e(b){var c=a(g.wrapper),d=a(g.dropdown),e=a(b),f=a(g.hint);c=c.css(h.wrapper),d=d.css(h.dropdown),f.css(h.hint).css({backgroundAttachment:e.css("background-attachment"),backgroundClip:e.css("background-clip"),backgroundColor:e.css("background-color"),backgroundImage:e.css("background-image"),backgroundOrigin:e.css("background-origin"),backgroundPosition:e.css("background-position"),backgroundRepeat:e.css("background-repeat"),backgroundSize:e.css("background-size")}),e.data("ttAttrs",{dir:e.attr("dir"),autocomplete:e.attr("autocomplete"),spellcheck:e.attr("spellcheck"),style:e.attr("style")}),e.addClass("tt-query").attr({autocomplete:"off",spellcheck:!1}).css(h.query);try{!e.attr("dir")&&e.attr("dir","auto")}catch(i){}return e.wrap(c).parent().prepend(f).append(d)}function f(a){var b=a.find(".tt-query");c.each(b.data("ttAttrs"),function(a,d){c.isUndefined(d)?b.removeAttr(a):b.attr(a,d)}),b.detach().removeData("ttAttrs").removeClass("tt-query").insertAfter(a),a.remove()}var g={wrapper:'',hint:'',dropdown:''},h={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none"},query:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"}};return c.isMsie()&&c.mixin(h.query,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),c.isMsie()&&c.isMsie()<=7&&(c.mixin(h.wrapper,{display:"inline",zoom:"1"}),c.mixin(h.query,{marginTop:"-1px"})),c.mixin(b.prototype,d,{_managePreventDefault:function(a){var b,c,d=a.data,e=!1;switch(a.type){case"tabKeyed":b=this.inputView.getHintValue(),c=this.inputView.getInputValue(),e=b&&b!==c;break;case"upKeyed":case"downKeyed":e=!d.shiftKey&&!d.ctrlKey&&!d.metaKey}e&&d.preventDefault()},_setLanguageDirection:function(){var a=this.inputView.getLanguageDirection();a!==this.dir&&(this.dir=a,this.$node.css("direction",a),this.dropdownView.setLanguageDirection(a))},_updateHint:function(){var a,b,d,e,f,g=this.dropdownView.getFirstSuggestion(),h=g?g.value:null,i=this.dropdownView.isVisible(),j=this.inputView.isOverflow();h&&i&&!j&&(a=this.inputView.getInputValue(),b=a.replace(/\s{2,}/g," ").replace(/^\s+/g,""),d=c.escapeRegExChars(b),e=new RegExp("^(?:"+d+")(.*$)","i"),f=e.exec(h),this.inputView.setHintValue(a+(f?f[1]:"")))},_clearHint:function(){this.inputView.setHintValue("")},_clearSuggestions:function(){this.dropdownView.clearSuggestions()},_setInputValueToQuery:function(){this.inputView.setInputValue(this.inputView.getQuery())},_setInputValueToSuggestionUnderCursor:function(a){var b=a.data;this.inputView.setInputValue(b.value,!0)},_openDropdown:function(){this.dropdownView.open()},_closeDropdown:function(a){this.dropdownView["blured"===a.type?"closeUnlessMouseIsOverDropdown":"close"]()},_moveDropdownCursor:function(a){var b=a.data;b.shiftKey||b.ctrlKey||b.metaKey||this.dropdownView["upKeyed"===a.type?"moveCursorUp":"moveCursorDown"]()},_handleSelection:function(a){var b="suggestionSelected"===a.type,d=b?a.data:this.dropdownView.getSuggestionUnderCursor();d&&(this.inputView.setInputValue(d.value),b?this.inputView.focus():a.data.preventDefault(),b&&c.isMsie()?c.defer(this.dropdownView.close):this.dropdownView.close(),this.eventBus.trigger("selected",d.datum,d.dataset))},_getSuggestions:function(){var a=this,b=this.inputView.getQuery();c.isBlankString(b)||c.each(this.datasets,function(c,d){d.getSuggestions(b,function(c){b===a.inputView.getQuery()&&a.dropdownView.renderSuggestions(d,c)})})},_autocomplete:function(a){var b,c,d,e,f;("rightKeyed"!==a.type&&"leftKeyed"!==a.type||(b=this.inputView.isCursorAtEnd(),c="ltr"===this.inputView.getLanguageDirection()?"leftKeyed"===a.type:"rightKeyed"===a.type,b&&!c))&&(d=this.inputView.getQuery(),e=this.inputView.getHintValue(),""!==e&&d!==e&&(f=this.dropdownView.getFirstSuggestion(),this.inputView.setInputValue(f.value),this.eventBus.trigger("autocompleted",f.datum,f.dataset)))},_propagateEvent:function(a){this.eventBus.trigger(a.type)},destroy:function(){this.inputView.destroy(),this.dropdownView.destroy(),f(this.$node),this.$node=null},setQuery:function(a){this.inputView.setQuery(a),this.inputView.setInputValue(a),this._clearHint(),this._clearSuggestions(),this._getSuggestions()}}),b}();!function(){var b,d={},f="ttView";b={initialize:function(b){function g(){var b,d=a(this),g=new e({el:d});b=c.map(h,function(a){return a.initialize()}),d.data(f,new l({input:d,eventBus:g=new e({el:d}),datasets:h})),a.when.apply(a,b).always(function(){c.defer(function(){g.trigger("initialized")})})}var h;return b=c.isArray(b)?b:[b],0===b.length&&a.error("no datasets provided"),h=c.map(b,function(a){var b=d[a.name]?d[a.name]:new i(a);return a.name&&(d[a.name]=b),b}),this.each(g)},destroy:function(){function b(){var b=a(this),c=b.data(f);c&&(c.destroy(),b.removeData(f))}return this.each(b)},setQuery:function(b){function c(){var c=a(this).data(f);c&&c.setQuery(b)}return this.each(c)}},jQuery.fn.typeahead=function(a){return b[a]?b[a].apply(this,[].slice.call(arguments,1)):b.initialize.apply(this,arguments)}}()}(window.jQuery); $(function(){var $search=$("#search");var tpl="";tpl+='

%name%

';tpl+='

%platforms%

';$search.find(".text").typeahead({limit:10,minLength:3,valueKey:"value",template:tpl,engine:{compile:function(tpl){return{render:function(datas){return tpl.replace(/%(\w+)%/g,function(match,key){var data=datas[key];if(typeof data=="object"){return data.join(", ")}return data})}}}},remote:{url:Routing.generate("jvfr_autocomplete_search",{keys:"QUERY"}),wildcard:"QUERY",timeout:2e3,maxParallelRequests:1}});$search.find(".text").on("typeahead:selected",function(object,datum){window.location=datum.url});$search.find(".submit").on("click",function(event){if($("#textrecherche").val()!=""){$(this).closest("form").submit()}})}); $(document).ready(function(){$(window).bind("user.loggedOut",function(){userCtrl.disconnect()});$(window).bind("user.login",function(event,data){userCtrl.connect(data.username,data.password)});var userCtrl={_init:function(view){var _this=this;this.view=view;this.view.onConnection=function(username,password){_this.connect(username,password)};this.view.onDisconnection=function(){_this.disconnect()};if(document.cookie.indexOf("nfuserid")>0){_this.disconnect()}},connect:function(username,password){var _this=this;var routeForChecking=["jvfr_login_check","jvpc_login_check"];var connected=0;for(var i=0;i {{ username }}'+'
  • Messages privés
  • '+'
  • Ma collection de jeux
  • '+'
  • Mon compte
  • ';if(idgroupe==8||idgroupe==10||idgroupe==12){template+='
  • Admin
  • '}template+='
  • Déconnexion
  • ';template=template.replace("{{ username }}",username).replace("{{ profileUrl }}",Routing.generate("jvfr_user_profile",{},true)).replace("{{ accountUrl }}",Routing.generate("jvfr_user_account",{},true)).replace("{{ adminUrl }}",Routing.generate("jvfr_user_admin",{},true)).replace("{{ profilMp }}",Routing.generate("jvfr_user_profile_mp",{username:username,id:userid},true)).replace("{{ profilCollectionJeux }}",Routing.generate("jvfr_user_profile_collection",{username:username,id:userid},true));this.$view.html(template);this.bindEvents()},error:function(message){this.$view.find(".error").html(message)},onConnection:function(username,password){},onDisconnection:function(){}};userView._init($("#mon-compte"));userCtrl._init(userView)}); Cookieu=function(b){this.options={};this.defaultOptions={name:"cookieu",html:"By using this website, you consent to our use of cookies. For more information on cookies see our Cookie Policy.",expireDays:547.5,parentNodeId:null,onDisplay:null,onHide:null};this.init=function(){this.options={};for(var a in this.defaultOptions)this.options[a]=void 0!==b&&b[a]?b[a]:this.defaultOptions[a];this.displayHeader()};this.getParentNode=function(){return this.options.parentNodeId?document.getElementById(this.options.parentNodeId):document.body};this.getExpireDate=function(){var a=new Date;return new Date(a.setTime(a.getTime()+864e5*this.options.expireDays))};this.hasLocalStorage=function(){return window.localStorage?!0:!1};this.confirmUsage=function(){this.addConfirmation();this.hideHeader()};this.removeConfirmation=function(){return this.hasLocalStorage()?window.localStorage.removeItem(this.options.name):document.cookie=this.options.name+"=;path=/;max-age=0"};this.addConfirmation=function(){if(this.hasLocalStorage())try{return window.localStorage.setItem(this.options.name,this.getExpireDate().getTime())}catch(a){return!1}return document.cookie=this.options.name+"="+this.options.name+";path=/;expires="+this.getExpireDate().toUTCString()};this.hasConfirmation=function(){if(this.hasLocalStorage()){var a=window.localStorage.getItem(this.options.name);return a?a>(new Date).getTime():!1}return-1!=document.cookie.indexOf(this.options.name)};this.displayHeader=function(){if(!this.hasConfirmation()&&(this.getParentNode().insertBefore(this.createHeader(),this.getParentNode().firstChild),this.options.onDisplay))this.options.onDisplay()};this.hideHeader=function(){var a=document.getElementById(this.getHeaderId());this.getParentNode().removeChild(a);if(this.options.onHide)this.options.onHide()};this.createHeader=function(){var a=document.createElement("div");a.innerHTML=this.options.html;var b=document.createAttribute("id");b.nodeValue=this.getHeaderId();a.setAttributeNode(b);return a};this.getHeaderId=function(){return this.options.name+"_header"};this.init()};Cookieu.icons={info:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAThJREFUeNqk07tKQ0EQxvFEvJuIEBt9AttgLGKleAGrFBYaEAQLIVVAsdRCRLGzUrCwEAWbI/gEXipFfAJFSCfES4iCYGKO/4UZGZZT6cAvkN39dnN2TuJhGMb+Ws3uY2//QL+3YQIzyCCFd1zhGBeou4WFxYVYk9moB9s4xRwGUMUT8jjDGro0oOF2rKOIFrNhAZMI0IlVrOgv1vC4LPTLBcfQZ8aWkLXhvO4m9YUbjOAQo2YuiWkbHvROjOMEs3JRfg3ZcNKbdM+dxiPuIsLdNlyJWHCPVj3Fq1cbvvUmq9JT176piPC1DR/h00y+oIQ3PMgF2rnAhi+xYxb0S8+H5Zm/ZbyBTb0HbU9NBt0Jy0hIP+fl8jrwjC3s6ma2tx/YwDly8iL0oizvdiAnNn77+Z9/1Y8AAwDPyUK2+0sSjAAAAABJRU5ErkJggg==",close:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6+R8AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAARlJREFUeNqUkrFqhEAQhvckWCVduMIi2BpQwcLCpDyuy2PcvYCN+CiB9BZqpcUR0gUEWx9CkRzkimtUnMxu3GVPr0gGPtjZnZ+Z/XdXAED+Gzez/BbZIxtkjXwh78gb8i2qaKeJJ6SB69EiG17LBY/IiZ72fX9RPQwDX54RSxYd6G4cx2DbNjTNb8O2bcFxHIiiiAs/uUhDRrqTZRmoqgqGYUBVVWBZFsuTJJGbP5BpVhFcqCjKNQGNF2Vup+u6RNd1Mo4j0TSNeJ639Fwej97BNE3WIQgCMWpd14vxhBFhGLLCNE3ZaZ7nLPd9f2GEsJzaWxTFxQXKsoSu67jltiyiPP/1cVezv3eH7JAtco8ckQ/kVf5GPwIMAFhkkB5Ap5/mAAAAAElFTkSuQmCC"}; 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="

    ";cookieuHtml+="";cookieuHtml+="";cookieuHtml+="En poursuivant votre navigation sur nos sites, vous acceptez l'installation et l'utilisation de cookies sur votre poste, notamment à des fins promotionnelles et/ou publicitaires, dans le respect de notre politique de protection de votre vie privée.";cookieuHtml+="

    ";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()}); 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;i0){if(!!fn){var fns=[],loopLen=this.listeners[ev].length;for(var i=0;i0||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="";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="";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"}M6.Tools=M6.Tools||{};M6.Tools.addOtherAttributes=function(giParams,params,prefix){M6.Console.groupCollapsed("M6.Tools.addOtherAttributes overloaded by GI","DOM");if(Object.prototype.toString.call(params)==="[object Array]"&¶ms.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");giParams[attName]=value}}}M6.Console.info(giParams,"DOM");M6.Console.groupEnd()};M6.Tools.setPrototypes("gi");M6.social.gi=M6.social.gi||function(){if(!M6.social.services._["gi"]){this.providers={facebook:0,twitter:0,google:0,pinterest:0,likedin:0,viadeo:0};this.options=window.gi_options||new Array;this.date=new Date;this.clientID="FSD1DSGF1KL";M6.Events.enable.call(this);M6.social.services._["gi"]=this}return M6.social.services._["gi"]};M6.social.gi.prototype.loadScript=function(){M6.Console.log("M6.social.gi.prototype.loadScript","GI DOM");var po=document.createElement("script");po.type="text/javascript";po.async=true;po.src="//tk.graphinsider.com/tgi.php?clientID="+this.clientID;M6.Console.warn(window.gi_options,"GI DOM");M6.Console.warn(window.giAsyncInit,"GI DOM");M6.Tools.checkScriptLoaded(po,function eventLoaded(callback){M6.Events.manager.fireEvent("gi.library.loaded",[callback])});var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(po,s);M6.social.gi.prototype.loadScript=function(){M6.Console.info("gi script already loaded","DOM")}};M6.social.gi.init=function funcM6SocialGiInit(){M6.Console.info("funcM6SocialGiInit","GI DOM");var giMain=new M6.social.gi;window.gi_options=giMain.options;window.giAsyncInit=function(){M6.Console.info("init GI with GI.init()","DOM");var giInitOpts={lang:"fr"};if(giMain.providers.facebook===1){GI.addEvent("onFbLoad",function(){M6.Events.manager.fireEvent("facebook.library.loaded")});giInitOpts.facebook={callit:true,display:true,status:true,cookie:true,xfbml:true}}if(giMain.providers.google===1){GI.addEvent("onGpLoad",function(){M6.Events.manager.fireEvent("google.library.loaded")});giInitOpts.gplus={callit:true,display:true}}if(giMain.providers.linkedin===1){GI.addEvent("onLinkLoad",function(){M6.Events.manager.fireEvent("linkedin.library.loaded")});giInitOpts.linkedin={callit:true,display:true}}if(giMain.providers.viadeo===1){GI.addEvent("onViLoad",function(){M6.Events.manager.fireEvent("viadeo.library.loaded")});giInitOpts.viadeo={callit:true,display:true}}if(giMain.providers.pinterest===1){GI.addEvent("onPintLoad",function(){M6.Events.manager.fireEvent("pinterest.library.loaded")});giInitOpts.pinterest={callit:true,display:true}}if(giMain.providers.twitter===1){GI.addEvent("onTwLoad",function(){M6.Events.manager.fireEvent("twitter.library.loaded")});giInitOpts.twitter={callit:true,display:true}}GI.init(giInitOpts)};giMain.loadScript();M6.Events.manager.removeListener("social.launch.load",M6.social.gi.init)};M6.Events.manager.addListener("social.launch.load",M6.social.gi.init);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={id:i.attr("id"),plugin:i.attr("id").split("_")[0].substring(7).toLowerCase()},d;var paramsKey,dataOptions=i.data();for(paramsKey in dataOptions){if(dataOptions.hasOwnProperty(paramsKey)){h[paramsKey]=dataOptions[paramsKey]}}if(typeof h.url!=="undefined"){h.countUrl=h.url}d="
    ";i.replaceWith(d);return GI.loadNewPlugins([h])};$(".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 gi=new M6.social.gi;gi.providers.twitter=1;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,params={},giMain=new M6.social.gi;if(typeof href==="undefined"){href=null}if(typeof layout==="undefined"){layout=null}if(layout!=="none"&&layout!=="horizontal"&&layout!=="vertical"&&layout!==null&&layout!==""){M6.Console.info("3rd parameter should be none/horizontal/vertical, current is "+layout)}params.id=idTag;params.plugin="tweet";if(href!==null){params.url=href}if(layout!==null){params.count=layout}if(arguments.length>3){this.addOtherAttributes(params,arguments[3])}$(idTag).removeClass("twitter-share-button");$(idTag).removeAttr("href");params.countUrl=params.url;giMain.options.push(params);myEl=document.getElementById(idTag);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,params={},giMain=new M6.social.gi;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")}params.id=idTag;params.plugin="follow";params.count="none";if(href!==null){params.url=href}if(layout!==null){params.count=!layout||layout===0||layout==="0"||layout==="false"||layout===false?"none":layout}if(arguments.length>3){if(arguments[3]["show-screen-name"]){params["displayName"]=arguments[3]["show-screen-name"];delete arguments[3]["show-screen-name"]}this.addOtherAttributes(params,arguments[3])}if(arguments[3]["show-screen-name"]>3){this.addOtherAttributes(params,arguments[3])}giMain.options.push(params);myEl=document.getElementById(idTag);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,params={},giMain=new M6.social.gi;if(typeof href==="undefined"){href=null}if(href===null){M6.Console.info("2nd parameter should not be null","DOM")}params.id=idTag;params.plugin="timelineTw";if(href!==null){params.url=href}if(arguments.length>3){}params.widgetid=arguments[3]["widget-id"];params.text="Chargement de la Timeline ...";giMain.options.push(params);M6.Console.warn(params);myEl=document.getElementById(idTag);M6.Console.groupEnd();return myEl};M6.social.google.prototype.loadScript=function(){M6.Console.info("M6.social.google.loadScript","DOM");var gi=new M6.social.gi;gi.providers.google=1;M6.social.google.prototype.loadScript=function(){M6.Console.info("google script already loaded","DOM")}};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,params={},giMain=new M6.social.gi;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")}params.id=idTag;params.plugin="+1";if(href!==null){params.url=href}if(layout!==null){params["annotation"]=layout}if(arguments.length>3){this.addOtherAttributes(params,arguments[3])}giMain.options.push(params);myEl=document.getElementById(idTag);M6.Console.groupEnd();return myEl};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,params={},giMain=new M6.social.gi;if(typeof href==="undefined"){href=null}params.id=idTag;params.plugin="badge";if(href!==null){params.url=href}if(arguments.length>3){this.addOtherAttributes(params,arguments[3])}giMain.options.push(params);myEl=document.getElementById(idTag);M6.Console.groupEnd();return myEl};M6.social.pinterest.prototype.loadScript=function(){M6.Console.info("M6.social.pinterest.loadScript","DOM");var gi=new M6.social.gi;gi.providers.pinterest=1;M6.social.pinterest.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,params={},giMain=new M6.social.gi;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}}params.id=idTag;params.plugin="pinit";if(href!==null){params.url=href}if(layout!==null){params["count-layout"]=layout}if(arguments.length>3){this.addOtherAttributes(params,arguments[3])}giMain.options.push(params);myEl=document.getElementById(idTag);M6.Console.groupEnd();return myEl};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={id:i.attr("id"),plugin:i.attr("id").split("_")[0].substring(8).toLowerCase()},d;var paramsKey,dataOptions=i.data();for(paramsKey in dataOptions){if(dataOptions.hasOwnProperty(paramsKey)){paramsValue=dataOptions[paramsKey];if(paramsKey==="href"){paramsKey="url";paramsValue=dataOptions["href"]}h[paramsKey]=paramsValue}}d="
    ";i.replaceWith(d);return GI.loadNewPlugins([h])};$(".M6SocialWidget.FacebookLike").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;M6.Console.info("no more FB.init via GI with coz this is GI thqt will manage everything... appId: "+myAppId+" and channelUrl: "+myChannelUrl,"DOM");M6.Console.groupEnd()};M6.social.facebook.prototype.loadScript=function(){M6.Console.info("M6.social.facebook.loadScript","DOM");var xmlNsFbName,htmlTag,divIdAttName,divFbRoot,id,js,s,gi;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)}gi=new M6.social.gi;gi.providers.facebook=1;M6.social.facebook.prototype.loadScript=function(){M6.Console.info("facebook script already loaded","DOM")}};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");var myEl,params={},giMain=new M6.social.gi;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")}params.id=idTag;params.plugin="like";params.send=false;params.showfaces=arguments.length>3&&typeof arguments[3]["show_faces"]!=="undefined"?arguments[3]["show_faces"]:false;if(href!==null){params.url=href}if(layout!==null){params.layout=layout}if(arguments.length>3){this.addOtherAttributes(params,arguments[3])}if(typeof params["show_faces"]!=="undefined")delete params["show_faces"];M6.Console.warn(arguments);M6.Console.warn(params);giMain.options.push(params);var myEl=document.getElementById(idTag);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");var myEl,params={},giMain=new M6.social.gi;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}params.id=idTag;params.plugin="likebox";if(href!==null){params.url=href}if(layout!==null){params.layout=layout}if(arguments.length>3){this.addOtherAttributes(params,arguments[3])}giMain.options.push(params);var myEl=document.getElementById(idTag);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");var myEl,params={},giMain=new M6.social.gi;layout=layout||null;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}params.id=idTag;params.plugin="recommendation";if(href!==null){params.url=href}if(layout!==null){params.side=layout}if(arguments.length>3){this.addOtherAttributes(params,arguments[3])}giMain.options.push(params);myEl=document.getElementById(idTag);M6.Console.groupEnd();return myEl};M6.social.linkedin.prototype.loadScript=function(){M6.Console.info("M6.social.linkedin.loadScript","DOM");var gi=new M6.social.gi;gi.providers.linkedin=1;M6.social.linkedin.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,params={},giMain=new M6.social.gi;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")}params.id=idTag;params.plugin="linkedin";if(href!==null){params.url=href}if(layout!==null){params.counter=layout}if(arguments.length>3){}giMain.options.push(params);myEl=document.getElementById(idTag);M6.Console.groupEnd();return myEl};M6.social.viadeo.prototype.loadScript=function(){M6.Console.info("M6.social.viadeo.loadScript","DOM");var gi=new M6.social.gi;gi.providers.viadeo=1;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,params={},giMain=new M6.social.gi;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")}params.id=idTag;params.plugin="viadeo";if(href!==null){params.url=href}if(arguments.length>3){this.addOtherAttributes(params,arguments[3])}giMain.options.push(params);myEl=document.getElementById(idTag);M6.Console.groupEnd();return myEl}})(); (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 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
    "+"Recommencez dans quelques
    instants');};return;\">Connectez-vous à Facebook ici
    ";$(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
    "+'Vérifiez les droits';$(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)+"... ";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="X "+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)})(); (function(){if(typeof M6==="undefined"||typeof M6.social==="undefined"){throw"M6.social object is not available"}if(typeof GI==="undefined"){M6.Console.warn("GI object is not available")}M6.social.gi.apiWaiting={_loaderLaunched:false,_loaded:false,loadWhenReady:function(myFunc){M6.Console.groupCollapsed("M6.social.gi.apiWaiting.loadWhenReady","loadWhenReady");M6.Console.info(myFunc,"loadWhenReady");M6.Console.info("name: "+myFunc.name,"loadWhenReady");if(!M6.social.gi.apiWaiting.isReady()){M6.Console.info("addListener","loadWhenReady");if(!M6.social.gi.apiWaiting._loaderLaunched){M6.social.gi.apiWaiting._loaderLaunched=true;M6.Events.manager.addListener("gi.library.loaded",M6.social.gi.apiWaiting.setLoaded)}M6.Events.manager.addListener("gi.library.loaded",myFunc)}else{M6.Console.info("callback executed directly","loadWhenReady");myFunc()}M6.Console.groupEnd();return this},isReady:function(){var returnedData=false;if(M6.social.gi.apiWaiting._loaded){returnedData=true}return returnedData},setLoaded:function(){M6.Console.info("M6.social.gi.apiWaiting.setLoaded","loadWhenReady");M6.social.gi.apiWaiting._loaded=true;M6.Events.manager.removeListener("gi.library.loaded",M6.social.gi.apiWaiting.setLoaded);return this}};M6.Events.manager.addListener("gi.library.loaded",M6.social.gi.apiWaiting.setLoaded)})(); (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:"×",navigate:{previous:"‹ précédent",next:"suivant ›",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:'
    ',alert:'
    ',image:'
    ',steps:'
    '}};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=$("").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=0&&index0){this.$content.find(".lb-previous").removeClass("lb-disable")}else{this.$content.find(".lb-previous").addClass("lb-disable")}this.$content.find(".lb-next").html(index *").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&&index0){this.$content.find(".lb-previous").removeClass("lb-disable")}else{this.$content.find(".lb-previous").addClass("lb-disable")}this.$content.find(".lb-next").html(index0?""+subtitle+"":""));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($("
    ").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($("").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);$("