
var Locale = {
    validation_field_required_text: 'This field is required.',
    validation_not_valid: '&quot; does not appear to be valid.',
    validation_email_address: 'Email address &quot;',
    bounce_message: 'Please note that we are unable to send emails to you. Please verify that your inbox is not full and that your email address is correct.<br/>To continue to receive email from Gilt Groupe, please ',
    click_here: 'click here',
    please_wait: "Please wait",
    please_wait_loading: 'Please wait. Loading...',
    please_wait_loading_spin: '<div id="MB_loading">Please wait. Loading...</div>',
    close_window: 'Close window',
    your_cart: 'Your Cart',
    your_wait_list: 'Your Wait List',
    please_select: function(msg) { return 'Please select ' + msg; },
    select_color: 'Select Color:',
    color: 'Color',
    size: 'Size',
    Sizing: "Sizing",
    conjunct: ' and ',
    minutes: ' minutes',
    blackbird_form_error: 'There was an error processing your registration. Please verify the information on the form.',
    is_out_of_stock: function (label) { return label + ' is out of stock.'; },
    add_to_cart_now_sold_out: 'Sorry, this item is now Sold Out.',
    is_not_available: 'This item is not available because it&rsquo;s in another member&rsquo;s cart. The item may become available if the member decides not to purchase it.',
    wait_list_unavailable: 'We\'re sorry, the wait list is currently unavailable.',
    wait_list_success: function(product) { return product + ' has been added to your Wait List'; },
    max_cart_size: function(max) { return 'You can only add ' + max + ' items to your cart at a time'; },
    loading: 'Loading...',
    n_units: function(n, sku_label) { return 'We only had ' + n + ' of the ' + sku_label + ' in stock.  Your cart has been adjusted to reflect our remaining inventory.'; },
    others_may_purchase_this_item: '<span class="label expired">This item is no longer reserved.</span>',
    others_may_purchase_these_items: '<br/>These items are no longer reserved. Other members may purchase them.',
    this_item_reserved: function(seconds) { return '<span class="brand' + (120 > seconds ? ' expiring' : '') + '"><span class="countdown">' + fl.Util.secondsToMinutesSeconds(seconds) + '</span> minutes.</label>'; },
    these_items_reserved: function(seconds) { return '<br/>These items are reserved for the next <span class="countdown">' + fl.Util.secondsToMinutesSeconds(seconds) + '</span> minutes.'; },
    currency_symbol: '$',
    currency_group_delimiter: ',',
    currency_decimal_point: '.',
    shipping_address_street_length_message: function(length) { return 'We limit the length of each address line to ' + length + ' characters to ensure the entire address prints on the shipping label.'; },
    textarea_length_message: function(length) { return 'You can enter at most ' + length + ' characters in this field.'; },
    validation_postal_code: 'US postal code must contain exactly 5 digits (e.g. 10011) or 9 digits (e.g. 10011-4318)',
    all: "All",
    you_are_leaving_gilt_title: "Before you leave Gilt",
    you_are_leaving_fuse_title: "Before you leave Gilt Fuse",
    you_are_leaving_gilt_for_fuse_message: function(msg, checkoutLink, checkoutEvent, proceedLink) {
      var numItems = gg.Cart.current.quantity || gg.Cart.current.reservations.length;
      var checkoutEventOnclick = '';
      if (checkoutEvent && checkoutEvent != "") {
        checkoutEventOnclick = "onclick='" + checkoutEvent + "' "
      }
      return "<h2>You have " + numItems + " item" + (numItems > 1 ? "s" : "") + " in your Gilt Cart " + msg + "</h2>" +
             "<p>For now, Gilt and Gilt Fuse maintain <strong>separate carts</strong>. To avoid losing your items, we recommend you <a href='" + checkoutLink + "'>check out now.</a></p>" +
             "<p>Remember, we offer free shipping on any additional orders placed on Gilt and Gilt Fuse within one hour.</p>" +
             "<div class='actions'><a href='" + checkoutLink + "' class='checkoutnow' " + checkoutEventOnclick +
              ">Check Out Now</a><a href='" + proceedLink + "' class='proceed'>Proceed</a></div><br style='clear:both' />";
    },
    you_are_leaving_fuse_for_gilt_message: function(msg, checkoutLink, checkoutEvent, proceedLink) {
      var numItems = gg.Cart.current.quantity || gg.Cart.current.reservations.length;
      var checkoutEventOnclick = '';
      if (checkoutEvent && checkoutEvent != "") {
        checkoutEventOnclick = "onclick='" + checkoutEvent + "' "
      }
      return "<h2>You have " + numItems + " item" + (numItems > 1 ? "s" : "") + " in your Fuse Cart " + msg + "</h2>" +
             "<p>For now, Gilt Fuse and Gilt maintain <strong>separate carts</strong>. To avoid losing your items, we recommend you <a href='" + checkoutLink + "'>check out now.</a></p>" +
             "<p>Remember, we offer free shipping on any additional orders placed on Gilt Fuse and Gilt within one hour.</p>" +
             "<div class='actions'><a href='" + checkoutLink + "' class='checkoutnow' " + checkoutEventOnclick +
             ">Check Out Now</a><a href='" + proceedLink + "' class='proceed'>Proceed</a></div><br style='clear:both' />";
    },
    you_are_leaving_subsite_expirationcase: function(seconds) { return 'reserved for the next <span class="highlight"><span class="countdown">' + fl.Util.secondsToMinutesSeconds(seconds) + '</span> minutes</span>'; },
    shipping_exemption_dialog_title: "Products Cannot be Shipped to this Address",
    gift_card: "Gilt e-Gift Card",
    please_select_a_credit_card: "Please select a credit card",
    field_does_not_match_address_provided: function(field, value) { return field + " does not match address provided (" + value + " suggested)"; },
    address_verification_provider_error: function(code, other) { 
      switch(code) {
        case 'M': return "Could not identify your exact address as there were multiple potential matching addresses";
        case 'N': return "Could not confirm that the street name you entered exists in the zip code entered";
        case 'R': return "The house number you entered appears to be out of range for the street you entered";
        case 'U': return "Could not confirm the name of your street. Please double check that the city, state, zip code and house number are correct.";
        case 'X': return "The address you entered is listed as non deliverable";
        case 'Z': return "The zip code you entered does not match the city and state";
        default:  return "Address verification error: " + other;
      }
    }
};

$(function() {
    try {
        $.extend($.validator.messages, {
            email: function(_, el) { return "Email address does not appear to be valid."; }
        });
    } catch(_) {
        setTimeout(arguments.callee, 100);
    }
    var gg;
    if (gg) {
      gg.newProductFilter.filterTypes.category.displayPrefix = ["Category", "Categories"];
      gg.newProductFilter.filterTypes.size.displayPrefix = ["Size", "Sizes"];
    }
});
