

function calculateday(){

  var f;

  f=document.orderformday;

  if(parseInt(f.qty_day_a500.value) > 1){
    alert("Maximum 1 for this item.");
    f.qty_day_a500.value=0;
  }
  if(parseInt(f.qty_day_micheld.value) > 4){
    alert("Maximum 4 for this item.");
    f.qty_day_micheld.value=0;
  }
  if(parseInt(f.qty_day_miclava.value) > 4){
    alert("Maximum 4 for this item.");
    f.qty_day_miclava.value=0;
  }
  if(parseInt(f.qty_day_micset.value) > 4){
    alert("Maximum 4 for this item.");
    f.qty_day_micset.value=0;
  }


  f.total_day_prx512m.value = str_replace(',', '', number_format(parseInt(f.qty_day_prx512m.value) * 50, 2));
  f.total_day_quickloc.value = str_replace(',', '', number_format(parseInt(f.qty_day_quickloc.value) * 5, 2));
  f.total_day_quicksls.value = str_replace(',', '', number_format(parseInt(f.qty_day_quicksls.value) * 25, 2));
  f.total_day_prx518x.value = str_replace(',', '', number_format(parseInt(f.qty_day_prx518x.value) * 60, 2));
  f.total_day_e6mixer.value = str_replace(',', '', number_format(parseInt(f.qty_day_e6mixer.value) * 35, 2));
  f.total_day_cd450.value = str_replace(',', '', number_format(parseInt(f.qty_day_cd450.value) * 20, 2));
  f.total_day_a500.value = str_replace(',', '', number_format(parseInt(f.qty_day_a500.value) * 15, 2));
  f.total_day_sm57.value = str_replace(',', '', number_format(parseInt(f.qty_day_sm57.value) * 10, 2));
  f.total_day_sm58.value = str_replace(',', '', number_format(parseInt(f.qty_day_sm58.value) * 10, 2));
  f.total_day_ms12.value = str_replace(',', '', number_format(parseInt(f.qty_day_ms12.value) * 5, 2));
  f.total_day_ms25.value = str_replace(',', '', number_format(parseInt(f.qty_day_ms25.value) * 7.50, 2));
  f.total_day_km211.value = str_replace(',', '', number_format(parseInt(f.qty_day_km211.value) * 2.5, 2));
  f.total_day_micheld.value = str_replace(',', '', number_format(parseInt(f.qty_day_micheld.value) * 50, 2));
  f.total_day_miclava.value = str_replace(',', '', number_format(parseInt(f.qty_day_miclava.value) * 60, 2));
  f.total_day_micset.value = str_replace(',', '', number_format(parseInt(f.qty_day_micset.value) * 65, 2));

  var x;
  x=parseFloat(f.total_day_prx512m.value);
  x=x+parseFloat(f.total_day_quickloc.value);
  x=x+parseFloat(f.total_day_quicksls.value);
  x=x+parseFloat(f.total_day_prx518x.value);
  x=x+parseFloat(f.total_day_e6mixer.value);
  x=x+parseFloat(f.total_day_cd450.value);
  x=x+parseFloat(f.total_day_a500.value);
  x=x+parseFloat(f.total_day_sm57.value);
  x=x+parseFloat(f.total_day_sm58.value);
  x=x+parseFloat(f.total_day_ms12.value);
  x=x+parseFloat(f.total_day_ms25.value);
  x=x+parseFloat(f.total_day_km211.value);
  x=x+parseFloat(f.total_day_micheld.value);
  x=x+parseFloat(f.total_day_miclava.value);
  x=x+parseFloat(f.total_day_micset.value);

  f.grandtotal.value=str_replace(',', '', number_format(x, 2));

}


function calculatewkd(){

  var f;

  f=document.orderformwkd;

  if(parseInt(f.qty_wkd_a500.value) > 1){
    alert("Maximum 1 for this item.");
    f.qty_wkd_a500.value=0;
  }
  if(parseInt(f.qty_wkd_micheld.value) > 4){
    alert("Maximum 4 for this item.");
    f.qty_wkd_micheld.value=0;
  }
  if(parseInt(f.qty_wkd_miclava.value) > 4){
    alert("Maximum 4 for this item.");
    f.qty_wkd_miclava.value=0;
  }
  if(parseInt(f.qty_wkd_micset.value) > 4){
    alert("Maximum 4 for this item.");
    f.qty_wkd_micset.value=0;
  }

  f.total_wkd_prx512m.value = str_replace(',', '', number_format(parseInt(f.qty_wkd_prx512m.value) * 75, 2));
  f.total_wkd_quickloc.value = str_replace(',', '', number_format(parseInt(f.qty_wkd_quickloc.value) * 7.5, 2));
  f.total_wkd_quicksls.value = str_replace(',', '', number_format(parseInt(f.qty_wkd_quicksls.value) * 37.5, 2));
  f.total_wkd_prx518x.value = str_replace(',', '', number_format(parseInt(f.qty_wkd_prx518x.value) * 90, 2));
  f.total_wkd_e6mixer.value = str_replace(',', '', number_format(parseInt(f.qty_wkd_e6mixer.value) * 52.5, 2));
  f.total_wkd_cd450.value = str_replace(',', '', number_format(parseInt(f.qty_wkd_cd450.value) * 30, 2));
  f.total_wkd_a500.value = str_replace(',', '', number_format(parseInt(f.qty_wkd_a500.value) * 22.5, 2));
  f.total_wkd_sm57.value = str_replace(',', '', number_format(parseInt(f.qty_wkd_sm57.value) * 15, 2));
  f.total_wkd_sm58.value = str_replace(',', '', number_format(parseInt(f.qty_wkd_sm58.value) * 15, 2));
  f.total_wkd_ms12.value = str_replace(',', '', number_format(parseInt(f.qty_wkd_ms12.value) * 7.5, 2));
  f.total_wkd_ms25.value = str_replace(',', '', number_format(parseInt(f.qty_wkd_ms25.value) * 11.25, 2));
  f.total_wkd_km211.value = str_replace(',', '', number_format(parseInt(f.qty_wkd_km211.value) * 3.75, 2));
  f.total_wkd_micheld.value = str_replace(',', '', number_format(parseInt(f.qty_wkd_micheld.value) * 75, 2));
  f.total_wkd_miclava.value = str_replace(',', '', number_format(parseInt(f.qty_wkd_miclava.value) * 90, 2));
  f.total_wkd_micset.value = str_replace(',', '', number_format(parseInt(f.qty_wkd_micset.value) * 97.5, 2));

  var x;
  x=parseFloat(f.total_wkd_prx512m.value);
  x=x+parseFloat(f.total_wkd_quickloc.value);
  x=x+parseFloat(f.total_wkd_quicksls.value);
  x=x+parseFloat(f.total_wkd_prx518x.value);
  x=x+parseFloat(f.total_wkd_e6mixer.value);
  x=x+parseFloat(f.total_wkd_cd450.value);
  x=x+parseFloat(f.total_wkd_a500.value);
  x=x+parseFloat(f.total_wkd_sm57.value);
  x=x+parseFloat(f.total_wkd_sm58.value);
  x=x+parseFloat(f.total_wkd_ms12.value);
  x=x+parseFloat(f.total_wkd_ms25.value);
  x=x+parseFloat(f.total_wkd_km211.value);
  x=x+parseFloat(f.total_wkd_micheld.value);
  x=x+parseFloat(f.total_wkd_miclava.value);
  x=x+parseFloat(f.total_wkd_micset.value);

  f.grandtotal.value=str_replace(',', '', number_format(x, 2));

}

