<!-- Begin
//var randNumber = Math.round(Math.random() * 5);
var randNumber = Math.floor(Math.random() * 5 + 1);
var img = new Array();
img[1] = "/img/index/50.jpg";
img[2] = "/img/index/51.jpg";
img[3] = "/img/index/52.jpg";
img[4] = "/img/index/53.jpg";
img[5] = "/img/index/54.jpg";

var imgALT = new Array();
imgALT[1] = "Read Across America Day";
imgALT[2] = "Read Across America Day";
imgALT[3] = "Hands-on Learning for Math Students";
imgALT[4] = "Science Show at EBSOLA";
imgALT[5] = "Roller Skating";

var title = new Array();
title[1] = "Read Across America Day";
title[2] = "Read Across America Day";
title[3] = "Hands-on Learning for Math Students";
title[4] = "Science Show at EBSOLA";
title[5] = "Roller Skating";

var cap = new Array();
cap[1] = "Grewenow Elementary";
cap[2] = "Grewenow Elementary";
cap[3] = "Bradford High";
cap[4] = "EBSOLA";
cap[5] = "Strange Elementary";

var word = new Array();
word[1] = "Kenosha County Executive James Kreuser reading to Grewenow Elementary kindergarten students during 'Read Across America Day'.";
word[2] = "County Executive James Kreuser presenting a proclamation to Gay Voelz, Grewenow Elementary Principal, and KEA Executive Director Joe Kiriaki declaring March 2 as 'Read Across America Day'.";
word[3] = "Bradford math teacher Dean Oleole gave one of his math classes a real hands-on learning experience with an egg bungee project. The goal was to drop an egg attached to a series of rubber bands, and have it stop right before the floor. Students had to factor in items such as the stretch length versus weight of the egg. Students found this a great way to better understand the uses of math.";
word[4] = "The University of Wisconsin - Madison's 'Wonders of Physics' traveling show presented two performances at EBSOLA school. The students watched examples that demonstrated motion, heat, sound, electricity, magnetism, and light. The activity was designed to get students excited about their Third Annual Science Fair on April 22.";
word[5] = "Ms. Olsen's class roller skating at Curtis Strange Elementary.";

var url = new Array();
url[1] = "/photos/photos.php";
url[2] = "/photos/photos.php";
url[3] = "/photos/photos.php";
url[4] = "/photos/photos.php";
url[5] = "/photos/photos.php?level=album&id=411";

function rotatePicture(num) {
	document.getElementById('image').src = img[num];
	document.getElementById('image').alt = imgALT[num];
	document.getElementById('title').innerHTML = title[num];
	document.getElementById('caption').innerHTML = cap[num];
	document.getElementById('word').innerHTML = word[num];
	document.getElementById('url').href = url[num];
}
//  End -->


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// Focus
<!-- Begin
function putFocus(formInst, elementInst) {
	/*
	if (document.forms.length > 0) {
		document.forms[formInst].elements[elementInst].focus();
	}
	*/
}
// The second number in the "onLoad" command in the body
// tag determines the form's focus. Counting starts with '0'
//  End -->
// END Focus
// HORIZ NAV JS

hideElements = new Array();

// hides selectors when user rolls over horizontal dropdown
function findForm() {
	//alert('this is ie');
	//hideElements = new Array();
	for (var f=0; f<window.document.forms.length; f++) {
		var theForm = window.document.forms[f];
		for (var e=0; e<theForm.elements.length; e++) {
			var theElem = theForm.elements[e];
			if (theElem.type.substr(0,6) == "select") {
				hideElements.push(theElem);
			}
		}
	}
}


