title: Strange error when swapping textinput values
body: <p>I am trying to create a JS function which allows admins to modify the rankings of the site's users, based on a few (currently irrelevant) variables.</p>
  
  <p>For this, I created a function which displays all the users, and, when you click on one of the names, display two buttons. These buttons can be used to move the user up or down one rank. Of course, the moves user have to switch place with the one already at the rank: for this, I (try to) use the classic <code>c = a, a = b, b = c</code> method.</p>
  
  <p>It works great, as long as you move the users up first; if you want to start by moving the user down, it does nothing.</p>
  
  <p>Here is the fiddle: <a href="http://jsfiddle.net/benedekadam/caqcw35h/" rel="nofollow">http://jsfiddle.net/benedekadam/caqcw35h/</a></p>
  
  <p>Please, keep in mind I had to modify it: I am using a newly created, smaller array to store the users' names, and I've taken out the piece of code that is responsible for disabling the buttons if it's the first or last name - so you can only move the last name up, or the first name down. Apart from these two changes, it's the same I currently use in my site.</p>
  
  <p>I am pretty sure something very simple mistake causes the error, but I spent the majority of the last two hours trying to find it - without any success.</p>
  
  <p>Can you help me?</p>