//this changes the picture upon loading function ChangePict() { pictnum = 6; //this is the max # of pictures that will change randnum = Math.random(); num = randnum * pictnum; round = Math.floor(num); if (round == pictnum) {round = round - 1;} document.pict.src = "http://www.me.ucr.edu/images/spict" + round + ".jpg"; } //Display and Hide Sub Menus var isNav; var pre = ""; var post = ""; var posleft = ".left" var offset = 655; var layers_list = new Array("pro", "peo", "res", "fac", "pos", "sem"); ie4 = document.all; nn6 = document.getElementById && !document.all; _meDelay = 1000; _meTimeout = null; if (document.all) { isNav = false; pre="all."; post=".style"; posleft = ".pixelLeft" } else { pre = "document.getElementById('"; post = "')"; isNav = true; offset = 690; } function positionMenu() { var winwidth; if (isNav) { winwidth = window.innerWidth; } else { winwidth = document.body.clientWidth; } if (winwidth < offset) { winwidth = offset; } if(ie4) { eval ("document." + pre + "pro" + post + posleft + "=(((winwidth-" + offset + ")/2)-45)"); eval ("document." + pre + "peo" + post + posleft + "=(((winwidth-" + offset + ")/2)+55)"); eval ("document." + pre + "res" + post + posleft + "=(((winwidth-" + offset + ")/2)+130)"); eval ("document." + pre + "fac" + post + posleft + "=(((winwidth-" + offset + ")/2)+225)"); eval ("document." + pre + "pos" + post + posleft + "=(((winwidth-" + offset + ")/2)+323)"); eval ("document." + pre + "sem" + post + posleft + "=(((winwidth-" + offset + ")/2)+418)"); } else { document.getElementById('pro').style.left = (((winwidth-offset)/2)-45) + "px"; document.getElementById('peo').style.left = (((winwidth-offset)/2)+55) + "px"; document.getElementById('res').style.left = (((winwidth-offset)/2)+130) + "px"; document.getElementById('fac').style.left = (((winwidth-offset)/2)+225) + "px"; document.getElementById('pos').style.left = (((winwidth-offset)/2)+323) + "px"; document.getElementById('sem').style.left = (((winwidth-offset)/2)+418) + "px"; } } function clearTimeouts() { if(_meTimeout != null) { clearTimeout(_meTimeout); _meTimeout = null; } } function hideByTimeout() { if(_meTimeout == null) return; hideMenus(); _meTimeout = null; } function hideSoon() { _meTimeout = setTimeout('hideByTimeout()', _meDelay); } function showMenu(id) { clearTimeout(_meTimeout); _meTimeout = null; hideMenus(); if(ie4) { document.all[id].style.visibility = "visible"; } else if(nn6) { document.getElementById(id).style.visibility = "visible"; } } function hideMenu(id) { if(ie4) { document.all[id].style.visibility = "hidden"; } else if(nn6) { document.getElementById(id).style.visibility = "hidden"; } } function hideMenus() { for (var n=0;n<=(layers_list.length-1);n++) { hideMenu(layers_list[n]); } } document.onclick = hideMenus;