 swapValues=[];

 $(document).ready(function()
    {
        $(".txtwatermark").each(
            function(i){
            	$(this).addClass("grayed");
            	
                swapValues[i]=$(this).val();
                $(this).focus(function()
                    {
                        if($(this).val()==swapValues[i])
                        {
                            $(this).val("")
                            $(this).removeClass("grayed");
                        }
                    }
                ).blur(function()
                    {
                        if($.trim($(this).val())=="")
                            {
                                $(this).val(swapValues[i]);
                                $(this).addClass("grayed");
                            }
                     }
                 )
            }
      );

	$('form').submit(function() {

		clearDefaultValues();

	});
  }
);

function clearDefaultValues()
{
	$(".txtwatermark").each(
            function(i){
       	
                if($(this).val()==swapValues[i])
		{
			$(this).val('');
		}
	});
}
