/* CHECK FUNCTIONS */

function check_data_length(form_name, input_name, alert_desc)
{
	if(document.forms[form_name].elements[input_name].value.length == 0)
	{
		alert(alert_desc);
		return false;
	}
	else return true;
}


function check_data_length_id(input_name, alert_desc)
{
	if(document.getElementById(input_name).value.length == 0)
	{
		alert(alert_desc);
		return false;
	}
	else return true;
}


/* WINDOW FUNCTIONS */
var win1;

function open_window(link_url, w, h, window_name, conf)
{
	l = (screen.availWidth - w) / 2;
	t = (screen.availHeight - h) / 2;
	win1 = window.open(link_url, window_name, 'width=' + w + ', height=' + h + ', left=' + l + ', top=' + t + conf).focus();
	return win1;
}


/* DISPLAY FUNCTIONS */
function show_element(element_id)
{
	if(navigator.appName=='Netscape')
		d='table-row';
	else
		d='block';
	document.getElementById(element_id).style.display = d;
}

function hide_element(element_id)
{
	document.getElementById(element_id).style.display = 'none';
}

function display_action(element_id)
{
	if(document.getElementById(element_id).style.display == 'none')
		show_element(element_id);
	else	hide_element(element_id);
}

function change_image(element_id, img_new)
{
	document.getElementById(element_id).src = img_new;
}

function check_display_status(element_id)
{
	if(document.getElementById(element_id).style.display == 'none') return 0;
	else return 1;
}
