var estampar_camiseta2 = 0
var ayuda_estampacion = 0
totalequipaciones = 0
precioestampacioncamiseta = 2.50
precioestampacionpantalon = 1.95
precionombre = 2.95
estampacioncamiseta = 0
estampacionpantalon = 0
totalpublicidades = 0
totalescudos = 0
prendaunica = 0
conjuntoportero = 0


if (document.images)
   {
    ICO_CAMISETAOFF = new Image()
    ICO_CAMISETAOFF.src=  "/imatges/IMATGESINTERFACE/ESPAÑOL/BOTONS/ICO_CAMISETAOFF.JPG"

    ICO_PANTALOOFF = new Image()
    ICO_PANTALOOFF.src=  "/imatges/IMATGESINTERFACE/ESPAÑOL/BOTONS/ICO_PANTALOOFF.JPG"
	
	ICO_CAMISETAESCUDOOFF = new Image()
    ICO_CAMISETAESCUDOOFF.src=  "/imatges/IMATGESINTERFACE/ESPAÑOL/BOTONS/ICO_CAMISETAESCUDOOFF.JPG"

	ICO_CAMISETAPUBLIOFF = new Image()
    ICO_CAMISETAPUBLIOFF.src=  "/imatges/IMATGESINTERFACE/ESPAÑOL/BOTONS/ICO_CAMISETAPUBLIOFF.JPG"
	
	ICO_CAMISETA = new Image()
    ICO_CAMISETA.src=  "/imatges/IMATGESINTERFACE/ESPAÑOL/BOTONS/ICO_CAMISETA.JPG"

    ICO_PANTALO = new Image()
    ICO_PANTALO.src=  "/imatges/IMATGESINTERFACE/ESPAÑOL/BOTONS/ICO_PANTALO.JPG"
	
	ICO_CAMISETAESCUDO = new Image()
    ICO_CAMISETAESCUDO.src=  "/imatges/IMATGESINTERFACE/ESPAÑOL/BOTONS/ICO_CAMISETAESCUDO.JPG"

	ICO_CAMISETAPUBLI = new Image()
    ICO_CAMISETAPUBLI.src=  "/imatges/IMATGESINTERFACE/ESPAÑOL/BOTONS/ICO_CAMISETAPUBLI.JPG"
	
	LEFT = new Image()
    LEFT.src=  "/imatges/IMATGESINTERFACE/ESPAÑOL/BOTONS/LEFT.GIF"
	
	RIGHT = new Image()
    RIGHT.src=  "/imatges/IMATGESINTERFACE/ESPAÑOL/BOTONS/RIGHT.GIF"
		
	TIPONUMERO1 = new Image()
    TIPONUMERO1.src=  "/imatges/imatgesprod/equipacions/numeros/STANDARDmania.jpg"
	
	TIPONUMERO2 = new Image()
    TIPONUMERO2.src=  "/imatges/imatgesprod/equipacions/numeros/STANDARDbrazil.jpg"
	
	TIPONUMERO3 = new Image()
    TIPONUMERO3.src=  "/imatges/imatgesprod/equipacions/numeros/STANDARDcutline.jpg"
	
	TIPONUMERO4 = new Image()
    TIPONUMERO4.src=  "/imatges/imatgesprod/equipacions/numeros/nadidas.jpg"
	
	TIPONUMERO5 = new Image()
    TIPONUMERO5.src=  "/imatges/imatgesprod/equipacions/numeros/nnike.jpg"
	
	TIPONUMERO6 = new Image()
    TIPONUMERO6.src=  "/imatges/imatgesprod/equipacions/numeros/ncursiva.jpg"
	
	document.getElementById('img_numerosamarreta').src = TIPONUMERO1.src
	document.getElementById('img_numeropantalo').src = TIPONUMERO1.src
  
  
    
  }
  

function cargarimagenes()
{
longitud = 0
	layerID = 'color_1'
	txt = 'Cargando imagenes...'
	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()
						                  }
            }
	
   	for (cont1=1;cont1<=3;cont1++)
   	{
   	eval("longitud = arr_ProductImages" + cont1+".length")
   	cont3 = 1
   		for(cont2=0;cont2<=longitud;cont2++)
   		{
   		eval("PRD_IMAGEN_"+ cont1 +"_"+ cont2 +"= new Image()")
   		eval("PRD_IMAGEN_"+ cont1 +"_"+ cont2 +".src = arr_ProductImages" + cont1 +"[" + cont2 + "]")
   		cont3++
   		}
   	
	}

return
}
  
  
function ciego(id)
{
document.getElementById(id).style.display = 'none'
document.getElementById('Iframe_ayuda').src = ''
}

function ayuda(pagina)
{
document.getElementById('Div_ayuda').style.display = 'block'
document.getElementById('Iframe_ayuda').src = pagina + '.asp'
}



function tabChange(id)
{
switch(id)
{
case 1:
	document.getElementById('Div_Seleccionar_Color').style.display = 'block'
	document.getElementById('derecha').style.display = 'block'
	document.getElementById('Div_Estampaciones').style.display = 'none'
	document.getElementById('Tab_1').className="TD_MENU"
	document.getElementById('Tab_2').className="TD_MENU_OFF"
	document.getElementById('Tab_2').style.bgGolor = '#FF0000'
	document.getElementById('lista_productos').style.display = 'none'
	document.getElementById('continuar2').style.display = 'none'
	document.getElementById('continuar1').style.display = 'block'
break
case 2:
 	if (ValidarDatos ())
	{
	document.getElementById('Div_Estampaciones').style.display = 'block'
	document.getElementById('Div_Seleccionar_Color').style.display = 'none'
	document.getElementById('continuar2').style.display = 'block'
	document.getElementById('continuar1').style.display = 'none'
	document.getElementById('Tab_1').className="TD_MENU_OFF"
	document.getElementById('Tab_2').className="TD_MENU"
	//document.getElementById('Tab_1').parentNode.bgGolor = '#FF0000'
	//document.getElementById('Tab_1').style.bgGolor = '#FF0000'
	document.getElementById('derecha').style.display = 'none'
	document.getElementById('lista_productos').style.display = 'block'
	bloquear_select()
		if (ayuda_estampacion == 0)
		{
		ayuda_estampacion = 1
		ayuda('ayuda_estampacion')
		}
	}
break
}
}

