$(document).ready(function () {
  $('#FM').click(function () {
    $('#typeOfDeal').show();
  });
  
  $('#Actor').click(function () {
    $('#typeOfDeal').hide();
  });
  
  $('#Athlete').click(function () {
    $('#typeOfDeal').hide();
  });
  
  $('#RL').click(function () {
    $('#typeOfDeal').hide();
  });
  
  $('#Celeb').click(function () {
    $('#typeOfDeal').hide();
  });
  
  $('#formCelebSignUp').submit(function () {
    var errors = false;
    var strForm = $('#formCelebSignUp').serialize();
    var celebName = $('#celeb_Name').val();
    var celebAgent = $('#celeb_Agent').val();
    var celebType = $('#celebType').val();
    var celebEmail = $('#celeb_Email').val();
    var celeb_PhArea = $('#celeb_PhArea').val();
    var celeb_Ph1 = $('#celeb_Ph1').val();
    var celeb_Ph2 = $('#celeb_Ph2').val();
    if (isEmpty(celebName)) {
      $('#celeb_CelebNameTxt').css({'color' : '#FF0000'});
      errors = true;
    }
    else if (isEmpty(celebAgent)) {
      $('#celeb_AgentTxt').css({'color' : '#FF0000'});
      errors = true;
    }
    else if (isEmpty(celebType)) {
      $('#celeb_TypeTxt').css({'color' : '#FF0000'});
      errors = true;
    }
    else if (isEmpty(celebEmail) || !isEmail(celebEmail)) {
      $('#celeb_EmailTxt').css({'color' : '#FF0000'});
      errors = true;
    }
    else if (isEmpty(celeb_PhArea) || isEmpty(celeb_Ph1) || isEmpty(celeb_Ph2) || isNaN(celeb_PhArea) || isNaN(celeb_Ph1) || isNaN(celeb_Ph2)) {
      $('#celeb_PhoneTxt').css({'color' : '#FF0000'});
      errors = true;
    }
    
    if (!errors) {
      $.ajax({
        type: 'POST',
        data: strForm, 
        url: 'ajax/ajax.celebRegister.php', 
        success: function (html) {
          $('#celebSignUpMessage').show();
          if (html == 1) {
            $('#celebSignUpMessage').html('We have you on record already. <br /><br />Please contact exclusive@newartist.com for any further questions or concerns.');
          }
          else {
            $('#formCelebSignUp').hide();
            $('#celebSignUpMessage').html('Thank you for your interest in NewArtist.com. One of our representative\'s will be in contact with you shortly to verify the account.');
          }
        }
      });
    }
    return false;
  });
});

function showDeal() {
  $('#typeOfDeal').show();
}