var ie=document.all; // internet explorer
var nm=document.getElementById&&!document.all; // netscape or mozilla
var drag=0;
var x,y;
var dragDiv;
function start(imagename, w, h, wc, hc) {
 document.getElementById('map').onmousedown=selectmouse;
 document.getElementById('map').onmouseout=mouseUp;
 document.onmouseup=mouseUp;    
 myImage = new Image();
 myImage.src = imagename;
 xdif = w - 656;
 ydif = h - 600;
 map.style.left = -xdif/wc;
 map.style.top = -ydif/hc;
 }
function movemouse(e) {
 if (drag) {
  map.style.left = nm ? tx + e.clientX - x : tx + event.clientX - x;
  map.style.top  = nm ? ty + e.clientY - y : ty + event.clientY - y;
  return false;
  }
 }
function selectmouse(e) {
 var selectDiv = nm ? e.target : event.srcElement;
 drag = true;
 tx = parseInt(map.style.left+0,10);
 ty = parseInt(map.style.top+0,10);
 x = nm ? e.clientX : event.clientX;
 y = nm ? e.clientY : event.clientY;
 document.onmousemove=movemouse;
 return false;
 }
function mouseUp() {
 drag = 0;
 bounds();
 }
function bounds() {
 if (parseInt(map.style.left) > 0) { map.style.left = 0; }
 if (parseInt(map.style.top) > 0) { map.style.top = 0; }
 if (parseInt(map.style.left) < -xdif) { map.style.left = -xdif; }
 if (parseInt(map.style.top) < -ydif) { map.style.top = -ydif; }
 }
