$(document).ready(function(){$(".infoPlayer .embeded input").length&&$(".infoPlayer .embeded input").focus(function(){$(this).select()});$(".block-video-listeVideo").length&&$("div.qtip").hover(function(){$(this).children().show();$("#container").offset().left>$(".qtipExpand",this).offset().left?($(".qtipExpand",this).addClass("right"),$(".arrowLeftTips_png",this).addClass("arrowRightTips_png").removeClass("arrowLeftTips_png")):$(".qtipExpand",this).addClass("left")},function(){var a=$(".qtipExpand",
this),c=setTimeout(function(){a.hide()},50);$(".qtipExpand",this).mouseenter(function(){clearTimeout(c)});$(".qtipExpand",this).mouseleave(function(){a.hide()})});$(".block-video-tableVideo").length&&($(".block-video-tableVideo table .video a").live("mouseenter",function(){$(this).parents("tr").find("td").css("text-decoration","underline")}),$(".block-video-tableVideo table .video a").live("mouseleave",function(){$(this).parents("tr").find("td").css("text-decoration","none")}),$(".block-video-tableVideo table").tablesorter({sortList:[[2,
1]],dateFormat:"uk",widgets:["zebra"]}),$(".block-video-tableVideo table .tip").length&&($(".block-video-tableVideo table .video a").live("mouseenter",function(){$(this).parents("tr").find(".tip").show()}),$(".block-video-tableVideo table .video a").live("mouseleave",function(){$(this).parents("tr").find(".tip").hide()})));$("#rechercherVideo input:text").defaultValue("Ex : Vid\u00e9o test Mass Effect 2");$("#rechercherVideo form").submit(function(){if(""==$("#rechercherVideo input:text").val()||
"Ex : Vid\u00e9o test Mass Effect 2"==$("#rechercherVideo input:text").val())return window.location=$("#defaultVideo").val(),!1});$(".infoPlayer .ticker").length&&$.ajax({url:"/ajax.php?action=slideComments",type:"POST",data:{id:$(".infoPlayer .ticker").attr("id").replace("ticker",""),type:"fiche videotv"},dataType:"json",success:function(a){if(0==a.length)$(".infoPlayer .ticker").next(".interligne").remove(),$(".infoPlayer .ticker").remove();else{0==$(".infoPlayer .ticker ul").length&&$(".infoPlayer .ticker").append("<ul />");
var c=1;$.each(a,function(a,b){0<b.contenu.length&&(150<=b.contenu.length&&(b.contenu=b.contenu.substring(0,147)+"..."),$(".infoPlayer .ticker ul").append("<li"+(1<c?" style='display:none;'":"")+"><div>"+b.nom_membre+' > </div><a href="'+b.url+'" class="bleu1">'+b.contenu+"</a></li>"),c++)});setInterval(function(){$(".infoPlayer .ticker ul li:visible").fadeOut("slow",function(){0==$(this).next("li").length?$(".infoPlayer .ticker ul li:first").fadeIn("slow"):$(this).next().fadeIn("slow")})},1E4)}}});
$("#linkDescriptionComplete").click(function(){$(".descriptionComplete").goTo()});var d=window.location.href.split("#view:");d[1]&&$.ajax({url:"/include/ajax/videoUrlView.php",type:"POST",data:{id:d[1]},success:function(a){window.location.replace(a)}});$("#update_video").live("click",function(){$.ajax({type:"POST",url:"/ajax.php?action=moderation_video_internaute",data:{id:$("#id").val(),titre:$("#titre").val(),id_type:$("#id_type").val(),shortdescription:$("#shortdescription").val(),longdescription:$("#longdescription").val(),
hide_video:$("#hide_video").is(":checked")},success:function(a){document.getElementById("edit_video_modo").innerHTML=a}})});$(".playlistVideo").click(function(){idVideo=$(this).attr("rel");currentIdVideo=$(".block-video-headerVideo .playlist li.active a").attr("rel");if(currentIdVideo==idVideo)return!1;$(this).closest("li").siblings().removeClass("active");$(this).closest("li").addClass("active");if(0<idVideo)return $.ajax({url:"/ajax.php?action=getPlayer&width=580&height=328&idVideo="+idVideo,dataType:"json",
success:function(a){$(".playerDiv:first").html(a.player);$(".description_video h3").html(a.titre);$(".description_video span.bleu1").html(a.description);$(".block-video-headerVideo .button.left a").attr("href",a.url);$(".block-video-headerVideo .button.left a").attr("title",a.commentaires);$(".block-video-headerVideo .button.left span").html(a.commentaires)}}),!1});getNextVideo=function(){if(0<$("#upload_video").length){current_video=$("#playlist li.active");next_video=$("#playlist li.active").next();
current_video.removeClass("active");next_video.addClass("active");var a=$("#playlist li.active").find(".id_video").val();0<a&&$.ajax({url:"/ajax.php?action=getPlayer&width=640&height=362&idVideo="+a,dataType:"json",success:function(a){$(".playerDiv:first").html(a.player);$(".block-video-vosVideos .playerLeft .description_video h3").html(a.jeu);$(".block-video-vosVideos .playerLeft .description_video p a").html(a.auteur);$(".block-video-vosVideos .playerLeft .description_video span").html(a.titre);
$(".block-video-vosVideos .playerLeft .description_video .details p.categ").html(a.categorie);$(".block-video-vosVideos .playerLeft .description_video a:first").attr("href",a.url);$(".block-video-vosVideos .playerLeft .button.right a").attr("href",a.url);$(".block-video-vosVideos .playerLeft .button.right a").attr("title",a.commentaires);$(".block-video-vosVideos .playerLeft .button.right a span").html(a.commentaires)}});return!1}0<$("#playlist li.active").next().find("a").length&&(playerOffset=$(".playerDiv").offset(),
maxOffset=playerOffset.top+100,325>maxOffset&&(maxOffset=325),$(window).scrollTop()<maxOffset&&(window.location=$("#playlist li.active").next().find("a").attr("href")))};$("#home.chaineVideo h2.orange1 a.nlchaines, #home.playerVideo div.headerVideo a.nlchaines").click(function(){showLayerNL()})});
function check_hide_video(d){1!=d||confirm("Vous allez cacher cette vid\u00e9o, elle ne sera plus visible \n et il faudra l'intervention d'un admin pour la r\u00e9afficher \n\n \u00eates vous s\u00fbr ?")||(document.getElementById("hide_video").checked=!1)};


