var coords      = [0, 46, -22];
var startcoords = [0, -174, -240];
var current = 0;
$(document).ready(function() {
	$('#phones_png').supersleight();
    $(".accord").click(
                     function()
                     {
                         var id = $(this).attr('id').substr(2);
                         if(current == id) return;
                         
                         if(id - current > 1){
                             tid = id - 1;
                             right = coords[tid];
                             $("#bbg"+tid).animate({right: right+'px'});
                         }

                         if(current - id > 1){
                             tid = current;
                             right = startcoords[tid];
                             $("#bbg"+tid).animate({right: right+'px'});
                         }

                         current = id;
                         var right = coords[id];
                         if(id == 0 || parseFloat($("#bbg"+id).css('right')) == right){
                             id++;
                             right = startcoords[id];
                         }
                         $("#bbg"+id).animate({right: right+'px'});
                     }
                 );
});

