<!--
// JavaScript Document

/*
 ** @method: confirm_delete
 ** @description: A general method for confirming the deletion of things.
 */
function confirm_delete(objectType, objectName) {
	msg = "Are you sure you want to delete ";
	switch (objectType) {
		case "news":
			msg += "the news item '"+objectName+"' ?";
			break;

		case "video":
			msg += "the video '"+objectName+"' ?";
			break;

		case "picture":
			msg += "the picture '"+objectName+"' ?";
			break;

		case "news":
			msg += "the news item '"+objectName+"' ?";
			break;

		default:
			msg += "this item?";
			break;
	}
	return confirm(msg);
}

/*
 ** @method: trim
 ** @description: 
 */
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

/*
 ** @method: disable_publish
 ** @description: Disables publish button
 */
function disable_publish() {
	document.getElementById("publish_button").disabled = true;
}

/*
 ** @method: enable_publish
 ** @description: Enables publish button
 */
function enable_publish() {
	document.getElementById("publish_button").disabled = false;
}

/*
 ** @method: publish_check
 ** @description: Enable publish button if form requirements have been meet.
 */
function publish_check() {
	news_title = trim(document.getElementById("title").value);
	news_body = trim(document.getElementById("body").value);
	
	if (news_title.length > 0 && news_body.length > 0) {
		enable_publish();
	} else {
		disable_publish();
	}
}


-->
