var debutParcours = 0 ;
var pointDarretLargeur = 750 ;
var valEnCoursLargeur = 25 ;
var valEnCoursHauteur = 25 ;
var pointDarretHauteur = 500 ;

function cellChangeColor(cellId, color){
	$(cellId).style.background = color ;
	if (color == 'white'){
		$(cellId).style.color = "#7ab2dc";
	}else{
		$(cellId).style.color = "white";
	}
}

function sendAjax(apartId){
	new Ajax('./mosmodule/'+apartId+'.php', 
		{
			method: 'post',
			update: $('Content')
		}).request();
}

function FillDiv(partId, cellId, nbParts){
	$('Content').style.border = "0px solid";	
	for (i=1; i<=nbParts; i++){
		var myId = "cell" ;
		var myLink = "link";
		myId += i ;
		myLink += i ;
		if (cellId != myId){
			cellChangeColor(myId, "#7ab2dc");
			$(myLink).style.color = "white" ;
		}else{
			cellChangeColor(myId, "white");
			$(myId).style.borderBottom = "0px solid white" ;
			$(myLink).style.color = "#7ab2dc" ;
		}
	}
	debutParcours = 0 ;
	//resize('Content', 0);
	$('Content').innerHTML = "";
	$('Content').style.borderBottom = "1px solid #7ab2dc" ;
	$('Content').style.borderRight = "1px solid #7ab2dc" ;
	$('Content').style.borderLeft = "1px solid #7ab2dc" ;
	setTimeout('sendAjax("'+partId+'")', 10);	
}

function resize(myDiv, debut){
	if (debut == 0){
		valEnCoursLargeur = 0 ;
		valEnCoursHauteur = 0 ;
		valOpac = 0 ;
	}
	if (valEnCoursLargeur == pointDarretLargeur ){
		return false;		
	}
	
	if (valEnCoursHauteur == pointDarretHauteur ){
		return false;
	}
	//$(myDiv).style.width = valEnCoursLargeur+'px' ;
	$(myDiv).style.height = valEnCoursHauteur+'px' ;
	//changeOpac(valOpac, myDiv);
	setTimeout("resize('Content', 1)", 1);
	//valEnCoursLargeur +=  25 ;
	valEnCoursHauteur +=  50 ;
	valOpac += 20 ;
}

function changeOpac(opacity, id) {
		var object = $(id).style;
		if (opacity <=100){
			//object.opacity = (opacity / 100);
			//object.MozOpacity = (opacity / 100);
			//object.KhtmlOpacity = (opacity / 100);
			object.filter = "alpha(opacity=" + opacity + ")";
		}
}