function calculatewky(){

  var f;

  f=document.orderformwky;

  if(parseInt(f.qty_wky_a500.value) > 1){
    alert("Maximum 1 for this item.");
    f.qty_wky_a500.value=0;
  }
  if(parseInt(f.qty_wky_micheld.value) > 4){
    alert("Maximum 4 for this item.");
    f.qty_wky_micheld.value=0;
  }
  if(parseInt(f.qty_wky_miclava.value) > 4){
    alert("Maximum 4 for this item.");
    f.qty_wky_miclava.value=0;
  }
  if(parseInt(f.qty_wky_micset.value) > 4){
    alert("Maximum 4 for this item.");
    f.qty_wky_micset.value=0;
  }

  f.total_wky_prx512m.value = str_replace(',', '', number_format(parseInt(f.qty_wky_prx512m.value) * 125, 2));
  f.total_wky_quickloc.value = str_replace(',', '', number_format(parseInt(f.qty_wky_quickloc.value) * 12.5, 2));
  f.total_wky_quicksls.value = str_replace(',', '', number_format(parseInt(f.qty_wky_quicksls.value) * 62.5, 2));
  f.total_wky_prx518x.value = str_replace(',', '', number_format(parseInt(f.qty_wky_prx518x.value) * 150, 2));
  f.total_wky_e6mixer.value = str_replace(',', '', number_format(parseInt(f.qty_wky_e6mixer.value) * 87.50, 2));
  f.total_wky_cd450.value = str_replace(',', '', number_format(parseInt(f.qty_wky_cd450.value) * 87.5, 2));
  f.total_wky_a500.value = str_replace(',', '', number_format(parseInt(f.qty_wky_a500.value) * 37.5, 2));
  f.total_wky_sm57.value = str_replace(',', '', number_format(parseInt(f.qty_wky_sm57.value) * 25, 2));
  f.total_wky_sm58.value = str_replace(',', '', number_format(parseInt(f.qty_wky_sm58.value) * 25, 2));
  f.total_wky_ms12.value = str_replace(',', '', number_format(parseInt(f.qty_wky_ms12.value) * 12.5, 2));
  f.total_wky_ms25.value = str_replace(',', '', number_format(parseInt(f.qty_wky_ms25.value) * 18.75, 2));
  f.total_wky_km211.value = str_replace(',', '', number_format(parseInt(f.qty_wky_km211.value) * 6.25, 2));
  f.total_wky_micheld.value = str_replace(',', '', number_format(parseInt(f.qty_wky_micheld.value) * 125, 2));
  f.total_wky_miclava.value = str_replace(',', '', number_format(parseInt(f.qty_wky_miclava.value) * 150, 2));
  f.total_wky_micset.value = str_replace(',', '', number_format(parseInt(f.qty_wky_micset.value) * 162.5, 2));

  var x;
  x=parseFloat(f.total_wky_prx512m.value);
  x=x+parseFloat(f.total_wky_quickloc.value);
  x=x+parseFloat(f.total_wky_quicksls.value);
  x=x+parseFloat(f.total_wky_prx518x.value);
  x=x+parseFloat(f.total_wky_e6mixer.value);
  x=x+parseFloat(f.total_wky_cd450.value);
  x=x+parseFloat(f.total_wky_a500.value);
  x=x+parseFloat(f.total_wky_sm57.value);
  x=x+parseFloat(f.total_wky_sm58.value);
  x=x+parseFloat(f.total_wky_ms12.value);
  x=x+parseFloat(f.total_wky_ms25.value);
  x=x+parseFloat(f.total_wky_km211.value);
  x=x+parseFloat(f.total_wky_micheld.value);
  x=x+parseFloat(f.total_wky_miclava.value);
  x=x+parseFloat(f.total_wky_micset.value);

  f.grandtotal.value=str_replace(',', '', number_format(x, 2));

}


