// JavaScript Document

var j=1;
var slidingTime=3200;
var moveTime=800;
var firstTime=true;
var newInt=setInterval('startAni(moveTime, j++)', slidingTime);
var widthOf = new Array();
var links = new Array(); 

/****** Internation packages Link **********/
links[1]="soul-kerala-packages.php";
links[2]="hill&beach-kerala-packages.php";
links[3]="experience-kerala-packages.php";
links[5]="hill&lake-kerala-packages.php";
links[6]="marvalous-kerala-packages.php";

/****** Domestic packages Links **********/
links[7]="internationaltourpackages.php";
links[8]="domtour.php?region=4&tour=1&"+lnkhref; /* Goa */ 
links[9]="domtour.php?region=2&tour=4&"+lnkhref; /* Ooty */
links[10]="domtour.php?region=2&tour=1&"+lnkhref; /* Munnar */
links[11]="domtour.php?region=2&tour=3&"+lnkhref; /* Kovalam */
links[12]="domtour.php?region=1&tour=2&"+lnkhref; /* Shimla */
links[13]="domtour.php?region=1&tour=1&"+lnkhref; /* Nainital */
links[14]="domtour.php?region=1&tour=3&"+lnkhref; /* Mussoorie */
links[15]="domtour.php?region=2&tour=2&"+lnkhref; /* Coorg */

$(document).ready(function(){

for(var i=1; i<=16; i++)
{
	$("#thumb"+i).click(function(){
	var temp=$(this).attr("id"); 
	temp=temp.slice(5,7)
	clearInterval(newInt);
	window.location=links[temp];
	});
}

for(var i=1; i<=16; i++)
{
$("#crslimg"+i).click(function()
{
	var temp=$(this).attr("id"); 
	temp=temp.slice(7,9)
	j=temp;

startAni(moveTime, j);
widthOf[temp]=$(".carouselimage"+temp).width();
if(widthOf[temp]==450)
{
	clearInterval(newInt);
window.location=links[temp];
}

});
}



$("#carousel-left").click(function(){
clearInterval(newInt);
if (firstTime)
{
 firstTime=false;
 if (j==0 || j==1)
 j=6;
 else
 j-=1;
}
if(j>=2)
j--;
else
j=6;
startAni(moveTime, j);

});

$("#carousel-right").click(function(){
clearInterval(newInt);
if (firstTime)
{
 firstTime=false;

}
else if(j<=6)
j++;
else
j=1;
startAni(moveTime, j);

});


});

function startAni(intervalItme, cur)
{
var direction="left";

if (direction=="left")
{
	
if(cur==1)
{
$("#crslimg6").css("z-index","24");
$("#crslimg1").css("z-index","25");
$("#crslimg2").css("z-index","23");
$("#crslimg3").css("z-index","22");
$("#crslimg4").css("z-index","21");
$("#crslimg5").css("z-index","20");
<!--$("#crslimg6").css("z-index","19");-->
$(".carouselimage6").animate({width: '360',  height: '256', opacity: 0.7, top:'29', left:'160' }, intervalItme);
$(".carouselimage1").animate({width: '450',  height: '320', opacity: 1, top:'0', left:'260' }, intervalItme);
$(".carouselimage2").animate({width: '360',  height: '256', opacity: 0.7, top:'29', left:'450' }, intervalItme);
$(".carouselimage3").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'623' }, intervalItme);
$(".carouselimage4").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'400' }, intervalItme);
<!--$(".carouselimage5").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'400' }, intervalItme);-->
$(".carouselimage5").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'60' }, intervalItme);
}

	
if(cur==2)
{
$("#crslimg1").css("z-index","24");
$("#crslimg2").css("z-index","25");
$("#crslimg3").css("z-index","23");
$("#crslimg4").css("z-index","22");
$("#crslimg5").css("z-index","21");
$("#crslimg6").css("z-index","20");
<!--$("#crslimg7").css("z-index","19");-->
$(".carouselimage1").animate({width: '360',  height: '256', opacity: 0.7, top:'29', left:'160' }, intervalItme);
$(".carouselimage2").animate({width: '450',  height: '320', opacity: 1, top:'0', left:'260' }, intervalItme);
$(".carouselimage3").animate({width: '360',  height: '256', opacity: 0.7, top:'29', left:'450' }, intervalItme);
$(".carouselimage4").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'623' }, intervalItme);
$(".carouselimage5").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'400' }, intervalItme);
$(".carouselimage6").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'60' }, intervalItme);
<!--$(".carouselimage7").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'60' }, intervalItme);-->
}