function bloquear_select()
{
	for (tal=1;tal<=numerotallas;tal++)
	{
	if( eval("document.UserForm.TALLASAM" & tal) != null)
	{
		eval("document.UserForm.TALLASAM" + tal + ".disabled=true")
		eval("document.UserForm.TALLAPAN" + tal + ".disabled=true")
		if( eval("document.UserForm.TALLAMIT" & tal) != null)
		{
		eval("document.UserForm.TALLAMIT" + tal + ".disabled=true")
		}
	}
	}
return
}

function desbloquear_select()
{
	for (tal=1;tal<=numerotallas;tal++)
	{
	if( eval("document.UserForm.TALLASAM" & tal) != null)
	{
		eval("document.UserForm.TALLASAM" + tal + ".disabled=false")
		eval("document.UserForm.TALLAPAN" + tal + ".disabled=false")
		if( eval("document.UserForm.TALLAMIT" & tal) != null)
		{
		eval("document.UserForm.TALLAMIT" + tal + ".disabled=false")
		}
	}
	}
}



function saltar(ID, IMATGE)
{
var canvi = IMATGE.replace('.JPG','')
//eval("document.getElementById('ICO" + ID + "').src = '/imatges/IMATGESINTERFACE/ESPAÑOL/BOTONS/' + IMATGE")
eval("document.getElementById('ICO" + ID + "').src = " + canvi +".src")
eval("document.getElementById('DIV_ICO" + ID + "').style.top = -4")
eval("document.getElementById('TEXTO" + ID + "').style.color = '#FFFFFF'")
eval("document.getElementById('TEXTO" + ID + "').style.backgroundColor = '#0033ff'")
}
function bajar(ID, IMATGE)
{
var canvi = IMATGE.replace('.JPG','')
//eval("document.getElementById('ICO" + ID + "').src = '/imatges/IMATGESINTERFACE/ESPA%D1OL/BOTONS/' + IMATGE")
eval("document.getElementById('ICO" + ID + "').src = " + canvi +".src")
eval("document.getElementById('DIV_ICO" + ID + "').style.top = 4")
eval("document.getElementById('TEXTO" + ID + "').style.color = '#0033ff'")
eval("document.getElementById('TEXTO" + ID + "').style.backgroundColor = '#FFFFFF'")
if (document.getElementById('Div_Camisetas').style.display == 'block' && ID==1)
{
	//eval("document.getElementById('ICO" + ID + "').src = " + canvi +".src")
	canvi = IMATGE.replace('OFF','')
	canvi = canvi.replace('src','')
	saltar(ID, canvi)
}
if (document.getElementById('Div_Pantalones').style.display == 'block' && ID==2)
{
	//eval("document.getElementById('ICO" + ID + "').src = " + canvi +".src")
	canvi = IMATGE.replace('OFF','')
	canvi = canvi.replace('src','')
	saltar(ID, canvi)
}
if (document.getElementById('Div_Escudos').style.display == 'block' && ID==3)
{
	//eval("document.getElementById('ICO" + ID + "').src = " + canvi +".src")
	canvi = IMATGE.replace('OFF','')
	canvi = canvi.replace('src','')
	saltar(ID, canvi)
}
if (document.getElementById('Div_Publicidades').style.display == 'block' && ID==4)
{
	//eval("document.getElementById('ICO" + ID + "').src = " + canvi +".src")
	canvi = IMATGE.replace('OFF','')
	canvi = canvi.replace('src','')
	saltar(ID, canvi)
}
}

function setStyle(x)
{
document.getElementById(x).style.background="yellow"
}

function prueba2()
{
contador = 0
	for(i=1;i<=numerotallas;i++)
	{
	contador = contador + Math.round((document.getElementById('TALLASAM' + i).value))
	}
return(contador)
}


function prueba3()
{
contador = 0
	for(i=1;i<=numerotallas;i++)
	{
	contador = contador + Math.round((document.getElementById('TALLAPAN' + i).value))
	}
return(contador)
}


function Buscar_Talla(prenda, i, total)
{

identificador = 'TALLASAM'
if (prenda == 'camiseta')
{
prenda = 'TALLASAM'
tallas = tallasam
}
else
{
prenda = 'TALLAPAN'
tallas = tallapan
}

seleccionada = tallas[0]
sumatoriotallas = 0

for(cont=1;cont<=numerotallas;cont++)
{
	prenda2 = prenda.concat(cont)
	sumatoriotallas = sumatoriotallas + Math.round(document.getElementById(prenda2).value)
	if (sumatoriotallas < i)
	{
	seleccionada = tallas[cont]
	}
}
return seleccionada
}

function contarNumero(i,label)
{
var x=document.getElementById(label + i).value
document.getElementById(label + i).style.background="white"
return x.length
}

function contarNumeros(label,totaltallas)
{
totaltallas = prueba2()
totalnumeros = 0
		for(i=1;i<=totaltallas;i++)
		{
		totalnumeros = totalnumeros + contarNumero(i,label)
		}
return totalnumeros
}

function contarNombres()
{
totaltallas = prueba2()
totalnombres = 0
		for(i=1;i<=totaltallas;i++)
		{
			if(document.getElementById("nombre" + i).value != "")
			{
			totalnombres = totalnombres + 1
			}
		document.getElementById("nombre" + i).style.background="white"
		}
return totalnombres
}

