      $(document).ready(function(){



         var checkprofile_value = 'Введите имя или ID пользователя';

         if($("#url").val() == ""){
             $("#url").val(checkprofile_value);
         }

         $("#url").click(function () {
            if($("#url").val() == checkprofile_value)
                $("#url").val('');
         });

         $("#url").blur(function () {
            //alert('check');
            if($("#url").val() == ""){
                $("#url").val(checkprofile_value);
            }
         });
         
         
         //////////////
         
         var download_value = 'Введите название или адрес страницы';
         
         if($("#download_query").val() == ""){
             $("#download_query").val(download_value);
         }

         $("#download_query").click(function () {
            if($("#download_query").val() == download_value)
                $("#download_query").val('');
         });

         $("#download_query").blur(function () {
            //alert('check');
            if($("#download_query").val() == ""){
                $("#download_query").val(download_value);
            }
         });         



        //feedback
        var textarea_value = 'Как нам стать лучше...';

         $("#msg_textarea").click(function () {
            if($("#msg_textarea").val() == textarea_value)
                $("#msg_textarea").val('');
         });

         $("#msg_textarea").blur(function () {
            //alert('check');
            if($("#msg_textarea").val() == ""){
                $("#msg_textarea").val(textarea_value);
            }
         });

        $('#msg_submit').click(function(){
            if($('#msg_textarea').val() == '' || $('#msg_textarea').val() == textarea_value){
                alert('Введите сообщение!');
                return;
             }

            var post_data = "nezayti="+encodeURIComponent($('#msg_textarea').val());
            $('#msg_submit').hide();
            
            $('#loader').show();

            $.ajax({
                type: 'POST',
                data: post_data,
                url: '/message.php',
                success: function(data) {
                        $('#loader').hide();
                        
 
                        if(data == 'ok'){
                            $("#msg_textarea").fadeOut(600, function(){$('#msg_success').fadeIn(600, "linear");});
                        }else{
                            $('#msg_submit').show();
                            $('#msg_textarea').show();
                            alert(data);
                        }
                        //
                      }
            });
        });
   

     });


