  
<!--

/********************************************************************  
*  Author: David Capelo  
*  Description: JavaScript Menu Functions that control the behavior of 
*	the Top Menu. (MENU TYPE - TOP TABS)
*	This function assumes that the two images, normal and glow, 
*	of each menu item will be call the same with the sufix _Off 
*	or _On.  The images are also assumed to be GIF
*  History: 9/18/2002 - Page Creation
* 
********************************************************************/
//***********************************************************
//Author - David Capelo
//This function assumes that the two images, normal and glow, 
//of each menu item will be call the same with the sufix _Off 
//or _On.  The images are also assumed to be GIF
//***********************************************************
var currentPageImageID="";
buildImageArrays('bHome','bIntro','bWhy','bPrograms','bApply','bCalculators','bLoanProcess','bGlossary','bFAQ','bCheckList','bContactUs');
function buildImageArrays() {
	//Define Variables    
	var d=document;
	var i=0;
	var k=buildImageArrays.arguments;

	//Create Image Arrays
	if(!d.menuImagesOff) d.menuImagesOff=new Array();
	if(!d.menuImagesOn) d.menuImagesOn=new Array();
	  
	//Build image arrays
	for(i=0; i<k.length; i++)
	{ 
		d.menuImagesOff[i]=new Image; 
		d.menuImagesOff[i].src='/images/buttons/'+k[i]+'_Off.jpg';
		d.menuImagesOn[i]=new Image; 
		d.menuImagesOn[i].src='/images/buttons/'+k[i]+'_On.jpg';
	}	
	//preloadMenuImages();  
}
function preloadMenuImages() {
	var d=document;
	var i;	
	for(i=0; i<d.menuImagesOff.length; i++){
		d.getElementById('image_'+i).src=d.menuImagesOff[i].src;		
		//d.getElementById('image_'+i).onmousemout='swapImgRestore(this);';
		//d.getElementById('image_'+i).onmouseover='swapImage(this);';		
	}
	d.getElementById('image_2').onmouseover;
}
function preselectMenuImages(imageID) {
	//Hold imageID selected
	currentPageImageID = imageID;	
	swapImage(document.getElementById(imageID));		
}
function swapImgRestore(obj){
	var index;
	var i	
	i=obj.id.indexOf('_');
	index=obj.id.substr(i+1);	
	obj.src=document.menuImagesOff[index].src;	
	if(currentPageImageID.indexOf('_')>0) {
		swapImage(document.getElementById(currentPageImageID));
	}
};
function swapImage(obj){
	var index;
	var i	
	i=obj.id.indexOf('_');
	index=obj.id.substr(i+1);	
	obj.src=document.menuImagesOn[index].src;
};

//-->


