$(function(){
  $('body').css('display','none');
  $('body').fadeIn(900);
  
  //Manage Titles in Form (Contour Override)
  $("input[type=text]").focus(function(srcc) {
    if ($(this).val() == $(this).parent().parent().find('label').html())
    {
      $(this).val("");
    }
  });
  
  $("input[type=text]").blur(function() {
    if ($(this).val() == "")
    {
      $(this).val($(this).parent().parent().find('label').html());
    }
  });
  
  $("input[type=text]").blur();   
  
  //Contour Ajax Override
  var options = {
  clearForm: true,
    beforeSubmit: function() {
      if($('div.phoneoptional label').html() == $('div.phoneoptional input').val()) {
        $('div.phoneoptional input').val() == "";
      }
      if($('div.firstandlastname label').html() == $('div.firstandlastname input').val()) {
        $('div.firstandlastname input').addClass('contourError').val() == "";
    
    return false;
      }    
    },
    success: function() {
    $("#pnlThanks").dialog({modal: true, resizable: false, height: 132, width: 425, closeText: 'OK'});
    $("input[type=text]").blur();
    return true;
    }
  };
  
  $("#theW").ajaxForm(options);  
})
