vitesse = 2;
temps = 1;

d = new Date();
_time = d.getTime();
//_depart = _time;
_depart=0;
balises = ['DIV','IMG','TD'];

function fondstaff() {
	_depart++;
	_depart = _depart > listestaff.length ? 1 : _depart;
//	_img = 'url(images/staff_'+(_depart%8 + 1)+'.gif)';
	_img = 'url(images/'+listestaff[_depart-1]+')';
	$('staff').style.backgroundImage=_img;
	setTimeout('fondstaff()',5000);
}

function afficher() {
	init_alpha();
	for(u=0;u<balises.length;u++) {
		liste =document.getElementsByTagName(balises[u]);
		for(i=0;i<liste.length;i++) {
			ie = liste[i].getAttribute('ie');
			if(ie != "no" || !is_ie()) {
				alpha = liste[i].getAttribute('alpha');
				if(alpha>0){
					if(!liste[i].id) {
						_id = 'alpha_'+(_time++);
						liste[i].id=_id;
					} else  {
						_id = liste[i].id;
					}
					setTimeout('alpha_afficher(\''+_id+'\',0);',(alpha-1)*1000);
				}
			}
		}
	}
}

function init_alpha(){
	for(u=0;u<balises.length;u++) {
		liste =document.getElementsByTagName(balises[u]);
		for(i=0;i<liste.length;i++) {
			ie = liste[i].getAttribute('ie');
			if(ie != "no" || !is_ie()) {
				alpha = liste[i].getAttribute('alpha');
				if(alpha>0){
					alpha_cacher(liste[i],0);
				}
			}
			alphamouseover = liste[i].getAttribute('alphamouseover');
			if(alphamouseover == "yes") {
				if(!liste[i].id) {
					_id = 'alpha_'+(_time++);
					liste[i].id=_id;
				} else  {
					_id = liste[i].id;
				}
				liste[i].setAttribute('onmouseover',"alpha_afficher('"+_id+"',0)");
			}
		}
	}
}

function alpha_afficher(obj,indice) {
	if(!obj.id) {
		if($(obj))
			obj = $(obj);
		else 
			return false;
	}
//	obj.style.display='block';
//	obj.style.visibility='visible';

	obj.style.filter='alpha(opacity='+indice+')';
	obj.style.opacity=Number(indice) / 100;
	if(indice < 100) {
		setTimeout('alpha_afficher("'+obj.id+'","'+(Number(indice)+vitesse)+'")',temps);
	}
}

function alpha_cacher(obj,indice) {
	if(!obj.id) {
		if($(obj))
			obj = $(obj);
		else 
			return false;
	}
	obj.style.filter='alpha(opacity='+indice+')';
	obj.style.opacity=Number(indice) / 100;
	if(indice > 0) {
		setTimeout('alpha_cacher("'+obj.id+'","'+(Number(indice)-vitesse)+'")',temps);
	}
}


function doAlpha(_obj,_valeur) {
	orig_bg = _obj.getAttribute('orig_bg')

	if(orig_bg == '') {

		orig_bg = _obj.style.backgroundImage;

		_obj.setAttribute('orig_bg',orig_bg);
	}
	if(_valeur) {
		_obj.style.backgroundImage = '';
	} else {
		_obj.style.backgroundImage = orig_bg;
	}
}

function $(id) {
	return document.getElementById(id);
}

function is_ie() {
	return true;
	// Attention, l'ordre de recherche est important !! Parce que IE reprend la mention 'Mozilla' et Opera reprend la mention 'MSIE' !!
	// on teste si on trouve la mention 'Opera...' dans le nom du navigateur
	if ( navigator.userAgent.indexOf('Opera 5') != -1 ) { return false }
	
	// on teste si on trouve la mention 'MSIE' dans le nom du navigateur
	else if ( navigator.userAgent.indexOf('MSIE') != -1 ) { return true }
	else if ( navigator.userAgent.indexOf('Mozilla') != -1 ) { return false }
	
	// si rien n'a été reconnu...
	else { return false }
	
}