function addNote(tablename, parentid) {
var params = ("width=800,height=600,status,scrollbars=no,resizable=no");
var noteurl = ("/cgi-bin/notes.cgi?mode=edit");
noteurl += ("&id=");
noteurl += ("&tablename=" + tablename);
noteurl += ("&parentid=" + parentid);
var popupWindow = window.open(noteurl,'NoteWindow',params);
popupWindow.opener = this.window;
return(false);
}

function editNote(tablename, parentid, noteid) {
var params = ("width=800,height=600,status,scrollbars=no,resizable=no");
var noteurl = ("/cgi-bin/notes.cgi?mode=edit");
var backurl = (document.location.href);
if (backurl.indexOf('mode=') == -1) {
	backurl += ("?mode=edit\&id=" + parentid);
}
noteurl += ("&id=" + noteid);
noteurl += ("&tablename=" + tablename);
noteurl += ("&parentid=" + parentid);
noteurl += ("&backurl=" + escape(backurl));
//noteurl += ("&destination_url=" + escape(document.location.href));
//var popupWindow = window.open(noteurl,'NoteWindow',params);
//popupWindow.opener = this.window;
document.location.href = noteurl;
return(false);
}

