function postAjaxvalue(formobj, postto, updateto, busydiv) {
    var formData = $(formobj).serialize();
    $(busydiv).toggle();
    $.ajax({
        type: 'POST',
        url: postto,
        data: formData,
        dataType: 'html',
        success: function(data){
            $(busydiv).toggle();
            $(updateto).val(data);
        }
    });
}

function postAjaxdiv(formobj, postto, updateto, busydiv) {
    var formData = $(formobj).serialize();
    $(busydiv).toggle();
    $.ajax({
        type: 'POST',
        url: postto,
        data: formData,
        dataType: 'html',
        success: function(data){
            $(busydiv).toggle();
            $(updateto).html(data);
        }
    });
}

function getAjaxdiv(postto, updateto, busydiv) {
    $(busydiv).toggle();
    $.ajax({
        type: 'GET',
        url: postto,
        dataType: 'html',
        success: function(data){
            $(busydiv).toggle();
            $(updateto).html(data);
            $(updateto).show();
        }
    });
}

function getAjax(postto, busydiv) {
    $(busydiv).toggle();
    $.ajax({
        type: 'GET',
        url: postto,
        dataType: 'html',
        success: function(data){
            $(busydiv).toggle();
        }
    });
}

function HideTweet(tan,un,tn,i) {
    var postto = '/users/hidetweet/?u='+un+'&t='+tn;
    $.ajax({
        type: 'GET',
        url: postto,
        dataType: 'html',
        success: function(data){
            document.getElementById(tan).deleteRow(i);
        }
    });

}

function manageMenu(action,item) {
    if (action == 'h'){
        getAjax('/users/setmenu?action=hide&section='+item, '#updimg')
        $('#mbhide'+item).show('fast');
        $('#mbshow'+item).hide('fast');
    } else {
        getAjax('/users/setmenu?action=show&section='+item, '#updimg')
        $('#mbshow'+item).show('fast');
        $('#mbhide'+item).hide('fast');
    }
}
