// JavaScript Document
function change_div(ID_elem, x, y) {
	var attributes = {
		scroll: { to: [x,y] }
	};
	var anim = new YAHOO.util.Scroll(ID_elem, attributes, 0.5, YAHOO.util.Easing.easeOut);
	anim.animate();
}

var pos_height = 0;
var pos_width = 0;
function change_perso(ID_elem, nb_elem, decal_height) {
	if(nb_elem) {
		pos_height += decal_height;
		pos_width = 0;
		
		if(pos_height < 0) {
			pos_height = 107*(nb_elem-3);
		}
		else if(pos_height > (107*(nb_elem-3))) {
			pos_height = 0;
		}
		
		change_div(ID_elem,pos_width,pos_height);
	}
	return false;
}

function change_marques(ID_elem, nb_elem, decal_height) {
	if(nb_elem) {
		pos_height += decal_height;
		pos_width = 0;
		
		/*if(pos_height < 0) {
			pos_height = 89*(nb_elem-3);
		}
		else if(pos_height > (89*(nb_elem-3))) {
			pos_height = 0;
		}*/
		
		if(pos_height < 0) {
			pos_height = 0;
		}
		else if(pos_height > (89*(nb_elem-3))) {
			pos_height = 89*(nb_elem-3);
		}
		
		change_div(ID_elem,pos_width,pos_height);
	}
	return false;
}
function change_portofolio(ID_elem, nb_elem, decal_height) {
	if(nb_elem) {
		pos_height += decal_height;
		pos_width = 0;
		
		if(pos_height < 0) {
			pos_height = 99*(nb_elem-3);
		}
		else if(pos_height > (99*(nb_elem-3))) {
			pos_height = 0;
		}
		
		change_div(ID_elem,pos_width,pos_height);
	}
	return false;
}
function change_actu(ID_elem, nb_elem, decal_height) {
	if(nb_elem) {
		pos_height += decal_height;
		pos_width = 0;
		
		if(pos_height < 0) {
			pos_height = 85*(nb_elem-3);
		}
		else if(pos_height > (85*(nb_elem-3))) {
			pos_height = 0;
		}
		
		change_div(ID_elem,pos_width,pos_height);
	}
	return false;
}