// =============================================================================
// 		generic functions (rollOn(), rollOff(), etc.
// =============================================================================

function preLoad() {
	// set our array of image names that we're going to load
	var arrImages = new Array ("schools","registration","calendars","transportation","testing","news","profile","employment","construction","redistricting","staff");
	var arrImage = new Array(6);
	
	// loop through arrImages, setting a new image and preloading it
	for (i = 0; i < arrImages.length; i++) {
		strName = "/appoquinimink/images/nav." + arrImages[i] + ".on.gif";
		arrImage[i] = new Image();
		arrImage[i].src = strName;
	}
}

function rollOn(name) {
	// rollover our images, based on the passed image name
	var strImage = "/appoquinimink/images/nav." + name + ".on.gif";
	document.images[name].src = strImage;
}

function rollOff(name) {
	// rollover our images, based on the passed image name
	var strImage = "/appoquinimink/images/nav." + name + ".gif";
	document.images[name].src = strImage;
}

preLoad();

function swapURL(page) {
	location.href = page;
}

function popWin(url,width,height) {
	var myWin = window.open(url, "myWin", "width=" + width + ",height=" + height + ",scrollbars=1,menu=0");
}

/* Note to all viewers:

I know this is a bad way to arrange your code. I simply did it for space constraints. 
I hate JavaScript that takes up 6,000 lines of code (obvious over-exageration). Just 
don't want anyone thinking I'm a slacker. : ) 

Joel
*/

function valLogin() {
	// make sure a username and password were supplied
	var strUsername = document.login.username.value;
	var strPassword = document.login.password.value;
	
	if (strUsername == "" || strPassword == "") {
		alert("Both the username and password are required to login.");
		return false;
	} else {
		// all good!
		return true;
	}
}

function valContact() {
	var strName = document.Contact.name.value;
	var strEmail = document.Contact.email.value;
	var strComments = document.Contact.comments.value;
	
	if (strName == "" || strEmail == "" || strComments == "") {
		alert("All fields are required to submit this form. Thank you.");
		return false;
	} else {
		// all good!
		return true;
	}
}

function chContent(msg){
	var indMsg = "Everything a parent needs to know about Delaware's fastest growing school district including: academic performance, enrollment, current events and school feeder patterns. We've even included an online application form for job seekers, and the district's email directory.";
	var dpMsg = "Appoquinimink Public Schools serve Middletown, Odessa, Townsend and nearby Bear, DE. You'll find information on the district - it&rsquo;s performance, policies and staff - in the District Profile.";
	var scMsg = "There are 10 schools in the District serving 7,300 students in grades Pre-K to 12 as well as the Groves Adult Education and Literacy Center, offering supportive services for those 16 and over. You'll find personalized information on each building in the Schools Section.";
	var regMsg = "ASD is the fastest growing school system in the state. To help busy parents, we&rsquo;ve developed an electronic pre-registration process you can begin at home.";
	var calMsg = "Check out the events happening each month in our schools. You'll find holidays, testing dates, open house information and more in this section.";
	var transMsg = "Whether your student walks, rides or takes the bus to school, you&rsquo;ll appreciate this information on school feeder patterns, bus routes and early dismissal/school closings.";
	var tstMsg = "Testing and assessment is part of the district&rsquo;s commitment to continuous improvement. You&rsquo;ll find the results of important state and national tests in this section.";
	var nwsMsg = "Appoquinimink Schools are governed by a volunteer Board. Meetings are open to the public. You'll find information on meetings, minutes and a directory of members in the Board Section.";
	var empMsg = "If you are a teacher, administrator or have other specialized educational skills, the Appoquinimink School District is a great place to advance your career. Review the latest job opportunities and apply online today.";
	var cnstMsg = "Building and maintaining top facilities creates a superior learning environment for students. View pictures and updates about construction projects in the district in this section.";
	var stfMsg = "The Appoquinimink Parents Academy offers FREE workshops every month for parents and caregivers. Experts offer advice on everything from \"How to Prepare Your Child for Kindergarten,\" to \"Getting Ready for College\". Morning and evening sessions are available. Check here for the latest offerings and to register online."
	var plnMsg = "ASD&rsquo;s strategic plan articulates our vision for the future. You&rsquo;ll find goals & objectives, action steps and timelines outlined in an easy to read format.";
	var cntMsg = "When you visit our website, please take time to tell us what you think. Use this online form to share your questions, ideas, comments and suggestions with our staff.";
	var twsMsg = "A resource page for educators that includes FREE monthly workshops, information on national certification and the Teacher Of The Year Program. Check here for the latest offerings and to register.";

	//alert('We made it this far.');
	obj = findDOM('idChContent');
	//alert(obj);
	var message = eval(msg);
	
	obj.innerHTML = message;
}