﻿var preload_ctrl_images=true;

var previmg='left.gif';
var stopimg='stop.gif';
var playimg='play.gif';
var nextimg='right.gif';

var inici=[]; //FIRST SLIDESHOW
inici[0] = ["../img/fotos/capsalera/generals1.jpg", ""];
inici[1] = ["../img/fotos/capsalera/generals2.jpg", ""];
inici[2] = ["../img/fotos/capsalera/generals3.jpg", ""];
inici[3] = ["../img/fotos/capsalera/generals4.jpg", ""];
inici[4] = ["../img/fotos/capsalera/generals5.jpg", ""];
inici[5] = ["../img/fotos/capsalera/generals6.jpg", ""];
inici[6] = ["../img/fotos/capsalera/generals7.jpg", ""];
inici[7] = ["../img/fotos/capsalera/generals8.jpg", ""];
inici[8] = ["../img/fotos/capsalera/generals9.jpg", ""];
inici[9] = ["../img/fotos/capsalera/generals10.jpg", ""];
inici[10] = ["../img/fotos/capsalera/generals11.jpg", ""];
inici[11] = ["../img/fotos/capsalera/generals12.jpg", ""];
inici[12] = ["../img/fotos/capsalera/generals13.jpg", ""];
inici[13] = ["../img/fotos/capsalera/generals14.jpg", ""];
inici[14] = ["../img/fotos/capsalera/generals15.jpg", ""];
inici[15] = ["../img/fotos/capsalera/generals16.jpg", ""];
inici[16] = ["../img/fotos/capsalera/generals17.jpg", ""];
inici[17] = ["../img/fotos/capsalera/generals18.jpg", ""];
inici[18] = ["../img/fotos/capsalera/generals19.jpg", ""];
inici[19] = ["../img/fotos/capsalera/generals20.jpg", ""];
inici[20] = ["../img/fotos/capsalera/generals21.jpg", ""];
inici[21] = ["../img/fotos/capsalera/generals22.jpg", ""];
inici[22] = ["../img/fotos/capsalera/generals23.jpg", ""];

var turisme=[]; //FIRST SLIDESHOW
turisme[0] = ["../img/fotos/capsalera/turisme0.jpg", ""];
turisme[1] = ["../img/fotos/capsalera/turisme1.jpg", ""];
turisme[2] = ["../img/fotos/capsalera/turisme2.jpg", ""];
turisme[3] = ["../img/fotos/capsalera/turisme3.jpg", ""];
turisme[4] = ["../img/fotos/capsalera/turisme4.jpg", ""];
turisme[5] = ["../img/fotos/capsalera/turisme5.jpg", ""];
turisme[6] = ["../img/fotos/capsalera/turisme6.jpg", ""];
turisme[7] = ["../img/fotos/capsalera/turisme7.jpg", ""];
turisme[8] = ["../img/fotos/capsalera/turisme8.jpg", ""];
turisme[9] = ["../img/fotos/capsalera/turisme9.jpg", ""];
turisme[10] = ["../img/fotos/capsalera/turisme10.jpg", ""];
turisme[11] = ["../img/fotos/capsalera/turisme11.jpg", ""];
turisme[12] = ["../img/fotos/capsalera/turisme12.jpg", ""];
turisme[13] = ["../img/fotos/capsalera/turisme13.jpg", ""];
turisme[14] = ["../img/fotos/capsalera/turisme14.jpg", ""];
turisme[15] = ["../img/fotos/capsalera/turisme15.jpg", ""];
turisme[16] = ["../img/fotos/capsalera/turisme16.jpg", ""];
turisme[17] = ["../img/fotos/capsalera/turisme17.jpg", ""];
turisme[18] = ["../img/fotos/capsalera/turisme18.jpg", ""];
turisme[19] = ["../img/fotos/capsalera/turisme19.jpg", ""];
turisme[20] = ["../img/fotos/capsalera/turisme20.jpg", ""];
turisme[21] = ["../img/fotos/capsalera/turisme21.jpg", ""];
turisme[22] = ["../img/fotos/capsalera/turisme22.jpg", ""];

var ofertes=[]; //FIRST SLIDESHOW
ofertes[0] = ["../img/fotos/capsalera/ofertes1.jpg", ""];
ofertes[1] = ["../img/fotos/capsalera/ofertes2.jpg", ""];
ofertes[2] = ["../img/fotos/capsalera/ofertes3.jpg", ""];
ofertes[3] = ["../img/fotos/capsalera/ofertes4.jpg", ""];
ofertes[4] = ["../img/fotos/capsalera/ofertes5.jpg", ""];
ofertes[5] = ["../img/fotos/capsalera/ofertes6.jpg", ""];
ofertes[6] = ["../img/fotos/capsalera/ofertes7.jpg", ""];
ofertes[7] = ["../img/fotos/capsalera/ofertes8.jpg", ""];
ofertes[8] = ["../img/fotos/capsalera/ofertes9.jpg", ""];
ofertes[9] = ["../img/fotos/capsalera/ofertes10.jpg", ""];

