
<!--
function kallenar1()
{
calculate(); 
llenar();
};


function llenar(obj,yo)
{
var sumar=0;
var su=0;
su = llenar2(obj)+llenar3(obj)+llenar4(obj)+llenar5(obj)+llenar6(obj)+llenar7(obj)+llenar8(obj)+llenar9(obj)+llenar10(obj)
+llenar11(obj)+llenar12(obj)+llenar13(obj)


document.form1.Comentarios.value = su;

sumar = dp(eval(llen2(yo))+eval(llen3(yo))+eval(llen4(yo))+eval(llen5(yo))+eval(llen6(yo))+eval(llen7(yo))+eval(llen8(yo))+eval(llen9(yo))
+eval(llen10(yo))+eval(llen11(yo))+eval(llen12(yo))+eval(llen13(yo)));

document.form1.totalfinal2.value = sumar;
};


ver = new Ver2()
function Ver2() 
{
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b	
}


//sirve para que solo se ingresen numeros. al campo cantidad tabla 1.
function valnum() {
if (ver.b== "ie") 
{
  var el = event.srcElement;
  var num = "0123456789";
  event.returnValue = true;  
for (var intLoop = 0; intLoop < el.value.length; intLoop++)
     if (-1 == num.indexOf(el.value.charAt(intLoop))) 
        event.returnValue=false;
        if (!event.returnValue)    {   
          el.className = "badValue"; 
        }
        else  {
        el.className="";
        }
}
 };




//coloca 0 al final de los resultados

function dp(price) 
{
   string = "" + price;
   number = string.length - string.indexOf('.');
   if (string.indexOf('.') == -1)
      return string + '';
   if (number == 1)
      return string + '';
   if (number == 2)
      return string + '';
   if (number > 3)
      return string.substring(0,string.length-number+3);
return string;
}

//calcula la tabla1
function calculate()
{
document.calcform.total1.value = dp((1800)*(document.calcform.txt1.value))
document.calcform.total2.value = dp((1500)*(document.calcform.txt2.value))
document.calcform.total3.value = dp((2000)*(document.calcform.txt3.value))
document.calcform.total4.value = dp((1500)*(document.calcform.txt4.value))
document.calcform.total5.value = dp((2000)*(document.calcform.txt5.value))
document.calcform.total6.value = dp((1500)*(document.calcform.txt6.value))
document.calcform.total7.value = dp((1100)*(document.calcform.txt7.value))
document.calcform.total8.value = dp((2000)*(document.calcform.txt8.value))
document.calcform.total9.value = dp((1100)*(document.calcform.txt9.value))
document.calcform.total10.value = dp((1100)*(document.calcform.txt10.value))
document.calcform.total11.value = dp((1100)*(document.calcform.txt11.value))
document.calcform.total12.value = dp((1100)*(document.calcform.txt12.value))


document.calcform.total.value = dp(eval(document.calcform.total1.value) + eval(document.calcform.total2.value) 
+ eval(document.calcform.total3.value) + eval(document.calcform.total4.value) + eval(document.calcform.total5.value) 
+ eval(document.calcform.total6.value) + eval(document.calcform.total7.value) + eval(document.calcform.total8.value) 
+ eval(document.calcform.total9.value) + eval(document.calcform.total10.value) + eval(document.calcform.total11.value) 
+ eval(document.calcform.total12.value))

}




//....................... verificar si  la linea esta con check y con una cantidad
function llenar2(obj)
{
  if ((document.calcform.ch1.checked)&&(document.calcform.txt1.value !="" && document.calcform.txt1.value != 0)) { obj = "\n" + document.calcform.txt1.value + "  " +  "Nš1 ARAUCARIA" + "  " + document.calcform.total1.value; }
  else  { obj = ""; }
return obj; 
}
function llenar3(obj)
{
  if ((document.calcform.ch2.checked)&&(document.calcform.txt2.value !="" && document.calcform.txt2.value != 0)) { obj = "\n" + document.calcform.txt2.value + "  " +  "Nš2 ARRAYAN" + "  " + document.calcform.total2.value; }
  else  { obj = ""; }
return obj;
}
function llenar4(obj)
{
  if ((document.calcform.ch3.checked)&&(document.calcform.txt3.value !="" && document.calcform.txt3.value != 0)) { obj = "\n" + document.calcform.txt3.value + "  " +  "Nš3 COIHUE" + "  " + document.calcform.total3.value; }
  else  { obj = ""; }
return obj;
}
function llenar5(obj)
{
  if ((document.calcform.ch4.checked)&&(document.calcform.txt4.value !="" && document.calcform.txt4.value != 0)) { obj = "\n" + document.calcform.txt4.value + "  " +  "Nš4 CANELO" + "  " + document.calcform.total4.value; }
  else  { obj = ""; }
return obj;
}
function llenar6(obj)
{
  if ((document.calcform.ch5.checked)&&(document.calcform.txt5.value !="" && document.calcform.txt5.value != 0)) { obj = "\n" + document.calcform.txt5.value + "  " +  "Nš5 GUINDO SANTO" + "  " + document.calcform.total5.value; }
  else  { obj = ""; }
return obj; 
}
function llenar7(obj)
{
  if ((document.calcform.ch6.checked)&&(document.calcform.txt6.value !="" && document.calcform.txt6.value != 0)) { obj = "\n" + document.calcform.txt6.value + "  " +  "Nš6 LAUREL" + "  " + document.calcform.total6.value; }
  else  { obj = ""; }
return obj;
}
function llenar8(obj)
{
  if ((document.calcform.ch7.checked)&&(document.calcform.txt7.value !="" && document.calcform.txt7.value != 0)) { obj = "\n" + document.calcform.txt7.value + "  " +  "Nš7 LINGUE" + "  " + document.calcform.total7.value; }
  else  { obj = ""; }
return obj;
}
function llenar9(obj)
{
  if ((document.calcform.ch8.checked)&&(document.calcform.txt8.value !="" && document.calcform.txt8.value != 0)) { obj = "\n" + document.calcform.txt8.value + "  " +  "Nš8 MAITEN" + "  " + document.calcform.total8.value; }
  else  { obj = ""; }
return obj;
}
function llenar10(obj)
{
  if ((document.calcform.ch9.checked)&&(document.calcform.txt9.value !="" && document.calcform.txt9.value != 0)) { obj = "\n" + document.calcform.txt9.value + "  " +  "Nš9 PATAGUA" + "  " + document.calcform.total9.value; }
  else  { obj = ""; }
return obj; 
}
function llenar11(obj)
{
  if ((document.calcform.ch10.checked)&&(document.calcform.txt10.value !="" && document.calcform.txt10.value != 0)) { obj = "\n" + document.calcform.txt10.value + "  " +  "Nš10 PEUMO" + "  " + document.calcform.total10.value; }
  else  { obj = ""; }
return obj;
}
function llenar12(obj)
{
  if ((document.calcform.ch11.checked)&&(document.calcform.txt11.value !="" && document.calcform.txt11.value != 0)) { obj = "\n" + document.calcform.txt11.value + "  " +  "Nš11 QUILLAY" + "  " + document.calcform.total11.value; }
  else  { obj = ""; }
return obj;
}
function llenar13(obj)
{
  if ((document.calcform.ch12.checked)&&(document.calcform.txt12.value !="" && document.calcform.txt12.value != 0)) { obj = "\n" + document.calcform.txt12.value + "  " +  "DT RAULI" + "  " + document.calcform.total12.value; }
  else  { obj = ""; }
return obj;
}


//  -->
