// 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 ("index");
var url_B = new Array ("membership");
var url_C = new Array ("articles");
var url_D = new Array ("breeders");
var url_E = new Array ("results");
var url_F = new Array ("events");
var url_G = new Array ("health");
var url_H = new Array ("links");
var url_I = new Array ("contact");



// determines the parent link names in the menu
var text_A = new Array ("Home");
var text_B = new Array ("Membership");
var text_C = new Array ("Articles");
var text_D = new Array ("Poultry Breeders");
var text_E = new Array ("Show Results");
var text_F = new Array ("Events & Entry Forms");
var text_G = new Array ("Health Programs");
var text_H = new Array ("Links");
var text_I = new Array ("Contact");



// determines the flyout status of the submenus
// 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 = "index.html";

if(typeof(loc)=="undefined"){ 

loc="index.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);

	/* find the submenu with currently open page */

	//var curloc = 0;

		// if (loc==url_C[1] || loc==url_C[2] || loc==url_C[3] || loc==url_C[4] || loc==url_C[5] || loc==url_C[6] || loc==url_C[7] || loc==url_C[8]){

		//curloc = 10;		

	//}

	//else if (loc==url_C[1] || loc==url_C[2] || loc==url_C[3] || loc==url_C[4]){

		//curloc = 20;		

		//}

	//else if (loc==url_C[1] || loc==url_C[2] || loc==url_C[3] || loc==url_C[4]){

		//curloc = 30;		

		//}

	//else if (loc==url_G[1] || loc==url_G[2] || loc==url_G[3] || loc==url_G[4] || loc==url_G[5] || loc==url_G[6] || loc==url_G[7] || loc==url_G[8] || loc==url_G[9] || loc==url_G[10]){



		//curloc = 40;		



	//}



	/* If the selected box is currently invisible, show it */



	//if(box.style.display == "none" || box.style.display=="") {



		//box.style.display = "block";



	//}



//}





var menubegin = ('<class="menu"><class="menu"><a class="menu')

var menumid1 = ('" href="')

var menumid2 = ('.html">')

var menuend = ('</a><br>')



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( 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 );





break

}

}



sectionDetect ();



 




