// JavaScript Document


function add_tblcell( field_id )
{
	field_name = '#' + field_id;				$(field_name).show();
	
	field_name = '#' + field_id + '_txt';	$(field_name).attr('rowspan', 2);
	
	field_name = '#' + field_id + '_act';	$(field_name).hide();
}

function hide_tblcell( field_id , url_str )
{
	field_name = '#' + field_id + '_txt';	$(field_name).attr('rowspan', 1);
	toggle_form( field_id ); hide_notice( field_id );
	field_name = '#' + field_id;				$(field_name).hide();
	
	if ( url_str )		show_action( field_id , url_str );
}

function show_action( field_id , url_str )
{
	field_name = '#' + field_id + '_act';	
	html_msg = "<a href='javascript:void(0)' onClick=\"add_tblcell('" + field_id + "');toggle_form('" + field_id + "')\">" + url_str + "</a>";
	$(field_name).show().html(html_msg);
}

function show_notice( field_id , message , type )
{
	field_name = '#' + field_id + '_result';
	
	if ( ! $(field_name).hasClass('result') )		$(field_name).addClass('result');
	
	if ( type == 1 )	img_icon = 'error16';
	else						img_icon = 'bulb16';
	html_msg = "<img src='/images/icons/" + img_icon + ".gif' border='0' align='left' hspace='10'><p>" + message + "</p>";
	$(field_name).html(html_msg);
}

function show_notice1( field_id , message , type )
{
	field_name = '#' + field_id + '_result';
	
	if ( type == 1 )	img_icon = 'error16';
	else						img_icon = 'bulb16';
	html_msg = "<img src='/images/icons/" + img_icon + ".gif' border='0' align='left' hspace='10'><p><b>" + message + "</b></p>";
	$(field_name).html(html_msg);
}

function show_wait( field_id , message )
{
	field_name = '#' + field_id + '_result';
	html_msg = "<img src='/images/ajax.gif' hspace='10'>" + message + '...';
	$(field_name).html(html_msg);
	
	toggle_form( field_id );
}

function hide_notice( field_id )
{
	field_name = '#' + field_id + '_result';
	$(field_name).removeClass('result').html('');
}

function toggle_form( field_id )
{
	field_name = '#' + field_id + '_form';
	$(field_name).toggle();
}


function show_return_button( field_ident )
{
	field_name = '#' + field_ident + '_button';
	$(field_name).show();
}
