
function showCounties(){
  $('#ctl00_ContentPlaceHolder1_countrylist').toggle('blind');
  switchImage('#countrydrilldown');
  $('#ctl00_ContentPlaceHolder1_statelist').hide();
  $('#statedrilldown').removeClass('searchcloseimg');
  $('#ctl00_ContentPlaceHolder1_citylist').hide();
  $('#citydrilldown').removeClass('searchcloseimg');
  return false;
}

function showStates(){
  $('#ctl00_ContentPlaceHolder1_countrylist').hide();
  $('#countrydrilldown').removeClass('searchcloseimg');
  $('#ctl00_ContentPlaceHolder1_statelist').toggle('blind');
  switchImage('#statedrilldown');
  $('#ctl00_ContentPlaceHolder1_citylist').hide();
  $('#citydrilldown').removeClass('searchcloseimg');
  return false;
}

function showCities(){
  $('#ctl00_ContentPlaceHolder1_countrylist').hide();
  $('#countrydrilldown').removeClass('searchcloseimg');
  $('#ctl00_ContentPlaceHolder1_statelist').hide();
  $('#statedrilldown').removeClass('searchcloseimg');
  $('#ctl00_ContentPlaceHolder1_citylist').toggle('blind');
  switchImage('#citydrilldown');
  return false;
}

function showFamily(){
  $('#familyblock').toggle('blind');
  switchImage('#familyTitle');
  return false;
}

function switchImage(obj){
  if ($(obj).hasClass('searchcloseimg')){
    $(obj).removeClass('searchcloseimg');
  }else{
    $(obj).addClass('searchcloseimg');
  }
}

var img_close = '/images/search_close.jpg';
var img_open =  '/images/search_open.jpg';
var txbxArrive = '#ctl00_ContentPlaceHolder1_txbxArrive';
var txbxDepart = '#ctl00_ContentPlaceHolder1_txbxDepart';
$(document).ready(function(){
  $('#blind_dates').click(function(){
    switchImage(this);
    $('#travel_dates').toggle('blind');
    return false;
  });
  $(txbxArrive).datepicker({
        buttonImageOnly: true,
        showButtonPanel: true,
        numberOfMonths: 2,
        onSelect : function(dateText, inst){
          if ($(txbxDepart).val() == ''){
            $(txbxDepart).datepicker('setDate', dateText);
            $(txbxDepart).datepicker('setDate', 'c+1d');
          }
        }
    });
    $(txbxDepart).datepicker({
        buttonImageOnly: true,
        showButtonPanel: true,
        numberOfMonths: 2
    });
});
