var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
function getRef(id) {
if (isDOM) return document.getElementById(id);
if (isIE4) return document.all[id];
if (isNS4) return document.layers[id];
}
function getSty(id) {
return (isNS4 ? getRef(id) : getRef(id).style);
} 
// Hide timeout.
var popTimer = 0;
// Array showing highlighted menu items.
var litNow = new Array();
function popOver(menuNum, itemNum) {
clearTimeout(popTimer);
hideAllBut(menuNum);
litNow = getTree(menuNum, itemNum);
changeCol(litNow, true);
targetNum = menu[menuNum][itemNum].target;
if (targetNum > 0) {
thisX = parseInt(menu[menuNum][0].ref.left) + parseInt(menu[menuNum][itemNum].ref.left);
thisY = parseInt(menu[menuNum][0].ref.top) + parseInt(menu[menuNum][itemNum].ref.top);
with (menu[targetNum][0].ref) {
left = parseInt(thisX + menu[targetNum][0].x);
top = parseInt(thisY + menu[targetNum][0].y);
visibility = 'visible';
      }
   }
}
function popOut(menuNum, itemNum) {
if ((menuNum == 0) && !menu[menuNum][itemNum].target)
hideAllBut(0)
else
popTimer = setTimeout('hideAllBut(0)', 500);
}
function getTree(menuNum, itemNum) {

// Array index is the menu number. The contents are null (if that menu is not a parent)
// or the item number in that menu that is an ancestor (to light it up).
itemArray = new Array(menu.length);

while(1) {
itemArray[menuNum] = itemNum;
// If we've reached the top of the hierarchy, return.
if (menuNum == 0) return itemArray;
itemNum = menu[menuNum][0].parentItem;
menuNum = menu[menuNum][0].parentMenu;
   }
}

// Pass an array and a boolean to specify colour change, true = over colour.
function changeCol(changeArray, isOver) {
for (menuCount = 0; menuCount < changeArray.length; menuCount++) {
if (changeArray[menuCount]) {
newCol = isOver ? menu[menuCount][0].overCol : menu[menuCount][0].backCol;
// Change the colours of the div/layer background.
with (menu[menuCount][changeArray[menuCount]].ref) {
if (isNS4) bgColor = newCol;
else backgroundColor = newCol;
         }
      }
   }
}
function hideAllBut(menuNum) {
var keepMenus = getTree(menuNum, 1);
for (count = 0; count < menu.length; count++)
if (!keepMenus[count])
menu[count][0].ref.visibility = 'hidden';
changeCol(litNow, false);
}

// *** MENU CONSTRUCTION FUNCTIONS ***

function Menu(isVert, popInd, x, y, width, overCol, backCol, borderClass, textClass) {
// True or false - a vertical menu?
this.isVert = isVert;
// The popout indicator used (if any) for this menu.
this.popInd = popInd
// Position and size settings.
this.x = x;
this.y = y;
this.width = width;
// Colours of menu and items.
this.overCol = overCol;
this.backCol = backCol;
// The stylesheet class used for item borders and the text within items.
this.borderClass = borderClass;
this.textClass = textClass;
// Parent menu and item numbers, indexed later.
this.parentMenu = null;
this.parentItem = null;
// Reference to the object's style properties (set later).
this.ref = null;
}

function Item(text, href, frame, length, spacing, target) {
this.text = text;
this.href = href;
this.frame = frame;
this.length = length;
this.spacing = spacing;
this.target = target;
// Reference to the object's style properties (set later).
this.ref = null;
}

