(function() {
  var __indexOf = Array.prototype.indexOf || function(item) {
    for (var i = 0, l = this.length; i < l; i++) {
      if (this[i] === item) return i;
    }
    return -1;
  };
  $(function() {
    return $('input[type=radio]').bind('change', function(event, firsttime) {
      return $("input[name=" + this.name + "]").each(function(index, radio) {
        var ext;
        if (radio.checked) {
          return;
        }
        ext = $("#" + (radio.name.replace(/[\.#]/g, '_')) + "_" + radio.value);
        return (firsttime ? ext.hide : ext.slideUp).apply(ext);
      }).each(function(index, radio) {
        var ext;
        if (!radio.checked) {
          return;
        }
        ext = $("#" + (radio.name.replace(/[\.#]/g, '_')) + "_" + radio.value);
        return ext.slideDown();
      });
    }).trigger('change', true);
  });
  $.support.placeholder = (__indexOf.call(document.createElement('input'), 'placeholder') >= 0);
  $(function() {
    var active;
    if ($.support.placeholder) {
      return;
    }
    active = document.activeElement;
    $(':text:not(.datepicker)').bind('focus.placeholder', function() {
      var el;
      el = $(this);
      if (el.attr('placeholder') && el.val() === el.attr('placeholder')) {
        return el.val('').removeClass('placeholder');
      }
    }).bind('blur.placeholder', function() {
      var el;
      el = $(this);
      if (el.attr('placeholder') && (el.val() === '' || el.val() === el.attr('placeholder'))) {
        return el.addClass('placeholder').val(el.attr('placeholder'));
      }
    }).trigger('blur.placeholder');
    $('form').bind('submit', function() {
      return $(':text.placeholder').each(function() {
        return $(this).val('');
      });
    });
    return active.focus();
  });
}).call(this);