function estampacion_camiseta()
{

//if (document.UserForm.estampacioncamiseta.checked == 1)
//{

	document.getElementById('Div_Pantalones').style.display = 'none'
	document.getElementById('Div_Escudos').style.display = 'none'
	document.getElementById('Div_Publicidades').style.display = 'none'
	document.getElementById('Div_Camisetas').style.display = 'block'
	//document.getElementById('ICO1').src = ICO_CAMISETA.src
	bajar(2,'ICO_PANTALOOFF.JPG')
	bajar(3,'ICO_CAMISETAESCUDOOFF.JPG')
	bajar(4,'ICO_CAMISETAPUBLIOFF.JPG')
	
	
if (estampacioncamiseta == 0)
{
	estampacioncamiseta = 1
	
	scr = "Seleccionar el modelo de número y color:&nbsp;<br><br>"
	scr  = scr + "<b>Modelo de nº&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Color</b>"
	scr  = scr + "<br><select name=TipoNumeroCamiseta id=TipoNumeroCamiseta onChange=TipoNumeroChangeCamiseta('Colorsamarreta')>"
	//scr  = scr + "<option selected value='Futbolmania'>Futbolmania</option>"
	scr  = scr + "<option selected value='Brazil'>Brazil</option>"
	scr  = scr + "<option value='Cursiva'>Cursiva</option>"
	scr  = scr + "<option value='Outline'>Outline</option>"
	//scr  = scr + "<option value='Adidas'>Adidas</option>"
	scr  = scr + "<option value='Nike'>Nike</option>"
    scr  = scr + "</select>"
	scr  = scr + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<select id=Colorsamarreta name=Colorsamarreta></select>"
	scr  = scr + "<br><br><div id='Precio_estampacio1'><b>Precio nº 2,50€ por unidad, nombre 2,95€</b></div><br><img src='http://www.futbolmanianet.com/imatges/imatgesprod/equipacions/numeros/STANDARDbrazil.jpg' id=img_numerosamarreta>&nbsp;&nbsp<a href='http://www.futbolmanianet.com/imatges/imatgesprod/equipacions/numeros/STANDARDbrazil.jpg' id=zoomnumero1 target=_blank>Zoom</a>"
	scr  = scr + "<br><br><B>&nbsp;Talla&nbsp;&nbsp;&nbsp;&nbsp;Nº&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nombre</B><br>"
	scr  = scr + "<div id='Div_Contenedor_Camisetas'>"
	scr  = scr + "<table>"
	contador = 0
	totaltallas = prueba2()
		for(i=1;i<=totaltallas;i++)
		{
		talla = Buscar_Talla('camiseta', i, totaltallas)
		scr = scr + "<tr><td align=left>"
		scr = scr + "&nbsp;<B>" + talla + ":</B>&nbsp;&nbsp;</td>"
		scr = scr + "<td><input type=text name=numero" + i + " id=numero" + i + " size=1 maxlength=2 onblur='total2()' onfocus='setStyle(this.id)'>&nbsp;&nbsp;&nbsp;<input type=text name=nombre" + i + " id=nombre" + i + " size=10 maxlength=15 onblur='total2()' onfocus='setStyle(this.id)'></td>"
		scr = scr + "</tr>"
		}
		scr  = scr + "</table>"
		scr = scr + "</div>"
		document.all.Div_Camisetas.innerHTML = scr
		SeleccionarColor('Brazil','Colorsamarreta')
//}
//else
//{
//document.getElementById('Div_Contenedor_Camisetas').style.display = 'none'
//document.all.Div_Camisetas.innerHTML = ""
//}
total2()
}
}


function SeleccionarColor(tipo,label)
{
var coloroutline = new Array("Blanco", "Negro", "Rojo", "Azul royal", "Azul marino", "Amarillo");
var colorbrasil = new Array("Blanco", "Negro", "Rojo", "Azul royal", "Azul marino", "Amarillo");
var colorfutbolmania = new Array("Rojo", "Amarillo");
var coloradidas = new Array("Blanco", "Negro", "Rojo", "Azul royal", "Azul marino", "Amarillo");
var colorcursiva = new Array("Blanco", "Negro", "Rojo", "Azul royal", "Azul marino", "Amarillo");
var colornike = new Array("Blanco", "Negro", "Rojo", "Azul royal", "Azul marino", "Amarillo");
colors = colorfutbolmania

switch(tipo)
{
case "Futbolmania":
colors = colorfutbolmania
break
case "Brazil":
colors = colorbrasil
break
case "Outline":
colors = coloroutline
break
case "Adidas":
colors = coloradidas
break
case "Cursiva":
colors = colorcursiva
break
case "Nike":
colors = colornike
}
num_colors = colors.length
document.getElementById(label).length = 0
document.getElementById(label).length = num_colors
       for(i=0;i<num_colors;i++)
       	  {
          document.getElementById(label).options[i].value=colors[i]
          document.getElementById(label).options[i].text=colors[i]
		  }
	  	  document.getElementById(label).options[0].selected = 1
total2()
}


function TipoNumeroChangeCamiseta(label)
{
	//seleccionado = document.UserForm.TipoNumeroCamiseta.selectedIndex
	seleccionado = document.UserForm.TipoNumeroCamiseta[document.UserForm.TipoNumeroCamiseta.selectedIndex].value
	switch(seleccionado)
	{
	case "Futbolmania":
	  precionombre = 2.95
	  precioestampacioncamiseta = 2.50
	  document.getElementById("img_numerosamarreta").src = TIPONUMERO1.src
	  document.all.Precio_estampacio1.innerHTML = "<b>Precio nº 2,50€ por unidad, nombre 2,95€</b>"
	  document.getElementById("zoomnumero1").href = "http://www.futbolmanianet.com/imatges/imatgesprod/equipacions/numeros/STANDARDmania.gif"
	  break
	case "Brazil":
	precionombre = 2.95
	  precioestampacioncamiseta = 2.90
	  document.getElementById("img_numerosamarreta").src = TIPONUMERO2.src
	  document.all.Precio_estampacio1.innerHTML = "<b>Precio nº 2,90€ por unidad, nombre 2,95€</b>"
	  document.getElementById("zoomnumero1").href = "http://www.futbolmanianet.com/imatges/imatgesprod/equipacions/numeros/STANDARDbrazil.gif"
	  break
	case "Outline":
	precionombre = 2.95
	  precioestampacioncamiseta = 3.50
	  document.getElementById("img_numerosamarreta").src = TIPONUMERO3.src
	  document.all.Precio_estampacio1.innerHTML = "<b>Precio nº 3,50€ por unidad, nombre 2,95€</b>"
	  document.getElementById("zoomnumero1").href = "http://www.futbolmanianet.com/imatges/imatgesprod/equipacions/numeros/STANDARDcutline.gif"
	  break
	case "Adidas":
	precionombre = 3.50
	  precioestampacioncamiseta = 4.00
	  document.getElementById("img_numerosamarreta").src = TIPONUMERO4.src
	  document.all.Precio_estampacio1.innerHTML = "<b>Precio nº 4,00€ por unidad, nombre arqueado 3,50€</b>"
	  document.getElementById("zoomnumero1").href = "http://www.futbolmanianet.com/imatges/imatgesprod/equipacions/numeros/nadidasg.gif"
	  break
	case "Cursiva":
	precionombre = 2.95
	  precioestampacioncamiseta = 2.50
	  document.getElementById("img_numerosamarreta").src = TIPONUMERO6.src
	  document.all.Precio_estampacio1.innerHTML = "<b>Precio nº 2,50€ por unidad, nombre 2,95€</b>"
	  document.getElementById("zoomnumero1").href = "http://www.futbolmanianet.com/imatges/imatgesprod/equipacions/numeros/ncursiva.gif"
	  break  
	case "Nike":
	precionombre = 3.50
	  precioestampacioncamiseta = 4.00
	  document.getElementById("img_numerosamarreta").src = TIPONUMERO5.src
	  document.all.Precio_estampacio1.innerHTML = "<b>Precio nº 4,00€ por unidad, nombre arqueado 3,50€</b>"
	  document.getElementById("zoomnumero1").href = "http://www.futbolmanianet.com/imatges/imatgesprod/equipacions/numeros/nnikeg.gif"
	}

SeleccionarColor(seleccionado,label)
}

