function GetE( elementId ){
	return document.getElementById(elementId)  ;
}
function onoff(nom) 
{
	if(GetE(nom)){
		if(GetE(nom).style.display=='none'){
			GetE(nom).style.display='block';
		}
		else{
			GetE(nom).style.display='none';
		}
	}
}
function blindonoff(nom, tps){
	if(GetE(nom)){
		if(GetE(nom).style.display=='none'){
			Effect.BlindDown(nom, { duration: tps});
			Effect.Appear(nom, { duration: tps});
		}
		else{
			Effect.BlindUp(nom, { duration: tps});
			Effect.Fade(nom, { duration: tps});
		}
	}
	return false;
}
function drop(nom, tps){
	if(GetE(nom)){
		if(GetE(nom).style.display=='none'){
			Effect.Appear(nom, { duration: tps});
		}
		else{
			Effect.DropOut(nom, { duration: tps});

		}
	}
	return false;
}
function appearonoff(nom){
	if(GetE(nom)){
		if(GetE(nom).style.display=='none'){
			Effect.Appear(nom, { to: 0.9 });
		}
		else{
			Effect.Fade(nom);
			GetE(nom).style.display='none';
		}
	}
}
function grow(id, to, taille){
	if(taille<to){
		taille+=15;
		GetE(id).style.height=taille + 'px';
		 setTimeout('grow(\'' + id + '\', ' + to + ', ' + taille + ')', 1);
	}else{
		GetE(id).style.height=to + 'px';
	}
}
function reduce(id, taille, to){
	if(taille>to){
		taille-=15;
		GetE(id).style.height=taille + 'px';
		 setTimeout('reduce(\'' + id + '\', ' + taille + ', ' + to + ')', 1);
	}else{
		GetE(id).style.height=to + 'px';
	}
}

function getup(id, move, actualmove, startmargin){
	if(actualmove==0){
		
		topmargin=move - startmargin
		GetE(id).style.marginTop= topmargin + 'px';
		GetE(id).style.paddingTop= topmargin + 'px';
	}
	if(actualmove<move){
		actualmove+=15;
		GetE(id).style.height=actualmove + 'px';
		topmargin=move - actualmove - startmargin
		GetE(id).style.marginTop=topmargin + 'px';
		GetE(id).style.paddingTop= topmargin + 'px';

		 setTimeout('getup(\'' + id + '\', ' + move + ', ' + actualmove +  ', ' + startmargin + ')', 1);

	}else{
		GetE(id).style.height=move + 'px';
	}
}

function move(id, x, y, toX, toY, direction){

/*
	if(x!=toX && y!=toY){
		if(direction==1){		//haut
			x-=1;
			GetE(id).style.marginTop='\'' x + 'px\'';			
		}elseif(direction==2){	//droit
			
		}elseif(direction==3){	//bas
			
		}elseif(direction==4){	//gauche
			
		}elseif(direction==12){	//haut droit
			x-=(toX/toY);
			y+=(toY/toX);
			GetE(id).style.marginTop='\'' x + 'px\'';	
		}elseif(direction==14){	//haut gauche
			
		}elseif(direction==32){	//bas droit
			
		}elseif(direction==34){	//bas gauche
			
		}

		 setTimeout('move(\'' + id + '\', ' + x + ', ' + y + ', ' + toX + ', ' + toY + ')', 1);

	}
*/
	
}
function loading(txt)
{
	var texte='Chargement en cours';
	GetE('contenu').style.display='none';
	GetE('loading').style.display='block';
	
	if(txt!=null){
		texte=txt;
	}

	GetE('txtLoading').innerHTML = texte;
}
