// // (c) Jupiter Design 2005 // // By Rob Ingram // 20050601 // Array to hold opacity values var steps = new Array(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.99); var offsets = new Array(); offsets[0] = new Array('0px','5px'); offsets[1] = new Array('138px','5px'); offsets[2] = new Array('0px','143px'); offsets[3] = new Array('138px','143px'); function setTimer() { // Make sure text box is opaque when refreshed // For IE if(document.getElementById('quoteBox').filters) { // But not Mac IE if(window.print) document.getElementById('quoteBox').filters.alpha.opacity = 0; } // For others else document.getElementById('quoteBox').style.opacity = 0; // Random array index for image and text selection var arrIndex = Math.floor(Math.random() * homeImages.length); // Set a time for the fade function var the_timeout = setTimeout("showIt(0)", 3000); // Set the images and text document.getElementById('windowImg').src = homeImages[arrIndex]; document.getElementById('quoteBox').innerHTML = '

“' + homeCaptions[arrIndex] + '”

'; document.getElementById('quoteBox').style.left = offsets[homeQuadrants[arrIndex]-1][0]; document.getElementById('quoteBox').style.top = offsets[homeQuadrants[arrIndex]-1][1]; document.getElementById('quoteBox').style.background = homeColours[arrIndex]; } function showIt(index) { var the_timeout; // If the panel is not fully opaque set the opacity to the value from the given array index if(steps[index] <= 1) { // For IE if(document.getElementById('quoteBox').filters) { // But not Mac IE if(window.print) document.getElementById('quoteBox').filters.alpha.opacity = steps[index]*100; }// For others else document.getElementById('quoteBox').style.opacity = steps[index]; // Increment the array index and set a new timer for this function index += 1; the_timeout = setTimeout("showIt("+index+")", 50); } } safeAddOnload(setTimer);