/*	oDiv: The div in which the calendar should be created.
	iMaxTemp: The max temperature the thermometer can read
	iCurrentTemp: The temperature the thermometer should read now
	sImgPath: Path to image directory 
*/
function Thermometer(oDiv, iMaxTemp, iCurTemp, sImgPath) {

	var div = Util.Get(oDiv);
	
	if (iCurTemp >= iMaxTemp) iCurTemp = iMaxTemp;
	
	var therm_top = document.createElement('img');
	therm_top.style.margin = '0 0 0 14px';
	therm_top.setAttribute('src', sImgPath + (iMaxTemp == iCurTemp ? '/thermo_top_done.bmp' : '/thermo_top.bmp'));
	
	var therm_body_height = 280;
	var therm_body = document.createElement('div');
	therm_body.style.height = therm_body_height + 'px';
	therm_body.style.width = '25px';
	therm_body.style.margin = '-5px 0 0 14px';
	therm_body.style.borderWidth = '0 3px 0 3px';
	therm_body.style.borderStyle = 'solid';
	therm_body.style.borderColor = 'black';
	
	var reading_height = Math.floor(iCurTemp / iMaxTemp * therm_body_height);
	var therm_spacer = document.createElement('div');
	therm_spacer.style.height = (therm_body_height - reading_height) + 'px';
	var therm_reading = document.createElement('div');
	therm_reading.style.backgroundColor = '#fc3535';
	therm_reading.style.height = reading_height + 'px';
	if (iCurTemp < iMaxTemp) therm_body.appendChild(therm_spacer);
	therm_body.appendChild(therm_reading);
	
	var therm_bottom = document.createElement('img');
	therm_bottom.setAttribute('src', sImgPath + '/thermo_bottom.bmp');
	
	var reading_label = document.createElement('div');
	reading_label.innerHTML = iCurTemp;
	reading_label.style.position = 'absolute';
	reading_label.style.fontWeight = 'bold';
	reading_label.style.fontSize = '18px';
	reading_label.style.marginTop = (therm_body_height + 24) + 'px';
	reading_label.style.width = '60px';
	reading_label.style.textAlign = 'center';
	
	div.appendChild(reading_label);
	div.appendChild(therm_top);
	div.appendChild(therm_body);
	div.appendChild(therm_bottom);
	
	Util.FixIE_PNGs();
}