gbAllowOtherScript = true;
var gstrThread = "";

//------------------------------------------------------------------------------------------------------------
function getThread()
{
	var strHTMLstart = '<A class="thread" href="';
	var strHTMLmiddle = '">';
	var strHTMLend = '</A>';
	var strHTMLarrow = ' <B>></B> ';
	var strHTMLPrefix = 'You are at:&nbsp;&nbsp;' + strHTMLstart + 'ISM_Home.html' + strHTMLmiddle + 'Home' + strHTMLend;
	
	var strThread = getCookie("ISMThread");

	var strMenuType = document.body.getAttribute("menutype");
	var strName = document.body.getAttribute("name");
	var strPage = document.body.getAttribute("page");
	var strSrc = window.location.href.substring(window.location.href.lastIndexOf("\/")+1);
	var strSectionSrc;

	switch (strName)
	{
		case "EarlyYears":
			strName = "<B>Early Years Department Site</B>";
			strSectionSrc = "ISM_EarlyYears_Intro_from_Head.html";
			break;

		case "Junior":
			strName = "<B>Junior Department Site</B>";
			strSectionSrc = "ISM_Junior_Intro_from_Head.html";
			break;

		case "Secondary":
			strName = "<B>Secondary Department Site</B>";
			strSectionSrc = "ISM_Secondary_Intro_from_Head.html";
			break;

		case "6thForm":
			strSectionSrc = "ISM_6thForm_Intro_from_Head.html";
			strName = "<B>6th Form Department Site</B>";
			break;

		case "Boarding":
			strSectionSrc = "ISM_Boarding_Introduction_to_Boarding.html";
			strName = "<B>Boarding Site</B>";
			break;


		case "WhatWeDo":
			strSectionSrc = "ISM_What_Do_We_Do.html";
			strName = "What Do We Do?";
			break;

		case "WhoAreWe":
			strSectionSrc = "ISM_Who_Are_We.html";
			strName = "Who Are We?";
			break;

		case "WhatsHappening":
			strSectionSrc = "ISM_Whats_Happening.html";
			strName = "What's Happening?";
			break;

		case "JoiningUs":
			strSectionSrc = "ISM_Joining_Us.html";
			strName = "Joining Us?";
			break;

		case "WantToGetInvolved":
			strSectionSrc = "ISM_Want_To_Get_Involved.html";
			strName = "Want To Get Involved?";
			break;

		case "WantToGetInTouch":
			strSectionSrc = "ISM_Want_To_Get_In_Touch.html";
			strName = "Want To Get In Touch?";
			break;

		default:
			break;	
	}

	if (strThread == "")
	{
		strThread = strHTMLPrefix;
	}


	// Only show the page name if we are not at the head of a section
	if (strPage != "undefined" && strPage != null  && strPage != "IntroFromHead" && strPage != "IntroductionToBoarding")
	{
		var aHeader = document.getElementsByTagName("H1");
		if(null != aHeader)
		{
			if (aHeader.length >= 1)
			{
				strPage = aHeader[0].innerHTML;
			}
			else
			{
				strPage = document.body.getAttribute("page");
			}
		}
	}

	// Don't show anything for home
	if(strName != "Home")
	{
		if (strPage == "undefined" || strPage == null || strPage == "IntroFromHead" || strPage == "IntroductionToBoarding")
		{
			// They have clicked on a main section so reset the thread
			strThread = strHTMLPrefix + strHTMLarrow + strHTMLstart + strSectionSrc + strHTMLmiddle + strName +strHTMLend;
		}
		else
		{
			// Combine the thread with the last one and include the new section header if necessary
			var iTemp;
			var iTemp2;
			var bAddSection = true;

			iTemp = strThread.lastIndexOf(strHTMLend);
			if (iTemp != -1)
			{
				iTemp2 = strThread.lastIndexOf('.html">', iTemp - 1);
				if (iTemp2 != -1)
				{
					if (strThread.substring(iTemp2 + 7, iTemp) == strName) bAddSection = false;
				}				
			}

			//alert(strThread.substring(iTemp2 + 7, iTemp));

			iTemp = strThread.lastIndexOf(strHTMLend + strHTMLarrow);
			if (iTemp != -1)
			{
				iTemp2 = strThread.lastIndexOf('.html">', iTemp - 1);
				if (iTemp2 != -1)
				{
					if (strThread.substring(iTemp2 + 7, iTemp) == strName)
					{
						bAddSection = false;
						
						// This also means that we are navigating within the same section and should remove the last entry
						strThread = strThread.substring(0,iTemp) + strHTMLend;
						//alert(strThread);
					}
				}				
			}

			//alert(strThread.substring(iTemp2 + 7, iTemp));

			//alert(strThread);
			//alert(iTemp);
			//alert(iTemp2);
			//alert(strTemp);
			//alert(strName);
			if (bAddSection)
			{
				//alert("adding section");
				strThread += strHTMLarrow + strHTMLstart + strSectionSrc + strHTMLmiddle + strName +strHTMLend;
			}

			strThread += strHTMLarrow + strHTMLstart + strSrc + strHTMLmiddle + strPage + strHTMLend;
		}
	}
	else
	{
		// Reset the thread to the basic home one
		strThread = strHTMLPrefix;
	}

	// Populate the thread HTML
	var oThread = document.getElementById("thread");
	if(null != oThread)
	{
		oThread.innerHTML = strThread;
	}

	setCookie("ISMThread", strThread);

	return (strThread);
}

