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: "language_id=" + $('#page_create_language').val() + "&page_type_id=" + $('#page_create_type').val() + "&active=" + active,
		success: function(msg)
		{
			$('#page_create_parent').html(msg);
			$('#page_create_indicator').css('display', 'none');
		}
	});
}
function changePhoto()
{
	if ($('#change_photo').css('display') == 'none') $('#change_photo').css('display', 'block');
	else $('#change_photo').css('display', 'none');
}
var menu_timeout = new Array();
function showSubmenu(id)
{
	clearTimeout(menu_timeout[id]);
	$('#submenu_' + id).show();
}
function hideSubmenu(id)
{
	clearTimeout(menu_timeout[id]);
	menu_timeout[id] = setTimeout("$('#submenu_" + id + "').hide(); clearTimeout(menu_timeout[" + id + "])", 1000);
}