/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});

/*
 *
 * TERMS OF USE - EASING EQUATIONS
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2001 Robert Penner
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
 */;
﻿/* Swiss-German initialisation for the jQuery UI date picker plugin. */
/* By Douglas Jose & Juerg Meier. */
jQuery(function($){
  $.datepicker.regional['de-CH'] = {
    closeText: 'schliessen',
    prevText: '&#x3c;zurück',
    nextText: 'nächster&#x3e;',
    currentText: 'heute',
    monthNames: ['Januar','Februar','März','April','Mai','Juni',
    'Juli','August','September','Oktober','November','Dezember'],
    monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
    'Jul','Aug','Sep','Okt','Nov','Dez'],
    dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
    dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
    dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
    weekHeader: 'Wo',
    dateFormat: 'dd.mm.yy',
    firstDay: 1,
    isRTL: false,
    showMonthAfterYear: false,
    yearSuffix: ''};
  $.datepicker.setDefaults($.datepicker.regional['de-CH']);
});;
/* Swiss-French initialisation for the jQuery UI date picker plugin. */
/* Written Martin Voelkle (martin.voelkle@e-tc.ch). */
jQuery(function($){
  $.datepicker.regional['fr-CH'] = {
    closeText: 'Fermer',
    prevText: '&#x3c;Préc',
    nextText: 'Suiv&#x3e;',
    currentText: 'Courant',
    monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
    'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
    monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
    'Jul','Aoû','Sep','Oct','Nov','Déc'],
    dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
    dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
    dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
    weekHeader: 'Sm',
    dateFormat: 'dd.mm.yy',
    firstDay: 1,
    isRTL: false,
    showMonthAfterYear: false,
    yearSuffix: ''};
  $.datepicker.setDefaults($.datepicker.regional['fr-CH']);
});;
/*
 Shadow animation jQuery-plugin 1.7
 http://www.bitstorm.org/jquery/shadow-animation/
 Copyright 2011 Edwin Martin <edwin@bitstorm.org>
 Contributors: Mark Carver, Xavier Lepretre
 Released under the MIT and GPL licenses.
*/
jQuery(function(e,i){function j(){var a=e("script:first"),b=a.css("color"),c=false;if(/^rgba/.test(b))c=true;else try{c=b!=a.css("color","rgba(0, 0, 0, 0.5)").css("color");a.css("color",b)}catch(d){}return c}function k(a,b,c){var d=[];a.c&&d.push("inset");typeof b.left!="undefined"&&d.push(parseInt(a.left+c*(b.left-a.left),10)+"px "+parseInt(a.top+c*(b.top-a.top),10)+"px");typeof b.blur!="undefined"&&d.push(parseInt(a.blur+c*(b.blur-a.blur),10)+"px");typeof b.a!="undefined"&&d.push(parseInt(a.a+c*
(b.a-a.a),10)+"px");if(typeof b.color!="undefined"){var g="rgb"+(e.support.rgba?"a":"")+"("+parseInt(a.color[0]+c*(b.color[0]-a.color[0]),10)+","+parseInt(a.color[1]+c*(b.color[1]-a.color[1]),10)+","+parseInt(a.color[2]+c*(b.color[2]-a.color[2]),10);if(e.support.rgba)g+=","+parseFloat(a.color[3]+c*(b.color[3]-a.color[3]));g+=")";d.push(g)}return d.join(" ")}function h(a){var b,c,d={};if(b=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(a))c=[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],
16),1];else if(b=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(a))c=[parseInt(b[1],16)*17,parseInt(b[2],16)*17,parseInt(b[3],16)*17,1];else if(b=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(a))c=[parseInt(b[1],10),parseInt(b[2],10),parseInt(b[3],10),1];else if(b=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9\.]*)\s*\)/.exec(a))c=[parseInt(b[1],10),parseInt(b[2],10),parseInt(b[3],10),parseFloat(b[4])];d=(b=/(-?[0-9]+)(?:px)?\s+(-?[0-9]+)(?:px)?(?:\s+(-?[0-9]+)(?:px)?)?(?:\s+(-?[0-9]+)(?:px)?)?/.exec(a))?
{left:parseInt(b[1],10),top:parseInt(b[2],10),blur:b[3]?parseInt(b[3],10):0,a:b[4]?parseInt(b[4],10):0}:{left:0,top:0,blur:0,a:0};d.c=/inset/.test(a);d.color=c;return d}e.extend(true,e,{support:{rgba:j()}});var f;e.each(["boxShadow","MozBoxShadow","WebkitBoxShadow"],function(a,b){a=e("html").css(b);if(typeof a=="string"&&a!=""){f=b;return false}});if(f)e.fx.step.boxShadow=function(a){if(!a.init){a.b=h(e(a.elem).get(0).style[f]||e(a.elem).css(f));a.end=e.extend({},a.b,h(a.end));if(a.b.color==i)a.b.color=
a.end.color||[0,0,0];a.init=true}a.elem.style[f]=k(a.b,a.end,a.pos)}});
;
var FORMALIZE=function(a,b,c){var d="placeholder"in c.createElement("input"),e="autofocus"in c.createElement("input"),f=!!a.browser.msie&&parseInt(a.browser.version,10)===6,g=!!a.browser.msie&&parseInt(a.browser.version,10)===7;return{go:function(){for(var a in FORMALIZE.init)FORMALIZE.init[a]()},init:{full_input_size:function(){g&&a("textarea, input.input_full").length&&a("textarea, input.input_full").wrap('<span class="input_full_wrap"></span>')},ie6_skin_inputs:function(){if(f&&a("input, select, textarea").length){var b=/button|submit|reset/,c=/date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;a("input").each(function(){var d=a(this);this.getAttribute("type").match(b)?(d.addClass("ie6_button"),this.disabled&&d.addClass("ie6_button_disabled")):this.getAttribute("type").match(c)&&(d.addClass("ie6_input"),this.disabled&&d.addClass("ie6_input_disabled"))}),a("textarea, select").each(function(){this.disabled&&a(this).addClass("ie6_input_disabled")})}},autofocus:function(){e||!a(":input[autofocus]").length||a(":input[autofocus]:visible:first").focus()},placeholder:function(){!d&&!!a(":input[placeholder]").length&&(FORMALIZE.misc.add_placeholder(),a(":input[placeholder]").each(function(){var b=a(this),c=b.attr("placeholder");b.focus(function(){b.val()===c&&b.val("").removeClass("placeholder_text")}).blur(function(){FORMALIZE.misc.add_placeholder()}),b.closest("form").submit(function(){b.val()===c&&b.val("").removeClass("placeholder_text")}).bind("reset",function(){setTimeout(FORMALIZE.misc.add_placeholder,50)})}))}},misc:{add_placeholder:function(){d||!a(":input[placeholder]").length||a(":input[placeholder]").each(function(){var b=a(this),c=b.attr("placeholder");(!b.val()||b.val()===c)&&b.val(c).addClass("placeholder_text")})}}}}(jQuery,this,this.document);jQuery(document).ready(function(){FORMALIZE.go()});
(function() {
  var $, add_clickable_masks, add_datepicker, counter, create_input_placeholder_from_label, current_section, ease_fn, fix_column_height, get_currenct_active_section, height_interval, langauge_set, menu_attach_click_handler, set_datepicker_language, set_mouse_pointer, switch_state, transition_duration, two_number_digit;
  $ = jQuery;
  ease_fn = "easeInOutQuint";
  transition_duration = 600;
  langauge_set = false;
  current_section = "fc";
  counter = 0;
  height_interval = false;
  fix_column_height = function() {
    var c1h, c2h;
    c1h = $("#left-wrapper").outerHeight();
    c2h = $("#right-wrapper").outerHeight();
    if (c1h > c2h) {
      $("#right-wrapper").css({
        "min-height": c1h + "px"
      });
    } else {
      $("#left-wrapper").css({
        "min-height": c2h + "px"
      });
    }
    return true;
  };
  set_datepicker_language = function() {
    var def_lang;
    if (langauge_set === false && $.datepicker.regional["fr-CH"]) {
      def_lang = "";
      if (Drupal.settings.pathPrefix === "fr\/") {
        def_lang = 'fr-CH';
      }
      if (Drupal.settings.pathPrefix === "de\/") {
        def_lang = "de-CH";
      }
      $.datepicker.setDefaults($.datepicker.regional[def_lang]);
      if (def_lang !== "") {
        $("#sidebar-datepicker").datepicker("option", $.datepicker.regional[def_lang]);
      }
      return langauge_set = true;
    }
  };
  two_number_digit = function(num) {
    if (num < 10) {
      return "0" + num;
    }
    return num;
  };
  add_datepicker = function(context) {
    var curr_date, def_date, input_target, is_cinema, target;
    target = $(".form-item-date-filter-1-value, .form-item-date-filter-value", context);
    target.append("<div id='sidebar-datepicker'></div>");
    set_datepicker_language();
    is_cinema = false;
    input_target = "#edit-date-filter-1-value-date";
    if ($("#edit-date-filter-1-value-date").length === 0) {
      is_cinema = true;
      input_target = "#edit-date-filter-value-date";
    }
    curr_date = $(input_target).val();
    if (curr_date !== "") {
      def_date = curr_date;
    }
    set_datepicker_language();
    $("#sidebar-datepicker").datepicker({
      dateFormat: 'yy-mm-dd',
      defaultDate: def_date,
      firstDay: 1,
      onSelect: function(dateText, inst) {
        var dateObject, dt;
        dateObject = $("#sidebar-datepicker").datepicker('getDate');
        dt = dateObject.getFullYear() + '-' + two_number_digit(dateObject.getMonth() + 1) + '-' + two_number_digit(dateObject.getDate());
        return $(input_target).val(dt);
      }
    });
    if (def_date) {
      return $("#sidebar-datepicker").datepicker("option", "defaultDate", def_date);
    }
  };
  switch_state = function(mode_agenda) {
    var big, opts, small;
    if (mode_agenda == null) {
      mode_agenda = false;
    }
    small = 214;
    big = 711;
    opts = {
      step: function(now, fx) {
        return $("#right-wrapper").css("width", small + big - now);
      },
      duration: transition_duration,
      easing: ease_fn
    };
    if (mode_agenda) {
      $("#left-wrapper").animate({
        width: small,
        boxShadow: 'rgba(0, 0, 0, 0.0) 9px -8px 35px'
      }, opts);
      $('#right-wrapper').animate({
        boxShadow: 'rgba(0, 0, 0, 0.3) -24px -8px 25px'
      });
      $('#box1').animate({
        boxShadow: '0px 0px 30px rgba(0,0,0,0.4)'
      });
      $("#block-menu-menu-menu-administration-agenda").delay(300).fadeIn(500);
      current_section = "agenda";
      $("#main-content").animate({
        opacity: 0.5
      }, 150);
    } else {
      $('#right-wrapper').animate({
        boxShadow: 'rgba(0, 0, 0, 0.0) -24px -8px 25px'
      });
      $("#left-wrapper").animate({
        width: big + 35,
        boxShadow: 'rgba(0, 0, 0,0.5) 9px -8px 35px'
      }, opts);
      $("#block-menu-menu-menu-administration-agenda").fadeOut(500);
      current_section = "fc";
    }
    return set_mouse_pointer();
  };
  set_mouse_pointer = function() {
    if (current_section === "fc") {
      $("#right-wrapper").css({
        cursor: "pointer"
      });
      return $("#left-wrapper").css({
        cursor: "auto"
      });
    } else {
      $("#left-wrapper").css({
        cursor: "pointer"
      });
      return $("#right-wrapper").css({
        cursor: "auto"
      });
    }
  };
  create_input_placeholder_from_label = function($container) {
    var $el, text;
    text = jQuery.trim($("label", $container).html());
    $el = $("input", $container);
    $el.attr("placeholder", text);
    $("label", $container).hide();
    $("form input[type=submit]").mousedown(function(e) {
      if ($el.val() === text) {
        return $el.val('').removeClass('placeholder_text');
      }
    });
    return FORMALIZE.go();
  };
  menu_attach_click_handler = function($this, is_agenda) {
    if (is_agenda == null) {
      is_agenda = false;
    }
    return $("a", $this).click(function(e) {
      if (is_agenda === true && current_section !== "agenda") {
        e.preventDefault();
      }
      switch_state(is_agenda);
      $("ul.menu li a").removeClass("active");
      $("ul.menu li a").removeClass("active-trail");
      if (is_agenda === false || indexOf("content/date", $(this).attr("href")) === -1) {
        $(this).addClass("active-trail");
      } else {
        $(".secondary-menu li:first-child a").addClass("active-trail");
      }
      if (is_agenda === true) {
        return true;
      }
    });
  };
  get_currenct_active_section = function() {
    return current_section = $("#left-wrapper").outerWidth() < 300 ? "agenda" : "fc";
  };
  $("document").ready(function() {
    return set_datepicker_language();
  });
  add_clickable_masks = function() {
    $("#left-wrapper").click(function(e) {
      if (current_section !== "fc") {
        e.preventDefault();
        switch_state(false);
        return $("#main-content").animate({
          opacity: 1
        }, 150);
      }
    });
    $("#right-wrapper").click(function(e) {
      if (current_section === "fc") {
        e.preventDefault();
        return switch_state(true);
      }
    });
    return set_mouse_pointer();
  };
  Drupal.behaviors.fribourgcentre_ch_base = {
    attach: function(context, settings) {
      get_currenct_active_section();
      $("#background-container").once(function() {
        return add_clickable_masks();
      });
      $("#app-wrapper").once(function() {
        fix_column_height();
        return height_interval = window.setInterval(fix_column_height, 1000);
      });
      $("#views-exposed-form-events-block").once(function() {
        var $this;
        $this = $(this);
        create_input_placeholder_from_label($("#edit-keys-wrapper"));
        return add_datepicker($this);
      });
      $("#views-exposed-form-events-block-1").once(function() {
        var $this;
        $this = $(this);
        create_input_placeholder_from_label($("#edit-keys-wrapper"));
        return add_datepicker($this);
      });
      $("#primary-menu-bar", context).once(function() {
        var $this;
        $this = $(this);
        return menu_attach_click_handler($this);
      });
      $("#secondary-menu-bar", context).once(function() {
        var $this;
        $this = $(this);
        return menu_attach_click_handler($this, true);
      });
      return $("#article-6, #article-7").once(function() {
        var myInfoWindow, myLatlng, myMap, myMapOptions, myMarker, myWindowOptions;
        $(this).before("<div id='gmap-containter'></div>");
        myLatlng = new google.maps.LatLng(46.803046, 7.152164);
        myMapOptions = {
          zoom: 14,
          center: new google.maps.LatLng(46.803046 + 0.005, 7.152164),
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        myMap = new google.maps.Map(document.getElementById('gmap-containter'), myMapOptions);
        myMarker = new google.maps.Marker({
          position: myLatlng,
          map: myMap,
          title: "Fribourg Centre"
        });
        myWindowOptions = {
          content: '<h6>Fribourg Centre</h6><p>Avenue de la Gare 12<br/>1700 Fribourg</p><a target="_blank" href="http://maps.google.com/maps/place?cid=14446328555661605021&q=Fribourg+Centre,+Avenue+de+la+Gare+12,+Fribourg,+Suisse&hl=fr&ie=UTF8&ll=46.802806,7.151585&spn=0.000015,0.000021&t=m&z=16&vpsrc=0">Itinéraires</a>'
        };
        myInfoWindow = new google.maps.InfoWindow(myWindowOptions);
        google.maps.event.addListener(myMarker, 'click', function() {
          return myInfoWindow.open(myMap, myMarker);
        });
        return myInfoWindow.open(myMap, myMarker);
      });
    }
  };
}).call(this);
;

