
 function calcula()
 {
	var tablaRes=""
	var cm25m=top.document.getElementById("25mm").value
	var precio1=0;
	var precio11=0;
	var total=0
	var total2=0
	var total3=0
	var total4=0
	var total5=0
	
	
		  if (cm25m!="")
		  {
			if (cm25m < 49)
			{
				precio1 = 0.49
			}						
			if (cm25m < 99 && cm25m > 49)
			{			
				precio1 = 0.40
			}
			if (cm25m < 199 && cm25m > 99)
			{ 
				precio1 = 0.25
			}		
			if (cm25m < 499 && cm25m > 199) 
			{
				precio1 = 0.24
			}						
			if (cm25m < 999 && cm25m > 499) 
			{
				precio1 = 0.20
			}			
			if (cm25m < 2499 && cm25m > 999) 
			{
				precio1 = 0.18
			}									
			if (cm25m < 5000 && cm25m > 2499) 
			{
				precio1 = 0.17
			}
			
			precio11 = precio1 + " Euros"
			total = redondear(precio1 * cm25m,2)
			total = total + " Euros"
			

			if (cm25m > 4999 )
			{
				precio11 = "Consultar"
				total = "Consultar"
			}
		}	
		
		
		var cm38m=top.document.getElementById("38mm").value
	var precio2=0;
	var precio22=0
	
		  if (cm38m!="")
		  {
			if (cm38m < 49)
			{
				precio2 = 0.57
			}						
			if (cm38m < 99 && cm38m > 49)
			{			
				precio2 = 0.50
			}
			if (cm38m < 199 && cm38m > 99)
			{ 
				precio2 = 0.33
			}		
			if (cm38m < 499 && cm38m > 199) 
			{
				precio2 = 0.29
			}						
			if (cm38m < 999 && cm38m > 499) 
			{
				precio2 = 0.23
			}			
			if (cm38m < 2499 && cm38m > 999) 
			{
				precio2 = 0.20
			}									
			if (cm38m < 5000 && cm38m > 2499) 
			{
				precio2 = 0.19
			}
			
			precio22 = precio2 + " Euros"
			total2 = redondear(precio2 * cm38m,2)
			total2 = total2 + " Euros"
			

			if (cm38m > 4999 )
			{
				precio22 = "Consultar"
				total2 = "Consultar"
			}
		}															
		
		
			var cm50m=top.document.getElementById("50mm").value
	var precio3=0;
	var precio33=0
	
		  if (cm50m!="")
		  {
			if (cm50m < 49)
			{
				precio3 = 0.71
			}						
			if (cm50m < 99 && cm50m > 49)
			{			
				precio3 = 0.52
			}
			if (cm50m < 499 && cm50m > 99)
			{ 
				precio3 = 0.38
			}		
			if (cm50m < 999 && cm50m > 499) 
			{
				precio3 = 0.32
			}						
			if (cm50m < 2499 && cm50m > 999) 
			{
				precio3 = 0.28
			}			
			if (cm50m < 5000 && cm50m > 2499) 
			{
				precio3 = 0.26
			}									
			
			
			precio33 = precio3 + " Euros"
			total3 = redondear(precio3 * cm50m,2)
			total3 = total3 + " Euros"
			

			if (cm50m > 4999 )
			{
				precio33 = "Consultar"
				total3 = "Consultar"
			}
		}	
		
		
		
			var cm32m=top.document.getElementById("32mm").value
	var precio4=0;
	var precio44=0;
	
		  if (cm32m!="")
		  {
			if (cm32m < 49)
			{
				precio4 = 0.80
			}						
			if (cm32m < 99 && cm32m > 49)
			{			
				precio4 = 0.70
			}
			if (cm32m < 499 && cm32m > 99)
			{ 
				precio4 = 0.42
			}		
			if (cm32m < 999 && cm32m > 499) 
			{
				precio4 = 0.38
			}						
			if (cm32m < 2499 && cm32m > 999) 
			{
				precio4 = 0.35
			}			
			if (cm32m < 5000 && cm32m > 2499) 
			{
				precio4 = 0.32
			}									
			
			
			precio44 = precio4 + " Euros"
			total4 = redondear(precio4 * cm32m,2)
			total4 = total4 + " Euros"
			

			if (cm32m > 4999 )
			{
				precio44 = "Consultar"
				total4 = "Consultar"
			}
		}																				
			
			
			
			
			var cm59m=top.document.getElementById("59mm").value
	var precio5=0;
	var precio55=0
	
		  if (cm59m!="")
		  {
			if (cm59m < 49)
			{
				precio5 = 0.80
			}						
			if (cm59m < 99 && cm59m > 49)
			{			
				precio5 = 0.70
			}
			if (cm59m < 499 && cm59m > 99)
			{ 
				precio5 = 0.44
			}		
			if (cm59m < 999 && cm59m > 499) 
			{
				precio5 = 0.38
			}						
			if (cm59m < 2499 && cm59m > 999) 
			{
				precio5 = 0.36
			}			
			if (cm59m < 5000 && cm59m > 2499) 
			{
				precio5 = 0.32
			}									
			
			
			precio55 = precio5 + " Euros"
			total5 = redondear(precio5 * cm59m,2)
			total5 = total5 + " Euros"
			

			if (cm59m > 4999 )
			{
				precio55 = "Consultar"
				total5 = "Consultar"
			}
		}	
									
									
	tablaRes='<table width="270" border="0" cellspacing="0" cellpadding="1" class="textos">'+
                                  '<tr>'+
                                  '<td width="66%"><div align="right">25mm Precio /  Unidad :</div></td>'+
                                  '<td width="34%">'+precio11+'</td>'+
                                '</tr>'+
                                '<tr>'+
                                 ' <td><div align="right" class="precios_verde">Total '+cm25m+' Unidades :</div></td>'+
                                  '<td class="precios_verde">'+total+' </td>'+
                                '</tr>'+
                                '<tr>'+
                                 '<td height="1" colspan="2"></td>'+
                                  '</tr>'+
                                '<tr>'+
                                 ' <td><div align="right">38mm Precio /  Unidad :</div></td>'+
                                 ' <td>'+precio22+'</td>'+
                                '</tr>'+
                                '<tr>'+
                                 ' <td><div align="right" class="precios_verde">Total '+cm38m+' Unidades :</div></td>'+
                                  '<td class="precios_verde">'+total2+' </td>'+
                                '</tr>'+
                                '<tr>'+
                                 ' <td height="1" colspan="2"></td>'+
                                  '</tr>'+
                                '<tr>'+
                                  '<td><div align="right">50mm Precio /  Unidad :</div></td>'+
                                  '<td>'+precio33+'</td>'+
                                '</tr>'+
                                '<tr>'+
                                 ' <td><div align="right" class="precios_verde">Total '+cm50m+' Unidades :</div></td>'+
                                 ' <td class="precios_verde"">'+total3+'</td>'+
                                '</tr>'+
                                 '<tr>'+
                                  '<td height="1" colspan="2"></td>'+
                                  '</tr>'+
								    
                                '<tr>'+
                                  '<td><div align="right">59mm Precio /  Unidad :</div></td>'+
                                  '<td>'+precio55+'</td>'+
                                '</tr>'+
                                '<tr>'+
                                 ' <td><div align="right" class="precios_verde">Total '+cm59m+' Unidades :</div></td>'+
                                 ' <td class="precios_verde">'+total5+'</td>'+
                                '</tr>'+
                                 '<tr>'+
                                  '<td height="1" colspan="2"></td>'+
                                  '</tr>'+
                                '<tr>'+
                                  '<td><div align="right">Cuadrada Precio /  Unidad :</div></td>'+
                                  '<td>'+precio44+'</td>'+
                                '</tr>'+
                                '<tr>'+
                                 ' <td><div align="right" class="precios_verde">Total '+cm32m+' Unidades :</div></td>'+
                                 ' <td class="precios_verde">'+total4+'</td>'+
                                '</tr>'+
                                '<tr>'+
                                 ' <td height="1" colspan="2"></td>'+
                                '</tr>'+
                                '<tr>'+
                                 ' <td colspan="2" background="images/barra.gif"></td>'+
                                '</tr>'+
                                '<tr>'+
                                '  <td colspan="2" height="30"  class="pedir"><a href="mailto:info@chapalandia.com"><div align="center"><u>PEDIR AHORA</u></div></a></td>'+
                                '</tr>'+
                                '<tr>'+
                                '  <td colspan="2" background="images/barra.gif"></td>'+
                               ' </tr>'+
                                '<tr>'+
                                  '<td colspan="2"><div align="center" class="pedir">IVA y Gastos de Env&iacute;o NO incluidos.</div></td>'+
                                  '</tr>'+
                              '</table>'
	
	
	top.document.getElementById("precios").innerHTML=tablaRes

 
 envios='<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
                    '  <tr>'+
                        '<td><table width="190" cellpadding="0"  cellspacing="0" class="table" align="right">'+
                          '<tr>'+
                           ' <td valign="top"><table width="100%" border="0" cellspacing="8" cellpadding="0" align="center">'+
                              '<tr>'+
                                '<td align="left" ><span class="titulos_verde_peq">Precios Online</span></td>'+
                              '</tr><tr>'+
                                '<td>Introduce la cantidad de chapas deseada y pulsa en Consultar para ver el precio. As&iacute; de f&aacute;cil !!<br /></td>'+
                              '</tr>'+
                           ' </table></td>'+
                         ' </tr>'+
                       ' </table></td>'+
                     ' </tr>'+
                      '<tr>'+
                       ' <td height="8"></td>'+
                     ' </tr>'+
                      '<tr>'+
                        '<td><div id="envio" ><table width="190" border="0" cellspacing="8" cellpadding="0" align="right">'+
                          '<tr>'+
                            '<td align="left" ><span class="titulos_verde_peq">Gastos de env&iacute;o</span></td>'+
                          '</tr>'+
                         ' <tr>'+
                           ' <td>Certificado : 6 euros<br />'+
                            '  Certificado Urgente : 7 euros<br />'+
                            ' Transporte SEUR : 9 euros'+
                             ' <br />'+
                          '  </td>'+
                         ' </tr>'+
                       ' </table></div></td>'+
                     ' </tr>'+
                   ' </table>'
				   
	top.document.getElementById("envio").innerHTML=envios
 
 }
 

 function calcula2()
 {
	var tablaRes=""
	var precio1=0;
	var precio11=0;
	var total=0
	var total2=0
	var total3=0
	var total4=0
	var total5=0
	
	
		
		
		var cm38m=top.document.getElementById("38mm2").value
	var precio2=0;
	var precio22=0
	
		  if (cm38m!="")
		  {
			if (cm38m < 49)
			{
				precio2 = 0.65
			}						
			if (cm38m < 99 && cm38m > 49)
			{			
				precio2 = 0.60
			}
			if (cm38m < 199 && cm38m > 99)
			{ 
				precio2 = 0.55
			}		
			if (cm38m < 499 && cm38m > 199) 
			{
				precio2 = 0.52
			}						
			if (cm38m < 999 && cm38m > 499) 
			{
				precio2 = 0.42
			}			
			if (cm38m < 2499 && cm38m > 999) 
			{
				precio2 = 0.32
			}									
			if (cm38m < 5000 && cm38m > 2499) 
			{
				precio2 = 0.30
			}
			
			precio22 = precio2 + " Euros"
			total2 = redondear(precio2 * cm38m,2)
			total2 = total2 + " Euros"
			

			if (cm38m > 4999 )
			{
				precio22 = "Consultar"
				total2 = "Consultar"
			}
		}															
		
		
			var cm50m=top.document.getElementById("50mm2").value
	var precio3=0;
	var precio33=0
	
		  if (cm50m!="")
		  {
			if (cm50m < 49)
			{
				precio3 = 0.8
			}						
			if (cm50m < 99 && cm50m > 49)
			{			
				precio3 = 0.6
			}
			if (cm50m < 499 && cm50m > 99)
			{ 
				precio3 = 0.45
			}		
			if (cm50m < 999 && cm50m > 499) 
			{
				precio3 = 0.38
			}						
			if (cm50m < 2499 && cm50m > 999) 
			{
				precio3 = 0.34
			}			
			if (cm50m < 5000 && cm50m > 2499) 
			{
				precio3 = 0.32
			}									
			
			
			precio33 = precio3 + " Euros"
			total3 = redondear(precio3 * cm50m,2)
			total3 = total3 + " Euros"
			

			if (cm50m > 4999 )
			{
				precio33 = "Consultar"
				total3 = "Consultar"
			}
		}	
		
		
		
		
			

																						
			
			
			
			
			var cm59m=top.document.getElementById("59mm2").value
	var precio5=0;
	var precio55=0
	
		  if (cm59m!="")
		  {
			if (cm59m < 49)
			{
				precio5 = 0.90
			}						
			if (cm59m < 99 && cm59m > 49)
			{			
				precio5 = 0.80
			}
			if (cm59m < 499 && cm59m > 99)
			{ 
				precio5 = 0.52
			}		
			if (cm59m < 999 && cm59m > 499) 
			{
				precio5 = 0.5
			}						
			if (cm59m < 2499 && cm59m > 999) 
			{
				precio5 = 0.40
			}			
			if (cm59m < 5000 && cm59m > 2499) 
			{
				precio5 = 0.38
			}									
			
			
			precio55 = precio5 + " Euros"
			total5 = redondear(precio5 * cm59m,2)
			total5 = total5 + " Euros"
			

			if (cm59m > 4999 )
			{
				precio55 = "Consultar"
				total5 = "Consultar"
			}
		}	
									
									
	tablaRes2='<table width="270" border="0" cellspacing="0" cellpadding="1" class="textos">'+
                                
                            
                                '<tr>'+
                                 '<td height="1" colspan="2"></td>'+
                                  '</tr>'+
                                '<tr>'+
                                 ' <td width="66%"><div align="right">38mm Precio /  Unidad :</div></td>'+
                                 ' <td width="34%">'+precio22+'</td>'+
                                '</tr>'+
                                '<tr>'+
                                 ' <td><div align="right" class="precios_verde">Total '+cm38m+' Unidades :</div></td>'+
                                  '<td class="precios_verde">'+total2+' </td>'+
                                '</tr>'+
                                '<tr>'+
                                 ' <td height="1" colspan="2"></td>'+
                                  '</tr>'+
                                '<tr>'+
                                  '<td><div align="right">50mm Precio /  Unidad :</div></td>'+
                                  '<td>'+precio33+'</td>'+
                                '</tr>'+
                                '<tr>'+
                                 ' <td><div align="right" class="precios_verde">Total '+cm50m+' Unidades :</div></td>'+
                                 ' <td class="precios_verde"">'+total3+'</td>'+
                                '</tr>'+
                                 '<tr>'+
                                  '<td height="1" colspan="2"></td>'+
                                  '</tr>'+
								    
                                '<tr>'+
                                  '<td><div align="right">59mm Precio /  Unidad :</div></td>'+
                                  '<td>'+precio55+'</td>'+
                                '</tr>'+
                                '<tr>'+
                                 ' <td><div align="right" class="precios_verde">Total '+cm59m+' Unidades :</div></td>'+
                                 ' <td class="precios_verde">'+total5+'</td>'+
                                '</tr>'+
                                 '<tr>'+
                                  '<td height="1" colspan="2"></td>'+
                                  '</tr>'+
                               
                                 '<tr>'+
                                 ' <td height="1" colspan="2"></td>'+
                                '</tr>'+
                                '<tr>'+
                                 ' <td colspan="2" background="images/barra.gif"></td>'+
                                '</tr>'+
                                '<tr>'+
                                '  <td colspan="2" height="30"  class="pedir"><a href="mailto:info@chapalandia.com"><div align="center"><u>PEDIR AHORA</u></div></a></td>'+
                                '</tr>'+
                                '<tr>'+
                                '  <td colspan="2" background="images/barra.gif"></td>'+
                               ' </tr>'+
                                '<tr>'+
                                  '<td colspan="2"><div align="center" class="pedir">IVA y Gastos de Env&iacute;o NO incluidos.</div></td>'+
                                  '</tr>'+
                              '</table>'
	
	
	top.document.getElementById("imanes_precios").innerHTML=tablaRes2

 
 envios2='<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
                    '  <tr>'+
                        '<td><table width="190" cellpadding="0"  cellspacing="0" class="table" align="right">'+
                          '<tr>'+
                           ' <td valign="top"><table width="100%" border="0" cellspacing="8" cellpadding="0" align="center">'+
                              '<tr>'+
                                '<td align="left" ><span class="titulos_verde_peq">Precios Online</span></td>'+
                              '</tr><tr>'+
                                '<td>Introduce la cantidad de imanes deseada y pulsa en Consultar para ver el precio. As&iacute; de f&aacute;cil !!<br /></td>'+
                              '</tr>'+
                           ' </table></td>'+
                         ' </tr>'+
                       ' </table></td>'+
                     ' </tr>'+
                      '<tr>'+
                       ' <td height="8"></td>'+
                     ' </tr>'+
                      '<tr>'+
                        '<td><div id="envio" ><table width="190" border="0" cellspacing="8" cellpadding="0" align="right">'+
                          '<tr>'+
                            '<td align="left" ><span class="titulos_verde_peq">Gastos de env&iacute;o</span></td>'+
                          '</tr>'+
                         ' <tr>'+
                           ' <td>Certificado : 6 euros<br />'+
                            '  Certificado Urgente : 7 euros<br />'+
                            ' Transporte SEUR : 9 euros'+
                             ' <br />'+
                          '  </td>'+
                         ' </tr>'+
                       ' </table></div></td>'+
                     ' </tr>'+
                   ' </table>'
				   
	top.document.getElementById("envio_imanes").innerHTML=envios2
 
 }
 

 
 function redondear(cantidad, decimales) 
 {
	var cantidad = parseFloat(cantidad);
	var decimales = parseFloat(decimales);
	decimales = (!decimales ? 2 : decimales);
	return Math.round(cantidad * Math.pow(10, decimales)) / Math.pow(10, decimales);
} 
 
 
