<!--
// Javascript controlling the rollovers, changing corners, and Menubar
//
// Browser Detection:
var isNS4 = (document.layers) ? true : false;
var isIE4 = (document.all && !document.getElementById) ? true : false;
var isIE5 = (document.all && document.getElementById) ? true : false;
var isNS6 = (!document.all && document.getElementById) ? true : false;



/// **************ROLLOVER CODE / CORNER CODE**************** ///
//
// Test if browser supports javascript rollovers
if (document.images)
{
//
// Preload and define the lower navbar elements.
//
exploreDef = new Image(123, 22);
exploreDef.src="http://www.ucds.org/MastGraphics/mainexplore.gif";
exploreRoll = new Image(123, 22);
exploreRoll.src="http://www.ucds.org/MastGraphics/mainexplore2.gif";

admissionsDef = new Image(108, 22);
admissionsDef.src="http://www.ucds.org/MastGraphics/mainapply.gif";
admissionsRoll = new Image(108, 22);
admissionsRoll.src="http://www.ucds.org/MastGraphics/mainapply2.gif";

involvedDef = new Image(118, 22);
involvedDef.src="http://www.ucds.org/MastGraphics/maininvolved.gif";
involvedRoll = new Image(118, 22);
involvedRoll.src="http://www.ucds.org/MastGraphics/maininvolved2.gif";

ucdsnetDef = new Image(113, 22);
ucdsnetDef.src="http://www.ucds.org/MastGraphics/mainnet.gif";
ucdsnetRoll = new Image(113, 22);
ucdsnetRoll.src="http://www.ucds.org/MastGraphics/mainnet2.gif";

alumniDef = new Image(87, 22);
alumniDef.src="http://www.ucds.org/MastGraphics/mainalumni.gif";
alumniRoll = new Image(87, 22);
alumniRoll.src="http://www.ucds.org/MastGraphics/mainalumni2.gif";

//
// Now preload and define the upper navigation elements
//
homeDef = new Image(55, 18);
homeDef.src="http://www.ucds.org/MastGraphics/tophome.gif";
homeRoll = new Image(55, 18);
homeRoll.src="http://www.ucds.org/MastGraphics/tophome2.gif";

contactDef = new Image(57, 18);
contactDef.src="http://www.ucds.org/MastGraphics/topcontact.gif";
contactRoll = new Image(57, 18);
contactRoll.src="http://www.ucds.org/MastGraphics/topcontact2.gif";

searchDef = new Image(73, 18);
searchDef.src="http://www.ucds.org/MastGraphics/topsearch.gif";
searchRoll = new Image(73, 18);
searchRoll.src="http://www.ucds.org/MastGraphics/topsearch2.gif";

newDef = new Image(85, 18);
newDef.src="http://www.ucds.org/MastGraphics/topnew.gif";
newRoll = new Image(85, 18);
newRoll.src="http://www.ucds.org/MastGraphics/topnew2.gif";




// Preloading Sub-Menu Graphics
exploreBarAboutDef = new Image(87, 22);
exploreBarAboutDef.src="http://www.ucds.org/MastGraphics/explore/exploreBarAboutDef.gif";
exploreBarAboutRoll = new Image(87, 22);
exploreBarAboutRoll.src="http://www.ucds.org/MastGraphics/explore/exploreBarAbout.gif";

exploreBarEmployDef = new Image(87, 22);
exploreBarEmployDef.src="http://www.ucds.org/MastGraphics/explore/exploreBarEmployDef.gif";
exploreBarEmployRoll = new Image(87, 22);
exploreBarEmployRoll.src="http://www.ucds.org/MastGraphics/explore/exploreBarEmploy.gif";

exploreBarPhilDef = new Image(133, 22);
exploreBarPhilDef.src="http://www.ucds.org/MastGraphics/explore/exploreBarPhilDef.gif";
exploreBarPhilRoll = new Image(133, 22);
exploreBarPhilRoll.src="http://www.ucds.org/MastGraphics/explore/exploreBarPhil.gif";


involvedBarAuctionDef = new Image(64, 22);
involvedBarAuctionDef.src="http://www.ucds.org/MastGraphics/involved/involvedBarAuctionDef.gif";
involvedBarAuctionRoll = new Image(64, 22);
involvedBarAuctionRoll.src="http://www.ucds.org/MastGraphics/involved/involvedBarAuctionRoll.gif";

involvedBarComDef = new Image(149, 22);
involvedBarComDef.src="http://www.ucds.org/MastGraphics/involved/involvedBarComDef.gif";
involvedBarComRoll = new Image(149, 22);
involvedBarComRoll.src="http://www.ucds.org/MastGraphics/involved/involvedBarComRoll.gif";

involvedBarGiveDef = new Image(54, 22);
involvedBarGiveDef.src="http://www.ucds.org/MastGraphics/involved/involvedBarGiveDef.gif";
involvedBarGiveRoll = new Image(54, 22);
involvedBarGiveRoll.src="http://www.ucds.org/MastGraphics/involved/involvedBarGiveRoll.gif";

involvedBarPADef = new Image(127, 22);
involvedBarPADef.src="http://www.ucds.org/MastGraphics/involved/involvedBarPADef.gif";
involvedBarPARoll = new Image(127, 22);
involvedBarPARoll.src="http://www.ucds.org/MastGraphics/involved/involvedBarPARoll.gif";

involvedBarWorkDef = new Image(83, 22);
involvedBarWorkDef.src="http://www.ucds.org/MastGraphics/involved/involvedBarWorkDef.gif";
involvedBarWorkRoll = new Image(83, 22);
involvedBarWorkRoll.src="http://www.ucds.org/MastGraphics/involved/involvedBarWorkRoll.gif";


admissionsBarAidDef = new Image(95, 22);
admissionsBarAidDef.src="http://www.ucds.org/MastGraphics/admissions/admissionsBarAidDef.gif";
admissionsBarAidRoll = new Image(95, 22);
admissionsBarAidRoll.src="http://www.ucds.org/MastGraphics/admissions/admissionsBarAidRoll.gif";

admissionsBarCalendarDef = new Image(71, 22);
admissionsBarCalendarDef.src="http://www.ucds.org/MastGraphics/admissions/admissionsBarCalendarDef.gif";
admissionsBarCalendarRoll = new Image(71, 22);
admissionsBarCalendarRoll.src="http://www.ucds.org/MastGraphics/admissions/admissionsBarCalendarRoll.gif";

admissionsBarFAQDef = new Image(52, 22);
admissionsBarFAQDef.src="http://www.ucds.org/MastGraphics/admissions/admissionsBarFAQDef.gif";
admissionsBarFAQRoll = new Image(52, 22);
admissionsBarFAQRoll.src="http://www.ucds.org/MastGraphics/admissions/admissionsBarFAQRoll.gif";

admissionsBarInfoDef = new Image(108, 22);
admissionsBarInfoDef.src="http://www.ucds.org/MastGraphics/admissions/admissionsBarInfoDef.gif";
admissionsBarInfoRoll = new Image(108, 22);
admissionsBarInfoRoll.src="http://www.ucds.org/MastGraphics/admissions/admissionsBarInfoRoll.gif";

admissionsBarReqDef = new Image(92, 22);
admissionsBarReqDef.src="http://www.ucds.org/MastGraphics/admissions/admissionsBarReqDef.gif";
admissionsBarReqRoll = new Image(92, 22);
admissionsBarReqRoll.src="http://www.ucds.org/MastGraphics/admissions/admissionsBarReqRoll.gif";


alumniBarDef = new Image(92, 22);
alumniBarDef.src="http://www.ucds.org/MastGraphics/alumni/alumniBar.gif";
alumniBarRoll = new Image(92, 22);
alumniBarRoll.src="http://www.ucds.org/MastGraphics/alumni/alumniBarRoll.gif";


ucdsnetBarCalendarDef = new Image(70, 22);
ucdsnetBarCalendarDef.src="http://www.ucds.org/MastGraphics/ucdsnet/ucdsnetBarCalendarDef.gif";
ucdsnetBarCalendarRoll = new Image(70, 22);
ucdsnetBarCalendarRoll.src="http://www.ucds.org/MastGraphics/ucdsnet/ucdsnetBarCalendarRoll.gif";

ucdsnetBarClassDef = new Image(115, 22);
ucdsnetBarClassDef.src="http://www.ucds.org/MastGraphics/ucdsnet/ucdsnetBarClassDef.gif";
ucdsnetBarClassRoll = new Image(115, 22);
ucdsnetBarClassRoll.src="http://www.ucds.org/MastGraphics/ucdsnet/ucdsnetBarClassRoll.gif";

ucdsnetBarWeekDef = new Image(63, 22);
ucdsnetBarWeekDef.src="http://www.ucds.org/MastGraphics/ucdsnet/ucdsnetBarWeekDef.gif";
ucdsnetBarWeekRoll = new Image(63, 22);
ucdsnetBarWeekRoll.src="http://www.ucds.org/MastGraphics/ucdsnet/ucdsnetBarWeekRoll.gif";

ucdsnetBarStudDef = new Image(98, 22);
ucdsnetBarStudDef.src="http://www.ucds.org/MastGraphics/ucdsnet/ucdsnetBarStudDef.gif";
ucdsnetBarStudRoll = new Image(98, 22);
ucdsnetBarStudRoll.src="http://www.ucds.org/MastGraphics/ucdsnet/ucdsnetBarStudRoll.gif";

//
// Now preload and define the side navigation elements
//
sclasspghomeDef = new Image(92, 30);
sclasspghomeDef.src="http://www.ucds.org/MastGraphics/side/s_classroompageshome_w.gif";
sclasspghomeRoll = new Image(92, 30);
sclasspghomeRoll.src="http://www.ucds.org/MastGraphics/side/s_classroompageshome_y.gif";

searlyDef = new Image(92, 19);
searlyDef.src="http://www.ucds.org/MastGraphics/side/s_earlyelementary_w.gif";
searlyRoll = new Image(92, 19);
searlyRoll.src="http://www.ucds.org/MastGraphics/side/s_earlyelementary_y.gif";

s12sDef = new Image(92, 19);
s12sDef.src="http://www.ucds.org/MastGraphics/side/s_12s_w.gif";
s12sRoll = new Image(92, 19);
s12sRoll.src="http://www.ucds.org/MastGraphics/side/s_12s_y.gif";

s23sDef = new Image(92, 19);
s23sDef.src="http://www.ucds.org/MastGraphics/side/s_23s_w.gif";
s23sRoll = new Image(92, 19);
s23sRoll.src="http://www.ucds.org/MastGraphics/side/s_23s_y.gif";

s34sDef = new Image(92, 19);
s34sDef.src="http://www.ucds.org/MastGraphics/side/s_34s_w.gif";
s34sRoll = new Image(92, 19);
s34sRoll.src="http://www.ucds.org/MastGraphics/side/s_34s_y.gif";

s45sDef = new Image(92, 19);
s45sDef.src="http://www.ucds.org/MastGraphics/side/s_45s_w.gif";
s45sRoll = new Image(92, 19);
s45sRoll.src="http://www.ucds.org/MastGraphics/side/s_45s_y.gif";

sartDef = new Image(92, 19);
sartDef.src="http://www.ucds.org/MastGraphics/side/s_art_w.gif";
sartRoll = new Image(92, 19);
sartRoll.src="http://www.ucds.org/MastGraphics/side/s_art_y.gif";

slibraryDef = new Image(92, 19);
slibraryDef.src="http://www.ucds.org/MastGraphics/side/s_library_w.gif";
slibraryRoll = new Image(92, 19);
slibraryRoll.src="http://www.ucds.org/MastGraphics/side/s_library_y.gif";

smusicDef = new Image(92, 19);
smusicDef.src="http://www.ucds.org/MastGraphics/side/s_music_w.gif";
smusicRoll = new Image(92, 19);
smusicRoll.src="http://www.ucds.org/MastGraphics/side/s_music_y.gif";

speDef = new Image(92, 19);
speDef.src="http://www.ucds.org/MastGraphics/side/s_pe_w.gif";
speRoll = new Image(92, 19);
speRoll.src="http://www.ucds.org/MastGraphics/side/s_pe_y.gif";

sscienceDef = new Image(92, 19);
sscienceDef.src="http://www.ucds.org/MastGraphics/side/s_science_w.gif";
sscienceRoll = new Image(92, 19);
sscienceRoll.src="http://www.ucds.org/MastGraphics/side/s_science_y.gif";

sspanishDef = new Image(92, 19);
sspanishDef.src="http://www.ucds.org/MastGraphics/side/s_spanish_w.gif";
sspanishRoll = new Image(92, 19);
sspanishRoll.src="http://www.ucds.org/MastGraphics/side/s_spanish_y.gif";

stechnologyDef = new Image(92, 19);
stechnologyDef.src="http://www.ucds.org/MastGraphics/side/s_technology_w.gif";
stechnologyRoll = new Image(92, 19);
stechnologyRoll.src="http://www.ucds.org/MastGraphics/side/s_technology_y.gif";

sedpDef = new Image(92, 19);
sedpDef.src="http://www.ucds.org/MastGraphics/side/s_edp_w.gif";
sedpRoll = new Image(92, 19);
sedpRoll.src="http://www.ucds.org/MastGraphics/side/s_edp_y.gif";

sclubsDef = new Image(92, 19);
sclubsDef.src="http://www.ucds.org/MastGraphics/side/s_clubs_w.gif";
sclubsRoll = new Image(92, 19);
sclubsRoll.src="http://www.ucds.org/MastGraphics/side/s_clubs_y.gif";


//Preloading corner graphics
admissionscorner = new Image(25, 34);
admissionscorner.src = "http://www.ucds.org/MastGraphics/admissions/newadmissionscorner.gif";

explorecorner = new Image(25, 34);
explorecorner.src = "http://www.ucds.org/MastGraphics/explore/newexplorecorner.gif";

alumnicorner = new Image(25, 34);
alumnicorner.src = "http://www.ucds.org/MastGraphics/alumni/newalumnicorner.gif";

ucdsnetcorner = new Image(25, 34);
ucdsnetcorner.src = "http://www.ucds.org/MastGraphics/ucdsnet/newucdsnetcorner.gif";

involvedcorner = new Image(25, 34);
involvedcorner.src = "http://www.ucds.org/MastGraphics/involved/newinvolvedcorner.gif";
// DONE PRELOADING/DEFINING GRAPHICS
}



