 function popupdeletethread(myuid,uid,tid,tdiv){
     if (myuid==0)
    {
        NewshowHintAutoClose("信息提示","该操作需要登陆，请先登陆");
    }
    else
    {

        
               $("#append_parent").load("cp_thread.aspx?op=deletethread&tid="+tid+" #deletethread"+tid,{"tid":tid ,"username":"syj"},function()
	           {  
	           setPopupPosition(tdiv,"deletethread"+tid,0);
	           //setCenter("delete"+cid);
	           $(".popupmenu_centerbox").easydrag(true);
	       
        	  
	           });  
	    
	}
}

function deletethread(myuid,uid,tid)
    {
   
        var jsonData =  "{tid :'"+tid+"'}";
       
         
             $.ajax({
              type: "POST",
              url: "cp_thread.aspx/deletethread",
              data: jsonData,
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function(msg) {
                     if (msg=="nologin")     
                       { 
                              NewshowHintAutoClose("信息提示","该操作需要登陆，请先登陆");
                       }
                      else 
                      {
                            if (msg=="flase")     
                           { 
                                  NewshowHintAutoClose("信息提示","你没有权限执行此操作");
                           }
                           else
                           {
                                    NewshowHintAutoClose("信息提示","删除成功!!!!!");
                                    //window.location.reload();
            	                   location.href="space_mtag_index.aspx?tagid="+msg;
            	           }
                        
                      }
              }
            });
    
    }

 function popuppostdelete(myuid,uid,pid,pdiv,tid){
     if (myuid==0)
    {
        NewshowHintAutoClose("信息提示","该操作需要登陆，请先登陆");
    }
    else
    {
//        if (myuid!=uid)
//        {
//            NewshowHintAutoClose("信息提示","你没有权限执行此操作");
//        }
//        else
//        {
               $("#append_parent").load("cp_thread.aspx?op=deletepost&pid="+pid+"&tid="+tid+" #deletepost"+pid,{"pdiv":pdiv ,"username":"syj"},function()
	           {  
	           setPopupPosition(pdiv,"deletepost"+pid,0);
	           //setCenter("delete"+cid);
	           $(".popupmenu_centerbox").easydrag(false);
        	  
	           });  
//	    }
	}
}


function deletepost(myuid,uid,pid,tid)
    {
   
        var jsonData =  "{pid :'"+pid+"',tid:'"+tid+"'}";
       
         
             $.ajax({
              type: "POST",
              url: "cp_thread.aspx/deletepost",
              data: jsonData,
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function(msg) {
                     if (msg=="nologin")     
                       { 
                              NewshowHintAutoClose("信息提示","该操作需要登陆，请先登陆");
                       }
                      else 
                      {
                            if (msg =="false")     
                           { 
                                  NewshowHintAutoClose("信息提示","你没有权限执行此操作");
                           }
                           else
                           {
                                    NewshowHintAutoClose("信息提示","删除成功!!!!!");
                                    window.location.reload();
            	                  // location.href="space_mtag_index.aspx?tagid="+msg;
            	           }
                        
                      }
              }
            });
    
    }
    
  function popupoptype(myuid,uid,tid,optype,tdiv){
     if (myuid==0)
    {
        NewshowHintAutoClose("信息提示","该操作需要登陆，请先登陆");
    }
    else
    {
//        if (myuid!=uid)
//        {
//            NewshowHintAutoClose("信息提示","你没有权限执行此操作");
//        }
//        else
//        {
               $("#append_parent").load("cp_thread.aspx?op=optype&optype="+optype+"&tid="+tid+" #optype"+tid,{"tid":tid ,"username":"syj"},function()
	           {  
	           setPopupPosition(tdiv,"optype"+tid,0);
	           //setCenter("delete"+cid);
	           $(".popupmenu_centerbox").easydrag(false);
	           $(".popupmenu_centerbox").setHandler("drag_title");
        	  
	           });  
//	    }
	}
}   
    
function optype(myuid,uid,tid,optype)
    {
   
        var jsonData =  "{optype :'"+optype+"', tid :'"+tid+"'}";
       
         
             $.ajax({
              type: "POST",
              url: "cp_thread.aspx/optypef",
              data: jsonData,
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function(msg) {
                     if (msg=="nologin")     
                       { 
                              NewshowHintAutoClose("信息提示","该操作需要登陆，请先登陆");
                       }
                      else 
                      {
                            if (msg =="false")   
                           { 
                                  NewshowHintAutoClose("信息提示","你没有权限执行此操作");
                           }
                           else
                           {
                                    NewshowHintAutoClose("信息提示",msg+"操作成功!!!!!");
                                    window.location.reload();
            	                  // location.href="space_mtag_index.aspx?tagid="+msg;
            	           }
                        
                      }
              }
            });
    
    }
    
    

 function popuppostedit(myuid,uid,pid,pdiv){
     if (myuid==0)
    {
        NewshowHintAutoClose("信息提示","该操作需要登陆，请先登陆");
    }
    else
    {
        if (myuid!=uid)
        {
            NewshowHintAutoClose("信息提示","你没有权限执行此操作");
        }
        else
        {
               $("#append_parent").load("cp_thread.aspx?op=editreply&pid="+pid+" #edit"+pid,{"pid":pid ,"username":"syj"},function()
	           {  
	           //setPopupPosition(cdiv,"edit"+cid,0);
	           setCenter("edit"+pid);
	           $(".popupmenu_centerbox").easydrag(true);
	          //注意这种只要标题拖动的方式比较好。
	           $(".popupmenu_centerbox").setHandler('drag_title');
	           
	           
        	  
	           });  
	   }
	 }
}

