<!-- configurable script -->
theimage = new Array();

// The dimensions of ALL the images should be the same or some of them may look stretched or reduced in Netscape 4.
// Format: theimage[...]=[image URL, link URL, name/description]
theimage[0]=["http://www.apartmentincostadelsol.com/images/apartment/living_room_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/living_room.jpg", "Living Room pic.1"];
theimage[1]=["http://www.apartmentincostadelsol.com/images/apartment/living_room2_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/living_room2.jpg", "Living Room pic.2"];
theimage[2]=["http://www.apartmentincostadelsol.com/images/apartment/living_room1_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/living_room1.jpg", "Living Room pic.3"];
//theimage[3]=["http://www.apartmentincostadelsol.com/images/apartment/dinningroom_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/dinningroom.jpg", "Dining Room"];
theimage[3]=["http://www.apartmentincostadelsol.com/images/apartment/dinningroom_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/dinningroom.jpg", "Dining Room pic.1"];
theimage[4]=["http://www.apartmentincostadelsol.com/images/apartment/DSCN0502_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/DSCN0502.jpg", "Dining Room pic.2"];

//theimage[4]=["http://www.apartmentincostadelsol.com/images/apartment/kitchen_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/kitchen.jpg", "Kitchen"];
theimage[5]=["http://www.apartmentincostadelsol.com/images/apartment/DSCN0497_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/DSCN0497.jpg", "Kitchen pic.1"];
theimage[6]=["http://www.apartmentincostadelsol.com/images/apartment/DSCN0500_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/DSCN0500.jpg", "Kitchen pic.2"];

//theimage[5]=["http://www.apartmentincostadelsol.com/images/apartment/masterbedroom_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/masterbedroom.jpg", "Master Bedroom"];
theimage[7]=["http://www.apartmentincostadelsol.com/images/apartment/DSCN0487_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/DSCN0487.jpg", "Master Bedroom pic.1"];
theimage[8]=["http://www.apartmentincostadelsol.com/images/apartment/DSCN0488_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/DSCN0488.jpg", "Master Bedroom pic.2"];
theimage[9]=["http://www.apartmentincostadelsol.com/images/apartment/DSCN0491_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/DSCN0491.jpg", "Master Bedroom pic.3"];

//theimage[6]=["http://www.apartmentincostadelsol.com/images/apartment/twinbedroom_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/twinbedroom.jpg", "Twin Bedroom"];
theimage[10]=["http://www.apartmentincostadelsol.com/images/apartment/DSCN0494_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/DSCN0494.jpg", "Twin Bedroom"];

theimage[11]=["http://www.apartmentincostadelsol.com/images/apartment/DSCN0493_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/DSCN0493.jpg", "Bathroom"];

theimage[12]=["http://www.apartmentincostadelsol.com/images/apartment/in_out_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/in_out.jpg", "View Through To Terrace"];
theimage[13]=["http://www.apartmentincostadelsol.com/images/apartment/terrace_view3_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/terrace_view3.jpg", "View of Terrace pic.1"];
theimage[14]=["http://www.apartmentincostadelsol.com/images/apartment/terrace_view4_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/terrace_view4.jpg", "View of Terrace pic.2"];
theimage[15]=["http://www.apartmentincostadelsol.com/images/apartment/terrace_view5_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/terrace_view5.jpg", "View of Terrace pic.3"];

theimage[16]=["http://www.apartmentincostadelsol.com/images/apartment/terrace_view6_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/terrace_view6.jpg", "View of Terrace pic.4"];
theimage[17]=["http://www.apartmentincostadelsol.com/images/apartment/outside_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/outside.jpg", "Outside the Apartment"];

//theimage[12]=["http://www.apartmentincostadelsol.com/images/apartment/outside_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/outside.jpg", "Outside the Apartment"];
theimage[18]=["http://www.apartmentincostadelsol.com/images/apartment/outside_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/outside.jpg", "Outside the Apartment"];
theimage[19]=["http://www.apartmentincostadelsol.com/images/apartment/DSCN0509_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/DSCN0509.jpg", "Outside the Apartment"];
theimage[20]=["http://www.apartmentincostadelsol.com/images/apartment/DSCN0510_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/DSCN0510.jpg", "Outside the Apartment"];

theimage[21]=["http://www.apartmentincostadelsol.com/images/apartment/gardens_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/gardens.jpg", "The Beautiful Gardens"];
theimage[22]=["http://www.apartmentincostadelsol.com/images/apartment/gym_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/gym.jpg", "The Gym"];
theimage[23]=["http://www.apartmentincostadelsol.com/images/apartment/kids_play_area_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/kids_play_area.jpg", "The Kids' Play Area pic.1"];
theimage[24]=["http://www.apartmentincostadelsol.com/images/apartment/kids_play_area2_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/kids_play_area2.jpg", "The Kids' Play Area pic.2"];
theimage[25]=["http://www.apartmentincostadelsol.com/images/apartment/pool_tables_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/pool_tables.jpg", "Pool Tables Area"];
theimage[26]=["http://www.apartmentincostadelsol.com/images/apartment/sports_courts_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/sports_courts.jpg", "Sports Courts"];
theimage[27]=["http://www.apartmentincostadelsol.com/images/apartment/crazy_golf1_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/crazy_golf1.jpg", "Crazy Golf Area pic.1"];
theimage[28]=["http://www.apartmentincostadelsol.com/images/apartment/crazy_golf2_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/crazy_golf2.jpg", "Crazy Golf Area pic.2"];

