// slide handler var curSlide; function initSlides (num) { //alert(num); curSlide = num; showCurrentSlide(); } function showCurrentSlide () { hideSlide( document.getElementById( slides[0] ) ); var sl = document.getElementById( slides[curSlide] ); if (!sl) { alert("Slide not found at index: " + curSlide); return; } showSlide(sl); } function hideCurrentSlide () { var sl = document.getElementById( slides[curSlide] ); if (!sl) { alert("Slide not found at index: " + curSlide); return; } hideSlide(sl); } function showNext () { if (curSlide == slides.length - 1) return; hideCurrentSlide(); curSlide++; showCurrentSlide(); } function showPrev () { if (curSlide == 0) return; hideCurrentSlide(); curSlide--; showCurrentSlide(); } function jumpTo (pos) { pos += 1; if (pos <= 0 || pos > slides.length) return; hideCurrentSlide(); curSlide = pos - 1; showCurrentSlide(); } function showSlide (sl) { sl.setAttribute( 'style', 'display:block' ); } function hideSlide (sl) { sl.setAttribute( 'style', 'display:none' ); } function showMap () { document.getElementById('map').setAttributeNS( null, 'display', 'block' ); }