
function url(u,a,t)
{
	var title='';
	if (t.length > 0)
		title='title="'+t+'" '
	document.write('<a '+title+'href="'+u+'">'+a+'</a>');
}

function addplus(id)
{
	$.ajax({
	    url: '/story-addplus/id,' + id.toString() + ',curr,' + $('#points_val_' + id.toString()).text(),
	    type: 'GET',
	    dataType: 'html',
	    error: function() {
	        alert('Wystąpił błąd. Spróbuj ponownie.');
	    },
	    success: function(html) {
	        $('#points_' + id.toString()).html(html);
	    }
	});
}
function addminus(id)
{
	$.ajax({
	    url: '/story-addminus/id,' + id.toString() + ',curr,' + $('#points_val_' + id.toString()).text(),
	    type: 'GET',
	    dataType: 'html',
	    error: function() {
	        alert('Wystąpił błąd. Spróbuj ponownie.');
	    },
	    success: function(html) {
	        $('#points_' + id.toString()).html(html);
	    }
	});
}
function addfav(id)
{
	$.ajax({
	    url: '/story-addfav/id,' + id.toString() + ',curr,' + $('#points_val_' + id.toString()).text(),
	    type: 'GET',
	    dataType: 'html',
	    error: function() {
	        alert('Wystąpił błąd. Spróbuj ponownie.');
	    },
	    success: function(html) {
	    	$('#favadd_' + id.toString()).css('display', 'none');
	    	$('#favrem_' + id.toString()).css('display', 'inline');
	    }
	});
}
function removefav(id)
{
	$.ajax({
	    url: '/story-removefav/id,' + id.toString() + ',curr,' + $('#points_val_' + id.toString()).text(),
	    type: 'GET',
	    dataType: 'html',
	    error: function() {
	        alert('Wystąpił błąd. Spróbuj ponownie.');
	    },
	    success: function(html) {
	    	$('#favadd_' + id.toString()).css('display', 'inline');
	    	$('#favrem_' + id.toString()).css('display', 'none');
	    }
	});
}

function commentplus(st,id)
{
	$.ajax({
	    url: '/story-commentplus/story,' + st.toString() + ',id,' + id.toString() + ',curr,' + $('#comments_val_' + id.toString()).text(),
	    type: 'GET',
	    dataType: 'html',
	    error: function() {
	        alert('Wystąpił błąd. Spróbuj ponownie.');
	    },
	    success: function(html) {
	        $('#comments_' + id.toString()).html(html);
	    }
	});
}
function commentminus(st,id)
{
	$.ajax({
	    url: '/story-commentminus/story,' + st.toString() + ',id,' + id.toString() + ',curr,' + $('#comments_val_' + id.toString()).text(),
	    type: 'GET',
	    dataType: 'html',
	    error: function() {
	        alert('Wystąpił błąd. Spróbuj ponownie.');
	    },
	    success: function(html) {
	        $('#comments_' + id.toString()).html(html);
	    }
	});
}

function addfriend(login)
{
	$.ajax({
	    url: '/profile-addfriend/user,' + login,
	    type: 'GET',
	    dataType: 'html',
	    error: function() {
	        alert('Wystąpił błąd. Spróbuj ponownie.');
	    },
	    success: function(html) {
	        $('#friendstatus').html(html);
	    }
	});
}
function removefriend(login)
{
	$.ajax({
	    url: '/profile-removefriend/user,' + login,
	    type: 'GET',
	    dataType: 'html',
	    error: function() {
	        alert('Wystąpił błąd. Spróbuj ponownie.');
	    },
	    success: function(html) {
	        $('#friendstatus').html(html);
	    }
	});
}
