
  


function commenSubmit(){
  //$.load("lib/Article/ajax/comment_response.php?message=blah");
  $.post("lib/Article/ajax.php", { 
      review_token:$("#token").val(),
      value:$("#aid").val(),
      message:$("#message").val(),
      where:"c_s"
    },
    function(data){
      
      var img_src = data.path + data.img + "_x30" + data.format;
      var msg_date = data.message_date;
      var message = data.message;
      
      $("#commentresponse").append("\
          <div id='new_message' class='article_comment' style='background: #f2f2f2; height: 100%; margin: 1px 0 1px 0;\
          border-bottom: 0px dotted #ccc; overflow: hidden; color: #000; $last_style\
          '>\
            <div id='message_holder_id_highlight_' style='padding: 10px 10px 10px 10px; overflow: hidden;'>\
              <div class='article_comment_col1' style='float: left;overflow: hidden; background-color: #; margin-right: 10px;'>\
                <a href='user/"+data.username+"'>\
                  <img src='"+data.image+"' style='padding: 3px; border: 0px solid #ccc; background: #fff;'>\
                </a>\
              </div>\
              <div class='article_comment_col2' style='\
              overflow: hidden; background-color: #; font: normal 10px verdana,sans-serif;\
              color: #555; line-height: 15px; font: normal normal normal 11px/18px verdana, sans-serif;'>\
                <div style='font-size: 12px;'>\
                  <a class='users' href='user/"+data.username+"'>"+data.username+"</a>\
                  <span style='color: #777; font-size: 10px;'>\
                    Just now\
                  </span>\
                </div>\
                <div style='color: #000;'>\
                  "+data.message+"\
                </div>\
              </div>\
            </div>\
          </div>\
        "
      );
      
    
        $("#commentresponse").slideDown("slow");
  
      var $submitButton = $("#comment_button"); 
      var $message = $("#message");
      $submitButton.attr("disabled", "true");
      $message.attr("disabled", "true"); 
    } 
    , "json"
  );   
}

function bumpDisabled(){
  doFaceBox(b_bumpTrack);
}

function bumpArticle(value, id_holder){
  $bumpButton = $("#bumpButton");
  $.post("lib/Article/ajax.php", { 
      value:value,
      where:"b_s"
    },
    function(data){
      if (data == "track")
      {
        doFaceBox(b_bumpTrack);
      } else {
        $bumpButton.fadeTo("normal", 0.33);
      }
    }
  );
}

function flag(value){
  
  $.post("lib/Bumpley/BumpleyBump_js.php", {
      value:value,
      where:"f_s"
    },

    function(data){
      if (data == "track"){
        doFaceBox("You've already flagged this article.");
      } else if (data == "1"){
        // done
      } else if (data == "logg"){
        doFaceBox("You must be signed in to flag this article.");
      }
    }
  );
}

/**
 *  dropSubmission
 */ 
function dropDiscussion(safe_id, key, id_holder)
{
  var $submission_holder = $("#message_holder_id_" + id_holder);
  
  //$submission_holder
  $("#message_holder_id_highlight_" + id_holder).addClass('ui-state-error ui-corner-all');
  answer = confirm('Are you sure you want to delete this discussion?');
  if (answer){  
    $.post("lib/Article/ajax.php", { 
        value:safe_id,
        value_key:key,
        where:"d_d"
      },
      function(data){
        //doFaceBox(data);
        //alert(data);
        //$submission_holder.slideUp();
      
        //$submission_holder.hide("blind");
        $submission_holder.slideUp("slow");
      
        //$submission_holder.hide("slide", {direction: "left"});
      } 
      //, "json"
    );   
  } else {
    $("#message_holder_id_highlight_" + id_holder).removeClass('ui-state-error ui-corner-all');
  }
}