var reserves=[]; //FIRST SLIDESHOW
reserves[0] = ["../img/fotos/capsalera/reserves1.jpg", ""];
reserves[1] = ["../img/fotos/capsalera/reserves2.jpg", ""];
reserves[2] = ["../img/fotos/capsalera/reserves3.jpg", ""];
reserves[3] = ["../img/fotos/capsalera/reserves4.jpg", ""];
reserves[4] = ["../img/fotos/capsalera/reserves5.jpg", ""];
reserves[5] = ["../img/fotos/capsalera/reserves6.jpg", ""];
reserves[6] = ["../img/fotos/capsalera/reserves7.jpg", ""];
reserves[7] = ["../img/fotos/capsalera/reserves8.jpg", ""];
reserves[8] = ["../img/fotos/capsalera/reserves9.jpg", ""];

var mesinfo=[]; //FIRST SLIDESHOW
mesinfo[0] = ["../img/fotos/capsalera/info1.jpg", ""];
mesinfo[1] = ["../img/fotos/capsalera/info2.jpg", ""];
mesinfo[2] = ["../img/fotos/capsalera/info3.jpg", ""];
mesinfo[3] = ["../img/fotos/capsalera/info4.jpg", ""];
mesinfo[4] = ["../img/fotos/capsalera/info5.jpg", ""];
mesinfo[5] = ["../img/fotos/capsalera/info6.jpg", ""];
mesinfo[6] = ["../img/fotos/capsalera/info7.jpg", ""];
mesinfo[7] = ["../img/fotos/capsalera/info8.jpg", ""];
mesinfo[8] = ["../img/fotos/capsalera/info9.jpg", ""];
mesinfo[9] = ["../img/fotos/capsalera/info10.jpg", ""];
mesinfo[10] = ["../img/fotos/capsalera/info11.jpg", ""];
mesinfo[11] = ["../img/fotos/capsalera/info12.jpg", ""];
mesinfo[12] = ["../img/fotos/capsalera/info13.jpg", ""];
mesinfo[13] = ["../img/fotos/capsalera/info14.jpg", ""];
mesinfo[14] = ["../img/fotos/capsalera/info15.jpg", ""];
mesinfo[15] = ["../img/fotos/capsalera/info16.jpg", ""];
mesinfo[16] = ["../img/fotos/capsalera/info17.jpg", ""];
mesinfo[17] = ["../img/fotos/capsalera/info18.jpg", ""];
mesinfo[18] = ["../img/fotos/capsalera/info19.jpg", ""];
mesinfo[19] = ["../img/fotos/capsalera/info20.jpg", ""];
mesinfo[20] = ["../img/fotos/capsalera/info21.jpg", ""];
mesinfo[21] = ["../img/fotos/capsalera/info22.jpg", ""];
mesinfo[22] = ["../img/fotos/capsalera/info23.jpg", ""];
mesinfo[23] = ["../img/fotos/capsalera/info24.jpg", ""];
mesinfo[24] = ["../img/fotos/capsalera/info25.jpg", ""];
mesinfo[25] = ["../img/fotos/capsalera/info26.jpg", ""];
mesinfo[26] = ["../img/fotos/capsalera/info27.jpg", ""];
mesinfo[27] = ["../img/fotos/capsalera/info28.jpg", ""];
mesinfo[28] = ["../img/fotos/capsalera/info29.jpg", ""];



var destinacions=[];
destinacions[0] = ["../img/fotos/capsalera/destinacions0.gif", ""];
destinacions[1] = ["../img/fotos/capsalera/destinacions1.jpg", ""];
destinacions[2] = ["../img/fotos/capsalera/destinacions2.jpg", ""];
destinacions[3] = ["../img/fotos/capsalera/destinacions3.jpg", ""];
destinacions[4] = ["../img/fotos/capsalera/destinacions4.jpg", ""];
destinacions[5] = ["../img/fotos/capsalera/destinacions5.jpg", ""];


var destinacio1=[];
destinacio1[0] = ["../img/fotos/capsalera/calella1.jpg", ""];
destinacio1[1] = ["../img/fotos/capsalera/calella2.jpg", ""];
destinacio1[2] = ["../img/fotos/capsalera/calella3.jpg", ""];
destinacio1[3] = ["../img/fotos/capsalera/calella4.jpg", ""];
destinacio1[4] = ["../img/fotos/capsalera/calella5.jpg", ""];
destinacio1[5] = ["../img/fotos/capsalera/calella6.jpg", ""];
destinacio1[6] = ["../img/fotos/capsalera/calella7.jpg", ""];

var destinacio2=[];
destinacio2[0] = ["../img/fotos/capsalera/lloret1.jpg", ""];
destinacio2[1] = ["../img/fotos/capsalera/lloret2.jpg", ""];
destinacio2[2] = ["../img/fotos/capsalera/lloret3.jpg", ""];
destinacio2[3] = ["../img/fotos/capsalera/lloret4.jpg", ""];
destinacio2[4] = ["../img/fotos/capsalera/lloret5.jpg", ""];
destinacio2[5] = ["../img/fotos/capsalera/lloret6.jpg", ""];
destinacio2[6] = ["../img/fotos/capsalera/lloret7.jpg", ""];

