﻿			var Ticker = new Class({
			Implements: Options,
            options: {

				/*setOptions: function(options) {
					this.options = Object.extend({*/
						speed: 1500,
						delay: 5000,
						direction: 'horizontal',
						onComplete: Class.empty,
						onStart: Class.empty
					
				},
				initialize: function(el,options){
				    var self=this;
					this.setOptions(options);
					this.el = $(el);
					this.items = this.el.getElements('li');
					var w = 0;
					var h = 0;
					if(this.options.direction.toLowerCase()=='horizontal') {
						h = this.el.getSize().y;
						this.items.each(function(li,index) {
							w += li.getSize().x;
						});
					} else {
						w = this.el.getSize().x;
						this.items.each(function(li,index) {
							h += li.getSize().y;
						});
					}
					this.el.setStyles({
						position: 'absolute',
						top: 0,
						left: 0,
						width: w,
						height: h
					});
					this.fxfred = new Fx.Tween(this.el,{duration:this.options.speed,onComplete:function() {
						var i = (self.current==0)?self.items.length:self.current;
						self.items[i-1].injectInside(el);
						self.el.setStyles({
							left:0,
							top:0
						});
					}});
					this.current = 0;
					this.next();
				},
				next: function() {
				//var self=this;
					this.current++;
					if (this.current >= this.items.length) this.current = 0;
					var pos = this.items[this.current];
					
					if(this.options.direction.toLowerCase()=='horizontal') {
					    this.fxfred.start('left', -pos.offsetLeft);
					} else {
					    this.fxfred.start('top', -pos.offsetTop);
					}
					this.next.bind(this).delay(this.options.delay+this.options.speed);
				}
			});



function makeScrollbar(content,scrollbar,handle,horizontal,ignoreMouse){
    var w = 0;
    $$('.news_h').each(function(div,index) {
        w += div.getSize().x;
    });
    //alert(w);
    if ($('slider')){
        $('slider').setStyles({width: w});
    }
	var steps = (horizontal?(content.getScrollSize().x - content.getSize().x):(content.getScrollSize().y - content.getSize().y))
	var slider = new Slider(scrollbar, handle, {	
		steps: steps,
		mode: (horizontal?'horizontal':'vertical'),
		onChange: function(step){
			// Scrolls the content element in x or y direction.
			var x = (horizontal?step:0);
			var y = (horizontal?0:step);
			content.scrollTo(x,y);
		}
	}).set(0);
	if( !(ignoreMouse) ){
		// Scroll the content element when the mousewheel is used within the 
		// content or the scrollbar element.
		$$(content, scrollbar).addEvent('mousewheel', function(e){	
			e = new Event(e).stop();
			var step = slider.step - e.wheel * 30;	
			slider.set(step);					
		});
	}
	// Stops the handle dragging process when the mouse leaves the document body.
	$(document.body).addEvent('mouseleave',function(){slider.drag.stop()});

}


function date()
{

var today=new Date();
var date_heure="";
h = today.getHours();
m = today.getMinutes();
s = today.getSeconds();

        if (h < 10) h = '0'+h;
        if(m<10)
   { m = '0'+m; };
        if(s<10)
   { s = '0'+s; };
date_heure = ''+h+':'+m+':'+s+'';
var csChaine;
var nJour, nMois, nAnnee, nHeures , nMinutes, nSecondes;
var dtJour;
csChaine = " ";
dtJour = new Date();
nJour = dtJour.getDate();
if ( nJour < 10 ) csChaine += "0";

csChaine += nJour;

nMois = dtJour.getMonth() + 1;
nj =dtJour.toLocaleDateString();
/*if (nMois == 1) csChaine += " Janvier";
else if (nMois == 2) csChaine += " F&eacute;vrier";
else if (nMois == 3) csChaine += " Mars";
else if (nMois == 4) csChaine += " Avril";
else if (nMois == 5) csChaine += " Mai";
else if (nMois == 6) csChaine += " Juin";
else if (nMois == 7) csChaine += " Juillet";
else if (nMois == 8) csChaine += " Ao&ucirc;t";
else if (nMois == 9) csChaine += " Septembre";
else if (nMois == 10) csChaine += " Octobre";
else if (nMois == 11) csChaine += " Novembre";
else if (nMois == 12) csChaine += " D&eacute;cembre";

csChaine += " ";

nAnnee = dtJour.getYear();

if (nAnnee <= 109) nAnnee += 1900;

csChaine += nAnnee + " ";*/

document.getElementById('date').innerHTML =  nj ;
document.getElementById('heure').innerHTML="Il est " +date_heure ; 
}



