<!--

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function cekflight(sString,tString)
{ 
  var i,p,q,nm,test,num,min,max,errors='',args=cekflight.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]); }
  //if (val) { nm=val.name; if ((val=val.value)!="") {
  //nm=val.name; 
  if (tString=="f") {//alert(tString);
  if (document.form1.fsd.value=="") {
  efesde=0;
  }
  else {
  efesde=((4000/100)*8*0.00257*document.form1.fsd.value);
  }
  if (document.form1.fld.value=="") {
  efelde=0;
  }
  else {
  efelde=((20000/100)*4*0.00257*document.form1.fld.value);
  }
  
  grandtotal=efelde+efesde;
  document.form1.tot_flight.value=Math.round((grandtotal)*100)/100;
  }

  if (tString=="ffar") {//alert(tString);
  if (sString!="") {grandtotal=(sString*(4/100)*0.00257);
  document.form1.tot_flight.value=Math.round((grandtotal)*100)/100;
  document.form1.fld.value="";
  document.form1.fsd.value="";
  }
  }

}


function cekcar(sString)
{ 
  if (sString=="sometimes") {//alert('sd');
  if (sString!="") {grandtotal=0.41;
  document.form1.tot_car.value=Math.round((grandtotal)*100)/100;
  document.form1.cfar.value="";
  }
  }
  if (sString=="often") {//alert('sd');
  if (sString!="") {grandtotal=1.63;
  document.form1.tot_car.value=Math.round((grandtotal)*100)/100;
  document.form1.cfar.value="";
  }
  }
  if (sString=="always") {//alert('sd');
  if (sString!="") {grandtotal=6.524;
  document.form1.tot_car.value=Math.round((grandtotal)*100)/100;
  document.form1.cfar.value="";
  }
  }
  
  if ((sString!="often") && (sString!="always") && (sString!="sometimes")){
  grandtotal=(sString*(7/100)*0.00233);
  document.form1.tot_car.value=Math.round((grandtotal)*100)/100;
  //document.form1.car.unchecked = true;
  document.form1.car[0].checked=false;
  document.form1.car[1].checked=false;
  document.form1.car[2].checked=false;
  //alert('aaa');

  }
}

function cektrain(sString)
{ 
  if (sString=="sometimes") {//alert('sd');
  if (sString!="") {grandtotal=0.15;
  document.form1.tot_train.value=Math.round((grandtotal)*100)/100;
  document.form1.tfar.value="";
  }
  }
  if (sString=="often") {//alert('sd');
  if (sString!="") {grandtotal=0.6;
  document.form1.tot_train.value=Math.round((grandtotal)*100)/100;
  document.form1.tfar.value="";
  }
  }
  if (sString=="always") {//alert('sd');
  if (sString!="") {grandtotal=2.4;
  document.form1.tot_train.value=Math.round((grandtotal)*100)/100;
  document.form1.tfar.value="";
  }
  }
  
  if ((sString!="often") && (sString!="always") && (sString!="sometimes")){
  grandtotal=(sString*0.00006);
  document.form1.tot_train.value=Math.round((grandtotal)*100)/100;
  document.form1.train[0].checked=false;
  document.form1.train[1].checked=false;
  document.form1.train[2].checked=false;

  }
}


function cekelectricity(sString)
{ 
  if ((document.form1.electricity[0].checked==false) && (document.form1.electricity[1].checked==false) && (document.form1.electricity[2].checked==false)) {
  document.form1.tot_electricity.value="";
  }
  else {
  if (sString=="below") {//alert('sd');
  if (sString!="") {grandtotal=0.381;
  document.form1.tot_electricity.value=Math.round((grandtotal)*100)/100;
  document.form1.xelectricity.value="";
  }
  }
  if (sString=="average") {//alert('sd');
  if (sString!="") {grandtotal=0.762;
  document.form1.tot_electricity.value=Math.round((grandtotal)*100)/100;
  document.form1.xelectricity.value="";
  }
  }
  if (sString=="above") {//alert('sd');
  if (sString!="") {grandtotal=1.524;
  document.form1.tot_electricity.value=Math.round((grandtotal)*100)/100;
  document.form1.xelectricity.value="";
  }
  }
  }
  
  if ((sString!="below") && (sString!="average") && (sString!="above")){
  grandtotal=(sString*0.000635);
  document.form1.tot_electricity.value=Math.round((grandtotal)*100)/100;
  document.form1.electricity[0].checked=false;
  document.form1.electricity[1].checked=false;
  document.form1.electricity[2].checked=false;

  }
}


