<!--
// THIS CODE HAS BEEN WRITTEN BY THE 1stBmthBB WEBTEAM. (C) 2001, 2002, 2003, 2004, 2005
// EMAIL: Webteam@1stBmthBB.org.uk	URL: www.1stBmthBB.org.uk
// VERSION 7 06/03/2006 - last edited by N.Bessant

//Global Variable
	var CurrentPage;

// USEFUL FUNCTIONS
function MakeArray(n) {
	this.length = n;
	for (var i = 0; i<n; i++) {
		this[i] = new Image();
	}
	return this;
}

// GLOBAL BORDER WRAP
	var PageTabs = new Array();
	
	function AddPageTab(name, page_url, tooltip, image_src_on, image_src_off) {
		this.name = name;
		this.url = page_url;
		this.tooltip = tooltip;
		this.image_on = new Image();
		this.image_on.src = image_src_on;
		this.image_off = new Image();
		this.image_off.src = image_src_off;
	}
	
	function AddPage(PageName, PageUrl, PageAlt, PageImageOn, PageImageOff) {
		var size = PageTabs.length;
		PageTabs[size] = new AddPageTab(PageName, PageUrl, PageAlt, PageImageOn, PageImageOff);
	}
	
	AddPage('anchortab', 'anchor.asp', 'LINK: Anchor Section Homepage', 'global/AnchorTabOn.gif', 'global/AnchorTab.gif');
	AddPage('juniortab', 'junior.asp', 'LINK: Junior Section Homepage', 'global/JuniorsTabOn.gif', 'global/JuniorsTab.gif');
	AddPage('companytab', 'company.asp', 'LINK: Company Section Homepage', 'global/CompanyTabOn.gif', 'global/CompanyTab.gif');
	AddPage('friendsandfamilytab', 'friendsandfamily.asp', 'LINK: For Friends and Families of The Company', 'global/FriendsandFamilyTabOn.gif', 'global/FriendsandFamilyTab.gif');
	AddPage('programmetab', 'programme.asp', 'LINK: Online interactive programme listing', 'global/ProgrammeTabOn.gif', 'global/ProgrammeTab.gif');
	AddPage('hometab', 'default.asp', 'LINK: 1stBmthBB Homepage', 'global/HomeTabOn.gif', 'global/HomeTab.gif');

	
	// table top half
	function PageHeader(DisplayPage)
	{
		CurrentPage = DisplayPage
		document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="global-tableset-x" align="left" valign="top" width="100%" background="global/TopTile.gif"><div>');
		// Need to loop round the different page headers and display the headers
		for(var index = 0; index < PageTabs.length; index++) {
			if (DisplayPage != PageTabs[index].url) {
				document.write('<A href="');
				document.write(PageTabs[index].url);
				document.write('">');
			}
			document.write('<img src="');
			if (DisplayPage != PageTabs[index].url) {
				document.write(PageTabs[index].image_off.src);
			} else {
				document.write(PageTabs[index].image_on.src);
			}
			document.write('" Name="')
			document.write(PageTabs[index].name);
			document.write('" alt="');
			document.write(PageTabs[index].tooltip);
			document.write('" Width="100" Height="34" border="0"');
			if (DisplayPage != PageTabs[index].url) {
				document.write('onmouseover="');
				document.write('over(this, ')
				document.write(index);
				document.write(');" onmouseout="out(this, ');
				document.write(index);
				document.write(');"');
			}
			document.write('>');
			if (DisplayPage != PageTabs[index].url) {
				document.write('</A>');			
			}
		}
	
		document.write('</div></td><td valign="top" align="center"><img src="global/TopRightCorner.gif" width="72" height="40" ALT=""></td></tr><tr><td valign="top"><div>');
	}

	// table bottom half
	function PageFooter(PageAuthor)
	{
	document.write('<table cellpadding="0 cellspacing="0" border="0" width="100%"><tr><td>')
	if (CurrentPage != 'default.asp'){
		document.write('<div style="font: 0.8em Helvetica, arial, sans-serif; color: #000088; text-align:center; margin:6px; padding: 2px; background-color: #FFFFFF; border: #000088 2px solid;">Did you like this page? Do you have any comments or suggestions? Leave a message on our <a href="messageboard.asp" style="color:#000088;">message board</a>!</div>');}
	document.write('</td></tr></table></div></td><td class="global-tableset-y" align="center" valign="top" background="global/RightTile.gif"><img src="global/DownName.gif" align="top" width="72" height="400" ALT="Welcome to the 1stBmthBB.org.uk Website"></td></tr></table>');
	document.write('<table class="footer" cellspacing="0" width="100%"><tr><td width="40%" valign="bottom" class="footer-author"><div class="footer-author">Page Author:');
	document.write('<br>');
	if (PageAuthor == null)
		document.write('1stBmthBB Web Team');
	else
		document.write(PageAuthor);
	document.write('</div></td><td width="60%" valign="bottom" CLASS="footer-disclaimer"><div class="footer-disclaimer"> This page is part of the 1st Bournemouth Boys\' Brigade Company web site. All written and graphical content copyright 1st Bournemouth Boys\' Brigade ©1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006. Part of Winton United Reformed Church. The Boys Brigade is a registered charity. <a class="footer-disclaimer" href="siteinfo.htm">More Information</a></div></td></tr></table>');
	}

	// mousovers
	browser = (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) || ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 3 )))

	function over(mysrc,num)
	{
	if (browser) {
		mysrc.src = PageTabs[num].image_on.src;
		}
	return true;
	}

	function out(mysrc,num)
	{
	if (browser) {
		mysrc.src = PageTabs[num].image_off.src;
		}
	return true;
	}

