function ieTrick(sep) {	d = new Date();	trick = d.getYear() + "ie" + d.getMonth() + "t" + d.getDate() + "r" + d.getHours() + "i" 			+ d.getMinutes() + "c" + d.getSeconds() + "k" + d.getMilliseconds();				if(sep != "?")		sep = "&";			return sep + "ietrick=" + trick;}/* ============= *	AUTOSUGGEST * ============= */function initAutoSuggest() {
	var options = {		script: "ajax-autosuggest.html"+ieTrick('?')+"&",		varname: "search",		json: false,		maxresults: 10,		noresults: "Aucun résultat",		timeout: 5000,		minchars: 2	};	var as = new bsn.AutoSuggest('searchField', options);}new Event.observe(window, 'load', initAutoSuggest);
/* =================== *	ANTI-AUTOCOMPLETE * =================== */function disableAutocomplete(){	//Autocomplete off		$$('input').each(function(s) {		if(s.hasClassName('disableAutoComplete'))			Element.writeAttribute(s,'autocomplete','off');	});}new Event.observe(window, 'load', disableAutocomplete);/** * Prototype Widget: Textarea * Automatically resizes a textarea and displays the number of remaining chars *  * From: http://stackoverflow.com/questions/7477/autosizing-textarea * Inspired by: http://github.com/jaz303/jquery-grab-bag/blob/63d7e445b09698272b2923cb081878fd145b5e3d/javascripts/jquery.autogrow-textarea.js */if (window.Widget == undefined) window.Widget = {}; Widget.Textarea = Class.create({  initialize: function(textarea, options){    this.textarea = $(textarea);    this.options = $H({      'min_height' : 100,      //'max_length' : 400    }).update(options);    this.textarea.observe('keyup', this.refresh.bind(this));    this._shadow = new Element('div').setStyle({      lineHeight : this.textarea.getStyle('lineHeight'),      fontSize : this.textarea.getStyle('fontSize'),      fontFamily : this.textarea.getStyle('fontFamily'),      position : 'absolute',      top: '-10000px',      left: '-10000px',      width: this.textarea.getWidth() + 'px'    });    this.textarea.insert({ after: this._shadow });    //this._remainingCharacters = new Element('p').addClassName('remainingCharacters');    this.textarea.insert({after: this._remainingCharacters});      this.refresh();    },  refresh: function(){     this._shadow.update($F(this.textarea).replace(/\n/g, '<br/>'));    this.textarea.setStyle({      height: Math.max(parseInt(this._shadow.getHeight()) + parseInt(this.textarea.getStyle('lineHeight').replace('px', '')), this.options.get('min_height')) + 'px'    });    // Keep the text/character count inside the limits:    if($F(this.textarea).length > this.options.get('max_length')){      text = $F(this.textarea).substring(0, this.options.get('max_length'));        this.textarea.value = text;        return false;    }    //var remaining = this.options.get('max_length') - $F(this.textarea).length;        //this._remainingCharacters.update(Math.abs(remaining)  + ' characters remaining');  }});Event.observe(window, 'load', function() {    $$('textarea.elastic').each(function(textarea) {      new Widget.Textarea(textarea);    });     });
