//$(function()
//{
//	if (msOnDemandDocumentId == 27670 || msOnDemandDocumentId == 27086 || msOnDemandDocumentId == 28676 || msOnDemandDocumentId == 27530)
//	{
	//	if (membersLayout == 'OK') // Display appropriate submenu for Members Only Page
	//	{
	//		MenuDisplay(); // Display the menu
	//	}
//	}
//})



function MenuDisplay()
{
	var sParam;
	var oXML;
	var oRoot;
	var aHTML = [];
	var h = -1;
	
	var divLoadPages = $('#divLoadPages');

	sParam = 'method=SITE_IS_LOGGED_ON';
	var loggedin  = onDemandSite(sParam);
	var arylog = loggedin.split('|');

//	alert ('OK');

	aHTML[++h] = '<ul>'

//	var oRow = oRoot.childNodes.item(iRow);

	if (arylog[0]=='OK' && arylog[1]=='OK')
	{

			aHTML[++h] = '<li><a title="Membership Information and Login" href="/rotary_membership_and_login">About Rotary Membership</a></li>';
			aHTML[++h] = '<li><a title="Members Only Home" href="/members_only_home">Information for Members</a></li>';
			aHTML[++h] = '<li><a title="Rotary Training for Stronger Leadership in your clubs" href="/members_rotary_leadership_institute">Rotary Leadership Institute</a></li>';
			aHTML[++h] = '<li><a title="Club Administration Manual" href="/club_administration_manual">Club Administration Manual</a></li>';
			aHTML[++h] = '<li><a title="Online Community Collaboration Portal" href="/security/downloadAttachment.asp?select=3083233" target="_blank">Online Community Collaboration Portal</a></li>';
			aHTML[++h] = '<li><a title="Connecting with Rotary Online" href="/security/downloadAttachment.asp?select=3083234">Connecting with Rotary Online (Member Access / Facebook / LinkedIn)</a></li>';
			aHTML[++h] = '<li><a title="PETS - Pre Work Social Styles - Human Capital" href="/security/downloadAttachment.asp?select=3176223">PETS - Pre Work Social Styles</a></li>';
			aHTML[++h] = '<li><a title="Rotary PETS Leadership - Human Capital" href="/security/downloadAttachment.asp?select=3176221">Rotary PETS - Leadership</a></li>';
			aHTML[++h] = '<li><a title="Speakers Bank - Suggestions for Great Guest Speakers" href="/speakers_bank">Speakers Bank</a></li>';
			aHTML[++h] = '<li><a title="Foundation Forms and Brochures" href="/foundation_forms_and_brochures">Foundation Forms and Brochures (Group Study Exchange&nbsp; - replaced with Vocational Training Teams, Future Vision, PHS, Centurion)</a></li>';
			aHTML[++h] = '<li><a title="Safeguarding young persons and vulnerable adults in Rotary, and other participants in Rotary Organised Activities (ROAs)" href="/security/downloadAttachment.asp?select=3052906" target="_blank">District Protection Policy</a></li>';
			aHTML[++h] = '<li><a href="/security/downloadAttachment.asp?select=3108133">Certificate of Incorporation of D9800 (as at Aug 2004)</a></li>';
			aHTML[++h] = '<li><a href="/security/downloadAttachment.asp?select=3108134">District Resolutions of D9800 (as at March 2008)</a></li>';
			aHTML[++h] = '<li><a href="/security/downloadAttachment.asp?select=3108135">Rules & Statement of Purposes of D9800 (as at Jan 2007)</a></li>';
			aHTML[++h] = '<li><a href="/password_change">Change Password</a></li>';
			aHTML[++h] = '<li><a onclick="Logoff()" href="/">Logout</a></li>';
			aHTML[++h] = '<li><a href="/update_your_details">Update Your Details</a></li>';
	}
	else
	{
			aHTML[++h] = '<li><a title="Membership Information and Login" href="/rotary_membership_and_login">About Rotary Membership</a></li>';
	}
	aHTML[++h] = '</ul>'

/*
	oXML = onDemandSiteXML(sParam);
	oRoot = oXML.getElementsByTagName('ondemand').item(0);

	if (oRoot.hasChildNodes())
	{
	
		aHTML[++h] = '<ul>'
		
	  	for (var iRow = 0; iRow < oRoot.childNodes.length; iRow++) 
		{
			var oRow = oRoot.childNodes.item(iRow);
			
			aHTML[++h] = '<tr><td style="width: 150px;" class="searchResult">' +
							'<h2><a href="' + onDemandXMLGetData(oRow, "url") +
							'" class="searchResult" id="document-' + onDemandXMLGetData(oRow, "id") + '">' +
							onDemandXMLGetData(oRow, "title") +
							'</a></h2></td>';
							
			aHTML[++h] = '<td class="searchResult"><h3>' +
							onDemandXMLGetData(oRow, "keywords") + '</h3><p>' +
							onDemandXMLGetData(oRow, "summary") +
							'</p></td></tr>';	
		}	
		
		aHTML[++h] = '</tbody>'
		aHTML[++h] = '</table>'	
		
	}
	else
	{
		aHTML[++h] = '<table><tr><td><i>No search results.</i></td></tr></table>'
	}
*/

	$("#nav_sub_menu").html(aHTML.join(''));
	
}