// set up month rollover scripts
function setNav() {
	// decide if dropdown should hide any flash objects on the page
	var av = navigator.appVersion.toLowerCase();
	var ua = navigator.userAgent.toLowerCase();
	var platform;
	var browser;
	var hideFlash = false;
	var hideAd = false;
	if (av.indexOf("mac") != -1) {
		platform = "mac";
	} else if (av.indexOf("windows") != -1) {
		platform = "win";
	}
	if (ua.indexOf("firefox") != -1) {
		browser = "firefox";
	}

	// if firefox...
	if (browser == "firefox") {
		//alert('user has firefox');
		hideFlash = true;
	}
	
	if (browser == "firefox" || ua.indexOf("safari") != -1) {
		hideAd = true;
	}

	var isIE = (navigator.appName == "Microsoft Internet Explorer");

	// swfPresent will be defined if hiding swfs
	if (window.swfList) {
		swfPresent = true;
		//alert('hiding: '+swfsToHide);
		//alert(swfList.length);
	} else {
		swfPresent = false;
		//alert('nothing to hide');
	}
	


	// drop down
	if (document.getElementById && document.getElementById("topNav")) {
		navRoot = document.getElementById("topNav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.className == "collapsed") {
			
				node.onmouseover = function() {
					this.className = 'expanded';
					
					// testing form thing
					if (isIE) {
						for (e=0; e<hideElements.length; e++) {
							var formElem = document.getElementById(hideElements[e].id);
							if (formElem != null) {
								formElem.style.visibility = 'hidden';
							}
						}
						
					}
					
					// This hides the flash object(s)
					if (hideFlash && swfPresent) {
						for (var s=0; s<swfList.length; s++) {
							var flashobject = document.getElementById(swfList[s]);
							flashobject.style.visibility = 'hidden';
						}
					}
					
					/*
					// hides wide ad
					if (hideAd) {
						if (document.getElementById('adWrap') != null) {
							var adDiv = document.getElementById('hideThisDiv');
							var adWrap = document.getElementById('adWrap');
							adWrap.style.height = '46px';
							//adWrap.style.backgroundColor = '#48AF38';
							adDiv.style.display = 'none';
						}
					}
					*/
					
					// hides ad
					if (hideAd && this.childNodes[1].innerHTML == "More [+]") {
						if (document.getElementById('ad_InContent') != null) {
							document.getElementById('ad_InContent').style.height = '262px';
						} else if (document.getElementById('ad_Poster') != null) {
							document.getElementById('ad_Poster').style.height = '612px';
						}
						var adObj1 = document.getElementById('ad');
						var adObj2 = document.getElementById('adslug');
						if (adObj1 != null) {
							adObj1.style.display = 'none';
						}
						if (adObj2 != null) {
							adObj2.style.display = 'none';
						}
					}
				}
				
				node.onmouseout = function() {
				this.className = 'collapsed';
					
					// testing form thing
					if (isIE) {
						for (e=0; e<hideElements.length; e++) {
							var formElem = document.getElementById(hideElements[e].id);
							if (formElem != null) {
								formElem.style.visibility = 'visible';
							}
						}
						
					}
					
					// This unhides the flash object(s)
					if (hideFlash && swfPresent) {
						for (var s=0; s<swfList.length; s++) {
							var flashobject = document.getElementById(swfList[s]);
							flashobject.style.visibility = 'visible';
						}
					}
					
					/*
					// unhides wide ad
					if (hideAd) {
						if (document.getElementById('adWrap') != null) {
							var adDiv = document.getElementById('hideThisDiv');
							var adWrap = document.getElementById('adWrap');
							adWrap.style.height = '46px';
							adDiv.style.display = 'block';
						}
					}
					*/
					
					// unhides ad
					if (hideAd && this.childNodes[1].innerHTML == "More [+]") {
						var adObj1 = document.getElementById('ad');
						var adObj2 = document.getElementById('adslug');
						if (adObj1 != null) {
							adObj1.style.display = 'block';
						}
						if (adObj2 != null) {
							adObj2.style.display = 'block';
						}
					}
					
				}
				
				for (j=0; j<node.childNodes.length; j++) {
					if (node.childNodes[j].className == "dropContainer") {
						elem = node.childNodes[j];
						for (k=0; k<elem.childNodes.length; k++) {
						
							// find 1st tier dropdowns
							if (elem.childNodes[k].className == "dropMenu" || elem.childNodes[k].className == "anchorDropMenu") {
								menuElem = elem.childNodes[k];
						
								for (q=0; q<menuElem.childNodes.length; q++) {

						
									if (menuElem.childNodes[q].className == "dropItem") {
										dropElem = menuElem.childNodes[q];
										dropElem.onmouseover = function() {
											//
											this.className = 'dropItemHi';
										}
										dropElem.onmouseout = function() {
											//
											this.className = 'dropItem';
										}
									
										// find 1st tier drop items that are also 2nd tier dropdowns
										for (d=0; d<dropElem.childNodes.length; d++) {
											if (dropElem.childNodes[d].className == "dropMenu2") {
												// found one
												tier2Item = dropElem.childNodes[d];
												// assign rollovers
												for (r=0; r<tier2Item.childNodes.length; r++) {
													if (tier2Item.childNodes[r].className != "rule") {
														tier2Item.childNodes[r].onmouseover = function() {
															this.className = 'dropItemHi';
														
														}
														tier2Item.childNodes[r].onmouseout = function() {
															this.className = 'dropItem';
														}
													}
												}
											}
										}
									} else if (menuElem.childNodes[q].className == "dropItem_s") { // special drop item, i.e. partner sites
										dropElem = menuElem.childNodes[q];
										dropElem.onmouseover = function() {
											//
											this.className = 'dropItemHi_s';
										}
										dropElem.onmouseout = function() {
											//
											this.className = 'dropItem_s';
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	
	if (navigator.appName == "Microsoft Internet Explorer" && platform != "mac") {
		isIE = true;
		window.attachEvent("onload", findForm);
		//window.onload = findForm;
	}	
}
function goTo(where) {
	window.location = where;
}
function goToNew(where,winName,features) {
	window.open(where,winName,features);
}
// do it
window.onload = setNav;