function TipoNumeroChange(label)
{
	
	
	seleccionado = document.UserForm.TipoNumero[document.UserForm.TipoNumero.selectedIndex].value
	
	switch(seleccionado)
	{
	case "Futbolmania":
	  precioestampacionpantalon = 1.95
	  document.getElementById("img_numeropantalo").src = TIPONUMERO1.src
	  document.all.Precio_estampacio2.innerHTML = "<b>Precio nº 1,95€ por unidad</b>"
	  document.getElementById("zoomnumero2").href = "http://www.futbolmanianet.com/imatges/imatgesprod/equipacions/numeros/STANDARDmania.gif"
	  break
	case "Brazil":
	  precioestampacionpantalon = 1.95
	  document.getElementById("img_numeropantalo").src = TIPONUMERO2.src
	  document.all.Precio_estampacio2.innerHTML = "<b>Precio nº 1,95€ por unidad</b>"
	  document.getElementById("zoomnumero2").href = "http://www.futbolmanianet.com/imatges/imatgesprod/equipacions/numeros/STANDARDbrazil.gif"
	  break
	case "Outline":
	  precioestampacionpantalon = 2.50
	  document.getElementById("img_numeropantalo").src = TIPONUMERO3.src
	  document.all.Precio_estampacio2.innerHTML = "<b>Precio nº 2,50€ por unidad</b>"
	  document.getElementById("zoomnumero2").href = "http://www.futbolmanianet.com/imatges/imatgesprod/equipacions/numeros/STANDARDcutline.gif"
  break
	case "Adidas":
	  precioestampacionpantalon = 3.00
	  document.getElementById("img_numeropantalo").src = TIPONUMERO4.src
	  document.all.Precio_estampacio2.innerHTML = "<b>Precio nº 3,00€ por unidad</b>"
	  document.getElementById("zoomnumero2").href = "http://www.futbolmanianet.com/imatges/imatgesprod/equipacions/numeros/nadidasg.gif"
	    break
	case "Cursiva":
	  precioestampacionpantalon = 1.95
	  document.getElementById("img_numeropantalo").src = TIPONUMERO6.src
	  document.all.Precio_estampacio2.innerHTML = "<b>Precio nº 1,95€ por unidad</b>"
	  document.getElementById("zoomnumero2").href = "http://www.futbolmanianet.com/imatges/imatgesprod/equipacions/numeros/ncursiva.gif"
	    break	
	case "Nike":
	  precioestampacionpantalon = 3.00
	  document.getElementById("img_numeropantalo").src = TIPONUMERO5.src
	  document.all.Precio_estampacio2.innerHTML = "<b>Precio nº 3,00€ por unidad</b>"
	  document.getElementById("zoomnumero2").href = "http://www.futbolmanianet.com/imatges/imatgesprod/equipacions/numeros/nnikeg.gif"
	}


//seleccionado= document.UserForm.TipoNumero.selectedIndex
SeleccionarColor(seleccionado,label)
}

function SeleccionarColorEscudo(i, tipo)
{
var colorNormal = new Array("Blanco", "Negro", "Rojo", "Azul royal", "Azul marino", "Amarillo");
var todosColores = new Array("Todos");

colors = colorNormal

var el = eval("document.getElementById('ColorEscudo" + i + "')")

switch(tipo)
{
case 0:
colors = colorNormal
el.style.visibility = 'visible'
break
case 1:
colors = todosColores
el.style.visibility = 'hidden'
break
case 2:
colors = todosColores
el.style.visibility = 'hidden'
break
case 3:
colors = colorNormal
el.style.visibility = 'visible'
break
case 4:
colors = colorNormal
el.visibility = 'visible'
}
num_colors = colors.length
el.length = 0
el.length = num_colors
       for(i=0;i<num_colors;i++)
       	  {
          el.options[i].value=colors[i]
          el.options[i].text=colors[i]
		  }
	  	  el.options[0].selected = 1
total2()
}



function TipoEscudoChange(label, i)
{
	seleccionado = document.getElementById(label + i).selectedIndex
	switch(seleccionado)
	{
	case 0:
	  precioescudo = 3.70
	  escudosminimos = 10	
	  eval("document.all.Precio_Escudo" + i + ".innerHTML = '<b>Precio 3,70€ por unidad</b>&nbsp;&nbsp;<a href=#>info</a>'")
	  break
	case 1:
	  precioescudo = 3.70
	  escudosminimos = 10	
	  eval("document.all.Precio_Escudo" + i + ".innerHTML = '<b>Precio 3,70€ por unidad</b>&nbsp;&nbsp;<a href=#>info</a>'")
	  break
	case 2:
	  precioescudo = 3.95
	  escudosminimos = 20	
	  eval("document.all.Precio_Escudo" + i + ".innerHTML = '<b>Precio 3,95€ por unidad</b>&nbsp;&nbsp;<a href=#>info</a>'")
	  break
	case 3:
	  precioescudo = 0.65
	  escudosminimos = 25
	  eval("document.all.Precio_Escudo" + i + ".innerHTML = '<b>Precio 0,65€ por unidad</b>&nbsp;&nbsp;<a href=#>info</a>'")
	}

SeleccionarColorEscudo(i,seleccionado)
}

