function Thermometer(oElement)
{
//	this.oLine = oElement.childNodes[1];
//	this.oLiquidTop = oElement.childNodes[3];
//	this.oLiquidMiddle = oElement.childNodes[5];
	
	this.oLine = document.getElementById('thermo1');
	this.oLiquidTop = document.getElementById('thermo2');
	this.oLiquidMiddle = document.getElementById('thermo3');
	
//	this.nTop = 11;
//	this.nTopHeight = 14;
//	this.nHeight = 53;
//	this.showValue(0.);
//	this.nValue = 0.;
	this.nTop = 11;
	this.nTopHeight = 5;
	this.nHeight = 53;
	this.showValue(0.);
	this.nValue = 0.;
}

Thermometer.prototype.showValue = function(nValue)
{
	var nHeight = Math.round(this.nHeight * nValue);
	
	this.oLiquidTop.style.top = (this.nTop + this.nHeight - nHeight) + "px";
	this.oLine.style.top = Math.round((this.nTop + this.nHeight - nHeight + this.nTopHeight / 2)) + "px";
	this.oLiquidMiddle.style.top = (this.nTop + this.nHeight - nHeight + this.nTopHeight) + "px";
	this.oLiquidMiddle.style.height = nHeight + "px";
}

Thermometer.prototype.moveToValue = function(nValue)
{
	nValue = (nValue - 20.) / 65.;
	
	var oThis = this;
	var nInterValue = this.nValue;
	var nSpeed = 0.02;
	this.oInterval = window.setInterval(function()
	{
		var nDelta = nValue - nInterValue;
		
		if (nDelta < 0.01)
		{
			nInterValue = nValue;
			oThis.nValue = nValue;
			window.clearInterval(oThis.oInterval);
		}
		else
		{
			nInterValue += nDelta * nSpeed;
		}
		
		oThis.showValue(nInterValue);
	}, 25);
}