// ROLLOVER FUNCTIONS
//
// Function to roll over image. Image variable used for rollover must be named 
// [imagename]Roll.src
function imgRoll(objName)  {
   if (document.images)
    {
      rollImg=eval(objName + "Roll.src");
      document[objName].src= rollImg; 
    }
}

// Function to roll off image. Image variable used for rollover must be named
// [imagename]Def.src
function imgDef(objName)  {
   if (document.images)
    {
      defImg=eval(objName + "Def.src");
      document[objName].src= defImg;
    }
}

// Netscape 4 has a problem with accessing images within layers, so we need
// seperate code for rolling over the sub bars.
//
// Function to roll over subbar image. Image variable used for rollover must be named 
// [imagename]Roll.src
function imgRollsub(objName, sectionNum)  {
   rollImg=eval(objName + "Roll.src");
   if (!isNS4) {
      document[objName].src= rollImg; 
    }
	else {
	  var barString = section2bar(sectionNum+1);
	  document.layers[barString].document.images[objName].src = rollImg;
	}
}


function imgDefsub(objName, sectionNum)  {
   defImg=eval(objName + "Def.src");
   if (!isNS4) {
      document[objName].src= defImg; 
    }
	else {
	  var barString = section2bar(sectionNum+1);
	  document.layers[barString].document.images[objName].src = defImg;
	}
}
/// ******************** END OF ROLLOVER CODE ********************* ///