function setCookie(strName, strValue, nExpireDays)
{
	var oDate = new Date();
	oDate.setDate(oDate.getDate() + nExpireDays);
	document.cookie = strName + "=" + escape(strValue) + ((nExpireDays == null) ? "" : ";expires=" + oDate.toGMTString());
}

function getCookie(strName)
{
	if (document.cookie.length > 0)
  	{	
		var nStart = document.cookie.indexOf(strName + "=");
  		if (nStart != -1)
    		{
    			nStart = nStart + strName.length + 1;
    			var nEnd = document.cookie.indexOf(";", nStart);
    			if (nEnd == -1) nEnd = document.cookie.length;
    			return unescape(document.cookie.substring(nStart, nEnd));
    		}
  	}	
	return "";
}


//------------------------------------------------------------------------------------------------------------
function gotoMinisite(e)
{
	var targ;
	if (!e)
	{
		var e = window.event;
	}
	if (e.target)
	{
		targ = e.target;
	}
	else if (e.srcElement)
	{
		targ = e.srcElement;
	}

	var strPage = targ.getAttribute("ismlink");

	// If we are not using IE then don't collapse, as the changes are kept when using the back button
	if(!bAllowScript) 
	{	
		window.location.href = strPage;
		return;
	}
	
	targ.className = "selectedminisite";
	
	var oMainPage = document.getElementById("divmainpage");
	var oTopFooter = document.getElementById("divtopfooter");
	var oMenuFooter = document.getElementById("divmenufooter");
	var oFooter = document.getElementById("divfooter");
	var oSideBar = document.getElementById("disidebar");
	var oISMMain = document.getElementById("TABLEISMMain");
	var oISMCont = document.getElementById("TABLEISMCont");
	
	
	if (null != oMainPage) oMainPage.style.display="none";
	if (null != oTopFooter) oTopFooter.style.display="none";
	if (null != oFooter) oFooter.style.display="none";
	if (null != oMenuFooter) oMenuFooter.style.display="none";
	if (null != oSideBar) oSideBar.style.display="none";
	if (null != oISMMain) oISMMain.style.border = 0;
	if (null != oISMCont) oISMCont.style.borderBottom = 0;
	
	collapseMenu(strPage);
}

//------------------------------------------------------------------------------------------------------------
function collapseMenu(strPage)
{
	var sfNavs = document.getElementById("nav");
	var bContinue = true;

	if (null != sfNavs)
	{
		var sfEls = document.getElementById("nav").getElementsByTagName("LI");
		if(null != sfEls)
		{
			for (var i=sfEls.length -1; i>=0; i--) 
			{
				if(sfEls[i].parentNode.parentNode.nodeName == "TD" && sfEls[i].className != "gone" && sfEls[i].className != "last")
				{
					bContinue = false;
					sfEls[i].className = "gone";
					eval('setTimeout("collapseMenu(\'' + strPage + '\')", 0)');
					break;
				}

				sfEls[i].className = "gone";

			}

			// If we get to here then we should navigate
			if (bContinue) window.location.href = strPage;
		}
	}
}

//------------------------------------------------------------------------------------------------------------
/***************************************************************
* Start Code for image shrinking 
****************************************************************/
var gaImageWSP = new Array();
var gaImageHSP = new Array();
var gaShrinkSP = new Array();
var gaImageSP = new Array();
var gaOperationSP = new Array();
var gcTimeoutSP = 5;
var gcSmallWidth = 80;
var gcSmallHeight = 60;
var gcBigWidth = 300;
var gcBigHeight = 225;
var gcIncrementPlus = 4;
var gcIncrementMinus = 4;
var gcY;
var gcX;
var gnCurrScroll;
var gnNumConcurrent = 0;

