$(document).ready(function () {
  $('.store_locator').hide();
  $('.secondary_menu .third a, .allegra_d_product_landing_buy_btn, .extras .find_a_store, .family_landing_find_store_btn a, .allegra_d_24_hour_content .spanish_button_one a, .allegra_d_12_hour_content .spanish_button_one a, .other-links ul li:eq(1) a, .result .other-links ul li.findstore a, .allegrad_24_hour .buy-btn, .allegrad_12_hour .buy-btn, #choice-results-d-12hour .buy-btn, #choice-results-d-24hour .buy-btn').click(function () {
    $('.store_locator').modal();
      $('.store_locator_title a').click(function () {
        $.modal.close();
        return false;
      });
    return false;
  });

  $('.store_locator_dropdown .other_retailers').hide();
  $('.store_locator_dropdown .placeholder').click(function() {
    $('.store_locator_dropdown .other_retailers').show();
    $('.store_locator_dropdown').blur(function() {
      $('.store_locator_dropdown .other_retailers').hide();
    });
    return false;
  });
  // Albertsons link
  // $('.store_locator_dropdown .albertson').mousedown(function () {
   // window.location.href = "http://locator.albertsons.com/StoreLocatorAction.do?action=showStoreSearch";
  // });
  
  // Duane Reade link
  // if ($('.store_locator_dropdown .duane_reade:selected')) {
    // window.location = "http://www.hopstop.com/dr?num=4";
  // }
  
  // Albertsons link
  // $('.store_locator_dropdown .albertson').click(function () {
    // document.getElementById("store_locater_form").submit();
  // });
  
  // Duane Reade link
  $('.store_locator_dropdown .duane_reade').click(function () {
    _gaq.push(['_trackEvent', 'Store Locator', 'Clicked', 'Duane Reade']);
    document.getElementById("store_locater_form").submit();
  });

  // Food Lion link
  $('.store_locator_dropdown .food_lion').click(function () {
    _gaq.push(['_trackEvent', 'Store Locator', 'Clicked', 'Food Lion']);
    document.getElementById("store_locater_form").submit();
  });
  
  // Heb link
  $('.store_locator_dropdown .heb').click(function () {
    _gaq.push(['_trackEvent', 'Store Locator', 'Clicked', 'HEB']);
    document.getElementById("store_locater_form").submit();
  });

  // Jewel Osco
  $('.store_locator_dropdown .jewel_osco').click(function () {
    _gaq.push(['_trackEvent', 'Store Locator', 'Clicked', 'Jewel Osco']);
    document.getElementById("store_locater_form").submit();
  });

  // Meijer
  $('.store_locator_dropdown .meijer').click(function () {
    _gaq.push(['_trackEvent', 'Store Locator', 'Clicked', 'Meijer']);
    document.getElementById("store_locater_form").submit();
  });

  // Stop and Shop
  $('.store_locator_dropdown .stop_and_shop').click(function () {
    _gaq.push(['_trackEvent', 'Store Locator', 'Clicked', 'Stop and Shop']);
    document.getElementById("store_locater_form").submit();
  });

  // Target
  $('.store_locator_dropdown .target').click(function () {
    _gaq.push(['_trackEvent', 'Store Locator', 'Clicked', 'Target']);
    document.getElementById("store_locater_form").submit();
  });

  // Winn Dixie
  $('.store_locator_dropdown .winn_dixie').click(function () {
    _gaq.push(['_trackEvent', 'Store Locator', 'Clicked', 'Winn Dixie']);
    document.getElementById("store_locater_form").submit();
  });

// Winn Dixie
  $('.store_locator_dropdown .Shop_Rite').click(function () {
    _gaq.push(['_trackEvent', 'Store Locator', 'Clicked', 'Shop Rite']);
    document.getElementById("store_locater_form").submit();
  });
});

/*function SelectOption() {
	document.getElementById("store_locater_form").submit();
}*/

