function checkForLength(input, lengthShort, lengthNormal)
{
  if (lengthShort == undefined) lengthShort = 0;
  if (lengthNormal == undefined) lengthNormal = 0;

	if ($(input).val().length > lengthShort)
  {
		$(input).parent().addClass("kindagood");
	}
	else
  {
		$(input).parent().removeClass("kindagood");
	}
  
	if ($(input).val().length > lengthNormal)
  {
		$(input).parent().addClass("welldone");
	}
	else
  {
		$(input).parent().removeClass("welldone");
	}
}

function validateLine(input)
{
  $(input).parent().parent().children("td:first").addClass("welldone");
}

function validateLineChk(input)
{
  $(input).parents("div:first").addClass("welldone");
}

$(function()
  {
    $("#close").click(function()
      {
        $(".excerpt").slideUp();
      }
    );
    
    $("input").focus(function()
      {
        $(this).siblings("span").show();
      }
    ).blur(function()
      {
        $(this).siblings("span").hide();
      }
    );
    
    $("textarea").focus(function()
      {
        $(this).siblings("span").show();
      }
    ).blur(function()
      {
        $(this).siblings("span").hide();
      }
    );
    
    $("input:radio").click(function()
      {
        validateLine($(this));
      }
    );
    
    $("input:checkbox").click(function()
      {
        validateLineChk($(this));
      }
    );
    
    
    $('form').submit(function()
      {
        $.post($(this).attr('action'), $(this).serialize());
        tb_show('Confirmation', 'thanks.html?height=140&width=300', null);
        return false;
      }
    );
  }
);