function editpost(myuid,uid,pid)
    {
      //showHintAutoClose("你发言太快了");
      var message =  $("#editmessage").val()=="undefined" ? "": $("#editmessage").val();

        //var jsonData =  "{message :'"+message+"'}";
         var jsonData =  "{message :'"+message+"', pid :'"+pid+"'}";
         
             $.ajax({
              type: "POST",
              url: "cp_thread.aspx/editpost",
              data: jsonData,
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function(msg) {
              
       if (msg=="nologin")     
       { 
              NewshowHintAutoClose("信息提示","该操作需要登陆，请先登陆");
       }
      else 
      {
              if (msg=="nopose")     
               { 
                 NewshowHintAutoClose("信息提示","你发言太快了");
               }
               else
               {
                  NewshowHintAutoClose("信息提示","修改成功!!!!!");
                window.location.reload();
            	//location.href="space_wall.aspx?uid=<%=JJudge.uid %>"; 
                   
                }
        
      }
              
              }
            });
    

    
    }
    
   
   
   
   
    
    
    
    
    
    
    
    
    

function popupjoin(myuid,id,cdiv)
    {
    if (myuid==0)
    {
        NewshowHintAutoClose("信息提示","该操作需要登陆，请先登陆");
    }
    else 
    {
     $("#append_parent").load("cp_mtag.aspx?op=join&tagid="+id+" #join"+id,{"uid":"888" ,"username":"syj"},function()
        {  
        setPopupPosition(cdiv,"join"+id,0);
       // setCenter("join"+id);
        $(".popupmenu_centerbox").easydrag(true);
       
        });  
    }
    
}
function joinmtag(tagid)
    {
   
 
         var jsonData =  "{tagid :'"+tagid+"'}";
         
             $.ajax({
              type: "POST",
              url: "cp_mtag.aspx/savejoinmtag",
              data: jsonData,
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function(msg) {
              
       if (msg=="nologin")     
       { 
              NewshowHintAutoClose("信息提示","该操作需要登陆，请先登陆");
       }
      else  if (msg=="false")  
      {

            NewshowHintAutoClose("信息提示","你已经加入该群了！");
      }
      else
      {
              NewshowHintAutoClose("信息提示","恭喜！加入群组成功");
              window.location.reload();
      
      }
              
              }
            });
    
 }
   

function popupignore(myuid,id,cdiv)
    {
    if (myuid==0)
    {
        NewshowHintAutoClose("信息提示","该操作需要登陆，请先登陆");
    }
    else 
    {
     $("#append_parent").load("cp_mtag.aspx?op=out&tagid="+id+" #ignore"+id,{"uid":"888" ,"username":"syj"},function()
        {  
        setPopupPosition(cdiv,"ignore"+id,0);
       // setCenter("join"+id);
        $(".popupmenu_centerbox").easydrag(true);
       
        });  
    }
    
}

function ignoremtag(tagid)
    {
   
 
         var jsonData =  "{tagid :'"+tagid+"'}";
         
             $.ajax({
              type: "POST",
              url: "cp_mtag.aspx/saveignoremtag",
              data: jsonData,
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function(msg) {
              
       if (msg=="nologin")     
       { 
              NewshowHintAutoClose("信息提示","该操作需要登陆，请先登陆");
       }
      else 
      {

              NewshowHintAutoClose("信息提示","退出群组成功");
        window.location.reload();
      }
              
              }
            });
    
 }
   

    
