var dovideo = false; //var dovideo = false; /** note this puts roll over on image, not href **/ function initRollovers() { //if we don't support getElementById then exit if (!document.getElementById) return //yes it even does preload var aPreLoad = new Array(); var aImages = new Array(); var sTempSrc; //grab all nav images //if(document.getElementById("dl-c-container")) { //var aImages = document.getElementById("dl-c-container").getElementsByTagName("img"); //} //nb if you want all images on page you do this instead (i only wanted nav) var aImages = document.getElementsByTagName("img"); //loop over images for (var i = 0; i < aImages.length; i++) { //we use class name to find image if (aImages[i].className.match('nav-roll')) { //grab src var src = aImages%5bi%5d.html //grab extension (neato works for gif and jpg nd png if you so feel) var ftype = src.substring(src.lastIndexOf('.'), src.length); //create a new attribute for rollover (for fyi = '-over') var hsrc = src.replace("_off"+ftype, '_over'+ftype); aImages[i].setAttribute('hsrc', hsrc); //PRELOAD !! aPreLoad[i] = new Image(); aPreLoad[i].src = hsrc; //on mouseover grab hsrc aImages[i].onmouseover = function() { sTempSrc = this.getAttribute('src'); this.setAttribute('src', this.getAttribute('hsrc')); } //on mouse out strip out "on" aImages[i].onmouseout = function() { //alert(sTempSrc); if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_over'+ftype, ftype); this.setAttribute('src', sTempSrc); } } else if (aImages[i].className.match('logo-roll')) { //grab src var src = aImages%5bi%5d.html //grab extension (neato works for gif and jpg nd png if you so feel) var ftype = src.substring(src.lastIndexOf('.'), src.length); //create a new attribute for rollover (for fyi = '-over') var hsrc = src.replace("_off"+ftype, '_over'+ftype); aImages[i].setAttribute('hsrc', hsrc); //PRELOAD !! aPreLoad[i] = new Image(); aPreLoad[i].src = hsrc; //on mouseover grab hsrc aImages[i].onmouseover = function() { sTempSrc = this.getAttribute('src'); this.setAttribute('src', this.getAttribute('hsrc')); } //on mouse out strip out "on" aImages[i].onmouseout = function() { //alert(sTempSrc); if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_over'+ftype, ftype); this.setAttribute('src', sTempSrc); } } } } function show_fact(whichDiv, thishref) { if (document.getElementById) { thishref.innerHTML = "Hide Fact"; thishref.onclick = function() { hide_fact(whichDiv, this); } show_div(whichDiv); } return false; } function hide_fact(whichDiv, thishref) { if (document.getElementById) { thishref.innerHTML = "Reveal Fact"; thishref.onclick = function() { show_fact(whichDiv, this); } hide_div(whichDiv); } return false; } function show(whichDiv, thishref) { if (document.getElementById) { thishref.innerHTML = "Hide Answer"; thishref.onclick = function() { return hide(whichDiv, this); } show_div(whichDiv); } return false; } function hide(whichDiv, thishref) { if (document.getElementById) { thishref.innerHTML = "Show Answer"; thishref.onclick = function() { return show(whichDiv, this); } hide_div(whichDiv); } return false; } function show_div(whichDiv) { if (document.getElementById) { document.getElementById(whichDiv).style.display = 'block'; } return false; } function hide_div(whichDiv) { if (document.getElementById) { document.getElementById(whichDiv).style.display = 'none'; } return false; } function sidebar(thislink) { window.open(thislink.href, 'horiz', 'width=405,height=470,toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1'); return false; } /** puts pop ups on hrefs that need **/ function initPopUps() { //if we don't support getElementById then exit if (!document.getElementById) return; //grab all hrefs from body var aHref = document.getElementsByTagName("a"); var nnn = ""; //loop over Hrefs for (var i = 0; i < aHref.length; i++) { //nnn += aHref[i].className + "\n"; if (aHref[i].className.match('nolink')) { //horizontal image pop up aHref[i].setAttribute('title', "launch in new window"); //on mouseover grab hsrc aHref[i].onclick = function() { window.open("pop_notdone.html", 'notdone', 'width=421,height=166,toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=1'); return false; } } } //alert(nnn); } function initPage() { //change home image if(document.getElementById('rnd-img')) { var r_img = document.getElementById('rnd-img'); var ranNum= Math.round(Math.random()*11); if(ranNum < 10) ranNum = '0'+ranNum; //alert(ranNum); r_img.setAttribute('src', 'i/home/circle_' + ranNum + '.gif'); } initRollovers(); initPopUps(); if(dovideo) { initVideo(); } } function init() { // quit if this function has already been called if (arguments.callee.done) return; // flag this function so we don't do the same thing twice arguments.callee.done = true; // create the "page loaded" message //var text = document.createTextNode("Page loaded!"); //var message = document.getElementById("message"); //message.appendChild(text); initPage(); }; /* for Mozilla */ if (document.addEventListener) { document.addEventListener("DOMContentLoaded", init, null); } /* for Internet Explorer */ /*@cc_on @*/ /*@if (@_win32) document.write("