function getExpandableItems()	{

	/* check the browser is capable of recognising the DOM objects
	   we need to implement the script - otherwise return false and allow the normal link to be executed */
	   
	if(!document.getElementsByTagName) return false;
	if(!document.getElementById) return false;
	if(!document.getElementById("pressReleases")) return false;

	
	/* get the reference to the pressReleases object and then create an array 
	   of all the <span> tags found in the array. To each tag assign a function to
	   the onclick method - which calls the expand() function. */
	   
	var gallery = document.getElementById("pressReleases");
	var links = gallery.getElementsByTagName("span");
	
	for(i = 0; i < links.length; i++) {
		
		links[i].onclick = function() {
			
			return expand(this);

		}
		
	}
	
	
	/*Now create an array of all the images within the pressReleases list, then check the class name
	  for each one ....... if it's "closeItem" then it's a close image. We then assign the
	  function collapse() to each one found */
	  
	var closeLinks = gallery.getElementsByTagName("img");
	
	for(i = 0; i < closeLinks.length; i++) {
		
		
		if(closeLinks[i].className == "closeItem" ){
					
			
			closeLinks[i].onclick = function() {
				
				return collapse(this)	
				
			}
			
			
		}
		
	}

	
}


var displayingThisElement

function expand(whichItem)  {
	
	
	/* get the alt attribute which contains the id of the actual element we want to display,
	   and then add the word expand to it */
	   
	var source = whichItem.getAttribute("id") + "expand";
	
		if(document.getElementById(source)) {
			
			document.getElementById(source).style.display = "block"
			document.getElementById(whichItem.getAttribute("id")).style.display = "none"
			document.getElementById(whichItem.getAttribute("id")).parentNode.style.display = "none"
		}
	
	
	if(document.getElementById(source)) {
				
		document.getElementById(source).style.display = "block"
		displayingThisElement = source

	}
		
}


function collapse(whichItem)  {
	
	
	// now get the alt attribute which again contains the actual element name we want to hide
	   
	var source = whichItem.getAttribute("alt") + "expand";
		
		if(document.getElementById(source)) {
			
			document.getElementById(source).style.display = "none"
			document.getElementById(whichItem.getAttribute("alt")).style.display = "block"
			document.getElementById(whichItem.getAttribute("alt")).parentNode.style.display = "block"
		}
		
}
