function moveImg(a){var b=popCurrPhoto;if(a=="next"&&popCurrPhoto<popNumPhotos-1){b=parseInt(popCurrPhoto)+1;}else if(a=="prev"&&popCurrPhoto>0){b=parseInt(popCurrPhoto)-1;}var c=parseInt(document.getElementById('tsliderdiv').style.width);var d=document.getElementById('thumb'+b).offsetLeft;var f=document.getElementById('thumb'+b).width;if(d+f>c){document.getElementById('tsliderdiv').scrollLeft=(d-(c/2));}if(d<c){document.getElementById('tsliderdiv').scrollLeft=0;}swapImg(b)}

