function getCostOfNewBathdipsByValue(animal) {
    
   var bathdipprices = getBathDipPrices();    
   var weightcategory = getWeightCategory(getNewDogWeight(animal));  

   if(!getNewIsDog(animal)) { weightcategory = 0; }
   
   var numpets = document.orderform.pets.value;
   
   //document.getElementById('testtexthere').innerHTML = document.getElementById('testtexthere').innerHTML + '<br> Animal '+animal+' weightcat '+weightcategory;
   
   var bathdipsdetails = new Array(5);
   bathdipsdetails[1] = ''; if(document.orderform.bathdips1 != null && numpets >= 1) { bathdipsdetails[1] = document.orderform.bathdips1.value; }
   bathdipsdetails[2] = ''; if(document.orderform.bathdips2 != null && numpets >= 2) { bathdipsdetails[2] = document.orderform.bathdips2.value; }
   bathdipsdetails[3] = ''; if(document.orderform.bathdips3 != null && numpets >= 3) { bathdipsdetails[3] = document.orderform.bathdips3.value; }
   bathdipsdetails[4] = ''; if(document.orderform.bathdips4 != null && numpets >= 4) { bathdipsdetails[4] = document.orderform.bathdips4.value; }
   bathdipsdetails[5] = ''; if(document.orderform.bathdips5 != null && numpets >= 5) { bathdipsdetails[5] = document.orderform.bathdips5.value; }   
   
   if(bathdipsdetails[animal] == 'bath') { return bathdipprices[weightcategory][0]; }
   if(bathdipsdetails[animal] == 'dip')  { return bathdipprices[weightcategory][1]; }
   if(bathdipsdetails[animal] == 'both') { return bathdipprices[weightcategory][2]; } 
   
   return 0;
 } 
 
function updateBathDipsCostNew() {
   
   var bathsdipscost = 1*getCostOfNewBathdipsByValue(1);   
   bathsdipscost += 1*getCostOfNewBathdipsByValue(2);   
   bathsdipscost += 1*getCostOfNewBathdipsByValue(3);
   bathsdipscost += 1*getCostOfNewBathdipsByValue(4);
   bathsdipscost += 1*getCostOfNewBathdipsByValue(5);   
   
   if(bathsdipscost == 0 || bathsdipscost == 'NaN') {
      document.getElementById('bathdipscost').innerHTML = '';
   }
   else {
      document.getElementById('bathdipscost').innerHTML = '$' + bathsdipscost;
      document.getElementById('bathdipscosttext').innerHTML = 'Bath/Dips'; 
   }   
} 

function updateBathDipsCost() {
   
   if(!getBoardedBefore()) { return updateBathDipsCostNew(); }
   
   var bathsdipscost = 1*getCostOfBathdipsByValue(1);   
   bathsdipscost += 1*getCostOfBathdipsByValue(2);   
   bathsdipscost += 1*getCostOfBathdipsByValue(3);
   bathsdipscost += 1*getCostOfBathdipsByValue(4);
   bathsdipscost += 1*getCostOfBathdipsByValue(5);   

   if(bathsdipscost == 0 || bathsdipscost == 'NaN') {
      document.getElementById('bathdipscost').innerHTML = '';
      document.getElementById('bathdipscosttext').innerHTML = '';       
   }
   else {
      document.getElementById('bathdipscost').innerHTML = '$' + bathsdipscost;
      document.getElementById('bathdipscosttext').innerHTML = 'Cost of All Baths/Dips';       
   }
   
}

function getCostOfBathdipsByValue(animal) {
   
   var bathdipprices = getBathDipPrices();    
   var weightcategory = getWeightCategory(getExistingDogWeight(animal));  
   
   if(!getIsDog(animal)) { weightcategory = 0; }
   
   var numpets = document.orderform.existingpets.value;
   
   var bathdipsdetails = new Array(5);
   bathdipsdetails[1] = ''; if(document.orderform.existing_bathdips1 != null && numpets >= 1) { bathdipsdetails[1] = document.orderform.existing_bathdips1.value; }
   bathdipsdetails[2] = ''; if(document.orderform.existing_bathdips2 != null && numpets >= 2) { bathdipsdetails[2] = document.orderform.existing_bathdips2.value; }
   bathdipsdetails[3] = ''; if(document.orderform.existing_bathdips3 != null && numpets >= 3) { bathdipsdetails[3] = document.orderform.existing_bathdips3.value; }
   bathdipsdetails[4] = ''; if(document.orderform.existing_bathdips4 != null && numpets >= 4) { bathdipsdetails[4] = document.orderform.existing_bathdips4.value; }
   bathdipsdetails[5] = ''; if(document.orderform.existing_bathdips5 != null && numpets >= 5) { bathdipsdetails[5] = document.orderform.existing_bathdips5.value; }   
   
   if(bathdipsdetails[animal] == 'bath') { return bathdipprices[weightcategory][0]; }
   if(bathdipsdetails[animal] == 'dip')  { return bathdipprices[weightcategory][1]; }
   if(bathdipsdetails[animal] == 'both') { return bathdipprices[weightcategory][2]; } 
   
   return 0;

} 
