function generate() {
	
	_calculate = document.getElementById('calculate');
	_total = document.getElementById('total');
	_f_total = document.getElementById('f_total_sq');
	_f_width = document.getElementById('f_width');
	_f_length = document.getElementById('f_length');
	_f_depth = document.getElementById('f_depth');
	
	if (_calculate && _total && _f_total) {
		_calculate.onclick = function(){
			var f_width = _f_width.value.replace(",",".");
			var f_length = _f_length.value.replace(",",".");
			var f_depth = _f_depth.value.replace(",",".");
			var tsq = f_width*f_length*f_depth;
			_f_total.value = tsq;
			_total.innerHTML = tsq * 1.5;
			return false;
		}
		_f_total.onclick = _f_total.onkeyup = _f_total.onchange = function(){
			tot = _f_total.value.replace(",",".");
			_total.innerHTML = tot * 1.5;
			return false;
		}
		document.calculate.onsubmit = function() {return false;}
	}
}
if (window.addEventListener)
	window.addEventListener("load", generate, false);
else if (window.attachEvent)
	window.attachEvent("onload", generate);