// JavaScript Document
	
	//<br /><a href='javascript: void(0)' onclick='window.open(/"self1.html/",/"self1/", /"width=454, height=279/"); return false;'>view animation >></a>
	//<br /><a href='javascript: void(0)' onclick='window.open('self2.html','self2', 'width=664, height=395'); return false;'>view animation >></a>
	//<br /><a href='javascript: void(0)' onclick='window.open('self3.html','self3', 'width=664, height=395'); return false;'>view animation >></a>
	
   //initial variables
 
	var imageDir = "images/slf/";
	
	//create array
	var imageNum = 0;
	imageArray = new Array();
	imageArray[imageNum++] = new imageItem(imageDir + "01.jpg");
	imageArray[imageNum++] = new imageItem(imageDir + "02.jpg");
	imageArray[imageNum++] = new imageItem(imageDir + "03.jpg");
	imageArray[imageNum++] = new imageItem(imageDir + "04.jpg");
	imageArray[imageNum++] = new imageItem(imageDir + "05.jpg");
	var totalImages = imageArray.length; 
	
	var captionNum = 0;
	captionArray = new Array();
	captionArray[captionNum++] = "Redesigned workout page for self.com<br /><a href='http://www.self.com/fitness/workouts/2009/08/antiaging-exercises-slideshow#slide=1' target='_blank' class='normalLink'>view the site >></a>";
	captionArray[captionNum++] = "Redesigned workout page for self.com<br /><a href='http://www.self.com/fitness/workouts/2009/08/antiaging-exercises-slideshow#slide=1' target='_blank' class='normalLink'>view the site >></a>";
	captionArray[captionNum++] = "Animated promo for self.som's redesign<br /><a href='self1.html' target='_blank' class='normalLink'>view animation >></a>";
	captionArray[captionNum++] = "Animation for Self Challenge 2007 landing page<br /><a href='self2.html' target='_blank' class='normalLink'>view animation >></a>";
	captionArray[captionNum++] = "Animation for Reach Your Goal 2006 landing page<br /><a href='self3.html' target='_blank' class='normalLink'>view animation >></a>";
	var totalCaptions = captionArray.length; 

	//get image location
	function imageItem(image_location) {
		this.image_item = new Image();
		this.image_item.src = image_location;
	}

	
	function get_ImageItemLocation(imageObj) {
		return(imageObj.image_item.src);
	}
	
	function updateCaption() {
	document.getElementById("caption").innerHTML = captionArray[captionNum];
	}
	

	
	//get next image
	function getNextImage() {
		imageNum = (imageNum+1) % totalImages;		
		var new_image = get_ImageItemLocation(imageArray[imageNum]);
		return(new_image);
		
		
		
		
	}
	
	function nextImage(place) {
		var new_image = getNextImage();
		document[place].src = new_image;
		captionNum = imageNum;
		updateCaption();
	}
	
	//get previous image
	function getPrevImage() {
		if (imageNum == 0) imageNum = totalImages;
		imageNum = (imageNum-1);
		var new_image = get_ImageItemLocation(imageArray[imageNum]);
		return(new_image);
		
		
	}
	
	function prevImage(place) {
		var new_image = getPrevImage();
		document[place].src = new_image;
		captionNum = imageNum;
		updateCaption();
	}

	





