var MainMenuIndex="";		var RelativePath="";		var MainMenu = new Array(10);
var SubMenu1 = new Array(20);	var SubMenu2 = new Array(20);	var SubMenu3 = new Array(20);
var SubMenu4 = new Array(20);	var SubMenu5 = new Array(20);	var SubMenu6 = new Array(20);
var SubMenu7 = new Array(20);	var SubMenu8 = new Array(20);	var SubMenu9 = new Array(20);

	
	
MainMenu[1] = "HOMEPAGE  #  main.htm";
	SubMenu1[1] = "DONATE ONLINE  #  http://www.justgiving.com/lingendavies";
	SubMenu1[2] = "EVENTS  #  Fundraising/events.htm";
	SubMenu1[3] = "CURRENT APPEAL  #  Appeals/cancercentre.htm";
	SubMenu1[4] = "ABOUT OUR CHARITY  #  Appeals/charity.htm";
	//SubMenu1[5] = "SANTA BIKE RIDE  #  Fundraising/Santa BikeRide.htm";
	SubMenu1[5] = "CONTACT US  #  contact.htm";
	//SubMenu1[6] = "CHRISTMAS  #  Fundraising/christmas.htm";
MainMenu[2] = "NEWS  #  news.htm";
	SubMenu2[1] = "NEWS  #  news.htm";
	SubMenu2[2] = "EVENTS  #  Fundraising/events.htm";
	//SubMenu2[3] = "DVD  #  dvd.htm";
	SubMenu2[3] = "WEBSITE  #  website.htm";
MainMenu[3] = "VOLUNTEERS  #  Volunteers/volunteers.htm";
	SubMenu3[1] = "VOLUNTEERS INTRODUCTION  #  Volunteers/volunteers.htm";
	SubMenu3[2] = "AREA CO-ORDINATORS  #  Volunteers/areacoord.htm";
MainMenu[4] = "COMPLETED PROJECTS  #  Appeals/charity.htm";
	SubMenu4[1] = "ABOUT OUR CHARITY  #  Appeals/charity.htm";
	SubMenu4[2] = "WHO'S WHO  #  whoswho.htm";
	SubMenu4[3] = "THE COBALT UNIT  #  Appeals/cobalt.htm";
	SubMenu4[4] = "THE HAMAR CENTRE  #  Appeals/hamar.htm";
	//SubMenu4[5] = "WARD 21  #  Appeals/ward21.htm";
	SubMenu4[5] = "CHEMOTHERAPY DAY UNIT  #  Appeals/chemo.htm";
	SubMenu4[6] = "LINEAR ACCELERATORS  #  Appeals/linac.htm";
	SubMenu4[7] = "RAINBOW UNIT  #  Appeals/rainbow.htm";
MainMenu[5] = "CANCER CENTRE APPEAL  #  Appeals/cancercentre.htm";
	SubMenu5[1] = "CANCER CENTRE APPEAL  #  Appeals/cancercentre.htm";
	SubMenu5[2] = "CHEMOTHERAPY  #  Appeals/cancercentre.htm#chemo";
	SubMenu5[3] = "HAEMATOLOGY  #  Appeals/cancercentre.htm#Haematology";
	SubMenu5[4] = "HEAD & NECK  #  Appeals/cancercentre.htm#head";
MainMenu[6] = "FUNDRAISING  #  Fundraising/events.htm";
	SubMenu6[1] = "EVENTS  #  Fundraising/events.htm";
	//SubMenu6[2] = "SANTA BIKE RIDE  #  Fundraising/Santa BikeRide.htm";
	//SubMenu6[2] = "PIRATES DAY  #  Fundraising/abseil.htm";
	//SubMenu6[3] = "RECENT EVENTS  #  Fundraising/gallery/photogallery.htm";
	//SubMenu6[4] = "MEMOIRS OF BERNARD LINGEN  #  Fundraising/memoirs.htm";
	SubMenu6[3] = "CELEBRATIONS  #  Fundraising/birthday.htm";
	SubMenu6[4] = "CORPORATE DONATIONS  #  Fundraising/corporate.htm";
	//SubMenu6[5] = "SPONSORED EVENTS  #  Fundraising/Sponsored events.htm";
	SubMenu6[5] = "CHRISTMAS  #  Fundraising/christmas.htm";

