Toggle - Horizontal accordion issue

Toggle - Horizontal accordion issue

I have a horizontal slider I am working on, I have it sliding properly sequentially but I don't have it sliding correctly when its not. Here is a brief explanation of what I am trying to find,  if you click the third element and then after click the second you should see the third move back to its state with the second. 

here is my jquery I am using:

$(document).ready(function(){
var masterCount = $('.sheets-gallery ul li').size();
$(".sheets-gallery ul li").each(function(idx, item) {
var itemNum = idx+1;
var p = $(this).parent()[0];
if(itemNum != masterCount){
$('#li'+itemNum).toggle(function(e) {
e.preventDefault();
var mLeft = $(this).css('margin-left').replace("px", "");
var total = parseInt(mLeft) - 700;

$(this).animate({'margin-left':total},500);
if(p != "undefined"){
$(this).prev('li').click();
}

},function() {
var mLeft3 = $(this).css('margin-left').replace("px", "");
var total3 = parseInt(mLeft3) + 700;
$(this).animate({'margin-left':total3},500);


});
}

});

});


Also here is where I have the example html.  http://mayaandteddy.com/jeremy23/sheets/slider2.html

Can anyone help get this to work correctly?