


function nmsg_send(){    
    
    var msg     = document.getElementById('write_text').value;
    var ownerid  = document.getElementById('ownerid').value;
    
    if( msg == ''){
     
        alert("Nem írtál semmit!");
        
    }else{
    
    $.get("jquery/jquery.user.msg.php", { doing:"write_comment" , msg: msg , ownerid: ownerid },
        function(data){
          $("#msg_board").prepend(data);
          document.getElementById('write_text').value = "";
          
        });
    
    }
    
}

function nmsg_more_send( ownerid , nmsg_msg_id , msg_more_exist ){
    
    var msg     = document.getElementById('write_text'+nmsg_msg_id).value;
    
    if( msg == ''){
     
        alert("Nem írtál semmit!");
        
    }else{
    
    $.get("jquery/jquery.user.msg.php", { doing:"write_more_comment" , msg: msg , ownerid: ownerid , parent_msg_id:nmsg_msg_id },
        function(data){
        
          if(msg_more_exist == 1){
            $("#nmsg_more_exist_board"+nmsg_msg_id).append(data) ;
          }else{
            $("#nmsg_more_board"+nmsg_msg_id).append(data) ;
          }
          document.getElementById('write_text'+nmsg_msg_id).value = "";
          nmsg_expand();
          
        });
    
    }
    
}

function nmsg_expand( id ){
    
    var nmsg_number = document.getElementById("nmsg_number").value;
    
    for(i=0 ; i<nmsg_number ; i++){
        document.getElementById("nmsg_more"+i).style.display = 'none';
    }
    
    if(id!=''){
        document.getElementById("nmsg_more"+id).style.display = 'block';
    }
    
}

function not_logged(){
    
    $.get("jquery/templates/user.login.html", "",
        function(data){
          $("#nmsg_login").html(data) ;
        });
    
}

function nmsg_del( nmsg_id  , nmsg_parent ){
    
    n_msg_id = nmsg_id;
    n_msg_parent = nmsg_parent
    
    $("#dialog1").dialog('open');
		$("#dialog1").dialog({
			bgiframe: true,
			resizable: false,
			modal: true,
			buttons: {
            'Mégse': function() {
               $(this).dialog('close');
            },
            'Igen': function() {
               
                $.get('jquery/jquery.user.msg.php', { doing:"nmsg_del" , nmsg_id:n_msg_id  } ,
                  function(data){
                    
                        if(data == 'ok'){
                            
                            if(n_msg_parent == 1){
                                document.getElementById("n_msg_more"+n_msg_id).style.display='none';
                            }else{
                                document.getElementById("n_msg_"+n_msg_id).style.display='none';
                            }
                            
                        }else{
                            alert('Nem sikerült törölni!');
                        }
                   
                  });
                  
                  
               
               $(this).dialog('close');
            }
            
         }
		});

}

function jquery_show_page( lap ){    

    $.get("jquery/jquery.nailart.page.php", {page:lap } ,
        function(data){
            
          $("#nailart_content_page").html(data);
          $("#content1").slideDown("slow");

        });
    
}

function rightbox(mit){    
    
    if(mit == "be"){
        $('#rightbox').fadeIn();
    }
    
    if(mit == "ki"){
        $('#rightbox').fadeOut();
    }
    
}

