// JavaScript Document
function ApproveArticle(artid)
{
var conf = window.confirm("Are you sure, you want to approve this article?");
if(conf)
  {
    window.location.href='article_action.php?artid='+artid+"&action=approvearticle"; 
  }
}
function DenyArticle(artid,creater)
{
var conf = window.confirm("Are you sure, you want to deny this article?");
if(conf)
  {
   window.location.href='article_action.php?artid='+artid+"&action=denyarticle&creator="+creater; 
  }
}

function addEvent() {
  var ni = document.getElementById('myDiv');
  var numi = document.getElementById('theValue');
  var num =(document.getElementById("theValue").value-1)+ 2;
  if(num>6)
  {
  alert("Maximum six files can be added here.");
  }
  else
  {

	 var divwidth = (num-1)*40 ;
	 
	
	    document.getElementById("filediv").style.height	=8+divwidth+'px';
 	
  numi.value = num;
  var divIdName = "my"+num+"Div";
  var newdiv = document.createElement('div');
  newdiv.setAttribute("id",divIdName);
  newdiv.innerHTML = "<div class='clear'></div><div style='padding-bottom:5px;padding-top:8px;'  ><input type='file' name='AttachFile"+num+"' id='AttachFile"+num+"' size='20' class='textfield1'/></div><div class='clear' ></div>";
  //newdiv.innerHTML = "Element Number " + num + " has been added! <a href=\"javascript:;\" onclick=\"removeElement(\'"+divIdName+"\')\">Remove the element &quot;"+divIdName+"&quot;</a>";
  ni.appendChild(newdiv);
  }
}

function RateArticle(val,artId)
{
  if(val==1)
  {
   var conf = window.confirm("Are you sure to give a positive rating for this article?");
    if(conf)
	 {
	  window.location.href='article_action.php?action=rateArticle&artid='+artId+"&rate=1"; 
	 
	 }
 }
 else
 {
 var conf = window.confirm("Are you sure to give a negative rating for this article?");
  if(conf)
	 {
	  window.location.href='article_action.php?action=rateArticle&artid='+artId+"&rate=0"; 
	 
	 }
 
 }

}

