var lvc_int; function startSpin(dir) { stopSpin(); lvc_int = window.setInterval( function() { lvc_spin(dir);},5); } function stopSpin() { window.clearInterval(lvc_int); } function lvc_spin(dir) { var cont = document.getElementById("lvc_biglist"); if(dir==0) { cont.style.left = (cont.offsetLeft+5)+"px"; } else { cont.style.left = (cont.offsetLeft-5)+"px"; } /*if(parseInt(cont.style.left) < -4742) { cont.style.left = "-4742px"; }*/ if(parseInt(cont.style.left) < -1856) { cont.style.left = "-1856px"; } if(parseInt(cont.style.left) > 0) { cont.style.left = "0px"; } moveFocus(dir); } function loadCell(req,dir) { var row = document.getElementById("lvc_actview").getElementsByTagName("table")[0].rows[0]; var img; if(dir==0) { img = row.cells[0].getElementsByTagName("img")[0]; } else { img = row.cells[row.cells.length-1].getElementsByTagName("img")[0]; } img.alt = ""; img.src = req.responseText; } function moveFocus(dir) { var marker = document.getElementById("lvc_marker"); var step; if(dir == 0) { step = 0 - (194/704*5); } else { step = (194/704*5); } if(!marker.left) { marker.left = parseInt(marker.style.left); } marker.left += step; if(Math.round(marker.left) < 7) { marker.left = 7;; } if(Math.round(marker.left) > 517) { marker.left = 517; } marker.style.left = Math.round(marker.left)+"px"; } function setCamFocus(event) { var posx = 0; if (event.pageX) { posx = event.pageX; } else if (e.clientX) { posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; } var obj = document.getElementById("lvc_imglist"); var parentx = obj.offsetLeft; while(obj = obj.offsetParent) { parentx += obj.offsetLeft; } //var pos = posx-parentx-77+7; //var pos = posx-parentx-47 var pos = posx-parentx-107; // pos inside lvc_imglist - half the marker if(pos<7) pos = 7; if(pos>517) pos = 517; document.getElementById("lvc_marker").style.left = pos+"px"; document.getElementById("lvc_marker").left = pos; var bigPos = posx-parentx-17; //padding: 17px; //bigPos = bigPos/(document.getElementById("lvc_imglist").offsetWidth-34); bigPos = Math.round((bigPos/704)*document.getElementById("lvc_biglist").offsetWidth); //bigPos = Math.round(bigPos * document.getElementById("lvc_biglist").offsetWidth); bigPos = bigPos-352; bigPos = 0 - bigPos; if(bigPos < 0-(document.getElementById("lvc_biglist").offsetWidth-704)) { bigPos = 0-(document.getElementById("lvc_biglist").offsetWidth-704); } if(bigPos > 0) { bigPos = 0; } document.getElementById("lvc_biglist").style.left = bigPos+"px"; }