$(document).ready(function() {
  $('ul.order a[href=#submit]').click(function() {
    var item = $(this).parents('li');
    $('form', item).submit();
    return false;
  });

  $('.wein_des_tages').each(function() {
    var wein_des_tages = this;
    $('.aktion', wein_des_tages).click(function() {
      $(document.wein_des_tages).submit();
    });
  });

  $(document.top_search).each(function () {
    var form = this;
    $('input[type=text]', form).each(function() {
      var self = this;
      var name = $(this).attr('name');
      var default_value = $('input[name='+name+'_default]', form).val();
      if ('' != default_value) {
        $(this).focus(function() {
          if (default_value == $(this).val()) $(this).val('');
        }).blur(function() {
          if ('' == $(this).val()) $(this).val(default_value);
        })
        $(form).submit(function() {
          var value = $(self).val();
          return ('' != value && default_value != value)
        });
      }
    });
  });
});
