	function thumbnailShowLarge(id, src){
			showLayer(id);
			loadImg(id + "_img", src);
	}
	function thumbnailHideLarge(id, src){
			hideLayer(id);
			unloadImg(id + "_img");
	}

/* Layer showing and hiding functions */
  function showLayer(id){ 
	document.getElementById(id).style.visibility = "visible"; 
    document.getElementById(id).style.display = "block";
  }
  function hideLayer(id){
    document.getElementById(id).style.visibility = "hidden"; 
    document.getElementById(id).style.display = "none";  
  }
  function loadIFrame(id, src)
  { 
    document.getElementById(id).style.visibility = "visible"; 
    document.getElementById(id).style.display = "block";
    document.getElementById(id).src = src;
  }
  function unloadIFrame(id)
  {
    document.getElementById(id).src = "";
    document.getElementById(id).style.visibility = "hidden"; 
    document.getElementById(id).style.display = "none";  
  }
  function loadImg(id, src)
  { 
    document.getElementById(id).src = src;
  }
  function unloadImg(id)
  {
    document.getElementById(id).src = "/images/clear.gif";
  }
  function adjustLeftOffset(id, maxX, newX){
    var element = document.getElementById(id);
	var coords = {x: 0, y: 0};
   	while (element) {
     coords.x += element.offsetLeft;
     coords.y += element.offsetTop;
     element = element.offsetParent;
   	}
	alert(coords.x);
	if(coords.x > maxX) {
		document.getElementById(id).style.left = newX; 
	}
  }
  function resizeIFrame(id){
		var the_height = document.getElementById(id).contentWindow.document.body.scrollHeight;
		document.getElementById(id).height = the_height;
		var the_width = document.getElementById(id).contentWindow.document.body.scrollWidth;
		document.getElementById(id).width = the_width;
  }
