// JavaScript Document

//Specify the slider's width (in pixels)

var sliderwidth="560px"

//Specify the slider's height

var sliderheight="88px"

//Specify the slider's slide speed (larger is faster 1-10)

var slidespeed=1

//configure background color:

slidebgcolor="#EAEAEA"

// To set the number of images
var noOfImages = 43;

// Image path
var imgPath = '';

//Specify the slider's images

var leftrightslide=new Array()

var finalslide=''

var prdimg=Array();

var prdlinks=Array();

var k;



slideimages=Array();

captions=Array();
/*
captions[1]="The Kumbalam backwaters. Serene and inspiring. Amble along its shores and let your mind drift."
captions[2]="The lake cottages and pool cottages open out to splendid views of the backwaters."
captions[3]="The 46 centrally air-conditioned accommodation facilities at Ramada Resort combine supreme indulgence with uber-chic interiors."
captions[4]="Fennel, the multi-cuisine restaurant. Discover how life tastes better when shorn of deadlines, emergency meetings and rushed lunches."
captions[5]="Hot Coals, the grill room. Surrender to guilty pleasures, straight off the grill. Their sinful taste is sure to have you craving for more."
captions[6]="Club 11HUNDRED, the lounge bar. It's your zone. To unwind. Escape the mundane. And to discover yourself."
captions[7]="The long, meandering pool, set alongside the soothing backwaters. Take a dip, and watch your worries drown."
captions[8]="F Chisel Spa with ayurveda, aromatherapy, mud therapy and more. Enter its luxurious environs and let go of all the stress that's been weighing you down."
captions[9]="If you'd rather mix pleasure, with small doses of business, there are avenues for that too. Ramada Resort is entirely wi-fi and plug-n-play business enabled, and offers excellent conference and banquet facilities: Royale Club (450 pax), Synergy Zone (80 pax), The Dais (80 pax) and Concord (40 pax)."
captions[10]="Strokes, the sunken pool bar, serves exotic cocktails even as you enjoy a lazy afternoon in the pool."
captions[11]="For the fitness freaks, the state-of-the-art health club offers a range of activities to work up a sweat."
*/
captions[1]=captions[2]=captions[3]="Make your journey. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
captions[4]="The Kumbalam backwaters. Serene and inspiring. Amble along its shores and let your mind drift.";
captions[5]=captions[6]="The lake cottages and pool cottages open out to splendid views of the backwaters.";
captions[17]="The 46 centrally air-conditioned accommodation facilities at Ramada Resort combine supreme indulgence with uber-chic interiors.";
captions[18]="Japanese garden. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
captions[14]="<b>Fennel</b>, the multi-cuisine restaurant. Discover how life tastes better when shorn of deadlines, emergency meetings and rushed lunches.";
captions[15]="<b>Hot Coals</b>, the grill room. Surrender to guilty pleasures, straight off the grill. Their sinful taste is sure to have you craving for more.";
captions[16]="<b>Club 1100</b>, the lounge bar. It's your zone. To unwind. Escape the mundane. And to discover yourself.";
captions[7]=captions[8]=captions[9]="The long, meandering pool, set alongside the soothing backwaters. Take a dip, and watch your worries drown.";
captions[11]="<b>F Chisel Spa</b> with ayurveda, aromatherapy, mud therapy and more. Enter its luxurious environs and let go of all the stress that's been weighing you down.";
captions[13]="If you'd rather mix pleasure, with small doses of business, there are avenues for that too. Ramada Resort is entirely wi-fi and plug-n-play business enabled, and offers excellent conference and banquet facilities: <b>Royale Club</b> (450 pax), <b>Synergy Zone</b> (80 pax), <b>The Dais</b> (80 pax) and <b>Concorde</b> (40 pax).";
captions[10]="Strokes, the sunken pool bar, serves exotic cocktails even as you enjoy a lazy afternoon in the pool.";
captions[12]="For the fitness freaks, the state-of-the-art health club offers a range of activities to work up a sweat.";

function blendimage(divid, imageid, imagefile, millisec) {
    var speed = Math.round(millisec / 100);
    var timer = 0;
    
    //set the current image as background
    //document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
    document.getElementById(divid).style.backgroundImage ='';
    //make image transparent
    changeOpac(0, imageid);
    
    //make new image
	document.getElementById(imageid).src = image0.src;
    document.getElementById(imageid).src = eval("image"+imagefile+".src");

    //fade in image
    for(i = 0; i <= 100; i++) {
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
        timer++;
    }
} 

function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}
function loadImg(id){
		blendimage("divImg","imgSlide",id,500);				
		capObj=document.getElementById("divCap");
		//imgObj.src="images/gallery/"+id+"_big.jpg";
		if(typeof(captions[id])!='undefined'){
			capObj.innerHTML='<div align="left">'+captions[id]+'</div>';
		}
		else{
			capObj.innerHTML="";
		}
}


for(i=1;i<=noOfImages;i++){
		leftrightslide[i]='<img src="../../gallery_images/all/thumb/img_'+i+'.jpg" border=0 style="cursor:pointer;border:1px solid #a9a8a7" onClick="loadImg('+i+')">'
}

//leftrightslide[i]='<a href="'+slideimages[pg][i]+'" rel="lightbox[contractors]" title="'+captions[pg]+'"><img src="'+slideimages[pg][i]+'" border=0 height="205"></a>'



var imagegap=" &nbsp;"



var slideshowgap=5





////NO NEED TO EDIT BELOW THIS LINE////////////



var copyspeed=slidespeed

