function confirmDelete(url) {
	if (confirm("Are you sure you want to delete this entry?")) {
		document.location = url;
	}
}

function confirmDeleteComment(url) {
	if (confirm("Are you sure you want to delete this comment and all of its replies?")) {
		document.location = url;
	}
}


function entryPreview(url, width, height) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=" + width + ",height=" + height + "');");
}

function populate_preview() {
	var title;
	var body;
	var more;
	var re = new RegExp ("\n", 'gi') ;

	if (title = opener.document.entry_form.title.value != "") {
		title = opener.document.entry_form.title.value;
		document.getElementById("title_div").innerHTML=title;
	}
	if (body = opener.document.entry_form.body.value != "") {
		body = opener.document.entry_form.body.value;
		body = body.replace(re, "\n<br />\n") ;
		document.getElementById("body_div").innerHTML=body;
	}
	if (more = opener.document.entry_form.more.value != "") {
		more = opener.document.entry_form.more.value;
		more = more.replace(re, "\n<br />\n") ;
		document.getElementById("more_div").innerHTML=more;
	}
}

