// JavaScript Document
// by: csseyah

//Pictures to switch in About page

var Rollpic1 = "images/about-1.png";
var Rollpic2 = "images/about-2.png";
var Rollpic3 = "images/about-3.png";

//Start at the what pic:
var PicNum=1;
//Number of pics:
var NumberPictures=3;
//Time between pics switching in secs
var HowLongBetweenPic=5;

//SwitchPic Function
function SwitchPic(counter){

 if(counter < HowLongBetweenPic){
 
  counter++;
  
  //DEBUG in the status bar at the bottom of the screen
  window.status="About Two Seasons Villas Hot Spring Resort: "+counter+" PicNumber: "+PicNum+" ";
  
 
 //Display pic in what <IMG> tag roll is what I called the image
  document.rolla.src = eval("Rollpic"+PicNum);
  
  //function calls itself
  CallSwitchPic=window.setTimeout("SwitchPic("+counter+")",1500); 
  
  }
  
  else{
   //if its not the last picture goto the next picture
   if(PicNum < NumberPictures){
    PicNum++;
    SwitchPic(0);
   }
   //its the last picture go to the first one
   else{
    PicNum=1;
    SwitchPic(0);
    }
 
  }

}

//Pictures to switch in Rooms page

var Roll1 = "images/room-1.png";
var Roll2 = "images/room-2.png";
var Roll3 = "images/room-3.png";
var Roll4 = "images/room-us.png";

//Start at the what pic:
var PicNumber=1;
//Number of pics:
var NumberPictures=4;
//Time between pics switching in secs
var HowLongBetweenPic=4;

//SwitchPic Function
function SwitchRoo(counter){

 if(counter < HowLongBetweenPic){
 
  counter++;
  
  //DEBUG in the status bar at the bottom of the screen
  window.status="Room at Two Seasons Villas Hot Spring Resort: "+counter+" PicNumber: "+PicNumber+" ";
  
 
 //Display pic in what <IMG> tag roll is what I called the image
  document.roll.src = eval("Roll" + PicNumber);
  
  //function calls itself
  CallSwitchPic=window.setTimeout("SwitchRoo("+counter+")",1500); 
  
  }
  
  else{
   //if its not the last picture goto the next picture
   if(PicNumber < NumberPictures){
    PicNumber++;
    SwitchRoo(0);
   }
   //its the last picture go to the first one
   else{
    PicNumber=1;
    SwitchRoo(0);
    }
 
  }

}
//Pictures to switch in Ameneties page

var Rolls1 = "images/amenities-1.png";
var Rolls2 = "images/amenities-2.png";

//Start at the what pic:
var PicNumber=1;
//Number of pics:
var NumberPictures=2;
//Time between pics switching in secs
var HowLongBetweenPic=4;

//SwitchPic Function
function SwitchAmm(counter){

 if(counter < HowLongBetweenPic){
 
  counter++;
  
  //DEBUG in the status bar at the bottom of the screen
  window.status="Amenities at Two Seasons Villas Hot Spring Resort: "+counter+" PicNumber: "+PicNumber+" ";
  
 
 //Display pic in what <IMG> tag roll is what I called the image
  document.rolls.src = eval("Rolls" + PicNumber);
  
  //function calls itself
  CallSwitchPic=window.setTimeout("SwitchAmm("+counter+")",1500); 
  
  }
  
  else{
   //if its not the last picture goto the next picture
   if(PicNumber < NumberPictures){
    PicNumber++;
    SwitchAmm(0);
   }
   //its the last picture go to the first one
   else{
    PicNumber=1;
    SwitchAmm(0);
    }
 
  }

}