
// preload level 1 buttons
var aBtn = new Array();
aBtn = ["about","people","programs","news","research","contact","apply"];
for (i = 0; i < aBtn.length; i++) {
  eval("menu" + i + "on = new Image();");	eval("menu" + i + "off = new Image();");
  eval("menu" + (i) + "on.src = \"" + folderDepth + "img/l1_" + aBtn[i] + "_r.gif\";");
  eval("menu" + (i) + "off.src = \"" + folderDepth + "img/l1_" + aBtn[i] + "_0.gif\";");
}


// Home page images
img1on = new Image(); img1on.src = "img/hmpg_learn_more_r.gif"; img1off = new Image(); img1off.src = "img/hmpg_learn_more_0.gif";
arrow1on = new Image(); arrow1on.src = "img/hmpg_arrow_r.gif"; arrow1off = new Image(); arrow1off.src = "img/hmpg_arrow_0.gif";
arrow2on = new Image(); arrow2on.src = "img/hmpg_arrow_r.gif"; arrow2off = new Image(); arrow2off.src = "img/hmpg_arrow_0.gif";


// preload level 2 nub
for (i=0;i<10;i++) {
	eval("C"+i+"on = new Image();"); eval("C"+i+"off = new Image();");
	eval("C"+(i)+"on.src = \""+folderDepth+"img/l2_arrow_r.gif\";");
	eval("C"+(i)+"off.src = \""+folderDepth+"img/btns/l2_arrow_r.gif\";");
}

function imgOn(imgName) {
  document[imgName].src = eval(imgName + "on.src")
}

function imgOff(imgName) {
  document[imgName].src = eval(imgName + "off.src")
}

// image-swapping function
function changeImages() {
  if (document.images) {
    for (var i=0; i<changeImages.arguments.length; i+=2) { 
  		document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src"); 
	}
  }
}

function goToURL(form) {
    var myindex=form.dropdownmenu.selectedIndex
    if(!myindex=="")
    {
    window.location.href=form.dropdownmenu.options[myindex].value;
  }
}

// Product Overview DIV Swapping

function grabElement(ID) {
	// set up element reference for NS4, DOM-compliant and IE4 respectively
	if (document.layers) {
		thisElement = document.layers[ID];
		//alert(thisElement);
	}
	if (document.getElementById) {
		thisElement = document.getElementById(ID).style;
	}
	if (document.all && !document.getElementById) {
		thisElement = document.all(ID).style;
	}
	
	return thisElement;
}



function noClick() {
	// does nothing
	}
	

function openWindow(url, name)
{
myWin = window.open("","pop", "left=0,width=500,height=500,status=no,toolbar=no,menubar=no,scrollbars=yes");
}

function closeIt(){
if (!myWin.closed)
myWin.self.close()
}

function makenew() {
	window.open("http://www.ece.unh.edu/flash/flash.html","blank","toolbar=no,width=550,height=400")
}

