var current_playing="";var soundz="";var oldi="";var current;currentplayer="";currentlength="";currentstate="";lastClick="";windowScroll="";currenti="";function loadFlash(){if(Browser.Plugins.Flash.version<10){new Element("div",{id:"flashalert"}).setStyles({position:"absolute"}).set("html",'Ce site requiert Flash player 10, cliquer <a href="http://www.adobe.com/fr/products/flashplayer/" target="_blank">ici</a> pour le t&eacute;l&eacute;charger').inject($(document.body),"top")}new Element("div",{id:"playercontainer"}).setStyles({overflow:"hidden",height:1,width:1,position:"absolute","z-index":"100",left:0,top:window.getScrollTop().toInt()}).inject($("video_content"),"top");$(document.body).addClass("hasplayer");var a=new Swiff("/wp-content/themes/division/flash/player/cplayer.swf",{id:"soundz",container:"playercontainer",width:690,height:400,params:{wmode:"transparent",bgcolor:"#ffffff",allowscriptaccess:"always",allowfullscreen:"true"},vars:{file:"",title:"division",autostart:false,controlbar:"over",skin:"/wp-content/themes/division/flash/player/stylish2.swf",repeat:"none"}});return a}function loadPlayer(e,b){var a=e.split(".flv");var d=a[0]+".jpg";var c=new Swiff("/wp-content/themes/division/flash/player/cplayer.swf",{id:"ctrl_"+b,container:b,width:690,height:400,params:{wmode:"transparent",bgcolor:"#ffffff",allowscriptaccess:"always",allowfullscreen:"true"},vars:{file:e,title:"division video",autostart:false,controlbar:"over",skin:"/wp-content/themes/division/flash/player/stylish2.swf",repeat:"none",image:d}});return c}function playerReady(a){initSingleVideo();$("soundz").addModelListener("STATE","stateAction")}function stateAction(a){currentstate=a.newstate;if(lastClick){lastClick.removeClass("PAUSED");lastClick.removeClass("COMPLETED");lastClick.removeClass("BUFFERING");lastClick.removeClass("COMPLETED");lastClick.removeClass("PLAYING");lastClick.addClass(a.newstate);if(a.newstate=="COMPLETED"){windowScroll.toElement(lastClick)}}}function loadplay(b){if(b==current_playing){$("soundz").sendEvent("PLAY");return}current_playing=b;var a=b;$("soundz").sendEvent("LOAD",a)}function initHomePlayer(){if(!$("video_content")){return}loadFlash();$("video_content").setStyles({position:"relative"});$$("#video_content div.post a.btnplay").each(function(b,a){b.addEvent("click",function(c){$("playercontainer").setStyles({display:"block",height:400,width:690,top:0,left:690*a});loadplay(this.getProperty("path"));$("soundz").sendEvent("PLAY")})})}function _directorsVidInit(b){$$("#video_content h3.posttitle").set("html",b.getProperty("title"));var a=b.getNext().getChildren("p.small-infos")[0];var c=b.getNext().getChildren(".post-full-infos")[0];if(a&&$$("#video_content .small-infos")[0]){$$("#video_content .small-infos")[0].set("html",a.get("html"))}if(c&&$$("#video_content .post-full-infos")[0]){$$("#video_content .post-full-infos")[0].set("html",c.get("html"))}if(!$chk(c.get("html").clean())){$$(".post-infos a.btn-toggler")[0].setStyle("visibility","hidden")}else{$$(".post-infos a.btn-toggler")[0].setStyle("visibility","visible")}Cufon.refresh();$("playercontainer").setStyles({display:"block",height:400,width:690,bottom:0});loadplay(b.getProperty("path"));lastClick=b;windowScroll.toElement($("playercontainer"))}function initDirectorsPlayer(){$$("a.videolink").addEvent("click",function(a){new Event(a).stop();_directorsVidInit(this)});$$("a.videolinkbis").addEvent("click",function(b){new Event(b).stop();var a=this.getParent().getParent().getPrevious();_directorsVidInit(a)})}function initSingleVideo(){if(!$(document.body).hasClass("single-video")){return}$$(".btnplay")[0].fireEvent("click")}window.addEvent("domready",function(k){$$(".clrzplayer").each(function(r,e){if(r.getChildren("a")[0]){loadPlayer(r.getChildren("a")[0].getProperty("href"),r.getProperty("id"))}});windowScroll=new Fx.Scroll($(document.body),{offset:{x:0,y:-100},transition:Fx.Transitions.Quart.easeOut,onComplete:function(){if(currentstate=="IDLE"||currentstate==""){$("soundz").sendEvent("PLAY")}}});initDirectorsPlayer();initHomePlayer();InputValue("search");InputValue("s");SmoothieRollOver();SideSmoothieRollOver();var h=new Tips($$(".infobulle"),{showDelay:400,hideDelay:400,offset:{x:0,y:-50},fixed:false});var j=$$(".btn-learnmore");var l=$$(".post-full-infos");j.each(function(r,e){r.addEvents({click:function(){if(r.hasClass("btn_close")){r.removeClass("btn_close");r.addClass("btn_open");r.innerHTML="Learn more"}else{r.removeClass("btn_open");r.addClass("btn_close");r.innerHTML="Close"}}})});var p=new Accordion(j,l,{display:-1,height:true,width:false,opacity:false,fixedHeight:false,fixedWidth:false,alwaysHide:true});if($("video_content")){var m=[];$$("#video_content div.post-infos").each(function(r,e){m[e]=new Fx.Morph(r,{duration:600,wait:false,transition:Fx.Transitions.Expo.easeOut})});var o=false;if($$("#video_container #video_content li").length>1){var f=new clrzSlider({perpage:1,setpage:0,layout:"horizontal",container:"video_container",items:"#video_container #video_content li",contentslider:"video_content",btnprev:"#archive-nav a.previous",btnnext:"#archive-nav a.next",bordertransition:"quint:InOut",duration:600,srolling:false,onInitialize:function(i){$("newspage").addClass("page");for(g=1;g<=this.maxpage;g=g+1){$("newspage").clone().inject($("newspage"),"after")}$$("#archive-nav li.page a").each(function(r,e){r.addEvent("click",function(s){new Event(s).stop();f.zgoto(e)})})},onZgoto:function(i){if(currentstate=="PLAYING"&&$(document.body).hasClass("home")){$("soundz").sendEvent("PLAY")}m.each(function(r,e){r.start({opacity:0})});if(!o){m[0].start({opacity:1})}o=true;$$("#archive-nav li.page").each(function(r,e){r.removeClass("active")});$$("#archive-nav li.page")[this.setpage].addClass("active");p.display(-1);$$("a.btn-toggler").each(function(r,e){r.removeClass("btn_close");r.addClass("btn_learnmore")})},onZgotocomplete:function(){m[this.setpage].start({opacity:1});if(Browser.Platform.mac==true&&$(document.body).hasClass("home")){$("playercontainer").setStyles({left:-2000})}}})}}var d=new clrzSlider({perpage:3,setpage:0,marge:15,layout:"horizontal",container:"archive-container",items:"#archive-container #archive-content div.post",contentslider:"archive-content",btnprev:"#archive-nav a.previous",btnnext:"#archive-nav a.next",bordertransition:"quint:InOut",onInitialize:function(i){$("newspage").addClass("page");if(this.maxpage==0){$("archive-nav").hide()}for(g=1;g<=this.maxpage;g=g+1){$("newspage").clone().inject($("newspage"),"after")}$$("#archive-nav li.page a").each(function(r,e){r.addEvent("click",function(s){new Event(s).stop();d.zgoto(e)})})},onZgoto:function(i){$$("#archive-nav li.page").removeClass("active");$$("#archive-nav li.page")[this.setpage].addClass("active")}});var q=0;if(document.body.hasClass("single-video")){q=1}var a=new Fx.Accordion($$(".switcher_btn"),$$(".switcher_tab"),{show:q,duration:850,onActive:function(i,e){i.addClass("current");e.removeClass("hiddenvector");$("switcherbox").removeClass("static")},onBackground:function(i,e){i.removeClass("current");e.addClass("hiddenvector")},onComplete:function(i,e){$("switcherbox").addClass("static")}});var b=[];var c=[];$$(".togglerz").each(function(r,e){b[e]=r.id;r.addEvents({click:function(){var i=$("archive-nav");raztoggler(r,i)}})});$$(".contentz").each(function(r,e){c[e]=r.id});for(var g=0;g<=b.length;g++){var n=new Accordion($$("#"+b[g]),$$("#"+c[g]),{display:0,height:true,width:false,opacity:false,fixedHeight:false,fixedWidth:false,alwaysHide:true})}});function raztoggler(b,a){if(b.id=="t-archive"){if(a.hasClass("ok")){a.removeClass("ok");a.addClass("non")}else{a.removeClass("non");a.addClass("ok")}}if(b.hasClass("plus")){b.removeClass("plus")}else{b.addClass("plus")}}function SmoothieRollOver(){var a=[];$$(".roll").each(function(c,b){a[b]=new Fx.Morph(c,{duration:600,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({opacity:0})});$$(".box").each(function(c,b){c.addEvents({mouseenter:function(d){a[b].start({opacity:1})},mouseleave:function(d){a[b].start({opacity:0})}})})}function SideSmoothieRollOver(){var a=[];var b=[];$$(".text_link").each(function(d,c){b[c]=new Fx.Morph(d,{duration:600,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({opacity:1})});$$(".item_link").each(function(d,c){d.addEvents({mouseover:function(f){b[c].start({color:"#FF0000"})},mouseleave:function(f){b[c].start({color:"#000000"})}})})}function InputValue(b){if(!$(b)){return}var a=$(b).get("value");$(b).addEvents({focus:function(){if(a==this.get("value")){this.setProperty("value","")}},blur:function(){if(this.get("value")==""){this.setProperty("value",a)}}})};