var gnOpacity;
var gnFadeIncrement = 10;
var gnFadeTiming = 40;
var gnCurrentSP;

function swapphoto(nCurrentSP)
{
	// Check if the viewer is visbile
	var oHeader = document.getElementById("ISMGalleryHeader");
	var oViewer = document.getElementById("ISMGalleryViewer");
	var oCaption = document.getElementById("ISMGalleryCaption");
	var oViewerIMG = document.getElementById("ISMGalleryViewerIMG");

		if (oViewer && oHeader && oCaption && oViewerIMG)
		{
			if (oViewer.style.display == "block")
			{
				// Stop any existing fades
				gnOpacity = -1;
				gnCurrentSP = nCurrentSP;
				setTimeout("fadephoto('pause')", gnFadeTiming*3);	
			}
			else
			{
				// Show the viewer and hide the header
				oViewer.style.display = "block";
				oCaption.style.display = "block";
				oHeader.style.display = "none";
				
				// Set photo and fade in
				fadephoto("fulloff");
				shrinkphoto(0, nCurrentSP);
				fadephoto("on");
			}
		}
}


function fadephoto(strFade)
{
	var oViewerIMG = document.getElementById("ISMGalleryViewerIMG");
	
	if (oViewerIMG)
	{
		if (strFade == "fulloff")
		{
			oViewerIMG.style.filter = "alpha(opacity=0)";
			oViewerIMG.style.opacity = 0;
			gnOpacity = 0;
		}
		else if (strFade == "fullon")
		{
			oViewerIMG.style.filter = "alpha(opacity=100)";
			oViewerIMG.style.opacity = 1;
			gnOpacity = 100;
		}
		else if (strFade == "on")
		{
			if (gnOpacity != -1)
			{
				if (gnOpacity < 100)
				{
					gnOpacity = gnOpacity + gnFadeIncrement;
					oViewerIMG.style.filter = "alpha(opacity=" + gnOpacity + ")";
					oViewerIMG.style.opacity = gnOpacity/100;
					setTimeout("fadephoto('on')", gnFadeTiming);
				}
				else
				{
					// Stop
					gnOpacity = 100
				}
			}
		}
		else if (strFade == "off")
		{
			if (gnOpacity != -1)
			{
				if (gnOpacity > 0)
				{
					gnOpacity = gnOpacity - gnFadeIncrement;
					oViewerIMG.style.filter = "alpha(opacity=" + gnOpacity + ")";
					oViewerIMG.style.opacity = gnOpacity/100;
					setTimeout("fadephoto('off')", gnFadeTiming);
				}
				else
				{
					shrinkphoto(0, gnCurrentSP);
					fadephoto("on");
				}
			}
		}
		else if (strFade == "pause")
		{
			// This was a pause just to allow the last fade to cancel
			gnOpacity = 100;
			fadephoto("off");
		}
	}
}


