


function nmsg_send(where){    
    
    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 , where: where},
        function(data){
          $("#msg_board").prepend(data);
          document.getElementById('write_text').value = "";
          
        });
    
    }
    
}

function nmsg_more_send( ownerid , nmsg_msg_id , msg_more_exist , where ){
    
    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 , where:where },
        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 basket_nailart_update( ){    

	if(document.getElementById('nailart_disc').checked == true){
		
		$("#basketbox").hide("slow" , function () {
			$("#basketbox_updated").hide("fast");	
			$.get("jquery/jquery.basket.nailart.update.php", {page:"done"} ,
			function(data){
				$("#basketbox_updated").html(data);
				$("#basketbox_updated").show("slow");	

			});
		})
		
	}else{
		
		$("#basketbox_updated").hide("slow" , function () {
			$("#basketbox_updated").html("");
			
			$("#basketbox").show("slow");
			document.getElementById('nailart_disc').checked = false;
		})
		
	}
		
}

function addOktatasCity(){

	$("#oktatas_varos").hide("slow" , function () {
			$("#add_varos_link").remove()
			$("#new_varos").show("slow");
	})

}

function addOktatasCat(){

	$("#oktatas_cat").hide("slow" , function () {
			$("#add_cat_link").remove()
			$("#new_oktatas_cat").show("slow");
	})

}

function addOktatasSzint(){

	$("#oktatas_szint").hide("slow" , function () {
			$("#add_szint_link").remove()
			$("#new_oktatas_szint").show("slow");
	})

}


function jquery_showBox(mit){

	$("#"+mit).show("slow");
}