/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder = "buttons/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources = new Array("button1up.png","button2up.png","button3up.png","button4up.png","button5up.png","button6up.png","button7up.png","button8up.png","button9up.png","button10up.png","button11up.png","button12up.png","button13up.png","button14up.png","button15up.png","button16up.png","button17up.png","button18up.png","button19up.png");

overSources = new Array("button1over.png","button2over.png","button3over.png","button4over.png","button5over.png","button6over.png","button7over.png","button8over.png","button9over.png","button10over.png","button11over.png","button12over.png","button13over.png","button14over.png","button15over.png","button16over.png","button17over.png","button18over.png","button19over.png");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo = new Array();
subInfo[1] = new Array();
subInfo[2] = new Array();
subInfo[3] = new Array();
subInfo[4] = new Array();
subInfo[5] = new Array();
subInfo[6] = new Array();
subInfo[7] = new Array();
subInfo[8] = new Array();
subInfo[9] = new Array();
subInfo[10] = new Array();
subInfo[11] = new Array();
subInfo[12] = new Array();
subInfo[13] = new Array();
subInfo[14] = new Array();
subInfo[15] = new Array();
subInfo[16] = new Array();
subInfo[17] = new Array();
subInfo[18] = new Array();
subInfo[19] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//

subInfo[2][1] = new Array("My Room ‘03 ","http://www.mspowell.com/tours/03.html","");
subInfo[2][2] = new Array("My Room ‘04 ","http://www.mspowell.com/tours/04.html","");
subInfo[2][3] = new Array("My Room ‘05 ","http://www.mspowell.com/tours/05.html","");
subInfo[2][4] = new Array("My Room ‘06 ","http://www.mspowell.com/tours/06.html","");
subInfo[2][5] = new Array("My Room ‘07 ","http://www.mspowell.com/tours/07.html","");
subInfo[2][6] = new Array("My Room ‘08 ","http://www.mspowell.com/tours/08.html","");
subInfo[2][7] = new Array("Site Visitors’ Rooms","http://www.mspowell.com/tours/sitevisitors.html","");
subInfo[2][8] = new Array("My Colleagues’ Rooms","http://www.mspowell.com/tours/colleagues.html","");

subInfo[3][1] = new Array("My Favorite Ideas","http://www.mspowell.com/favoriteorganization.html","");
subInfo[3][2] = new Array("Other Teachers’ Ideas","http://www.mspowell.com/organizationsubmissions.html","");
subInfo[3][3] = new Array("The Paper Trap","http://www.mspowell.com/papertrap.html","");
subInfo[3][4] = new Array("Lesson Materials & Files","http://mspowell.com/lessonpapers.html","");
subInfo[3][5] = new Array("Cleaning/Moving/Storing","http://www.mspowell.com/storage.html","");
subInfo[3][6] = new Array("Decorating Tips","http://www.mspowell.com/decorating.html","");
subInfo[3][7] = new Array("Bulletin Boards","http://www.mspowell.com/bulletinboards.html","");
subInfo[3][8] = new Array("Organizing the Kids","http://www.mspowell.com/organizingkids.html","");
subInfo[3][9] = new Array("BEE Books","http://www.mspowell.com/beebooks.html","");

subInfo[4][1] = new Array("Timesavers","http://www.mspowell.com/timesavers.html","");
subInfo[4][2] = new Array("$$ Saving Ideas","http://www.mspowell.com/moneysaving.html","");
subInfo[4][3] = new Array("The Paper Trap","http://www.mspowell.com/papertrap.html","");
subInfo[4][4] = new Array("Transition Tips","http://www.mspowell.com/transitiontips.html","");
subInfo[4][5] = new Array("Classroom Jobs","http://www.mspowell.com/classroomjobs.html","");
subInfo[4][6] = new Array("Daily Schedule","http://www.mspowell.com/dailyschedule.html","");

subInfo[5][1] = new Array("Planning Basics","http://www.mspowell.com/planning.html","");
subInfo[5][2] = new Array("Daily Schedule","http://www.mspowell.com/dailyschedule.html","");
subInfo[5][3] = new Array("The Paper Trap","http://www.mspowell.com/papertrap.html","");
subInfo[5][4] = new Array("Documentation","http://www.mspowell.com/documentation.html","");
subInfo[5][5] = new Array("Assessment","http://www.mspowell.com/assessment.html","");
subInfo[5][6] = new Array("Grading Made Simple","http://www.mspowell.com/grading.html","");

