/*
 * Funciones desarrolladas por Soluciones Nexus.
 * http://www.solucionesnexus.es/
 *
 * Para enlazar:
 *  <script language="javaScript" src="js/funciones.js" type="text/javascript"></script>
 * 
 *
 * · function obtenEstilo(c,p);
 * · function obtenElles (p);
 * · function obtenElls(p);
 * · function rellenaMinis(coleccion, inicio);
 * */
 
 
 /* Devuelve una entrada de elles o ells */
function obtenEstilo(e,p)
{
 	switch (e)
 	{
 		case 0: return obtenElles(p);
 						break;
 		case 1: return obtenElls(p);
 						break;
 	}
}
 
 /* Devuelve una entrada de la lista de imagens de Elles */
 function obtenElles(p)
 {
 		var i=0;
 		tam=1;
		imagen=new Array(tam);
		for(i=0;i<tam;i++) imagen[i]=new Array(2);
 	
		imagen[0][0]="0001";imagen[0][1]="Novelda Elles";

	 	
	 	// Nos aseguramos que la imagen existe
	 	if( (p >= 0) && (p < tam) )
	 		return imagen[p];
	 	else
	 		return null;
}

/* Devuelve una entrada de la lista de imagens de Ells */
 function obtenElls(p)
 {
 		var i=0;
 		tam=1;
		imagen=new Array(tam);
		for(i=0;i<tam;i++) imagen[i]=new Array(2);
 	
		imagen[0][0]="0001";imagen[0][1]="Novelda Ells";

 		
 		
	 	
	 	// Nos aseguramos que la imagen existe
	 	if( (p >= 0) && (p < tam) )
	 		return imagen[p];
	 	else
	 		return null;
}


/* Mete una imagen en las miniaturas */
function rellenaMinis(estilo, inicio)
{
	pos=inicio;

	aux=obtenEstilo(estilo, pos);

	if(estilo == 0) // Elles
		 ruta="imag/tienda/";
	if(estilo == 1) // Ells
		 ruta="imag/tienda/";


	id="foto";

	if(aux != null)
	{
		document.getElementById(id).src=ruta+aux[0]+".jpg";
		document.getElementById(id).alt=aux[1];
		document.getElementById(id).title=aux[1];
	}
	else
	{
		document.getElementById(id).src="imag/tienda/0000.jpg";
		document.getElementById(id).alt="";
		document.getElementById(id).title="";
	}
}


