// JavaScript Document


var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages[0]=["images/1.jpg", "", ""] //plain image syntax
fadeimages[1]=["images/2.jpg", "", ""] //image with link syntax
fadeimages[2]=["images/3.jpg", "", "_new"] //image with link and target syntax
fadeimages[3]=["images/4.jpg", "", ""] //plain image syntax
fadeimages[4]=["images/5.jpg", "", ""] //image with link syntax
fadeimages[5]=["images/6.jpg", "", "_new"] //image with link and target syntax
fadeimages[6]=["images/7.jpg", "", ""] //plain image syntax
fadeimages[7]=["images/8.jpg", "", ""] //image with link syntax
fadeimages[8]=["images/9.jpg", "", "_new"] //image with link and target syntax

var fadeimages2=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages2[0]=["images/golf/gplf1.jpg", "", ""] //plain image syntax
fadeimages2[1]=["images/golf/gplf2.jpg", "http://www.samanahhotels.com", ""] //image with link syntax
fadeimages2[2]=["images/golf/gplf3.jpg", "http://www.samanahhotels.com", "_new"] //image with link and target syntax
fadeimages2[3]=["images/golf/gplf4.jpg", "", ""] 
fadeimages2[4]=["images/golf/gplf5.jpg", "", ""] 




var fadeimages3=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages3[0]=["images/sight1.jpg", "", ""] //plain image syntax
fadeimages3[1]=["images/sight2.jpg", "http://www.samanahhotels.com", ""] //image with link syntax
fadeimages3[2]=["images/sight3.jpg", "http://www.samanahhotels.com", "_new"] //image with link and target syntax
fadeimages3[3]=["images/sight4.jpg", "", ""] 

var fadeimages4=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages4[0]=["images/kids.jpg", "", ""] //plain image syntax
fadeimages4[1]=["images/kids1.jpg", "http://www.samanahhotels.com", ""] //image with link syntax
fadeimages4[2]=["images/kids2.jpg", "http://www.samanahhotels.com", "_new"] //image with link and target syntax
var fadeimages5=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages5[0]=["images/lobby/lobby1.jpg", "", ""] //plain image syntax
fadeimages5[1]=["images/lobby/lobby2.jpg", "", ""] 
fadeimages5[2]=["images/lobby/lobby3.jpg", "", ""] 
fadeimages5[3]=["images/lobby/lobby4.jpg", "", ""] 
var fadebgolor="white"
var fadeimages6=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages6[0]=["images/spa/spa1.jpg", "", ""] //plain image syntax
fadeimages6[1]=["images/spa/spa2.jpg", "http://www.samanahhotels.com", ""] //image with link syntax
fadeimages6[2]=["images/spa/spa3.jpg", "http://www.samanahhotels.com", "_new"] //image with link and target syntax
fadeimages6[3]=["images/spa/spa4.jpg", "", ""] 
fadeimages6[4]=["images/spa/spa5.jpg", "", ""] 
fadeimages6[5]=["images/spa/spa6.jpg", "", ""] 
var fadebgcolor="white"
 
 
 var fadeimages7=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages7[0]=["images/swimming/swim1.jpg", "", ""] //plain image syntax
fadeimages7[1]=["images/swimming/swim2.jpg", "http://www.samanahhotels.com", ""] //image with link syntax
fadeimages7[2]=["images/swimming/swim3.jpg", "http://www.samanahhotels.com", "_new"] //image with link and target syntax
fadeimages7[3]=["images/swimming/swim4.jpg", "", ""] 
fadeimages7[4]=["images/swimming/swim5.jpg", "", ""] 
fadeimages7[5]=["images/swimming/swim6.jpg", "", ""] 
var fadebgolor="white"
 
 var fadeimages8=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages8[0]=["images/dining/dining1.jpg", "", ""] //plain image syntax
fadeimages8[1]=["images/dining/dining2.jpg", "http://www.samanahhotels.com", ""] //image with link syntax
fadeimages8[2]=["images/dining/dining3.jpg", "http://www.samanahhotels.com", "_new"] //image with link and target syntax
var fadebgolor="white"
 


 var fadeimages9=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages9[0]=["images/golf/golf1.jpg", "", ""] //plain image syntax
fadeimages9[1]=["images/golf/golf2.jpg", "http://www.samanahhotels.com", ""] //image with link syntax
fadeimages9[2]=["images/golf/golf3.jpg", "http://www.samanahhotels.com", "_new"] //image with link and target syntax
fadeimages9[3]=["images/golf/golf4.jpg", "", ""] 
fadeimages9[4]=["images/golf/golf5.jpg", "", ""] 
fadeimages9[5]=["images/golf/golf6.jpg", "", ""] 
var fadebgolor="white"


 var fadeimages10=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages10[0]=["images/souks/souks1.jpg", "", ""] //plain image syntax
