
var curimg=1;
var op=0;
var tim=0;

function shownext()
{ 
  clearInterval(tim);
  op=0;
  document.getElementById('photo').src="photos/home"+curimg+".jpg";
  document.getElementById('photo').style.MozOpacity=0; //1
  document.getElementById('photo').style.opacity=0; //1
  curimg++;
  if(curimg>=6)
	{
    curimg=1;
  }
  document.getElementById('photo').src="photos/home"+curimg+".jpg";
  tim=setInterval("changeOpacity()",10);
  slide();
}

function showprev()
{
  clearInterval(tim);
  op=0;
  document.getElementById('photo').src="images/photo"+curimg+".jpg";
  document.getElementById('photo').style.MozOpacity=0; //1
  document.getElementById('photo').style.opacity=0; //1
  curimg--;
  if(curimg<=0)
	{
    curimg=4;
  }
  document.getElementById('photo').src="photos/home"+curimg+".jpg";
  tim=setInterval("changeOpacity()",10);
  slide();
}

function changeOpacity()
{
  op++;
  if(op>100)
  {
    clearInterval(tim);
	op=0;
  }
  else
	{
		document.getElementById('photo').style.MozOpacity=op/10;
		document.getElementById('photo').style.opacity=op/10;
	}
}

var tid=0;
var ttext=0;
var textcount=0;

function slide()
{
  clearInterval(ttext);
  clearInterval(tid);
  ttext=setInterval("changetext()",4000);
  tid=setInterval("shownext()",5000);
}

function onlytext()
{
  clearInterval(ttext);
  clearInterval(tid);
  ttext=setInterval("changetext()",4000);
}

function changetext()
{
  textcount++;
  if(textcount>=5)
	{
    textcount=0;
  }
  document.getElementById('testimonial').innerHTML=text[textcount];
//  document.getElementById('testimonialperson').innerHTML=person[textcount];
}
