/*************************************************************************
  This code is from Dynamic Web Coding at www.dyn-web.com
  Copyright 2003-4 by Sharon Paine 
  See Terms of Use at www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

/*
  dw_lib.js - used with dw_glide.js, dw_glider.js, ...
  version date July 2004 
*/

dynObj.holder = {}; 
// constructor
function dynObj(id,x,y,w,h) {
  var el = dynObj.getElemRef(id);
  if (!el) return;  this.id = id; 
  dynObj.holder[this.id] = this; this.animString = "dynObj.holder." + this.id;
  var px = window.opera? 0: "px";
	this.x = x || 0;	if (x) el.style.left = this.x + px;
	this.y = y || 0;	if (y) el.style.top = this.y + px;
	this.w = w || el.offsetWidth || 0;	this.h = h || el.offsetHeight || 0;
	// if w/h passed, set style width/height
	if (w) el.style.width = w + px; if (h) el.style.height = h + px;
}

dynObj.getElemRef = function(id) { 
  var el = document.getElementById? document.getElementById(id): null;
  return el;
} 

dynObj.getInstance = function(id) {
  var obj = dynObj.holder[id];
  if (!obj) obj = new dynObj(id);
  else if (!obj.el) obj.el = dynObj.getElemRef(id);
  return obj;
}

dynObj.prototype.shiftTo = function(x,y) {
  var el = this.el? this.el: dynObj.getElemRef(this.id)? dynObj.getElemRef(this.id): null;
  if (el) {
    if (x != null) el.style.left = (this.x = x) + "px";
    if (y != null) el.style.top = (this.y = y) + "px";
  }
}

dynObj.prototype.shiftBy = function(x,y) { this.shiftTo(this.x+x, this.y+y); }

dynObj.prototype.show = function() { 
  var el = this.el? this.el: dynObj.getElemRef(this.id)? dynObj.getElemRef(this.id): null;
  if (el) el.style.visibility = "visible"; 
}
dynObj.prototype.hide = function() { 
  var el = this.el? this.el: dynObj.getElemRef(this.id)? dynObj.getElemRef(this.id): null;
  if (el) el.style.visibility = "hidden"; 
}


// for time-based animations
// resources: www.13thparallel.org and www.youngpup.net (accelimation)
var dw_Bezier = {
  B1: function (t) { return t*t*t },
  B2: function (t) { return 3*t*t*(1-t) },
  B3: function (t) { return 3*t*(1-t)*(1-t) },
  B4: function (t) { return (1-t)*(1-t)*(1-t) },
  // returns current value based on percentage of time passed
  getValue: function (percent,startVal,endVal,c1,c2) {
    return endVal * this.B1(percent) + c2 * this.B2(percent) + c1 * this.B3(percent) + startVal * this.B4(percent);
  }
}

// adapted from accelimation.js by Aaron Boodman of www.youngpup.net
dw_Animation = {
  instances: [],
  add: function(fp) {
    this.instances[this.instances.length] = fp;
  	if (this.instances.length == 1) this.timerID = window.setInterval("dw_Animation.control()", 10);
  },
  
  remove: function(fp) {
    for (var i = 0; this.instances[i]; i++) {
  		if (fp == this.instances[i]) {
  			this.instances = this.instances.slice(0,i).concat( this.instances.slice(i+1) );
  			break;
  		}
  	}
  	if (this.instances.length == 0) {
  		window.clearInterval(this.timerID);	this.timerID = null;
  	}
  },
  
  control: function() {
    for (var i = 0; this.instances[i]; i++) {
  		if (typeof this.instances[i] == "function" ) this.instances[i]();
      else eval(this.instances[i]);
    }
  }
}

/*************************************************************************
  This code is from Dynamic Web Coding at www.dyn-web.com
  Copyright 2003-4 by Sharon Paine 
  See Terms of Use at www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

/*
  dw_glide.js - requires dw_lib.js
  version date July 2004 
*/

// acc is number between -1 and 1 ( -1 full decelerated, 1 full accelerated, 0 linear, i.e. no acceleration)
dynObj.prototype.slideTo = function (destX,destY,slideDur,acc,endFn) {
  if (!document.getElementById) return;
  this.slideDur = slideDur || .0001; var acc = -acc || 0;
  if (endFn) this.onSlideEnd = endFn;
  // hold destination values (check for movement on 1 axis only)
 	if (destX == null) this.destX = this.x;	else this.destX = destX;
  if (destY == null) this.destY = this.y; else this.destY = destY;
  this.startX = this.x; this.startY = this.y;
	this.st = new Date().getTime();
	// control points for bezier-controlled slide (see www.youngpup.net accelimation)
  this.xc1 = this.x + ( (1+acc) * (this.destX-this.x)/3 );
	this.xc2 = this.x + ( (2+acc) * (this.destX-this.x)/3 );
  this.yc1 = this.y + ( (1+acc) * (this.destY-this.y)/3 );
	this.yc2 = this.y + ( (2+acc) * (this.destY-this.y)/3 );
	this.sliding = true;
  this.onSlideStart();
  dw_Animation.add(this.animString + ".doSlide()");
}

dynObj.prototype.doSlide = function() {
	if (!this.sliding) return;	
	var elapsed = new Date().getTime() - this.st;
	if (elapsed < this.slideDur) {
    var x = dw_Bezier.getValue(elapsed/this.slideDur, this.startX, this.destX, this.xc1, this.xc2);
    var y = dw_Bezier.getValue(elapsed/this.slideDur, this.startY, this.destY, this.yc1, this.yc2);
		this.shiftTo( Math.round(x) ,Math.round(y) );
		this.onSlide();
	} else {	// if time's up
    dw_Animation.remove(this.animString + ".doSlide()");
		this.shiftTo(this.destX,this.destY);
		this.onSlide();
		this.sliding = false;
		this.onSlideEnd();
	}
}

