// provides the list of page names which the JS compares in order to decided which page the user is on
var url_A = new Array ("about");
var url_B = new Array ("core");
var url_C = new Array ("plan");
var url_D = new Array ("board");
var url_E = new Array ("history");
var url_F = new Array ("facilities");
var url_G = new Array ("life");
var url_H = new Array ("events");
var url_I = new Array ("faq");
var url_J = new Array ("contact");
var url_K = new Array ("http://www.smu.ca/academic/sobey/welcome");
var url_L = new Array ("http://www.smu.ca/academic/sobey/about/contact");
var url_M = new Array ("http://community.smu.ca/sobey/");



// determines the parent link names in the menu
var text_A = new Array ("Welcome");
var text_B = new Array ("Our Core Purpose and Values");
var text_C = new Array ("Our Strategic Plan");
var text_D = new Array ("Our Advisory Board");
var text_E = new Array ("A Proud History");
var text_F = new Array ("Superb Location & Facilities");
var text_G = new Array ("A Vibrant University Life");
var text_H = new Array ("Sobey News and Events");
var text_I = new Array ("Frequently Asked Questions");
var text_J = new Array ("Contact Sobey Dean");
var text_K = new Array ("<b>Return to Sobey Home</b>");
var text_L = new Array ("<b>Contact Sobey</b>");
var text_M = new Array ("<b>Sobey Photo Gallery</b>");





// determines the flyout status of the submenus
//var hideshow_B = new Array ("none","block");
//var hideshow_C = new Array ("none","block");
//var hideshow_E = new Array ("none","block");
//var hideshow_F = new Array ("none","block");


// gets the full path for use later 
var thisPage=String((document.location.href));

// takes the above variable and strips out the extraneous path components and 
// makes a name for the page, eg 'www.smu.ca/academic/welcome.html' becomes just 'welcome'
var loc= String((thisPage));
loc=loc.split("/");
loc=loc[loc.length-1].split(".");
loc=loc[loc.length-2];

// A URL not displaying an HTML file, eg 'www.smu.ca/academic/' returns a 'null' value to this script.
// This forces a 'null' value to assume the value of 'welcome' to display the root menu.
if (loc == null)   loc = "welcome.html";

if(typeof(loc)=="undefined"){ 

loc="welcome.html"; 

}


// (uncomment the line below for testing and troubleshooting)
// document.write (loc)



function ShowHideLayer(boxID) {
	/* Obtain reference for the selected boxID layer and its button */
	var box = document.getElementById("submenu"+boxID);

}

var menubegin = ('<ul class="menu"><li class="menu"><a class="menu')
var menumid1 = ('" href="')
var menumid2 = ('.html">')
var menuend = ('</a></li></ul>')

var menu2begin = ('<li class="menu2"><a href="')
var menu2mid = ('.html" class="menu2')
var menu2liend = ('</a> &#8226;</li>')

// this function takes the value of loc 
// and compares it to all the contents of the arrays until it finds a match.

function sectionDetect()
{
for(var i=0; i<20; i++)
{



// A
document.write( "<br><b>ABOUT US</b><br><br>" );
document.write( menubegin ); switch (loc) { case url_A[i]: document.write('thispage'); break } document.write( menumid1 + url_A[0] + menumid2 + text_A[0] + menuend );

// B
document.write( menubegin ); switch (loc) { case url_B[i]: document.write('thispage'); break } document.write( menumid1 + url_B[0] + menumid2 + text_B[0] + menuend );

// C
document.write( menubegin ); switch (loc) { case url_C[i]: document.write('thispage'); break } document.write( menumid1 + url_C[0] + menumid2 + text_C[0] + menuend );

// D
document.write( menubegin ); switch (loc) { case url_D[i]: document.write('thispage'); break } document.write( menumid1 + url_D[0] + menumid2 + text_D[0] + menuend );

// E
document.write( menubegin ); switch (loc) { case url_E[i]: document.write('thispage'); break } document.write( menumid1 + url_E[0] + menumid2 + text_E[0] + menuend );

// F
document.write( menubegin ); switch (loc) { case url_F[i]: document.write('thispage'); break } document.write( menumid1 + url_F[0] + menumid2 + text_F[0] + menuend );


// G
document.write( menubegin ); switch (loc) { case url_G[i]: document.write('thispage'); break } document.write( menumid1 + url_G[0] + menumid2 + text_G[0] + menuend );

// H
document.write( menubegin ); switch (loc) { case url_H[i]: document.write('thispage'); break } document.write( menumid1 + url_H[0] + menumid2 + text_H[0] + menuend );

// I
document.write( menubegin ); switch (loc) { case url_I[i]: document.write('thispage'); break } document.write( menumid1 + url_I[0] + menumid2 + text_I[0] + menuend );

// J
document.write( menubegin ); switch (loc) { case url_J[i]: document.write('thispage'); break } document.write( menumid1 + url_J[0] + menumid2 + text_J[0] + menuend );

// K
document.write( "<br><br>" );
document.write( menubegin ); switch (loc) { case url_K[i]: document.write('thispage'); break } document.write( menumid1 + url_K[0] + menumid2 + text_K[0] + menuend );

// L
document.write( menubegin ); switch (loc) { case url_L[i]: document.write('thispage'); break } document.write( menumid1 + url_L[0] + menumid2 + text_L[0] + menuend );

// M
document.write('<a href="http://community.smu.ca/sobey/" class="menu">' + text_M[0] + '</a><br />')


break
}
}

sectionDetect ();
 
// UNCOMMENT the lines below if the site uses a RELATED LINKS table. 

//	document.write('<P><table width="100%" border="0" cellspacing="0" cellpadding="3" align="center"><tr><td valign="top" bgcolor="FAF6EB" class="border"><span class="bold">Related Links</span></td></tr>')
//	document.write('<tr><td valign="top" class="borderbottomleftright">')
//	document.write('<a href="http://www.smu.ca/administration/ohs/">Occupational Health &amp; Safety</a><br>')
//	document.write('</td></tr></table>')

