/*
 * Read from SVN revision 45597 on Wed May 19, 2010 at 03:18 PM by r.clein.
 */
function formPost(path, hash) {
	f = new Element('form', { method: 'post', action: path });
	for(o in hash) {
		i = new Element('input', { type: 'hidden', name: o, value: hash[o] });
		f.insert({ bottom: i });
	}
	$$('body')[0].insert({ bottom: f });
	f.submit();
}

/* Add fields to an existing form and post it. */
function postFormWith(form, hash) {
	f = $(form);
	for(o in hash) {
		i = new Element('input', { type: 'hidden', name: o, value: hash[o] });
		f.insert({ bottom: i });
	}
	f.submit();
}

function regenerateLiveURLLayout(site, board, layout, section) {
	if(confirm('Are you sure you would like to regenerate your live URL layout? Doing so will immediately retrieve the latest header and footer and make them live and visible to your users.'))
		formPost('/p/account/boards/board.cfm?site_id=' + site + '&id=' + board, { layoutregenerate_id: layout, layoutregenerate_section: section });
}
