// Список комментариев;
function comments(doc, id) {
	$('#comments_count').hide();
	$('#comments_load').show();
	$('#comments').show();
	$('#comments').load('/includes/php/comments.php', { 'doc': doc, 'id': id }, function() {
		$('#comments_load').hide();
	});
}

// Добавление комментариев;
function comments_send() {
	$('#comments_load').show();
	var string = $("#comments_form").serialize();
	$.post("/includes/php/comments.php", string, function(data) {
		$("#comments").html(data);
		$('#comments_load').hide();
	});
}

// Фотография;
function photo(id) {
	$('#background').show();
	//$('#photos_load').show();
	$('#photos').html('<div class="content" align="center"><img src="/templates/images/loading.gif"></div>');
	$('#photos').show();
	$('#photos').load('/includes/php/photos.php', { 'id': id }, function() {
		//$('#photos_load').hide();
	});
	// По центру;
	$('#photos').css("top",(document.documentElement.clientHeight/2)-275+"px");
	$('#photos').css("left",(document.documentElement.clientWidth/2)-300+"px");
}

// Голосование;
function poll(answer) {
	$('#poll_load').show();
	$('#polls').load('/includes/php/vote.php', { 'answer': answer }, function() {
		$('#poll_load').hide();
	});
}

// Календарь событий;
function events(date) {
	$('#events').hide();
	//$('#events_load').show();
	$('#events').load('/includes/php/events.php', { 'date': date }, function() {
		//$('#events_load').hide();
		$('#events').show();
	});
}

// Вход и регистрация;
function login() {
	$('#background').show();
	$('#login').show();
	//var string = $("#login_form").serialize();
	//$.post("/includes/php/login.php", string, function(data) {
		//$("#login").html(data);
	//});
	// По центру;
	$('#login').css("top",(document.documentElement.clientHeight/2)-200+"px");
	$('#login').css("left",(document.documentElement.clientWidth/2)-125+"px");
}

// ;
function blog_edit(id) {
	//$('#blog'+id).show();
	$('#blog'+id).load('/includes/php/blogs.php', { 'id': id }, function() {
		//$('#poll_load').hide();
	});
}

// ;
function blogEdit(id, title) {
	//$('#blog'+id).show();
	//alert(id);
	$('#img'+id).show();
	$('#div'+id).load('/includes/php/blogs.php', { 'id': id, 'title': title }, function() {
		//$('#poll_load').hide();
		$('#img'+id).hide();
	});
}

// ;
function blog_delete(id) {
	//$('#blog'+id).show();
	//alert(id);
	$('#div'+id).load('/includes/php/blogs.php', { 'delete_id': id }, function() {
		//$('#poll_load').hide();
	});
}

// Подключение скрипта;
//$.getScript('/templates/js/demo.js');