function getDocDims() {
  var dWidth = 0, dHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    dWidth = window.innerWidth;
    dHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    dWidth = document.documentElement.clientWidth;
    dHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    dWidth = document.body.clientWidth;
    dHeight = document.body.clientHeight;
  }
  return [ dWidth, dHeight ];
}

function getDocScrl() {
  var scrlOfX = 0, scrlOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrlOfY = window.pageYOffset;
    scrlOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrlOfY = document.body.scrollTop;
    scrlOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrlOfY = document.documentElement.scrollTop;
    scrlOfX = document.documentElement.scrollLeft;
  }
  return [ scrlOfX, scrlOfY ];
}

function showpic(g, n) {
	width = eval('width'+g);
	height = eval('height'+g);
	image = eval('image'+g);
	desc = eval('desc'+g);
	galname = eval('galname'+g);
pic = document.getElementById('divPic');
docDims = getDocDims();
docScrl = getDocScrl();
picWidth = width[n];
picHeight = height[n];
picSrc = image[n];
picDesc = desc[n];
pic.style.left = docDims[0]/2 - 10 - picWidth/2 + docScrl[0] + 'px';
pic.style.top = docDims[1]/2 - 15 - picHeight/2 + docScrl[1] + 'px';
pic.style.display="inline";
pic.innerHTML="<a href='#' onClick='hidepic(); return false;'><img src='"+picSrc+"' alt='"+picDesc+"'width='"+picWidth+"' height='"+picHeight+"'><br></a><table width='"+picWidth+"'><tr><td align='center'><b>"+galname+"</b> - "+picDesc+"</tr></td></table>";
}

function hidepic() {
pic = document.getElementById('divPic');
pic.style.display="none";
}


