/*** By FINSA: modified for enhancing control ***/
function setPostColumns(){

  if (!document.getElementById 
  || !document.getElementById("divSizerImg") 
	|| typeof document.getElementById("divSizerImg").innerHTML == "undefined"
  )
  {
    	var colHeight = 375;
  }
  else
  {
    	var colHeight = 155;
  }

	var colWidth = 220;
	var colSpace = 15;
	var vSplit = "";

  try
  {	
  	var vText = document.getElementById("Entry-divPost2Split");
  	
  	var vColumns = Columns.splitText(vText.innerHTML, colWidth, colHeight);
  	
  	//var top = document.getElementById("AuthAndTime-first").offsetHeight+(document.getElementById("Img_Post-first")?(document.getElementById("Img_Post-first").offsetHeight):0)+document.getElementById("PostTitle-first").offsetHeight+30;
  	if(document.getElementById("divSizerImg") != null)
  	{
      var top = -(document.getElementById("divSizerImg").offsetHeight);
    }
  	else
    {
      var top = -(document.getElementById("divSizer").offsetHeight);
  	}
  	
    for (var i = 0; i < vColumns.length; i ++){
  	  if(i==0)
  		vSplit += '<div class="multipleCols" id="divColumn' + i + '" style="position: relative; top:'+top+'px; left: 0px; width: ' + colWidth + 'px; height: ' + colHeight + 'px; text-align:justify">'
  		else
  		vSplit += '<div class="multipleCols" id="divColumn' + i + '" style="position: relative; top:'+top+'px; left: 20px; width: ' + colWidth + 'px; height: ' + colHeight + 'px; text-align:justify">'
      vSplit += vColumns[i];
  		vSplit += '</div>';
	}

	vText.innerHTML = vSplit;
	vText.style.visibility = 'visible';
	}
	catch(e)
	{
    //alert(e);
  }
}

/* BY FINSA:  Manage the Active authors' list, collapsing or not*/
/* Close authors' list on page loading */
function closeAuthorsList()
{
  var auth = document.getElementById('AuthorsList');
  var li = auth.childNodes;
  var MAX_VISIBLE_AUTHORS = 4;
  
  var present_authors = 0;
  
  for(i=0;i<li.length;i++)
  {
    if( li.item(i) == '[object HTMLLIElement]' )
    {
      present_authors = present_authors +1;
      
      if(present_authors > MAX_VISIBLE_AUTHORS)
      {
        var el = li.item(i);
        var more = document.getElementById('More');

        el.style.display = "none";
        more.innerHTML= "View more authors";
      
      }
    }
  }
}

/* Called by clicking on "View more/less authors" in active-authors-list.php */
function showMoreAuthors()
{
  var auth = document.getElementById('AuthorsList');
  var li = auth.childNodes;
  var MAX_VISIBLE_AUTHORS = 4;
  
  var present_authors = 0;
  
  for(i=0;i<li.length;i++)
  {
    if( li.item(i) == '[object HTMLLIElement]' )
    {
      present_authors = present_authors +1;
      
      if(present_authors > MAX_VISIBLE_AUTHORS)
      {
        var el = li.item(i);
        var more = document.getElementById('More');
        
          if(el.style.display == "none")
          {
            el.style.display = "block";
            more.innerHTML= "View less authors";
          }
          else
          { 
            el.style.display = "none";
            more.innerHTML= "View more authors";
          }
              
      }
    }
  }
}