var destinacio3=[];
destinacio3[0] = ["../img/fotos/capsalera/tossa1.jpg", ""];
destinacio3[1] = ["../img/fotos/capsalera/tossa2.jpg", ""];
destinacio3[2] = ["../img/fotos/capsalera/tossa3.jpg", ""];
destinacio3[3] = ["../img/fotos/capsalera/tossa4.jpg", ""];
destinacio3[4] = ["../img/fotos/capsalera/tossa6.jpg", ""];
destinacio3[5] = ["../img/fotos/capsalera/tossa7.jpg", ""];
destinacio3[6] = ["../img/fotos/capsalera/tossa8.jpg", ""];

var destinacio4=[];
destinacio4[0] = ["../img/fotos/capsalera/sagaro1.jpg", ""];
destinacio4[1] = ["../img/fotos/capsalera/sagaro2.jpg", ""];
destinacio4[2] = ["../img/fotos/capsalera/sagaro3.jpg", ""];
destinacio4[3] = ["../img/fotos/capsalera/sagaro4.jpg", ""];
destinacio4[4] = ["../img/fotos/capsalera/sagaro5.jpg", ""];
destinacio4[5] = ["../img/fotos/capsalera/sagaro6.jpg", ""];
destinacio4[6] = ["../img/fotos/capsalera/sagaro7.jpg", ""];

var destinacio5=[];
destinacio5[0] = ["../img/fotos/capsalera/platjadaro1.jpg", ""];
destinacio5[1] = ["../img/fotos/capsalera/platjadaro2.jpg", ""];
destinacio5[2] = ["../img/fotos/capsalera/platjadaro3.jpg", ""];
destinacio5[3] = ["../img/fotos/capsalera/platjadaro4.jpg", ""];
destinacio5[4] = ["../img/fotos/capsalera/platjadaro5.jpg", ""];
destinacio5[5] = ["../img/fotos/capsalera/platjadaro6.jpg", ""];
destinacio5[6] = ["../img/fotos/capsalera/platjadaro7.jpg", ""];
destinacio5[7] = ["../img/fotos/capsalera/platjadaro8.jpg", ""];

var hotels=[];
hotels[0] = ["../img/fotos/capsalera/hotels1.jpg", ""];
hotels[1] = ["../img/fotos/capsalera/hotels2.jpg", ""];
hotels[2] = ["../img/fotos/capsalera/hotels3.jpg", ""];
hotels[3] = ["../img/fotos/capsalera/hotels4.jpg", ""];
hotels[4] = ["../img/fotos/capsalera/hotels5.jpg", ""];
hotels[5] = ["../img/fotos/capsalera/hotels6.jpg", ""];
hotels[6] = ["../img/fotos/capsalera/hotels7.jpg", ""];
hotels[7] = ["../img/fotos/capsalera/hotels8.jpg", ""];
hotels[8] = ["../img/fotos/capsalera/hotels9.jpg", ""];


var hotel1=[];
hotel1[0] = ["../img/fotos/capsalera/hotels/balmes1.jpg", ""];
hotel1[1] = ["../img/fotos/capsalera/hotels/balmes2.jpg", ""];
hotel1[2] = ["../img/fotos/capsalera/hotels/balmes3.jpg", ""];
hotel1[3] = ["../img/fotos/capsalera/hotels/balmes4.jpg", ""];
hotel1[4] = ["../img/fotos/capsalera/hotels/balmes5.jpg", ""];
hotel1[5] = ["../img/fotos/capsalera/hotels/balmes6.jpg", ""];
hotel1[6] = ["../img/fotos/capsalera/hotels/balmes7.jpg", ""];
hotel1[7] = ["../img/fotos/capsalera/hotels/balmes8.jpg", ""];

var hotel2=[];
hotel2[0] = ["../img/fotos/capsalera/hotels/maritim1.jpg", ""];
hotel2[1] = ["../img/fotos/capsalera/hotels/maritim2.jpg", ""];
hotel2[2] = ["../img/fotos/capsalera/hotels/maritim3.jpg", ""];
hotel2[3] = ["../img/fotos/capsalera/hotels/maritim4.jpg", ""];
hotel2[4] = ["../img/fotos/capsalera/hotels/maritim5.jpg", ""];
hotel2[5] = ["../img/fotos/capsalera/hotels/maritim6.jpg", ""];
hotel2[6] = ["../img/fotos/capsalera/hotels/maritim7.jpg", ""];
hotel2[7] = ["../img/fotos/capsalera/hotels/maritim8.jpg", ""];

var hotel3=[];
hotel3[0] = ["../img/fotos/capsalera/hotels/oasispark1.jpg", ""];
hotel3[1] = ["../img/fotos/capsalera/hotels/oasispark2.jpg", ""];
hotel3[2] = ["../img/fotos/capsalera/hotels/oasispark3.jpg", ""];
hotel3[3] = ["../img/fotos/capsalera/hotels/oasispark4.jpg", ""];
hotel3[4] = ["../img/fotos/capsalera/hotels/oasispark5.jpg", ""];
hotel3[5] = ["../img/fotos/capsalera/hotels/oasispark6.jpg", ""];
hotel3[6] = ["../img/fotos/capsalera/hotels/oasispark7.jpg", ""];
hotel3[7] = ["../img/fotos/capsalera/hotels/oasispark8.jpg", ""];

