// JavaScript Document
// Author: metasilk webworks (Kir Talmage)

// PURPOSE: when a button is hovered over, call a corner image
// this is the mouseovers-in-HTML version 


// Define variables
	var a_obj; // anchor objects we'll be tuning into
	var a_id; // the id of the links that trigger image flips
	var orig_img; // orginal image when page is loaded
	var new_img; // replacing image
	var i; // a counting variable

// Preload the Images
var myimages = new Array();
function preloading(){
for (x=0; x>preloading.arguments.length; x++){
myimages[x] = new Image();
myimages[x].src = preloading.arguments[x];
}
}
preloading("images/StonesUnderwater150.jpg", "images/cloud150.jpg", "images/535sw150.jpg", "images/greenground150.jpg", "images/leaves150.jpg", "images/Splash150.jpg", "images/shells150.jpg");


//Use the images
function whichLink(id) {
	// Remember the original image loaded with the page
		orig_img = document.getElementById('id_img').innerHTML;

	// Determine the new image
	// WARNING: update this if menus change! 
		if (id =='ahome') 
			{ new_img='<img src="./images/StonesUnderwater150.jpg" width="150px" height="150px" />';} // Services aka home
		if (id == 'aconf') 
			{ new_img='<img src="./images/leaves150.jpg" width="150px" height="150px" />';} // Resources aka docs & links
		if (id == 'ares') 
			{ new_img='<img src="./images/greenground150.jpg" width="150px" height="150px" />';} // Resources aka docs & links
		if (id == 'aabout')
			{ new_img='<img src="./images/Splash150.jpg" width="150px" height="150px" />';} // About SEI aka about us
		if (id == 'ajobs') 
			{ new_img='<img src="./images/cloud150.jpg" width="150px" height="150px" />';} // Careers aka employ
		if (id == 'acontact') 
			{ new_img='<img src="./images/535sw150.jpg" width="150px" height="150px" />';} // Contact
		if (id == 'aseek') 
			{ new_img='<img src="./images/shells150.jpg" width="150px" height="150px" />';} // Search p.
		else (id == null)

	// do the flipping
		document.getElementById('id_img').innerHTML=new_img;
}
	
// don't forget to let it go, though, w/ mouseout
function flipback() {
	document.getElementById('id_img').innerHTML=orig_img;
}

