function updateVoting(e)
{
	getObject('voting').innerHTML = e.responseText;
}

function voteForVideo(video, value)
{
	sendPostRequest(BASE+'app/videos/ajax?do=vote','video='+video+'&value='+value, updateVoting);
}
function videocomment_ready(e)
{
	getObject('comments').innerHTML = e.responseText + getObject('comments').innerHTML;
}
function videoComment(id)
{
	text = getObject('text').value;
	text = text.replace(/\\015\\012|\\015|\\012/g,"");
	
	text = text.replace(/&/g,'|4|');
	var paras = 'text='+text;
	
	sendPostRequest(BASE+'app/videos/ajax?do=new_comment&videoid='+id, paras,  videocomment_ready);
}
function favouriteVideo(id)
{
	sendGetRequest(BASE+'app/videos/ajax?do=favourite&id='+id, function (e) {alert(e.responseText);});
}
function delete_ready(e)
{
	
	hideSlowly(e.responseText);
}
function deleteComment(id)
{
	if (confirm(lang['delete_really']))
	{
		sendPostRequest(BASE+'app/videos/ajax?do=delete_comment', 'id='+id, delete_ready);
	}
}
function deleteFavourite(id)
{
	sendGetRequest(BASE+'app/videos/ajax?do=delete_favourite&id='+id, function (e) {alert(e.responseText);});
}
function addVideo(id)
{
	sendGetRequest(BASE+'app/videos/ajax?do=add_video&id='+id, function (e) {alert(e.responseText);});
}
function removeVideo(id)
{
	sendGetRequest(BASE+'app/videos/ajax?do=remove_video&id='+id, function (e) {alert(e.responseText);});
}