//'*******************************************************************************
//'Function:      GetNewPage
//'Parameters:
//'Return:
//'Description:   automatically loads page from a dropdown SELECT list
//'*******************************************************************************

function getNewPage(form) {
	var f = form.urlList;
	var selectedUrl = f.options[f.selectedIndex].value;
	return location.href = selectedUrl;
}
//'*******************************************************************************
//'Function:      PreloadImages
//'Parameters:
//'Return:
//'Description:   preload images that are used for mouseovers
//'*******************************************************************************

function PreloadImages()
{
   if (document.images)
   {
     iconMediaCentre_off = new Image();
	 iconMediaCentre_off.src = "images/iconMediaCentre_off.gif";
	 iconMediaCentre_on = new Image();
	 iconMediaCentre_on.src = "images/iconMediaCentre_on.gif";
	 iconMediaCentre_active = new Image();
	 iconMediaCentre_active.src = "images/iconMediaCentre_on.gif"; 

     iconVolunteer_off = new Image();
	 iconVolunteer_off.src = "images/iconVolunteer_off.gif";
	 iconVolunteer_on = new Image();
	 iconVolunteer_on.src = "images/iconVolunteer_on.gif";
	 iconVolunteer_active = new Image();
	 iconVolunteer_active.src = "images/iconVolunteer_on.gif"; 

     iconLawnSign_off = new Image();
	 iconLawnSign_off.src = "images/iconLawnSign_off.gif";
	 iconLawnSign_on = new Image();
	 iconLawnSign_on.src = "images/iconLawnSign_on.gif";
	 iconLawnSign_active = new Image();
	 iconLawnSign_active.src = "images/iconLawnSign_on.gif"; 

     iconDonate_off = new Image();
	 iconDonate_off.src = "images/iconDonate_off.gif";
	 iconDonate_on = new Image();
	 iconDonate_on.src = "images/iconDonate_on.gif";
	 iconDonate_active = new Image();
	 iconDonate_active.src = "images/iconDonate_on.gif"; 

     iconRidingInfo_off = new Image();
	 iconRidingInfo_off.src = "images/iconRidingInfo_off.gif";
	 iconRidingInfo_on = new Image();
	 iconRidingInfo_on.src = "images/iconRidingInfo_on.gif";
	 iconRidingInfo_active = new Image();
	 iconRidingInfo_active.src = "images/iconRidingInfo_on.gif"; 

     iconMediaProfile_off = new Image();
	 iconMediaProfile_off.src = "images/iconMediaProfile_off.gif";
	 iconMediaProfile_on = new Image();
	 iconMediaProfile_on.src = "images/iconMediaProfile_on.gif";
	 iconMediaProfile_active = new Image();
	 iconMediaProfile_active.src = "images/iconMediaProfile_on.gif"; 

     iconMediaPhoto_off = new Image();
	 iconMediaPhoto_off.src = "images/iconMediaPhoto_off.gif";
	 iconMediaPhoto_on = new Image();
	 iconMediaPhoto_on.src = "images/iconMediaPhoto_on.gif";
	 iconMediaPhoto_active = new Image();
	 iconMediaPhoto_active.src = "images/iconMediaPhoto_on.gif"; 

     iconMediaRequest_off = new Image();
	 iconMediaRequest_off.src = "images/iconMediaRequest_off.gif";
	 iconMediaRequest_on = new Image();
	 iconMediaRequest_on.src = "images/iconMediaRequest_on.gif";
	 iconMediaRequest_active = new Image();
	 iconMediaRequest_active.src = "images/iconMediaRequest_on.gif"; 

     iconMembership_off = new Image();
	 iconMembership_off.src = "images/iconMembership_off.gif";
	 iconMembership_on = new Image();
	 iconMembership_on.src = "images/iconMembership_on.gif";
	 iconMembership_active = new Image();
	 iconMembership_active.src = "images/iconMembership_on.gif"; 

     iconAskAQuestion_off = new Image();
	 iconAskAQuestion_off.src = "images/iconAskAQuestion_off.gif";
	 iconAskAQuestion_on = new Image();
	 iconAskAQuestion_on.src = "images/iconAskAQuestion_on.gif";
	 iconAskAQuestion_active = new Image();
	 iconAskAQuestion_active.src = "images/iconAskAQuestion_on.gif"; 
   }
}
// call this function as soon as its loaded
PreloadImages();

//'*******************************************************************************
//'Function:      TurnOn
//'Parameters:    strName,strCurrentSection,strMenu
//'Return:
//'Description:   function to turn on mouseover effect for navigation elements
//'*******************************************************************************

function TurnOn(strName)
{
   if (document.images)
   {
      onImage = eval(strName + "_on.src");
      document[strName].src = onImage;
   }
}

//'*******************************************************************************
//'Function:      TurnOff
//'Parameters:    strName,strCurrentSection,strMenu
//'Return:
//'Description:   function to turn off mouseover effect for navigation elements
//'*******************************************************************************

function TurnOff(strName,strCurrentSection,strMenu)
{
   if (document.images)
   {
      if (strCurrentSection != strMenu)
      {
         offImage = eval(strName + "_off.src");
         document[strName].src = offImage;
      }
      else
      {
         activeImage = eval(strName + "_active.src");
         document[strName].src = activeImage;
      }
   }
}



//'*******************************************************************************
//'Function:      LaunchExternal
//'Parameters:    strURL
//'Return:
//'Description:   function to launch a new window set to a specific size
//'*******************************************************************************

function LaunchExternal(strURL)
{
   NewWindow(strURL,'external_window',1,1,1,1,1,1,1,750,525);
}

//'*******************************************************************************
//'Function:      NewWindow
//'Parameters:    strURL,strName,intMenubar,intToolbar,intLocation,
//'               intDirectories,intStatus,intScrollbars,intResizable,
//'               intWidth,intHeight
//'Return:
//'Description:   function to launch a new window set to specific parameters
//'*******************************************************************************

function NewWindow(strURL,strName,intMenubar,intToolbar,intLocation,intDirectories,intStatus,intScrollbars,intResizable,intWidth,intHeight)
{
   var objNewWindow;
   if (strURL == '' && strName == 'print')
   {  
		strURL = window.location + "&Print=True";
   }
   
   if (strURL == '' && strName == 'print2')
   {  
		strURL = window.location + "?Print=True";
   }
   var strParameters
   strParameters = 'menubar=' + intMenubar;
   strParameters += ',toolbar=' + intToolbar;
   strParameters += ',location=' + intLocation;
   strParameters += ',directories=' + intDirectories;
   strParameters += ',status=' + intStatus;
   strParameters += ',scrollbars=' + intScrollbars;
   strParameters += ',resizable=' + intResizable;
   strParameters += ',width=' + intWidth;
   strParameters += ',height=' + intHeight;
   strParameters += ',screenX=' + 10;
   strParameters += ',screenY=' + 10;
   strParameters += ',left=' + 10;
   strParameters += ',top=' + 10;
   objNewWindow = window.open(strURL,strName,strParameters);
   objNewWindow.focus();
}