var text_comment_const = "Left comment...";
var new_comment_id = "#new_comment";
function new_comment_focus(){
    if( $(new_comment_id).val() == text_comment_const ) {
        $(new_comment_id).val("");
        $('#comment_button').fadeIn();
    }
}
function new_comment_blur() {
    if( $(new_comment_id).val() == "" ) {
        $(new_comment_id).val( text_comment_const );
        $('#comment_button').fadeOut();
    } else {

    }
}
function add_trainer_tip_comment( tip_id, page ) {
    var comment = $(new_comment_id).val();
    var params = { "comment" : comment, "tip_id" : tip_id };
    $.post( base_url + 'add_trainer_tip_comment', params, function( data ) {
        if( data == "0" ) {
            window.location.href = base_url + 'user_login';
        } else {
            if( data != '-1' ) {
                showTrainerTipsComments( tip_id, page );
            }
        }
    });
}
function deleteTrainerCommentTip( comment_id, page, tip_id )
{
    if( confirm("Delete comment ?") ) {
        $('#about_me').html("<img src='" + base_url + "images/loading.gif'>");
        $.post(base_url+'delete_trainer_tip_comment',{"comment_id":comment_id},function(){
            showTrainerTipsComments( tip_id, page );
        });
    }
}
