 $(document).ready(function(){

//loop through all text inputs, password inputs and textarea
    var inputs = $('input[type="text"], textarea, input[type="password"]');

if ($('input#name').val() == ""){
         $('label[for="'+$('input#name').attr('id')+'"]').show();
        }
    else{
      $('label[for="'+$('input#name').attr('id')+'"]').hide();   
    }

        if ($('input#email').val() == ""){
         $('label[for="'+$('input#email').attr('id')+'"]').show();
        }
    else{
      $('label[for="'+$('input#email').attr('id')+'"]').hide();   
    }

            if ($('input#phone').val() == ""){
         $('label[for="'+$('input#phone').attr('id')+'"]').show();
        }
    else{
      $('label[for="'+$('input#phone').attr('id')+'"]').hide();   
    }

            if ($('input#address').val() == ""){
         $('label[for="'+$('input#address').attr('id')+'"]').show();
        }
    else{
      $('label[for="'+$('input#address').attr('id')+'"]').hide();   
    }

            if ($('textarea#message').val() == ""){
         $('label[for="'+$('textarea#message').attr('id')+'"]').show();
        }
    else{
      $('label[for="'+$('textarea#message').attr('id')+'"]').hide();   
    }


    // remove label on focus
    inputs.focus(function(){
    $('label[for="'+$(this).attr('id')+'"]').hide();
    });

    inputs.blur(function(){
    var that = $(this);
    if (that.val() == ""){
    $('label[for="'+that.attr('id')+'"]').show();
  		}
	});
	inputs.blur();

  }
                                );
