title: Logic for stacking behaviour in javascript
body: <p>I'm trying to write some javascript that will stack objects by setting z-index.</p>
  
  <p>Test Case:
  <a href="http://christophermeyers.name/stacker/" rel="nofollow noreferrer">http://christophermeyers.name/stacker/</a></p>
  
  <p>I've hacked that together, but I'd like to extrapolate that behavior to something a little more logical. That is:</p>
  
  <p>Given x number of elements, when element C is moved to the top, all elements above that element must move down 1, while all elements below that element should remain in place.</p>