function writeMenus() {
if (!isDOM && !isIE4 && !isNS4) return;

for (currMenu = 0; currMenu < menu.length; currMenu++) with (menu[currMenu][0]) {
// Variable for holding HTML for items and positions of next item.
var str = '', itemX = 0, itemY = 0;


for (currItem = 1; currItem < menu[currMenu].length; currItem++) with (menu[currMenu][currItem]) {
var itemID = 'menu' + currMenu + 'item' + currItem;

// The width and height of the menu item - dependent on orientation!
var w = (isVert ? width : length);
var h = (isVert ? length : width);

if (isDOM || isIE4) {
str += '<div id="' + itemID + '" style="position: absolute; left: ' + itemX + '; top: ' + itemY + '; width: ' + w + '; height: ' + h + '; visibility: inherit; ';
if (backCol) str += 'background: ' + backCol + '; ';
str += '" ';
}
if (isNS4) {
str += '<layer id="' + itemID + '" left="' + itemX + '" top="' + itemY + '" width="' +  w + '" height="' + h + '" visibility="inherit" ';
if (backCol) str += 'bgcolor="' + backCol + '" ';
}
if (borderClass) str += 'class="' + borderClass + '" ';

// Add mouseover handlers and finish div/layer.
str += 'onMouseOver="popOver(' + currMenu + ',' + currItem + ')" onMouseOut="popOut(' + currMenu + ',' + currItem + ')">';

// Add contents of item (default: table with link inside).
// In IE/NS6+, add padding if there's a border to emulate NS4's layer padding.
// If a target frame is specified, also add that to the <a> tag.

str += '<table width="' + (w - 8) + '" border="0" cellspacing="0" cellpadding="' + (!isNS4 && borderClass ? 3 : 0) + '"><tr><td align="left" height="' + (h - 7) + '">' + '<a class="' + textClass + '" href="' + href + '"' + (frame ? ' target="' + frame + '">' : '>') + text + '</a></td>';
if (target > 0) {

// Set target's parents to this menu item.
menu[target][0].parentMenu = currMenu;
menu[target][0].parentItem = currItem;

// Add a popout indicator.
if (popInd) str += '<td class="' + textClass + '" align="right">' + popInd + '</td>';
}
str += '</tr></table>' + (isNS4 ? '</layer>' : '</div>');
if (isVert) itemY += length + spacing;
else itemX += length + spacing;
}
if (isDOM) {
var newDiv = document.createElement('div');
document.getElementsByTagName('body').item(0).appendChild(newDiv);
newDiv.innerHTML = str;
ref = newDiv.style;
ref.position = 'absolute';
ref.visibility = 'hidden';
}

// Insert a div tag to the end of the BODY with menu HTML in place for IE4.
if (isIE4) {
document.body.insertAdjacentHTML('beforeEnd', '<div id="menu' + currMenu + 'div" ' + 'style="position: absolute; visibility: hidden">' + str + '</div>');
ref = getSty('menu' + currMenu + 'div');
}

// In NS4, create a reference to a new layer and write the items to it.
if (isNS4) {
ref = new Layer(0);
ref.document.write(str);
ref.document.close();
}

for (currItem = 1; currItem < menu[currMenu].length; currItem++) {
itemName = 'menu' + currMenu + 'item' + currItem;
if (isDOM || isIE4) menu[currMenu][currItem].ref = getSty(itemName);
if (isNS4) menu[currMenu][currItem].ref = ref.document[itemName];
   }
}
with(menu[0][0]) {
ref.left = x;
ref.top = y;
ref.visibility = 'visible';
   }
}

// Syntaxes:
//
// menu[menuNumber][0] = new Menu(Vertical menu? (true/false), 'popout indicator', left, top,
// width, 'mouseover colour', 'background colour', 'border stylesheet', 'text stylesheet');
//
// Left and Top are measured on-the-fly relative to the top-left corner of its trigger, or
// for the root menu, the top-left corner of the page.
//
// menu[menuNumber][itemNumber] = new Item('Text', 'URL', 'target frame', length of menu item,
//  additional spacing to next menu item, number of target menu to popout);
//
// If no target menu (popout) is desired, set it to 0. Likewise, if your site does not use
// frames, pass an empty string as a frame target.
//
// Something that needs explaining - the Vertical Menu setup. You can see most menus below
// are 'true', that is they are vertical, except for the first root menu. The 'length' and
// 'width' of an item depends on its orientation -- length is how long the item runs for in
// the direction of the menu, and width is the lateral dimension of the menu. Just look at
// the examples and tweak the numbers, they'll make sense eventually :).

var menu = new Array();

// Default colours passed to most menu constructors (just passed to functions, not
// a global variable - makes things easier to change later in bulk).
var defOver = '#FF3300', defBack = '#000000';

// Default 'length' of menu items - item height if menu is vertical, width if horizontal.
var defLength = 22;

// Menu 0 is the special, 'root' menu from which everything else arises.
menu[0] = new Array();

// *** MOVE ROOT MENU AROUND HERE ***  it's positioned at (85, 68) and is 15px high now.
menu[0][0] = new Menu(false, '', 85, 68, 15, '#FF3300', '#000000', '', 'itemText');
// Notice how the targets are all set to nonzero values...
// The 'length' of each of these items is 40, and there is spacing of 5 to the next item.
// Most of the links are set to '#' hashes, make sure you change them to actual files.
menu[0][1] = new Item('  Home', 'index.asp', '', 35, 60, 0);
menu[0][2] = new Item('  Strategic Plans & Assessment Reports', '', '', 230, 60, 1);
//menu[0][2] = new Item('  Assessment Reports', 'SPAR.asp', '', 128, 60, 2);
menu[0][3] = new Item('  Related Links', '' , '', 85, 60, 2);
menu[0][4] = new Item('  Stratplan Help', 'instructions.asp', '', 94, 60, 3);


