function fBrowser(field_name, url, type, win)
{
	var cmsURL = '/upload.php?type=' + type;
	if (type == 'image')
	{
		a_width = 590;
		a_height = 545;
	}
	else
	{
		a_width = 475;
		a_height = 375;
	}
	tinyMCE.activeEditor.windowManager.open({
		file: cmsURL,
		title: 'fBrowser',
		width: a_width,
		height: a_height,
		resizable: 'no',
		inline: 'yes',
		close_previous: 'no'
	}, {
		window: win,
		input: field_name
	});
	return false;
}
function changeParents(active)
{
	$('#page_create_indicator').css('display', 'inline');
	$.ajax({
		type: "POST",
		url: "/page/changeParents",
		data: "page_type_id=" + $('#page_create_type').val() + "&active=" + active,
		success: function(msg)
		{
			$('#page_create_parent').html(msg);
			$('#page_create_indicator').css('display', 'none');
		}
	});
}
function pollAddAnswer()
{
	var answers = $('#poll_create_answers').val();
	$('#poll_answers').append('<div style="padding-bottom: 5px"><input type="text" name="poll_answer' + answers + '" /></div>');
	answers++;
	$('#poll_create_answers').val(answers);
}
function reply(comment_id)
{
	$('#comment_create_parent').val(comment_id);
	$('#comment' + comment_id).after($('#comment_form'));
}
function changeBanner()
{
	if ($('#change_banner').css('display') == 'none') $('#change_banner').css('display', 'block');
	else $('#change_banner').css('display', 'none');
}