// JavaScript Document

function obfuscate(domain, name) {
	if(domain == "") { // if you leave the domain blank
		domain = "csuchico.edu"; // the script assumes csuchico.edu
	}
	window.location.href=('mailto:' + name + '@' + domain.replace(/%%%/g,".")); // write out email address
}





function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;


startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("leftnav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;

function selectImage() {
	var randNum = Math.round(Math.random()*11)+1
	document.write("<img src='/nfsc/images/homePhoto" + randNum + ".jpg' alt='Nutrition and Food Sciences Program' name='photo' width='269' height='291' />")
	//alert(randNum)
}

function selectInteriorImage() {
	var randNum = Math.round(Math.random()*11)+1
	document.write("<img src='/nfsc/images/intPhoto" + randNum + ".gif' alt='Nutrition and Food Sciences Program' name='photo' width='175' height='158' align='top' />")
	//alert(randNum)
}