jQuery(document).ready(function() {
// Script to remove empty pricing field.
  if(jQuery(".group-pvt-tour-sng-day-price .field-item").text()==""){   
    jQuery(".group-pvt-tour-sng-day-price").remove()
  }

// Script to remove empty pricing field.
  if(jQuery(".group-pvt-tour-multi-day-price .fieldset-wrapper").text()==""){
    jQuery(".group-pvt-tour-multi-day-price").remove()
  }


// Script to add a * just below the price display noting tour is no avaliable.
 if(jQuery(".group-pvt-tour-multi-day-price .field-name-field-low-price-2-persons .field-item").text()=="$0"){
    jQuery(".group-pvt-tour-multi-day-price .field-name-field-low-price-2-persons .field-item").text("*N/A")
    jQuery(".group-pvt-tour-multi-day-price").after("<p style='font-weight:bold;'>* This tour is not available in the winter time</p>")
  }

// Script to remove empty pricing field. 
jQuery(".group-pvt-tour-multi-day-price .field-item").each(function(){
    if(jQuery(".group-pvt-tour-multi-day-price .field-item").text()==""){
      jQuery(".group-pvt-tour-multi-day-price").remove()
    }
  })

// Script to remove empty pricing field. -- Likely not requird.
  if(jQuery(".group-festival-tour-with-price .field-item").text()==""){
    jQuery(".group-festival-tour-with-price").remove()
  }

// Commenting out this line. Believe is not needed as prices are not a field but WYSIYWYG Table.
/*  if(jQuery(".group-price-title .field-item").text()==""){
    jQuery(".group-price-title").remove()
  }
*/
  
// Script that is removing prices from the hotel nodes if they are empty.
if(jQuery(".group-hotel-price .field-item").text()==""){
    jQuery(".group-hotel-price").remove()
  }
  
// Script to move exchange rate for group tours and private tours
jQuery('.group-price-title h3').append(jQuery('.field-name-field-currency-exchange-rate .field-item').html());
jQuery('.field-name-field-departure-dates-price .field-item').prepend(jQuery('.field-name-field-currency-exchange-rate .field-item').html());
jQuery('.node-type-private-tour .field-name-field-currency-exchange-rate, .node-type-group-tour .field-name-field-currency-exchange-rate').remove();
 
// Script that is removing the locationn label if there are values.
if(jQuery(".location-locations-wrapper span.locality").text()==""){
    jQuery("h3.location-locations-header").addClass("hidden")
  }
 
// Script that is likely related to "Group Tours"  -- Likely not required.
  jQuery(".group-pvt-tour-multi-day-price li:nth-child(2)").addClass("second")
  jQuery(".group-hotel-price li:nth-child(2)").addClass("second")
  jQuery(".group-price-title h3.field-group-format-toggler.accordion-item").hide()

// Script that is used on private tour pages for (3) tab price effect.
jQuery(".group_top .second").hover(function() {
    jQuery(".first").removeClass("selected")
    jQuery(".last").removeClass("selected")
    jQuery(".second").addClass("selected")
    jQuery("#node_private_tour_full_group_low_season_price").css("display","none")
    jQuery("#node_private_tour_full_group_shoulder_season_price").css("display","block")
    jQuery("#node_private_tour_full_group_peak_season_price").css("display","none")
  })

// Script that is used on private tour pages for (3) tab price effect.
  jQuery(".group_top .first").hover(function() {
    jQuery(".last").removeClass("selected")
    jQuery(".second").removeClass("selected")
    jQuery(".first").addClass("selected")
    jQuery("#node_private_tour_full_group_low_season_price").css("display","block")
    jQuery("#node_private_tour_full_group_shoulder_season_price").css("display","none")
    jQuery("#node_private_tour_full_group_peak_season_price").css("display","none")
    jQuery(".group-weekday-price").css("display","block")
    jQuery(".group-weekend-price").css("display","none")
    jQuery("#node_cruise_ships_full_group_shoulder_season_price").css("display","block")
    jQuery("#node_cruise_ships_full_group_peak_season_price").css("display","none")
  })

// Script that is used on private tour pages for (3) tab price effect.
  jQuery(".group_top .last").hover(function() {
    jQuery(".first").removeClass("selected")
    jQuery(".second").removeClass("selected")
    jQuery(".last").addClass("selected")
    jQuery("#node_private_tour_full_group_low_season_price").css({'display': 'none', 'position': 'static'})
    jQuery("#node_private_tour_full_group_shoulder_season_price").css({'display': 'none', 'position': 'static'})
    jQuery("#node_private_tour_full_group_peak_season_price").css({'display': 'block', 'position': 'static'})
    jQuery(".group-weekday-price").css("display","none")
    jQuery(".group-weekend-price").css("display","block")
    jQuery("#node_cruise_ships_full_group_shoulder_season_price").css({'display': 'none', 'position': 'static'})
    jQuery("#node_cruise_ships_full_group_peak_season_price").css({'display': 'block', 'position': 'static'})
  })

// Script that is used on group tour pages for (2) tab effect.
  jQuery(".group-departure-dates-and-price").css({'display': 'none', 'position': 'static'})
  jQuery(".group-tour-detail li.first").addClass("over")
  jQuery(".group-tour-detail li.last").addClass("out")

// Script that is used on group tour pages for (2) tab effect.
  jQuery(".group-tour-detail li.first").hover(function() {
    jQuery(".group-tour-detail li.last").removeClass("selected over").addClass("out")    
    jQuery(".group-tour-detail li.first").addClass("over selected").removeClass("out")
    jQuery(".group-tour-detail fieldset:nth-child(1)").css("display","block")
    jQuery(".group-tour-detail fieldset:nth-child(2)").css("display","none")
  })
  
// Script that is used on group tour pages for (2) tab effect.  
  jQuery(".group-tour-detail li.last").hover(function() {
    jQuery(".group-tour-detail li.first").removeClass("selected over").addClass("out")
    jQuery(".group-tour-detail li.last").addClass("over selected").removeClass("out")
    jQuery(".group-tour-detail fieldset:nth-child(1)").css("display","none")
    jQuery(".group-tour-detail fieldset:nth-child(2)").css("display","block")
  })

// Script that is likely related to "Group Tours" -- Likely not required.
  jQuery(".field-name-field-departure-dates a").click(function() {
    jQuery(".group-tour-detail fieldset:nth-child(1)").css("display","none")
    jQuery(".group-tour-detail fieldset:nth-child(2)").css("display","block")
  })
  
// Script used in insert a ":" after the locatin label on hotels and other nodes.
  jQuery("h3.location-locations-header").append(":")
  
// Script that is being use on Private tours to put all Inclusions / Exclusions in an order list.
  jQuery('.field-name-field-private-tour-notes .field-item').each(function(){
    jQuery(this).replaceWith('<li style="list-style-type:decimal;list-style-position:outside;">' + jQuery(this).text() + '</li>')
  })

// Script that is being use on Private tours to put all Inclusions / Exclusions in an order list.  
  jQuery('.field-name-field-private-tour-notes li').wrapAll('<ul style="margin-left:20px;"></ul>')
  
// Script that is being use on Private tours to put all Inclusions / Exclusions in an order list.  
  jQuery(".group-general-inclusions .field-item").each(function(){
    jQuery(this).replaceWith('<li style="list-style-type:decimal;list-style-position:outside;">' + jQuery(this).text() + '</li>')
  })
  
// Script that is being use on Private tours to put all Inclusions / Exclusions in an order list.
jQuery(".group-general-inclusions li").wrapAll('<ul style="margin-left:20px;"></ul>')

// Script that is being use on Private tours to put all Inclusions / Exclusions in an order list.  
  jQuery(".group-general-exclusions .field-item").each(function(x){
    jQuery(this).replaceWith('<li style="list-style-type:decimal;list-style-position:outside;">' + jQuery(this).text() + '</li>')
  })

// Script that is being use on Private tours to put all Inclusions / Exclusions in an order list.  
  jQuery(".group-general-exclusions li").wrapAll('<ul style="margin-left:20px;"></ul>')

// Script that is being use on Group tours to put all Inclusions / Exclusions in an order list.  
  jQuery(".field-name-field-group-tour-notes .field-item").each(function(x){
    jQuery(this).replaceWith('<li style="list-style-type:decimal;list-style-position:outside;">' + jQuery(this).text() + '</li>')
  })

// Script that is being use on Group tours to put all Inclusions / Exclusions in an order list.    
  jQuery(".field-name-field-group-tour-notes li").wrapAll('<ul style="margin-left:20px;"></ul>')
  
});

;

