function element(obj) { return document.getElementById(obj); }
function top(obj) { return obj.offsetTop; }
function left(obj) { return obj.offsetLeft; }
function x(e) { return isIE ? event.clientX : e.clientX; }
function y(e) { return isIE ? event.clientY : e.clientY; }

var isIE = document.all;
document.onmousemove = move;
document.onmouseup = clear;

var currx = 0;
var curry = 0;
var ob = new Object();
ob.backx = 0;
ob.backy = 0;

function move(e)
{
  currx = x(e);
  curry = y(e);
  newx = currx+ob.offsetx;
  newy = curry+ob.offsety;
  
  if(newx >= 0) newx = 0;
  if(newy >= 0) newy = 0;
  if(Math.abs(newx) >= ob.backw-715) newx = -(ob.backw-715);
  if(Math.abs(newy) >= ob.backh-490) newy = -(ob.backh-490);

  if(ob.current)
  {
    ob.current.style.backgroundPosition = newx+"px "+newy+"px";
    ob.backx = newx;
    ob.backy = newy;
  }
}
function clear() { ob.current = false; }
function check(what)
{
  ob.current = what;
  ob.offsetx = ob.backx-currx;
  ob.offsety = ob.backy-curry;
}

function getPageSize()
{
  var xScroll, yScroll;
  if(window.innerHeight && window.scrollMaxY)
  {	
    xScroll = document.body.scrollWidth;
    yScroll = window.innerHeight + window.scrollMaxY;
  }
  else
  if(document.body.scrollHeight > document.body.offsetHeight)
  {
    xScroll = document.body.scrollWidth;
    yScroll = document.body.scrollHeight;
  }
  else
  {
    xScroll = document.body.offsetWidth;
    yScroll = document.body.offsetHeight;
  }
  var windowWidth, windowHeight;
  if(self.innerHeight)
  {
    windowWidth = self.innerWidth;
    windowHeight = self.innerHeight;
  }
  else
  if(document.documentElement && document.documentElement.clientHeight)
  {
    windowWidth = document.documentElement.clientWidth;
    windowHeight = document.documentElement.clientHeight;
  }
  else
  if(document.body)
  {
    windowWidth = document.body.clientWidth;
    windowHeight = document.body.clientHeight;
  }	
  if(yScroll < windowHeight) pageHeight = windowHeight;
  else
  pageHeight = yScroll;

  if(xScroll < windowWidth) pageWidth = windowWidth;
  else
  pageWidth = xScroll;

  arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
  return arrayPageSize;
}
