
 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
	var total6=0
	
	
		  if (cm25m!="")
		  {
			if (cm25m < 49)
			{
				precio1 = 0.49
			}						
			if (cm25m < 99 && cm25m > 49)
			{			
				precio1 = 0.40
			}
			if (cm25m < 199 && cm25m > 99)
			{ 
				precio1 = 0.23
			}		
			if (cm25m < 499 && cm25m > 199) 
			{
				precio1 = 0.21
			}						
			if (cm25m < 999 && cm25m > 499) 
			{
				precio1 = 0.17
			}			
			if (cm25m < 2500 && cm25m > 999) 
			{
				precio1 = 0.15
			}									
			/*if (cm25m < 5000 && cm25m > 2499) 
			{
				precio1 = 0.15
			}*/
			
			precio11 = precio1 + " Euros"
			total = redondear(precio1 * cm25m,2)
			total = total + " Euros"
			

			if (cm25m > 2499 )
			{
				precio11 = '<a href="mailto:info@chapalandia.com">Consultar</a>'
				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.29
			}		
			if (cm38m < 499 && cm38m > 199) 
			{
				precio2 = 0.26
			}						
			if (cm38m < 999 && cm38m > 499) 
			{
				precio2 = 0.21
			}			
			if (cm38m < 2500 && cm38m > 999) 
			{
				precio2 = 0.17
			}									
			/*if (cm38m < 5000 && cm38m > 2499) 
			{
				precio2 = 0.17
			}*/
			
			precio22 = precio2 + " Euros"
			total2 = redondear(precio2 * cm38m,2)
			total2 = total2 + " Euros"
			

			if (cm38m > 2499 )
			{
				precio22 = '<a href="mailto:info@chapalandia.com">Consultar</a>'
				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 < 2500 && cm50m > 999) 
			{
				precio3 = 0.24
			}			
			/*if (cm50m < 5000 && cm50m > 2499) 
			{
				precio3 = 0.24
			}*/									
			
			
			precio33 = precio3 + " Euros"
			total3 = redondear(precio3 * cm50m,2)
			total3 = total3 + " Euros"
			

			if (cm50m > 2499 )
			{
				precio33 = '<a href="mailto:info@chapalandia.com">Consultar</a>'
				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 < 2500 && 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 > 2499 )
			{
				precio44 = '<a href="mailto:info@chapalandia.com">Consultar</a>'
				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.42
			}		
			if (cm59m < 999 && cm59m > 499) 
			{
				precio5 = 0.38
			}						
			if (cm59m < 2500 && cm59m > 999) 
			{
				precio5 = 0.25
			}			
			/*if (cm59m < 5000 && cm59m > 2499) 
			{
				precio5 = 0.25
			}*/									
			
			
			precio55 = precio5 + " Euros"
			total5 = redondear(precio5 * cm59m,2)
			total5 = total5 + " Euros"
			

			if (cm59m > 2499 )
			{
				precio55 = '<a href="mailto:info@chapalandia.com">Consultar</a>'
				total5 = "Consultar"
			}
		}	
				
				
	
	var cm75m=top.document.getElementById("75mm").value
	var precio6=0;
	var precio66=0
	
		  if (cm75m!="")
		  {
			if (cm75m < 49)
			{
				precio6 = 0.90
			}						
			if (cm75m < 99 && cm75m > 49)
			{			
				precio6 = 0.72
			}
			if (cm75m < 499 && cm75m > 99)
			{ 
				precio6 = 0.44
			}		
			if (cm75m < 999 && cm75m > 499) 
			{
				precio6 = 0.4
			}						
			if (cm75m < 2500 && cm75m > 999) 
			{
				precio6 = 0.36
			}			
			/*if (cm75m < 5000 && cm75m > 2499) 
			{
				precio6 = 0.32
			}*/									
			
			
			precio66 = precio6 + " Euros"
			total6 = redondear(precio6 * cm75m,2)
			total6 = total6 + " Euros"
			

			if (cm75m > 2499 )
			{
				precio66 = '<a href="mailto:info@chapalandia.com">Consultar</a>'
				total6 = "Consultar"
			}
		}						
									
	tablaRes='<table width="270" border="0" cellspacing="0" cellpadding="1" >'+
                                  '<tr>'+
                                  '<td width="66%"><div align="right">25mm Precio /  Unidad :</div></td>'+
                                  '<td width="34%" class="pedir2">'+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 class="pedir2">'+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 class="pedir2">'+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 class="pedir2">'+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">75mm Precio /  Unidad :</div></td>'+
                                  '<td class="pedir2">'+precio66+'</td>'+
                                '</tr>'+
                                '<tr>'+
                                 ' <td><div align="right" class="precios_verde">Total '+cm75m+' Unidades :</div></td>'+
                                 ' <td class="precios_verde">'+total6+'</td>'+
                                '</tr>'+
                                 '<tr>'+
                                  '<td height="1" colspan="2"></td>'+
                                  '</tr>'+
                                '<tr>'+
                                  '<td><div align="right">Cuadrada Precio /  Unidad :</div></td>'+
                                  '<td class="pedir2">'+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 total6=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.5
			}		
			if (cm38m < 499 && cm38m > 199) 
			{
				precio2 = 0.52
			}						
			if (cm38m < 999 && cm38m > 499) 
			{
				precio2 = 0.42
			}			
			if (cm38m < 2500 && 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 > 2499 )
			{
				precio22 = '<a href="mailto:info@chapalandia.com">Consultar</a>'
				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.50
			}		
			if (cm50m < 999 && cm50m > 499) 
			{
				precio3 = 0.38
			}						
			if (cm50m < 2500 && 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 > 2499 )
			{
				precio33 = '<a href="mailto:info@chapalandia.com">Consultar</a>'
				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 < 2500 && 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 > 2499 )
			{
				precio55 = '<a href="mailto:info@chapalandia.com">Consultar</a>'
				total5 = "Consultar"
			}
		}
		
		var cm75m=top.document.getElementById("75mm2").value
	var precio6=0;
	var precio66=0
	
		  if (cm75m!="")
		  {
			if (cm75m < 49)
			{
				precio6 = 0.92
			}						
			if (cm75m < 99 && cm75m > 49)
			{			
				precio6 = 0.78
			}
			if (cm75m < 499 && cm75m > 99)
			{ 
				precio6 = 0.58
			}		
			if (cm75m < 999 && cm75m > 499) 
			{
				precio6 = 0.52
			}						
			if (cm75m < 2500 && cm75m > 999) 
			{
				precio6 = 0.48
			}			
			/*if (cm75m < 5000 && cm75m > 2499) 
			{
				precio6 = 0.44
			}*/									
			
			
			precio66 = precio6 + " Euros"
			total6 = redondear(precio6 * cm75m,2)
			total6 = total6 + " Euros"
			

			if (cm75m > 2499 )
			{
				precio66 = '<a href="mailto:info@chapalandia.com">Consultar</a>'
				total6 = "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%" class="pedir2">'+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 class="pedir2">'+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 class="pedir2">'+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><div align="right">75mm Precio /  Unidad :</div></td>'+
                                  '<td class="pedir2">'+precio66+'</td>'+
                                '</tr>'+
                                '<tr>'+
                                 ' <td><div align="right" class="precios_verde">Total '+cm75m+' Unidades :</div></td>'+
                                 ' <td class="precios_verde">'+total6+'</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);
} 
 
 

