var nind;
var eqind = new Array;
var idind = new Array;
var enind = new Array;
var deind = new Array;

//ind.sort();

for(x=0;x<ind.length;x++)
{barra=ind[x].indexOf("=");
deind[x]=ind[x].substring(0,barra);
resta=ind[x].substring(barra+1,ind[x].length);
barra=resta.indexOf("=");
idind[x]=resta.substring(0,barra);
resta=resta.substring(barra+1,ind[x].length);
barra=resta.indexOf("=");
enind[x]=resta.substring(0,barra);
resta=resta.substring(barra+1,ind[x].length);
barra=resta.indexOf("=");
eqind[x]=resta.substring(barra+1,resta.length);
}

function anarind ()
{if (enind[document.frmind.txtind.selectedIndex]>"")
location.href=enind[document.frmind.txtind.selectedIndex];
frmind.reset();}

function pleind () 
{ var nueva;
with(document.frmind.txtind)
for(x=0;x<deind.length;x++)
{nueva=new Option(deind[x],'',false,false);
document.frmind.txtind.options[x]=nueva;}
document.frmind.txtind.selectedIndex=0;
}

var n = 0;
var hits = 0

timedelay = 30;		// 30 segons  	
timedelay *= 1000; 	// 10 segons

var imgs = new Array();
imgs=eqind;
var dsp = new Array();
dsp.length=imgs.length;

var nr_of_links = imgs.length-1;

function radonmize ()
{while (hits < (nr_of_links + 1))
{rnd = Math.round(Math.random() * nr_of_links);
{while (imgs[rnd] > "") 
{dsp[hits]=rnd;
imgs[rnd] = "";
hits += 1}
}}rotate()}

function hook() 
{var p = (n == 0) ? dsp[dsp.length-1] : dsp[n-1];
//document.location.href = enind[p];
}

function rotate() 
{document.picform.slideshow.src = idind[dsp[n]];
document.frmind.txtind.selectedIndex=dsp[n];
(n == (imgs.length - 1)) ? n = 0 : n++;
// window.setTimeout("rotate()", timedelay);
}

function imatge() 
{document.picform.slideshow.src = idind[document.frmind.txtind.selectedIndex];}

function anaramunt() 
{
document.frmind.txtind.selectedIndex = document.frmind.txtind.selectedIndex - 1;
//alert(document.frmind.txtind.selectedIndex + ' ' + idind[document.frmind.txtind.selectedIndex]);
if (document.frmind.txtind.selectedIndex == -1)
{document.frmind.txtind.selectedIndex = idind.length - 1}
//document.picform.slideshow.src = idind[document.frmind.txtind.selectedIndex];
imatge();
}

function anaravall() 
{
document.frmind.txtind.selectedIndex = document.frmind.txtind.selectedIndex + 1;
//alert(document.frmind.txtind.selectedIndex + ' ' + idind[document.frmind.txtind.selectedIndex]);
if (document.frmind.txtind.selectedIndex == -1)
{document.frmind.txtind.selectedIndex = 0}
//document.picform.slideshow.src = idind[document.frmind.txtind.selectedIndex];
imatge();
}