function LlenarPosicionEscudo(i)
{

var PosicionesPubli = new Array("Camiseta en el pecho izquierda", "Camiseta en el pecho centro", "Camiseta en el pecho derecha", "Pantalón delante a la izquierda", "Pantalón delante a la derecha");

var el = eval("document.getElementById('PosicionEscudo" + i + "')")

colors = PosicionesPubli

num_colors = colors.length
el.length = 0
el.length = num_colors
       for(i=0;i<num_colors;i++)
       	  {
          el.options[i].value=colors[i]
          el.options[i].text=colors[i]
		  }
	  	  el.options[0].selected = 1
total2()

}


function LlenarPosicionPublicidad(i)
{

var PosicionesPubli = new Array("Camiseta en el pecho", "Camiseta debajo del número", "Camiseta encima del número", "Pantalón delante a la izquierda", "Pantalón delante a la derecha");

var el = eval("document.getElementById('PosicionPublicidad" + i + "')")

colors = PosicionesPubli

num_colors = colors.length
el.length = 0
el.length = num_colors
       for(i=0;i<num_colors;i++)
       	  {
          el.options[i].value=colors[i]
          el.options[i].text=colors[i]
		  }
	  	  el.options[0].selected = 1
total2()

}

function SeleccionarColorPublicidad(i, tipo)
{
var colorNormal = new Array("Blanco", "Negro", "Rojo", "Azul royal", "Azul marino", "Amarillo");
var todosColores = new Array("Todos");

colors = colorNormal

var el = eval("document.getElementById('ColorPublicidad" + i + "')")

switch(tipo)
{
case 0:
colors = colorNormal
el.style.visibility = 'visible'
break
case 1:
colors = todosColores
el.style.visibility = 'hidden'
break
case 2:
colors = todosColores
el.style.visibility = 'hidden'
break
case 3:
colors = colorNormal
el.style.visibility = 'visible'
break
case 4:
colors = colorNormal
el.visibility = 'visible'
}
num_colors = colors.length
el.length = 0
el.length = num_colors
       for(i=0;i<num_colors;i++)
       	  {
          el.options[i].value=colors[i]
          el.options[i].text=colors[i]
		  }
	  	  el.options[0].selected = 1
total2()
}


function TipoPublicidadChange(label, i)
{
	seleccionado = document.getElementById(label + i).selectedIndex
	switch(seleccionado)
	{
	case 0:
	  precioescudo = 3.70
	  escudosminimos = 10
	  eval("document.all.Precio_Publicidad" + i + ".innerHTML = '<b>Precio 3,70€ por unidad'")
	  break
	case 1:
	  precioescudo = 3.70
	  escudosminimos = 10
	  eval("document.all.Precio_Publicidad" + i + ".innerHTML = '<b>Precio 3,70€ por unidad'")
	  break
	case 2:
	  precioescudo = 0.85
	  escudosminimos = 20
	  eval("document.all.Precio_Publicidad" + i + ".innerHTML = '<b>Precio 4,95€ por unidad'")
	  break
	case 3:
	  precioescudo = 0.85
	  escudosminimos = 25
	  eval("document.all.Precio_Publicidad" + i + ".innerHTML = '<b>Precio 0,85€ por unidad'")
	}

SeleccionarColorPublicidad(i,seleccionado)
}


function TipoPublicidadPrecio(label, i)
{

	totalequipaciones = prueba2()
	preciopubli = 0
	publisminimos = 10
	el = eval("document.getElementById('" + label + i + "')")
	seleccionado = el.selectedIndex
	switch(seleccionado)
	{
	case 0:
	  precioescudo = 3.70
	  publisminimos = 10
	  break
	case 1:
	  precioescudo = 3.70
	  publisminimos = 10
	  break
	case 2:
	  precioescudo = 0.85
	  publisminimos = 20
	  break
	case 3:
	  precioescudo = 0.85
	  publisminimos = 25
	}
	
	

	//if (publisminimos >= totalequipaciones & el.selectedIndex != 0)
	if (publisminimos >= totalequipaciones)
		{
		 preciopubli = publisminimos * precioescudo
		}
		else
		{
		 preciopubli = totalequipaciones * precioescudo
		}

return preciopubli
}

function PantallaPublicidadChange()
{
total2()
}

function estampacion_pantalon()
{
if (prendaunica == 0 || conjuntoportero == 1)
{

	document.getElementById('Div_Camisetas').style.display = 'none'
	document.getElementById('Div_Escudos').style.display = 'none'
	document.getElementById('Div_Publicidades').style.display = 'none'
	document.getElementById('Div_Pantalones').style.display = 'block'
	bajar(1,'ICO_CAMISETAOFF.JPG')
	bajar(3,'ICO_CAMISETAESCUDOOFF.JPG')
	bajar(4,'ICO_CAMISETAPUBLIOFF.JPG')
	
if (estampacionpantalon == 0)
{
	estampacionpantalon = 1
	
	scr2 = "Seleccionar el modelo de número y color:&nbsp;<br><br>"
	scr2  = scr2 + "<b>Modelo de nº&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Color</b>"
	scr2  = scr2 + "<br><select name=TipoNumero id=TipoNumero onChange=TipoNumeroChange('Colorpantalo')>"
	//scr2  = scr2 + "<option selected value='Futbolmania'>Futbolmania</option>"
	scr2  = scr2 + "<option selected value='Brazil'>Brazil</option>"
	scr2  = scr2 + "<option value='Cursiva'>Cursiva</option>"
	scr2  = scr2 + "<option value='Outline'>Outline</option>"
	//scr2  = scr2 + "<option value='Adias'>Adidas</option>"
	scr2  = scr2 + "<option value='Nike'>Nike</option>"	
	scr2  = scr2 + "</select>"
	scr2  = scr2 + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<select id=Colorpantalo name=Colorpantalo></select>"
	scr2  = scr2 + "<br><br><div id='Precio_estampacio2'><b>Precio nº 1,95€ por unidad</div><br><img src='http://www.futbolmanianet.com/imatges/imatgesprod/equipacions/numeros/STANDARDbrazil.jpg' id=img_numeropantalo>&nbsp;&nbsp<a href='http://www.futbolmanianet.com/imatges/imatgesprod/equipacions/numeros/STANDARDbrazil.jpg' id=zoomnumero2 target=_blank>Zoom</a>"
	scr2  = scr2 + "<br><br><B>&nbsp;Talla&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nº</B><br>"
	scr2  = scr2 + "<div id='Div_Contenedor_Pantalones'>"
	scr2  = scr2 + "<table>"
	contador = 0
	totaltallas = prueba3()
		for(i=1;i<=totaltallas;i++)
		{
		talla = Buscar_Talla('pantalon', i, totaltallas)
		scr2 = scr2 + "<tr><td align=left>"
		scr2 = scr2 + "&nbsp;<B>" + talla + ":</B>&nbsp;&nbsp;&nbsp;&nbsp;</td>"
		scr2 = scr2 + "<td><input type=text name=pantalon" + i + " id=pantalon" + i + " size=1 maxlength=2 onblur='total2()' onfocus='setStyle(this.id)'></td></tr>"
		}
	scr2  = scr2 + "</table>"
	scr2  = scr2 + "</div>"
	document.all.Div_Pantalones.innerHTML = scr2
	SeleccionarColor('Brazil','Colorpantalo')
//}
//else
//{
//document.getElementById('Div_Contenedor_Pantalones').style.display = 'none'
//document.all.Div_Pantalones.innerHTML = ""

total2()
}
}
}


