function validateForm() {
  var error = $('#form_error'),
      throwError = 0;

  error.text('');

  if(window.location.pathname === '/tcpreview') {
    var email = document.forms["mc-embedded-subscribe-form"]["EMAIL"].value,
        year = parseInt(document.forms["mc-embedded-subscribe-form"]["MMERGE3[year]"].value),
        month = parseInt(document.forms["mc-embedded-subscribe-form"]["MMERGE2[month]"].value),
        day = parseInt(document.forms["mc-embedded-subscribe-form"]["MMERGE2[day]"].value),
        tos = document.forms["mc-embedded-subscribe-form"]["group[6377][1]"].checked;
  } else {
    var email = document.forms["mc-embedded-subscribe-form"]["EMAIL"].value,
      year = parseInt(document.forms["mc-embedded-subscribe-form"]["MMERGE1[year]"].value),
      month = parseInt(document.forms["mc-embedded-subscribe-form"]["MMERGE1[month]"].value),
      day = parseInt(document.forms["mc-embedded-subscribe-form"]["MMERGE1[day]"].value),
      tos = document.forms["mc-embedded-subscribe-form"]["tos"].checked;
  }
  var minAge = 13,
      todayObject = new Date(),
      birthday = Date.parse( year, month, day ),
      today = Date.parse( todayObject );

  if ( (today - birthday) < (minAge * 365 * 24 * 60 * 60 * 1000) ){
      throwError = 1;
      error.text('You need to be 13 years of age or older to sign up');
  }

  if ( !email ) {
      throwError = 1;
      error.text('Please enter an Email Address');
  }

  if ( !tos ){
      throwError = 1;
      error.text('You must agree to the Terms of Use');
  }

  if ( throwError ) {
      error.show();
      return false;
  }else{
      error.hide();
      return true;
  }
}

$(window).load(function() {
  if(window.location.pathname === '/') {
    var targetDate = new Date();
    targetDate = new Date(2012,1,12,20);

    $('#theTimer').countdown({
      until: targetDate,
      layout:'<span class="days">{dn}</span><span class="hours">{hn}</span><span class="minutes">{mn}</span><span class="seconds">{sn}</span>'
    });
  }
});