function shrinkphoto(strOperation, nCurrentSP)
{

	// For the moment let's not use the shrinking/enlarging code.  It is too jerky.
	// Just use the photo viewer idea
	var oViewerIMG = document.getElementById("ISMGalleryViewerIMG");
	var oCaptionTD = document.getElementById("ISMGalleryCaptionTD");
	var strCaption;

	if (oViewerIMG)
	{
		oViewerIMG.src = "images/" + document.body.getAttribute("picnames") + nCurrentSP + ".jpg";

		// Get the caption for the photo
		strCaption = document.body.getAttribute("caption" + nCurrentSP);
		oCaptionTD.innerHTML = "<P class='caption'>" + strCaption + "</P>";
	}
/*
	var oPic = document.getElementById("photo" + nCurrentSP);
	if (oPic)
	{
		if (strOperation == "unshrink")
		{
			//oPic.className = "ISMGalleryBig";
			oPic.style.width = 200;
			oPic.style.height = 150;
			eval("setTimeout(\'shrinkphoto(\"continue\"," + nCurrentSP + ")\', gcTimeoutSP)");
		}
		else if(strOperation == "shrink")
		{
			//oPic.className = "ISMGallery";
			oPic.style.width = gcSmallWidth;
			oPic.style.height = gcSmallHeight;
		}
		else
		{
			oPic.style.width = gcBigWidth;
			oPic.style.height = gcBigHeight;	
		}
	}
}
else
{

	if (nCurrentSP > 0)
	{
		// Check which element invoked this, or is it a recursive call?
		if (event != null)
		{			
			// Set the current action for this one
			gaOperationSP[nCurrentSP] = strOperation;
		
			gnCurrScroll = getScrollXY("Y");
			
			if (gaOperationSP[nCurrentSP] == "unshrink")
			{
				gnNumConcurrent++;
				window.status = gnNumConcurrent;
			}
				
			event.srcElement.offsetParent ? gcY = event.srcElement.offsetParent.offsetTop : gcY = null;
			if (event.srcElement.id != "") gaImageSP[nCurrentSP] = document.getElementById("photo" + nCurrentSP);		
		}
		
		if (gaImageSP[nCurrentSP] != null)
		{
			if (strOperation == "shrink")
			{
				gaShrinkSP[nCurrentSP] = "shrink";
			}
			if (strOperation == "unshrink")
			{
				gaShrinkSP[nCurrentSP] = "unshrink";
			}
			
			if (gaImageWSP[nCurrentSP] == undefined) gaImageWSP[nCurrentSP] = gaImageSP[nCurrentSP].width;
			if (gaImageHSP[nCurrentSP] == undefined) gaImageHSP[nCurrentSP] = gaImageSP[nCurrentSP].height;
		}
		
		if (gaImageSP[nCurrentSP] != null)
		{
			var nImageW = gaImageSP[nCurrentSP].width;
			var nImageH = gaImageSP[nCurrentSP].height;
			
			if (gaShrinkSP[nCurrentSP] == "shrink")
			{
				if (nImageW - gcIncrementMinus > gcSmallWidth)
				{
					gaImageSP[nCurrentSP].style.width = nImageW - gcIncrementMinus;
					if (nImageH/nImageW >= 0.70)
					{
						gaImageSP[nCurrentSP].style.height = nImageH - gcIncrementMinus;
						gnCurrScroll = gnCurrScroll*1 - gcIncrementMinus*0.75;
						if (gnNumConcurrent >= 1) window.scrollTo(0, gnCurrScroll);
					}
					eval("setTimeout(\'shrinkphoto(\"continue\"," + nCurrentSP + ")\', gcTimeoutSP)");
				}
				else
				{	
					if (nImageW == gcSmallWidth)
					{
						// Do nothing
						gnNumConcurrent--;
					}
					{
						gnNumConcurrent--;
						window.status = gnNumConcurrent;
						gaImageSP[nCurrentSP].style.width = gcSmallWidth;
						gaImageSP[nCurrentSP].style.height = gcSmallHeight;
						gaShrinkSP[nCurrentSP] = null;
						return;
					}
				}
			}
			else if (gaShrinkSP[nCurrentSP] == "unshrink")
			{
				if (nImageW < gcBigWidth - gcIncrementPlus)
				{
					gaImageSP[nCurrentSP].style.width = nImageW + gcIncrementPlus;
					if (nImageH/nImageW <= 0.75) 
					{
						gaImageSP[nCurrentSP].style.height = nImageH + gcIncrementPlus;
						if(gnCurrScroll < gcY) 
						{
							gnCurrScroll = gnCurrScroll*1 + gcIncrementPlus*1.1;
							if (gnNumConcurrent == 1) window.scrollTo(0, gnCurrScroll);
						}
					}
					eval("setTimeout(\'shrinkphoto(\"continue\"," + nCurrentSP + ")\', gcTimeoutSP)");
				}	
				else
				{
					gaImageSP[nCurrentSP].style.width = gcBigWidth;
					gaImageSP[nCurrentSP].style.height = gcBigHeight;
				}	
			}
		}				
	}
*/
}

//------------------------------------------------------------------------------------------------------------
function getScrollXY(strDim) 
{
	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) 
	{
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} 
	else if(document.body && (document.body.scrollLeft || document.body.scrollTop )) 
	{
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} 
	else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop )) 
	{
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}
	
	if (strDim == "Y")
	{
		return [scrOfY];
	}
	else if (strDim == "X")
	{
		return [scrOfX];
	}
	else
	{
		return [scrOfX, scrOfY];
	}
}

