function del_comment_topic(id){
    if(confirm('Sigurno?')){
        $.ajax({
            type: "GET",
            url: "/comment/topic/delete/"+id,
            success: function(){
                $('#topic_comment_'+id).hide('slow');
            },
            error: function(){
                alert('fail');
            }
        });     
    }
}


function stick_topic_toggle(id){
    if(confirm('Sigurno?')){
        $.ajax({
            type: "GET",
            url: "/topic/stick-toggle/"+id,
            success: function(){
            	history.go(0);
            },
            error: function(){
                alert('fail');
            }
        });     
    }
}


function lock_topic_toggle(id){
    if(confirm('Sigurno?')){
        $.ajax({
            type: "GET",
            url: "/topic/lock-toggle/"+id,
            success: function(){
            	history.go(0);
            },
            error: function(){
                alert('fail');
            }
        });     
    }
}


function delete_topic(id){
    if(confirm('Sigurno?')){
    	document.location = "/topic/delete/"+id;    
    }
}


function rent_server(id,name) {
	$('#rent_form').hide();
	$("#rent_id").val(id);
	$("#server_name").val(name);
	$("#rent_form").fadeIn('slow');
}


function select_text(id){
	document.getElementById(id).focus();
	document.getElementById(id).select();
}