/// ******************** MENU CONTROLLING CODE ********************** ///
//
// Defining the possible sections as elements in arrays.
//
// Sections will be referenced as explore = sectionArray[0], 
// admissions = sectionArray[1], etc.  up to alumni = sectionArray[4].
// Subsections will be refrenced in a two dimensional array, where the 
// first subsection under the explore section will be subbarArray[0][0],
// and the (for example), third subsection under admissions will be
// subbarArray[1][2]
//
// Code for keeping track of subsection
var subbarArray = new Array(5);

// Defining explore, admissions, involved, ucdsnet, alumni in that order
subbarArray[0] = new Array(3);
subbarArray[1] = new Array(5);
subbarArray[2] = new Array(5);
subbarArray[3] = new Array(3);
subbarArray[4] = new Array(1);

subbarArray[0][0] = 'exploreBarAbout';
subbarArray[0][1] = 'exploreBarPhil';
subbarArray[0][2] = 'exploreBarEmploy';

subbarArray[1][0] = 'admissionsBarInfo';
subbarArray[1][1] = 'admissionsBarCalendar';
subbarArray[1][2] = 'admissionsBarAid';
subbarArray[1][3] = 'admissionsBarReq';
subbarArray[1][4] = 'admissionsBarFAQ';

subbarArray[2][0] = 'involvedBarGive';
subbarArray[2][1] = 'involvedBarCom';
subbarArray[2][2] = 'involvedBarAuction';
subbarArray[2][3] = 'involvedBarPA';
subbarArray[2][4] = 'involvedBarWork';

