function change_text(id, text) { var space = document.getElementById(id); space.innerHTML = text; } function initImage(step) { if (visible_index == photo_array.length) { visible_index = 0; } else if (visible_index < 0) { visible_index= photo_array.length - 1; } var tmp = image_array[visible_index]; if (! tmp.complete) { alert ('chill -- the image is loading'); } imageId = 'thephoto'; image = document.getElementById(imageId); image.style.visibility = 'visible'; image.src = photo_array[visible_index]; if (tmp.width > 450) { image.width = 450; document.getElementById('zoom_control').style.visibility = 'visible'; } else { image.width = tmp.width; document.getElementById('zoom_control').style.visibility = 'hidden'; } fadeIn(imageId,0); change_text("photo_headline", headline_array[visible_index]); change_text("photo_caption", caption_array[visible_index]); } function setOpacity(obj, opacity) { opacity = (opacity == 100)?99.999:opacity; // IE/Win obj.style.filter = "alpha(opacity:"+opacity+")"; // Safari<1.2, Konqueror obj.style.KHTMLOpacity = opacity/100; // Older Mozilla and Firefox obj.style.MozOpacity = opacity/100; // Safari 1.2, newer Firefox and Mozilla, CSS3 obj.style.opacity = opacity/100; } function fadeIn(objId,opacity) { if (document.getElementById) { obj = document.getElementById(objId); if (opacity <= 100) { setOpacity(obj, opacity); opacity += 10; window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100); } } } function zoom(index) { if (zoom_window) { zoom_window.close(); } var tmp = image_array[visible_index]; zoom_window = window.open(tmp.src,'moosefish_photo',"width=" + tmp.width + ",height=" + tmp.height + ",innerwidth=" + tmp.width + ",innerheight=" + tmp.height + ",location=no,resizable=yes,status=no,menubar=no,scrollbars=no,toolbar=no"); }