 /**
  - $Archive: /Development/Web/ARCWeb3/Main/Development/WebApp/WebRoot/js/showLayer.js $
  - $Revision: 208933 $
  - $Date: 2007-04-23 15:32:23 +0100 (Mon, 23 Apr 2007) $
  -
  - Project     : ARC Web prototyping
  - Author      : Jacob Lester
  - Description : The function that displays a hidden layer.
  -
  - (c) 2005 U.S. National Archives and Records Administration
  -
  - Modification History:
  -
  - JAL  15/08/05 Initial development.
  - FiZ  24/08/05 Added displayProgress function to fix an animated gif display bug in I.E.
  - Fiz	 19/04/05 Accessibility review: The bulk of the HTML source is now "dynamically" 
  -				  inserted using a web standard DOM2 method (not innerHTML!). 
  -
  */


  
/***
  * Function to display a hidden div container.
  *
  * @param targetID the id of the div to display
  */
  
function showLayer(targetID) 
{
    if(document.getElementById(targetID))
    {
      var test = document.getElementById(targetID);
      test.style.display = "block";
    }
}


/***
  * Function to display the hidden progress indicator.
  *
  * @param targetID the id of the div to display
  */

// Preloads the image

		barImage = new Image();
		barImage.src = "../laf/nara/images/animated/gfxProg_2.gif";  

  
function displayProgress(targetID) {

		showLayer(targetID); //Unhide the searchProgress DIV.
		
		// Create a nested DIV tag within the searchProgress DIV tag.
		var dynEl1 = document.getElementById("searchProgress");
		var newDiv = document.createElement('div');
	    newDiv.setAttribute("id","txtwrapper");
		dynEl1.appendChild(newDiv);
		
		// Create a STRONG tag within txtwrapper DIV tag.
		var dynEl2 = document.getElementById("txtwrapper"); 
		var newBold = document.createElement('strong');
		newBold.setAttribute("id","boldme");
		dynEl2.appendChild(newBold);
	
		// Display the search in progress text within boldme STRONG tag.
		var dynEl3 = document.getElementById("boldme");
		var searchText = document.createTextNode('Search in progress...');
	    dynEl3.appendChild(searchText);
		
		// Display the ProgressBar image after the strong tag.
		var newImg = document.createElement('img');
		newImg.setAttribute("src",barImage.src); //Uses the preloaded image
		newImg.setAttribute("alt","");
		newImg.setAttribute("id","nowSearching");
		dynEl1.appendChild(newImg);
}
