/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder_SchoolUser = "buttons/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources_SchoolUser = new Array("button1up_SchoolUser.png","button2up_SchoolUser.png","button3up_SchoolUser.png","button4up_SchoolUser.png","button5up_SchoolUser.png","button6up_SchoolUser.png","button7up_SchoolUser.png","button8up_SchoolUser.png","button9up_SchoolUser.png","button10up_SchoolUser.png","button11up_SchoolUser.png");

overSources_SchoolUser = new Array("button1over_SchoolUser.png","button2over_SchoolUser.png","button3over_SchoolUser.png","button4over_SchoolUser.png","button5over_SchoolUser.png","button6over_SchoolUser.png","button7over_SchoolUser.png","button8over_SchoolUser.png","button9over_SchoolUser.png","button10over_SchoolUser.png","button11over_SchoolUser.png");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo_SchoolUser = new Array();
subInfo_SchoolUser[1] = new Array();
subInfo_SchoolUser[2] = new Array();
subInfo_SchoolUser[3] = new Array();
subInfo_SchoolUser[4] = new Array();
subInfo_SchoolUser[5] = new Array();
subInfo_SchoolUser[6] = new Array();
subInfo_SchoolUser[7] = new Array();
subInfo_SchoolUser[8] = new Array();
subInfo_SchoolUser[9] = new Array();
subInfo_SchoolUser[10] = new Array();
subInfo_SchoolUser[11] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//

subInfo_SchoolUser[2][1] = new Array("Pre-K","http://www.stmonicasea.org/Pre-K/Pre-KHome.html","");
subInfo_SchoolUser[2][2] = new Array("Kindergarten","http://www.stmonicasea.org/Kindergarten/index.html","");
subInfo_SchoolUser[2][3] = new Array("1st Grade","http://www.stmonicasea.org/1stgrade/first.htm","");
subInfo_SchoolUser[2][4] = new Array("2nd Grade","http://www.stmonicasea.org/2ndgrade/2ndgrade.htm","");
subInfo_SchoolUser[2][5] = new Array("3rd Grade","http://www.stmonicasea.org/3rdgrade/3rdgrade.htm","");
subInfo_SchoolUser[2][6] = new Array("4th Grade","http://www.stmonicasea.org/4thgrade/4thGrade.htm","");
subInfo_SchoolUser[2][7] = new Array("5th Grade","http://www.stmonicasea.org/5thGrade/5thGrade.htm","");
subInfo_SchoolUser[2][8] = new Array("6th Grade","http://www.stmonicasea.org/6thGrade/6thGrade.htm","");
subInfo_SchoolUser[2][9] = new Array("7th Grade","http://www.stmonicasea.org/7thGrade/7thgrade.htm","");
subInfo_SchoolUser[2][10] = new Array("8th Grade","http://www.stmonicasea.org/8thgrade/8thgrade.htm","");
subInfo_SchoolUser[2][11] = new Array("Art","http://www.stmonicasea.org/Art/art.htm","");
subInfo_SchoolUser[2][12] = new Array("Math","http://www.stmonicasea.org/Math/math.htm","");
subInfo_SchoolUser[2][13] = new Array("Music","http://www.stmonicasea.org/Music/music.htm","");
subInfo_SchoolUser[2][14] = new Array("PE","http://www.stmonicasea.org/PE/PE.htm","");
subInfo_SchoolUser[2][15] = new Array("Reading Spec.","http://www.stmonicasea.org/ReadingSpecialist/Readingspecialist.htm","");
subInfo_SchoolUser[2][16] = new Array("Science","http://www.stmonicasea.org/Science/science.htm","");
subInfo_SchoolUser[2][17] = new Array("Technology","http://www.stmonicasea.org/Technology/technology.htm","");


subInfo_SchoolUser[4][1] = new Array("Catalog","http://www.wlsdestiny.org/common/welcome.jsp?context=stmonica","");



subInfo_SchoolUser[7][1] = new Array("Forms","http://www.stmonicasea.org/ParentLinks/Forms.html","");
subInfo_SchoolUser[7][2] = new Array("Parent Access (PASS)","http://www.stmonicasea.org/PASS/smframe.htm","");
subInfo_SchoolUser[7][3] = new Array("Parent Club","http://www.stmonicasea.org/ParentLinks/parents.htm","");
subInfo_SchoolUser[7][4] = new Array("Parents Internet Safety","http://www.stmonicasea.org/Technology/InternetSafety.htm","");
subInfo_SchoolUser[7][5] = new Array("School Commission","http://www.stmonicasea.org/School_Commission/school_commission.htm","");
subInfo_SchoolUser[7][6] = new Array("Scrip","http://www.stmonicasea.org/Scrip/Scrip.htm","");






//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset_SchoolUser = 116;
var ySubOffset_SchoolUser = 3;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub_SchoolUser = false;
var delay_SchoolUser = 1000;
totalButtons_SchoolUser = upSources_SchoolUser.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons_SchoolUser; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo_SchoolUser[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '_SchoolUser">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '_SchoolUser" class="dropmenu_SchoolUser" ');
		document.write('onMouseOver="overSub_SchoolUser=true;');
		document.write('setOverImg_SchoolUser(\'' + (x+1) + '\',\'_SchoolUser\');"');
		document.write('onMouseOut="overSub_SchoolUser=false;');
		document.write('setTimeout(\'hideSubMenu_SchoolUser(\\\'submenu' + (x+1) + '_SchoolUser\\\')\',delay_SchoolUser);');
		document.write('setOutImg_SchoolUser(\'' + (x+1) + '\',\'_SchoolUser\');">');


		document.write('<ul>');
		for ( k=0; k<subInfo_SchoolUser[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo_SchoolUser[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo_SchoolUser[x+1][k+1][2] + '">');
			document.write( subInfo_SchoolUser[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_SchoolUser() {
	for ( x=0; x<totalButtons_SchoolUser; x++ ) {
		buttonUp_SchoolUser = new Image();
		buttonUp_SchoolUser.src = buttonFolder_SchoolUser + upSources_SchoolUser[x];
		buttonOver_SchoolUser = new Image();
		buttonOver_SchoolUser.src = buttonFolder_SchoolUser + overSources_SchoolUser[x];
	}
}

// SET MOUSEOVER BUTTON
function setOverImg_SchoolUser(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_SchoolUser + overSources_SchoolUser[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg_SchoolUser(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_SchoolUser + upSources_SchoolUser[But-1];
}



//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement_SchoolUser(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft_SchoolUser(id) { 
	var el = getElement_SchoolUser(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_SchoolUser(id) {
	var el = getElement_SchoolUser(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_SchoolUser(objectID,x,y) {
	var el = getElement_SchoolUser(objectID);
	el.style.left = x;
	el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu_SchoolUser(subID, buttonID) {
	hideAllSubMenus_SchoolUser();
	butX = getRealLeft_SchoolUser(buttonID);
	butY = getRealTop_SchoolUser(buttonID);
	moveObjectTo_SchoolUser(subID,butX+xSubOffset_SchoolUser, butY+ySubOffset_SchoolUser);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus_SchoolUser() {
	for ( x=0; x<totalButtons_SchoolUser; x++) {
		moveObjectTo_SchoolUser("submenu" + (x+1) + "_SchoolUser",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu_SchoolUser(subID) {
	if ( overSub_SchoolUser == false ) {
		moveObjectTo_SchoolUser(subID,-500, -500);
	}
}



//preload_SchoolUser();

