/*
   Author: jgf
    Date:   10/06/09


Function List:
stringReverse
      Used to reverse the order of characters in a text string
showEm
	  makes clickable address  	
SlideShow 
	 operates the slide show from an array defined in the head section of the page
frontwards
	controls the direction of SlideShow
backwards
	controls the direction of SlideShow
TransSlide
	run the slide show with a gradient wipe transition, in the same direction as the Slide show is runing 
 LIn, LOut, RIn, ROut 
 	change arrow images when arrows are clicked.
*/
function stringReverse(textString) {
   if (!textString) return '';
   var revString='';
   for (i = textString.length-1; i>=0; i--)
       revString+=textString.charAt(i)
   return revString;
}
function showEm (userName, emServer){
	userName = stringReverse(userName);
	emServer = stringReverse(emServer); 
	var emLink = userName+ "@"+emServer;
	document.write("<a href = 'mailto:"+emLink+" '>");
	document.write(userName);
	document.write("</a>");
	}

function SlideShow(direction){
// direction is forward	
	if (direction == "forward"){
// check to see if at the end of the slide show, if so, set to begining, increase index otherwise			
	if (SlideNum == 02) {SlideNum = 0;}
      else	{SlideNum ++;}
		 }
// direction is reverse    
	if (direction == "reverse"){
// check to see if at the begining of the slide show, if so, set to end , decrease index otherwise		
	if (SlideNum == 0) {SlideNum = 02;}
      else	{SlideNum --;}
	  }
if (document.getElementById("Photo").filters) {
	TransSlide(direction)} 
else {
	document.images["Photo"].src=Slides[SlideNum].src;
// added the following code to figure out what was happening with the image direction 
	document.images["Photo"].alt = SlideNum+ " "+ direction;  
	}
	}	
function frontwards(){
direction= "forward";
SlideShow(direction);
}
function backwards(){
direction = "reverse";
SlideShow(direction);
}	
function TransSlide(){
//run the slide show with a gradient wipe transition, in the same direction as the Slide show is runing 
document.images["Photo"].filters[0].motion = direction;
document.images["Photo"].filters[0].apply();
document.images["Photo"].src = Slides[SlideNum].src;
document.images["Photo"].filters[0].play(2); 
// added the following code to figure out what was happening with the image direction 
document.images["Photo"].alt = SlideNum+ " "+ direction; 
}
// functions LIn, LOut, RIn, ROut change arrow images when arrows are clicked. 
	function LIn(){
		if (document.images){
		document.getElementById("LeftArrow").src=LDown.src;}
		}
	function LOut(){
	if (document.images){
		document.getElementById("LeftArrow").src=LUp.src;}	
		}
	function RIn(){
		if (document.images){
		document.getElementById("RightArrow").src=RDown.src;}
		}
	function ROut(){
	if (document.images){
		document.getElementById("RightArrow").src=RUp.src;}	
		}