var hotel4=[];
hotel4[0] = ["../img/fotos/capsalera/hotels/aquarium1.jpg", ""];
hotel4[1] = ["../img/fotos/capsalera/hotels/aquarium2.jpg", ""];
hotel4[2] = ["../img/fotos/capsalera/hotels/aquarium3.jpg", ""];
hotel4[3] = ["../img/fotos/capsalera/hotels/aquarium4.jpg", ""];
hotel4[4] = ["../img/fotos/capsalera/hotels/aquarium5.jpg", ""];
hotel4[5] = ["../img/fotos/capsalera/hotels/aquarium6.jpg", ""];
hotel4[6] = ["../img/fotos/capsalera/hotels/aquarium7.jpg", ""];
hotel4[7] = ["../img/fotos/capsalera/hotels/aquarium8.jpg", ""];

var hotel5=[];
hotel5[0] = ["../img/fotos/capsalera/hotels/costabrava1.jpg", ""];
hotel5[1] = ["../img/fotos/capsalera/hotels/costabrava2.jpg", ""];
hotel5[2] = ["../img/fotos/capsalera/hotels/costabrava3.jpg", ""];
hotel5[3] = ["../img/fotos/capsalera/hotels/costabrava4.jpg", ""];
hotel5[4] = ["../img/fotos/capsalera/hotels/costabrava5.jpg", ""];
hotel5[5] = ["../img/fotos/capsalera/hotels/costabrava6.jpg", ""];
hotel5[6] = ["../img/fotos/capsalera/hotels/costabrava7.jpg", ""];
hotel5[7] = ["../img/fotos/capsalera/hotels/costabrava8.jpg", ""];

var hotel6=[];
hotel6[0] = ["../img/fotos/capsalera/hotels/neptuno1.jpg", ""];
hotel6[1] = ["../img/fotos/capsalera/hotels/neptuno2.jpg", ""];
hotel6[2] = ["../img/fotos/capsalera/hotels/neptuno3.jpg", ""];
hotel6[3] = ["../img/fotos/capsalera/hotels/neptuno4.jpg", ""];
hotel6[4] = ["../img/fotos/capsalera/hotels/neptuno5.jpg", ""];
hotel6[5] = ["../img/fotos/capsalera/hotels/neptuno6.jpg", ""];
hotel6[6] = ["../img/fotos/capsalera/hotels/neptuno7.jpg", ""];
hotel6[7] = ["../img/fotos/capsalera/hotels/neptuno8.jpg", ""];


var hotel7=[];
hotel7[0] = ["../img/fotos/capsalera/hotels/oasistossa1.jpg", ""];
hotel7[1] = ["../img/fotos/capsalera/hotels/oasistossa2.jpg", ""];
hotel7[2] = ["../img/fotos/capsalera/hotels/oasistossa3.jpg", ""];
hotel7[3] = ["../img/fotos/capsalera/hotels/oasistossa4.jpg", ""];
hotel7[4] = ["../img/fotos/capsalera/hotels/oasistossa5.jpg", ""];
hotel7[5] = ["../img/fotos/capsalera/hotels/oasistossa6.jpg", ""];
hotel7[6] = ["../img/fotos/capsalera/hotels/oasistossa7.jpg", ""];
hotel7[7] = ["../img/fotos/capsalera/hotels/oasistossa8.jpg", ""];


var hotel8=[];
hotel8[0] = ["../img/fotos/capsalera/hotels/sagaro1.jpg", ""];
hotel8[1] = ["../img/fotos/capsalera/hotels/sagaro2.jpg", ""];
hotel8[2] = ["../img/fotos/capsalera/hotels/sagaro3.jpg", ""];
hotel8[3] = ["../img/fotos/capsalera/hotels/sagaro4.jpg", ""];
hotel8[4] = ["../img/fotos/capsalera/hotels/sagaro5.jpg", ""];
hotel8[5] = ["../img/fotos/capsalera/hotels/sagaro6.jpg", ""];
hotel8[6] = ["../img/fotos/capsalera/hotels/sagaro7.jpg", ""];
hotel8[7] = ["../img/fotos/capsalera/hotels/sagaro8.jpg", ""];


var hotel9=[];
hotel9[0] = ["../img/fotos/capsalera/hotels/xaloc1.jpg", ""];
hotel9[1] = ["../img/fotos/capsalera/hotels/xaloc2.jpg", ""];
hotel9[2] = ["../img/fotos/capsalera/hotels/xaloc3.jpg", ""];
hotel9[3] = ["../img/fotos/capsalera/hotels/xaloc4.jpg", ""];
hotel9[4] = ["../img/fotos/capsalera/hotels/xaloc5.jpg", ""];
hotel9[5] = ["../img/fotos/capsalera/hotels/xaloc6.jpg", ""];
hotel9[6] = ["../img/fotos/capsalera/hotels/xaloc7.jpg", ""];
hotel9[7] = ["../img/fotos/capsalera/hotels/xaloc8.jpg", ""];

var ghthotels=[];
ghthotels[0] = ["../img/fotos/capsalera/ghthotels_equip.gif", ""];

var treballa=[];
treballa[0] = ["../img/fotos/capsalera/treballa.gif", ""];

var professionals=[];
professionals[0] = ["../img/fotos/capsalera/professionals.gif", ""];

var contacte=[];
contacte[0] = ["../img/fotos/capsalera/contacte.gif", ""];

var mapaweb=[];
mapaweb[0] = ["../img/fotos/capsalera/mapaweb.gif", ""];