function TipoEscudoPrecio(label, i)
{

	totalequipaciones = prueba2()
	preciopubli = 0
	publisminimos = 10
	el = eval("document.getElementById('" + label + i + "')")
	seleccionado = el.selectedIndex
	switch(seleccionado)
	{
	case 0:
	  precioescudo = 3.70
	  publisminimos = 10
	  break
	case 1:
	  precioescudo = 3.70
	  publisminimos = 10
	  break
	case 2:
	  precioescudo = 3.95
	  publisminimos = 20
	  break
	case 3:
	  precioescudo = 0.65
	  publisminimos = 25
	}
	
	//if (publisminimos >= totalequipaciones & el.selectedIndex != 0)
	if (publisminimos >= totalequipaciones)
		{
		 preciopubli = publisminimos * precioescudo
		}
		else
		{
		 preciopubli = totalequipaciones * precioescudo
		}

return preciopubli
}

function estampacion_escudo()
{

//if (document.UserForm.estampacionescudo.checked == 1)
//{
	document.getElementById('Div_Camisetas').style.display = 'none'
	document.getElementById('Div_Pantalones').style.display = 'none'
	document.getElementById('Div_Publicidades').style.display = 'none'
	document.getElementById('Div_Escudos').style.display = 'block'
	bajar(1,'ICO_CAMISETAOFF.JPG')
	bajar(2,'ICO_PANTALOOFF.JPG')
	bajar(4,'ICO_CAMISETAPUBLIOFF.JPG')
if (totalescudos < 1)
	{
	totalescudos = 1
	scr2 = "<DIV id=Div_Crear_Escudos name=Div_Crear_Escudos></div>"
	scr2 = scr2 + "<br><IMG src='/imatges/IMATGESINTERFACE/ESPAÑOL/BOTONS/ADD_CAMISETAESCUDO.JPG' onClick='Crear_Escudos()' style='cursor: pointer; cursor: hand'>&nbsp;<a href='#' class='Anadir_Escudo' onClick='Crear_Escudos()'>AÑADIR ESCUDO</a>"
	scr2 = scr2 + "&nbsp;&nbsp;&nbsp;"
	scr2 = scr2 + "<IMG src='/imatges/IMATGESINTERFACE/ESPAÑOL/BOTONS/DEL_CAMISETAESCUDO.JPG' onClick='Borrar_Escudos()' style='cursor: pointer; cursor: hand'>&nbsp;<a href='#' class='Anadir_Escudo' onClick='Borrar_Escudos()'>BORRAR ESCUDO</a>"
	document.all.Div_Escudos.innerHTML = scr2
	totalescudos = 0
	Crear_Escudos(totalescudos)
	}
//}
//else
//{
//document.all.Div_Escudos.innerHTML = ""
//}
//total2()

}


function PantallaEscudoChange(i)
{
var id = 'Pantalla_Escudo' & i
if (eval("document.getElementById('Pantalla_Escudo" + i + "').checked == 0"))
{
document.getElementById('Div_ayuda').style.display = 'block'
document.getElementById('Iframe_ayuda').src = 'ayuda_pantallaescudo' + '.asp'
}
total2()
}

function Borrar_Escudos(cant)
{
if (totalescudos > 0)
{
el = document.getElementById("Div_Crear_Escudos" + totalescudos)
el.parentNode.removeChild(el)
totalescudos = totalescudos - 1
}
total2()
}

