var TextLove = {
  _q_num: 1,
  _q_total: 3,

  init: function() {
    if (typeof sc_sentinel == 'function') {
      if (!sc_sentinel({cookie_name:'TextLove_completed'})) {
        return false;
      }
    }
    else if (Get_Cookie('TextLove_completed') == 'true') {
      $(Owlery).trigger('repopulate');
      return false;
    }

    $('#inputzone').hide();
    $('#select_gender').show();
    $('#container').removeClass('imagestep1').addClass('imagestep0');
    $('#select_gender #gender_answer a').click(function(e) {e.preventDefault(); TextLove.startQuestion();});
    $('#question_zone #answers a').click(function(e) {e.preventDefault(); TextLove.next();});
    return true;
  },

  startQuestion: function() {
    $('#select_gender').hide();
    $('#question_zone').fadeIn('slow');
  },

  next: function() {
    this._q_num++;
    if (this._q_num > this._q_total) {
      this.end();
    }
    else {
      $('#question_zone').hide().fadeIn('slow');
      $('#question_zone').attr('class', 'q'+this._q_num);
    }
  },

  end: function() {
    $('#question_zone').hide();

    $('#container').removeClass('imagestep0').addClass('imagestep1');
    Set_Cookie('TextLove_completed', 'true');
    $('#inputzone').fadeIn('slow');
    $(Owlery).trigger('showMin');
  }
};

landingControlHolder['precontroller'] = TextLove;

