
/*----------------------------------------------
** FADING SUR LES LIENS AU SURVOL
** http://www.toutpourtonsite.com/article77.html
**/ 
/* CHANGEMENTS A FAIRE */
startColor = "#003399"; // MouseOut link color
endColor = "#FF0000"; // MouseOver link color

stepIn = 20; // delay when fading in
stepOut = 20; // delay when fading out

/*
** set to true or false; true will
** cause all links to fade automatically
***/
autoFade = false;
/*
** set to true or false; true will cause all CSS
** classes with "fade" in them to fade onmouseover
***/
sloppyClass = true;
/* FIN DES CHANGEMENTS A FAIRE */

hexa = new makearray(16); 
for(var i=0;i<10;i++) 
hexa[i]=i;
hexa[10]="a";hexa[11]="b";hexa[12]="c";hexa[13]="d";hexa[14]="e";hexa[15]="f";
document.onmouseover=domouseover;document.onmouseout=domouseout;
startColor=dehexize(startColor.toLowerCase());endColor=dehexize(endColor.toLowerCase());
var fadeId=new Array(); 
function dehexize(Color){
var colorArr=new makearray(3);
for (i=1;i<7;i++){
for (j=0;j<16;j++){
if(Color.charAt(i)==hexa[j]){
if(i%2!=0)
colorArr[Math.floor((i-1)/2)]=eval(j)*16;
else
colorArr[Math.floor((i-1)/2)]+=eval(j);
}}}
return colorArr;}
function domouseover(){
if(document.all){
var srcElement=event.srcElement;
if((srcElement.tagName=="A"&&autoFade)||srcElement.className=="fade"||(sloppyClass&&srcElement.className.indexOf("fade")!=-1))
fade(startColor,endColor,srcElement.uniqueID,stepIn);
}}
function domouseout(){
if(document.all){
var srcElement=event.srcElement;
if((srcElement.tagName=="A"&&autoFade)||srcElement.className=="fade"||(sloppyClass&&srcElement.className.indexOf("fade")!=-1))
fade(endColor,startColor,srcElement.uniqueID,stepOut);
}}
function makearray(n){this.length=n;for(var i=1;i<=n;i++)this[i]=0;return this;} 
function hex(i){
if(i<0)return "00";
else if(i>255)return "ff";
else return ""+hexa[Math.floor(i/16)]+hexa[i%16];}
function setColor(r,g,b,element){
var hr=hex(r);var hg=hex(g); var hb=hex(b);
element.style.color="#"+hr+hg+hb;
}
function fade(s,e,element,step){ 
var sr=s[0];var sg=s[1];var sb=s[2];
var er=e[0];var eg=e[1];var eb=e[2];
if(fadeId[0]!=null&&fade[0]!=element){
setColor(sr,sg,sb,eval(fadeId[0]));
var i=1;
while(i<fadeId.length){clearTimeout(fadeId[i]);i++;}
}
for(var i=0;i<=step;i++){
fadeId[i+1]=setTimeout("setColor(Math.floor("+sr+" *(( "+step+" - "+i+" )/ "+step+" ) + "+er+" * ("+i+"/"+
step+")),Math.floor("+sg+" * (( "+step+" - "+i+" )/ "+step+" ) + "+eg+" * ("+i+"/"+step+
")),Math.floor("+sb+" * (("+step+"-"+i+")/"+step+") + "+eb+" * ("+i+"/"+step+")),"+element+");",i*step);
}
fadeId[0]=element;}



/****** TEXT COLOUR CYCLER v1.1 by Angus Turnbull http://www.twinhelix.com ******/
// Please leave the above line in the source, and a link to my site in your page somewhere.
// After all, if you found these scripts useful, won't your visitors?
// Run the rest of this through my comment trimmer if you want before deploying.

var isDOM=document.getElementById?1:0;
var isIE=document.all?1:0;
var isNS4=(navigator.appName=='Netscape'&&!isDOM)?1:0;
var isIE4=(isIE&&!isDOM)?1:0;
var isDyn=(isDOM||isIE4||isNS4);
function getRef(id,par){
 par=(!par?document:(par.navigator?par.document:par));
 return (isIE?par.all[id]:
  (isDOM?(par.getElementById?par:par.ownerDocument).getElementById(id):
  par.layers[id]));
}
// *** TEXT CYCLING FUNCTIONS ***
function txcCycle(){with(this){

 if(!div) div=getRef(myName+'Layer');
 count=((count-step)%colours.length);
 var str='<span class="'+myName+'">';
 for (var i=0;i<text.length;i++){
  var pos=(count+i)%colours.length;
  if (pos<0)pos+=colours.length;
  str+='<font color="'+colours[pos]+'">'+text.substring(i,i+1)+'</font>';
 }
 str+='</span>';
 if(isNS4) with(div.document){write(str);close()}
 else div.innerHTML=str;
 setTimeout(myName+'.cycle()',interval);
}}
function TextCycler(myName)
{
 this.myName=myName;this.div=null;this.colours=null;
 this.interval=100;this.count=0;this.step=1;this.text='';this.cycle=txcCycle;
}


function setPointer(theRow, theAction, theDefaultColor, thePointerColor)
{
    var theCells = null;
	theMarkColor="#FF0000";
    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor = theMarkColor;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()) {
        if (theAction == 'out') {
            newColor = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor = theMarkColor;
        }
    }
    

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
} // end of the 'setPointer()' function