//created by: josh brown
//Aztek technology
//Date: 7/17/2007


var source = new Array ("../images/floorplan/log-cabin.jpg", 
						"../images/floorplan/wildlife-exhibits.jpg", 
						"../images/floorplan/deer-barn.jpg",
						"../images/floorplan/pond.jpg",
						"../images/floorplan/rocky-river-classroom.jpg",
						"",
						"../images/floorplan/resource-center.jpg",
						"../images/floorplan/rehab-intake.jpg",
						"",
						"../images/floorplan/turtle-exhibit.jpg",
						"../images/floorplan/reception.jpg",
						"../images/floorplan/courtyard.jpg",
						"../images/floorplan/exhibit-hall.jpg",
						"",
						"../images/floorplan/planetarium.jpg",
						"../images/floorplan/wild-birds-unlimited.jpg",
						"../images/floorplan/grand-river-room-south.jpg",
						"../images/floorplan/grand-river-room-north.jpg",
						"../images/floorplan/porter-creek-classroom.jpg");
						

var title = new Array ("Log Cabin", "Wildlife Exhibits", "Deer Barn", "Pond", "Rocky River Classroom", "Vermilion Conference Room", "Resource Center", "Wildlife Rehab Intake", "Administrative Offices", "Turtle Exhibit", "Reception", "Courtyard", "Exhibit Hall", "Patio with Fireplace", "Planetarium", "Wild Birds Unlimited", "Grand River Room South", "Grand River Room North", "Porter Creek Classroom");

var caption = new Array ('The Log Cabin is our interactive "get-away" classroom for kindergarteners.  Nature programs are extra fun in this classroom by the pond.',
						 "",
						 "This outdoor haven is home to friendly deer, wild turkeys, and plenty of adorable bunnies.  You'll experience this critter, close encounter at the end of the outdoor bunny trail.",
						 "You will find frogs, fish, turtles, and plant life in our serene outdoor pond.  Stand in the middle of the bridge and witness the natural beauty all around you. Perfect for a Girl Scout Bridging Ceremony.",
						 "Parents and children come together to experience classes and programs in this room, like Frogs &amp; Polliwogs. Its location next to the outdoor wildlife encourages discovery as well as nature hikes and collaborative crafts and fun.",
						 "Scouts find this area perfect for concentrating on earning those much-needed badges.  Reading camps are conducted here as well.",
						 "Named after the founder of the Lake Erie Nature & Science Center, Dr. Elberta W. Fleming, this room provides you with a forest of information…but a forest easily navigated.",
						 'The Intake is the first room injured or abandoned animals will see in their stay at the Lake Erie Nature &amp; Science Center.  After assessing the animal\'s condition, the animal may go to our "hospital" or back home with you.',
						 "The habitat of Lake Erie Nature &amp; Science Center staff where they employ their passion for bringing natural science &amp; wildlife education to friends, family, community, and you!",
						 "Though extremely slow, turtles in this open exhibit are a favorite at Lake Erie Nature &amp; Science Center.  Get up close and feel the shells as they lumber along under your hand.",
						 "As soon as you walk in the door, the smiling face behind the desk is ready to get you started discovering all the Center has to offer.",
						 "From the main hallway you can gaze upon this enclosed habitat where the sun and the chloroplasts play.",
						 "Witness many of Lake Erie Nature &amp; Science Center's 100+ animals in this indoor Exhibit Hall. You'll also find our Tide pool, indoor fireplace, and discovery area here.",
						 "",
						 "Be informed and awestruck in the Walter R. Schuele Planetarium.  Programs like Twinkle Tots, Stellar Stars, Backyard Astronomy and much more give you insight to navigating the majesty of the night sky.",
						 "Once you're finished with your trip through the Lake Erie Nature &amp; Science Center, stop by Wild Birds Unlimited for souvenirs and other nature-themed gift items.",
						 "Field trips and large scale programs are ideal for such a venue.",
						 "Birthday parties as well as facility events are frequently hosted here.",
						 "Your preschooler will be thrilled by Nature Nuts in this engaging and entertaining classroom.  With plenty of pictures, toys, and small animals, there are so many ways to learn while having fun.");



function showExhibit(evt,exhibitIndex, orientation) 
{

	theDiv = document.getElementById("exhibit-div");
	
	
	//Added to clear out the div before you set the information again
	//KMI - 7/17/2007
	theDiv.innerHTML = '';
	
	
	//create an image control and assign the source images
	theImg = document.createElement("img");
	theImg.src=source[exhibitIndex];
	theImg.alt=title[exhibitIndex];
	
	//create h2 and assign title from array title	
	theTitle = document.createElement("h2");
	theTitle.innerHTML = title[exhibitIndex];
	theTitle.style.margin = "6px";
	
	//create caption P tag and assing text from caption array	
	theCaption = document.createElement("p");
	theCaption.innerHTML = caption[exhibitIndex];
	theCaption.style.margin = "6px";
	
	//insert image tag only if there is an image file to show
	if (source[exhibitIndex] != "") 
	{
	theDiv.appendChild(theImg);
	}
	
	//insert title and caption
	theDiv.appendChild(theTitle);
	theDiv.appendChild(theCaption);
	
	//make wrapper div landscape or portrait
	if (orientation == "horz") 
	{
 theDiv.style.width = "286px";
	}else{
	  theDiv.style.width = "200px";
	}
	
	
	theDiv.style.visibility = "visible";
	
	
	//KMI - 7/17/2007 added so image displays based on mouse position
	theDiv.style.top =  mouseY(evt) + 30 + "px";
	theDiv.style.left = mouseX(evt) - 143 + "px";

	
}

//KMI - 7/17/2007 added to capture mouse position 
function mouseX(evt) 
{
	if (evt.pageX) return evt.pageX;
	else if (evt.clientX)return evt.clientX + (document.documentElement.scrollLeft ?  document.documentElement.scrollLeft : document.body.scrollLeft); 
	else return null;
 }
//KMI - 7/17/2007 added to capture mouse position
function mouseY(evt) 
{
	if (evt.pageY) return evt.pageY; 
	else if (evt.clientY)return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); 
	else return null;
}


function hideExhibit() {
	theDiv = document.getElementById("exhibit-div");
	theDiv.style.visibility = "hidden";
}
