function previousStep(){
	document.getElementById('step').value = document.getElementById('step').value*1-1;
	document.getElementById('form').submit();
}

function nextStep(){
	document.getElementById('step').value = document.getElementById('step').value*1+1;
	document.getElementById('form').submit();
}

/*function calculateArea(){
	var area = document.getElementById('room_length').value * document.getElementById('room_width').value;
	
	return area;
}

function calculateCubage(){
	var cubage = calculateArea() * document.getElementById('room_height').value;
	
	return cubage;
}

function calculateWindowsLoad(){
	var sides = Array('SE', 'SW', 'E', 'W');
	var width, height, count;
	var windowsLoad = 0;
	
	for(var i=0; i<sides.length; i++){
		width = document.getElementById('windows_'+sides[i]+'_width');
		height = document.getElementById('windows_'+sides[i]+'_height');
		count = document.getElementById('windows_'+sides[i]+'_count');
		
		validateNumericValues([width, height, count]);
		
		windowsLoad += width.value * height.value * count.value;
	}
	
	return windowsLoad;
}

function validateNumericValues(elements){
	for(var i=0; i<elements.length; i++){
		if(elements[i].value != "" && isNaN(elements[i].value)){
			throw "Należy wypełnić pola wartościami liczbowymi";
		}
	}
}

function calculateTotalLoad(){
	var cubage, windowLoad;
	
	try{
		cubage = calculateCubage();
		alert(cubage);
		windowsLoad = calculateWindowsLoad();
		alert(windowsLoad);
	} catch(e){
		alert(e);
	}
	
	return false;
}
*/