Because your code is doing it!
You are doing
onClick="sizeSelection='Small'" so you *ARE* setting the (now global) variable
sizeSelection according to what was clicked on.
When you were doing
Code:
sizeSelection = document.getElementByName('size').value;
that code was wrong and was WIPING OUT the value that the
onclick had already put there.
When you are ready, go looking (you can search in this forum) for how to get the value of the checked radio button in a set of radio buttons. Then you won't need the onclick handlers any more.