subInfo[6][1] = new Array("Multiple Intelligences","http://www.mspowell.com/mi.html","");
subInfo[6][2] = new Array("Brain-Based Learning","http://www.mspowell.com/brainbased.html","");
subInfo[6][3] = new Array("Using Manipulatives","http://www.mspowell.com/usingmanips.html","");
subInfo[6][4] = new Array("Cooperative Learning","http://www.mspowell.com/cooperativelearning.html","");
subInfo[6][5] = new Array("Teaching With Themes","http://www.mspowell.com/themes.html","");
subInfo[6][6] = new Array("Equitable Participation","http://www.mspowell.com/participation.html","");
subInfo[6][7] = new Array("Kids Off Task? (FMAP)","http://mspowell.com/kidsofftask.html","");
subInfo[6][8] = new Array("Using Music","http://www.mspowell.com/music.html","");

subInfo[7][1] = new Array("HW Procedures","http://www.mspowell.com/homework.html","");
subInfo[7][2] = new Array("Ideas for Assignments","http://www.mspowell.com/hwassignments.html","");
subInfo[7][3] = new Array("Fun Folders","http://www.mspowell.com/funfolders.html","");

subInfo[8][1] = new Array("Science/Health","http://www.mspowell.com/science.html","");
subInfo[8][2] = new Array("Social Studies","http://www.mspowell.com/socialstudies.html","");
subInfo[8][3] = new Array("U.S. History","http://www.mspowell.com/historyus.html","");
subInfo[8][4] = new Array("World History","http://www.mspowell.com/historyworld.html","");
subInfo[8][5] = new Array("Technology","http://www.mspowell.com/technology.html","");
subInfo[8][6] = new Array("Homework","http://www.mspowell.com/homework.html","");
subInfo[8][7] = new Array("Seasonal Ideas","http://www.mspowell.com/seasonal.html","");
subInfo[8][8] = new Array("Fun Free Stuff to Print","http://mspowell.com/funfreestuff.html","");

subInfo[9][1] = new Array("Literacy 911!","http://www.mspowell.com/literacy911.html","");
subInfo[9][2] = new Array("Class Meetings","http://www.mspowell.com/classmeetings.html","");
subInfo[9][3] = new Array("Read/ Think Alouds","http://www.mspowell.com/readalouds.html","");
subInfo[9][4] = new Array("Guided Reading Groups","http://mspowell.com/readinggroups.html","");
subInfo[9][5] = new Array("Centers","http://www.mspowell.com/centers.html","");
subInfo[9][6] = new Array("Workjobs","http://mspowell.com/workjobs.html","");
subInfo[9][7] = new Array("Self-Selected Reading","http://mspowell.com/SSR.html","");
subInfo[9][8] = new Array("Classroom Library","http://www.mspowell.com/classlibraries.html","");
subInfo[9][9] = new Array("Non-Fiction Texts","http://www.mspowell.com/nonfiction.html","");
subInfo[9][10] = new Array("Comprehension","http://mspowell.com/comprehension.html","");
subInfo[9][11] = new Array("Word Work","http://mspowell.com/wordwork.html","");
subInfo[9][12] = new Array("Spelling","http://mspowell.com/spelling.html","");
subInfo[9][13] = new Array("Vocabulary","http://www.mspowell.com/vocabulary.html","");
subInfo[9][14] = new Array("Writing","http://mspowell.com/writing.html","");
subInfo[9][15] = new Array("Grammar","http://mspowell.com/grammar.html","");
subInfo[9][16] = new Array("Word Walls","http://mspowell.com/wordwalls.html","");

subInfo[10][1] = new Array("Math Tubs (Games)","http://www.mspowell.com/mathtubs.html","");
subInfo[10][2] = new Array("Math KITs (For Home)","http://mspowell.com/mathkits.html","");
subInfo[10][3] = new Array("Math Activities/Lessons","http://mspowell.com/mathactivities.html","");
subInfo[10][4] = new Array("Using Manipulatives","http://www.mspowell.com/usingmanips.html","");

subInfo[11][1] = new Array("Portfolios","http://www.mspowell.com/portfolios.html","");
subInfo[11][2] = new Array("Grading Made Simple","http://www.mspowell.com/grading.html","");
subInfo[11][3] = new Array("Creative Ways to Assess","http://www.mspowell.com/assessment.html","");
subInfo[11][4] = new Array("Bi-Weekly Work Samples","http://www.mspowell.com/biweeklies.html","");
subInfo[11][5] = new Array("Standardized Tests","http://www.mspowell.com/standardized.html","");

