
function getheight()
{
  var h = 0;

  //IE 
  if( !window.innerHeight ) 
  { 
    //strict mode 
    if( !( document.documentElement.offsetHeight == 0 ) ) 
    { 
      h = document.documentElement.offsetHeight; 
    } 
    else //quirks mode 
    {  
      h = document.body.offsetHeight; 
    } 
  } 
  else //w3c 
  { 
    h = window.innerHeight; 
  }
  
  return h;
  
}

function getwidth()
{
  var w = 0;

  
  if( !window.innerWidth ) //IE 
  { 
    //strict mode 
    if( !( document.documentElement.clientWidth == 0 ) ) 
    { 
      w = document.documentElement.clientWidth; 
    } 
    else //quirks mode 
    {  
      w = document.body.clientWidth; 
    } 
  } 
  else //w3c 
  { 
    w = window.innerWidth; 
  }
  
  return w;
  
}

function hide( e )
{
  target = document.getElementById( "zoom" );
  if( !e ) var e = window.event;
  var relTarg = e.relatedTarget || e.toElement;
  if( relTarg == target )
    return true;
  target = document.getElementById( "imagezoom" );
  target.style.visibility = "hidden";
  target.removeChild( target.lastChild );
  return true;

}

function unhide( smallimg, x, y )
{
  smallimg.onmouseout = hide;
  var start = smallimg.src.lastIndexOf( "/" );
  imgPath = smallimg.src.substr( start + 1 );
  imgPath = "./big" + imgPath; 

  if( !window.pageYOffset ) //IE
    scrolloffset = document.body.scrollTop;
  else
    scrolloffset = window.pageYOffset;

  target = document.getElementById( "imagezoom" );
  target.onmouseout = hide;
  zmImg = new Image( x, y );
  zmImg.id = "zoom";
  zmImg.src = imgPath;
  target.appendChild( zmImg );
  target.style.left = (getwidth()/2)-(x/2);
  target.style.top = ((getheight()/2)-(y/2))+scrolloffset;
  target.style.visibility = "visible";

}
