// JavaScript Document
var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
var tempX = 0
var tempY = 0
var x_p = 0;
var y_p = 0;
var m_x = 0;
var m_y = 0;
var img_h = 540;
var img_w = 350;
function getMouseXY(e) {

  if (IE) { // grab the x-y pos.s if browser is IE
	tempX = event.clientX + document.body.scrollLeft
	tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
	tempX = e.pageX
	tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  
  if(m_x > 0 && m_y > 0){
	x_p = tempX - m_x;
	y_p = tempY - m_y;
	var obj = document.getElementById("divZoom");
	GotoXY(obj, x_p/10, y_p/10);
  }
  return true
}	
function GotoXY(obj, x, y){
	var pos = obj.style.backgroundPosition;
	var arr = pos.split(' ');
	var x1 = x + parseInt(arr[0]);
	var y1 = y + parseInt(arr[1]);
	if(x1 > -img_w + 350 && x1 <= 0 && y1 > -img_h + 540 && y1 <= 0){
		pos = x1 + "px " + y1 + "px";
		obj.style.backgroundPosition = pos;
	}
}
function MouseDown(){			  
	m_x = tempX;
	m_y = tempY;		
}
function MouseUP(){
	m_x = 0;
	m_y = 0;
}
function show_zoom(div){
	document.getElementById("shop_loading").style.display = 'block';	
	document.getElementById(div).style.display = 'block';	
	setTimeout("show_loading()",8000);
	return false;
}
function show_loading(){
	document.getElementById("shop_loading").style.display = 'none';
	
}