var avislegal=[];
avislegal[0] = ["../img/fotos/capsalera/mapaweb.gif", ""];

////NO need to edit /////////////

function preloadctrl(im){
if (typeof im=='string'){
var imo=new Image();
imo.src=im;
}

}

if(document.images&&typeof preload_ctrl_images!='undefined'&&preload_ctrl_images){
var ctrlimgs=[previmg, stopimg, playimg, nextimg]
for (var i_tem = 0; i_tem < ctrlimgs.length; i_tem++)
if (ctrlimgs[i_tem])
preloadctrl(ctrlimgs[i_tem])
}

var iss=[]; //array to cache inter_slide instances

function inter_slide(){
if(!document.images||arguments.length==0)
return;
var imgs=arguments[0];
var width=null, height=null, delay=null;
if(arguments.length==2)
delay=arguments[1];
else if(arguments.length==3||arguments.length==4)
width=arguments[1], height=arguments[2], delay=arguments[3]? arguments[3] : null;
this.dom=(document.getElementById) //modern dom browsers
this.da=document.all
this.delay=imgs.delay? imgs.delay : delay? delay : 3500+iss.length*750;//velocitat de les fotos
this.nextimgidx=0;
iss[this.issid=iss.length]=this;
this.imgs=imgs;
if (imgs.random)
this.imgs.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.imgborder=imgs.border? parseInt(imgs.border) : 0;
if (!this.dom){
this.postimgs=new Array() //preload imgs
for (p=0;p<imgs.length;p++){
this.postimgs[p]=new Image()
this.postimgs[p].src=this.imgs[p][0]
}
}

if (this.dom){ //if modern browsers (ie: Firefox, IE5+)
this.faded=0;
this.loadimgidx=[];
this.fade=!imgs.nofade;
if(this.fade)
this.degree=10 //initial opacity degree (10%)
this.pausecheck=imgs.pause;
this.mouseovercheck=0
this.canvasbase="canvas"+this.issid
this.curcanvas=this.canvasbase+"_0"
this.descriptions=!imgs.no_descriptions;
this.man_start=imgs.manual_start;
this.addbr=!imgs.no_added_linebreaks;
this.no_auto=imgs.no_auto;
this.onclick=imgs.onclick;
this.specs=imgs.specs;
this.counter=imgs.counter;
this.ics=imgs.image_controls;
this.jumpto=imgs.jumpto;
this.no_c=imgs.no_controls;
this.target=imgs.target;
this.ualt=imgs.use_alt;
this.utit=imgs.use_title;
this.fadecolor=imgs.fadecolor;
this.ibut_hc=imgs.button_highlight;
this.dp=imgs.desc_prefix? imgs.desc_prefix : ' ';
this.imbcolor=imgs.border_color;
this.imbstyle=imgs.border_style;
this.width=imgs.width? imgs.width : width? width : null
this.width=this.width? this.width+this.imgborder*2 : null;
this.height=imgs.height? imgs.height : height? height : null
this.height=this.height? this.height+this.imgborder*2 : null;
var ief='', dims='';
if(this.width||this.height)
dims=this.width&&this.height? 'width:'+this.width+'px;height:'+this.height+'px;' : this.width? 'width:'+this.width+'px;' : 'height:'+this.height+'px;';
if(this.fade&&document.body&&document.body.style)
ief=document.body.filters? 'filter:progid:DXImageTransform.Microsoft.alpha(opacity=0);' : typeof document.body.style.opacity=='string'? 'opacity:0;' : 'opacity:0.10;-moz-opacity:0.10;-khtml-opacity:0.10;';
var brs=this.addbr? '' : '';
if (imgs.controls_top){
this.controls();
document.write(brs)
}
document.write('<div id="master'+this.issid+'" style="position:relative;'+dims+'overflow:hidden;margin:0 auto;"><div id="'+this.canvasbase+'_0" style="position:absolute;'+dims+'top:0;left:0;'+ief+'background-color:'+(imgs.fadecolor? imgs.fadecolor : 'white')+'"><\/div><div id="'+this.canvasbase+'_1" style="position:absolute;'+dims+'top:0;left:0;'+ief+'background-color:'+(imgs.fadecolor? imgs.fadecolor : 'white')+'"><\/div><\/div>')
if(this.descriptions)
document.write(''+this.dp+'<span id="imgdsc'+this.issid+'">&nbsp;<\/span>');
if(this.counter&&!this.descriptions)
//document.write(brs);
if(this.counter)
this.cntrl()
if (!imgs.controls_top){
//document.write(this.ics? '' : brs);
this.controls();
}
}
else
document.write('<img name="defaultslide'+this.issid+'" src="'+this.postimgs[0].src+'">')


if (this.dom) //if modern browsers such as Firefox, IE5+
this.startit()
else{
this.nextimgidx++
setInterval("iss["+this.issid+"].rotateimg()", this.delay)
}
}

inter_slide.prototype.cntrl=function(){
this.cpad=this.imgs.length.toString().length;
//document.write('<div align="center">Viewing Image: <b><span id="thecnt'+this.issid+'"><\/span><\/b> of<span style="font-size:1ex;">&nbsp;</span>&nbsp;<b>'+this.imgs.length+'<\/b><\/div>');
//document.write('<div align="center">Viewing Image: <b><span id="thecnt'+this.issid+'"><\/span><\/b> of<span style="font-size:1ex;">&nbsp;</span>&nbsp;<b>'+this.imgs.length+'<\/b><\/div>');
}


