// Applies a border to the block and makes the edit link visible. 
function overEdit(element_id) {
	Element.classNames(element_id).add('over_edit');
}

function outEdit(element_id) {
	Element.classNames(element_id).remove('over_edit');
}

// Makes the links for adding new products and related materials visible
function overProducts() {
	Element.classNames('products').add('over_items');
}

function outProducts() {
	Element.classNames('products').remove('over_items');
}
function overRelatedMaterial() {
	Element.classNames('materials').add('over_items');
}

function outRelatedMaterial() {
	Element.classNames('materials').remove('over_items');
}

function toggleNewProductForm(){
	$('new_product').toggle();
	hideForms('new_product');
	showDisplays();
	if ($('new_product_header')) {
		$('new_product_header').scrollTo();
	}
}

function togglePayByCheckAddress(){
	hideForms('blah','blah');
	$('pay_by_check').toggle();
	$('pay_by_check').scrollTo();
}

function toggleNewRelatedMaterialForm(){
	$('new_related_material').toggle();
	hideForms('new_related_material');
	showDisplays();
	if ($('new_related_material_header')) {
		$('new_related_material_header').scrollTo();
	}
}

// If an innovation isn't published, this function lets the user see
// the hidden areas. 
function toggleHiddenEditAreas() {
	$('unpublished_info').toggle();
	$('published_info').toggle();
}

// Disables the specified input button and submits the form
function disableButtonAndSubmit(button_id) {
	$(button_id).disabled = true;
	changedForm = null;
	return true;
}

var changedForm = null;

function changeFormCheck(form_id) {
	changedForm = form_id;
}