70% complete

Couldn't get the picture to rotate on a click. Only one picture would shift. 

This is the code : 
next.onclick = function(event){
var carousel = document.getElementById("carousel").style.marginLeft;

if (document.getElementById("carousel").style.marginLeft = "0px") {
  document.getElementById("carousel").style.marginLeft = "-612px";
}

  else if (document.getElementById("carousel").style.marginLeft = "-612px") {
    document.getElementById("carousel").style.marginLeft = "-1224px";
  }
  else {
    document.getElementById("carousel").style.marginLeft = "0px";
  }
};