/* :::::::::::::::::::: Photo Gallery :::::::::::::::::::: */ var CurrentPhoto = 0; //======================================================== //Define the gallery // The passed ID is the ID of the DIV that holds the gallery //======================================================== function set_gallery(ID) { document.body.insertAdjacentHTML('beforeend', "
"); GalleryElements = document.getElementById(ID).getElementsByTagName("a"); //Collection of all A tags within the ID GalleryLinks = new Array(); GalleryName = new Array(); GalleryWords = new Array(); for(i = 0; i < GalleryElements.length; i++) { if( GalleryElements[i].href ) //Must have an HREF in its link, otherwise an image isn't actually linked { URL = GalleryElements[i].href.replace("javascript:open_gallery('","").replace("');",""); GalleryLinks[i] = URL; document.getElementById("preload_image").innerHTML += ""; gTEXT = GalleryElements[i].innerHTML.replace(/STRONG/g,"strong").replace(/BR/g,"br"); GalleryName[i] = gTEXT.slice(gTEXT.indexOf("\">")+2); } } } //@OPEN //======================================================== function open_gallery(imgURL) { document.getElementById("popup_pic").src = imgURL; document.getElementById("photo").style.display = ""; //Make the invisible table visible for(i=0; i= GalleryLinks.length) CurrentPhoto = 0; for(i=0; i<=10; i++) { setTimeout("document.getElementById('popup_pic').style.opacity='" + (10-i)/10 + "';", i*30); setTimeout("document.getElementById('popup_pic').style.filter='Alpha(opacity=" + (10-i)*10 + ")';", i*30); } setTimeout("document.getElementById('popup_pic').src='" + GalleryLinks[CurrentPhoto] + "';", 10*30); document.getElementById('pic_name').innerHTML = GalleryName[CurrentPhoto]; for(i=0; i<=10; i++) { setTimeout("document.getElementById('popup_pic').style.opacity='" + (i/10) + "';", i*30 + 10*30); setTimeout("document.getElementById('popup_pic').style.filter='Alpha(opacity=" + (i*10) + ")';", i*30 + 10*30); } } //PREV //============================================ function photo_prev() { CurrentPhoto --; if (CurrentPhoto < 0) CurrentPhoto = GalleryLinks.length-1; for(i=0; i<=10; i++) { setTimeout("document.getElementById('popup_pic').style.opacity='" + (10-i)/10 + "';", i*30); setTimeout("document.getElementById('popup_pic').style.filter='Alpha(opacity=" + (10-i)*10 + ")';", i*30); } setTimeout("document.getElementById('popup_pic').src='" + GalleryLinks[CurrentPhoto] + "';", 10*30); document.getElementById('pic_name').innerHTML = GalleryName[CurrentPhoto]; for(i=0; i<=10; i++) { setTimeout("document.getElementById('popup_pic').style.opacity='" + (i/10) + "';", i*30 + 10*30); setTimeout("document.getElementById('popup_pic').style.filter='Alpha(opacity=" + (i*10) + ")';", i*30 + 10*30); } } //@CLOSE //======================================================== function close_gallery() { for(i=0; i<=10; i++) { setTimeout("document.getElementById('photo').style.opacity='" + (10-i)/10 + "';", i*30); setTimeout("document.getElementById('photo').style.filter='Alpha(opacity=" + (10-i)*10 + ")';", i*30); } setTimeout("document.getElementById('photo').style.display='none';", 10*30); document.getElementById("bu_next").style.zIndex = "5000"; document.getElementById("bu_prev").style.zIndex = "5000"; document.getElementById("popup_pic").style.zIndex = "1"; }