function Crear_Escudos()
{

totalescudos++
scr2= ""
i=totalescudos
iescudos = totalescudos
hescudos = totalescudos
		scr2  = scr2 + "<DIV style='border: 1px solid #cccccc'>"
		scr2  = scr2 + "<input name='pvp_escudo" + i + "' type='hidden' value='0'>"
		scr2  = scr2 + "<table border=0 width=275 class='formulari'><tr><td>"
		scr2  = scr2 + "<B>ESCUDO&nbsp;Nº&nbsp;" + i + "</b><br>"
		scr2  = scr2 + "</td></tr><tr><td>Pantalla publicidad precio 63€ <input type='checkbox' id='Pantalla_Escudo" + i + "' name='Pantalla_Escudo" + i + "' value='true' checked=checked onClick=PantallaEscudoChange("+ i +")>&nbsp;&nbsp;<a href='#' onclick=ayuda('ayuda_estampacionescudos')>info</a><br>"
		scr2  = scr2 + "</td></tr><tr><td>Seleccionar el tipo de escudo y color:</td></tr><tr><td><select name=TipoEscudo" + i + " id=TipoEscudo" + i + " onChange=TipoEscudoChange('TipoEscudo'," + i + ")>"
		//scr2  = scr2 + "<option selected value='Vinilo a 1 color'>Vinilo a 1 color</option>"
		scr2  = scr2 + "<option value='Vinilo a todo color'>Vinilo a todo color (min. 10 uni.)</option>"
		//scr2  = scr2 + "<option value='Bordado'>Bordado (min. 20 unidades)</option>"
		//scr2  = scr2 + "<option value='Serigrafia'>Serigrafia (min. 25 unidades)</option>"
		scr2  = scr2 + "</select>"
		scr2  = scr2 + "&nbsp;&nbsp;<select id=ColorEscudo" + i + " name=ColorEscudo" + i + ">"
		scr2  = scr2 + "<option selected value='Blanco'>Blanco</option>"
		scr2  = scr2 + "</select>"
		scr2  = scr2 + "</td></tr><tr height=8><td><div id='Precio_Escudo" + i + "'><b>Precio por unidad: 3,70€</b>&nbsp;&nbsp;<a href='#' onclick=ayuda('ayuda_estampacionescudos')>info</a></div>"
		scr2  = scr2 + "</td></tr><tr><td>Seleccionar posicion:</td></tr><tr><td><select id=PosicionEscudo" + i + " name=PosicionEscudo" + i + "></select>"
		scr2  = scr2 + "</td></tr></table>"
		scr2  = scr2 + "</DIV><br>"
		eDIV = document.createElement("div")
		eDIV.setAttribute("id", "Div_Crear_Escudos" + i)
		document.getElementById("Div_Crear_Escudos").appendChild(eDIV)
		eval("document.all.Div_Crear_Escudos" + i + ".innerHTML = scr2")
		eval("document.UserForm.PosicionEscudo" + i + ".focus()")
		eval("document.UserForm.TipoEscudo" + i + ".focus()")

		SeleccionarColorEscudo(iescudos,0)
		LlenarPosicionEscudo(hescudos)
		total2()
}


function PantallaPubliChange(i)
{
var id = 'Pantalla_Publicidad' & i
if (eval("document.getElementById('Pantalla_Publicidad" + i + "').checked == 0"))
{
document.getElementById('Div_ayuda').style.display = 'block'
document.getElementById('Iframe_ayuda').src = 'ayuda_pantallapubli' + '.asp'
}
total2()
}


function Borrar_Publicidades(cant)
{
if (totalpublicidades > 0)
{
el = document.getElementById("Div_Crear_Publicidades" + totalpublicidades)
el.parentNode.removeChild(el)
totalpublicidades = totalpublicidades - 1
}
total2()
}

function Crear_Publicidades()
{
totalpublicidades++
scr2= ""
i=totalpublicidades
ipublis = totalpublicidades
hpublis = totalpublicidades

		scr2  = scr2 + "<DIV style='border: 1px solid #cccccc'>"
		scr2  = scr2 + "<input name='pvp_publi" + i + "' type='hidden' value='0'>"
		scr2  = scr2 + "<table border=0 width=275 class='formulari'><tr><td>"
		scr2  = scr2 + "<B>PUBLICIDAD&nbsp;Nº&nbsp;" + i + "</b><br>"
		scr2  = scr2 + "</td></tr><tr><td>Pantalla publicidad precio 63€ <input type='checkbox' id='Pantalla_Publicidad" + i + "' name='Pantalla_Publicidad" + i + "' value='true' checked=checked onClick=PantallaPubliChange("+ i +")>&nbsp;&nbsp;<a href='#' onclick=ayuda('ayuda_estampacionpublis')>info</a><br>"
		scr2  = scr2 + "</td></tr><tr><td>Seleccionar el tipo de publicidad y color:"
		scr2  = scr2 + "</td></tr><tr><td><select name=TipoPublicidad" + i + " id=TipoPublicidad" + i + " onChange=TipoPublicidadChange('TipoPublicidad'," + i + ")>"
		//scr2  = scr2 + "<option selected value='Vinilo a 1 color'>Vinilo a 1 color</option>"
		scr2  = scr2 + "<option value='Vinilo a todo color'>Vinilo a todo color (min. 10 uni.)</option>"
		//scr2  = scr2 + "<option value='Serigrafia'>Serigrafia (min. 25 unidades)</option>"
		scr2  = scr2 + "</select>"
		scr2  = scr2 + "&nbsp;&nbsp;<select id=ColorPublicidad" + i + " name=ColorPublicidad" + i + ">"
		scr2  = scr2 + "<option selected value='Blanco'>Blanco</option>"
		scr2  = scr2 + "</select>"
		scr2  = scr2 + "</td></tr><tr height=10><td height=10><div id='Precio_Publicidad" + i + "'><b>Precio por unidad: 3,70€</b>&nbsp;&nbsp;<a href='#' onclick=ayuda('ayuda_estampacionpublis')>info</a></div>"
		scr2  = scr2 + "</td></tr><tr><td>Seleccionar posicion:</td></tr><tr><td><select id=PosicionPublicidad" + i + " name=PosicionPublicidad" + i + "></select>"
		scr2  = scr2 + "</td></tr></table>"
		scr2  = scr2 + "</DIV><br>"		

		eDIV = document.createElement("div");
		//assign an ID to the element because you may need to access it again
		eDIV.setAttribute("id", "Div_Crear_Publicidades" + i);
		document.getElementById("Div_Crear_Publicidades").appendChild(eDIV);
		eval("document.all.Div_Crear_Publicidades" + i + ".innerHTML = scr2")
		eval("document.UserForm.PosicionPublicidad" + i + ".focus()")
		eval("document.UserForm.TipoPublicidad" + i + ".focus()")
		SeleccionarColorPublicidad(ipublis,0)
		LlenarPosicionPublicidad(hpublis)
		total2()
}

