// iTERRA 3.0 template JavaScript include: Gallery (c) 2007 by evanto media AG

function showGalleryImage (imgsrc, width, height) 
{
  if (document.getElementById)
  {
	dialog = document.getElementById("gallery_large_image");
	if (dialog)
	{  		
		// repid = repid.replace(/´/g, "'");
		
		defWidth = width + 4; // frame
		defHeight = height + 26; // frame + header
			
		dialog.style.width = defWidth + "px";
		dialog.style.height = defHeight  + "px";
		
		// IE
		if (document.documentElement.clientWidth && window.navigate)
		{
			dialog.style.left = ((document.documentElement.clientWidth - defWidth) / 2) + "px";
			dialog.style.top  = ((document.documentElement.clientHeight - defHeight) / 2) + "px";
		}

		// Mozilla, Opera
		if (window.netscape)
		{
			dialog.style.left = ((window.innerWidth - defWidth) / 2) + "px";
			dialog.style.top  = ((window.innerHeight - defHeight) / 2) + "px";
		}
		
		img = document.getElementById("gallery_large_image_src");
		if (img)
		{  		
			img.src = imgsrc;
		}
		else
			alert ("Image Dialog Source Image not found!");

		// show dialog
		dialog.style.display = ""; 
	}
	else
	  alert ("Image Dialog not found!");
  }
  return false;
}

function closeGalleryImage () 
{
  if (document.getElementById)
  {
	dialog = document.getElementById("gallery_large_image");
	if (dialog)
	{  				
		img = document.getElementById("gallery_large_image_src");
		if (img)
		{  		
			img.src = "/images/spacer.gif";
		}
		else
			alert ("Image Dialog Source Image not found!");

		dialog.style.display = "none"; 
	}
	else
	  alert ("Image Dialog not found!");
  }
  return false;
}
