// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
window.onload = function() {
	var out = '';
	$$('#tmNavigation ul li a').each(function(e) {
		if (e.href == window.location.href) {
			e.addClassName('current');
			return true;
		}
  });
}

var app = {
  shippingIsBilling : function(el) {
    if (el.checked) {
      $('gift_card_billing_address_1').value = $F('gift_card_shipping_address_1')
      $('gift_card_billing_address_2').value = $F('gift_card_shipping_address_2')
      $('gift_card_billing_city').value = $F('gift_card_shipping_city')
      $('gift_card_billing_state').value = $F('gift_card_shipping_state')
      $('gift_card_billing_zip_code').value = $F('gift_card_shipping_zip_code')
    }
  },
	updateReserveDates : function() {
		var year = $F('reservation_year')
		var month = $F('reservation_month')
		new Ajax.Request('/reservations/update_days',{parameters : 'y='+year+'&m='+month});
	},
	updateReserveTimes : function() {
		var day = $F('reservation_day')
		new Ajax.Request('/reservations/update_times',{parameters : 'd='+day});
	}
}