function i2h(id) {
	var handler = (document.getElementById(id))?document.getElementById(id):false;
	return handler;
}

function scrollIt(unConteneur,unEltToScroll,unNom){
	this.contScroll = unConteneur;
	this.toScroll = unEltToScroll;
	this.posX = 0;
	this.posY = 0;
	this.monNom = unNom;
	this.limitX = this.toScroll.offsetWidth - this.contScroll.offsetWidth;
	this.limitY = this.toScroll.offsetHeight - this.contScroll.offsetHeight;
	this.speed = 5;
}
scrollIt.prototype.bouger = function(unElt,uneDir){
	var maDir = uneDir;
	var moi = unElt;
	var monPas = 1;
	var nm = this.monNom;
	var spd = this.speed;
	var x;
	if(maDir == 'h') var t = setInterval(nm + ".bougeHaut(" + monPas + ")",spd);
	if(maDir == 'b') var t = setInterval(nm + ".bougeBas(" + monPas + ")",spd);
	moi.onmouseout = function(){clearInterval(t); clearInterval(x);}
	moi.onmousedown = function(){
		var ps = monPas*3;
		if(maDir == 'h') x = setInterval(nm + ".bougeHaut(" + ps + ")",spd);
		if(maDir == 'b') x = setInterval(nm + ".bougeBas(" + ps + ")",spd);
	}
	moi.onmouseup = function(){clearInterval(x);}
}
scrollIt.prototype.bougeHaut = function(pas){
	if(this.posY*-1 <= this.limitY) this.posY -= pas;
	this.toScroll.style.top = this.posY + 'px';
}
scrollIt.prototype.bougeBas = function(pas){
	if(this.posY < 0) this.posY += pas;
	this.toScroll.style.top = this.posY + 'px';
}

scrollIt.prototype.affichePosY = function(){return this.posY;}
scrollIt.prototype.afficheLimitY = function(){return this.limitY;}
scrollIt.prototype.affichePosX = function(){return this.posX;}
scrollIt.prototype.afficheLimitX = function(){return this.limitX;}