subbarArray[3][0] = 'ucdsnetBarCalendar';
subbarArray[3][1] = 'ucdsnetBarStud';
subbarArray[3][2] = 'ucdsnetBarWeek';
subbarArray[3][3] = 'ucdsnetBarClass';

subbarArray[4][0] = 'alumniBar';

var sectionArray = new Array(5);

sectionArray[0] = 'explore';
sectionArray[1] = 'admissions';
sectionArray[2] = 'involved';
sectionArray[3] = 'ucdsnet';
sectionArray[4] = 'alumni';
// End of array Definitions





// Browser Specific Code to Reveal Sub-Menus:
//
// This Function will reveal a submenu given the function,
// and hide the last submenu.
function reveal(menu) {
   if (isNS4){
     theMenu = document.layers[menu];
     theLastMenu = document.layers[lastMenu];
	 theLastMenu.visibility = 'hide';
	 theMenu.visibility = 'show';
     }
   else if (isIE4) {
     theMenu = document.all[menu];
	 theLastMenu = document.all[lastMenu];
	 theLastMenu.style.visibility = 'hidden';
	 theMenu.style.visibility = 'visible';
     }
   else if (isIE5 || isNS6) {
     theMenu = document.getElementById(menu);
	 theLastMenu = document.getElementById(lastMenu);
	 theLastMenu.style.visibility = 'hidden';
	 theMenu.style.visibility = 'visible';
     }
	 
  lastMenu = menu;
}
// End actual browser specific menubar code