inter_slide.prototype.controls=function(){
//var brs=this.addbr? '<br>' : ' &nbsp;';
var brs=this.addbr? '' : '';
/*
if(!this.ics&&!this.no_c)
document.write('<div align="center"><input id="prev'+this.issid+'" disabled type="button" value=" << " onclick="iss['+this.issid+'].changeimg(false, \'nav\');">\n'+
(this.no_auto? '&nbsp;&nbsp;&nbsp;' : ' <input id="gostp'+this.issid+'" type="button" value=" Stop " onclick="iss['+this.issid+'].gostop(this);">\n')+
' <input id="next'+this.issid+'" disabled type="button" value=" >> " onclick="iss['+this.issid+'].changeimg(true, \'nav\');">'+(this.jumpto? brs+'Jump to: <input disabled type="text" size="'+this.imgs.length.toString().length+'" id="goto'+this.issid+'" onkeydown="iss['+this.issid+'].jumper(event);"><input id="go'+this.issid+'" disabled type="button" onclick="iss['+this.issid+'].jumper();" value="GO">' : '')+'<\/div>')
else if(this.ics&&!this.no_c){
var op=document.body.filters? ' style="filter:alpha(opacity=100);"' : ' style="opacity:'+(this.man_start? 0.99 : 0.45)+';"';
document.write('<table align="center" cellpadding="0" cellspacing="10"><tr><td valign="middle" align="center" style="padding:2px 2px 1px 2px;"><input'+op+' onmouseover="iss['+this.issid+'].ibute(this,1);" onmouseout="iss['+this.issid+'].ibute(this,2);" onmousedown="iss['+this.issid+'].ibute(this,3);" onmouseup="iss['+this.issid+'].ibute(this,4);" type="image" title="Previous" id="prev'+this.issid+'" src="'+previmg+'" onclick="iss['+this.issid+'].changeimg(false, \'nav\');"><\/td>'+(this.no_auto? '<td>&nbsp;<\/td>' : '<td valign="middle" align="center" style="padding:2px 2px 1px 2px;"><input onmouseover="iss['+this.issid+'].ibute(this,1);" onmouseout="iss['+this.issid+'].ibute(this,2);" onmousedown="iss['+this.issid+'].ibute(this,3);" onmouseup="iss['+this.issid+'].ibute(this,4);" title="Stop" type="image" id="gostp'+this.issid+'" src="'+(this.g_fPlayMode? playimg : stopimg)+'" onclick="iss['+this.issid+'].gostop(this);"><\/td>')+'<td valign="middle" align="center" style="padding:2px 2px 1px 2px;"><input'+op+' onmouseover="iss['+this.issid+'].ibute(this,1);" onmouseout="iss['+this.issid+'].ibute(this,2);" onmousedown="iss['+this.issid+'].ibute(this,3);" onmouseup="iss['+this.issid+'].ibute(this,4);" type="image" title="Next" id="next'+this.issid+'" src="'+nextimg+'" onclick="iss['+this.issid+'].changeimg(true, \'nav\');"><\/td><\/tr><\/table>\n');
}
else
*/
this.no_c=1;

}


inter_slide.prototype.jumper=function(e){
var key;
if(typeof e=='object')
key=e.keyCode? e.keyCode : e.which? e.which : 1;
if(key&&key!==13)
return;
var num=typeof e=='number'? e : parseInt(this.go('goto'+this.issid).value);
if(num<=this.imgs.length&&num>0){
this.nextimgidx=num-2;
this.changeimg(true, 'jump');
}
}

inter_slide.prototype.ibute=function(obj, i){
if(!obj.parentNode)
return;
if(i==1)
obj.parentNode.style.backgroundColor=this.ibut_hc? this.ibut_hc : 'yellow';
else if(i==2)
obj.parentNode.style.backgroundColor='transparent';
else if(i==3){
obj.parentNode.style.borderTop=obj.parentNode.style.borderLeft='1px solid gray';
obj.parentNode.style.paddingRight='1px';obj.parentNode.style.paddingBottom=0;
}
if (i==2||i==4){
obj.parentNode.style.borderTop=obj.parentNode.style.borderLeft='none';
obj.parentNode.style.paddingRight='2px';obj.parentNode.style.paddingBottom='1px';
}
}