leftrightslide='<nobr>'+leftrightslide.join(imagegap)+'</nobr>'
leftrightslide=leftrightslide.replace(imagegap+''+imagegap,imagegap);
var iedom=document.all||document.getElementById

if (iedom)

document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+leftrightslide+'</span>')

var actualwidth=''

var cross_slide, ns_slide

var image0= new Image();
image0.src=imgPath+'images/loading.gif';

for(i=1;i<=noOfImages;i++){	
		eval("var image"+i+"=new Image();");
}
function fillup(imagePath){
 imgPath = imagePath;
for(i=1;i<=noOfImages;i++){
	//eval("var image"+i+"=new Image();");
		eval("image"+i+".src='"+imgPath+"gallery_images/all/main/img_"+i+".jpg';");
	//alert(image1.src);
}
if (iedom){

cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2

cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3

cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide

actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth

cross_slide2.style.left=actualwidth+slideshowgap+"px"

}

else if (document.layers){

ns_slide=document.ns_slidemenu.document.ns_slidemenu2

ns_slide2=document.ns_slidemenu.document.ns_slidemenu3

ns_slide.document.write(leftrightslide)

ns_slide.document.close()

actualwidth=ns_slide.document.width

ns_slide2.left=actualwidth+slideshowgap

ns_slide2.document.write(leftrightslide)

ns_slide2.document.close()

}
/*
if (iedom)
	cross_slide.style.left=(actualwidth*(-1))+parseInt(sliderwidth)+"px";
else
	ns_slide.left=(actualwidth*(-1))+parseInt(sliderwidth);
*/
//lefttime=setInterval("slideright()",30)
slideleft();
}





function slideleft(){
	
	if (iedom){
	
		if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
		
		cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px"
		
		else
		
		cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px"
		
		
		
		if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
		
		cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px"
		
		else
		
		cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px"
	
	
	
	}
	
	else if (document.layers){
	
		if (ns_slide.left>(actualwidth*(-1)+8))
		
		ns_slide.left-=copyspeed
		
		else
		
		ns_slide.left=ns_slide2.left+actualwidth+slideshowgap
		
		
		
		if (ns_slide2.left>(actualwidth*(-1)+8))
		
		ns_slide2.left-=copyspeed
		
		else
		
		ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
		
	}
	if(typeof(handle)!='undefined')
		clearTimeout(handle);
	handle=setTimeout("slideleft()",30);
	
}

function slideright(){
	
	if (iedom){		
		
		
		if (parseInt(cross_slide.style.left)<parseInt(sliderwidth))
		
		cross_slide.style.left=parseInt(cross_slide.style.left)+copyspeed+"px"
		
		else
		
		cross_slide.style.left=(parseInt(cross_slide2.style.left)-(actualwidth+slideshowgap))+"px"
		
		
		
		if (parseInt(cross_slide2.style.left)<parseInt(sliderwidth))
		
		cross_slide2.style.left=parseInt(cross_slide2.style.left)+copyspeed+"px"
		
		else
		
		cross_slide2.style.left=(parseInt(cross_slide.style.left)-(actualwidth+slideshowgap))+"px"
		
	}
	
	else if (document.layers){
	
		if (ns_slide.left<parseInt(sliderwidth))
		
		ns_slide.left+=copyspeed
		
		else
		
		ns_slide.left=ns_slide2.left-(actualwidth+slideshowgap)
		
		
		
		if (ns_slide2.left<parseInt(sliderwidth))
		
		ns_slide2.left+=copyspeed
		
		else
		
		ns_slide.left=ns_slide.left-(actualwidth+slideshowgap)
		
	}
	if(typeof(handle)!='undefined')
		clearTimeout(handle);
	handle=setTimeout("slideright()",30);
	
}






if (iedom||document.layers){

with (document){

write('<table border="0" cellspacing="0" cellpadding="0"><td valign=top>')

if (iedom){

write('<div id="scrollParent" style="position:relative;width:'+sliderwidth+';height:'+sliderheight+';overflow:hidden;">')

write('<div style="position:absolute;width:'+sliderwidth+';height:'+sliderheight+';" onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed">')

write('<div id="test2" style="position:absolute;left:0px;top:0px"></div>')

write('<div id="test3" style="position:absolute;left:-1000px;top:0px"></div>')

write('</div></div>')

}

else if (document.layers){

write('<ilayer width='+sliderwidth+' height='+sliderheight+' name="ns_slidemenu">')

write('<layer name="ns_slidemenu2" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')

write('<layer name="ns_slidemenu3" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')

write('</ilayer>')

}

write('</td></table>')

}

}
function changeImagePrevious()
{
	imgString = document.getElementById('imgSlide').src;
	imgArr = imgString.split("/");
	imgIdArr = imgArr[7].split("_");
	imgId = imgIdArr[1].split(".");
	newImgId = imgId[0];
	newImgId = parseInt(newImgId) - 1;
	//alert(newImgId);
	if(newImgId>0)
		loadImg(newImgId);
}
function changeImageNext()
{
	imgString = document.getElementById('imgSlide').src;
	imgArr = imgString.split("/");
	imgIdArr = imgArr[7].split("_");
	imgId = imgIdArr[1].split(".");
	newImgId = imgId[0];
	newImgId = parseInt(newImgId)+1;
	//alert(newImgId);
	if(newImgId<=43)
		loadImg(newImgId);
}
//if(window.attachEvent)window.attachEvent("onload",fillup);

//else  if(window.addEventListener)window.addEventListener("load",fillup,1);
