sniffBrowsers();

menuItemBullet = new bulletPoint("./images/transparent.gif","./images/transparent.gif");
labelBullet1 = new bulletPoint("./images/nav_home_off.gif","./images/nav_home_on.gif");
labelBullet2 = new bulletPoint("./images/nav_aboutus_off.gif","./images/nav_aboutus_on.gif");
labelBullet3 = new bulletPoint("./images/nav_fundraising_off.gif","./images/nav_fundraising_on.gif");
labelBullet4 = new bulletPoint("./images/nav_sponsorships_off.gif","./images/nav_sponsorships_on.gif");
labelBullet5 = new bulletPoint("./images/nav_clubevents_off.gif","./images/nav_clubevents_on.gif");

aboutusImage1 = new bulletPoint("./images/nav_submembers_off.gif","./images/nav_submembers_on.gif");
aboutusImage2 = new bulletPoint("./images/nav_subjoin_off.gif","./images/nav_subjoin_on.gif");
aboutusImage3 = new bulletPoint("./images/nav_subhistory_off.gif","./images/nav_subhistory_on.gif");
aboutusImage4 = new bulletPoint("./images/nav_subphoto_off.gif","./images/nav_subphoto_on.gif");

fundraisingImage1 = new bulletPoint("./images/nav_submaple_off.gif","./images/nav_submaple_on.gif");
fundraisingImage2 = new bulletPoint("./images/nav_subdonnybrook_off.gif","./images/nav_subdonnybrook_on.gif");
fundraisingImage3 = new bulletPoint("./images/nav_subbingo_off.gif","./images/nav_subbingo_on.gif");
fundraisingImage4 = new bulletPoint("./images/nav_sublotteries_off.gif","./images/nav_sublotteries_on.gif");
fundraisingImage5 = new bulletPoint("./images/nav_subcommcal_off.gif","./images/nav_subcommcal_on.gif");


sponsershipsImage1 = new bulletPoint("./images/nav_subyouth_off.gif","./images/nav_subyouth_on.gif");
sponsershipsImage2 = new bulletPoint("./images/nav_subcommunity_off.gif","./images/nav_subcommunity_on.gif");

clubeventsImage1 = new bulletPoint("./images/nav_subevents_off.gif","./images/nav_subevents_on.gif");
clubeventsImage2 = new bulletPoint("./images/nav_subminutes_off.gif","./images/nav_subminutes_on.gif");

myTest = new menuBar('myTest',472, 'horizontal', '', '');
myTest.addLabel('labelBullet1', '', 1, 44, '', '', 'index.html', 'left');
myTest.addLabel('labelBullet2', '', 2, 66, '', '', '#', 'left');
myTest.addLabel('labelBullet3', '', 3, 88, '', '', '#', 'left');
myTest.addLabel('labelBullet4', '', 4, 97, '', '', '#', 'left');
myTest.addLabel('labelBullet5', '', 5, 85, '', '', '#', 'left');
myTest.height = 14;

menus[1] = new menu(65, 'vertical', '', '');
menus[1].writeMenu();

menus[2] = new menu(87, 'vertical', '', '');
menus[2].height = 19;
menus[2].addItem('aboutusImage1', '', null, 121, '', '', './members.html', 'left');
menus[2].addItem('aboutusImage2', '', null, 121, '', '', './members.html#section_join', 'left');
menus[2].addItem('aboutusImage3', '', null, 121, '', '', './history.html', 'left');
menus[2].addItem('aboutusImage4', '', null, 121, '', '', './photogallery.html', 'left');
menus[2].writeMenu();

menus[3] = new menu(109, 'vertical', '', '');
menus[3].height = 19;
menus[3].addItem('fundraisingImage1', '', null, 121, '', '', './fundraising.html?type=maple', 'left');
menus[3].addItem('fundraisingImage2', '', null, 121, '', '', './fundraising.html?type=donnybrook', 'left');
menus[3].addItem('fundraisingImage3', '', null, 121, '', '', './fundraising.html?type=bingo', 'left');
menus[3].addItem('fundraisingImage4', '', null, 121, '', '', './fundraising.html?type=lotteries', 'left');
menus[3].addItem('fundraisingImage5', '', null, 121, '', '', './communitycalendar.html', 'left');
menus[3].writeMenu();

menus[4] = new menu(118, 'vertical', '', '');
menus[4].height = 19;
menus[4].addItem('sponsershipsImage1', '', null, 121, '', '', './youthsponsorships.html', 'left');
menus[4].addItem('sponsershipsImage2', '', null, 121, '', '', './commsponsorships.html', 'left');
menus[4].writeMenu();

menus[5] = new menu(106, 'vertical', '', '');
menus[5].height = 19;
menus[5].addItem('clubeventsImage1', '', null, 121, '', '', './eventscalendar.html', 'left');
menus[5].addItem('clubeventsImage2', '', null, 121, '', '', './minutesofmeeting.html', 'left');
menus[5].writeMenu();

