(function(c){var b=[];c.preLoadImages=function(){var g=arguments.length;for(var f=g;f--;){var e=document.createElement("img");e.src=arguments[f];b.push(e)}};function d(){var e=c("img.resize");var f=8/5;e.width((c(window).width()));e.height(c(window).width()/f);if(e.height()<c(window).height()){e.height(c(window).height());e.width(c(window).height()*f)}}c(window).resize(function(){d()});if(c("#home").length){c("#introtxt").fadeIn(1000).delay(200).fadeOut(1000);c("#slider1").anythingSlider({expand:true,resizeContents:false,buildArrows:false,buildNavigation:false,buildStartStop:false,autoPlay:false,delay:3000,easing:"easeOutExpo"});d();c("#wrapper").delay(2000).fadeIn(1000,function(){c(".mainlogo").animate({top:"0"},1000,"easeOutExpo");c("nav.menu").delay(400).fadeIn(1000)})}if(c("#portfolio").length){c.preLoadImages("images/loading.gif");c("div.titlepreview").hide();c(window).bind("hashchange",function(){var f=window.location.hash||"#filter=.preview";c('#filters a[href="'+f+'"]').addClass("selected");var f=f.replace("#filter=.",".");var g=c("#container");g.imagesLoaded(function(){g.isotope({itemSelector:".element",filter:f,animationOptions:{duration:1000}});if(f==".preview"){c("#container .preview").each(function(j){c(this).delay(j*100).fadeIn()})}else{c("#container .element").show()}});var e=c("#dynfilters .option-set"),h=e.find("a");h.click(function(){var n=c(this);if(n.hasClass("selected")){return false}var k=n.parents(".option-set");k.find(".selected").removeClass("selected");n.addClass("selected");var i={},j=k.attr("data-option-key"),l=n.attr("data-option-value");l=l==="false"?false:l;i[j]=l;if(j==="layoutMode"&&typeof changeLayoutMode==="function"){changeLayoutMode(n,i)}else{g.isotope(i)}var m=n.attr("href");c.bbq.pushState(m)})});c(window).trigger("hashchange");c("div.element:not(.isotope-hidden)").live("click",function(h){c("body").append('<img class="loader" src="images/loading.gif" alt="">');var g=c(this).index()+1;var f=c(this).parent().children("div:lt("+g+"):not(.isotope-hidden)").length;var i=window.location.hash||"#filter=.preview";if(i=="#filter=.preview"){var e="preview"}if(i=="#filter=.campagnes"){var e="campagnes"}if(i=="#filter=.interactif"){var e="interactif"}if(i=="#filter=.videos"){var e="videos"}if(i=="#filter=.imprimes"){var e="imprimes"}if(i=="#filter=.identites"){var e="identites"}if(i=="#filter=.studiophotos"){var e="studiophotos"}c("#wrapper").load("sliders.html #"+e,function(){c("img.loader").remove();c("#wrapper .slider").anythingSlider({expand:true,resizeContents:false,buildArrows:true,buildNavigation:false,buildStartStop:false,autoPlay:false,delay:5000,onInitialized:function(l){d();c("video").VideoJS();var j=c(this).find("li:not(.cloned)");j.each(function(){var n=c(this).find(".desc h2").text();var m=c(this).find(".desc h4").text();c(this).append("<div class='information'><h2>"+n+"</h2><h4>"+m+"</h4></div>")});c("#wrapper, #closer").fadeIn(600);c("#contentholder").hide();var k=c(this).data("AnythingSlider").options;k.animationTime=0;c(this).anythingSlider(f);k.animationTime=600}})})});c("#closer").live("click",function(e){c(".video video").each(function(){this.pause()});c("#wrapper, .anythingSlider").hide();c("#contentholder").show();c("#container").isotope("resize");c("#container div.element img").stop(true,true).fadeTo("slow",1);c("#container div.element div.titlepreview").stop(true,true).fadeOut("slow");c(this).hide();e.preventDefault()});c("#wrapper .arrow").live("click",function(e){c(".video video").each(function(){this.pause()})});c(document).on("mouseenter","#container div.element",function(){c(this).find("img").stop(true,true).fadeTo("slow",0.3);c(this).find("div.titlepreview").stop(true,true).fadeIn("slow")});c(document).on("mouseleave","#container div.element",function(){c(this).find("img").stop(true,true).fadeTo("slow",1);c(this).find("div.titlepreview").stop(true,true).fadeOut("slow")});c(document).on("mouseenter","li div.information",function(){c("li div.desc").stop(true,true).animate({bottom:"0"},800,"easeOutExpo")});c(document).on("mouseleave","li div.desc",function(){c("li div.desc").stop(true,true).animate({bottom:"-240"},500,"easeOutExpo")})}if(c("#agence").length){function a(){c("#page1, #page2, #page3, #page4").hide();c("nav.menu ul ul a").removeClass("selected")}c(window).bind("hashchange",function(){var e=window.location.hash||"#page1";if(e=="#page1"||e=="#page2"||e=="#page3"||e=="#page4"){a();c(e).fadeIn("slow")}if(e=="#page1"){c('nav.menu ul ul a[href$="#page1"]').addClass("selected")}if(e=="#page2"){c('nav.menu ul ul a[href$="#page2"]').addClass("selected")}if(e=="#page3"){c('nav.menu ul ul a[href$="#page3"]').addClass("selected")}if(e=="#page4"){c('nav.menu ul ul a[href$="#page4"]').addClass("selected")}});c(window).trigger("hashchange");c(".collapser").collapse({show:function(){this.animate({opacity:"toggle",height:"toggle"},300)},hide:function(){this.animate({opacity:"toggle",height:"toggle"},300)}});c("#agence .contactlist a").css({backgroundPosition:"0 -125px"}).mouseover(function(){c(this).stop().animate({backgroundPosition:"(0 0)"},500,"easeOutExpo")}).mouseout(function(){c(this).stop().animate({backgroundPosition:"(0 -125px)"},500,"easeOutExpo")})}if(c("#noel").length){c("video").VideoJS()}})(jQuery);
