 function writeLayer(layerID,txt){
            if(document.getElementById){
                  document.getElementById(layerID).innerHTML=txt;
            }else if(document.all){
                  document.all[layerID].innerHTML=txt;
            }else if(document.layers){
                  with(document.layers[layerID].document){
                        open();
                        write(txt);
                        close();
                  }
            }
 }



<!-- ********************************* -->
 function displayProducts (start, vector, conjunt)
 <!-- ********************************* -->
 {
  offset = arr_TecImages.length;
  
  if (offset > 2){
   offset = 3;
  }
   
  // Show three ProductImages starting with "start"
  //eval("document.images.prod_" + vector + ".src = arr_ProductImages" + vector + "[start]");
  eval("document.images.prod_" + vector + ".src = PRD_IMAGEN_"+ vector +"_"+ start +".src");
  //document.getElementById("color1") = arr_ProductColor[start]
  
  eval("writeLayer('color_" + vector + "',arr_ProductColor" + vector + "[start])");
  switch(vector)
  {
  case 1:
   eval("writeLayer('SPcamiseta',arr_ProductColor" + vector + "[start])");
   if (conjunt ==1 )
   {
	   writeLayer('SPpantalon',arr_ProductColor2[start]);
	   document.UserForm.codigo2.value= arr_ProductUrls2[start];
  	   document.UserForm.color2.value= arr_ProductColor2[start];
   }
   if (conjunt ==2 )
   {
	   writeLayer('SPpantalon',arr_ProductColor2[start]);
	   document.UserForm.codigo2.value= arr_ProductUrls2[start];
  	   document.UserForm.color2.value= arr_ProductColor2[start];
	    writeLayer('SPmedia',arr_ProductColor3[start]);
	   document.UserForm.codigo3.value= arr_ProductUrls3[start];
  	   document.UserForm.color3.value= arr_ProductColor3[start];
   }
  break
  case 2:
   eval("writeLayer('SPpantalon',arr_ProductColor" + vector + "[start])");
  break
  case 3:
   eval("writeLayer('SPmedia',arr_ProductColor" + vector + "[start])");
  break
  }
  
  //document.writeln = arr_ProductUrls[start];
  eval("document.UserForm.codigo" + vector + ".value= arr_ProductUrls" + vector + "[start]");
  eval("document.UserForm.color" + vector + ".value= arr_ProductColor" + vector + "[start]");

  if((start) >= eval("arr_ProductImages" + vector + ".length - 1")) {
   eval("document.images.prod_right" + vector + ".src = '/imatges/IMATGESINTERFACE/ESPA%D1OL/BOTONS/spacer2.gif'");
  } else {
	   	 if(((start) == eval("arr_ProductImages" + vector + ".length - 2")) || (start < 2)) 
	 {
   eval("document.images.prod_right" + vector + ".src = RIGHT.src");
  	}
  }
  
  if (start == 0) {
   eval("document.images.prod_left" + vector + ".src = '/imatges/IMATGESINTERFACE/ESPA%D1OL/BOTONS/spacer2.gif'");
  } else 
  {
  	if (start == 1)
	{
	eval("document.images.prod_left" + vector + ".src = LEFT.src");
	}
  }
  
  return;
 }
 
 <!-- ********************************* --> 
 function productsScrollLeft (vector,conjunt)
 <!-- ********************************* -->
 {
  if (eval("counter_Product" + vector + "[0] > 0")) {
   eval("counter_Product" + vector + "[0]--");
   eval("displayProducts(counter_Product" + vector + "[0], vector, conjunt)");
  }
  return;
 }
 
 <!-- ********************************* --> 
 function productsScrollRight (vector,conjunt)
 <!-- ********************************* -->
 {
  if (eval("counter_Product" + vector + "[0] < (arr_ProductImages" + vector + ".length - 1)"))
  {
   eval("counter_Product" + vector + "[0]++");
   eval("displayProducts(counter_Product" + vector + "[0], vector, conjunt)");
  }
  return;
 }

  
 function ValidarDatos()
  <!-- ********************************* -->
  {
	desbloquear_select();
 	var a, b, c
	
	a = 0
	for (j=1;j<=numerotallas;j++)
	{
		a = a + eval("parseInt(document.UserForm.TALLASAM" + j + ".value)")
	}

	b = 0
	for (j=1;j<=numerotallas;j++)
	{
		b = b + eval("parseInt(document.UserForm.TALLAPAN" + j + ".value)")
	}

	c = 0
	for (j=1;j<=3;j++)
	{
		c = c + eval("parseInt(document.UserForm.TALLAMIT" + j + ".value)")
	}
	
	if (esconjunt == 1)
	{
		
		nosoniguals = 0
		for (j=1;j<=numerotallas;j++)
		{
		if ( eval("parseInt(document.UserForm.TALLASAM" + j + ".value)") != eval("parseInt(document.UserForm.TALLAPAN" + j + ".value)") ) 
		{
		nosoniguals = 1
		}
		}
		if (nosoniguals == 1)
		{
		
		alert("¡¡ATENCIÓN!! En los conjuntos el número de tallas seleccionadas de camisetas y pantalones debe ser iguales");
   		return false;
		}
	}

	if (prendaunica == 0)
	{
	if ((a == 0 || b == 0 || c==0))
	{alert("¡¡ATENCIÓN!! Debe elegir como mínimo una talla de camiseta, pantalón y media");
   	return false;}
	if ((a != b) | (b != c))
 	{alert("¡¡ATENCIÓN!! El número total de camisetas, pantalones y medias debe ser igual");
   	return false;}
	}
//	return true;
//  }
  
  if (esconjunt == 3)
	{
	if (a == 0 || b == 0 )
	{alert("¡¡ATENCIÓN!! Debe elegir como mínimo una talla de camiseta y pantalón");
   	return false;}
	if (a != b)
 	{alert("¡¡ATENCIÓN!! El número total de camisetas y pantalones debe ser igual");
   	return false;}
	}
	return true;
  }
 
 function EnviarForm() { //v3.0
  if(document.UserForm.onsubmit())
  {//this check triggers the validations
     document.UserForm.submit();
  }
 }
 
 

