/**
 * Isotope v1.4.110630
 * An exquisite jQuery plugin for magical layouts
 * http://isotope.metafizzy.co
 *
 * Commercial use requires one-time license fee
 * http://metafizzy.co/#licenses
 *
 * Copyright 2011 David DeSandro / Metafizzy
 */
/*jshint curly: true, eqeqeq: true, forin: false, immed: false, newcap: true, noempty: true, undef: true */
/*global Modernizr: true */
(function(a,b,c){function f(a){var b=document.documentElement.style,c;if(typeof b[a]=="string")return a;a=d(a);for(var f=0,g=e.length;f<g;f++){c=e[f]+a;if(typeof b[c]=="string")return c}}function d(a){return a.charAt(0).toUpperCase()+a.slice(1)}var e="Moz Webkit Khtml O Ms".split(" "),g=f("transform"),h={csstransforms:function(){return!!g},csstransforms3d:function(){var a=!!f("perspective");if(a){var c=" -o- -moz- -ms- -webkit- -khtml- ".split(" "),d="@media ("+c.join("transform-3d),(")+"modernizr)",e=b("<style>"+d+"{#modernizr{height:3px}}"+"</style>").appendTo("head"),g=b('<div id="modernizr" />').appendTo("html");a=g.height()===3,g.remove(),e.remove()}return a},csstransitions:function(){return!!f("transitionProperty")}};if(a.Modernizr)for(var i in h)Modernizr.hasOwnProperty(i)||Modernizr.addTest(i,h[i]);else a.Modernizr=function(){var a={_version:"1.6ish: miniModernizr for Isotope"},c=" ",d,e;for(e in h)d=h[e](),a[e]=d,c+=" "+(d?"":"no-")+e;b("html").addClass(c);return a}();if(Modernizr.csstransforms){var j=Modernizr.csstransforms3d?{translate:function(a){return"translate3d("+a[0]+"px, "+a[1]+"px, 0) "},scale:function(a){return"scale3d("+a+", "+a+", 1) "}}:{translate:function(a){return"translate("+a[0]+"px, "+a[1]+"px) "},scale:function(a){return"scale("+a+") "}},k=function(a,c,d){var e=b.data(a,"isoTransform")||{},f={},h,i={},k;f[c]=d,b.extend(e,f);for(h in e)k=e[h],i[h]=j[h](k);var l=i.translate||"",m=i.scale||"",n=l+m;b.data(a,"isoTransform",e),a.style[g]=n};b.cssNumber.scale=!0,b.cssHooks.scale={set:function(a,b){k(a,"scale",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.scale?d.scale:1}},b.fx.step.scale=function(a){b.cssHooks.scale.set(a.elem,a.now+a.unit)},b.cssNumber.translate=!0,b.cssHooks.translate={set:function(a,b){k(a,"translate",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.translate?d.translate:[0,0]}}}var l=b.event,m;l.special.smartresize={setup:function(){b(this).bind("resize",l.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",l.special.smartresize.handler)},handler:function(a,b){var c=this,d=arguments;a.type="smartresize",m&&clearTimeout(m),m=setTimeout(function(){jQuery.event.handle.apply(c,d)},b==="execAsap"?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execAsap"])},b.Isotope=function(a,c){this.element=b(c),this._create(a),this._init()};var n=["overflow","position","width","height"];b.Isotope.settings={resizable:!0,layoutMode:"masonry",containerClass:"isotope",itemClass:"isotope-item",hiddenClass:"isotope-hidden",hiddenStyle:Modernizr.csstransforms&&!b.browser.opera?{opacity:0,scale:.001}:{opacity:0},visibleStyle:Modernizr.csstransforms&&!b.browser.opera?{opacity:1,scale:1}:{opacity:1},animationEngine:b.browser.opera?"jquery":"best-available",animationOptions:{queue:!1,duration:800},sortBy:"original-order",sortAscending:!0,resizesContainer:!0,transformsEnabled:!0,itemPositionDataEnabled:!1},b.Isotope.prototype={_create:function(c){this.options=b.extend(!0,{},b.Isotope.settings,c),this.styleQueue=[],this.elemCount=0;var d=this.element[0].style;this.originalStyle={};for(var e=0,f=n.length;e<f;e++){var g=n[e];this.originalStyle[g]=d[g]||null}this.element.css({overflow:"hidden",position:"relative"}),this._updateAnimationEngine(),this._updateUsingTransforms();var h={"original-order":function(a,b){return b.elemCount},random:function(){return Math.random()}};this.options.getSortData=b.extend(this.options.getSortData,h),this.reloadItems();var i=b(document.createElement("div")).prependTo(this.element);this.offset=i.position(),i.remove();var j=this;setTimeout(function(){j.element.addClass(j.options.containerClass)},0),this.options.resizable&&b(a).bind("smartresize.isotope",function(){j.resize()})},_getAtoms:function(a){var b=this.options.itemSelector,c=b?a.filter(b).add(a.find(b)):a,d={position:"absolute"};this.usingTransforms&&(d.left=0,d.top=0),c.css(d).addClass(this.options.itemClass),this.updateSortData(c,!0);return c},_init:function(a){this.$filteredAtoms=this._filter(this.$allAtoms),this._sort(),this.reLayout(a)},option:function(a){if(b.isPlainObject(a)){this.options=b.extend(!0,this.options,a);var c;for(var e in a)c="_update"+d(e),this[c]&&this[c]()}},_updateAnimationEngine:function(){var a=this.options.animationEngine.toLowerCase().replace(/[ _\-]/g,"");switch(a){case"css":case"none":this.isUsingJQueryAnimation=!1;break;case"jquery":this.isUsingJQueryAnimation=!0;break;default:this.isUsingJQueryAnimation=!Modernizr.csstransitions}this._updateUsingTransforms()},_updateTransformsEnabled:function(){this._updateUsingTransforms()},_updateUsingTransforms:function(){this.usingTransforms=this.options.transformsEnabled&&Modernizr.csstransforms&&Modernizr.csstransitions&&!this.isUsingJQueryAnimation,this.getPositionStyles=this.usingTransforms?this._translate:this._positionAbs},_filter:function(a){var b=this.options.filter===""?"*":this.options.filter;if(!b)return a;var c=this.options.hiddenClass,d="."+c,e=a.filter(d),f=e;if(b!=="*"){f=e.filter(b);var g=a.not(d).not(b).addClass(c);this.styleQueue.push({$el:g,style:this.options.hiddenStyle})}this.styleQueue.push({$el:f,style:this.options.visibleStyle}),f.removeClass(c);return a.filter(b)},updateSortData:function(a,c){var d=this,e=this.options.getSortData,f,g;a.each(function(){f=b(this),g={};for(var a in e)g[a]=e[a](f,d);b.data(this,"isotope-sort-data",g),c&&d.elemCount++})},_sort:function(){var a=this.options.sortBy,b=this._getSorter,c=this.options.sortAscending?1:-1,d=function(d,e){var f=b(d,a),g=b(e,a);f===g&&a!=="original-order"&&(f=b(d,"original-order"),g=b(e,"original-order"));return(f>g?1:f<g?-1:0)*c};this.$filteredAtoms.sort(d)},_getSorter:function(a,c){return b.data(a,"isotope-sort-data")[c]},_translate:function(a,b){return{translate:[a,b]}},_positionAbs:function(a,b){return{left:a,top:b}},_pushPosition:function(a,b,c){b+=this.offset.left,c+=this.offset.top;var d=this.getPositionStyles(b,c);this.styleQueue.push({$el:a,style:d}),this.options.itemPositionDataEnabled&&a.data("isotope-item-position",{x:b,y:c})},layout:function(a,b){var c=this.options.layoutMode;this["_"+c+"Layout"](a);if(this.options.resizesContainer){var d=this["_"+c+"GetContainerSize"]();this.styleQueue.push({$el:this.element,style:d})}this._processStyleQueue(),b&&b.call(a),this.isLaidOut=!0},_processStyleQueue:function(){var a=this.isLaidOut?this.isUsingJQueryAnimation?"animate":"css":"css",c=this.options.animationOptions,d=this._isInserting&&this.isUsingJQueryAnimation,e;b.each(this.styleQueue,function(b,f){e=d&&f.$el.hasClass("no-transition")?"css":a,f.$el[e](f.style,c)}),this.styleQueue=[]},resize:function(){this["_"+this.options.layoutMode+"ResizeChanged"]()&&this.reLayout()},reLayout:function(a){this["_"+this.options.layoutMode+"Reset"](),this.layout(this.$filteredAtoms,a)},addItems:function(a,b){var c=this._getAtoms(a);this.$allAtoms=this.$allAtoms.add(c),b&&b(c)},insert:function(a,b){this.element.append(a);var c=this;this.addItems(a,function(a){var d=c._filter(a,!0);c._addHideAppended(d),c._sort(),c.reLayout(),c._revealAppended(d,b)})},appended:function(a,b){var c=this;this.addItems(a,function(a){c._addHideAppended(a),c.layout(a),c._revealAppended(a,b)})},_addHideAppended:function(a){this.$filteredAtoms=this.$filteredAtoms.add(a),a.addClass("no-transition"),this._isInserting=!0,this.styleQueue.push({$el:a,style:this.options.hiddenStyle})},_revealAppended:function(a,b){var c=this;setTimeout(function(){a.removeClass("no-transition"),c.styleQueue.push({$el:a,style:c.options.visibleStyle}),c._processStyleQueue(),delete c._isInserting,b&&b(a)},10)},reloadItems:function(){this.$allAtoms=this._getAtoms(this.element.children())},remove:function(a){this.$allAtoms=this.$allAtoms.not(a),this.$filteredAtoms=this.$filteredAtoms.not(a),a.remove()},shuffle:function(){this.updateSortData(this.$allAtoms),this.options.sortBy="random",this._sort(),this.reLayout()},destroy:function(){var c=this.usingTransforms;this.$allAtoms.removeClass(this.options.hiddenClass+" "+this.options.itemClass).each(function(){this.style.position=null,this.style.top=null,this.style.left=null,this.style.opacity=null,c&&(this.style[g]=null)});var d=this.element[0].style;for(var e=0,f=n.length;e<f;e++){var h=n[e];d[h]=this.originalStyle[h]}this.element.unbind(".isotope").removeClass(this.options.containerClass).removeData("isotope"),b(a).unbind(".isotope")},_getSegments:function(a){var b=this.options.layoutMode,c=a?"rowHeight":"columnWidth",e=a?"height":"width",f=a?"rows":"cols",g=this.element[e](),h,i=this.options[b]&&this.options[b][c]||this.$filteredAtoms["outer"+d(e)](!0)||g;h=Math.floor(g/i),h=Math.max(h,1),this[b][f]=h,this[b][c]=i},_checkIfSegmentsChanged:function(a){var b=this.options.layoutMode,c=a?"rows":"cols",d=this[b][c];this._getSegments(a);return this[b][c]!==d},_masonryReset:function(){this.masonry={},this._getSegments();var a=this.masonry.cols;this.masonry.colYs=[];while(a--)this.masonry.colYs.push(0)},_masonryLayout:function(a){var c=this,d=c.masonry;a.each(function(){var a=b(this),e=Math.ceil(a.outerWidth(!0)/d.columnWidth);e=Math.min(e,d.cols);if(e===1)c._masonryPlaceBrick(a,d.colYs);else{var f=d.cols+1-e,g=[],h,i;for(i=0;i<f;i++)h=d.colYs.slice(i,i+e),g[i]=Math.max.apply(Math,h);c._masonryPlaceBrick(a,g)}})},_masonryPlaceBrick:function(a,b){var c=Math.min.apply(Math,b),d=0;for(var e=0,f=b.length;e<f;e++)if(b[e]===c){d=e;break}var g=this.masonry.columnWidth*d,h=c;this._pushPosition(a,g,h);var i=c+a.outerHeight(!0),j=this.masonry.cols+1-f;for(e=0;e<j;e++)this.masonry.colYs[d+e]=i},_masonryGetContainerSize:function(){var a=Math.max.apply(Math,this.masonry.colYs);return{height:a}},_masonryResizeChanged:function(){return this._checkIfSegmentsChanged()},_fitRowsReset:function(){this.fitRows={x:0,y:0,height:0}},_fitRowsLayout:function(a){var c=this,d=this.element.width(),e=this.fitRows;a.each(function(){var a=b(this),f=a.outerWidth(!0),g=a.outerHeight(!0);e.x!==0&&f+e.x>d&&(e.x=0,e.y=e.height),c._pushPosition(a,e.x,e.y),e.height=Math.max(e.y+g,e.height),e.x+=f})},_fitRowsGetContainerSize:function(){return{height:this.fitRows.height}},_fitRowsResizeChanged:function(){return!0},_cellsByRowReset:function(){this.cellsByRow={index:0},this._getSegments(),this._getSegments(!0)},_cellsByRowLayout:function(a){var c=this,d=this.cellsByRow;a.each(function(){var a=b(this),e=d.index%d.cols,f=~~(d.index/d.cols),g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByRowGetContainerSize:function(){return{height:Math.ceil(this.$filteredAtoms.length/this.cellsByRow.cols)*this.cellsByRow.rowHeight+this.offset.top}},_cellsByRowResizeChanged:function(){return this._checkIfSegmentsChanged()},_straightDownReset:function(){this.straightDown={y:0}},_straightDownLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,0,c.straightDown.y),c.straightDown.y+=d.outerHeight(!0)})},_straightDownGetContainerSize:function(){return{height:this.straightDown.y}},_straightDownResizeChanged:function(){return!0},_masonryHorizontalReset:function(){this.masonryHorizontal={},this._getSegments(!0);var a=this.masonryHorizontal.rows;this.masonryHorizontal.rowXs=[];while(a--)this.masonryHorizontal.rowXs.push(0)},_masonryHorizontalLayout:function(a){var c=this,d=c.masonryHorizontal;a.each(function(){var a=b(this),e=Math.ceil(a.outerHeight(!0)/d.rowHeight);e=Math.min(e,d.rows);if(e===1)c._masonryHorizontalPlaceBrick(a,d.rowXs);else{var f=d.rows+1-e,g=[],h,i;for(i=0;i<f;i++)h=d.rowXs.slice(i,i+e),g[i]=Math.max.apply(Math,h);c._masonryHorizontalPlaceBrick(a,g)}})},_masonryHorizontalPlaceBrick:function(a,b){var c=Math.min.apply(Math,b),d=0;for(var e=0,f=b.length;e<f;e++)if(b[e]===c){d=e;break}var g=c,h=this.masonryHorizontal.rowHeight*d;this._pushPosition(a,g,h);var i=c+a.outerWidth(!0),j=this.masonryHorizontal.rows+1-f;for(e=0;e<j;e++)this.masonryHorizontal.rowXs[d+e]=i},_masonryHorizontalGetContainerSize:function(){var a=Math.max.apply(Math,this.masonryHorizontal.rowXs);return{width:a}},_masonryHorizontalResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_fitColumnsReset:function(){this.fitColumns={x:0,y:0,width:0}},_fitColumnsLayout:function(a){var c=this,d=this.element.height(),e=this.fitColumns;a.each(function(){var a=b(this),f=a.outerWidth(!0),g=a.outerHeight(!0);e.y!==0&&g+e.y>d&&(e.x=e.width,e.y=0),c._pushPosition(a,e.x,e.y),e.width=Math.max(e.x+f,e.width),e.y+=g})},_fitColumnsGetContainerSize:function(){return{width:this.fitColumns.width}},_fitColumnsResizeChanged:function(){return!0},_cellsByColumnReset:function(){this.cellsByColumn={index:0},this._getSegments(),this._getSegments(!0)},_cellsByColumnLayout:function(a){var c=this,d=this.cellsByColumn;a.each(function(){var a=b(this),e=~~(d.index/d.rows),f=d.index%d.rows,g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByColumnGetContainerSize:function(){return{width:Math.ceil(this.$filteredAtoms.length/this.cellsByColumn.rows)*this.cellsByColumn.columnWidth}},_cellsByColumnResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_straightAcrossReset:function(){this.straightAcross={x:0}},_straightAcrossLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,c.straightAcross.x,0),c.straightAcross.x+=d.outerWidth(!0)})},_straightAcrossGetContainerSize:function(){return{width:this.straightAcross.x}},_straightAcrossResizeChanged:function(){return!0}},b.fn.imagesLoaded=function(a){var b=this.find("img"),d=b.length,e=this;b.length||a.call(this),b.bind("load",function(){--d<=0&&a.call(e)}).each(function(){if(this.complete||this.complete===c){var a=this.src;this.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",this.src=a}});return this};var o=function(a){this.console&&console.error(a)};b.fn.isotope=function(a){if(typeof a=="string"){var c=Array.prototype.slice.call(arguments,1);this.each(function(){var d=b.data(this,"isotope");if(!d)o("cannot call methods on isotope prior to initialization; attempted to call method '"+a+"'");else{if(!b.isFunction(d[a])||a.charAt(0)==="_"){o("no such method '"+a+"' for isotope instance");return}d[a].apply(d,c)}})}else this.each(function(){var c=b.data(this,"isotope");c?(c.option(a),c._init()):b.data(this,"isotope",new b.Isotope(a,this))});return this}})(window,jQuery);
;
/**
* hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne brian(at)cherne(dot)net
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);;
/*! Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Version: 1.0
 */

(function($) {

$.event.special.mousemove = {
	setup: function(data, namespaces) {
		var elem = this,
			behavior = data && data.behavior || "throttle", // "throttle" or "debounce"
			delay = data && data.delay || 100,
			handler = delayedHandler.call(elem, actualHandler, behavior, delay);
		$.data(elem, 'delayedmousemovehandler', handler);
		if ( elem.addEventListener )
			elem.addEventListener('mousemove', handler, false);
		else if ( elem.attachEvent )
			elem.attachEvent('onmousemove', handler);
	},
	
	teardown: function(data, namespaces) {
		var elem = this,
			handler = $.data(elem, 'delayedmousemovehandler');
		if ( elem.removeEventListener )
			elem.removeEventListener('mousemove', handler, false);
		else if ( elem.detachEvent )
			elem.detachEvent('onmousemove', handler);
	}
};

function delayedHandler(fn, behavior, delay) {
	var timeout, scope = this;
	return function() {
		var event = $.event.fix( arguments[0] || window.event );
		function delayed() {
			fn.call(scope, event);
			timeout = null;
		};
		if ( behavior === "debounce" && timeout )
			clearTimeout(timeout);
		if ( behavior === "throttle" && !timeout || behavior === "debounce" )
			timeout = setTimeout(delayed, delay);
	};
};

function actualHandler(event) {
	return $.event.handle.apply(this, arguments);
};

})(jQuery);;
(function() {
  var $, add_tooltip_to_image_black, add_update_listener, clr_update_projects_number, create_simple_slideshow, create_slidehow_tip, olditem, pfilter, psort, set_tip_position, tip_offset;
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
  $ = jQuery;
  psort = "year";
  pfilter = "realises";
  olditem = false;
  tip_offset = 8;
  add_update_listener = function($target, sub_txt, has_click, is_view) {
    var set_active_text, t_out;
    if (is_view == null) {
      is_view = false;
    }
    t_out = 7000;
    if (has_click === true) {
      t_out = 0;
    }
    set_active_text = function($slide, $cont, home2) {
      var $tip, count, desc, r, title;
      $tip = $(".tip", $cont);
      count = $slide.index() + 1;
      if (has_click === true && $tip.hasClass("tip-with-pager") === false) {
        $tip.addClass("tip-with-pager");
      }
      if (is_view === true) {
        title = "<strong>" + jQuery.trim($(".field-name-title h2", $slide).text()) + "</strong>";
      } else {
        title = "<strong>" + jQuery.trim($(".view-mode-full h2").text()) + "</strong>";
      }
      desc = $("img", $slide).attr("alt");
      if (desc === "" && has_click === false && home2 === false) {
        return true;
      }
      r = "<div class='head'>";
      if (has_click === true) {
        r += "<div class='counter'><b>" + count + "</b>/" + $("img", $target.parent().parent()).size() + "</div>";
      }
      r += title;
      if (desc !== "") {
        r += "<p class='desc'>" + desc + "</p>";
      }
      r += "</div>";
      if ($("img", $target).size() > 1 ||  has_click === false) {
        if (sub_txt !== false) {
          r += "<span>" + sub_txt + "</span>";
        }
      }
      return $tip.html(r);
    };
    $target.cycle({
      timeout: t_out,
      onPrevNextEvent: function(isNext, zeroBasedSlideIndex, slideElement) {
        return set_active_text($(slideElement), $target.parent().parent(), false);
      },
      after: function(currSlideElement, nextSlideElement, options, forwardFlag) {
        return set_active_text($(nextSlideElement), $target.parent().parent(), true);
      }
    });
    if ($target.hasClass("field-slideshow")) {
      return set_active_text($target, $target.parent().parent(), false);
    }
  };
  clr_update_projects_number = function() {
    var $p, count, maxsize, maxyear, minsize, minyear, txt;
    count = $(".view-content .views-row:not('.isotope-hidden')").size();
    txt = "<span>" + count + "</span> ";
    $("#block-views-projects-block header h2").html(txt);
    $p = $(".view-content .views-row:not('.isotope-hidden')");
    minyear = false;
    maxyear = false;
    minsize = false;
    maxsize = false;
    $p.each(function(el) {
      var $elem, csize, cyear;
      $elem = $(this);
      cyear = parseInt($(".field-name-field-date-real span", $elem).text());
      csize = parseFloat($(".field-name-field-surface", $elem).text());
      cyear = parseInt(new Date(cyear * 1000).getFullYear());
      if (minyear === false ||  cyear < minyear) {
        minyear = cyear;
      }
      if (minsize === false ||  csize < minsize) {
        minsize = csize;
      }
      if (maxyear === false ||  cyear > maxyear) {
        maxyear = cyear;
      }
      if (maxsize === false ||  csize > maxsize) {
        return maxsize = csize;
      }
    });
    $("ul.list-options li:nth-child(1) a").html(maxyear.toString() + " - " + minyear.toString());
    return $("ul.list-options li:nth-child(2) a").html(maxsize.toString() + "m&sup2; - " + minsize.toString() + "m&sup2;");
  };
  set_tip_position = function(e, $tip, $target) {
    return $tip.css({
      left: e.pageX - $target.offset().left + 7 + 4 + tip_offset,
      top: e.pageY - $target.offset().top - $tip.outerHeight() - 7 - 5 - tip_offset
    });
  };
  add_tooltip_to_image_black = function() {
    var $target, $tip, on_node_out, on_node_over, tipcontainer2;
    tipcontainer2 = $("#block-views-project-images-block .view-project-images .field-name-field-image");
    tipcontainer2.css({
      position: "relative"
    });
    $target = $("img", tipcontainer2);
    if ($(".tip", tipcontainer2).size() === 0) {
      tipcontainer2.append("<div class='tip'></div>");
      $(".tip", tipcontainer2).hide();
    }
    $tip = $(".tip", tipcontainer2);
    tipcontainer2.bind('mousemove', {
      behavior: 'debounce',
      delay: 1
    }, function(e) {
      return set_tip_position(e, $tip, $target);
    });
    on_node_over = function(e) {
      return set_tip_position(e, $tip, $target);
    };
    on_node_out = function(e) {
      set_tip_position(e, $tip, $target);
      return $tip.hide().css({
        display: 'none !important'
      });
    };
    tipcontainer2.hover(on_node_over, on_node_out);
    return $target.hover(function(e) {
      if ($(this).attr("alt") === "") {
        $tip.hide().css({
          display: 'none !important'
        });
        return true;
      }
      $tip.show();
      $(this).addClass("hover");
      $tip.html("<p class='desc'>" + $(this).attr("alt") + "</p>");
      return $tip.css({
        display: 'block !important'
      });
    }, function(e) {
      return $(this).removeClass("hover");
    });
  };
  create_slidehow_tip = function($target, $container, title, count, maxwidth, has_click, is_view) {
    var $tip, on_node_out, on_node_over, sub_t, tipcontainer;
    if (maxwidth == null) {
      maxwidth = 453;
    }
    if (has_click == null) {
      has_click = true;
    }
    if (is_view == null) {
      is_view = false;
    }
    tipcontainer = $target.parent().parent();
    if (has_click === true) {
      sub_t = false;
    } else {
      sub_t = Drupal.t("click to go to the project");
    }
    if ($(".tip", tipcontainer).size() === 0) {
      tipcontainer.append("<div class='tip'></div>");
      $(".tip", tipcontainer).hide();
      add_update_listener($target, sub_t, has_click, is_view);
    }
    $tip = $(".tip", tipcontainer);
    tipcontainer.bind('mousemove', {
      behavior: 'debounce',
      delay: 1
    }, function(e) {
      return set_tip_position(e, $tip, $target);
    });
    on_node_over = function(e) {
      $target.addClass("hover");
      $tip.css({
        display: 'block !important'
      });
      set_tip_position(e, $tip, $target);
      return $tip.show();
    };
    on_node_out = function(e) {
      $target.removeClass("hover");
      set_tip_position(e, $tip, $target);
      return $tip.hide().css({
        display: 'none !important'
      });
    };
    return tipcontainer.hover(on_node_over, on_node_out);
  };
  create_simple_slideshow = function($target, maxwidth, addClick) {
    if (maxwidth == null) {
      maxwidth = 367;
    }
    if (addClick == null) {
      addClick = true;
    }
    $(".field-slideshow-slide", $target).each(function(el2) {
      var container, desc, title;
      title = "<strong>" + jQuery.trim($(".view-mode-full h2").text()) + "</strong>";
      desc = $("img", $target).attr("alt");
      container = $(this);
      return create_slidehow_tip($target, container, title, false, maxwidth, true);
    });
    if (addClick === true) {
      return $("img", $target).click(function(e) {
        return $target.cycle('next');
      });
    }
  };
  Drupal.behaviors.clr_base = {
    attach: function(context, settings) {
      $("#name-and-slogan:not(.processed)", context).each(function(el2) {
        var $this, on_logo_hover, on_logo_out;
        $this = $(this);
        $this.addClass("processed");
        on_logo_hover = function(e) {
          return $this.addClass("hover");
        };
        on_logo_out = function(e) {
          return $this.removeClass("hover");
        };
        return $this.hover(on_logo_hover, on_logo_out);
      });
      $("#block-views-projects-block .field-name-field-image a:not(.processed)", context).each(function(el2) {
        var $th, $this, on_th_hover, on_th_out;
        $this = $(this);
        $this.addClass("processed");
        $this.prepend("<div class='thumb-hover'></div>");
        $th = $(".thumb-hover", $this);
        $th.hide().css({
          opacity: 0.5
        });
        on_th_hover = function(e) {
          $th.css({
            width: $("img", $this).innerWidth(),
            height: $("img", $this).innerHeight()
          });
          return $th.show();
        };
        on_th_out = function(e) {
          return $th.hide();
        };
        return $this.hover(on_th_hover, on_th_out);
      });
      $("body.page-node.node-type-project:not('.h-processed')", context).each(function(el) {
        var $b1, $b2, $b3, $nav, $this, blocks, blocks_visibility, nav;
        $this = $(this);
        $(".view-mode-full .field-slideshow:not('.h-processed')", context).each(function(el) {
          return create_simple_slideshow($(this));
        });
        $(".view-mode-project_plans .field-slideshow:not('.h-processed')", context).each(function(el) {
          return create_simple_slideshow($(this));
        });
        $("body.page-node.node-type-project", context).addClass("h-processed");
        $b1 = $("#block-views-project-images-block");
        $b2 = $("#block-views-project-plans-block");
        $b3 = $("#block-views-project-infos-block");
        blocks = new Array($b1, $b2, $b3);
        blocks_visibility = new Array(true, true, true);
        if (jQuery.trim($(".field-name-field-plans", $b2).text()) === "") {
          blocks_visibility[1] = false;
        }
        nav = "<div id='project-navigation'><ul></ul></div>";
        $("#block-system-main").after(nav);
        $nav = $("#project-navigation");
        $.each(blocks, function(i, val) {
          var block_title;
          block_title = $("header h2", $(val)).text();
          if (blocks_visibility[i] === true) {
            return $("ul", $nav).append("<li><a rel='" + i + "' href='#'>" + block_title + "</a></li>");
          }
        });
        return $(window).load(function() {
          $("#block-views-project-images-block .view-content .field-name-field-image").isotope({
            animationOptions: {
              duration: 0
            },
            masonry: {
              columnWidth: 5
            }
          });
          add_tooltip_to_image_black();
          $.each(blocks, function(i, val) {
            val.css({
              opacity: 1
            });
            return val.hide();
          });
          return $("a", $nav).click(function(e) {
            var ti;
            e.preventDefault();
            $("a", $nav).removeClass("selected");
            $(this).addClass("selected");
            ti = parseInt($(this).attr("rel"));
            $.each(blocks, function(i, val) {
              if (i !== ti) {
                return val.hide();
              } else {
                return val.show();
              }
            });
            return false;
          });
        });
      });
      $("#block-views-news-block:not('.h-processed')", context).each(function(el) {
        var $this, first_year, get_row_year, news_array, old_year;
        $this = $(this);
        $("#block-views-news-block", context).addClass("h-processed");
        get_row_year = __bind(function($row) {
          var d, reg;
          reg = new RegExp("[.]+", "g");
          d = jQuery.trim($(".field-name-post-date", $row).html());
          return d.split(reg)[2];
        }, this);
        news_array = new Array();
        $(".views-row", $this).each(function(el2) {
          var o;
          o = new Object();
          o.year = get_row_year($(this));
          o.val = $(this);
          news_array.push(o);
          return $(this).addClass("year-" + o.year);
        });
        old_year = -1;
        first_year = -1;
        $(news_array).each(function(i, el2) {
          if (old_year !== el2.year) {
            el2.val.before("<div class='year-toggle year-toggle-" + el2.year + "'><a href='#'>" + el2.year + "</a></div>");
          }
          if (old_year === -1) {
            first_year = el2.year;
          }
          old_year = el2.year;
          return $(".year-toggle-" + el2.year).click(function(e) {
            e.preventDefault();
            $(".views-row:not(.year-" + el2.year + ")").hide(0);
            $(".year-toggle:not(.year-toggle-" + el2.year + ")").removeClass("year-focus");
            $(".year-toggle-" + el2.year).addClass("year-focus");
            return $(".year-" + el2.year).show();
          });
        });
        return $(".year-toggle").first().click();
      });
      $("#bureau-picture-holder:not('.h-processed')", context).each(function(el) {
        var $this, on_out, on_over;
        $this = $(this);
        $this.addClass("h-processed");
        on_out = function(e) {
          return $this.stop().animate({
            height: "9px"
          }, 420);
        };
        on_over = function(e) {
          return $this.stop().animate({
            height: "480px"
          }, 200);
        };
        return $this.hoverIntent({
          over: on_over,
          out: on_out,
          timeout: 500
        });
      });
      $(".view-id-home_slideshow:not('.h-processed')", context).each(function(el) {
        var $this, z;
        $this = $(this);
        $this.addClass("h-processed");
        $this.append("<div id='home-slideshow-container'></div>");
        $(".view-content").hide(0);
        z = 0;
        $(".node-project", $this).each(function(el2) {
          var $n;
          $n = $(this);
          return $(".field-type-image a", $n).each(function(pict) {
            var $slide;
            $("#home-slideshow-container").append("<div class='slide-" + z + " home-slide'><div class='node'></div></div>");
            $slide = $(".slide-" + z + " .node");
            $slide.append($(this));
            $slide.append('<div class="field field-name-title field-type-ds field-label-hidden clearfix"><h2>' + jQuery.trim($("h2", $n).html()) + '</h2></div>');
            return z += 1;
          });
        });
        $(".view-content").remove();
        $("#home-slideshow-container").cycle({
          fx: 'fade',
          timeout: 7000,
          pause: 1
        });
        return $(".home-slide").each(function(el2) {
          var container, title;
          title = "<strong>" + jQuery.trim($(".field-name-title h2", $(this)).text()) + "</strong><br/>";
          container = $(".node", $(this));
          return create_slidehow_tip($(this).parent(), container, title, false, 453, false, true);
        });
      });
      $(".view-mode-user_bureau:not(.h-processed)", context).each(function(el) {
        var $this;
        $this = $(this);
        $(".view-mode-user_bureau", context).addClass("h-processed");
        $(".bio", $this).hide(0);
        return $(".name a", $this).click(function(e) {
          e.preventDefault();
          if ($(this).hasClass("element-focus")) {
            $(this).removeClass("element-focus");
            return $(".bio", context).slideUp(0);
          } else {
            $(".name a").removeClass("element-focus");
            $(this).addClass("element-focus");
            $(".bio", context).slideUp(0);
            return $(".bio", $this).stop().slideDown(0);
          }
        });
      });
      $(".node-project.view-mode-full .project-category").once(function() {
        var params, txt, url;
        params = $.deparam.querystring();
        url = Drupal.settings.basePath + Drupal.settings.pathPrefix;
        if (Drupal.settings.pathPrefix === "fr\/") {
          url += "node/2#";
        } else {
          url += "node/6#";
        }
        if (params.filter) {
          url += "filter=" + params.filter;
        }
        if (params.sort) {
          url += "&sortBy=" + params.sort;
        }
        txt = $("span", this).html();
        return $("span", this).html('<a href="' + url + '">' + txt + '</a>');
      });
      return $(".view-projects:not(.h-processed)", context).each(function(el) {
        var $container;
        $(".view-projects", context).addClass("h-processed");
        $("#block-views-projects-block header").prepend("<ul class='list-filters'><li><a href='#filter=realises' data-filter='.realises' class='selected'>" + Drupal.t("completed") + "</a></li><li><a href='#filter=en-cours' data-filter='.en-cours'>" + Drupal.t("in progress") + "</a><li><a href='#filter=concours' data-filter='.concours'>" + Drupal.t("competitions") + "</a></li></li></ul>");
        $("#block-views-projects-block header").append("<ul class='list-options'><li><a href='#sortBy=year' data-option-value='year' class='selected'>2011 – 1999</a></li><li><a href='#sortBy=surface' data-option-value='surface'>80m&sup2; – 530m&sup2;</sup></a><li><a href='#sortBy=genre' data-option-value='genre'>genre</a></li></li></ul>");
        $container = $(".view-content", $(this));
        $(".views-row", $container).each(function(el2) {
          return $(this).addClass(jQuery.trim($(".field-name-field-status", this).text()).replace(/\s/g, "-").replace(/é/g, "e"));
        });
        $container.css({
          opacity: 0
        });
        return $(window).load(function() {
          var update_thumbs_links;
          $container.isotope({
            animationOptions: {
              duration: 0
            },
            itemSelector: '.views-row',
            getSortData: {
              year: function($elem) {
                return parseInt($(".field-name-field-date-real span", $elem).text()) * -1;
              },
              surface: function($elem) {
                return parseFloat($(".field-name-field-surface", $elem).text()) * -1;
              },
              genre: function($elem) {
                return jQuery.trim($(".field-name-field-genre", $elem).text()).toLowerCase() + " " + jQuery.trim($(".field-name-title h2", $elem).text()).toLowerCase();
              }
            },
            sortAscending: true,
            masonry: {
              columnWidth: 5
            }
          });
          $(".field-name-field-image a", $container).each(function(el) {
            return $(this).data("href", $(this).attr("href"));
          });
          update_thumbs_links = function() {
            return $(".field-name-field-image a", $container).each(function(el) {
              return $(this).attr("href", $(this).data("href") + "?sort=" + psort + "&filter=" + pfilter);
            });
          };
          $(".list-filters a", $("#block-views-projects-block header")).click(function(e) {
            var $this, selector;
            e.preventDefault();
            $this = $(this);
            selector = $(this).attr('data-filter');
            $.bbq.pushState($(this).attr('href'), $.bbq.getState());
            return true;
            $('a', $this.parent().parent()).removeClass('selected');
            $this.addClass('selected');
            $container.isotope({
              filter: selector,
              animationOptions: {
                duration: 0
              }
            });
            pfilter = selector.replace(".", "");
            clr_update_projects_number();
            return update_thumbs_links();
          });
          $(".list-options a", $("#block-views-projects-block header")).click(function(e) {
            var $this, key, options, value;
            e.preventDefault();
            $this = $(this);
            $.bbq.pushState($(this).attr('href'), $.bbq.getState());
            return true;
            $this = $(this);
            if ($this.hasClass('selected')) {
              return;
            }
            $('a', $this.parent().parent()).removeClass('selected');
            $this.addClass('selected');
            options = {
              animationOptions: {
                duration: 0
              }
            };
            key = 'sortBy';
            value = $this.attr('data-option-value');
            if (value === 'false') {
              value = false;
            }
            psort = value;
            options[key] = value;
            $container.isotope(options);
            return update_thumbs_links();
          });
          $container.isotope({
            animationOptions: {
              duration: 0
            },
            filter: ".realises",
            sortBy: "year",
            sortAscending: true,
            visibleStyle: {
              opacity: 1,
              scale: 1
            },
            hiddenStyle: {
              opacity: 0,
              scale: 1
            }
          });
          clr_update_projects_number();
          update_thumbs_links();
          $container.delay(300).show().css({
            opacity: 1
          });
          $(window).bind("hashchange", function(e) {
            var cs, options;
            $(".list-filters a, .list-options a").removeClass("selected");
            cs = e.getState();
            options = {
              animationOptions: {
                duration: 0
              }
            };
            if (cs.sortBy) {
              options.sortBy = cs.sortBy;
            } else {
              options.sortBy = "year";
            }
            if (cs.filter) {
              options.filter = "." + cs.filter;
            } else {
              options.filter = ".realises";
            }
            $('.list-options a[href*="' + options.sortBy + '"], .list-filters a[href*="' + options.filter.replace(".", "") + '"]').addClass("selected");
            psort = options.sortBy;
            pfilter = options.filter.replace(".", "");
            $container.isotope(options);
            update_thumbs_links();
            return clr_update_projects_number();
          });
          return $(window).trigger("hashchange");
        });
      });
    }
  };
}).call(this);
;