(function(b){b.extend({tablesorter:new function(){function a(c,a){l(c+","+((new Date).getTime()-a.getTime())+"ms")}function l(c){"undefined"!=typeof console&&"undefined"!=typeof console.debug?console.log(c):alert(c)}function h(c,a){if(c.config.debug)var e="";var f=c.tBodies[0].rows;if(c.tBodies[0].rows[0])for(var d=[],f=f[0].cells,C=f.length,k=0;k<C;k++){var p=!1;b.metadata&&b(a[k]).metadata()&&b(a[k]).metadata().sorter?p=r(b(a[k]).metadata().sorter):c.config.headers[k]&&c.config.headers[k].sorter&&
(p=r(c.config.headers[k].sorter));if(!p)a:{for(var p=c,m=f[k],n=q.length,u=1;u<n;u++)if(q[u].is(b.trim(y(p.config,m)),p,m)){p=q[u];break a}p=q[0]}c.config.debug&&(e+="column:"+k+" parser:"+p.id+"\n");d.push(p)}c.config.debug&&l(e);return d}function r(c){for(var a=q.length,b=0;b<a;b++)if(q[b].id.toLowerCase()==c.toLowerCase())return q[b];return!1}function t(c){if(c.config.debug)var g=new Date;for(var e=c.tBodies[0]&&c.tBodies[0].rows.length||0,f=c.tBodies[0].rows[0]&&c.tBodies[0].rows[0].cells.length||
0,d=c.config.parsers,l={row:[],normalized:[]},k=0;k<e;++k){var p=c.tBodies[0].rows[k],m=[];l.row.push(b(p));for(var n=0;n<f;++n)m.push(d[n].format(y(c.config,p.cells[n]),c,p.cells[n]));m.push(k);l.normalized.push(m)}c.config.debug&&a("Building cache for "+e+" rows:",g);return l}function y(c,a){if(!a)return"";var e="";return e="simple"==c.textExtraction?a.childNodes[0]&&a.childNodes[0].hasChildNodes()?a.childNodes[0].innerHTML:a.innerHTML:"function"==typeof c.textExtraction?c.textExtraction(a):b(a).text()}
function w(c,g){if(c.config.debug)var e=new Date;for(var f=g.row,d=g.normalized,l=d.length,k=d[0].length-1,p=b(c.tBodies[0]),m=[],n=0;n<l;n++)if(m.push(f[d[n][k]]),!c.config.appender)for(var h=f[d[n][k]],q=h.length,s=0;s<q;s++)p[0].appendChild(h[s]);c.config.appender&&c.config.appender(c,m);m=null;c.config.debug&&a("Rebuilt table:",e);x(c);setTimeout(function(){b(c).trigger("sortEnd")},0)}function D(c){if(c.config.debug)var g=new Date;for(var e=0;e<c.tHead.rows.length;e++);$tableHeaders=b("thead th",
c);$tableHeaders.each(function(a){this.count=0;this.column=a;var d=c.config.sortInitialOrder;this.order=i="Number"!=typeof d?"desc"==d.toLowerCase()?1:0:1==d?d:0;d=b.metadata&&!1===b(this).metadata().sorter?!0:!1;d||(d=c.config.headers[a]&&!1===c.config.headers[a].sorter?!0:!1);d&&(this.sortDisabled=!0);this.sortDisabled||b(this).addClass(c.config.cssHeader);c.config.headerList[a]=this});c.config.debug&&(a("Built headers:",g),l($tableHeaders));return $tableHeaders}function x(a){for(var b=a.config.widgets,
e=b.length,f=0;f<e;f++)z(b[f]).format(a)}function z(a){for(var b=v.length,e=0;e<b;e++)if(v[e].id.toLowerCase()==a.toLowerCase())return v[e]}function E(a,b){for(var e=b.length,f=0;f<e;f++)if(b[f][0]==a)return!0;return!1}function A(a,g,e,f){g.removeClass(f[0]).removeClass(f[1]);var d=[];g.each(function(a){this.sortDisabled||(d[this.column]=b(this))});a=e.length;for(g=0;g<a;g++)d[e[g][0]].addClass(f[e[g][1]])}function F(a,g){if(a.config.widthFixed){var e=b("<colgroup>");b("tr:first td",a.tBodies[0]).each(function(){e.append(b("<col>").css("width",
b(this).width()))});b(a).prepend(e)}}function B(c,b,e){if(c.config.debug)var f=new Date;for(var d="var sortWrapper = function(a,b) {",l=b.length,k=0;k<l;k++)var p=b[k][0],m=b[k][1],n="e"+k,d=d+("var "+n+" = "+("text"==c.config.parsers[p].type?0==m?"sortText":"sortTextDesc":0==m?"sortNumeric":"sortNumericDesc")+"(a["+p+"],b["+p+"]); "),d=d+("if("+n+") { return "+n+"; } "),d=d+"else { ";k=e.normalized[0].length-1;d+="return a["+k+"]-b["+k+"];";for(k=0;k<l;k++)d+="}; ";d+="return 0; }; ";eval(d);e.normalized.sort(sortWrapper);
c.config.debug&&a("Sorting on "+b.toString()+" and dir "+m+" time:",f);return e}var q=[],v=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:!1,cancelSelection:!0,sortList:[],headerList:[],dateFormat:"us",decimal:".",debug:!1};this.benchmark=a;this.construct=function(a){return this.each(function(){if(this.tHead&&
this.tBodies){var g,e,f,d;this.config={};d=b.extend(this.config,b.tablesorter.defaults,a);g=b(this);e=D(this);this.config.parsers=h(this,e);f=t(this);var l=[d.cssDesc,d.cssAsc];F(this);e.click(function(a){g.trigger("sortStart");var c=g[0].tBodies[0]&&g[0].tBodies[0].rows.length||0;if(!this.sortDisabled&&0<c){b(this);c=this.column;this.order=this.count++%2;if(a[d.sortMultiSortKey])if(E(c,d.sortList))for(a=0;a<d.sortList.length;a++){var m=d.sortList[a],n=d.headerList[m[0]];m[0]==c&&(n.count=m[1],n.count++,
m[1]=n.count%2)}else d.sortList.push([c,this.order]);else{d.sortList=[];if(null!=d.sortForce){m=d.sortForce;for(a=0;a<m.length;a++)m[a][0]!=c&&d.sortList.push(m[a])}d.sortList.push([c,this.order])}setTimeout(function(){A(g[0],e,d.sortList,l);w(g[0],B(g[0],d.sortList,f))},1);return!1}}).mousedown(function(){if(d.cancelSelection)return this.onselectstart=function(){return!1},!1});g.bind("update",function(){this.config.parsers=h(this,e);f=t(this)}).bind("sorton",function(a,c){b(this).trigger("sortStart");
d.sortList=c;for(var g=d.sortList,n=this.config,h=g.length,s=0;s<h;s++){var q=g[s],r=n.headerList[q[0]];r.count=q[1];r.count++}A(this,e,g,l);w(this,B(this,g,f))}).bind("appendCache",function(){w(this,f)}).bind("applyWidgetId",function(a,c){z(c).format(this)}).bind("applyWidgets",function(){x(this)});b.metadata&&(b(this).metadata()&&b(this).metadata().sortlist)&&(d.sortList=b(this).metadata().sortlist);0<d.sortList.length&&g.trigger("sorton",[d.sortList]);x(this)}})};this.addParser=function(a){for(var b=
q.length,e=!0,f=0;f<b;f++)q[f].id.toLowerCase()==a.id.toLowerCase()&&(e=!1);e&&q.push(a)};this.addWidget=function(a){v.push(a)};this.formatFloat=function(a){a=parseFloat(a);return isNaN(a)?0:a};this.formatInt=function(a){a=parseInt(a);return isNaN(a)?0:a};this.isDigit=function(a,g){return RegExp("^(((\\d{1,3})(\\s\\d{3})*)|(\\d+))(\\"+g.decimal+"\\d+)?$").test(b.trim(a))};this.clearTableBody=function(a){b.browser.msie?function(){for(;this.firstChild;)this.removeChild(this.firstChild)}.apply(a.tBodies[0]):
a.tBodies[0].innerHTML=""}}});b.fn.extend({tablesorter:b.tablesorter.construct});var h=b.tablesorter;h.addParser({id:"text",is:function(a){return!0},format:function(a){return b.trim(a.toLowerCase())},type:"text"});h.addParser({id:"digit",is:function(a,l){return b.tablesorter.isDigit(a,l.config)},format:function(a){return b.tablesorter.formatFloat(a.replace(/\s/,""))},type:"numeric"});h.addParser({id:"currency",is:function(a){return/^[\u00a3$\u20ac?.]/.test(a)},format:function(a){return b.tablesorter.formatFloat(a.replace(RegExp(/[^0-9.]/g),
""))},type:"numeric"});h.addParser({id:"ipAddress",is:function(a){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(a)},format:function(a){a=a.split(".");for(var l="",h=a.length,r=0;r<h;r++)var t=a[r],l=2==t.length?l+("0"+t):l+t;return b.tablesorter.formatFloat(l)},type:"numeric"});h.addParser({id:"url",is:function(a){return/^(https?|ftp|file):\/\/$/.test(a)},format:function(a){return jQuery.trim(a.replace(RegExp(/(https?|ftp|file):\/\//),""))},type:"text"});h.addParser({id:"isoDate",is:function(a){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a)},
format:function(a){return b.tablesorter.formatFloat(""!=a?(new Date(a.replace(RegExp(/-/g),"/"))).getTime():"0")},type:"numeric"});h.addParser({id:"percent",is:function(a){return/\%$/.test(b.trim(a))},format:function(a){return b.tablesorter.formatFloat(a.replace(RegExp(/%/g),""))},type:"numeric"});h.addParser({id:"usLongDate",is:function(a){return a.match(RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/))},format:function(a){return b.tablesorter.formatFloat((new Date(a)).getTime())},
type:"numeric"});h.addParser({id:"shortDate",is:function(a){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(a)},format:function(a,l){var h=l.config;a=a.replace(/\-/g,"/");if("us"==h.dateFormat)a=a.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2");else if("uk"==h.dateFormat)a=a.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1");else if("dd/mm/yy"==h.dateFormat||"dd-mm-yy"==h.dateFormat)a=a.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3");return b.tablesorter.formatFloat((new Date(a)).getTime())},
type:"numeric"});h.addParser({id:"time",is:function(a){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(a)},format:function(a){return b.tablesorter.formatFloat((new Date("2000/01/01 "+a)).getTime())},type:"numeric"});h.addParser({id:"metadata",is:function(a){return!1},format:function(a,l,h){a=l.config;a=!a.parserMetadataName?"sortValue":a.parserMetadataName;return b(h).metadata()[a]},type:"numeric"});h.addWidget({id:"zebra",format:function(a){if(a.config.debug)var h=new Date;
b("tr:visible",a.tBodies[0]).filter(":even").removeClass(a.config.widgetZebra.css[1]).addClass(a.config.widgetZebra.css[0]).end().filter(":odd").removeClass(a.config.widgetZebra.css[0]).addClass(a.config.widgetZebra.css[1]);a.config.debug&&b.tablesorter.benchmark("Applying Zebra widget",h)}})})(jQuery);


(function(b){b.fn.tinycarousel=function(a){function u(){a.controls&&(0<n.length&&0<p.length)&&(n.click(function(){e(-1);return!1}),p.click(function(){e(1);return!1}));a.pager&&0<q.length&&q.click(v)}function w(){a.controls&&(n.toggleClass("disable",!(0<c)),p.toggleClass("disable",!(c+1<h)));if(a.pager){var s=b(".pagenum",q);s.removeClass("active");b(s[c]).addClass("active")}}function v(a){a=a.target;b(a).hasClass("pagenum")&&(c=parseInt(a.rel)-1,e(1));return!1}function x(b){a.interval&&!b&&(clearInterval(t),
t=window.setInterval(function(){r=c+1==h?!1:0==c?!0:r;e(r?1:-1,!0)},a.intervaltime))}function e(b,e){if(-1<c+b&&c+b<h){c+=b;var d={};d[f?"left":"top"]=-(c*k*a.display);g.animate(d,{queue:!1,duration:a.animation?a.duration:0,complete:function(){"function"==typeof a.callback&&a.callback.call(this,l[c],c)}});w();x(e)}}a=b.extend({start:1,display:1,axis:"x",controls:!0,pager:!1,interval:!1,intervaltime:3E3,animation:!0,duration:500,callback:null},a);var d=b(this),m=b(".viewport",d),g=b(".overview",d),
l=g.children(),p=b(".next",d),n=b(".prev",d),q=b(".pager",d),k,h,c,t,r=!0,f="x"==a.axis;return this.each(function(){g.css({"list-style":"none",position:"absolute",left:0,top:0,margin:0,padding:0}).find("li").css("float","left");k=f?b(l[0]).outerWidth(!0):b(l[0]).outerHeight(!0);m.css(f?"width":"height",k*a.display).css({overflow:"hidden",position:"relative"});var d=Math.ceil((f?m.outerWidth():m.outerHeight())/(k*a.display)-1);h=Math.max(1,Math.ceil(l.length/a.display)-d);c=Math.min(h,Math.max(1,a.start))-
2;g.css(f?"width":"height",k*l.length);m.css(f?"height":"width",f?g.find("li:first").outerHeight(!0):g.find("li:first").outerWidth(!0));e(1);u()})}})(jQuery);