$(document).ready(function () {
  $('.expirationSelector').change(function (e) {
    change_selector(this);
  }).each(function(){
    change_selector(this);
  });

  if (typeof($().datepicker) == 'function') {
    $('.editDate').datepicker({yearRange: '+0:+20', showOn: 'button', showOtherMonths: true, 
      showWeeks: true, firstDay: 1, changeFirstDay: true, dateFormat: 'yy-mm-dd', 
      buttonImageOnly: true, buttonImage: 'http://proofile.org/img/calendar.gif', defaultDate: '+0y'});
  }
});

function change_selector(t) {
  // alert($(this).attr('value'));
  var val = parseInt($(t).attr('value'));
  if (val == 2) {
    $(t).nextAll('span').show();
  }
  else {
    $(t).nextAll('span').hide();
  }
}