if (document.getElementById && document.getElementsByTagName && document.createElement) {
	document.write('<link rel="stylesheet" type="text/css" href="js_hide.css" />');
	window.onload = initShowHide; 
}

function initShowHide() 

{
	// Hide the container with all toggleable elements 
	document.getElementById('toggleable').style.display = 'none';
	var as = document.getElementById('toggle').getElementsByTagName('a');
	for (var i = 0; i < as.length; i++) {
		as[i].onclick = function() {

//	{
// 	set up an array of the images
//	  images = new Array(
//	"/scenery/IMG_9293.jpg",
//	"/yes/IMG_3852.jpg",
//	"/yes/IMG_5477.jpg",
//	"/yes/IMG_3280.jpg",
//	"/yes/IMG_5288.jpg",
//	"/yes/IMG_7558.jpg",
//	"/yes/112802.jpg",
//	"/yes/IMG_0303.jpg",
//	"/yes/IMG_9686.jpg",
//	"/yes/2274.jpg"
//	);
//		  rand = Math.floor(Math.random()*images.length); // chose a random number, between 0 and the length of the array -1
//		  img = images[rand]; // set img to the random image's src
//		  document.bgColor="#000000";
//		  document.body.style.background = "url("+img+")"; // set the background image
//	}

{

//This does the on click random background pic

var randnum = Math.random();
var inum = 10;
// Change this number to the number of images you are using.
var rand1 = Math.round(randnum * (inum-1)) + 1;
var randomBg = "yes/"+galleryarray[rand1]
document.bgColor="#000000";
// document.body.style.backgroundRepeat = "no-repeat";
document.body.style.background="#000 url("+randomBg+") no-repeat"; // set the background image

// document.write('<body background="' + randomBg + '" link="#5050FF" bgcolor="#000000">')

}



			toggle(this);
			return false;
		}
	
	}
}

function toggle(s) {
	// Retrieve the id of the toggleable section
	var id = s.href.match(/#(\w.+)/)[1];
	// Clone the activated toggleable element from the content pool
	var clone = document.getElementById(id).cloneNode(true);
	// This clone will be wrapped in a generated container element called 'cloneDiv' 
	// Try to get a reference to an existing container element
	var cloneDiv = document.getElementById('cloneDiv');
	// In case the container element already exists
	if (cloneDiv) {
		// Replace the previously cloned toggleable element with the new one
		cloneDiv.replaceChild(clone, cloneDiv.firstChild);	
	}
	// In case the container element isn't created yet
	else {
		// Create the container element
		var cloneDiv = document.createElement('div');
		// Add the id attribute and set its value
		cloneDiv.setAttribute('id', 'cloneDiv');
		// Put the cloned element in the cloned container
		cloneDiv.appendChild(clone);
		// Append the cloned container to the body of the document
		document.body.appendChild(cloneDiv);
	}
}