function cekheating(sString)
{ //alert(sString);
  //alert('sd');
  //document.form1.heating[0].checked=false;
  //document.form1.heating[1].checked=false;
  //document.form1.heating[2].checked=false;
  //document.form1.heating[3].checked=false;
  //document.form1.heating[4].checked=false;
  //document.form1.heating[5].checked=false;
  grandtotal=0;
  if (sString=="hobelow") {grandtotal=1.31; }
  if (sString=="hoaverage") {grandtotal=2.62;}
  if (sString=="hoabove") {grandtotal=5.25;}
  if (sString=="hgbelow") {grandtotal=0.89;}
  if (sString=="hgaverage") {grandtotal=1.78;}
  if (sString=="hgabove") {grandtotal=3.56;}
  
  if ((sString=="hobelow") || (sString=="hoaverage") || (sString=="hoabove")) {//alert('sd');
  if (sString!="") {
  document.form1.tot_heatingoil.value=Math.round((grandtotal)*100)/100;
  document.form1.tot_heatinggas.value="";
  document.form1.xheatingoil.value="";
  document.form1.xheatinggas.value="";
  }}
  
  if ((sString=="hgbelow") || (sString=="hgaverage") || (sString=="hgabove")) {//alert('sd');
  if (sString!="") {
  document.form1.tot_heatinggas.value=Math.round((grandtotal)*100)/100;
  document.form1.tot_heatingoil.value="";
  document.form1.xheatingoil.value="";
  document.form1.xheatinggas.value="";
  }}
  //if ((sString!="below") && (sString!="average") && (sString!="above")){
  //grandtotal=(sString*0.00262);
  //document.form1.tot_heatingoil.value=Math.round((grandtotal)*100)/100;
  
}

function cekxheating(jumlah,sString)
{ alert(jumlah);
  //alert('sd');
  document.form1.heating[0].checked=false;
  document.form1.heating[1].checked=false;
  document.form1.heating[2].checked=false;
  document.form1.heating[3].checked=false;
  document.form1.heating[4].checked=false;
  document.form1.heating[5].checked=false;
  if (sString=="oil") {
  grandtotal=(jumlah*0.00262);
  document.form1.tot_heatingoil.value=Math.round((grandtotal)*100)/100;
  document.form1.tot_heatinggas.value=0;
  document.form1.xheatinggas.value="";
  }
  if (sString=="gas") {
  grandtotal=(jumlah*0.00178);
  document.form1.tot_heatinggas.value=Math.round((grandtotal)*100)/100;
  document.form1.tot_heatingoil.value=0;
  document.form1.xheatingoil.value="";

  }
  
  
}

function cekfood(sString)
{ 
  if (sString=="below") {//alert('sd');
  if (sString!="") {grandtotal=0.7;
  document.form1.tot_food.value=Math.round((grandtotal)*100)/100;
  }
  }
  if (sString=="average") {//alert('sd');
  if (sString!="") {grandtotal=1.5;
  document.form1.tot_food.value=Math.round((grandtotal)*100)/100;
  }
  }
  if (sString=="above") {//alert('sd');
  if (sString!="") {grandtotal=3;
  document.form1.tot_food.value=Math.round((grandtotal)*100)/100;
  }
  }
}

function cekgoods(sString)
{ 
  if (sString=="below") {//alert('sd');
  if (sString!="") {grandtotal=1;
  document.form1.tot_goods.value=Math.round((grandtotal)*100)/100;
  }
  }
  if (sString=="average") {//alert('sd');
  if (sString!="") {grandtotal=2.3;
  document.form1.tot_goods.value=Math.round((grandtotal)*100)/100;
  }
  }
  if (sString=="above") {//alert('sd');
  if (sString!="") {grandtotal=5;
  document.form1.tot_goods.value=Math.round((grandtotal)*100)/100;
  }
  }
}



function cektotal()
{ 
  flight=document.form1.tot_flight.value*1;
  car=document.form1.tot_car.value*1;
  train=document.form1.tot_train.value*1;
  electricity=document.form1.tot_electricity.value*1;
  heatingoil=document.form1.tot_heatingoil.value*1;
  heatinggas=document.form1.tot_heatinggas.value*1;
  food=document.form1.tot_food.value*1;
  goods=document.form1.tot_goods.value*1;
  public=document.form1.tot_public.value*1;
  grandtotal=flight+car+train+electricity+heatingoil+heatinggas+food+goods+public;
  document.form1.grandtotal.value=Math.round((grandtotal)*100)/100;
  
}

function insialisasi() 
{

  document.form1.heating[0].checked=false;
  document.form1.heating[1].checked=false;
  document.form1.heating[2].checked=false;
  document.form1.heating[3].checked=false;
  document.form1.heating[4].checked=false;
  document.form1.heating[5].checked=false;
  document.form1.car[0].checked=false;
  document.form1.car[1].checked=false;
  document.form1.car[2].checked=false;

document.form1.tot_flight.value="";
document.form1.tot_car.value="";
document.form1.tot_train.value="";
document.form1.tot_electricity.value="";
document.form1.tot_heatinggas.value="";
document.form1.tot_heatingoil.value="";
document.form1.tot_food.value="";
document.form1.tot_goods.value="";
//document.MM_x = false;
//alert('Inisialisasi');
}


function hektare(sString) 
{

  document.form1.euro.value=360*sString;
  document.form1.rupiah.value=4500000*sString;
  document.form1.us.value=490*sString;
//document.MM_x = false;
//alert('Inisialisasi');
}

//-->
