preload("images/scroller_pic_1.jpg");
preload("images/guy.jpg");
preload("images/couple.jpg");

(function()
{
	var node = document.getElementById("slideshow");
	var image = node;
	var title = node.getElementsByTagName("h3")[0];
	var byline = getElementsBy(node, "className", "byline", true)[0];
	var text = node.getElementsByTagName("p")[0];
	var link = node.getElementsByTagName("a")[0];
	var imgs = node.getElementsByTagName("img");
	var slide = new Slide(node, title, byline, text, link);
	var show = new SlideShow(slide);

	show.interval = 8000;

	for (var i = 0; i < imgs.length; ++i)
		if (imgs[i].className == "last")
			show.play = imgs[i];
		else
			show.buttons.add(imgs[i]);

	show.items.add(new Slide("", "<a href='what-is-depression.html'>Understanding Depression</a>", "", "<a href='what-is-depression.html'>Approximately 15 million American adults suffer from depression every year.</a>", "what-is-depression.html"));
	show.items.add(new Slide("", "<a href='symptoms-of-depression.html'>Symptoms of Depression</a>", "", "<a href='symptoms-of-depression.html'>Because no two people are exactly alike, it makes sense that different people may experience the symptoms of depression in different ways. For one person, fatigue may occur, while another person may become agitated or restless.</a>", "symptoms-of-depression.html"));
	show.items.add(new Slide("", "<a href='talking-to-your-doctor.html'>Talk to Your Doctor</a>", "", "<a href='talking-to-your-doctor.html'>Initiating a conversation with your doctor about depression or anxiety is not always the easiest thing to do. If you prepare ahead of time and know what you would like to discuss, you have a better chance of having your questions answered and your condition properly diagnosed.</a>", "talking-to-your-doctor.html"));

	show.start();
})();