// Strategic Plans menu.
menu[1] = new Array();
// The File menu is positioned 0px across and 20 down from its trigger, and is 80 to 100 px wide.

menu[1][0] = new Menu(true, '>', 0, 20, 230, defOver, defBack, 'itemBorder', 'itemText');
menu[1][1] = new Item('Strategic Plans & <br>Current Assessment Reports (All)', 'SPAR.asp', '', defLength, 16, 0);
//menu[1][2] = new Item('Current Assessment Reports (All)', 'SPAR.asp', '', defLength, 0, 0);
menu[1][2] = new Item('Archived Assessment Reports', 'getAnnualReportFrame.asp?theLink=0', '', defLength, 0, 11);

//menu[1][1] = new Item('Texas Tech University Strategic Plan', 'getStratPlanFrame.asp?theLink=0', '', defLength, 0, 0);
//menu[1][2] = new Item('Academic Strategic Plans', 'getStratPlanFrame.asp?theLink=1', '', defLength, 0, 4);
//menu[1][3] = new Item('Support Strategic Plans', 'getStratPlanFrame.asp?theLink=2', '', defLength, 0, 5);

// Assessment Reports menu.
menu[11] = new Array();
menu[11][0] = new Menu(true, '>', 230, 0, 170, defOver, defBack, 'itemBorder', 'itemText');

//remove after 2003
menu[11][1] = new Item('Texas Tech University', 'getAnnualReportFrame.asp?theLink=1',  '', defLength, 0, 0);
menu[11][2] = new Item('Academic Areas/Units', 'getAnnualReportFrame.asp?theLink=2', '', defLength, 0, 12);
menu[11][3] = new Item('Support', 'getAnnualReportFrame.asp?theLink=3', '', defLength, 0, 13);


//Academic Areas sub-menu
menu[12] = new Array();
menu[12][0] = new Menu(true, '>', 170, 0, 150, defOver, defBack, 'itemBorder', 'itemText');
menu[12][1] = new Item('Colleges', 'getAnnualReportFrame.asp?theLink=11', '', defLength, 0, 0);
menu[12][2] = new Item('Academic Departments', 'getAnnualReportFrame.asp?theLink=12', '', defLength, 0, 0);
menu[12][3] = new Item('Other Academic Areas', 'getAnnualReportFrame.asp?theLink=13', '', defLength, 0, 0);
menu[12][4] = new Item('Other Academic Units', 'getAnnualReportFrame.asp?theLink=14', '', defLength, 0, 0);

// Related Links menu
menu[2] = new Array();
menu[2][0] = new Menu(true, '>', 0, 20, 240, defOver, defBack, 'itemBorder', 'itemText');
menu[2][1] = new Item('Office of Strategic Planning', 'http://www.depts.ttu.edu/opa/', '1', defLength, 0, 0);
menu[2][2] = new Item('Strategic Planning Information', 'SPinfo.asp', '', defLength, 0, 7);
menu[2][3] = new Item('TTU System Strategic Plan: TechSTAR', 'http://www.texastech.edu/TechStar03/index.html', '1', defLength, 0, 0);
menu[2][4] = new Item('Planning and assessment at other universities', '', '', defLength, 16, 6);
menu[2][5] = new Item('Summary of Strategic Planning', 'docs/Summary_of_Strategic_Planning-Revised_July_2003.doc', '0', defLength, 0, 0);
menu[2][6] = new Item('Outcomes Assessment Resources', 'OAResources.asp', '', defLength, 0, 8);
menu[2][7] = new Item('Presentations', 'Presentations.asp', '', defLength, 0, 9);
menu[2][8] = new Item('Strategic Planning Newsletter', 'Newsletter.asp', '', defLength, 0, 10);
menu[2][9] = new Item('Updating Strategic Plans', 'docs/Strategic_Planning_Update_Guidelines.doc', '', defLength, 0, 0);


//Support sub-menu
menu[13] = new Array();
menu[13][0] = new Menu(true, '>', 170, 0, 100, defOver, defBack, 'itemBorder', 'itemText');
menu[13][1] = new Item('Support Areas', 'getAnnualReportFrame.asp?theLink=21', '', defLength, 0, 0);
menu[13][2] = new Item('Support Units', 'getAnnualReportFrame.asp?theLink=22', '', defLength, 0, 0);

