var i = 0;					// declare variable
var imgs = new Array(17); 	// declare an array of 17 elements

// initialize an array of 17 image objects

for(i = 0; i < imgs.length; i++){

imgs[i] = new Image();

}

// initialize each array image object to an image

imgs[0].src = "images/img_1.jpg";
imgs[1].src = "images/about_on.jpg";
imgs[2].src = "images/news_on.jpg";
imgs[3].src = "images/fands_on.jpg";
imgs[4].src = "images/faculty_on.jpg";
imgs[5].src = "images/research_on.jpg";
imgs[6].src = "images/members_on.jpg";
imgs[7].src = "images/contact_on.jpg";
imgs[8].src = "images/sitemap_on.jpg";

imgs[9].src = "images/about_off.jpg";
imgs[10].src = "images/news_off.jpg";
imgs[11].src = "images/fands_off.jpg";
imgs[12].src = "images/faculty_off.jpg";
imgs[13].src = "images/research_off.jpg";
imgs[14].src = "images/members_off.jpg";
imgs[15].src = "images/contact_off.jpg";
imgs[16].src = "images/sitemap_off.jpg";

// set the image index to the imgObj

function swapOn(imgObj, index){

	imgObj.src = imgs[index].src;

}

// set the image index to the imgObj

function swapOff(imgObj, index){

	imgObj.src = imgs[index].src;

}

/**

	This function expands or makes visible the DIV element
	
	First it tests if it is visible, if it is not than retrieves a reference to the DIV element
	in question and sets the style properties of visibility and display visible and block.
	
	otherwise. . .
	
	if the test fails, than the elements are set to be hidden by using their style properties of
	visibility and display


*/

function expandSelection(obj){

	var elem = null;
	
	elem = getObject(obj);

	if(elem.style.visibility == '' || elem.style.visibility == "hidden"){
	
	elem.style.visibility = "visible";
	elem.style.display = "block";
	
	} else {
	
	elem.style.visibility = "hidden";
	elem.style.display = "none";
	
	}
	
	return ;
		
}

/**

	This tests what type of browser the client is using
	
	If document.getElementById evaluates to true, than we know we have a browser that 
	implements the DOM and we can use the document.getElementById method to retrieve
	a reference to the DIV element
	
	otherwise. . . .

	If document.all evaluates to true, than we know we have a browser that does not
	implements the DOM and we can use the document.all[objname] property to retrieve
	a reference to the DIV element, this is normally because of IE not implementing
	the DOM standard


*/

function getObject(obj){

	if(document.getElementById){	// if true, browser implements DOM standard
	
	return document.getElementById(obj);
	
	} else if(document.all){ // if true, browser does not implement DOM standard
	
	return document.all[obj];
	
	}
	
	return null;

}
