var openContainer = null;
var hideMenuTimer = null;


pic1= new Image(75,36); 
pic1.src="img/aboutUsBLUE.jpg";

pic2= new Image(75,36); 
pic2.src="img/aboutUs.jpg";

pic3= new Image(88,36); 
pic3.src="img/academicsBLUE.jpg";

pic4= new Image(75,36); 
pic4.src="img/academics.jpg";

pic5= new Image(91,36); 
pic5.src="img/admissionsBLUE.jpg";

pic6= new Image(91,36); 
pic6.src="img/admissions.jpg";

pic7= new Image(93,36); 
pic7.src="img/montessoriBLUE.jpg";

pic8= new Image(93,36); 
pic8.src="img/montessori.jpg";

pic9= new Image(97,36); 
pic9.src="img/elementaryBLUE.jpg";

pic10= new Image(97,36); 
pic10.src="img/elementary.jpg";

pic11= new Image(104,36); 
pic11.src="img/highSchoolBLUE.jpg";

pic12= new Image(104,36); 
pic12.src="img/highSchool.jpg";

pic13= new Image(79,36); 
pic13.src="img/givingBLUE.jpg";

pic14= new Image(79,36); 
pic14.src="img/giving.jpg";

pic15= new Image(70,36); 
pic15.src="img/alumniBLUE.jpg";

pic16= new Image(70,36); 
pic16.src="img/alumni.jpg";

pic17= new Image(69,36); 
pic17.src="img/parentsBLUE.jpg";

pic18= new Image(69,36); 
pic18.src="img/parents.jpg";

pic19= new Image(68,36); 
pic19.src="img/giftBLUE.jpg";

pic20= new Image(68,36); 
pic20.src="img/gift.jpg";


function allowClose(id, src) {
	hideTimeout = 1000;
	hideMenuTimer = setTimeout('hideMenus(\'' + id + '\', \'' + src + '\')', hideTimeout);
}

function hideMenus(id, src) {
	stayOpen();
	restoreImages();
	if(openContainer) {
		var c = document.getElementById(openContainer);
		c.style.visibility = "hidden";
		openContainer = null;
	}

}

function stayOpen() {
	if (hideMenuTimer) clearTimeout(hideMenuTimer);
	hideMenuTimer = null;
}

function elem(id) {
	return document.getElementById(id);
}

function restoreImages() {
	changeImage('aboutUsG', 'aboutUs.jpg');
	changeImage('academicsG', 'academics.jpg');
	changeImage('admissionsG', 'admissions.jpg');
	changeImage('montessoriG', 'montessori.jpg');
	changeImage('elementaryG', 'elementary.jpg');
	changeImage('highSchoolG', 'highSchool.jpg');
	changeImage('alumniG', 'alumni.jpg');
	changeImage('givingG', 'giving.jpg');
	changeImage('parentsG', 'parents.jpg');
	changeImage('giftG', 'gift.jpg');
}

function openDrop(containName, id, src) {
	hideMenus(id, src);
	stayOpen();
	changeImage(id, src);

         var c = document.getElementById(containName);
         if(c) {
		c.style.visibility = "visible";
		openContainer = "" + containName;
	}
}

function changeImage(id, src) {
	var a = document.getElementById(id);
	a.src='img/' + src;
}