// TOUR WINDOW
	function tour() {
	siteWindow=window.open("tour/tour.htm", "tour", "toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=0, width=630, height=400");
	siteWindow.opener=self;}

// SORRY WINDOW
	function sorry() {
	siteWindow=window.open("sorry.htm", "sorry", "toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0, width=225, height=100");
	siteWindow.opener=self;}

// ROTATING BANNER
	var BannerInfo = new Array();

	function AddFeatureToBanner(bannerimage, bannerurl, script) {
		var size = BannerInfo.length;
		BannerInfo[size] = new BannerInformation(bannerimage, bannerurl, script);
	}
	
	function BannerInformation(image, url, script) {
		if (document.images) {
			this.image = new Image();
			this.image.src = image;
		}
		else {
			this.image = image;
		}
		this.url = url;
		this.script = script;
	}

	function FeatureBanner() {
		document.write('<div align="center"><IMG align="center" SRC="banners/banner_left.gif" border="0" width="20" height="60"><A HREF="#" onClick="Banner_link();return false" onMouseover="Banner_status();return true;" onMouseout="parent.window.status=\'\';return true;">');
		Banner_sctr=-1; if (Banner_rand==0) {Banner_sctr++;}
		 else {Banner_sctr=Math.floor(Math.random()*BannerInfo.length);}
		if (document.images) {document.write('<img align="center" src="'+BannerInfo[Banner_sctr].image.src+'" alt="Featured Article" width=450 height=60 border=0 name=Banner></A></div>');}
		 else {document.write('<img align="center" src="'+BannerInfo[Banner_sctr].image+'" alt="Featured Article" width=450 height=60 border=0 name=Banner></A></div>');}
		setTimeout("Banner_rotate()",Banner_timeout);
	}

	//IMAGES width=450 height=60 
	
	var Banner_sctr=0;
	var Banner_halt=0;
	var Banner_rand=1;
	var Banner_timeout=5000;
	
	function Banner_rotate(){
	 if (Banner_halt!=1){
	  if (Banner_rand==0) {Banner_sctr++;}
	   else {Banner_sctr=Math.floor(Math.random()*BannerInfo.length);}
	  if (Banner_sctr>BannerInfo.length-1) Banner_sctr=0;
	  if (document.images) {
	   document.Banner.src=BannerInfo[Banner_sctr].image.src;
	  } else {
	   document.Banner.src=BannerInfo[Banner_sctr].image;
	  }
	  setTimeout("Banner_rotate()",Banner_timeout);
	 }
	}

	function Banner_link(){
	 Banner_halt=1;
	 if (BannerInfo[Banner_sctr].url.length!=0) {
		if (BannerInfo[Banner_sctr].script == false) {
		  location.href=BannerInfo[Banner_sctr].url;
		} else {
		  eval(BannerInfo[Banner_sctr].url);
		}
	 }
	}

	function Banner_status(){ parent.window.status=BannerInfo[Banner_sctr].url;}

//-->