<!--
// gallery.js: Controls the opening of the gallery page
//
// Copyright (c) 2008 Aculade, LLC.
//    All rights reserved.
//
//    You may not remove this header.
//    You may edit and use this code for all purposes so long as this
//       header remains intact.
//    You may not sell or receive profits for this script alone.
//    You may use this script as a function of a commercial, for-profit
//       site design as long as this header remains unedited.


   // Initializes page as closed; adds support for users without JS enabled.
   //    Users with JS disabled will see the page opened on load.
	var elementID_1 = document.getElementById('photos');
	elementID_1.style.height = '150px';

	setTimeout('begin();',2000);
   document.getElementById('page').style.paddingBottom = "10px";
	document.getElementById('slide_slideshow').style.visibility = "hidden";

	function begin() {
		document.getElementById('box').style.display = "block";
		document.getElementById('box').style.visibility = "hidden";
		shrink_page();
	}
	function shrink_page() {
		var boxID = document.getElementById('box');
		var box_height = boxID.offsetHeight;
		box_height = box_height - 8;

		if (box_height > 0) {
			boxID.style.height = box_height + "px";
			setTimeout("shrink_page();",0);
		}
		else {
			boxID.style.display = "none";
			grow_slideshow();
		}
	}
	function grow_slideshow() {
		var container = document.getElementById('photos');
		var slideshow = document.getElementById('PictoBrowser');
		var final_height = 400;
		var current_height = container.offsetHeight;
		current_height = current_height + 5;

		if (current_height < final_height) {
			container.style.height = current_height + "px";
			slideshow.style.height = current_height + "px";
			setTimeout("grow_slideshow();",0);
		}
		else {
			container.style.height = final_height + "px";
			slideshow.style.height = final_height + "px";
			document.getElementById('slide_slideshow').style.visibility = "visible";
			if (document.getElementById('paper_bottom').innerHTML.indexOf("[") < 0)
				document.getElementById('paper_bottom').innerHTML = document.getElementById('paper_bottom').innerHTML + "<div class='right' style='margin-right: 25px; margin-top: -10px;'><a href='' onclick='closepage();return false;'>[ Reopen Page ]</a></div>"
		}
	}

   function closepage() {
      if (document.getElementById('box').style.display == "none") {
	      document.getElementById('box').style.display = "block";
			document.getElementById('box').style.visibility = "visible";
			document.getElementById('box').style.height = "auto";
			document.getElementById('photos').style.height = "150px";
			document.getElementById('PictoBrowser').style.height = "150px";
	   }
      else {
	      begin();
	   }
   }
-->