//------------------------------------------------------------------------------------------------------------
var gnLastScroll;
function smoothlink(strId)
{
	var nTimeout = 10;
	var nIncrement = 25;
	var nBannerOffset = 175;

	gbAllowOtherScript = false;
	
	if (document.getElementById(strId) != null)
	{
		var nDest = document.getElementById(strId).offsetTop*1 + nBannerOffset;
		var nCurr = getScrollXY("Y")*1;

		// If it isn't possible to scroll down that far then break
		if (gnLastScroll == nCurr)
		{
			gbAllowOtherScript = true;
			gnLastScroll = null;
			return;
		}
	
		if (nCurr + nIncrement < nDest)
		{
			gnLastScroll = nCurr;
			window.scrollTo(0, nCurr + nIncrement);
			eval("setTimeout(\'smoothlink(\"" + strId + "\")\', nTimeout)");
		}
		else
		{	
			gbAllowOtherScript = true;
			gnLastScroll = null;
			window.scrollTo(0, nDest);
		}
	}
}

//------------------------------------------------------------------------------------------------------------
var gnTop = 0;
function keepvisible()
{
	
	if (document.all.divmenubar)
	{

		if (gnTop == 0) gnTop = document.all.divmenubar.offsetTop;
		
		if (document.body.clientHeight > document.all.divmenubar.offsetHeight && document.body.scrollTop > gnTop)
		{
			if (document.all.divsidebar) document.all.divsidebar.style.top = document.body.scrollTop - gnTop;
			if (document.all.divmenubar) document.all.divmenubar.style.top = document.body.scrollTop - gnTop
		}		
		else
		{
			if (document.all.divsidebar) document.all.divsidebar.style.top = 0;
			if (document.all.divmenubar) document.all.divmenubar.style.top = 0;
		}
	}	

	// Comment out the following line to disable menu scrolling. The value in milliseconds represents the time between updates - change if necessary, 
	setTimeout("keepvisible()", 100);
}

//------------------------------------------------------------------------------------------------------------
/*********************************************************
** Which browser?
*********************************************************/
var bAllowScript;
if (navigator.appName == "Microsoft Internet Explorer")
{
	bAllowScript = true;
}
else
{
	bAllowScript = false;
}



//------------------------------------------------------------------------------------------------------------
/*********************************************************
** Start the document
*********************************************************/
document.open();
document.writeln('<DIV id="wholepage" class="menu">');


//------------------------------------------------------------------------------------------------------------
/*********************************************************
** This section is for the banner
*********************************************************/
document.writeln('<TABLE id="ISMBanner" class="ISMContBanner" border=0>');
document.writeln('<TR><TD align=left valign=bottom>');
document.writeln('<a name="Top"></a>');
document.writeln('<TABLE width="800px"><TR><TD>');
document.writeln('<P id="thread" class="thread"></P>');
document.writeln('</TD></TR></TABLE>');
document.writeln('</TD></TR>');
document.writeln('</TABLE>');

if(document.body.getAttribute("sidebar") != "none")
{
document.writeln('<TABLE id="TABLEISMCont" class="ISMCont">');
}
else
{
document.writeln('<TABLE id="TABLEISMCont" class="ISMContNoSideBar">');
}

document.writeln('	<TR>');
document.writeln('		<TD valign=top align=right>');
document.writeln('			<TABLE class="ISMSide">');
document.writeln('			<TR><TD>');
document.writeln('			<DIV id="divmenubar" class="sidebar">');
document.writeln('			<BR>');

document.writeln('<ul id="nav">');


//------------------------------------------------------------------------------------------------------------
/*********************************************************
** This section is for the main menus
*********************************************************/