MainMenu[7] = "MAKE A DONATION  #  Donations/donations.htm";
	SubMenu7[1] = "MAKE A DONATION  #  Donations/donations.htm";
	SubMenu7[2] = "DONATE ONLINE  #  Donations/donateonline.htm";
	SubMenu7[3] = "GIFT AID  #  Donations/giftaid.htm";
	SubMenu7[4] = "PAYROLL GIVING  #  Donations/payroll.htm";
	SubMenu7[5] = "DONATE THROUGH THE BANK  #  Donations/bank.htm";
	SubMenu7[6] = "LEGACIES  #  Donations/will.htm";
	SubMenu7[7] = "IN MEMORY  #  Donations/bereavement.htm";
	//SubMenu7[8] = "HOME BOXES  #  Donations/home boxes.htm";
var SubMenu8 = new Array(20);
var SubMenu9 = new Array(20);














var MainMenuTDElement1 = "<td align='center' width='14%' bgcolor='#D6EBFF'>ELEMENT_TEXT</td>";
var MainMenuTDElement2 = "<td align='center' width='14%' bgcolor='#D6EBFF'>ELEMENT_TEXT</td>";
var MainMenuFontElement1MenuLink = "<a href='LINK_TARGET'>";
   MainMenuFontElement1MenuLink += "<font color='#000080' size='3'>";
   MainMenuFontElement1MenuLink += "   <strong>LINK_CAPTION</strong>";
   MainMenuFontElement1MenuLink += "</font></a>";
var MainMenuFontElement2MenuLink = "<a href='LINK_TARGET'>";
   MainMenuFontElement2MenuLink += "<font color='#000080' size='3'>";
   MainMenuFontElement2MenuLink += "   <strong>LINK_CAPTION</strong>";
   MainMenuFontElement2MenuLink += "</font></a>";
var MainMenuFontElement1CurrentPage = "<font color='#FF0000' size='3'>";
   MainMenuFontElement1CurrentPage += "<strong>LINK_CAPTION</strong>";
   MainMenuFontElement1CurrentPage += "</font>";
var MainMenuFontElement2CurrentPage = "<font color='#FF0000' size='3'>";
   MainMenuFontElement2CurrentPage += "<strong>LINK_CAPTION</strong>";
   MainMenuFontElement2CurrentPage += "</font>";

var SubMenuTDElement1 = "<tr><td align='center' bgcolor='#FFFFA5'>ELEMENT_TEXT</td>";
   SubMenuTDElement1 += "<td><img src='RELPATHspacer.gif' width='0' height='2' vspace=40></td></tr>";
var SubMenuTDElement2 = "<tr><td align='center' bgcolor='#D6EBFF'>ELEMENT_TEXT</td>";
   SubMenuTDElement2 += "<td><img src='RELPATHspacer.gif' width='0' height='2' vspace=40></td></tr>";
var SubMenuFontElement1MenuLink = "<a href='LINK_TARGET'>";
   SubMenuFontElement1MenuLink += "<font color='#000080' size='3'>";
   SubMenuFontElement1MenuLink += "<strong>LINK_CAPTION</strong>";
   SubMenuFontElement1MenuLink += "</font></a>";
var SubMenuFontElement2MenuLink = "<a href='LINK_TARGET'>";
   SubMenuFontElement2MenuLink += "<font color='#000080' size='3'>";
   SubMenuFontElement2MenuLink += "<strong>LINK_CAPTION</strong>";
   SubMenuFontElement2MenuLink += "</font></a>";
var SubMenuFontElement1CurrentPage = "<font color='#FF0000' size='3'>";
   SubMenuFontElement1CurrentPage += "<strong>LINK_CAPTION</strong>";
   SubMenuFontElement1CurrentPage += "</font>";
var SubMenuFontElement2CurrentPage = "<font color='#FF0000' size='3'>";
   SubMenuFontElement2CurrentPage += "<strong>LINK_CAPTION</strong>";
   SubMenuFontElement2CurrentPage += "</font>";








