function setSearchPosition(indexDocument)
{
   var parentHeight = document.getElementById("navigation").clientHeight;
   var menuHeight = document.getElementById("menu").scrollHeight;
   var height = document.getElementById("search").scrollHeight;
   var contentHeight = document.getElementById("content").scrollHeight;
   var targetHeight = contentHeight > parentHeight ? contentHeight : parentHeight;
   var right = document.getElementById("right");
   if (right != null)
   {
      var rightHeight = right.scrollHeight;
      if (rightHeight > targetHeight)
         targetHeight = rightHeight;
   }
   
   //alert("parentHeight: " + parentHeight);
   //alert("menuHeight: " + menuHeight);
   //alert("height: " + height);
   
   var margin = targetHeight - menuHeight - height;
   //if (indexDocument)
   {
      margin += (document.uniqueID != null ? -5 : -5);
      if (document.getElementById("unesco") == null)
      {
         document.getElementById("search").style.marginBottom = "" + (document.uniqueID != null ? -8 : 0) + "px";
      }
   }
   var indexContent = document.getElementById("indexcontent");
   if (indexContent != null)
   {
      var indexHeight = indexContent.scrollHeight;
      if (indexHeight < targetHeight)
      	indexContent.style.paddingBottom = targetHeight - indexHeight + 10 + "px";
   }
   var tCcontent = document.getElementById("tCcontent");
   if (tCcontent != null)
   {
      var tCcontentHeight = tCcontent.scrollHeight;
      if (tCcontentHeight < targetHeight)
      	tCcontent.style.paddingBottom = targetHeight - tCcontentHeight + 30 + "px";
   }
   /*
   else
   {
      margin += (document.uniqueID != null ? 4 : -4);
   }*/
   if (margin < 10)
      margin = 10;
   document.getElementById("search").style.marginTop = "" + margin + "px";
}

function setIndexDocumentSearchPosition()
{
   setSearchPosition(true);
}