theimage[29]=["http://www.apartmentincostadelsol.com/images/apartment/crazy_golf3_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/crazy_golf3.jpg", "Crazy Golf Area pic.3"];
theimage[30]=["http://www.apartmentincostadelsol.com/images/apartment/piscina1_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/piscina1.jpg", "Swimming Pools pic.1"];
theimage[31]=["http://www.apartmentincostadelsol.com/images/apartment/piscina2_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/piscina2.jpg", "Swimming Pools pic.2"];
theimage[32]=["http://www.apartmentincostadelsol.com/images/apartment/piscina3_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/piscina3.jpg", "Swimming Pools pic.3"];
theimage[33]=["http://www.apartmentincostadelsol.com/images/apartment/piscina4_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/piscina4.jpg", "Swimming Pools pic.4"];
theimage[34]=["http://www.apartmentincostadelsol.com/images/apartment/piscinas_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/piscinas.jpg", "Swimming Pools pic.5"];
theimage[35]=["http://www.apartmentincostadelsol.com/images/apartment/piscina6_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/piscina6.jpg", "Swimming Pools pic.6"];
theimage[36]=["http://www.apartmentincostadelsol.com/images/apartment/piscina7_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/piscina7.jpg", "Swimming Pools pic.7"];
theimage[37]=["http://www.apartmentincostadelsol.com/images/apartment/piscina_from_balcony_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/piscina_from_balcony.jpg", "Swimming Pools from Balcony"];
theimage[38]=["http://www.apartmentincostadelsol.com/images/apartment/piscina_sea_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/piscina_sea.jpg", "Swimming Pools & Sea View pic.1"];

theimage[39]=["http://www.apartmentincostadelsol.com/images/apartment/piscinas_sea_view_thumb.jpg", "http://www.apartmentincostadelsol.com/images/apartment/piscinas_sea_view.jpg", "Swimming Pools & Sea View pic.2"];

///// Plugin variables

playspeed=8000;// The playspeed determines the delay for the "Play" button in ms
dotrans=1; // if value = 1 then there are transitions played in IE
transtype='blendTrans';// 'blendTrans' or 'revealtrans'

// transattributes options are as follows:-
// None
// Blend Transition
// 0 - Box in
// 1 - Box out
// 2 - Circle in
// 3 - Circle out
// 4 - Wipe up
// 5 - Wipe down
// 6 - Wipe right
// 7 - Wipe left
// 8 - Vertical blinds
// 9 - Horizontal blinds
// 10 - Checkerboard across
// 11 - Checkerboard down
// 12 - Random dissolve
// 13 - Split vertical in
// 14 - Split vertical out
// 15 - Split horizontal in
// 16 - Split horizontal out
// 17 - Strips left down
// 18 - Strips left up
// 19 - Strips right down
// 20 - Strips right up
// 21 - Random bars horizontal
// 22 - Random bars vertical
// 23 - Random Apply above filters randomly
transattributes='23';// duration=seconds,transition=#<24

//#####
//key that holds where in the array currently are
i=0;

//###########################################
window.onload=function(){

	//preload images into browser
	preloadSlide();

	//"jump to" box
	for (y=0;y<theimage.length;y++) {
		document.slideshow.imgComboBox[y]=new Option(theimage[y][2]);
	}

	//set transitions
	GetTrans();

	//set the first slide
	SetSlide(0);

	//autoplay
	PlaySlide();
}

//###########################################
function SetSlide(num) {
	//too big
	i=num%theimage.length;
	//too small
	if(i<0)i=theimage.length-1;

	//switch the image
	if(document.all&&!window.opera&&dotrans==1)eval('document.images.imgslide.filters.'+transtype+'.Apply()')
	document.images.imgslide.src=theimage[i][0];
	if(document.all&&!window.opera&&dotrans==1)eval('document.images.imgslide.filters.'+transtype+'.Play()')

	//if drop down box
	if(document.slideshow.imgComboBox){
		document.slideshow.imgComboBox.selectedIndex = i;
	}

	//if they want name of current slide
	document.getElementById('slidebox').innerHTML=theimage[i][2];

	//if they want current slide number and total
	document.getElementById('slidecount').innerHTML= "Image "+(i+1)+" of "+theimage.length;

}


//###########################################
function PlaySlide() {
	if (!window.playing) {
		PlayingSlide(i+1);
		if(document.slideshow.play){
			document.slideshow.play.value="Stop Slideshow";
		}
	}
	else {
		playing=clearTimeout(playing);
		if(document.slideshow.play){
			document.slideshow.play.value="Play Slideshow";
		}
	}
	// if you have to change the image for the "playing" slide
	if(document.images.imgPlay){
		setTimeout('document.images.imgPlay.src="'+imgStop+'"',1);
		imgStop=document.images.imgPlay.src
	}
}


//###########################################
function PlayingSlide(num) {
	playing=setTimeout('PlayingSlide(i+1);SetSlide(i+1);', playspeed);
}


//###########################################
//desc: picks the transition to apply to the images
function GetTrans() {
	//si=document.slideshow.trans.selectedIndex;

		if((document.slideshow.trans && document.slideshow.trans.selectedIndex == 0) || (!document.slideshow.trans && dotrans==0)){
		dotrans=0;
	}
	else if ((document.slideshow.trans && document.slideshow.trans.selectedIndex == 1) || (!document.slideshow.trans && transtype == 'blendTrans')){
		dotrans=1;
		transtype='blendTrans';
		document.imgslide.style.filter = "blendTrans(duration=1,transition=1)";
	}else{
		dotrans=1;
		transtype='revealtrans';
		if(document.slideshow.trans) transattributes=document.slideshow.trans[document.slideshow.trans.selectedIndex].value;
		document.imgslide.style.filter = "revealTrans(duration=1,transition=" +transattributes+ ")";
	}

}
//###########################################
function preloadSlide() {
	for(k=0;k<theimage.length;k++) {
		theimage[k][0]=new Image().src=theimage[k][0];
	}
}

