//<![CDATA[
/* ## Requires betterJS & Prototype ## */
/* [## magicCSS 0.2 - Joshua Jarman ##] */
toggleHidden = function(id) { c = $(id); if (c.style.display == 'none') { c.style.display = ''; } else { c.style.display = 'none'; }; };
showThis = function(id) { c = $(id); c.style.display = ''; }
hideThis = function(id) { c = $(id); c.style.display = 'none'; }
/* slideshow of objects */
fadeSwap = function(id1, id2) { new Effect.Fade(id1, {duration: 5.0}); new Effect.Appear(id2, {duration: 5.0}); };
fadeThenShow = function(id1, id2, myduration, myscope) { myduration=myduration||5.0; myscope=myscope||'global'; new Effect.Fade(id1, {duration: myduration, queue: { position: 'end', scope: myscope } }); new Effect.Appear(id2, {duration: myduration, queue: { position: 'end', scope: myscope } }); };
justShow = function(id1, myduration, myscope) { myduration=myduration||5.0; myscope=myscope||'global'; new Effect.Appear(id1, {duration: myduration, queue: { position: 'end', scope: myscope } }); };
autoSlideshows = function() { $$('.slideshow').each(function(obj) { makeSlideshow(obj.id); }); }; addEvent(window,'load',autoSlideshows,false);
makeSlideshow = function(id) { if ($(id)) { var thisSlideshow = $(id); thisSlideshow.NumberOfSlides = thisSlideshow.childElements().length; thisSlideshow.Delay = thisSlideshow.getAttribute("delay"); thisSlideshow.Delay = thisSlideshow.Delay || 6; thisSlideshow.SlideOrder = thisSlideshow.getAttribute("slideorder"); thisSlideshow.SlideOrder = thisSlideshow.SlideOrder || 'random'; thisSlideshow.CurrentSlide = thisSlideshow.getAttribute("currentslide"); thisSlideshow.CurrentSlide = thisSlideshow.CurrentSlide || 1; thisSlideshow.Slides = new Array(); thisSlideshow.childElements().each(function(obj) { thisSlideshow.Slides.push(obj.id); }); thisSlideshow.setAttribute("numberofslides", thisSlideshow.NumberOfSlides); thisSlideshow.setAttribute("delay", thisSlideshow.Delay); thisSlideshow.setAttribute("slideorder", thisSlideshow.SlideOrder); thisSlideshow.setAttribute("currentslide", thisSlideshow.CurrentSlide); thisSlideshow.Slides.each(function(id) { $(id).style.display = 'none'; }); if (thisSlideshow.SlideOrder != 'linear') { thisSlideshow.Slides = thisSlideshow.Slides.shuffle(); }; $(''+thisSlideshow.Slides[thisSlideshow.CurrentSlide - 1]).style.display = ""; nextSlide(''+id); }; };
nextSlide = function(id) { if ($(id)) { var thisSlideshow = $(id); 	var currentSlide = ''+thisSlideshow.Slides[thisSlideshow.CurrentSlide - 1]; ++thisSlideshow.CurrentSlide; if (thisSlideshow.CurrentSlide > thisSlideshow.NumberOfSlides) { thisSlideshow.CurrentSlide = 1; }; thisSlideshow.setAttribute("currentslide", thisSlideshow.CurrentSlide); var newSlide = ''+thisSlideshow.Slides[thisSlideshow.CurrentSlide - 1]; fadeSwap(currentSlide, newSlide); setTimeout("nextSlide('"+id+"');", ""+thisSlideshow.getAttribute("delay")+"000"); }; };
//]]>