subInfo[12][1] = new Array("Beginning of Year","http://www.mspowell.com/firstweeks.htm","");
subInfo[12][2] = new Array("Open House","http://www.mspowell.com/openhouse.html","");
subInfo[12][3] = new Array("End of Year","http://www.mspowell.com/yearsend.html","");
subInfo[12][4] = new Array("State Test Time","http://www.mspowell.com/standardized.html","");
subInfo[12][5] = new Array("Seasonal Activities","http://www.mspowell.com/seasonal.html","");

subInfo[13][1] = new Array("English Learners","http://www.mspowell.com/esol.html","");
subInfo[13][2] = new Array("Talented and Gifted","http://www.mspowell.com/gifted.html","");
subInfo[13][3] = new Array("Special Needs","http://mspowell.com/specialneeds.html","");
subInfo[13][4] = new Array("Fast & Slow Finishers","http://mspowell.com/fastslowworkers.html","");
subInfo[13][5] = new Array("High-Poverty Classes","http://www.mspowell.com/poverty.html","");

subInfo[14][1] = new Array("Behavior 101","http://mspowell.com/behavior101.html","");
subInfo[14][2] = new Array("The Bead System","http://www.mspowell.com/beadsystem.html","");
subInfo[14][3] = new Array("Easy Token System","http://www.mspowell.com/tokensystem.html","");
subInfo[14][4] = new Array("Character Education","http://mspowell.com/charactered.html","");
subInfo[14][5] = new Array("Class Meetings","http://www.mspowell.com/classmeetings.html","");
subInfo[14][6] = new Array("Kids Off Task? (FMAP)","http://mspowell.com/kidsofftask.html","");
subInfo[14][7] = new Array("Transition Tips","http://www.mspowell.com/transitiontips.html","");
subInfo[14][8] = new Array("Fast & Slow Finishers","http://mspowell.com/fastslowworkers.html","");
subInfo[14][9] = new Array("Using Music","http://www.mspowell.com/music.html	","");
subInfo[14][10] = new Array("Individual Plans","http://mspowell.com/behaviorplans.html","");
subInfo[14][11] = new Array("Daily/Weekly Reports","http://mspowell.com/weeklyevaluations.html","");
subInfo[14][12] = new Array("Documentation","http://www.mspowell.com/documentation.html","");
subInfo[14][13] = new Array("High-Poverty Classes","http://www.mspowell.com/poverty.html","");

subInfo[15][1] = new Array("15 Ways to Involve","http://mspowell.com/parents.html","");
subInfo[15][2] = new Array("Family Festivities","http://www.mspowell.com/familyfests.html","");
subInfo[15][3] = new Array("Daily/Weekly Reports","http://mspowell.com/weeklyevaluations.html","");
subInfo[15][4] = new Array("Bi-Weekly Work Samples","http://www.mspowell.com/biweeklies.html","");
subInfo[15][5] = new Array("Documentation","http://www.mspowell.com/documentation.html","");

subInfo[16][1] = new Array("Top 10 Tips","http://www.mspowell.com/toptentips.html","");
subInfo[16][2] = new Array("Burned Out?","http://www.mspowell.com/burnedout.html","");
subInfo[16][3] = new Array("Fight For Reform!","http://mspowell.com/reform.html","");
subInfo[16][4] = new Array("Are You Serious?","http://www.mspowell.com/areyouserious.html","");
subInfo[16][5] = new Array("National Board Certif.","http://mspowell.com/nbpts.html","");
subInfo[16][6] = new Array("Classic Class Moments","http://www.mspowell.com/classicmoments.html","");
subInfo[16][7] = new Array("Ms. Powell’s Book","http://www.TheCornerstoneForTeachers.com/book.html","");
subInfo[16][8] = new Array("Ms. Powell's Blog", "http://www.TheCornerstoneForTeachers.blogspot.com","");
subInfo[16][9] = new Array("The new website!","http://www.TheCornerstoneForTeachers.com","");
subInfo[16][10] = new Array("Devotions for Teachers","http://www.mspowell.blogspot.com","");
subInfo[16][11] = new Array("Message Board Forum","http://groups.yahoo.com/group/TheCornerstoneForTeachers/join","");

