// JavaScript Document
function preload_array(vector){
	for(contador in vector){
		MM_preloadImages(vector[contador]);
	}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function switchImage(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src = imgSrc;
    }
  }
}

function mostra(cat,imatges)
{
	img1 = document.getElementById("foto");
	
	img1.src = imatges[cat];
}

function seguent(imatges,pos)
{
	pos=(pos+1)%imatges.length;
	switchImage("foto",imatges[pos]);
	return(pos);
}

function anterior(imatges,pos)
{
	pos=(pos-1);
	if(pos<0)pos=imatges.length-1;
	switchImage("foto",imatges[pos]);
	return(pos);
}

var pos=0;






