function send_news(){
    
    var ID = $(this).attr("id");
    //console.info("#edit_place_" + ID);

    function showResponse(data){

        $("#edit_place_" + ID).fadeOut();
        var origi_title = $("#title_" + ID).val();
        $("#text_title_" + ID).text(origi_title);

        $('textarea').autoResize({
            // On resize:
            onResize : function() {
                $(this).css({opacity:0.8});
            },
            // After resize:
            animateCallback : function() {
                $(this).css({opacity:1});
            },
            // Quite slow animation:
            animateDuration : 3000,
            // More extra space:
            extraSpace : 0
        });
        
    };

    var options = {
        success: showResponse,
        url: 'edit_article_post.php?id=' + ID,
        type: 'post',
        dataType: 'json'
    };
    $("#form_" + ID).ajaxSubmit(options);
}

function send_refs(){

    var ID = $(this).attr("id");
    //console.info("#edit_place_" + ID);

    function showResponse(data){

        $("#edit_place_" + ID).fadeOut();
        var origi_fname = $("#fname_" + ID).val();
        var origi_sname = $("#sname_" + ID).val();
        $("#text_title_" + ID).text(origi_fname+' '+origi_sname );

    };

    var options = {
        success: showResponse,
        url: 'edit_article_post.php?id=' + ID,
        type: 'post',
        dataType: 'json'
    };
    $("#form_" + ID).ajaxSubmit(options);
}

function send_grounds(){

    var ID = $(this).attr("id");
    //console.info("#edit_place_" + ID);

    function showResponse(data){

        $("#edit_place_" + ID).fadeOut();
        var origi_ground_name = $("#name_" + ID).val();
        var origi_post_code = $("#post_code_" + ID).val();
        $("#text_title_" + ID).text(origi_ground_name+' '+origi_post_code);

    };

    var options = {
        success: showResponse,
        url: 'edit_article_post.php?id=' + ID,
        type: 'post',
        dataType: 'json'
    };
    $("#form_" + ID).ajaxSubmit(options);
}


function send_fixture(){

    var ID = $(this).attr("id");
    //console.info("#edit_place_" + ID);

    function showResponse(data){

        $("#edit_place_" + ID).fadeOut();

        $.each(data, function(i, item){
            $("#tr_" + ID + " .home").html(item.home_team);
            $("#tr_" + ID + " .away").html(item.away_team);
            $("#tr_" + ID + " .ground").html(item.ground_name);
            $("#tr_" + ID + " .competition").html(item.league_name);
            if(item.gf == '' || item.ga == '') {$("#tr_" + ID + " .score").html(item.gf +' - '+ item.ga); }
        });

    };

    var options = {
        success: showResponse,
        url: 'edit_article_post.php?id=' + ID,
        type: 'post',
        dataType: 'json'
    };
    $("#form_" + ID).ajaxSubmit(options);
}


function send_edit_videos(){

    var ID = $(this).attr("id");
    //console.info("#edit_place" + ID);

    function showResponse(data){

        $("#edit_place_edit" + ID).fadeOut();

        $.each(data, function(i, item){
            $("#tr_" + ID + " .hm_player").html(item.home_team);
            $("#tr_" + ID + " .away").html(item.away_team);
            $("#tr_" + ID + " .ground").html(item.ground_name);
            $("#tr_" + ID + " .competition").html(item.league_name);
            if(item.gf == '' || item.ga == '') {$("#tr_" + ID + " .score").html(item.gf +' - '+ item.ga); }
        });

    };

    var options = {
        success: showResponse,
        url: 'edit_article_post.php?id=' + ID,
        type: 'post',
        dataType: 'json'
    };
    $("#form_edit" + ID).ajaxSubmit(options);
}

function send_edit_clubs(){

    var ID = $(this).attr("id");
   //console.info('cname_edit_' + ID);

    function showResponse(data){

        $("#edit_place_" + ID).fadeOut();
        var origi_title = $("#cname_" + ID).val();
        $("#text_title_" + ID).text(origi_title);
    };

    var options = {
        success: showResponse,
        url: 'edit_article_post.php?id=' + ID,
        type: 'post'
    };
    $("#form_" + ID).ajaxSubmit(options);
}

function send_edit_teams(){

    var ID = $(this).attr("id");
   //console.info('team_name' + ID);

    function showResponse(data){

        $("#edit_place_" + ID).fadeOut();
        var origi_title = $("#team_name_" + ID).val();
        $("#text_title_" + ID).text(origi_title);
    };

    var options = {
        success: showResponse,
        url: 'edit_article_post.php?id=' + ID,
        type: 'post'
    };
    $("#form_" + ID).ajaxSubmit(options);
}


function send_edit_polls(){

    var ID = $(this).attr("id");
   //console.info('team_name' + ID);

    function showResponse(data){

        $("#edit_place_" + ID).fadeOut();
        var origi_title = $("#team_name_" + ID).val();
        $("#text_title_" + ID).text(origi_title);
    };

    var options = {
        success: showResponse,
        url: 'edit_article_post.php?id=' + ID,
        type: 'post'
    };
    $("#form_" + ID).ajaxSubmit(options);
}