// Misc Menubar Helper Functions:
//
// These Functions all work to allow the menubars to work properly.
//
//
// Brings back proper menu dependent on which section we are currently on.
function defreveal() {
  reveal(whichBarString);
}



//Function to show corner.
function showCorner() {
  var theCorner;
  var dummyCorner = 'corner';
  if (whichbar == 1) {
    theCorner=eval("explorecorner.src");
  }
  else if (whichbar == 2) {
    theCorner=eval("admissionscorner.src");
  }
  else if (whichbar == 3) {
    theCorner=eval("involvedcorner.src");
  }
  else if (whichbar == 4) {
    theCorner=eval("ucdsnetcorner.src");
  }
  else if (whichbar == 5) {
    theCorner=eval("alumnicorner.src");
  }

  document[dummyCorner].src= theCorner;
}



// Called when the mouse is moved off a menu. If the mouse has not been moved back on a menu, the sub-menu
// returns to default
function closeTest() {
  if (menuopen == 0) 
    {
	defreveal();
    }
}


// Here are the actual functions that are called when the popup menu is activated.

// To be called when we mouseover a menu item
function menuOn(menu) {
  reveal(menu);
  menuopen = 1;
 }
 
// To be called when we mouseoff a menu item
function menuOff() {
  menuopen = 0;
  setTimeout("closeTest()", 300);
 }
    
// To be called when we mouseover a sub-menu
function subOn() {
  menuopen = 1;
 }
  
  
function section2bar (sectionNum) {
  if (sectionNum == 1) {
  return('exploreMenu');
  }
  else if (sectionNum == 2) {
  return('admisMenu');
  }
  else if (sectionNum == 3) {
  return('involvedMenu');
  }
  else if (sectionNum == 4) {
  return('ucdsnetMenu');
  }
  else if (sectionNum == 5) {
  return('alumniMenu');
  }
 }
  
// Initialize function when the page is first loaded
function initImg(section, subsection) {
  // Roll over images for current section and subsection
  var rollIDsec = sectionArray[section];
  imgRoll(rollIDsec);
  
  if (subsection > -1 && subsection < 5) {
    var rollIDsub = subbarArray[section][subsection];
    imgRollsub(rollIDsub, section);
  }
  
  whichBarString = section2bar(whichbar);
}



// Wrapper functions to use both the rollovers and popup menus
function menubarOver(menu, rollID) {
  menuOn(menu);
  imgRoll(rollID);
  }
  
function menubarOut(rollID) {
  menuOff();
  if (!(sectionArray[whichbar-1] == rollID)) {
  imgDef(rollID);
  }
}
  
function subbarOver(section, subsection) {
  var rollID = subbarArray[section][subsection];
  subOn();
  imgRollsub(rollID, section);
  }
  
function subbarOut(section, subsection) {
  var rollID = subbarArray[section][subsection];
  menuOff();
  if (!(section == (whichbar-1) && subsection == whichsub)) {
  imgDefsub(rollID, section);
  }
}
  
//-->