var n=-1;
var i=0;
var imglist = new Array();
var txtlist = new Array();
var delaylist = new Array();
var timer;

n++; imglist[n] = new Image(); imglist[n].src = 'CyprusGolfVillas/accomodation2.jpg'; txtlist[n] = ""; delaylist[n] = "5";
n++; imglist[n] = new Image(); imglist[n].src = 'CyprusGolfVillas/accomodation3.jpg'; txtlist[n] = ""; delaylist[n] = "";
n++; imglist[n] = new Image(); imglist[n].src = 'CyprusGolfVillas/accomodation4.jpg'; txtlist[n] = ""; delaylist[n] = "";
n++; imglist[n] = new Image(); imglist[n].src = 'CyprusGolfVillas/accomodation5.jpg'; txtlist[n] = ""; delaylist[n] = "";
n++; imglist[n] = new Image(); imglist[n].src = 'CyprusGolfVillas/accomodation6.jpg'; txtlist[n] = ""; delaylist[n] = "";
n++; imglist[n] = new Image(); imglist[n].src = 'CyprusGolfVillas/accomodation7.jpg'; txtlist[n] = ""; delaylist[n] = "";
n++; imglist[n] = new Image(); imglist[n].src = 'CyprusGolfVillas/accomodation8.jpg'; txtlist[n] = ""; delaylist[n] = "";
n++; imglist[n] = new Image(); imglist[n].src = 'CyprusGolfVillas/accomodation9.jpg'; txtlist[n] = ""; delaylist[n] = "";
n++; imglist[n] = new Image(); imglist[n].src = 'CyprusGolfVillas/accomodation10.jpg'; txtlist[n] = ""; delaylist[n] = "";
n++; imglist[n] = new Image(); imglist[n].src = 'CyprusGolfVillas/accomodation11.jpg'; txtlist[n] = ""; delaylist[n] = "";
n++; imglist[n] = new Image(); imglist[n].src = 'CyprusGolfVillas/accomodation12.jpg'; txtlist[n] = ""; delaylist[n] = "";



if( delaylist[i] > 0 ) { delay = delaylist[i]; } else { delay = 5; }
timer = self.setTimeout("rotateimg(1)", delay*1000);


function rotateimg( x )
{
   i = i + x;
   if( i > n ) { i = 0; }
   if( i < 0 ) { i = n; }
   document.getElementById('pic').src = imglist[i].src;

   self.clearTimeout(timer);


   if( delaylist[i] > 0 ) { delay = delaylist[i]; } else { delay = 5; }
   timer = self.setTimeout("rotateimg(1)", delay*1000);

}