var img_sources = new Array(
	"../img/slideshow/prospective/1.jpg",
	"../img/slideshow/prospective/2.jpg",
	"../img/slideshow/prospective/3.jpg",
	"../img/slideshow/prospective/4.jpg",
	"../img/slideshow/prospective/5.jpg"
	);	
	
var img_text = new Array(
  	"Class size allows opportunity for individual attention",
	"Faculty available to answer questions regarding career choices",
	"Individualized attention by faculty when needed",
	"Instructors available during office hours to assist in student needs",
	"Instructors available during office hours to assist in student needs"
	);

var counter = 0;
var fadeValue = 0;
var fadeInInterval;
var fadeOutInterval;
var imgStopInterval;

function nextImg()
{
	if(counter == img_sources.length)
	  counter = 0;
	document.getElementById("slide").src = img_sources[counter];
	document.getElementById("slideText").innerHTML = img_text[counter];
	counter++;
	if (navigator.appName.indexOf("Microsoft")!= -1  && parseInt(navigator.appVersion)>=4)
      document.getElementById("slide").filters.alpha.opacity=0;
    else
    {
      document.getElementById("slide").style.MozOpacity=0.0;
    }
	fadeInInterval = setInterval("fadeIn(document.getElementById(\"slide\"))", 30);	
}

function prevImg()
{
	if(counter == 0)
		counter = img_sources.length - 1;
    counter--;
	document.getElementById("slide").src = img_sources[counter];
	document.getElementById("slideText").innerHTML = img_text[counter];
}

function fadeIn(img)
{
  if (navigator.appName.indexOf("Microsoft")!= -1  && parseInt(navigator.appVersion)>=4)
  {
    img.filters.alpha.opacity=fadeValue;
  }
  else
  {
    img.style.MozOpacity=fadeValue/100;    
  }
  fadeValue += 2;
  if(fadeValue == 100)
  {
     clearInterval(fadeInInterval);
     //fadeOutInterval = setInterval("fadeOut(document.getElementById(\"slide\"))", 30);
     imgStopInterval = setInterval("imgStop()", 2000);
  }
}

function fadeOut(img)
{
  if (navigator.appName.indexOf("Microsoft")!= -1  && parseInt(navigator.appVersion)>=4)
  {
    img.filters.alpha.opacity=fadeValue;
  }
  else
  { 
      img.style.MozOpacity=fadeValue/100;
  }
  fadeValue -= 2;
  if(fadeValue == 0)
  {
    clearInterval(fadeOutInterval);
    nextImg();
  }
}

function imgStop()
{
  clearInterval(imgStopInterval);
  fadeOutInterval = setInterval("fadeOut(document.getElementById(\"slide\"))", 30);
}


function playSlideShow() {
   nextImg();	
}