// Using TTU-SPAR menu
menu[3] = new Array();
menu[3][0] = new Menu(true, '>', 0, 20, 200, defOver, defBack, 'itemBorder', 'itemText');
menu[3][1] = new Item('Using Stratplan Website', 'Message.asp?Using-TTUSPAR', '1', defLength, 0, 0);
menu[3][2] = new Item('Assessment Report Instructions', 'docs/Assessment_Report_General_Instructions.pdf', '1', defLength, 0, 0);
menu[3][3] = new Item('Guidelines', 'docs/Guidelines_2008_SPAR.pdf', '', defLength, 0, 0);
menu[3][4] = new Item('Changing IE browser settings', 'ie_browsersettings.asp', '', defLength, 0, 0);
menu[3][5] = new Item('Allow pop-up on this site', 'AllowPop-up.asp', '', defLength, 0, 0);

// Academic Strategic Plans sub-menu
menu[4] = new Array();
menu[4][0] = new Menu(true, '>', 230, 0, 180, defOver, defBack, 'itemBorder', 'itemText');
menu[4][1] = new Item('Colleges', 'getStratPlanFrame.asp?theLink=11', '', defLength, 0, 0);
menu[4][2] = new Item('Academic Departments', 'getStratPlanFrame.asp?theLink=12', '', defLength, 0, 0);
menu[4][3] = new Item('Other Academic Areas', 'getStratPlanFrame.asp?theLink=13', '', defLength, 0, 0);

// Support Strategic Plans sub-menu
menu[5] = new Array();
menu[5][0] = new Menu(true, '>', 230, 0, 110, defOver, defBack, 'itemBorder', 'itemText');
menu[5][1] = new Item('Support Areas', 'getStratPlanFrame.asp?theLink=21', '', defLength, 0, 0);
menu[5][2] = new Item('Support Units', 'getStratPlanFrame.asp?theLink=22', '', defLength, 0, 0);

//Planning and assessment at other universities sub-menu
menu[6] = new Array();
menu[6][0] = new Menu(true, '>', 240, 0, 200, defOver, defBack, 'itemBorder', 'itemText');
menu[6][1] = new Item('Penn State University', 'http://www.psu.edu/president/pia', '1', defLength, 0, 0);
menu[6][2] = new Item('University of Florida', 'http://thecenter.ufl.edu', '1', defLength, 0, 0);
menu[6][3] = new Item('University of Colorado at Boulder', 'http://www.colorado.edu/pba/perfmeas/index.htm', '1', defLength, 0, 0);
menu[6][4] = new Item('The University of Kansas', 'http://www.ku.edu/~oirp/Assess/index_home%20page.shtml', '1', defLength, 0, 0);
menu[6][5] = new Item('Oregon State University', 'http://oregonstate.edu/leadership/strategicplan', '1', defLength, 0, 0);

//Strategic Planning Information sub-menu
menu[7] = new Array();
menu[7][0] = new Menu(true, '>', 240, 	0, 120, defOver, defBack, 'itemBorder', 'itemText');
menu[7][1] = new Item('Council Members', 'http://www.ttu.edu/stratplan/StrategicPlanningCouncil.php', '1', defLength, 0, 0);
menu[7][2] = new Item('Council By-Laws', 'docs/BYLAWS_Amended_11-6-03.pdf', '', defLength, 0, 0);

//Outcomes Assessment Resources sub-menu

