clickposx=0;clickposy=0;var newposx=0;var newposy=0;scrollstartleft=0;scrollstarttop=0;ismousedown=false;maxleft=0;maxtop=0;var targetWidth=0;var targetHeight=0;var framingWidth=0;var framingHeight=0;function falsefunc(){return false}function getMouseXY(A){if(!A){A=window.event}if(A){if(A.pageX||A.pageY){newposx=A.pageX;newposy=A.pageY}else{if(A.clientX||A.clientY){newposx=A.clientX+document.body.scrollLeft;newposy=A.clientY+document.body.scrollTop}}}return false}function initMouseXY(A){if(!A){A=window.event}if(A){if(A.pageX||A.pageY){clickposx=A.pageX;clickposy=A.pageY}else{if(A.clientX||A.clientY){clickposx=A.clientX+document.body.scrollLeft;clickposy=A.clientY+document.body.scrollTop}}}return false}function setClickPos(C,B){document.onmousedown=falsefunc;document.onmousemove=moveTarget;document.onmouseup=mouseup;initMouseXY(C);scrollstartleft=parseInt(B.style.left);scrollstarttop=parseInt(B.style.top);var A=dojo.byId("productImagePane");targetWidth=parseInt(B.width);targetHeight=parseInt(B.height);framingWidth=parseInt(A.style.width);framingHeight=parseInt(A.style.height);if(targetWidth>framingWidth){maxleft=targetWidth-framingWidth}else{maxleft=framingWidth-targetWidth}if(targetHeight>framingHeight){maxtop=targetHeight-framingHeight}else{maxtop=framingHeight-targetHeight}ismousedown=true;return false}function mouseup(A,B){document.onmousedown=null;document.onmousemove=null;document.onmouseup=null;ismousedown=false;return false}function moveTarget(D,E){E=dojo.byId("lulofruit");if(ismousedown==true){getMouseXY(D);var B=newposx-clickposx;var A=newposy-clickposy;var F=scrollstartleft+B;if(targetWidth<framingWidth){if(F>maxleft){F=maxleft}if(F<0){F=0}}else{if(F>0){F=0}if(F<(0-maxleft)){F=(0-maxleft)}}var C=scrollstarttop+A;if(targetHeight<framingHeight){if(C>maxtop){C=maxtop}if(C<0){C=0}}else{if(C>0){C=0}if(C<(0-maxtop)){C=(0-maxtop)}}moveToPosition(E,F,C)}return false}function moveToPosition(B,A,C){B=dojo.byId("lulofruit");B.style.left=""+A+"px";B.style.top=""+C+"px";return false};
