//'*******************************************************************************
//'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)
   {
     menu1_off = new Image();
	 menu1_off.src = "/images/menu1.gif";
	 menu1_on = new Image();
	 menu1_on.src = "/images/menu1_on.gif";
	 menu1_active = new Image();
	 menu1_active.src = "/images/menu1_on.gif"; 

     menu2_off = new Image();
	 menu2_off.src = "/images/menu2.gif";
	 menu2_on = new Image();
	 menu2_on.src = "/images/menu2_on.gif";
	 menu2_active = new Image();
	 menu2_active.src = "/images/menu2_on.gif"; 
	 
     menu3_off = new Image();
	 menu3_off.src = "/images/menu3.gif";
	 menu3_on = new Image();
	 menu3_on.src = "/images/menu3_on.gif";
	 menu3_active = new Image();
	 menu3_active.src = "/images/menu3_on.gif"; 
	 
     menu4_off = new Image();
	 menu4_off.src = "/images/menu4.gif";
	 menu4_on = new Image();
	 menu4_on.src = "/images/menu4_on.gif";
	 menu4_active = new Image();
	 menu4_active.src = "/images/menu4_on.gif"; 
	 
     menu5_off = new Image();
	 menu5_off.src = "/images/menu5.gif";
	 menu5_on = new Image();
	 menu5_on.src = "/images/menu5_on.gif";
	 menu5_active = new Image();
	 menu5_active.src = "/images/menu5_on.gif"; 
	 
     menu6_off = new Image();
	 menu6_off.src = "/images/menu6.gif";
	 menu6_on = new Image();
	 menu6_on.src = "/images/menu6_on.gif";
	 menu6_active = new Image();
	 menu6_active.src = "/images/menu6_on.gif"; 

   }
}
// call this function as soon as its loaded
PreloadImages();

// THESE FUNCTIONS HIDE AND UNHIDE THE FLASH FOR MODAL POPUP
function hideFlash(){
	//hide flash
	flashbox = document.getElementById('flashBox');
	flashbox.style.visibility = "hidden";
}

function showFlash(){
	//hide flash
	flashbox = document.getElementById('flashBox');
	flashbox.style.visibility = "visible";
}


//'*******************************************************************************
//'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
//
//'Parameters:    strURL,strName,intMenubar,intToolbar,intLocation,
//'               intDirectories,intStatus,intScrollbars,intResizable,
//'               intWidth,intHeight
//'*******************************************************************************

function LaunchExternal(strURL,width,height)
{
   if(width==null)
   {
   width=750;
   }
   
   if(height==null)
   {
   height=525;
   }
   NewWindow(strURL,'',0,0,0,0,1,1,1,width,height);
}

//'*******************************************************************************
//'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();
}