subInfo[17][1] = new Array("Student Teaching","http://www.mspowell.com/studentteaching.html","");
subInfo[17][2] = new Array("Job Interview Tips","http://www.mspowell.com/jobinterview.html","");
subInfo[17][3] = new Array("Top 10 Tips","http://www.mspowell.com/toptentips.html","");
subInfo[17][4] = new Array("Are You Serious?","http://www.mspowell.com/areyouserious.html","");

subInfo[18][1] = new Array("God in Public Schools","http://mspowell.com/Godsplace.html","");
subInfo[18][2] = new Array("Devotions For Teachers","http://www.mspowell.blogspot.com","");

subInfo[19][1] = new Array("Autobiography","http://www.mspowell.com/autobiography.html","");
subInfo[19][2] = new Array("Ms. Powell’s Book","http://www.TheCornerstoneForTeachers.com/book.html","");
subInfo[19][3] = new Array("The new website!","http://www.TheCornerstoneForTeachers.com","");
subInfo[19][4] = new Array("The Blog","http://www.thecornerstoneforteachers.blogspot.com/","");
subInfo[19][5] = new Array("Message Board Forum","http://groups.yahoo.com/group/TheCornerstoneForTeachers/join","");
subInfo[19][6] = new Array("Devotions for Teachers","http://www.mspowell.blogspot.com","");
subInfo[19][7] = new Array("Ms. Powell on Twitter","http://www.twitter.com/AngelaPowell","");
subInfo[19][8] = new Array("View/Sign Guestbook","http://users3.smartgb.com/g/g.php?a=s&i=g30-00965-07","");
subInfo[19][9] = new Array("View Old Guestbook","http://htmlgear.tripod.com/guest/control.guest?u=angelas23&i=3&a=view","");
subInfo[19][10] = new Array("Awards","http://www.mspowell.com/awards.html","");
subInfo[19][11] = new Array("Donations","http://www.mspowell.com/donations.html","");


//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset = 148;
var ySubOffset = 0;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub = false;
var delay = 1000;
totalButtons = upSources.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '" class="dropmenu" ');
		document.write('onMouseOver="overSub=true;');
		document.write('setOverImg(\'' + (x+1) + '\',\'\');"');
		document.write('onMouseOut="overSub=false;');
		document.write('setTimeout(\'hideSubMenu(\\\'submenu' + (x+1) + '\\\')\',delay);');
		document.write('setOutImg(\'' + (x+1) + '\',\'\');">');


		document.write('<ul>');
		for ( k=0; k<subInfo[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo[x+1][k+1][2] + '">');
			document.write( subInfo[x+1][k+1][0] + '</a>');
			document.write('</li>');
		}
		document.write('</ul>');
	}
	document.write('</div>');
}





//*** MAIN BUTTONS FUNCTIONS ***//
// PRELOAD MAIN MENU BUTTON IMAGES
function preload() {
	for ( x=0; x<totalButtons; x++ ) {
		buttonUp = new Image();
		buttonUp.src = buttonFolder + upSources[x];
		buttonOver = new Image();
		buttonOver.src = buttonFolder + overSources[x];
	}
}

// SET MOUSEOVER BUTTON
function setOverImg(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder + overSources[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder + upSources[But-1];
}



//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft(id) { 
	var el = getElement(id);
	if (el) { 
		xPos = el.offsetLeft;
		tempEl = el.offsetParent;
		while (tempEl != null) {
			xPos += tempEl.offsetLeft;
			tempEl = tempEl.offsetParent;
		} 
		return xPos;
	} 
} 

// GET Y COORDINATE
function getRealTop(id) {
	var el = getElement(id);
	if (el) { 
		yPos = el.offsetTop;
		tempEl = el.offsetParent;
		while (tempEl != null) {
			yPos += tempEl.offsetTop;
			tempEl = tempEl.offsetParent;
		}
		return yPos;
	}
}

// MOVE OBJECT TO COORDINATE
function moveObjectTo(objectID,x,y) {
	var el = getElement(objectID);
	el.style.left = x;
	el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu(subID, buttonID) {
	hideAllSubMenus();
	butX = getRealLeft(buttonID);
	butY = getRealTop(buttonID);
	moveObjectTo(subID,butX+xSubOffset, butY+ySubOffset);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus() {
	for ( x=0; x<totalButtons; x++) {
		moveObjectTo("submenu" + (x+1) + "",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu(subID) {
	if ( overSub == false ) {
		moveObjectTo(subID,-500, -500);
	}
}



//preload();