function addpost(uid)
    {
   
      var message =  $("#message").val()=="undefined" ? "": $("#message").val();
      var tid =  $("#tid").val()=="undefined" ? "": $("#tid").val();  
 
         var jsonData =  "{message :'"+message+"', tid :'"+tid+"', uid :'"+uid+"'}";
         
             $.ajax({
              type: "POST",
              url: "space_thread_view.aspx/savepost",
              data: jsonData,
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function(msg) {
              
       if (msg=="nologin")     
       { 
              NewshowHintAutoClose("信息提示","该操作需要登陆，请先登陆");
       }
      else 
      {
              var post_ul =  $("#post_ul");
              $(msg).appendTo(post_ul);
              NewshowHintAutoClose("信息提示","保存成功!!!!!");
        
      }
              
              }
            });
    
 }
   

    
 function popuppostreply(myuid,uid,pid,pdiv,pagecount){
     if (myuid==0)
    {
        NewshowHintAutoClose("信息提示","该操作需要登陆，请先登陆");
    }
    else
    {

               $("#append_parent").load("cp_thread.aspx?op=reply&pid="+pid+" #reply"+pid,{"pid":pid ,"pagecount":pagecount},function()
	           {  
	           setCenter("reply"+pid);
	           $(".popupmenu_centerbox").easydrag(false);
	            $(".popupmenu_centerbox").setHandler("drag_title");
        	  
	           });  
	
	}
	
	}


function replysave(myuid,uid,pid)
    {
   
      var message =  $("#replymessage").val()=="undefined" ? "": $("#replymessage").val();
 
         var jsonData =  "{message :'"+message+"', pid :'"+pid+"', uid :'"+uid+"'}";
         
             $.ajax({
              type: "POST",
              url: "cp_thread.aspx/replysave",
              data: jsonData,
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function(msg) {
              
       if (msg=="nologin")     
       { 
              NewshowHintAutoClose("信息提示","该操作需要登陆，请先登陆");
       }
      else 
      {
              var post_ul =  $("#post_ul");
              $(msg).appendTo(post_ul);
              NewshowHintAutoClose("信息提示","保存成功!!!!!");
        
      }
              
              }
            });
    
 }


//function EditComment(cid)
//    {
//      //showHintAutoClose("你发言太快了");
//      var message =  $("#message_"+cid).val()=="undefined" ? "": $("#message_"+cid).val();
//      var ocid =  cid;
//        //var jsonData =  "{message :'"+message+"'}";
//         var jsonData =  "{message :'"+message+"', ocid :'"+ocid+"'}";
//         
//             $.ajax({
//              type: "POST",
//              url: "cp_comment.aspx/Editcomment",
//              data: jsonData,
//              contentType: "application/json; charset=utf-8",
//              dataType: "json",
//              success: function(msg) {
//              
//       if (msg=="nologin")     
//       { 
//              NewshowHintAutoClose("信息提示","该操作需要登陆，请先登陆");
//       }
//      else 
//      {
//              if (msg=="nopose")     
//               { 
//                 NewshowHintAutoClose("信息提示","你发言太快了");
//               }
//               else
//               {
//                  NewshowHintAutoClose("信息提示","修改成功!!!!!");
//                window.location.reload();
//            	//location.href="space_wall.aspx?uid=<%=JJudge.uid %>"; 
//                   
//                }
//        
//      }
//              
//              }
//            });
//    

//    
//    }
//    
//   
//   
//   



//function ReplyComment(cid)
//    {
//      //showHintAutoClose("你发言太快了");
//      var message =  $("#message_pop_"+cid).val()=="undefined" ? "": $("#message_pop_"+cid).val();
//      var ocid =  cid;
//        //var jsonData =  "{message :'"+message+"'}";
//         var jsonData =  "{message :'"+message+"', ocid :'"+ocid+"'}";
//         
//             $.ajax({
//              type: "POST",
//              url: "cp_comment.aspx/ReplyComment",
//              data: jsonData,
//              contentType: "application/json; charset=utf-8",
//              dataType: "json",
//              success: function(msg) {
//              
//       if (msg=="nologin")     
//       { 
//              NewshowHintAutoClose("信息提示","该操作需要登陆，请先登陆");
//       }
//      else 
//      {
//              if (msg=="nopose")     
//               { 
//                 NewshowHintAutoClose("信息提示","你发言太快了");
//               }
//               else
//               {
//                  NewshowHintAutoClose("信息提示","你已经成功给留言");
//                  window.location.reload();
//               	  //location.href="space_wall.aspx?uid=<%=JJudge.uid %>"; 
//                   
//                }
//        
//      }
//              
//              }
//            });
//    

//    
//    }
//    
//    
// function DeleteComment(cid)
//    {
//    
//      var ocid =  cid;
//        var jsonData =  "{ocid :'"+ocid+"'}";
//       
//         
//             $.ajax({
//              type: "POST",
//              url: "cp_comment.aspx/DeleteComment",
//              data: jsonData,
//              contentType: "application/json; charset=utf-8",
//              dataType: "json",
//              success: function(msg) {
//                     if (msg=="nologin")     
//                       { 
//                              NewshowHintAutoClose("信息提示","该操作需要登陆，请先登陆");
//                       }
//                      else 
//                      {
//                                NewshowHintAutoClose("信息提示","删除成功!!!!!");
//                                window.location.reload();
//            	               // location.href="space_wall.aspx?uid=<%=JJudge.uid %>";
//                        
//                      }
//              }
//            });
//    
//    }
//    
//    