if(document.body.getAttribute("menutype") != "minisite")
{
// Change banner (different for mini sites)
// Now done with a background image and we have the thread bar so this is not necessary any longer
//document.getElementById("ISMBanner").src = "images/ISM_Banner.jpg"

if (document.body.getAttribute("name") != "Home")
{
document.writeln('<li class="mainmenu"><a href="index.html">Home&nbsp;</a></li>');
}
else
{
document.writeln('<li class="mainmenu"><a class="selectedmenu">IISM Home&nbsp;</a></li>');
};

document.writeln('<li class="mainmenu"><a ');
document.body.getAttribute("name") == "WhatWeDo" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_What_Do_We_Do.html">What do we do?&nbsp;</a>');

if (document.body.getAttribute("name") == "WhatWeDo") document.writeln('</li>') 
else {
document.writeln('<ul>');
document.writeln('<li class="submenu"><a id="WhatDoWeDo" class="submenu" href="ISM_What_Do_We_Do.html">Intro From Head&nbsp;</a></li>');}
document.writeln('<li class="submenu"><a id="MissionStatement" class="submenu" href="ISM_Mission_Statement.html">Mission Statement&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="EarlyYears" class="submenu" href="ISM_EarlyYears_Intro_from_Head.html">Early Years&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="JuniorSchool" class="submenu" href="ISM_Junior_Intro_from_Head.html">Junior&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="SecondarySchool" class="submenu" href="ISM_Secondary_Intro_from_Head.html">Secondary&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="6thForm" class="submenu" href="ISM_6thForm_Intro_from_Head.html">6th Form&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="Boarding" class="submenu" href="ISM_Boarding_Introduction_to_Boarding.html">Boarding&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="SaturdaySchool" class="submenu" href="ISM_Saturday_School.html">Saturday School&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="ExamResults" class="submenu" href="ISM_Exam_Results.html">Exam Results&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="FacilitiesForHire" class="submenu" href="ISM_Facilities_for_Hire.html">Facilities for Hire&nbsp;</a></li>');
document.body.getAttribute("name") == "WhatWeDo" ? document.writeln('') : document.writeln('</ul></li>');

document.writeln('<li class="mainmenu"><a ');
document.body.getAttribute("name") == "WhoAreWe" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_Who_Are_We.html">Who are we?&nbsp;</a>');

if (document.body.getAttribute("name") == "WhoAreWe") document.writeln('</li>') 
else {
document.writeln('<ul>');
document.writeln('<li class="submenu"><a id="WhoAreWe" class="submenu" href="ISM_Who_Are_We.html">Overview&nbsp;</a></li>');}
document.writeln('<li class="submenu"><a id="SchoolStructure" class="submenu" href="ISM_School_Structure.html">School Structure&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="MeetTheStaff" class="submenu" href="ISM_Meet_The_Staff.html">Meet The Staff&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="Governors" class="submenu" href="ISM_Governors.html">Governors&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="PTA" class="submenu" href="ISM_PTA.html">PTA&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="SchoolHistory" class="submenu" href="ISM_School_History.html">School History&nbsp;</a></li>');
//document.writeln('<li class="submenu"><a id="Alumni" class="submenu" href="ISM_Alumni.html">Alumni&nbsp;</a></li>');
document.body.getAttribute("name") == "WhoAreWe" ? document.writeln('') : document.writeln('</ul></li>');

document.writeln('<li class="mainmenu"><a ');
document.body.getAttribute("name") == "WhatsHappening" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_Whats_Happening.html">What&#39s happening?&nbsp;</a>');

if (document.body.getAttribute("name") == "WhatsHappening") document.writeln('</li>') 
else {
document.writeln('<ul>');
document.writeln('<li class="submenu"><a id="WhatsHappening" class="submenu" href="ISM_Whats_Happening.html">Latest Notices&nbsp;</a></li>');}
document.writeln('<li class="submenu"><a id="CalendarDates" class="submenu" href="ISM_Calendar_Dates.html">Calendar Dates&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="Events" class="submenu" href="ISM_Events.html">Events&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="SchoolHours" class="submenu" href="ISM_School_Hours.html">School Hours&nbsp;</a></li>');
//document.writeln('<li class="submenu"><a id="SchoolNewspaper" class="submenu" href="ISM_School_Newspaper.html">School Newspaper&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="ParentalNewsletter" class="submenu" href="ISM_Parental_Newsletter.html">School Newsletter&nbsp;</a></li>');
document.body.getAttribute("name") == "WhatsHappening" ? document.writeln('') : document.writeln('</ul></li>');

document.writeln('<li class="mainmenu"><a ');
document.body.getAttribute("name") == "JoiningUs" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_Joining_Us.html">Joining us?&nbsp;</a>');

if (document.body.getAttribute("name") == "JoiningUs") document.writeln('</li>') 
else {
document.writeln('<ul>');
document.writeln('<li class="submenu"><a id="JoiningUs" class="submenu" href="ISM_Joining_Us.html">Overview&nbsp;</a></li>');}
document.writeln('<li class="submenu"><a id="Uniform" class="submenu" href="ISM_Uniform.html">Uniform&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="FeeStructure" class="submenu" href="ISM_Fee_Structure.html">Fee Structure&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="HowToApply" class="submenu" href="ISM_How_To_Apply.html">How to Apply/Admissions&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="Scholarships" class="submenu" href="ISM_Scholarships_Bursaries.html">Scholarships & Bursaries&nbsp;</a></li>');
document.body.getAttribute("name") == "JoiningUs" ? document.writeln('') : document.writeln('</ul></li>');

document.writeln('<li class="mainmenu"><a ');
document.body.getAttribute("name") == "WantToGetInvolved" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_Want_To_Get_Involved.html">Want to get involved?&nbsp;</a>');

if (document.body.getAttribute("name") == "WantToGetInvolved") document.writeln('</li>') 
else {
document.writeln('<ul>');
document.writeln('<li class="submenu"><a id="WantToGetInvolved" class="submenu" href="ISM_Want_To_Get_Involved.html">Overview&nbsp;</a></li>');}
document.writeln('<li class="submenu"><a id="Recruitment" class="submenu" href="ISM_Recruitment.html">Recruitment&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="Sponsorship" class="submenu" href="ISM_Sponsorship.html">Sponsorship&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="Fundraising" class="submenu" href="ISM_Fundraising.html">Fundraising&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="PTA" class="submenu" href="ISM_PTA.html">PTA&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="Governors" class="submenu" href="ISM_Governors.html">Governors&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="OldIsamilians" class="submenu" href="ISM_OldIsamilians.html">Old Isamilians&nbsp;</a></li>');
document.body.getAttribute("name") == "WantToGetInvolved" ? document.writeln('') : document.writeln('</ul></li>');

document.writeln('<li class="mainmenu"><a ');
document.body.getAttribute("name") == "WantToGetInTouch" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_Want_To_Get_In_Touch.html">Want to get in touch?&nbsp;</a>');

if (document.body.getAttribute("name") == "WantToGetInTouch") document.writeln('</li>') 
else {
document.writeln('<ul>');
document.writeln('<li class="submenu"><a id="WantToGetInTouch" class="submenu" href="ISM_Want_To_Get_In_Touch.html">Contact Us&nbsp;</a></li>');}
document.writeln('<li class="submenu"><a id="AboutMwanza" class="submenu" href="ISM_About_Mwanza.html">About Mwanza&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="UsefulLinks" class="submenu" href="ISM_Useful_Links.html">Useful Links&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="Downloads" class="submenu" href="ISM_Downloads.html">Downloads&nbsp;</a></li>');
document.writeln('<li class="submenu"><a id="SiteMap" class="submenu" href="ISM_Site_map.html">Site Map&nbsp;</a></li>');
document.body.getAttribute("name") == "WantToGetInTouch" ? document.writeln('') : document.writeln('</ul></li>');


// Highlight the current menu item
if (document.getElementById(document.body.getAttribute("page")) != null) document.getElementById(document.body.getAttribute("page")).className = "selectedsubmenu";

}
else
{

//------------------------------------------------------------------------------------------------------------
/*********************************************************
** This section is for the mini site menus
*********************************************************/

// Change banner (different for mini sites)
document.getElementById("ISMBanner").src = "images/ISM_Banner_" + document.body.getAttribute("name") + ".jpg"

// Create the menu
if (document.body.getAttribute("name") != "Home")
{
document.writeln('<li><a href="index.html" class="menuhome">School Home&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>');
document.writeln('</li>');
};

	if (document.body.getAttribute("name") == "Boarding")
	{
document.writeln('<li><a ');
document.body.getAttribute("page") == "IntroductionToBoarding" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_' + document.body.getAttribute("name") + '_Introduction_to_boarding.html">Introduction&nbsp;</a>');
document.writeln('</li>');

document.writeln('<li><a ');
document.body.getAttribute("page") == "Girls" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_' + document.body.getAttribute("name") + '_Girls.html">Girls&nbsp;</a>');
document.writeln('</li>');

document.writeln('<li><a ');
document.body.getAttribute("page") == "Boys" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_' + document.body.getAttribute("name") + '_Boys.html">Boys&nbsp;</a>');
document.writeln('</li>');

document.writeln('<li><a ');
document.body.getAttribute("page") == "ADayInTheLife" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_' + document.body.getAttribute("name") + '_A_Day_In_The_Life.html">A Day In The Life&nbsp;</a>');
document.writeln('</li>');

	}
	else
	{
document.writeln('<li><a ');
document.body.getAttribute("page") == "IntroFromHead" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_' + document.body.getAttribute("name") + '_Intro_From_Head.html">Intro from Head&nbsp;</a>');
document.writeln('</li>');

document.writeln('<li><a ');
document.body.getAttribute("page") == "CurriculumContent" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_' + document.body.getAttribute("name") + '_Curriculum_Content.html">Curriculum Content&nbsp;</a>');
document.writeln('</li>');

if(document.body.getAttribute("name") == "EarlyYears")
{
document.writeln('<li><a ');
document.body.getAttribute("page") == "StayandPlay" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_' + document.body.getAttribute("name") + '_StayandPlay.html">Stay and Play Club&nbsp;</a>');
document.writeln('</li>');
}

document.writeln('<li><a ');
document.body.getAttribute("page") == "ExtraCurricular" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_' + document.body.getAttribute("name") + '_Extra_Curricular.html">Extra Curricular&nbsp;</a>');
document.writeln('</li>');

if(document.body.getAttribute("name") != "6thForm")
{
document.writeln('<li><a ');
document.body.getAttribute("page") == "HouseSystem" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_' + document.body.getAttribute("name") + '_House_System.html">House System&nbsp;</a>');
document.writeln('</li>');

document.writeln('<li><a ');
document.body.getAttribute("page") == "Trips" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_' + document.body.getAttribute("name") + '_Trips.html">Trips&nbsp;</a>');
document.writeln('</li>');
}

document.writeln('<li><a ');
document.body.getAttribute("page") == "PupilSupport" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_' + document.body.getAttribute("name") + '_Pupil_Support.html">Pupil Support&nbsp;</a>');
document.writeln('</li>');

document.writeln('<li><a ');
document.body.getAttribute("page") == "MeetTheStaff" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_' + document.body.getAttribute("name") + '_Meet_The_Staff.html">Meet The Staff&nbsp;</a>');
document.writeln('</li>');

document.writeln('<li><a ');
document.body.getAttribute("page") == "Policies" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_' + document.body.getAttribute("name") + '_Policies.html">Policies&nbsp;</a>');
document.writeln('</li>');

if(document.body.getAttribute("name") == "EarlyYears" || document.body.getAttribute("name") == "6thForm")
{
document.writeln('<li><a ');
document.body.getAttribute("page") == "Photo Album" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_' + document.body.getAttribute("name") + '_Photo_Album.html">Photo Album&nbsp;</a>');
document.writeln('</li>');
}
else
{
document.writeln('<li><a ');
document.body.getAttribute("page") == "ExamResults" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_' + document.body.getAttribute("name") + '_Exam_Results.html">Exam Results&nbsp;</a>');
document.writeln('</li>');
}

document.writeln('<li><a ');
document.body.getAttribute("page") == "StudentsWork" ? document.writeln('class="selectedmenu" ') : document.writeln('');
document.writeln('href="ISM_' + document.body.getAttribute("name") + '_StudsWork.html">Work of Students&nbsp;</a>');
document.writeln('</li>');

	}

// Put up the minisite menu image
// This is no longer used - it doesn't look very nice in IE and doesn't work well in other browsers
//document.writeln('<DIV class="minisite"><Image class="minisite" src="images/ISM_Menu_' + document.body.getAttribute("name") + '.gif"></DIV>');
}


