//'*******************************************************************************
//'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)
   {

     menuMain1_off = new Image();
	 menuMain1_off.src = "images/menuMain1.gif";
	 menuMain1_on = new Image();
	 menuMain1_on.src = "images/menuMain1_on.gif";
	 menuMain1_active = new Image();
	 menuMain1_active.src = "images/menuMain1_on.gif"; 

     menuMain2_off = new Image();
	 menuMain2_off.src = "images/menuMain2.gif";
	 menuMain2_on = new Image();
	 menuMain2_on.src = "images/menuMain2_on.gif";
	 menuMain2_active = new Image();
	 menuMain2_active.src = "images/menuMain2_on.gif"; 

     menuMain3_off = new Image();
	 menuMain3_off.src = "images/menuMain3.gif";
	 menuMain3_on = new Image();
	 menuMain3_on.src = "images/menuMain3_on.gif";
	 menuMain3_active = new Image();
	 menuMain3_active.src = "images/menuMain3_on.gif"; 

     menuMain4_off = new Image();
	 menuMain4_off.src = "images/menuMain4.gif";
	 menuMain4_on = new Image();
	 menuMain4_on.src = "images/menuMain4_on.gif";
	 menuMain4_active = new Image();
	 menuMain4_active.src = "images/menuMain4_on.gif"; 

     menuMain5_off = new Image();
	 menuMain5_off.src = "images/menuMain5.gif";
	 menuMain5_on = new Image();
	 menuMain5_on.src = "images/menuMain5_on.gif";
	 menuMain5_active = new Image();
	 menuMain5_active.src = "images/menuMain5_on.gif"; 

     menuMain6_off = new Image();
	 menuMain6_off.src = "images/menuMain6.gif";
	 menuMain6_on = new Image();
	 menuMain6_on.src = "images/menuMain6_on.gif";
	 menuMain6_active = new Image();
	 menuMain6_active.src = "images/menuMain6_on.gif"; 

     btnSetupSubscription_off = new Image();
	 btnSetupSubscription_off.src = "images/btnSetupSubscription.jpg";
	 btnSetupSubscription_on = new Image();
	 btnSetupSubscription_on.src = "images/btnSetupSubscription_on.jpg";
	 btnSetupSubscription_active = new Image();
	 btnSetupSubscription_active.src = "images/btnSetupSubscription_on.jpg"; 
   
     protectPet_off = new Image();
	 protectPet_off.src = "images/sub_protect_off.gif";
	 protectPet_on = new Image();
	 protectPet_on.src = "images/sub_protect_on.gif";
	 protectPet_active = new Image();
	 protectPet_active.src = "images/sub_protect_on.gif"; 
   
     protectPet2_off = new Image();
	 protectPet2_off.src = "images/sub_protect_off.gif";
	 protectPet2_on = new Image();
	 protectPet2_on.src = "images/sub_protect_on.gif";
	 protectPet2_active = new Image();
	 protectPet2_active.src = "images/sub_protect_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();
}