menu[8] = new Array();
menu[8][0] = new Menu(true, '>', 240, 	0, 180, defOver, defBack, 'itemBorder', 'itemText');
menu[8][1] = new Item('Internet Resources for Outcomes Assessment', 'http://www2.acs.ncsu.edu/UPA/assmt/resource.htm', '0', defLength, 16, 0);
menu[8][2] = new Item('Summer 2003 Workshop', 'docs/Does_Your_Academic_Program_Make_a_Difference.ppt', '', defLength, 0, 0);
menu[8][3] = new Item('Summer 2004 Workshop', 'docs/2004_Outcomes_Assessment_Seminar.ppt', '', defLength, 0, 0);
menu[8][4] = new Item('Summer 2005 Workshop', 'docs/2005_Third_Annual_Assessment_Workshop.ppt', '', defLength, 0, 0);
menu[8][5] = new Item('Fall 2005 Workshop', 'docs/Assessment_Workshop_wrapup.ppt', '', defLength, 0, 0);
menu[8][6] = new Item('Spring 2006 Workshop', 'docs/2006-01-25_Preparing_the_Annual_Assessment_Reports.ppt', '', defLength, 0, 0);
menu[8][7] = new Item('Fall 2006 Workshop 1', 'docs/2006_Fall_Planning_and_Assessment_Workshop_Session_1.ppt', '', defLength, 0, 0);
menu[8][8] = new Item('Fall 2006 Workshop 2', 'docs/2006_Fall_Planning_and_Assessment_Workshop_Session_2.ppt', '', defLength, 0, 0);
menu[8][9] = new Item('Fall 2006 Workshop 3', 'docs/2006_Fall_Planning_and_Assessment_Workshop_Session_3.ppt', '', defLength, 0, 0);
menu[8][10] = new Item('Spring 2008 Workshop', 'docs/2008_Intro_to_Planning_and_Assessment_Workshop_January_2008_v1.ppt', '', defLength, 0, 0);
menu[8][11] = new Item('2005 Assessment Packet', 'docs/THIRD_ANNUAL_WORKSHOP_PACKET.doc', '', defLength, 0, 0);
menu[8][12] = new Item('Additional Resources', 'docs/Resources_on_SP_and_OA.doc', '', defLength, 0, 0);
menu[8][13] = new Item('Assessing Student Learning', 'docs/Assessing_Student_Learning_Final.ppt', '', defLength, 0, 0);
menu[8][14] = new Item('Other Assessment Links', 'OtherAssessmentLinks.ASP', '', defLength, 0, 0);


//Presentations sub-menu

menu[9] = new Array();
menu[9][0] = new Menu(true, '>', 240, 	0, 100, defOver, defBack, 'itemBorder', 'itemText');
menu[9][1] = new Item('TTUHSC 2004', 'docs/HSC_Strategic_Planning_and_Assessment_10-04.ppt', '0', defLength, 0, 0);
menu[9][2] = new Item('SACS 2004', 'docs/SACS_Presentation.ppt', '0', defLength, 0, 0);
menu[9][3] = new Item('TWU 2005', 'docs/Strategic_Planning_at_Texas_Tech_TWU_Presentation.ppt', '0', defLength, 0, 0);
menu[9][4] = new Item('SACS 2005', 'docs/Nguyen_et_al._SACS_presentation_Dec_2005_112905.ppt', '0', defLength, 0, 0);
menu[9][5] = new Item('ISU 2006', 'docs/Iowas_State_University_Strategic_Planning.ppt', '0', defLength, 0, 0);


//Strategic Planning Newsletter sub-menu

menu[10] = new Array();
menu[10][0] = new Menu(true, '>', 240, 	0, 120, defOver, defBack, 'itemBorder', 'itemText');
menu[10][1] = new Item('Nov 2004 V1-N1', 'docs/STRATEGIC_PLANNING_NEWSLETTER_V1-N1_2004.pdf', '0', defLength, 0, 0);
menu[10][2] = new Item('Jan 2005 V1-N2', 'docs/STRATEGIC_PLANNING_NEWSLETTER_V1-N2_2004-2005.pdf', '0', defLength, 0, 0);
menu[10][3] = new Item('Oct 2005 V2-N1', 'docs/STRATEGIC_PLANNING_NEWSLETTER_V2-N1_2005-2006.pdf', '0', defLength, 0, 0);
menu[10][4] = new Item('Feb 2006 V2-N2', 'docs/STRATEGIC_PLANNING_NEWSLETTER_V2-N2_2005-2006.pdf', '0', defLength, 0, 0);
menu[10][5] = new Item('Jun 2006 V2-N3', 'docs/STRATEGIC_PLANNING_NEWSLETTER_V2-N3_2005-2006.pdf', '0', defLength, 0, 0);
menu[10][6] = new Item('Oct 2006 V3-N1', 'docs/STRATEGIC_PLANNING_NEWSLETTER_V3-N1_2006-2007.pdf', '0', defLength, 0, 0);
menu[10][7] = new Item('Feb 2007 V3-N2', 'docs/STRATEGIC_PLANNING_NEWSLETTER_V3-N2_2006-2007.pdf', '0', defLength, 0, 0);
menu[10][8] = new Item('Apr 2007 V3-N3', 'docs/STRATEGIC_PLANNING_NEWSLETTER_V3-N3_2006-2007.pdf', '0', defLength, 0, 0);
menu[10][9] = new Item('Nov 2007 V4-N1', 'docs/STRATEGIC_PLANNING_NEWSLETTER_V4-N1_2007-2008.pdf', '0', defLength, 0, 0);
menu[10][10] = new Item('Mar 2008 V4-N2', 'docs/STRATEGIC_PLANNING_NEWSLETTER_V4-N2_2007-2008.pdf', '0', defLength, 0, 0);


//  End -->