dynObj.prototype.slideBy = function(dx,dy,slideDur,acc,endFn) {
	var destX=this.x+dx; var destY=this.y+dy;
	this.slideTo(destX,destY,slideDur,acc,endFn);
}

dynObj.prototype.onSlideStart = function () {}
dynObj.prototype.onSlide = function () {}
dynObj.prototype.onSlideEnd = function () { if (this.el) this.el = null; }

/*************************************************************************
  Les boutons du menu eux-meme personnellement
  C'est ici
  Pas plus haut
*************************************************************************/
<!-- Begin

function openWin(url, windowname, w, h) {
  newWin=window.open(url, windowname, "scrollbars=yes,resizable=yes,width=" + w + ",height=" + h)
  newWin.focus()
}


//BIOGRAPHY
nouvelles_on = new Image ( );
nouvelles_off = new Image ( );
nouvelles_on.src = "images/BoutonQuandOn.gif";
nouvelles_off.src = "images/BoutonQuandOff.gif";

activities_on = new Image ( );
activities_off = new Image ( );
activities_on.src = "images/BoutonQuoiOn.gif";
activities_off.src = "images/BoutonQuoiOff.gif";

propos_on = new Image ( );
propos_off = new Image ( );
propos_on.src = "images/BoutonQuiOn.gif";
propos_off.src = "images/BoutonQuiOff.gif";

boutique_on = new Image ( );
boutique_off = new Image ( );
boutique_on.src = "images/BoutonCombienOn.gif";
boutique_off.src = "images/BoutonCombienOff.gif";

don_on = new Image ( );
don_off = new Image ( );
don_on.src = "images/BoutonCommentOn.gif";
don_off.src = "images/BoutonCommentOff.gif";

panier_on = new Image ( );
panier_off = new Image ( );
panier_on.src = "images/new_images/panier_btn_on.jpg";
panier_off.src = "images/new_images/panier_btn.jpg";

cartes_on = new Image ( );
cartes_off = new Image ( );
cartes_on.src = "images/new_images/cartes_btn_on.jpg";
cartes_off.src = "images/new_images/cartes_btn.jpg";

papeterie_on = new Image ( );
papeterie_off = new Image ( );
papeterie_on.src = "images/new_images/papeterie_btn_on.jpg";
papeterie_off.src = "images/new_images/papeterie_btn.jpg";

textiles_on = new Image ( );
textiles_off = new Image ( );
textiles_on.src = "images/new_images/textiles_btn_on.jpg";
textiles_off.src = "images/new_images/textiles_btn.jpg";

publications_on = new Image ( );
publications_off = new Image ( );
publications_on.src = "images/new_images/publications_btn_on.jpg";
publications_off.src = "images/new_images/publications_btn.jpg";

function button_on ( imgName )
{
  if ( document.images )
  {
    butOn = eval ( imgName + "_on.src" );
    document[imgName].src = butOn;

  }
}

function button_off ( imgName )
{
  if ( document.images )
  {
    butOff = eval ( imgName + "_off.src" );
    document[imgName].src = butOff;	
  }
}

/*************************************************************************
  This code is from Dynamic Web Coding at www.dyn-web.com
  Copyright 2002-4 by Sharon Paine 
  See Terms of Use at www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

// change speed of slide here
var slide_in_speed = 600;	// millisecond duration of slide into view
var slide_out_speed = 500;// millisecond duration of slide out of view

function initGlideLayers() {
  var glideLyrs = new Array();
  
  // Set up your layers here
  // arguments: id, left=0 (offset calculated based on width), top
  //MUST INTRODUCE NEW DIVS HERE IF PART OF SLIDE MENU
  glideLyrs[0] = new dynObj('glideDiv0', 0, 160);
  glideLyrs[1] = new dynObj('glideDiv1', 0, 160);
  glideLyrs[2] = new dynObj('glideDiv2', 0, 160);

  
  for (var i=0; glideLyrs[i]; i++) {
		// hold original left position 
		glideLyrs[i].xOff = -(glideLyrs[i].w + 10);
		glideLyrs[i].shiftTo( glideLyrs[i].xOff, glideLyrs[i].y );
		glideLyrs[i].show();
  }
  //slideEm('glideDiv0'); // Slide first one into view 
}

var curGlideLyr;
function slideEm(id) {
  var oldLyr, newLyr;
  // if link for current layer clicked, slide it out of view 
	if (curGlideLyr == id) { 
    oldLyr = dynObj.getInstance(curGlideLyr);
		oldLyr.slideTo(oldLyr.xOff, null, slide_out_speed, -1);
    curGlideLyr = ""; return; 
  }
	// if layer currently in view, set up to slide new one into view
	// after current one slides away
	if (curGlideLyr) {
    oldLyr = dynObj.getInstance(curGlideLyr);
		oldLyr.onSlideEnd = function() { 
			dynObj.holder[curGlideLyr].slideTo(10, null, slide_in_speed, -1); 
			this.onSlideEnd = function() { if (this.el) this.el = null } 
		}
		// slide current layer out of view
		oldLyr.slideTo(oldLyr.xOff, null, slide_out_speed, -1);
	} else { 	// if no layer currently in view
    newLyr = dynObj.getInstance(id);
    newLyr.slideTo(10, null, slide_in_speed, -1);
  }
	curGlideLyr = id;
}

// End -->
// JavaScript Document