var back_target=0;

function jm_pop_up (url, name) {
	var jm_window=window.open (url, name, "menubar=no,status=no,scrollbars=auto,resizable=yes,width=400,height=450,toolbar=no,location=no,directories=no");
	jm_window.focus ();
	return false;
}

var form_is_dirty=0;
var dirty_form;
var return_sct='';

function submit_form(the_button) {
	the_form=the_button.form;
	the_form.submit_action.value=the_button.value;
	if (back_target==1) {
		the_form.target=window.opener.name;
	}
	if (the_form.dirty_suppress) {
		the_form.dirty_suppress.value=0;
	}
}

function disable_submits() {
	if (document.forms) {
		for (i=0; i < document.forms.length; i++) {
			the_form=document.forms[i];
			if (the_form) {
				for (j=0; j < the_form.elements.length; j++) {
					the_element=the_form.elements[j];
					if (the_element.type=='submit') {
						the_element.disabled=true;
					}
				}
			}
		}
	}
}

function make_dirty(the_form) {
	form_is_dirty=1;
	dirty_form=the_form;
}

function check_dirty_form(this_dis) {
	if ((form_is_dirty==1) && (confirm('Save the changes you made on this form?\n\nClick "OK" to save and continue.\n\nClick "Cancel" to continue without saving.'))) {
		if (dirty_form) {
			if (return_sct!='') {
				the_input=dirty_form.return_sct;
				the_input.value=return_sct;
			}
			if (dirty_form.dirty_suppress) {
				dirty_form.dirty_suppress.value=0;
			}
			dirty_form.submit();
		}
		return false;
	} else {
		if (this_dis==0) {
			return true;
		} else {
			return false;
		}
	}
}

function jm_a_click(this_dis) {
	if (this_dis==0) {
		return true;
	} else {
		return false;
	}
}

function jm_confirm(str) {
	if (dis==0) {
		return confirm(str);
	} else {
		return false;
	}
}

function set_return_sct(sct) {
	return_sct=sct;
}
