// JavaScript Document


/*
	// on récupère la page en cours
	var url=document.location.href;
	
	// si l'URL comporte une query string, on la retire
	if(document.location.search) {
		cheminCompletSansQueryString = url.split(document.location.search);
		cheminComplet = cheminCompletSansQueryString[0];
	} else {
		cheminComplet = url;
	}
		
	// si il n'y a pas de fichier après le dernier slash, on doit être sur la page index.html
	cheminCompletDecoupe = cheminComplet.split("/");	
	if (cheminCompletDecoupe[cheminCompletDecoupe.length-1] != "") { //si il y a un / dans l'url	
		//on n'est pas à la racine du site, on récupère la page en cours				
		page = cheminCompletDecoupe[cheminCompletDecoupe.length-1];	
		//alert(page);	
	else
	{
		//alert("index.php");	
	}
*/
	
	
	// GESTION DES MARQUEURS DIRECT-STATS 
function mesure(_MesurePro, _page)
	{		
		scr_w = screen.width;
		scr_h = screen.height;
		color = screen.colorDepth;
		ref = escape(window.document.referrer);
		document.write('<img src="http://www.direct-stats.com/logs/fastcrea/v91V7J3vMrtI5BQ/marqueur.php?page='+_page+ '&n='+ Math.round (Math.random () * 1000000000000000)+ '&reso_w='+ scr_w+ '&reso_h='+ scr_h+ '&color='+ color+ '&referer='+ ref+'" style="border:0px;" />');
	}
	
	//mesure("Mesure Pro", "page");





//fonction générant une animation (AJAX)
function animation(nomId) {
	for(var i=0; i<3; i++)  new Effect.Highlight(nomId, { duration: 1.0, queue: 'front' });
	new Effect.ScrollTo(nomId); 
	return false;
}


//fonction pour faire apparaitre ou disparaitre le voilage sur les images
function high(which2){
	
theobject=which2
highlighting=setInterval("highlightit(theobject)",30)
}
function low(which2){
clearInterval(highlighting)
if (which2.style.MozOpacity)
which2.style.MozOpacity=0.3
else if (which2.filters)
which2.filters.alpha.opacity=30
}

function highlightit(cur2){
if (cur2.style.MozOpacity<1)
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+0.1
else if (cur2.filters&&cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}

// begin of resizer ---------------------------------------
//pour l'utiliser : onmouseover=" new PloP(this,123,123);"   onmouseout="new PloP(this,62,62);"hspace=1
  PloP = Class.create();
PloP.prototype = {

   initialize: function(element, w, h) {
   //this, null, null, 200, 200, 20 , 20
      this.element = $(element);
      this.x = null;
      this.y = null;
      this.w = w;
      this.h = h;
      this.duration = 10;
      this.steps    = 5;
      this.options  = arguments[7] || {};

      this.sizeAndPosition();
   },

   sizeAndPosition: function() {
      if (this.isFinished()) {
         if(this.options.complete) this.options.complete(this);
         return;
      }

      if (this.timer)
         clearTimeout(this.timer);

      var stepDuration = Math.round(this.duration/this.steps) ;

      // Get original values: x,y = top left corner;  w,h = width height
      var currentX = this.element.offsetLeft;
      var currentY = this.element.offsetTop;
      var currentW = this.element.offsetWidth;
      var currentH = this.element.offsetHeight;

      // If values not set, or zero, we do not modify them, and take original as final as well
      this.x = (this.x) ? this.x : currentX;
      this.y = (this.y) ? this.y : currentY;
      this.w = (this.w) ? this.w : currentW;
      this.h = (this.h) ? this.h : currentH;

      // how much do we need to modify our values for each step?
      var difX = this.steps >  0 ? (this.x - currentX)/this.steps : 0;
      var difY = this.steps >  0 ? (this.y - currentY)/this.steps : 0;
      var difW = this.steps >  0 ? (this.w - currentW)/this.steps : 0;
      var difH = this.steps >  0 ? (this.h - currentH)/this.steps : 0;

      this.moveBy(difX, difY);
      this.resizeBy(difW, difH);

      this.duration -= stepDuration;
      this.steps--;

      this.timer = setTimeout(this.sizeAndPosition.bind(this), stepDuration);
   },

   isFinished: function() {
      return this.steps <= 0;
   },

   moveBy: function( difX, difY ) {
      var currentLeft = this.element.offsetLeft;
      var currentTop  = this.element.offsetTop;
      var intDifX     = parseInt(difX);
      var intDifY     = parseInt(difY);

      var style = this.element.style;
      if ( intDifX != 0 )
         style.left = (currentLeft + intDifX) + "px";
      if ( intDifY != 0 )
         style.top  = (currentTop + intDifY) + "px";
   },

   resizeBy: function( difW, difH ) {
      var currentWidth  = this.element.offsetWidth;
      var currentHeight = this.element.offsetHeight;
      var intDifW       = parseInt(difW);
      var intDifH       = parseInt(difH);

      var style = this.element.style;
      if ( intDifW != 0 )
         style.width   = (currentWidth  + intDifW) + "px";
      if ( intDifH != 0 )
         style.height  = (currentHeight + intDifH) + "px";
   }
}
// end of resizer ---------------------------------------

//pour eviter la désactivation des flash par IE7
function flash(tag) {
	document.write(tag);
} 