if(cur==3)
{
$("#crslimg2").css("z-index","24");
$("#crslimg3").css("z-index","25");
$("#crslimg4").css("z-index","23");
$("#crslimg5").css("z-index","22");
$("#crslimg6").css("z-index","21");
<!--$("#crslimg7").css("z-index","19");-->
$("#crslimg1").css("z-index","19");
$(".carouselimage2").animate({width: '360',  height: '256', opacity: 0.7, top:'29', left:'160' }, intervalItme);
$(".carouselimage3").animate({width: '450',  height: '320', opacity: 1, top:'0', left:'260' }, intervalItme);
$(".carouselimage4").animate({width: '360',  height: '256', opacity: 0.7, top:'29', left:'450' }, intervalItme);
$(".carouselimage5").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'623' }, intervalItme);
$(".carouselimage6").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'400' }, intervalItme);
<!--$(".carouselimage7").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'400' }, intervalItme);-->
$(".carouselimage1").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'60' }, intervalItme);
}

if(cur==4)
{
$("#crslimg3").css("z-index","24");
$("#crslimg4").css("z-index","25");
$("#crslimg5").css("z-index","23");
$("#crslimg6").css("z-index","22");
<!--$("#crslimg7").css("z-index","19");-->
$("#crslimg1").css("z-index","20");
$("#crslimg2").css("z-index","19");
$(".carouselimage3").animate({width: '360',  height: '256', opacity: 0.7, top:'29', left:'160' }, intervalItme);
$(".carouselimage4").animate({width: '450',  height: '320', opacity: 1, top:'0', left:'260' }, intervalItme);
$(".carouselimage5").animate({width: '360',  height: '256', opacity: 0.7, top:'29', left:'450' }, intervalItme);
$(".carouselimage6").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'623' }, intervalItme);
<!--$(".carouselimage7").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'400' }, intervalItme);-->
$(".carouselimage1").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'400' }, intervalItme);
$(".carouselimage2").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'60' }, intervalItme);
}


if(cur==5)
{
$("#crslimg4").css("z-index","24");
$("#crslimg5").css("z-index","25");
$("#crslimg6").css("z-index","23");
<!--$("#crslimg7").css("z-index","19");-->
$("#crslimg1").css("z-index","21");
$("#crslimg2").css("z-index","20");
$("#crslimg3").css("z-index","19");
$(".carouselimage4").animate({width: '360',  height: '256', opacity: 0.7, top:'29', left:'160' }, intervalItme);
$(".carouselimage5").animate({width: '450',  height: '320', opacity: 1, top:'0', left:'260' }, intervalItme);
$(".carouselimage6").animate({width: '360',  height: '256', opacity: 0.7, top:'29', left:'450' }, intervalItme);
$(".carouselimage1").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'623' }, intervalItme);
<!--$(".carouselimage7").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'400' }, intervalItme);-->
$(".carouselimage2").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'400' }, intervalItme);
$(".carouselimage3").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'60' }, intervalItme);
}

if(cur==6)
{
$("#crslimg5").css("z-index","24");
$("#crslimg6").css("z-index","25");
<!--$("#crslimg7").css("z-index","19");-->
$("#crslimg1").css("z-index","22");
$("#crslimg2").css("z-index","21");
$("#crslimg3").css("z-index","20");
$("#crslimg4").css("z-index","19");
$(".carouselimage5").animate({width: '360',  height: '256', opacity: 0.7, top:'29', left:'160' }, intervalItme);
$(".carouselimage6").animate({width: '450',  height: '320', opacity: 1, top:'0', left:'260' }, intervalItme);
$(".carouselimage1").animate({width: '360',  height: '256', opacity: 0.7, top:'29', left:'450' }, intervalItme);
$(".carouselimage2").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'623' }, intervalItme);
<!--$(".carouselimage2").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'400' }, intervalItme);
$(".carouselimage3").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'400' }, intervalItme);
$(".carouselimage4").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'60' }, intervalItme);
}

/*if(cur==7)
{
$("#crslimg6").css("z-index","24");
$("#crslimg7").css("z-index","25");
$("#crslimg1").css("z-index","23");
$("#crslimg2").css("z-index","22");
$("#crslimg3").css("z-index","21");
$("#crslimg4").css("z-index","20");
$("#crslimg5").css("z-index","19");
$(".carouselimage6").animate({width: '360',  height: '256', opacity: 0.7, top:'29', left:'160' }, intervalItme);
$(".carouselimage7").animate({width: '450',  height: '320', opacity: 1, top:'0', left:'260' }, intervalItme);
$(".carouselimage1").animate({width: '360',  height: '256', opacity: 0.7, top:'29', left:'450' }, intervalItme);
$(".carouselimage2").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'623' }, intervalItme);
$(".carouselimage3").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'400' }, intervalItme);
$(".carouselimage4").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'400' }, intervalItme);
$(".carouselimage5").animate({width: '288',  height: '205', opacity: 0.5, top:'52', left:'60' }, intervalItme);
}*/


if(j==7)
j=1;

}

}

