Javascript - swapping text box values

Hi all

I have two textboxes, whereby the contents are swapped to be in numerical order.

I have this working but need to add a third text box, but can’t figure out how… I tried some long winded extra if statements, but to no avail.

function swapVals() {

	f1Obj = document.getElementById('f1');
	f2Obj = document.getElementById('f2');
var temp = f2Obj.value;
f1Obj.value = temp;