

var speedr = 3;
var fullWeight = 302;
	var minWeightR = 20;

function ustawpmR(i) {
	var robC = pobierzObiektElem('modul_'+i);
	var robM = pobierzObiektElem('sM_'+i);
	if (robC && robM) {
		if (robC.className=='on modul') 
			ukryjRealizacja(robM, robC);
		else 
			pokazRealizacja(robM, robC);
	}
}

function pokazRealizacja(tt,cc) {
	
	var moveby = 10; //Math.round(speedr*10);
	var intIdpR = setInterval(function() {
		var curWeight = tt.offsetWidth;
		var newWeight = curWeight + moveby;
		if (newWeight < fullWeight) {
			tt.style.width = newWeight + "px";
		} else {
			clearInterval(intIdpR);
			tt.style.width = "";
			cc.className='on modul';
			
		}
	}, 30);

}

function ukryjRealizacja(tt,cc) {
	speedr = 6;
	var movebyR = 10; //Math.round(speedr*10);
var intIduR = setInterval(function() {
		var curWeightR = tt.offsetWidth;
		var newWeightR = curWeightR - movebyR;
		if (newWeightR > minWeightR) 
			tt.style.width = newWeightR + "px";
		else {
			clearInterval(intIduR);
			tt.style.width = minWeightR+"px";
			cc.className='off modul';
		}
	}, 10);

}