menus[1].align='right';
menus[2].align='right';
menus[3].align='right';
menus[4].align='right';
menus[5].align='right';



// Rollover - changes the images of an object when rolled over
function Hilite(name,image,over) {
  if(window.document.images) {
    if (over)
      window.document.images[name].src = "images/" + image + "_on.gif";
    else
      window.document.images[name].src = "images/"+ image + "_off.gif";
  }
}

function blank(){
}


/*----------------------------------------------------------------------------
Name:       findLayer(name, doc)
Description:    Returns a reference to the layer named "name" embedded in the "doc"
       object for both IE and NS.  ("doc" object ignored for IE)
Inputs:         String "name" - name of the layer to search for
       Object "doc" - object to search within (NS only)
Outputs:     reference to layer if found, null otherwise
-----------------------------------------------------------------------------*/
function findLayer(name,doc){
 if(document.layers){
  var i, layer;
  for (i=0; i<doc.layers.length; i++){
   layer = doc.layers[i];
   if (layer.name == name){
    return layer;
   }
   if (layer.document.layers.length > 0){
    layer = findLayer(name, layer.document);
    if (layer != null){
     return layer;
    }
   }
  }
  return null;
 }
 else if(document.getElementById){
  return document.getElementById(name);
 }
 else if(document.all){
  var tempDiv = eval("document.all." + name);
  if(typeof tempDiv == "object")
   return tempDiv;
  else
   return null;
 }
}

/*----------------------------------------------------------------------------
Name:          rewriteLayerHTML(LayerName, sHTML)
Author:   Roger Obando (robando@sapient.com)
Description:    rewrites the contents of a layer to the passed in HTML string
Inputs:         var "LayerName" - name of the layer to write to.  You can
    either pass a string and the function will find a reference
    to the layer by that name or you can pass in a layer object
    and the function will simply use that.
    string "sHTML" - The HTML string to write to the layer
Outputs:     none
Browser Support:Up to IE 5.5 and NS 4.X
Notes:   [robando 2/20/02] Be aware that writing a table to a layer will
    not render correctly in IE 5.0 on a Macintosh.  It's a Mac bug.
    I've found the best workaround is to work with <div> or <span>
    tags instead.
-----------------------------------------------------------------------------*/
function rewriteLayerHTML(LayerName, sHTML){

 if((typeof LayerName) == "string"){
  var oLayer = findLayer(LayerName, document);
 }
 else if((typeof LayerName) == "object"){
  var oLayer = LayerName;
 }
 else{
  var oLayer = null;
 }

 if(oLayer != null){
  if(document.layers){
   oLayer.document.open();
   oLayer.document.write(sHTML);
   oLayer.document.close();
  }
  else if(document.all || document.getElementById){
   oLayer.innerHTML = sHTML;

  }
 }
 else{
  // Let's let people know they messed up in the function call
  alert("That is not a valid layerName parameter for rewriteLayerHTML");
 }
}


/*----------------------------------------------------------------------------
Name:     		getURLParameters(parametername)
Author:   		Lisa Harpur (lharpur@sapient.com)
Description:	returns a value of any parameter within the browser URL
Inputs: 			var "parametername" - name of the parameter you want returned
Outputs:			value of parameter
Browser 			Support:Up to IE 5.5 and NS 4.X
Notes:  
-----------------------------------------------------------------------------*/

function getURLParameters(parametername) 
{

	// Initialize the return value to nothing
	returnvalue = "";
	
	// Get the URL String
	var sURL = window.document.URL.toString();

	// Make sure there are parameters	
	if (sURL.indexOf("?") > 0)
	{
		// Get all Parameters  - everything after ?
		var arrParams = sURL.split("?");
			
		// Split each parameter into name=value pairs
		var arrURLParams = arrParams[1].split("&");
		
		// Set the number of Names and the number of Values
		var arrParamNames = new Array(arrURLParams.length);
		var arrParamValues = new Array(arrURLParams.length);
		
		// Loop though each name=value pair
		var i = 0;
		for (i=0;i<arrURLParams.length;i++)
		{
			var sParam =  arrURLParams[i].split("=");
			arrParamNames[i] = sParam[0];
			if (sParam[1] != "")
				arrParamValues[i] = unescape(sParam[1]);
			else
				arrParamValues[i] = "";

			if (arrParamNames[i] == parametername)
				returnvalue = arrParamValues[i];
		}
	}

return returnvalue;
}


function showHideDiv(d,a) {
	var theDiv = document.getElementById(a);
	var theDisplay = theDiv.style.display;
	if (theDisplay == 'none' || theDisplay == '') {
		theDiv.style.display = 'block';
	} else {
		theDiv.style.display = 'none';
	}
}