document.writeln('</ul>');

document.writeln('			</DIV>');
document.writeln('			</TD></TR>');


// Legal bits on home
if (document.body.getAttribute("name") == "Home")
{
document.writeln('			<TR><TD>');
document.writeln('			<DIV id="divmenufooter">');
document.writeln('<P class="footnote">');
document.writeln('The schools are registered with:');
document.writeln('<BR><BR>The Tanzanian Ministry of Education and Culture (Nos: MZ.01/4/002 & S.957)');
document.writeln('<BR><BR>The British Department for Children, Schools and Families (DCSF No. 703 6228)');
document.writeln('<BR><BR>The Association of International Schools in Africa (AISA)');
document.writeln('</P>');
document.writeln('			</DIV>');
document.writeln('			</TD></TR>');
}

document.writeln('			</TABLE>');
document.writeln('</DIV>');
document.writeln('		</TD>');
document.writeln('		<TD valign=top>');


if(document.body.getAttribute("sidebar") == "none")
{
document.writeln('			<TABLE class="ISMMainNoSideBar" cellpadding=5 border=0>');
}
else if (document.body.getAttribute("sidebar") == "gallery")
{
document.writeln('			<TABLE class="ISMMainGallery" cellpadding=5>');
}
else if (document.body.getAttribute("sidebar") == "gallery_full")
{
document.writeln('			<TABLE class="ISMMainGallery_Full" cellpadding=5>');
}
else
{
document.writeln('			<TABLE id="TABLEISMMain" class="ISMMain" cellpadding=5>');
}


document.writeln('				<TR>');
document.writeln('					<TD>');
document.writeln('			<DIV id="divmainpage">');
//document.writeln('						<a name="Top"></a>');
document.close();

