
// ----- WARNING ----- \\
// COPYRIGHTED CONTENT \\
//  COPYRIGHT © NERVA  \\
//   nerva@nerva.ee    \\
// All rights reserved \\
// ------------------- \\

var mbindex_editor = new Array();

function edit_content(contentid, arguments) {
  if (contentid != "") {
		var o = null;
		disable_comments_candies();
		if (mbindex_editor[contentid] > 0) {
			o = document.getElementById("mb_" + mbindex_editor[contentid]);
			if (o != null) {
				unhide(o);
				mb_bringtofront(o);
			  }
			}
		if (o == null) {
	    last_mbindex++;
			mbindex_editor[contentid] = last_mbindex;
	    loadcontent(root + "content/direct.php?&randomkey=" + Math.random() + "&call=content/editor|contenteditor&langid=" + langid + "&contentid=" + contentid + "&mbindex=" + last_mbindex + ((arguments != null) ? arguments : ""), overlay_callback);
			}
	  }
  }

function cancel_content_editor(contentid, mbindex) {
	delete mbindex_editor[contentid];
	hide(document.getElementById("mb_" + mbindex));
  }

function start_editor_click(mbindex, fieldname) {
	var e = document.getElementById("button_" + mbindex + "_" + fieldname);
	if (e != null) {
		hide(e);
	  var e = document.getElementById("editor_" + mbindex + "_" + fieldname);
		if (e != null) {
			unhide(e);
		  }
	  }
  }
