function kill_form(formname) {
	
	$("#"+formname+" input").prop('disabled', true);
	$("#"+formname+" textarea").prop('disabled', true);
	$("#"+formname+" select").prop('disabled', true);
	$("#"+formname+" input[type='submit']").attr("class", "submit_button_disabled");
	
	alert('Timed out - sorry!');
}

function form_timeout(formname, duration) {
	setTimeout("kill_form('"+formname+"')", duration);
}

function show_comment_form() {
	$("#user_comment_div iframe").show();
}

function setShow(command, target, suffix, hideNow) {
	
	var hideLink = $('<a id="showHideLink" href="#" />');
	hideLink.click(function() {
		showHide(hideLink.id, target, suffix);
		return false;
	});
	hideLink.html("Hide" + (suffix != '' ? ' ' + suffix : ''));
	$("#"+command).prepend(hideLink);
	if (hideNow)
		hideLink.hide();
}

function showHide(linkID, target, suffix) {
	$("#"+target).toggle();
	if ($("#"+target).is(":visible")) {
		$("#"+linkID).html("Hide" + (suffix != '' ? ' ' + suffix : ''));
	} else {
		$("#"+linkID).html("Show" + (suffix != '' ? ' ' + suffix : ''));
	}
}


