var timeDelay=5;
var howMany = 3;
timeDelay *= 1000;
var PicCurrentNum = 1;
function startPix() {
intervalId=setInterval("slideshow()", timeDelay);
}
function slideshow() {
$(".rotate").hide();
PicCurrentNum++;
if (PicCurrentNum > howMany) {
PicCurrentNum = 1;
}
$("#Rotate"+PicCurrentNum).show();
}


function change(n) {

clearInterval(intervalId);
intervalId=setInterval("slideshow()", timeDelay);


if(n==0)
{
  if(PicCurrentNum==1)
  {
  n=3;
  }
  else
  {
  n=PicCurrentNum-1;
  }
}
else if(n==4)
{
if(PicCurrentNum==3)
  {
  n=1;
  }
  else
  {
  n=PicCurrentNum+1;
  }
}

PicCurrentNum = n;
$(".rotate").hide();
$("#Rotate"+n).show();

}


$("#Rotate1").show();
startPix();
