var imgs = ["1.jpgrecords," 2.jpgrecords recorder 3.jpg"];
var idx = 0;
function resetImgs(dir){
var len = imgs.length;
switch(dir){
case "PREV":
if(idx <= 0){
idx = len - 1;
_setPrevImgs(idx);
}else{
idx--;
_setPrevImgs(idx);
}
break;
case "NEXT":
if(idx >= 0 && idx < len - 1){
_setNextImgs(idx);
idxPP;
}else if(idx >= len - 1){
_setNextImgs(idx);
idx = 0;
}
break;
}
for(var i in imgs){
document.getElementById("img" + (Number(i) + 1)).src = imgs[i];
}
function _setNextImgs(index){
curImg = (index + 1) + ".jpg";
imgs.splice(0, 1);
imgs.push(curImg);
}
function _setPrevImgs(index){
curImg = (index + 1) + ".jpg";
imgs.splice(len - 1, 1);
imgs.unshift(curImg);