function WriteMenu(Relpath, menuNumber)
{
	MainMenuIndex = menuNumber;
	RelativePath = Relpath;

	WriteTopBar();
	WriteMainMenu();
	WriteSideMenu();
}

function WriteTopBar()
{

    document.write("        <a name='top'>									 ");
    document.write("        <table style='border-top: 3px solid #000084; border-bottom: 3px solid #000084;       ");
    document.write("         margin-bottom: 4px;' border='0' cellpadding='0' cellspacing='0' width='100%'>       ");
    document.write("            <tr> 												     ");
    document.write("                <td bgcolor='#FFFFA5'>                                                       ");
    document.write("                          <img src='"+RelativePath+"logo.JPG' width='80' height='80'>        ");
    document.write("                </td>                                                                        ");
    document.write("                <td align='center' width='100%' bgcolor='#FFFFA5'>                           ");
    document.write("                        <font size='6' face='Bookman Old Style'>                             ");
    document.write("                          <strong>Lingen Davies Cancer Relief Fund                       ");
    document.write("                            </strong><br></font>                                             ");
    document.write("                        <font size='3' face='times new roman'>                             ");
    document.write("                          <strong>Registered Charity Number 509649                           ");
    document.write("                            </strong></font>                                                 ");
    document.write("                </td>                                                                        ");
    document.write("                <td align='right' bgcolor='#FFFFA5'>                                         ");
    document.write("                          <img src='"+RelativePath+"logo.JPG' width='80' height='80'>        ");
    document.write("                </td>                     			                                   ");
    document.write("            </tr>                                         			                 ");
    document.write("        </table>                                                        			     ");
}

function WriteEndHTML()
{
	document.write("	    <br> 		</td>											");
	document.write("	         </tr>											");
	document.write("	     	</table>											");
        document.write("        <table border='0' cellpadding='0' cellspacing='0' width='100%'          ");
        document.write("         style='padding-top: 10; border-top: 3px solid #000084; 		      ");
        document.write("                padding-bottom:0; border-bottom: 0px solid #000084;'>          ");
	document.write("	         <tr>											");
	document.write("	             <td align='center' colspan='2'>						");
	document.write("	     		  <p align='center'><a href='#top'>				");
	document.write("	     			<font size='4' color=red face='Times New Roman'>				");
	document.write("	     				<strong>							");
	document.write("	     					Top of page					");
	document.write("	     				</strong>							");
	document.write("	     			</font>									");
	document.write("	     		   </a></p>									");
	document.write("	     			<p><font size='2' face='Bookman Old Style'>			");
	document.write("	     				Photographs and information from this website 		");
	document.write("	     				should not be produced without prior permission 	");
	document.write("	     				from the Lingen Davies Cancer Relief Fund. (c) 2006	");
	document.write("	     				<br>Website designed by <a href="+RelativePath+"website.htm>Ian Trenfield</a>	");
	document.write("	     			</font></p>									");
	document.write("	             </td>										");
	document.write("	         </tr>											");
	document.write("	     </table>											");
	document.write("	     </body>											");
	document.write("	     </html>											");

	document.write("<style> <!-- BODY {											");
	document.write("					margin-top: 3px;							");
	document.write("					margin-left: 5px;							");
	document.write("					margin-right: 5px;						");
	document.write("					margin-bottom: 0px;						");
	document.write("				} --> </style>								");
}


function ConvertToForwardSlashes(txt)
{
	PARTS = txt.split("\\");
	txt=PARTS[0];
	for(i=1; i<PARTS.length; i++)
	{
		txt=txt+"/"+PARTS[i];
	}
	return txt;
}

function WriteMainMenu()
{
   document.write("        <table border='1' cellspacing='0' width='100%'         ");
   document.write("        bordercolor='#000080' bordercolordark='#000080'        ");
   document.write("        bordercolorlight='#000080'>                            ");
   document.write("            <tr>                                               ");
   for (i=1; i<10; i++)
   {
		Element = MainMenu[i];
		if (Element != null)
		{
			if (i == MainMenuIndex)  {  	OutputMenuElement(i, "MainMenu", "CurrentPage", Element);   }
			if (i != MainMenuIndex)  { 	OutputMenuElement(i, "MainMenu", "MenuLink", Element);	    }
		}
   }
   document.write("            </tr>                                              ");
   document.write("        </table>                                               ");
   document.write("        <table><tr><td></td></tr></table>                                 ");
}


