document.getElementById("rightA").onclick = function showRight() {
for( i = 1 ; i < img.length-1; i++ ) {
if(img[i + 2].style.display == "none" && img[i - 1].style.display == "") {
img[i + 2].style.display = "";
img[i - 1].style.display = "none";
break
}
}
}