inter_slide.prototype.fadepic=function(){
if (this.fade&&this.degree<100){
this.faded=0
this.degree+=10
if (this.tempobj.filters&&this.tempobj.filters[0]){
if (typeof this.tempobj.filters[0].opacity=="number") //if IE6+
this.tempobj.filters[0].opacity=this.degree
else //else if IE5.5-
this.tempobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (this.tempobj.style.MozOpacity)
this.tempobj.style.MozOpacity=this.degree/101
else if (this.tempobj.style.KhtmlOpacity)
this.tempobj.style.KhtmlOpacity=this.degree/100
else if (this.tempobj.style.opacity&&!this.tempobj.filters)
this.tempobj.style.opacity=this.degree/101
}
else{
this.faded=1
clearInterval(this.fadeclear)
this.nextcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_0" : this.canvasbase+"_1"
this.tempobj=this.go(this.nextcanvas)
if(this.playing)
this.changeimg()
}
}

inter_slide.prototype.populateslide=function(picobj, picidx){
if(document.getElementsByTagName){
if(picobj.getElementsByTagName('a')[0]&&picobj.getElementsByTagName('a')[0].onclick)
picobj.getElementsByTagName('a')[0].onclick=null;
if(picobj.getElementsByTagName('img')[0]&&picobj.getElementsByTagName('img')[0].onload)
picobj.getElementsByTagName('img')[0].onload=null;
}
picobj.style.backgroundColor=this.imgs[picidx].fadecolor? this.imgs[picidx].fadecolor : this.fadecolor? this.fadecolor : 'white';
var slideHTML=''
if (this.imgs[picidx][2]){ //if associated link exists for img
var specs=this.imgs[picidx][4]? ", '"+this.imgs[picidx][4]+"'" : this.specs? ", '"+this.specs+"'" : '';
slideHTML+='<a href="'+this.imgs[picidx][2]+'"'+(this.imgs[picidx][3]? ' target="'+this.imgs[picidx][3]+'"' : this.target? ' target="'+this.target+'"' : '')+' onclick="'+(this.onclick? this.onclick : 'window.open(this.href, (this.target? this.target : \'_self\')'+specs+');return false;')+'">'
}
slideHTML+='<img id="theimg'+picidx+'_'+this.issid+'" src="'+(this.loadimgidx[picidx]&&typeof this.loadimgidx[picidx].complete=='boolean'&&this.loadimgidx[picidx].complete? this.loadimgidx[picidx].src : this.imgs[picidx][0])+'" alt="'+(this.ualt? this.imgs[picidx][1] : 'Slide Show Image')+'" title="'+(this.utit? this.imgs[picidx][1] : '')+'" '+(this.imbcolor&&!this.imgs[picidx].noborder? 'style="border:'+this.imgborder+'px '+(this.imbstyle? this.imbstyle : 'solid')+' '+this.imbcolor+';"' : 'border="'+(this.imgs[picidx].noborder? '0' : this.imgborder)+'"')+(!this.width||!this.height? ' onload="iss['+this.issid+'].imgload(this);"' : '')+'>'
if (this.imgs[picidx][2]) //if associated link exists for img
slideHTML+='<\/a>'
slideHTML+=''
picobj.innerHTML=slideHTML
}

inter_slide.prototype.buttons=function(bool){
if(this.no_c)
return;
var next=this.go('next'+this.issid), prev=this.go('prev'+this.issid);
next.disabled=prev.disabled=!bool;
next.title=bool? 'next' : '';
prev.title=bool? 'previous' : '';
if(this.jumpto&&!this.ics)
this.go('go'+this.issid).disabled=this.go('goto'+this.issid).disabled=!bool;
if(this.ics){
if(!this.no_auto){
var go=this.go('gostp'+this.issid)
go.title=bool? 'Play' : 'Stop';
go.src=bool? playimg : stopimg;
}
if(prev.filters&&prev.parentNode)
prev.parentNode.style.filter=next.parentNode.style.filter='alpha(opacity='+(bool? 100 : 45)+')';
else if(prev.style.opacity&&!prev.filters)
prev.style.opacity=next.style.opacity=bool? 0.99 : 0.45;
}
}

inter_slide.prototype.imgload=function(el){
if(!el&&!this.imgel)
return;
var el=el? el : this.imgel;
if(el.width==0||el.height==0){
this.imgel=el;
var cacheobj=this;
clearTimeout(this.getdim)
this.getdim=setTimeout(function(){cacheobj.imgload()}, 200)
return;
}
var m=this.go('master'+this.issid).style, c0=this.go(this.canvasbase+'_0').style, c1=this.go(this.canvasbase+'_1').style;
if(!this.width){
this.width=el.width+this.imgborder*2;
m.width = c0.width = c1.width = this.width+'px';
}
if(!this.height){
this.height=el.height+this.imgborder*2;
m.height = c0.height = c1.height = this.height+'px';
}
}

inter_slide.prototype.changeimg=function(bool,nav){
if(this.playing){
this.buttons(false)
this.nextimgidx=(this.keeptrack()<this.imgs.length-1)? this.keeptrack()+1 : 0
this.populateslide(this.tempobj, this.nextimgidx)
if(bool)
this.rotateimg()
else{
clearTimeout(this.inprocess)
this.inprocess=setTimeout("iss["+this.issid+"].rotateimg()", this.delay)
}
}
else {
if(!this.faded){
if(nav&&nav=='nav')
return;
this.nextimgidx=this.keeptrack()+(bool? 1 : -1)
this.nextimgidx=(this.nextimgidx<this.imgs.length)? this.nextimgidx : this.nextimgidx-this.imgs.length
this.nextimgidx=(this.nextimgidx>-1)? this.nextimgidx : this.imgs.length+this.nextimgidx
return;
}
if(this.fadeclear)
clearInterval(this.fadeclear);
if(bool){
var loadidx=this.nextimgidx+2
loadidx=(loadidx<this.imgs.length)? loadidx : loadidx-this.imgs.length;
loadidx=(loadidx>-1)? loadidx : this.imgs.length+loadidx;
this.loadimgidx[loadidx]=new Image();
this.loadimgidx[loadidx].src=this.imgs[loadidx][0];
}
else{
var loadidx=this.nextimgidx-2
loadidx=(loadidx<this.imgs.length)? loadidx : loadidx-this.imgs.length
loadidx=(loadidx>-1)? loadidx : this.imgs.length+loadidx
this.loadimgidx[loadidx]=new Image();
this.loadimgidx[loadidx].src=this.imgs[loadidx][0];
}
if(nav&&nav=='jump')
this.nextimgidx++;
else
this.nextimgidx=this.keeptrack()+(bool? 1 : -1)
this.nextimgidx=(this.nextimgidx<this.imgs.length)? this.nextimgidx : this.nextimgidx-this.imgs.length
this.nextimgidx=(this.nextimgidx>-1)? this.nextimgidx : this.imgs.length+this.nextimgidx
this.populateslide(this.tempobj, this.nextimgidx)
this.rotateimg()
}
}

inter_slide.prototype.go=function(id){
return this.da? this.da[id] : document.getElementById(id);
}

inter_slide.prototype.rotateimg=function(){
if(this.dom){
var cimg=this.go('theimg'+this.nextimgidx+'_'+this.issid)? this.go('theimg'+this.nextimgidx+'_'+this.issid) : null;
if(cimg&&typeof cimg.complete=='boolean'&&!cimg.complete){
var cacheobj=this
clearTimeout(this.loading)
this.loading=setTimeout(function(){cacheobj.rotateimg()}, 300)
return;
}
if (this.mouseovercheck==1){
var cacheobj=this
clearTimeout(this.mousep)
this.mousep=setTimeout(function(){cacheobj.rotateimg()}, 100)
return;
}
if(this.fade)
this.resetit()
var crossobj=this.tempobj=this.go(this.curcanvas)
crossobj.style.zIndex++
var othercanvas=this.curcanvas==this.canvasbase+"_0"? this.go(this.canvasbase+"_1") : this.go(this.canvasbase+"_0");
othercanvas.style.zIndex=0;
if(this.descriptions)
this.go('imgdsc'+this.issid).innerHTML = this.imgs[this.keeptrack()][1];
if(this.counter){
var padit='';
for (var p=0; p<this.cpad-(this.nextimgidx+1).toString().length; p++)
padit+='<span style="visibility:hidden;">0</span>';
this.go('thecnt'+this.issid).innerHTML = padit+(this.keeptrack()<this.imgs.length? this.keeptrack()+1 : 1);
}
if (this.jumpto)
this.go('goto'+this.issid).value=this.keeptrack()<this.imgs.length? this.keeptrack()+1 : 1;
this.jumperidx=this.keeptrack()<this.imgs.length? this.keeptrack()+1 : 1;
var fadeobj=this
clearInterval(this.fadeclear)
this.fadeclear=setInterval(function(){fadeobj.fadepic()},80)//temps de transicio entre fotos
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var v4imgobj=document.images['defaultslide'+this.issid]
v4imgobj.src=this.postimgs[this.nextimgidx].src
this.nextimgidx=(this.nextimgidx<this.imgs.length-1)? this.nextimgidx+1 : 0
}
}

inter_slide.prototype.resetit=function(){
this.degree=10
var crossobj=this.go(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=this.degree/100
else if (crossobj.style.opacity&&!crossobj.filters)
crossobj.style.opacity=this.degree/101
}

inter_slide.prototype.startit=function(){
this.playing=1
var crossobj=this.go(this.curcanvas)
this.populateslide(crossobj, this.nextimgidx)
if (this.pausecheck==1){ //if slideshow should pause onmouseover
var cacheobj=this
var crossobjcontainer=this.go("master"+this.issid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimg()
if(this.no_auto)
this.gostop();
else if(this.man_start)
this.gostop(this.go('gostp'+this.issid));
else if(this.ics&&document.body.filters){ //kludge for IE5.5 bug
this.buttons(false);
}
}

inter_slide.prototype.gostop=function(el){
if(el)
el.value=el.value==' Stop '? ' Play ' : ' Stop ';
if(this.inprocess&&this.playing){
clearTimeout(this.inprocess);
this.nextimgidx-=this.faded;
}
this.playing=!this.playing;
if(this.playing){
clearInterval(this.fadeclear)
this.faded=1
this.changeimg(true);
}
else{
var loadidx=(this.keeptrack()<this.imgs.length-1)? this.keeptrack()+1 : 0
this.loadimgidx[loadidx]=new Image();
this.loadimgidx[loadidx].src=this.imgs[loadidx][0];
this.jumper(this.jumperidx? this.jumperidx : 0)
this.buttons(true);
}
}

inter_slide.prototype.keeptrack=function(){
if(!document.getElementsByTagName)
return this.nextimgidx;
var canvases=[this.go('canvas'+this.issid+'_0'), this.go('canvas'+this.issid+'_1')]
if(canvases[0].style.zIndex>canvases[1].style.zIndex&&canvases[0].getElementsByTagName("img")[0])
return parseInt(canvases[0].getElementsByTagName('img')[0].id.replace(/theimg/, ''))
else if(canvases[1].getElementsByTagName("img")[0])
return parseInt(canvases[1].getElementsByTagName('img')[0].id.replace(/theimg/, ''))
else
return this.nextimgidx;
}