function WriteSideMenu()
{
         document.write("        <table border='0' cellpadding='5' width='100%'>				");
         document.write("            <tr>											");
         document.write("                <td align='center' valign='top' width='300'>			");
         document.write("                    <table border='0' cellpadding='0' cellspacing='0'		");
         document.write("                     width='100%' bordercolor='#000000'				");
         document.write("                     bordercolordark='#FFFFFF' bordercolorlight='#000000'>	");
  	   for (SubMenuIndex=1; SubMenuIndex<21; SubMenuIndex++)
  	   {

			element = eval("SubMenu" + MainMenuIndex + "[" + SubMenuIndex + "]; ");

			if (element != null) 
			{ 
				Settings = element.split("  #  "); 

				PageURL = ConvertToForwardSlashes(document.URL).toUpperCase();
				ElementURL = ConvertToForwardSlashes(Settings[1]).toUpperCase();
				index = PageURL.indexOf(ElementURL);

				CurrentPage = (index + ElementURL.length) == PageURL.length;
		  		if (CurrentPage) 	 {	OutputMenuElement(SubMenuIndex, "SubMenu", "CurrentPage", element);	}
		  		if (!(CurrentPage))   {	OutputMenuElement(SubMenuIndex, "SubMenu", "MenuLink", element);	}
			}
         }
   	   document.write("        		   </table>									");
   	   document.write("        		   <table border='0' width='100%'>					");
   	   document.write("                       <tr>									");
   	   document.write("                          <td width='100%'>						");			
   	   document.write("                               <img src='"+RelativePath+"spacer.gif' 		");
  	   document.write("                                    width='100' height='15'>			");
   	   document.write("                          </td>								");
   	   document.write("                       </tr>									");
   	   document.write("                    </table>									");
   	   document.write("                </td>										");
	   document.write("               <td align='center' valign='top' width='100%'>			");
}



// OutputMenuElement
//	i 		= 	the index of the element to output.
//				If "menutype" = "main" this is the Main Menu element to output
//				If "menutype" = "sub" this is the Sub Menu element, within the 'MainMenuIndex', to output
// 	menutype 	= 	"SubMenu" or "MainMenu"
// 	elementtype = 	"CurrentPage" or "MenuLink"



function OutputMenuElement(i, menutype, elementtype, Element)
{
	VirtIndx = (i%2);
	if (VirtIndx == 0) VirtIndx=2;

	TDElement = eval(menutype + "TDElement" + VirtIndx);
	FontElement = eval(menutype + "FontElement" + VirtIndx + elementtype);

	Settings = Element.split("  #  ");
	txt = FontElement;
	if (txt.indexOf("LINK_CAPTION") > 1)
	{
		PARTS = txt.split("LINK_CAPTION");
		txt = PARTS[0] + Settings[0] + PARTS[1];
	}
	if (txt.indexOf("LINK_TARGET") > 1)
	{
		PARTS = txt.split("LINK_TARGET");
		txt = PARTS[0] + RelativePath+Settings[1] + PARTS[1];
	}
	if (TDElement.indexOf("ELEMENT_TEXT") > 1)
	{
		PARTS = TDElement.split("ELEMENT_TEXT");
		txt = PARTS[0] + txt + PARTS[1];
	}
	document.write(txt);
}



function YellowBox()	{	CreateBox("#FFFFA5");	}
function RedBox()	{	CreateBox("#FFDFDE");	}
function BlueBox()	{	CreateBox("#D6EBFF");	}
function GreenBox()	{	CreateBox("#DAFFDA");	}
function GreyBox()	{	CreateBox("#EFEBEF");	}


function CreateBox(colour)
{
	document.write(" <table border=0 bgcolor="+colour+" width=100%>");
	document.write(" <tr><td>");
}
function EndBox()
{
	document.write(" </td></tr></table>");
}

