function postform( form, action )
{
	for( i = 2; i < arguments.length; i++ ) {
		pair = arguments[i].split( '=' );
		if( document.getElementById( pair[0] ) ) {
			document.getElementById( pair[0] ).value = pair[1];
		}
	}
	if( arguments[1] != '' ) {
		document.getElementById(form).action = arguments[1];
	}
	document.getElementById(form).submit();
}

function popdownfont( id_font, image, id )
{
	window.opener.document.getElementById( 'id_font_' + id ).value = id_font;
	window.opener.document.getElementById( 'id_image_' + id ).src = image;
	window.close();
	if( autoupdate == true ) {
		window.opener.document.getElementById( 'id_preview' ).submit();
	}
}

function popdownbgcolor( id_color, color_hex )
{
	window.opener.document.getElementById( 'id_color' ).value = id_color;
	window.opener.document.getElementById( 'color_hex' ).style.background = '#'+ color_hex;
	window.close();
	if( autoupdate == true ) {
		window.opener.document.getElementById( 'id_preview' ).submit();
	}
}

function popdowncolor( id_color, color_hex, id )
{
	window.opener.document.getElementById( 'id_color_' + id ).value = id_color;
	window.opener.document.getElementById( 'color_hex_' + id ).style.background = '#'+ color_hex;
	window.close();
	if( autoupdate == true ) {
		window.opener.document.getElementById( 'id_preview' ).submit();
	}
}
