var SlideShowSpeed = 6000;
var CrossFadeDuration = 3;
var Picture = new Array(); // don't change this
var Caption = new Array(); // don't change this
var PicLink = new Array(); // don't change this

Picture[1]='/images/mainphoto/APH.jpg';
Picture[2]='/images/mainphoto/ath.jpg';
Picture[3]='/images/mainphoto/BVH.jpg';
Picture[4]='/images/mainphoto/sjh.jpg';
Picture[5]='/images/mainphoto/cbr-pool.jpg';
Picture[6]='/images/mainphoto/ecr-ex.jpg';
Picture[7]='/images/mainphoto/nph.jpg';
Picture[8]='/images/mainphoto/nvs.jpg';
Picture[9]='/images/mainphoto/orr.jpg';
Picture[10]='/images/mainphoto/prr-pool.jpg';
Picture[11]='/images/mainphoto/RCH.jpg';
Picture[12]='/images/mainphoto/vgr-night.jpg';
Picture[13]='/images/mainphoto/wgh.jpg';

Caption[1]  = "Amari Don Muang Airport Hotel, Bangkok";
Caption[2]  = "Amari Atrium Hotel, Bangkok";
Caption[3]  = "Amari Boulevard Hotel, Bangkok";
Caption[4]  = "St. James Hotel, Bangkok";
Caption[5]  = "Amari Coral Beach Resort, Phuket";
Caption[6]  = "Amari Emerald Cove Resort, Koh Chang";
Caption[7]  = "Nova Platinum Hotel, Pattaya";
Caption[8]  = "Amari Nova Suites, Pattaya";
Caption[9]  = "Amari Orchid Resort &amp; Tower, Pattaya";
Caption[10]  = "Amari Palm Reef Resort, Koh Samui";
Caption[11]  = "Amari Rincome Hotel, Chiang Mai";
Caption[12]  = "Amari Vogue Resort, Krabi"; 
Caption[13]  = "Amari Watergate Hotel, Bangkok"; 

// =====================================
// Do not edit anything below this line!
// =====================================

var tss;
var iss;
var jss = Math.floor(Math.random()*15); //Start random 'noom add for random - var randomnumber=Math.floor(Math.random()*22) ;
if(jss>7) jss=8;
var pss = Picture.length-1;
var jmax = jss + 6 //Noom add for max 7
var jmin = jss	   //Add for min 1

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];
}

function runSlideShow(){
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[jss].src;
if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
//if (document.getElementById) document.getElementById("PictureLink").href= PicLink[jss];
if (document.all) document.images.PictureBox.filters.blendTrans.Play();

jss = jss + 1;
if (jss>jmax) jss = jmin; //add for check max 7

//if (jss > (pss)) jss=1;
tss = setTimeout('runSlideShow()', SlideShowSpeed);
}


