/*
	Zoombox v3.06.08 - For dynamically moving a zoomed in image within a div or lightbox
	(c) 2010 Peter Wallhead for Bluechilli
*/
function doUp() {
  timer = setInterval("scroll_up()", 30);
}

function doDown() {
  timer = setInterval("scroll_down()", 30);
}

function doLeft() {
  timer = setInterval("scroll_left()", 3);
}

function doRight() {
  timer = setInterval("scroll_right()", 30);
}

function scroll_down() {
var div=document.getElementById('LBLink');
var tu=parseInt(div.style.top)+5;
div.style.top = tu + "px";
}


function scroll_up() {
var div=document.getElementById('LBLink');
var td=parseInt(div.style.top)-5;
div.style.top = td + "px";
}

function scroll_right() {
var div=document.getElementById('LBLink');
var l=parseInt(div.style.left)-5;
div.style.left = l + "px";
}
function scroll_left() {
var div=document.getElementById('LBLink');
var l=parseInt(div.style.left)+5;
div.style.left = l + "px";
}

// New functions added Bluechilli (PW) 5Aug2010

i=0;
function zoom_in() {
var count=document.getElementById('zoomAmount').value;
var div=document.getElementById('LBLink');
//var h=parseInt(div.style.height)+50;
var w=parseInt(div.style.width)+50;
var newt=parseInt(div.style.top)-25;
var newl=parseInt(div.style.left)-25;
if (count != 20) { 
div.style.left = newl + "px";
div.style.top = newt + "px";
//div.style.height = h + "px";
div.style.width = w + "px";
document.getElementById('zoomAmount').value = i++;
}
}

function zoom_out() {
var div=document.getElementById('LBLink');
//var h=parseInt(div.style.height)-50;
var w=parseInt(div.style.width)-50;
var newt=parseInt(div.style.top)+25;
var newl=parseInt(div.style.left)+25;
if (w>=200){
div.style.left = newl + "px";
div.style.top = newt + "px";
//div.style.height = h + "px";
div.style.width = w + "px";
document.getElementById('zoomAmount').value = i--;
}
}

function zoom_reset() {
var div=document.getElementById('LBLink');
var count=document.getElementById('zoomAmount').value;
div.style.width = 200 + "px";
div.style.height = "auto";
div.style.left = 150 + "px";
div.style.top = 75 + "px";
document.getElementById('zoomAmount').value = 0;
i=0;
}
