// JavaScript Document


// HISTORY

/**
* @id id de l'élément
* @movement vitesse du mouvement
* @animation précision de l'animation
* @elh hauteur d'un élément
* @nh nombre d'éléments
**/
function history(id, movement, animation, elh, nh){
	this.current_pos = 0;
	this.movement = movement;
	this.animation = animation;
	this.id = id;
	this.elh = elh;
	this.nh = nh;
	
	this.move = function(direction){
		if(direction == "up") this.current_pos = this.current_pos + this.movement;
		else this.current_pos = this.current_pos - this.movement;
		
		if(this.current_pos < 0){
			this.current_pos = 0;
			document.getElementById('hup').className = 'arrow-top-gray';
		}
		else if( this.current_pos > (this.elh * (nh-1)) ){
			this.current_pos = this.elh * (nh-1);
			document.getElementById('hdown').className = 'arrow-bottom-gray';
		}
		else if(direction == "up") document.getElementById('hup').className = 'arrow-top-red';
		else document.getElementById('hdown').className = 'arrow-bottom-red';
		
		document.getElementById(this.id).style.marginTop = '-'+this.current_pos+'px';
	}
}

function most_dl(id, movement, animation, elh, nh){
	this.current_pos = 0;
	this.movement = movement;
	this.animation = animation;
	this.id = id;
	this.elh = elh;
	this.nh = nh;
	
	this.move = function(direction){
		if(direction == "up") this.current_pos = this.current_pos + this.movement;
		else this.current_pos = this.current_pos - this.movement;

		if(this.current_pos < 0){
			this.current_pos = 0;
			document.getElementById('hup_dl').className = 'arrow-top-gray';
		}
		else if( this.current_pos > (this.elh * (nh-1)) ){
			this.current_pos = this.elh * (nh-1);
			document.getElementById('hdown_dl').className = 'arrow-bottom-gray';
		}
		else if(direction == "up") document.getElementById('hup_dl').className = 'arrow-top-red';
		else document.getElementById('hdown_dl').className = 'arrow-bottom-red';
		
		document.getElementById(this.id).style.marginTop = '-'+this.current_pos+'px';
	}
}

function majh(){
	if(navigator.appName != "Microsoft Internet Explorer"){
		setTimeout('sendRequest(\'maj_history.php\', \'box_right0\');', 500);
		setTimeout('slide_arr[0] = new Fx.Slide(\'vertical_slide0\');slide_arr[0].hide();',600);
	}
}