function estampacion_publicidad()
{

//if (document.UserForm.estampacionpublicidad.checked == 1)
//{
	document.getElementById('Div_Camisetas').style.display = 'none'
	document.getElementById('Div_Pantalones').style.display = 'none'
	document.getElementById('Div_Escudos').style.display = 'none'
	document.getElementById('Div_Publicidades').style.display = 'block'
	bajar(1,'ICO_CAMISETAOFF.JPG')
	bajar(3,'ICO_CAMISETAESCUDOOFF.JPG')
	bajar(4,'ICO_CAMISETAPUBLIOFF.JPG')
if (totalpublicidades == 0)
	{
	totalpublicidades = 0
	scr2 = "<DIV id=Div_Crear_Publicidades name=Div_Crear_Publicidades></div>"
	scr2 = scr2 + "<br><IMG src='/imatges/IMATGESINTERFACE/ESPAÑOL/BOTONS/ADD_CAMISETAPUBLI.JPG' onClick='Crear_Publicidades()' style='cursor: pointer; cursor: hand'>&nbsp;<a href='#' class='Anadir_Escudo' onClick='Crear_Publicidades()'>AÑADIR PUBLICIDAD</a>"
	scr2 = scr2 + "&nbsp;&nbsp;"
	scr2 = scr2 + "<IMG src='/imatges/IMATGESINTERFACE/ESPAÑOL/BOTONS/DEL_CAMISETAPUBLI.JPG' onClick='Borrar_Publicidades()' style='cursor: pointer; cursor: hand'>&nbsp;<a href='#' class='Anadir_Escudo' onClick='Borrar_Publicidades()'>BORRAR PUBLICIDAD</a>"
	document.all.Div_Publicidades.innerHTML = scr2
	Crear_Publicidades()
//}
//else
//{
//document.all.Div_Publicidades.innerHTML = ""
//}
total2()
}
}

function total2()
{
subtotal = 0
estampacion = 0
numeros = 0
estampacionnombres = 0
numerospantalon = 0
preciototalestampacionpantalon = 0
pantallaescudo = 0
precioescudos = 0
preciototalestampacionescudo = 0
preciototalestampacionpublicidad = 0
totalequipaciones = prueba2()
camisetassindto = 0
camisetas = 0

if (totalequipaciones > 4)
{
camisetas = (total * totalequipaciones)
camisetassindto = (precio1 * totalequipaciones)
}
else
{
camisetas = (precio1 * totalequipaciones)
}
	if (estampacioncamiseta > 0)
	{
	numeros = contarNumeros('numero',prueba2())
	nombres = contarNombres()
	estampacion = numeros * precioestampacioncamiseta
	estampacionnombres = nombres * precionombre
	document.UserForm.pvp_numerocam.value = precioestampacioncamiseta
	document.UserForm.pvp_nom.value = precionombre
	if (numeros > 0 || nombres > 0)
	{
		colour = document.UserForm.TipoNumeroCamiseta[document.UserForm.TipoNumeroCamiseta.selectedIndex].value
		colour = colour + " " + document.UserForm.Colorsamarreta[document.UserForm.Colorsamarreta.selectedIndex].value
		writeLayer('SPest_camiseta',colour)
	}
	else
	{
	writeLayer('SPest_camiseta','')
	}
	}


	if (estampacionpantalon > 0)
	{
	numerospantalon = contarNumeros('pantalon',prueba3())
	preciototalestampacionpantalon = numerospantalon * precioestampacionpantalon
	document.UserForm.pvp_numeropan.value = precioestampacionpantalon
	
	if (numerospantalon > 0)
	{
		colour = document.UserForm.TipoNumero[document.UserForm.TipoNumero.selectedIndex].value
		colour = colour + " " + document.UserForm.Colorpantalo[document.UserForm.Colorpantalo.selectedIndex].value
		writeLayer('SPest_pantalon',colour)
	}
	else
	{
	writeLayer('SPest_pantalon','')
	}
		
	}
	writeLayer('SPescudo',totalescudos)
	writeLayer('SPpublis',totalpublicidades)

	if (totalescudos > 0)
		{

			pantallaescudo = 0

			precioescudos = 0

			precioescudos2 = 0

			for(h=1;h<=totalescudos;h++)
			{
				pantallaescudo2 = 0

				el = eval("document.getElementById('Pantalla_Escudo" + h + "')")
				if (el.checked == 1)
				{
				pantallaescudo = pantallaescudo + 63
				pantallaescudo2 = 63
				}

			precioescudos2 = TipoEscudoPrecio('TipoEscudo',h)

			precioescudos = precioescudos + precioescudos2
			
			eval("document.UserForm.pvp_escudo" + h + ".value = precioescudos2 + pantallaescudo2")

			}

			preciototalestampacionescudo = preciototalestampacionescudo + pantallaescudo + precioescudos
			document.UserForm.pvp_escudos.value = preciototalestampacionescudo
			
	}


	if (totalpublicidades > 0)
	{

		pantallapublicidad = 0

		preciopublis = 0

		preciopublis2 = 0

		for(h=1;h<=totalpublicidades;h++)
		{
			pantallapublicidad2 = 0
			el = eval("document.getElementById('Pantalla_Publicidad" + h + "')")
			if (el.checked == 1)
			{
			pantallapublicidad = pantallapublicidad + 63
			pantallapublicidad2 = 63
			}

		preciopublis2 = TipoPublicidadPrecio('TipoPublicidad',h)

		preciopublis = preciopublis + preciopublis2
		
		eval("document.UserForm.pvp_publi" + h + ".value = preciopublis2 + pantallapublicidad2")

		}

		preciototalestampacionpublicidad = preciototalestampacionpublicidad + pantallapublicidad + preciopublis
		document.UserForm.pvp_publis.value = preciototalestampacionpublicidad
	}

subtotal = camisetas + estampacion + estampacionnombres + preciototalestampacionpantalon + preciototalestampacionescudo + preciototalestampacionpublicidad

document.UserForm.Total.value = Math.round(subtotal*1000)/1000
document.UserForm.totalequipaciones.value = totalequipaciones
document.UserForm.numerotallas.value = numerotallas
document.UserForm.estampacioncamiseta.value = estampacioncamiseta
document.UserForm.estampacionpantalon.value = estampacionpantalon
document.UserForm.totalpublicidades.value = totalpublicidades
document.UserForm.totalescudos.value = totalescudos
document.UserForm.tallas_equip.value = tallas_equip
document.UserForm.pvp_nom.value = precionombre

document.all.div_precio.innerHTML = "<SPAN>" + Math.round(subtotal*1000)/1000 + "€</SPAM>"

if (totalequipaciones > 4)
{
 document.all.div_dto.innerHTML = "Dto. aplicado: -" + Math.round((camisetassindto - camisetas)*1000)/1000 + "€"
 document.UserForm.dto.value = Math.round((camisetassindto - camisetas)*1000)/1000
 document.getElementById('div_dto').style.display = 'block'
}
else
{
	document.getElementById('div_dto').style.display = 'none'
	document.UserForm.dto.value = '0'
}

}