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

function article_move_callback(content) {
	var i = content.indexOf(":");
	if (i > 0) {
		var o = document.getElementById("move_article_" + content.substr(0, i));
		if (o != null) o.innerHTML = content.substr(i + 1);
	  }
  }

function print_article(url) {
	window.open(url, "_blank", "directories=no,fullscreen=no,location=no,menubar=no,scrollbars=yes,resizable=yes", false);
  }

function onContentSearch() {
	var o = document.getElementById("contentsearch");
	if (o == null) return false;
	loadcontent(root + "content/direct.php?&call=content/article/article|contentsearch&langid=" + langid + "&contentsearch=" + o.value, callbackContentSearch);
  }

function callbackContentSearch(content) {
	var o = document.getElementById("contentsearchresponse");
	if (o != null) o.innerHTML = content;
  }

function popupArticle(articleid) {
	last_mbindex++;
	disable_comments_candies();
	loadcontent(root + "content/direct.php?&call=content/article/article|getarticle&langid=" + langid + "&articleid=" + articleid + "&mbindex=" + last_mbindex, overlay_callback);
	// We do not want to popup older versions. But if it becomes necessary then add "&versionid=" field to the query.
  }

function content_history(contentid) {
	last_mbindex++;
	disable_comments_candies();
	loadcontent(root + "content/direct.php?&call=content/article/article|getarticlehistory&langid=" + langid + "&contentid=" + contentid + "&mbindex=" + last_mbindex, overlay_callback);
  }