fadeimages10[1]=["images/souks/souks2.jpg", "http://www.samanahhotels.com", ""] //image with link syntax
fadeimages10[2]=["images/souks/souks3.jpg", "http://www.samanahhotels.com", "_new"] //image with link and target syntax
fadeimages10[3]=["images/souks/souks4.jpg", "", ""] 
fadeimages10[4]=["images/souks/souks5.jpg", "", ""] 
fadeimages10[5]=["images/souks/souks6.jpg", "", ""] 
fadeimages10[6]=["images/souks/souks7.jpg", "", ""] 
fadeimages10[7]=["images/souks/souks8.jpg", "", ""] 
fadeimages10[8]=["images/souks/souks9.jpg", "", ""] 
var fadebgolor="white"



 var fadeimages11=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages11[0]=["images/tennis/tennis1.jpg", "", ""] //plain image syntax
fadeimages11[1]=["images/tennis/tennis2.jpg", "http://www.samanahhotels.com", ""] //image with link syntax
fadeimages11[2]=["images/tennis/tennis3.jpg", "http://www.samanahhotels.com", ""] //image with link syntax
fadeimages11[3]=["images/tennis/tennis4.jpg", "http://www.samanahhotels.com", ""] //image with link syntax

var fadebgolor="white"



 var fadeimages12=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages12[0]=["images/ski/ski1.jpg", "", ""] //plain image syntax
fadeimages12[1]=["images/ski/ski2.jpg", "http://www.samanahhotels.com", ""] //image with link syntax
fadeimages12[2]=["images/ski/ski3.jpg", "http://www.samanahhotels.com", ""] //image with link syntax
fadeimages12[3]=["images/ski/ski4.jpg", "http://www.samanahhotels.com", ""] //image with link syntax
fadeimages12[4]=["images/ski/ski5.jpg", "http://www.samanahhotels.com", ""] //image with link syntax
fadeimages12[5]=["images/ski/ski6.jpg", "http://www.samanahhotels.com", ""] //image with link syntax
fadeimages12[6]=["images/ski/ski7.jpg", "http://www.samanahhotels.com", ""] //image with link syntax

var fadebgolor="white"




 var fadeimages13=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages13[0]=["images/water/water1.jpg", "", ""] //plain image syntax
fadeimages13[1]=["images/water/water2.jpg", "http://www.samanahhotels.com", ""] //image with link syntax
fadeimages13[2]=["images/water/water3.jpg", "http://www.samanahhotels.com", ""] //image with link syntax
fadeimages13[3]=["images/water/water4.jpg", "http://www.samanahhotels.com", ""] //image with link syntax
fadeimages13[4]=["images/water/water5.jpg", "http://www.samanahhotels.com", ""] //image with link syntax

var fadebgolor="white"

 var fadeimages14=new Array() 

fadeimages14[0]=["images/beach/beach1.jpg", "", ""]
fadeimages14[1]=["images/beach/beach2.jpg", "", ""]
fadeimages14[2]=["images/beach/beach3.jpg", "", ""]
fadeimages14[3]=["images/beach/beach4.jpg", "", ""]
fadeimages14[4]=["images/beach/beach5.jpg", "", ""]
fadeimages14[5]=["images/beach/beach6.jpg", "", ""]
fadeimages14[6]=["images/beach/beach7.jpg", "", ""]
fadeimages14[7]=["images/beach/beach8.jpg", "", ""]
fadeimages14[8]=["images/beach/beach9.jpg", "", ""]
fadeimages14[9]=["images/beach/beach10.jpg", "", ""]

var fadebgolor="white"


 var fadeimages15=new Array() 

fadeimages15[0]=["images/basket/basket1.jpg", "", ""]
fadeimages15[1]=["images/basket/basket2.jpg", "", ""]
fadeimages15[2]=["images/basket/basket3.jpg", "", ""]
fadeimages15[3]=["images/basket/basket4.jpg", "", ""]

var fadebgolor="white"


var fadeimages16=new Array() 

fadeimages16[0]=["images/atlas/atlas1.jpg", "", ""]
fadeimages16[1]=["images/atlas/atlas2.jpg", "", ""]
fadeimages16[2]=["images/atlas/atlas3.jpg", "", ""]
fadeimages16[3]=["images/atlas/atlas4.jpg", "", ""]

var fadebgolor="white"



var fadeimages17=new Array() 

fadeimages17[0]=["images/room/room1.jpg", "", ""]
fadeimages17[1]=["images/room/room2.jpg", "", ""]
fadeimages17[2]=["images/room/room3.jpg", "", ""]
fadeimages17[3]=["images/room/room4.jpg", "", ""]
fadeimages17[4]=["images/room/room5.jpg", "", ""]
fadeimages17[5]=["images/room/room6.jpg", "", ""]
var fadebgolor="white"

////NO need to edit beyond here/////////////
 
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder)
{
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=obj.degree/100
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}
 
































