Are you saying that the text "txtpositionmode" is staying at 0 ? If so remove the on start of layout condition. Otherwise it appears to work...
edit : I am going to have to learn to type faster <img src="smileys/smiley1.gif" border="0" align="middle" />